@xiongtao.xt/tau-plugins 0.44.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/client/{chunk-UTVEXGFI.js → chunk-CEWYJJKJ.js} +12 -1
- package/client/{fuse-KWYBABFA.js → fuse-OHBNZPDB.js} +1 -1
- package/docs/README.md +2 -2
- package/docs/api-support.md +17 -4
- package/docs/editor-collaboration.md +146 -0
- package/docs/editor.md +30 -27
- package/docs/getting-started.md +3 -3
- package/docs/portability.md +7 -3
- package/docs/providers/asr.md +3 -1
- package/docs/providers/tts.md +15 -0
- package/docs/release.md +1 -1
- package/docs/whiteboard-collaboration.md +67 -0
- package/docs/whiteboard.md +55 -13
- package/package.js +1 -1
- package/package.json +5 -4
- package/portable.js +1 -1
- package/publish-artifacts.js +17975 -76
- package/publish-client.js +2 -2
- package/types/packages/collaboration/src/protocol.d.ts +144 -0
- package/types/packages/collaboration/src/whiteboard-contract.d.ts +6 -0
- package/types/packages/collaboration/src/whiteboard-types.d.ts +181 -0
- package/types/packages/collaboration/whiteboard-types.d.ts +1 -0
- package/types/packages/db-schema/content-contracts.d.ts +4 -1
- package/types/packages/db-schema/content-identities.d.ts +19 -0
- package/types/packages/db-schema/data-versions.d.ts +16 -0
- package/types/packages/editor/source-contracts.d.ts +13 -41
- package/types/packages/editor/src/Editor.d.ts +7 -0
- package/types/packages/editor/src/builtin-types.d.ts +22 -0
- package/types/packages/editor/src/core/CoreEditor.d.ts +44 -0
- package/types/packages/editor/src/core/api/elementView.d.ts +14 -0
- package/types/packages/editor/src/core/api/extension.d.ts +3 -8
- package/types/packages/editor/src/core/api/index.d.ts +5 -0
- package/types/packages/editor/src/core/api/slateTextFields.d.ts +6 -0
- package/types/packages/editor/src/core/api/textFieldInput.d.ts +14 -0
- package/types/packages/editor/src/core/document/EditorDocument.d.ts +74 -0
- package/types/packages/editor/src/core/extensions/markdown-paste-import/index.d.ts +10 -0
- package/types/packages/editor/src/core/hooks/useTouchVoidSelection.d.ts +10 -0
- package/types/packages/editor/src/core/index.d.ts +36 -0
- package/types/packages/editor/src/core/menu/defaultMenu.d.ts +2 -0
- package/types/packages/editor/src/core/plugins/withMarkdownPasteImport.d.ts +17 -0
- package/types/packages/editor/src/core/services/elementEditingPolicy.d.ts +0 -1
- package/types/packages/editor/src/core/utils/blockNavigation.d.ts +1 -1
- package/types/packages/editor/src/core/utils/editor.d.ts +2 -2
- package/types/packages/editor/src/core/utils/hotkey.d.ts +17 -0
- package/types/packages/editor/src/core/utils/index.d.ts +9 -0
- package/types/packages/editor/src/core/utils/normalizeEditorContent.d.ts +2 -0
- package/types/packages/editor/src/core/utils/plugin.d.ts +1 -1
- package/types/packages/editor/src/extensions/annotation/src/augmentations.d.ts +9 -0
- package/types/packages/editor/src/extensions/annotation/src/types.d.ts +6 -0
- package/types/packages/editor/src/extensions/blockquote/src/augmentations.d.ts +6 -0
- package/types/packages/editor/src/extensions/blockquote/src/types.d.ts +7 -0
- package/types/packages/editor/src/extensions/callout/src/augmentations.d.ts +6 -0
- package/types/packages/editor/src/extensions/callout/src/types.d.ts +11 -0
- package/types/packages/editor/src/extensions/callout/src/variants.d.ts +1 -0
- package/types/packages/editor/src/extensions/code-block/src/augmentations.d.ts +7 -0
- package/types/packages/editor/src/extensions/code-block/src/types/code-block.d.ts +40 -0
- package/types/packages/editor/src/extensions/code-block/src/types/index.d.ts +1 -0
- package/types/packages/editor/src/extensions/comment/src/augmentations.d.ts +9 -0
- package/types/packages/editor/src/extensions/comment/src/types.d.ts +15 -0
- package/types/packages/editor/src/extensions/detail/src/augmentations.d.ts +6 -0
- package/types/packages/editor/src/extensions/detail/src/types.d.ts +9 -0
- package/types/packages/editor/src/extensions/diagram/src/augmentations.d.ts +7 -0
- package/types/packages/editor/src/extensions/diagram/src/types/index.d.ts +4 -0
- package/types/packages/editor/src/extensions/diagram/src/types/mermaid.d.ts +12 -0
- package/types/packages/editor/src/extensions/diagram/src/types/plantuml.d.ts +6 -0
- package/types/packages/editor/src/extensions/diagram/src/types/typst.d.ts +9 -0
- package/types/packages/editor/src/extensions/divide-line/src/augmentations.d.ts +6 -0
- package/types/packages/editor/src/extensions/divide-line/src/types.d.ts +5 -0
- package/types/packages/editor/src/extensions/emoji/src/augmentations.d.ts +9 -0
- package/types/packages/editor/src/extensions/emoji/src/types.d.ts +9 -0
- package/types/packages/editor/src/extensions/front-matter/src/augmentations.d.ts +6 -0
- package/types/packages/editor/src/extensions/front-matter/src/types.d.ts +6 -0
- package/types/packages/editor/src/extensions/header/src/augmentations.d.ts +6 -0
- package/types/packages/editor/src/extensions/header/src/types.d.ts +8 -0
- package/types/packages/editor/src/extensions/highlight-block/src/augmentations.d.ts +6 -0
- package/types/packages/editor/src/extensions/highlight-block/src/types.d.ts +10 -0
- package/types/packages/editor/src/extensions/highlight-block/src/variants.d.ts +1 -0
- package/types/packages/editor/src/extensions/kbd/src/augmentations.d.ts +9 -0
- package/types/packages/editor/src/extensions/kbd/src/types.d.ts +5 -0
- package/types/packages/editor/src/extensions/link/src/augmentations.d.ts +9 -0
- package/types/packages/editor/src/extensions/link/src/types.d.ts +6 -0
- package/types/packages/editor/src/extensions/list/src/augmentations.d.ts +10 -0
- package/types/packages/editor/src/extensions/list/src/types/check-list.d.ts +25 -0
- package/types/packages/editor/src/extensions/list/src/types/list.d.ts +18 -0
- package/types/packages/editor/src/extensions/list/src/types.d.ts +3 -0
- package/types/packages/editor/src/extensions/math/src/augmentations.d.ts +10 -0
- package/types/packages/editor/src/extensions/math/src/types.d.ts +11 -0
- package/types/packages/editor/src/extensions/media/src/augmentations.d.ts +15 -0
- package/types/packages/editor/src/extensions/media/src/components/ImageCropEditor/geometry.d.ts +119 -0
- package/types/packages/editor/src/extensions/media/src/types/element/audio.d.ts +13 -0
- package/types/packages/editor/src/extensions/media/src/types/element/image-appearance.d.ts +2 -0
- package/types/packages/editor/src/extensions/media/src/types/element/image.d.ts +31 -0
- package/types/packages/editor/src/extensions/media/src/types/element/inline-image.d.ts +10 -0
- package/types/packages/editor/src/extensions/media/src/types/element/video.d.ts +21 -0
- package/types/packages/editor/src/extensions/styled-text/src/augmentations.d.ts +9 -0
- package/types/packages/editor/src/extensions/styled-text/src/colors.d.ts +75 -0
- package/types/packages/editor/src/extensions/styled-text/src/types.d.ts +7 -0
- package/types/packages/editor/src/extensions/table/src/align.d.ts +2 -0
- package/types/packages/editor/src/extensions/table/src/augmentations.d.ts +8 -0
- package/types/packages/editor/src/extensions/table/src/types.d.ts +19 -0
- package/types/packages/editor/src/extensions/tabs/src/augmentations.d.ts +7 -0
- package/types/packages/editor/src/extensions/tabs/src/types.d.ts +29 -0
- package/types/packages/editor/src/extensions/underline/src/augmentations.d.ts +9 -0
- package/types/packages/editor/src/extensions/underline/src/types.d.ts +8 -0
- package/types/packages/editor/src/extensions/webview/src/augmentations.d.ts +6 -0
- package/types/packages/editor/src/extensions/webview/src/types.d.ts +14 -0
- package/types/packages/editor/src/index.d.ts +4 -0
- package/types/packages/editor/src/presets/default.d.ts +2 -0
- package/types/packages/editor/text-field-contract.d.ts +36 -0
- package/types/packages/plugins/src/content-input.d.ts +1 -0
- package/types/packages/plugins/src/data.d.ts +1 -0
- package/types/packages/plugins/src/flashcards.d.ts +2 -0
- package/types/packages/plugins/src/whiteboard.d.ts +3 -2
- package/types/packages/shared/color-utils.d.ts +19 -0
- package/types/packages/shared/media-services.d.ts +18 -0
- package/types/packages/shared/media-types.d.ts +1 -0
- package/types/packages/shared/src/task-assistant/contracts.d.ts +119 -0
- package/types/packages/shared/src/task-assistant/document-state.d.ts +14 -0
- package/types/packages/shared/src/task-assistant/schema.d.ts +42 -0
- package/types/packages/shared/task-assistant.d.ts +3 -0
- package/types/packages/whiteboard/src/Board.d.ts +180 -0
- package/types/packages/whiteboard/src/WhiteBoard.d.ts +53 -0
- package/types/packages/whiteboard/src/author.d.ts +5 -3
- package/types/packages/whiteboard/src/components/ArrowConnectPointGroup/index.d.ts +13 -0
- package/types/packages/whiteboard/src/components/ArrowDropConnectPoint/index.d.ts +7 -0
- package/types/packages/whiteboard/src/components/DocumentElement/index.d.ts +13 -0
- package/types/packages/whiteboard/src/components/ResizeCircle/index.d.ts +15 -0
- package/types/packages/whiteboard/src/components/SketchPaths/SketchRect.d.ts +21 -0
- package/types/packages/whiteboard/src/components/Toolbar/ToolMenu.d.ts +15 -0
- package/types/packages/whiteboard/src/constants/arrow.d.ts +19 -0
- package/types/packages/whiteboard/src/constants/boardIdentity.d.ts +2 -0
- package/types/packages/whiteboard/src/constants/geometry.d.ts +7 -0
- package/types/packages/whiteboard/src/constants/grid.d.ts +4 -0
- package/types/packages/whiteboard/src/constants/image.d.ts +21 -0
- package/types/packages/whiteboard/src/constants/index.d.ts +13 -0
- package/types/packages/whiteboard/src/constants/map.d.ts +2 -0
- package/types/packages/whiteboard/src/constants/mind-themes.d.ts +30 -0
- package/types/packages/whiteboard/src/constants/mind.d.ts +14 -0
- package/types/packages/whiteboard/src/constants/resize.d.ts +2 -0
- package/types/packages/whiteboard/src/constants/select.d.ts +4 -0
- package/types/packages/whiteboard/src/constants/shadow.d.ts +12 -0
- package/types/packages/whiteboard/src/constants/sketch.d.ts +16 -0
- package/types/packages/whiteboard/src/constants/text-style.d.ts +68 -0
- package/types/packages/whiteboard/src/constants/tools.d.ts +11 -0
- package/types/packages/whiteboard/src/constants/viewport.d.ts +3 -0
- package/types/packages/whiteboard/src/document-version.d.ts +9 -0
- package/types/packages/whiteboard/src/document.d.ts +47 -0
- package/types/packages/whiteboard/src/extensions/api.d.ts +9 -0
- package/types/packages/whiteboard/src/extensions/authorApi.d.ts +10 -0
- package/types/packages/whiteboard/src/extensions/authorHooks.d.ts +2 -2
- package/types/packages/whiteboard/src/extensions/authorTypes.d.ts +150 -0
- package/types/packages/whiteboard/src/extensions/media.d.ts +50 -0
- package/types/packages/whiteboard/src/extensions/publicHooks.d.ts +2 -0
- package/types/packages/whiteboard/src/extensions/runtime.d.ts +95 -0
- package/types/packages/whiteboard/src/extensions/text.d.ts +58 -0
- package/types/packages/whiteboard/src/extensions/versions.d.ts +2 -0
- package/types/packages/whiteboard/src/hooks/useBoardState.d.ts +6 -0
- package/types/packages/whiteboard/src/hooks/useDropArrow.d.ts +76 -0
- package/types/packages/whiteboard/src/hooks/useElementsMoving.d.ts +10 -0
- package/types/packages/whiteboard/src/hooks/useMindTheme.d.ts +8 -0
- package/types/packages/whiteboard/src/hooks/useSelectState.d.ts +10 -0
- package/types/packages/whiteboard/src/hooks/useSketch.d.ts +15 -0
- package/types/packages/whiteboard/src/index.d.ts +54 -0
- package/types/packages/whiteboard/src/interactions/InteractionManager.d.ts +68 -0
- package/types/packages/whiteboard/src/interactions/InteractionState.d.ts +28 -0
- package/types/packages/whiteboard/src/interactions/states/ResizingState.d.ts +40 -0
- package/types/packages/whiteboard/src/plugins/ArrowPlugin.d.ts +48 -0
- package/types/packages/whiteboard/src/plugins/AudioPlugin.d.ts +15 -0
- package/types/packages/whiteboard/src/plugins/ColumnPlugin.d.ts +81 -0
- package/types/packages/whiteboard/src/plugins/CommonPlugin.d.ts +104 -0
- package/types/packages/whiteboard/src/plugins/CopyPastePlugin.d.ts +38 -0
- package/types/packages/whiteboard/src/plugins/DocumentPlugin.d.ts +41 -0
- package/types/packages/whiteboard/src/plugins/ExportImagePlugin.d.ts +6 -0
- package/types/packages/whiteboard/src/plugins/FileDragDropPlugin.d.ts +15 -0
- package/types/packages/whiteboard/src/plugins/FramePlugin.d.ts +14 -0
- package/types/packages/whiteboard/src/plugins/GeometryPlugin.d.ts +31 -0
- package/types/packages/whiteboard/src/plugins/HandwritePlugin.d.ts +22 -0
- package/types/packages/whiteboard/src/plugins/ImagePlugin.d.ts +21 -0
- package/types/packages/whiteboard/src/plugins/MindPlugin.d.ts +72 -0
- package/types/packages/whiteboard/src/plugins/PresentationPlugin.d.ts +13 -0
- package/types/packages/whiteboard/src/plugins/RichTextPlugin.d.ts +44 -0
- package/types/packages/whiteboard/src/plugins/VideoPlugin.d.ts +14 -0
- package/types/packages/whiteboard/src/plugins/ViewPortPlugin.d.ts +13 -0
- package/types/packages/whiteboard/src/plugins/WebviewPlugin.d.ts +11 -0
- package/types/packages/whiteboard/src/plugins/WhiteBoardPlugin.d.ts +31 -0
- package/types/packages/whiteboard/src/plugins/index.d.ts +19 -0
- package/types/packages/whiteboard/src/public.d.ts +54 -0
- package/types/packages/whiteboard/src/schematic/PageSchematic.d.ts +13 -0
- package/types/packages/whiteboard/src/services/CapabilityService.d.ts +186 -0
- package/types/packages/whiteboard/src/transforms/SelectTransforms.d.ts +4 -0
- package/types/packages/whiteboard/src/transforms/SketchTransforms.d.ts +5 -0
- package/types/packages/whiteboard/src/transforms/ViewPortTransforms.d.ts +26 -0
- package/types/packages/whiteboard/src/transforms/index.d.ts +3 -0
- package/types/packages/whiteboard/src/types/arrow.d.ts +52 -0
- package/types/packages/whiteboard/src/types/audio.d.ts +8 -0
- package/types/packages/whiteboard/src/types/board.d.ts +79 -0
- package/types/packages/whiteboard/src/types/capabilities.d.ts +267 -0
- package/types/packages/whiteboard/src/types/column.d.ts +71 -0
- package/types/packages/whiteboard/src/types/element.d.ts +1 -0
- package/types/packages/whiteboard/src/types/frame.d.ts +35 -0
- package/types/packages/whiteboard/src/types/image.d.ts +19 -0
- package/types/packages/whiteboard/src/types/index.d.ts +33 -0
- package/types/packages/whiteboard/src/types/mind.d.ts +54 -0
- package/types/packages/whiteboard/src/types/resize.d.ts +16 -0
- package/types/packages/whiteboard/src/types/video.d.ts +20 -0
- package/types/packages/whiteboard/src/types/webview.d.ts +7 -0
- package/types/packages/whiteboard/src/utils/ArrowConnectTracker.d.ts +50 -0
- package/types/packages/whiteboard/src/utils/ArrowStyleUtil.d.ts +15 -0
- package/types/packages/whiteboard/src/utils/ArrowUtil.d.ts +11 -0
- package/types/packages/whiteboard/src/utils/AudioUtil.d.ts +20 -0
- package/types/packages/whiteboard/src/utils/BoardUtil.d.ts +101 -0
- package/types/packages/whiteboard/src/utils/CanvasUtil.d.ts +5 -0
- package/types/packages/whiteboard/src/utils/ClipboardUtil.d.ts +8 -0
- package/types/packages/whiteboard/src/utils/ColumnUtil.d.ts +125 -0
- package/types/packages/whiteboard/src/utils/ConnectPointOwner.d.ts +36 -0
- package/types/packages/whiteboard/src/utils/ConnectPointUtil.d.ts +66 -0
- package/types/packages/whiteboard/src/utils/Constraints.d.ts +6 -0
- package/types/packages/whiteboard/src/utils/ExportImageUtil.d.ts +14 -0
- package/types/packages/whiteboard/src/utils/FrameUtil.d.ts +90 -0
- package/types/packages/whiteboard/src/utils/GeometryUtil.d.ts +18 -0
- package/types/packages/whiteboard/src/utils/HandwriteGroupUtil.d.ts +25 -0
- package/types/packages/whiteboard/src/utils/HandwriteUtil.d.ts +39 -0
- package/types/packages/whiteboard/src/utils/ImageUtil.d.ts +13 -0
- package/types/packages/whiteboard/src/utils/LayerOrderUtil.d.ts +16 -0
- package/types/packages/whiteboard/src/utils/MindThemePreviewStore.d.ts +11 -0
- package/types/packages/whiteboard/src/utils/MindThemeUtil.d.ts +54 -0
- package/types/packages/whiteboard/src/utils/MindUtil.d.ts +65 -0
- package/types/packages/whiteboard/src/utils/PathUtil.d.ts +80 -0
- package/types/packages/whiteboard/src/utils/PointUtil.d.ts +50 -0
- package/types/packages/whiteboard/src/utils/PresentationManager.d.ts +53 -0
- package/types/packages/whiteboard/src/utils/RichTextContentUtil.d.ts +17 -0
- package/types/packages/whiteboard/src/utils/SelectionActionUtil.d.ts +9 -0
- package/types/packages/whiteboard/src/utils/TextStyleStore.d.ts +10 -0
- package/types/packages/whiteboard/src/utils/VideoUtil.d.ts +11 -0
- package/types/packages/whiteboard/src/utils/ViewportUtil.d.ts +10 -0
- package/types/packages/whiteboard/src/utils/common.d.ts +18 -0
- package/types/packages/whiteboard/src/utils/events.d.ts +13 -0
- package/types/packages/whiteboard/src/utils/index.d.ts +28 -0
- package/types/packages/whiteboard/src/utils/sketch/arrow.d.ts +29 -0
- package/types/packages/whiteboard/src/utils/sketch/batch.d.ts +10 -0
- package/types/packages/whiteboard/src/utils/sketch/index.d.ts +9 -0
- package/types/packages/whiteboard/src/utils/sketch/patch.d.ts +5 -0
- package/types/packages/whiteboard/src/utils/sketch/resolve.d.ts +14 -0
- package/types/packages/whiteboard/src/utils/snap/SnapGeometry.d.ts +52 -0
- package/types/packages/whiteboard/src/utils/snap/SnapManager.d.ts +57 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type MediaCapabilities } from "../extensions/media";
|
|
2
|
+
import { Board, IBoardPlugin } from "../types/index";
|
|
3
|
+
export declare class FileDragDropPlugin implements IBoardPlugin {
|
|
4
|
+
private readonly media;
|
|
5
|
+
name: string;
|
|
6
|
+
constructor(media?: MediaCapabilities);
|
|
7
|
+
onDragEnter(e: DragEvent, _board: Board): void;
|
|
8
|
+
onDragOver(e: DragEvent, _board: Board): void;
|
|
9
|
+
onDragLeave(e: DragEvent, _board: Board): void;
|
|
10
|
+
onDrop(e: DragEvent, board: Board): void;
|
|
11
|
+
private handleDroppedFiles;
|
|
12
|
+
private handleImageFiles;
|
|
13
|
+
private handleVideoFiles;
|
|
14
|
+
private handleAudioFiles;
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Board, BoardElement, EHandlerPosition, IBoardPlugin, Point, FrameElement, ContextMenuContext, PluginContextMenuItem, IElementCapabilities } from "../types/index";
|
|
2
|
+
import { CommonPlugin } from "./CommonPlugin";
|
|
3
|
+
export declare class FramePlugin extends CommonPlugin implements IBoardPlugin {
|
|
4
|
+
name: string;
|
|
5
|
+
getCapabilities(): IElementCapabilities;
|
|
6
|
+
getContextMenu(context: ContextMenuContext): PluginContextMenuItem[];
|
|
7
|
+
moveElement(_board: Board, element: FrameElement, dx: number, dy: number): BoardElement | null;
|
|
8
|
+
protected onResize(board: Board, element: FrameElement, position: EHandlerPosition, startPoint: Point, endPoint: Point, isPreserveRatio?: boolean, isAdsorb?: boolean): void;
|
|
9
|
+
protected onResizeEnd(board: Board): void;
|
|
10
|
+
render(_board: Board, { element, children }: {
|
|
11
|
+
element: FrameElement;
|
|
12
|
+
children?: any;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Board, ContextMenuContext, PluginContextMenuItem, SketchFillStyle } from "../types/index";
|
|
2
|
+
import { CommonPlugin, CommonElement } from "./CommonPlugin";
|
|
3
|
+
import { Descendant } from "slate";
|
|
4
|
+
export interface GeometryElement extends CommonElement {
|
|
5
|
+
type: "geometry";
|
|
6
|
+
geometryType: string;
|
|
7
|
+
theme?: "light" | "dark";
|
|
8
|
+
color?: string;
|
|
9
|
+
fill?: string;
|
|
10
|
+
fillOpacity?: number;
|
|
11
|
+
stroke?: string;
|
|
12
|
+
strokeWidth?: number;
|
|
13
|
+
strokeOpacity?: number;
|
|
14
|
+
/** 手绘模式下的填充样式(D-107);普通模式一律按实色渲染,缺省 solid */
|
|
15
|
+
fillStyle?: SketchFillStyle;
|
|
16
|
+
paths: string[];
|
|
17
|
+
extraInfo?: Record<string, any>;
|
|
18
|
+
text: {
|
|
19
|
+
align: "left" | "center" | "right";
|
|
20
|
+
content: Descendant[];
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export declare class GeometryPlugin extends CommonPlugin {
|
|
24
|
+
name: string;
|
|
25
|
+
constructor();
|
|
26
|
+
getContextMenu(context: ContextMenuContext): PluginContextMenuItem[];
|
|
27
|
+
render(_board: Board, { element }: {
|
|
28
|
+
element: GeometryElement;
|
|
29
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
}
|
|
31
|
+
export default GeometryPlugin;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Board, ContextMenuContext, IBoardPlugin, IElementCapabilities, PluginContextMenuItem } from "../types/index";
|
|
2
|
+
import { CommonElement, CommonPlugin } from "./CommonPlugin";
|
|
3
|
+
import type { HandwriteInputPoint, HandwriteOutlinePoint, HandwriteStyle } from "../utils/index";
|
|
4
|
+
export interface HandwriteElement extends CommonElement {
|
|
5
|
+
type: "handwrite";
|
|
6
|
+
name: string;
|
|
7
|
+
points: HandwriteInputPoint[];
|
|
8
|
+
outline: HandwriteOutlinePoint[];
|
|
9
|
+
style: HandwriteStyle;
|
|
10
|
+
}
|
|
11
|
+
export declare class HandwritePlugin extends CommonPlugin implements IBoardPlugin {
|
|
12
|
+
name: string;
|
|
13
|
+
getCapabilities(): IElementCapabilities;
|
|
14
|
+
private updateElementStyle;
|
|
15
|
+
private updateHandwriteGroup;
|
|
16
|
+
getContextMenu(context: ContextMenuContext): PluginContextMenuItem[];
|
|
17
|
+
isHit(_board: Board, element: HandwriteElement, x: number, y: number): boolean;
|
|
18
|
+
render(_board: Board, { element }: {
|
|
19
|
+
element: HandwriteElement;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
}
|
|
22
|
+
export default HandwritePlugin;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type MediaCapabilities } from "../extensions/media";
|
|
2
|
+
import CommonPlugin from "./CommonPlugin";
|
|
3
|
+
import { Board, IBoardPlugin, ImageElement, ContextMenuContext, PluginContextMenuItem, IElementCapabilities } from "../types/index";
|
|
4
|
+
export declare class ImagePlugin extends CommonPlugin implements IBoardPlugin {
|
|
5
|
+
private readonly media;
|
|
6
|
+
name: string;
|
|
7
|
+
private previewStartPoint;
|
|
8
|
+
private previewCandidateImage;
|
|
9
|
+
private previewMoved;
|
|
10
|
+
constructor(media?: MediaCapabilities);
|
|
11
|
+
private resetPreviewState;
|
|
12
|
+
getCapabilities(): IElementCapabilities;
|
|
13
|
+
getContextMenu(context: ContextMenuContext): PluginContextMenuItem[];
|
|
14
|
+
onPointerDown(e: PointerEvent, board: Board): void;
|
|
15
|
+
onGlobalPointerMove(e: PointerEvent, board: Board): void;
|
|
16
|
+
onGlobalPointerUp(e: PointerEvent, board: Board): void;
|
|
17
|
+
onPaste(event: ClipboardEvent, board: Board): void;
|
|
18
|
+
render(_board: Board, { element }: {
|
|
19
|
+
element: ImageElement;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type TextExtensionOptions } from "../extensions/text";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import { Board, IBoardPlugin, MindNodeElement, Selection, MindDragState, ContextMenuContext, PluginContextMenuItem, IElementCapabilities, BoardElement } from "../types/index";
|
|
4
|
+
import type { InteractionState } from "../interactions/InteractionState";
|
|
5
|
+
export declare const EMPTY_MIND_DRAG_STATE: MindDragState;
|
|
6
|
+
export declare class MindPlugin implements IBoardPlugin {
|
|
7
|
+
private readonly text;
|
|
8
|
+
name: string;
|
|
9
|
+
constructor(text?: TextExtensionOptions);
|
|
10
|
+
getCapabilities(): IElementCapabilities;
|
|
11
|
+
private dragState;
|
|
12
|
+
private dragAnimationFrame;
|
|
13
|
+
private pendingPointerMove;
|
|
14
|
+
private listeners;
|
|
15
|
+
getContextMenu(context: ContextMenuContext): PluginContextMenuItem[];
|
|
16
|
+
isHit(_board: Board, element: MindNodeElement, x: number, y: number): boolean;
|
|
17
|
+
moveElement(_board: Board, element: MindNodeElement, dx: number, dy: number): MindNodeElement | null;
|
|
18
|
+
getBounds(_board: Board, element: MindNodeElement): import("../index").ElementBounds;
|
|
19
|
+
isElementSelected(board: Board, element: MindNodeElement, selectArea?: Selection["selectArea"]): boolean;
|
|
20
|
+
private emitChange;
|
|
21
|
+
subscribe(listener: () => void): () => void;
|
|
22
|
+
getSnapshot(): MindDragState;
|
|
23
|
+
getServerSnapshot(): MindDragState;
|
|
24
|
+
isDraggingNode(nodeId: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 思维导图节点拖拽的手势声明:pointerdown 命中 mind-node 且节点可移动时,
|
|
27
|
+
* 初始化拖拽状态机并返回 MindDragInteraction 交由交互内核接管路由。
|
|
28
|
+
* (原 onPointerDown 的 return false 抢占已由内核仲裁取代)
|
|
29
|
+
*/
|
|
30
|
+
claimPointerGesture(board: Board, e: PointerEvent, hitElement: BoardElement): MindDragInteraction | null;
|
|
31
|
+
/** 当前拖拽是否由该指针发起(由 MindDragInteraction 转发前校验) */
|
|
32
|
+
isDragPointer(pointerId: number): boolean;
|
|
33
|
+
/** 拖拽移动调度(rAF 合帧,原 onGlobalPointerMove 主体) */
|
|
34
|
+
scheduleDragPreview(e: PointerEvent, board: Board): void;
|
|
35
|
+
/** 拖拽收尾:提交落点或越界取消;未构成拖拽的点击回落为点选(原 onGlobalPointerUp 主体) */
|
|
36
|
+
finishDrag(e: PointerEvent, board: Board): void;
|
|
37
|
+
/**
|
|
38
|
+
* 未越过拖拽阈值的点击:回落为点选语义,与其他元素的点击选中保持一致
|
|
39
|
+
* (ctrl/cmd 点击在多选中切换该节点)。
|
|
40
|
+
*/
|
|
41
|
+
private selectClickedNode;
|
|
42
|
+
updateDragPreview(board: Board, clientX: number, clientY: number, altKey?: boolean): void;
|
|
43
|
+
private getConnectionLineColor;
|
|
44
|
+
commitDrop(board: Board): void;
|
|
45
|
+
isPointerInsideBoard(board: Board, clientX: number, clientY: number): boolean;
|
|
46
|
+
setDragState(nextState: MindDragState): void;
|
|
47
|
+
cancelScheduledPointerMove(): void;
|
|
48
|
+
cancelDrag(board: Board): void;
|
|
49
|
+
private cleanup;
|
|
50
|
+
render(_board: Board, { element, children }: {
|
|
51
|
+
element: MindNodeElement;
|
|
52
|
+
children?: ReactNode;
|
|
53
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
}
|
|
55
|
+
export default MindPlugin;
|
|
56
|
+
/**
|
|
57
|
+
* 思维导图拖拽的交互内核适配:由 MindPlugin.claimPointerGesture 创建,
|
|
58
|
+
* 将内核路由的指针/键盘事件转发给插件的拖拽状态机并消费。
|
|
59
|
+
* 取代旧机制中插件 onGlobalPointerMove 等通过 return false 的抢占,
|
|
60
|
+
* 拖拽状态机(含 MindDragOverlay 的订阅)仍留在插件内。
|
|
61
|
+
*/
|
|
62
|
+
declare class MindDragInteraction implements InteractionState {
|
|
63
|
+
private plugin;
|
|
64
|
+
readonly name = "mind-drag";
|
|
65
|
+
isFinished: boolean;
|
|
66
|
+
constructor(plugin: MindPlugin);
|
|
67
|
+
onGlobalPointerMove(e: PointerEvent, board: Board): boolean;
|
|
68
|
+
onGlobalPointerUp(e: PointerEvent, board: Board): boolean;
|
|
69
|
+
onGlobalPointerCancel(e: PointerEvent, board: Board): boolean;
|
|
70
|
+
onExit(board: Board): void;
|
|
71
|
+
onKeyDown(e: KeyboardEvent, board: Board): boolean;
|
|
72
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Board, IBoardPlugin } from "../types/index";
|
|
2
|
+
export declare class PresentationPlugin implements IBoardPlugin {
|
|
3
|
+
name: string;
|
|
4
|
+
private startPoint;
|
|
5
|
+
private hitElements;
|
|
6
|
+
private moved;
|
|
7
|
+
onPointerDown(e: PointerEvent, board: Board): void;
|
|
8
|
+
onPointerMove(e: PointerEvent, board: Board): void;
|
|
9
|
+
onGlobalPointerUp(e: PointerEvent, board: Board): void;
|
|
10
|
+
onKeyDown(e: KeyboardEvent, board: Board): void;
|
|
11
|
+
onWheel(e: WheelEvent, board: Board): void;
|
|
12
|
+
}
|
|
13
|
+
export default PresentationPlugin;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type TextExtensionOptions } from "../extensions/text";
|
|
2
|
+
import { Descendant } from "slate";
|
|
3
|
+
import { Board, EHandlerPosition, Point, ContextMenuContext, PluginContextMenuItem, IElementCapabilities } from "../types/index";
|
|
4
|
+
import { CommonPlugin, CommonElement } from "./CommonPlugin";
|
|
5
|
+
import { TextTone, TextVariant } from "../constants/index";
|
|
6
|
+
export interface RichTextElement extends CommonElement {
|
|
7
|
+
type: "richtext";
|
|
8
|
+
content: Descendant[];
|
|
9
|
+
contentId?: number;
|
|
10
|
+
contentTitle?: string;
|
|
11
|
+
linkedCardId?: number;
|
|
12
|
+
linkedArticleId?: number;
|
|
13
|
+
readonly?: boolean;
|
|
14
|
+
maxWidth: number;
|
|
15
|
+
maxHeight: number;
|
|
16
|
+
resized: boolean;
|
|
17
|
+
autoFocus?: boolean;
|
|
18
|
+
variant?: TextVariant;
|
|
19
|
+
tone?: TextTone;
|
|
20
|
+
/** @deprecated 旧版外观字段,只读,由 resolveTextStyle 换算成 variant/tone */
|
|
21
|
+
background?: string;
|
|
22
|
+
/** @deprecated 同上 */
|
|
23
|
+
topColor?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare class RichTextPlugin extends CommonPlugin {
|
|
26
|
+
private readonly text;
|
|
27
|
+
name: string;
|
|
28
|
+
private readonly measurers;
|
|
29
|
+
dispose(): void;
|
|
30
|
+
constructor(text?: TextExtensionOptions);
|
|
31
|
+
getCapabilities(): IElementCapabilities;
|
|
32
|
+
getContextMenu(context: ContextMenuContext): PluginContextMenuItem[];
|
|
33
|
+
onDblClick(event: MouseEvent, board: Board): void;
|
|
34
|
+
/** content 先建后插(见 createRichTextContentId),故为异步;调用方不等待;双击空白创建共用此入口 */
|
|
35
|
+
private insertRichText;
|
|
36
|
+
onResize(board: Board, element: RichTextElement, position: EHandlerPosition, startPoint: Point, endPoint: Point, _isPreserveRatio?: boolean, isAdsorb?: boolean): void;
|
|
37
|
+
private removeAutoFocus;
|
|
38
|
+
private onEditorSizeChange;
|
|
39
|
+
private onContentChange;
|
|
40
|
+
private onElementChange;
|
|
41
|
+
render(_board: Board, { element }: {
|
|
42
|
+
element: RichTextElement;
|
|
43
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type MediaCapabilities } from "../extensions/media";
|
|
2
|
+
import CommonPlugin from "./CommonPlugin";
|
|
3
|
+
import { Board, IBoardPlugin, VideoElement, ContextMenuContext, PluginContextMenuItem, IElementCapabilities } from "../types/index";
|
|
4
|
+
export declare class VideoPlugin extends CommonPlugin implements IBoardPlugin {
|
|
5
|
+
private readonly media;
|
|
6
|
+
name: string;
|
|
7
|
+
constructor(media?: MediaCapabilities);
|
|
8
|
+
getCapabilities(): IElementCapabilities;
|
|
9
|
+
getContextMenu(context: ContextMenuContext): PluginContextMenuItem[];
|
|
10
|
+
onPaste(event: ClipboardEvent, board: Board): void;
|
|
11
|
+
render(_board: Board, { element }: {
|
|
12
|
+
element: VideoElement;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IBoardPlugin, Board } from "../types/index";
|
|
2
|
+
/**
|
|
3
|
+
* 视口的滚轮缩放/平移与右键菜单默认行为:
|
|
4
|
+
* 缩放/全览快捷键已迁入 tau.interaction 扩展(extensions/interactionCommands.ts),
|
|
5
|
+
* 右键拖拽平移已迁入交互内核(interactions/states/PanningState),
|
|
6
|
+
* 方向键平移已迁入 interactions/states/ViewportMoveState。
|
|
7
|
+
*/
|
|
8
|
+
export declare class ViewPortPlugin implements IBoardPlugin {
|
|
9
|
+
name: string;
|
|
10
|
+
private lastZoomTime;
|
|
11
|
+
onContextMenu(e: MouseEvent): void;
|
|
12
|
+
onWheel(e: WheelEvent, board: Board): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import CommonPlugin, { CommonElement } from "./CommonPlugin";
|
|
2
|
+
import { Board, IBoardPlugin, WebviewElement, ContextMenuContext, PluginContextMenuItem } from "../types/index";
|
|
3
|
+
export declare class WebviewPlugin extends CommonPlugin implements IBoardPlugin {
|
|
4
|
+
name: string;
|
|
5
|
+
constructor();
|
|
6
|
+
getContextMenu(context: ContextMenuContext): PluginContextMenuItem[];
|
|
7
|
+
isHit(_board: Board, element: CommonElement & any, x: number, y: number): boolean;
|
|
8
|
+
render(_board: Board, { element }: {
|
|
9
|
+
element: WebviewElement;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Board, IBoardPlugin, EHandlerPosition, Point, ContextMenuContext, PluginContextMenuItem, IElementCapabilities } from "../types/index";
|
|
2
|
+
import { CommonPlugin, CommonElement } from "./CommonPlugin";
|
|
3
|
+
export interface WhiteBoardElement extends CommonElement {
|
|
4
|
+
type: "whiteboard";
|
|
5
|
+
/** 引用的整块白板 */
|
|
6
|
+
whiteBoardId?: number;
|
|
7
|
+
/** 旧元素:只引用了某一页(新元素不再写入) */
|
|
8
|
+
whiteBoardContentId?: number;
|
|
9
|
+
/** 插入时的白板标题(白板读取失败时兜底显示) */
|
|
10
|
+
name: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
snapshot?: string;
|
|
13
|
+
maxWidth: number;
|
|
14
|
+
maxHeight: number;
|
|
15
|
+
resized: boolean;
|
|
16
|
+
fill?: string;
|
|
17
|
+
fillOpacity?: number;
|
|
18
|
+
theme?: "light" | "dark";
|
|
19
|
+
resizable?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare class WhiteBoardPlugin extends CommonPlugin implements IBoardPlugin {
|
|
22
|
+
private readonly canCreate;
|
|
23
|
+
name: string;
|
|
24
|
+
constructor(canCreate?: boolean);
|
|
25
|
+
getCapabilities(): IElementCapabilities;
|
|
26
|
+
getContextMenu(context: ContextMenuContext): PluginContextMenuItem[];
|
|
27
|
+
onResize(board: Board, element: WhiteBoardElement, position: EHandlerPosition, startPoint: Point, endPoint: Point, _isPreserveRatio?: boolean, isAdsorb?: boolean): void;
|
|
28
|
+
render(board: Board, { element }: {
|
|
29
|
+
element: WhiteBoardElement;
|
|
30
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from "./ViewPortPlugin";
|
|
2
|
+
export * from "./CopyPastePlugin";
|
|
3
|
+
export * from "./RichTextPlugin";
|
|
4
|
+
export * from "./GeometryPlugin";
|
|
5
|
+
export * from "./HandwritePlugin";
|
|
6
|
+
export * from "./DocumentPlugin";
|
|
7
|
+
export * from "./CommonPlugin";
|
|
8
|
+
export * from "./ArrowPlugin";
|
|
9
|
+
export * from "./ImagePlugin";
|
|
10
|
+
export * from "./VideoPlugin";
|
|
11
|
+
export * from "./AudioPlugin";
|
|
12
|
+
export * from "./MindPlugin";
|
|
13
|
+
export * from "./PresentationPlugin";
|
|
14
|
+
export * from "./WebviewPlugin";
|
|
15
|
+
export * from "./FramePlugin";
|
|
16
|
+
export * from "./WhiteBoardPlugin";
|
|
17
|
+
export * from "./ColumnPlugin";
|
|
18
|
+
export * from "./FileDragDropPlugin";
|
|
19
|
+
export * from "./ExportImagePlugin";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { WhiteboardAPI, WhiteboardExtension, WhiteboardSnapshot } from "./extensions/api";
|
|
2
|
+
import { BoardUtil as InternalBoardUtil } from "./utils/BoardUtil";
|
|
3
|
+
import { ViewPortTransforms as InternalViewport } from "./transforms/index";
|
|
4
|
+
import { VideoUtil as InternalVideo } from "./utils/VideoUtil";
|
|
5
|
+
import type { BoardElement } from "./types/index";
|
|
6
|
+
import type { MediaCapabilities } from "./extensions/media";
|
|
7
|
+
import { FrameUtil as InternalFrame } from "./utils/FrameUtil";
|
|
8
|
+
import { PointUtil as InternalPoint } from "./utils/PointUtil";
|
|
9
|
+
import { MindUtil as InternalMind } from "./utils/MindUtil";
|
|
10
|
+
export declare const FrameUtil: {
|
|
11
|
+
createFrame: typeof InternalFrame.createFrame;
|
|
12
|
+
};
|
|
13
|
+
export declare const PointUtil: {
|
|
14
|
+
getResizePointFromRect: typeof InternalPoint.getResizePointFromRect;
|
|
15
|
+
};
|
|
16
|
+
export declare const MindUtil: {
|
|
17
|
+
findNodeInTree: typeof InternalMind.findNodeInTree;
|
|
18
|
+
getChildrenByNode: typeof InternalMind.getChildrenByNode;
|
|
19
|
+
layout: typeof InternalMind.layout;
|
|
20
|
+
toggleFold: typeof InternalMind.toggleFold;
|
|
21
|
+
};
|
|
22
|
+
/** 无界面会话供导入、测试及命令使用;生命周期与只读控制归宿主。 */
|
|
23
|
+
export declare function createWhiteboardSession(snapshot: WhiteboardSnapshot, extensions?: readonly WhiteboardExtension[]): {
|
|
24
|
+
api: WhiteboardAPI;
|
|
25
|
+
setReadonly(value: boolean): void;
|
|
26
|
+
setActive(value: boolean): void;
|
|
27
|
+
dispose(): void;
|
|
28
|
+
};
|
|
29
|
+
export declare const BoardUtil: {
|
|
30
|
+
getElementById: (api: WhiteboardAPI, id: string) => BoardElement | null;
|
|
31
|
+
diffNodePatchOnly: typeof InternalBoardUtil.diffNodePatchOnly;
|
|
32
|
+
};
|
|
33
|
+
export declare const PathUtil: {
|
|
34
|
+
getPathByElement(api: WhiteboardAPI, element: BoardElement): number[] | null;
|
|
35
|
+
};
|
|
36
|
+
export declare const ViewPortTransforms: {
|
|
37
|
+
centerElementsIfNotInViewPort: (api: WhiteboardAPI, elements: BoardElement[]) => void;
|
|
38
|
+
fitAllElements: (api: WhiteboardAPI, padding?: number | undefined, animate?: boolean | undefined, elements?: BoardElement[] | undefined) => void;
|
|
39
|
+
moveViewPort: (api: WhiteboardAPI, minX: number, minY: number) => void;
|
|
40
|
+
};
|
|
41
|
+
export declare const ImageUtil: {
|
|
42
|
+
insertImage: (file: File, api: WhiteboardAPI, media: MediaCapabilities) => Promise<void>;
|
|
43
|
+
insertImageFromPath: (path: string, api: WhiteboardAPI) => Promise<void>;
|
|
44
|
+
};
|
|
45
|
+
export declare const VideoUtil: {
|
|
46
|
+
insertVideo: (file: File, api: WhiteboardAPI, media: MediaCapabilities) => Promise<void>;
|
|
47
|
+
insertVideoFromUrl: (url: string, api: WhiteboardAPI) => Promise<void>;
|
|
48
|
+
insertVideoFromMeta: (api: WhiteboardAPI, meta: Parameters<typeof InternalVideo.insertVideoFromMeta>[1], pageUrl: string) => Promise<void>;
|
|
49
|
+
};
|
|
50
|
+
export declare const AudioUtil: {
|
|
51
|
+
insertAudio: (file: File, api: WhiteboardAPI, media: MediaCapabilities) => Promise<void>;
|
|
52
|
+
insertAudioFromUrl: (url: string, api: WhiteboardAPI) => Promise<void>;
|
|
53
|
+
insertAudioFromTTS: (blob: Blob, text: string, api: WhiteboardAPI, media: MediaCapabilities) => Promise<void>;
|
|
54
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 白板页示意图(schematic.ts 生成图元,这里画成 SVG)。随列表数据实时变化,不截图、不缓存。
|
|
3
|
+
*/
|
|
4
|
+
import type { BoardElement } from "../types/index";
|
|
5
|
+
import type { WhiteboardElementDefinition } from "../extensions/api";
|
|
6
|
+
export declare const PageSchematic: import("react").NamedExoticComponent<{
|
|
7
|
+
elements: BoardElement[] | undefined;
|
|
8
|
+
aspect: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
definitions?: readonly WhiteboardElementDefinition[];
|
|
11
|
+
resolveDefinition?: (element: BoardElement) => WhiteboardElementDefinition | undefined;
|
|
12
|
+
isBuiltin?: (element: BoardElement) => boolean;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import type Board from "../Board";
|
|
2
|
+
import type { BoardElement, IBoardPlugin, Operation, Point } from "../types/index";
|
|
3
|
+
import { type IElementCapabilities, type ISnapCapability, type IContainmentCapability, type IMovementCapability, type IRenderCapability, type IMeasurementCapability, type ContainerDragFeedback, MovementBehavior, ChildrenRenderOrder } from "../types/capabilities";
|
|
4
|
+
/**
|
|
5
|
+
* 能力查询服务
|
|
6
|
+
* 提供统一的能力查询接口,支持渐进式迁移
|
|
7
|
+
*/
|
|
8
|
+
export declare class CapabilityService {
|
|
9
|
+
private registry;
|
|
10
|
+
private board;
|
|
11
|
+
constructor(board: Board);
|
|
12
|
+
/**
|
|
13
|
+
* 注册插件能力到缓存
|
|
14
|
+
*/
|
|
15
|
+
registerPlugin(plugin: IBoardPlugin): void;
|
|
16
|
+
/**
|
|
17
|
+
* 清除缓存(当插件更新时调用)
|
|
18
|
+
*/
|
|
19
|
+
clearCache(elementType?: string): void;
|
|
20
|
+
/**
|
|
21
|
+
* 获取元素的能力声明
|
|
22
|
+
* 优先从插件获取,如果没有则使用默认能力
|
|
23
|
+
*/
|
|
24
|
+
getCapabilities(elementType: string): IElementCapabilities;
|
|
25
|
+
/**
|
|
26
|
+
* 获取吸附能力
|
|
27
|
+
*/
|
|
28
|
+
getSnapCapability(elementType: string): ISnapCapability;
|
|
29
|
+
/**
|
|
30
|
+
* 检查元素是否参与吸附
|
|
31
|
+
*/
|
|
32
|
+
shouldElementSnap(element: BoardElement): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 对于 RootOnly 类型,整体移动所有子元素
|
|
35
|
+
*/
|
|
36
|
+
snapMoveAll(element: BoardElement, dx: number, dy: number): BoardElement | null;
|
|
37
|
+
/**
|
|
38
|
+
* 获取容纳能力
|
|
39
|
+
*/
|
|
40
|
+
getContainmentCapability(elementType: string): IContainmentCapability;
|
|
41
|
+
/**
|
|
42
|
+
* 检查元素是否是容器
|
|
43
|
+
*/
|
|
44
|
+
isContainer(element: BoardElement): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 检查元素是否可以被包含
|
|
47
|
+
*/
|
|
48
|
+
canBeContained(element: BoardElement): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 检查容器是否可以包含指定元素
|
|
51
|
+
*/
|
|
52
|
+
canContain(container: BoardElement, child: BoardElement): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* 检查元素能否被指定类型的容器包含(无需真实容器实例,
|
|
55
|
+
* 供创建流程等尚无容器元素的场合预判准入)。
|
|
56
|
+
*/
|
|
57
|
+
canBeContainedByType(element: BoardElement, containerType: string): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* 获取移动能力
|
|
60
|
+
*/
|
|
61
|
+
getMovementCapability(elementType: string): IMovementCapability;
|
|
62
|
+
/**
|
|
63
|
+
* 获取移动行为
|
|
64
|
+
*/
|
|
65
|
+
getMovementBehavior(element: BoardElement): MovementBehavior;
|
|
66
|
+
/**
|
|
67
|
+
* 收集移动该元素时需要一起移动的完整集合(含自身),
|
|
68
|
+
* 未声明 collectMoveSubtree 能力的元素仅返回自身。
|
|
69
|
+
*/
|
|
70
|
+
collectMoveSubtree(element: BoardElement): BoardElement[];
|
|
71
|
+
/**
|
|
72
|
+
* 检查元素移动是否需要以子树平移提交
|
|
73
|
+
* (MoveWithChildren 容器整体移动,或 RootOnly 元素带子节点的整树移动)。
|
|
74
|
+
*/
|
|
75
|
+
shouldTranslateAsSubtree(element: BoardElement): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* 生成元素移动 ops:子树元素生成整树平移 ops(避免 set_node 写入 children),
|
|
78
|
+
* 普通元素只 patch 变化字段。
|
|
79
|
+
*/
|
|
80
|
+
buildElementMoveOps(originElement: BoardElement, targetElement: BoardElement, path: number[]): Operation[];
|
|
81
|
+
/**
|
|
82
|
+
* 检查元素是否需要带着子元素一起移动
|
|
83
|
+
*/
|
|
84
|
+
shouldMoveWithChildren(element: BoardElement): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* 检查元素移动后是否需要重新布局
|
|
87
|
+
*/
|
|
88
|
+
requiresRelayout(element: BoardElement): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* 结构/图层变化移动元素后的 relayout 通知(如思维导图重排受影响的导图)
|
|
91
|
+
*/
|
|
92
|
+
notifyAfterMove(element: BoardElement): void;
|
|
93
|
+
/**
|
|
94
|
+
* 获取渲染能力
|
|
95
|
+
*/
|
|
96
|
+
getRenderCapability(elementType: string): IRenderCapability;
|
|
97
|
+
/**
|
|
98
|
+
* 获取子元素渲染顺序
|
|
99
|
+
*/
|
|
100
|
+
getChildrenRenderOrder(element: BoardElement): ChildrenRenderOrder;
|
|
101
|
+
/**
|
|
102
|
+
* 过滤渲染期可见的子元素(未声明能力时全部可见)
|
|
103
|
+
*/
|
|
104
|
+
getVisibleChildren(element: BoardElement, children: BoardElement[]): BoardElement[];
|
|
105
|
+
/**
|
|
106
|
+
* 子元素是否应该反向渲染
|
|
107
|
+
*/
|
|
108
|
+
shouldReverseChildren(element: BoardElement): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* 获取元素颜色主题(用于 UI 区分)
|
|
111
|
+
*/
|
|
112
|
+
getColorTheme(element: BoardElement): string;
|
|
113
|
+
/**
|
|
114
|
+
* 获取元素显示名称
|
|
115
|
+
*/
|
|
116
|
+
getDisplayName(element: BoardElement): string;
|
|
117
|
+
/**
|
|
118
|
+
* 检查元素是否参与参考线计算
|
|
119
|
+
*/
|
|
120
|
+
shouldParticipateInRefLines(element: BoardElement): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* 获取测量能力
|
|
123
|
+
*/
|
|
124
|
+
getMeasurementCapability(elementType: string): IMeasurementCapability;
|
|
125
|
+
/**
|
|
126
|
+
* 测量元素在指定宽度下的高度
|
|
127
|
+
*/
|
|
128
|
+
measureElementHeight(element: BoardElement, targetWidth: number): Promise<number>;
|
|
129
|
+
/**
|
|
130
|
+
* 检查元素是否在容器范围内
|
|
131
|
+
* @param pointerPosition 鼠标位置(可选),如果提供则用鼠标位置判断
|
|
132
|
+
*/
|
|
133
|
+
isElementInContainer(container: BoardElement, element: BoardElement, pointerPosition?: Point): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* 检查元素是否是容器的子元素
|
|
136
|
+
*/
|
|
137
|
+
isChildInContainer(container: BoardElement, child: BoardElement): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* 获取插入索引
|
|
140
|
+
* @param excludeElementId - 排除某个元素(用于同一容器内拖拽)
|
|
141
|
+
*/
|
|
142
|
+
getDropIndex(container: BoardElement, dropY: number, excludeElementId?: string): number;
|
|
143
|
+
/**
|
|
144
|
+
* 准备元素插入(尺寸调整)
|
|
145
|
+
*/
|
|
146
|
+
prepareElementForInsertion(container: BoardElement, element: BoardElement): Promise<BoardElement>;
|
|
147
|
+
/**
|
|
148
|
+
* 触发插入后回调
|
|
149
|
+
*/
|
|
150
|
+
notifyChildInserted(container: BoardElement): void;
|
|
151
|
+
/**
|
|
152
|
+
* 触发移出后回调
|
|
153
|
+
* @param container 容器元素
|
|
154
|
+
* @param removedChild 被移除的子元素(可选,用于恢复属性等)
|
|
155
|
+
*/
|
|
156
|
+
notifyChildRemoved(container: BoardElement, removedChild?: BoardElement): void;
|
|
157
|
+
/**
|
|
158
|
+
* 是否为有序容器(子元素位置由容器布局管理)
|
|
159
|
+
*/
|
|
160
|
+
hasOrderedChildren(container: BoardElement): boolean;
|
|
161
|
+
/**
|
|
162
|
+
* 生成子元素拖拽时的容器反馈 ops(无声明返回空数组)
|
|
163
|
+
*/
|
|
164
|
+
buildChildDragFeedbackOps(container: BoardElement, childId: string, position: {
|
|
165
|
+
x: number;
|
|
166
|
+
y: number;
|
|
167
|
+
}): Operation[];
|
|
168
|
+
/**
|
|
169
|
+
* 生成容器拖拽悬停反馈 ops;feedback 为 null 表示清除(无声明返回空数组)
|
|
170
|
+
*/
|
|
171
|
+
buildDragFeedbackOps(container: BoardElement, feedback: ContainerDragFeedback | null): Operation[];
|
|
172
|
+
/**
|
|
173
|
+
* 容器拖拽悬停反馈是否激活(无声明视为未激活)
|
|
174
|
+
*/
|
|
175
|
+
isDropFeedbackActive(container: BoardElement): boolean;
|
|
176
|
+
/**
|
|
177
|
+
* 重算容器的外包 bounds(无声明返回 null,表示容器不自适应)
|
|
178
|
+
*/
|
|
179
|
+
calculateContainerBounds(container: BoardElement): {
|
|
180
|
+
x: number;
|
|
181
|
+
y: number;
|
|
182
|
+
width: number;
|
|
183
|
+
height: number;
|
|
184
|
+
} | null;
|
|
185
|
+
}
|
|
186
|
+
export default CapabilityService;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ViewPort, Board, BoardElement } from "../types/index";
|
|
2
|
+
export declare class ViewPortTransforms {
|
|
3
|
+
static updateZoom(board: Board, newZoom: number, point?: [number, number]): void;
|
|
4
|
+
static onContainerResize(board: Board): void;
|
|
5
|
+
static moveViewPort(board: Board, minX: number, minY: number): void;
|
|
6
|
+
static fitAllElements(board: Board, padding?: number, animate?: boolean, elements?: BoardElement[]): void;
|
|
7
|
+
/** 容纳指定元素(默认全部)所需的视口;无容器或无有效边界时返回 null */
|
|
8
|
+
static getFitViewport(board: Board, padding?: number, elements?: BoardElement[]): ViewPort | null;
|
|
9
|
+
/**
|
|
10
|
+
* 从一个视图平滑过渡到另一个视图
|
|
11
|
+
* @param board 白板实例
|
|
12
|
+
* @param startViewport 起始视图
|
|
13
|
+
* @param endViewport 目标视图
|
|
14
|
+
* @param duration 动画持续时间(毫秒)
|
|
15
|
+
* @param easeFunction 缓动函数,默认为缓出效果
|
|
16
|
+
* @returns Promise,动画完成时解析
|
|
17
|
+
*/
|
|
18
|
+
static animateToViewport(board: Board, startViewport: ViewPort, endViewport: ViewPort, duration?: number, easeFunction?: (t: number) => number): Promise<void>;
|
|
19
|
+
private static getNewViewport;
|
|
20
|
+
static centerElements(board: Board, elements: BoardElement[], options?: {
|
|
21
|
+
animate: boolean;
|
|
22
|
+
duration: number;
|
|
23
|
+
padding: number;
|
|
24
|
+
}): void;
|
|
25
|
+
static centerElementsIfNotInViewPort(board: Board, elements: BoardElement[]): void;
|
|
26
|
+
}
|