@beyondwork/docx-react-component 1.0.36 → 1.0.37

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 (64) hide show
  1. package/README.md +103 -13
  2. package/package.json +1 -1
  3. package/src/api/package-version.ts +13 -0
  4. package/src/api/public-types.ts +83 -0
  5. package/src/core/commands/index.ts +18 -1
  6. package/src/core/selection/mapping.ts +6 -0
  7. package/src/io/docx-session.ts +24 -9
  8. package/src/io/export/build-app-properties-xml.ts +88 -0
  9. package/src/io/export/serialize-comments.ts +6 -1
  10. package/src/io/export/serialize-footnotes.ts +10 -9
  11. package/src/io/export/serialize-headers-footers.ts +11 -10
  12. package/src/io/export/serialize-main-document.ts +337 -50
  13. package/src/io/export/serialize-numbering.ts +115 -24
  14. package/src/io/export/serialize-tables.ts +13 -11
  15. package/src/io/export/table-properties-xml.ts +35 -16
  16. package/src/io/export/twip.ts +66 -0
  17. package/src/io/normalize/normalize-text.ts +5 -0
  18. package/src/io/ooxml/parse-footnotes.ts +2 -1
  19. package/src/io/ooxml/parse-headers-footers.ts +2 -1
  20. package/src/io/ooxml/parse-main-document.ts +21 -1
  21. package/src/legal/bookmarks.ts +78 -0
  22. package/src/model/canonical-document.ts +11 -0
  23. package/src/review/store/scope-tag-diff.ts +130 -0
  24. package/src/runtime/document-navigation.ts +1 -305
  25. package/src/runtime/document-runtime.ts +173 -11
  26. package/src/runtime/layout/docx-font-loader.ts +143 -0
  27. package/src/runtime/layout/index.ts +188 -0
  28. package/src/runtime/layout/inert-layout-facet.ts +45 -0
  29. package/src/runtime/layout/layout-engine-instance.ts +618 -0
  30. package/src/runtime/layout/layout-invalidation.ts +257 -0
  31. package/src/runtime/layout/layout-measurement-provider.ts +175 -0
  32. package/src/runtime/layout/measurement-backend-canvas.ts +307 -0
  33. package/src/runtime/layout/measurement-backend-empirical.ts +208 -0
  34. package/src/runtime/layout/page-fragment-mapper.ts +179 -0
  35. package/src/runtime/layout/page-graph.ts +433 -0
  36. package/src/runtime/layout/page-layout-snapshot-adapter.ts +70 -0
  37. package/src/runtime/layout/page-story-resolver.ts +195 -0
  38. package/src/runtime/layout/paginated-layout-engine.ts +788 -0
  39. package/src/runtime/layout/public-facet.ts +705 -0
  40. package/src/runtime/layout/resolved-formatting-document.ts +317 -0
  41. package/src/runtime/layout/resolved-formatting-state.ts +430 -0
  42. package/src/runtime/scope-tag-registry.ts +95 -0
  43. package/src/runtime/surface-projection.ts +1 -0
  44. package/src/runtime/text-ack-range.ts +49 -0
  45. package/src/ui/WordReviewEditor.tsx +15 -0
  46. package/src/ui/editor-runtime-boundary.ts +10 -1
  47. package/src/ui/editor-surface-controller.tsx +3 -0
  48. package/src/ui/headless/chrome-registry.ts +235 -0
  49. package/src/ui/headless/scoped-chrome-policy.ts +164 -0
  50. package/src/ui/headless/selection-tool-context.ts +2 -0
  51. package/src/ui/headless/selection-tool-resolver.ts +36 -17
  52. package/src/ui-tailwind/editor-surface/fast-text-edit-lane.ts +333 -0
  53. package/src/ui-tailwind/editor-surface/local-edit-session-state.ts +89 -0
  54. package/src/ui-tailwind/editor-surface/perf-probe.ts +21 -1
  55. package/src/ui-tailwind/editor-surface/pm-command-bridge.ts +8 -1
  56. package/src/ui-tailwind/editor-surface/pm-decorations.ts +73 -13
  57. package/src/ui-tailwind/editor-surface/predicted-position-map.ts +78 -0
  58. package/src/ui-tailwind/editor-surface/predicted-tag-preflight.ts +63 -0
  59. package/src/ui-tailwind/editor-surface/predicted-tx-gate.ts +39 -0
  60. package/src/ui-tailwind/editor-surface/tw-prosemirror-surface.tsx +173 -6
  61. package/src/ui-tailwind/theme/editor-theme.css +40 -14
  62. package/src/ui-tailwind/toolbar/tw-toolbar-icon-button.tsx +2 -2
  63. package/src/ui-tailwind/toolbar/tw-toolbar.tsx +235 -166
  64. package/src/ui-tailwind/tw-review-workspace.tsx +27 -1
