@agilehub/agile-editor 1.8.3 → 1.8.5

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.
Files changed (112) hide show
  1. package/dist/agile-editor.css +1 -1
  2. package/dist/agile-editor.js +24008 -15910
  3. package/dist/{i18n-E7gk29NK.js → i18n-DZxiNlPY.js} +481 -620
  4. package/dist/types/components/editor/callout-dialog.vue.d.ts +48 -0
  5. package/dist/types/components/editor/callout-gradient-editor.vue.d.ts +12 -0
  6. package/dist/types/components/editor/figure-caption-numbering-dialog.vue.d.ts +11 -0
  7. package/dist/types/components/editor/index.vue.d.ts +2 -2
  8. package/dist/types/components/editor/table-background-control.vue.d.ts +11 -0
  9. package/dist/types/components/editor/table-cell-properties.vue.d.ts +8 -0
  10. package/dist/types/components/editor/table-property-section.vue.d.ts +22 -0
  11. package/dist/types/components/index.d.ts +2 -0
  12. package/dist/types/components/index.vue.d.ts +898 -19
  13. package/dist/types/components/menus/bubble/image/replace.vue.d.ts +3 -0
  14. package/dist/types/components/menus/bubble/image/size.vue.d.ts +3 -0
  15. package/dist/types/components/menus/bubble/link/edit.vue.d.ts +3 -0
  16. package/dist/types/components/menus/toolbar/tools/bubble-note-editor.vue.d.ts +52 -0
  17. package/dist/types/components/menus/toolbar/tools/bubble-note-image.d.ts +3 -0
  18. package/dist/types/components/menus/toolbar/tools/bubble-note.vue.d.ts +9 -0
  19. package/dist/types/components/menus/toolbar/tools/figure-caption-numbering.vue.d.ts +15 -1
  20. package/dist/types/components/toolbar/classic.vue.d.ts +10 -10
  21. package/dist/types/components/toolbar/ribbon.vue.d.ts +10 -10
  22. package/dist/types/composables/i18n.d.ts +897 -18
  23. package/dist/types/extensions/bubble-note-content.d.ts +48 -0
  24. package/dist/types/extensions/bubble-note-extensions.d.ts +12 -0
  25. package/dist/types/extensions/bubble-note-render.d.ts +1 -0
  26. package/dist/types/extensions/bubble-note.d.ts +5 -0
  27. package/dist/types/extensions/callout/index.d.ts +3 -3
  28. package/dist/types/extensions/callout/title-view.vue.d.ts +93 -0
  29. package/dist/types/extensions/callout/title.d.ts +7 -0
  30. package/dist/types/extensions/code-block/index.d.ts +8 -0
  31. package/dist/types/extensions/columns/schema.d.ts +6 -1
  32. package/dist/types/extensions/courseware/reader-visibility.d.ts +6 -0
  33. package/dist/types/extensions/file/index.d.ts +4 -0
  34. package/dist/types/extensions/image/automatic-attributes.d.ts +6 -0
  35. package/dist/types/extensions/image/paste.d.ts +3 -0
  36. package/dist/types/extensions/indent.d.ts +1 -0
  37. package/dist/types/extensions/insert-newline.d.ts +2 -3
  38. package/dist/types/extensions/math/index.d.ts +2 -1
  39. package/dist/types/extensions/smart-sheet/model.d.ts +5 -0
  40. package/dist/types/extensions/table-column-resize.d.ts +15 -0
  41. package/dist/types/extensions/table.d.ts +29 -0
  42. package/dist/types/extensions/timeline/content.vue.d.ts +1 -0
  43. package/dist/types/extensions/timeline/index.d.ts +3 -6
  44. package/dist/types/extensions/timeline/model.d.ts +18 -15
  45. package/dist/types/extensions/trailing-node.d.ts +14 -0
  46. package/dist/types/i18n.d.ts +897 -18
  47. package/dist/types/options/config/callout-assets.d.ts +3 -0
  48. package/dist/types/options/config/callout-color-picker.d.ts +13 -0
  49. package/dist/types/options/config/callout-templates.d.ts +66 -0
  50. package/dist/types/options/config/index.d.ts +12 -0
  51. package/dist/types/options/config/table-color-picker.d.ts +6 -0
  52. package/dist/types/utils/base64url.d.ts +2 -0
  53. package/dist/types/utils/block-menu.d.ts +1 -0
  54. package/dist/types/utils/bookmark-attributes.d.ts +2 -0
  55. package/dist/types/utils/bubble-note-selection.d.ts +7 -0
  56. package/dist/types/utils/callout.d.ts +204 -0
  57. package/dist/types/utils/caption-numbering.d.ts +62 -0
  58. package/dist/types/utils/code-block-indent.d.ts +15 -0
  59. package/dist/types/utils/column-width.d.ts +9 -0
  60. package/dist/types/utils/document-attributes.d.ts +3 -0
  61. package/dist/types/utils/document-import.d.ts +4 -0
  62. package/dist/types/utils/document-loading.d.ts +14 -0
  63. package/dist/types/utils/document-save.d.ts +5 -0
  64. package/dist/types/utils/editor-scroll.d.ts +1 -0
  65. package/dist/types/utils/editor-view.d.ts +12 -0
  66. package/dist/types/utils/figure-caption-numbering.d.ts +11 -55
  67. package/dist/types/utils/figure-caption-visibility.d.ts +8 -0
  68. package/dist/types/utils/file.d.ts +5 -2
  69. package/dist/types/utils/font-size.d.ts +2 -0
  70. package/dist/types/utils/formula-size.d.ts +23 -0
  71. package/dist/types/utils/iframe.d.ts +5 -0
  72. package/dist/types/utils/image-display-size.d.ts +13 -0
  73. package/dist/types/utils/image-file-caption.d.ts +11 -0
  74. package/dist/types/utils/image-replacement.d.ts +31 -0
  75. package/dist/types/utils/image-source.d.ts +2 -0
  76. package/dist/types/utils/inline-style.d.ts +9 -0
  77. package/dist/types/utils/insert-newline-position.d.ts +23 -0
  78. package/dist/types/utils/link.d.ts +5 -0
  79. package/dist/types/utils/pointer-hover-scheduler.d.ts +9 -0
  80. package/dist/types/utils/selection.d.ts +2 -1
  81. package/dist/types/utils/source-attributes.d.ts +7 -0
  82. package/dist/types/utils/style-target.d.ts +4 -0
  83. package/dist/types/utils/table-appearance.d.ts +33 -0
  84. package/dist/types/utils/table-attributes.d.ts +14 -0
  85. package/dist/types/utils/table-border.d.ts +38 -0
  86. package/dist/types/utils/table-caption-numbering.d.ts +19 -0
  87. package/dist/types/utils/table-caption-visibility.d.ts +32 -0
  88. package/dist/types/utils/table-column-resize.d.ts +10 -0
  89. package/dist/types/utils/table-layout.d.ts +10 -0
  90. package/dist/types/utils/table-properties.d.ts +39 -0
  91. package/dist/types/utils/table-reset.d.ts +23 -0
  92. package/dist/types/utils/table-row-resize.d.ts +8 -0
  93. package/dist/types/utils/table-selection.d.ts +18 -0
  94. package/dist/types/utils/thousands-separator.d.ts +1 -0
  95. package/dist/types/utils/tracking-attributes.d.ts +8 -0
  96. package/dist/{viewer-DmoW4doo.js → viewer-DWO1FZ3A.js} +2 -2
  97. package/docs/SECONDARY_DEVELOPMENT.md +799 -795
  98. package/docs/superpowers/plans/2026-11-27-table-reset-controls.md +185 -0
  99. package/docs/superpowers/plans/2026-11-28-bubble-note-rich-content.md +101 -0
  100. package/docs/superpowers/plans/2026-11-28-image-replace.md +190 -0
  101. package/docs/superpowers/plans/2026-11-28-table-image-resize-preview.md +121 -0
  102. package/docs/superpowers/plans/2026-11-28-table-property-category-actions.md +192 -0
  103. package/docs/superpowers/specs/2026-11-27-table-reset-controls-design.md +66 -0
  104. package/docs/superpowers/specs/2026-11-28-bubble-note-rich-content-design.md +64 -0
  105. package/docs/superpowers/specs/2026-11-28-image-replace-design.md +40 -0
  106. package/docs/superpowers/specs/2026-11-28-table-image-resize-preview-design.md +30 -0
  107. package/docs/superpowers/specs/2026-11-28-table-property-category-actions-design.md +63 -0
  108. package/package.json +4 -4
  109. package/dist/types/components/menus/bubble/callout/background.vue.d.ts +0 -7
  110. package/dist/types/components/menus/bubble/callout/emoji-remove.vue.d.ts +0 -7
  111. /package/dist/types/components/{menus/bubble/callout/builtin.vue.d.ts → editor/table-cell-context-menu.vue.d.ts} +0 -0
  112. /package/dist/types/components/{menus/bubble/image/open.vue.d.ts → editor/table-quick-toolbar.vue.d.ts} +0 -0
