@stll/folio-core 0.39.1 → 0.41.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 (64) hide show
  1. package/dist/ai-edits/apply.js +6 -4
  2. package/dist/ai-edits/clean-text.d.ts +28 -6
  3. package/dist/ai-edits/clean-text.js +28 -13
  4. package/dist/ai-edits/headless.d.ts +12 -0
  5. package/dist/ai-edits/headless.js +26 -3
  6. package/dist/ai-edits/index.d.ts +2 -2
  7. package/dist/ai-edits/snapshot.d.ts +6 -1
  8. package/dist/ai-edits/snapshot.js +15 -10
  9. package/dist/ai-edits/types.d.ts +19 -6
  10. package/dist/ai-suggestions/text-positions.js +15 -3
  11. package/dist/compare/inline-atoms.js +2 -2
  12. package/dist/compat/eigenpal.d.ts +3 -2
  13. package/dist/compat/eigenpal.js +2 -1
  14. package/dist/display-list/primitives.d.ts +2 -1
  15. package/dist/document-operations.d.ts +24 -23
  16. package/dist/document-operations.js +163 -127
  17. package/dist/docx/blockPlainText.d.ts +8 -0
  18. package/dist/docx/blockPlainText.js +40 -0
  19. package/dist/docx/commentRangeIntegrity.js +0 -1
  20. package/dist/docx/compatibility.d.ts +16 -2
  21. package/dist/docx/compatibility.js +30 -9
  22. package/dist/docx/footnoteParser.js +4 -23
  23. package/dist/docx/graphicFrameLocks.d.ts +22 -0
  24. package/dist/docx/graphicFrameLocks.js +55 -0
  25. package/dist/docx/groupDrawingParser.d.ts +7 -1
  26. package/dist/docx/groupDrawingParser.js +11 -2
  27. package/dist/docx/headerFooterParser.d.ts +5 -1
  28. package/dist/docx/headerFooterParser.js +7 -21
  29. package/dist/docx/headerFooterVerbatim.d.ts +1 -12
  30. package/dist/docx/imageParser.js +5 -0
  31. package/dist/docx/imageRawXml.d.ts +33 -1
  32. package/dist/docx/imageRawXml.js +56 -1
  33. package/dist/docx/numberingParser.d.ts +1 -3
  34. package/dist/docx/runParser.js +43 -21
  35. package/dist/docx/serializer/runSerializer.js +4 -2
  36. package/dist/docx/server/createBilingualDocument.js +31 -5
  37. package/dist/docx/settingsParser.d.ts +2 -6
  38. package/dist/docx/shapeParser.js +32 -6
  39. package/dist/docx/vmlImageParser.d.ts +11 -1
  40. package/dist/docx/vmlImageParser.js +29 -2
  41. package/dist/headless-layout.js +1 -7
  42. package/dist/index.d.ts +3 -2
  43. package/dist/index.js +2 -1
  44. package/dist/internal/compare/inline-presentation.d.ts +11 -3
  45. package/dist/internal/compare/inline-presentation.js +8 -1
  46. package/dist/prosemirror/attrs/index.js +33 -3
  47. package/dist/prosemirror/conversion/fromProseDoc.d.ts +13 -2
  48. package/dist/prosemirror/conversion/fromProseDoc.js +85 -46
  49. package/dist/prosemirror/conversion/index.d.ts +2 -2
  50. package/dist/prosemirror/conversion/toProseDoc.js +12 -21
  51. package/dist/prosemirror/extensions/features/ListExtension.js +2 -1
  52. package/dist/prosemirror/extensions/nodes/ImageExtension.js +6 -0
  53. package/dist/prosemirror/imageCommit.js +7 -3
  54. package/dist/prosemirror/listMarker.d.ts +1 -1
  55. package/dist/prosemirror/listMarker.js +1 -18
  56. package/dist/prosemirror/listRenderingAttrs.d.ts +42 -0
  57. package/dist/prosemirror/listRenderingAttrs.js +80 -0
  58. package/dist/prosemirror/runFormattingInlineCarriers.d.ts +16 -1
  59. package/dist/prosemirror/runFormattingInlineCarriers.js +20 -1
  60. package/dist/prosemirror/schema/marks.d.ts +1 -1
  61. package/dist/prosemirror/schema/nodes.d.ts +20 -0
  62. package/dist/prosemirror/styles/resolvedStyleAttrs.js +2 -14
  63. package/dist/utils/mergeDocumentContent.js +1 -1
  64. package/package.json +2 -2
@@ -1090,6 +1090,7 @@ const buildInsertedParagraphs = ({ item, schema, formattingFromStyle, mode, auth
1090
1090
  suggestionId
1091
1091
  } : {}
1092
1092
  };
