@beyondwork/docx-react-component 1.0.127 → 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.
Files changed (98) hide show
  1. package/dist/api/public-types.cjs +215 -61
  2. package/dist/api/public-types.d.cts +2 -2
  3. package/dist/api/public-types.d.ts +2 -2
  4. package/dist/api/public-types.js +2 -2
  5. package/dist/api/v3.cjs +1324 -71
  6. package/dist/api/v3.d.cts +3 -3
  7. package/dist/api/v3.d.ts +3 -3
  8. package/dist/api/v3.js +8 -8
  9. package/dist/{canonical-document-CXCFCbAz.d.cts → canonical-document-BMtONpgf.d.cts} +6 -0
  10. package/dist/{canonical-document-CXCFCbAz.d.ts → canonical-document-BMtONpgf.d.ts} +6 -0
  11. package/dist/{chunk-KV435YXO.js → chunk-5DSHUYSY.js} +1 -1
  12. package/dist/{chunk-TQDQU2E3.js → chunk-63FYIGCT.js} +2 -2
  13. package/dist/{chunk-ZDOAUP3V.js → chunk-DDN2AIGE.js} +1 -1
  14. package/dist/{chunk-6F5QW44A.js → chunk-DJU2W4E4.js} +2 -2
  15. package/dist/{chunk-4EENH4FG.js → chunk-EZKJXIPH.js} +1 -1
  16. package/dist/{chunk-CXSYRB37.js → chunk-HUIHBBAQ.js} +166 -49
  17. package/dist/{chunk-ESJ2MES5.js → chunk-JJGVE5J7.js} +1 -1
  18. package/dist/{chunk-LZVBNDGU.js → chunk-LJH64PV3.js} +3 -3
  19. package/dist/{chunk-MWSBGJQO.js → chunk-OTQIW2TC.js} +2 -2
  20. package/dist/{chunk-2QL5DAKF.js → chunk-PGKUJZXV.js} +3 -3
  21. package/dist/{chunk-PUMZWE2D.js → chunk-PRAZBHNF.js} +460 -136
  22. package/dist/{chunk-4YJVRIUB.js → chunk-Q3QYGKFE.js} +51 -8
  23. package/dist/{chunk-YHZHPXDB.js → chunk-RMRTQGW3.js} +50 -13
  24. package/dist/{chunk-XRACP43Q.js → chunk-SKPTKQHF.js} +351 -13
  25. package/dist/{chunk-D5HYZQTG.js → chunk-VNLDQJ47.js} +1 -1
  26. package/dist/{chunk-BYSRJ4FE.js → chunk-W34X3KBR.js} +1 -1
  27. package/dist/{chunk-V6XVZFFH.js → chunk-XMHSGPLN.js} +2 -2
  28. package/dist/{chunk-46KNRA4C.js → chunk-XQCAMKIQ.js} +849 -6
  29. package/dist/{chunk-YD2JE54B.js → chunk-YZDZ4FGR.js} +1 -1
  30. package/dist/compare.d.cts +1 -1
  31. package/dist/compare.d.ts +1 -1
  32. package/dist/core/commands/formatting-commands.d.cts +2 -2
  33. package/dist/core/commands/formatting-commands.d.ts +2 -2
  34. package/dist/core/commands/image-commands.cjs +166 -49
  35. package/dist/core/commands/image-commands.d.cts +2 -2
  36. package/dist/core/commands/image-commands.d.ts +2 -2
  37. package/dist/core/commands/image-commands.js +4 -4
  38. package/dist/core/commands/section-layout-commands.d.cts +2 -2
  39. package/dist/core/commands/section-layout-commands.d.ts +2 -2
  40. package/dist/core/commands/style-commands.d.cts +2 -2
  41. package/dist/core/commands/style-commands.d.ts +2 -2
  42. package/dist/core/commands/table-structure-commands.cjs +166 -49
  43. package/dist/core/commands/table-structure-commands.d.cts +2 -2
  44. package/dist/core/commands/table-structure-commands.d.ts +2 -2
  45. package/dist/core/commands/table-structure-commands.js +3 -3
  46. package/dist/core/commands/text-commands.cjs +166 -49
  47. package/dist/core/commands/text-commands.d.cts +2 -2
  48. package/dist/core/commands/text-commands.d.ts +2 -2
  49. package/dist/core/commands/text-commands.js +4 -4
  50. package/dist/core/selection/mapping.d.cts +2 -2
  51. package/dist/core/selection/mapping.d.ts +2 -2
  52. package/dist/core/state/editor-state.d.cts +2 -2
  53. package/dist/core/state/editor-state.d.ts +2 -2
  54. package/dist/index.cjs +1943 -219
  55. package/dist/index.d.cts +5 -5
  56. package/dist/index.d.ts +5 -5
  57. package/dist/index.js +56 -22
  58. package/dist/io/docx-session.cjs +51 -8
  59. package/dist/io/docx-session.d.cts +4 -4
  60. package/dist/io/docx-session.d.ts +4 -4
  61. package/dist/io/docx-session.js +3 -3
  62. package/dist/legal.d.cts +1 -1
  63. package/dist/legal.d.ts +1 -1
  64. package/dist/legal.js +2 -2
  65. package/dist/{loader-CFICtb9m.d.ts → loader-4qsw4eIU.d.ts} +3 -3
  66. package/dist/{loader-DveZOVuC.d.cts → loader-B8TKhmQi.d.cts} +3 -3
  67. package/dist/{public-types-beSYFJRR.d.cts → public-types-B5CRoR6f.d.cts} +220 -1
  68. package/dist/{public-types-Cgl3efbO.d.ts → public-types-p9b8rfy8.d.ts} +220 -1
  69. package/dist/public-types.cjs +215 -61
  70. package/dist/public-types.d.cts +2 -2
  71. package/dist/public-types.d.ts +2 -2
  72. package/dist/public-types.js +2 -2
  73. package/dist/runtime/collab.d.cts +3 -3
  74. package/dist/runtime/collab.d.ts +3 -3
  75. package/dist/runtime/document-runtime.cjs +999 -193
  76. package/dist/runtime/document-runtime.d.cts +2 -2
  77. package/dist/runtime/document-runtime.d.ts +2 -2
  78. package/dist/runtime/document-runtime.js +13 -13
  79. package/dist/{session-B7u82EJF.d.cts → session-BnGIjaex.d.cts} +3 -3
  80. package/dist/{session-BWMJ9jm4.d.ts → session-vEYKf-w3.d.ts} +3 -3
  81. package/dist/session.cjs +51 -8
  82. package/dist/session.d.cts +5 -5
  83. package/dist/session.d.ts +5 -5
  84. package/dist/session.js +4 -4
  85. package/dist/tailwind.cjs +215 -61
  86. package/dist/tailwind.d.cts +2 -2
  87. package/dist/tailwind.d.ts +2 -2
  88. package/dist/tailwind.js +5 -5
  89. package/dist/{types-BQjdVZsh.d.cts → types-BLuvZ6cQ.d.cts} +2 -2
  90. package/dist/{types-DvvmS5A7.d.ts → types-Dutlyj0T.d.ts} +2 -2
  91. package/dist/ui-tailwind/editor-surface/search-plugin.d.cts +3 -3
  92. package/dist/ui-tailwind/editor-surface/search-plugin.d.ts +3 -3
  93. package/dist/ui-tailwind/editor-surface/search-plugin.js +3 -3
  94. package/dist/ui-tailwind.cjs +215 -61
  95. package/dist/ui-tailwind.d.cts +3 -3
  96. package/dist/ui-tailwind.d.ts +3 -3
  97. package/dist/ui-tailwind.js +5 -5
  98. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  extractBookmarksFromBodyXml