@@ -0,0 +1,48 @@
1
+ export interface BubbleNoteContentLimits {
2
+ maxCharacters?: number;
3
+ maxImages?: number;
4
+ maxFormulas?: number;
5
+ maxBytes?: number;
6
+ }
7
+ export declare const DEFAULT_BUBBLE_NOTE_CONTENT_LIMITS: {
8
+ readonly maxCharacters: 2000;
9
+ readonly maxImages: 5;
10
+ readonly maxFormulas: 20;
11
+ readonly maxBytes: number;
12
+ };
13
+ export interface BubbleNoteContentStats {
14
+ characters: number;
15
+ images: number;
16
+ formulas: number;
17
+ bytes: number;
18
+ }
19
+ export interface BubbleNoteValidationResult {
20
+ valid: boolean;
21
+ errors: Array<'characters' | 'images' | 'formulas' | 'bytes'>;
22
+ stats: BubbleNoteContentStats;
23
+ }
24
+ export interface BubbleNoteImageResource {
25
+ id: string;
26
+ url: string;
27
+ }
28
+ export declare const createBubbleNoteContent: (text: unknown) => {
29
+ type: string;
30
+ content: {
31
+ content?: {
32
+ type: string;
33
+ text: string;
34
+ }[];
35
+ type: string;
36
+ }[];
37
+ };
38
+ export declare const normalizeBubbleNoteContent: (value: unknown, fallbackText?: string) => {
39
+ type: string;
40
+ content: any;
41
+ };
42
+ export declare const encodeBubbleNoteContent: (value: unknown) => string;
43
+ export declare const decodeBubbleNoteContent: (value: unknown) => Record<string, any>;
44
+ export declare const getBubbleNoteText: (value: unknown) => string;
45
+ export declare const collectBubbleNoteImageResources: (value: unknown) => BubbleNoteImageResource[];
46
+ export declare const getRemovedBubbleNoteImageResources: (previous: unknown, next: unknown) => BubbleNoteImageResource[];
47
+ export declare const getBubbleNoteImageUploadCapacity: (value: unknown, maxImages: number) => number;
48
+ export declare const validateBubbleNoteContent: (value: unknown, limits?: BubbleNoteContentLimits) => BubbleNoteValidationResult;
@@ -0,0 +1,12 @@
1
+ export declare const createBubbleNoteExtensions: () => (import("@tiptap/core").Node<any, any> | import("@tiptap/core").Extension<any, {
2
+ dialog: {
3
+ visible: boolean;
4
+ latex: string;
5
+ originalLatex: string;
6
+ display: import("@/extensions/math").FormulaDisplay;
7
+ position: number | null;
8
+ from: number;
9
+ to: number;
10
+ session: number;
11
+ };
12
+ }> | import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extension-text-style").TextStyleKitOptions, any>)[];
@@ -0,0 +1 @@
1
+ export declare const renderBubbleNoteContentHtml: (value: unknown, fallbackText?: string) => string;
@@ -1,4 +1,9 @@
1
1
  import { Mark } from '@tiptap/core';
2
+ declare module '@tiptap/core' {
3
+ interface Storage {
4
+ previewImage?: (src: string) => void;
5
+ }
6
+ }
2
7
  export declare const normalizeBubbleNoteLineType: (value: any) => any;
3
8
  export declare const normalizeBubbleNoteLineColor: (value: any) => string;
4
9
  export declare const normalizeBubbleNoteIconSource: (value: any) => string;
@@ -1,7 +1,7 @@
1
1
  /**
2
- * 插件作用:定义高亮段落容器节点及其节点视图。
3
- * 使用方法:注册后通过块菜单插入或包装当前段落。
4
- * 注意事项:保留容器内原有段落内容,避免仅在段落下方新增空块。
2
+ * 插件作用:定义可配置高亮块容器及其节点命令。
3
+ * 使用方法:通过插入菜单包装选区,或直接插入空高亮块。
4
+ * 注意事项:标题节点必须位于正文块之前;高亮块内部禁止再次嵌套高亮块。
5
5
  */
6
6
  import { Node } from '@tiptap/core';
7
7
  declare const _default: Node<any, any>;
@@ -0,0 +1,93 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<globalThis.ExtractPropTypes<{
2
+ editor: {
3
+ type: PropType<import("@tiptap/core").NodeViewProps["editor"]>;
4
+ required: true;
5
+ };
6
+ node: {
7
+ type: PropType<import("@tiptap/core").NodeViewProps["node"]>;
8
+ required: true;
9
+ };
10
+ decorations: {
11
+ type: PropType<import("@tiptap/core").NodeViewProps["decorations"]>;
12
+ required: true;
13
+ };
14
+ selected: {
15
+ type: PropType<import("@tiptap/core").NodeViewProps["selected"]>;
16
+ required: true;
17
+ };
18
+ extension: {
19
+ type: PropType<import("@tiptap/core").NodeViewProps["extension"]>;
20
+ required: true;
21
+ };
22
+ getPos: {
23
+ type: PropType<import("@tiptap/core").NodeViewProps["getPos"]>;
24
+ required: true;
25
+ };
26
+ updateAttributes: {
27
+ type: PropType<import("@tiptap/core").NodeViewProps["updateAttributes"]>;
28
+ required: true;
29
+ };
30
+ deleteNode: {
31
+ type: PropType<import("@tiptap/core").NodeViewProps["deleteNode"]>;
32
+ required: true;
33
+ };
34
+ view: {
35
+ type: PropType<import("@tiptap/core").NodeViewProps["view"]>;
36
+ required: true;
37
+ };
38
+ innerDecorations: {
39
+ type: PropType<import("@tiptap/core").NodeViewProps["innerDecorations"]>;
40
+ required: true;
41
+ };
42
+ HTMLAttributes: {
43
+ type: PropType<import("@tiptap/core").NodeViewProps["HTMLAttributes"]>;
44
+ required: true;
45
+ };
46
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
47
+ editor: {
48
+ type: PropType<import("@tiptap/core").NodeViewProps["editor"]>;
49
+ required: true;
50
+ };
51
+ node: {
52
+ type: PropType<import("@tiptap/core").NodeViewProps["node"]>;
53
+ required: true;
54
+ };
55
+ decorations: {
56
+ type: PropType<import("@tiptap/core").NodeViewProps["decorations"]>;
57
+ required: true;
58
+ };
59
+ selected: {
60
+ type: PropType<import("@tiptap/core").NodeViewProps["selected"]>;
61
+ required: true;
62
+ };
63
+ extension: {
64
+ type: PropType<import("@tiptap/core").NodeViewProps["extension"]>;
65
+ required: true;
66
+ };
67
+ getPos: {
68
+ type: PropType<import("@tiptap/core").NodeViewProps["getPos"]>;
69
+ required: true;
70
+ };
71
+ updateAttributes: {
72
+ type: PropType<import("@tiptap/core").NodeViewProps["updateAttributes"]>;
73
+ required: true;
74
+ };
75
+ deleteNode: {
76
+ type: PropType<import("@tiptap/core").NodeViewProps["deleteNode"]>;
77
+ required: true;
78
+ };
79
+ view: {
80
+ type: PropType<import("@tiptap/core").NodeViewProps["view"]>;
81
+ required: true;
82
+ };
83
+ innerDecorations: {
84
+ type: PropType<import("@tiptap/core").NodeViewProps["innerDecorations"]>;
85
+ required: true;
86
+ };
87
+ HTMLAttributes: {
88
+ type: PropType<import("@tiptap/core").NodeViewProps["HTMLAttributes"]>;
89
+ required: true;
90
+ };
91
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
92
+ declare const _default: typeof __VLS_export;
93
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { Node } from '@tiptap/core';
2
+ /**
3
+ * 高亮块富文本标题节点。
4
+ * 内容限制为 text*,允许文字标记,但不允许图片、公式或其他内联原子节点。
5
+ */
6
+ declare const _default: Node<any, any>;
7
+ export default _default;
@@ -1,2 +1,10 @@
1
+ declare module '@tiptap/core' {
2
+ interface Commands<ReturnType> {
3
+ codeBlockIndent: {
4
+ indentCodeBlock: () => ReturnType;
5
+ outdentCodeBlock: () => ReturnType;
6
+ };
7
+ }
8
+ }
1
9
  declare const _default: import("@tiptap/core").Node<import("@tiptap/extension-code-block-lowlight").CodeBlockLowlightOptions, any>;
2
10
  export default _default;
@@ -6,11 +6,15 @@ export declare const columnNodes: () => {
6
6
  colWidth: {
7
7
  default: number;
8
8
  };
9
+ colWidthUnit: {
10
+ default: string;
11
+ };
9
12
  };
10
13
  parseDOM: {
11
14
  tag: string;
12
15
  getAttrs(dom: any): false | {
13
- colWidth: string | number;
16
+ colWidth: number;
17
+ colWidthUnit: import("@/utils/column-width").ColumnWidthUnit;
14
18
  };
15
19
  }[];
16
20
  toDOM(node: any): (string | number | {
@@ -21,6 +25,7 @@ export declare const columnNodes: () => {
21
25
  columnContainer: {
22
26
  group: string;
23
27
  content: string;
28
+ isolating: boolean;
24
29
  parseDOM: {
25
30
  tag: string;
26
31
  }[];
@@ -0,0 +1,6 @@
1
+ type CoursewareReaderVisibilityOptions = {
2
+ nearViewport: boolean;
3
+ url: string;
4
+ };
5
+ export declare const shouldMountCoursewareReader: ({ nearViewport, url, }: CoursewareReaderVisibilityOptions) => boolean;
6
+ export {};
@@ -10,6 +10,10 @@ export declare const fileMimeTypes: {
10
10
  video: string[];
11
11
  audio: string[];
12
12
  };
13
+ export declare const resolveInsertImageDimensions: (editor: any, file: File, inline?: boolean) => Promise<{
14
+ width: number;
15
+ height: number;
16
+ }>;
13
17
  export declare const resolveFileAccept: (type: any, accept?: any[]) => string;
14
18
  declare const _default: Node<any, any>;
15
19
  export default _default;
@@ -0,0 +1,6 @@
1
+ import type { Editor } from '@tiptap/core';
2
+ import type { Node } from '@tiptap/pm/model';
3
+ type GetPosition = () => number | null | undefined;
4
+ /** 同一帧加载的图片共享一次事务,避免每张图片分别刷新编辑器。 */
5
+ export declare const queueAutomaticImageAttributes: (editor: Editor, getPosition: GetPosition, source: Node, attrs: Record<string, unknown>) => void;
6
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { Slice } from '@tiptap/pm/model';
2
+ import { type EditorState } from '@tiptap/pm/state';
3
+ export declare const insertPastedImageBelowSelection: (state: EditorState, slice: Slice) => import("@tiptap/pm/state").Transaction;
@@ -4,6 +4,7 @@
4
4
  * 注意事项:表格内段落默认不缩进,但允许用户手动设置。
5
5
  */
6
6
  import { Extension } from '@tiptap/core';
7
+ export declare const DEFAULT_TEXT_INDENT_LEVEL = 2;
7
8
  export declare const resolveIndentAttributes: (attrs: any, indent: any, minLevel: any, config: any, fallbackUnit?: string) => any;
8
9
  declare const _default: Extension<{
9
10
  types: string[];
@@ -1,7 +1,6 @@
1
1
  /**
2
- * 插件作用:在不可直接输入的块节点边缘提供新段落入口。
3
- * 使用方法:注册后编辑器自动显示对应交互。
4
- * 注意事项:只在块节点边缘触发,避免干扰正文选择。
2
+ * 在块节点边缘显示段落插入按钮。悬停只更新编辑区外的按钮,
3
+ * 点击后才提交编辑器事务。
5
4
  */
6
5
  import { Extension } from '@tiptap/core';
7
6
  declare const _default: Extension<any, any>;
@@ -4,7 +4,8 @@
4
4
  * 注意事项:公式内容与生成图片需保持同步。
5
5
  */
6
6
  import { Extension, Node } from '@tiptap/core';
7
- export type FormulaDisplay = 'inline' | 'block';
7
+ import { type FormulaDisplay } from '@/utils/formula-size';
8
+ export type { FormulaDisplay } from '@/utils/formula-size';
8
9
  /** 公式弹窗状态;originalLatex 用于识别编辑前内容,position 用于覆盖原节点。 */
9
10
  export interface FormulaDialogState {
10
11
  visible: boolean;
@@ -13,6 +13,11 @@ export interface SmartSheetData {
13
13
  }
14
14
  export declare const getSmartSheetId: (url: string) => string;
15
15
  export declare const createEmptySmartSheetData: () => SmartSheetData;
16
+ /**
17
+ * 根据 Excel 文件名生成表格默认标题。
18
+ * 去掉最后一个扩展名后按标题上限截断,空文件名返回空字符串。
19
+ */
20
+ export declare const getSmartSheetDefaultTitle: (name: unknown) => string;
16
21
  export declare const normalizeSmartSheetData: (value: unknown) => SmartSheetData;
17
22
  export declare const parseSmartSheetData: (value: string | null) => SmartSheetData;
18
23
  export declare const serializeSmartSheetData: (value: unknown) => string;
@@ -0,0 +1,15 @@
1
+ import { Plugin } from '@tiptap/pm/state';
2
+ import { ResizeState } from '@tiptap/pm/tables';
3
+ type ColumnResizeOptions = {
4
+ handleWidth?: number;
5
+ cellMinWidth?: number;
6
+ defaultCellMinWidth?: number;
7
+ lastColumnResizable?: boolean;
8
+ };
9
+ /**
10
+ * The default column resizing plugin assumes the first table child is the
11
+ * colgroup. The table figure renders caption first, so resolve the colgroup
12
+ * explicitly before applying live column widths.
13
+ */
14
+ export declare const tableColumnResizing: ({ handleWidth, cellMinWidth, defaultCellMinWidth, lastColumnResizable, }?: ColumnResizeOptions) => Plugin<ResizeState>;
15
+ export {};
@@ -1,15 +1,44 @@
1
1
  import { Node as TiptapNode } from '@tiptap/core';
2
+ import { type TableBackground } from '@/utils/table-appearance';
3
+ import { type TableBorderPatch } from '@/utils/table-border';
4
+ import { type TableCellSizeValues } from '@/utils/table-properties';
2
5
  declare module '@tiptap/core' {
3
6
  interface Commands<ReturnType> {
4
7
  tableCaption: {
5
8
  toggleTableCaption: () => ReturnType;
6
9
  setTableCaption: (text: string) => ReturnType;
7
10
  };
11
+ tableSelection: {
12
+ selectCurrentTable: () => ReturnType;
13
+ };
14
+ tableAppearance: {
15
+ clearTableSettings: () => ReturnType;
16
+ };
17
+ tableCellAppearance: {
18
+ setTableCellAlignment: (align: string) => ReturnType;
19
+ setTableCellWidth: (width: number | null) => ReturnType;
20
+ setTableCellSize: (size: TableCellSizeValues) => ReturnType;
21
+ updateTableCellBorder: (patch: TableBorderPatch) => ReturnType;
22
+ clearTableCellAlignment: () => ReturnType;
23
+ clearTableCellBorder: () => ReturnType;
24
+ clearTableCellSize: () => ReturnType;
25
+ clearTableCellSettings: () => ReturnType;
26
+ };
27
+ tableRowAppearance: {
28
+ setTableRowCellAttributes: (attributes: Record<string, unknown>) => ReturnType;
29
+ setTableRowBorder: (style: string, color: string) => ReturnType;
30
+ updateTableRowBorder: (patch: TableBorderPatch) => ReturnType;
31
+ setTableRowType: (header: boolean) => ReturnType;
32
+ setTableRowBackgroundStyle: (background: TableBackground) => ReturnType;
33
+ clearTableRowBorder: () => ReturnType;
34
+ clearTableRowSettings: () => ReturnType;
35
+ };
8
36
  }
9
37
  }
10
38
  export declare const tablePresetStyles: readonly ["plain", "horizontal", "header-line", "double-line", "vertical", "grid", "outline", "header-grid", "banded", "bold-grid", "columns", "three-line"];
11
39
  export declare const tablePresetColors: readonly ["#222222", "#4472c4", "#ed7d31", "#f2b600", "#70ad47", "#2bb9b0", "#db4d63"];
12
40
  export declare const tableShadingTypes: readonly ["first-row", "first-column", "alternate-row", "alternate-column", "last-row", "last-column"];
41
+ export declare const isTablePresetColor: (color: string) => boolean;
13
42
  export declare const tablePresetContrastColor: (color: string) => "#fff" | "#1f2937";
14
43
  declare const CustomTable: TiptapNode<import("@tiptap/extension-table").TableOptions, any>;
15
44
  declare const CustomTableHeader: TiptapNode<import("@tiptap/extension-table/header").TableHeaderOptions, any>;
@@ -2,6 +2,7 @@ import { type TimelineData } from './model';
2
2
  type __VLS_Props = {
3
3
  data: TimelineData;
4
4
  embedded?: boolean;
5
+ eagerImages?: boolean;
5
6
  };
6
7
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
8
  declare const _default: typeof __VLS_export;
@@ -4,7 +4,7 @@
4
4
  * 注意:内容为原子节点;对话框确认时一次事务更新,HTML 由 renderTimeline 输出。
5
5
  */
6
6
  import { Node } from '@tiptap/core';
7
- import { type TimelineData } from './model';
7
+ import { type TimelineData, type TimelineSnapshot } from './model';
8
8
  import './style.less';
9
9
  interface TimelineDialogState {
10
10
  visible: boolean;
@@ -21,7 +21,7 @@ declare module '@tiptap/core' {
21
21
  }
22
22
  interface Commands<ReturnType> {
23
23
  timeline: {
24
- insertTimeline: (data: TimelineData) => ReturnType;
24
+ insertTimeline: (data: TimelineData, snapshot?: TimelineSnapshot | null) => ReturnType;
25
25
  openTimeline: (position?: number | null) => ReturnType;
26
26
  };
27
27
  }
@@ -34,16 +34,13 @@ declare const _default: Node<any, {
34
34
  version: 1;
35
35
  orientation: import("./model").TimelineOrientation;
36
36
  arrangement: import("./model").TimelineArrangement;
37
- containerWidth: number | null;
38
- containerHeight: number;
39
- cardWidth: number | null;
40
- cardHeight: number | null;
41
37
  items: {
42
38
  id: string;
43
39
  timeText: string;
44
40
  title: string;
45
41
  description: string;
46
42
  color: string;
43
+ collapsed: boolean;
47
44
  images: {
48
45
  id: string;
49
46
  fileId?: string;
@@ -11,35 +11,38 @@ export interface TimelineItem {
11
11
  title: string;
12
12
  description: string;
13
13
  color: string;
14
+ collapsed: boolean;
14
15
  images: TimelineImage[];
15
16
  }
16
17
  export type TimelineOrientation = 'vertical' | 'horizontal';
17
18
  export type TimelineArrangement = 'alternate' | 'same-side';
19
+ export declare const MAX_TIMELINE_TITLE_LENGTH = 50;
20
+ export declare const MAX_TIMELINE_TIME_LENGTH = 20;
18
21
  export interface TimelineData {
19
22
  version: 1;
20
23
  orientation: TimelineOrientation;
21
24
  arrangement: TimelineArrangement;
22
- containerWidth: number | null;
23
- containerHeight: number;
24
- cardWidth: number | null;
25
- cardHeight: number | null;
26
25
  items: TimelineItem[];
27
26
  }
28
- export declare const timelineAutoThreshold: {
29
- readonly containerWidth: 360;
30
- readonly cardHeight: 70;
31
- };
32
- export declare const timelineStyle: (data: TimelineData) => {
27
+ export interface TimelineSnapshot {
28
+ src: string;
29
+ width: number;
30
+ height: number;
31
+ encoding?: 'base64url' | null;
32
+ mimeType?: string | null;
33
+ }
34
+ export declare const timelineStyle: () => {
33
35
  width: string;
34
- '--agile-timeline-container-height': string;
35
- '--agile-timeline-card-width': string;
36
- '--agile-timeline-card-height': string;
37
- '--agile-timeline-item-width': string;
38
- '--agile-timeline-description-lines': number;
39
36
  };
40
37
  /** 清理导入的数据;旧版节点名称仅在标题缺失时用于回填。 */
41
38
  export declare function normalizeTimeline(value: unknown): TimelineData;
39
+ /** 将时间轴语义数据编码到 HTML 属性,供快照模式在刷新后恢复编辑数据。 */
40
+ export declare function encodeTimelineData(data: TimelineData): string;
41
+ /** 从快照 HTML 属性恢复时间轴数据;异常数据按无数据处理。 */
42
+ export declare function decodeTimelineData(value: string | null | undefined): TimelineData;
42
43
  /** 从导出的语义 HTML 恢复时间轴;不执行或解析节点内的脚本。 */
43
44
  export declare function parseTimeline(element: HTMLElement): TimelineData;
45
+ /** 生成只保留完整时间轴图片的 HTML,语义数据仍用于重新编辑。 */
46
+ export declare function renderTimelineSnapshot(data: TimelineData, snapshot: TimelineSnapshot, htmlAttributes?: Record<string, unknown>): DOMOutputSpec;
44
47
  /** 生成浏览器无需初始化编辑器即可展示的 HTML 结构。 */
45
- export declare function renderTimeline(data: TimelineData, htmlAttributes?: Record<string, unknown>): DOMOutputSpec;
48
+ export declare function renderTimeline(data: TimelineData, htmlAttributes?: Record<string, unknown>, snapshot?: TimelineSnapshot | null): DOMOutputSpec;
@@ -0,0 +1,14 @@
1
+ import { Extension } from '@tiptap/core';
2
+ interface TrailingNodeOptions {
3
+ node?: string;
4
+ notAfter?: string | string[];
5
+ }
6
+ interface TrailingNodeState {
7
+ suspended: boolean;
8
+ }
9
+ /**
10
+ * 在 Tiptap TrailingNode 基础上支持跨事务挂起。
11
+ * 分块导入时,后续 UniqueID 等追加事务不会丢失挂起状态,避免中间块生成空段落。
12
+ */
13
+ declare const _default: Extension<TrailingNodeOptions, TrailingNodeState>;
14
+ export default _default;