@stll/folio-core 0.74.0 → 0.76.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 (174) 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 +7 -3
  4. package/dist/ai-edits/headless.js +36 -21
  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 +135 -90
  9. package/dist/ai-edits/pendingJoin.d.ts +5 -1
  10. package/dist/ai-edits/pendingJoin.js +6 -2
  11. package/dist/ai-edits/read.js +9 -3
  12. package/dist/ai-edits/retired-comment-receipts.d.ts +2 -2
  13. package/dist/ai-edits/retired-comment-receipts.js +3 -18
  14. package/dist/ai-edits/tracked-batch-fidelity.d.ts +6 -10
  15. package/dist/ai-edits/tracked-batch-fidelity.js +3 -182
  16. package/dist/ai-edits/types.d.ts +9 -4
  17. package/dist/canonical/batchCommentReferences.js +2 -1
  18. package/dist/canonical/canonicalBatchReview.d.ts +4 -1
  19. package/dist/canonical/canonicalBatchReview.js +37 -22
  20. package/dist/canonical/canonicalComments.d.ts +6 -2
  21. package/dist/canonical/canonicalComments.js +16 -6
  22. package/dist/canonical/canonicalCompilerRefusal.d.ts +2 -4
  23. package/dist/canonical/canonicalCompilerRefusal.js +20 -14
  24. package/dist/canonical/canonicalPublicOperations.js +231 -79
  25. package/dist/canonical/canonicalRefusalGrounds.d.ts +4 -0
  26. package/dist/canonical/canonicalRefusalGrounds.js +56 -0
  27. package/dist/canonical/canonicalSession.d.ts +12 -6
  28. package/dist/canonical/canonicalSession.js +119 -122
  29. package/dist/canonical/canonicalTrackedBatchFidelity.js +3 -3
  30. package/dist/compare/inline-atoms.d.ts +35 -41
  31. package/dist/compare/inline-atoms.js +2 -465
  32. package/dist/compare/section-boundary-properties.d.ts +3 -30
  33. package/dist/compare/section-boundary-properties.js +4 -72
  34. package/dist/controller/canonicalClipboard.d.ts +1 -1
  35. package/dist/controller/canonicalClipboard.js +110 -55
  36. package/dist/controller/canonicalComposition.d.ts +1 -1
  37. package/dist/controller/canonicalComposition.js +5 -5
  38. package/dist/controller/canonicalContentControlValue.js +7 -7
  39. package/dist/controller/canonicalInput.d.ts +4 -2
  40. package/dist/controller/canonicalInput.js +33 -16
  41. package/dist/controller/canonicalReview.d.ts +21 -0
  42. package/dist/controller/canonicalReview.js +44 -9
  43. package/dist/controller/canonicalStoryEditor.d.ts +2 -3
  44. package/dist/controller/canonicalStoryEditor.js +43 -25
  45. package/dist/controller/canonicalStructure.d.ts +19 -3
  46. package/dist/controller/canonicalStructure.js +182 -58
  47. package/dist/controller/deferredDisplayListPainter.d.ts +8 -0
  48. package/dist/controller/deferredDisplayListPainter.js +34 -0
  49. package/dist/controller/folioEditor.js +4 -2
  50. package/dist/controller/fontReadiness.js +50 -23
  51. package/dist/controller/headerFooterEditorManager.js +3 -17
  52. package/dist/controller/hiddenEditorApi.d.ts +24 -3
  53. package/dist/controller/hiddenEditorApi.js +2 -0
  54. package/dist/controller/hiddenEditorManager.js +135 -207
  55. package/dist/controller/layoutPipeline.d.ts +4 -86
  56. package/dist/controller/layoutPipeline.js +8 -727
  57. package/dist/controller/layoutPipelineExecution.d.ts +94 -0
  58. package/dist/controller/layoutPipelineExecution.js +730 -0
  59. package/dist/controller/noteEditorManager.js +3 -16
  60. package/dist/docx/blockContentParser.d.ts +1 -3
  61. package/dist/docx/blockContentParser.js +3 -10
  62. package/dist/docx/bulletMarkers.d.ts +8 -0
  63. package/dist/docx/bulletMarkers.js +9 -1
  64. package/dist/docx/canonicalSave.d.ts +4 -3
  65. package/dist/docx/canonicalSave.js +4 -3
  66. package/dist/docx/canonicalSessionInput.js +25 -11
  67. package/dist/docx/ensureParaIds.d.ts +31 -0
  68. package/dist/docx/ensureParaIds.js +57 -32
  69. package/dist/docx/ensureUniqueControlIds.d.ts +13 -0
  70. package/dist/docx/ensureUniqueControlIds.js +47 -29
  71. package/dist/docx/ensureUniqueRevisionIds.d.ts +13 -0
  72. package/dist/docx/ensureUniqueRevisionIds.js +52 -29
  73. package/dist/docx/listMarkerComputation.d.ts +24 -17
  74. package/dist/docx/listMarkerComputation.js +31 -60
  75. package/dist/docx/listModelNormalization.js +8 -15
  76. package/dist/docx/rezip.d.ts +16 -3
  77. package/dist/docx/rezip.js +35 -9
  78. package/dist/docx/selectiveSave.js +13 -5
  79. package/dist/docx/server/templatePlan/apply.js +96 -7
  80. package/dist/docx/server/templatePlan/blocks.d.ts +70 -3
  81. package/dist/docx/server/templatePlan/blocks.js +272 -10
  82. package/dist/docx/server/templatePlan/builders.d.ts +52 -2
  83. package/dist/docx/server/templatePlan/builders.js +224 -5
  84. package/dist/docx/server/templatePlan/effects.d.ts +27 -0
  85. package/dist/docx/server/templatePlan/effects.js +188 -0
  86. package/dist/docx/server/templatePlan/emit.d.ts +4 -1
  87. package/dist/docx/server/templatePlan/emit.js +46 -2
  88. package/dist/docx/server/templatePlan/inspect.js +39 -52
  89. package/dist/docx/server/templatePlan/labels.d.ts +7 -2
  90. package/dist/docx/server/templatePlan/labels.js +120 -23
  91. package/dist/docx/server/templatePlan/plan.d.ts +24 -3
  92. package/dist/docx/server/templatePlan/plan.js +54 -15
  93. package/dist/docx/server/templatePlan/planShape.js +76 -22
  94. package/dist/docx/server/templatePlan/revisions.d.ts +46 -0
  95. package/dist/docx/server/templatePlan/revisions.js +407 -0
  96. package/dist/docx/server/templatePlan/story.d.ts +23 -1
  97. package/dist/docx/server/templatePlan/story.js +60 -2
  98. package/dist/docx/server/templatePlan/types.d.ts +354 -16
  99. package/dist/docx/server/templatePlan/verify.js +164 -14
  100. package/dist/docx/server/templatePlan/xml.d.ts +3 -0
  101. package/dist/docx/server/templatePlan/xml.js +4 -1
  102. package/dist/i18n/messages/ar.gen.js +1 -0
  103. package/dist/i18n/messages/catalogs.gen.d.ts +17 -0
  104. package/dist/i18n/messages/catalogs.gen.js +17 -0
  105. package/dist/i18n/messages/cs.gen.js +1 -0
  106. package/dist/i18n/messages/de.gen.js +1 -0
  107. package/dist/i18n/messages/en.gen.js +1 -0
  108. package/dist/i18n/messages/es.gen.js +1 -0
  109. package/dist/i18n/messages/et.gen.js +1 -0
  110. package/dist/i18n/messages/fr.gen.js +1 -0
  111. package/dist/i18n/messages/he.gen.js +1 -0
  112. package/dist/i18n/messages/hi.gen.js +1 -0
  113. package/dist/i18n/messages/hu.gen.js +1 -0
  114. package/dist/i18n/messages/lt.gen.js +1 -0
  115. package/dist/i18n/messages/lv.gen.js +1 -0
  116. package/dist/i18n/messages/messages.gen.d.ts +1 -0
  117. package/dist/i18n/messages/pl.gen.js +1 -0
  118. package/dist/i18n/messages/pt-BR.gen.js +1 -0
  119. package/dist/i18n/messages/sk.gen.js +1 -0
  120. package/dist/i18n/messages/tr.gen.js +1 -0
  121. package/dist/i18n/messages/zh-CN.gen.js +1 -0
  122. package/dist/internal/revisionResolutionStep.d.ts +2 -31
  123. package/dist/internal/revisionResolutionStep.js +2 -171
  124. package/dist/layout-bridge/convert/toFlowBlocks.js +0 -12
  125. package/dist/layout-bridge/convert/topLevelConversion.js +1 -10
  126. package/dist/prosemirror/commands/comments.d.ts +6 -234
  127. package/dist/prosemirror/commands/comments.js +5 -2464
  128. package/dist/prosemirror/commands/index.d.ts +4 -2
  129. package/dist/prosemirror/commands/index.js +4 -2
  130. package/dist/prosemirror/commands/tableCellMergeResolution.d.ts +1 -11
  131. package/dist/prosemirror/commands/tableCellMergeResolution.js +3 -154
  132. package/dist/prosemirror/extensions/features/ImagePasteExtension.js +1 -1
  133. package/dist/prosemirror/extensions/marks/HyperlinkExtension.js +6 -8
  134. package/dist/prosemirror/hyperlinkRemoval.d.ts +11 -8
  135. package/dist/prosemirror/hyperlinkRemoval.js +24 -15
  136. package/dist/prosemirror/listMarker.d.ts +1 -6
  137. package/dist/prosemirror/listMarker.js +4 -56
  138. package/dist/prosemirror/paraIds.d.ts +1 -14
  139. package/dist/prosemirror/paraIds.js +1 -14
  140. package/dist/prosemirror/paragraphMarkJoin.d.ts +0 -16
  141. package/dist/prosemirror/paragraphMarkJoin.js +3 -46
  142. package/dist/prosemirror/projectionReview.d.ts +49 -0
  143. package/dist/prosemirror/projectionReview.js +292 -0
  144. package/dist/prosemirror/rebaseParagraphRunFormatting.d.ts +1 -13
  145. package/dist/prosemirror/rebaseParagraphRunFormatting.js +1 -16
  146. package/dist/prosemirror/replacedAnnotations.d.ts +2 -5
  147. package/dist/prosemirror/replacedAnnotations.js +1 -10
  148. package/dist/prosemirror/revisionCarriers.d.ts +9 -1
  149. package/dist/prosemirror/revisionCarriers.js +15 -1
  150. package/dist/prosemirror/revisionRangeQueries.d.ts +32 -0
  151. package/dist/prosemirror/revisionRangeQueries.js +76 -0
  152. package/dist/prosemirror/runFormattingMarkNames.d.ts +1 -1
  153. package/dist/prosemirror/runFormattingMarkNames.js +1 -1
  154. package/dist/prosemirror/suggestionQueries.d.ts +114 -0
  155. package/dist/prosemirror/suggestionQueries.js +320 -0
  156. package/dist/prosemirror/tableGridMutation.d.ts +1 -16
  157. package/dist/prosemirror/tableGridMutation.js +1 -78
  158. package/dist/prosemirror/tableRowRevisionOwnership.d.ts +18 -0
  159. package/dist/prosemirror/tableRowRevisionOwnership.js +7 -0
  160. package/dist/prosemirror/utils/extractTrackedChanges.js +14 -4
  161. package/dist/server.d.ts +2 -2
  162. package/dist/types/canonicalCapabilities.d.ts +40 -69
  163. package/dist/types/canonicalCapabilities.js +51 -65
  164. package/dist/types/canonicalComments.d.ts +2 -2
  165. package/dist/types/canonicalSections.d.ts +2 -2
  166. package/dist/utils/clipboard.d.ts +2 -28
  167. package/dist/utils/clipboard.js +1 -96
  168. package/dist/utils/clipboardFiles.d.ts +27 -0
  169. package/dist/utils/clipboardFiles.js +98 -0
  170. package/dist/utils/rulerControl.d.ts +1 -0
  171. package/dist/utils/rulerControl.js +2 -1
  172. package/package.json +2 -2
  173. package/dist/internal/headlessRevisionResolutionGuard.d.ts +0 -3
  174. package/dist/internal/headlessRevisionResolutionGuard.js +0 -18
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, DocxTemplateInvisibleEffect, DocxTemplateNumbering, DocxTemplateNumberingLevel, DocxTemplateSection, DocxTemplateStyle, DocxTextEffect, DocxTextEffectOwner, DocxTrackedChanges, TEMPLATE_PLAN_ERROR_CODES, TemplatePlan, TemplatePlanAlignment, TemplatePlanBlockResult, TemplatePlanEffectCount, TemplatePlanError, TemplatePlanErrorCode, TemplatePlanFieldLeftover, TemplatePlanHighlight, TemplatePlanIndent, TemplatePlanIssue, TemplatePlanItem, TemplatePlanMerge, TemplatePlanNestedParagraph, TemplatePlanNoteCounts, TemplatePlanNumbering, TemplatePlanNumberingPatch, TemplatePlanOmitReason, TemplatePlanReference, TemplatePlanReferenceResult, TemplatePlanReport, TemplatePlanSection, TemplatePlanSectionPage, TemplatePlanSourceItem, TemplatePlanSpanCounts, TemplatePlanTrackedView, 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 DocxTemplateInvisibleEffect, type DocxTemplateNumbering, type DocxTemplateNumberingLevel, type DocxTemplateSection, type DocxTemplateStyle, type DocxTextEffect, type DocxTextEffectOwner, type DocxTrackedChanges, 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 TemplatePlanAlignment, type TemplatePlanBlockResult, type TemplatePlanEffectCount, TemplatePlanError, type TemplatePlanErrorCode, type TemplatePlanFieldLeftover, type TemplatePlanHighlight, type TemplatePlanIndent, 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, type TemplatePlanTrackedView, 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,16 +1,8 @@
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
- readonly commands: "command-descriptors";
5
3
  readonly trackedTableStructure: "tracked-table-structure";
