mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-07 04:20:11 +08:00
chore: sort imports
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import type { TDDocument, TDFile } from '@toeverything/components/board-types';
|
||||
import type { FileSystemHandle } from './browser-fs-access';
|
||||
import { get as getFromIdb, set as setToIdb } from 'idb-keyval';
|
||||
import {
|
||||
IMAGE_EXTENSIONS,
|
||||
VIDEO_EXTENSIONS,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { get as getFromIdb, set as setToIdb } from 'idb-keyval';
|
||||
import type { FileSystemHandle } from './browser-fs-access';
|
||||
|
||||
const options = { mode: 'readwrite' as const };
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export * from './migrate';
|
||||
export * from './filesystem';
|
||||
export * from './browser-fs-access';
|
||||
export * from './filesystem';
|
||||
export * from './migrate';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { TDDocument } from '~types';
|
||||
import { TldrawApp } from '~state';
|
||||
import oldDoc from '~test/documents/old-doc';
|
||||
import oldDoc2 from '~test/documents/old-doc-2';
|
||||
import type { TDDocument } from '~types';
|
||||
|
||||
describe('When migrating bindings', () => {
|
||||
it('migrates a document without a version', () => {
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import {
|
||||
Decoration,
|
||||
FontStyle,
|
||||
TDDocument,
|
||||
TDShapeType,
|
||||
// TextShape
|
||||
} from '@toeverything/components/board-types';
|
||||
|
||||
export function migrate(document: TDDocument, newVersion: number): TDDocument {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { get, set, del } from 'idb-keyval';
|
||||
import { del, get, set } from 'idb-keyval';
|
||||
|
||||
// Used for clipboard
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export { deepCopy } from './manager/deep-copy';
|
||||
export { TLDR } from './tldr';
|
||||
export { TldrawApp } from './tldraw-app';
|
||||
export type { TldrawAppCtorProps } from './tldraw-app';
|
||||
export { TLDR } from './tldr';
|
||||
export { deepCopy } from './manager/deep-copy';
|
||||
export { BaseTool, Status as BaseToolStatus } from './types/tool';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import createVanilla, { StoreApi } from 'zustand/vanilla';
|
||||
import create, { UseBoundStore } from 'zustand';
|
||||
import * as idb from 'idb-keyval';
|
||||
import { deepCopy } from './deep-copy';
|
||||
import type { Patch, Command } from '@toeverything/components/board-types';
|
||||
import { Utils } from '@tldraw/core';
|
||||
import type { Command, Patch } from '@toeverything/components/board-types';
|
||||
import * as idb from 'idb-keyval';
|
||||
import create, { UseBoundStore } from 'zustand';
|
||||
import createVanilla, { StoreApi } from 'zustand/vanilla';
|
||||
import { deepCopy } from './deep-copy';
|
||||
|
||||
export class StateManager<T extends Record<string, any>> {
|
||||
/**
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import { TLBounds, TLTransformInfo, Utils, TLPageState } from '@tldraw/core';
|
||||
import { TLBounds, TLPageState, TLTransformInfo, Utils } from '@tldraw/core';
|
||||
import {
|
||||
TDSnapshot,
|
||||
ShapesWithProp,
|
||||
TDShape,
|
||||
TDBinding,
|
||||
TDPage,
|
||||
TldrawCommand,
|
||||
TldrawPatch,
|
||||
TDShapeType,
|
||||
ArrowShape,
|
||||
TDHandle,
|
||||
TDExportType,
|
||||
BINDING_DISTANCE,
|
||||
} from '@toeverything/components/board-types';
|
||||
intersectRayBounds,
|
||||
intersectRayEllipse,
|
||||
intersectRayLineSegment,
|
||||
} from '@tldraw/intersect';
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import type { TDShapeUtil } from '@toeverything/components/board-shapes';
|
||||
import {
|
||||
getShapeUtil,
|
||||
getTrianglePoints,
|
||||
} from '@toeverything/components/board-shapes';
|
||||
import { deepCopy } from './manager/deep-copy';
|
||||
import {
|
||||
intersectRayBounds,
|
||||
intersectRayEllipse,
|
||||
intersectRayLineSegment,
|
||||
} from '@tldraw/intersect';
|
||||
ArrowShape,
|
||||
BINDING_DISTANCE,
|
||||
ShapesWithProp,
|
||||
TDBinding,
|
||||
TDExportType,
|
||||
TDHandle,
|
||||
TDPage,
|
||||
TDShape,
|
||||
TDShapeType,
|
||||
TDSnapshot,
|
||||
TldrawCommand,
|
||||
TldrawPatch,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { deepCopy } from './manager/deep-copy';
|
||||
|
||||
const isDev = process.env['NODE_ENV'] === 'development';
|
||||
|
||||
|
||||
@@ -3,77 +3,77 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import {
|
||||
TLBounds,
|
||||
TLBoundsEventHandler,
|
||||
TLBoundsHandleEventHandler,
|
||||
TLKeyboardEventHandler,
|
||||
TLShapeCloneHandler,
|
||||
TLCanvasEventHandler,
|
||||
TLDropEventHandler,
|
||||
TLKeyboardEventHandler,
|
||||
TLPageState,
|
||||
TLPinchEventHandler,
|
||||
TLPointerEventHandler,
|
||||
TLShapeCloneHandler,
|
||||
TLWheelEventHandler,
|
||||
Utils,
|
||||
TLBounds,
|
||||
TLDropEventHandler,
|
||||
} from '@tldraw/core';
|
||||
import { Vec } from '@tldraw/vec';
|
||||
import {
|
||||
clearPrevSize,
|
||||
defaultStyle,
|
||||
shapeUtils,
|
||||
} from '@toeverything/components/board-shapes';
|
||||
import {
|
||||
FlipType,
|
||||
TDDocument,
|
||||
MoveType,
|
||||
AlignType,
|
||||
StretchType,
|
||||
ArrowShape,
|
||||
BaseSessionType,
|
||||
DistributeType,
|
||||
FIT_TO_SCREEN_PADDING,
|
||||
FlipType,
|
||||
GRID_SIZE,
|
||||
GroupShape,
|
||||
IMAGE_EXTENSIONS,
|
||||
MoveType,
|
||||
SessionType,
|
||||
ShapeStyles,
|
||||
StretchType,
|
||||
SVG_EXPORT_PADDING,
|
||||
TDAsset,
|
||||
TDAssets,
|
||||
TDAssetType,
|
||||
TDBinding,
|
||||
TDDocument,
|
||||
TDExport,
|
||||
TDExportType,
|
||||
TDPage,
|
||||
TDShape,
|
||||
TDShapeType,
|
||||
TDSnapshot,
|
||||
TDStatus,
|
||||
TDPage,
|
||||
TDBinding,
|
||||
GroupShape,
|
||||
TldrawCommand,
|
||||
TDUser,
|
||||
SessionType,
|
||||
TDToolType,
|
||||
TDAssetType,
|
||||
TDAsset,
|
||||
TDAssets,
|
||||
TDExport,
|
||||
ArrowShape,
|
||||
TDExportType,
|
||||
TDUser,
|
||||
TldrawCommand,
|
||||
USER_COLORS,
|
||||
FIT_TO_SCREEN_PADDING,
|
||||
GRID_SIZE,
|
||||
IMAGE_EXTENSIONS,
|
||||
VIDEO_EXTENSIONS,
|
||||
SVG_EXPORT_PADDING,
|
||||
BaseSessionType,
|
||||
} from '@toeverything/components/board-types';
|
||||
import { MIN_PAGE_WIDTH } from '@toeverything/components/editor-core';
|
||||
import {
|
||||
migrate,
|
||||
FileSystemHandle,
|
||||
loadFileHandle,
|
||||
openFromFileSystem,
|
||||
saveToFileSystem,
|
||||
openAssetFromFileSystem,
|
||||
fileToBase64,
|
||||
fileToText,
|
||||
getImageSizeFromSrc,
|
||||
getVideoSizeFromSrc,
|
||||
loadFileHandle,
|
||||
migrate,
|
||||
openAssetFromFileSystem,
|
||||
openFromFileSystem,
|
||||
saveToFileSystem,
|
||||
} from './data';
|
||||
import { TLDR } from './tldr';
|
||||
import {
|
||||
shapeUtils,
|
||||
defaultStyle,
|
||||
clearPrevSize,
|
||||
} from '@toeverything/components/board-shapes';
|
||||
import { StateManager } from './manager/state-manager';
|
||||
import { getClipboard, setClipboard } from './idb-clipboard';
|
||||
import { StateManager } from './manager/state-manager';
|
||||
import { TLDR } from './tldr';
|
||||
import type { Commands } from './types/commands';
|
||||
import type { BaseTool } from './types/tool';
|
||||
import { MIN_PAGE_WIDTH } from '@toeverything/components/editor-core';
|
||||
|
||||
const uuid = Utils.uniqueId();
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import type { TLBounds } from '@tldraw/core';
|
||||
import type { TldrawApp } from '../tldraw-app';
|
||||
import type {
|
||||
TldrawCommand,
|
||||
AlignType,
|
||||
TDShape,
|
||||
TDBinding,
|
||||
DistributeType,
|
||||
FlipType,
|
||||
MoveType,
|
||||
StretchType,
|
||||
ShapeStyles,
|
||||
GroupShape,
|
||||
MoveType,
|
||||
ShapeStyles,
|
||||
StretchType,
|
||||
TDBinding,
|
||||
TDShape,
|
||||
TldrawCommand,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '../tldraw-app';
|
||||
|
||||
export interface Commands {
|
||||
alignShapes(app: TldrawApp, ids: string[], type: AlignType): TldrawCommand;
|
||||
|
||||
@@ -4,11 +4,11 @@ import {
|
||||
TLPointerEventHandler,
|
||||
Utils,
|
||||
} from '@tldraw/core';
|
||||
import type { TldrawApp } from '../tldraw-app';
|
||||
import {
|
||||
TDEventHandler,
|
||||
TDToolType,
|
||||
} from '@toeverything/components/board-types';
|
||||
import type { TldrawApp } from '../tldraw-app';
|
||||
|
||||
export enum Status {
|
||||
Idle = 'idle',
|
||||
|
||||
Reference in New Issue
Block a user