3
- } from "./chunk-4YJVRIUB.js";
3
+ } from "./chunk-Q3QYGKFE.js";
4
4
 
5
5
  // src/legal/document-root.ts
6
6
  function resolveWalkableRoot(document) {
@@ -1,4 +1,4 @@
1
- import { C as CanonicalDocument, B as BlockNode } from './canonical-document-CXCFCbAz.cjs';
1
+ import { C as CanonicalDocument, B as BlockNode } from './canonical-document-BMtONpgf.cjs';
2
2
 
3
3
  type OpcCompressionMethod = "store" | "deflate";
4
4
  type OpcSurfaceKind = "content" | "relationships" | "content-types";
package/dist/compare.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as CanonicalDocument, B as BlockNode } from './canonical-document-CXCFCbAz.js';
1
+ import { C as CanonicalDocument, B as BlockNode } from './canonical-document-BMtONpgf.js';
2
2
 
3
3
  type OpcCompressionMethod = "store" | "deflate";
4
4
  type OpcSurfaceKind = "content" | "relationships" | "content-types";
@@ -1,7 +1,7 @@
1
1
  import 'prosemirror-state';
2
2
  import 'prosemirror-model';
3
- export { g4 as Alignment, g5 as FormattingMutationResult, g6 as FormattingOperation, g7 as TextMarkClearTarget, g8 as TextMarkRangeOperation, g9 as applyFormattingOperationToDocument, ga as applyIndentation, gb as applyTextMarkOperationToDocumentRange, gc as getFormattingStateFromRenderSnapshot, gd as isMarkActive, ge as makeSetAlignment, gf as makeSetFontFamily, gg as makeSetFontSize, gh as makeSetHighlight, gi as makeSetTextColor, gj as makeToggleAllCaps, gk as makeToggleBold, gl as makeToggleItalic, gm as makeToggleSmallCaps, gn as makeToggleStrikethrough, go as makeToggleSubscript, gp as makeToggleSuperscript, gq as makeToggleUnderline } from '../../public-types-beSYFJRR.cjs';
4
- import '../../canonical-document-CXCFCbAz.cjs';
3
+ export { g4 as Alignment, g5 as FormattingMutationResult, g6 as FormattingOperation, g7 as TextMarkClearTarget, g8 as TextMarkRangeOperation, g9 as applyFormattingOperationToDocument, ga as applyIndentation, gb as applyTextMarkOperationToDocumentRange, gc as getFormattingStateFromRenderSnapshot, gd as isMarkActive, ge as makeSetAlignment, gf as makeSetFontFamily, gg as makeSetFontSize, gh as makeSetHighlight, gi as makeSetTextColor, gj as makeToggleAllCaps, gk as makeToggleBold, gl as makeToggleItalic, gm as makeToggleSmallCaps, gn as makeToggleStrikethrough, go as makeToggleSubscript, gp as makeToggleSuperscript, gq as makeToggleUnderline } from '../../public-types-B5CRoR6f.cjs';
4
+ import '../../canonical-document-BMtONpgf.cjs';
5
5
  import 'react';
