@beyondwork/docx-react-component 1.0.126 → 1.0.128

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 (59) hide show
  1. package/dist/api/public-types.d.cts +1 -1
  2. package/dist/api/public-types.d.ts +1 -1
  3. package/dist/api/v3.cjs +507 -24
  4. package/dist/api/v3.d.cts +2 -2
  5. package/dist/api/v3.d.ts +2 -2
  6. package/dist/api/v3.js +2 -2
  7. package/dist/{chunk-GL7XRYBY.js → chunk-6EROGFUF.js} +29 -13
  8. package/dist/{chunk-6IGWPAR4.js → chunk-LCYYR57Q.js} +462 -24
  9. package/dist/{chunk-4G3OS2H6.js → chunk-LZVBNDGU.js} +3 -0
  10. package/dist/{chunk-FPRWV54X.js → chunk-XRACP43Q.js} +46 -1
  11. package/dist/core/commands/formatting-commands.d.cts +1 -1
  12. package/dist/core/commands/formatting-commands.d.ts +1 -1
  13. package/dist/core/commands/image-commands.d.cts +1 -1
  14. package/dist/core/commands/image-commands.d.ts +1 -1
  15. package/dist/core/commands/section-layout-commands.d.cts +1 -1
  16. package/dist/core/commands/section-layout-commands.d.ts +1 -1
  17. package/dist/core/commands/style-commands.d.cts +1 -1
  18. package/dist/core/commands/style-commands.d.ts +1 -1
  19. package/dist/core/commands/table-structure-commands.d.cts +1 -1
  20. package/dist/core/commands/table-structure-commands.d.ts +1 -1
  21. package/dist/core/commands/text-commands.cjs +3 -0
  22. package/dist/core/commands/text-commands.d.cts +2 -1
  23. package/dist/core/commands/text-commands.d.ts +2 -1
  24. package/dist/core/commands/text-commands.js +1 -1
  25. package/dist/core/selection/mapping.d.cts +1 -1
  26. package/dist/core/selection/mapping.d.ts +1 -1
  27. package/dist/core/state/editor-state.d.cts +1 -1
  28. package/dist/core/state/editor-state.d.ts +1 -1
  29. package/dist/index.cjs +549 -37
  30. package/dist/index.d.cts +4 -4
  31. package/dist/index.d.ts +4 -4
  32. package/dist/index.js +16 -6
  33. package/dist/io/docx-session.d.cts +3 -3
  34. package/dist/io/docx-session.d.ts +3 -3
  35. package/dist/{loader-CS9-9KFa.d.ts → loader-19ct2Be0.d.ts} +2 -2
  36. package/dist/{loader-OoWJ1_17.d.cts → loader-CoXQ2wGd.d.cts} +2 -2
  37. package/dist/{public-types-DdcHqcow.d.ts → public-types-7KZsNGE2.d.ts} +93 -0
  38. package/dist/{public-types-BP3vqJR5.d.cts → public-types-B-CskQen.d.cts} +93 -0
  39. package/dist/public-types.d.cts +1 -1
  40. package/dist/public-types.d.ts +1 -1
  41. package/dist/runtime/collab.d.cts +2 -2
  42. package/dist/runtime/collab.d.ts +2 -2
  43. package/dist/runtime/document-runtime.cjs +76 -12
  44. package/dist/runtime/document-runtime.d.cts +1 -1
  45. package/dist/runtime/document-runtime.d.ts +1 -1
  46. package/dist/runtime/document-runtime.js +3 -3
  47. package/dist/{session-Cq-fzx3B.d.cts → session-B5015J4v.d.cts} +2 -2
  48. package/dist/{session-DyFQt8Ph.d.ts → session-C2i8-d6v.d.ts} +2 -2
  49. package/dist/session.d.cts +4 -4
  50. package/dist/session.d.ts +4 -4
  51. package/dist/tailwind.d.cts +1 -1
  52. package/dist/tailwind.d.ts +1 -1
  53. package/dist/{types-Bg7D-GD3.d.cts → types-DNhN0WeN.d.cts} +1 -1
  54. package/dist/{types-bJAgMq1M.d.ts → types-yvrQuGX9.d.ts} +1 -1
  55. package/dist/ui-tailwind/editor-surface/search-plugin.d.cts +2 -2
  56. package/dist/ui-tailwind/editor-surface/search-plugin.d.ts +2 -2
  57. package/dist/ui-tailwind.d.cts +2 -2
  58. package/dist/ui-tailwind.d.ts +2 -2
  59. package/package.json +1 -1