6
4
  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";
12
- readonly publicComments: "publicOps.comments";
13
- readonly publicUnsupportedInline: "publicOps.unsupportedInline";
5
+ readonly trackedChangeRecords: "tracked-change-records";
14
6
  readonly commentReplacementAlignment: "comment-replacement-alignment";
15
7
  readonly publicHeadlessSession: "publicOps.headlessSession";
16
8
  };
@@ -29,53 +21,68 @@ export declare const CANONICAL_RULE_MESSAGE_KEYS: {
29
21
  readonly contentControlLock: "editor.contentLocked";
30
22
  readonly linkSuggestionShape: "editor.linkSuggestionUnavailable";
31
23
  };
24
+ /**
25
+ * Conditions of the session or of the request, not of the document: the
26
+ * session holds the capability, but cannot make this change now or was not
27
+ * asked for one it can make. A refusal under one is correct and is never a gap
28
+ * to retire.
29
+ */
30
+ export declare const CANONICAL_CONDITION: {
31
+ readonly notReady: "notReady";
32
+ readonly notEditable: "notEditable";
33
+ readonly composing: "composing";
34
+ readonly invalidRequest: "invalidRequest";
35
+ readonly idSpace: "idSpace";
36
+ readonly stale: "stale";
37
+ readonly hostTransaction: "hostTransaction";
38
+ readonly internal: "internal";
39
+ };
40
+ export type CanonicalCondition = (typeof CANONICAL_CONDITION)[keyof typeof CANONICAL_CONDITION];
32
41
  /**
33
42
  * The editor message, in the folio catalog, a host shows for a refusal under
34
43
  * any gap: the change cannot be made here yet.
35
44
  */
