@beyondwork/docx-react-component 1.0.18 → 1.0.20
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/README.md +8 -2
- package/package.json +24 -34
- package/src/api/README.md +5 -1
- package/src/api/public-types.ts +710 -4
- package/src/api/session-state.ts +60 -0
- package/src/core/commands/formatting-commands.ts +2 -1
- package/src/core/commands/image-commands.ts +147 -0
- package/src/core/commands/index.ts +19 -3
- package/src/core/commands/list-commands.ts +231 -36
- package/src/core/commands/paragraph-layout-commands.ts +339 -0
- package/src/core/commands/section-layout-commands.ts +680 -0
- package/src/core/commands/style-commands.ts +262 -0
- package/src/core/search/search-text.ts +357 -0
- package/src/core/selection/mapping.ts +41 -0
- package/src/core/state/editor-state.ts +4 -1
- package/src/index.ts +51 -0
- package/src/io/docx-session.ts +623 -56
- package/src/io/export/serialize-comments.ts +104 -34
- package/src/io/export/serialize-footnotes.ts +198 -1
- package/src/io/export/serialize-headers-footers.ts +203 -10
- package/src/io/export/serialize-main-document.ts +285 -8
- package/src/io/export/serialize-numbering.ts +28 -7
- package/src/io/export/split-review-boundaries.ts +181 -19
- package/src/io/normalize/normalize-text.ts +144 -32
- package/src/io/ooxml/highlight-colors.ts +39 -0
- package/src/io/ooxml/numbering-sentinels.ts +44 -0
- package/src/io/ooxml/parse-comments.ts +85 -19
- package/src/io/ooxml/parse-fields.ts +396 -0
- package/src/io/ooxml/parse-footnotes.ts +452 -22
- package/src/io/ooxml/parse-headers-footers.ts +657 -29
- package/src/io/ooxml/parse-inline-media.ts +30 -0
- package/src/io/ooxml/parse-main-document.ts +807 -20
- package/src/io/ooxml/parse-numbering.ts +7 -0
- package/src/io/ooxml/parse-revisions.ts +317 -38
- package/src/io/ooxml/parse-settings.ts +184 -0
- package/src/io/ooxml/parse-shapes.ts +25 -0
- package/src/io/ooxml/parse-styles.ts +463 -0
- package/src/io/ooxml/parse-theme.ts +32 -0
- package/src/legal/bookmarks.ts +44 -0
- package/src/legal/cross-references.ts +59 -1
- package/src/model/canonical-document.ts +250 -4
- package/src/model/cds-1.0.0.ts +13 -0
- package/src/model/snapshot.ts +87 -2
- package/src/review/store/revision-store.ts +6 -0
- package/src/review/store/revision-types.ts +1 -0
- package/src/runtime/document-layout.ts +332 -0
- package/src/runtime/document-navigation.ts +603 -0
- package/src/runtime/document-runtime.ts +1754 -78
- package/src/runtime/document-search.ts +145 -0
- package/src/runtime/numbering-prefix.ts +47 -26
- package/src/runtime/page-layout-estimation.ts +212 -0
- package/src/runtime/read-only-diagnostics-runtime.ts +9 -0
- package/src/runtime/session-capabilities.ts +35 -3
- package/src/runtime/story-context.ts +164 -0
- package/src/runtime/story-targeting.ts +162 -0
- package/src/runtime/surface-projection.ts +324 -36
- package/src/runtime/table-schema.ts +89 -7
- package/src/runtime/view-state.ts +477 -0
- package/src/runtime/workflow-markup.ts +349 -0
- package/src/ui/WordReviewEditor.tsx +2469 -1344
- package/src/ui/browser-export.ts +52 -0
- package/src/ui/editor-command-bag.ts +120 -0
- package/src/ui/editor-runtime-boundary.ts +1422 -0
- package/src/ui/editor-shell-view.tsx +134 -0
- package/src/ui/editor-surface-controller.tsx +51 -0
- package/src/ui/headless/preserve-editor-selection.ts +5 -0
- package/src/ui/headless/revision-decoration-model.ts +4 -4
- package/src/ui/headless/selection-helpers.ts +20 -0
- package/src/ui/headless/selection-toolbar-model.ts +22 -0
- package/src/ui/headless/use-editor-keyboard.ts +6 -1
- package/src/ui/runtime-snapshot-selectors.ts +197 -0
- package/src/ui-tailwind/chrome/tw-alert-banner.tsx +18 -2
- package/src/ui-tailwind/chrome/tw-image-context-toolbar.tsx +129 -0
- package/src/ui-tailwind/chrome/tw-layout-panel.tsx +114 -0
- package/src/ui-tailwind/chrome/tw-object-context-toolbar.tsx +34 -0
- package/src/ui-tailwind/chrome/tw-page-ruler.tsx +386 -0
- package/src/ui-tailwind/chrome/tw-selection-toolbar.tsx +150 -14
- package/src/ui-tailwind/chrome/tw-table-context-toolbar.tsx +128 -0
- package/src/ui-tailwind/editor-surface/perf-probe.ts +179 -0
- package/src/ui-tailwind/editor-surface/pm-command-bridge.ts +46 -7
- package/src/ui-tailwind/editor-surface/pm-contextual-ui.ts +31 -0
- package/src/ui-tailwind/editor-surface/pm-decorations.ts +35 -0
- package/src/ui-tailwind/editor-surface/pm-position-map.ts +3 -3
- package/src/ui-tailwind/editor-surface/pm-schema.ts +186 -13
- package/src/ui-tailwind/editor-surface/pm-state-from-snapshot.ts +191 -68
- package/src/ui-tailwind/editor-surface/search-plugin.ts +19 -68
- package/src/ui-tailwind/editor-surface/surface-build-keys.ts +51 -0
- package/src/ui-tailwind/editor-surface/tw-inline-token.tsx +11 -0
- package/src/ui-tailwind/editor-surface/tw-opaque-block.tsx +7 -1
- package/src/ui-tailwind/editor-surface/tw-prosemirror-surface.tsx +528 -85
- package/src/ui-tailwind/editor-surface/tw-table-node-view.tsx +0 -1
- package/src/ui-tailwind/index.ts +2 -1
- package/src/ui-tailwind/page-chrome-model.ts +27 -0
- package/src/ui-tailwind/review/tw-comment-sidebar.tsx +277 -147
- package/src/ui-tailwind/review/tw-health-panel.tsx +31 -2
- package/src/ui-tailwind/review/tw-review-rail.tsx +8 -8
- package/src/ui-tailwind/review/tw-revision-sidebar.tsx +15 -15
- package/src/ui-tailwind/theme/editor-theme.css +127 -0
- package/src/ui-tailwind/toolbar/tw-toolbar-icon-button.tsx +4 -0
- package/src/ui-tailwind/toolbar/tw-toolbar.tsx +829 -12
- package/src/ui-tailwind/tw-review-workspace.tsx +1238 -42
- package/src/validation/compatibility-engine.ts +119 -24
- package/src/validation/compatibility-report.ts +1 -0
- package/src/validation/diagnostics.ts +1 -0
- package/src/validation/docx-comment-proof.ts +707 -0
package/README.md
CHANGED
|
@@ -39,9 +39,15 @@ import { WordReviewEditor } from "@beyondwork/docx-react-component";
|
|
|
39
39
|
|
|
40
40
|
`WordReviewEditor` remains uncontrolled by default:
|
|
41
41
|
|
|
42
|
-
- host passes `initialDocx` or `initialSnapshot`
|
|
42
|
+
- host passes `initialDocx`, `initialSessionState`, or `initialSnapshot`, or provides `hostAdapter.load()` / `datastore.load()`
|
|
43
43
|
- runtime owns the live working session
|
|
44
|
-
- host receives events, warnings, errors, snapshots, and exported artifacts
|
|
44
|
+
- host receives events, warnings, errors, session state, compatibility snapshots, and exported artifacts
|
|
45
|
+
|
|
46
|
+
Persistence direction:
|
|
47
|
+
|
|
48
|
+
- `EditorSessionState` is the canonical host-facing live-session contract
|
|
49
|
+
- `EditorHostAdapter` is the preferred persistence boundary for `load`, `saveSession`, `saveExport`, and telemetry
|
|
50
|
+
- `EditorDatastoreAdapter` remains the legacy snapshot bridge for hosts that still persist `PersistedEditorSnapshot`
|
|
45
51
|
|
|
46
52
|
Snapshot/export note:
|
|
47
53
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beyondwork/docx-react-component",
|
|
3
3
|
"publisher": "beyondwork",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.20",
|
|
5
5
|
"description": "Embeddable React Word (docx) editor with review, comments, tracked changes, and round-trip OOXML fidelity.",
|
|
6
|
-
"packageManager": "pnpm@10.30.3",
|
|
7
6
|
"type": "module",
|
|
8
7
|
"sideEffects": [
|
|
9
8
|
"**/*.css"
|
|
@@ -81,29 +80,6 @@
|
|
|
81
80
|
"./ui-tailwind/theme/editor-theme.css": "./src/ui-tailwind/theme/editor-theme.css"
|
|
82
81
|
},
|
|
83
82
|
"types": "./src/index.ts",
|
|
84
|
-
"scripts": {
|
|
85
|
-
"build": "tsup",
|
|
86
|
-
"test": "bash scripts/run-workspace-tests.sh",
|
|
87
|
-
"test:repo": "node scripts/run-repo-tests.mjs core",
|
|
88
|
-
"test:repo:all": "node scripts/run-repo-tests.mjs all",
|
|
89
|
-
"test:repo:optional": "node scripts/run-repo-tests.mjs optional",
|
|
90
|
-
"test:wcag-audit": "node scripts/run-repo-tests.mjs wcag-audit",
|
|
91
|
-
"test:harness": "pnpm --filter @docx-react-component/react-word-editor-harness test",
|
|
92
|
-
"lint": "pnpm run lint:no-authored-js && pnpm run lint:tsgo && pnpm run lint:tsgo:harness",
|
|
93
|
-
"lint:no-authored-js": "bash scripts/check-no-authored-js.sh",
|
|
94
|
-
"lint:tsgo": "tsgo --noEmit -p tsconfig.build.json",
|
|
95
|
-
"lint:tsgo:harness": "pnpm --filter @docx-react-component/react-word-editor-harness lint:tsgo",
|
|
96
|
-
"context7:api-check": "bash scripts/context7-export-env.sh run bash scripts/context7-api-check.sh",
|
|
97
|
-
"wave:doctor": "bash scripts/context7-export-env.sh run pnpm exec wave doctor --json",
|
|
98
|
-
"wave:dry-run": "bash scripts/context7-export-env.sh run pnpm exec wave launch --lane main --dry-run --no-dashboard",
|
|
99
|
-
"wave:launch": "bash scripts/context7-export-env.sh run pnpm exec wave launch --lane main",
|
|
100
|
-
"wave:launch:managed": "bash scripts/wave-launch.sh",
|
|
101
|
-
"wave:status": "bash scripts/wave-status.sh",
|
|
102
|
-
"wave:watch": "bash scripts/wave-watch.sh --follow",
|
|
103
|
-
"wave:dashboard:current": "bash scripts/wave-dashboard-attach.sh current",
|
|
104
|
-
"wave:dashboard:global": "bash scripts/wave-dashboard-attach.sh global",
|
|
105
|
-
"harness:dev": "pnpm --filter @docx-react-component/react-word-editor-harness dev"
|
|
106
|
-
},
|
|
107
83
|
"keywords": [
|
|
108
84
|
"docx",
|
|
109
85
|
"word",
|
|
@@ -166,14 +142,28 @@
|
|
|
166
142
|
"tsup": "^8.3.0",
|
|
167
143
|
"tsx": "^4.21.0"
|
|
168
144
|
},
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
"
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
145
|
+
"scripts": {
|
|
146
|
+
"build": "tsup",
|
|
147
|
+
"test": "bash scripts/run-workspace-tests.sh",
|
|
148
|
+
"test:repo": "node scripts/run-repo-tests.mjs core",
|
|
149
|
+
"test:repo:all": "node scripts/run-repo-tests.mjs all",
|
|
150
|
+
"test:repo:optional": "node scripts/run-repo-tests.mjs optional",
|
|
151
|
+
"test:wcag-audit": "node scripts/run-repo-tests.mjs wcag-audit",
|
|
152
|
+
"test:harness": "pnpm --filter @docx-react-component/react-word-editor-harness test",
|
|
153
|
+
"lint": "pnpm run lint:no-authored-js && pnpm run lint:docs-contracts && pnpm run lint:tsgo && pnpm run lint:tsgo:harness",
|
|
154
|
+
"lint:docs-contracts": "bash scripts/check-reference-load-contract.sh",
|
|
155
|
+
"lint:no-authored-js": "bash scripts/check-no-authored-js.sh",
|
|
156
|
+
"lint:tsgo": "tsgo --noEmit -p tsconfig.build.json",
|
|
157
|
+
"lint:tsgo:harness": "pnpm --filter @docx-react-component/react-word-editor-harness lint:tsgo",
|
|
158
|
+
"context7:api-check": "bash scripts/context7-export-env.sh run bash scripts/context7-api-check.sh",
|
|
159
|
+
"wave:doctor": "bash scripts/context7-export-env.sh run pnpm exec wave doctor --json",
|
|
160
|
+
"wave:dry-run": "bash scripts/context7-export-env.sh run pnpm exec wave launch --lane main --dry-run --no-dashboard",
|
|
161
|
+
"wave:launch": "bash scripts/context7-export-env.sh run pnpm exec wave launch --lane main",
|
|
162
|
+
"wave:launch:managed": "bash scripts/wave-launch.sh",
|
|
163
|
+
"wave:status": "bash scripts/wave-status.sh",
|
|
164
|
+
"wave:watch": "bash scripts/wave-watch.sh --follow",
|
|
165
|
+
"wave:dashboard:current": "bash scripts/wave-dashboard-attach.sh current",
|
|
166
|
+
"wave:dashboard:global": "bash scripts/wave-dashboard-attach.sh global",
|
|
167
|
+
"harness:dev": "pnpm --filter @docx-react-component/react-word-editor-harness dev"
|
|
178
168
|
}
|
|
179
169
|
}
|
package/src/api/README.md
CHANGED
|
@@ -5,7 +5,8 @@ Public TypeScript contracts for `WordReviewEditor` belong here.
|
|
|
5
5
|
This layer should expose:
|
|
6
6
|
|
|
7
7
|
- component props and ref types
|
|
8
|
-
-
|
|
8
|
+
- session-state and snapshot compatibility types
|
|
9
|
+
- host adapter and datastore adapter interfaces
|
|
9
10
|
- runtime-derived position and selection projection types used by the public API
|
|
10
11
|
- discriminated event unions
|
|
11
12
|
- warning and error payloads
|
|
@@ -18,5 +19,8 @@ Frozen naming and boundary rules:
|
|
|
18
19
|
|
|
19
20
|
- the shipped component name is `WordReviewEditor`
|
|
20
21
|
- `DocumentRuntime` is an internal runtime contract, not a public React component name
|
|
22
|
+
- `EditorSessionState` is the canonical host-facing live-session contract
|
|
23
|
+
- `PersistedEditorSnapshot` is the legacy/store compatibility envelope
|
|
24
|
+
- `EditorHostAdapter` is the preferred persistence boundary; `EditorDatastoreAdapter` remains the snapshot-compatible bridge
|
|
21
25
|
- public range references are canonical-position projections, not DOM-path handles
|
|
22
26
|
- render snapshots stay in `src/runtime`; `src/api` only exposes persisted host-facing snapshot types
|