@beyondwork/docx-react-component 1.0.120 → 1.0.122

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 (116) hide show
  1. package/README.md +1 -0
  2. package/dist/api/public-types.cjs +1713 -55
  3. package/dist/api/public-types.d.cts +2 -2
  4. package/dist/api/public-types.d.ts +2 -2
  5. package/dist/api/public-types.js +6 -6
  6. package/dist/api/v3.cjs +4958 -406
  7. package/dist/api/v3.d.cts +3 -3
  8. package/dist/api/v3.d.ts +3 -3
  9. package/dist/api/v3.js +14 -14
  10. package/dist/{canonical-document-fNawStsc.d.cts → canonical-document-ByIqTd4s.d.cts} +9 -1
  11. package/dist/{canonical-document-fNawStsc.d.ts → canonical-document-ByIqTd4s.d.ts} +9 -1
  12. package/dist/{chunk-5RNMPLXU.js → chunk-37SEJQ3G.js} +4 -4
  13. package/dist/{chunk-FXGQM2JB.js → chunk-3OFSP2IX.js} +11 -5
  14. package/dist/{chunk-U5BSQXF4.js → chunk-3OHVK2D6.js} +70 -12
  15. package/dist/{chunk-AUQDC5BD.js → chunk-3TUQCHYT.js} +101 -2
  16. package/dist/{chunk-SJSMYEMU.js → chunk-B4YHWFE3.js} +3 -3
  17. package/dist/{chunk-XC56YLIS.js → chunk-C2LWJ4CZ.js} +4 -0
  18. package/dist/{chunk-VDIUVT46.js → chunk-CX42VC67.js} +1 -1
  19. package/dist/{chunk-KCHEAX4Z.js → chunk-EMDH4IQN.js} +148 -70
  20. package/dist/{chunk-TMQGWF7R.js → chunk-G3B2OBCZ.js} +352 -17
  21. package/dist/{chunk-VCL5MJMZ.js → chunk-GON2DNTE.js} +149 -28
  22. package/dist/{chunk-WVZX4NYG.js → chunk-GZW2ERUO.js} +601 -47
  23. package/dist/{chunk-WDNEPRFW.js → chunk-ICX54W4U.js} +1 -1
  24. package/dist/{chunk-FIGWJ43K.js → chunk-IT2DK3A7.js} +1883 -90
  25. package/dist/{chunk-2ZWFQ74R.js → chunk-OBCP6VTG.js} +1 -1
  26. package/dist/{chunk-FLNQY74K.js → chunk-OYGMRRR7.js} +1 -1
  27. package/dist/{chunk-MPYYBRVN.js → chunk-PCXTMEGY.js} +782 -124
  28. package/dist/{chunk-4JNUMMM7.js → chunk-PGGPPZ65.js} +17 -2
  29. package/dist/{chunk-KHZNNBTN.js → chunk-QFU7ZOAD.js} +43 -39
  30. package/dist/{chunk-4ZNQFWFM.js → chunk-QIO6V46H.js} +84 -4
  31. package/dist/{chunk-IQ2VJEF6.js → chunk-QNGJRZ2D.js} +1 -1
  32. package/dist/{chunk-BM5NSDII.js → chunk-S4ANOS2M.js} +2 -2
  33. package/dist/{chunk-AQA7OZ2R.js → chunk-TFSXOIAI.js} +959 -43
  34. package/dist/{chunk-NQZUGMLW.js → chunk-TMU7JMXX.js} +184 -32
  35. package/dist/{chunk-KD5K5XIA.js → chunk-UHQOUTAX.js} +568 -88
  36. package/dist/{chunk-327AIUXL.js → chunk-UWDWGQH5.js} +11 -4
  37. package/dist/{chunk-BBB4GSDB.js → chunk-XVFENXLK.js} +2 -2
  38. package/dist/{chunk-MUEN2WOG.js → chunk-ZKSDVHGH.js} +6 -3
  39. package/dist/compare.cjs +17 -2
  40. package/dist/compare.d.cts +1 -1
  41. package/dist/compare.d.ts +1 -1
  42. package/dist/compare.js +3 -3
  43. package/dist/core/commands/formatting-commands.d.cts +2 -2
  44. package/dist/core/commands/formatting-commands.d.ts +2 -2
  45. package/dist/core/commands/image-commands.cjs +814 -45
  46. package/dist/core/commands/image-commands.d.cts +2 -2
  47. package/dist/core/commands/image-commands.d.ts +2 -2
  48. package/dist/core/commands/image-commands.js +8 -8
  49. package/dist/core/commands/section-layout-commands.d.cts +2 -2
  50. package/dist/core/commands/section-layout-commands.d.ts +2 -2
  51. package/dist/core/commands/style-commands.d.cts +2 -2
  52. package/dist/core/commands/style-commands.d.ts +2 -2
  53. package/dist/core/commands/table-structure-commands.cjs +750 -42
  54. package/dist/core/commands/table-structure-commands.d.cts +2 -2
  55. package/dist/core/commands/table-structure-commands.d.ts +2 -2
  56. package/dist/core/commands/table-structure-commands.js +6 -6
  57. package/dist/core/commands/text-commands.cjs +910 -57
  58. package/dist/core/commands/text-commands.d.cts +2 -2
  59. package/dist/core/commands/text-commands.d.ts +2 -2
  60. package/dist/core/commands/text-commands.js +8 -8
  61. package/dist/core/selection/mapping.d.cts +2 -2
  62. package/dist/core/selection/mapping.d.ts +2 -2
  63. package/dist/core/state/editor-state.cjs +17 -2
  64. package/dist/core/state/editor-state.d.cts +2 -2
  65. package/dist/core/state/editor-state.d.ts +2 -2
  66. package/dist/core/state/editor-state.js +2 -2
  67. package/dist/index.cjs +6203 -625
  68. package/dist/index.d.cts +5 -5
  69. package/dist/index.d.ts +5 -5
  70. package/dist/index.js +299 -67
  71. package/dist/io/docx-session.cjs +354 -102
  72. package/dist/io/docx-session.d.cts +4 -4
  73. package/dist/io/docx-session.d.ts +4 -4
  74. package/dist/io/docx-session.js +5 -5
  75. package/dist/legal.cjs +183 -31
  76. package/dist/legal.d.cts +1 -1
  77. package/dist/legal.d.ts +1 -1
  78. package/dist/legal.js +3 -3
  79. package/dist/{loader-CaohrhNl.d.ts → loader-BF8ju_LK.d.ts} +22 -4
  80. package/dist/{loader-BpCyGnZl.d.cts → loader-g54WRvj1.d.cts} +22 -4
  81. package/dist/{public-types-Dpch9JG0.d.cts → public-types-D_y4Ptcj.d.cts} +747 -21
  82. package/dist/{public-types-C948HNVF.d.ts → public-types-Dl1jiWjk.d.ts} +747 -21
  83. package/dist/public-types.cjs +1713 -55
  84. package/dist/public-types.d.cts +2 -2
  85. package/dist/public-types.d.ts +2 -2
  86. package/dist/public-types.js +6 -6
  87. package/dist/runtime/collab.cjs +4 -0
  88. package/dist/runtime/collab.d.cts +3 -3
  89. package/dist/runtime/collab.d.ts +3 -3
  90. package/dist/runtime/collab.js +2 -2
  91. package/dist/runtime/document-runtime.cjs +3699 -507
  92. package/dist/runtime/document-runtime.d.cts +2 -2
  93. package/dist/runtime/document-runtime.d.ts +2 -2
  94. package/dist/runtime/document-runtime.js +18 -18
  95. package/dist/{session-Dqg17V3s.d.ts → session-C1EPAkcI.d.ts} +3 -3
  96. package/dist/{session-BlXE5zxz.d.cts → session-D15QOO0Q.d.cts} +3 -3
  97. package/dist/session.cjs +951 -104
  98. package/dist/session.d.cts +5 -5
  99. package/dist/session.d.ts +5 -5
  100. package/dist/session.js +10 -8
  101. package/dist/tailwind.cjs +1752 -91
  102. package/dist/tailwind.d.cts +2 -2
  103. package/dist/tailwind.d.ts +2 -2
  104. package/dist/tailwind.js +10 -10
  105. package/dist/{types-C9vZVpKy.d.cts → types-BoSRp2Vg.d.cts} +2 -2
  106. package/dist/{types-B1tlF1bq.d.ts → types-DEvRwq9C.d.ts} +2 -2
  107. package/dist/ui-tailwind/editor-surface/search-plugin.d.cts +3 -3
  108. package/dist/ui-tailwind/editor-surface/search-plugin.d.ts +3 -3
  109. package/dist/ui-tailwind/editor-surface/search-plugin.js +7 -7
  110. package/dist/ui-tailwind/theme/editor-theme.css +5 -5
  111. package/dist/ui-tailwind.cjs +1752 -91
  112. package/dist/ui-tailwind.d.cts +8 -8
  113. package/dist/ui-tailwind.d.ts +8 -8
  114. package/dist/ui-tailwind.js +10 -10
  115. package/package.json +17 -5
  116. package/dist/ui-tailwind/theme/tokens.css +0 -382
