@beyondwork/docx-react-component 1.0.128 → 1.0.129
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 +215 -61
- 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 +896 -71
- package/dist/api/v3.d.cts +3 -3
- package/dist/api/v3.d.ts +3 -3
- package/dist/api/v3.js +8 -8
- package/dist/{canonical-document-CXCFCbAz.d.cts → canonical-document-BMtONpgf.d.cts} +6 -0
- package/dist/{canonical-document-CXCFCbAz.d.ts → canonical-document-BMtONpgf.d.ts} +6 -0
- package/dist/{chunk-KV435YXO.js → chunk-5DSHUYSY.js} +1 -1
- package/dist/{chunk-TQDQU2E3.js → chunk-63FYIGCT.js} +2 -2
- package/dist/{chunk-ZDOAUP3V.js → chunk-DDN2AIGE.js} +1 -1
- package/dist/{chunk-6F5QW44A.js → chunk-DJU2W4E4.js} +2 -2
- package/dist/{chunk-4EENH4FG.js → chunk-EZKJXIPH.js} +1 -1
- package/dist/{chunk-CXSYRB37.js → chunk-HUIHBBAQ.js} +166 -49
- package/dist/{chunk-ESJ2MES5.js → chunk-JJGVE5J7.js} +1 -1
- package/dist/{chunk-LZVBNDGU.js → chunk-LJH64PV3.js} +3 -3
- package/dist/{chunk-MWSBGJQO.js → chunk-OTQIW2TC.js} +2 -2
- package/dist/{chunk-2QL5DAKF.js → chunk-PGKUJZXV.js} +3 -3
- package/dist/{chunk-6EROGFUF.js → chunk-PRAZBHNF.js} +441 -128
- package/dist/{chunk-4YJVRIUB.js → chunk-Q3QYGKFE.js} +51 -8
- package/dist/{chunk-YHZHPXDB.js → chunk-RMRTQGW3.js} +50 -13
- package/dist/{chunk-XRACP43Q.js → chunk-SKPTKQHF.js} +351 -13
- package/dist/{chunk-D5HYZQTG.js → chunk-VNLDQJ47.js} +1 -1
- package/dist/{chunk-BYSRJ4FE.js → chunk-W34X3KBR.js} +1 -1
- package/dist/{chunk-V6XVZFFH.js → chunk-XMHSGPLN.js} +2 -2
- package/dist/{chunk-LCYYR57Q.js → chunk-XQCAMKIQ.js} +421 -6
- package/dist/{chunk-YD2JE54B.js → chunk-YZDZ4FGR.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 +166 -49
- 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 +166 -49
- 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 +166 -49
- 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 +1486 -211
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +46 -22
- package/dist/io/docx-session.cjs +51 -8
- package/dist/io/docx-session.d.cts +4 -4
- package/dist/io/docx-session.d.ts +4 -4
- package/dist/io/docx-session.js +3 -3
- package/dist/legal.d.cts +1 -1
- package/dist/legal.d.ts +1 -1
- package/dist/legal.js +2 -2
- package/dist/{loader-19ct2Be0.d.ts → loader-4qsw4eIU.d.ts} +3 -3
- package/dist/{loader-CoXQ2wGd.d.cts → loader-B8TKhmQi.d.cts} +3 -3
- package/dist/{public-types-B-CskQen.d.cts → public-types-B5CRoR6f.d.cts} +128 -1
- package/dist/{public-types-7KZsNGE2.d.ts → public-types-p9b8rfy8.d.ts} +128 -1
- package/dist/public-types.cjs +215 -61
- 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 +980 -185
- package/dist/runtime/document-runtime.d.cts +2 -2
- package/dist/runtime/document-runtime.d.ts +2 -2
- package/dist/runtime/document-runtime.js +13 -13
- package/dist/{session-B5015J4v.d.cts → session-BnGIjaex.d.cts} +3 -3
- package/dist/{session-C2i8-d6v.d.ts → session-vEYKf-w3.d.ts} +3 -3
- package/dist/session.cjs +51 -8
- package/dist/session.d.cts +5 -5
- package/dist/session.d.ts +5 -5
- package/dist/session.js +4 -4
- package/dist/tailwind.cjs +215 -61
- package/dist/tailwind.d.cts +2 -2
- package/dist/tailwind.d.ts +2 -2
- package/dist/tailwind.js +5 -5
- package/dist/{types-DNhN0WeN.d.cts → types-BLuvZ6cQ.d.cts} +2 -2
- package/dist/{types-yvrQuGX9.d.ts → types-Dutlyj0T.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 +3 -3
- package/dist/ui-tailwind.cjs +215 -61
- 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
|
@@ -3865,12 +3865,13 @@ function getLevelStartAt(level, levelDefinitions) {
|
|
|
3865
3865
|
return levelDefinitions.get(level)?.startAt ?? DEFAULT_NUMBERING_START_AT;
|
|
3866
3866
|
}
|
|
3867
3867
|
function getNumberingFormatPosture(format, value) {
|
|
3868
|
-
|
|
3868
|
+
const registryEntry = getNumberingFormatRegistryEntry(format);
|
|
3869
|
+
if (!registryEntry || registryEntry.renderSupport === "approximated") {
|
|
3869
3870
|
return {
|
|
3870
3871
|
status: "approximated",
|
|
3871
3872
|
requestedFormat: format,
|
|
3872
3873
|
renderedFormat: "decimal",
|
|
3873
|
-
reason: "unsupported-numbering-format-decimal-fallback"
|
|
3874
|
+
reason: registryEntry?.fallbackReason ?? "unsupported-numbering-format-decimal-fallback"
|
|
3874
3875
|
};
|
|
3875
3876
|
}
|
|
3876
3877
|
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)) {
|
|
@@ -3901,56 +3902,148 @@ function renderLevelText(text, counters, levelDefinitions) {
|
|
|
3901
3902
|
});
|
|
3902
3903
|
return rendered.trim().length > 0 ? rendered : null;
|
|
3903
3904
|
}
|
|
3904
|
-
var SUPPORTED_NUMBERING_FORMATS = /* @__PURE__ */ new Set([
|
|
3905
|
-
"decimal",
|
|
3906
|
-
"decimalZero",
|
|
3907
|
-
"upperLetter",
|
|
3908
|
-
"lowerLetter",
|
|
3909
|
-
"upperRoman",
|
|
3910
|
-
"lowerRoman",
|
|
3911
|
-
"hex",
|
|
3912
|
-
"ordinal",
|
|
3913
|
-
"cardinalText",
|
|
3914
|
-
"ordinalText",
|
|
3915
|
-
"chicago",
|
|
3916
|
-
"bullet",
|
|
3917
|
-
"none"
|
|
3918
|
-
]);
|
|
3919
3905
|
function isSupportedNumberingFormat(format) {
|
|
3920
|
-
return
|
|
3906
|
+
return getNumberingFormatRegistryEntry(format)?.renderSupport === "supported";
|
|
3907
|
+
}
|
|
3908
|
+
function getNumberingFormatRegistryEntry(format) {
|
|
3909
|
+
return NUMBERING_FORMAT_REGISTRY.get(format);
|
|
3921
3910
|
}
|
|
3922
3911
|
function formatCounter(value, format) {
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3912
|
+
return getNumberingFormatRegistryEntry(format)?.render(value) ?? String(value);
|
|
3913
|
+
}
|
|
3914
|
+
var exactNumberingFormatEntries = [
|
|
3915
|
+
{
|
|
3916
|
+
format: "decimal",
|
|
3917
|
+
renderSupport: "supported",
|
|
3918
|
+
renderedFormat: "decimal",
|
|
3919
|
+
supportsMutation: true,
|
|
3920
|
+
render: (value) => String(value)
|
|
3921
|
+
},
|
|
3922
|
+
{
|
|
3923
|
+
format: "decimalZero",
|
|
3924
|
+
renderSupport: "supported",
|
|
3925
|
+
renderedFormat: "decimalZero",
|
|
3926
|
+
supportsMutation: true,
|
|
3927
|
+
render: (value) => String(value).padStart(2, "0")
|
|
3928
|
+
},
|
|
3929
|
+
{
|
|
3930
|
+
format: "upperLetter",
|
|
3931
|
+
renderSupport: "supported",
|
|
3932
|
+
renderedFormat: "upperLetter",
|
|
3933
|
+
supportsMutation: true,
|
|
3934
|
+
render: (value) => toAlphabetic2(value).toUpperCase()
|
|
3935
|
+
},
|
|
3936
|
+
{
|
|
3937
|
+
format: "lowerLetter",
|
|
3938
|
+
renderSupport: "supported",
|
|
3939
|
+
renderedFormat: "lowerLetter",
|
|
3940
|
+
supportsMutation: true,
|
|
3941
|
+
render: (value) => toAlphabetic2(value).toLowerCase()
|
|
3942
|
+
},
|
|
3943
|
+
{
|
|
3944
|
+
format: "upperRoman",
|
|
3945
|
+
renderSupport: "supported",
|
|
3946
|
+
renderedFormat: "upperRoman",
|
|
3947
|
+
supportsMutation: true,
|
|
3948
|
+
render: (value) => toRoman2(value).toUpperCase()
|
|
3949
|
+
},
|
|
3950
|
+
{
|
|
3951
|
+
format: "lowerRoman",
|
|
3952
|
+
renderSupport: "supported",
|
|
3953
|
+
renderedFormat: "lowerRoman",
|
|
3954
|
+
supportsMutation: true,
|
|
3955
|
+
render: (value) => toRoman2(value).toLowerCase()
|
|
3956
|
+
},
|
|
3957
|
+
{
|
|
3958
|
+
format: "hex",
|
|
3959
|
+
renderSupport: "supported",
|
|
3960
|
+
renderedFormat: "hex",
|
|
3961
|
+
supportsMutation: true,
|
|
3962
|
+
render: (value) => value >= 0 ? value.toString(16).toUpperCase() : String(value)
|
|
3963
|
+
},
|
|
3964
|
+
{
|
|
3965
|
+
format: "ordinal",
|
|
3966
|
+
renderSupport: "supported",
|
|
3967
|
+
renderedFormat: "ordinal",
|
|
3968
|
+
supportsMutation: true,
|
|
3969
|
+
render: toOrdinal2
|
|
3970
|
+
},
|
|
3971
|
+
{
|
|
3972
|
+
format: "cardinalText",
|
|
3973
|
+
renderSupport: "supported",
|
|
3974
|
+
renderedFormat: "cardinalText",
|
|
3975
|
+
supportsMutation: true,
|
|
3976
|
+
render: toCardinalText2
|
|
3977
|
+
},
|
|
3978
|
+
{
|
|
3979
|
+
format: "ordinalText",
|
|
3980
|
+
renderSupport: "supported",
|
|
3981
|
+
renderedFormat: "ordinalText",
|
|
3982
|
+
supportsMutation: true,
|
|
3983
|
+
render: toOrdinalText2
|
|
3984
|
+
},
|
|
3985
|
+
{
|
|
3986
|
+
format: "chicago",
|
|
3987
|
+
renderSupport: "supported",
|
|
3988
|
+
renderedFormat: "chicago",
|
|
3989
|
+
supportsMutation: true,
|
|
3990
|
+
render: toChicago2
|
|
3991
|
+
},
|
|
3992
|
+
{
|
|
3993
|
+
format: "bullet",
|
|
3994
|
+
renderSupport: "supported",
|
|
3995
|
+
renderedFormat: "bullet",
|
|
3996
|
+
supportsMutation: true,
|
|
3997
|
+
render: () => ""
|
|
3998
|
+
},
|
|
3999
|
+
{
|
|
4000
|
+
format: "none",
|
|
4001
|
+
renderSupport: "supported",
|
|
4002
|
+
renderedFormat: "none",
|
|
4003
|
+
supportsMutation: true,
|
|
4004
|
+
render: () => ""
|
|
3952
4005
|
}
|
|
3953
|
-
|
|
4006
|
+
];
|
|
4007
|
+
var approximatedDecimalFormats = [
|
|
4008
|
+
"decimalEnclosedCircle",
|
|
4009
|
+
"decimalEnclosedFullstop",
|
|
4010
|
+
"decimalEnclosedParen",
|
|
4011
|
+
"decimalFullWidth",
|
|
4012
|
+
"decimalHalfWidth",
|
|
4013
|
+
"aiueo",
|
|
4014
|
+
"iroha",
|
|
4015
|
+
"ganada",
|
|
4016
|
+
"chosung",
|
|
4017
|
+
"russianLower",
|
|
4018
|
+
"russianUpper",
|
|
4019
|
+
"hebrew1",
|
|
4020
|
+
"hebrew2",
|
|
4021
|
+
"arabicAlpha",
|
|
4022
|
+
"arabicAbjad",
|
|
4023
|
+
"thaiLetters",
|
|
4024
|
+
"thaiNumbers",
|
|
4025
|
+
"hindiLetters",
|
|
4026
|
+
"hindiNumbers",
|
|
4027
|
+
"ideographDigital",
|
|
4028
|
+
"ideographTraditional",
|
|
4029
|
+
"chineseCounting",
|
|
4030
|
+
"japaneseCounting",
|
|
4031
|
+
"japaneseLegal"
|
|
4032
|
+
];
|
|
4033
|
+
var approximatedNumberingFormatEntries = approximatedDecimalFormats.map((format) => ({
|
|
4034
|
+
format,
|
|
4035
|
+
renderSupport: "approximated",
|
|
4036
|
+
renderedFormat: "decimal",
|
|
4037
|
+
supportsMutation: false,
|
|
4038
|
+
fallbackReason: "unsupported-numbering-format-decimal-fallback",
|
|
4039
|
+
render: (value) => String(value)
|
|
4040
|
+
}));
|
|
4041
|
+
var NUMBERING_FORMAT_REGISTRY = new Map(
|
|
4042
|
+
[...exactNumberingFormatEntries, ...approximatedNumberingFormatEntries].map((entry) => [
|
|
4043
|
+
entry.format,
|
|
4044
|
+
entry
|
|
4045
|
+
])
|
|
4046
|
+
);
|
|
3954
4047
|
function toOrdinal2(value) {
|
|
3955
4048
|
if (value <= 0) return String(value);
|
|
3956
4049
|
const lastTwo = value % 100;
|
|
@@ -4604,12 +4697,36 @@ var DEFAULT_HYPERLINK_COLOR_HEX = "0563C1";
|
|
|
4604
4697
|
function resolveHyperlinkRunFormatting(input, catalog, resolver) {
|
|
4605
4698
|
const augmentedInput = input.characterStyleId === void 0 ? { ...input, characterStyleId: HYPERLINK_CHARACTER_STYLE_ID } : input;
|
|
4606
4699
|
const cascade = resolveEffectiveRunFormatting(augmentedInput, catalog);
|
|
4607
|
-
const resolvedColor = resolveHyperlinkColorHex(
|
|
4700
|
+
const resolvedColor = resolveHyperlinkColorHex(
|
|
4701
|
+
stripInheritedColorHexForImplicitHyperlink(input, catalog, cascade),
|
|
4702
|
+
resolver
|
|
4703
|
+
);
|
|
4608
4704
|
if (resolvedColor && resolvedColor !== cascade.colorHex) {
|
|
4609
4705
|
return { ...cascade, colorHex: resolvedColor };
|
|
4610
4706
|
}
|
|
4611
4707
|
return cascade;
|
|
4612
4708
|
}
|
|
4709
|
+
function hasDirectNonAutoColor(input) {
|
|
4710
|
+
return Boolean(input.direct?.colorHex && input.direct.colorHex !== "auto");
|
|
4711
|
+
}
|
|
4712
|
+
function characterStyleDeclaresColorHex(styleId, catalog) {
|
|
4713
|
+
if (!catalog) return false;
|
|
4714
|
+
const chain = resolveCharacterStyleChain(styleId, catalog);
|
|
4715
|
+
return chain.some((chainStyleId) => {
|
|
4716
|
+
const colorHex = catalog.characters[chainStyleId]?.runProperties?.colorHex;
|
|
4717
|
+
return Boolean(colorHex && colorHex !== "auto");
|
|
4718
|
+
});
|
|
4719
|
+
}
|
|
4720
|
+
function stripInheritedColorHexForImplicitHyperlink(originalInput, catalog, cascade) {
|
|
4721
|
+
if (originalInput.characterStyleId !== void 0 || hasDirectNonAutoColor(originalInput) || !cascade.colorHex || cascade.colorHex === "auto" || characterStyleDeclaresColorHex(HYPERLINK_CHARACTER_STYLE_ID, catalog)) {
|
|
4722
|
+
return cascade;
|
|
4723
|
+
}
|
|
4724
|
+
const inheritedCascade = resolveEffectiveRunFormatting(originalInput, catalog);
|
|
4725
|
+
if (inheritedCascade.colorHex !== cascade.colorHex) {
|
|
4726
|
+
return cascade;
|
|
4727
|
+
}
|
|
4728
|
+
return { ...cascade, colorHex: void 0 };
|
|
4729
|
+
}
|
|
4613
4730
|
function resolveHyperlinkColorHex(cascade, resolver) {
|
|
4614
4731
|
if (cascade.colorHex && cascade.colorHex !== "auto") {
|
|
4615
4732
|
return cascade.colorHex;
|
|
@@ -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-B5CRoR6f.cjs';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
import 'y-protocols/awareness';
|
|
5
|
-
import '../../canonical-document-
|
|
5
|
+
import '../../canonical-document-BMtONpgf.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-p9b8rfy8.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
import 'y-protocols/awareness';
|
|
5
|
-
import '../../canonical-document-
|
|
5
|
+
import '../../canonical-document-BMtONpgf.js';
|
|
6
6
|
import 'prosemirror-state';
|
|
7
7
|
import 'prosemirror-model';
|
|
8
8
|
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
insertImage,
|
|
3
3
|
repositionFloatingImage,
|
|
4
4
|
resizeImage
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-DJU2W4E4.js";
|
|
6
|
+
import "../../chunk-5DSHUYSY.js";
|
|
7
|
+
import "../../chunk-W34X3KBR.js";
|
|
8
8
|
import "../../chunk-QIO6V46H.js";
|
|
9
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-HUIHBBAQ.js";
|
|
10
10
|
import "../../chunk-OYGMRRR7.js";
|
|
11
11
|
import "../../chunk-5DGKFNQT.js";
|
|
12
12
|
import "../../chunk-UFVDIR2C.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-B5CRoR6f.cjs';
|
|
2
|
+
import { C as CanonicalDocument, P as PageSize, a as PageMargins, b as ColumnProperties, c as PageNumbering } from '../../canonical-document-BMtONpgf.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-p9b8rfy8.js';
|
|
2
|
+
import { C as CanonicalDocument, P as PageSize, a as PageMargins, b as ColumnProperties, c as PageNumbering } from '../../canonical-document-BMtONpgf.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-B5CRoR6f.cjs';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
import 'y-protocols/awareness';
|
|
5
|
-
import '../../canonical-document-
|
|
5
|
+
import '../../canonical-document-BMtONpgf.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-p9b8rfy8.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
import 'y-protocols/awareness';
|
|
5
|
-
import '../../canonical-document-
|
|
5
|
+
import '../../canonical-document-BMtONpgf.js';
|
|
6
6
|
import 'prosemirror-state';
|
|
7
7
|
import 'prosemirror-model';
|
|
8
8
|
|
|
@@ -3430,12 +3430,13 @@ function getLevelStartAt(level, levelDefinitions) {
|
|
|
3430
3430
|
return levelDefinitions.get(level)?.startAt ?? DEFAULT_NUMBERING_START_AT;
|
|
3431
3431
|
}
|
|
3432
3432
|
function getNumberingFormatPosture(format, value) {
|
|
3433
|
-
|
|
3433
|
+
const registryEntry = getNumberingFormatRegistryEntry(format);
|
|
3434
|
+
if (!registryEntry || registryEntry.renderSupport === "approximated") {
|
|
3434
3435
|
return {
|
|
3435
3436
|
status: "approximated",
|
|
3436
3437
|
requestedFormat: format,
|
|
3437
3438
|
renderedFormat: "decimal",
|
|
3438
|
-
reason: "unsupported-numbering-format-decimal-fallback"
|
|
3439
|
+
reason: registryEntry?.fallbackReason ?? "unsupported-numbering-format-decimal-fallback"
|
|
3439
3440
|
};
|
|
3440
3441
|
}
|
|
3441
3442
|
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)) {
|
|
@@ -3466,56 +3467,148 @@ function renderLevelText(text, counters, levelDefinitions) {
|
|
|
3466
3467
|
});
|
|
3467
3468
|
return rendered.trim().length > 0 ? rendered : null;
|
|
3468
3469
|
}
|
|
3469
|
-
var SUPPORTED_NUMBERING_FORMATS = /* @__PURE__ */ new Set([
|
|
3470
|
-
"decimal",
|
|
3471
|
-
"decimalZero",
|
|
3472
|
-
"upperLetter",
|
|
3473
|
-
"lowerLetter",
|
|
3474
|
-
"upperRoman",
|
|
3475
|
-
"lowerRoman",
|
|
3476
|
-
"hex",
|
|
3477
|
-
"ordinal",
|
|
3478
|
-
"cardinalText",
|
|
3479
|
-
"ordinalText",
|
|
3480
|
-
"chicago",
|
|
3481
|
-
"bullet",
|
|
3482
|
-
"none"
|
|
3483
|
-
]);
|
|
3484
3470
|
function isSupportedNumberingFormat(format) {
|
|
3485
|
-
return
|
|
3471
|
+
return getNumberingFormatRegistryEntry(format)?.renderSupport === "supported";
|
|
3472
|
+
}
|
|
3473
|
+
function getNumberingFormatRegistryEntry(format) {
|
|
3474
|
+
return NUMBERING_FORMAT_REGISTRY.get(format);
|
|
3486
3475
|
}
|
|
3487
3476
|
function formatCounter(value, format) {
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3477
|
+
return getNumberingFormatRegistryEntry(format)?.render(value) ?? String(value);
|
|
3478
|
+
}
|
|
3479
|
+
var exactNumberingFormatEntries = [
|
|
3480
|
+
{
|
|
3481
|
+
format: "decimal",
|
|
3482
|
+
renderSupport: "supported",
|
|
3483
|
+
renderedFormat: "decimal",
|
|
3484
|
+
supportsMutation: true,
|
|
3485
|
+
render: (value) => String(value)
|
|
3486
|
+
},
|
|
3487
|
+
{
|
|
3488
|
+
format: "decimalZero",
|
|
3489
|
+
renderSupport: "supported",
|
|
3490
|
+
renderedFormat: "decimalZero",
|
|
3491
|
+
supportsMutation: true,
|
|
3492
|
+
render: (value) => String(value).padStart(2, "0")
|
|
3493
|
+
},
|
|
3494
|
+
{
|
|
3495
|
+
format: "upperLetter",
|
|
3496
|
+
renderSupport: "supported",
|
|
3497
|
+
renderedFormat: "upperLetter",
|
|
3498
|
+
supportsMutation: true,
|
|
3499
|
+
render: (value) => toAlphabetic2(value).toUpperCase()
|
|
3500
|
+
},
|
|
3501
|
+
{
|
|
3502
|
+
format: "lowerLetter",
|
|
3503
|
+
renderSupport: "supported",
|
|
3504
|
+
renderedFormat: "lowerLetter",
|
|
3505
|
+
supportsMutation: true,
|
|
3506
|
+
render: (value) => toAlphabetic2(value).toLowerCase()
|
|
3507
|
+
},
|
|
3508
|
+
{
|
|
3509
|
+
format: "upperRoman",
|
|
3510
|
+
renderSupport: "supported",
|
|
3511
|
+
renderedFormat: "upperRoman",
|
|
3512
|
+
supportsMutation: true,
|
|
3513
|
+
render: (value) => toRoman2(value).toUpperCase()
|
|
3514
|
+
},
|
|
3515
|
+
{
|
|
3516
|
+
format: "lowerRoman",
|
|
3517
|
+
renderSupport: "supported",
|
|
3518
|
+
renderedFormat: "lowerRoman",
|
|
3519
|
+
supportsMutation: true,
|
|
3520
|
+
render: (value) => toRoman2(value).toLowerCase()
|
|
3521
|
+
},
|
|
3522
|
+
{
|
|
3523
|
+
format: "hex",
|
|
3524
|
+
renderSupport: "supported",
|
|
3525
|
+
renderedFormat: "hex",
|
|
3526
|
+
supportsMutation: true,
|
|
3527
|
+
render: (value) => value >= 0 ? value.toString(16).toUpperCase() : String(value)
|
|
3528
|
+
},
|
|
3529
|
+
{
|
|
3530
|
+
format: "ordinal",
|
|
3531
|
+
renderSupport: "supported",
|
|
3532
|
+
renderedFormat: "ordinal",
|
|
3533
|
+
supportsMutation: true,
|
|
3534
|
+
render: toOrdinal2
|
|
3535
|
+
},
|
|
3536
|
+
{
|
|
3537
|
+
format: "cardinalText",
|
|
3538
|
+
renderSupport: "supported",
|
|
3539
|
+
renderedFormat: "cardinalText",
|
|
3540
|
+
supportsMutation: true,
|
|
3541
|
+
render: toCardinalText2
|
|
3542
|
+
},
|
|
3543
|
+
{
|
|
3544
|
+
format: "ordinalText",
|
|
3545
|
+
renderSupport: "supported",
|
|
3546
|
+
renderedFormat: "ordinalText",
|
|
3547
|
+
supportsMutation: true,
|
|
3548
|
+
render: toOrdinalText2
|
|
3549
|
+
},
|
|
3550
|
+
{
|
|
3551
|
+
format: "chicago",
|
|
3552
|
+
renderSupport: "supported",
|
|
3553
|
+
renderedFormat: "chicago",
|
|
3554
|
+
supportsMutation: true,
|
|
3555
|
+
render: toChicago2
|
|
3556
|
+
},
|
|
3557
|
+
{
|
|
3558
|
+
format: "bullet",
|
|
3559
|
+
renderSupport: "supported",
|
|
3560
|
+
renderedFormat: "bullet",
|
|
3561
|
+
supportsMutation: true,
|
|
3562
|
+
render: () => ""
|
|
3563
|
+
},
|
|
3564
|
+
{
|
|
3565
|
+
format: "none",
|
|
3566
|
+
renderSupport: "supported",
|
|
3567
|
+
renderedFormat: "none",
|
|
3568
|
+
supportsMutation: true,
|
|
3569
|
+
render: () => ""
|
|
3517
3570
|
}
|
|
3518
|
-
|
|
3571
|
+
];
|
|
3572
|
+
var approximatedDecimalFormats = [
|
|
3573
|
+
"decimalEnclosedCircle",
|
|
3574
|
+
"decimalEnclosedFullstop",
|
|
3575
|
+
"decimalEnclosedParen",
|
|
3576
|
+
"decimalFullWidth",
|
|
3577
|
+
"decimalHalfWidth",
|
|
3578
|
+
"aiueo",
|
|
3579
|
+
"iroha",
|
|
3580
|
+
"ganada",
|
|
3581
|
+
"chosung",
|
|
3582
|
+
"russianLower",
|
|
3583
|
+
"russianUpper",
|
|
3584
|
+
"hebrew1",
|
|
3585
|
+
"hebrew2",
|
|
3586
|
+
"arabicAlpha",
|
|
3587
|
+
"arabicAbjad",
|
|
3588
|
+
"thaiLetters",
|
|
3589
|
+
"thaiNumbers",
|
|
3590
|
+
"hindiLetters",
|
|
3591
|
+
"hindiNumbers",
|
|
3592
|
+
"ideographDigital",
|
|
3593
|
+
"ideographTraditional",
|
|
3594
|
+
"chineseCounting",
|
|
3595
|
+
"japaneseCounting",
|
|
3596
|
+
"japaneseLegal"
|
|
3597
|
+
];
|
|
3598
|
+
var approximatedNumberingFormatEntries = approximatedDecimalFormats.map((format) => ({
|
|
3599
|
+
format,
|
|
3600
|
+
renderSupport: "approximated",
|
|
3601
|
+
renderedFormat: "decimal",
|
|
3602
|
+
supportsMutation: false,
|
|
3603
|
+
fallbackReason: "unsupported-numbering-format-decimal-fallback",
|
|
3604
|
+
render: (value) => String(value)
|
|
3605
|
+
}));
|
|
3606
|
+
var NUMBERING_FORMAT_REGISTRY = new Map(
|
|
3607
|
+
[...exactNumberingFormatEntries, ...approximatedNumberingFormatEntries].map((entry) => [
|
|
3608
|
+
entry.format,
|
|
3609
|
+
entry
|
|
3610
|
+
])
|
|
3611
|
+
);
|
|
3519
3612
|
function toOrdinal2(value) {
|
|
3520
3613
|
if (value <= 0) return String(value);
|
|
3521
3614
|
const lastTwo = value % 100;
|
|
@@ -4169,12 +4262,36 @@ var DEFAULT_HYPERLINK_COLOR_HEX = "0563C1";
|
|
|
4169
4262
|
function resolveHyperlinkRunFormatting(input, catalog, resolver) {
|
|
4170
4263
|
const augmentedInput = input.characterStyleId === void 0 ? { ...input, characterStyleId: HYPERLINK_CHARACTER_STYLE_ID } : input;
|
|
4171
4264
|
const cascade = resolveEffectiveRunFormatting(augmentedInput, catalog);
|
|
4172
|
-
const resolvedColor = resolveHyperlinkColorHex(
|
|
4265
|
+
const resolvedColor = resolveHyperlinkColorHex(
|
|
4266
|
+
stripInheritedColorHexForImplicitHyperlink(input, catalog, cascade),
|
|
4267
|
+
resolver
|
|
4268
|
+
);
|
|
4173
4269
|
if (resolvedColor && resolvedColor !== cascade.colorHex) {
|
|
4174
4270
|
return { ...cascade, colorHex: resolvedColor };
|
|
4175
4271
|
}
|
|
4176
4272
|
return cascade;
|
|
4177
4273
|
}
|
|
4274
|
+
function hasDirectNonAutoColor(input) {
|
|
4275
|
+
return Boolean(input.direct?.colorHex && input.direct.colorHex !== "auto");
|
|
4276
|
+
}
|
|
4277
|
+
function characterStyleDeclaresColorHex(styleId, catalog) {
|
|
4278
|
+
if (!catalog) return false;
|
|
4279
|
+
const chain = resolveCharacterStyleChain(styleId, catalog);
|
|
4280
|
+
return chain.some((chainStyleId) => {
|
|
4281
|
+
const colorHex = catalog.characters[chainStyleId]?.runProperties?.colorHex;
|
|
4282
|
+
return Boolean(colorHex && colorHex !== "auto");
|
|
4283
|
+
});
|
|
4284
|
+
}
|
|
4285
|
+
function stripInheritedColorHexForImplicitHyperlink(originalInput, catalog, cascade) {
|
|
4286
|
+
if (originalInput.characterStyleId !== void 0 || hasDirectNonAutoColor(originalInput) || !cascade.colorHex || cascade.colorHex === "auto" || characterStyleDeclaresColorHex(HYPERLINK_CHARACTER_STYLE_ID, catalog)) {
|
|
4287
|
+
return cascade;
|
|
4288
|
+
}
|
|
4289
|
+
const inheritedCascade = resolveEffectiveRunFormatting(originalInput, catalog);
|
|
4290
|
+
if (inheritedCascade.colorHex !== cascade.colorHex) {
|
|
4291
|
+
return cascade;
|
|
4292
|
+
}
|
|
4293
|
+
return { ...cascade, colorHex: void 0 };
|
|
4294
|
+
}
|
|
4178
4295
|
function resolveHyperlinkColorHex(cascade, resolver) {
|
|
4179
4296
|
if (cascade.colorHex && cascade.colorHex !== "auto") {
|
|
4180
4297
|
return cascade.colorHex;
|
|
@@ -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-B5CRoR6f.cjs';
|
|
2
|
+
import '../../canonical-document-BMtONpgf.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-p9b8rfy8.js';
|
|
2
|
+
import '../../canonical-document-BMtONpgf.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'yjs';
|
|
5
5
|
import 'y-protocols/awareness';
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
removeCellFromRow,
|
|
6
6
|
removeTableRowPure,
|
|
7
7
|
tableStructureActionHandleForTarget
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
8
|
+
} from "../../chunk-DDN2AIGE.js";
|
|
9
|
+
import "../../chunk-W34X3KBR.js";
|
|
10
|
+
import "../../chunk-HUIHBBAQ.js";
|
|
11
11
|
import "../../chunk-OYGMRRR7.js";
|
|
12
12
|
import "../../chunk-5DGKFNQT.js";
|
|
13
13
|
import "../../chunk-UFVDIR2C.js";
|