@beyondwork/docx-react-component 1.0.83 → 1.0.85

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.
Files changed (55) hide show
  1. package/package.json +1 -1
  2. package/src/api/internal/build-ref-projections.ts +3 -0
  3. package/src/api/public-types.ts +86 -4
  4. package/src/api/v3/_runtime-handle.ts +15 -0
  5. package/src/api/v3/runtime/content.ts +148 -1
  6. package/src/api/v3/runtime/formatting.ts +41 -0
  7. package/src/api/v3/runtime/review.ts +98 -0
  8. package/src/api/v3/runtime/workflow.ts +154 -6
  9. package/src/core/commands/index.ts +81 -25
  10. package/src/core/state/editor-state.ts +15 -0
  11. package/src/io/export/serialize-main-document.ts +72 -6
  12. package/src/io/ooxml/header-footer-reference.ts +38 -0
  13. package/src/io/ooxml/parse-headers-footers.ts +11 -23
  14. package/src/io/ooxml/parse-main-document.ts +7 -10
  15. package/src/io/ooxml/workflow-payload-validator.ts +24 -0
  16. package/src/io/ooxml/workflow-payload.ts +12 -0
  17. package/src/model/canonical-document.ts +9 -0
  18. package/src/model/review/comment-types.ts +2 -0
  19. package/src/runtime/document-runtime.ts +718 -68
  20. package/src/runtime/formatting/field/resolver.ts +73 -8
  21. package/src/runtime/layout/layout-engine-version.ts +31 -12
  22. package/src/runtime/layout/paginated-layout-engine.ts +18 -11
  23. package/src/runtime/layout/public-facet.ts +119 -16
  24. package/src/runtime/layout/resolve-page-fields.ts +68 -6
  25. package/src/runtime/layout/resolve-page-previews.ts +1 -1
  26. package/src/runtime/scopes/_scope-dependencies.ts +1 -0
  27. package/src/runtime/scopes/action-validation.ts +54 -45
  28. package/src/runtime/scopes/workflow-overlap.ts +41 -9
  29. package/src/runtime/suggestions-snapshot.ts +24 -0
  30. package/src/runtime/surface-projection.ts +59 -2
  31. package/src/runtime/workflow/coordinator.ts +66 -14
  32. package/src/runtime/workflow/scope-writer.ts +83 -5
  33. package/src/shell/ref-commands.ts +3 -354
  34. package/src/shell/session-bootstrap.ts +10 -0
  35. package/src/ui/WordReviewEditor.tsx +99 -9
  36. package/src/ui/editor-command-bag.ts +3 -1
  37. package/src/ui/headless/revision-decoration-model.ts +13 -0
  38. package/src/ui/headless/selection-tool-types.ts +2 -0
  39. package/src/ui-tailwind/chrome/tw-suggestion-card.tsx +7 -3
  40. package/src/ui-tailwind/chrome/tw-table-context-toolbar.tsx +175 -25
  41. package/src/ui-tailwind/chrome-overlay/tw-chrome-overlay.tsx +1 -1
  42. package/src/ui-tailwind/editor-surface/pm-decorations.ts +12 -0
  43. package/src/ui-tailwind/editor-surface/pm-page-break-decorations.ts +18 -30
  44. package/src/ui-tailwind/editor-surface/pm-state-from-snapshot.ts +1 -1
  45. package/src/ui-tailwind/editor-surface/tw-page-block-view.tsx +1 -1
  46. package/src/ui-tailwind/page-stack/tw-page-chrome-entry.tsx +20 -11
  47. package/src/ui-tailwind/page-stack/tw-page-footer-band.tsx +9 -4
  48. package/src/ui-tailwind/page-stack/tw-page-header-band.tsx +12 -7
  49. package/src/ui-tailwind/page-stack/tw-page-stack-chrome-layer.tsx +29 -10
  50. package/src/ui-tailwind/page-stack/tw-region-block-renderer.tsx +1 -1
  51. package/src/ui-tailwind/review-workspace/types.ts +3 -2
  52. package/src/ui-tailwind/review-workspace/use-page-markers.ts +11 -1
  53. package/src/ui-tailwind/toolbar/tw-role-action-region.tsx +2 -1
  54. package/src/ui-tailwind/toolbar/tw-toolbar.tsx +2 -1
  55. package/src/ui-tailwind/tw-review-workspace.tsx +18 -2