1093
+ const formatsEveryParagraph = operation.formattingScope === "allParagraphs";
1093
1094
  const baseAttrs = operation.inheritFormatting === false ? {} : {
1094
1095
  ...stripBlockIdentityAttrs(item.blockNode.attrs),
1095
1096
  _propertyChanges: null,
@@ -1102,6 +1103,7 @@ const buildInsertedParagraphs = ({ item, schema, formattingFromStyle, mode, auth
1102
1103
  let nextRevisionId = revisionSeed;
1103
1104
  for (const [paragraphIndex, text] of insertTexts.entries()) {
1104
1105
  const isFirstParagraph = paragraphIndex === 0;
1106
+ const formatsParagraph = isFirstParagraph || formatsEveryParagraph;
1105
1107
  const marks = [];
1106
1108
  let paragraphRevisionId = null;
1107
1109
  if (producesTrackedChanges && insertionType) {
@@ -1127,11 +1129,11 @@ const buildInsertedParagraphs = ({ item, schema, formattingFromStyle, mode, auth
1127
1129
  text,
1128
1130
  marks
1129
1131
  }) : buildEmphasisInlineContent(schema, text, marks);
1130
- const attrs = isFirstParagraph ? { ...baseAttrs } : {};
1132
+ const attrs = formatsParagraph ? { ...baseAttrs } : {};
1131
1133
  if (isFirstParagraph && operation.pageBreakBefore === true) attrs["pageBreakBefore"] = true;
1132
1134
  const explicitNumbering = operation.numbering;
1133
1135
  const listLevel = operation.listLevel;
1134
- if (isFirstParagraph) {
1136
+ if (formatsParagraph) {
1135
1137
  if (explicitNumbering === null) {
1136
1138
  attrs["numPr"] = null;
1137
1139
  Object.assign(attrs, CLEARED_LIST_RENDERING_ATTRS);
@@ -1160,11 +1162,11 @@ const buildInsertedParagraphs = ({ item, schema, formattingFromStyle, mode, auth
1160
1162
  }
1161
1163
  }
1162
1164
  }
1163
- if (isFirstParagraph && operation.styleId !== void 0) {
1165
+ if (formatsParagraph && operation.styleId !== void 0) {
1164
1166
  attrs["styleId"] = operation.styleId;
1165
1167
  if (operation.inheritFormatting !== false && operation.styleId !== null) Object.assign(attrs, CLEARED_LIST_RENDERING_ATTRS);
1166
1168
  }
1167
- if (isFirstParagraph && (operation.styleId !== void 0 || operation.alignment !== void 0 || operation.spacing !== void 0 || operation.indentation !== void 0)) {
1169
+ if (formatsParagraph && (operation.styleId !== void 0 || operation.alignment !== void 0 || operation.spacing !== void 0 || operation.indentation !== void 0)) {
1168
1170
  const inheritedDirectAlignment = operation.inheritFormatting === false ? void 0 : directParagraphAlignment(expectParagraphAttrs(item.blockNode));
1169
1171
  const inheritedDirectSpacing = operation.inheritFormatting === false ? void 0 : directParagraphSpacing(expectParagraphAttrs(item.blockNode));
1170
1172
  const inheritedDirectIndentation = operation.inheritFormatting === false ? void 0 : directParagraphIndentation(expectParagraphAttrs(item.blockNode));
@@ -44,6 +44,18 @@ type CleanTextStructuralBoundary = {
44
44
  clear?: PageBreakRunAttrs["clear"];
45
45
  /** Whether the post-tracked-changes projection retains this carrier. */
46
46
  presentInCleanView: boolean;
47
+ } | {
48
+ /**
49
+ * A field result: several clean-text characters over a single PM
50
+ * position. Only the whole span is addressable, so a text range may
51
+ * start or end at its edges but never inside it.
52
+ */
53
+ type: "field";
54
+ offset: number;
55
+ /** Characters the result contributes; always greater than one. */
56
+ length: number;
57
+ from: number;
58
+ to: number;
47
59
  };
48
60
  type ResolveCleanTextRangeOptions = {
49
61
  cleanBlock: CleanBlockText;
@@ -51,17 +63,27 @@ type ResolveCleanTextRangeOptions = {
51
63
  endOffset: number;
52
64
  };
53
65
  /**
54
- * Resolve clean-text offsets without selecting a zero-width structural atom.
66
+ * Resolve clean-text offsets without selecting a structural atom.
55
67
  *
56
- * A range wholly on one side of a boundary is biased away from the atom. A
57
- * range spanning both sides is unrepresentable as a generic text selection
58
- * and returns `null`; a structural operation must own that mutation instead.
68
+ * A range wholly on one side of a zero-width boundary is biased away from the
69
+ * atom. A range spanning both sides, or cutting into a field result, is
70
+ * unrepresentable as a generic text selection and returns `null`; a structural
71
+ * operation must own that mutation instead.
59
72
  */
60
73
  declare const resolveCleanTextRange: ({ cleanBlock, startOffset, endOffset }: ResolveCleanTextRangeOptions) => {
61
74
  from: number;
62
75
  to: number;
63
76
  } | null;
64
- declare const buildCleanBlockText: (blockNode: Node, blockFrom: number) => CleanBlockText;
77
+ type BuildCleanBlockTextOptions = {
78
+ /**
79
+ * `"text"` reads a field as the result Word shows, which is the view a reader
80
+ * and the AI reason against. `"omitted"` drops it, which is what an alignment
81
+ * coordinate needs: an atom present on only one side must not shift the
82
+ * offsets that locate it.
83
+ */
84
+ fieldResults: "text" | "omitted";
85
+ };
86
+ declare const buildCleanBlockText: (blockNode: Node, blockFrom: number, { fieldResults }?: BuildCleanBlockTextOptions) => CleanBlockText;
65
87
  /**
66
88
  * A "redline-aware" view of a textblock: the same left-to-right traversal as
67
89
  * {@link buildCleanBlockText}, but every tracked change and comment anchor is
@@ -83,4 +105,4 @@ declare const buildCleanBlockText: (blockNode: Node, blockFrom: number) => Clean
83
105
  */
84
106
  declare const buildAnnotatedBlockText: (blockNode: Node) => string;
85
107
  //#endregion
86
- export { CleanBlockText, CleanTextStructuralBoundary, buildAnnotatedBlockText, buildCleanBlockText, resolveCleanTextRange };
108
+ export { BuildCleanBlockTextOptions, CleanBlockText, CleanTextStructuralBoundary, buildAnnotatedBlockText, buildCleanBlockText, resolveCleanTextRange };
@@ -1,13 +1,15 @@
1
1
  import { expectPageBreakRunAttrs } from "../prosemirror/attrs/index.js";
2
- import { runFormattingInlineControlCharacter } from "../prosemirror/runFormattingInlineCarriers.js";
2
+ import { runFormattingInlineAtomCleanText, runFormattingInlineControlCharacter } from "../prosemirror/runFormattingInlineCarriers.js";
3
3
  //#region src/ai-edits/clean-text.ts
4
4
  const EMPTY_CLEAN_TEXT_STRUCTURAL_BOUNDARIES = Object.freeze([]);
5
+ const cutsIntoSpan = ({ offset, length }, boundaryOffset) => boundaryOffset > offset && boundaryOffset < offset + length;
5
6
  /**
6
- * Resolve clean-text offsets without selecting a zero-width structural atom.
7
+ * Resolve clean-text offsets without selecting a structural atom.
7
8
  *
8
- * A range wholly on one side of a boundary is biased away from the atom. A
9
- * range spanning both sides is unrepresentable as a generic text selection
10
- * and returns `null`; a structural operation must own that mutation instead.
9
+ * A range wholly on one side of a zero-width boundary is biased away from the
10
+ * atom. A range spanning both sides, or cutting into a field result, is
11
+ * unrepresentable as a generic text selection and returns `null`; a structural
12
+ * operation must own that mutation instead.
11
13
  */
12
14
  const resolveCleanTextRange = ({ cleanBlock, startOffset, endOffset }) => {
13
15
  if (!Number.isInteger(startOffset) || !Number.isInteger(endOffset) || startOffset < 0 || endOffset < startOffset || endOffset > cleanBlock.text.length) return null;
@@ -22,6 +24,10 @@ const resolveCleanTextRange = ({ cleanBlock, startOffset, endOffset }) => {
22
24
  let from = baseFrom;
23
25
  let to = baseTo;
24
26
  for (const boundary of structuralBoundaries) {
27
+ if (boundary.type === "field") {
28
+ if (cutsIntoSpan(boundary, startOffset) || cutsIntoSpan(boundary, endOffset)) return null;
29
+ continue;
30
+ }
25
31
  if (boundary.offset > startOffset && boundary.offset < endOffset) return null;
26
32
  if (boundary.offset === startOffset) from = Math.max(from, boundary.to);
27
33
  if (startOffset !== endOffset && boundary.offset === endOffset) to = Math.min(to, boundary.from);
@@ -40,7 +46,8 @@ const INSERTION_MARK = "insertion";
40
46
  const COMMENT_MARK = "comment";
41
47
  const HIDDEN_MARK = "hidden";
42
48
  const isOmittedFromCleanView = (node) => node.marks.some((mark) => mark.type.name === DELETION_MARK || mark.type.name === HIDDEN_MARK);
43
- const buildCleanBlockText = (blockNode, blockFrom) => {
49
+ const DEFAULT_BUILD_CLEAN_BLOCK_TEXT_OPTIONS = { fieldResults: "text" };
50
+ const buildCleanBlockText = (blockNode, blockFrom, { fieldResults } = DEFAULT_BUILD_CLEAN_BLOCK_TEXT_OPTIONS) => {
44
51
  let text = "";
45
52
  const offsets = [];
46
53
  let structuralBoundaries;
@@ -59,12 +66,19 @@ const buildCleanBlockText = (blockNode, blockFrom) => {
59
66
  });
60
67
  return false;
61
68
  }
62
- const controlCharacter = runFormattingInlineControlCharacter(node);
63
- if (controlCharacter !== null) {
69
+ const atomText = fieldResults === "omitted" ? runFormattingInlineControlCharacter(node) : runFormattingInlineAtomCleanText(node);
70
+ if (atomText !== null) {
64
71
  if (isOmittedFromCleanView(node)) return false;
65
72
  const startPos = blockFrom + 1 + pos;
66
- offsets.push(startPos);
67
- text += controlCharacter;
73
+ if (atomText.length > 1) (structuralBoundaries ??= []).push({
74
+ type: "field",
75
+ offset: text.length,
76
+ length: atomText.length,
77
+ from: startPos,
78
+ to: startPos + node.nodeSize
79
+ });
80
+ for (let index = 0; index < atomText.length; index++) offsets.push(startPos);
81
+ text += atomText;
68
82
  lastEnd = startPos + node.nodeSize;
69
83
  return false;
70
84
  }
@@ -105,16 +119,17 @@ const buildCleanBlockText = (blockNode, blockFrom) => {
105
119
  const buildAnnotatedBlockText = (blockNode) => {
106
120
  const segments = [];
107
121
  blockNode.descendants((node) => {
108
- if (!node.isText || node.text === void 0) return true;
122
+ const text = node.isText ? node.text : runFormattingInlineAtomCleanText(node);
123
+ if (text === void 0 || text === null) return true;
109
124
  const annotation = annotationOf(node.marks);
110
125
  const previous = segments.at(-1);
111
126
  if (previous && sameAnnotation(previous.annotation, annotation)) {
112
- previous.text += node.text;
127
+ previous.text += text;
113
128
  return false;
114
129
  }
115
130
  segments.push({
116
131
  annotation,
117
- text: node.text
132
+ text
118
133
  });
119
134
  return false;
120
135
  });
@@ -514,6 +514,18 @@ declare class FolioDocxReviewer {
514
514
  private createComparisonHeaderFooter;
515
515
  private canImportHeaderFooterContent;
516
516
  private getNoteStory;
517
+ /**
518
+ * A loaded story's blocks, so its text comes from the same walk an unloaded
519
+ * one uses.
520
+ *
521
+ * The two used to be separate walks and disagreed: the model walk separates
522
+ * paragraphs, joins table cells with a tab and reads the accepted
523
+ * tracked-change view, while the editor walk concatenated text nodes and saw
524
+ * none of that. The same note therefore read one way before it was loaded and
525
+ * another after. This is the conversion the save path already performs on the
526
+ * same states, so the text now describes exactly what a save would write.
527
+ */
528
+ private storyBlocks;
517
529
  private getHeaderFooterStoryText;
518
530
  private getNoteStoryText;
519
531
  private getStoryText;
@@ -1530,14 +1530,37 @@ var FolioDocxReviewer = class FolioDocxReviewer {
1530
1530
  if (story.type === "footnote") return this.baseDocument.package.footnotes?.find((note) => note.id === story.noteId && !isSeparatorFootnote(note));
1531
1531
  return this.baseDocument.package.endnotes?.find((note) => note.id === story.noteId && !isSeparatorEndnote(note));
1532
1532
  }
1533
+ /**
1534
+ * A loaded story's blocks, so its text comes from the same walk an unloaded
1535
+ * one uses.
1536
+ *
1537
+ * The two used to be separate walks and disagreed: the model walk separates
1538
+ * paragraphs, joins table cells with a tab and reads the accepted
1539
+ * tracked-change view, while the editor walk concatenated text nodes and saw
1540
+ * none of that. The same note therefore read one way before it was loaded and
1541
+ * another after. This is the conversion the save path already performs on the
1542
+ * same states, so the text now describes exactly what a save would write.
1543
+ */
1544
+ storyBlocks(state, source) {
1545
+ return state ? proseDocToBlocks(state.doc, source.content, this.baseDocument.package.styles, { emptyFieldResult: "authored" }) : source.content;
1546
+ }
1533
1547
  getHeaderFooterStoryText(story, source) {
1534
1548
  const state = this.secondaryStoryStates.get(headerFooterStoryKey(story))?.state;
1535
- return normalizeFolioAIBlockText(state?.doc.textContent ?? getHeaderFooterText(source));
1549
+ return normalizeFolioAIBlockText(getHeaderFooterText({
1550
+ ...source,
1551
+ content: this.storyBlocks(state, source)
1552
+ }));
1536
1553
  }
1537
1554
  getNoteStoryText(story, source) {
1538
1555
  const state = this.secondaryStoryStates.get(noteStoryKey(story))?.state;
1539
- const sourceText = source.type === "footnote" ? getFootnoteText(source) : getEndnoteText(source);
1540
- return normalizeFolioAIBlockText(state?.doc.textContent ?? sourceText);
1556
+ const content = this.storyBlocks(state, source);
1557
+ return normalizeFolioAIBlockText(source.type === "footnote" ? getFootnoteText({
1558
+ ...source,
1559
+ content
1560
+ }) : getEndnoteText({
1561
+ ...source,
1562
+ content
1563
+ }));
1541
1564
  }
1542
1565
  getStoryText(story) {
1543
1566
  if (story.type === "main") return this.getContentAsText();
@@ -1,5 +1,5 @@
1
1
  import { FolioContentParagraphKind } from "../compare/content-types.js";
2
- import { FolioAIBlock, FolioAIBlockAnchor, FolioAIBlockKind, FolioAIBlockPreviewRun, FolioAIBlockStructuralBoundary, FolioAIBlockTableLocation, FolioAIComment, FolioAIEditAppliedOperation, FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditNormalization, FolioAIEditNormalizationCode, FolioAIEditOperation, FolioAIEditPrecondition, FolioAIEditReviewMeta, FolioAIEditSeverity, FolioAIEditSkipReason, FolioAIEditSkippedOperation, FolioAIEditSnapshot, FolioAIInlineBooleanProperty, FolioAIInlineFormatting, FolioAIInlineFormattingPatch, FolioAIParagraphSpacing, FolioAISignatureParty, FolioAITextRangeHandle, FolioDocumentNavigationTarget, FolioDocumentOutline, FolioDocumentOutlineEntry, FolioDocumentSection, FolioDocumentSectionHandle, FolioDocumentSectionReadResult } from "./types.js";
2
+ import { FolioAIBlock, FolioAIBlockAnchor, FolioAIBlockKind, FolioAIBlockPreviewRun, FolioAIBlockStructuralBoundary, FolioAIBlockTableLocation, FolioAIComment, FolioAIEditAppliedOperation, FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditNormalization, FolioAIEditNormalizationCode, FolioAIEditOperation, FolioAIEditPrecondition, FolioAIEditReviewMeta, FolioAIEditSeverity, FolioAIEditSkipReason, FolioAIEditSkippedOperation, FolioAIEditSnapshot, FolioAIInlineBooleanProperty, FolioAIInlineFormatting, FolioAIInlineFormattingPatch, FolioAIInsertFormattingScope, FolioAIParagraphSpacing, FolioAISignatureParty, FolioAITextRangeHandle, FolioDocumentNavigationTarget, FolioDocumentOutline, FolioDocumentOutlineEntry, FolioDocumentSection, FolioDocumentSectionHandle, FolioDocumentSectionReadResult } from "./types.js";
3
3
  import { WORD_DIFF_GRANULARITIES, WordDiffGranularity, WordDiffNormalization, WordDiffOptions, WordDiffSegment, diffWordSegments } from "./word-diff.js";
4
4
  import { FolioAIEditApplyOutcome, FolioAIEditView, FolioRevisionStamp, FolioWordDiffOptions, applyFolioAIEditOperations } from "./apply.js";
5
5
  import { DocPositionRange, clampRangeToDocSize, resolveFolioAIBlockRange, resolveFolioAITextRange, resolvePassageRange } from "./blockRange.js";
@@ -10,4 +10,4 @@ import { createFolioAIEditSnapshot, createFolioAITextRangeHandle, hashFolioAIBlo
10
10
  import { FOLIO_RESOLVED_REVIEWED_VIEWS, FOLIO_REVIEWED_VIEWS, FolioApplyDocumentOperationsToStoryOptions, FolioDocumentStory, FolioDocumentStoryHandle, FolioDocumentStoryNotFoundError, FolioEditableDocumentStoryHandle, FolioReadReviewedStoryOptions, FolioResolveReviewedStoryOptions, FolioResolvedReviewedView, FolioReviewedStory, FolioReviewedView, UnsupportedFolioReviewedViewError, isFolioResolvedReviewedView, isFolioReviewedView } from "./headless.js";
11
11
  import { getFolioDocumentOutline, readFolioDocumentSection } from "./scoped-reading.js";
12
12
  import { getFolioParaIdFromBlockId } from "../types/block-id.js";
13
- export { type ApplyFolioDocumentOperationsOptions, type DocPositionRange, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FOLIO_LINE_SPACING_RULE_VALUES, FOLIO_PARAGRAPH_ALIGNMENT_VALUES, FOLIO_RESOLVED_REVIEWED_VIEWS, FOLIO_REVIEWED_VIEWS, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIBlockStructuralBoundary, type FolioAIBlockTableLocation, type FolioAIComment, type FolioAIEditAppliedOperation, type FolioAIEditApplyMode, type FolioAIEditApplyOutcome, type FolioAIEditApplyResult, type FolioAIEditNormalization, type FolioAIEditNormalizationCode, type FolioAIEditOperation, type FolioAIEditPrecondition, type FolioAIEditReviewMeta, type FolioAIEditSeverity, type FolioAIEditSkipReason, type FolioAIEditSkippedOperation, type FolioAIEditSnapshot, type FolioAIEditView, type FolioAIInlineBooleanProperty, type FolioAIInlineFormatting, type FolioAIInlineFormattingPatch, type FolioAIParagraphSpacing, type FolioAISignatureParty, type FolioAITextRangeHandle, type FolioApplyDocumentOperationsToStoryOptions, type FolioCommentAnchor, type FolioContentParagraphKind, type FolioDocumentNavigationTarget, type FolioDocumentOperation, type FolioDocumentOperationAffectedTarget, type FolioDocumentOperationBatch, type FolioDocumentOperationCapabilities, type FolioDocumentOperationIssue, type FolioDocumentOperationMode, type FolioDocumentOperationPrecondition, type FolioDocumentOperationReceipt, type FolioDocumentOperationRecovery, type FolioDocumentOperationResult, type FolioDocumentOperationResultBase, type FolioDocumentOperationStatus, type FolioDocumentOperationStory, type FolioDocumentOperationType, type FolioDocumentOperationUndoFailureReason, type FolioDocumentOperationUndoHandle, type FolioDocumentOperationUndoResult, type FolioDocumentOutline, type FolioDocumentOutlineEntry, type FolioDocumentSection, type FolioDocumentSectionHandle, type FolioDocumentSectionReadResult, type FolioDocumentStory, type FolioDocumentStoryHandle, FolioDocumentStoryNotFoundError, type FolioEditableDocumentStoryHandle, type FolioReadReviewedStoryOptions, type FolioResolveReviewedStoryOptions, type FolioResolvedReviewedView, type FolioReviewChange, type FolioReviewChangeKind, type FolioReviewedStory, type FolioReviewedView, type FolioRevisionStamp, type FolioWordDiffOptions, InvalidFolioDocumentOperationBatchError, UnsupportedFolioDocumentOperationVersionError, UnsupportedFolioReviewedViewError, WORD_DIFF_GRANULARITIES, type WordDiffGranularity, type WordDiffNormalization, type WordDiffOptions, type WordDiffSegment, applyFolioAIEditOperations, applyFolioDocumentOperations, assertSupportedFolioDocumentOperationVersion, buildAnnotatedBlockText, clampRangeToDocSize, createFolioAIEditSnapshot, createFolioAITextRangeHandle, diffWordSegments, getCommentAnchorsFromDoc, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioDocumentOutline, getFolioParaIdFromBlockId, getTrackedChangesFromDoc, hashFolioAIBlockText, isFolioAIContentBlock, isFolioDocumentOperationModeSupported, isFolioResolvedReviewedView, isFolioReviewedView, isSupportedFolioDocumentOperationVersion, normalizeFolioAIBlockText, parseFolioDocumentOperationBatch, readFolioDocumentSection, resolveFolioAIBlockRange, resolveFolioAITextRange, resolvePassageRange };
13
+ export { type ApplyFolioDocumentOperationsOptions, type DocPositionRange, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FOLIO_LINE_SPACING_RULE_VALUES, FOLIO_PARAGRAPH_ALIGNMENT_VALUES, FOLIO_RESOLVED_REVIEWED_VIEWS, FOLIO_REVIEWED_VIEWS, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIBlockStructuralBoundary, type FolioAIBlockTableLocation, type FolioAIComment, type FolioAIEditAppliedOperation, type FolioAIEditApplyMode, type FolioAIEditApplyOutcome, type FolioAIEditApplyResult, type FolioAIEditNormalization, type FolioAIEditNormalizationCode, type FolioAIEditOperation, type FolioAIEditPrecondition, type FolioAIEditReviewMeta, type FolioAIEditSeverity, type FolioAIEditSkipReason, type FolioAIEditSkippedOperation, type FolioAIEditSnapshot, type FolioAIEditView, type FolioAIInlineBooleanProperty, type FolioAIInlineFormatting, type FolioAIInlineFormattingPatch, type FolioAIInsertFormattingScope, type FolioAIParagraphSpacing, type FolioAISignatureParty, type FolioAITextRangeHandle, type FolioApplyDocumentOperationsToStoryOptions, type FolioCommentAnchor, type FolioContentParagraphKind, type FolioDocumentNavigationTarget, type FolioDocumentOperation, type FolioDocumentOperationAffectedTarget, type FolioDocumentOperationBatch, type FolioDocumentOperationCapabilities, type FolioDocumentOperationIssue, type FolioDocumentOperationMode, type FolioDocumentOperationPrecondition, type FolioDocumentOperationReceipt, type FolioDocumentOperationRecovery, type FolioDocumentOperationResult, type FolioDocumentOperationResultBase, type FolioDocumentOperationStatus, type FolioDocumentOperationStory, type FolioDocumentOperationType, type FolioDocumentOperationUndoFailureReason, type FolioDocumentOperationUndoHandle, type FolioDocumentOperationUndoResult, type FolioDocumentOutline, type FolioDocumentOutlineEntry, type FolioDocumentSection, type FolioDocumentSectionHandle, type FolioDocumentSectionReadResult, type FolioDocumentStory, type FolioDocumentStoryHandle, FolioDocumentStoryNotFoundError, type FolioEditableDocumentStoryHandle, type FolioReadReviewedStoryOptions, type FolioResolveReviewedStoryOptions, type FolioResolvedReviewedView, type FolioReviewChange, type FolioReviewChangeKind, type FolioReviewedStory, type FolioReviewedView, type FolioRevisionStamp, type FolioWordDiffOptions, InvalidFolioDocumentOperationBatchError, UnsupportedFolioDocumentOperationVersionError, UnsupportedFolioReviewedViewError, WORD_DIFF_GRANULARITIES, type WordDiffGranularity, type WordDiffNormalization, type WordDiffOptions, type WordDiffSegment, applyFolioAIEditOperations, applyFolioDocumentOperations, assertSupportedFolioDocumentOperationVersion, buildAnnotatedBlockText, clampRangeToDocSize, createFolioAIEditSnapshot, createFolioAITextRangeHandle, diffWordSegments, getCommentAnchorsFromDoc, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioDocumentOutline, getFolioParaIdFromBlockId, getTrackedChangesFromDoc, hashFolioAIBlockText, isFolioAIContentBlock, isFolioDocumentOperationModeSupported, isFolioResolvedReviewedView, isFolioReviewedView, isSupportedFolioDocumentOperationVersion, normalizeFolioAIBlockText, parseFolioDocumentOperationBatch, readFolioDocumentSection, resolveFolioAIBlockRange, resolveFolioAITextRange, resolvePassageRange };
@@ -66,7 +66,12 @@ declare const isFolioAIContentBlock: ({ text }: Pick<FolioAIBlock, "text">) => b
66
66
  */
67
67
  declare const trailingBodyBlockId: ({ blocks }: FolioAIEditSnapshot) => string | null;
68
68
  declare const hashFolioAIBlockText: (text: string) => string;
69
- /** Canonical public projection of the clean view's zero-width structure. */
69
+ /**
70
+ * Canonical public projection of the clean view's zero-width structure.
71
+ *
72
+ * A field boundary stays internal: it marks text the reader already sees, so it
73
+ * belongs to range resolution rather than to a block's published structure.
74
+ */
70
75
  declare const projectFolioAIBlockStructuralBoundaries: ({ structuralBoundaries }: Pick<CleanBlockText, "structuralBoundaries">) => readonly FolioAIBlockStructuralBoundary[];
71
76
  /** Stable precondition fingerprint for a block's zero-width structure. */
72
77
  declare const hashFolioAIBlockStructuralBoundaries: (cleanBlock: Pick<CleanBlockText, "structuralBoundaries">) => string;
@@ -4,7 +4,7 @@ import { marksToTextFormatting } from "../prosemirror/conversion/fromProseDoc.js
4
4
  import { directParagraphAlignment } from "../prosemirror/paragraphAlignment.js";
5
5
  import { directParagraphIndentation } from "../prosemirror/paragraphIndentation.js";
6
6
  import { directParagraphSpacing } from "../prosemirror/paragraphSpacing.js";
7
- import { runFormattingInlineControlCharacter } from "../prosemirror/runFormattingInlineCarriers.js";
7
+ import { runFormattingInlineAtomCleanText } from "../prosemirror/runFormattingInlineCarriers.js";
8
8
  import { authoredRunFormattingFromAttrs } from "../prosemirror/runFormattingProvenance.js";
9
9
  import { readAuthoredRunFormatting, reconcileRunFormattingMarks } from "../prosemirror/runFormattingReconciliation.js";
10
10
  import { paragraphRunStyleContext } from "../prosemirror/runStyleFormatting.js";
@@ -231,15 +231,20 @@ const hashFolioAIBlockText = (text) => {
231
231
  };
232
232
  const EMPTY_FOLIO_AI_BLOCK_STRUCTURAL_BOUNDARIES = Object.freeze([]);
233
233
  const EMPTY_FOLIO_AI_BLOCK_STRUCTURAL_BOUNDARY_HASH = hashFolioAIBlockText(JSON.stringify(EMPTY_FOLIO_AI_BLOCK_STRUCTURAL_BOUNDARIES));
234
- /** Canonical public projection of the clean view's zero-width structure. */
234
+ /**
235
+ * Canonical public projection of the clean view's zero-width structure.
236
+ *
237
+ * A field boundary stays internal: it marks text the reader already sees, so it
238
+ * belongs to range resolution rather than to a block's published structure.
239
+ */
235
240
  const projectFolioAIBlockStructuralBoundaries = ({ structuralBoundaries }) => {
236
241
  let projected;
237
- for (const { clear, offset, presentInCleanView } of structuralBoundaries) {
238
- if (!presentInCleanView) continue;
242
+ for (const boundary of structuralBoundaries) {
243
+ if (boundary.type !== "pageBreakRun" || !boundary.presentInCleanView) continue;
239
244
  (projected ??= []).push({
240
245
  type: "pageBreak",
241
- offset,
242
- ...clear !== void 0 ? { clear } : {}
246
+ offset: boundary.offset,
247
+ ...boundary.clear !== void 0 ? { clear: boundary.clear } : {}
243
248
  });
244
249
  }
245
250
  return projected ?? EMPTY_FOLIO_AI_BLOCK_STRUCTURAL_BOUNDARIES;
@@ -531,13 +536,13 @@ const getPreviewRuns = ({ node, nodeFrom, cleanBlock, styleResolver }) => {
531
536
  let paragraphStyleContext;
532
537
  let cleanOffset = 0;
533
538
  node.descendants((child, relativePosition) => {
534
- const text = child.isText ? child.text : runFormattingInlineControlCharacter(child);
535
- if (text === void 0 || text === null) return true;
539
+ const text = child.isText ? child.text : runFormattingInlineAtomCleanText(child);
540
+ if (text === void 0 || text === null || text.length === 0) return true;
536
541
  if (child.marks.some((mark) => mark.type.name === DELETION_MARK || mark.type.name === HIDDEN_MARK)) return false;
537
542
  const start = nodeFrom + 1 + relativePosition;
538
543
  while ((cleanBlock.offsets[cleanOffset] ?? Number.POSITIVE_INFINITY) < start) cleanOffset++;
539
- const endOffset = cleanOffset + text.length - 1;
540
- if (cleanBlock.offsets[cleanOffset] !== start || cleanBlock.offsets[endOffset] !== start + text.length - 1) return false;
544
+ const lastCharacterPosition = child.isText ? start + text.length - 1 : start;
545
+ if (cleanBlock.offsets[cleanOffset] !== start || cleanBlock.offsets[cleanOffset + text.length - 1] !== lastCharacterPosition) return false;
541
546
  cleanOffset += text.length;
542
547
  const style = getPreviewRunStyle(child.marks, defaultStyle);
543
548
  const hasAuthorshipCarrier = child.marks.some(({ type }) => type.name === RUN_FORMATTING_OVERRIDE_MARK || type.name === CHARACTER_STYLE_MARK);
@@ -43,6 +43,8 @@ type FolioAIParagraphSpacing = FolioContentParagraphSpacing;
43
43
  /** The complete modeled attribute set of one direct `w:pPr/w:ind` child. */
44
44
  type FolioAIParagraphIndentation = FolioContentParagraphIndentation;
45
45
  type FolioAIListReference = FolioContentListReference;
46
+ /** Which paragraphs split from one insertion's `text` receive its paragraph formatting. */
47
+ type FolioAIInsertFormattingScope = "firstParagraph" | "allParagraphs";
46
48
  /**
47
49
  * The paragraph properties an operation may set. A subset of `w:pPrChange`'s
48
50
  * scope: properties a comparison can see in a block projection and an agent
@@ -212,11 +214,11 @@ type FolioAIEditOperation = FolioAIEditReviewMeta & {
212
214
  /**
213
215
  * The paragraph text to insert. With the default `lineBreakMode:
214
216
  * "paragraph"`, a line break splits `text` into consecutive
215
- * paragraphs at the same anchor: only the first paragraph gets
216
- * `styleId` / `alignment` / `inheritFormatting`, later ones use
217
- * body formatting. Blank lines are dropped and reported as a
218
- * `splitMultilineText` normalization. `"inline"` retains the
219
- * control inside one paragraph.
217
+ * paragraphs at the same anchor. `formattingScope` decides which of
218
+ * them receive this operation's paragraph formatting: by default only
219
+ * the first, later ones use body formatting. Blank lines are dropped
220
+ * and reported as a `splitMultilineText` normalization. `"inline"`
221
+ * retains the control inside one paragraph.
220
222
  *
221
223
  * `""` inserts a BLANK paragraph, and is a real edit: adding an empty
222
224
  * line is a change a reader sees, and a document that has one where
@@ -229,6 +231,17 @@ type FolioAIEditOperation = FolioAIEditReviewMeta & {
229
231
  * `"inline"` retains tabs and hard breaks inside this inserted block.
230
232
  */
231
233
  lineBreakMode?: "paragraph" | "inline";
234
+ /**
235
+ * Which paragraphs split from `text` receive the operation's
236
+ * paragraph formatting: the inherited anchor formatting plus
237
+ * `styleId`, `listLevel`, `numbering`, `alignment`, `spacing` and
238
+ * `indentation`. `"firstParagraph"` (the default) formats the first
239
+ * and leaves the rest as body paragraphs, for a heading followed by
240
+ * its body. `"allParagraphs"` formats every paragraph alike, for
241
+ * several list items in one operation. `pageBreakBefore` and
242
+ * `hardPageBreak` apply to the first paragraph in either scope.
243
+ */
244
+ formattingScope?: FolioAIInsertFormattingScope;
232
245
  inheritFormatting?: boolean;
233
246
  /**
234
247
  * Links this insertion to the deletion that carries the same
@@ -596,4 +609,4 @@ type FolioAIEditApplyResult = {
596
609
  normalizations?: FolioAIEditNormalization[];
597
610
  };
598
611
  //#endregion
599
- export { FolioAIBlock, FolioAIBlockAnchor, FolioAIBlockKind, FolioAIBlockParagraphProperties, FolioAIBlockPreviewRun, FolioAIBlockStructuralBoundary, FolioAIBlockTableLocation, FolioAIComment, FolioAIEditAppliedOperation, FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditNormalization, FolioAIEditNormalizationCode, FolioAIEditOperation, FolioAIEditPrecondition, FolioAIEditReviewMeta, FolioAIEditSeverity, FolioAIEditSkipReason, FolioAIEditSkippedOperation, FolioAIEditSnapshot, FolioAIInlineBooleanProperty, FolioAIInlineFormatting, FolioAIInlineFormattingPatch, FolioAIListReference, FolioAIParagraphIndentation, FolioAIParagraphSpacing, FolioAISignatureParty, FolioAITextRangeHandle, FolioDocumentNavigationTarget, FolioDocumentOutline, FolioDocumentOutlineEntry, FolioDocumentSection, FolioDocumentSectionHandle, FolioDocumentSectionReadResult };
612
+ export { FolioAIBlock, FolioAIBlockAnchor, FolioAIBlockKind, FolioAIBlockParagraphProperties, FolioAIBlockPreviewRun, FolioAIBlockStructuralBoundary, FolioAIBlockTableLocation, FolioAIComment, FolioAIEditAppliedOperation, FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditNormalization, FolioAIEditNormalizationCode, FolioAIEditOperation, FolioAIEditPrecondition, FolioAIEditReviewMeta, FolioAIEditSeverity, FolioAIEditSkipReason, FolioAIEditSkippedOperation, FolioAIEditSnapshot, FolioAIInlineBooleanProperty, FolioAIInlineFormatting, FolioAIInlineFormattingPatch, FolioAIInsertFormattingScope, FolioAIListReference, FolioAIParagraphIndentation, FolioAIParagraphSpacing, FolioAISignatureParty, FolioAITextRangeHandle, FolioDocumentNavigationTarget, FolioDocumentOutline, FolioDocumentOutlineEntry, FolioDocumentSection, FolioDocumentSectionHandle, FolioDocumentSectionReadResult };
@@ -1,3 +1,4 @@
1
+ import { runFormattingInlineAtomResultText } from "../prosemirror/runFormattingInlineCarriers.js";
1
2
  //#region src/ai-suggestions/text-positions.ts
2
3
  const BLOCK_SEPARATOR = "\n";
3
4
  /**
@@ -15,11 +16,22 @@ function buildPositionalText(doc, from = 0, to = doc.content.size) {
15
16
  if (node.type.name === "pageBreakRun") {
16
17
  structuralBoundaries.push({
17
18
  textOffset: textLength,
18
- from: pos,
19
- to: pos + node.nodeSize
19
+ length: 0
20
20
  });
21
21
  return false;
22
22
  }
23
+ const resultText = runFormattingInlineAtomResultText(node);
24
+ if (resultText !== null) {
25
+ if (resultText.length === 0 || pos < from || pos + node.nodeSize > to) return false;
26
+ structuralBoundaries.push({
27
+ textOffset: textLength,
28
+ length: resultText.length
29
+ });
30
+ chunks.push(resultText);
31
+ for (let index = 0; index < resultText.length; index++) offsets.push(pos);
32
+ textLength += resultText.length;
33
+ return false;
34
+ }
23
35
  if (node.isText) {
24
36
  const text = node.text ?? "";
25
37
  const startInNode = Math.max(from, pos);
@@ -54,7 +66,7 @@ function buildPositionalText(doc, from = 0, to = doc.content.size) {
54
66
  text,
55
67
  pmPositionAt,
56
68
  pmRangeAt: (startTextIndex, endTextIndex) => {
57
- if (!Number.isInteger(startTextIndex) || !Number.isInteger(endTextIndex) || startTextIndex < 0 || endTextIndex <= startTextIndex || endTextIndex > text.length || structuralBoundaries.some(({ textOffset }) => textOffset > startTextIndex && textOffset < endTextIndex)) return null;
69
+ if (!Number.isInteger(startTextIndex) || !Number.isInteger(endTextIndex) || startTextIndex < 0 || endTextIndex <= startTextIndex || endTextIndex > text.length || structuralBoundaries.some(({ textOffset, length }) => length === 0 ? textOffset > startTextIndex && textOffset < endTextIndex : startTextIndex > textOffset && startTextIndex < textOffset + length || endTextIndex > textOffset && endTextIndex < textOffset + length)) return null;
58
70
  const rangeFrom = pmPositionAt(startTextIndex);
59
71
  const finalCharacter = offsets[endTextIndex - 1];
60
72
  if (finalCharacter === void 0) return null;
@@ -46,7 +46,7 @@ const atomKey = (node) => canonicalJson({
46
46
  content: node.content.toJSON()
47
47
  });
48
48
  const atomBlockOf = ({ node, from }) => {
49
- const clean = buildCleanBlockText(node, from);
49
+ const clean = buildCleanBlockText(node, from, { fieldResults: "omitted" });
50
50
  const supported = [];
51
51
  const unsupportedTopology = [];
52
52
  let unalignable = false;
@@ -237,7 +237,7 @@ const sameParagraphSourcePosition = ({ sourceBlocks, reviewed, offset }) => {
237
237
  if (typeof paraId !== "string" || paraId.length === 0) return null;
238
238
  const source = sourceBlocks.get(paraId);
239
239
  if (!source || source.node.type !== reviewed.node.type) return null;
240
- const clean = buildCleanBlockText(source.node, source.from);
240
+ const clean = buildCleanBlockText(source.node, source.from, { fieldResults: "omitted" });
241
241
  return clean.text === reviewed.cleanText ? clean.offsets[offset] ?? null : null;
242
242
  };
243
243
  /**
@@ -20,7 +20,8 @@ import { mergeDocumentContent } from "../utils/mergeDocumentContent.js";
20
20
  import { DocumentStyleCatalog, DocumentStyleCatalogEntry, ExtractDocumentStyleSetOptions, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, inspectDocumentStyles, inspectDocumentStylesFromDocx } from "../style-sets/extract.js";
21
21
  import { STELLA_STYLE_SET_NAME, createStellaStyleDocumentPreset, createStellaStyleSet } from "../style-sets/stellaStyle.js";
22
22
  import { createDocx } from "../docx/rezip.js";
23
- import { DocxCompatibility, DocxCompatibilityContext, DocxCompatibilityIssue, DocxCompatibilityLocation, DocxCompatibilityPart, FolioDocxCompatibilityHost, FolioDocxCompatibilityProfile, InspectDocxCompatibilityOptions, inspectDocxCompatibility } from "../docx/compatibility.js";
23
+ import { DRAWING_SAFETY_CLASSES, DrawingSafetyClass } from "../docx/imageRawXml.js";
24
+ import { DocxCompatibility, DocxCompatibilityContext, DocxCompatibilityIssue, DocxCompatibilityLocation, DocxCompatibilityPart, DocxDrawingClassification, FolioDocxCompatibilityHost, FolioDocxCompatibilityProfile, InspectDocxCompatibilityOptions, inspectDocxCompatibility } from "../docx/compatibility.js";
24
25
  import { BlockRect } from "../paged-layout/blockGeometry.js";
25
26
  import { setAISuggestionsMeta, setFocusedSuggestionMeta } from "../prosemirror/plugins/aiSuggestionDecorations.js";
26
27
  import { scrollFolioPositionIntoView } from "../paged-layout/scrollToPmPosition.js";
@@ -39,4 +40,4 @@ import { getGoogleFontsEnabled, setEmbeddedFontFamilyMap, setGoogleFontsEnabled
39
40
  import { DOCX_CONFORMANCE_CLASSES } from "../index.js";
40
41
  type Document = document_d_exports.Document;
41
42
  type DocxConformanceClass = document_d_exports.DocxConformanceClass;
42
- export { type AIBarStatus, type AIChatMode, type AICitation, type AICitationRange, type AICitationSource, type AIGenerateInput, type AISuggestion, type AISuggestionApplyMode, type AISuggestionPreset, type AISuggestionSeverity, type AISuggestionStatus, type AcceptAutocompleteResult, type AnonymizationMatch, type AnonymizationTerm, type ApplyFolioDocumentOperationsOptions, type ApplyResult, type AutocompleteSuggestionPluginOptions, type AutocompleteSuggestionState, type AutocompleteSuggestionStatus, type AutocompleteTriggerCheck, type AutocompleteTriggerOptions, type AutocompleteTriggerSkipReason, type BlockRect, COMPARE_REVISION_FORMATS, COMPARE_UNSUPPORTED_REASONS, COMPARE_VERIFICATION_CAUSES, COMPARE_VERIFICATION_INVARIANTS, type CompareChange, type CompareChangeLocation, type CompareCompatibility, type CompareContentOptions, CompareDocxApplyError, type CompareDocxError, CompareDocxFinalParagraphMarkError, CompareDocxOperationLimitError, type CompareDocxOptions, CompareDocxParseError, CompareDocxRoundTripError, CompareDocxSerializeError, type CompareFolioRequirement, type CompareResult, type CompareRevisionFormat, type CompareUnsupportedPart, type CompareUnsupportedReason, type CompareVerification, type CompareVerificationCause, type CompareVerificationFailure, type CompareVerificationInvariant, type CreateEmptyDocumentOptions, DEFAULT_AI_SUGGESTION_PRESETS, DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, DOCX_CONFORMANCE_CLASSES, type DeriveBlockIdInput, type DirectiveKind, type DirectiveRange, type Document, type DocumentPreset, type DocumentStyleCatalog, type DocumentStyleCatalogEntry, type DocumentStyleSet, type DocxCompatibility, type DocxCompatibilityContext, type DocxCompatibilityIssue, type DocxCompatibilityLocation, type DocxCompatibilityPart, type DocxConformanceClass, type EmbeddedFont, type EmbeddedFontParts, type ExtractDocumentStyleSetOptions, FOLIO_CONTENT_COMPARISON_LIMITS, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FOLIO_LINE_SPACING_RULE_VALUES, FOLIO_PARAGRAPH_ALIGNMENT_VALUES, type FinalParagraphMarkRevision, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIBlockStructuralBoundary, type FolioAIBlockTableLocation, type FolioAIComment, type FolioAIEditAppliedOperation, type FolioAIEditApplyMode, type FolioAIEditApplyOutcome, type FolioAIEditApplyResult, type FolioAIEditNormalization, type FolioAIEditNormalizationCode, type FolioAIEditOperation, type FolioAIEditPrecondition, type FolioAIEditReviewMeta, type FolioAIEditSeverity, type FolioAIEditSkipReason, type FolioAIEditSkippedOperation, type FolioAIEditSnapshot, type FolioAIInlineBooleanProperty, type FolioAIInlineFormatting, type FolioAIInlineFormattingPatch, type FolioAIParagraphSpacing, type FolioAISignatureParty, type FolioBlockId, type FolioContentBlock, type FolioContentBlockProperty, type FolioContentComparison, type FolioContentComparisonError, type FolioContentComparisonEvent, type FolioContentComparisonLimit, FolioContentComparisonLimitError, type FolioContentContainerPathEntry, type FolioContentFormatRange, type FolioContentFormattingChange, type FolioContentIdStability, type FolioContentInlineBooleanProperty, type FolioContentInlineComparisonResult, type FolioContentInlineFormatting, type FolioContentInlineFormattingPatch, FolioContentInlinePresentationProjectionError, type FolioContentLineSpacingRule, type FolioContentParagraphAlignment, type FolioContentParagraphFormattingPatch, type FolioContentParagraphKind, type FolioContentParagraphSpacing, type FolioContentRun, type FolioContentSnapshot, type FolioContentStructuralChange, type FolioContentTableLocation, type FolioContentTextSegment, type FolioDocumentOperation, type FolioDocumentOperationAffectedTarget, type FolioDocumentOperationBatch, type FolioDocumentOperationCapabilities, type FolioDocumentOperationIssue, type FolioDocumentOperationMode, type FolioDocumentOperationPrecondition, type FolioDocumentOperationReceipt, type FolioDocumentOperationRecovery, type FolioDocumentOperationResult, type FolioDocumentOperationResultBase, type FolioDocumentOperationStatus, type FolioDocumentOperationStory, type FolioDocumentOperationType, type FolioDocumentOperationUndoFailureReason, type FolioDocumentOperationUndoHandle, type FolioDocumentOperationUndoResult, type FolioDocxCompatibilityHost, type FolioDocxCompatibilityProfile, type FolioRevisionStamp, type FolioWordDiffOptions, type ImageMeta, type ImageRef, type InspectDocxCompatibilityOptions, InvalidCompareDocxOptionsError, InvalidFolioContentComparisonError, InvalidFolioDocumentOperationBatchError, MAX_COMPARE_OPERATIONS, type MarkdownOptions, type MarkdownResult, type PositionalText, type ResolvedAnchor, STELLA_STYLE_SET_NAME, type TemplatePreviewSpan, type TemplatePreviewValue, type TemplatePreviewValues, type TemplateSlashMenuKeyAction, type TemplateSlashMenuState, UnsupportedFolioDocumentOperationVersionError, WORD_DIFF_GRANULARITIES, type WordDiffGranularity, type WordDiffNormalization, type WordDiffOptions, type WordDiffSegment, acceptAutocompleteSuggestion, acceptAutocompleteWord, anonymizationDecorationsKey, appendAutocompleteToken, applyFolioAIEditOperations, applyFolioDocumentOperations, applySuggestions, assertSupportedFolioDocumentOperationVersion, autocompleteSuggestionKey, autocompleteSuggestionPlugin, buildEmbeddedFontFamilyMap, buildPositionalText, clearAutocompleteSuggestion, clearTemplateSlashMenu, compareContent, compareDocx, consumeTemplateSlashQuery, createAICitationDecorationsPlugin, createDocx, createEmptyDocument, createFolioAIEditSnapshot, createStellaStyleDocumentPreset, createStellaStyleSet, currentFolioBlockId, deriveBlockId, diffWordSegments, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, extractEmbeddedFonts, finishAutocompleteSuggestion, fromMarkdown, getAnonymizationMatches, getAutocompleteSuggestion, getEmbeddedFontFaces, getFolioCaretViewportRect, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioParaIdFromBlockId, getFolioSelectionViewportRect, getGoogleFontsEnabled, getTemplateDirectives, getTemplateSlashMenu, hashFolioAIBlockText, inspectDocumentStyles, inspectDocumentStylesFromDocx, inspectDocxCompatibility, isFolioAIContentBlock, isFolioBlockId, isFolioDocumentOperationModeSupported, isSequentialFolioBlockId, isSuggestionStale, isSupportedFolioDocumentOperationVersion, mergeDocumentContent, normalizeFolioAIBlockText, parseFolioDocumentOperationBatch, resetTemplateSlashQuery, resolveSuggestionAnchor, scanDirectives, scopeEmbeddedFontFamily, scrollFolioPositionIntoView, setAICitationsMeta, setAISuggestionsMeta, setActiveCitationMeta, setAnonymizationTermsMeta, setEmbeddedFontFamilyMap, setFocusedSuggestionMeta, setGoogleFontsEnabled, setTemplatePreviewValues, shouldTriggerAutocomplete, startAutocompleteSuggestion, templateSlashMenuKey, toMarkdown, toMarkdownResult };
43
+ export { type AIBarStatus, type AIChatMode, type AICitation, type AICitationRange, type AICitationSource, type AIGenerateInput, type AISuggestion, type AISuggestionApplyMode, type AISuggestionPreset, type AISuggestionSeverity, type AISuggestionStatus, type AcceptAutocompleteResult, type AnonymizationMatch, type AnonymizationTerm, type ApplyFolioDocumentOperationsOptions, type ApplyResult, type AutocompleteSuggestionPluginOptions, type AutocompleteSuggestionState, type AutocompleteSuggestionStatus, type AutocompleteTriggerCheck, type AutocompleteTriggerOptions, type AutocompleteTriggerSkipReason, type BlockRect, COMPARE_REVISION_FORMATS, COMPARE_UNSUPPORTED_REASONS, COMPARE_VERIFICATION_CAUSES, COMPARE_VERIFICATION_INVARIANTS, type CompareChange, type CompareChangeLocation, type CompareCompatibility, type CompareContentOptions, CompareDocxApplyError, type CompareDocxError, CompareDocxFinalParagraphMarkError, CompareDocxOperationLimitError, type CompareDocxOptions, CompareDocxParseError, CompareDocxRoundTripError, CompareDocxSerializeError, type CompareFolioRequirement, type CompareResult, type CompareRevisionFormat, type CompareUnsupportedPart, type CompareUnsupportedReason, type CompareVerification, type CompareVerificationCause, type CompareVerificationFailure, type CompareVerificationInvariant, type CreateEmptyDocumentOptions, DEFAULT_AI_SUGGESTION_PRESETS, DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, DOCX_CONFORMANCE_CLASSES, DRAWING_SAFETY_CLASSES, type DeriveBlockIdInput, type DirectiveKind, type DirectiveRange, type Document, type DocumentPreset, type DocumentStyleCatalog, type DocumentStyleCatalogEntry, type DocumentStyleSet, type DocxCompatibility, type DocxCompatibilityContext, type DocxCompatibilityIssue, type DocxCompatibilityLocation, type DocxCompatibilityPart, type DocxConformanceClass, type DocxDrawingClassification, type DrawingSafetyClass, type EmbeddedFont, type EmbeddedFontParts, type ExtractDocumentStyleSetOptions, FOLIO_CONTENT_COMPARISON_LIMITS, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FOLIO_LINE_SPACING_RULE_VALUES, FOLIO_PARAGRAPH_ALIGNMENT_VALUES, type FinalParagraphMarkRevision, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIBlockStructuralBoundary, type FolioAIBlockTableLocation, type FolioAIComment, type FolioAIEditAppliedOperation, type FolioAIEditApplyMode, type FolioAIEditApplyOutcome, type FolioAIEditApplyResult, type FolioAIEditNormalization, type FolioAIEditNormalizationCode, type FolioAIEditOperation, type FolioAIEditPrecondition, type FolioAIEditReviewMeta, type FolioAIEditSeverity, type FolioAIEditSkipReason, type FolioAIEditSkippedOperation, type FolioAIEditSnapshot, type FolioAIInlineBooleanProperty, type FolioAIInlineFormatting, type FolioAIInlineFormattingPatch, type FolioAIParagraphSpacing, type FolioAISignatureParty, type FolioBlockId, type FolioContentBlock, type FolioContentBlockProperty, type FolioContentComparison, type FolioContentComparisonError, type FolioContentComparisonEvent, type FolioContentComparisonLimit, FolioContentComparisonLimitError, type FolioContentContainerPathEntry, type FolioContentFormatRange, type FolioContentFormattingChange, type FolioContentIdStability, type FolioContentInlineBooleanProperty, type FolioContentInlineComparisonResult, type FolioContentInlineFormatting, type FolioContentInlineFormattingPatch, FolioContentInlinePresentationProjectionError, type FolioContentLineSpacingRule, type FolioContentParagraphAlignment, type FolioContentParagraphFormattingPatch, type FolioContentParagraphKind, type FolioContentParagraphSpacing, type FolioContentRun, type FolioContentSnapshot, type FolioContentStructuralChange, type FolioContentTableLocation, type FolioContentTextSegment, type FolioDocumentOperation, type FolioDocumentOperationAffectedTarget, type FolioDocumentOperationBatch, type FolioDocumentOperationCapabilities, type FolioDocumentOperationIssue, type FolioDocumentOperationMode, type FolioDocumentOperationPrecondition, type FolioDocumentOperationReceipt, type FolioDocumentOperationRecovery, type FolioDocumentOperationResult, type FolioDocumentOperationResultBase, type FolioDocumentOperationStatus, type FolioDocumentOperationStory, type FolioDocumentOperationType, type FolioDocumentOperationUndoFailureReason, type FolioDocumentOperationUndoHandle, type FolioDocumentOperationUndoResult, type FolioDocxCompatibilityHost, type FolioDocxCompatibilityProfile, type FolioRevisionStamp, type FolioWordDiffOptions, type ImageMeta, type ImageRef, type InspectDocxCompatibilityOptions, InvalidCompareDocxOptionsError, InvalidFolioContentComparisonError, InvalidFolioDocumentOperationBatchError, MAX_COMPARE_OPERATIONS, type MarkdownOptions, type MarkdownResult, type PositionalText, type ResolvedAnchor, STELLA_STYLE_SET_NAME, type TemplatePreviewSpan, type TemplatePreviewValue, type TemplatePreviewValues, type TemplateSlashMenuKeyAction, type TemplateSlashMenuState, UnsupportedFolioDocumentOperationVersionError, WORD_DIFF_GRANULARITIES, type WordDiffGranularity, type WordDiffNormalization, type WordDiffOptions, type WordDiffSegment, acceptAutocompleteSuggestion, acceptAutocompleteWord, anonymizationDecorationsKey, appendAutocompleteToken, applyFolioAIEditOperations, applyFolioDocumentOperations, applySuggestions, assertSupportedFolioDocumentOperationVersion, autocompleteSuggestionKey, autocompleteSuggestionPlugin, buildEmbeddedFontFamilyMap, buildPositionalText, clearAutocompleteSuggestion, clearTemplateSlashMenu, compareContent, compareDocx, consumeTemplateSlashQuery, createAICitationDecorationsPlugin, createDocx, createEmptyDocument, createFolioAIEditSnapshot, createStellaStyleDocumentPreset, createStellaStyleSet, currentFolioBlockId, deriveBlockId, diffWordSegments, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, extractEmbeddedFonts, finishAutocompleteSuggestion, fromMarkdown, getAnonymizationMatches, getAutocompleteSuggestion, getEmbeddedFontFaces, getFolioCaretViewportRect, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioParaIdFromBlockId, getFolioSelectionViewportRect, getGoogleFontsEnabled, getTemplateDirectives, getTemplateSlashMenu, hashFolioAIBlockText, inspectDocumentStyles, inspectDocumentStylesFromDocx, inspectDocxCompatibility, isFolioAIContentBlock, isFolioBlockId, isFolioDocumentOperationModeSupported, isSequentialFolioBlockId, isSuggestionStale, isSupportedFolioDocumentOperationVersion, mergeDocumentContent, normalizeFolioAIBlockText, parseFolioDocumentOperationBatch, resetTemplateSlashQuery, resolveSuggestionAnchor, scanDirectives, scopeEmbeddedFontFamily, scrollFolioPositionIntoView, setAICitationsMeta, setAISuggestionsMeta, setActiveCitationMeta, setAnonymizationTermsMeta, setEmbeddedFontFamilyMap, setFocusedSuggestionMeta, setGoogleFontsEnabled, setTemplatePreviewValues, shouldTriggerAutocomplete, startAutocompleteSuggestion, templateSlashMenuKey, toMarkdown, toMarkdownResult };
@@ -11,6 +11,7 @@ import { COMPARE_REVISION_FORMATS, COMPARE_UNSUPPORTED_REASONS, CompareDocxApply
11
11
  import { COMPARE_VERIFICATION_CAUSES, COMPARE_VERIFICATION_INVARIANTS } from "../compare/verification.js";
12
12
  import { FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FOLIO_LINE_SPACING_RULE_VALUES, FOLIO_PARAGRAPH_ALIGNMENT_VALUES, InvalidFolioDocumentOperationBatchError, UnsupportedFolioDocumentOperationVersionError, applyFolioDocumentOperations, assertSupportedFolioDocumentOperationVersion, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, isFolioDocumentOperationModeSupported, isSupportedFolioDocumentOperationVersion, parseFolioDocumentOperationBatch } from "../document-operations.js";
13
13
  import { inspectDocxCompatibility } from "../docx/compatibility.js";
14
+ import { DRAWING_SAFETY_CLASSES } from "../docx/imageRawXml.js";
14
15
  import { createDocx } from "../docx/rezip.js";
15
16
  import { buildEmbeddedFontFamilyMap, extractEmbeddedFonts, getEmbeddedFontFaces, scopeEmbeddedFontFamily } from "../fonts/embeddedFonts.js";
16
17
  import { DOCX_CONFORMANCE_CLASSES } from "../index.js";
@@ -32,4 +33,4 @@ import { currentFolioBlockId, deriveBlockId, getFolioParaIdFromBlockId, isFolioB
32
33
  import { createEmptyDocument } from "../utils/createDocument.js";
33
34
  import { getGoogleFontsEnabled, setEmbeddedFontFamilyMap, setGoogleFontsEnabled } from "../utils/fontResolver.js";
34
35
  import { mergeDocumentContent } from "../utils/mergeDocumentContent.js";
35
- export { COMPARE_REVISION_FORMATS, COMPARE_UNSUPPORTED_REASONS, COMPARE_VERIFICATION_CAUSES, COMPARE_VERIFICATION_INVARIANTS, CompareDocxApplyError, CompareDocxFinalParagraphMarkError, CompareDocxOperationLimitError, CompareDocxParseError, CompareDocxRoundTripError, CompareDocxSerializeError, DEFAULT_AI_SUGGESTION_PRESETS, DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, DOCX_CONFORMANCE_CLASSES, FOLIO_CONTENT_COMPARISON_LIMITS, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FOLIO_LINE_SPACING_RULE_VALUES, FOLIO_PARAGRAPH_ALIGNMENT_VALUES, FolioContentComparisonLimitError, FolioContentInlinePresentationProjectionError, InvalidCompareDocxOptionsError, InvalidFolioContentComparisonError, InvalidFolioDocumentOperationBatchError, MAX_COMPARE_OPERATIONS, STELLA_STYLE_SET_NAME, UnsupportedFolioDocumentOperationVersionError, WORD_DIFF_GRANULARITIES, acceptAutocompleteSuggestion, acceptAutocompleteWord, anonymizationDecorationsKey, appendAutocompleteToken, applyFolioAIEditOperations, applyFolioDocumentOperations, applySuggestions, assertSupportedFolioDocumentOperationVersion, autocompleteSuggestionKey, autocompleteSuggestionPlugin, buildEmbeddedFontFamilyMap, buildPositionalText, clearAutocompleteSuggestion, clearTemplateSlashMenu, compareContent, compareDocx, consumeTemplateSlashQuery, createAICitationDecorationsPlugin, createDocx, createEmptyDocument, createFolioAIEditSnapshot, createStellaStyleDocumentPreset, createStellaStyleSet, currentFolioBlockId, deriveBlockId, diffWordSegments, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, extractEmbeddedFonts, finishAutocompleteSuggestion, fromMarkdown, getAnonymizationMatches, getAutocompleteSuggestion, getEmbeddedFontFaces, getFolioCaretViewportRect, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioParaIdFromBlockId, getFolioSelectionViewportRect, getGoogleFontsEnabled, getTemplateDirectives, getTemplateSlashMenu, hashFolioAIBlockText, inspectDocumentStyles, inspectDocumentStylesFromDocx, inspectDocxCompatibility, isFolioAIContentBlock, isFolioBlockId, isFolioDocumentOperationModeSupported, isSequentialFolioBlockId, isSuggestionStale, isSupportedFolioDocumentOperationVersion, mergeDocumentContent, normalizeFolioAIBlockText, parseFolioDocumentOperationBatch, resetTemplateSlashQuery, resolveSuggestionAnchor, scanDirectives, scopeEmbeddedFontFamily, scrollFolioPositionIntoView, setAICitationsMeta, setAISuggestionsMeta, setActiveCitationMeta, setAnonymizationTermsMeta, setEmbeddedFontFamilyMap, setFocusedSuggestionMeta, setGoogleFontsEnabled, setTemplatePreviewValues, shouldTriggerAutocomplete, startAutocompleteSuggestion, templateSlashMenuKey, toMarkdown, toMarkdownResult };
36
+ export { COMPARE_REVISION_FORMATS, COMPARE_UNSUPPORTED_REASONS, COMPARE_VERIFICATION_CAUSES, COMPARE_VERIFICATION_INVARIANTS, CompareDocxApplyError, CompareDocxFinalParagraphMarkError, CompareDocxOperationLimitError, CompareDocxParseError, CompareDocxRoundTripError, CompareDocxSerializeError, DEFAULT_AI_SUGGESTION_PRESETS, DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, DOCX_CONFORMANCE_CLASSES, DRAWING_SAFETY_CLASSES, FOLIO_CONTENT_COMPARISON_LIMITS, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FOLIO_LINE_SPACING_RULE_VALUES, FOLIO_PARAGRAPH_ALIGNMENT_VALUES, FolioContentComparisonLimitError, FolioContentInlinePresentationProjectionError, InvalidCompareDocxOptionsError, InvalidFolioContentComparisonError, InvalidFolioDocumentOperationBatchError, MAX_COMPARE_OPERATIONS, STELLA_STYLE_SET_NAME, UnsupportedFolioDocumentOperationVersionError, WORD_DIFF_GRANULARITIES, acceptAutocompleteSuggestion, acceptAutocompleteWord, anonymizationDecorationsKey, appendAutocompleteToken, applyFolioAIEditOperations, applyFolioDocumentOperations, applySuggestions, assertSupportedFolioDocumentOperationVersion, autocompleteSuggestionKey, autocompleteSuggestionPlugin, buildEmbeddedFontFamilyMap, buildPositionalText, clearAutocompleteSuggestion, clearTemplateSlashMenu, compareContent, compareDocx, consumeTemplateSlashQuery, createAICitationDecorationsPlugin, createDocx, createEmptyDocument, createFolioAIEditSnapshot, createStellaStyleDocumentPreset, createStellaStyleSet, currentFolioBlockId, deriveBlockId, diffWordSegments, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, extractEmbeddedFonts, finishAutocompleteSuggestion, fromMarkdown, getAnonymizationMatches, getAutocompleteSuggestion, getEmbeddedFontFaces, getFolioCaretViewportRect, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioParaIdFromBlockId, getFolioSelectionViewportRect, getGoogleFontsEnabled, getTemplateDirectives, getTemplateSlashMenu, hashFolioAIBlockText, inspectDocumentStyles, inspectDocumentStylesFromDocx, inspectDocxCompatibility, isFolioAIContentBlock, isFolioBlockId, isFolioDocumentOperationModeSupported, isSequentialFolioBlockId, isSuggestionStale, isSupportedFolioDocumentOperationVersion, mergeDocumentContent, normalizeFolioAIBlockText, parseFolioDocumentOperationBatch, resetTemplateSlashQuery, resolveSuggestionAnchor, scanDirectives, scopeEmbeddedFontFamily, scrollFolioPositionIntoView, setAICitationsMeta, setAISuggestionsMeta, setActiveCitationMeta, setAnonymizationTermsMeta, setEmbeddedFontFamilyMap, setFocusedSuggestionMeta, setGoogleFontsEnabled, setTemplatePreviewValues, shouldTriggerAutocomplete, startAutocompleteSuggestion, templateSlashMenuKey, toMarkdown, toMarkdownResult };
@@ -2,6 +2,7 @@ import { DisplayColor, DisplayGlyphRun, DisplayHitRegion, DisplayPrimitive } fro
2
2
  import { hasCursiveLetter, joinsAcrossBoundary } from "../utils/cursiveJoining.js";
3
3
  import { hasComplexScript, isComplexScriptCodePoint } from "../utils/scriptSegments.js";
4
4
  //#region src/display-list/primitives.d.ts
5
+ type PrimitiveKind = DisplayPrimitive["kind"];
5
6
  /**
6
7
  * Left edge of every code point of a run, as an offset from the run's `xPx`.
7
8
  *
@@ -15,7 +16,7 @@ import { hasComplexScript, isComplexScriptCodePoint } from "../utils/scriptSegme
15
16
  * advances rightward from its origin whatever the paragraph does.
16
17
  */
17
18
  declare const glyphCellOffsetsPx: (run: DisplayGlyphRun) => readonly number[];
18
- declare const DISPLAY_PRIMITIVE_KINDS: ("glyphRun" | "rect" | "line" | "image" | "clipGroup" | "rotateGroup" | "opacityGroup")[];
19
+ declare const DISPLAY_PRIMITIVE_KINDS: readonly PrimitiveKind[];
19
20
  /**
20
21
  * Dash geometry of each stroke pattern, as multiples of the stroke thickness.
21
22
  *