@xiongtao.xt/tau-plugins 0.57.0 → 0.59.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 +8 -0
- package/docs/README.md +1 -1
- package/docs/ai.md +1 -1
- package/docs/app-surfaces.md +1 -1
- package/docs/getting-started.md +1 -1
- package/docs/notifications-and-voice.md +3 -1
- package/docs/pages.md +73 -4
- package/docs/permissions.md +1 -1
- package/docs/plugin-basics.md +1 -1
- package/docs/portability.md +34 -33
- package/docs/references.md +2 -0
- package/docs/settings-and-commands.md +3 -0
- package/docs/windows.md +18 -18
- package/package.json +1 -1
- package/publish-artifacts.js +20 -18
- package/tailwind.css +3 -3
- package/types/packages/collaboration/src/document-history-edit.d.ts +11 -0
- package/types/packages/collaboration/src/document-history.d.ts +91 -0
- package/types/packages/collaboration/src/index.d.ts +2 -0
- package/types/packages/collaboration/src/node-document.d.ts +1 -1
- package/types/packages/db-schema/content-identities.d.ts +1 -1
- package/types/packages/editor/src/core/CoreEditor.d.ts +10 -1
- package/types/packages/editor/src/core/api/extension.d.ts +0 -1
- package/types/packages/editor/src/core/api/index.d.ts +3 -1
- package/types/packages/editor/src/core/utils/nodeOperations.d.ts +1 -0
- package/types/packages/editor/src/core/utils/undoStep.d.ts +6 -0
- package/types/packages/editor/src/core/utils/wrapInlineText.d.ts +4 -0
- package/types/packages/editor/src/extensions/kbd/src/types.d.ts +2 -2
- package/types/packages/editor/src/extensions/link/src/types.d.ts +2 -2
- package/types/packages/editor/src/extensions/styled-text/src/types.d.ts +2 -2
- package/types/packages/editor/src/extensions/underline/src/types.d.ts +2 -2
- package/types/packages/markdown/src/codec.d.ts +6 -2
- package/types/packages/markdown/src/markdown.d.ts +2 -1
- package/types/packages/markdown/src/positionMapper.d.ts +7 -1
- package/types/packages/plugins/src/app.d.ts +2 -0
- package/types/packages/plugins/src/index.d.ts +1 -1
- package/types/packages/plugins/src/notifications.d.ts +2 -0
- package/types/packages/plugins/src/pages.d.ts +8 -2
- package/types/packages/shared/src/chat-core/aiRunProtocol.d.ts +1 -1
- package/types/packages/shared/src/chat-core/messages.d.ts +13 -4
- package/types/packages/themes/src/themes/ink.theme.d.ts +1 -2
- package/types/packages/themes/src/themes/mint.theme.d.ts +1 -2
- package/types/packages/themes/src/themes/ocean.theme.d.ts +1 -2
- package/types/packages/themes/src/themes/paper.theme.d.ts +1 -2
- package/types/packages/themes/src/themes/sakura.theme.d.ts +1 -2
- package/types/packages/themes/src/themes/wisteria.theme.d.ts +1 -2
- package/types/packages/ui/src/cn.d.ts +1 -1
- package/types/packages/ui/src/primitives/AnchoredPanel.d.ts +3 -3
- package/types/packages/ui/src/primitives/Button.d.ts +4 -4
- package/types/packages/ui/src/primitives/Checkbox.d.ts +2 -2
- package/types/packages/ui/src/primitives/ConfirmDialog.d.ts +3 -3
- package/types/packages/ui/src/primitives/Dialog.d.ts +4 -4
- package/types/packages/ui/src/primitives/Loading.d.ts +1 -1
- package/types/packages/ui/src/primitives/Menu.d.ts +1 -1
- package/types/packages/ui/src/primitives/Notification.d.ts +4 -2
- package/types/packages/ui/src/primitives/Popover.d.ts +3 -3
- package/types/packages/ui/src/primitives/Radio.d.ts +2 -3
- package/types/packages/ui/src/primitives/RadioGroup.d.ts +1 -1
- package/types/packages/ui/src/primitives/Segmented.d.ts +3 -3
- package/types/packages/ui/src/primitives/Select.d.ts +6 -6
- package/types/packages/ui/src/primitives/Switch.d.ts +2 -2
- package/types/packages/ui/src/primitives/Tag.d.ts +2 -3
- package/types/packages/ui/src/primitives/Toast.d.ts +1 -1
- package/types/packages/ui/src/primitives/Tooltip.d.ts +5 -5
- package/types/packages/ui/src/primitives/ValueDisplay.d.ts +2 -3
- package/types/packages/ui/src/primitives/anchoredPosition.d.ts +1 -2
- package/types/packages/ui/src/primitives/datepicker/DatePicker.d.ts +2 -2
- package/types/packages/ui/src/primitives/datepicker/DateRangePicker.d.ts +1 -1
- package/types/packages/ui/src/primitives/input/Input.d.ts +4 -4
- package/types/packages/ui/src/primitives/input/NumberInput.d.ts +2 -2
- package/types/packages/ui/src/primitives/input/Textarea.d.ts +1 -1
- package/types/packages/whiteboard/src/Board.d.ts +8 -6
- package/types/packages/whiteboard/src/{WhiteBoard.d.ts → Whiteboard.d.ts} +6 -6
- package/types/packages/whiteboard/src/chrome/index.d.ts +1 -1
- package/types/packages/whiteboard/src/components/ArrowConnectPoint/index.d.ts +26 -0
- package/types/packages/whiteboard/src/components/ArrowConnectPointGroup/index.d.ts +3 -0
- package/types/packages/whiteboard/src/components/DocumentElement/index.d.ts +2 -0
- package/types/packages/whiteboard/src/components/ExcerptElement/index.d.ts +13 -0
- package/types/packages/whiteboard/src/components/SketchPopover.d.ts +1 -1
- package/types/packages/whiteboard/src/constants/arrow.d.ts +0 -2
- package/types/packages/whiteboard/src/constants/mind.d.ts +0 -13
- package/types/packages/whiteboard/src/constants/text-style.d.ts +1 -1
- package/types/packages/whiteboard/src/extensions/authorApi.d.ts +0 -1
- package/types/packages/whiteboard/src/extensions/events.d.ts +0 -1
- package/types/packages/whiteboard/src/hooks/useDropArrow.d.ts +1 -1
- package/types/packages/whiteboard/src/hooks/useReadonly.d.ts +1 -0
- package/types/packages/whiteboard/src/hooks/useSelectState.d.ts +0 -1
- package/types/packages/whiteboard/src/index.d.ts +10 -6
- package/types/packages/whiteboard/src/plugins/ArrowPlugin.d.ts +1 -1
- package/types/packages/whiteboard/src/plugins/ColumnPlugin.d.ts +1 -1
- package/types/packages/whiteboard/src/plugins/CommonPlugin.d.ts +10 -10
- package/types/packages/whiteboard/src/plugins/DocumentPlugin.d.ts +36 -3
- package/types/packages/whiteboard/src/plugins/ExcerptPlugin.d.ts +48 -0
- package/types/packages/whiteboard/src/plugins/FramePlugin.d.ts +1 -1
- package/types/packages/whiteboard/src/plugins/GeometryPlugin.d.ts +5 -2
- package/types/packages/whiteboard/src/plugins/MindPlugin.d.ts +1 -2
- package/types/packages/whiteboard/src/plugins/WebviewPlugin.d.ts +1 -1
- package/types/packages/whiteboard/src/plugins/{WhiteBoardPlugin.d.ts → WhiteboardPlugin.d.ts} +8 -5
- package/types/packages/whiteboard/src/plugins/index.d.ts +2 -1
- package/types/packages/whiteboard/src/public.d.ts +23 -1
- package/types/packages/whiteboard/src/types/board.d.ts +10 -10
- package/types/packages/whiteboard/src/types/element.d.ts +6 -1
- package/types/packages/whiteboard/src/types/operation.d.ts +1 -1
- package/types/packages/whiteboard/src/types/selection.d.ts +1 -1
- package/types/packages/whiteboard/src/types/sketch.d.ts +2 -2
- package/types/packages/whiteboard/src/types/viewport.d.ts +1 -1
- package/types/packages/whiteboard/src/utils/ArrowStyleUtil.d.ts +0 -1
- package/types/packages/whiteboard/src/utils/CanvasUtil.d.ts +0 -1
- package/types/packages/whiteboard/src/utils/ClipboardUtil.d.ts +0 -5
- package/types/packages/whiteboard/src/utils/HandwriteUtil.d.ts +0 -1
- package/types/packages/whiteboard/src/utils/MindUtil.d.ts +0 -3
- package/types/packages/whiteboard/src/utils/PathUtil.d.ts +1 -1
- package/types/packages/whiteboard/src/utils/PointUtil.d.ts +0 -1
- package/types/packages/whiteboard/src/utils/PresentationManager.d.ts +1 -1
- package/types/packages/whiteboard/src/utils/TextStyleStore.d.ts +2 -1
- package/types/packages/whiteboard/src/utils/index.d.ts +0 -1
- package/types/packages/whiteboard/src/utils/sketch/handText.d.ts +1 -1
- package/types/packages/whiteboard/src/utils/sketch/index.d.ts +4 -5
- package/types/packages/whiteboard/src/utils/sketch/shape.d.ts +1 -2
- package/types/packages/whiteboard/src/utils/ViewportUtil.d.ts +0 -10
|
@@ -88,17 +88,17 @@ export declare abstract class CommonPlugin implements IBoardPlugin {
|
|
|
88
88
|
})[];
|
|
89
89
|
static getCustomBindPoint(element: CommonElement, customOffset: CustomOffset): Point;
|
|
90
90
|
getArrowBindPoint(_board: Board, element: CommonElement, connectId: string, customOffset?: CustomOffset): Point | null;
|
|
91
|
-
isHit(_board: Board, element: CommonElement
|
|
92
|
-
moveElement(_board: Board, element: CommonElement
|
|
93
|
-
getBounds(_board: Board, element: CommonElement
|
|
94
|
-
minX:
|
|
95
|
-
minY:
|
|
96
|
-
maxX:
|
|
97
|
-
maxY:
|
|
91
|
+
isHit(_board: Board, element: CommonElement, x: number, y: number): boolean;
|
|
92
|
+
moveElement(_board: Board, element: CommonElement, dx: number, dy: number): BoardElement | null;
|
|
93
|
+
getBounds(_board: Board, element: CommonElement): {
|
|
94
|
+
minX: number;
|
|
95
|
+
minY: number;
|
|
96
|
+
maxX: number;
|
|
97
|
+
maxY: number;
|
|
98
98
|
};
|
|
99
|
-
isElementSelected(board: Board, element: CommonElement
|
|
100
|
-
protected onResizeStart(element: CommonElement
|
|
101
|
-
protected onResize(board: Board, element: CommonElement
|
|
99
|
+
isElementSelected(board: Board, element: CommonElement, selectArea?: Selection["selectArea"]): boolean;
|
|
100
|
+
protected onResizeStart(element: CommonElement): void;
|
|
101
|
+
protected onResize(board: Board, element: CommonElement, position: EHandlerPosition, startPoint: Point, endPoint: Point, isPreserveRatio?: boolean, isAdsorb?: boolean): void | CommonElement;
|
|
102
102
|
protected onResizeEnd(board: Board): void;
|
|
103
103
|
}
|
|
104
104
|
export default CommonPlugin;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Board, BoardElement, IBoardPlugin, EHandlerPosition, Point, ContextMenuContext, PluginContextMenuItem, IElementCapabilities } from "../types/index";
|
|
2
|
+
import type { ViewPort } from "../types/viewport";
|
|
2
3
|
import { CommonPlugin, CommonElement } from "./CommonPlugin";
|
|
3
|
-
/**
|
|
4
|
-
export type DocumentKind = "card" | "article" | "project-item" | "diary-moment";
|
|
4
|
+
/** 文档卡可指向的实体:正文实体写法同 EntityRefKind;pdf 是一整份 PDF(pdfs.id),没有正文 */
|
|
5
|
+
export type DocumentKind = "card" | "article" | "project-item" | "diary-moment" | "pdf";
|
|
5
6
|
/**
|
|
6
|
-
* 文档卡:引用一篇库里的正文(卡片 / 文章 / 项目文档 /
|
|
7
|
+
* 文档卡:引用一篇库里的正文(卡片 / 文章 / 项目文档 / 日记里的一条碎碎念),或一整份 PDF。画布上只读预览,展开后编辑;
|
|
7
8
|
* 正文不存在元素上,删除元素不影响原文。只存 entityRef,不存 contentId——白板保存按 contentId 计引用。
|
|
8
9
|
*/
|
|
9
10
|
export interface DocumentElement extends CommonElement {
|
|
@@ -23,8 +24,40 @@ export declare const DOCUMENT_DEFAULT_SIZE: Record<DocumentKind, {
|
|
|
23
24
|
width: number;
|
|
24
25
|
height: number;
|
|
25
26
|
}>;
|
|
27
|
+
/**
|
|
28
|
+
* 放入请求:`/`、工具栏、右键「文档」、从文档卡拖出到空白处都只发这个请求,宿主的检索面板响应。
|
|
29
|
+
* - at:放入位置(画布坐标),一行内容从这里向右展开;
|
|
30
|
+
* - screen:面板贴在哪里(client 坐标),缺省放在视口中央;
|
|
31
|
+
* - linkFrom:放入后从这个元素连一条箭头到每个新元素。
|
|
32
|
+
*/
|
|
33
|
+
export declare const DOCUMENT_INSERT_EVENT = "tau.document.insert";
|
|
34
|
+
export interface DocumentInsertRequest {
|
|
35
|
+
at: Point;
|
|
36
|
+
/** at 是行的左缘还是中心,缺省左缘 */
|
|
37
|
+
align?: "start" | "center";
|
|
38
|
+
screen?: Point;
|
|
39
|
+
linkFrom?: string;
|
|
40
|
+
/** 拖出时画着的临时连线:面板关闭(放入或取消)时由宿主调用移除 */
|
|
41
|
+
release?(): void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 速览:按住文档卡 250ms,或选中后按住空格,卡面原位放大到能读,松开落回。
|
|
45
|
+
* 载荷为元素 id(开始)或 null(结束);宿主的速览层响应,只读画布同样可用。
|
|
46
|
+
*/
|
|
47
|
+
export declare const DOCUMENT_PEEK_EVENT = "tau.document.peek";
|
|
48
|
+
export declare const DOCUMENT_PEEK_DELAY = 250;
|
|
49
|
+
export declare const requestPeekDocument: (board: Board, elementId: string | null) => void;
|
|
50
|
+
/** PDF 文档卡翻页:选中 PDF 卡按 [ / ],载荷 { id, delta };宿主写回全局「上次读到的页」 */
|
|
51
|
+
export declare const DOCUMENT_TURN_PAGE_EVENT = "tau.document.turn-page";
|
|
52
|
+
/** 长出相关请求:选中文档卡按 R 或点属性条「相关」,载荷为元素 id;宿主在卡旁浮出建议 */
|
|
53
|
+
export declare const DOCUMENT_RELATED_EVENT = "tau.document.related";
|
|
26
54
|
export declare const isDocumentElement: (element: BoardElement | null | undefined) => boolean;
|
|
27
55
|
export declare const requestOpenDocument: (board: Board, elementId: string) => void;
|
|
56
|
+
export declare const requestInsertDocument: (board: Board, request: DocumentInsertRequest) => void;
|
|
57
|
+
/** 视口中央的放入请求(工具栏按钮、没有光标位置时) */
|
|
58
|
+
export declare function viewportInsertRequest(source: {
|
|
59
|
+
viewPort: ViewPort;
|
|
60
|
+
}): DocumentInsertRequest;
|
|
28
61
|
export declare class DocumentPlugin extends CommonPlugin implements IBoardPlugin {
|
|
29
62
|
private readonly actions;
|
|
30
63
|
name: string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Board, BoardElement, IBoardPlugin, EHandlerPosition, Point, IElementCapabilities } from "../types/index";
|
|
2
|
+
import { CommonPlugin, CommonElement } from "./CommonPlugin";
|
|
3
|
+
/** 摘录的来源:PDF 里的一处标注,或一篇正文 */
|
|
4
|
+
export type ExcerptSource = {
|
|
5
|
+
kind: "pdf";
|
|
6
|
+
entity: import("../../../db-schema/content-identities").ContentEntityReference & {
|
|
7
|
+
kind: "pdf";
|
|
8
|
+
};
|
|
9
|
+
annotationObjectId: string;
|
|
10
|
+
page: number;
|
|
11
|
+
} | {
|
|
12
|
+
kind: "pdf";
|
|
13
|
+
pdfId: number;
|
|
14
|
+
annotationId: number | null;
|
|
15
|
+
page: number;
|
|
16
|
+
} | {
|
|
17
|
+
kind: "card" | "article" | "project-item";
|
|
18
|
+
id: number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* 摘录:从阅读纸里摘下的一段原文,带来源。原文与笔记存快照(来源删除后照样显示),不进库、不建索引;
|
|
22
|
+
* 回到原文由来源条发 EXCERPT_OPEN_SOURCE_EVENT,宿主打开来源并定位。
|
|
23
|
+
*/
|
|
24
|
+
export interface ExcerptElement extends CommonElement {
|
|
25
|
+
type: "excerpt";
|
|
26
|
+
source?: ExcerptSource;
|
|
27
|
+
quote?: string;
|
|
28
|
+
note?: string;
|
|
29
|
+
/** 高亮色(EHighlightColor 的值),卡片左侧色条 */
|
|
30
|
+
color?: string;
|
|
31
|
+
/** 来源标题快照:来源条显示 */
|
|
32
|
+
sourceTitle?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare const EXCERPT_OPEN_SOURCE_EVENT = "tau.excerpt.open-source";
|
|
35
|
+
export declare const EXCERPT_DEFAULT_SIZE: {
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
};
|
|
39
|
+
export declare const isExcerptElement: (element: BoardElement | null | undefined) => boolean;
|
|
40
|
+
export declare class ExcerptPlugin extends CommonPlugin implements IBoardPlugin {
|
|
41
|
+
name: string;
|
|
42
|
+
constructor();
|
|
43
|
+
getCapabilities(): IElementCapabilities;
|
|
44
|
+
onResize(board: Board, element: ExcerptElement, position: EHandlerPosition, startPoint: Point, endPoint: Point, isPreserveRatio?: boolean, isAdsorb?: boolean): void;
|
|
45
|
+
render(_board: Board, { element }: {
|
|
46
|
+
element: ExcerptElement;
|
|
47
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
}
|
|
@@ -9,6 +9,6 @@ export declare class FramePlugin extends CommonPlugin implements IBoardPlugin {
|
|
|
9
9
|
protected onResizeEnd(board: Board): void;
|
|
10
10
|
render(_board: Board, { element, children }: {
|
|
11
11
|
element: FrameElement;
|
|
12
|
-
children?:
|
|
12
|
+
children?: React.ReactNode;
|
|
13
13
|
}): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
}
|
|
@@ -11,10 +11,13 @@ export interface GeometryElement extends CommonElement {
|
|
|
11
11
|
stroke?: string;
|
|
12
12
|
strokeWidth?: number;
|
|
13
13
|
strokeOpacity?: number;
|
|
14
|
-
/**
|
|
14
|
+
/** 手绘模式下的填充样式;普通模式一律按实色渲染,缺省 solid */
|
|
15
15
|
fillStyle?: SketchFillStyle;
|
|
16
16
|
paths: string[];
|
|
17
|
-
|
|
17
|
+
/** 渲染器按图形类型读取附加参数(如矩形圆角);未知键原样保留 */
|
|
18
|
+
extraInfo?: {
|
|
19
|
+
cornerRadius?: number;
|
|
20
|
+
} & Record<string, unknown>;
|
|
18
21
|
text: {
|
|
19
22
|
align: "left" | "center" | "right";
|
|
20
23
|
content: Descendant[];
|
|
@@ -2,14 +2,13 @@ import { type TextExtensionOptions } from "../extensions/text";
|
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
3
|
import { Board, IBoardPlugin, MindNodeElement, Selection, MindDragState, ContextMenuContext, PluginContextMenuItem, IElementCapabilities, BoardElement } from "../types/index";
|
|
4
4
|
import type { InteractionState } from "../interactions/InteractionState";
|
|
5
|
-
export declare const EMPTY_MIND_DRAG_STATE: MindDragState;
|
|
6
5
|
export declare class MindPlugin implements IBoardPlugin {
|
|
7
6
|
private readonly text;
|
|
8
7
|
name: string;
|
|
9
8
|
constructor(text?: TextExtensionOptions);
|
|
10
9
|
getCapabilities(): IElementCapabilities;
|
|
11
10
|
private dragState;
|
|
12
|
-
private
|
|
11
|
+
private cancelDragPreviewFrame;
|
|
13
12
|
private pendingPointerMove;
|
|
14
13
|
private listeners;
|
|
15
14
|
getContextMenu(context: ContextMenuContext): PluginContextMenuItem[];
|
|
@@ -4,7 +4,7 @@ export declare class WebviewPlugin extends CommonPlugin implements IBoardPlugin
|
|
|
4
4
|
name: string;
|
|
5
5
|
constructor();
|
|
6
6
|
getContextMenu(context: ContextMenuContext): PluginContextMenuItem[];
|
|
7
|
-
isHit(_board: Board, element: CommonElement
|
|
7
|
+
isHit(_board: Board, element: CommonElement, x: number, y: number): boolean;
|
|
8
8
|
render(_board: Board, { element }: {
|
|
9
9
|
element: WebviewElement;
|
|
10
10
|
}): import("react/jsx-runtime").JSX.Element;
|
package/types/packages/whiteboard/src/plugins/{WhiteBoardPlugin.d.ts → WhiteboardPlugin.d.ts}
RENAMED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Board, IBoardPlugin, EHandlerPosition, Point, ContextMenuContext, PluginContextMenuItem, IElementCapabilities } from "../types/index";
|
|
2
2
|
import { CommonPlugin, CommonElement } from "./CommonPlugin";
|
|
3
|
-
export interface
|
|
3
|
+
export interface WhiteboardElement extends CommonElement {
|
|
4
4
|
type: "whiteboard";
|
|
5
5
|
/** 引用的整块白板 */
|
|
6
|
-
|
|
6
|
+
whiteboardId?: number;
|
|
7
7
|
/** 旧元素:只引用了某一页(新元素不再写入) */
|
|
8
|
+
whiteboardContentId?: number;
|
|
9
|
+
/** 旧画布元素的误拼 key,读取兼容 */
|
|
10
|
+
whiteBoardId?: number;
|
|
8
11
|
whiteBoardContentId?: number;
|
|
9
12
|
/** 插入时的白板标题(白板读取失败时兜底显示) */
|
|
10
13
|
name: string;
|
|
@@ -18,14 +21,14 @@ export interface WhiteBoardElement extends CommonElement {
|
|
|
18
21
|
theme?: "light" | "dark";
|
|
19
22
|
resizable?: boolean;
|
|
20
23
|
}
|
|
21
|
-
export declare class
|
|
24
|
+
export declare class WhiteboardPlugin extends CommonPlugin implements IBoardPlugin {
|
|
22
25
|
private readonly canCreate;
|
|
23
26
|
name: string;
|
|
24
27
|
constructor(canCreate?: boolean);
|
|
25
28
|
getCapabilities(): IElementCapabilities;
|
|
26
29
|
getContextMenu(context: ContextMenuContext): PluginContextMenuItem[];
|
|
27
|
-
onResize(board: Board, element:
|
|
30
|
+
onResize(board: Board, element: WhiteboardElement, position: EHandlerPosition, startPoint: Point, endPoint: Point, _isPreserveRatio?: boolean, isAdsorb?: boolean): void;
|
|
28
31
|
render(board: Board, { element }: {
|
|
29
|
-
element:
|
|
32
|
+
element: WhiteboardElement;
|
|
30
33
|
}): import("react/jsx-runtime").JSX.Element;
|
|
31
34
|
}
|
|
@@ -4,6 +4,7 @@ export * from "./RichTextPlugin";
|
|
|
4
4
|
export * from "./GeometryPlugin";
|
|
5
5
|
export * from "./HandwritePlugin";
|
|
6
6
|
export * from "./DocumentPlugin";
|
|
7
|
+
export * from "./ExcerptPlugin";
|
|
7
8
|
export * from "./CommonPlugin";
|
|
8
9
|
export * from "./ArrowPlugin";
|
|
9
10
|
export * from "./ImagePlugin";
|
|
@@ -13,7 +14,7 @@ export * from "./MindPlugin";
|
|
|
13
14
|
export * from "./PresentationPlugin";
|
|
14
15
|
export * from "./WebviewPlugin";
|
|
15
16
|
export * from "./FramePlugin";
|
|
16
|
-
export * from "./
|
|
17
|
+
export * from "./WhiteboardPlugin";
|
|
17
18
|
export * from "./ColumnPlugin";
|
|
18
19
|
export * from "./FileDragDropPlugin";
|
|
19
20
|
export * from "./ExportImagePlugin";
|
|
@@ -2,7 +2,9 @@ import type { WhiteboardAPI, WhiteboardExtension, WhiteboardSnapshot } from "./e
|
|
|
2
2
|
import { BoardUtil as InternalBoardUtil } from "./utils/BoardUtil";
|
|
3
3
|
import { ViewPortTransforms as InternalViewport } from "./transforms/index";
|
|
4
4
|
import { VideoUtil as InternalVideo } from "./utils/VideoUtil";
|
|
5
|
-
import type { BoardElement } from "./types/index";
|
|
5
|
+
import type { BoardElement, Point } from "./types/index";
|
|
6
|
+
import { type DocumentElement } from "./plugins/DocumentPlugin";
|
|
7
|
+
import { type ExcerptElement } from "./plugins/ExcerptPlugin";
|
|
6
8
|
import type { MediaCapabilities } from "./extensions/media";
|
|
7
9
|
import { FrameUtil as InternalFrame } from "./utils/FrameUtil";
|
|
8
10
|
import { PointUtil as InternalPoint } from "./utils/PointUtil";
|
|
@@ -52,3 +54,23 @@ export declare const AudioUtil: {
|
|
|
52
54
|
insertAudioFromUrl: (url: string, api: WhiteboardAPI) => Promise<void>;
|
|
53
55
|
insertAudioFromTTS: (blob: Blob, text: string, api: WhiteboardAPI, media: MediaCapabilities) => Promise<void>;
|
|
54
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* 把一组文档放到白板:从 at 起排成一行(align 为 center 时以 at 为中心),可选从 linkFrom 连箭头,选中新卡。
|
|
59
|
+
* 插入、连线与选中是一次 apply(一步撤销)。返回新元素;linkFrom 已不存在时不连线。
|
|
60
|
+
*/
|
|
61
|
+
export declare function placeDocuments(api: WhiteboardAPI, documents: readonly Pick<DocumentElement, "entityRef" | "entity" | "title">[], options: {
|
|
62
|
+
at: Point;
|
|
63
|
+
align?: "start" | "center";
|
|
64
|
+
linkFrom?: string;
|
|
65
|
+
/** 保留当前选中(长出相关:放入建议后还要继续看这张卡的其他建议) */
|
|
66
|
+
keepSelection?: boolean;
|
|
67
|
+
}): DocumentElement[];
|
|
68
|
+
/**
|
|
69
|
+
* 放一张摘录:at 为左缘中点(align center 时为中心);linkFrom 存在时从来源卡画一条虚线箭头。
|
|
70
|
+
* 插入、连线与选中是一次 apply。返回新元素。
|
|
71
|
+
*/
|
|
72
|
+
export declare function placeExcerpt(api: WhiteboardAPI, excerpt: Pick<ExcerptElement, "source" | "quote" | "note" | "color" | "sourceTitle">, options: {
|
|
73
|
+
at: Point;
|
|
74
|
+
align?: "start" | "center";
|
|
75
|
+
linkFrom?: string;
|
|
76
|
+
}): ExcerptElement;
|
|
@@ -60,20 +60,20 @@ export interface IBoardPlugin {
|
|
|
60
60
|
onDragOver?: EventHandler;
|
|
61
61
|
onDragEnter?: EventHandler;
|
|
62
62
|
onDragLeave?: EventHandler;
|
|
63
|
-
getArrowBindPoint
|
|
64
|
-
isElementSelected
|
|
65
|
-
moveElement
|
|
66
|
-
isHit?(board: Board, element: BoardElement
|
|
67
|
-
render
|
|
68
|
-
element: BoardElement
|
|
69
|
-
children?: React.
|
|
70
|
-
})
|
|
71
|
-
getBounds
|
|
63
|
+
getArrowBindPoint?(board: Board, element: BoardElement, connectId: string, customOffset?: CustomOffset): Point | null;
|
|
64
|
+
isElementSelected?(board: Board, element: BoardElement, selectArea?: Selection["selectArea"]): boolean;
|
|
65
|
+
moveElement?(board: Board, element: BoardElement, offsetX: number, offsetY: number): BoardElement | null;
|
|
66
|
+
isHit?(board: Board, element: BoardElement, x: number, y: number): boolean;
|
|
67
|
+
render?(board: Board, value: {
|
|
68
|
+
element: BoardElement;
|
|
69
|
+
children?: React.ReactNode;
|
|
70
|
+
}): React.ReactElement;
|
|
71
|
+
getBounds?(board: Board, element: BoardElement): ElementBounds | null;
|
|
72
72
|
getContextMenu?: (context: ContextMenuContext) => PluginContextMenuItem[];
|
|
73
73
|
getCapabilities?: () => IElementCapabilities;
|
|
74
74
|
}
|
|
75
75
|
export interface ContextMenuModalPayload {
|
|
76
|
-
type: "
|
|
76
|
+
type: "image" | "video" | "audio" | "webview" | "whiteboard" | "export-image";
|
|
77
77
|
action?: string;
|
|
78
78
|
selectedElementIds?: string[];
|
|
79
79
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { EntityRef } from "../../../shared/entity-ref";
|
|
2
|
+
/** 元素指向的库内实体:正文实体(EntityRef),或一整份 PDF(文档卡) */
|
|
3
|
+
export type BoardEntityRef = EntityRef | {
|
|
4
|
+
kind: "pdf";
|
|
5
|
+
id: number;
|
|
6
|
+
};
|
|
2
7
|
import type { ElementSketch } from "./sketch";
|
|
3
8
|
import type { Point } from "./point";
|
|
4
9
|
/** 白板持久化元素;不依赖 Board 或内部插件实例。 */
|
|
@@ -10,7 +15,7 @@ export interface BoardElement {
|
|
|
10
15
|
children?: BoardElement[];
|
|
11
16
|
resizable?: boolean;
|
|
12
17
|
autoHeight?: boolean;
|
|
13
|
-
entityRef?:
|
|
18
|
+
entityRef?: BoardEntityRef;
|
|
14
19
|
entity?: import("../../../db-schema/content-identities").ContentEntityReference;
|
|
15
20
|
sketch?: ElementSketch;
|
|
16
21
|
schemaVersion?: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/** 页面画风:手绘 /
|
|
1
|
+
/** 页面画风:手绘 / 普通 */
|
|
2
2
|
export type SketchMode = "sketch" | "normal";
|
|
3
3
|
/** 笔触档位:工整 / 自然 / 潦草 */
|
|
4
4
|
export type SketchLevel = "neat" | "natural" | "loose";
|
|
5
5
|
/** 形状填充样式;普通模式下一律按实色渲染 */
|
|
6
6
|
export type SketchFillStyle = "solid" | "hatch" | "cross" | "scribble";
|
|
7
|
-
/** 页级画风,存在
|
|
7
|
+
/** 页级画风,存在 WhiteboardContent.data.sketch,缺省为 DEFAULT_PAGE_SKETCH */
|
|
8
8
|
export interface PageSketch {
|
|
9
9
|
mode: SketchMode;
|
|
10
10
|
level: SketchLevel;
|
|
@@ -10,6 +10,5 @@ export interface ArrowStylePreset {
|
|
|
10
10
|
animated: boolean;
|
|
11
11
|
animationSpeed: number;
|
|
12
12
|
}
|
|
13
|
-
export declare const getDefaultArrowStylePreset: () => ArrowStylePreset;
|
|
14
13
|
export declare const getPrevArrowStylePreset: () => ArrowStylePreset;
|
|
15
14
|
export declare const saveArrowStylePresetFromElement: (element: ArrowElement) => void;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { Board, BoardElement } from "../types/index";
|
|
2
2
|
export declare const buildClipboardPayload: (board: Board, elements: BoardElement[]) => string | null;
|
|
3
3
|
export declare const writeClipboardPayload: (payload: string) => Promise<boolean>;
|
|
4
|
-
declare const _default: {
|
|
5
|
-
buildClipboardPayload: (board: Board, elements: BoardElement[]) => string | null;
|
|
6
|
-
writeClipboardPayload: (payload: string) => Promise<boolean>;
|
|
7
|
-
};
|
|
8
|
-
export default _default;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { Board, ElementBounds, MindNodeElement, MindDragTarget } from "../types/index";
|
|
2
|
-
export declare const MIND_DRAG_HORIZONTAL_THRESHOLD_PX = 120;
|
|
3
|
-
export declare const MIND_DRAG_VERTICAL_THRESHOLD_PX = 80;
|
|
4
|
-
export declare const MIND_DRAG_TARGET_RETENTION_SCALE = 1.2;
|
|
5
2
|
export declare class MindUtil {
|
|
6
3
|
static isRoot(node: MindNodeElement): boolean;
|
|
7
4
|
static layout(node: MindNodeElement): MindNodeElement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BoardElement, Board, Operation } from "../types/index";
|
|
2
2
|
export type Path = number[];
|
|
3
3
|
export declare class PathUtil {
|
|
4
|
-
static getPathByElement(board: Board, element: BoardElement
|
|
4
|
+
static getPathByElement(board: Board, element: BoardElement): Path | null;
|
|
5
5
|
static getElementByPath(board: Board, path: number[]): BoardElement;
|
|
6
6
|
static getElement(children: BoardElement[], path: Path): BoardElement | null;
|
|
7
7
|
static getParentByPath(board: Board, path: Path): Board | BoardElement | null;
|
|
@@ -47,4 +47,3 @@ export declare class PointUtil {
|
|
|
47
47
|
static getResizedBBox(bbox: BBox, position: EHandlerPosition, anchor: Point, focus: Point): BBox;
|
|
48
48
|
static getResizeCursor(position: EHandlerPosition): "move" | "e-resize" | "n-resize" | "ne-resize" | "nw-resize" | "s-resize" | "se-resize" | "sw-resize" | "w-resize";
|
|
49
49
|
}
|
|
50
|
-
export default PointUtil;
|
|
@@ -11,7 +11,7 @@ export declare class PresentationManager {
|
|
|
11
11
|
constructor(board: Board, initialSequences?: PresentationSequence[]);
|
|
12
12
|
on(event: string, listener: (...args: any[]) => void): void;
|
|
13
13
|
off(event: string, listener: (...args: any[]) => void): void;
|
|
14
|
-
emit(event: string, ...args:
|
|
14
|
+
emit(event: string, ...args: unknown[]): void;
|
|
15
15
|
once(event: string, listener: (...args: any[]) => void): void;
|
|
16
16
|
get isPresentationMode(): boolean;
|
|
17
17
|
set isPresentationMode(value: boolean);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TextStyle } from "../constants/index";
|
|
2
2
|
/** 记住上一次选的外观,新建同类元素时沿用;只存语义,旧版色值键不再读取 */
|
|
3
|
-
|
|
3
|
+
declare class TextStyleStore {
|
|
4
4
|
private readonly prefix;
|
|
5
5
|
private readonly fallback;
|
|
6
6
|
constructor(prefix: string, fallback: TextStyle);
|
|
@@ -8,3 +8,4 @@ export declare class TextStyleStore {
|
|
|
8
8
|
load(): TextStyle;
|
|
9
9
|
}
|
|
10
10
|
export declare const RichTextUtil: TextStyleStore;
|
|
11
|
+
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export * from "./types";
|
|
2
|
-
export { sketchShape,
|
|
3
|
-
export { sketchArrow,
|
|
4
|
-
export { resolveSketch
|
|
2
|
+
export { sketchShape, type SketchOutline, type SketchShapeInput } from "./shape";
|
|
3
|
+
export { sketchArrow, type SketchArrowInput, type SketchArrowOutput } from "./arrow";
|
|
4
|
+
export { resolveSketch } from "./resolve";
|
|
5
5
|
export { inkSize } from "./levels";
|
|
6
|
-
export {
|
|
7
|
-
export { flattenPath } from "./geometry";
|
|
6
|
+
export { hashSeed } from "./random";
|
|
8
7
|
export { patchSketch, getSketchTargets, buildSketchOps } from "./batch";
|
|
9
8
|
export { handTextClass } from "./handText";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SketchFillStyle, SketchLevel } from "../../types/sketch";
|
|
2
|
-
import { type
|
|
2
|
+
import { type Vec } from "./geometry";
|
|
3
3
|
import type { SketchPath } from "./types";
|
|
4
4
|
export type SketchOutline = {
|
|
5
5
|
kind: "rect";
|
|
@@ -29,7 +29,6 @@ export interface SketchShapeInput {
|
|
|
29
29
|
level: SketchLevel;
|
|
30
30
|
seed: number;
|
|
31
31
|
}
|
|
32
|
-
export declare function outlinePolylines(outline: SketchOutline, width: number, height: number): Polyline[];
|
|
33
32
|
/** 闭合轮廓一笔绕一圈:随机起点,末尾一小段向外搭接,形成手绘的收口 */
|
|
34
33
|
export declare function loopStroke(loop: Vec[], amplitude: number, random: () => number, overlapRatio?: number): Vec[];
|
|
35
34
|
/** 排线间距随线宽变粗、随形状尺寸微调:大形状不稀、小形状不糊 */
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ViewPort } from "../types/index";
|
|
2
|
-
declare class ViewportUtil {
|
|
3
|
-
static isRectInViewport(rect: {
|
|
4
|
-
x: number;
|
|
5
|
-
y: number;
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
}, viewPort: ViewPort, expandPixels?: number): boolean;
|
|
9
|
-
}
|
|
10
|
-
export default ViewportUtil;
|