@stll/folio-core 0.74.0 → 0.75.0

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 (113) hide show
  1. package/dist/ai-edits/clean-text.d.ts +4 -1
  2. package/dist/ai-edits/clean-text.js +21 -7
  3. package/dist/ai-edits/headless.d.ts +5 -2
  4. package/dist/ai-edits/headless.js +18 -9
  5. package/dist/ai-edits/note-references.d.ts +1 -1
  6. package/dist/ai-edits/note-references.js +1 -1
  7. package/dist/ai-edits/pending-suggestions.d.ts +9 -7
  8. package/dist/ai-edits/pending-suggestions.js +134 -88
  9. package/dist/ai-edits/pendingJoin.d.ts +5 -1
  10. package/dist/ai-edits/pendingJoin.js +6 -2
  11. package/dist/ai-edits/retired-comment-receipts.d.ts +2 -2
  12. package/dist/ai-edits/retired-comment-receipts.js +3 -18
  13. package/dist/ai-edits/tracked-batch-fidelity.d.ts +6 -10
  14. package/dist/ai-edits/tracked-batch-fidelity.js +3 -182
  15. package/dist/canonical/canonicalBatchReview.d.ts +4 -1
  16. package/dist/canonical/canonicalBatchReview.js +32 -14
  17. package/dist/canonical/canonicalComments.d.ts +6 -2
  18. package/dist/canonical/canonicalComments.js +8 -4
  19. package/dist/canonical/canonicalPublicOperations.js +29 -9
  20. package/dist/canonical/canonicalRefusalGrounds.d.ts +4 -0
  21. package/dist/canonical/canonicalRefusalGrounds.js +56 -0
  22. package/dist/canonical/canonicalSession.d.ts +12 -6
  23. package/dist/canonical/canonicalSession.js +116 -121
  24. package/dist/canonical/canonicalTrackedBatchFidelity.js +3 -3
  25. package/dist/compare/inline-atoms.d.ts +35 -41
  26. package/dist/compare/inline-atoms.js +2 -465
  27. package/dist/compare/section-boundary-properties.d.ts +3 -30
  28. package/dist/compare/section-boundary-properties.js +4 -72
  29. package/dist/controller/canonicalClipboard.js +43 -42
  30. package/dist/controller/canonicalComposition.d.ts +1 -1
  31. package/dist/controller/canonicalComposition.js +5 -5
  32. package/dist/controller/canonicalInput.d.ts +4 -2
  33. package/dist/controller/canonicalInput.js +33 -16
  34. package/dist/controller/canonicalStoryEditor.d.ts +2 -3
  35. package/dist/controller/canonicalStoryEditor.js +43 -25
  36. package/dist/controller/canonicalStructure.d.ts +19 -2
  37. package/dist/controller/canonicalStructure.js +139 -42
  38. package/dist/controller/deferredDisplayListPainter.d.ts +8 -0
  39. package/dist/controller/deferredDisplayListPainter.js +34 -0
  40. package/dist/controller/folioEditor.js +4 -2
  41. package/dist/controller/headerFooterEditorManager.js +3 -17
  42. package/dist/controller/hiddenEditorApi.d.ts +24 -3
  43. package/dist/controller/hiddenEditorApi.js +2 -0
  44. package/dist/controller/hiddenEditorManager.js +132 -189
  45. package/dist/controller/layoutPipeline.d.ts +4 -86
  46. package/dist/controller/layoutPipeline.js +8 -727
  47. package/dist/controller/layoutPipelineExecution.d.ts +94 -0
  48. package/dist/controller/layoutPipelineExecution.js +730 -0
  49. package/dist/controller/noteEditorManager.js +3 -16
  50. package/dist/docx/blockContentParser.d.ts +1 -3
  51. package/dist/docx/blockContentParser.js +3 -10
  52. package/dist/docx/canonicalSave.d.ts +4 -3
  53. package/dist/docx/canonicalSave.js +4 -3
  54. package/dist/docx/listMarkerComputation.d.ts +24 -17
  55. package/dist/docx/listMarkerComputation.js +31 -60
  56. package/dist/docx/listModelNormalization.js +8 -15
  57. package/dist/docx/rezip.d.ts +16 -3
  58. package/dist/docx/rezip.js +35 -9
  59. package/dist/docx/selectiveSave.js +13 -5
  60. package/dist/docx/server/templatePlan/apply.js +38 -3
  61. package/dist/docx/server/templatePlan/blocks.d.ts +16 -1
  62. package/dist/docx/server/templatePlan/blocks.js +93 -7
  63. package/dist/docx/server/templatePlan/builders.d.ts +37 -2
  64. package/dist/docx/server/templatePlan/builders.js +196 -5
  65. package/dist/docx/server/templatePlan/emit.d.ts +2 -0
  66. package/dist/docx/server/templatePlan/emit.js +2 -0
  67. package/dist/docx/server/templatePlan/inspect.js +19 -52
  68. package/dist/docx/server/templatePlan/labels.d.ts +7 -2
  69. package/dist/docx/server/templatePlan/labels.js +104 -22
  70. package/dist/docx/server/templatePlan/plan.d.ts +13 -1
  71. package/dist/docx/server/templatePlan/plan.js +22 -7
  72. package/dist/docx/server/templatePlan/planShape.js +31 -2
  73. package/dist/docx/server/templatePlan/story.d.ts +8 -0
  74. package/dist/docx/server/templatePlan/story.js +11 -1
  75. package/dist/docx/server/templatePlan/types.d.ts +138 -16
  76. package/dist/docx/server/templatePlan/verify.js +50 -9
  77. package/dist/i18n/messages/ar.gen.js +1 -0
  78. package/dist/i18n/messages/catalogs.gen.d.ts +17 -0
  79. package/dist/i18n/messages/catalogs.gen.js +17 -0
  80. package/dist/i18n/messages/cs.gen.js +1 -0
  81. package/dist/i18n/messages/de.gen.js +1 -0
  82. package/dist/i18n/messages/en.gen.js +1 -0
  83. package/dist/i18n/messages/es.gen.js +1 -0
  84. package/dist/i18n/messages/et.gen.js +1 -0
  85. package/dist/i18n/messages/fr.gen.js +1 -0
  86. package/dist/i18n/messages/he.gen.js +1 -0
  87. package/dist/i18n/messages/hi.gen.js +1 -0
  88. package/dist/i18n/messages/hu.gen.js +1 -0
  89. package/dist/i18n/messages/lt.gen.js +1 -0
  90. package/dist/i18n/messages/lv.gen.js +1 -0
  91. package/dist/i18n/messages/messages.gen.d.ts +1 -0
  92. package/dist/i18n/messages/pl.gen.js +1 -0
  93. package/dist/i18n/messages/pt-BR.gen.js +1 -0
  94. package/dist/i18n/messages/sk.gen.js +1 -0
  95. package/dist/i18n/messages/tr.gen.js +1 -0
  96. package/dist/i18n/messages/zh-CN.gen.js +1 -0
  97. package/dist/layout-bridge/convert/toFlowBlocks.js +0 -12
  98. package/dist/layout-bridge/convert/topLevelConversion.js +1 -10
  99. package/dist/prosemirror/extensions/features/ImagePasteExtension.js +1 -1
  100. package/dist/prosemirror/listMarker.d.ts +1 -6
  101. package/dist/prosemirror/listMarker.js +4 -56
  102. package/dist/server.d.ts +2 -2
  103. package/dist/types/canonicalCapabilities.d.ts +40 -45
  104. package/dist/types/canonicalCapabilities.js +51 -43
  105. package/dist/types/canonicalComments.d.ts +2 -2
  106. package/dist/types/canonicalSections.d.ts +2 -2
  107. package/dist/utils/clipboard.d.ts +2 -28
  108. package/dist/utils/clipboard.js +1 -96
  109. package/dist/utils/clipboardFiles.d.ts +27 -0
  110. package/dist/utils/clipboardFiles.js +98 -0
  111. package/dist/utils/rulerControl.d.ts +1 -0
  112. package/dist/utils/rulerControl.js +2 -1
  113. package/package.json +2 -2
