@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,119 @@
|
|
|
1
|
+
export type TaskRef = {
|
|
2
|
+
kind: "todo";
|
|
3
|
+
todoId: number;
|
|
4
|
+
createdAt: number;
|
|
5
|
+
} | {
|
|
6
|
+
kind: "document";
|
|
7
|
+
contentId: number;
|
|
8
|
+
createdAt: number;
|
|
9
|
+
taskId: string;
|
|
10
|
+
};
|
|
11
|
+
export interface TaskOccurrenceRef {
|
|
12
|
+
seriesId: string;
|
|
13
|
+
occurrenceDate: string;
|
|
14
|
+
}
|
|
15
|
+
export interface TaskRecurrenceRule {
|
|
16
|
+
type: "daily" | "weekdays" | "weekly" | "monthly" | "yearly" | "custom";
|
|
17
|
+
interval: number;
|
|
18
|
+
startDate: string;
|
|
19
|
+
endDate?: string | null;
|
|
20
|
+
weekdays?: number[];
|
|
21
|
+
monthDay?: number;
|
|
22
|
+
yearMonth?: number;
|
|
23
|
+
yearDay?: number;
|
|
24
|
+
maxOccurrences?: number | null;
|
|
25
|
+
excludeHolidays?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface TaskRecurrenceSegment {
|
|
28
|
+
seriesId: string;
|
|
29
|
+
effectiveDate: string;
|
|
30
|
+
rule: TaskRecurrenceRule | null;
|
|
31
|
+
}
|
|
32
|
+
export interface TaskOccurrenceState {
|
|
33
|
+
completedAt?: number | null;
|
|
34
|
+
skipped?: boolean;
|
|
35
|
+
scheduledAt?: string | null;
|
|
36
|
+
}
|
|
37
|
+
export interface DocumentTaskAttributes {
|
|
38
|
+
taskReminder?: {
|
|
39
|
+
version: 1;
|
|
40
|
+
at: string;
|
|
41
|
+
} | null;
|
|
42
|
+
taskRecurrence?: {
|
|
43
|
+
version: 1;
|
|
44
|
+
segments: TaskRecurrenceSegment[];
|
|
45
|
+
} | null;
|
|
46
|
+
taskOccurrenceState?: Record<string, TaskOccurrenceState>;
|
|
47
|
+
taskArchived?: boolean;
|
|
48
|
+
taskCompletedAt?: number | null;
|
|
49
|
+
}
|
|
50
|
+
export interface AssistantTask {
|
|
51
|
+
taskRef: TaskRef;
|
|
52
|
+
revision: string;
|
|
53
|
+
title: string;
|
|
54
|
+
completed: boolean;
|
|
55
|
+
archived: boolean;
|
|
56
|
+
dueAt: string | null;
|
|
57
|
+
groupId: number | null;
|
|
58
|
+
sourceTitle?: string;
|
|
59
|
+
sourceRef?: {
|
|
60
|
+
kind: "card" | "article" | "project-item" | "diary-moment";
|
|
61
|
+
id: number;
|
|
62
|
+
};
|
|
63
|
+
documentRevision?: string;
|
|
64
|
+
occurrence?: TaskOccurrenceRef;
|
|
65
|
+
reminderAt?: string | null;
|
|
66
|
+
recurrence?: TaskRecurrenceSegment[];
|
|
67
|
+
writable: boolean;
|
|
68
|
+
readonlyReason?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface AssistantCalendarEvent {
|
|
71
|
+
eventId: number;
|
|
72
|
+
createdAt: number;
|
|
73
|
+
revision: string;
|
|
74
|
+
title: string;
|
|
75
|
+
calendarId: number;
|
|
76
|
+
start: string;
|
|
77
|
+
end: string;
|
|
78
|
+
allDay: boolean;
|
|
79
|
+
taskRef?: TaskRef;
|
|
80
|
+
occurrence?: TaskOccurrenceRef;
|
|
81
|
+
writable: boolean;
|
|
82
|
+
}
|
|
83
|
+
export interface AssistantQueryResult<T> {
|
|
84
|
+
type: "assistant-tasks" | "assistant-calendar" | "assistant-operations";
|
|
85
|
+
databaseName: string;
|
|
86
|
+
items: T[];
|
|
87
|
+
hasMore: boolean;
|
|
88
|
+
nextCursor: string | null;
|
|
89
|
+
incomplete: boolean;
|
|
90
|
+
warnings: string[];
|
|
91
|
+
document?: {
|
|
92
|
+
contentId: number;
|
|
93
|
+
createdAt: number;
|
|
94
|
+
revision: string;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export interface TaskOperationResult {
|
|
98
|
+
requestId: string;
|
|
99
|
+
operationId?: string;
|
|
100
|
+
status: "succeeded" | "pending" | "failed" | "notExecuted";
|
|
101
|
+
result?: unknown;
|
|
102
|
+
error?: {
|
|
103
|
+
code: string;
|
|
104
|
+
message: string;
|
|
105
|
+
};
|
|
106
|
+
undoableUntil?: number;
|
|
107
|
+
}
|
|
108
|
+
export interface TaskBatchResult {
|
|
109
|
+
type: "assistant-task-operation";
|
|
110
|
+
databaseName: string;
|
|
111
|
+
batchId: string;
|
|
112
|
+
items: TaskOperationResult[];
|
|
113
|
+
}
|
|
114
|
+
export declare class TaskAssistantError extends Error {
|
|
115
|
+
readonly code: string;
|
|
116
|
+
constructor(code: string, message: string);
|
|
117
|
+
}
|
|
118
|
+
export declare function taskKey(ref: TaskRef): string;
|
|
119
|
+
export declare function occurrenceKey(ref: TaskOccurrenceRef): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type DocumentTaskAttributes, type TaskOccurrenceRef, type TaskOccurrenceState, type TaskRecurrenceSegment } from "./contracts";
|
|
2
|
+
export declare function taskOccurrencesInRange(segments: TaskRecurrenceSegment[], states: Record<string, TaskOccurrenceState>, start: string, end: string, holidays?: Set<number>): {
|
|
3
|
+
occurrence: TaskOccurrenceRef;
|
|
4
|
+
scheduledAt: string;
|
|
5
|
+
state: TaskOccurrenceState;
|
|
6
|
+
}[];
|
|
7
|
+
/** 正文勾选只改变当天实例;没有当天实例时不能把整个周期标为完成。 */
|
|
8
|
+
export declare function documentTaskOccurrence(attributes: DocumentTaskAttributes, now?: Date): TaskOccurrenceRef | null;
|
|
9
|
+
export declare function documentTaskCheck(attributes: DocumentTaskAttributes & {
|
|
10
|
+
checked?: boolean;
|
|
11
|
+
}, checked: boolean, now?: number): Record<string, unknown> | null;
|
|
12
|
+
export declare function documentTaskIsChecked(attributes: DocumentTaskAttributes & {
|
|
13
|
+
checked?: boolean;
|
|
14
|
+
}, now?: Date): boolean;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface TaskSchema {
|
|
2
|
+
type?: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
properties?: Record<string, TaskSchema>;
|
|
5
|
+
required?: string[];
|
|
6
|
+
additionalProperties?: boolean;
|
|
7
|
+
items?: TaskSchema;
|
|
8
|
+
enum?: string[];
|
|
9
|
+
anyOf?: TaskSchema[];
|
|
10
|
+
minItems?: number;
|
|
11
|
+
maxItems?: number;
|
|
12
|
+
minimum?: number;
|
|
13
|
+
maximum?: number;
|
|
14
|
+
minLength?: number;
|
|
15
|
+
maxLength?: number;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export declare const TASK_WRITE_SCHEMAS: {
|
|
19
|
+
create_todo: TaskSchema;
|
|
20
|
+
update_todo: TaskSchema;
|
|
21
|
+
set_todo_completed: TaskSchema;
|
|
22
|
+
delete_todo: TaskSchema;
|
|
23
|
+
set_todo_recurrence: TaskSchema;
|
|
24
|
+
update_todo_occurrence: TaskSchema;
|
|
25
|
+
create_calendar_event: TaskSchema;
|
|
26
|
+
update_calendar_event: TaskSchema;
|
|
27
|
+
delete_calendar_event: TaskSchema;
|
|
28
|
+
undo_task_operation: TaskSchema;
|
|
29
|
+
};
|
|
30
|
+
export type TaskWriteName = keyof typeof TASK_WRITE_SCHEMAS;
|
|
31
|
+
export declare const TASK_READ_SCHEMAS: {
|
|
32
|
+
query_todos: TaskSchema;
|
|
33
|
+
query_calendar_events: TaskSchema;
|
|
34
|
+
query_task_operations: TaskSchema;
|
|
35
|
+
};
|
|
36
|
+
export type TaskReadName = keyof typeof TASK_READ_SCHEMAS;
|
|
37
|
+
export type TaskToolName = TaskReadName | TaskWriteName;
|
|
38
|
+
export declare const TASK_TOOL_DESCRIPTIONS: Record<TaskToolName, string>;
|
|
39
|
+
/** 本地校验标记不进入模型厂商的 JSON Schema。 */
|
|
40
|
+
export declare function taskToolSchema(name: TaskToolName): TaskSchema;
|
|
41
|
+
export declare function validateTaskValue(schema: TaskSchema, value: unknown, path?: string): void;
|
|
42
|
+
export declare function validateTaskTool(name: TaskToolName, args: unknown): asserts args is Record<string, unknown>;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import SnapManager from "./utils/snap/SnapManager";
|
|
3
|
+
import { PresentationManager } from "./utils/PresentationManager";
|
|
4
|
+
import { Operation, Selection, IBoardPlugin, BoardElement, ViewPort, PresentationSequence, ElementBounds, BoardContextMenuPayload, PluginContextMenuItem, CustomOffset, PageSketch } from "./types/index";
|
|
5
|
+
import { CapabilityService } from "./services/CapabilityService";
|
|
6
|
+
import { InteractionManager } from "./interactions/InteractionManager";
|
|
7
|
+
import { ExtensionRuntime } from "./extensions/runtime";
|
|
8
|
+
import type { WhiteboardAPI, WhiteboardExtension, WhiteboardExtensionError } from "./extensions/api";
|
|
9
|
+
import type { ServiceRegistry } from "../../shared/service-registry";
|
|
10
|
+
import type { WhiteboardDocumentBinding } from "./document";
|
|
11
|
+
import { boardFlag } from "./constants/boardIdentity";
|
|
12
|
+
interface VisibleElementTree {
|
|
13
|
+
element: BoardElement;
|
|
14
|
+
children: VisibleElementTree[];
|
|
15
|
+
}
|
|
16
|
+
declare class Board {
|
|
17
|
+
static boardFlag: symbol;
|
|
18
|
+
document?: WhiteboardDocumentBinding;
|
|
19
|
+
private disconnectDocument?;
|
|
20
|
+
private projectingDocument;
|
|
21
|
+
attachDocument(document: WhiteboardDocumentBinding): void;
|
|
22
|
+
publishDocument(children: BoardElement[], sketch?: PageSketch, sequences?: PresentationSequence[]): void;
|
|
23
|
+
private plugins;
|
|
24
|
+
private eventEmitter;
|
|
25
|
+
snap: SnapManager;
|
|
26
|
+
capabilityService: CapabilityService;
|
|
27
|
+
interactions: InteractionManager;
|
|
28
|
+
mindThemePreviewStore: import("zustand").StoreApi<import("./utils/MindThemePreviewStore").MindThemePreviewState>;
|
|
29
|
+
private active;
|
|
30
|
+
extensions?: ExtensionRuntime;
|
|
31
|
+
private historyGroup;
|
|
32
|
+
/** undo/redo 重放标记:重放历史操作不进提交校验(数据提交时已校验过) */
|
|
33
|
+
private replayingHistory;
|
|
34
|
+
installExtensions(extensions: readonly WhiteboardExtension[], onExtensionError?: (error: WhiteboardExtensionError) => void, services?: ServiceRegistry, extensionServices?: (id: string, api: WhiteboardAPI) => ServiceRegistry): void;
|
|
35
|
+
/** 加载期迁移落盘:替换 children 并重建快照,不进 undo 历史、不 emit change */
|
|
36
|
+
replaceChildrenSilently(children: BoardElement[]): void;
|
|
37
|
+
private submissionVersion;
|
|
38
|
+
private removedElementVersions;
|
|
39
|
+
setActive(active: boolean): void;
|
|
40
|
+
captureSubmission(element?: BoardElement): () => boolean;
|
|
41
|
+
getFontSize(): number;
|
|
42
|
+
presentationManager: PresentationManager;
|
|
43
|
+
boardFlag: typeof boardFlag;
|
|
44
|
+
isDestroyed: boolean;
|
|
45
|
+
children: BoardElement[];
|
|
46
|
+
viewPort: ViewPort;
|
|
47
|
+
selection: Selection;
|
|
48
|
+
/** 页级画风(D-107);变化时 emit("sketch:change") */
|
|
49
|
+
sketch: PageSketch;
|
|
50
|
+
undos: Array<Operation[]>;
|
|
51
|
+
redos: Array<Operation[]>;
|
|
52
|
+
isEditingElements: string[];
|
|
53
|
+
private lastUndoTimestamp;
|
|
54
|
+
private elementVersion;
|
|
55
|
+
private containerRectCache;
|
|
56
|
+
/**
|
|
57
|
+
* 容器视口矩形(缓存):指针热路径(每次 pointermove 的坐标转换)高频读取,
|
|
58
|
+
* getBoundingClientRect 在上一帧 DOM 写入后会把整文档强制重排(大页面百 ms 级)。
|
|
59
|
+
* 平移/手势期间容器几何不变,缓存恒命中;布局变化经 invalidateContainerRect 失效
|
|
60
|
+
* (容器 ResizeObserver 与窗口滚动捕获,见 WhiteBoard 接线)。
|
|
61
|
+
*/
|
|
62
|
+
getContainerRect(): {
|
|
63
|
+
x: number;
|
|
64
|
+
y: number;
|
|
65
|
+
} | null;
|
|
66
|
+
invalidateContainerRect(): void;
|
|
67
|
+
/** 剔除滞回的上一轮保留集合(见 filterElementsInViewport 的宽退出盒说明) */
|
|
68
|
+
private cullRetainedIds;
|
|
69
|
+
private snapshot;
|
|
70
|
+
/** 当前工具("tau.select" 表示非创建模式) */
|
|
71
|
+
private _activeTool;
|
|
72
|
+
private _activeToolOptions;
|
|
73
|
+
/**
|
|
74
|
+
* 创建手势的预览覆盖层状态:预览元素从不进入 children、快照、onChange 与历史;
|
|
75
|
+
* 变化时 emit("internal:creation-preview-change")。leaving 表示取消退场中(120ms 后清空)。
|
|
76
|
+
*/
|
|
77
|
+
creationPreview: {
|
|
78
|
+
element: BoardElement;
|
|
79
|
+
highlight: readonly string[];
|
|
80
|
+
leaving: boolean;
|
|
81
|
+
/** 尺寸徽标文本(drag 已移动时由内核计算,line 约束显示长度) */
|
|
82
|
+
sizeLabel?: string;
|
|
83
|
+
/** 是否绘制包围盒描边(手写笔迹等传 false) */
|
|
84
|
+
bounds: boolean;
|
|
85
|
+
} | null;
|
|
86
|
+
/** 设置/清除创建预览;element 为 null 时清除 */
|
|
87
|
+
setCreationPreview(element: BoardElement | null, options?: {
|
|
88
|
+
highlight?: readonly string[];
|
|
89
|
+
sizeLabel?: string;
|
|
90
|
+
bounds?: boolean;
|
|
91
|
+
}): void;
|
|
92
|
+
/** 标记预览进入取消退场(渲染层播放 120ms 淡出) */
|
|
93
|
+
markCreationPreviewLeaving(): void;
|
|
94
|
+
constructor(children: BoardElement[], viewPort: ViewPort, selection: Selection, plugins?: IBoardPlugin[], presentationSequences?: PresentationSequence[], readonly?: boolean, sketch?: PageSketch);
|
|
95
|
+
private _readonly;
|
|
96
|
+
/** 文档版本过高导致的强制只读原因;普通只读为 null。宿主(WhiteBoard 组件)负责设置。 */
|
|
97
|
+
readonlyReason: "document-too-new" | null;
|
|
98
|
+
get readonly(): boolean;
|
|
99
|
+
set readonly(value: boolean);
|
|
100
|
+
on(event: string, listener: (...args: any[]) => void): void;
|
|
101
|
+
off(event: string, listener: (...args: any[]) => void): void;
|
|
102
|
+
emit(event: string, ...args: any[]): void;
|
|
103
|
+
once(event: string, listener: (...args: any[]) => void): void;
|
|
104
|
+
destroy(): void;
|
|
105
|
+
initPlugins(plugins: IBoardPlugin[]): void;
|
|
106
|
+
addPlugin(plugin: IBoardPlugin): void;
|
|
107
|
+
isHit(element: BoardElement, x: number, y: number): boolean;
|
|
108
|
+
moveElement(element: BoardElement, offsetX: number, offsetY: number): BoardElement | null | undefined;
|
|
109
|
+
getBounds(element: BoardElement): ElementBounds | null;
|
|
110
|
+
onMouseDown(event: MouseEvent): void;
|
|
111
|
+
onGlobalMouseDown(event: MouseEvent): void;
|
|
112
|
+
onMouseMove(event: MouseEvent): void;
|
|
113
|
+
onMouseUp(event: MouseEvent): void;
|
|
114
|
+
onGlobalMouseUp(event: MouseEvent): void;
|
|
115
|
+
onMouseLeave(event: MouseEvent): void;
|
|
116
|
+
onMouseEnter(event: MouseEvent): void;
|
|
117
|
+
onClick(event: MouseEvent): void;
|
|
118
|
+
onDblClick(event: MouseEvent): void;
|
|
119
|
+
onContextMenu(event: MouseEvent): void;
|
|
120
|
+
getContextMenu(context: BoardContextMenuPayload): PluginContextMenuItem[];
|
|
121
|
+
onWheel(event: WheelEvent): void;
|
|
122
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
123
|
+
/**
|
|
124
|
+
* Esc 只承担退出创建模式(浮层退场语义之外无其它角色)。让位规则:
|
|
125
|
+
* 输入法组合在 onKeyDown 入口已让位;元素编辑中、演示态与编辑上下文
|
|
126
|
+
* (输入框/可编辑节点)让位;portal 浮层的事件本就不归属画布(ownsBoardEvent),
|
|
127
|
+
* 天然优先于本处理。
|
|
128
|
+
*/
|
|
129
|
+
private exitCreateToolOnEscape;
|
|
130
|
+
onKeyUp(event: KeyboardEvent): void;
|
|
131
|
+
onPointerDown(event: PointerEvent): void;
|
|
132
|
+
onPointerUp(event: PointerEvent): void;
|
|
133
|
+
onPointerMove(event: PointerEvent): void;
|
|
134
|
+
onGlobalPointerDown(event: PointerEvent): void;
|
|
135
|
+
onGlobalPointerUp(event: PointerEvent): void;
|
|
136
|
+
onGlobalPointerMove(event: PointerEvent): void;
|
|
137
|
+
onGlobalPointerCancel(event: PointerEvent): void;
|
|
138
|
+
onPaste(event: ClipboardEvent): void;
|
|
139
|
+
onCopy(event: ClipboardEvent): void;
|
|
140
|
+
onCut(event: ClipboardEvent): void;
|
|
141
|
+
onDrop(event: DragEvent): void;
|
|
142
|
+
onDragOver(event: DragEvent): void;
|
|
143
|
+
onDragEnter(event: DragEvent): void;
|
|
144
|
+
onDragLeave(event: DragEvent): void;
|
|
145
|
+
/** 内部操作的唯一历史入口,缩放预览结束后也通过此入口提交。 */
|
|
146
|
+
recordHistory(processedOps: Operation[], historyGroup?: string): void;
|
|
147
|
+
apply(ops: Operation | Operation[], updateHistory?: boolean, historyGroup?: string): void;
|
|
148
|
+
isElementSelected(element: BoardElement, selectArea?: Selection["selectArea"]): boolean;
|
|
149
|
+
renderElement(element: BoardElement): React.ReactElement | null | undefined;
|
|
150
|
+
renderPluginElement(plugin: IBoardPlugin, element: BoardElement, children: React.ReactElement[]): import("react/jsx-runtime").JSX.Element;
|
|
151
|
+
renderElements(value?: BoardElement[]): (React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null | undefined)[];
|
|
152
|
+
getArrowBindPoint(element: BoardElement, connectId: string, customOffset?: CustomOffset): import("./types/index").Point | null;
|
|
153
|
+
undo(): void;
|
|
154
|
+
redo(): void;
|
|
155
|
+
subscribe(callback: () => void): () => void;
|
|
156
|
+
getSnapshot(): {
|
|
157
|
+
children: BoardElement[];
|
|
158
|
+
viewPort: ViewPort;
|
|
159
|
+
selection: Selection;
|
|
160
|
+
presentationSequences: PresentationSequence[];
|
|
161
|
+
sketch: PageSketch;
|
|
162
|
+
version: number;
|
|
163
|
+
};
|
|
164
|
+
getElementVersion(): number;
|
|
165
|
+
get activeTool(): string;
|
|
166
|
+
get activeToolOptions(): Readonly<Record<string, unknown>> | null;
|
|
167
|
+
/** 是否处于创建模式(非"选择"工具激活) */
|
|
168
|
+
isCreating(): boolean;
|
|
169
|
+
/**
|
|
170
|
+
* 设置当前工具;id 必须是已注册工具 id 或 "tau.select",否则抛错。
|
|
171
|
+
* 只读画布下非 select 的设置被忽略并返回 false。未传 options 视为清空参数。
|
|
172
|
+
*/
|
|
173
|
+
setActiveTool(id: string, options?: Record<string, unknown>): boolean;
|
|
174
|
+
/** 写齐字段后统一发事件 */
|
|
175
|
+
private applyToolChange;
|
|
176
|
+
getPlugin<T extends IBoardPlugin>(name: string): T | undefined;
|
|
177
|
+
filterElementsInViewport(elements: BoardElement[], expandPixels?: number): VisibleElementTree[];
|
|
178
|
+
renderVisibleElements(elements?: VisibleElementTree[]): Array<React.ReactElement | null | undefined>;
|
|
179
|
+
}
|
|
180
|
+
export default Board;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { WhiteboardDocumentBinding } from "./document";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { type ServiceRegistry } from "../../shared/service-registry";
|
|
4
|
+
import { BoardElement, ViewPort, Selection, PresentationSequence, PageSketch } from "./types/index";
|
|
5
|
+
import type { WhiteboardExtension, WhiteboardExtensionError, WhiteboardOutline, WhiteboardSnapshot } from "./extensions/api";
|
|
6
|
+
export interface WhiteBoardProps {
|
|
7
|
+
document?: WhiteboardDocumentBinding;
|
|
8
|
+
extensions: readonly WhiteboardExtension[];
|
|
9
|
+
outline?: WhiteboardOutline;
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
initData: BoardElement[] & {
|
|
13
|
+
presentationSequences?: PresentationSequence[];
|
|
14
|
+
};
|
|
15
|
+
initViewPort?: ViewPort;
|
|
16
|
+
initSelection?: Selection;
|
|
17
|
+
initPresentationSequences?: PresentationSequence[];
|
|
18
|
+
/** 页级画风(D-107),缺省为普通 */
|
|
19
|
+
initSketch?: PageSketch;
|
|
20
|
+
/** 加载的文档版本(getDocumentVersion(data)),缺省视为 1;高于支持范围时强制只读且不写回 */
|
|
21
|
+
version?: number;
|
|
22
|
+
readonly?: boolean;
|
|
23
|
+
onChange?: (data: WhiteboardSnapshot) => void;
|
|
24
|
+
showSidebar?: boolean;
|
|
25
|
+
showToolbar?: boolean;
|
|
26
|
+
showAttributeSetter?: boolean;
|
|
27
|
+
showStatusBar?: boolean;
|
|
28
|
+
/** 进出演示模式(宿主页面据此收起画布外的浮动件,如页签条) */
|
|
29
|
+
onPresentationModeChange?: (presenting: boolean) => void;
|
|
30
|
+
/** 扩展被禁用时回调(命名空间违规、冲突、创建失败等),画布继续运行 */
|
|
31
|
+
onExtensionError?: (error: WhiteboardExtensionError) => void;
|
|
32
|
+
/** 宿主服务注册表:扩展经 requires/optional 声明后从扩展 api 获取;缺省为空注册表 */
|
|
33
|
+
services?: ServiceRegistry;
|
|
34
|
+
/** 宿主为特定扩展派生服务作用域;未提供时使用公共注册表。 */
|
|
35
|
+
extensionServices?: (id: string, api: import("./extensions/api").WhiteboardAPI) => ServiceRegistry;
|
|
36
|
+
}
|
|
37
|
+
export interface WhiteBoardRef {
|
|
38
|
+
fitAllElements: (padding?: number, animate?: boolean) => void;
|
|
39
|
+
getElements: () => BoardElement[];
|
|
40
|
+
zoomIn: () => void;
|
|
41
|
+
zoomOut: () => void;
|
|
42
|
+
zoomTo: (zoom: number) => void;
|
|
43
|
+
/** 选中并滚入视野,派发 element:flash 让元素闪一下;元素不存在返回 false */
|
|
44
|
+
revealElement: (id: string) => boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 画板生命周期:渲染期只构造无副作用的 Board,文档连接与扩展装配放在提交期,完成后才挂载画布。
|
|
48
|
+
* 被丢弃的渲染(挂起、出错重试、StrictMode 双渲染)因此不会残留扩展实例或占用文档绑定;
|
|
49
|
+
* 销毁由画布在容器真正脱离文档时执行(见 WhiteBoardCanvas 的容器 effect)。
|
|
50
|
+
*/
|
|
51
|
+
declare const WhiteBoard: React.NamedExoticComponent<WhiteBoardProps & React.RefAttributes<WhiteBoardRef>>;
|
|
52
|
+
export default WhiteBoard;
|
|
53
|
+
export * from "./types/index";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/** 白板作者入口保持无 DOM 副作用,定义可在纯数据宿主中求值。 */
|
|
2
|
-
export { defineElement, defineWhiteboardExtension } from "./extensions/
|
|
3
|
-
export type { WhiteboardAPI, WhiteboardExtension, WhiteboardElementDefinition, WhiteboardContributions,
|
|
2
|
+
export { defineElement, defineWhiteboardExtension, useWhiteboardAPI } from "./extensions/authorApi";
|
|
3
|
+
export type { WhiteboardAPI, WhiteboardExtension, WhiteboardElementDefinition, WhiteboardContributions, WhiteboardSnapshot, WhiteboardIdCommand, WhiteboardShellPatch, WhiteboardGeometry, WhiteboardData, } from "./extensions/authorTypes";
|
|
4
4
|
export type { BoardElement } from "./types/element";
|
|
5
|
-
export {
|
|
5
|
+
export type { TypedBoardElement, WhiteboardToolProps } from "./extensions/api";
|
|
6
|
+
export type ElementCreateSpec<TData = unknown> = NonNullable<import("./extensions/authorTypes").WhiteboardElementDefinition<TData>["create"]>;
|
|
6
7
|
export { useSketch, usePageSketch } from "./extensions/authorHooks";
|
|
7
8
|
export { AttrPopover, AttrToggle, OptionGrid, Seg } from "./chrome/index";
|
|
8
9
|
export { default as SketchPopover } from "./components/SketchPopover";
|
|
@@ -12,3 +13,4 @@ export type { SketchPath } from "./utils/sketch/types";
|
|
|
12
13
|
export type { Vec } from "./utils/sketch/geometry";
|
|
13
14
|
export type { SchematicShape, SchematicFill } from "./types/schematic";
|
|
14
15
|
export type { ResolvedSketch, ElementSketch, PageSketch, SketchLevel } from "./types/sketch";
|
|
16
|
+
export { assertWhiteboardElementVersions } from "./extensions/versions";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BoardElement, Point } from "../../types/index";
|
|
2
|
+
type ArrowConnectPointData = {
|
|
3
|
+
connectId: string;
|
|
4
|
+
point: Point;
|
|
5
|
+
};
|
|
6
|
+
interface ArrowConnectPointGroupProps {
|
|
7
|
+
element: BoardElement;
|
|
8
|
+
points: ArrowConnectPointData[];
|
|
9
|
+
isSelected: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const ArrowConnectPointGroup: import("react").MemoExoticComponent<(props: ArrowConnectPointGroupProps) => import("react/jsx-runtime").JSX.Element>;
|
|
13
|
+
export default ArrowConnectPointGroup;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface ArrowDropConnectPointProps {
|
|
2
|
+
cx: number;
|
|
3
|
+
cy: number;
|
|
4
|
+
isActive: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const ArrowDropConnectPoint: import("react").MemoExoticComponent<(props: ArrowDropConnectPointProps) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
export default ArrowDropConnectPoint;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Board, EHandlerPosition, Point } from "../../types/index";
|
|
2
|
+
import { type DocumentElement } from "../../plugins/DocumentPlugin";
|
|
3
|
+
/** 画布上文档卡的圆角,宿主的纸面与选中框共用 */
|
|
4
|
+
export declare const DOCUMENT_CARD_RADIUS = 16;
|
|
5
|
+
interface DocumentElementProps {
|
|
6
|
+
element: DocumentElement;
|
|
7
|
+
onResizeStart?: (element: DocumentElement, startPoint: Point) => void;
|
|
8
|
+
onResize: (board: Board, element: DocumentElement, position: EHandlerPosition, startPoint: Point, endPoint: Point, isPreserveRatio?: boolean, isAdsorb?: boolean) => void;
|
|
9
|
+
onResizeEnd?: (board: Board, element: DocumentElement, position: EHandlerPosition, startPoint: Point, endPoint: Point) => void;
|
|
10
|
+
}
|
|
11
|
+
/** 文档卡外壳负责选中、缩放和连线,纸面由文档扩展的渲染闭包提供。 */
|
|
12
|
+
declare const DocumentElementComponent: import("react").MemoExoticComponent<(props: DocumentElementProps) => import("react/jsx-runtime").JSX.Element>;
|
|
13
|
+
export default DocumentElementComponent;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EHandlerPosition, Point } from "../../types/index";
|
|
2
|
+
interface ResizeCircleProps {
|
|
3
|
+
position: EHandlerPosition;
|
|
4
|
+
cx: number;
|
|
5
|
+
cy: number;
|
|
6
|
+
r: number;
|
|
7
|
+
fill: string;
|
|
8
|
+
innerRadius?: number;
|
|
9
|
+
innerFill?: string;
|
|
10
|
+
onResizeStart?: (startPoint: Point) => void;
|
|
11
|
+
onResize: (position: EHandlerPosition, startPoint: Point, endPoint: Point, isPreserveRatio?: boolean, isAdsorb?: boolean) => void;
|
|
12
|
+
onResizeEnd?: (position: EHandlerPosition, startPoint: Point, endPoint: Point) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const ResizeCircle: import("react").MemoExoticComponent<(props: ResizeCircleProps) => import("react/jsx-runtime").JSX.Element>;
|
|
15
|
+
export default ResizeCircle;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SketchFillStyle, SketchLevel } from "../../types/index";
|
|
2
|
+
interface SketchRectProps {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
radius?: number;
|
|
8
|
+
stroke?: string;
|
|
9
|
+
strokeWidth: number;
|
|
10
|
+
fill?: string;
|
|
11
|
+
fillOpacity?: number;
|
|
12
|
+
fillStyle?: SketchFillStyle;
|
|
13
|
+
washAlpha?: number;
|
|
14
|
+
/** 描边线型:只对圆角矩形生效;缺省实线 */
|
|
15
|
+
strokeDash?: "dashed" | "dotted";
|
|
16
|
+
level: SketchLevel;
|
|
17
|
+
seed: number;
|
|
18
|
+
}
|
|
19
|
+
/** 手绘圆角矩形框:画框、分栏、文本底板、导图节点共用;不接收指针事件,命中仍由原图形承担 */
|
|
20
|
+
declare const SketchRect: import("react").MemoExoticComponent<(props: SketchRectProps) => import("react/jsx-runtime").JSX.Element>;
|
|
21
|
+
export default SketchRect;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { LucideIcon } from "lucide-react";
|
|
3
|
+
export interface ToolMenuItem {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon: LucideIcon;
|
|
7
|
+
onSelect: () => void;
|
|
8
|
+
}
|
|
9
|
+
/** 带子菜单的工具按钮:按钮右下角小三角,点开是 Menu 公共件 */
|
|
10
|
+
export declare function ToolMenu({ label, icon, items, active, }: {
|
|
11
|
+
label: string;
|
|
12
|
+
icon: ReactNode;
|
|
13
|
+
items: ToolMenuItem[];
|
|
14
|
+
active?: boolean;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const ARROW_SIZE = 6;
|
|
2
|
+
export declare const ARROW_CONNECT_POINT_FILL = "var(--tau-accent)";
|
|
3
|
+
export declare const ARROW_CONNECT_POINT_RADIUS = 4;
|
|
4
|
+
export declare const ARROW_CONNECT_PROXIMITY_RADIUS = 28;
|
|
5
|
+
export declare const ARROW_CONNECT_PROXIMITY_HIDE_DELAY = 80;
|
|
6
|
+
export declare const ARROW_DROP_PROXIMITY_RADIUS = 10;
|
|
7
|
+
export declare const DEFAULT_ARROW_LINE_COLOR = "currentColor";
|
|
8
|
+
export declare const DEFAULT_ARROW_LINE_WIDTH = 2;
|
|
9
|
+
export declare const ARROW_CONNECT_ID: {
|
|
10
|
+
readonly TOP: "top";
|
|
11
|
+
readonly BOTTOM: "bottom";
|
|
12
|
+
readonly LEFT: "left";
|
|
13
|
+
readonly RIGHT: "right";
|
|
14
|
+
readonly CENTER: "center";
|
|
15
|
+
readonly CUSTOM: "custom";
|
|
16
|
+
};
|
|
17
|
+
export declare const ARROW_CUSTOM_CONNECT_PROXIMITY = 14;
|
|
18
|
+
export declare const ARROW_CUSTOM_CONNECT_MIN_WORLD = 12;
|
|
19
|
+
export declare const ARROW_CUSTOM_BIND_MARKER_RADIUS = 3.5;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const DEFAULT_GEOMETRY_FILL = "none";
|
|
2
|
+
export declare const DEFAULT_GEOMETRY_FILL_OPACITY = 0;
|
|
3
|
+
export declare const DEFAULT_GEOMETRY_STROKE = "currentColor";
|
|
4
|
+
export declare const DEFAULT_GEOMETRY_STROKE_WIDTH = 1;
|
|
5
|
+
export declare const DEFAULT_GEOMETRY_STROKE_OPACITY = 1;
|
|
6
|
+
export declare const DEFAULT_GEOMETRY_CORNER_RADIUS = 0;
|
|
7
|
+
export declare const DEFAULT_GEOMETRY_TEXT_ALIGN = "center";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EShadowSize } from "./shadow";
|
|
2
|
+
export declare enum EDescriptionPosition {
|
|
3
|
+
TOP = "top",
|
|
4
|
+
BOTTOM = "bottom"
|
|
5
|
+
}
|
|
6
|
+
export declare enum EDescriptionAlignment {
|
|
7
|
+
LEFT = "left",
|
|
8
|
+
CENTER = "center",
|
|
9
|
+
RIGHT = "right"
|
|
10
|
+
}
|
|
11
|
+
export declare const IMAGE_DESCRIPTION_HEIGHT = 24;
|
|
12
|
+
export declare const IMAGE_DESCRIPTION_PADDING = "4px 8px";
|
|
13
|
+
export declare const IMAGE_DESCRIPTION_MARGIN = 8;
|
|
14
|
+
export declare const IMAGE_DESCRIPTION_LIGHT_COLOR = "#666666";
|
|
15
|
+
export declare const IMAGE_DESCRIPTION_DARK_COLOR = "#aaaaaa";
|
|
16
|
+
export declare const IMAGE_DESCRIPTION_PLACEHOLDER = "\u6DFB\u52A0\u63CF\u8FF0...";
|
|
17
|
+
export declare const DEFAULT_DESCRIPTION = "";
|
|
18
|
+
export declare const DEFAULT_DESCRIPTION_POSITION = EDescriptionPosition.BOTTOM;
|
|
19
|
+
export declare const DEFAULT_DESCRIPTION_ALIGNMENT = EDescriptionAlignment.CENTER;
|
|
20
|
+
export declare const DEFAULT_DESCRIPTION_FONT_SIZE = 10;
|
|
21
|
+
export declare const DEFAULT_IMAGE_SHADOW_SIZE = EShadowSize.None;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./map";
|
|
2
|
+
export * from "./select";
|
|
3
|
+
export * from "./tools";
|
|
4
|
+
export * from "./arrow";
|
|
5
|
+
export * from "./resize";
|
|
6
|
+
export * from "./geometry";
|
|
7
|
+
export * from "./text-style";
|
|
8
|
+
export * from "./mind";
|
|
9
|
+
export * from "./viewport";
|
|
10
|
+
export * from "./grid";
|
|
11
|
+
export * from "./shadow";
|
|
12
|
+
export * from "./sketch";
|
|
13
|
+
export declare const FIT_VIEW_PADDING = 50;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 思维导图主题 = 配色(种子色相)× 风格(节点轻重)× 明暗。
|
|
3
|
+
* 这里只存种子,具体色值由 MindThemeUtil 在 OKLCH 空间派生,并保证文字对比度 ≥ 4.5:1。
|
|
4
|
+
* 着色按分支:同一条二级分支及其子孙共用一个色相,层级靠「实心 → 浅底 → 纯文字」区分。
|
|
5
|
+
*/
|
|
6
|
+
export interface MindHue {
|
|
7
|
+
/** OKLCH 色相(度) */
|
|
8
|
+
h: number;
|
|
9
|
+
/** OKLCH 彩度,0 为纯灰 */
|
|
10
|
+
c: number;
|
|
11
|
+
}
|
|
12
|
+
export interface MindPalette {
|
|
13
|
+
id: string;
|
|
14
|
+
label: string;
|
|
15
|
+
root: MindHue;
|
|
16
|
+
/** 分支色相,按二级节点顺序循环 */
|
|
17
|
+
hues: MindHue[];
|
|
18
|
+
/** 深色画布下根节点仍用深色实底(霓虹这类以深底为特征的配色) */
|
|
19
|
+
rootAlwaysDark?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export type MindThemeStyle = "solid" | "soft" | "outline";
|
|
22
|
+
export declare const MIND_THEME_STYLES: Array<{
|
|
23
|
+
value: MindThemeStyle;
|
|
24
|
+
label: string;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const MIND_PALETTES: MindPalette[];
|
|
27
|
+
export declare const DEFAULT_THEME_ID = "classic";
|
|
28
|
+
export declare const DEFAULT_THEME_STYLE: MindThemeStyle;
|
|
29
|
+
export declare function getPaletteById(id: string | undefined): MindPalette;
|
|
30
|
+
export declare function isMindThemeStyle(v: unknown): v is MindThemeStyle;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const MIND_COLORS: readonly [{
|
|
2
|
+
readonly background: "rgb(62, 136, 245)";
|
|
3
|
+
readonly textColor: "#fff";
|
|
4
|
+
readonly theme: "dark";
|
|
5
|
+
}, {
|
|
6
|
+
readonly background: "rgb(238, 238, 238)";
|
|
7
|
+
readonly textColor: "#000";
|
|
8
|
+
readonly theme: "light";
|
|
9
|
+
}, {
|
|
10
|
+
readonly background: "transparent";
|
|
11
|
+
readonly textColor: "currentColor";
|
|
12
|
+
}];
|
|
13
|
+
export declare const MIND_LINE_COLORS: string[];
|
|
14
|
+
export declare const getMindDragSourceId: (nodeId: string) => string;
|