@@ -1,3 +1,7 @@
1
+ import {
2
+ collectEditableTargetRefs
3
+ } from "./chunk-TFSXOIAI.js";
4
+
1
5
  // src/api/v3/_ux-response.ts
2
6
  function emitUxResponse(runtime, res) {
3
7
  const bus = runtime.debug?.bus;
@@ -627,6 +631,19 @@ function createViewportFamily(ctx) {
627
631
  };
628
632
  }
629
633
 
634
+ // src/api/v3/_editable-target-refs.ts
635
+ function collectModeledEditableTargetRefs(handle) {
636
+ try {
637
+ const layoutInputs = handle.getCanonicalLayoutInputs?.();
638
+ if (layoutInputs?.editableTargets !== void 0) {
639
+ return layoutInputs.editableTargets;
640
+ }
641
+ return collectEditableTargetRefs(handle.getCanonicalDocument());
642
+ } catch {
643
+ return [];
644
+ }
645
+ }
646
+
630
647
  // src/api/v3/ui/overlays-visibility.ts
631
648
  var INTRINSIC_DEFAULT_ON = {
632
649
  "scope-rail": true,
@@ -905,6 +922,17 @@ function createOverlaysFamily(ctx) {
905
922
  reason
906
923
  };
907
924
  }
925
+ const EDITABLE_TARGET_PAGE_GEOMETRY_UNAVAILABLE = "editable-target-page-geometry-unavailable";
926
+ function unavailableEditableTargetRect() {
927
+ return {
928
+ space: "frame",
929
+ leftPx: 0,
930
+ topPx: 0,
931
+ widthPx: 0,
932
+ heightPx: 0,
933
+ precision: "heuristic"
934
+ };
935
+ }
908
936
  function editableTargetMatchesQuery(entry, query) {
909
937
  if (query.targetKey !== void 0 && entry.targetKey !== query.targetKey) return false;
910
938
  if (query.semanticHandleId !== void 0 && entry.tableAction?.handle.id !== query.semanticHandleId) return false;
@@ -988,7 +1016,7 @@ function createOverlaysFamily(ctx) {
988
1016
  history: "runtime-undo",
989
1017
  replay: "runtime-command-event",
990
1018
  exportReopen: "OOXML-export-reopen",
991
- source: "geometry-index"
1019
+ source: entry.provenanceSource
992
1020
  }
993
1021
  };