6
6
  import 'yjs';
7
7
  import 'y-protocols/awareness';
@@ -1,7 +1,7 @@
1
1
  import 'prosemirror-state';
2
2
  import 'prosemirror-model';
3
- export { g4 as Alignment, g5 as FormattingMutationResult, g6 as FormattingOperation, g7 as TextMarkClearTarget, g8 as TextMarkRangeOperation, g9 as applyFormattingOperationToDocument, ga as applyIndentation, gb as applyTextMarkOperationToDocumentRange, gc as getFormattingStateFromRenderSnapshot, gd as isMarkActive, ge as makeSetAlignment, gf as makeSetFontFamily, gg as makeSetFontSize, gh as makeSetHighlight, gi as makeSetTextColor, gj as makeToggleAllCaps, gk as makeToggleBold, gl as makeToggleItalic, gm as makeToggleSmallCaps, gn as makeToggleStrikethrough, go as makeToggleSubscript, gp as makeToggleSuperscript, gq as makeToggleUnderline } from '../../public-types-Cgl3efbO.js';
4
- import '../../canonical-document-CXCFCbAz.js';
3
+ export { g4 as Alignment, g5 as FormattingMutationResult, g6 as FormattingOperation, g7 as TextMarkClearTarget, g8 as TextMarkRangeOperation, g9 as applyFormattingOperationToDocument, ga as applyIndentation, gb as applyTextMarkOperationToDocumentRange, gc as getFormattingStateFromRenderSnapshot, gd as isMarkActive, ge as makeSetAlignment, gf as makeSetFontFamily, gg as makeSetFontSize, gh as makeSetHighlight, gi as makeSetTextColor, gj as makeToggleAllCaps, gk as makeToggleBold, gl as makeToggleItalic, gm as makeToggleSmallCaps, gn as makeToggleStrikethrough, go as makeToggleSubscript, gp as makeToggleSuperscript, gq as makeToggleUnderline } from '../../public-types-p9b8rfy8.js';
4
+ import '../../canonical-document-BMtONpgf.js';
5
5
  import 'react';