package/dist/api/v3.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { u as MockPayload, A as ApiStatus, U as UxIntent, v as RuntimeApiHandle, w as UiControllerFactory, x as ApiV3Ui } from '../public-types-DdcHqcow.js';
2
- export { y as AgentMetadata, z as AiPe2EvidenceOptions, B as AiPe2GraphOracleReference, D as AiPe2OracleEvidence, F as AiPe2OracleEvidenceProvider, G as AiPe2OracleEvidenceProviderInput, H as AiPe2OracleVerdict, J as ApiV3, K as ApiV3FnMetadata, N as ApiV3UiChrome, O as ApiV3UiDebug, Q as ApiV3UiOverlays, V as ApiV3UiSession, W as ApiV3UiSurface, X as ApiV3UiViewport, Y as BroadcastsVia, Z as ChromeDebugMode, _ as ChromeDocumentMode, $ as ChromeHostPosture, a0 as ChromeMarkupDisplay, a1 as ChromePosture, a2 as ChromeReviewMode, a3 as ChromeSurface, a4 as ChromeSurfaceKind, a5 as CreateApiV3Opts, a6 as DebugAttachment, a7 as DebugSession, a8 as GeometryRect, a9 as LiveEvidence, aa as MockShape, ab as OverlayAnchorQuery, ac as PersistsTo, ad as ScrollTarget, ae as ScrollTargetBehavior, af as SelectionRangeInput, ag as SourceLayer, ah as StateClass, ai as SubscriptionShape, aj as UiBinding, ak as UiController, al as UiControllerKind, am as UiListener, an as UiUnsubscribe, ao as ViewportState, ap as createApiV3, aq as validateApiV3Metadata } from '../public-types-DdcHqcow.js';
1
+ import { u as MockPayload, A as ApiStatus, U as UxIntent, v as RuntimeApiHandle, w as UiControllerFactory, x as ApiV3Ui } from '../public-types-7KZsNGE2.js';
2
+ export { y as AgentMetadata, z as AiPe2EvidenceOptions, B as AiPe2GraphOracleReference, D as AiPe2OracleEvidence, F as AiPe2OracleEvidenceProvider, G as AiPe2OracleEvidenceProviderInput, H as AiPe2OracleVerdict, J as ApiV3, K as ApiV3FnMetadata, N as ApiV3UiChrome, O as ApiV3UiDebug, Q as ApiV3UiOverlays, V as ApiV3UiSession, W as ApiV3UiSurface, X as ApiV3UiViewport, Y as BroadcastsVia, Z as ChromeDebugMode, _ as ChromeDocumentMode, $ as ChromeHostPosture, a0 as ChromeMarkupDisplay, a1 as ChromePosture, a2 as ChromeReviewMode, a3 as ChromeSurface, a4 as ChromeSurfaceKind, a5 as CreateApiV3Opts, a6 as DebugAttachment, a7 as DebugSession, a8 as GeometryRect, a9 as LiveEvidence, aa as MockShape, ab as OverlayAnchorQuery, ac as PersistsTo, ad as ScrollTarget, ae as ScrollTargetBehavior, af as SelectionRangeInput, ag as SourceLayer, ah as StateClass, ai as SubscriptionShape, aj as UiBinding, ak as UiController, al as UiControllerKind, am as UiListener, an as UiUnsubscribe, ao as ViewportState, ap as createApiV3, aq as validateApiV3Metadata } from '../public-types-7KZsNGE2.js';
3
3
  import 'react';
4
4
  import 'yjs';
5
5
  import 'y-protocols/awareness';
package/dist/api/v3.js CHANGED
@@ -5,8 +5,8 @@ import {
5
5
  mockId,
6
6
  mockPayload,
7
7
  validateApiV3Metadata
8
- } from "../chunk-6IGWPAR4.js";
9
- import "../chunk-FPRWV54X.js";
8
+ } from "../chunk-LCYYR57Q.js";
9
+ import "../chunk-XRACP43Q.js";
10
10
  import "../chunk-C2LWJ4CZ.js";