36
45
  export declare const CANONICAL_GAP_MESSAGE_KEY: "editor.changeUnavailable";
46
+ /**
47
+ * The editor message, in the folio catalog, a host shows for a refusal under
48
+ * any condition: the change was not made.
49
+ */
50
+ export declare const CANONICAL_CONDITION_MESSAGE_KEY: "editor.changeNotApplied";
37
51
  /** A catalog key a refusal notice reads. */
38
- export type CanonicalRefusalMessageKey = (typeof CANONICAL_RULE_MESSAGE_KEYS)[CanonicalRule] | typeof CANONICAL_GAP_MESSAGE_KEY;
52
+ export type CanonicalRefusalMessageKey = (typeof CANONICAL_RULE_MESSAGE_KEYS)[CanonicalRule] | typeof CANONICAL_GAP_MESSAGE_KEY | typeof CANONICAL_CONDITION_MESSAGE_KEY;
39
53
  /**
40
54
  * What a host shows for a refusal, always from the folio catalog, which the
41
55
  * 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.
56
+ * that the change was not made for a condition, and that the change cannot be
57
+ * made here yet for a gap. The session's own message describes the refusal
58
+ * for logs and `onError`, never for the user.
44
59
  */
45
60
  export declare const canonicalRefusalNotice: (ground: CanonicalRefusalGround, translate: (key: CanonicalRefusalMessageKey) => string) => string;
