@beyondwork/docx-react-component 1.0.124 → 1.0.126
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 +147 -35
- package/dist/api/public-types.d.cts +2 -2
- package/dist/api/public-types.d.ts +2 -2
- package/dist/api/public-types.js +3 -3
- package/dist/api/v3.cjs +796 -102
- package/dist/api/v3.d.cts +3 -3
- package/dist/api/v3.d.ts +3 -3
- package/dist/api/v3.js +10 -10
- package/dist/{canonical-document-CG2TgAzj.d.cts → canonical-document-CXCFCbAz.d.cts} +2 -0
- package/dist/{canonical-document-CG2TgAzj.d.ts → canonical-document-CXCFCbAz.d.ts} +2 -0
- package/dist/{chunk-PFYUJU3Q.js → chunk-2QL5DAKF.js} +98 -43
- package/dist/{chunk-4IPEZYQX.js → chunk-4EENH4FG.js} +1 -1
- package/dist/{chunk-BOHHIVQ2.js → chunk-4G3OS2H6.js} +3 -3
- package/dist/{chunk-A74Y5NE4.js → chunk-4YJVRIUB.js} +52 -21
- package/dist/{chunk-FNWKE74J.js → chunk-5DGKFNQT.js} +5 -1
- package/dist/{chunk-RSYN6FTS.js → chunk-6F5QW44A.js} +2 -2
- package/dist/{chunk-ZMRO6P3A.js → chunk-6IGWPAR4.js} +505 -44
- package/dist/{chunk-KOHQFZMM.js → chunk-BYSRJ4FE.js} +1 -1
- package/dist/{chunk-H6IL5ABU.js → chunk-CXSYRB37.js} +64 -20
- package/dist/{chunk-32ZAOQ54.js → chunk-D5HYZQTG.js} +1 -1
- package/dist/{chunk-TY4DIJO3.js → chunk-ESJ2MES5.js} +1 -1
- package/dist/{chunk-Q76XPPTA.js → chunk-FPRWV54X.js} +101 -14
- package/dist/{chunk-MPH4ZQS4.js → chunk-GL7XRYBY.js} +624 -87
- package/dist/{chunk-IR7QV2BX.js → chunk-KV435YXO.js} +2 -2
- package/dist/{chunk-N4VIXI2Z.js → chunk-MWSBGJQO.js} +137 -18
- package/dist/{chunk-7PC6XUNO.js → chunk-TQDQU2E3.js} +2 -2
- package/dist/{chunk-4B74ETJI.js → chunk-V6XVZFFH.js} +2 -2
- package/dist/{chunk-NAMAWCXN.js → chunk-YD2JE54B.js} +1 -1
- package/dist/{chunk-ZRHLLPSJ.js → chunk-YHZHPXDB.js} +85 -18
- package/dist/{chunk-HXHQA4BU.js → chunk-YIYM4ZAP.js} +1 -1
- package/dist/{chunk-LGWNN3L2.js → chunk-ZDOAUP3V.js} +2 -2
- 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 +65 -20
- 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 +5 -5
- 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 +65 -20
- 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 +4 -4
- package/dist/core/commands/text-commands.cjs +66 -21
- 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 +5 -5
- 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 +1677 -240
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +62 -25
- package/dist/io/docx-session.cjs +51 -20
- package/dist/io/docx-session.d.cts +4 -4
- package/dist/io/docx-session.d.ts +4 -4
- package/dist/io/docx-session.js +4 -4
- package/dist/legal.cjs +36 -12
- package/dist/legal.d.cts +1 -1
- package/dist/legal.d.ts +1 -1
- package/dist/legal.js +3 -3
- package/dist/{loader-D9y4ZRjj.d.ts → loader-CS9-9KFa.d.ts} +3 -3
- package/dist/{loader-D9KCtj4m.d.cts → loader-OoWJ1_17.d.cts} +3 -3
- package/dist/{public-types-CNnMHZM9.d.ts → public-types-BP3vqJR5.d.cts} +157 -11
- package/dist/{public-types-DajNGKV4.d.cts → public-types-DdcHqcow.d.ts} +157 -11
- package/dist/public-types.cjs +147 -35
- package/dist/public-types.d.cts +2 -2
- package/dist/public-types.d.ts +2 -2
- package/dist/public-types.js +3 -3
- package/dist/runtime/collab.d.cts +3 -3
- package/dist/runtime/collab.d.ts +3 -3
- package/dist/runtime/document-runtime.cjs +945 -134
- package/dist/runtime/document-runtime.d.cts +2 -2
- package/dist/runtime/document-runtime.d.ts +2 -2
- package/dist/runtime/document-runtime.js +14 -14
- package/dist/{session-DyQGlryH.d.cts → session-Cq-fzx3B.d.cts} +3 -3
- package/dist/{session-DEmaOEjA.d.ts → session-DyFQt8Ph.d.ts} +3 -3
- package/dist/session.cjs +51 -20
- package/dist/session.d.cts +5 -5
- package/dist/session.d.ts +5 -5
- package/dist/session.js +5 -5
- package/dist/tailwind.cjs +238 -73
- package/dist/tailwind.d.cts +2 -2
- package/dist/tailwind.d.ts +2 -2
- package/dist/tailwind.js +7 -7
- package/dist/{types-CxE1aZiv.d.cts → types-Bg7D-GD3.d.cts} +2 -2
- package/dist/{types-DjJNaE9c.d.ts → types-bJAgMq1M.d.ts} +2 -2
- 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 +4 -4
- package/dist/ui-tailwind.cjs +238 -73
- package/dist/ui-tailwind.d.cts +3 -3
- package/dist/ui-tailwind.d.ts +3 -3
- package/dist/ui-tailwind.js +7 -7
- package/package.json +1 -1
|
@@ -1465,7 +1465,7 @@ function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, tar
|
|
|
1465
1465
|
context: { storyKey, insideSdt: contentControl !== void 0 },
|
|
1466
1466
|
...tableTarget
|
|
1467
1467
|
}) : void 0;
|
|
1468
|
-
const listAddress =
|
|
1468
|
+
const listAddress = paragraph.numbering !== void 0 ? createCanonicalAddress({
|
|
1469
1469
|
addressKind: "list-item-text",
|
|
1470
1470
|
storyKey,
|
|
1471
1471
|
staleCheckKind: "paragraph",
|
|
@@ -1499,6 +1499,7 @@ function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, tar
|
|
|
1499
1499
|
...contentControl !== void 0 ? { contentControl } : {},
|
|
1500
1500
|
...tableIdentity !== void 0 ? { table: tableIdentity } : {},
|
|
1501
1501
|
...editableOwner !== void 0 ? { editableOwner } : {},
|
|
1502
|
+
...listAddress !== void 0 ? { listAddress } : {},
|
|
1502
1503
|
...tableIdentity !== void 0 ? {
|
|
1503
1504
|
canonicalAddress: createTableTargetCanonicalAddress(
|
|
1504
1505
|
tableIdentity,
|
|
@@ -3598,6 +3599,7 @@ function mergeLevelDefinition(base, override, startOverride, fallbackLevel) {
|
|
|
3598
3599
|
);
|
|
3599
3600
|
const runProperties = override?.runProperties ?? base?.runProperties;
|
|
3600
3601
|
const restartAfterLevel = override?.restartAfterLevel ?? base?.restartAfterLevel;
|
|
3602
|
+
const picBulletId = override?.picBulletId ?? base?.picBulletId;
|
|
3601
3603
|
return {
|
|
3602
3604
|
level,
|
|
3603
3605
|
format,
|
|
@@ -3608,7 +3610,8 @@ function mergeLevelDefinition(base, override, startOverride, fallbackLevel) {
|
|
|
3608
3610
|
...override?.suffix ?? base?.suffix ? { suffix: override?.suffix ?? base?.suffix } : {},
|
|
3609
3611
|
...paragraphGeometry ? { paragraphGeometry } : {},
|
|
3610
3612
|
...runProperties ? { runProperties } : {},
|
|
3611
|
-
...restartAfterLevel !== void 0 ? { restartAfterLevel } : {}
|
|
3613
|
+
...restartAfterLevel !== void 0 ? { restartAfterLevel } : {},
|
|
3614
|
+
...picBulletId !== void 0 ? { picBulletId } : {}
|
|
3612
3615
|
};
|
|
3613
3616
|
}
|
|
3614
3617
|
function withDefaultStartAt(level) {
|
|
@@ -3736,7 +3739,7 @@ function resolveHangingWidth(indentation) {
|
|
|
3736
3739
|
// src/runtime/formatting/numbering/prefix.ts
|
|
3737
3740
|
function createNumberingPrefixResolver(catalog) {
|
|
3738
3741
|
const sequenceStates = /* @__PURE__ */ new Map();
|
|
3739
|
-
function resolveInternal(numbering, paragraph) {
|
|
3742
|
+
function resolveInternal(numbering, paragraph, options = {}) {
|
|
3740
3743
|
const resolved = resolveNumberingDefinitionSet(
|
|
3741
3744
|
catalog,
|
|
3742
3745
|
paragraph?.numbering ?? numbering,
|
|
@@ -3749,29 +3752,44 @@ function createNumberingPrefixResolver(catalog) {
|
|
|
3749
3752
|
if (!resolvedNumbering) {
|
|
3750
3753
|
return null;
|
|
3751
3754
|
}
|
|
3752
|
-
const
|
|
3753
|
-
|
|
3755
|
+
const advance = options.advance !== false;
|
|
3756
|
+
const sequenceState = getSequenceState(
|
|
3757
|
+
sequenceStates,
|
|
3758
|
+
resolvedNumbering.numberingInstanceId,
|
|
3759
|
+
{ create: advance }
|
|
3760
|
+
);
|
|
3761
|
+
if (!sequenceState) {
|
|
3762
|
+
return null;
|
|
3763
|
+
}
|
|
3764
|
+
const workingState = advance ? sequenceState : cloneSequenceState(sequenceState);
|
|
3765
|
+
advanceSequence(workingState, resolved.effectiveLevel.level, resolved.effectiveLevels);
|
|
3766
|
+
const currentCounter = workingState.counters[resolved.effectiveLevel.level];
|
|
3754
3767
|
const effectiveLevelDefs = resolved.effectiveLevel.isLegalNumbering ? new Map(
|
|
3755
3768
|
Array.from(resolved.effectiveLevels.entries()).map(([level, definition]) => [
|
|
3756
3769
|
level,
|
|
3757
3770
|
{ ...definition, format: "decimal" }
|
|
3758
3771
|
])
|
|
3759
3772
|
) : resolved.effectiveLevels;
|
|
3773
|
+
const picBulletId = resolved.effectiveLevel.picBulletId;
|
|
3760
3774
|
const text = renderLevelText(
|
|
3761
3775
|
resolved.effectiveLevel.text,
|
|
3762
|
-
|
|
3776
|
+
workingState.counters,
|
|
3763
3777
|
effectiveLevelDefs
|
|
3764
3778
|
);
|
|
3765
|
-
if (resolved.effectiveLevel.format !== "none" && text === null) {
|
|
3779
|
+
if (picBulletId == null && resolved.effectiveLevel.format !== "none" && text === null) {
|
|
3766
3780
|
return null;
|
|
3767
3781
|
}
|
|
3768
3782
|
const visibleText = resolved.effectiveLevel.format === "none" ? null : text;
|
|
3769
|
-
const
|
|
3783
|
+
const formatPosture = getNumberingFormatPosture(
|
|
3784
|
+
resolved.effectiveLevel.format,
|
|
3785
|
+
currentCounter
|
|
3786
|
+
);
|
|
3770
3787
|
const picBulletMediaId = picBulletId != null ? catalog.numPicBullets?.[picBulletId]?.mediaId : void 0;
|
|
3771
3788
|
return {
|
|
3772
3789
|
text: visibleText,
|
|
3773
3790
|
level: resolved.effectiveLevel.level,
|
|
3774
3791
|
format: resolved.effectiveLevel.format,
|
|
3792
|
+
...formatPosture !== void 0 ? { formatPosture } : {},
|
|
3775
3793
|
startAt: resolved.effectiveLevel.startAt ?? DEFAULT_NUMBERING_START_AT,
|
|
3776
3794
|
...resolved.effectiveLevel.suffix ? { suffix: resolved.effectiveLevel.suffix } : {},
|
|
3777
3795
|
...resolved.effectiveLevel.paragraphStyleId ? { paragraphStyleId: resolved.effectiveLevel.paragraphStyleId } : {},
|
|
@@ -3782,23 +3800,26 @@ function createNumberingPrefixResolver(catalog) {
|
|
|
3782
3800
|
};
|
|
3783
3801
|
}
|
|
3784
3802
|
return {
|
|
3785
|
-
resolve(numbering) {
|
|
3786
|
-
const result = resolveInternal(numbering);
|
|
3803
|
+
resolve(numbering, options) {
|
|
3804
|
+
const result = resolveInternal(numbering, void 0, options);
|
|
3787
3805
|
return result?.text ?? null;
|
|
3788
3806
|
},
|
|
3789
|
-
resolveDetailed(numbering, paragraph) {
|
|
3790
|
-
return resolveInternal(numbering, paragraph);
|
|
3807
|
+
resolveDetailed(numbering, paragraph, options) {
|
|
3808
|
+
return resolveInternal(numbering, paragraph, options);
|
|
3791
3809
|
},
|
|
3792
|
-
resolveParagraph(paragraph) {
|
|
3793
|
-
return resolveInternal(paragraph.numbering, paragraph);
|
|
3810
|
+
resolveParagraph(paragraph, options) {
|
|
3811
|
+
return resolveInternal(paragraph.numbering, paragraph, options);
|
|
3794
3812
|
}
|
|
3795
3813
|
};
|
|
3796
3814
|
}
|
|
3797
|
-
function getSequenceState(states, numberingInstanceId) {
|
|
3815
|
+
function getSequenceState(states, numberingInstanceId, options = { create: true }) {
|
|
3798
3816
|
const existing = states.get(numberingInstanceId);
|
|
3799
3817
|
if (existing) {
|
|
3800
3818
|
return existing;
|
|
3801
3819
|
}
|
|
3820
|
+
if (options.create === false) {
|
|
3821
|
+
return { counters: [], lastLevel: null };
|
|
3822
|
+
}
|
|
3802
3823
|
const created = {
|
|
3803
3824
|
counters: [],
|
|
3804
3825
|
lastLevel: null
|
|
@@ -3806,6 +3827,12 @@ function getSequenceState(states, numberingInstanceId) {
|
|
|
3806
3827
|
states.set(numberingInstanceId, created);
|
|
3807
3828
|
return created;
|
|
3808
3829
|
}
|
|
3830
|
+
function cloneSequenceState(state) {
|
|
3831
|
+
return {
|
|
3832
|
+
counters: [...state.counters],
|
|
3833
|
+
lastLevel: state.lastLevel
|
|
3834
|
+
};
|
|
3835
|
+
}
|
|
3809
3836
|
function advanceSequence(state, currentLevel, levelDefinitions) {
|
|
3810
3837
|
for (let level = currentLevel + 1; level < state.counters.length; level += 1) {
|
|
3811
3838
|
if (shouldResetDeeperLevel(level, currentLevel, levelDefinitions)) {
|
|
@@ -3837,6 +3864,25 @@ function shouldResetDeeperLevel(level, triggeringLevel, levelDefinitions) {
|
|
|
3837
3864
|
function getLevelStartAt(level, levelDefinitions) {
|
|
3838
3865
|
return levelDefinitions.get(level)?.startAt ?? DEFAULT_NUMBERING_START_AT;
|
|
3839
3866
|
}
|
|
3867
|
+
function getNumberingFormatPosture(format, value) {
|
|
3868
|
+
if (!isSupportedNumberingFormat(format)) {
|
|
3869
|
+
return {
|
|
3870
|
+
status: "approximated",
|
|
3871
|
+
requestedFormat: format,
|
|
3872
|
+
renderedFormat: "decimal",
|
|
3873
|
+
reason: "unsupported-numbering-format-decimal-fallback"
|
|
3874
|
+
};
|
|
3875
|
+
}
|
|
3876
|
+
if (value !== void 0 && ((format === "upperRoman" || format === "lowerRoman") && (value <= 0 || value >= 4e3) || (format === "cardinalText" || format === "ordinalText") && (!Number.isInteger(value) || value < 1 || value > 999) || (format === "upperLetter" || format === "lowerLetter" || format === "chicago") && value < 1)) {
|
|
3877
|
+
return {
|
|
3878
|
+
status: "approximated",
|
|
3879
|
+
requestedFormat: format,
|
|
3880
|
+
renderedFormat: "decimal",
|
|
3881
|
+
reason: "numbering-format-range-decimal-fallback"
|
|
3882
|
+
};
|
|
3883
|
+
}
|
|
3884
|
+
return void 0;
|
|
3885
|
+
}
|
|
3840
3886
|
function renderLevelText(text, counters, levelDefinitions) {
|
|
3841
3887
|
if (!text) {
|
|
3842
3888
|
return null;
|
|
@@ -4679,6 +4725,7 @@ function toNumberingLayoutInput(numbering) {
|
|
|
4679
4725
|
associatedTabStops: toLayoutTabStops(numbering.geometry.tabStops, "numbering"),
|
|
4680
4726
|
level: numbering.level,
|
|
4681
4727
|
format: numbering.format,
|
|
4728
|
+
...numbering.formatPosture !== void 0 ? { formatPosture: { ...numbering.formatPosture } } : {},
|
|
4682
4729
|
startAt: numbering.startAt,
|
|
4683
4730
|
...numbering.isLegalNumbering ? { isLegalNumbering: true } : {},
|
|
4684
4731
|
...numbering.picBulletMediaId ? { pictureBulletMediaId: numbering.picBulletMediaId } : {}
|
|
@@ -4908,13 +4955,10 @@ var FormattingContextImpl = class {
|
|
|
4908
4955
|
const effectiveNumbering = this.resolveEffectiveParagraphNumbering(para);
|
|
4909
4956
|
if (!effectiveNumbering) return null;
|
|
4910
4957
|
if (!emitGeometry) {
|
|
4911
|
-
|
|
4958
|
+
this.numbering.resolve(effectiveNumbering, { advance });
|
|
4912
4959
|
return null;
|
|
4913
4960
|
}
|
|
4914
|
-
|
|
4915
|
-
console.warn("[formatting-context] resolveParagraphNumbering({advance:false}) is not supported; counter always advances");
|
|
4916
|
-
}
|
|
4917
|
-
return this.numbering.resolveDetailed(effectiveNumbering, para);
|
|
4961
|
+
return this.numbering.resolveDetailed(effectiveNumbering, para, { advance });
|
|
4918
4962
|
}
|
|
4919
4963
|
resolveNumberingLayoutInput(para, options = {}) {
|
|
4920
4964
|
return toNumberingLayoutInput(this.resolveParagraphNumbering(para, options));
|
|
@@ -7109,6 +7153,7 @@ function toSurfaceResolvedNumbering(numbering) {
|
|
|
7109
7153
|
return {
|
|
7110
7154
|
level: numbering.level,
|
|
7111
7155
|
format: numbering.format,
|
|
7156
|
+
...numbering.formatPosture !== void 0 ? { formatPosture: { ...numbering.formatPosture } } : {},
|
|
7112
7157
|
...numbering.text !== null ? { text: numbering.text } : {},
|
|
7113
7158
|
startAt: numbering.startAt,
|
|
7114
7159
|
...numbering.paragraphStyleId ? { paragraphStyleId: numbering.paragraphStyleId } : {},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as CanonicalDocumentEnvelope, S as SelectionSnapshot, g as TransactionMapping } from '../../public-types-
|
|
1
|
+
import { C as CanonicalDocumentEnvelope, S as SelectionSnapshot, g as TransactionMapping } from '../../public-types-BP3vqJR5.cjs';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
import 'y-protocols/awareness';
|
|
5
|
-
import '../../canonical-document-
|
|
5
|
+
import '../../canonical-document-CXCFCbAz.cjs';
|
|
6
6
|
import 'prosemirror-state';
|
|
7
7
|
import 'prosemirror-model';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as CanonicalDocumentEnvelope, S as SelectionSnapshot, g as TransactionMapping } from '../../public-types-
|
|
1
|
+
import { C as CanonicalDocumentEnvelope, S as SelectionSnapshot, g as TransactionMapping } from '../../public-types-DdcHqcow.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
import 'y-protocols/awareness';
|
|
5
|
-
import '../../canonical-document-
|
|
5
|
+
import '../../canonical-document-CXCFCbAz.js';
|
|
6
6
|
import 'prosemirror-state';
|
|
7
7
|
import 'prosemirror-model';
|
|
8
8
|
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
insertImage,
|
|
3
3
|
repositionFloatingImage,
|
|
4
4
|
resizeImage
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-6F5QW44A.js";
|
|
6
|
+
import "../../chunk-KV435YXO.js";
|
|
7
|
+
import "../../chunk-BYSRJ4FE.js";
|
|
8
8
|
import "../../chunk-QIO6V46H.js";
|
|
9
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-CXSYRB37.js";
|
|
10
10
|
import "../../chunk-OYGMRRR7.js";
|
|
11
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-5DGKFNQT.js";
|
|
12
12
|
import "../../chunk-UFVDIR2C.js";
|
|
13
13
|
import "../../chunk-PGGPPZ65.js";
|
|
14
14
|
import "../../chunk-DNXYUIIS.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as SelectionSnapshot, M as MarginPresetDefinition, i as PageFormatDefinition, R as RuntimeRenderSnapshot } from '../../public-types-
|
|
2
|
-
import { C as CanonicalDocument, P as PageSize, a as PageMargins, b as ColumnProperties, c as PageNumbering } from '../../canonical-document-
|
|
1
|
+
import { h as SelectionSnapshot, M as MarginPresetDefinition, i as PageFormatDefinition, R as RuntimeRenderSnapshot } from '../../public-types-BP3vqJR5.cjs';
|
|
2
|
+
import { C as CanonicalDocument, P as PageSize, a as PageMargins, b as ColumnProperties, c as PageNumbering } from '../../canonical-document-CXCFCbAz.cjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'yjs';
|
|
5
5
|
import 'y-protocols/awareness';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as SelectionSnapshot, M as MarginPresetDefinition, i as PageFormatDefinition, R as RuntimeRenderSnapshot } from '../../public-types-
|
|
2
|
-
import { C as CanonicalDocument, P as PageSize, a as PageMargins, b as ColumnProperties, c as PageNumbering } from '../../canonical-document-
|
|
1
|
+
import { h as SelectionSnapshot, M as MarginPresetDefinition, i as PageFormatDefinition, R as RuntimeRenderSnapshot } from '../../public-types-DdcHqcow.js';
|
|
2
|
+
import { C as CanonicalDocument, P as PageSize, a as PageMargins, b as ColumnProperties, c as PageNumbering } from '../../canonical-document-CXCFCbAz.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'yjs';
|
|
5
5
|
import 'y-protocols/awareness';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as PersistedEditorSnapshot, R as RuntimeRenderSnapshot } from '../../public-types-
|
|
1
|
+
import { P as PersistedEditorSnapshot, R as RuntimeRenderSnapshot } from '../../public-types-BP3vqJR5.cjs';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
import 'y-protocols/awareness';
|
|
5
|
-
import '../../canonical-document-
|
|
5
|
+
import '../../canonical-document-CXCFCbAz.cjs';
|
|
6
6
|
import 'prosemirror-state';
|
|
7
7
|
import 'prosemirror-model';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as PersistedEditorSnapshot, R as RuntimeRenderSnapshot } from '../../public-types-
|
|
1
|
+
import { P as PersistedEditorSnapshot, R as RuntimeRenderSnapshot } from '../../public-types-DdcHqcow.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
import 'y-protocols/awareness';
|
|
5
|
-
import '../../canonical-document-
|
|
5
|
+
import '../../canonical-document-CXCFCbAz.js';
|
|
6
6
|
import 'prosemirror-state';
|
|
7
7
|
import 'prosemirror-model';
|
|
8
8
|
|
|
@@ -870,7 +870,7 @@ function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, tar
|
|
|
870
870
|
context: { storyKey, insideSdt: contentControl !== void 0 },
|
|
871
871
|
...tableTarget
|
|
872
872
|
}) : void 0;
|
|
873
|
-
const listAddress =
|
|
873
|
+
const listAddress = paragraph.numbering !== void 0 ? createCanonicalAddress({
|
|
874
874
|
addressKind: "list-item-text",
|
|
875
875
|
storyKey,
|
|
876
876
|
staleCheckKind: "paragraph",
|
|
@@ -904,6 +904,7 @@ function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, tar
|
|
|
904
904
|
...contentControl !== void 0 ? { contentControl } : {},
|
|
905
905
|
...tableIdentity !== void 0 ? { table: tableIdentity } : {},
|
|
906
906
|
...editableOwner !== void 0 ? { editableOwner } : {},
|
|
907
|
+
...listAddress !== void 0 ? { listAddress } : {},
|
|
907
908
|
...tableIdentity !== void 0 ? {
|
|
908
909
|
canonicalAddress: createTableTargetCanonicalAddress(
|
|
909
910
|
tableIdentity,
|
|
@@ -3163,6 +3164,7 @@ function mergeLevelDefinition(base, override, startOverride, fallbackLevel) {
|
|
|
3163
3164
|
);
|
|
3164
3165
|
const runProperties = override?.runProperties ?? base?.runProperties;
|
|
3165
3166
|
const restartAfterLevel = override?.restartAfterLevel ?? base?.restartAfterLevel;
|
|
3167
|
+
const picBulletId = override?.picBulletId ?? base?.picBulletId;
|
|
3166
3168
|
return {
|
|
3167
3169
|
level,
|
|
3168
3170
|
format,
|
|
@@ -3173,7 +3175,8 @@ function mergeLevelDefinition(base, override, startOverride, fallbackLevel) {
|
|
|
3173
3175
|
...override?.suffix ?? base?.suffix ? { suffix: override?.suffix ?? base?.suffix } : {},
|
|
3174
3176
|
...paragraphGeometry ? { paragraphGeometry } : {},
|
|
3175
3177
|
...runProperties ? { runProperties } : {},
|
|
3176
|
-
...restartAfterLevel !== void 0 ? { restartAfterLevel } : {}
|
|
3178
|
+
...restartAfterLevel !== void 0 ? { restartAfterLevel } : {},
|
|
3179
|
+
...picBulletId !== void 0 ? { picBulletId } : {}
|
|
3177
3180
|
};
|
|
3178
3181
|
}
|
|
3179
3182
|
function withDefaultStartAt(level) {
|
|
@@ -3301,7 +3304,7 @@ function resolveHangingWidth(indentation) {
|
|
|
3301
3304
|
// src/runtime/formatting/numbering/prefix.ts
|
|
3302
3305
|
function createNumberingPrefixResolver(catalog) {
|
|
3303
3306
|
const sequenceStates = /* @__PURE__ */ new Map();
|
|
3304
|
-
function resolveInternal(numbering, paragraph) {
|
|
3307
|
+
function resolveInternal(numbering, paragraph, options = {}) {
|
|
3305
3308
|
const resolved = resolveNumberingDefinitionSet(
|
|
3306
3309
|
catalog,
|
|
3307
3310
|
paragraph?.numbering ?? numbering,
|
|
@@ -3314,29 +3317,44 @@ function createNumberingPrefixResolver(catalog) {
|
|
|
3314
3317
|
if (!resolvedNumbering) {
|
|
3315
3318
|
return null;
|
|
3316
3319
|
}
|
|
3317
|
-
const
|
|
3318
|
-
|
|
3320
|
+
const advance = options.advance !== false;
|
|
3321
|
+
const sequenceState = getSequenceState(
|
|
3322
|
+
sequenceStates,
|
|
3323
|
+
resolvedNumbering.numberingInstanceId,
|
|
3324
|
+
{ create: advance }
|
|
3325
|
+
);
|
|
3326
|
+
if (!sequenceState) {
|
|
3327
|
+
return null;
|
|
3328
|
+
}
|
|
3329
|
+
const workingState = advance ? sequenceState : cloneSequenceState(sequenceState);
|
|
3330
|
+
advanceSequence(workingState, resolved.effectiveLevel.level, resolved.effectiveLevels);
|
|
3331
|
+
const currentCounter = workingState.counters[resolved.effectiveLevel.level];
|
|
3319
3332
|
const effectiveLevelDefs = resolved.effectiveLevel.isLegalNumbering ? new Map(
|
|
3320
3333
|
Array.from(resolved.effectiveLevels.entries()).map(([level, definition]) => [
|
|
3321
3334
|
level,
|
|
3322
3335
|
{ ...definition, format: "decimal" }
|
|
3323
3336
|
])
|
|
3324
3337
|
) : resolved.effectiveLevels;
|
|
3338
|
+
const picBulletId = resolved.effectiveLevel.picBulletId;
|
|
3325
3339
|
const text = renderLevelText(
|
|
3326
3340
|
resolved.effectiveLevel.text,
|
|
3327
|
-
|
|
3341
|
+
workingState.counters,
|
|
3328
3342
|
effectiveLevelDefs
|
|
3329
3343
|
);
|
|
3330
|
-
if (resolved.effectiveLevel.format !== "none" && text === null) {
|
|
3344
|
+
if (picBulletId == null && resolved.effectiveLevel.format !== "none" && text === null) {
|
|
3331
3345
|
return null;
|
|
3332
3346
|
}
|
|
3333
3347
|
const visibleText = resolved.effectiveLevel.format === "none" ? null : text;
|
|
3334
|
-
const
|
|
3348
|
+
const formatPosture = getNumberingFormatPosture(
|
|
3349
|
+
resolved.effectiveLevel.format,
|
|
3350
|
+
currentCounter
|
|
3351
|
+
);
|
|
3335
3352
|
const picBulletMediaId = picBulletId != null ? catalog.numPicBullets?.[picBulletId]?.mediaId : void 0;
|
|
3336
3353
|
return {
|
|
3337
3354
|
text: visibleText,
|
|
3338
3355
|
level: resolved.effectiveLevel.level,
|
|
3339
3356
|
format: resolved.effectiveLevel.format,
|
|
3357
|
+
...formatPosture !== void 0 ? { formatPosture } : {},
|
|
3340
3358
|
startAt: resolved.effectiveLevel.startAt ?? DEFAULT_NUMBERING_START_AT,
|
|
3341
3359
|
...resolved.effectiveLevel.suffix ? { suffix: resolved.effectiveLevel.suffix } : {},
|
|
3342
3360
|
...resolved.effectiveLevel.paragraphStyleId ? { paragraphStyleId: resolved.effectiveLevel.paragraphStyleId } : {},
|
|
@@ -3347,23 +3365,26 @@ function createNumberingPrefixResolver(catalog) {
|
|
|
3347
3365
|
};
|
|
3348
3366
|
}
|
|
3349
3367
|
return {
|
|
3350
|
-
resolve(numbering) {
|
|
3351
|
-
const result = resolveInternal(numbering);
|
|
3368
|
+
resolve(numbering, options) {
|
|
3369
|
+
const result = resolveInternal(numbering, void 0, options);
|
|
3352
3370
|
return result?.text ?? null;
|
|
3353
3371
|
},
|
|
3354
|
-
resolveDetailed(numbering, paragraph) {
|
|
3355
|
-
return resolveInternal(numbering, paragraph);
|
|
3372
|
+
resolveDetailed(numbering, paragraph, options) {
|
|
3373
|
+
return resolveInternal(numbering, paragraph, options);
|
|
3356
3374
|
},
|
|
3357
|
-
resolveParagraph(paragraph) {
|
|
3358
|
-
return resolveInternal(paragraph.numbering, paragraph);
|
|
3375
|
+
resolveParagraph(paragraph, options) {
|
|
3376
|
+
return resolveInternal(paragraph.numbering, paragraph, options);
|
|
3359
3377
|
}
|
|
3360
3378
|
};
|
|
3361
3379
|
}
|
|
3362
|
-
function getSequenceState(states, numberingInstanceId) {
|
|
3380
|
+
function getSequenceState(states, numberingInstanceId, options = { create: true }) {
|
|
3363
3381
|
const existing = states.get(numberingInstanceId);
|
|
3364
3382
|
if (existing) {
|
|
3365
3383
|
return existing;
|
|
3366
3384
|
}
|
|
3385
|
+
if (options.create === false) {
|
|
3386
|
+
return { counters: [], lastLevel: null };
|
|
3387
|
+
}
|
|
3367
3388
|
const created = {
|
|
3368
3389
|
counters: [],
|
|
3369
3390
|
lastLevel: null
|
|
@@ -3371,6 +3392,12 @@ function getSequenceState(states, numberingInstanceId) {
|
|
|
3371
3392
|
states.set(numberingInstanceId, created);
|
|
3372
3393
|
return created;
|
|
3373
3394
|
}
|
|
3395
|
+
function cloneSequenceState(state) {
|
|
3396
|
+
return {
|
|
3397
|
+
counters: [...state.counters],
|
|
3398
|
+
lastLevel: state.lastLevel
|
|
3399
|
+
};
|
|
3400
|
+
}
|
|
3374
3401
|
function advanceSequence(state, currentLevel, levelDefinitions) {
|
|
3375
3402
|
for (let level = currentLevel + 1; level < state.counters.length; level += 1) {
|
|
3376
3403
|
if (shouldResetDeeperLevel(level, currentLevel, levelDefinitions)) {
|
|
@@ -3402,6 +3429,25 @@ function shouldResetDeeperLevel(level, triggeringLevel, levelDefinitions) {
|
|
|
3402
3429
|
function getLevelStartAt(level, levelDefinitions) {
|
|
3403
3430
|
return levelDefinitions.get(level)?.startAt ?? DEFAULT_NUMBERING_START_AT;
|
|
3404
3431
|
}
|
|
3432
|
+
function getNumberingFormatPosture(format, value) {
|
|
3433
|
+
if (!isSupportedNumberingFormat(format)) {
|
|
3434
|
+
return {
|
|
3435
|
+
status: "approximated",
|
|
3436
|
+
requestedFormat: format,
|
|
3437
|
+
renderedFormat: "decimal",
|
|
3438
|
+
reason: "unsupported-numbering-format-decimal-fallback"
|
|
3439
|
+
};
|
|
3440
|
+
}
|
|
3441
|
+
if (value !== void 0 && ((format === "upperRoman" || format === "lowerRoman") && (value <= 0 || value >= 4e3) || (format === "cardinalText" || format === "ordinalText") && (!Number.isInteger(value) || value < 1 || value > 999) || (format === "upperLetter" || format === "lowerLetter" || format === "chicago") && value < 1)) {
|
|
3442
|
+
return {
|
|
3443
|
+
status: "approximated",
|
|
3444
|
+
requestedFormat: format,
|
|
3445
|
+
renderedFormat: "decimal",
|
|
3446
|
+
reason: "numbering-format-range-decimal-fallback"
|
|
3447
|
+
};
|
|
3448
|
+
}
|
|
3449
|
+
return void 0;
|
|
3450
|
+
}
|
|
3405
3451
|
function renderLevelText(text, counters, levelDefinitions) {
|
|
3406
3452
|
if (!text) {
|
|
3407
3453
|
return null;
|
|
@@ -4244,6 +4290,7 @@ function toNumberingLayoutInput(numbering) {
|
|
|
4244
4290
|
associatedTabStops: toLayoutTabStops(numbering.geometry.tabStops, "numbering"),
|
|
4245
4291
|
level: numbering.level,
|
|
4246
4292
|
format: numbering.format,
|
|
4293
|
+
...numbering.formatPosture !== void 0 ? { formatPosture: { ...numbering.formatPosture } } : {},
|
|
4247
4294
|
startAt: numbering.startAt,
|
|
4248
4295
|
...numbering.isLegalNumbering ? { isLegalNumbering: true } : {},
|
|
4249
4296
|
...numbering.picBulletMediaId ? { pictureBulletMediaId: numbering.picBulletMediaId } : {}
|
|
@@ -4473,13 +4520,10 @@ var FormattingContextImpl = class {
|
|
|
4473
4520
|
const effectiveNumbering = this.resolveEffectiveParagraphNumbering(para);
|
|
4474
4521
|
if (!effectiveNumbering) return null;
|
|
4475
4522
|
if (!emitGeometry) {
|
|
4476
|
-
|
|
4523
|
+
this.numbering.resolve(effectiveNumbering, { advance });
|
|
4477
4524
|
return null;
|
|
4478
4525
|
}
|
|
4479
|
-
|
|
4480
|
-
console.warn("[formatting-context] resolveParagraphNumbering({advance:false}) is not supported; counter always advances");
|
|
4481
|
-
}
|
|
4482
|
-
return this.numbering.resolveDetailed(effectiveNumbering, para);
|
|
4526
|
+
return this.numbering.resolveDetailed(effectiveNumbering, para, { advance });
|
|
4483
4527
|
}
|
|
4484
4528
|
resolveNumberingLayoutInput(para, options = {}) {
|
|
4485
4529
|
return toNumberingLayoutInput(this.resolveParagraphNumbering(para, options));
|
|
@@ -6673,6 +6717,7 @@ function toSurfaceResolvedNumbering(numbering) {
|
|
|
6673
6717
|
return {
|
|
6674
6718
|
level: numbering.level,
|
|
6675
6719
|
format: numbering.format,
|
|
6720
|
+
...numbering.formatPosture !== void 0 ? { formatPosture: { ...numbering.formatPosture } } : {},
|
|
6676
6721
|
...numbering.text !== null ? { text: numbering.text } : {},
|
|
6677
6722
|
startAt: numbering.startAt,
|
|
6678
6723
|
...numbering.paragraphStyleId ? { paragraphStyleId: numbering.paragraphStyleId } : {},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { gr as CellLocator, gs as TableStructureOperation, gt as applyTableStructureOperation, gu as applyTableStructureOperationForEditableTarget, gv as getTableStructureContext, gw as removeCellFromRow, gx as removeTableRowPure, gy as tableStructureActionHandleForTarget } from '../../public-types-
|
|
2
|
-
import '../../canonical-document-
|
|
1
|
+
export { gr as CellLocator, gs as TableStructureOperation, gt as applyTableStructureOperation, gu as applyTableStructureOperationForEditableTarget, gv as getTableStructureContext, gw as removeCellFromRow, gx as removeTableRowPure, gy as tableStructureActionHandleForTarget } from '../../public-types-BP3vqJR5.cjs';
|
|
2
|
+
import '../../canonical-document-CXCFCbAz.cjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'yjs';
|
|
5
5
|
import 'y-protocols/awareness';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { gr as CellLocator, gs as TableStructureOperation, gt as applyTableStructureOperation, gu as applyTableStructureOperationForEditableTarget, gv as getTableStructureContext, gw as removeCellFromRow, gx as removeTableRowPure, gy as tableStructureActionHandleForTarget } from '../../public-types-
|
|
2
|
-
import '../../canonical-document-
|
|
1
|
+
export { gr as CellLocator, gs as TableStructureOperation, gt as applyTableStructureOperation, gu as applyTableStructureOperationForEditableTarget, gv as getTableStructureContext, gw as removeCellFromRow, gx as removeTableRowPure, gy as tableStructureActionHandleForTarget } from '../../public-types-DdcHqcow.js';
|
|
2
|
+
import '../../canonical-document-CXCFCbAz.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'yjs';
|
|
5
5
|
import 'y-protocols/awareness';
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
removeCellFromRow,
|
|
6
6
|
removeTableRowPure,
|
|
7
7
|
tableStructureActionHandleForTarget
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
8
|
+
} from "../../chunk-ZDOAUP3V.js";
|
|
9
|
+
import "../../chunk-BYSRJ4FE.js";
|
|
10
|
+
import "../../chunk-CXSYRB37.js";
|
|
11
11
|
import "../../chunk-OYGMRRR7.js";
|
|
12
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-5DGKFNQT.js";
|
|
13
13
|
import "../../chunk-UFVDIR2C.js";
|
|
14
14
|
import "../../chunk-PGGPPZ65.js";
|
|
15
15
|
import "../../chunk-DNXYUIIS.js";
|