@docx-editor.dev/core 0.0.1 → 2.1.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/LICENSE +201 -0
- package/README.md +91 -2
- package/THIRD_PARTY_NOTICES.md +18 -0
- package/dist/automation.cjs +1 -0
- package/dist/automation.d.cts +74 -0
- package/dist/automation.d.ts +74 -0
- package/dist/automation.js +1 -0
- package/dist/binding.cjs +1 -0
- package/dist/binding.d.cts +88 -0
- package/dist/binding.d.ts +88 -0
- package/dist/binding.js +1 -0
- package/dist/chunk-2DTQDAN7.js +2 -0
- package/dist/chunk-3JKQE4QJ.cjs +2 -0
- package/dist/chunk-4WWEDTTE.js +2 -0
- package/dist/chunk-6WIIHJFY.js +1 -0
- package/dist/chunk-7VQ7YLW3.cjs +1 -0
- package/dist/chunk-BS554B6D.cjs +2 -0
- package/dist/chunk-BZK64YU3.cjs +10 -0
- package/dist/chunk-CZFUMACF.cjs +12 -0
- package/dist/chunk-GQQOL4PV.js +1 -0
- package/dist/chunk-HBL3NNH5.cjs +1 -0
- package/dist/chunk-JQFDLZXQ.cjs +2 -0
- package/dist/chunk-O2WQY7IT.cjs +5 -0
- package/dist/chunk-PC76F2HR.cjs +1 -0
- package/dist/chunk-QRAUDDVY.js +2 -0
- package/dist/chunk-REZUWYB7.js +1 -0
- package/dist/chunk-STCITBJK.js +12 -0
- package/dist/chunk-TBBXCC7D.js +5 -0
- package/dist/chunk-TSXT537P.cjs +12 -0
- package/dist/chunk-WOGYVM3W.js +12 -0
- package/dist/chunk-Y7TA7TPF.js +10 -0
- package/dist/content-control-walk-CbTqHq6O.d.cts +56 -0
- package/dist/content-control-walk-D06GijR0.d.ts +56 -0
- package/dist/contracts/document.cjs +1 -0
- package/dist/contracts/document.d.cts +246 -0
- package/dist/contracts/document.d.ts +246 -0
- package/dist/contracts/document.js +0 -0
- package/dist/contracts/editor.cjs +1 -0
- package/dist/contracts/editor.d.cts +11 -0
- package/dist/contracts/editor.d.ts +11 -0
- package/dist/contracts/editor.js +1 -0
- package/dist/contracts/interaction.cjs +1 -0
- package/dist/contracts/interaction.d.cts +11 -0
- package/dist/contracts/interaction.d.ts +11 -0
- package/dist/contracts/interaction.js +0 -0
- package/dist/contracts/modules.cjs +1 -0
- package/dist/contracts/modules.d.cts +117 -0
- package/dist/contracts/modules.d.ts +117 -0
- package/dist/contracts/modules.js +1 -0
- package/dist/contracts/types.cjs +1 -0
- package/dist/contracts/types.d.cts +452 -0
- package/dist/contracts/types.d.ts +452 -0
- package/dist/contracts/types.js +0 -0
- package/dist/custom-node-writes-YqISlSRl.d.cts +885 -0
- package/dist/custom-node-writes-ttKuYd0M.d.ts +885 -0
- package/dist/editor-B93PggnR.d.cts +1690 -0
- package/dist/editor-CFsSrxGR.d.ts +1690 -0
- package/dist/editor.cjs +1 -0
- package/dist/editor.css +7106 -0
- package/dist/editor.d.cts +271 -0
- package/dist/editor.d.ts +271 -0
- package/dist/editor.js +1 -0
- package/dist/hf-references-BdjsQNE_.d.ts +71 -0
- package/dist/hf-references-CgEOSw3i.d.cts +71 -0
- package/dist/image-resources-C_YnqPhn.d.ts +203 -0
- package/dist/image-resources-DwpNnTg3.d.cts +203 -0
- package/dist/index-BjZelfWL.d.cts +2532 -0
- package/dist/index-DP1yJJ3R.d.ts +2532 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +22 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +1 -0
- package/dist/layout.cjs +1 -0
- package/dist/layout.d.cts +2366 -0
- package/dist/layout.d.ts +2366 -0
- package/dist/layout.js +1 -0
- package/dist/note-nodes-BPSTVDMr.d.ts +108 -0
- package/dist/note-nodes-C6DLxlvj.d.cts +108 -0
- package/dist/ooxml-package-CR5us6ad.d.cts +354 -0
- package/dist/ooxml-package-D_CtywTW.d.ts +354 -0
- package/dist/ooxml-tree-BU0e3DVi.d.cts +871 -0
- package/dist/ooxml-tree-BU0e3DVi.d.ts +871 -0
- package/dist/output.cjs +1 -0
- package/dist/output.d.cts +158 -0
- package/dist/output.d.ts +158 -0
- package/dist/output.js +1 -0
- package/dist/protocol-BWVA3Q1p.d.ts +1255 -0
- package/dist/protocol-FAz_nPm_.d.cts +1255 -0
- package/dist/review-reads-CsoXSvUg.d.ts +401 -0
- package/dist/review-reads-qW0jvdF1.d.cts +401 -0
- package/dist/review-support-D64Wu236.d.cts +358 -0
- package/dist/review-support-nsLXC9jf.d.ts +358 -0
- package/dist/revision-projection-72ZApe-g.d.cts +84 -0
- package/dist/revision-projection-DHAkcD_L.d.ts +84 -0
- package/dist/semantic-cell-selection-D_8RbPII.d.ts +427 -0
- package/dist/semantic-cell-selection-DwLB71fF.d.cts +427 -0
- package/dist/semantic-interaction-CXH2wFqi.d.ts +187 -0
- package/dist/semantic-interaction-DqcEonqD.d.cts +187 -0
- package/dist/semantic-paint-drawings-B5Wk2so5.d.ts +21 -0
- package/dist/semantic-paint-drawings-x8g44lD_.d.cts +21 -0
- package/dist/semantic-records-COVFW5aS.d.cts +1505 -0
- package/dist/semantic-records-zTC0_1zi.d.ts +1505 -0
- package/dist/shaped-measurer-AFnFxoot.d.cts +613 -0
- package/dist/shaped-measurer-CZXL-a6v.d.ts +613 -0
- package/dist/store.cjs +1 -0
- package/dist/store.d.cts +2153 -0
- package/dist/store.d.ts +2153 -0
- package/dist/store.js +1 -0
- package/dist/tree-op-types-DWLCllG7.d.ts +1486 -0
- package/dist/tree-op-types-UOXlRUqQ.d.cts +1486 -0
- package/dist/tree-session-BtVFXsF6.d.ts +580 -0
- package/dist/tree-session-DxIOHUOD.d.cts +580 -0
- package/dist/tree-store-B1lEkdXc.d.cts +273 -0
- package/dist/tree-store-BscFPB7x.d.ts +273 -0
- package/package.json +110 -8
- package/index.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk7VQ7YLW3_cjs=require('../chunk-7VQ7YLW3.cjs');Object.defineProperty(exports,"resolveEditorModules",{enumerable:true,get:function(){return chunk7VQ7YLW3_cjs.a}});
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { e as OoxmlPart } from '../ooxml-tree-BU0e3DVi.cjs';
|
|
2
|
+
export { R as RevisionAddress } from '../tree-op-types-UOXlRUqQ.cjs';
|
|
3
|
+
import { R as RevisionDisplayMode } from '../revision-projection-72ZApe-g.cjs';
|
|
4
|
+
import { R as ReviewModelInput, a as ReviewItem, b as ReviewRevisionItem } from '../review-support-D64Wu236.cjs';
|
|
5
|
+
export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, e as ReviewPosition, f as ReviewRange, g as ReviewRevisionKind } from '../review-support-D64Wu236.cjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* `@docx-editor.dev/core/contracts/modules` — the `EditorModule` seam.
|
|
9
|
+
*
|
|
10
|
+
* How a paid or optional capability contributes to the engine without the free tier importing
|
|
11
|
+
* it: the review module and custom nodes both arrive through here, and their absence leaves the
|
|
12
|
+
* corresponding chrome disabled with the engine's own reason.
|
|
13
|
+
*
|
|
14
|
+
* NOT a plugin system. The shape is closed: every contribution point is named
|
|
15
|
+
* here, core iterates registered modules at its existing dispatch points, and
|
|
16
|
+
* core never imports a capability package. A capability absent from this file
|
|
17
|
+
* is not extendable from outside — deliberately, so the one-pipeline principle
|
|
18
|
+
* survives the packaging boundary.
|
|
19
|
+
* The free engine behaves identically with an empty registry: documents
|
|
20
|
+
* round-trip losslessly, revisions render in their final-state projection, and
|
|
21
|
+
* the review chrome slots stay disabled with the engine's own reason.
|
|
22
|
+
*
|
|
23
|
+
* @packageDocumentation
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Derives the review queue — every pending revision decision and comment
|
|
29
|
+
* thread — from one story part plus its comment parts. Implemented by the pro
|
|
30
|
+
* review module; the free engine has no implementation and reports an empty
|
|
31
|
+
* queue.
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
type CollectReviewItems = (input: ReviewModelInput) => readonly ReviewItem[];
|
|
36
|
+
/**
|
|
37
|
+
* What a review module contributes: the queue derivation, and the revision
|
|
38
|
+
* display modes the editor may enter beyond the free tier's final-state
|
|
39
|
+
* projection.
|
|
40
|
+
*
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
interface ReviewModuleContribution {
|
|
44
|
+
/**
|
|
45
|
+
* Display modes this module unlocks (the free engine renders `proposed` only).
|
|
46
|
+
*
|
|
47
|
+
* Currently DECLARATIVE: any registered review module restores the layout
|
|
48
|
+
* default (`all-markup`), and no runtime mode switch exists yet. The list is
|
|
49
|
+
* carried so the future `setRevisionDisplayMode` command can validate against
|
|
50
|
+
* it without a breaking module-shape change.
|
|
51
|
+
*/
|
|
52
|
+
readonly displayModes: readonly RevisionDisplayMode[];
|
|
53
|
+
/** The review queue derivation. */
|
|
54
|
+
readonly collectReviewItems: CollectReviewItems;
|
|
55
|
+
/**
|
|
56
|
+
* Revisions wholly inside one paragraph — for the conservative local review
|
|
57
|
+
* patch after a text-local body edit.
|
|
58
|
+
*/
|
|
59
|
+
readonly revisionItemsOfParagraph: (part: OoxmlPart, paragraphId: string) => readonly ReviewRevisionItem[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* One registered capability module. Registration is construction-time
|
|
63
|
+
* (`createDocxEditor({ modules })`) and immutable for the instance's lifetime.
|
|
64
|
+
*
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
67
|
+
interface EditorModule {
|
|
68
|
+
/** Diagnostic identity (`'review'`, `'custom-nodes'`); not a dispatch key. */
|
|
69
|
+
readonly id: string;
|
|
70
|
+
/** Review capability: queue derivation, commands gate, display modes. */
|
|
71
|
+
readonly review?: ReviewModuleContribution;
|
|
72
|
+
/**
|
|
73
|
+
* Custom inline node definitions. Reserved: the definition shape lands with
|
|
74
|
+
* the custom-nodes lane; the registry carries them opaquely until then.
|
|
75
|
+
*/
|
|
76
|
+
readonly customNodes?: readonly unknown[];
|
|
77
|
+
/**
|
|
78
|
+
* customXml payload namespaces this module OWNS, swept for orphans when a document opens.
|
|
79
|
+
*
|
|
80
|
+
* A payload lives in a customXml data part, and Word will not delete one when a user deletes
|
|
81
|
+
* the control bound to it — nothing in OOXML asks it to. So a document can arrive holding
|
|
82
|
+
* payloads for chips that no longer exist, and reconciling against what the story actually
|
|
83
|
+
* binds is the only thing that collects them.
|
|
84
|
+
*
|
|
85
|
+
* The claim is what keeps the sweep off other people's stores: Word's own Cover Page
|
|
86
|
+
* Properties store rides in most templates, and a sweep that walked every customXml part
|
|
87
|
+
* would be deleting from it on the strength of a name collision. A namespace no module names
|
|
88
|
+
* is never touched.
|
|
89
|
+
*/
|
|
90
|
+
readonly customNodePayloadNamespaces?: readonly string[];
|
|
91
|
+
/**
|
|
92
|
+
* Told when the recognition pass finds something wrong with a node in THIS editor's document.
|
|
93
|
+
*
|
|
94
|
+
* Carried per module rather than kept by the capability package, so two editors on one page
|
|
95
|
+
* hear only their own documents and a detached editor's listener goes with it. The shape is
|
|
96
|
+
* opaque here for the same reason `customNodes` is: what a diagnostic means belongs to the
|
|
97
|
+
* package that raised it.
|
|
98
|
+
*/
|
|
99
|
+
readonly onCustomNodeDiagnostic?: (diagnostic: unknown) => void;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The resolved registry the editor instance holds: at most one review
|
|
103
|
+
* contribution (first registration wins), all custom node definitions in
|
|
104
|
+
* registration order.
|
|
105
|
+
*/
|
|
106
|
+
interface EditorModuleRegistry {
|
|
107
|
+
readonly review: ReviewModuleContribution | null;
|
|
108
|
+
readonly customNodes: readonly unknown[];
|
|
109
|
+
/** Every claimed payload namespace, deduplicated, in registration order. */
|
|
110
|
+
readonly customNodePayloadNamespaces: readonly string[];
|
|
111
|
+
/** Every registered diagnostic listener, in registration order. */
|
|
112
|
+
readonly customNodeDiagnostics: readonly ((diagnostic: unknown) => void)[];
|
|
113
|
+
}
|
|
114
|
+
/** Resolve construction-time modules into the registry the instance dispatches over. */
|
|
115
|
+
declare function resolveEditorModules(modules: readonly EditorModule[] | undefined): EditorModuleRegistry;
|
|
116
|
+
|
|
117
|
+
export { type CollectReviewItems, type EditorModule, type EditorModuleRegistry, OoxmlPart, ReviewItem, ReviewModelInput, type ReviewModuleContribution, ReviewRevisionItem, RevisionDisplayMode, resolveEditorModules };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { e as OoxmlPart } from '../ooxml-tree-BU0e3DVi.js';
|
|
2
|
+
export { R as RevisionAddress } from '../tree-op-types-DWLCllG7.js';
|
|
3
|
+
import { R as RevisionDisplayMode } from '../revision-projection-DHAkcD_L.js';
|
|
4
|
+
import { R as ReviewModelInput, a as ReviewItem, b as ReviewRevisionItem } from '../review-support-nsLXC9jf.js';
|
|
5
|
+
export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, e as ReviewPosition, f as ReviewRange, g as ReviewRevisionKind } from '../review-support-nsLXC9jf.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* `@docx-editor.dev/core/contracts/modules` — the `EditorModule` seam.
|
|
9
|
+
*
|
|
10
|
+
* How a paid or optional capability contributes to the engine without the free tier importing
|
|
11
|
+
* it: the review module and custom nodes both arrive through here, and their absence leaves the
|
|
12
|
+
* corresponding chrome disabled with the engine's own reason.
|
|
13
|
+
*
|
|
14
|
+
* NOT a plugin system. The shape is closed: every contribution point is named
|
|
15
|
+
* here, core iterates registered modules at its existing dispatch points, and
|
|
16
|
+
* core never imports a capability package. A capability absent from this file
|
|
17
|
+
* is not extendable from outside — deliberately, so the one-pipeline principle
|
|
18
|
+
* survives the packaging boundary.
|
|
19
|
+
* The free engine behaves identically with an empty registry: documents
|
|
20
|
+
* round-trip losslessly, revisions render in their final-state projection, and
|
|
21
|
+
* the review chrome slots stay disabled with the engine's own reason.
|
|
22
|
+
*
|
|
23
|
+
* @packageDocumentation
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Derives the review queue — every pending revision decision and comment
|
|
29
|
+
* thread — from one story part plus its comment parts. Implemented by the pro
|
|
30
|
+
* review module; the free engine has no implementation and reports an empty
|
|
31
|
+
* queue.
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
type CollectReviewItems = (input: ReviewModelInput) => readonly ReviewItem[];
|
|
36
|
+
/**
|
|
37
|
+
* What a review module contributes: the queue derivation, and the revision
|
|
38
|
+
* display modes the editor may enter beyond the free tier's final-state
|
|
39
|
+
* projection.
|
|
40
|
+
*
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
interface ReviewModuleContribution {
|
|
44
|
+
/**
|
|
45
|
+
* Display modes this module unlocks (the free engine renders `proposed` only).
|
|
46
|
+
*
|
|
47
|
+
* Currently DECLARATIVE: any registered review module restores the layout
|
|
48
|
+
* default (`all-markup`), and no runtime mode switch exists yet. The list is
|
|
49
|
+
* carried so the future `setRevisionDisplayMode` command can validate against
|
|
50
|
+
* it without a breaking module-shape change.
|
|
51
|
+
*/
|
|
52
|
+
readonly displayModes: readonly RevisionDisplayMode[];
|
|
53
|
+
/** The review queue derivation. */
|
|
54
|
+
readonly collectReviewItems: CollectReviewItems;
|
|
55
|
+
/**
|
|
56
|
+
* Revisions wholly inside one paragraph — for the conservative local review
|
|
57
|
+
* patch after a text-local body edit.
|
|
58
|
+
*/
|
|
59
|
+
readonly revisionItemsOfParagraph: (part: OoxmlPart, paragraphId: string) => readonly ReviewRevisionItem[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* One registered capability module. Registration is construction-time
|
|
63
|
+
* (`createDocxEditor({ modules })`) and immutable for the instance's lifetime.
|
|
64
|
+
*
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
67
|
+
interface EditorModule {
|
|
68
|
+
/** Diagnostic identity (`'review'`, `'custom-nodes'`); not a dispatch key. */
|
|
69
|
+
readonly id: string;
|
|
70
|
+
/** Review capability: queue derivation, commands gate, display modes. */
|
|
71
|
+
readonly review?: ReviewModuleContribution;
|
|
72
|
+
/**
|
|
73
|
+
* Custom inline node definitions. Reserved: the definition shape lands with
|
|
74
|
+
* the custom-nodes lane; the registry carries them opaquely until then.
|
|
75
|
+
*/
|
|
76
|
+
readonly customNodes?: readonly unknown[];
|
|
77
|
+
/**
|
|
78
|
+
* customXml payload namespaces this module OWNS, swept for orphans when a document opens.
|
|
79
|
+
*
|
|
80
|
+
* A payload lives in a customXml data part, and Word will not delete one when a user deletes
|
|
81
|
+
* the control bound to it — nothing in OOXML asks it to. So a document can arrive holding
|
|
82
|
+
* payloads for chips that no longer exist, and reconciling against what the story actually
|
|
83
|
+
* binds is the only thing that collects them.
|
|
84
|
+
*
|
|
85
|
+
* The claim is what keeps the sweep off other people's stores: Word's own Cover Page
|
|
86
|
+
* Properties store rides in most templates, and a sweep that walked every customXml part
|
|
87
|
+
* would be deleting from it on the strength of a name collision. A namespace no module names
|
|
88
|
+
* is never touched.
|
|
89
|
+
*/
|
|
90
|
+
readonly customNodePayloadNamespaces?: readonly string[];
|
|
91
|
+
/**
|
|
92
|
+
* Told when the recognition pass finds something wrong with a node in THIS editor's document.
|
|
93
|
+
*
|
|
94
|
+
* Carried per module rather than kept by the capability package, so two editors on one page
|
|
95
|
+
* hear only their own documents and a detached editor's listener goes with it. The shape is
|
|
96
|
+
* opaque here for the same reason `customNodes` is: what a diagnostic means belongs to the
|
|
97
|
+
* package that raised it.
|
|
98
|
+
*/
|
|
99
|
+
readonly onCustomNodeDiagnostic?: (diagnostic: unknown) => void;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The resolved registry the editor instance holds: at most one review
|
|
103
|
+
* contribution (first registration wins), all custom node definitions in
|
|
104
|
+
* registration order.
|
|
105
|
+
*/
|
|
106
|
+
interface EditorModuleRegistry {
|
|
107
|
+
readonly review: ReviewModuleContribution | null;
|
|
108
|
+
readonly customNodes: readonly unknown[];
|
|
109
|
+
/** Every claimed payload namespace, deduplicated, in registration order. */
|
|
110
|
+
readonly customNodePayloadNamespaces: readonly string[];
|
|
111
|
+
/** Every registered diagnostic listener, in registration order. */
|
|
112
|
+
readonly customNodeDiagnostics: readonly ((diagnostic: unknown) => void)[];
|
|
113
|
+
}
|
|
114
|
+
/** Resolve construction-time modules into the registry the instance dispatches over. */
|
|
115
|
+
declare function resolveEditorModules(modules: readonly EditorModule[] | undefined): EditorModuleRegistry;
|
|
116
|
+
|
|
117
|
+
export { type CollectReviewItems, type EditorModule, type EditorModuleRegistry, OoxmlPart, ReviewItem, ReviewModelInput, type ReviewModuleContribution, ReviewRevisionItem, RevisionDisplayMode, resolveEditorModules };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as resolveEditorModules}from'../chunk-GQQOL4PV.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';
|