@beyondwork/docx-react-component 1.0.1 → 1.0.3
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 +44 -104
- package/package.json +50 -30
- package/src/README.md +85 -0
- package/src/api/README.md +22 -0
- package/src/api/public-types.ts +525 -0
- package/src/compare/diff-engine.ts +530 -0
- package/src/compare/export-redlines.ts +162 -0
- package/src/compare/snapshot.ts +37 -0
- package/src/component-inventory.md +99 -0
- package/src/core/README.md +10 -0
- package/src/core/commands/README.md +3 -0
- package/src/core/commands/formatting-commands.ts +161 -0
- package/src/core/commands/image-commands.ts +144 -0
- package/src/core/commands/index.ts +1013 -0
- package/src/core/commands/list-commands.ts +370 -0
- package/src/core/commands/review-commands.ts +108 -0
- package/src/core/commands/text-commands.ts +119 -0
- package/src/core/schema/README.md +3 -0
- package/src/core/schema/text-schema.ts +512 -0
- package/src/core/selection/README.md +3 -0
- package/src/core/selection/mapping.ts +238 -0
- package/src/core/selection/review-anchors.ts +94 -0
- package/src/core/state/README.md +3 -0
- package/src/core/state/editor-state.ts +580 -0
- package/src/core/state/text-transaction.ts +276 -0
- package/src/formats/xlsx/io/parse-shared-strings.ts +41 -0
- package/src/formats/xlsx/io/parse-sheet.ts +289 -0
- package/src/formats/xlsx/io/parse-styles.ts +57 -0
- package/src/formats/xlsx/io/parse-workbook.ts +75 -0
- package/src/formats/xlsx/io/xlsx-session.ts +306 -0
- package/src/formats/xlsx/model/cell.ts +189 -0
- package/src/formats/xlsx/model/sheet.ts +244 -0
- package/src/formats/xlsx/model/styles.ts +118 -0
- package/src/formats/xlsx/model/workbook.ts +449 -0
- package/src/index.ts +45 -0
- package/src/io/README.md +10 -0
- package/src/io/docx-session.ts +1763 -0
- package/src/io/export/README.md +3 -0
- package/src/io/export/export-session.ts +165 -0
- package/src/io/export/minimal-docx.ts +115 -0
- package/src/io/export/reattach-preserved-parts.ts +54 -0
- package/src/io/export/serialize-comments.ts +876 -0
- package/src/io/export/serialize-footnotes.ts +217 -0
- package/src/io/export/serialize-headers-footers.ts +200 -0
- package/src/io/export/serialize-main-document.ts +982 -0
- package/src/io/export/serialize-numbering.ts +97 -0
- package/src/io/export/serialize-revisions.ts +389 -0
- package/src/io/export/serialize-runtime-revisions.ts +265 -0
- package/src/io/export/serialize-tables.ts +147 -0
- package/src/io/export/split-review-boundaries.ts +194 -0
- package/src/io/normalize/README.md +3 -0
- package/src/io/normalize/normalize-text.ts +437 -0
- package/src/io/ooxml/README.md +3 -0
- package/src/io/ooxml/parse-comments.ts +779 -0
- package/src/io/ooxml/parse-complex-content.ts +287 -0
- package/src/io/ooxml/parse-fields.ts +438 -0
- package/src/io/ooxml/parse-footnotes.ts +403 -0
- package/src/io/ooxml/parse-headers-footers.ts +483 -0
- package/src/io/ooxml/parse-inline-media.ts +431 -0
- package/src/io/ooxml/parse-main-document.ts +1846 -0
- package/src/io/ooxml/parse-numbering.ts +425 -0
- package/src/io/ooxml/parse-revisions.ts +658 -0
- package/src/io/ooxml/parse-shapes.ts +271 -0
- package/src/io/ooxml/parse-tables.ts +568 -0
- package/src/io/ooxml/parse-theme.ts +314 -0
- package/src/io/ooxml/part-manifest.ts +136 -0
- package/src/io/ooxml/revision-boundaries.ts +351 -0
- package/src/io/opc/README.md +3 -0
- package/src/io/opc/corrupt-package.ts +166 -0
- package/src/io/opc/docx-package.ts +74 -0
- package/src/io/opc/package-reader.ts +325 -0
- package/src/io/opc/package-writer.ts +273 -0
- package/src/legal/bookmarks.ts +196 -0
- package/src/legal/cross-references.ts +356 -0
- package/src/legal/defined-terms.ts +203 -0
- package/src/model/README.md +3 -0
- package/src/model/canonical-document.ts +1911 -0
- package/src/model/cds-1.0.0.ts +196 -0
- package/src/model/snapshot.ts +393 -0
- package/src/preservation/README.md +3 -0
- package/src/preservation/markup-compatibility.ts +48 -0
- package/src/preservation/opaque-fragment-store.ts +89 -0
- package/src/preservation/opaque-region.ts +233 -0
- package/src/preservation/package-preservation.ts +120 -0
- package/src/preservation/preserved-part-manifest.ts +56 -0
- package/src/preservation/relationship-retention.ts +57 -0
- package/src/preservation/store.ts +185 -0
- package/src/review/README.md +16 -0
- package/src/review/store/README.md +3 -0
- package/src/review/store/comment-anchors.ts +70 -0
- package/src/review/store/comment-remapping.ts +154 -0
- package/src/review/store/comment-store.ts +331 -0
- package/src/review/store/comment-thread.ts +109 -0
- package/src/review/store/revision-actions.ts +394 -0
- package/src/review/store/revision-store.ts +303 -0
- package/src/review/store/revision-types.ts +168 -0
- package/src/review/store/runtime-comment-store.ts +43 -0
- package/src/runtime/README.md +3 -0
- package/src/runtime/ai-action-policy.ts +764 -0
- package/src/runtime/document-runtime.ts +967 -0
- package/src/runtime/read-only-diagnostics-runtime.ts +232 -0
- package/src/runtime/review-runtime.ts +44 -0
- package/src/runtime/revision-runtime.ts +107 -0
- package/src/runtime/session-capabilities.ts +138 -0
- package/src/runtime/surface-projection.ts +570 -0
- package/src/runtime/table-commands.ts +87 -0
- package/src/runtime/table-schema.ts +140 -0
- package/src/runtime/virtualized-rendering.ts +258 -0
- package/src/ui/README.md +30 -0
- package/src/ui/WordReviewEditor.tsx +1506 -0
- package/src/ui/comments/README.md +3 -0
- package/src/ui/compatibility/README.md +3 -0
- package/src/ui/editor-surface/README.md +3 -0
- package/src/ui/headless/comment-decoration-model.ts +124 -0
- package/src/ui/headless/revision-decoration-model.ts +128 -0
- package/src/ui/headless/selection-helpers.ts +34 -0
- package/src/ui/headless/use-editor-keyboard.ts +98 -0
- package/src/ui/review/README.md +3 -0
- package/src/ui/shared/revision-filters.ts +31 -0
- package/src/ui/status/README.md +3 -0
- package/src/ui/theme/README.md +3 -0
- package/src/ui/toolbar/README.md +3 -0
- package/src/ui-tailwind/chrome/tw-alert-banner.tsx +48 -0
- package/src/ui-tailwind/chrome/tw-selection-toolbar.tsx +44 -0
- package/src/ui-tailwind/chrome/tw-unsaved-modal.tsx +58 -0
- package/src/ui-tailwind/chrome/use-before-unload.ts +20 -0
- package/src/ui-tailwind/editor-surface/pm-command-bridge.ts +139 -0
- package/src/ui-tailwind/editor-surface/pm-decorations.ts +98 -0
- package/src/ui-tailwind/editor-surface/pm-position-map.ts +123 -0
- package/src/ui-tailwind/editor-surface/pm-schema.ts +452 -0
- package/src/ui-tailwind/editor-surface/pm-state-from-snapshot.ts +327 -0
- package/src/ui-tailwind/editor-surface/search-plugin.ts +157 -0
- package/src/ui-tailwind/editor-surface/tw-caret.tsx +12 -0
- package/src/ui-tailwind/editor-surface/tw-editor-surface.tsx +150 -0
- package/src/ui-tailwind/editor-surface/tw-inline-token.tsx +118 -0
- package/src/ui-tailwind/editor-surface/tw-opaque-block.tsx +52 -0
- package/src/ui-tailwind/editor-surface/tw-paragraph-block.tsx +151 -0
- package/src/ui-tailwind/editor-surface/tw-prosemirror-surface.tsx +215 -0
- package/src/ui-tailwind/editor-surface/tw-segment-view.tsx +111 -0
- package/src/ui-tailwind/editor-surface/tw-table-node-view.tsx +122 -0
- package/src/ui-tailwind/index.ts +61 -0
- package/src/ui-tailwind/review/tw-comment-sidebar.tsx +276 -0
- package/src/ui-tailwind/review/tw-health-panel.tsx +120 -0
- package/src/ui-tailwind/review/tw-review-rail.tsx +120 -0
- package/src/ui-tailwind/review/tw-revision-sidebar.tsx +164 -0
- package/src/ui-tailwind/status/tw-status-bar.tsx +58 -0
- package/src/ui-tailwind/theme/editor-theme.css +190 -0
- package/src/ui-tailwind/toolbar/tw-toolbar-icon-button.tsx +48 -0
- package/src/ui-tailwind/toolbar/tw-toolbar.tsx +231 -0
- package/src/ui-tailwind/tw-review-workspace.tsx +140 -0
- package/src/validation/README.md +3 -0
- package/src/validation/compatibility-engine.ts +317 -0
- package/src/validation/compatibility-report.ts +160 -0
- package/src/validation/diagnostics.ts +203 -0
- package/src/validation/import-diagnostics.ts +128 -0
- package/src/validation/low-priority-word-surfaces.ts +373 -0
- package/dist/chunk-32W6IVQE.js +0 -7725
- package/dist/chunk-32W6IVQE.js.map +0 -1
- package/dist/index.cjs +0 -23722
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -7
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -16011
- package/dist/index.js.map +0 -1
- package/dist/public-types-DqCURAz8.d.cts +0 -1152
- package/dist/public-types-DqCURAz8.d.ts +0 -1152
- package/dist/tailwind.cjs +0 -8295
- package/dist/tailwind.cjs.map +0 -1
- package/dist/tailwind.d.cts +0 -323
- package/dist/tailwind.d.ts +0 -323
- package/dist/tailwind.js +0 -553
- package/dist/tailwind.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,121 +2,74 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/bwllaming/React-OOXML-Office/actions/workflows/ci.yml)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`docx-react-component` is now configured as an npm-ready package for the shipped product in this repository: `WordReviewEditor`, a fidelity-first React editor for legal-review-safe `docx` workflows.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The broader repository is still evolving toward a layered `react-ooxml-office` platform, but the source reality is unchanged:
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
9
|
+
- `docx` is the only implemented and shipped runtime contract
|
|
10
|
+
- `xlsx` is the next planned OOXML sibling
|
|
11
|
+
- `pdf` is future work and outside the first shared OOXML platform contract
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Install
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add docx-react-component react react-dom \
|
|
17
|
+
prosemirror-commands prosemirror-keymap prosemirror-model \
|
|
18
|
+
prosemirror-state prosemirror-tables prosemirror-transform prosemirror-view
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Current packaging truth:
|
|
22
|
+
|
|
23
|
+
- the package is ESM-only
|
|
24
|
+
- exports point at shipped TypeScript source entry points
|
|
25
|
+
- consumers need a bundler or runtime that can resolve `.ts` and `.tsx` ESM imports
|
|
26
|
+
- package and source identifiers remain docx-first until a deliberate rename lands
|
|
27
|
+
|
|
28
|
+
## Shipped Product
|
|
29
|
+
|
|
30
|
+
The primary shipped surface is:
|
|
16
31
|
|
|
17
32
|
```tsx
|
|
33
|
+
import { WordReviewEditor } from "docx-react-component";
|
|
34
|
+
|
|
18
35
|
<WordReviewEditor />
|
|
19
36
|
```
|
|
20
37
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- `docx` is the only implemented and shipped runtime contract in this repo today
|
|
24
|
-
- `xlsx` is now documented as the next planned OOXML sibling
|
|
25
|
-
- `pdf` is acknowledged as a future vertical, but it is not part of the first shared OOXML platform contract
|
|
38
|
+
`WordReviewEditor` remains uncontrolled by default:
|
|
26
39
|
|
|
27
|
-
|
|
40
|
+
- host passes `initialDocx` or `initialSnapshot`
|
|
41
|
+
- runtime owns the live working session
|
|
42
|
+
- host receives events, warnings, errors, snapshots, and exported artifacts
|
|
28
43
|
|
|
29
|
-
|
|
30
|
-
- what is the target shared architecture
|
|
31
|
-
- what is still research or future planning
|
|
44
|
+
The current public ESM exports are:
|
|
32
45
|
|
|
33
|
-
|
|
46
|
+
- `docx-react-component` -> `WordReviewEditor`
|
|
47
|
+
- `docx-react-component/public-types` -> public TypeScript contracts
|
|
48
|
+
- `docx-react-component/ui-tailwind` -> current Tailwind UI primitives
|
|
34
49
|
|
|
35
|
-
##
|
|
50
|
+
## Product Contract
|
|
36
51
|
|
|
37
52
|
For every format the repo eventually ships, the standard is:
|
|
38
53
|
|
|
39
54
|
> Open -> edit -> save -> reopen in the host application without damage.
|
|
40
55
|
|
|
41
|
-
For the current shipped `docx` implementation, that
|
|
56
|
+
For the current shipped `docx` implementation, that specifically means:
|
|
42
57
|
|
|
43
58
|
- open in recent Microsoft Word without repair prompts
|
|
44
59
|
- preserve supported content and review structures
|
|
45
60
|
- preserve unsupported but preservable OOXML
|
|
46
61
|
- remain editable in Word after export
|
|
47
62
|
|
|
48
|
-
##
|
|
49
|
-
|
|
50
|
-
- Compatibility first: host-format fidelity outranks convenience.
|
|
51
|
-
- Structured editing over DOM editing: runtime-owned canonical state is the source of truth.
|
|
52
|
-
- Preserve, do not destroy: unsupported but preservable OOXML must survive round trips.
|
|
53
|
-
- Explicit capability classes: features are `supported-roundtrip`, `preserve-only`, or `unsupported-fatal`.
|
|
54
|
-
- Clean UX over suite chrome: contextual, low-noise UI beats ribbon-style sprawl.
|
|
55
|
-
- Separate platform, runtime, validation, preservation, and UI concerns.
|
|
56
|
-
- Main-thread only for shipped runtimes unless the architecture explicitly changes.
|
|
57
|
-
|
|
58
|
-
## Architecture Layers
|
|
59
|
-
|
|
60
|
-
All landed and planned editor work follows the same high-level mutation path:
|
|
61
|
-
|
|
62
|
-
```text
|
|
63
|
-
UI -> Command -> Transaction -> State Update -> Render
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
The broader architecture is layered like this:
|
|
63
|
+
## Repository Direction
|
|
67
64
|
|
|
68
|
-
|
|
69
|
-
shared platform
|
|
70
|
-
package io, preservation, diagnostics, validation, host doctrine
|
|
65
|
+
This repo is broadening from the original docx-first editor into a layered shared-OOXML story:
|
|
71
66
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
pdf future, outside the first OOXML platform contract
|
|
76
|
-
|
|
77
|
-
host surfaces
|
|
78
|
-
embeddable components, internal harnesses, certification views
|
|
79
|
-
```
|
|
67
|
+
- shared platform concerns for package IO, preservation, diagnostics, and validation
|
|
68
|
+
- format-specific runtimes with explicit capability boundaries
|
|
69
|
+
- host-facing review and editing surfaces for each supported format
|
|
80
70
|
|
|
81
71
|
The canonical shared-platform overview lives in `docs/architecture/platform/shared-openxml-editor-platform.md`.
|
|
82
72
|
|
|
83
|
-
## Current Landed Source Layout
|
|
84
|
-
|
|
85
|
-
The truthful current source layout remains docx-first:
|
|
86
|
-
|
|
87
|
-
```text
|
|
88
|
-
src/
|
|
89
|
-
api/
|
|
90
|
-
model/
|
|
91
|
-
core/
|
|
92
|
-
review/
|
|
93
|
-
io/
|
|
94
|
-
preservation/
|
|
95
|
-
validation/
|
|
96
|
-
runtime/
|
|
97
|
-
ui/
|
|
98
|
-
services/
|
|
99
|
-
react-word-editor/
|
|
100
|
-
openxml-validator/
|
|
101
|
-
test/
|
|
102
|
-
fixtures/
|
|
103
|
-
docs/
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
The target future source layout is broader, but it is still only a planning direction:
|
|
107
|
-
|
|
108
|
-
```text
|
|
109
|
-
src/
|
|
110
|
-
platform/
|
|
111
|
-
formats/
|
|
112
|
-
docx/
|
|
113
|
-
xlsx/
|
|
114
|
-
pdf/
|
|
115
|
-
services/
|
|
116
|
-
office-harness/
|
|
117
|
-
openxml-validator/
|
|
118
|
-
```
|
|
119
|
-
|
|
120
73
|
## Documentation Map
|
|
121
74
|
|
|
122
75
|
Start here:
|
|
@@ -144,25 +97,12 @@ Shared platform and planned xlsx docs:
|
|
|
144
97
|
- `docs/plans/xlsx/xlsx-fixture-corpus-and-certification-plan.md`
|
|
145
98
|
- `docs/xlsx-react/README.md`
|
|
146
99
|
|
|
147
|
-
##
|
|
148
|
-
|
|
149
|
-
`WordReviewEditor` remains uncontrolled by default:
|
|
150
|
-
|
|
151
|
-
- host passes `initialDocx` or `initialSnapshot`
|
|
152
|
-
- runtime owns the live working session
|
|
153
|
-
- host receives events, warnings, errors, snapshots, and exported artifacts
|
|
154
|
-
|
|
155
|
-
The current shipped scope is still the legal-review-safe docx slice documented in the docx reference set. Tables, shell structures, and later legal-fidelity work remain governed by the existing wave sequence.
|
|
156
|
-
|
|
157
|
-
## Validation Strategy
|
|
158
|
-
|
|
159
|
-
The runtime editor does not ship the Microsoft Open XML SDK.
|
|
160
|
-
|
|
161
|
-
Instead:
|
|
100
|
+
## Packaging And Release
|
|
162
101
|
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
102
|
+
- `.github/workflows/publish.yml` publishes on `v*` tags
|
|
103
|
+
- `pnpm pack --dry-run` is the baseline package proof for this wave
|
|
104
|
+
- npm provenance is enabled in `publishConfig`
|
|
105
|
+
- the Microsoft Open XML SDK remains CI/internal-service only, never part of the shipped browser runtime
|
|
166
106
|
|
|
167
107
|
## Contribution Rules
|
|
168
108
|
|
package/package.json
CHANGED
|
@@ -1,27 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beyondwork/docx-react-component",
|
|
3
|
-
"
|
|
3
|
+
"publisher": "beyondwork",
|
|
4
|
+
"version": "1.0.3",
|
|
4
5
|
"description": "Embeddable React Word (docx) editor with review, comments, tracked changes, and round-trip OOXML fidelity.",
|
|
5
6
|
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"README.md",
|
|
9
|
+
"LICENSE.md",
|
|
10
|
+
"src"
|
|
11
|
+
],
|
|
6
12
|
"exports": {
|
|
7
13
|
".": {
|
|
8
|
-
"types": "./
|
|
9
|
-
"import": "./
|
|
10
|
-
|
|
14
|
+
"types": "./src/index.ts",
|
|
15
|
+
"import": "./src/index.ts"
|
|
16
|
+
},
|
|
17
|
+
"./public-types": {
|
|
18
|
+
"types": "./src/api/public-types.ts",
|
|
19
|
+
"import": "./src/api/public-types.ts"
|
|
20
|
+
},
|
|
21
|
+
"./ui-tailwind": {
|
|
22
|
+
"types": "./src/ui-tailwind/index.ts",
|
|
23
|
+
"import": "./src/ui-tailwind/index.ts"
|
|
11
24
|
},
|
|
12
25
|
"./tailwind": {
|
|
13
|
-
"types": "./
|
|
14
|
-
"import": "./
|
|
15
|
-
|
|
16
|
-
|
|
26
|
+
"types": "./src/ui-tailwind/index.ts",
|
|
27
|
+
"import": "./src/ui-tailwind/index.ts"
|
|
28
|
+
},
|
|
29
|
+
"./io/docx-session": "./src/io/docx-session.ts",
|
|
30
|
+
"./runtime/document-runtime": "./src/runtime/document-runtime.ts",
|
|
31
|
+
"./api/public-types": "./src/api/public-types.ts",
|
|
32
|
+
"./package.json": "./package.json"
|
|
17
33
|
},
|
|
18
|
-
"
|
|
19
|
-
"module": "./dist/index.js",
|
|
20
|
-
"types": "./dist/index.d.ts",
|
|
21
|
-
"files": [
|
|
22
|
-
"dist",
|
|
23
|
-
"LICENSE.md"
|
|
24
|
-
],
|
|
34
|
+
"types": "./src/index.ts",
|
|
25
35
|
"keywords": [
|
|
26
36
|
"docx",
|
|
27
37
|
"word",
|
|
@@ -29,16 +39,13 @@
|
|
|
29
39
|
"editor",
|
|
30
40
|
"react",
|
|
31
41
|
"comments",
|
|
32
|
-
"tracked-changes"
|
|
42
|
+
"tracked-changes",
|
|
43
|
+
"word-review",
|
|
44
|
+
"prosemirror"
|
|
33
45
|
],
|
|
34
46
|
"author": "",
|
|
35
47
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
36
|
-
"
|
|
37
|
-
"react": ">=18",
|
|
38
|
-
"react-dom": ">=18"
|
|
39
|
-
},
|
|
40
|
-
"devDependencies": {
|
|
41
|
-
"@chllming/wave-orchestration": "^0.9.8",
|
|
48
|
+
"dependencies": {
|
|
42
49
|
"@radix-ui/react-popover": "^1.1.15",
|
|
43
50
|
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
44
51
|
"@radix-ui/react-select": "^2.2.6",
|
|
@@ -46,23 +53,36 @@
|
|
|
46
53
|
"@radix-ui/react-toggle": "^1.1.10",
|
|
47
54
|
"@radix-ui/react-toggle-group": "^1.1.11",
|
|
48
55
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
56
|
+
"fflate": "^0.8.2",
|
|
57
|
+
"lucide-react": "^1.7.0"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"prosemirror-commands": "^1.7.1",
|
|
61
|
+
"prosemirror-keymap": "^1.2.3",
|
|
62
|
+
"prosemirror-model": "^1.25.4",
|
|
63
|
+
"prosemirror-state": "^1.4.4",
|
|
64
|
+
"prosemirror-tables": "^1.8.5",
|
|
65
|
+
"prosemirror-transform": "^1.11.0",
|
|
66
|
+
"prosemirror-view": "^1.41.7",
|
|
67
|
+
"react": "^19.2.0",
|
|
68
|
+
"react-dom": "^19.2.0"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"@chllming/wave-orchestration": "^0.9.8",
|
|
49
72
|
"@types/react": "19.2.14",
|
|
50
73
|
"@types/react-dom": "19.2.3",
|
|
51
74
|
"jsdom": "^29.0.1",
|
|
52
|
-
"lucide-react": "^1.7.0",
|
|
53
|
-
"react": "19.2.4",
|
|
54
|
-
"react-dom": "19.2.4",
|
|
55
|
-
"tsup": "^8.3.0",
|
|
56
|
-
"tsx": "^4.21.0"
|
|
57
|
-
},
|
|
58
|
-
"dependencies": {
|
|
59
75
|
"prosemirror-commands": "^1.7.1",
|
|
60
76
|
"prosemirror-keymap": "^1.2.3",
|
|
61
77
|
"prosemirror-model": "^1.25.4",
|
|
62
78
|
"prosemirror-state": "^1.4.4",
|
|
63
79
|
"prosemirror-tables": "^1.8.5",
|
|
64
80
|
"prosemirror-transform": "^1.11.0",
|
|
65
|
-
"prosemirror-view": "^1.41.7"
|
|
81
|
+
"prosemirror-view": "^1.41.7",
|
|
82
|
+
"react": "19.2.4",
|
|
83
|
+
"react-dom": "19.2.4",
|
|
84
|
+
"tsup": "^8.3.0",
|
|
85
|
+
"tsx": "^4.21.0"
|
|
66
86
|
},
|
|
67
87
|
"scripts": {
|
|
68
88
|
"build": "tsup",
|
package/src/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Source Layout
|
|
2
|
+
|
|
3
|
+
The landed source tree is still organized around the active docx implementation, not around the future target office-wide layout.
|
|
4
|
+
|
|
5
|
+
## Current Landed Layout
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
src/
|
|
9
|
+
api/
|
|
10
|
+
model/
|
|
11
|
+
core/
|
|
12
|
+
schema/
|
|
13
|
+
state/
|
|
14
|
+
commands/
|
|
15
|
+
selection/
|
|
16
|
+
review/
|
|
17
|
+
store/
|
|
18
|
+
io/
|
|
19
|
+
opc/
|
|
20
|
+
ooxml/
|
|
21
|
+
normalize/
|
|
22
|
+
export/
|
|
23
|
+
preservation/
|
|
24
|
+
validation/
|
|
25
|
+
runtime/
|
|
26
|
+
ui/
|
|
27
|
+
headless/ # Shared pure logic (framework-free)
|
|
28
|
+
shared/ # Shared utilities (revision-filters)
|
|
29
|
+
WordReviewEditor.tsx # Entry point
|
|
30
|
+
ui-tailwind/ # Default rendering (Tailwind + Radix + Lucide)
|
|
31
|
+
editor-surface/
|
|
32
|
+
toolbar/
|
|
33
|
+
review/
|
|
34
|
+
status/
|
|
35
|
+
chrome/
|
|
36
|
+
theme/
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
This is the truthful current layout for implementation work today.
|
|
40
|
+
|
|
41
|
+
## Target Broader Layout
|
|
42
|
+
|
|
43
|
+
The broader repo story now targets a future layout like this:
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
src/
|
|
47
|
+
platform/
|
|
48
|
+
formats/
|
|
49
|
+
docx/
|
|
50
|
+
xlsx/
|
|
51
|
+
pdf/
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
That layout is not landed yet. Use it as a planning direction, not as evidence that the current code has already been reorganized.
|
|
55
|
+
|
|
56
|
+
## UI Layer Strategy
|
|
57
|
+
|
|
58
|
+
- `ui/headless/` — Pure logic: keyboard handling, decoration models, selection utilities. No React dependencies.
|
|
59
|
+
- `ui-tailwind/` — Default rendering: Tailwind CSS, Radix UI primitives, Lucide icons. All styling via CSS custom properties.
|
|
60
|
+
- `ui/WordReviewEditor.tsx` — Public entry point that bridges the runtime to the Tailwind layer.
|
|
61
|
+
|
|
62
|
+
Legacy inline-CSSProperties components have been removed. See `docs/reference/word-review-editor-frontend-architecture.md` for the canonical frontend architecture.
|
|
63
|
+
|
|
64
|
+
Keep business rules close to the subsystem that owns them. Do not centralize unrelated logic into generic utility layers.
|
|
65
|
+
|
|
66
|
+
Ownership rules:
|
|
67
|
+
|
|
68
|
+
- `api` exposes public contracts only.
|
|
69
|
+
- `model`, `core`, `review`, `io`, `preservation`, and `validation` should remain React-free when possible.
|
|
70
|
+
- `runtime` is the only mutation boundary the UI calls into.
|
|
71
|
+
- `ui` consumes runtime contracts and design tokens; it does not own canonical document truth.
|
|
72
|
+
|
|
73
|
+
## Broader Repo Direction
|
|
74
|
+
|
|
75
|
+
As the repo broadens:
|
|
76
|
+
|
|
77
|
+
- shared package and preservation concerns should move toward `src/platform/`
|
|
78
|
+
- current docx runtime code remains the active implementation track until a deliberate source move lands
|
|
79
|
+
- future xlsx work should gain its own source area rather than widening docx-specific modules by implication
|
|
80
|
+
- future pdf work should remain separate from the first OOXML platform layer unless architecture decisions intentionally broaden it
|
|
81
|
+
|
|
82
|
+
Wave 0 inventory references:
|
|
83
|
+
|
|
84
|
+
- `component-inventory.md`
|
|
85
|
+
Wave-owned inventory for the major editor subsystems, their boundaries, and the promotion target for this scaffold phase.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# API
|
|
2
|
+
|
|
3
|
+
Public TypeScript contracts for `WordReviewEditor` belong here.
|
|
4
|
+
|
|
5
|
+
This layer should expose:
|
|
6
|
+
|
|
7
|
+
- component props and ref types
|
|
8
|
+
- datastore adapter interfaces
|
|
9
|
+
- runtime-derived position and selection projection types used by the public API
|
|
10
|
+
- discriminated event unions
|
|
11
|
+
- warning and error payloads
|
|
12
|
+
- persisted snapshot contracts
|
|
13
|
+
- export and compatibility report types
|
|
14
|
+
|
|
15
|
+
Do not place runtime logic here.
|
|
16
|
+
|
|
17
|
+
Frozen naming and boundary rules:
|
|
18
|
+
|
|
19
|
+
- the shipped component name is `WordReviewEditor`
|
|
20
|
+
- `DocumentRuntime` is an internal runtime contract, not a public React component name
|
|
21
|
+
- public range references are canonical-position projections, not DOM-path handles
|
|
22
|
+
- render snapshots stay in `src/runtime`; `src/api` only exposes persisted host-facing snapshot types
|