@vervedoc/core 3.0.11 → 3.3.11

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 (55) hide show
  1. package/README.md +194 -71
  2. package/dist/assets/editor-worker-CG2Et0Mg.js +244 -0
  3. package/dist/assets/editor-worker-CG2Et0Mg.js.map +1 -0
  4. package/dist/assets/thumbnail-worker-BGjZ82h0.js +52 -0
  5. package/dist/assets/thumbnail-worker-BGjZ82h0.js.map +1 -0
  6. package/dist/command-chain.d.ts +40 -0
  7. package/dist/constants.d.ts +21 -0
  8. package/dist/core.js +16080 -3917
  9. package/dist/core.js.map +1 -1
  10. package/dist/core.umd.cjs +413 -134
  11. package/dist/core.umd.cjs.map +1 -1
  12. package/dist/docx-editor.d.ts +110 -0
  13. package/dist/index.d.ts +20 -23
  14. package/dist/shortcut.d.ts +60 -0
  15. package/dist/workers/compute.d.ts +17 -0
  16. package/dist/workers/thumbnail-manager.d.ts +19 -0
  17. package/dist/workers/worker-manager.d.ts +44 -0
  18. package/package.json +55 -60
  19. package/dist/DocxEditor.d.ts +0 -17
  20. package/dist/actuator/Actuator.d.ts +0 -22
  21. package/dist/assets/runtime.worker-glNChxsd.js.map +0 -1
  22. package/dist/docxParser/constants.d.ts +0 -42
  23. package/dist/docxParser/docx.parser.d.ts +0 -13
  24. package/dist/docxParser/index.d.ts +0 -13
  25. package/dist/docxParser/types.d.ts +0 -170
  26. package/dist/docxParser/worker/builder/element.builder.d.ts +0 -6
  27. package/dist/docxParser/worker/numbering.resolver.d.ts +0 -29
  28. package/dist/docxParser/worker/parsers/chart.parser.d.ts +0 -16
  29. package/dist/docxParser/worker/parsers/comment.parser.d.ts +0 -5
  30. package/dist/docxParser/worker/parsers/hyperlink.parser.d.ts +0 -14
  31. package/dist/docxParser/worker/parsers/image.parser.d.ts +0 -12
  32. package/dist/docxParser/worker/parsers/list.parser.d.ts +0 -6
  33. package/dist/docxParser/worker/parsers/ooxml.chart.parser.d.ts +0 -4
  34. package/dist/docxParser/worker/parsers/paragraph.parser.d.ts +0 -10
  35. package/dist/docxParser/worker/parsers/run.parser.d.ts +0 -22
  36. package/dist/docxParser/worker/parsers/section.parser.d.ts +0 -20
  37. package/dist/docxParser/worker/parsers/table.parser.d.ts +0 -11
  38. package/dist/docxParser/worker/parsers/toc.parser.d.ts +0 -13
  39. package/dist/docxParser/worker/relationship.resolver.d.ts +0 -17
  40. package/dist/docxParser/worker/style.resolver.d.ts +0 -33
  41. package/dist/docxParser/worker/theme.resolver.d.ts +0 -21
  42. package/dist/docxParser/worker/xml.helper.d.ts +0 -36
  43. package/dist/export/ExportComponent.d.ts +0 -9
  44. package/dist/i18n/I18n.d.ts +0 -14
  45. package/dist/index-DCzhFl4v.js +0 -16770
  46. package/dist/index-DCzhFl4v.js.map +0 -1
  47. package/dist/table-contextmenu/TableContextMenu.d.ts +0 -48
  48. package/dist/table-contextmenu/TableContextMenuComponent.d.ts +0 -7
  49. package/dist/utils/clipboard.d.ts +0 -11
  50. package/dist/utils/print.d.ts +0 -7
  51. package/dist/worker/WorkerComponent.d.ts +0 -8
  52. package/dist/worker/WorkerManager.d.ts +0 -21
  53. package/dist/worker/WorkerMessage.d.ts +0 -21
  54. /package/dist/{docxParser/worker/docx.parse.worker.d.ts → workers/editor-worker.d.ts} +0 -0
  55. /package/dist/{worker/runtime.worker.d.ts → workers/thumbnail-worker.d.ts} +0 -0