994
1022
  }
@@ -1006,36 +1034,129 @@ function createOverlaysFamily(ctx) {
1006
1034
  function documentSeed() {
1007
1035
  return ctx.handle.getSessionState().documentId ?? "document";
1008
1036
  }
1037
+ function modeledTargetSourceIdentity(target) {
1038
+ const table = target.table;
1039
+ return {
1040
+ storyKey: target.storyKey,
1041
+ blockPath: table?.tablePath ?? target.blockPath,
1042
+ ...table?.tableKey !== void 0 ? { tableKey: table.tableKey } : {},
1043
+ ...table?.sourceRef !== void 0 ? { sourceRef: table.sourceRef } : target.sourceRef !== void 0 ? { sourceRef: target.sourceRef } : {},
1044
+ ...table?.rowSourceRef !== void 0 ? { rowSourceRef: table.rowSourceRef } : {},
1045
+ ...table?.cellSourceRef !== void 0 ? { cellSourceRef: table.cellSourceRef } : {},
1046
+ inlinePath: target.leafPath,
1047
+ editPosture: target.editability,
1048
+ joinKind: "block-scoped"
1049
+ };
1050
+ }
1051
+ function projectModeledEditableTarget(target) {
1052
+ const blockers = target.posture.blockers;
1053
+ const projected = {
1054
+ targetKey: target.targetKey,
1055
+ pageId: "editable-target-page-geometry-unavailable",
1056
+ pageIndex: -1,
1057
+ rect: unavailableEditableTargetRect(),
1058
+ geometryStatus: "unavailable",
1059
+ geometryPrecision: "heuristic",
1060
+ geometryAvailable: false,
1061
+ geometryUnavailableReason: EDITABLE_TARGET_PAGE_GEOMETRY_UNAVAILABLE,
1062
+ blockers,
1063
+ provenance: {
1064
+ target: "L02",
1065
+ geometry: "L05",
1066
+ source: "canonical-document"
1067
+ },
1068
+ kind: target.kind,
1069
+ commandFamily: target.commandFamily,
1070
+ editability: target.editability,
1071
+ leafPath: target.leafPath,
1072
+ ...target.canonicalAddress !== void 0 ? { canonicalAddress: target.canonicalAddress } : {},
1073
+ ...target.editableOwner !== void 0 ? {
1074
+ owner: {
1075
+ targetKey: target.editableOwner.targetKey,
1076
+ reason: target.editableOwner.reason,
1077
+ ...target.editableOwner.canonicalAddress !== void 0 ? { canonicalAddress: target.editableOwner.canonicalAddress } : {}
1078
+ }
1079
+ } : {},
1080
+ sourceIdentity: modeledTargetSourceIdentity(target)
1081
+ };
1082
+ const tableAction = tableActionReadback({
1083
+ editableTargetKey: target.targetKey,
1084
+ editableTargetKind: target.kind,
1085
+ editableTargetCommandFamily: target.commandFamily,
1086
+ editableTargetEditability: target.editability,
1087
+ editableTargetBlockers: blockers,
1088
+ status: "unavailable",
1089
+ provenanceSource: "canonical-document"
1090
+ });
1091
+ return tableAction ? { ...projected, tableAction } : projected;
1092
+ }
1093
+ function projectGeometryEditableTarget(entry) {
1094
+ const targetKey = entry.editableTargetKey;
1095
+ if (targetKey === void 0) return [];
1096
+ const blockers = entry.editableTargetBlockers ?? Object.freeze([]);
1097
+ const projected = {
1098
+ targetKey,
1099
+ pageId: entry.pageId,
1100
+ pageIndex: entry.pageIndex,
1101
+ rect: entry.rect,
1102
+ geometryStatus: entry.status,
1103
+ geometryPrecision: entry.precision,
1104
+ geometryAvailable: entry.status === "realized",
1105
+ blockers,
1106
+ provenance: {
1107
+ target: "L02",
1108
+ geometry: "L05",
1109
+ source: "geometry-index"
1110
+ },
1111
+ ...entry.editableTargetKind !== void 0 ? { kind: entry.editableTargetKind } : {},
1112
+ ...entry.editableTargetCommandFamily !== void 0 ? { commandFamily: entry.editableTargetCommandFamily } : {},
1113
+ ...entry.editableTargetEditability !== void 0 ? { editability: entry.editableTargetEditability } : {},
1114
+ ...entry.editableTargetLeafPath !== void 0 ? { leafPath: entry.editableTargetLeafPath } : {},
1115
+ ...entry.editableTargetCanonicalAddress !== void 0 ? { canonicalAddress: entry.editableTargetCanonicalAddress } : {},
1116
+ ...entry.editableTargetUnavailableReason !== void 0 ? { geometryUnavailableReason: entry.editableTargetUnavailableReason } : {},
1117
+ ...entry.editableTargetOwnerKey !== void 0 ? {
1118
+ owner: {
1119
+ targetKey: entry.editableTargetOwnerKey,
1120
+ ...entry.editableTargetOwnerReason !== void 0 ? { reason: entry.editableTargetOwnerReason } : {},
1121
+ ...entry.editableTargetOwnerCanonicalAddress !== void 0 ? { canonicalAddress: entry.editableTargetOwnerCanonicalAddress } : {}
1122
+ }
1123
+ } : {},
1124
+ ...entry.sourceIdentity !== void 0 ? { sourceIdentity: entry.sourceIdentity } : {}
1125
+ };
1126
+ const tableAction = tableActionReadback({
1127
+ editableTargetKey: entry.editableTargetKey,
1128
+ editableTargetKind: entry.editableTargetKind,
1129
+ editableTargetCommandFamily: entry.editableTargetCommandFamily,
1130
+ editableTargetEditability: entry.editableTargetEditability,
1131
+ editableTargetBlockers: blockers,
1132
+ status: entry.status,
1133
+ provenanceSource: "geometry-index"
1134
+ });
1135
+ return tableAction ? [{ ...projected, tableAction }] : [projected];
1136
+ }
1137
+ function collectModeledEditableTargetEntries() {
1138
+ return collectModeledEditableTargetRefs(ctx.handle).map(projectModeledEditableTarget);
1139
+ }
1009
1140
  function readEditableTargets(query = {}) {
1010
1141
  const index = ctx.handle.geometry?.getGeometryIndex?.() ?? null;
1011
- if (!index) return unavailableEditableTargets();
1012
- const entries = index.semanticEntries.flatMap((entry) => {
1013
- const targetKey = entry.editableTargetKey;
1014
- if (targetKey === void 0) return [];
1015
- const blockers = entry.editableTargetBlockers ?? Object.freeze([]);
1016
- const projected = {
1017
- targetKey,
1018
- pageId: entry.pageId,
1019
- pageIndex: entry.pageIndex,
1020
- rect: entry.rect,
1021
- geometryStatus: entry.status,
1022
- geometryPrecision: entry.precision,
1023
- geometryAvailable: entry.status === "realized",
1024
- blockers,
1025
- provenance: {
1026
- target: "L02",
1027
- geometry: "L05",
1028
- source: "geometry-index"
1029
- },
1030
- ...entry.editableTargetKind !== void 0 ? { kind: entry.editableTargetKind } : {},
1031
- ...entry.editableTargetCommandFamily !== void 0 ? { commandFamily: entry.editableTargetCommandFamily } : {},
1032
- ...entry.editableTargetEditability !== void 0 ? { editability: entry.editableTargetEditability } : {},
1033
- ...entry.editableTargetLeafPath !== void 0 ? { leafPath: entry.editableTargetLeafPath } : {},
1034
- ...entry.sourceIdentity !== void 0 ? { sourceIdentity: entry.sourceIdentity } : {}
1142
+ const modeledEntries = collectModeledEditableTargetEntries();
1143
+ if (!index) {
1144
+ const entries2 = modeledEntries.filter((entry) => editableTargetMatchesQuery(entry, query));
1145
+ if (entries2.length === 0) return unavailableEditableTargets();
1146
+ return {
1147
+ status: "unavailable",
1148
+ source: "canonical-document",
1149
+ revision: 0,
1150
+ entries: entries2,
1151
+ reason: "geometry index is not warm on the runtime handle"
1035
1152
  };
1036
- const tableAction = tableActionReadback(entry);
1037
- return tableAction ? [{ ...projected, tableAction }] : [projected];
1038
- }).filter((entry) => editableTargetMatchesQuery(entry, query));
1153
+ }
1154
+ const geometryEntries = index.semanticEntries.flatMap(projectGeometryEditableTarget);
1155
+ const geometryTargetKeys = new Set(geometryEntries.map((entry) => entry.targetKey));
1156
+ const fallbackEntries = modeledEntries.filter(
1157
+ (entry) => !geometryTargetKeys.has(entry.targetKey)
1158
+ );
1159
+ const entries = [...geometryEntries, ...fallbackEntries].filter((entry) => editableTargetMatchesQuery(entry, query));
1039
1160
  return {
1040
1161
  status: index.coverage.status,
1041
1162
  source: "geometry-index",