mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 21:38:44 +08:00
chore: sort imports
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { getTitle, getBoard } from '../support/app.po';
|
||||
import { getBoard, getTitle } from '../support/app.po';
|
||||
|
||||
describe('ligo-virgo', () => {
|
||||
beforeEach(() => cy.visit('/'));
|
||||
|
||||
@@ -3,10 +3,7 @@
|
||||
"version": "0.0.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@authing/react-ui-components": "^3.1.39",
|
||||
"@emotion/styled": "^11.9.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"authing-js-sdk": "^4.23.35"
|
||||
}
|
||||
"devDependencies": {}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import { Link } from 'react-router-dom';
|
||||
import style9 from 'style9';
|
||||
import { getAuth, signOut } from 'firebase/auth';
|
||||
|
||||
import { MuiBox as Box } from '@toeverything/components/ui';
|
||||
import { keyframes } from '@emotion/react';
|
||||
import { LOGOUT_LOCAL_STORAGE, LOGOUT_COOKIES } from '@toeverything/utils';
|
||||
import { MuiBox as Box } from '@toeverything/components/ui';
|
||||
|
||||
const styles = style9.create({
|
||||
container: {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export { Login } from './login';
|
||||
export { Error } from './error';
|
||||
export { PageLoading } from './loading';
|
||||
export { Login } from './login';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import style9 from 'style9';
|
||||
import { MuiCircularProgress as CircularProgress } from '@toeverything/components/ui';
|
||||
import style9 from 'style9';
|
||||
|
||||
const styles = style9.create({
|
||||
container: {
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
import { Guard as AuthingGuard } from '@authing/react-ui-components';
|
||||
import { MuiBox as Box } from '@toeverything/components/ui';
|
||||
import type { User as AuthingUser } from 'authing-js-sdk';
|
||||
import { useCallback, useEffect, useMemo } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import style9 from 'style9';
|
||||
|
||||
import { useUserAndSpaces } from '@toeverything/datasource/state';
|
||||
import { AUTHING_APP_HOST_US, AUTHING_APP_ID_US } from '@toeverything/utils';
|
||||
|
||||
import '@authing/react-ui-components/lib/index.min.css';
|
||||
|
||||
export function Authing() {
|
||||
const navigate = useNavigate();
|
||||
const { handleUserLoginSuccess, currentSpaceId } = useUserAndSpaces();
|
||||
|
||||
/**
|
||||
* Refer to Authing documentation https://docs.authing.cn/v2/reference/guard/react.html
|
||||
*/
|
||||
const handle_login_success = useCallback(
|
||||
async (authingUser: AuthingUser) => {
|
||||
handleUserLoginSuccess(authingUser);
|
||||
},
|
||||
[handleUserLoginSuccess]
|
||||
);
|
||||
|
||||
const authing_config = useMemo(() => {
|
||||
return {
|
||||
host: AUTHING_APP_HOST_US,
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (currentSpaceId) {
|
||||
const targetRoute = `/${currentSpaceId}`;
|
||||
navigate(targetRoute);
|
||||
}
|
||||
}, [currentSpaceId, navigate]);
|
||||
|
||||
return (
|
||||
<div className={styles('loginContainer')}>
|
||||
<Box
|
||||
sx={{
|
||||
'.g2-view-header': {
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
},
|
||||
'.authing-g2-render-module': {
|
||||
boxShadow: '0 2px 10px 0 rgb(57 106 255 / 20%)',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<AuthingGuard
|
||||
onLogin={handle_login_success}
|
||||
appId={AUTHING_APP_ID_US}
|
||||
config={authing_config}
|
||||
/>
|
||||
<Box sx={{ height: '56px' }} />
|
||||
</Box>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = style9.create({
|
||||
loginContainer: {
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
width: '100%',
|
||||
height: 'calc( 100vh - 64px )',
|
||||
},
|
||||
});
|
||||
@@ -1,15 +1,15 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Tldraw } from '@toeverything/components/board-draw';
|
||||
import { tools } from '@toeverything/components/board-tools';
|
||||
import { getSession } from '@toeverything/components/board-sessions';
|
||||
import * as commands from '@toeverything/components/board-commands';
|
||||
import { TldrawApp, deepCopy } from '@toeverything/components/board-state';
|
||||
import { TDShapeType } from '@toeverything/components/board-types';
|
||||
import { services } from '@toeverything/datasource/db-service';
|
||||
import { useShapes } from './hooks';
|
||||
import { RecastBlockProvider } from '@toeverything/components/editor-core';
|
||||
import { createEditor } from '@toeverything/components/affine-editor';
|
||||
import * as commands from '@toeverything/components/board-commands';
|
||||
import { Tldraw } from '@toeverything/components/board-draw';
|
||||
import { getSession } from '@toeverything/components/board-sessions';
|
||||
import { deepCopy, TldrawApp } from '@toeverything/components/board-state';
|
||||
import { tools } from '@toeverything/components/board-tools';
|
||||
import { TDShapeType } from '@toeverything/components/board-types';
|
||||
import { RecastBlockProvider } from '@toeverything/components/editor-core';
|
||||
import { services } from '@toeverything/datasource/db-service';
|
||||
import { AsyncBlock, BlockEditor } from '@toeverything/framework/virgo';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useShapes } from './hooks';
|
||||
|
||||
interface AffineBoardProps {
|
||||
workspace: string;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { services } from '@toeverything/datasource/db-service';
|
||||
import type { ReturnEditorBlock } from '@toeverything/datasource/db-service';
|
||||
import type { TDShape } from '@toeverything/components/board-types';
|
||||
import { Editor } from '@toeverything/components/board-shapes';
|
||||
import type { TDShape } from '@toeverything/components/board-types';
|
||||
import type { ReturnEditorBlock } from '@toeverything/datasource/db-service';
|
||||
import { services } from '@toeverything/datasource/db-service';
|
||||
import { usePageClientWidth } from '@toeverything/datasource/state';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
export const useShapes = (workspace: string, rootBlockId: string) => {
|
||||
const { pageClientWidth } = usePageClientWidth();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
|
||||
|
||||
import {
|
||||
RenderRoot,
|
||||
RenderBlock,
|
||||
RenderRoot,
|
||||
type BlockEditor,
|
||||
} from '@toeverything/components/editor-core';
|
||||
import { useCurrentEditors } from '@toeverything/datasource/state';
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
import { BlockEditor } from '@toeverything/framework/virgo';
|
||||
import {
|
||||
PageBlock,
|
||||
RefLinkBlock,
|
||||
TextBlock,
|
||||
BulletBlock,
|
||||
CalloutBlock,
|
||||
CodeBlock,
|
||||
DividerBlock,
|
||||
EmbedLinkBlock,
|
||||
FigmaBlock,
|
||||
// TocBlock,
|
||||
FileBlock,
|
||||
GridBlock,
|
||||
GridItemBlock,
|
||||
GroupBlock,
|
||||
GroupDividerBlock,
|
||||
Heading1Block,
|
||||
Heading2Block,
|
||||
Heading3Block,
|
||||
QuoteBlock,
|
||||
TodoBlock,
|
||||
CodeBlock,
|
||||
// TocBlock,
|
||||
FileBlock,
|
||||
ImageBlock,
|
||||
DividerBlock,
|
||||
CalloutBlock,
|
||||
YoutubeBlock,
|
||||
FigmaBlock,
|
||||
GroupBlock,
|
||||
EmbedLinkBlock,
|
||||
BulletBlock,
|
||||
NumberedBlock,
|
||||
GridBlock,
|
||||
GridItemBlock,
|
||||
GroupDividerBlock,
|
||||
PageBlock,
|
||||
QuoteBlock,
|
||||
RefLinkBlock,
|
||||
TextBlock,
|
||||
TodoBlock,
|
||||
YoutubeBlock,
|
||||
} from '@toeverything/components/editor-blocks';
|
||||
import { Protocol } from '@toeverything/datasource/db-service';
|
||||
import { plugins } from '@toeverything/components/editor-plugins';
|
||||
import { Protocol } from '@toeverything/datasource/db-service';
|
||||
import { BlockEditor } from '@toeverything/framework/virgo';
|
||||
|
||||
export const createEditor = (
|
||||
workspace: string,
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export { AffineEditor } from './Editor';
|
||||
export { createEditor } from './create-editor';
|
||||
export { AffineEditor } from './Editor';
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import { Utils } from '@tldraw/core';
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import {
|
||||
AlignType,
|
||||
TldrawCommand,
|
||||
TDShapeType,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
export function alignShapes(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { TldrawCommand } from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type { TldrawCommand } from '@toeverything/components/board-types';
|
||||
|
||||
export function changePage(app: TldrawApp, pageId: string): TldrawCommand {
|
||||
return {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type {
|
||||
TldrawCommand,
|
||||
TDPage,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { Utils, TLPageState } from '@tldraw/core';
|
||||
import { TLPageState, Utils } from '@tldraw/core';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type {
|
||||
TDPage,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
|
||||
export function createPage(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type {
|
||||
Patch,
|
||||
TDBinding,
|
||||
TDShape,
|
||||
TldrawCommand,
|
||||
TDBinding,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
export function createShapes(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { TldrawCommand } from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type { TldrawCommand } from '@toeverything/components/board-types';
|
||||
|
||||
export function deletePage(app: TldrawApp, pageId: string): TldrawCommand {
|
||||
const {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type {
|
||||
TDAsset,
|
||||
TDAssets,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { removeShapesFromPage } from './shared/remove-shapes-from-page';
|
||||
|
||||
const removeAssetsFromDocument = (assets: TDAssets, idsToRemove: string[]) => {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import { Utils } from '@tldraw/core';
|
||||
import Vec from '@tldraw/vec';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import {
|
||||
DistributeType,
|
||||
TDShape,
|
||||
TldrawCommand,
|
||||
TDShapeType,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import Vec from '@tldraw/vec';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
export function distributeShapes(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { TldrawCommand } from '@toeverything/components/board-types';
|
||||
import { Utils } from '@tldraw/core';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type { TldrawCommand } from '@toeverything/components/board-types';
|
||||
|
||||
export function duplicatePage(app: TldrawApp, pageId: string): TldrawCommand {
|
||||
const newId = Utils.uniqueId();
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import { Utils } from '@tldraw/core';
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type {
|
||||
PagePartial,
|
||||
TldrawCommand,
|
||||
TDShape,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
export function duplicateShapes(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { FlipType } from '@toeverything/components/board-types';
|
||||
import { TLBoundsCorner, Utils } from '@tldraw/core';
|
||||
import type { TldrawCommand } from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type { TldrawCommand } from '@toeverything/components/board-types';
|
||||
import { FlipType } from '@toeverything/components/board-types';
|
||||
|
||||
export function flipShapes(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { TDShape, TDShapeType } from '@toeverything/components/board-types';
|
||||
import { Utils } from '@tldraw/core';
|
||||
import type {
|
||||
Patch,
|
||||
TldrawCommand,
|
||||
TDBinding,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type {
|
||||
Patch,
|
||||
TDBinding,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { TDShape, TDShapeType } from '@toeverything/components/board-types';
|
||||
|
||||
export function groupShapes(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -10,10 +10,12 @@ export * from './duplicate-shapes';
|
||||
export * from './flip-shapes';
|
||||
export * from './group-shapes';
|
||||
export * from './move-shapes-to-page';
|
||||
export * from './reorder-shapes';
|
||||
export * from './rename-page';
|
||||
export * from './reorder-shapes';
|
||||
export * from './reset-bounds';
|
||||
export * from './rotate-shapes';
|
||||
export * from './set-shapes-lock-status';
|
||||
export * from './set-shapes-props';
|
||||
export * from './stretch-shapes';
|
||||
export * from './style-shapes';
|
||||
export * from './toggle-shapes-decoration';
|
||||
@@ -21,5 +23,3 @@ export * from './toggle-shapes-prop';
|
||||
export * from './translate-shapes';
|
||||
export * from './ungroup-shapes';
|
||||
export * from './update-shapes';
|
||||
export * from './set-shapes-props';
|
||||
export * from './set-shapes-lock-status';
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import { TLBounds, Utils } from '@tldraw/core';
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type {
|
||||
ArrowShape,
|
||||
PagePartial,
|
||||
TldrawCommand,
|
||||
TDShape,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import { Utils, TLBounds } from '@tldraw/core';
|
||||
import { Vec } from '@tldraw/vec';
|
||||
|
||||
export function moveShapesToPage(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { TldrawCommand } from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type { TldrawCommand } from '@toeverything/components/board-types';
|
||||
|
||||
export function renamePage(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import {
|
||||
MoveType,
|
||||
TDShape,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
export function reorderShapes(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { TldrawCommand } from '@toeverything/components/board-types';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type { TldrawCommand } from '@toeverything/components/board-types';
|
||||
|
||||
export function resetBounds(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Utils } from '@tldraw/core';
|
||||
import type {
|
||||
TldrawCommand,
|
||||
TDShape,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type {
|
||||
TDShape,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
|
||||
const PI2 = Math.PI * 2;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type {
|
||||
TDShape,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
export function setShapesLockStatus<T extends TDShape>(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type {
|
||||
TDShape,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
export function setShapesProps<T extends TDShape>(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import { TLBoundsCorner, Utils } from '@tldraw/core';
|
||||
import { StretchType, TDShapeType } from '@toeverything/components/board-types';
|
||||
import type { TldrawCommand } from '@toeverything/components/board-types';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type { TldrawCommand } from '@toeverything/components/board-types';
|
||||
import { StretchType, TDShapeType } from '@toeverything/components/board-types';
|
||||
|
||||
export function stretchShapes(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import {
|
||||
Patch,
|
||||
ShapeStyles,
|
||||
TldrawCommand,
|
||||
TDShape,
|
||||
// TDShapeType,
|
||||
// TextShape
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
export function styleShapes(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Decoration } from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type {
|
||||
Patch,
|
||||
ArrowShape,
|
||||
Patch,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { Decoration } from '@toeverything/components/board-types';
|
||||
|
||||
export function toggleShapesDecoration(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type {
|
||||
TDShape,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
export function toggleShapesProp(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type {
|
||||
TldrawCommand,
|
||||
PagePartial,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
export function translateShapes(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type {
|
||||
Patch,
|
||||
GroupShape,
|
||||
Patch,
|
||||
TDBinding,
|
||||
TDShape,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
export function ungroupShapes(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type {
|
||||
TldrawCommand,
|
||||
TDShape,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type {
|
||||
TDShape,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
|
||||
export function updateShapes(
|
||||
app: TldrawApp,
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
/* eslint-disable max-lines */
|
||||
import { Renderer } from '@tldraw/core';
|
||||
import { shapeUtils } from '@toeverything/components/board-shapes';
|
||||
import {
|
||||
TLDR,
|
||||
TldrawApp,
|
||||
TldrawAppCtorProps,
|
||||
} from '@toeverything/components/board-state';
|
||||
import {
|
||||
GRID_SIZE,
|
||||
TDDocument,
|
||||
TDMeta,
|
||||
TDStatus,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import {
|
||||
memo,
|
||||
useEffect,
|
||||
useLayoutEffect,
|
||||
useRef,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
type RefObject,
|
||||
} from 'react';
|
||||
import { Renderer } from '@tldraw/core';
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import {
|
||||
TDDocument,
|
||||
TDStatus,
|
||||
GRID_SIZE,
|
||||
TDMeta,
|
||||
} from '@toeverything/components/board-types';
|
||||
import {
|
||||
TldrawApp,
|
||||
TldrawAppCtorProps,
|
||||
TLDR,
|
||||
} from '@toeverything/components/board-state';
|
||||
import { ToolsPanel } from './components/tools-panel';
|
||||
import {
|
||||
TldrawContext,
|
||||
useStylesheet,
|
||||
useKeyboardShortcuts,
|
||||
useStylesheet,
|
||||
useTldrawApp,
|
||||
} from './hooks';
|
||||
import { shapeUtils } from '@toeverything/components/board-shapes';
|
||||
import { ToolsPanel } from './components/tools-panel';
|
||||
// import { TopPanel } from '~components/TopPanel';
|
||||
import { ContextMenu } from './components/context-menu';
|
||||
// import { FocusButton } from '~components/FocusButton';
|
||||
import { Loading } from './components/loading';
|
||||
import { ErrorBoundary } from 'react-error-boundary';
|
||||
import { ErrorFallback } from './components/error-fallback';
|
||||
import { ZoomBar } from './components/zoom-bar';
|
||||
import { CommandPanel } from './components/command-panel';
|
||||
import { usePageClientWidth } from '@toeverything/datasource/state';
|
||||
import { ErrorBoundary } from 'react-error-boundary';
|
||||
import { CommandPanel } from './components/command-panel';
|
||||
import { ErrorFallback } from './components/error-fallback';
|
||||
import { Loading } from './components/loading';
|
||||
import { ZoomBar } from './components/zoom-bar';
|
||||
|
||||
export interface TldrawProps extends TldrawAppCtorProps {
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type { TDShape } from '@toeverything/components/board-types';
|
||||
import { Popover, Tooltip, IconButton } from '@toeverything/components/ui';
|
||||
import {
|
||||
BorderColorNoneIcon,
|
||||
BorderColorDuotoneIcon,
|
||||
BorderColorNoneIcon,
|
||||
} from '@toeverything/components/icons';
|
||||
import { IconButton, Popover, Tooltip } from '@toeverything/components/ui';
|
||||
import { countBy, maxBy } from '@toeverything/utils';
|
||||
import { getShapeIds } from './utils';
|
||||
import { Palette } from '../palette';
|
||||
import { getShapeIds } from './utils';
|
||||
|
||||
interface BorderColorConfigProps {
|
||||
app: TldrawApp;
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
import { TLDR, TldrawApp } from '@toeverything/components/board-state';
|
||||
import { Divider, Popover, styled } from '@toeverything/components/ui';
|
||||
import { Fragment } from 'react';
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import { TldrawApp, TLDR } from '@toeverything/components/board-state';
|
||||
import { Popover, styled, Divider } from '@toeverything/components/ui';
|
||||
import { getAnchor, useConfig } from './utils';
|
||||
import { BorderColorConfig } from './BorderColorConfig';
|
||||
import { DeleteShapes } from './DeleteOperation';
|
||||
import { FillColorConfig } from './FillColorConfig';
|
||||
import { FontSizeConfig } from './FontSizeConfig';
|
||||
import { StrokeLineStyleConfig } from './stroke-line-style-config';
|
||||
import { Group, UnGroup } from './GroupOperation';
|
||||
import { DeleteShapes } from './DeleteOperation';
|
||||
import { Lock, Unlock } from './LockOperation';
|
||||
import { FrameFillColorConfig } from './FrameFillColorConfig';
|
||||
import { Group, UnGroup } from './GroupOperation';
|
||||
import { Lock, Unlock } from './LockOperation';
|
||||
import { StrokeLineStyleConfig } from './stroke-line-style-config';
|
||||
import { getAnchor, useConfig } from './utils';
|
||||
|
||||
export const CommandPanel = ({ app }: { app: TldrawApp }) => {
|
||||
const state = app.useStore();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type { TDShape } from '@toeverything/components/board-types';
|
||||
import { IconButton, Tooltip } from '@toeverything/components/ui';
|
||||
import { DeleteCashBinIcon } from '@toeverything/components/icons';
|
||||
import { IconButton, Tooltip } from '@toeverything/components/ui';
|
||||
import { getShapeIds } from './utils';
|
||||
|
||||
interface DeleteShapesProps {
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type { TDShape } from '@toeverything/components/board-types';
|
||||
import {
|
||||
ShapeColorDuotoneIcon,
|
||||
ShapeColorNoneIcon,
|
||||
} from '@toeverything/components/icons';
|
||||
import {
|
||||
IconButton,
|
||||
Popover,
|
||||
Tooltip,
|
||||
IconButton,
|
||||
useTheme,
|
||||
} from '@toeverything/components/ui';
|
||||
import {
|
||||
ShapeColorNoneIcon,
|
||||
ShapeColorDuotoneIcon,
|
||||
} from '@toeverything/components/icons';
|
||||
import { countBy, maxBy } from '@toeverything/utils';
|
||||
import { getShapeIds } from './utils';
|
||||
import { Palette } from '../palette';
|
||||
import { getShapeIds } from './utils';
|
||||
|
||||
interface BorderColorConfigProps {
|
||||
app: TldrawApp;
|
||||
|
||||
@@ -2,17 +2,17 @@ import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type { TDShape } from '@toeverything/components/board-types';
|
||||
import { FontSizeStyle } from '@toeverything/components/board-types';
|
||||
import {
|
||||
Popover,
|
||||
Tooltip,
|
||||
IconButton,
|
||||
styled,
|
||||
} from '@toeverything/components/ui';
|
||||
import {
|
||||
TextFontIcon,
|
||||
HeadingOneIcon,
|
||||
HeadingTwoIcon,
|
||||
HeadingThreeIcon,
|
||||
HeadingTwoIcon,
|
||||
TextFontIcon,
|
||||
} from '@toeverything/components/icons';
|
||||
import {
|
||||
IconButton,
|
||||
Popover,
|
||||
styled,
|
||||
Tooltip,
|
||||
} from '@toeverything/components/ui';
|
||||
import { countBy, maxBy } from '@toeverything/utils';
|
||||
import { getShapeIds } from './utils';
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type { TDShape } from '@toeverything/components/board-types';
|
||||
import {
|
||||
ShapeColorDuotoneIcon,
|
||||
ShapeColorNoneIcon,
|
||||
} from '@toeverything/components/icons';
|
||||
import {
|
||||
IconButton,
|
||||
Popover,
|
||||
Tooltip,
|
||||
IconButton,
|
||||
useTheme,
|
||||
} from '@toeverything/components/ui';
|
||||
import {
|
||||
ShapeColorNoneIcon,
|
||||
ShapeColorDuotoneIcon,
|
||||
} from '@toeverything/components/icons';
|
||||
import { countBy, maxBy } from '@toeverything/utils';
|
||||
import { getShapeIds } from './utils';
|
||||
import { Palette } from '../palette';
|
||||
import { getShapeIds } from './utils';
|
||||
|
||||
interface BorderColorConfigProps {
|
||||
app: TldrawApp;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type { TDShape } from '@toeverything/components/board-types';
|
||||
import { IconButton, Tooltip } from '@toeverything/components/ui';
|
||||
import { GroupIcon, UngroupIcon } from '@toeverything/components/icons';
|
||||
import { IconButton, Tooltip } from '@toeverything/components/ui';
|
||||
import { getShapeIds } from './utils';
|
||||
|
||||
interface GroupAndUnGroupProps {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type { TDShape } from '@toeverything/components/board-types';
|
||||
import { IconButton, Tooltip } from '@toeverything/components/ui';
|
||||
import { LockIcon, UnlockIcon } from '@toeverything/components/icons';
|
||||
import { IconButton, Tooltip } from '@toeverything/components/ui';
|
||||
import { getShapeIds } from './utils';
|
||||
|
||||
interface GroupAndUnGroupProps {
|
||||
|
||||
+4
-4
@@ -1,15 +1,15 @@
|
||||
import { DashStyle, StrokeWidth } from '@toeverything/components/board-types';
|
||||
import {
|
||||
LineNoneIcon,
|
||||
DashLineIcon,
|
||||
SolidLineIcon,
|
||||
BrushIcon,
|
||||
DashLineIcon,
|
||||
LineNoneIcon,
|
||||
SolidLineIcon,
|
||||
} from '@toeverything/components/icons';
|
||||
import {
|
||||
IconButton,
|
||||
Slider,
|
||||
styled,
|
||||
Tooltip,
|
||||
Slider,
|
||||
} from '@toeverything/components/ui';
|
||||
|
||||
export const lineStyles = [
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { DashStyle, StrokeWidth } from '@toeverything/components/board-types';
|
||||
import type { TDShape } from '@toeverything/components/board-types';
|
||||
import { Popover, IconButton, Tooltip } from '@toeverything/components/ui';
|
||||
import { DashStyle, StrokeWidth } from '@toeverything/components/board-types';
|
||||
import { BrushIcon } from '@toeverything/components/icons';
|
||||
import { IconButton, Popover, Tooltip } from '@toeverything/components/ui';
|
||||
import { countBy, maxBy } from '@toeverything/utils';
|
||||
import { getShapeIds } from '../utils';
|
||||
import { LineStyle, lineStyles } from './LineStyle';
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export { getAnchor } from './get-anchor';
|
||||
export { useConfig, getShapeIds } from './use-config';
|
||||
export { getShapeIds, useConfig } from './use-config';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import type { TDShape } from '@toeverything/components/board-types';
|
||||
import { TDShapeType } from '@toeverything/components/board-types';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
|
||||
interface Config {
|
||||
type:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import { FallbackProps } from 'react-error-boundary';
|
||||
import { useTldrawApp } from '../../hooks';
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
|
||||
export function ErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
|
||||
const app = useTldrawApp();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import { useTldrawApp } from '../../hooks';
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import type { TDSnapshot } from '@toeverything/components/board-types';
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import { useTldrawApp } from '../../hooks';
|
||||
|
||||
const loadingSelector = (s: TDSnapshot) => s.appState.isLoading;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
import { styled, Tooltip } from '@toeverything/components/ui';
|
||||
import { ShapeColorNoneIcon } from '@toeverything/components/icons';
|
||||
import { styled, Tooltip } from '@toeverything/components/ui';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
interface ColorObject {
|
||||
name?: string;
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import {
|
||||
ConnectorIcon,
|
||||
ConectorLineIcon,
|
||||
ConectorArrowIcon,
|
||||
ConectorLineIcon,
|
||||
ConnectorIcon,
|
||||
} from '@toeverything/components/icons';
|
||||
import {
|
||||
Tooltip,
|
||||
Popover,
|
||||
IconButton,
|
||||
Popover,
|
||||
styled,
|
||||
Tooltip,
|
||||
} from '@toeverything/components/ui';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { TDSnapshot, TDShapeType } from '@toeverything/components/board-types';
|
||||
import { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TDShapeType, TDSnapshot } from '@toeverything/components/board-types';
|
||||
|
||||
export type ShapeTypes = TDShapeType.Line | TDShapeType.Arrow;
|
||||
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import {
|
||||
ShapeIcon,
|
||||
RectangleIcon,
|
||||
EllipseIcon,
|
||||
TriangleIcon,
|
||||
PolygonIcon,
|
||||
StarIcon,
|
||||
ArrowIcon,
|
||||
EllipseIcon,
|
||||
PolygonIcon,
|
||||
RectangleIcon,
|
||||
ShapeIcon,
|
||||
StarIcon,
|
||||
TriangleIcon,
|
||||
} from '@toeverything/components/icons';
|
||||
import {
|
||||
Tooltip,
|
||||
Popover,
|
||||
IconButton,
|
||||
Popover,
|
||||
styled,
|
||||
Tooltip,
|
||||
} from '@toeverything/components/ui';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { TDSnapshot, TDShapeType } from '@toeverything/components/board-types';
|
||||
import { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TDShapeType, TDSnapshot } from '@toeverything/components/board-types';
|
||||
|
||||
export type ShapeTypes =
|
||||
| TDShapeType.Rectangle
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
import style9 from 'style9';
|
||||
import {
|
||||
EraserIcon,
|
||||
EraserIconProps,
|
||||
FrameIcon,
|
||||
HandToolIcon,
|
||||
HandToolIconProps,
|
||||
SelectIcon,
|
||||
SelectIconProps,
|
||||
TextIcon,
|
||||
TextIconProps,
|
||||
} from '@toeverything/components/icons';
|
||||
import {
|
||||
IconButton,
|
||||
PopoverContainer,
|
||||
// MuiIconButton as IconButton,
|
||||
// MuiTooltip as Tooltip,
|
||||
Tooltip,
|
||||
PopoverContainer,
|
||||
IconButton,
|
||||
useTheme,
|
||||
} from '@toeverything/components/ui';
|
||||
import {
|
||||
FrameIcon,
|
||||
HandToolIcon,
|
||||
SelectIcon,
|
||||
TextIcon,
|
||||
EraserIcon,
|
||||
SelectIconProps,
|
||||
EraserIconProps,
|
||||
HandToolIconProps,
|
||||
TextIconProps,
|
||||
} from '@toeverything/components/icons';
|
||||
import style9 from 'style9';
|
||||
|
||||
import { TldrawApp } from '@toeverything/components/board-state';
|
||||
import {
|
||||
TDSnapshot,
|
||||
TDShapeType,
|
||||
TDSnapshot,
|
||||
TDToolType,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
import { ShapeTools } from './ShapeTools';
|
||||
import { PenTools } from './pen-tools';
|
||||
import { ComponentType } from 'react';
|
||||
import { LineTools } from './LineTools';
|
||||
import { ComponentType, Component } from 'react';
|
||||
import { PenTools } from './pen-tools';
|
||||
import { ShapeTools } from './ShapeTools';
|
||||
|
||||
const activeToolSelector = (s: TDSnapshot) => s.appState.activeTool;
|
||||
const toolLockedSelector = (s: TDSnapshot) => s.appState.isToolLocked;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { IconButton, styled, Tooltip } from '@toeverything/components/ui';
|
||||
import type { ReactNode } from 'react';
|
||||
import { Tooltip, styled, IconButton } from '@toeverything/components/ui';
|
||||
|
||||
interface PenProps {
|
||||
name: string;
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
import { ReactElement, type CSSProperties } from 'react';
|
||||
import style9 from 'style9';
|
||||
import {
|
||||
MuiDivider as Divider,
|
||||
Popover,
|
||||
Tooltip,
|
||||
IconButton,
|
||||
styled,
|
||||
} from '@toeverything/components/ui';
|
||||
import { TDShapeType, TDToolType } from '@toeverything/components/board-types';
|
||||
import { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TDShapeType, TDToolType } from '@toeverything/components/board-types';
|
||||
import {
|
||||
PencilDuotoneIcon,
|
||||
HighlighterDuotoneIcon,
|
||||
LaserPenDuotoneIcon,
|
||||
PencilDuotoneIcon,
|
||||
} from '@toeverything/components/icons';
|
||||
import {
|
||||
IconButton,
|
||||
MuiDivider as Divider,
|
||||
Popover,
|
||||
styled,
|
||||
Tooltip,
|
||||
} from '@toeverything/components/ui';
|
||||
import { ReactElement, type CSSProperties } from 'react';
|
||||
import { Palette } from '../../palette';
|
||||
import { Pen } from './Pen';
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import AddIcon from '@mui/icons-material/Add';
|
||||
import RemoveIcon from '@mui/icons-material/Remove';
|
||||
import UnfoldMoreIcon from '@mui/icons-material/UnfoldMore';
|
||||
import {
|
||||
MuiIconButton as IconButton,
|
||||
MuiButton as Button,
|
||||
MuiIconButton as IconButton,
|
||||
styled,
|
||||
} from '@toeverything/components/ui';
|
||||
import RemoveIcon from '@mui/icons-material/Remove';
|
||||
import AddIcon from '@mui/icons-material/Add';
|
||||
import UnfoldMoreIcon from '@mui/icons-material/UnfoldMore';
|
||||
|
||||
import { useTldrawApp } from '../../hooks';
|
||||
import { TDSnapshot } from '@toeverything/components/board-types';
|
||||
import { useTldrawApp } from '../../hooks';
|
||||
|
||||
import { MiniMap } from './mini-map';
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ import { TLDR } from '@toeverything/components/board-state';
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import { useTldrawApp } from '../../../hooks';
|
||||
|
||||
import { getViewportBound, processBound } from './bounds';
|
||||
import { SimplifiedShape } from './SimplifiedShape';
|
||||
import { Viewport } from './Viewport';
|
||||
import { processBound, getViewportBound } from './bounds';
|
||||
|
||||
const MINI_MAP_WIDTH = 150;
|
||||
const MINI_MAP_HEIGHT = 100;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { CSSProperties } from 'react';
|
||||
import type { TLBounds } from '@tldraw/core';
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import type { CSSProperties } from 'react';
|
||||
|
||||
interface SimplifiedShapeProps extends TLBounds {
|
||||
onClick?: () => void;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { CSSProperties, PointerEventHandler } from 'react';
|
||||
import { useState, useRef } from 'react';
|
||||
import type { TLBounds } from '@tldraw/core';
|
||||
import Vec from '@tldraw/vec';
|
||||
import { styled, alpha } from '@toeverything/components/ui';
|
||||
import { alpha, styled } from '@toeverything/components/ui';
|
||||
import type { CSSProperties, PointerEventHandler } from 'react';
|
||||
import { useRef, useState } from 'react';
|
||||
|
||||
interface ViewportProps extends TLBounds {
|
||||
onPan?: (delta: [number, number]) => void;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export * from './use-file-system-handlers';
|
||||
export * from './use-keyboard-shortcuts';
|
||||
export * from './use-tldraw-app';
|
||||
// export * from './useTheme';
|
||||
export * from './use-stylesheet';
|
||||
export * from './use-file-system-handlers';
|
||||
export * from './use-tldraw-app';
|
||||
// export * from './useFileSystem';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { AlignStyle, TDShapeType } from '@toeverything/components/board-types';
|
||||
import * as React from 'react';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { AlignStyle, TDShapeType } from '@toeverything/components/board-types';
|
||||
import { useTldrawApp } from './use-tldraw-app';
|
||||
import { useFileSystemHandlers } from './use-file-system-handlers';
|
||||
import { useTldrawApp } from './use-tldraw-app';
|
||||
|
||||
export function useKeyboardShortcuts(ref: React.RefObject<HTMLDivElement>) {
|
||||
const app = useTldrawApp();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import * as React from 'react';
|
||||
|
||||
export const TldrawContext = React.createContext<TldrawApp>({} as TldrawApp);
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export { Tldraw } from './TlDraw';
|
||||
export { useTldrawApp } from './hooks';
|
||||
export { Tldraw } from './TlDraw';
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import { Utils } from '@tldraw/core';
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import { shapeUtils } from '@toeverything/components/board-shapes';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { deepCopy, TLDR } from '@toeverything/components/board-state';
|
||||
import {
|
||||
ArrowBinding,
|
||||
ArrowShape,
|
||||
TDShape,
|
||||
TDBinding,
|
||||
TDStatus,
|
||||
SessionType,
|
||||
TDBinding,
|
||||
TDShape,
|
||||
TDShapeType,
|
||||
TldrawPatch,
|
||||
TDStatus,
|
||||
TldrawCommand,
|
||||
TldrawPatch,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import { TLDR, deepCopy } from '@toeverything/components/board-state';
|
||||
import { shapeUtils } from '@toeverything/components/board-shapes';
|
||||
import { BaseSession } from './base-session';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { Utils } from '@tldraw/core';
|
||||
|
||||
export class ArrowSession extends BaseSession {
|
||||
type = SessionType.Arrow;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { BaseSessionType } from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { BaseSessionType } from '@toeverything/components/board-types';
|
||||
|
||||
export abstract class BaseSession extends BaseSessionType {
|
||||
app: TldrawApp;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { TLBounds, Utils } from '@tldraw/core';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import {
|
||||
SessionType,
|
||||
TldrawPatch,
|
||||
TDStatus,
|
||||
TldrawCommand,
|
||||
TldrawPatch,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { BaseSession } from './base-session';
|
||||
|
||||
export class BrushSession extends BaseSession {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Utils } from '@tldraw/core';
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import {
|
||||
DrawShape,
|
||||
SessionType,
|
||||
TDStatus,
|
||||
TldrawPatch,
|
||||
TldrawCommand,
|
||||
DrawShape,
|
||||
TldrawPatch,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { BaseSession } from './base-session';
|
||||
|
||||
export class DrawSession extends BaseSession {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import {
|
||||
SessionType,
|
||||
TDStatus,
|
||||
TDShape,
|
||||
PagePartial,
|
||||
TDBinding,
|
||||
TldrawPatch,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import {
|
||||
PagePartial,
|
||||
SessionType,
|
||||
TDBinding,
|
||||
TDShape,
|
||||
TDStatus,
|
||||
TldrawCommand,
|
||||
TldrawPatch,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { BaseSession } from './base-session';
|
||||
|
||||
export class EraseSession extends BaseSession {
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import { TLPageState, TLBounds, Utils } from '@tldraw/core';
|
||||
import { TLBounds, TLPageState, Utils } from '@tldraw/core';
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import {
|
||||
Patch,
|
||||
SessionType,
|
||||
TDShape,
|
||||
TDStatus,
|
||||
SessionType,
|
||||
TDShapeType,
|
||||
TldrawPatch,
|
||||
TldrawCommand,
|
||||
TldrawPatch,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { BaseSession } from './base-session';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
export class GridSession extends BaseSession {
|
||||
type = SessionType.Grid;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import {
|
||||
SessionType,
|
||||
ShapesWithProp,
|
||||
TDStatus,
|
||||
TldrawCommand,
|
||||
TldrawPatch,
|
||||
TDStatus,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import { BaseSession } from './base-session';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
export class HandleSession extends BaseSession {
|
||||
type = SessionType.Handle;
|
||||
|
||||
@@ -2,14 +2,14 @@ import { ExceptFirst, SessionType } from '@toeverything/components/board-types';
|
||||
import { ArrowSession } from './arrow-session';
|
||||
import { BrushSession } from './brush-session';
|
||||
import { DrawSession } from './draw-session';
|
||||
import { EraseSession } from './erase-session';
|
||||
import { GridSession } from './grid-session';
|
||||
import { HandleSession } from './handle-session';
|
||||
import { LaserSession } from './laser-session';
|
||||
import { RotateSession } from './rotate-session';
|
||||
import { TransformSession } from './transform-session';
|
||||
import { TransformSingleSession } from './transform-single-session';
|
||||
import { TranslateSession } from './translate-session';
|
||||
import { EraseSession } from './erase-session';
|
||||
import { GridSession } from './grid-session';
|
||||
import { LaserSession } from './laser-session';
|
||||
|
||||
export type TldrawSession =
|
||||
| ArrowSession
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import {
|
||||
SessionType,
|
||||
TDStatus,
|
||||
TldrawPatch,
|
||||
TldrawCommand,
|
||||
TldrawPatch,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { BaseSession } from './base-session';
|
||||
export class LaserSession extends BaseSession {
|
||||
type = SessionType.Draw;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { Utils } from '@tldraw/core';
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import {
|
||||
SessionType,
|
||||
TDShape,
|
||||
TDShapeType,
|
||||
TDStatus,
|
||||
TldrawCommand,
|
||||
TldrawPatch,
|
||||
TDShape,
|
||||
TDStatus,
|
||||
TDShapeType,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import { BaseSession } from './base-session';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
export class RotateSession extends BaseSession {
|
||||
type = SessionType.Rotate;
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import type { TLBoundsWithCenter, TLSnapLine } from '@tldraw/core';
|
||||
import { TLBounds, TLBoundsCorner, TLBoundsEdge, Utils } from '@tldraw/core';
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import type { TLSnapLine, TLBoundsWithCenter } from '@tldraw/core';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import {
|
||||
SessionType,
|
||||
TldrawCommand,
|
||||
TldrawPatch,
|
||||
TDShape,
|
||||
TDStatus,
|
||||
SLOW_SPEED,
|
||||
SNAP_DISTANCE,
|
||||
TDShape,
|
||||
TDStatus,
|
||||
TldrawCommand,
|
||||
TldrawPatch,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import { BaseSession } from './base-session';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
type SnapInfo =
|
||||
| {
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
import {
|
||||
TLBoundsCorner,
|
||||
TLSnapLine,
|
||||
TLBoundsEdge,
|
||||
Utils,
|
||||
TLBoundsWithCenter,
|
||||
TLBounds,
|
||||
TLBoundsCorner,
|
||||
TLBoundsEdge,
|
||||
TLBoundsWithCenter,
|
||||
TLSnapLine,
|
||||
Utils,
|
||||
} from '@tldraw/core';
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import {
|
||||
SessionType,
|
||||
TldrawCommand,
|
||||
TldrawPatch,
|
||||
TDShape,
|
||||
TDStatus,
|
||||
SLOW_SPEED,
|
||||
SNAP_DISTANCE,
|
||||
TDShape,
|
||||
TDStatus,
|
||||
TldrawCommand,
|
||||
TldrawPatch,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import { BaseSession } from './base-session';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
type SnapInfo =
|
||||
| {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import type { TLBounds } from '@tldraw/core';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import {
|
||||
ArrowShape,
|
||||
EllipseShape,
|
||||
RectangleShape,
|
||||
SessionType,
|
||||
TDStatus,
|
||||
TldrawCommand,
|
||||
TldrawPatch,
|
||||
TDStatus,
|
||||
RectangleShape,
|
||||
TriangleShape,
|
||||
EllipseShape,
|
||||
ArrowShape,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import { BaseSession } from './base-session';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import type { TLBounds } from '@tldraw/core';
|
||||
|
||||
export class TranslateLabelSession extends BaseSession {
|
||||
type = SessionType.Handle;
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import {
|
||||
TLPageState,
|
||||
Utils,
|
||||
TLBoundsWithCenter,
|
||||
TLSnapLine,
|
||||
TLBounds,
|
||||
TLBoundsWithCenter,
|
||||
TLPageState,
|
||||
TLSnapLine,
|
||||
Utils,
|
||||
} from '@tldraw/core';
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import {
|
||||
TDShape,
|
||||
TDBinding,
|
||||
TldrawCommand,
|
||||
TDStatus,
|
||||
ArrowShape,
|
||||
Patch,
|
||||
GroupShape,
|
||||
SessionType,
|
||||
ArrowBinding,
|
||||
TldrawPatch,
|
||||
TDShapeType,
|
||||
ArrowShape,
|
||||
GroupShape,
|
||||
Patch,
|
||||
SessionType,
|
||||
SLOW_SPEED,
|
||||
SNAP_DISTANCE,
|
||||
TDBinding,
|
||||
TDShape,
|
||||
TDShapeType,
|
||||
TDStatus,
|
||||
TldrawCommand,
|
||||
TldrawPatch,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { TLDR } from '@toeverything/components/board-state';
|
||||
import { BaseSession } from './base-session';
|
||||
import type { TldrawApp } from '@toeverything/components/board-state';
|
||||
|
||||
type CloneInfo =
|
||||
| {
|
||||
|
||||
@@ -8,21 +8,17 @@
|
||||
* 5. All Plugins should inherit from BasePlugin, in the form of objects
|
||||
* 6. Dependencies between plugins are not supported for the time being
|
||||
*/
|
||||
// import { CompleteInfoSelectOption } from '@authing/react-ui-components/components/CompleteInfo/interface';
|
||||
import type {
|
||||
BlockFlavors,
|
||||
BlockFlavorKeys,
|
||||
} from '@toeverything/datasource/db-service';
|
||||
import type { PatchNode } from '@toeverything/components/ui';
|
||||
import type { BlockFlavors } from '@toeverything/datasource/db-service';
|
||||
import type { IdList, SelectionInfo, SelectionManager } from './selection';
|
||||
|
||||
import { Point } from '@toeverything/utils';
|
||||
import { Observable } from 'rxjs';
|
||||
import type { AsyncBlock } from './block';
|
||||
import type { BlockHelper } from './block/block-helper';
|
||||
import type { BlockCommands } from './commands/block-commands';
|
||||
import type { DragDropManager } from './drag-drop';
|
||||
import { MouseManager } from './mouse';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Point } from '@toeverything/utils';
|
||||
import { ScrollManager } from './scroll';
|
||||
|
||||
// import { BrowserClipboard } from './clipboard/browser-clipboard';
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
"jotai": "^1.7.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"authing-js-sdk": "^4.23.35",
|
||||
"firebase": "^9.9.2"
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+19
-1063
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user