@@ -0,0 +1,110 @@
1
+ import { IDocxDocumentMeta, IEditorOption, EditorPlugin } from '@vervedoc/docx-editor-schema';
2
+ import { EventBus, Listener, RangeManager } from '@vervedoc/docx-editor-state';
3
+ import { Draw } from '@vervedoc/docx-editor-view';
4
+ import { Command } from '@vervedoc/docx-editor-transform';
5
+ import { Search, BlockParticle, DateParticle, LaTexParticle, ControlComponent } from '@vervedoc/docx-editor-commands';
6
+ import { HistoryComponent } from '@vervedoc/docx-editor-history';
7
+ import { WorkerManager } from './workers/worker-manager';
8
+ /**
9
+ * DocxEditor 文档编辑器主类
10
+ *
11
+ * 全新构造,零兼容:只接受 IDocxDocumentMeta。
12
+ * 组合 Listener / EventBus / RangeManager / Draw / Command / Comment / Revision / Search 等组件。
13
+ */
14
+ export declare class DocxEditor {
15
+ /** 事件监听器(content/range/page/catalog 等命名空间) */
16
+ listener: Listener;
17
+ /** 全局事件总线(hyperlinkMenuClick / chartClick 等右键菜单事件) */
18
+ eventBus: EventBus;
19
+ /** 选区管理器(anchor/focus 位置与折叠/展开) */
20
+ range: RangeManager;
21
+ /** 视图绘制引擎(布局 + Canvas 渲染 + 交互) */
22
+ draw: Draw;
23
+ /** 命令入口(executeXxx 系列方法) */
24
+ command: Command;
25
+ private adapt;
26
+ private destroyed;
27
+ private clipboardEpoch;
28
+ private clipboardGuard;
29
+ /** 已注册插件表(按 name 索引) */
30
+ private plugins;
31
+ /** 插件命令注册表(命令名 → 处理函数),责任链中插件命令 handler 查此表分发 */
32
+ private pluginCommands;
33
+ /** 命令分发责任链 */
34
+ private commandChain;
35
+ /** 插件宿主契约实例,构造完成后赋值,use(plugin) 时注入给插件 */
36
+ private pluginHost;
37
+ /** 搜索组件 */
38
+ search: Search;
39
+ /** 块级粒子组件(图片/视频/音频/图表等块级元素) */
40
+ block: BlockParticle;
41
+ /** 日期粒子组件 */
42
+ date: DateParticle;
43
+ /** LaTeX 公式粒子组件 */
44
+ laTex: LaTexParticle;
45
+ /** 控件组件(checkbox/radio/dropdown 等) */
46
+ control: ControlComponent;
47
+ /** 历史管理组件(撤销/重做) */
48
+ history: HistoryComponent;
49
+ /** Worker 管理器(后台计算目录/搜索等) */
50
+ worker: WorkerManager;
51
+ private thumbnailWorker;
52
+ private thumbnailSources;
53
+ /**
54
+ * 构造 DocxEditor 实例
55
+ * @param container 编辑器挂载的 DOM 容器(必须为 HTMLDivElement)
56
+ * @param document 文档元数据(必须包含 elements 数组,不再兼容 IElement[] / IEditorData)
57
+ * @param options 编辑器选项(字体/字号/页边距等,缺省时自动合并默认值)
58
+ * @throws {TypeError} container 非 HTMLDivElement 或 document 非 IDocxDocumentMeta 时抛出
59
+ */
60
+ constructor(container: HTMLDivElement, document: IDocxDocumentMeta, options?: IEditorOption);
61
+ /**
62
+ * 订阅 after-render 生命周期事件,集中管理渲染后各组件的联动。
63
+ *
64
+ * Draw 只 emit `after-render` 事件,不直接调用插件/block/control/worker,
65
+ * 已注册插件的 `hooks.afterRender` 在此遍历调用,核心组件联动也在此集中订阅。
66
+ */
67
+ private wireAfterRenderHooks;
68
+ private refreshThumbnailAppearance;
69
+ /**
70
+ * 渲染嵌入块(iframe):遍历 layout 中 kind === 'block' 的节点,
71
+ * 调 BlockParticle.render 挂载/复用 DOM。chart 已由 canvas drawImage 渲染,不在此处理。
72
+ */
73
+ private renderEmbedBlocks;
74
+ /**
75
+ * 获取当前文档元数据
76
+ * @returns 文档元数据(含 elements/sections/comments 等)
77
+ */
78
+ getDocument(): IDocxDocumentMeta;
79
+ /**
80
+ * 设置文档元数据,重置 zone 到 main 并通知插件同步数据
81
+ * @param doc 文档元数据(必须包含 elements 数组)
82
+ * @throws {TypeError} doc 非 IDocxDocumentMeta 时抛出
83
+ */
84
+ setDocument(doc: IDocxDocumentMeta): void;
85
+ /**
86
+ * 注册插件。core 在注册时自动注入 PluginHost、登记命令表;
87
+ * 若文档已加载,立即触发 `hooks.onSetDocument` 以同步初始数据。
88
+ *
89
+ * 核心引擎(view/transform)保持内置硬编码,不通过此方法注册。
90
+ *
91
+ * @param plugin 满足 EditorPlugin 契约的插件实例
92
+ */
93
+ use(plugin: EditorPlugin): void;
94
+ /**
95
+ * 获取已注册插件实例,供宿主层调用插件特有方法。
96
+ *
97
+ * @param name 插件名称
98
+ * @returns 插件实例,未注册时返回 undefined
99
+ */
100
+ getPlugin<T extends EditorPlugin>(name: string): T | undefined;
101
+ /**
102
+ * 分发命令到责任链(供宿主层触发插件命令)
103
+ */
104
+ dispatchCommand(command: string, ...args: any[]): any;
105
+ /**
106
+ * 销毁编辑器实例,释放所有资源(DOM/事件监听/定时器/组件/插件)
107
+ */
108
+ destroy(): void;
109
+ }
110
+ export default DocxEditor;
package/dist/index.d.ts CHANGED
@@ -1,26 +1,23 @@
1
- import { default as DocxEditor } from './DocxEditor';
1
+ import { default as DocxEditor } from './docx-editor';
2
2
  export default DocxEditor;
