@beyondwork/docx-react-component 1.0.56 → 1.0.57
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 +1 -1
- package/src/api/public-types.ts +157 -0
- package/src/compare/diff-engine.ts +3 -0
- package/src/core/commands/formatting-commands.ts +1 -0
- package/src/core/commands/index.ts +17 -11
- package/src/core/selection/mapping.ts +18 -1
- package/src/core/selection/review-anchors.ts +29 -18
- package/src/io/chart-preview-resolver.ts +175 -41
- package/src/io/docx-session.ts +57 -2
- package/src/io/export/serialize-main-document.ts +82 -0
- package/src/io/export/serialize-styles.ts +61 -3
- package/src/io/export/table-properties-xml.ts +19 -4
- package/src/io/normalize/normalize-text.ts +33 -0
- package/src/io/ooxml/parse-anchor.ts +182 -0
- package/src/io/ooxml/parse-drawing.ts +319 -0
- package/src/io/ooxml/parse-fields.ts +115 -2
- package/src/io/ooxml/parse-fill.ts +215 -0
- package/src/io/ooxml/parse-font-table.ts +190 -0
- package/src/io/ooxml/parse-footnotes.ts +52 -1
- package/src/io/ooxml/parse-main-document.ts +241 -1
- package/src/io/ooxml/parse-numbering.ts +96 -0
- package/src/io/ooxml/parse-picture.ts +107 -0
- package/src/io/ooxml/parse-settings.ts +34 -0
- package/src/io/ooxml/parse-shapes.ts +87 -0
- package/src/io/ooxml/parse-solid-fill.ts +11 -0
- package/src/io/ooxml/parse-styles.ts +74 -1
- package/src/io/ooxml/parse-theme.ts +60 -0
- package/src/io/paste/html-clipboard.ts +449 -0
- package/src/io/paste/word-clipboard.ts +5 -1
- package/src/legal/_document-root.ts +26 -0
- package/src/legal/bookmarks.ts +4 -3
- package/src/legal/cross-references.ts +3 -2
- package/src/legal/defined-terms.ts +2 -1
- package/src/legal/signature-blocks.ts +2 -1
- package/src/model/canonical-document.ts +415 -3
- package/src/runtime/chart/chart-model-store.ts +73 -10
- package/src/runtime/document-runtime.ts +693 -41
- package/src/runtime/edit-ops/index.ts +129 -0
- package/src/runtime/event-refresh-hints.ts +7 -0
- package/src/runtime/field-resolver.ts +341 -0
- package/src/runtime/footnote-resolver.ts +55 -0
- package/src/runtime/hyperlink-color-resolver.ts +13 -10
- package/src/runtime/object-grab/index.ts +51 -0
- package/src/runtime/paragraph-style-resolver.ts +105 -0
- package/src/runtime/resolved-numbering-geometry.ts +12 -0
- package/src/runtime/selection/cursor-ops.ts +186 -15
- package/src/runtime/selection/index.ts +17 -1
- package/src/runtime/structure-ops/index.ts +77 -0
- package/src/runtime/styles-cascade.ts +33 -0
- package/src/runtime/surface-projection.ts +186 -12
- package/src/runtime/theme-color-resolver.ts +189 -44
- package/src/runtime/units.ts +46 -0
- package/src/runtime/view-state.ts +13 -2
- package/src/ui/WordReviewEditor.tsx +168 -10
- package/src/ui/editor-runtime-boundary.ts +94 -1
- package/src/ui/editor-shell-view.tsx +1 -1
- package/src/ui/runtime-shortcut-dispatch.ts +17 -3
- package/src/ui-tailwind/chart/ChartSurface.tsx +36 -10
- package/src/ui-tailwind/chart/layout/plot-area.ts +120 -45
- package/src/ui-tailwind/chart/render/area.tsx +22 -4
- package/src/ui-tailwind/chart/render/bar-column.tsx +37 -11
- package/src/ui-tailwind/chart/render/bubble.tsx +6 -2
- package/src/ui-tailwind/chart/render/combo.tsx +37 -4
- package/src/ui-tailwind/chart/render/line.tsx +28 -5
- package/src/ui-tailwind/chart/render/pie.tsx +36 -16
- package/src/ui-tailwind/chart/render/progressive-render.ts +8 -1
- package/src/ui-tailwind/chart/render/scatter.tsx +9 -4
- package/src/ui-tailwind/chrome/avatar-initials.ts +15 -0
- package/src/ui-tailwind/chrome/tw-comment-preview.tsx +3 -1
- package/src/ui-tailwind/chrome/tw-context-menu.tsx +14 -0
- package/src/ui-tailwind/chrome/tw-selection-tool-host.tsx +3 -2
- package/src/ui-tailwind/chrome/tw-selection-toolbar.tsx +30 -11
- package/src/ui-tailwind/chrome/tw-shortcut-hint.tsx +15 -2
- package/src/ui-tailwind/chrome/tw-suggestion-card.tsx +1 -1
- package/src/ui-tailwind/chrome/tw-table-context-toolbar.tsx +24 -7
- package/src/ui-tailwind/chrome/tw-table-grip-layer.tsx +31 -12
- package/src/ui-tailwind/chrome-overlay/page-border-resolver.ts +211 -0
- package/src/ui-tailwind/chrome-overlay/tw-chrome-overlay.tsx +1 -0
- package/src/ui-tailwind/chrome-overlay/tw-comment-balloon-layer.tsx +74 -0
- package/src/ui-tailwind/chrome-overlay/tw-locked-block-layer.tsx +65 -0
- package/src/ui-tailwind/chrome-overlay/tw-page-border-overlay.tsx +233 -0
- package/src/ui-tailwind/chrome-overlay/tw-page-stack-overlay-layer.tsx +135 -13
- package/src/ui-tailwind/chrome-overlay/tw-revision-margin-bar-layer.tsx +51 -0
- package/src/ui-tailwind/chrome-overlay/tw-scope-card-layer.tsx +12 -4
- package/src/ui-tailwind/chrome-overlay/tw-scope-card.tsx +32 -12
- package/src/ui-tailwind/chrome-overlay/tw-toc-outline-sidebar.tsx +133 -0
- package/src/ui-tailwind/editor-surface/chart-node-view.tsx +49 -10
- package/src/ui-tailwind/editor-surface/float-wrap-resolver.ts +119 -0
- package/src/ui-tailwind/editor-surface/pm-command-bridge.ts +236 -9
- package/src/ui-tailwind/editor-surface/pm-schema.ts +188 -11
- package/src/ui-tailwind/editor-surface/pm-state-from-snapshot.ts +28 -2
- package/src/ui-tailwind/editor-surface/shape-renderer.ts +206 -0
- package/src/ui-tailwind/editor-surface/surface-layer.ts +66 -0
- package/src/ui-tailwind/editor-surface/tw-inline-token.tsx +29 -0
- package/src/ui-tailwind/editor-surface/tw-segment-view.tsx +7 -1
- package/src/ui-tailwind/page-stack/tw-page-stack-chrome-layer.tsx +22 -6
- package/src/ui-tailwind/review/tw-comment-sidebar.tsx +10 -16
- package/src/ui-tailwind/review/tw-health-panel.tsx +0 -25
- package/src/ui-tailwind/review/tw-rail-card.tsx +38 -17
- package/src/ui-tailwind/review/tw-review-rail.tsx +2 -2
- package/src/ui-tailwind/review/tw-revision-sidebar.tsx +5 -12
- package/src/ui-tailwind/review/tw-workflow-tab.tsx +2 -2
- package/src/ui-tailwind/theme/editor-theme.css +1 -0
- package/src/ui-tailwind/theme/tokens.css +6 -0
- package/src/ui-tailwind/theme/tokens.ts +10 -0
- package/src/validation/compatibility-engine.ts +2 -0
- package/src/validation/docx-comment-proof.ts +12 -3
|
@@ -87,6 +87,15 @@ export const BRAND_TOKENS = {
|
|
|
87
87
|
comment: "#E8F4EC",
|
|
88
88
|
selection: "#DDF1E4",
|
|
89
89
|
},
|
|
90
|
+
highlight: {
|
|
91
|
+
// Text-highlighter yellow. User-driven content color (like cell fills
|
|
92
|
+
// and author avatars) — intentionally stable across themes so highlights
|
|
93
|
+
// persist when the document is re-opened under a different theme.
|
|
94
|
+
// Light mode picks Material Amber-A100 for contrast on white canvas;
|
|
95
|
+
// dark mode dims the same chroma (~#B8A829) to avoid glare on dark
|
|
96
|
+
// canvas while keeping the mark recognizably "yellow".
|
|
97
|
+
default: "#FFF59D",
|
|
98
|
+
},
|
|
90
99
|
scopeTint: {
|
|
91
100
|
blocked: "#FBE3E6",
|
|
92
101
|
inScope: "#E2F2E8",
|
|
@@ -170,6 +179,7 @@ export type BrandTokenPath =
|
|
|
170
179
|
| `color.status.${keyof BrandTokens["color"]["status"]}`
|
|
171
180
|
| `color.comment.${keyof BrandTokens["color"]["comment"]}`
|
|
172
181
|
| `color.change.${keyof BrandTokens["color"]["change"]}`
|
|
182
|
+
| `color.highlight.${keyof BrandTokens["color"]["highlight"]}`
|
|
173
183
|
| `color.scopeTint.${keyof BrandTokens["color"]["scopeTint"]}`
|
|
174
184
|
| `color.chart.categorical.${keyof BrandTokens["color"]["chart"]["categorical"]}`
|
|
175
185
|
| `color.chart.sequential.${keyof BrandTokens["color"]["chart"]["sequential"]}`
|
|
@@ -444,6 +444,7 @@ function measureInlineNode(
|
|
|
444
444
|
flags.hyperlinks = true;
|
|
445
445
|
return node.children.reduce((size, child) => size + measureInlineNode(child, flags), 0);
|
|
446
446
|
case "image":
|
|
447
|
+
case "drawing_frame":
|
|
447
448
|
flags.images = true;
|
|
448
449
|
flags.runs = true;
|
|
449
450
|
return 1;
|
|
@@ -778,6 +779,7 @@ function collectLossyInlineContent(
|
|
|
778
779
|
case "field":
|
|
779
780
|
case "bookmark_start":
|
|
780
781
|
case "bookmark_end":
|
|
782
|
+
case "drawing_frame":
|
|
781
783
|
case "shape":
|
|
782
784
|
case "wordart":
|
|
783
785
|
case "vml_shape":
|
|
@@ -70,6 +70,7 @@ export type ClosureValidationCheck =
|
|
|
70
70
|
| { type: "minCommentThreads"; count: number }
|
|
71
71
|
| { type: "lockedFragmentCountAtLeast"; count: number }
|
|
72
72
|
| { type: "surfaceBlockKind"; kind: string; count?: number }
|
|
73
|
+
| { type: "segmentLabelPrefix"; value: string; kind?: string }
|
|
73
74
|
| { type: "opaqueBlockLabelPrefix"; value: string }
|
|
74
75
|
| { type: "opaqueInlineLabelPrefix"; value: string }
|
|
75
76
|
| {
|
|
@@ -238,6 +239,12 @@ export function evaluateClosureCheck(
|
|
|
238
239
|
(check.count ?? 1),
|
|
239
240
|
reason: `expected at least ${check.count ?? 1} surface blocks of kind ${check.kind}`,
|
|
240
241
|
};
|
|
242
|
+
case "segmentLabelPrefix":
|
|
243
|
+
return {
|
|
244
|
+
type: check.type,
|
|
245
|
+
passed: hasSegmentLabelPrefix(context.surface, check.value, check.kind),
|
|
246
|
+
reason: `expected a ${check.kind ?? "surface"} segment label starting with ${check.value}`,
|
|
247
|
+
};
|
|
241
248
|
case "opaqueBlockLabelPrefix":
|
|
242
249
|
return {
|
|
243
250
|
type: check.type,
|
|
@@ -253,7 +260,7 @@ export function evaluateClosureCheck(
|
|
|
253
260
|
case "opaqueInlineLabelPrefix":
|
|
254
261
|
return {
|
|
255
262
|
type: check.type,
|
|
256
|
-
passed:
|
|
263
|
+
passed: hasSegmentLabelPrefix(context.surface, check.value, "opaque_inline"),
|
|
257
264
|
reason: `expected an opaque inline label starting with ${check.value}`,
|
|
258
265
|
};
|
|
259
266
|
case "trackedChangeMatch": {
|
|
@@ -458,9 +465,10 @@ export function extractDocxCommentProof(bytes: Uint8Array): DocxCommentProof {
|
|
|
458
465
|
};
|
|
459
466
|
}
|
|
460
467
|
|
|
461
|
-
function
|
|
468
|
+
function hasSegmentLabelPrefix(
|
|
462
469
|
surface: RuntimeRenderSnapshot["surface"],
|
|
463
470
|
prefix: string,
|
|
471
|
+
segmentKind?: string,
|
|
464
472
|
): boolean {
|
|
465
473
|
if (!surface) {
|
|
466
474
|
return false;
|
|
@@ -474,7 +482,8 @@ function hasOpaqueInlineLabelPrefix(
|
|
|
474
482
|
if (
|
|
475
483
|
block.segments.some(
|
|
476
484
|
(segment) =>
|
|
477
|
-
segment.kind ===
|
|
485
|
+
(segmentKind === undefined || segment.kind === segmentKind) &&
|
|
486
|
+
"label" in segment &&
|
|
478
487
|
typeof segment.label === "string" &&
|
|
479
488
|
segment.label.startsWith(prefix),
|
|
480
489
|
)
|