@beyondwork/docx-react-component 1.0.41 → 1.0.43
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/package.json +38 -37
- package/src/api/awareness-identity-types.ts +35 -0
- package/src/api/comment-negotiation-types.ts +130 -0
- package/src/api/comment-presentation-types.ts +106 -0
- package/src/api/editor-state-types.ts +110 -0
- package/src/api/external-custody-types.ts +74 -0
- package/src/api/participants-types.ts +18 -0
- package/src/api/public-types.ts +541 -5
- package/src/api/scope-metadata-resolver-types.ts +88 -0
- package/src/core/commands/formatting-commands.ts +1 -1
- package/src/core/commands/index.ts +601 -9
- package/src/core/search/search-text.ts +15 -2
- package/src/index.ts +131 -1
- package/src/io/docx-session.ts +672 -2
- package/src/io/export/escape-xml-attribute.ts +26 -0
- package/src/io/export/external-send.ts +188 -0
- package/src/io/export/serialize-comments.ts +13 -16
- package/src/io/export/serialize-footnotes.ts +17 -24
- package/src/io/export/serialize-headers-footers.ts +17 -24
- package/src/io/export/serialize-main-document.ts +59 -62
- package/src/io/export/serialize-numbering.ts +20 -27
- package/src/io/export/serialize-runtime-revisions.ts +2 -9
- package/src/io/export/serialize-tables.ts +8 -15
- package/src/io/export/table-properties-xml.ts +25 -32
- package/src/io/import/external-reimport.ts +40 -0
- package/src/io/load-scheduler.ts +230 -0
- package/src/io/normalize/normalize-text.ts +83 -0
- package/src/io/ooxml/bw-xml.ts +244 -0
- package/src/io/ooxml/canonicalize-payload.ts +301 -0
- package/src/io/ooxml/comment-negotiation-payload.ts +288 -0
- package/src/io/ooxml/comment-presentation-payload.ts +311 -0
- package/src/io/ooxml/external-custody-payload.ts +102 -0
- package/src/io/ooxml/participants-payload.ts +97 -0
- package/src/io/ooxml/payload-signature.ts +112 -0
- package/src/io/ooxml/workflow-payload-validator.ts +367 -0
- package/src/io/ooxml/workflow-payload.ts +317 -7
- package/src/runtime/awareness-identity.ts +173 -0
- package/src/runtime/collab/event-types.ts +27 -0
- package/src/runtime/collab-session-bridge.ts +157 -0
- package/src/runtime/collab-session-facet.ts +193 -0
- package/src/runtime/collab-session.ts +273 -0
- package/src/runtime/comment-negotiation-sync.ts +91 -0
- package/src/runtime/comment-negotiation.ts +158 -0
- package/src/runtime/comment-presentation.ts +223 -0
- package/src/runtime/document-runtime.ts +639 -124
- package/src/runtime/editor-state-channel.ts +544 -0
- package/src/runtime/editor-state-integration.ts +217 -0
- package/src/runtime/external-send-runtime.ts +117 -0
- package/src/runtime/layout/docx-font-loader.ts +11 -30
- package/src/runtime/layout/index.ts +2 -0
- package/src/runtime/layout/inert-layout-facet.ts +4 -0
- package/src/runtime/layout/layout-engine-instance.ts +139 -14
- package/src/runtime/layout/page-graph.ts +79 -7
- package/src/runtime/layout/paginated-layout-engine.ts +441 -48
- package/src/runtime/layout/public-facet.ts +585 -14
- package/src/runtime/layout/table-row-split.ts +316 -0
- package/src/runtime/markdown-sanitizer.ts +132 -0
- package/src/runtime/participants.ts +134 -0
- package/src/runtime/perf-counters.ts +28 -0
- package/src/runtime/render/render-frame-types.ts +17 -0
- package/src/runtime/render/render-kernel.ts +172 -29
- package/src/runtime/resign-payload.ts +120 -0
- package/src/runtime/surface-projection.ts +10 -5
- package/src/runtime/tamper-gate.ts +157 -0
- package/src/runtime/workflow-markup.ts +80 -16
- package/src/runtime/workflow-rail-segments.ts +244 -5
- package/src/ui/WordReviewEditor.tsx +654 -45
- package/src/ui/editor-command-bag.ts +14 -0
- package/src/ui/editor-runtime-boundary.ts +111 -11
- package/src/ui/editor-shell-view.tsx +21 -0
- package/src/ui/editor-surface-controller.tsx +5 -0
- package/src/ui/headless/selection-helpers.ts +10 -0
- package/src/ui-tailwind/chrome/chrome-preset-model.ts +28 -0
- package/src/ui-tailwind/chrome/chrome-preset-toolbar.tsx +62 -2
- package/src/ui-tailwind/chrome/collab-audience-chip.tsx +73 -0
- package/src/ui-tailwind/chrome/collab-negotiation-action-bar.tsx +244 -0
- package/src/ui-tailwind/chrome/collab-presence-strip.tsx +150 -0
- package/src/ui-tailwind/chrome/collab-role-chip.tsx +62 -0
- package/src/ui-tailwind/chrome/collab-send-to-supplier-button.tsx +68 -0
- package/src/ui-tailwind/chrome/collab-send-to-supplier-modal.tsx +149 -0
- package/src/ui-tailwind/chrome/collab-tamper-banner.tsx +68 -0
- package/src/ui-tailwind/chrome/collab-top-nav-container.tsx +281 -0
- package/src/ui-tailwind/chrome/forward-non-drag-click.ts +104 -0
- package/src/ui-tailwind/chrome/tw-mode-dock.tsx +1 -0
- package/src/ui-tailwind/chrome/tw-selection-tool-host.tsx +7 -1
- package/src/ui-tailwind/chrome/tw-table-grip-layer.tsx +1 -38
- package/src/ui-tailwind/chrome-overlay/index.ts +6 -0
- package/src/ui-tailwind/chrome-overlay/scope-card-role-model.ts +78 -0
- package/src/ui-tailwind/chrome-overlay/scope-keyboard-cycle.ts +49 -0
- package/src/ui-tailwind/chrome-overlay/tw-chrome-overlay.tsx +106 -0
- package/src/ui-tailwind/chrome-overlay/tw-page-stack-overlay-layer.tsx +527 -0
- package/src/ui-tailwind/chrome-overlay/tw-scope-card-layer.tsx +120 -22
- package/src/ui-tailwind/chrome-overlay/tw-scope-card.tsx +310 -32
- package/src/ui-tailwind/chrome-overlay/tw-scope-rail-layer.tsx +93 -14
- package/src/ui-tailwind/editor-surface/paste-plain-text.ts +72 -0
- package/src/ui-tailwind/editor-surface/pm-command-bridge.ts +118 -8
- package/src/ui-tailwind/editor-surface/pm-decorations.ts +35 -1
- package/src/ui-tailwind/editor-surface/pm-page-break-decorations.ts +86 -3
- package/src/ui-tailwind/editor-surface/pm-schema.ts +167 -17
- package/src/ui-tailwind/editor-surface/pm-state-from-snapshot.ts +35 -7
- package/src/ui-tailwind/editor-surface/remote-cursor-plugin.ts +20 -3
- package/src/ui-tailwind/editor-surface/tw-page-block-view.helpers.ts +265 -0
- package/src/ui-tailwind/editor-surface/tw-page-block-view.tsx +10 -256
- package/src/ui-tailwind/editor-surface/tw-prosemirror-surface.tsx +9 -0
- package/src/ui-tailwind/editor-surface/tw-table-node-view.tsx +66 -0
- package/src/ui-tailwind/index.ts +37 -1
- package/src/ui-tailwind/page-stack/tw-endnote-area.tsx +57 -0
- package/src/ui-tailwind/page-stack/tw-footnote-area.tsx +71 -0
- package/src/ui-tailwind/page-stack/tw-page-footer-band.tsx +73 -0
- package/src/ui-tailwind/page-stack/tw-page-header-band.tsx +74 -0
- package/src/ui-tailwind/page-stack/tw-page-stack-chrome-layer.tsx +477 -0
- package/src/ui-tailwind/page-stack/tw-region-block-renderer.tsx +374 -0
- package/src/ui-tailwind/review/comment-markdown-renderer.tsx +155 -0
- package/src/ui-tailwind/review/tw-comment-sidebar.tsx +77 -16
- package/src/ui-tailwind/review/tw-review-rail-footer.tsx +29 -3
- package/src/ui-tailwind/status/tw-status-bar.tsx +52 -1
- package/src/ui-tailwind/theme/editor-theme.css +25 -0
- package/src/ui-tailwind/tw-review-workspace.tsx +455 -118
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metadata persistence mode — overlay-level default.
|
|
3
|
+
*
|
|
4
|
+
* - `"internal"`: every entry / field is inlined in the bw:workflowPayload
|
|
5
|
+
* XML body. Self-contained docx; no host callback required.
|
|
6
|
+
* - `"external"`: entries / fields are stored by reference via a host-owned
|
|
7
|
+
* ScopeMetadataResolver; the docx carries only a `storageRef` string.
|
|
8
|
+
*
|
|
9
|
+
* Unknown values → preserve-only (spec §8.2). Readers must never silently
|
|
10
|
+
* coerce to a known value.
|
|
11
|
+
*/
|
|
12
|
+
export type MetadataPersistenceMode = "internal" | "external";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Per-scope / per-entry / per-field override. `"inherit"` defers to the
|
|
16
|
+
* parent (entry inherits scope; scope inherits overlay; overlay inherits
|
|
17
|
+
* the default `"internal"`).
|
|
18
|
+
*/
|
|
19
|
+
export type ScopeMetadataPersistence = "internal" | "external" | "inherit";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Opaque host-owned reference for externally-stored metadata values. The
|
|
23
|
+
* editor never parses this string — it is passed verbatim to the
|
|
24
|
+
* resolver. Host examples:
|
|
25
|
+
*
|
|
26
|
+
* "clm-workblock-row:wb-123:row-42:v-3"
|
|
27
|
+
* "https://rowstore.internal/metadata/abc"
|
|
28
|
+
* "s3://bucket/tenant-1/scope-metadata/e91a.json"
|
|
29
|
+
*/
|
|
30
|
+
export type ScopeMetadataStorageRef = string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Host-supplied resolver. The editor calls `resolve` whenever it needs
|
|
34
|
+
* the actual value of an external entry / field; it calls `publish` when
|
|
35
|
+
* toggling a scope / entry from `"internal"` to `"external"` and needs
|
|
36
|
+
* to hand the current inline value off to the host's store.
|
|
37
|
+
*
|
|
38
|
+
* All methods are async so the host can make network calls. An
|
|
39
|
+
* `undefined` return from `resolve` signals a missing or revoked ref;
|
|
40
|
+
* the editor surfaces this as a non-fatal warning and renders the entry
|
|
41
|
+
* as detached in the scope card. `undefined` (rather than `null`)
|
|
42
|
+
* matches the shipped `ExternalCustodyResolver.restore` convention (P7).
|
|
43
|
+
*
|
|
44
|
+
* `delete` is optional — hosts that don't need cleanup on toggle may
|
|
45
|
+
* omit it. The editor only calls it when transitioning a scope from
|
|
46
|
+
* `"external"` back to `"internal"` (hand the value back inline, then
|
|
47
|
+
* release the ref).
|
|
48
|
+
*/
|
|
49
|
+
export interface ScopeMetadataResolver {
|
|
50
|
+
/**
|
|
51
|
+
* Fetch the value for an opaque storageRef. Returns `undefined`
|
|
52
|
+
* when the ref is unknown or revoked — the editor surfaces this as
|
|
53
|
+
* a non-fatal warning and renders the entry as detached in the
|
|
54
|
+
* scope card. `version` (when present) is the rowstore's current
|
|
55
|
+
* version; the editor compares it against the docx's embedded
|
|
56
|
+
* `metadataVersion` hint and emits `metadata_conflict_detected` on
|
|
57
|
+
* mismatch. Matches the `ExternalCustodyResolver.restore`
|
|
58
|
+
* convention (P7) — prefer `undefined` over `null` for consistency.
|
|
59
|
+
*/
|
|
60
|
+
resolve(ref: ScopeMetadataStorageRef): Promise<
|
|
61
|
+
| { value: Record<string, unknown>; version?: number }
|
|
62
|
+
| undefined
|
|
63
|
+
>;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Publish an inline value to the host store. `expectedVersion`
|
|
67
|
+
* (when set) enables optimistic concurrency: the host rejects the
|
|
68
|
+
* write if the stored row has advanced past the expected version,
|
|
69
|
+
* throwing a host-defined error that the editor surfaces via
|
|
70
|
+
* `metadata_conflict_detected`.
|
|
71
|
+
*
|
|
72
|
+
* Returns the opaque ref plus the version the store recorded for
|
|
73
|
+
* this write. The editor embeds this version on the XML element.
|
|
74
|
+
*/
|
|
75
|
+
publish(input: {
|
|
76
|
+
scopeId: string;
|
|
77
|
+
metadataId: string;
|
|
78
|
+
entryId?: string;
|
|
79
|
+
fieldKey?: string;
|
|
80
|
+
value: Record<string, unknown>;
|
|
81
|
+
expectedVersion?: number;
|
|
82
|
+
}): Promise<{
|
|
83
|
+
ref: ScopeMetadataStorageRef;
|
|
84
|
+
version: number;
|
|
85
|
+
}>;
|
|
86
|
+
|
|
87
|
+
delete?(ref: ScopeMetadataStorageRef): Promise<void>;
|
|
88
|
+
}
|
|
@@ -188,7 +188,7 @@ type ToggleFormattingMark =
|
|
|
188
188
|
| "strikethrough"
|
|
189
189
|
| "superscript"
|
|
190
190
|
| "subscript";
|
|
191
|
-
type FormattingOperation =
|
|
191
|
+
export type FormattingOperation =
|
|
192
192
|
| { type: "toggle"; mark: ToggleFormattingMark }
|
|
193
193
|
| { type: "set-font-family"; fontFamily: string | null }
|
|
194
194
|
| { type: "set-font-size"; size: number | null }
|