11
11
  import {
12
12
  createUiApi,
@@ -22,7 +22,7 @@ import {
22
22
  insertText,
23
23
  outdentParagraphAtSelection,
24
24
  splitParagraph
25
- } from "./chunk-4G3OS2H6.js";
25
+ } from "./chunk-LZVBNDGU.js";
26
26
  import {
27
27
  applyFormattingOperationToDocument,
28
28
  applyTextMarkOperationToDocumentRange,
@@ -74,7 +74,7 @@ import {
74
74
  resolveHeadingPath,
75
75
  resolveScope,
76
76
  serializeFragmentToWordML
77
- } from "./chunk-FPRWV54X.js";
77
+ } from "./chunk-XRACP43Q.js";
78
78
  import {
79
79
  ISSUE_METADATA_ID,
80
80
  LAYOUT_ENGINE_VERSION,
@@ -14038,15 +14038,17 @@ function createDocumentRuntime(options) {
14038
14038
  ...resolution.textTarget ? { textTarget: resolution.textTarget } : {}
14039
14039
  };
14040
14040
  }
14041
- function prepareFragmentInsertCommandForExecution(command, document, surface, storyTarget) {
14041
+ function prepareFragmentInsertCommandForExecution(command, document, surface, storyTarget, selection) {
14042
14042
  if (!command.editableTarget) {
14043
- return { kind: "accepted", selection: state.selection };
14043
+ return { kind: "accepted", selection };
14044
14044
  }
14045
+ const preserveCallerSelection = command.editableTarget.listAddress?.operationScope === "list-text";
14045
14046
  const resolution = resolveEditableTextTarget({
14046
14047
  document,
14047
14048
  surface,
14048
14049
  target: command.editableTarget,
14049
14050
  activeStoryKey: canonicalEditableTargetStoryKey(storyTarget),
14051
+ ...preserveCallerSelection ? { selection } : {},
14050
14052
  editableTargetCache: editableTargetBlockCache
14051
14053
  });
14052
14054
  if (resolution.kind === "rejected") {
@@ -14064,7 +14066,7 @@ function createDocumentRuntime(options) {
14064
14066
  }
14065
14067
  return {
14066
14068
  kind: "accepted",
14067
- selection: createSelectionSnapshot(resolution.range.from, resolution.range.to),
14069
+ selection: preserveCallerSelection ? selection : createSelectionSnapshot(resolution.range.from, resolution.range.to),
14068
14070
  ...resolution.textTarget ? { textTarget: resolution.textTarget } : {}
14069
14071
  };
14070
14072
  }
@@ -14236,7 +14238,8 @@ function createDocumentRuntime(options) {
14236
14238
  command,
14237
14239
  state.document,
14238
14240
  cachedRenderSnapshot.surface?.blocks ?? [],
14239
- activeStory
14241
+ activeStory,
14242
+ commandSelection
14240
14243
  );
14241
14244
  if (prepared.kind === "rejected") {
14242
14245
  return;
@@ -14399,7 +14402,8 @@ function createDocumentRuntime(options) {
14399
14402
  command,
14400
14403
  replayState.document,
14401
14404
  replaySnapshot.surface?.blocks ?? [],
14402
- replayStory
14405
+ replayStory,
14406
+ replayState.selection
14403
14407
  );
14404
14408
  if (prepared.kind === "rejected") {
14405
14409
  return;
@@ -14542,7 +14546,8 @@ function createDocumentRuntime(options) {
14542
14546
  command,
14543
14547
  stateForCommand.document,
14544
14548
  snapshotForCommand.surface?.blocks ?? [],
14545
- replayStory
14549
+ replayStory,
14550
+ stateForCommand.selection
14546
14551
  );
14547
14552
  if (prepared.kind === "rejected") {
14548
14553
  continue;
@@ -15106,7 +15111,7 @@ function createDocumentRuntime(options) {
15106
15111
  try {
15107
15112
  const timestamp = clock();
15108
15113
  const selection = target ? createSelectionFromPublicAnchor(target) : state.selection;
15109
- const editableTarget = editContext?.editableTarget && isTableParagraphEditableTarget(editContext.editableTarget) ? editContext.editableTarget : inferEditableTargetForFragmentInsert(
15114
+ const editableTarget = editContext?.editableTarget && isFragmentInsertEditableTarget(editContext.editableTarget) ? editContext.editableTarget : inferEditableTargetForFragmentInsert(
15110
15115
  cachedRenderSnapshot.surface?.blocks ?? [],
15111
15116
  selection
15112
15117
  );
@@ -16913,7 +16918,8 @@ function createDocumentRuntime(options) {
16913
16918
  blockedReasons: [blockedReason]
16914
16919
  });
16915
16920
  }
16916
- const textTarget = targetResolution?.kind === "accepted" ? targetResolution.textTarget : legacyTextTarget;
16921
+ const listBoundaryDeleteUsesStoryText = targetResolution?.kind === "accepted" && editableTarget?.listAddress?.operationScope === "list-text" && isTopLevelMainStoryBlockPath(editableTarget.blockPath) && selection.isCollapsed && (commandForDispatch.type === "text.delete-backward" && selection.anchor === targetResolution.range.from || commandForDispatch.type === "text.delete-forward" && selection.anchor === targetResolution.range.to);
16922
+ const textTarget = targetResolution?.kind === "accepted" && !listBoundaryDeleteUsesStoryText ? targetResolution.textTarget : legacyTextTarget;
16917
16923
  const context = {
16918
16924
  timestamp,
16919
16925
  documentMode: textOptions.documentModeOverride ?? workflowCoordinator.getEffectiveDocumentMode(selection),
@@ -16923,6 +16929,7 @@ function createDocumentRuntime(options) {
16923
16929
  editableTargetCache: editableTargetBlockCache,
16924
16930
  activeStorySize: cachedRenderSnapshot.surface?.storySize,
16925
16931
  textTarget,
16932
+ preserveNumberingOnSplit: (commandForDispatch.type === "paragraph.split" || commandForDispatch.type === "fragment.insert") && targetResolution?.kind === "accepted" && editableTarget?.listAddress?.operationScope === "list-text",
16926
16933
  rejectTargetlessTableStructureInsert: true
16927
16934
  };
16928
16935
  const baseState = selection === state.selection ? state : {
@@ -17744,7 +17751,7 @@ function canonicalEditableTargetStoryKey(storyTarget) {
17744
17751
  function inferEditableTargetForFragmentInsert(blocks, selection) {
17745
17752
  const position = Math.min(selection.anchor, selection.head);
17746
17753
  const target = findEditableTargetAtSurfacePosition(blocks, position);
17747
- return target && isTableParagraphEditableTarget(target) ? target : void 0;
17754
+ return target && isFragmentInsertEditableTarget(target) ? target : void 0;
17748
17755
  }
17749
17756
  function findEditableTargetAtSurfacePosition(blocks, position) {
17750
17757
  for (const block of blocks) {
@@ -17773,8 +17780,14 @@ function findEditableTargetInSurfaceCell(cell, position) {
17773
17780
  }
17774
17781
  return findEditableTargetAtSurfacePosition(cell.content, position);
17775
17782
  }
17776
- function isTableParagraphEditableTarget(target) {
17777
- return target.editability === "editable" && target.posture.blockers.length === 0 && target.commandFamily === "text-leaf" && (target.kind === "table-cell-paragraph-text" || target.kind === "nested-table-cell-paragraph-text" || target.kind === "sdt-table-cell-paragraph-text");
17783
+ function isFragmentInsertEditableTarget(target) {
17784
+ if (target.editability !== "editable" || target.posture.blockers.length > 0 || target.commandFamily !== "text-leaf") {
17785
+ return false;
17786
+ }
17787
+ if (target.listAddress?.operationScope === "list-text") {
17788
+ return true;
17789
+ }
17790
+ return target.kind === "table-cell-paragraph-text" || target.kind === "nested-table-cell-paragraph-text" || target.kind === "sdt-table-cell-paragraph-text";
17778
17791
  }
17779
17792
  function extractSelectionFragment(document, selection, activeStory) {
17780
17793
  const from = Math.min(selection.anchor, selection.head);
@@ -19780,6 +19793,9 @@ function stripStoryTarget(selection) {
19780
19793
  const { storyTarget: _storyTarget, ...rest } = selection;
19781
19794
  return rest;
19782
19795
  }
19796
+ function isTopLevelMainStoryBlockPath(blockPath) {
19797
+ return typeof blockPath === "string" && /^main\/block\[\d+\]$/u.test(blockPath);
19798
+ }
19783
19799
  function toInternalSelectionSnapshot(selection) {
19784
19800
  return {
19785
19801
  anchor: selection.anchor,