6
6
  import 'yjs';
7
7
  import 'y-protocols/awareness';
@@ -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
- if (!isSupportedNumberingFormat(format)) {
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 SUPPORTED_NUMBERING_FORMATS.has(format);
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
- switch (format) {
3924
- case "decimal":
3925
- return String(value);
3926
- case "decimalZero":
3927
- return String(value).padStart(2, "0");
3928
- case "upperLetter":
3929
- return toAlphabetic2(value).toUpperCase();
3930
- case "lowerLetter":
3931
- return toAlphabetic2(value).toLowerCase();
3932
- case "upperRoman":
3933
- return toRoman2(value).toUpperCase();
3934
- case "lowerRoman":
3935
- return toRoman2(value).toLowerCase();
3936
- case "hex":
3937
- return value >= 0 ? value.toString(16).toUpperCase() : String(value);
3938
- case "ordinal":
3939
- return toOrdinal2(value);
3940
- case "cardinalText":
3941
- return toCardinalText2(value);
3942
- case "ordinalText":
3943
- return toOrdinalText2(value);
3944
- case "chicago":
3945
- return toChicago2(value);
3946
- case "bullet":
3947
- return "";
3948
- case "none":
3949
- return "";
3950
- default:
3951
- return String(value);
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(cascade, resolver);
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-beSYFJRR.cjs';
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-CXCFCbAz.cjs';
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-Cgl3efbO.js';
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-CXCFCbAz.js';
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-6F5QW44A.js";
6
- import "../../chunk-KV435YXO.js";
7
- import "../../chunk-BYSRJ4FE.js";
5
+ } from "../../chunk-DJU2W4E4.js";
6
+ import "../../chunk-5DSHUYSY.js";
7
+ import "../../chunk-W34X3KBR.js";
8
8
  import "../../chunk-QIO6V46H.js";
9
- import "../../chunk-CXSYRB37.js";
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-beSYFJRR.cjs';
2
- import { C as CanonicalDocument, P as PageSize, a as PageMargins, b as ColumnProperties, c as PageNumbering } from '../../canonical-document-CXCFCbAz.cjs';
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-Cgl3efbO.js';
2
- import { C as CanonicalDocument, P as PageSize, a as PageMargins, b as ColumnProperties, c as PageNumbering } from '../../canonical-document-CXCFCbAz.js';
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-beSYFJRR.cjs';
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-CXCFCbAz.cjs';
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-Cgl3efbO.js';
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-CXCFCbAz.js';
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
- if (!isSupportedNumberingFormat(format)) {
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 SUPPORTED_NUMBERING_FORMATS.has(format);
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
- switch (format) {
3489
- case "decimal":
3490
- return String(value);
3491
- case "decimalZero":
3492
- return String(value).padStart(2, "0");
3493
- case "upperLetter":
3494
- return toAlphabetic2(value).toUpperCase();
3495
- case "lowerLetter":
3496
- return toAlphabetic2(value).toLowerCase();
3497
- case "upperRoman":
3498
- return toRoman2(value).toUpperCase();
3499
- case "lowerRoman":
3500
- return toRoman2(value).toLowerCase();
3501
- case "hex":
3502
- return value >= 0 ? value.toString(16).toUpperCase() : String(value);
3503
- case "ordinal":
3504
- return toOrdinal2(value);
3505
- case "cardinalText":
3506
- return toCardinalText2(value);
3507
- case "ordinalText":
3508
- return toOrdinalText2(value);
3509
- case "chicago":
3510
- return toChicago2(value);
3511
- case "bullet":
3512
- return "";
3513
- case "none":
3514
- return "";
3515
- default:
3516
- return String(value);
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(cascade, resolver);
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-beSYFJRR.cjs';
2
- import '../../canonical-document-CXCFCbAz.cjs';
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-Cgl3efbO.js';
2
- import '../../canonical-document-CXCFCbAz.js';
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';