@@ -337,6 +337,7 @@ const messages = { "folio": {
337
337
  "editSessionTakenOver": "Diese Bearbeitungssitzung wurde an anderer Stelle übernommen.",
338
338
  "editor": {
339
339
  "accessibleName": "Dokumenteditor",
340
+ "changeNotApplied": "Diese Änderung konnte nicht vorgenommen werden.",
340
341
  "changeUnavailable": "Diese Änderung ist hier noch nicht möglich.",
341
342
  "contentLocked": "Dieser Teil des Dokuments ist gesperrt.",
342
343
  "editing": "Bearbeiten",
@@ -337,6 +337,7 @@ const messages = { "folio": {
337
337
  "editSessionTakenOver": "Another tab, window, or device opened this document for editing, so this session was released. Unsaved local changes are preserved — reopen the doc to continue.",
338
338
  "editor": {
339
339
  "accessibleName": "Document editor",
340
+ "changeNotApplied": "This change couldn't be made.",
340
341
  "changeUnavailable": "This change can't be made here yet.",
341
342
  "contentLocked": "This part of the document is locked.",
342
343
  "editing": "Editing",
@@ -337,6 +337,7 @@ const messages = { "folio": {
337
337
  "editSessionTakenOver": "Esta sesión de edición se tomó en otro lugar.",
338
338
  "editor": {
339
339
  "accessibleName": "Editor de documentos",
340
+ "changeNotApplied": "No se pudo hacer este cambio.",
340
341
  "changeUnavailable": "Este cambio aún no se puede hacer aquí.",
341
342
  "contentLocked": "Esta parte del documento está bloqueada.",
342
343
  "editing": "Edición",
@@ -337,6 +337,7 @@ const messages = { "folio": {
337
337
  "editSessionTakenOver": "See muutmisseanss võeti mujal üle.",
338
338
  "editor": {
339
339
  "accessibleName": "Dokumendiredaktor",
340
+ "changeNotApplied": "Seda muudatust ei saanud teha.",
340
341
  "changeUnavailable": "Seda muudatust ei saa siin veel teha.",
341
342
  "contentLocked": "See dokumendi osa on lukustatud.",
342
343
  "editing": "Redigeerimine",
@@ -337,6 +337,7 @@ const messages = { "folio": {
337
337
  "editSessionTakenOver": "Cette session de modification a été reprise ailleurs.",
338
338
  "editor": {
339
339
  "accessibleName": "Éditeur de documents",
340
+ "changeNotApplied": "Cette modification n'a pas pu être effectuée.",
340
341
  "changeUnavailable": "Cette modification n'est pas encore possible ici.",
341
342
  "contentLocked": "Cette partie du document est verrouillée.",
342
343
  "editing": "Modification",
@@ -337,6 +337,7 @@ const messages = { "folio": {
337
337
  "editSessionTakenOver": "כרטיסייה, חלון או מכשיר אחר פתחו מסמך זה לעריכה, ולכן הפעלה זו שוחררה. שינויים מקומיים שלא נשמרו נשמרו — פתח מחדש את המסמך כדי להמשיך.",
338
338
  "editor": {
339
339
  "accessibleName": "עורך מסמכים",
340
+ "changeNotApplied": "לא ניתן היה לבצע את השינוי הזה.",
340
341
  "changeUnavailable": "עדיין לא ניתן לבצע את השינוי הזה כאן.",
341
342
  "contentLocked": "חלק זה של המסמך נעול.",
342
343
  "editing": "עריכה",
@@ -337,6 +337,7 @@ const messages = { "folio": {
337
337
  "editSessionTakenOver": "किसी अन्य टैब, विंडो या डिवाइस ने इस दस्तावेज़ को संपादन के लिए खोला, इसलिए यह सत्र बंद कर दिया गया। सहेजे नहीं गए स्थानीय परिवर्तन सुरक्षित हैं — जारी रखने के लिए दस्तावेज़ फिर से खोलें।",
338
338
  "editor": {
339
339
  "accessibleName": "दस्तावेज़ संपादक",
340
+ "changeNotApplied": "यह बदलाव नहीं किया जा सका।",
340
341
  "changeUnavailable": "यह बदलाव अभी यहाँ नहीं किया जा सकता।",
341
342
  "contentLocked": "दस्तावेज़ का यह हिस्सा लॉक है।",
342
343
  "editing": "संपादन",
@@ -337,6 +337,7 @@ const messages = { "folio": {
337
337
  "editSessionTakenOver": "Ezt a szerkesztési munkamenetet máshol vették át.",
338
338
  "editor": {
339
339
  "accessibleName": "Dokumentumszerkesztő",
340
+ "changeNotApplied": "Ezt a módosítást nem sikerült végrehajtani.",
340
341
  "changeUnavailable": "Ez a módosítás itt még nem hajtható végre.",
341
342
  "contentLocked": "A dokumentum ezen része zárolva van.",
342
343
  "editing": "Szerkesztés",
@@ -337,6 +337,7 @@ const messages = { "folio": {
337
337
  "editSessionTakenOver": "Ši redagavimo sesija buvo perimta kitur.",
338
338
  "editor": {
339
339
  "accessibleName": "Dokumentų redaktorius",
340
+ "changeNotApplied": "Šio pakeitimo atlikti nepavyko.",
340
341
  "changeUnavailable": "Šio pakeitimo čia dar negalima atlikti.",
341
342
  "contentLocked": "Ši dokumento dalis užrakinta.",
342
343
  "editing": "Redagavimas",
@@ -337,6 +337,7 @@ const messages = { "folio": {
337
337
  "editSessionTakenOver": "Šo rediģēšanas sesiju pārņēma citur.",
338
338
  "editor": {
339
339
  "accessibleName": "Dokumentu redaktors",
340
+ "changeNotApplied": "Šīs izmaiņas neizdevās veikt.",
340
341
  "changeUnavailable": "Šīs izmaiņas šeit vēl nevar veikt.",
341
342
  "contentLocked": "Šī dokumenta daļa ir bloķēta.",
342
343
  "editing": "Rediģēšana",
@@ -337,6 +337,7 @@ type Messages = {
337
337
  "editSessionTakenOver": "Another tab, window, or device opened this document for editing, so this session was released. Unsaved local changes are preserved — reopen the doc to continue.";
338
338
  "editor": {
339
339
  "accessibleName": "Document editor";
340
+ "changeNotApplied": "This change couldn't be made.";
340
341
  "changeUnavailable": "This change can't be made here yet.";
341
342
  "contentLocked": "This part of the document is locked.";
342
343
  "editing": "Editing";
@@ -337,6 +337,7 @@ const messages = { "folio": {
337
337
  "editSessionTakenOver": "Ta sesja edycji została przejęta gdzie indziej.",
338
338
  "editor": {
339
339
  "accessibleName": "Edytor dokumentów",
340
+ "changeNotApplied": "Nie udało się wprowadzić tej zmiany.",
340
341
  "changeUnavailable": "Tej zmiany nie można jeszcze tu wprowadzić.",
341
342
  "contentLocked": "Ta część dokumentu jest zablokowana.",
342
343
  "editing": "Edytowanie",
@@ -337,6 +337,7 @@ const messages = { "folio": {
337
337
  "editSessionTakenOver": "Esta sessão de edição foi assumida em outro lugar.",
338
338
  "editor": {
339
339
  "accessibleName": "Editor de documentos",
340
+ "changeNotApplied": "Não foi possível fazer esta alteração.",
340
341
  "changeUnavailable": "Ainda não é possível fazer esta alteração aqui.",
341
342
  "contentLocked": "Esta parte do documento está bloqueada.",
342
343
  "editing": "Editando",
@@ -337,6 +337,7 @@ const messages = { "folio": {
337
337
  "editSessionTakenOver": "Túto reláciu úprav prevzalo iné okno.",
338
338
  "editor": {
339
339
  "accessibleName": "Editor dokumentov",
340
+ "changeNotApplied": "Túto zmenu sa nepodarilo vykonať.",
340
341
  "changeUnavailable": "Túto zmenu tu zatiaľ nemožno vykonať.",
341
342
  "contentLocked": "Táto časť dokumentu je uzamknutá.",
342
343
  "editing": "Úpravy",
@@ -337,6 +337,7 @@ const messages = { "folio": {
337
337
  "editSessionTakenOver": "Başka bir sekme, pencere veya cihaz bu belgeyi düzenlemek için açtığından bu oturum sonlandırıldı. Kaydedilmemiş yerel değişiklikler korunur; devam etmek için belgeyi yeniden açın.",
338
338
  "editor": {
339
339
  "accessibleName": "Belge düzenleyici",
340
+ "changeNotApplied": "Bu değişiklik yapılamadı.",
340
341
  "changeUnavailable": "Bu değişiklik henüz burada yapılamıyor.",
341
342
  "contentLocked": "Belgenin bu bölümü kilitli.",
342
343
  "editing": "Düzenleme",
@@ -337,6 +337,7 @@ const messages = { "folio": {
337
337
  "editSessionTakenOver": "另一个标签页、窗口或设备已打开此文档进行编辑,因此本会话已释放。未保存的本地更改会保留,请重新打开文档以继续。",
338
338
  "editor": {
339
339
  "accessibleName": "文档编辑器",
340
+ "changeNotApplied": "无法进行此更改。",
340
341
  "changeUnavailable": "暂时无法在此处进行此更改。",
341
342
  "contentLocked": "文档的这一部分已锁定。",
342
343
  "editing": "编辑",
@@ -48,24 +48,12 @@ function toFlowBlocks(doc, options = {}) {
48
48
  counters: listCounters,
49
49
  abstractCounters: options.listAbstractCounters ?? /* @__PURE__ */ new Map(),
50
50
  seenLevels: options.listSeenNumIds ?? /* @__PURE__ */ new Set(),
51
- restartedNumIds: /* @__PURE__ */ new Set(),
52
- previousList: {
53
- abstractNumId: null,
54
- fromStyle: false,
55
- numId: null
56
- },
57
51
  ...lastAdvancedNumId !== void 0 ? { lastAdvancedNumId } : {}
58
52
  };
59
53
  const originalListCounterState = {
60
54
  counters: originalListCounters,
61
55
  abstractCounters: options.originalListAbstractCounters ?? /* @__PURE__ */ new Map(),
62
56
  seenLevels: options.originalListSeenNumIds ?? /* @__PURE__ */ new Set(),
63
- restartedNumIds: /* @__PURE__ */ new Set(),
64
- previousList: {
65
- abstractNumId: null,
66
- fromStyle: false,
67
- numId: null
68
- },
69
57
  ...lastAdvancedOriginalNumId !== void 0 ? { lastAdvancedNumId: lastAdvancedOriginalNumId } : {}
70
58
  };
71
59
  const { firstPageBreakRunPosition } = buildPageBreakRunDescendantIndex(doc);
@@ -45,10 +45,7 @@ const sameMembers = (left, right) => {
45
45
  */
46
46
  const sameListCounterState = (left, right) => {
47
47
  if (left === right) return true;
48
- if (left.counters.size !== right.counters.size || left.abstractCounters.size !== right.abstractCounters.size || left.lastAdvancedNumId !== right.lastAdvancedNumId || !sameMembers(left.seenLevels, right.seenLevels) || !sameMembers(left.restartedNumIds, right.restartedNumIds)) return false;
49
- const leftList = left.previousList;
50
- const rightList = right.previousList;
51
- if ((leftList?.abstractNumId ?? null) !== (rightList?.abstractNumId ?? null) || (leftList?.fromStyle ?? false) !== (rightList?.fromStyle ?? false) || (leftList?.numId ?? null) !== (rightList?.numId ?? null)) return false;
48
+ if (left.counters.size !== right.counters.size || left.abstractCounters.size !== right.abstractCounters.size || left.lastAdvancedNumId !== right.lastAdvancedNumId || !sameMembers(left.seenLevels, right.seenLevels)) return false;
52
49
  const paired = /* @__PURE__ */ new Map();
53
50
  const pairs = (leftArray, rightArray) => {
54
51
  if (rightArray === void 0) return false;
@@ -97,12 +94,6 @@ const restoreListCounterState = (target, source) => {
97
94
  for (const [key, values] of source.abstractCounters) target.abstractCounters.set(key, copyOf(values));
98
95
  target.seenLevels.clear();
99
96
  for (const level of source.seenLevels) target.seenLevels.add(level);
100
- target.restartedNumIds = new Set(source.restartedNumIds);
101
- target.previousList = { ...source.previousList ?? {
102
- abstractNumId: null,
103
- fromStyle: false,
104
- numId: null
105
- } };
106
97
  if (source.lastAdvancedNumId === void 0) delete target.lastAdvancedNumId;
107
98
  else target.lastAdvancedNumId = source.lastAdvancedNumId;
108
99
  };
@@ -1,5 +1,5 @@
1
1
  import { FOLIO_INSERTED_PICTURE_FRAME_LOCKS } from "../../../docx/graphicFrameLocks.js";
2
- import { getStandaloneClipboardImageFiles } from "../../../utils/clipboard.js";
2
+ import { getStandaloneClipboardImageFiles } from "../../../utils/clipboardFiles.js";
3
3
  import { isSafeImageFile } from "../../../utils/imageValidation.js";
4
4
  import { sanitizeImageSrc } from "../../../utils/sanitizeImageSrc.js";
5
5
  import { createExtension } from "../create.js";
@@ -5,13 +5,8 @@ import { ParagraphAttrs } from "./schema/nodes.js";
5
5
  export type ListCounterState = {
6
6
  counters: Map<number, number[]>;
7
7
  abstractCounters: Map<number, number[]>;
8
+ /** The levels of list instances a paragraph has used, as `numId:level`. */
8
9
  seenLevels: Set<string>;
9
- restartedNumIds?: Set<number>;
10
- previousList?: {
11
- abstractNumId: number | null;
12
- fromStyle: boolean;
13
- numId: number | null;
14
- };
15
10
  lastAdvancedNumId?: number;
16
11
  };
17
12
  export type ListCounterStreams = {
@@ -30,13 +30,7 @@ function createListCounterState() {
30
30
  return {
31
31
  counters: /* @__PURE__ */ new Map(),
32
32
  abstractCounters: /* @__PURE__ */ new Map(),
33
- seenLevels: /* @__PURE__ */ new Set(),
34
- restartedNumIds: /* @__PURE__ */ new Set(),
35
- previousList: {
36
- abstractNumId: null,
37
- fromStyle: false,
38
- numId: null
39
- }
33
+ seenLevels: /* @__PURE__ */ new Set()
40
34
  };
41
35
  }
42
36
  function cloneListCounterState(state) {
@@ -56,12 +50,6 @@ function cloneListCounterState(state) {
56
50
  counters,
57
51
  abstractCounters,
58
52
  seenLevels: new Set(state.seenLevels),
59
- restartedNumIds: new Set(state.restartedNumIds ?? []),
60
- previousList: { ...state.previousList ?? {
61
- abstractNumId: null,
62
- fromStyle: false,
63
- numId: null
64
- } },
65
53
  ...state.lastAdvancedNumId !== void 0 ? { lastAdvancedNumId: state.lastAdvancedNumId } : {}
66
54
  };
67
55
  }
@@ -142,14 +130,7 @@ function formatNumberedMarker(counters, level) {
142
130
  return parts.length === 0 ? "1." : `${parts.join(".")}.`;
143
131
  }
144
132
  function advanceListMarker(attrs, state) {
145
- if (!hasListRendering(attrs)) {
146
- state.previousList = {
147
- abstractNumId: null,
148
- fromStyle: false,
149
- numId: null
150
- };
151
- return null;
152
- }
133
+ if (!hasListRendering(attrs)) return null;
153
134
  const markerTemplate = attrs.listMarkerTemplate ?? attrs.listMarker;
154
135
  const foldedMarkerSuffix = attrs.listFoldedMarkerSuffix ?? void 0;
155
136
  const effectiveNumbering = effectiveParagraphNumbering(paragraphNumberingSourcesFromBoundary({
@@ -170,44 +151,16 @@ function advanceListMarker(attrs, state) {
170
151
  forceDecimal: attrs.listIsLegal
171
152
  });
172
153
  }
173
- state.previousList = {
174
- abstractNumId: null,
175
- fromStyle: false,
176
- numId: null
177
- };
178
154
  return marker;
179
155
  }
180
156
  if (attrs.listIsBullet) {
181
- state.previousList = {
182
- abstractNumId: null,
183
- fromStyle: false,
184
- numId: null
185
- };
186
157
  if (foldedMarkerSuffix !== void 0 && attrs.listMarkerTemplate == null) return attrs.listMarker ?? null;
187
158
  const marker = convertBulletToUnicode(attrs.listMarkerTemplate ?? attrs.listMarker ?? "", bulletMarkerFontName(attrs.listMarkerFormatting));
188
159
  return foldedMarkerSuffix === void 0 ? marker : `${marker}\t${foldedMarkerSuffix}`;
189
160
  }
190
- const firstInstanceEncounter = !state.counters.has(numId);
191
- let counters = state.counters.get(numId) ?? Array.from({ length: 9 }, () => NaN);
192
161
  const abstractNumId = attrs.listAbstractNumId;
193
- const previousList = state.previousList ?? {
194
- abstractNumId: null,
195
- fromStyle: false,
196
- numId: null
197
- };
198
- const restartedNumIds = state.restartedNumIds ??= /* @__PURE__ */ new Set();
199
- const latestAbstractCounters = abstractNumId === void 0 ? void 0 : state.abstractCounters.get(abstractNumId);
200
- const styleNumbering = attrs.numPr?.kind !== "reference" && attrs.numPrFromStyle?.kind === "reference";
201
- const resumesRestartedInstance = firstInstanceEncounter && attrs.listStartOverride == null && abstractNumId !== void 0 && previousList.abstractNumId === abstractNumId && previousList.numId !== null && previousList.numId !== numId && restartedNumIds.has(previousList.numId);
202
- const resumesStyleInstance = firstInstanceEncounter && !styleNumbering && attrs.listStartOverride == null && abstractNumId !== void 0 && previousList.abstractNumId === abstractNumId && previousList.fromStyle;
203
- if (latestAbstractCounters && (styleNumbering || resumesRestartedInstance || resumesStyleInstance)) counters = latestAbstractCounters;
204
- if (attrs.listStartOverride != null || resumesRestartedInstance || previousList.numId === numId && restartedNumIds.has(numId)) restartedNumIds.add(numId);
205
- if (level > 0) {
206
- if (counters.slice(0, level).every((counter) => !Number.isFinite(counter))) for (let index = 0; index < level; index += 1) {
207
- const latestCounter = latestAbstractCounters?.[index];
208
- counters[index] = latestCounter !== void 0 && Number.isFinite(latestCounter) ? latestCounter : attrs.listLevelStarts?.[index] ?? 1;
209
- }
210
- }
162
+ const counters = (abstractNumId === void 0 ? void 0 : state.abstractCounters.get(abstractNumId)) ?? state.counters.get(numId) ?? Array.from({ length: 9 }, () => NaN);
163
+ for (let index = 0; index < level; index += 1) if (!Number.isFinite(counters[index])) counters[index] = attrs.listLevelStarts?.[index] ?? 1;
211
164
  const seenKey = `${numId}:${level}`;
212
165
  if (!state.seenLevels.has(seenKey)) {
213
166
  state.seenLevels.add(seenKey);
@@ -224,11 +177,6 @@ function advanceListMarker(attrs, state) {
224
177
  state.counters.set(numId, counters);
225
178
  state.lastAdvancedNumId = numId;
226
179
  if (abstractNumId !== void 0) state.abstractCounters.set(abstractNumId, counters);
227
- state.previousList = {
228
- abstractNumId: abstractNumId ?? null,
229
- fromStyle: Boolean(styleNumbering),
230
- numId
231
- };
232
180
  const levelFormats = attrs.listLevelNumFmts ?? (attrs.listNumFmt ? [attrs.listNumFmt] : void 0);
233
181
  if (markerTemplate?.includes("%") && (foldedMarkerSuffix === void 0 || attrs.listMarkerTemplate != null)) {
234
182
  const marker = resolveListTemplate({
package/dist/server.d.ts CHANGED
@@ -36,7 +36,7 @@ import { FOLIO_DOCX_PACKAGE_INSPECTION_DEFAULTS, FOLIO_DOCX_PACKAGE_INSPECTION_E
36
36
  import { applyTemplatePlan } from "./docx/server/templatePlan/apply.js";
37
37
  import { analyzeDocxBlocks } from "./docx/server/templatePlan/blocks.js";
38
38
  import { inspectDocxTemplate } from "./docx/server/templatePlan/inspect.js";
39
- import { ApplyTemplatePlanArgs, ApplyTemplatePlanOptions, ApplyTemplatePlanResult, DocxBlock, DocxBlockManifest, DocxBlockNumbering, DocxNote, DocxTableCell, DocxTemplateBookmark, DocxTemplateField, DocxTemplateInspection, DocxTemplateNumbering, DocxTemplateNumberingLevel, DocxTemplateSection, DocxTemplateStyle, TEMPLATE_PLAN_ERROR_CODES, TemplatePlan, TemplatePlanBlockResult, TemplatePlanError, TemplatePlanErrorCode, TemplatePlanFieldLeftover, TemplatePlanHighlight, TemplatePlanIssue, TemplatePlanItem, TemplatePlanMerge, TemplatePlanNestedParagraph, TemplatePlanNoteCounts, TemplatePlanNumbering, TemplatePlanNumberingPatch, TemplatePlanOmitReason, TemplatePlanReference, TemplatePlanReferenceResult, TemplatePlanReport, TemplatePlanSourceItem, TemplatePlanSpanCounts, VerifyTemplatePlanOutputArgs } from "./docx/server/templatePlan/types.js";
39
+ import { ApplyTemplatePlanArgs, ApplyTemplatePlanOptions, ApplyTemplatePlanResult, DocxBlock, DocxBlockManifest, DocxBlockNumbering, DocxCompat, DocxNote, DocxSection, DocxTableCell, DocxTemplateBookmark, DocxTemplateField, DocxTemplateInspection, DocxTemplateNumbering, DocxTemplateNumberingLevel, DocxTemplateSection, DocxTemplateStyle, TEMPLATE_PLAN_ERROR_CODES, TemplatePlan, TemplatePlanBlockResult, TemplatePlanError, TemplatePlanErrorCode, TemplatePlanFieldLeftover, TemplatePlanHighlight, TemplatePlanIssue, TemplatePlanItem, TemplatePlanMerge, TemplatePlanNestedParagraph, TemplatePlanNoteCounts, TemplatePlanNumbering, TemplatePlanNumberingPatch, TemplatePlanOmitReason, TemplatePlanReference, TemplatePlanReferenceResult, TemplatePlanReport, TemplatePlanSection, TemplatePlanSectionPage, TemplatePlanSourceItem, TemplatePlanSpanCounts, VerifyTemplatePlanOutputArgs } from "./docx/server/templatePlan/types.js";
40
40
  import { verifyTemplatePlanOutput } from "./docx/server/templatePlan/verify.js";
41
41
  import { FOLIO_DOCX_CONFORMANCE_CHECKS, FOLIO_DOCX_CONFORMANCE_ISSUE_CODES, FOLIO_DOCX_CONFORMANCE_PROFILE, FOLIO_DOCX_CONFORMANCE_REPORT_VERSION, FolioDocxConformanceCheck, FolioDocxConformanceCheckId, FolioDocxConformanceCheckStatus, FolioDocxConformanceIssue, FolioDocxConformanceIssueCode, FolioDocxConformanceReport, FolioDocxConformanceStatus, ValidateDocxConformanceOptions, validateDocxConformance } from "./docx/server/validateDocxConformance.js";
42
42
  import { GenerateRedlineDocxOptions, GenerateRedlineDocxResourceImportError, GenerateRedlineDocxResult, GenerateRedlineReferenceWarning, GenerateRedlineUnprocessedStory, InvalidGenerateRedlineDocxOptionsError, generateRedlineDocx } from "./redline.js";
@@ -46,4 +46,4 @@ import { DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, DocumentPreset, Do
46
46
  import { DeriveBlockIdInput, FolioBlockId, deriveBlockId, getFolioParaIdFromBlockId, isFolioBlockId, isSequentialFolioBlockId } from "./types/block-id.js";
47
47
  import { CreateEmptyDocumentOptions, createEmptyDocument } from "./utils/createDocument.js";
48
48
  import { FOLIO_VERSION_COMPARISON_PRIVACY_TRANSFORMS, FOLIO_VERSION_COMPARISON_SCOPES, FolioBlockDiff, FolioBlockProperty, FolioCompareDocxVersionsOptions, FolioDocumentMetadataValue, FolioFormatProperty, FolioMetadataDiff, FolioStoryDiff, FolioVersionBlockHandle, FolioVersionChangeProperty, FolioVersionComparisonPrivacyTransform, FolioVersionComparisonScope, FolioVersionDiff, FolioVersionDiffPrivacyOptions, FolioVersionDiffPrivacyReport, FolioVersionDiffSegment, FolioVersionDiffSummaryCounts, InvalidFolioVersionComparisonOptionsError, applyFolioVersionDiffPrivacy, compareDocxVersions, isFolioVersionComparisonPrivacyTransform, isFolioVersionComparisonScope } from "./version-comparison.js";
49
- export { type ApplyDocxXmlPatchProposalArgs, type ApplyFolioAIEditsToBufferOptions, type ApplyFolioAIEditsToBufferResult, type ApplyTemplatePlanArgs, type ApplyTemplatePlanOptions, type ApplyTemplatePlanResult, BILINGUAL_TABLE_LAYOUTS, type BilingualBorders, type BilingualParagraphRef, type BilingualRow, type BilingualRowKind, type BilingualTableLayout, type BilingualTableParagraphRef, type ChangeListFormatOptions, type CreateBilingualDocumentOptions, type CreateBilingualDocumentResult, type CreateBilingualDocxOptions, type CreateBilingualDocxResult, type CreateCommentReplyInput, type CreateEmptyDocumentOptions, DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, type DeriveBlockIdInput, type DocumentPreset, type DocumentPropertiesOptions, type DocumentStyleCatalog, type DocumentStyleCatalogEntry, type DocumentStyleSet, DocxArchiveError, type DocxArchiveOptions, type DocxBlock, type DocxBlockManifest, type DocxBlockNumbering, type DocxNote, type DocxParagraphSource, type DocxTableCell, type DocxTableRowKind, type DocxTableRowPosition, type DocxTemplateBookmark, type DocxTemplateField, type DocxTemplateInspection, type DocxTemplateNumbering, type DocxTemplateNumberingLevel, type DocxTemplateSection, type DocxTemplateStyle, EnsureParaIdsError, type EnsureParaIdsOptions, type EnsureParaIdsResult, type EvaluateDocxXmlPatchProposalArgs, type ExtractDocumentStyleSetOptions, type ExtractDocxTextOptions, type ExtractedDocxParagraph, type ExtractedDocxTableCell, type ExtractedDocxTableCellParagraph, type ExtractedDocxText, FOLIO_DOCUMENT_METADATA_PROPERTIES, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_BATCH_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_KEYS_BY_TYPE, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FOLIO_DOCUMENT_PRIVACY_TRANSFORMS, FOLIO_DOCX_CONFORMANCE_CHECKS, FOLIO_DOCX_CONFORMANCE_ISSUE_CODES, FOLIO_DOCX_CONFORMANCE_PROFILE, FOLIO_DOCX_CONFORMANCE_REPORT_VERSION, FOLIO_DOCX_PACKAGE_INSPECTION_DEFAULTS, FOLIO_DOCX_PACKAGE_INSPECTION_ERROR_CODES, FOLIO_DOCX_PACKAGE_INSPECTION_VERSION, FOLIO_DOCX_XML_PATCH_APPLICATION_PROFILE, FOLIO_DOCX_XML_PATCH_APPLICATION_VERSION, FOLIO_DOCX_XML_PATCH_PROPOSAL_DEFAULTS, FOLIO_DOCX_XML_PATCH_PROPOSAL_ISSUE_CODES, FOLIO_DOCX_XML_PATCH_PROPOSAL_PROFILE, FOLIO_DOCX_XML_PATCH_PROPOSAL_VERSION, FOLIO_EXISTING_REVISION_POLICIES, FOLIO_HIGHLIGHT_COLOR_VALUES, FOLIO_LINE_SPACING_RULE_VALUES, FOLIO_LIST_NUMBER_FORMAT_VALUES, FOLIO_PAGE_BREAK_CLEAR_VALUES, FOLIO_PARAGRAPH_ALIGNMENT_VALUES, FOLIO_RESOLVED_REVIEWED_VIEWS, FOLIO_REVIEWED_VIEWS, FOLIO_VERSION_COMPARISON_PRIVACY_TRANSFORMS, FOLIO_VERSION_COMPARISON_SCOPES, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIBlockStructuralBoundary, type FolioAIComment, type FolioAIDiagnosticBlock, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditNormalization, type FolioAIEditNormalizationCode, type FolioAIEditOperation, type FolioAIEditPrecondition, type FolioAIEditSnapshot, type FolioAIInlineBooleanProperty, type FolioAIInlineFormatting, type FolioAIInlineFormattingPatch, type FolioAIParagraphBlock, type FolioAIParagraphSpacing, type FolioAITextRangeHandle, type FolioAbsorbedBlock, type FolioApplyDocumentOperationsOptions, type FolioApplyDocumentOperationsToStoryOptions, type FolioApplyOperationsOptions, type FolioBlockDiff, type FolioBlockId, type FolioBlockProperty, type FolioCompareDocxVersionsOptions, type FolioContentParagraphKind, type FolioDocumentMetadataProperty, type FolioDocumentMetadataValue, type FolioDocumentNavigationTarget, type FolioDocumentOperation, type FolioDocumentOperationAffectedTarget, type FolioDocumentOperationBatch, type FolioDocumentOperationBatchInput, type FolioDocumentOperationBatchPrecondition, type FolioDocumentOperationCapabilities, type FolioDocumentOperationIssue, type FolioDocumentOperationMode, type FolioDocumentOperationPrecondition, type FolioDocumentOperationQueuedOperation, type FolioDocumentOperationReceipt, type FolioDocumentOperationRecovery, type FolioDocumentOperationResult, type FolioDocumentOperationResultBase, type FolioDocumentOperationStatus, type FolioDocumentOperationStory, type FolioDocumentOperationType, type FolioDocumentOperationUndoFailureReason, type FolioDocumentOperationUndoHandle, type FolioDocumentOperationUndoResult, type FolioDocumentOutline, type FolioDocumentOutlineEntry, FolioDocumentPrivacyArchiveError, type FolioDocumentPrivacyOptions, type FolioDocumentPrivacyReport, type FolioDocumentPrivacyTransform, type FolioDocumentSection, type FolioDocumentSectionHandle, type FolioDocumentSectionReadResult, type FolioDocumentStory, type FolioDocumentStoryHandle, FolioDocumentStoryNotFoundError, type FolioDocxConformanceCheck, type FolioDocxConformanceCheckId, type FolioDocxConformanceCheckStatus, type FolioDocxConformanceIssue, type FolioDocxConformanceIssueCode, type FolioDocxConformanceReport, type FolioDocxConformanceStatus, type FolioDocxInspectedXmlPart, type FolioDocxPackageInspection, FolioDocxPackageInspectionError, type FolioDocxPackageInspectionErrorCode, type FolioDocxPackageInspectionLimits, type FolioDocxPackagePart, type FolioDocxPackagePartKind, type FolioDocxPreparedXmlReplacement, FolioDocxReviewer, type FolioDocxReviewerOptions, type FolioDocxXmlPatchApplication, FolioDocxXmlPatchApplicationError, type FolioDocxXmlPatchApplicationReceipt, type FolioDocxXmlPatchProposal, type FolioDocxXmlPatchProposalEvaluation, type FolioDocxXmlPatchProposalIssue, type FolioDocxXmlPatchProposalIssueCode, type FolioDocxXmlPatchProposalLimits, type FolioDocxXmlReplacement, type FolioEditableDocumentStoryHandle, type FolioFormatProperty, type FolioMetadataDiff, type FolioReadReviewedStoryOptions, type FolioResolveReviewedStoryOptions, type FolioResolvedReviewedView, type FolioReviewChange, type FolioReviewChangeFilter, type FolioReviewChangeKind, type FolioReviewComment, type FolioReviewCommentFilter, type FolioReviewCommentReply, type FolioReviewReplyInput, type FolioReviewResolution, type FolioReviewResolutionSkip, type FolioReviewedStory, type FolioReviewedView, type FolioReviewerRepackReason, type FolioReviewerSaveOptions, type FolioReviewerSaveResult, type FolioRevisionStamp, FolioRoomJournalError, type FolioStoryDiff, type FolioVersionBlockHandle, type FolioVersionChangeProperty, type FolioVersionComparisonPrivacyTransform, type FolioVersionComparisonScope, type FolioVersionDiff, type FolioVersionDiffPrivacyOptions, type FolioVersionDiffPrivacyReport, type FolioVersionDiffSegment, type FolioVersionDiffSummaryCounts, type GenerateRedlineDocxOptions, GenerateRedlineDocxResourceImportError, type GenerateRedlineDocxResult, type GenerateRedlineReferenceWarning, type GenerateRedlineUnprocessedStory, HEADING_LEVELS, type HeadingLevel, type InspectDocxPackageOptions, InvalidBilingualDocumentOptionsError, InvalidFolioDocumentOperationBatchError, InvalidFolioDocumentPrivacyOptionsError, InvalidFolioDocxXmlPatchProposalError, InvalidFolioDocxXmlPatchProposalOptionsError, InvalidFolioReportBuilderOptionsError, InvalidFolioVersionComparisonOptionsError, InvalidGenerateRedlineDocxOptionsError, type ParseOptions, type RewriteDocxMetadataPrivacyResult, STELLA_STYLE_SET_NAME, TEMPLATE_PLAN_ERROR_CODES, type TableCellSpec, type TemplatePlan, type TemplatePlanBlockResult, TemplatePlanError, type TemplatePlanErrorCode, type TemplatePlanFieldLeftover, type TemplatePlanHighlight, type TemplatePlanIssue, type TemplatePlanItem, type TemplatePlanMerge, type TemplatePlanNestedParagraph, type TemplatePlanNoteCounts, type TemplatePlanNumbering, type TemplatePlanNumberingPatch, type TemplatePlanOmitReason, type TemplatePlanReference, type TemplatePlanReferenceResult, type TemplatePlanReport, type TemplatePlanSourceItem, type TemplatePlanSpanCounts, UnsupportedFolioDocumentOperationVersionError, UnsupportedFolioDocxXmlPatchApplicationProfileError, UnsupportedFolioReviewedViewError, type ValidateDocxConformanceOptions, type VerifyTemplatePlanOutputArgs, analyzeDocxBlocks, applyDocxXmlPatchProposal, applyFolioAIEditsToBuffer, applyFolioVersionDiffPrivacy, applyTemplatePlan, assertSupportedFolioDocumentOperationVersion, bookmark, changeListFormat, compareDocxVersions, createBilingualDocument, createBilingualDocx, createDocx, createEmptyDocument, createFolioAITextRangeHandle, createStellaStyleDocumentPreset, createStellaStyleSet, createTableOfContentsField, deriveBlockId, docxToMarkdown, endnote, ensureParaIds, evaluateDocxXmlPatchProposal, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, extractDocxText, generateRedlineDocx, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioDocumentOperationRemovedBlockIds, getFolioDocumentOutline, getFolioParaIdFromBlockId, getTrackedFolioDocumentOperationRemovedBlockIds, hashFolioAIBlockText, heading, hyperlink, inspectDocumentStyles, inspectDocumentStylesFromDocx, inspectDocxPackage, inspectDocxTemplate, isFolioAIContentBlock, isFolioBlockId, isFolioDocumentOperationModeSupported, isFolioDocumentPrivacyTransform, isFolioResolvedReviewedView, isFolioReviewedView, isFolioVersionComparisonPrivacyTransform, isFolioVersionComparisonScope, isSequentialFolioBlockId, isSupportedFolioDocumentOperationVersion, normalizeFolioAIBlockText, pageBreak, paragraph, parseDocx, parseFolioDocumentOperationBatch, parseFolioDocxXmlPatchProposal, readBilingualDocument, readBilingualDocx, readFolioDocumentSection, replyToComment, rewriteDocxMetadataPrivacy, run, table, validateDocxConformance, verifyTemplatePlanOutput };
49
+ export { type ApplyDocxXmlPatchProposalArgs, type ApplyFolioAIEditsToBufferOptions, type ApplyFolioAIEditsToBufferResult, type ApplyTemplatePlanArgs, type ApplyTemplatePlanOptions, type ApplyTemplatePlanResult, BILINGUAL_TABLE_LAYOUTS, type BilingualBorders, type BilingualParagraphRef, type BilingualRow, type BilingualRowKind, type BilingualTableLayout, type BilingualTableParagraphRef, type ChangeListFormatOptions, type CreateBilingualDocumentOptions, type CreateBilingualDocumentResult, type CreateBilingualDocxOptions, type CreateBilingualDocxResult, type CreateCommentReplyInput, type CreateEmptyDocumentOptions, DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, type DeriveBlockIdInput, type DocumentPreset, type DocumentPropertiesOptions, type DocumentStyleCatalog, type DocumentStyleCatalogEntry, type DocumentStyleSet, DocxArchiveError, type DocxArchiveOptions, type DocxBlock, type DocxBlockManifest, type DocxBlockNumbering, type DocxCompat, type DocxNote, type DocxParagraphSource, type DocxSection, type DocxTableCell, type DocxTableRowKind, type DocxTableRowPosition, type DocxTemplateBookmark, type DocxTemplateField, type DocxTemplateInspection, type DocxTemplateNumbering, type DocxTemplateNumberingLevel, type DocxTemplateSection, type DocxTemplateStyle, EnsureParaIdsError, type EnsureParaIdsOptions, type EnsureParaIdsResult, type EvaluateDocxXmlPatchProposalArgs, type ExtractDocumentStyleSetOptions, type ExtractDocxTextOptions, type ExtractedDocxParagraph, type ExtractedDocxTableCell, type ExtractedDocxTableCellParagraph, type ExtractedDocxText, FOLIO_DOCUMENT_METADATA_PROPERTIES, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_BATCH_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_KEYS_BY_TYPE, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FOLIO_DOCUMENT_PRIVACY_TRANSFORMS, FOLIO_DOCX_CONFORMANCE_CHECKS, FOLIO_DOCX_CONFORMANCE_ISSUE_CODES, FOLIO_DOCX_CONFORMANCE_PROFILE, FOLIO_DOCX_CONFORMANCE_REPORT_VERSION, FOLIO_DOCX_PACKAGE_INSPECTION_DEFAULTS, FOLIO_DOCX_PACKAGE_INSPECTION_ERROR_CODES, FOLIO_DOCX_PACKAGE_INSPECTION_VERSION, FOLIO_DOCX_XML_PATCH_APPLICATION_PROFILE, FOLIO_DOCX_XML_PATCH_APPLICATION_VERSION, FOLIO_DOCX_XML_PATCH_PROPOSAL_DEFAULTS, FOLIO_DOCX_XML_PATCH_PROPOSAL_ISSUE_CODES, FOLIO_DOCX_XML_PATCH_PROPOSAL_PROFILE, FOLIO_DOCX_XML_PATCH_PROPOSAL_VERSION, FOLIO_EXISTING_REVISION_POLICIES, FOLIO_HIGHLIGHT_COLOR_VALUES, FOLIO_LINE_SPACING_RULE_VALUES, FOLIO_LIST_NUMBER_FORMAT_VALUES, FOLIO_PAGE_BREAK_CLEAR_VALUES, FOLIO_PARAGRAPH_ALIGNMENT_VALUES, FOLIO_RESOLVED_REVIEWED_VIEWS, FOLIO_REVIEWED_VIEWS, FOLIO_VERSION_COMPARISON_PRIVACY_TRANSFORMS, FOLIO_VERSION_COMPARISON_SCOPES, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIBlockStructuralBoundary, type FolioAIComment, type FolioAIDiagnosticBlock, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditNormalization, type FolioAIEditNormalizationCode, type FolioAIEditOperation, type FolioAIEditPrecondition, type FolioAIEditSnapshot, type FolioAIInlineBooleanProperty, type FolioAIInlineFormatting, type FolioAIInlineFormattingPatch, type FolioAIParagraphBlock, type FolioAIParagraphSpacing, type FolioAITextRangeHandle, type FolioAbsorbedBlock, type FolioApplyDocumentOperationsOptions, type FolioApplyDocumentOperationsToStoryOptions, type FolioApplyOperationsOptions, type FolioBlockDiff, type FolioBlockId, type FolioBlockProperty, type FolioCompareDocxVersionsOptions, type FolioContentParagraphKind, type FolioDocumentMetadataProperty, type FolioDocumentMetadataValue, type FolioDocumentNavigationTarget, type FolioDocumentOperation, type FolioDocumentOperationAffectedTarget, type FolioDocumentOperationBatch, type FolioDocumentOperationBatchInput, type FolioDocumentOperationBatchPrecondition, type FolioDocumentOperationCapabilities, type FolioDocumentOperationIssue, type FolioDocumentOperationMode, type FolioDocumentOperationPrecondition, type FolioDocumentOperationQueuedOperation, type FolioDocumentOperationReceipt, type FolioDocumentOperationRecovery, type FolioDocumentOperationResult, type FolioDocumentOperationResultBase, type FolioDocumentOperationStatus, type FolioDocumentOperationStory, type FolioDocumentOperationType, type FolioDocumentOperationUndoFailureReason, type FolioDocumentOperationUndoHandle, type FolioDocumentOperationUndoResult, type FolioDocumentOutline, type FolioDocumentOutlineEntry, FolioDocumentPrivacyArchiveError, type FolioDocumentPrivacyOptions, type FolioDocumentPrivacyReport, type FolioDocumentPrivacyTransform, type FolioDocumentSection, type FolioDocumentSectionHandle, type FolioDocumentSectionReadResult, type FolioDocumentStory, type FolioDocumentStoryHandle, FolioDocumentStoryNotFoundError, type FolioDocxConformanceCheck, type FolioDocxConformanceCheckId, type FolioDocxConformanceCheckStatus, type FolioDocxConformanceIssue, type FolioDocxConformanceIssueCode, type FolioDocxConformanceReport, type FolioDocxConformanceStatus, type FolioDocxInspectedXmlPart, type FolioDocxPackageInspection, FolioDocxPackageInspectionError, type FolioDocxPackageInspectionErrorCode, type FolioDocxPackageInspectionLimits, type FolioDocxPackagePart, type FolioDocxPackagePartKind, type FolioDocxPreparedXmlReplacement, FolioDocxReviewer, type FolioDocxReviewerOptions, type FolioDocxXmlPatchApplication, FolioDocxXmlPatchApplicationError, type FolioDocxXmlPatchApplicationReceipt, type FolioDocxXmlPatchProposal, type FolioDocxXmlPatchProposalEvaluation, type FolioDocxXmlPatchProposalIssue, type FolioDocxXmlPatchProposalIssueCode, type FolioDocxXmlPatchProposalLimits, type FolioDocxXmlReplacement, type FolioEditableDocumentStoryHandle, type FolioFormatProperty, type FolioMetadataDiff, type FolioReadReviewedStoryOptions, type FolioResolveReviewedStoryOptions, type FolioResolvedReviewedView, type FolioReviewChange, type FolioReviewChangeFilter, type FolioReviewChangeKind, type FolioReviewComment, type FolioReviewCommentFilter, type FolioReviewCommentReply, type FolioReviewReplyInput, type FolioReviewResolution, type FolioReviewResolutionSkip, type FolioReviewedStory, type FolioReviewedView, type FolioReviewerRepackReason, type FolioReviewerSaveOptions, type FolioReviewerSaveResult, type FolioRevisionStamp, FolioRoomJournalError, type FolioStoryDiff, type FolioVersionBlockHandle, type FolioVersionChangeProperty, type FolioVersionComparisonPrivacyTransform, type FolioVersionComparisonScope, type FolioVersionDiff, type FolioVersionDiffPrivacyOptions, type FolioVersionDiffPrivacyReport, type FolioVersionDiffSegment, type FolioVersionDiffSummaryCounts, type GenerateRedlineDocxOptions, GenerateRedlineDocxResourceImportError, type GenerateRedlineDocxResult, type GenerateRedlineReferenceWarning, type GenerateRedlineUnprocessedStory, HEADING_LEVELS, type HeadingLevel, type InspectDocxPackageOptions, InvalidBilingualDocumentOptionsError, InvalidFolioDocumentOperationBatchError, InvalidFolioDocumentPrivacyOptionsError, InvalidFolioDocxXmlPatchProposalError, InvalidFolioDocxXmlPatchProposalOptionsError, InvalidFolioReportBuilderOptionsError, InvalidFolioVersionComparisonOptionsError, InvalidGenerateRedlineDocxOptionsError, type ParseOptions, type RewriteDocxMetadataPrivacyResult, STELLA_STYLE_SET_NAME, TEMPLATE_PLAN_ERROR_CODES, type TableCellSpec, type TemplatePlan, type TemplatePlanBlockResult, TemplatePlanError, type TemplatePlanErrorCode, type TemplatePlanFieldLeftover, type TemplatePlanHighlight, type TemplatePlanIssue, type TemplatePlanItem, type TemplatePlanMerge, type TemplatePlanNestedParagraph, type TemplatePlanNoteCounts, type TemplatePlanNumbering, type TemplatePlanNumberingPatch, type TemplatePlanOmitReason, type TemplatePlanReference, type TemplatePlanReferenceResult, type TemplatePlanReport, type TemplatePlanSection, type TemplatePlanSectionPage, type TemplatePlanSourceItem, type TemplatePlanSpanCounts, UnsupportedFolioDocumentOperationVersionError, UnsupportedFolioDocxXmlPatchApplicationProfileError, UnsupportedFolioReviewedViewError, type ValidateDocxConformanceOptions, type VerifyTemplatePlanOutputArgs, analyzeDocxBlocks, applyDocxXmlPatchProposal, applyFolioAIEditsToBuffer, applyFolioVersionDiffPrivacy, applyTemplatePlan, assertSupportedFolioDocumentOperationVersion, bookmark, changeListFormat, compareDocxVersions, createBilingualDocument, createBilingualDocx, createDocx, createEmptyDocument, createFolioAITextRangeHandle, createStellaStyleDocumentPreset, createStellaStyleSet, createTableOfContentsField, deriveBlockId, docxToMarkdown, endnote, ensureParaIds, evaluateDocxXmlPatchProposal, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, extractDocxText, generateRedlineDocx, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioDocumentOperationRemovedBlockIds, getFolioDocumentOutline, getFolioParaIdFromBlockId, getTrackedFolioDocumentOperationRemovedBlockIds, hashFolioAIBlockText, heading, hyperlink, inspectDocumentStyles, inspectDocumentStylesFromDocx, inspectDocxPackage, inspectDocxTemplate, isFolioAIContentBlock, isFolioBlockId, isFolioDocumentOperationModeSupported, isFolioDocumentPrivacyTransform, isFolioResolvedReviewedView, isFolioReviewedView, isFolioVersionComparisonPrivacyTransform, isFolioVersionComparisonScope, isSequentialFolioBlockId, isSupportedFolioDocumentOperationVersion, normalizeFolioAIBlockText, pageBreak, paragraph, parseDocx, parseFolioDocumentOperationBatch, parseFolioDocxXmlPatchProposal, readBilingualDocument, readBilingualDocx, readFolioDocumentSection, replyToComment, rewriteDocxMetadataPrivacy, run, table, validateDocxConformance, verifyTemplatePlanOutput };
@@ -1,14 +1,9 @@
1
1
  /** Remaining seams to retire before the canonical session becomes the only authority. */
2
2
  export declare const CANONICAL_GAP: {
3
- readonly authorityRouting: "authority-routing";
4
3
  readonly commands: "command-descriptors";
5
4
  readonly trackedTableStructure: "tracked-table-structure";
6
5
  readonly storyContentProjection: "story-content-projection";
7
- readonly comments: "comment-model-edits";
8
- readonly modelEdits: "direct-model-edits";
9
- readonly sectionProperties: "section-properties";
10
- readonly dispatch: "unclassified-transactions";
11
- readonly saveSerialization: "save-serialization";
6
+ readonly trackedChangeRecords: "tracked-change-records";
12
7
  readonly publicComments: "publicOps.comments";
13
8
  readonly publicUnsupportedInline: "publicOps.unsupportedInline";
14
9
  readonly commentReplacementAlignment: "comment-replacement-alignment";
@@ -29,39 +24,63 @@ export declare const CANONICAL_RULE_MESSAGE_KEYS: {
29
24
  readonly contentControlLock: "editor.contentLocked";
30
25
  readonly linkSuggestionShape: "editor.linkSuggestionUnavailable";
31
26
  };
27
+ /**
28
+ * Conditions of the session or of the request, not of the document: the
29
+ * session holds the capability, but cannot make this change now or was not
30
+ * asked for one it can make. A refusal under one is correct and is never a gap
31
+ * to retire.
32
+ */
33
+ export declare const CANONICAL_CONDITION: {
34
+ readonly notReady: "notReady";
35
+ readonly notEditable: "notEditable";
36
+ readonly composing: "composing";
37
+ readonly invalidRequest: "invalidRequest";
38
+ readonly idSpace: "idSpace";
39
+ readonly stale: "stale";
40
+ readonly hostTransaction: "hostTransaction";
41
+ readonly internal: "internal";
42
+ };
43
+ export type CanonicalCondition = (typeof CANONICAL_CONDITION)[keyof typeof CANONICAL_CONDITION];
32
44
  /**
33
45
  * The editor message, in the folio catalog, a host shows for a refusal under
34
46
  * any gap: the change cannot be made here yet.
35
47
  */
36
48
  export declare const CANONICAL_GAP_MESSAGE_KEY: "editor.changeUnavailable";
49
+ /**
50
+ * The editor message, in the folio catalog, a host shows for a refusal under
51
+ * any condition: the change was not made.
52
+ */
53
+ export declare const CANONICAL_CONDITION_MESSAGE_KEY: "editor.changeNotApplied";
37
54
  /** A catalog key a refusal notice reads. */
38
- export type CanonicalRefusalMessageKey = (typeof CANONICAL_RULE_MESSAGE_KEYS)[CanonicalRule] | typeof CANONICAL_GAP_MESSAGE_KEY;
55
+ export type CanonicalRefusalMessageKey = (typeof CANONICAL_RULE_MESSAGE_KEYS)[CanonicalRule] | typeof CANONICAL_GAP_MESSAGE_KEY | typeof CANONICAL_CONDITION_MESSAGE_KEY;
39
56
  /**
40
57
  * What a host shows for a refusal, always from the folio catalog, which the
41
58
  * host translates: the editor's own message for a rule the document states,
42
- * and that the change cannot be made here yet for a gap. The session's own
43
- * message describes the refusal for logs and `onError`, never for the user.
59
+ * that the change was not made for a condition, and that the change cannot be
60
+ * made here yet for a gap. The session's own message describes the refusal
61
+ * for logs and `onError`, never for the user.
44
62
  */
45
63
  export declare const canonicalRefusalNotice: (ground: CanonicalRefusalGround, translate: (key: CanonicalRefusalMessageKey) => string) => string;
46
64
  /**
47
- * The ground for a refusal: a capability the session does not have yet, or a
48
- * rule the document or its review records state. A host tells "not supported yet" from "not
49
- * allowed" by which one is present.
65
+ * The ground for a refusal: a capability the session does not have yet, a
66
+ * rule the document or its review records state, or a condition of the
67
+ * session or the request. A host tells "not supported yet" from "not allowed"
68
+ * from "not now" by which one is present.
50
69
  */
51
70
  export type CanonicalRefusalGround = {
52
71
  gap: CanonicalGap;
53
72
  rule?: never;
73
+ condition?: never;
54
74
  } | {
55
75
  rule: CanonicalRule;
56
76
  gap?: never;
77
+ condition?: never;
78
+ } | {
79
+ condition: CanonicalCondition;
80
+ gap?: never;
81
+ rule?: never;
57
82
  };
58
83
  export declare const CANONICAL_CAPABILITIES: {
59
- readonly "authority-routing": {
60
- readonly owner: "controller";
61
- readonly kind: "routing";
62
- readonly adapters: readonly ["react", "vue"];
63
- readonly summary: "Explicit session selection and legacy authority routing.";
64
- };
65
84
  readonly "command-descriptors": {
66
85
  readonly remainingCommands: {
67
86
  readonly registry: "extension-commands";
@@ -83,35 +102,11 @@ export declare const CANONICAL_CAPABILITIES: {
83
102
  readonly adapters: readonly ["react", "vue"];
84
103
  readonly summary: "Unsupported inline, field and review content cannot be projected after canonical edits; pasted embedded blocks, comment and note references copied outside the editor, and compositions over such content refuse.";
85
104
  };
86
- readonly "comment-model-edits": {
87
- readonly owner: "adapters";
88
- readonly kind: "routing";
89
- readonly adapters: readonly ["react", "vue"];
90
- readonly summary: "Legacy sessions retain comment model edits; canonical comments use semantic operations.";
91
- };
92
- readonly "direct-model-edits": {
93
- readonly owner: "adapters";
94
- readonly kind: "refusal";
95
- readonly adapters: readonly ["react", "vue"];
96
- readonly summary: "Direct model and pending-suggestion snapshots bypass the canonical journal.";
97
- };
98
- readonly "section-properties": {
99
- readonly owner: "controller";
100
- readonly kind: "routing";
101
- readonly adapters: readonly ["react", "vue"];
102
- readonly summary: "The shared controller journals section properties; legacy sessions keep model changes.";
103
- };
104
- readonly "unclassified-transactions": {
105
- readonly owner: "controller";
106
- readonly kind: "refusal";
107
- readonly adapters: readonly ["react", "vue"];
108
- readonly summary: "A host plugin or raw dispatch that changes the document is refused, naming the transaction's meta keys; hosts express edits as document operations (applyDocumentOperations).";
109
- };
110
- readonly "save-serialization": {
111
- readonly owner: "controller";
105
+ readonly "tracked-change-records": {
106
+ readonly owner: "document-operations";
112
107
  readonly kind: "refusal";
113
108
  readonly adapters: readonly ["react", "vue"];
114
- readonly summary: "Canonical save waits for composition to finish and reports package serialization refusals and fidelity fallbacks.";
109
+ readonly summary: "A suggested change whose content the tracked-change records cannot express is refused: comment boundaries in a tracked range, paragraph-mark run properties, a join at a section break, a record inside a field.";
115
110
  };
116
111
  readonly "publicOps.comments": {
117
112
  readonly owner: "document-operations";