@beyondwork/docx-react-component 1.0.134 → 1.0.136
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/dist/api/public-types.cjs +20 -2
- package/dist/api/public-types.d.cts +2 -2
- package/dist/api/public-types.d.ts +2 -2
- package/dist/api/public-types.js +2 -2
- package/dist/api/v3.cjs +203 -41
- package/dist/api/v3.d.cts +3 -3
- package/dist/api/v3.d.ts +3 -3
- package/dist/api/v3.js +4 -4
- package/dist/{canonical-document-CfZIc-fC.d.cts → canonical-document-COmM7v11.d.cts} +1 -1
- package/dist/{canonical-document-CfZIc-fC.d.ts → canonical-document-COmM7v11.d.ts} +1 -1
- package/dist/{chunk-REFHJ2FN.js → chunk-2BNXARVO.js} +3 -3
- package/dist/{chunk-INLRCC4N.js → chunk-4CIHTMCH.js} +2 -2
- package/dist/{chunk-MQ5GAJ54.js → chunk-BJXSMPHD.js} +1 -1
- package/dist/{chunk-XBQFDBXE.js → chunk-EZFF6GKF.js} +9 -2
- package/dist/{chunk-3YR47WTD.js → chunk-FGJTOFZY.js} +21 -9
- package/dist/{chunk-74R5B2EZ.js → chunk-H4HI6RUE.js} +1 -1
- package/dist/{chunk-IJD6D7HU.js → chunk-HUWZ7AHE.js} +125 -2
- package/dist/{chunk-7Y6JCIK3.js → chunk-HWMPNLEF.js} +1 -1
- package/dist/{chunk-EBSI6VQX.js → chunk-JZZKTL7K.js} +800 -93
- package/dist/{chunk-VA24T4EB.js → chunk-NEMOQ4QR.js} +1 -1
- package/dist/{chunk-ESEEWELA.js → chunk-NX7W6T7L.js} +171 -39
- package/dist/{chunk-O4EDZR44.js → chunk-P7XDEVS6.js} +12 -1
- package/dist/{chunk-QTRJLKR2.js → chunk-TSNK4ECL.js} +1 -1
- package/dist/{chunk-WDDFU2N2.js → chunk-UR2LW63N.js} +1 -1
- package/dist/compare.d.cts +1 -1
- package/dist/compare.d.ts +1 -1
- package/dist/core/commands/formatting-commands.d.cts +2 -2
- package/dist/core/commands/formatting-commands.d.ts +2 -2
- package/dist/core/commands/image-commands.cjs +9 -2
- package/dist/core/commands/image-commands.d.cts +2 -2
- package/dist/core/commands/image-commands.d.ts +2 -2
- package/dist/core/commands/image-commands.js +4 -4
- package/dist/core/commands/section-layout-commands.d.cts +2 -2
- package/dist/core/commands/section-layout-commands.d.ts +2 -2
- package/dist/core/commands/style-commands.d.cts +2 -2
- package/dist/core/commands/style-commands.d.ts +2 -2
- package/dist/core/commands/table-structure-commands.cjs +9 -2
- package/dist/core/commands/table-structure-commands.d.cts +2 -2
- package/dist/core/commands/table-structure-commands.d.ts +2 -2
- package/dist/core/commands/table-structure-commands.js +3 -3
- package/dist/core/commands/text-commands.cjs +9 -2
- package/dist/core/commands/text-commands.d.cts +2 -2
- package/dist/core/commands/text-commands.d.ts +2 -2
- package/dist/core/commands/text-commands.js +4 -4
- package/dist/core/selection/mapping.d.cts +2 -2
- package/dist/core/selection/mapping.d.ts +2 -2
- package/dist/core/state/editor-state.d.cts +2 -2
- package/dist/core/state/editor-state.d.ts +2 -2
- package/dist/index.cjs +1287 -198
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +135 -34
- package/dist/io/docx-session.d.cts +4 -4
- package/dist/io/docx-session.d.ts +4 -4
- package/dist/legal.d.cts +1 -1
- package/dist/legal.d.ts +1 -1
- package/dist/{loader-CK3lZy4h.d.cts → loader-Cr35kVUi.d.cts} +3 -3
- package/dist/{loader-CQXplstv.d.ts → loader-uGY6nDZP.d.ts} +3 -3
- package/dist/{public-types-DXNZVKrS.d.ts → public-types-8kVIB5HW.d.ts} +22 -8
- package/dist/{public-types-BR1SYK2F.d.cts → public-types-CSSH2Whc.d.cts} +22 -8
- package/dist/public-types.cjs +20 -2
- package/dist/public-types.d.cts +2 -2
- package/dist/public-types.d.ts +2 -2
- package/dist/public-types.js +2 -2
- package/dist/runtime/collab.d.cts +3 -3
- package/dist/runtime/collab.d.ts +3 -3
- package/dist/runtime/document-runtime.cjs +929 -83
- package/dist/runtime/document-runtime.d.cts +2 -2
- package/dist/runtime/document-runtime.d.ts +2 -2
- package/dist/runtime/document-runtime.js +10 -10
- package/dist/{session-CSbwkgII.d.cts → session-Beg8ihOi.d.cts} +3 -3
- package/dist/{session-C9UjrhJF.d.ts → session-Dgp-2uYw.d.ts} +3 -3
- package/dist/session.d.cts +5 -5
- package/dist/session.d.ts +5 -5
- package/dist/tailwind.cjs +27 -8
- package/dist/tailwind.d.cts +2 -2
- package/dist/tailwind.d.ts +2 -2
- package/dist/tailwind.js +5 -5
- package/dist/{types-RzkCXDNV.d.ts → types-Cin_abw3.d.ts} +2 -2
- package/dist/{types-CZtAueri.d.cts → types-qsS39ZkQ.d.cts} +2 -2
- package/dist/ui-tailwind/editor-surface/search-plugin.cjs +11 -0
- package/dist/ui-tailwind/editor-surface/search-plugin.d.cts +3 -3
- package/dist/ui-tailwind/editor-surface/search-plugin.d.ts +3 -3
- package/dist/ui-tailwind/editor-surface/search-plugin.js +3 -3
- package/dist/ui-tailwind.cjs +27 -8
- package/dist/ui-tailwind.d.cts +3 -3
- package/dist/ui-tailwind.d.ts +3 -3
- package/dist/ui-tailwind.js +5 -5
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolvePageOverlayRectsFromGeometry
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-H4HI6RUE.js";
|
|
4
4
|
import {
|
|
5
5
|
buildPageAnchorAttributes,
|
|
6
6
|
buildPageAnchorSelector,
|
|
@@ -20,13 +20,13 @@ import {
|
|
|
20
20
|
incrementInvalidationCounter,
|
|
21
21
|
recordPerfSample,
|
|
22
22
|
sanitizeMarkdown
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-P7XDEVS6.js";
|
|
24
24
|
import {
|
|
25
25
|
createCanvasBackend
|
|
26
26
|
} from "./chunk-OVLZQ6FZ.js";
|
|
27
27
|
import {
|
|
28
28
|
storyTargetKey
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-EZFF6GKF.js";
|
|
30
30
|
import {
|
|
31
31
|
EMU_PER_INCH,
|
|
32
32
|
EMU_PER_PX,
|
|
@@ -17204,6 +17204,10 @@ function TwTableGripLayer({
|
|
|
17204
17204
|
tableGeometry,
|
|
17205
17205
|
plan.columnsTwips
|
|
17206
17206
|
);
|
|
17207
|
+
const columnWidthCapability = tableContext.operations.setColumnWidth;
|
|
17208
|
+
const rowHeightCapability = tableContext.operations.setRowHeight;
|
|
17209
|
+
const columnResizeDisabled = !!disabled || !onSetColumnWidth || columnWidthCapability?.enabled === false;
|
|
17210
|
+
const rowResizeDisabled = !!disabled || !onSetRowHeight || rowHeightCapability?.enabled === false;
|
|
17207
17211
|
return /* @__PURE__ */ jsxs50(Fragment13, { children: [
|
|
17208
17212
|
plan.columnResizeHandles.map((handle) => {
|
|
17209
17213
|
const rect = resolveColumnEdgeRect(
|
|
@@ -17218,7 +17222,8 @@ function TwTableGripLayer({
|
|
|
17218
17222
|
colIndex: handle.columnIndex,
|
|
17219
17223
|
originalTwips: plan.columnsTwips[handle.columnIndex] ?? 720,
|
|
17220
17224
|
pxPerTwip,
|
|
17221
|
-
disabled:
|
|
17225
|
+
disabled: columnResizeDisabled,
|
|
17226
|
+
disabledReason: columnWidthCapability?.reason,
|
|
17222
17227
|
onCommit: onSetColumnWidth
|
|
17223
17228
|
},
|
|
17224
17229
|
`col-${blockId}-${handle.columnIndex}`
|
|
@@ -17239,7 +17244,8 @@ function TwTableGripLayer({
|
|
|
17239
17244
|
rowIndex,
|
|
17240
17245
|
originalTwips,
|
|
17241
17246
|
pxPerTwip,
|
|
17242
|
-
disabled:
|
|
17247
|
+
disabled: rowResizeDisabled,
|
|
17248
|
+
disabledReason: rowHeightCapability?.reason,
|
|
17243
17249
|
onCommit: onSetRowHeight
|
|
17244
17250
|
},
|
|
17245
17251
|
`row-${blockId}-${rowIndex}`
|
|
@@ -17329,6 +17335,7 @@ function ColResizeGrip({
|
|
|
17329
17335
|
originalTwips,
|
|
17330
17336
|
pxPerTwip,
|
|
17331
17337
|
disabled,
|
|
17338
|
+
disabledReason,
|
|
17332
17339
|
onCommit
|
|
17333
17340
|
}) {
|
|
17334
17341
|
const dragRef = useRef19(null);
|
|
@@ -17387,11 +17394,13 @@ function ColResizeGrip({
|
|
|
17387
17394
|
role: "separator",
|
|
17388
17395
|
"aria-orientation": "vertical",
|
|
17389
17396
|
"aria-label": `Resize column ${colIndex + 1}`,
|
|
17397
|
+
"aria-disabled": disabled ? "true" : void 0,
|
|
17390
17398
|
"data-testid": `col-resize-grip-${colIndex}`,
|
|
17391
17399
|
"data-active": isActive ? "true" : "false",
|
|
17400
|
+
title: disabled ? disabledReason : void 0,
|
|
17392
17401
|
className: [
|
|
17393
|
-
"wre-table-grip-col
|
|
17394
|
-
disabled ? "opacity-0 cursor-default" : ""
|
|
17402
|
+
"wre-table-grip-col absolute",
|
|
17403
|
+
disabled ? "pointer-events-none opacity-0 cursor-default" : "pointer-events-auto"
|
|
17395
17404
|
].filter(Boolean).join(" "),
|
|
17396
17405
|
style: {
|
|
17397
17406
|
left: `calc(${pos.left} - ${GRIP_HIT_PX / 2}px)`,
|
|
@@ -17409,6 +17418,7 @@ function RowResizeGrip({
|
|
|
17409
17418
|
originalTwips,
|
|
17410
17419
|
pxPerTwip,
|
|
17411
17420
|
disabled,
|
|
17421
|
+
disabledReason,
|
|
17412
17422
|
onCommit
|
|
17413
17423
|
}) {
|
|
17414
17424
|
const dragRef = useRef19(null);
|
|
@@ -17468,11 +17478,13 @@ function RowResizeGrip({
|
|
|
17468
17478
|
role: "separator",
|
|
17469
17479
|
"aria-orientation": "horizontal",
|
|
17470
17480
|
"aria-label": `Resize row ${rowIndex + 1}`,
|
|
17481
|
+
"aria-disabled": disabled ? "true" : void 0,
|
|
17471
17482
|
"data-testid": `row-resize-grip-${rowIndex}`,
|
|
17472
17483
|
"data-active": isActive ? "true" : "false",
|
|
17484
|
+
title: disabled ? disabledReason : void 0,
|
|
17473
17485
|
className: [
|
|
17474
|
-
"wre-table-grip-row
|
|
17475
|
-
disabled ? "opacity-0 cursor-default" : ""
|
|
17486
|
+
"wre-table-grip-row absolute",
|
|
17487
|
+
disabled ? "pointer-events-none opacity-0 cursor-default" : "pointer-events-auto"
|
|
17476
17488
|
].filter(Boolean).join(" "),
|
|
17477
17489
|
style: {
|
|
17478
17490
|
left: pos.left,
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
resolveSectionForStoryTarget,
|
|
8
8
|
searchSecondaryStories,
|
|
9
9
|
searchSurfaceBlocks
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-P7XDEVS6.js";
|
|
11
11
|
import {
|
|
12
12
|
createEditorSurfaceSnapshot,
|
|
13
13
|
createFormattingContext,
|
|
14
14
|
resolveTableStyleResolution
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-EZFF6GKF.js";
|
|
16
16
|
import {
|
|
17
17
|
createSelectionSnapshot
|
|
18
18
|
} from "./chunk-OYGMRRR7.js";
|
|
@@ -9594,6 +9594,106 @@ function setStartOverride(catalog, numberingInstanceId, level, startAt) {
|
|
|
9594
9594
|
overrides: mergeOverride(instance.overrides, { level, startAt })
|
|
9595
9595
|
};
|
|
9596
9596
|
}
|
|
9597
|
+
function mergeFragmentNumberingCatalog(target, fragment) {
|
|
9598
|
+
const catalog = cloneNumberingCatalog(target);
|
|
9599
|
+
const abstractIdMap = /* @__PURE__ */ new Map();
|
|
9600
|
+
const instanceIdMap = /* @__PURE__ */ new Map();
|
|
9601
|
+
const picBulletIdMap = /* @__PURE__ */ new Map();
|
|
9602
|
+
if (!fragment) {
|
|
9603
|
+
return { catalog, abstractIdMap, instanceIdMap, picBulletIdMap };
|
|
9604
|
+
}
|
|
9605
|
+
for (const [picBulletId, entry] of Object.entries(fragment.numPicBullets ?? {})) {
|
|
9606
|
+
const mappedId = mapPicBulletId(catalog, picBulletId, entry);
|
|
9607
|
+
picBulletIdMap.set(picBulletId, mappedId);
|
|
9608
|
+
}
|
|
9609
|
+
for (const [abstractId, definition] of Object.entries(fragment.abstractDefinitions)) {
|
|
9610
|
+
const mappedId = mapAbstractDefinition(catalog, definition, picBulletIdMap);
|
|
9611
|
+
abstractIdMap.set(abstractId, mappedId);
|
|
9612
|
+
}
|
|
9613
|
+
for (const [instanceId, instance] of Object.entries(fragment.instances)) {
|
|
9614
|
+
const mappedAbstractId = abstractIdMap.get(instance.abstractNumberingId) ?? instance.abstractNumberingId;
|
|
9615
|
+
const mappedId = mapNumberingInstance(
|
|
9616
|
+
catalog,
|
|
9617
|
+
instance,
|
|
9618
|
+
mappedAbstractId,
|
|
9619
|
+
picBulletIdMap
|
|
9620
|
+
);
|
|
9621
|
+
instanceIdMap.set(instanceId, mappedId);
|
|
9622
|
+
}
|
|
9623
|
+
return { catalog, abstractIdMap, instanceIdMap, picBulletIdMap };
|
|
9624
|
+
}
|
|
9625
|
+
function mapPicBulletId(catalog, picBulletId, entry) {
|
|
9626
|
+
const existing = catalog.numPicBullets?.[picBulletId];
|
|
9627
|
+
if (existing && existing.rawXml === entry.rawXml) return picBulletId;
|
|
9628
|
+
const mappedId = existing ? nextNumericString(Object.keys(catalog.numPicBullets ?? {})) : picBulletId;
|
|
9629
|
+
const numPicBullets = { ...catalog.numPicBullets ?? {} };
|
|
9630
|
+
numPicBullets[mappedId] = {
|
|
9631
|
+
...stripSourceRef(structuredClone(entry)),
|
|
9632
|
+
numPicBulletId: mappedId
|
|
9633
|
+
};
|
|
9634
|
+
catalog.numPicBullets = numPicBullets;
|
|
9635
|
+
return mappedId;
|
|
9636
|
+
}
|
|
9637
|
+
function mapAbstractDefinition(catalog, definition, picBulletIdMap) {
|
|
9638
|
+
const existing = catalog.abstractDefinitions[definition.abstractNumberingId];
|
|
9639
|
+
if (existing && sameJson(comparableAbstract(existing), comparableAbstract(definition))) {
|
|
9640
|
+
return definition.abstractNumberingId;
|
|
9641
|
+
}
|
|
9642
|
+
const mappedId = existing ? nextCanonicalNumericId("abstract-num:", Object.keys(catalog.abstractDefinitions)) : definition.abstractNumberingId;
|
|
9643
|
+
catalog.abstractDefinitions[mappedId] = {
|
|
9644
|
+
...stripSourceRef(structuredClone(definition)),
|
|
9645
|
+
abstractNumberingId: mappedId,
|
|
9646
|
+
nsid: freshLongHex(catalog, mappedId, "nsid"),
|
|
9647
|
+
tplc: freshLongHex(catalog, mappedId, "tmpl"),
|
|
9648
|
+
levels: definition.levels.map((level) => remapLevelPicBullet(level, picBulletIdMap))
|
|
9649
|
+
};
|
|
9650
|
+
return mappedId;
|
|
9651
|
+
}
|
|
9652
|
+
function mapNumberingInstance(catalog, instance, abstractNumberingId, picBulletIdMap) {
|
|
9653
|
+
const existing = catalog.instances[instance.numberingInstanceId];
|
|
9654
|
+
const candidate = {
|
|
9655
|
+
...instance,
|
|
9656
|
+
abstractNumberingId,
|
|
9657
|
+
overrides: instance.overrides.map(
|
|
9658
|
+
(override) => remapOverridePicBullet(override, picBulletIdMap)
|
|
9659
|
+
)
|
|
9660
|
+
};
|
|
9661
|
+
if (existing && sameJson(comparableInstance(existing), comparableInstance(candidate))) {
|
|
9662
|
+
return instance.numberingInstanceId;
|
|
9663
|
+
}
|
|
9664
|
+
const mappedId = existing ? nextCanonicalNumericId("num:", Object.keys(catalog.instances)) : instance.numberingInstanceId;
|
|
9665
|
+
catalog.instances[mappedId] = {
|
|
9666
|
+
...stripSourceRef(structuredClone(instance)),
|
|
9667
|
+
overrides: candidate.overrides.map((override) => stripOverrideSourceRefs(override)),
|
|
9668
|
+
numberingInstanceId: mappedId,
|
|
9669
|
+
abstractNumberingId
|
|
9670
|
+
};
|
|
9671
|
+
return mappedId;
|
|
9672
|
+
}
|
|
9673
|
+
function remapLevelPicBullet(level, picBulletIdMap) {
|
|
9674
|
+
const cloned = stripSourceRef(structuredClone(level));
|
|
9675
|
+
if (!level.picBulletId) return cloned;
|
|
9676
|
+
return {
|
|
9677
|
+
...cloned,
|
|
9678
|
+
picBulletId: picBulletIdMap.get(level.picBulletId) ?? level.picBulletId
|
|
9679
|
+
};
|
|
9680
|
+
}
|
|
9681
|
+
function remapOverridePicBullet(override, picBulletIdMap) {
|
|
9682
|
+
const cloned = stripOverrideSourceRefs(structuredClone(override));
|
|
9683
|
+
if (!override.levelDefinition) return cloned;
|
|
9684
|
+
return {
|
|
9685
|
+
...cloned,
|
|
9686
|
+
levelDefinition: remapLevelPicBullet(override.levelDefinition, picBulletIdMap)
|
|
9687
|
+
};
|
|
9688
|
+
}
|
|
9689
|
+
function stripOverrideSourceRefs(override) {
|
|
9690
|
+
const cloned = stripSourceRef(override);
|
|
9691
|
+
if (!override.levelDefinition) return cloned;
|
|
9692
|
+
return {
|
|
9693
|
+
...cloned,
|
|
9694
|
+
levelDefinition: stripSourceRef(override.levelDefinition)
|
|
9695
|
+
};
|
|
9696
|
+
}
|
|
9597
9697
|
function mergeOverride(overrides, nextOverride) {
|
|
9598
9698
|
return [
|
|
9599
9699
|
...overrides.filter((override) => override.level !== nextOverride.level),
|
|
@@ -9665,6 +9765,28 @@ function hashLongHex(input) {
|
|
|
9665
9765
|
}
|
|
9666
9766
|
return hash.toString(16).toUpperCase().padStart(8, "0").slice(-8);
|
|
9667
9767
|
}
|
|
9768
|
+
function stripSourceRef(value) {
|
|
9769
|
+
const { sourceRef: _sourceRef, ...rest } = value;
|
|
9770
|
+
return rest;
|
|
9771
|
+
}
|
|
9772
|
+
function comparableAbstract(definition) {
|
|
9773
|
+
return {
|
|
9774
|
+
...stripSourceRef(definition),
|
|
9775
|
+
levels: definition.levels.map((level) => stripSourceRef(level))
|
|
9776
|
+
};
|
|
9777
|
+
}
|
|
9778
|
+
function comparableInstance(instance) {
|
|
9779
|
+
return {
|
|
9780
|
+
...stripSourceRef(instance),
|
|
9781
|
+
overrides: instance.overrides.map((override) => ({
|
|
9782
|
+
...stripSourceRef(override),
|
|
9783
|
+
...override.levelDefinition ? { levelDefinition: stripSourceRef(override.levelDefinition) } : {}
|
|
9784
|
+
}))
|
|
9785
|
+
};
|
|
9786
|
+
}
|
|
9787
|
+
function sameJson(left, right) {
|
|
9788
|
+
return JSON.stringify(left) === JSON.stringify(right);
|
|
9789
|
+
}
|
|
9668
9790
|
|
|
9669
9791
|
// src/runtime/formatting/projector.ts
|
|
9670
9792
|
function buildFormattingDebugEntry(inputs) {
|
|
@@ -9692,6 +9814,7 @@ export {
|
|
|
9692
9814
|
ensureDefaultListInstance,
|
|
9693
9815
|
allocateNumberingInstance,
|
|
9694
9816
|
setStartOverride,
|
|
9817
|
+
mergeFragmentNumberingCatalog,
|
|
9695
9818
|
inlineLengthForScopeCoordinates,
|
|
9696
9819
|
computeScopeStoryLayout,
|
|
9697
9820
|
findParagraphSlotAtPosition,
|