3
+ export { DocxEditor };
4
+ export { DocxEditor as Editor };
3
5
  export * from '@vervedoc/docx-editor-schema';
4
- export { Listener, RangeManager, EventBus } from '@vervedoc/docx-editor-state';
6
+ export type { TitleLevel } from '@vervedoc/docx-editor-schema';
7
+ export * from './constants';
8
+ export { WorkerManager } from './workers/worker-manager';
9
+ export type { TocResult, SearchResult } from './workers/worker-manager';
10
+ export { EventBus, Listener, RangeManager } from '@vervedoc/docx-editor-state';
11
+ export type { IRangeStyle, IEditorAbility, ListenerMap, EventHandler } from '@vervedoc/docx-editor-schema';
12
+ export { Draw, LayoutEngine, CanvasRenderer, TextMeasure, getSharedMeasure, hitTest } from '@vervedoc/docx-editor-view';
13
+ export type { DocumentLayout, PageLayout, BlockNode, ParagraphBlock, ImageBlock, PageBreakBlock, TableBlock, TableRowLayout, TableCellLayout, LineBox, InlineBox, Rect } from '@vervedoc/docx-editor-view';
5
14
  export { Command, CommandAdapt } from '@vervedoc/docx-editor-transform';
6
- export type { IDrawContext, ICursorContext, IBadgeContext, IZoneContext, IListParticleContext, IHyperlinkParticleContext, IGroupContext, IAreaContext, IRegisterContext, IPreviewerContext, ISearchContext, IEventBusContext, IWorkerManagerContext } from '@vervedoc/docx-editor-transform';
7
- export { BaseCommandAdapter, BaseAdapter, TextStyleAdapter, ParagraphAdapter, TableAdapter, PageAdapter } from '@vervedoc/docx-editor-transform';
8
- export type { IAdapterContext } from '@vervedoc/docx-editor-transform';
9
- export { Draw, Cursor, CursorAgent, Position, CanvasEvent, GlobalEvent, ImageObserver, MouseObserver, ScrollObserver, SelectionObserver, TextParticle, ImageParticle, HyperlinkParticle, SeparatorParticle, PageBreakParticle, ListParticle, SuperscriptParticle, SubscriptParticle, LineBreakParticle, CheckboxParticle, RadioParticle, TableParticle, TableOperate, TableTool, Previewer, Background, Badge, Footer, Header, LineNumber, Margin, PageBorder, PageNumber, Placeholder, Watermark, AbstractRichText, Highlight, ParagraphColor, Strikeout, Underline, Area, Group, FloatingBar, Override, Register } from '@vervedoc/docx-editor-view';
10
- export type { Plugin, IParticleRegistry, IHistoryProvider, ISearchProvider, IControlProvider } from '@vervedoc/docx-editor-view';
11
- export * from '@vervedoc/docx-editor-history';
12
- export { Shortcut, KeymapComponent } from '@vervedoc/docx-editor-keymap';
13
- export { Control, CheckboxControl, RadioControl, TextControl, SelectControl, DateControl, NumberControl, ControlSearch, ControlBorder, DateParticle, DatePicker, LaTexParticle, Search, BlockParticle, ControlComponent, GadgetComponent } from '@vervedoc/docx-editor-commands';
14
- export { WorkerManager } from './worker/WorkerManager';
15
- export { WorkerComponent } from './worker/WorkerComponent';
16
- export { I18n } from './i18n/I18n';
17
- export { Actuator } from './actuator/Actuator';
18
- export type { AutoSaveOptions } from './actuator/Actuator';
19
- export { ExportComponent } from './export/ExportComponent';
20
- export { CommentComponent, RevisionComponent } from '@vervedoc/docx-editor-comment';
21
- export type { DocxCommentMeta, RevisionCallbacks } from '@vervedoc/docx-editor-comment';
22
- export { getClipboardData, getIsClipboardContainFile, removeClipboardData } from './utils/clipboard';
23
- export { version } from '../package.json';
24
- export { DocxParser, createDocxParser, parseDocx } from './docxParser/index';
25
- export type { IDocxParseResult, IDocxParseOptions, IChartRenderer } from './docxParser/types';
26
- export { default as Editor } from './DocxEditor';
15
+ export type { IHistoryManager, HistorySnapshot } from '@vervedoc/docx-editor-schema';
16
+ export { CommandChain } from './command-chain';
17
+ export type { CommandHandler, CommandNext } from './command-chain';
18
+ export { HistoryManager, HistoryComponent, createSnapshot } from '@vervedoc/docx-editor-history';
19
+ export type { HistorySnapshot as HistorySnapshotType } from '@vervedoc/docx-editor-history';
20
+ export { Search, BlockParticle, DateParticle, LaTexParticle, ControlComponent } from '@vervedoc/docx-editor-commands';
21
+ export type { ISearchResult, IReplaceOption, INavigateInfo, IElementPosition } from '@vervedoc/docx-editor-schema';
22
+ /** VerveDocs Core 版本号 */
23
+ export declare const version = "4.0.0-tree";
@@ -0,0 +1,60 @@
1
+ import { Draw } from '@vervedoc/docx-editor-view';
2
+ import { Command, CommandAdapt } from '@vervedoc/docx-editor-transform';
3
+ import { RangeManager } from '@vervedoc/docx-editor-state';
4
+ /** 快捷键处理器依赖注入接口 */
5
+ export interface ShortcutDeps {
6
+ /** 获取 Draw 视图实例 */
7
+ getDraw: () => Draw;
8
+ /** 获取 Command 命令实例 */
9
+ getCommand: () => Command;
10
+ dispatchCommand: (command: string, ...args: any[]) => any;
11
+ /** 获取 RangeManager 选区管理器 */
12
+ getRange: () => RangeManager;
13
+ /** 获取 CommandAdapt 适配器(可能未初始化) */
14
+ getAdapt: () => CommandAdapt | null;
15
+ }
16
+ /** 键盘快捷键处理器,分编辑/光标/格式/历史四组 */
17
+ export declare class ShortcutHandler {
18
+ /** 依赖注入 */
19
+ private deps;
20
+ /**
21
+ * 构造快捷键处理器
22
+ * @param deps 依赖注入对象
23
+ */
24
+ constructor(deps: ShortcutDeps);
25
+ /**
26
+ * 处理键盘事件,依次尝试编辑/光标/格式/历史四组快捷键
27
+ * @param e 键盘事件
28
+ */
29
+ handle: (e: KeyboardEvent) => void;
30
+ /**
31
+ * 处理编辑类快捷键(复制/剪切/粘贴/全选/删除/Enter/Tab/Escape)
32
+ * @param e 键盘事件
33
+ * @param adapt 命令适配器
34
+ * @param draw 视图实例
35
+ * @returns 是否已处理该事件
36
+ */
37
+ private handleEditKeys;
38
+ /**
39
+ * 处理光标移动快捷键(方向键/Home/End/PageUp/PageDown,含 Ctrl 词移动/文档首尾)
40
+ * @param e 键盘事件
41
+ * @param adapt 命令适配器
42
+ * @param draw 视图实例
43
+ * @returns 是否已处理该事件
44
+ */
45
+ private handleCursorKeys;
46
+ /**
47
+ * 处理格式快捷键(加粗/斜体/下划线/删除线/字号/对齐/列表/标题/清除格式)
48
+ * @param e 键盘事件
49
+ * @param command 命令实例
50
+ * @returns 是否已处理该事件
51
+ */
52
+ private handleFormatKeys;
53
+ /**
54
+ * 处理历史快捷键(撤销/重做/分页)
55
+ * @param e 键盘事件
56
+ * @param command 命令实例
57
+ * @returns 是否已处理该事件
58
+ */
59
+ private handleHistoryKeys;
60
+ }
@@ -0,0 +1,17 @@
1
+ import { IElement, PathSegment } from '@vervedoc/docx-editor-schema';
2
+ export declare function computeToc(elements: IElement[]): {
3
+ toc: {
4
+ id: string;
5
+ level: number;
6
+ name: string;
7
+ number?: string;
8
+ }[];
9
+ };
10
+ export declare function computeSearch(elements: IElement[], keyword: string): {
11
+ results: {
12
+ path: PathSegment[];
13
+ offset: number;
14
+ length: number;
15
+ }[];
16
+ count: number;
17
+ };
@@ -0,0 +1,19 @@
1
+ /** Background composition is isolated from document search/TOC work. */
2
+ export declare class ThumbnailManager {
3
+ private publish;
4
+ private worker;
5
+ private epoch;
6
+ private sources;
7
+ private color;
8
+ private scheduled;
9
+ private sourcesDirty;
10
+ private disposed;
11
+ private failed;
12
+ private invalidated;
13
+ constructor(publish: (images: string[]) => void);
14
+ invalidate(): void;
15
+ update(sources: string[], color: string): void;
16
+ private flush;
17
+ private fail;
18
+ destroy(): void;
19
+ }
@@ -0,0 +1,44 @@
1
+ import { IElement, PathSegment } from '@vervedoc/docx-editor-schema';
2
+ export interface TocResult {
3
+ toc: {
4
+ id: string;
5
+ level: number;
6
+ name: string;
7
+ number?: string;
8
+ }[];
9
+ }
10
+ export interface SearchResult {
11
+ results: {
12
+ path: PathSegment[];
13
+ offset: number;
14
+ length: number;
15
+ }[];
16
+ count: number;
17
+ }
18
+ type TocListener = (result: TocResult) => void;
19
+ type SearchListener = (result: SearchResult) => void;
20
+ type CloneListener = (data: unknown) => void;
21
+ type ErrorListener = (message: string) => void;
22
+ export declare class WorkerManager {
23
+ private worker;
24
+ private failed;
25
+ private destroyed;
26
+ private pending;
27
+ private elements;
28
+ private tocListeners;
29
+ private searchListeners;
30
+ private cloneListeners;
31
+ private errorListeners;
32
+ init(): void;
33
+ private fallback;
34
+ updateElements(elements: IElement[]): void;
35
+ private flush;
36
+ search(keyword: string): void;
37
+ clone(data: unknown): void;
38
+ onTocResult(listener: TocListener): () => void;
39
+ onSearchResult(listener: SearchListener): () => void;
40
+ onCloneResult(listener: CloneListener): () => void;
41
+ onError(listener: ErrorListener): () => void;
42
+ destroy(): void;
43
+ }
44
+ export {};
package/package.json CHANGED
@@ -1,60 +1,55 @@
1
- {
2
- "name": "@vervedoc/core",
3
- "version": "3.0.11",
4
- "description": "VerveDoc Core 核心编辑器库",
5
- "author": "wanghe",
6
- "license": "MIT",
7
- "type": "module",
8
- "main": "./dist/core.umd.cjs",
9
- "module": "./dist/core.js",
10
- "types": "./dist/index.d.ts",
11
- "exports": {
12
- ".": {
13
- "types": "./dist/index.d.ts",
14
- "import": "./dist/core.js",
15
- "require": "./dist/core.umd.cjs"
16
- }
17
- },
18
- "publishConfig": {
19
- "access": "public"
20
- },
21
- "files": [
22
- "dist",
23
- "README.md",
24
- "package.json"
25
- ],
26
- "scripts": {
27
- "dev": "vite",
28
- "clean": "node -e \"const fs = require('fs'); if(fs.existsSync('dist')) fs.rmSync('dist', {recursive: true})\"",
29
- "build": "npm run clean && tsc && vite build",
30
- "preview": "vite preview",
31
- "type:check": "tsc --noEmit"
32
- },
33
- "devDependencies": {
34
- "@eslint/js": "^10.0.1",
35
- "@types/node": "^25.3.3",
36
- "eslint": "^10.4.0",
37
- "eslint-plugin-unused-imports": "^4.4.1",
38
- "typescript": "^5.0.0",
39
- "typescript-eslint": "^8.59.4",
40
- "vite": "^6.4.3",
41
- "vite-plugin-css-injected-by-js": "^3.0.0",
42
- "vite-plugin-dts": "^4.5.4"
43
- },
44
- "engines": {
45
- "node": ">=16.0.0"
46
- },
47
- "dependencies": {
48
- "@vervedoc/docx-editor-commands": "1.0.4",
49
- "@vervedoc/docx-editor-comment": "1.0.7",
50
- "@vervedoc/docx-editor-history": "1.0.8",
51
- "@vervedoc/docx-editor-keymap": "1.0.5",
52
- "@vervedoc/docx-editor-schema": "1.0.9",
53
- "@vervedoc/docx-editor-state": "1.0.3",
54
- "@vervedoc/docx-editor-transform": "1.0.8",
55
- "@vervedoc/docx-editor-view": "1.0.5",
56
- "docx": "^9.1.0",
57
- "jszip": "^3.10.1",
58
- "vanilla-picker": "^2.12.3"
59
- }
60
- }
1
+ {
2
+ "name": "@vervedoc/core",
3
+ "version": "3.3.11",
4
+ "description": "VerveDoc Core 核心编辑器库(Canvas 2D 高性能实现)",
5
+ "author": "wanghe",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "main": "./dist/core.umd.cjs",
9
+ "module": "./dist/core.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/core.js",
15
+ "require": "./dist/core.umd.cjs"
16
+ }
17
+ },
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "files": [
22
+ "dist",
23
+ "README.md",
24
+ "package.json"
25
+ ],
26
+ "devDependencies": {
27
+ "@eslint/js": "^10.0.1",
28
+ "@types/node": "^22.10.0",
29
+ "eslint": "^10.4.0",
30
+ "eslint-plugin-unused-imports": "^4.4.1",
31
+ "typescript": "~5.6.2",
32
+ "typescript-eslint": "^8.59.4",
33
+ "vite": "^6.4.3",
34
+ "vite-plugin-css-injected-by-js": "^3.0.0",
35
+ "vite-plugin-dts": "^4.5.4"
36
+ },
37
+ "engines": {
38
+ "node": ">=16.0.0"
39
+ },
40
+ "dependencies": {
41
+ "@vervedoc/docx-editor-schema": "^1.0.10",
42
+ "@vervedoc/docx-editor-view": "^1.0.6",
43
+ "@vervedoc/docx-editor-state": "^1.0.4",
44
+ "@vervedoc/docx-editor-transform": "^1.0.9",
45
+ "@vervedoc/docx-editor-history": "^1.0.9",
46
+ "@vervedoc/docx-editor-commands": "^1.0.5"
47
+ },
48
+ "scripts": {
49
+ "dev": "vite",
50
+ "clean": "node -e \"const fs = require('fs'); if(fs.existsSync('dist')) fs.rmSync('dist', {recursive: true})\"",
51
+ "build": "pnpm run clean && tsc && vite build",
52
+ "preview": "vite preview",
53
+ "type:check": "tsc --noEmit"
54
+ }
55
+ }
@@ -1,17 +0,0 @@
1
- import { IEditorData, IEditorOption, IElement, EventBusMap, UsePlugin } from '@vervedoc/docx-editor-schema';
2
- import { Command } from '@vervedoc/docx-editor-transform';
3
- import { Listener, EventBus } from '@vervedoc/docx-editor-state';
4
- import { Register, Override } from '@vervedoc/docx-editor-view';
5
- import { CommentComponent, RevisionComponent } from '@vervedoc/docx-editor-comment';
6
- export default class DocxEditor {
7
- command: Command;
8
- listener: Listener;
9
- eventBus: EventBus<EventBusMap>;
10
- override: Override;
11
- register: Register;
12
- comment: CommentComponent;
13
- revision: RevisionComponent;
14
- destroy: () => void;
15
- use: UsePlugin;
16
- constructor(container: HTMLDivElement, data: IEditorData | IElement[], options?: IEditorOption);
17
- }
@@ -1,22 +0,0 @@
1
- export interface AutoSaveOptions {
2
- interval?: number;
3
- enabled?: boolean;
4
- isReadonly?: () => boolean;
5
- onSave: (content: any) => void | Promise<void>;
6
- getContent: () => any;
7
- }
8
- export declare class Actuator {
9
- private _saveTimer;
10
- private _saving;
11
- private _pendingSave;
12
- private _autoSaveOptions;
13
- install(): this;
14
- configureAutoSave(options: AutoSaveOptions): void;
15
- saveNow(_options?: {
16
- silent?: boolean;
17
- }): Promise<void>;
18
- scheduleSave(): void;
19
- stopAutoSave(): void;
20
- isSaving(): boolean;
21
- destroy(): void;
22
- }