@@ -57,6 +57,10 @@ import type {
57
57
  SelectionToolAnchor,
58
58
  } from "../ui/headless/selection-tool-types";
59
59
  import type { MarkupDisplay } from "../ui/headless/comment-decoration-model";
60
+ import {
61
+ resolveScopedChromePolicy,
62
+ shouldRenderSelectionToolKind,
63
+ } from "../ui/headless/scoped-chrome-policy";
60
64
  import type { EditorCommandBag } from "../ui/editor-command-bag.ts";
61
65
  import { preserveEditorSelectionMouseDown } from "../ui/headless/preserve-editor-selection";
62
66
  import { TwAlertBanner } from "./chrome/tw-alert-banner";
@@ -340,6 +344,25 @@ export function TwReviewWorkspace(inputProps: TwReviewWorkspaceProps) {
340
344
  }),
341
345
  [reviewRailAvailable, reviewRailOpen, viewportWidth],
342
346
  );
347
+ const scopedChromePolicy = useMemo(
348
+ () =>
349
+ resolveScopedChromePolicy({
350
+ preset: chromePreset,
351
+ compactMode: responsiveChrome.isNarrow,
352
+ capabilities: caps,
353
+ interactionGuardSnapshot: props.interactionGuardSnapshot,
354
+ workflowScopeSnapshot: props.workflowScopeSnapshot,
355
+ activeListContext: props.activeListContext,
356
+ }),
357
+ [
358
+ caps,
359
+ chromePreset,
360
+ props.activeListContext,
361
+ props.interactionGuardSnapshot,
362
+ props.workflowScopeSnapshot,
363
+ responsiveChrome.isNarrow,
364
+ ],
365
+ );
343
366
  const toolbarInteractionPolicy: ToolbarInteractionPolicy | undefined = caps
344
367
  ? {
345
368
  mode: effectiveSelectionMode,
@@ -438,6 +461,7 @@ export function TwReviewWorkspace(inputProps: TwReviewWorkspaceProps) {
438
461
  blockedReasons={blockedReasons}
439
462
  showDiagnosticsChrome={chromeVisibility.alerts}
440
463
  interactionPolicy={toolbarInteractionPolicy}
464
+ scopedChromePolicy={scopedChromePolicy}
441
465
  compactMode={responsiveChrome.isNarrow}
442
466
  workspaceMode={props.workspaceMode}
443
467
  zoomLevel={props.zoomLevel}
@@ -817,7 +841,9 @@ export function TwReviewWorkspace(inputProps: TwReviewWorkspaceProps) {
817
841
  />
818
842
  </div>
819
843
  ) : null}
820
- {chromeVisibility.selectionOverlay && gatedSelectionTool ? (
844
+ {chromeVisibility.selectionOverlay &&
845
+ gatedSelectionTool &&
846
+ shouldRenderSelectionToolKind(scopedChromePolicy, gatedSelectionTool.kind) ? (
821
847
  <TwSelectionToolHost
822
848
  tool={gatedSelectionTool}
823
849
  contextAnalytics={