46
61
  /**
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.
62
+ * The ground for a refusal: a capability the session does not have yet, a
63
+ * rule the document or its review records state, or a condition of the
64
+ * session or the request. A host tells "not supported yet" from "not allowed"
65
+ * from "not now" by which one is present.
50
66
  */
51
67
  export type CanonicalRefusalGround = {
52
68
  gap: CanonicalGap;
53
69
  rule?: never;
70
+ condition?: never;
54
71
  } | {
55
72
  rule: CanonicalRule;
56
73
  gap?: never;
74
+ condition?: never;
75
+ } | {
76
+ condition: CanonicalCondition;
77
+ gap?: never;
78
+ rule?: never;
57
79
  };
58
80
  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
- readonly "command-descriptors": {
66
- readonly remainingCommands: {
67
- readonly registry: "extension-commands";
68
- };
69
- readonly owner: "controller";
70
- readonly kind: "refusal";
71
- readonly adapters: readonly ["react", "vue"];
72
- readonly summary: "Commands without canonical descriptors retain PM probing and hit the dispatch boundary.";
73
- };
74
81
  readonly "tracked-table-structure": {
75
82
  readonly owner: "controller";
76
83
  readonly kind: "refusal";
77
84
  readonly adapters: readonly ["react", "vue"];
78
- readonly summary: "Suggested row, column and table changes refuse content the tracked table records cannot express; a dragged table refuses to move.";
85
+ readonly summary: "Suggested table changes refuse markup the tracked table records cannot express: a row insertion or deletion in a table holding captured markup, wrapper stacks or row content controls; a column or cell edit in a table whose rows keep captured markup between their cells; a table inserted or deleted with captured markup, bookmarks, wrapper stacks or property revisions; a column deletion through a cell spanning other columns.";
79
86
  };