@@ -927,6 +927,8 @@ function buildWorkflowScopeXml(scope: WorkflowScope): string {
927
927
  scope.workItemId ? ` workItemRef="${escapeXml(scope.workItemId)}"` : "",
928
928
  scope.label ? ` label="${escapeXml(scope.label)}"` : "",
929
929
  scope.domain ? ` domain="${escapeXml(scope.domain)}"` : "",
930
+ scope.visibility ? ` visibility="${escapeXml(scope.visibility)}"` : "",
931
+ scope.guardPolicy ? ` guardPolicy="${escapeXml(scope.guardPolicy)}"` : "",
930
932
  scope.metadataPersistence && scope.metadataPersistence !== "inherit"
931
933
  ? ` metadataPersistence="${escapeXml(scope.metadataPersistence)}"`
932
934
  : "",
@@ -1166,6 +1168,14 @@ function parseWorkflowScope(attributesSource: string, body: string): WorkflowSco
1166
1168
  attributes.metadataPersistence,
1167
1169
  ["internal", "external", "inherit"] as const,
1168
1170
  );
1171
+ const visibility = parseClosedEnum(
1172
+ attributes.visibility,
1173
+ ["visible", "hidden", "invisible"] as const,
1174
+ );
1175
+ const guardPolicy = parseClosedEnum(
1176
+ attributes.guardPolicy,
1177
+ ["none", "insert-only", "read-only"] as const,
1178
+ );
1169
1179
 
1170
1180
  return {
1171
1181
  scopeId: attributes.id,
@@ -1177,6 +1187,8 @@ function parseWorkflowScope(attributesSource: string, body: string): WorkflowSco
1177
1187
  label: attributes.label,
1178
1188
  domain: attributes.domain as WorkflowScope["domain"],
1179
1189
  metadata: parseWorkflowScopeMetadata(body),
1190
+ ...(visibility !== undefined ? { visibility } : {}),
1191
+ ...(guardPolicy !== undefined ? { guardPolicy } : {}),
1180
1192
  ...(scopeMetadataPersistence !== undefined ? { metadataPersistence: scopeMetadataPersistence } : {}),
1181
1193
  };
1182
1194
  }
@@ -2095,6 +2095,12 @@ export interface CommentThreadMetadata {
2095
2095
  source?: "runtime" | "import";
2096
2096
  rootOoxmlCommentId?: string;
2097
2097
  rootParaId?: string;
2098
+ /**
2099
+ * Runtime-authored discussion thread for a tracked change. The comment
2100
+ * anchor points at the revision range; this metadata keeps the review
2101
+ * relation stable after remaps and lets suggestion cards surface replies.
2102
+ */
2103
+ linkedRevisionId?: string;
2098
2104
  detachedReason?: "incomplete-markers" | "multi-paragraph" | "opaque-region" | "revision-overlap";
2099
2105
  actionabilityNote?: string;
2100
2106
  }
@@ -3323,6 +3329,9 @@ function validateCommentThreadMetadata(
3323
3329
  if (record.rootParaId !== undefined) {
3324
3330
  expectString(record.rootParaId, `${path}.rootParaId`, issues);
3325
3331
  }
3332
+ if (record.linkedRevisionId !== undefined) {
3333
+ expectString(record.linkedRevisionId, `${path}.linkedRevisionId`, issues);
3334
+ }
3326
3335
  }
3327
3336
 
3328
3337
  function validateRevisionKind(
@@ -62,6 +62,8 @@ export interface CommentThreadMetadata {
62
62
  source?: "runtime" | "import";
63
63
  rootOoxmlCommentId?: string;
64
64
  rootParaId?: string;
65
+ /** Stable link from a comment thread to the tracked change it discusses. */
66
+ linkedRevisionId?: string;
65
67
  detachedReason?: "incomplete-markers" | "multi-paragraph" | "opaque-region" | "revision-overlap";
66
68
  actionabilityNote?: string;
67
69
  }