80
87
  readonly "story-content-projection": {
81
88
  readonly owner: "controller";
@@ -83,47 +90,11 @@ export declare const CANONICAL_CAPABILITIES: {
83
90
  readonly adapters: readonly ["react", "vue"];
84
91
  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
92
  };
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";
112
- readonly kind: "refusal";
113
- readonly adapters: readonly ["react", "vue"];
114
- readonly summary: "Canonical save waits for composition to finish and reports package serialization refusals and fidelity fallbacks.";
115
- };
116
- readonly "publicOps.comments": {
117
- readonly owner: "document-operations";
118
- readonly kind: "refusal";
119
- readonly adapters: readonly ["react", "vue"];
120
- readonly summary: "Public comment edits refuse when their anchors or revision structure cannot be represented.";
121
- };
122
- readonly "publicOps.unsupportedInline": {
93
+ readonly "tracked-change-records": {
123
94
  readonly owner: "document-operations";
124
95
  readonly kind: "refusal";
125
96
  readonly adapters: readonly ["react", "vue"];
126
- readonly summary: "Unsupported public payloads refuse with a typed compiler capability gap.";
97
+ 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.";
127
98
  };
128
99
  readonly "comment-replacement-alignment": {
129
100
  readonly owner: "controller";
@@ -1,17 +1,9 @@
1
1
  // src/types/canonicalCapabilities.ts
2
2
  /** Remaining seams to retire before the canonical session becomes the only authority. */
3
3
  const CANONICAL_GAP = {
4
- authorityRouting: "authority-routing",
5
- commands: "command-descriptors",
6
4
  trackedTableStructure: "tracked-table-structure",
7
5
  storyContentProjection: "story-content-projection",
8
- comments: "comment-model-edits",
9
- modelEdits: "direct-model-edits",
10
- sectionProperties: "section-properties",
11
- dispatch: "unclassified-transactions",
12
- saveSerialization: "save-serialization",
13
- publicComments: "publicOps.comments",
14
- publicUnsupportedInline: "publicOps.unsupportedInline",
6
+ trackedChangeRecords: "tracked-change-records",
15
7
  commentReplacementAlignment: "comment-replacement-alignment",
16
8
  publicHeadlessSession: "publicOps.headlessSession"
17
9
  };
@@ -36,36 +28,66 @@ const CANONICAL_RULE_MESSAGE_KEYS = {
36
28
  linkSuggestionShape: "editor.linkSuggestionUnavailable"
37
29
  };
38
30
  /**
31
+ * Conditions of the session or of the request, not of the document: the
32
+ * session holds the capability, but cannot make this change now or was not
33
+ * asked for one it can make. A refusal under one is correct and is never a gap
34
+ * to retire.
35
+ */
36
+ const CANONICAL_CONDITION = {
37
+ /** No session holds a document yet, or the editor showing it has closed. */
38
+ notReady: "notReady",
39
+ /** The editor is read-only. */
40
+ notEditable: "notEditable",
41
+ /** An input composition must finish first. */
42
+ composing: "composing",
43
+ /**
44
+ * The request names nothing in the document or describes no change the
45
+ * document allows, such as a reply to a missing comment.
46
+ */
47
+ invalidRequest: "invalidRequest",
48
+ /** No id is left to mint, in the document or in this author's lease. */
49
+ idSpace: "idSpace",
50
+ /** The projection, version or lease the change was prepared against moved on. */
51
+ stale: "stale",
52
+ /**
53
+ * A plugin or raw dispatch changed the document outside document
54
+ * operations; hosts express edits through `applyDocumentOperations`.
55
+ */
56
+ hostTransaction: "hostTransaction",
57
+ /**
58
+ * The session failed to project or stage the change: a defect to report,
59
+ * not a missing capability.
60
+ */
61
+ internal: "internal"
62
+ };
63
+ /**
39
64
  * The editor message, in the folio catalog, a host shows for a refusal under
40
65
  * any gap: the change cannot be made here yet.
41
66
  */
42
67
  const CANONICAL_GAP_MESSAGE_KEY = "editor.changeUnavailable";
43
68
  /**
69
+ * The editor message, in the folio catalog, a host shows for a refusal under
70
+ * any condition: the change was not made.
71
+ */
72
+ const CANONICAL_CONDITION_MESSAGE_KEY = "editor.changeNotApplied";
73
+ /**
44
74
  * What a host shows for a refusal, always from the folio catalog, which the
45
75
  * host translates: the editor's own message for a rule the document states,
46
- * and that the change cannot be made here yet for a gap. The session's own
47
- * message describes the refusal for logs and `onError`, never for the user.
76
+ * that the change was not made for a condition, and that the change cannot be
77
+ * made here yet for a gap. The session's own message describes the refusal
78
+ * for logs and `onError`, never for the user.
48
79
  */
49
- const canonicalRefusalNotice = (ground, translate) => translate(ground.rule === void 0 ? CANONICAL_GAP_MESSAGE_KEY : CANONICAL_RULE_MESSAGE_KEYS[ground.rule]);
80
+ const canonicalRefusalNotice = (ground, translate) => {
81
+ if (ground.rule !== void 0) return translate(CANONICAL_RULE_MESSAGE_KEYS[ground.rule]);
82
+ if (ground.condition !== void 0) return translate(CANONICAL_CONDITION_MESSAGE_KEY);
83
+ return translate(CANONICAL_GAP_MESSAGE_KEY);
84
+ };
50
85
  const CANONICAL_CAPABILITIES = {
51
- [CANONICAL_GAP.authorityRouting]: {
52
- owner: "controller",
53
- kind: "routing",
54
- adapters: ["react", "vue"],
55
- summary: "Explicit session selection and legacy authority routing."
56
- },
57
- [CANONICAL_GAP.commands]: {
58
- remainingCommands: { registry: "extension-commands" },
59
- owner: "controller",
60
- kind: "refusal",
61
- adapters: ["react", "vue"],
62
- summary: "Commands without canonical descriptors retain PM probing and hit the dispatch boundary."
63
- },
64
86
  [CANONICAL_GAP.trackedTableStructure]: {
65
87
  owner: "controller",
66
88
  kind: "refusal",
67
89
  adapters: ["react", "vue"],
68
- summary: "Suggested row, column and table changes refuse content the tracked table records cannot express; a dragged table refuses to move."
90
+ summary: "Suggested table changes refuse markup the tracked table records cannot express: a row insertion or deletion in a table holding captured markup, wrapper stacks or row content controls; a column or cell edit in a table whose rows keep captured markup between their cells; a table inserted or deleted with captured markup, bookmarks, wrapper stacks or property revisions; a column deletion through a cell spanning other columns."
69
91
  },
70
92
  [CANONICAL_GAP.storyContentProjection]: {
71
93
  owner: "controller",
@@ -73,47 +95,11 @@ const CANONICAL_CAPABILITIES = {
73
95
  adapters: ["react", "vue"],
74
96
  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."
75
97
  },
76
- [CANONICAL_GAP.comments]: {
77
- owner: "adapters",
78
- kind: "routing",
79
- adapters: ["react", "vue"],
80
- summary: "Legacy sessions retain comment model edits; canonical comments use semantic operations."
81
- },
82
- [CANONICAL_GAP.modelEdits]: {
83
- owner: "adapters",
84
- kind: "refusal",
85
- adapters: ["react", "vue"],
86
- summary: "Direct model and pending-suggestion snapshots bypass the canonical journal."
87
- },
88
- [CANONICAL_GAP.sectionProperties]: {
89
- owner: "controller",
90
- kind: "routing",
91
- adapters: ["react", "vue"],
92
- summary: "The shared controller journals section properties; legacy sessions keep model changes."
93
- },
94
- [CANONICAL_GAP.dispatch]: {
95
- owner: "controller",
96
- kind: "refusal",
97
- adapters: ["react", "vue"],
98
- 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)."
99
- },
100
- [CANONICAL_GAP.saveSerialization]: {
101
- owner: "controller",
102
- kind: "refusal",
103
- adapters: ["react", "vue"],
104
- summary: "Canonical save waits for composition to finish and reports package serialization refusals and fidelity fallbacks."
105
- },
106
- [CANONICAL_GAP.publicComments]: {
107
- owner: "document-operations",
108
- kind: "refusal",
109
- adapters: ["react", "vue"],
110
- summary: "Public comment edits refuse when their anchors or revision structure cannot be represented."
111
- },
112
- [CANONICAL_GAP.publicUnsupportedInline]: {
98
+ [CANONICAL_GAP.trackedChangeRecords]: {
113
99
  owner: "document-operations",
114
100
  kind: "refusal",
115
101
  adapters: ["react", "vue"],
116
- summary: "Unsupported public payloads refuse with a typed compiler capability gap."
102
+ 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."
117
103
  },
118
104
  [CANONICAL_GAP.commentReplacementAlignment]: {
119
105
  owner: "controller",
@@ -129,4 +115,4 @@ const CANONICAL_CAPABILITIES = {
129
115
  }
130
116
  };
131
117
  const canonicalRefusalMessage = (gap, message) => `[${gap}] ${message}`;
132
- export { CANONICAL_CAPABILITIES, CANONICAL_GAP, CANONICAL_GAP_MESSAGE_KEY, CANONICAL_RULE, CANONICAL_RULE_MESSAGE_KEYS, canonicalRefusalMessage, canonicalRefusalNotice };
118
+ export { CANONICAL_CAPABILITIES, CANONICAL_CONDITION, CANONICAL_CONDITION_MESSAGE_KEY, CANONICAL_GAP, CANONICAL_GAP_MESSAGE_KEY, CANONICAL_RULE, CANONICAL_RULE_MESSAGE_KEYS, canonicalRefusalMessage, canonicalRefusalNotice };
@@ -1,4 +1,4 @@
1
- import { CanonicalGap } from "./canonicalCapabilities.js";
1
+ import { CanonicalRefusalGround } from "./canonicalCapabilities.js";
2
2
  import { Comment } from "./content.js";
3
3
  import { OpStory } from "@stll/docx-core/ops";
4
4
  /** Requests name their anchor; comment metadata never creates an unanchored root. */
@@ -41,7 +41,7 @@ export type CanonicalCommentResult = {
41
41
  commentId?: number;
42
42
  } | {
43
43
  status: "refused";
44
- gap: CanonicalGap;
44
+ ground: CanonicalRefusalGround;
45
45
  message: string;
46
46
  /** Whether the same request can succeed once a pending composition settles. */
47
47
  retry: "afterComposition" | "never";
@@ -1,9 +1,9 @@
1
- import { CANONICAL_GAP } from "./canonicalCapabilities.js";
1
+ import { CanonicalRefusalGround } from "./canonicalCapabilities.js";
2
2
  export type CanonicalSectionPropertiesResult = {
3
3
  status: "applied";
4
4
  version: number;
5
5
  } | {
6
6
  status: "refused";
7
- gap: typeof CANONICAL_GAP.sectionProperties;
7
+ ground: CanonicalRefusalGround;
8
8
  message: string;
9
9
  };
@@ -1,4 +1,5 @@
1
1
  import { document_d_exports } from "../types/document.js";
2
+ import { CLIPBOARD_TYPES, INTERNAL_CLIPBOARD_TYPE, getClipboardImageFiles, getStandaloneClipboardImageFiles } from "./clipboardFiles.js";
2
3
  /**
3
4
  * Clipboard content format
4
5
  */
@@ -34,33 +35,6 @@ export type ClipboardOptions = {
34
35
  /** Callback for handling errors */
35
36
  onError?: (error: Error) => void;
36
37
  };
37
- /**
38
- * Custom MIME type for internal clipboard format
39
- */
40
- export declare const INTERNAL_CLIPBOARD_TYPE = "application/x-stella-folio";
41
- /**
42
- * Standard clipboard MIME types
43
- */
44
- export declare const CLIPBOARD_TYPES: {
45
- readonly HTML: "text/html";
46
- readonly PLAIN: "text/plain";
47
- };
48
- /**
49
- * Extract image files from clipboard data (if present).
50
- */
51
- type ClipboardDataLike = {
52
- files?: FileList | readonly File[] | undefined;
53
- getData?: ((format: string) => string) | undefined;
54
- items?: DataTransferItemList | readonly DataTransferItem[] | undefined;
55
- types?: ArrayLike<string> | undefined;
56
- };
57
- export declare function getClipboardImageFiles(clipboardData: ClipboardDataLike | null): File[];
58
- /**
59
- * Return image files only when the clipboard has no readable editor content.
60
- * Rich HTML, internal payloads, and plain text must stay on the normal paste
61
- * path; some applications include a rendered image beside that content.
62
- */
63
- export declare function getStandaloneClipboardImageFiles(clipboardData: ClipboardDataLike | null): File[];
64
38
  /**
65
39
  * Copy runs to clipboard with formatting
66
40
  */
@@ -147,4 +121,4 @@ declare const _default_1: {
147
121
  isEditorHtml: typeof isEditorHtml;
148
122
  createClipboardHandlers: typeof createClipboardHandlers;
149
123
  };
150
- export { _default_1 as default };
124
+ export { CLIPBOARD_TYPES, INTERNAL_CLIPBOARD_TYPE, _default_1 as default, getClipboardImageFiles, getStandaloneClipboardImageFiles };
@@ -1,3 +1,4 @@
1
+ import { CLIPBOARD_TYPES, INTERNAL_CLIPBOARD_TYPE, getClipboardImageFiles, getStandaloneClipboardImageFiles } from "./clipboardFiles.js";
1
2
  import { htmlCommentEnd } from "./htmlComments.js";
2
3
  import { stripXmlDeclarations } from "./stripXmlDeclarations.js";
3
4
  import { encodeUtf8, readBlobText } from "./textEncoding.js";
@@ -15,17 +16,6 @@ import createDOMPurify from "dompurify";
15
16
  */
16
17
  let domPurify;
17
18
  const getDomPurify = () => domPurify ??= createDOMPurify(window);
18
- /**
19
- * Custom MIME type for internal clipboard format
20
- */
21
- const INTERNAL_CLIPBOARD_TYPE = "application/x-stella-folio";
22
- /**
23
- * Standard clipboard MIME types
24
- */
25
- const CLIPBOARD_TYPES = {
26
- HTML: "text/html",
27
- PLAIN: "text/plain"
28
- };
29
19
  const SKIPPED_CLIPBOARD_ELEMENTS = /* @__PURE__ */ new Set([
30
20
  "script",
31
21
  "style",
@@ -35,91 +25,6 @@ const SKIPPED_CLIPBOARD_ELEMENTS = /* @__PURE__ */ new Set([
35
25
  "svg",
36
26
  "math"
37
27
  ]);
38
- function getClipboardImageFiles(clipboardData) {
39
- if (!clipboardData) return [];
40
- const collectFromItems = () => {
41
- const items = clipboardData.items;
42
- if (!items || items.length === 0) return [];
43
- const files = [];
44
- for (const item of Array.from(items)) {
45
- if (item.kind !== "file") continue;
46
- if (!item.type.startsWith("image/")) continue;
47
- const file = item.getAsFile();
48
- if (file) files.push(file);
49
- }
50
- return files;
51
- };
52
- const collectFromFiles = () => {
53
- const clipboardFiles = clipboardData.files;
54
- if (!clipboardFiles || clipboardFiles.length === 0) return [];
55
- return Array.from(clipboardFiles).filter((file) => file.type.startsWith("image/"));
56
- };
57
- const candidates = collectFromItems();
58
- const files = candidates.length ? candidates : collectFromFiles();
59
- if (files.length <= 1) return files;
60
- const preferredTypes = [
61
- "image/png",
62
- "image/jpeg",
63
- "image/webp",
64
- "image/gif",
65
- "image/svg+xml",
66
- "image/bmp",
67
- "image/tiff"
68
- ];
69
- const pickBest = (group) => {
70
- let best = group[0];
71
- let bestRank = preferredTypes.indexOf(best.type);
72
- if (bestRank < 0) bestRank = Number.MAX_SAFE_INTEGER;
73
- for (const file of group.slice(1)) {
74
- let rank = preferredTypes.indexOf(file.type);
75
- if (rank < 0) rank = Number.MAX_SAFE_INTEGER;
76
- if (rank < bestRank) {
77
- best = file;
78
- bestRank = rank;
79
- continue;
80
- }
81
- if (rank === bestRank && file.size > best.size) best = file;
82
- }
83
- return best;
84
- };
85
- const groups = /* @__PURE__ */ new Map();
86
- for (const file of files) {
87
- const rawName = file.name.trim();
88
- const key = (rawName ? rawName.replace(/\.[^/.]+$/, "").toLowerCase() : "") || `size:${file.size}`;
89
- const bucket = groups.get(key);
90
- if (bucket) bucket.push(file);
91
- else groups.set(key, [file]);
92
- }
93
- const deduped = [];
94
- for (const group of groups.values()) deduped.push(pickBest(group));
95
- return deduped;
96
- }
97
- const ENGINE_CLIPBOARD_TYPES = [
98
- INTERNAL_CLIPBOARD_TYPE,
99
- CLIPBOARD_TYPES.HTML,
100
- CLIPBOARD_TYPES.PLAIN
101
- ];
102
- const hasEngineClipboardContent = (clipboardData) => {
103
- if (!clipboardData.types || !clipboardData.getData) return false;
104
- const availableTypes = new Set(Array.from(clipboardData.types));
105
- for (const type of ENGINE_CLIPBOARD_TYPES) {
106
- if (!availableTypes.has(type)) continue;
107
- try {
108
- if (clipboardData.getData(type) !== "") return true;
109
- } catch {}
110
- }
111
- return false;
112
- };
113
- /**
114
- * Return image files only when the clipboard has no readable editor content.
115
- * Rich HTML, internal payloads, and plain text must stay on the normal paste
116
- * path; some applications include a rendered image beside that content.
117
- */
118
- function getStandaloneClipboardImageFiles(clipboardData) {
119
- const imageFiles = getClipboardImageFiles(clipboardData);
120
- if (imageFiles.length === 0 || !clipboardData) return imageFiles;
121
- return hasEngineClipboardContent(clipboardData) ? [] : imageFiles;
122
- }
123
28
  /**
124
29
  * Copy runs to clipboard with formatting
125
30
  */
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Custom MIME type for internal clipboard format
3
+ */
4
+ export declare const INTERNAL_CLIPBOARD_TYPE = "application/x-stella-folio";
5
+ /**
6
+ * Standard clipboard MIME types
7
+ */
8
+ export declare const CLIPBOARD_TYPES: {
9
+ readonly HTML: "text/html";
10
+ readonly PLAIN: "text/plain";
11
+ };
12
+ /**
13
+ * Extract image files from clipboard data (if present).
14
+ */
15
+ export type ClipboardDataLike = {
16
+ files?: FileList | readonly File[] | undefined;
17
+ getData?: ((format: string) => string) | undefined;
18
+ items?: DataTransferItemList | readonly DataTransferItem[] | undefined;
19
+ types?: ArrayLike<string> | undefined;
20
+ };
21
+ export declare function getClipboardImageFiles(clipboardData: ClipboardDataLike | null): File[];
22
+ /**
23
+ * Return image files only when the clipboard has no readable editor content.
24
+ * Rich HTML, internal payloads, and plain text must stay on the normal paste
25
+ * path; some applications include a rendered image beside that content.
26
+ */
27
+ export declare function getStandaloneClipboardImageFiles(clipboardData: ClipboardDataLike | null): File[];