@stll/folio-core 0.63.0 → 0.63.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-edits/headless.d.ts +5 -4
- package/dist/ai-edits/headless.js +10 -67
- package/dist/compare/content.d.ts +7 -7
- package/dist/compare/content.js +6 -3
- package/dist/compare/types.d.ts +15 -14
- package/dist/compare/types.js +14 -7
- package/dist/content-controls/errors.d.ts +7 -6
- package/dist/content-controls/errors.js +6 -3
- package/dist/controller/canonicalComments.d.ts +4 -3
- package/dist/controller/canonicalComments.js +2 -1
- package/dist/controller/canonicalInlineProjection.d.ts +3 -3
- package/dist/controller/canonicalInlineProjection.js +2 -1
- package/dist/controller/canonicalListRendering.d.ts +5 -3
- package/dist/controller/canonicalPublicOperations.js +2 -1
- package/dist/controller/canonicalSession.d.ts +5 -5
- package/dist/controller/canonicalSession.js +2 -1
- package/dist/controller/hiddenEditorManager.d.ts +3 -2
- package/dist/controller/hiddenEditorManager.js +2 -1
- package/dist/document-operations.d.ts +5 -4
- package/dist/document-operations.js +4 -2
- package/dist/docx/appVersionNormalization.d.ts +3 -2
- package/dist/docx/appVersionNormalization.js +2 -1
- package/dist/docx/attributeRemainder.d.ts +3 -2
- package/dist/docx/attributeRemainder.js +2 -1
- package/dist/docx/canonicalResourceSave.d.ts +3 -2
- package/dist/docx/canonicalResourceSave.js +2 -1
- package/dist/docx/canonicalSave.d.ts +6 -4
- package/dist/docx/canonicalSave.js +2 -1
- package/dist/docx/canonicalSessionInput.d.ts +4 -3
- package/dist/docx/canonicalSessionInput.js +2 -1
- package/dist/docx/encryption/errors.d.ts +3 -2
- package/dist/docx/encryption/errors.js +2 -1
- package/dist/docx/ensureParaIds.d.ts +3 -2
- package/dist/docx/ensureParaIds.js +2 -1
- package/dist/docx/headerFooterVerbatim.d.ts +2 -2
- package/dist/docx/imageParser.d.ts +1 -1
- package/dist/docx/index.d.ts +1 -0
- package/dist/docx/linkedSdtPreservation.d.ts +5 -3
- package/dist/docx/linkedSdtPreservation.js +2 -1
- package/dist/docx/metadataPrivacy.d.ts +5 -4
- package/dist/docx/metadataPrivacy.js +4 -2
- package/dist/docx/numericIdAllocator.js +2 -1
- package/dist/docx/paragraphPropertySource.d.ts +3 -2
- package/dist/docx/paragraphPropertySource.js +2 -1
- package/dist/docx/parser.d.ts +3 -2
- package/dist/docx/parser.js +2 -1
- package/dist/docx/reviewResolutionProvenance.d.ts +3 -2
- package/dist/docx/reviewResolutionProvenance.js +2 -1
- package/dist/docx/revisionIdNormalization.d.ts +3 -2
- package/dist/docx/revisionIdNormalization.js +2 -1
- package/dist/docx/rezip.d.ts +5 -4
- package/dist/docx/rezip.js +4 -2
- package/dist/docx/sectionReferenceHistory.d.ts +3 -2
- package/dist/docx/sectionReferenceHistory.js +2 -1
- package/dist/docx/serializer/paragraphSerializer.js +6 -3
- package/dist/docx/serializer/partNamespaces.d.ts +3 -2
- package/dist/docx/serializer/partNamespaces.js +2 -1
- package/dist/docx/server/applyDocxXmlPatchProposal.d.ts +5 -4
- package/dist/docx/server/applyDocxXmlPatchProposal.js +4 -2
- package/dist/docx/server/boundedArchive.d.ts +3 -2
- package/dist/docx/server/boundedArchive.js +2 -1
- package/dist/docx/server/build.d.ts +3 -2
- package/dist/docx/server/build.js +2 -1
- package/dist/docx/server/createBilingualDocument.d.ts +3 -2
- package/dist/docx/server/createBilingualDocument.js +4 -2
- package/dist/docx/server/evaluateDocxXmlPatchProposal.d.ts +5 -4
- package/dist/docx/server/evaluateDocxXmlPatchProposal.js +4 -2
- package/dist/docx/server/inspectDocxPackage.d.ts +3 -2
- package/dist/docx/server/inspectDocxPackage.js +2 -1
- package/dist/docx/server/materializeYjsDocx.d.ts +3 -2
- package/dist/docx/server/materializeYjsDocx.js +2 -1
- package/dist/docx/server/migrateYjsAttrSchema.d.ts +3 -3
- package/dist/docx/server/migrateYjsAttrSchema.js +2 -1
- package/dist/docx/tableParser.d.ts +4 -4
- package/dist/docx/verbatimCapture.d.ts +3 -2
- package/dist/docx/verbatimCapture.js +2 -1
- package/dist/docx/xmlResourceLimits.d.ts +3 -2
- package/dist/docx/xmlResourceLimits.js +5 -2
- package/dist/export-pdf.d.ts +3 -3
- package/dist/export-pdf.js +2 -1
- package/dist/fonts/headlessMeasure.d.ts +3 -3
- package/dist/fonts/headlessMeasure.js +2 -1
- package/dist/fonts/sfnt/parse.d.ts +3 -3
- package/dist/fonts/sfnt/parse.js +2 -1
- package/dist/fonts/sfnt/subset.d.ts +3 -3
- package/dist/fonts/sfnt/subset.js +2 -1
- package/dist/fonts/sfnt/tables.d.ts +3 -3
- package/dist/fonts/sfnt/tables.js +2 -1
- package/dist/fonts/sfnt/woff.d.ts +3 -3
- package/dist/fonts/sfnt/woff.js +2 -1
- package/dist/headless-layout.d.ts +3 -3
- package/dist/headless-layout.js +2 -1
- package/dist/layout-engine/measure/font-metrics.worker.js +2 -1
- package/dist/layout-engine/measure/hyphenationDictionaries.d.ts +3 -20
- package/dist/layout-engine/measure/hyphenationDictionaries.js +2 -1
- package/dist/layout-engine/section-breaks.d.ts +1 -1
- package/dist/pdf/fonts.js +2 -1
- package/dist/pdf/images.d.ts +3 -3
- package/dist/pdf/images.js +2 -1
- package/dist/pdf/paint.d.ts +3 -3
- package/dist/pdf/paint.js +2 -1
- package/dist/pdf/writePdf.d.ts +3 -3
- package/dist/pdf/writePdf.js +2 -1
- package/dist/prosemirror/canonicalCommands.d.ts +9 -9
- package/dist/prosemirror/commands/tableMergeFoldDecisions.d.ts +15 -14
- package/dist/prosemirror/commentIdAllocator.d.ts +3 -2
- package/dist/prosemirror/commentIdAllocator.js +2 -1
- package/dist/prosemirror/conversion/fromProseDoc.js +4 -2
- package/dist/prosemirror/extensions/core/DocExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/core/HistoryExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/core/TextExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/features/AutoBidiDetectionExtension.d.ts +2 -2
- package/dist/prosemirror/extensions/features/BidiShortcutExtension.d.ts +0 -10
- package/dist/prosemirror/extensions/features/ContentControlWidgetsExtension.d.ts +0 -10
- package/dist/prosemirror/extensions/features/DropCursorExtension.d.ts +0 -6
- package/dist/prosemirror/extensions/features/EmptyParagraphFormatExtension.d.ts +4 -4
- package/dist/prosemirror/extensions/features/GapCursorExtension.d.ts +0 -13
- package/dist/prosemirror/extensions/features/ImageDragExtension.d.ts +0 -9
- package/dist/prosemirror/extensions/features/ImagePasteExtension.d.ts +0 -6
- package/dist/prosemirror/extensions/features/JoinedRunStyleExtension.d.ts +0 -14
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.d.ts +3 -2
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.js +77 -46
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.d.ts +2 -2
- package/dist/prosemirror/extensions/features/PasteCleanupExtension.d.ts +0 -17
- package/dist/prosemirror/extensions/features/PasteStyleInlinerExtension.d.ts +0 -14
- package/dist/prosemirror/extensions/marks/AllCapsExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/marks/BoldExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/marks/CharacterSpacingExtension.d.ts +0 -8
- package/dist/prosemirror/extensions/marks/CharacterStyleExtension.d.ts +0 -14
- package/dist/prosemirror/extensions/marks/CommentExtension.d.ts +0 -6
- package/dist/prosemirror/extensions/marks/FontFamilyExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/marks/FontSizeExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/marks/FootnoteRefExtension.d.ts +0 -5
- package/dist/prosemirror/extensions/marks/HiddenTextExtension.d.ts +0 -17
- package/dist/prosemirror/extensions/marks/InlineWrapperExtension.d.ts +0 -12
- package/dist/prosemirror/extensions/marks/ItalicExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/marks/SmallCapsExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/marks/StrikeExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/marks/SubscriptExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/marks/SuperscriptExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/marks/TextColorExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/marks/TextEffectsExtensions.d.ts +0 -6
- package/dist/prosemirror/extensions/marks/TrackedChangeExtensions.d.ts +0 -7
- package/dist/prosemirror/extensions/marks/UnderlineExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/marks/markUtils.d.ts +8 -7
- package/dist/prosemirror/extensions/nodes/BlockBookmarkBoundaryExtension.d.ts +0 -22
- package/dist/prosemirror/extensions/nodes/BlockMoveRangeBoundaryExtension.d.ts +0 -14
- package/dist/prosemirror/extensions/nodes/BlockSdtExtension.d.ts +0 -17
- package/dist/prosemirror/extensions/nodes/BookmarkBoundaryExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/FieldExtension.d.ts +0 -8
- package/dist/prosemirror/extensions/nodes/HardBreakExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/nodes/HorizontalRuleExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/nodes/ImageExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/nodes/MathExtension.d.ts +0 -7
- package/dist/prosemirror/extensions/nodes/MoveRangeBoundaryExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/PageBreakExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/nodes/PageBreakRunExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/PreservedBlockExtension.d.ts +0 -25
- package/dist/prosemirror/extensions/nodes/PreservedXmlExtension.d.ts +0 -9
- package/dist/prosemirror/extensions/nodes/RangeAnchorExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/RenderedPageBreakExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/SdtExtension.d.ts +0 -6
- package/dist/prosemirror/extensions/nodes/TabExtension.d.ts +0 -3
- package/dist/prosemirror/extensions/nodes/TextBoxAnchorExtension.d.ts +0 -7
- package/dist/prosemirror/hyperlinkRemoval.d.ts +3 -2
- package/dist/prosemirror/hyperlinkRemoval.js +2 -1
- package/dist/prosemirror/markupViewProjection.d.ts +3 -3
- package/dist/prosemirror/noteReferenceOccurrences.d.ts +6 -5
- package/dist/prosemirror/noteReferenceOccurrences.js +4 -2
- package/dist/prosemirror/numberingAttr.d.ts +5 -5
- package/dist/prosemirror/plugins/aiCitationDecorations.d.ts +4 -4
- package/dist/prosemirror/plugins/aiSuggestionDecorations.d.ts +4 -4
- package/dist/prosemirror/plugins/anonymizationDecorations.d.ts +2 -2
- package/dist/prosemirror/plugins/autocompleteSuggestion.d.ts +2 -2
- package/dist/prosemirror/plugins/contentControlWidgets.d.ts +4 -4
- package/dist/prosemirror/plugins/documentStyleState.d.ts +4 -4
- package/dist/prosemirror/plugins/revisionIds.d.ts +3 -2
- package/dist/prosemirror/plugins/revisionIds.js +2 -1
- package/dist/prosemirror/plugins/selectionTracker.d.ts +2 -2
- package/dist/prosemirror/plugins/suggestionMode.d.ts +2 -2
- package/dist/prosemirror/plugins/templateDirectives.d.ts +5 -5
- package/dist/prosemirror/plugins/templatePreviewValues.d.ts +4 -4
- package/dist/prosemirror/plugins/templateSlashMenu.d.ts +2 -2
- package/dist/prosemirror/preservedXmlReview.d.ts +2 -2
- package/dist/prosemirror/runStyleFormatting.d.ts +7 -7
- package/dist/prosemirror/schema/index.d.ts +2 -1
- package/dist/prosemirror/schema/index.js +0 -7
- package/dist/prosemirror/styles/styleResolver.d.ts +1 -1
- package/dist/prosemirror/textInput.d.ts +3 -2
- package/dist/prosemirror/yjsDocumentMetadata.d.ts +8 -8
- package/dist/prosemirror/yjsDocumentMetadata.js +6 -3
- package/dist/redline.d.ts +5 -4
- package/dist/redline.js +4 -2
- package/dist/redlineOperationLimit.d.ts +3 -2
- package/dist/redlineOperationLimit.js +2 -1
- package/dist/render-dom/commentAnchorAttributes.d.ts +1 -1
- package/dist/shaping/shaper.d.ts +3 -21
- package/dist/shaping/shaper.js +2 -1
- package/dist/utils/clipboard.d.ts +2 -2
- package/dist/utils/clipboard.js +2 -2
- package/dist/utils/formatToStyle.d.ts +1 -1
- package/dist/utils/units.d.ts +1 -1
- package/dist/version-comparison.d.ts +3 -2
- package/dist/version-comparison.js +2 -1
- package/package.json +3 -3
package/dist/fonts/sfnt/woff.js
CHANGED
|
@@ -12,7 +12,8 @@ import { inflateSync } from "node:zlib";
|
|
|
12
12
|
* `glyf`/`loca` transform has to be reversed and Brotli decoded), so it is
|
|
13
13
|
* rejected here rather than half-supported.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
const WoffDecodeErrorBase = TaggedError("WoffDecodeError");
|
|
16
|
+
var WoffDecodeError = class extends WoffDecodeErrorBase {};
|
|
16
17
|
const fail = (message) => Result.err(new WoffDecodeError({ message }));
|
|
17
18
|
/** Byte offsets inside the WOFF header. */
|
|
18
19
|
const WOFF_HEADER = {
|
|
@@ -6,7 +6,7 @@ import { BlockLookup } from "./layout-painter/index.js";
|
|
|
6
6
|
import { PageFurnitureInputs } from "./display-list/build/furniture.js";
|
|
7
7
|
import { DocumentFeatures } from "./display-list/build/buildDisplayList.js";
|
|
8
8
|
import { Node } from "prosemirror-model";
|
|
9
|
-
import { Result } from "better-result";
|
|
9
|
+
import { Result, TaggedErrorClass } from "better-result";
|
|
10
10
|
//#region src/headless-layout.d.ts
|
|
11
11
|
/**
|
|
12
12
|
* Constructs the painter takes from render options rather than from `Layout`.
|
|
@@ -26,8 +26,8 @@ export type HeadlessLayoutGap = {
|
|
|
26
26
|
readonly story: never;
|
|
27
27
|
readonly detail: string;
|
|
28
28
|
};
|
|
29
|
-
declare const
|
|
30
|
-
export declare class HeadlessLayoutError extends
|
|
29
|
+
declare const HeadlessLayoutErrorBase: TaggedErrorClass<"HeadlessLayoutError">;
|
|
30
|
+
export declare class HeadlessLayoutError extends HeadlessLayoutErrorBase<{
|
|
31
31
|
message: string;
|
|
32
32
|
cause?: unknown;
|
|
33
33
|
}> {}
|
package/dist/headless-layout.js
CHANGED
|
@@ -64,7 +64,8 @@ const formatEndnoteTexts = (numbers, formatNumber) => {
|
|
|
64
64
|
for (const [id, displayNumber] of numbers) texts.set(id, formatNumber(displayNumber));
|
|
65
65
|
return texts;
|
|
66
66
|
};
|
|
67
|
-
|
|
67
|
+
const HeadlessLayoutErrorBase = TaggedError("HeadlessLayoutError");
|
|
68
|
+
var HeadlessLayoutError = class extends HeadlessLayoutErrorBase {};
|
|
68
69
|
/**
|
|
69
70
|
* Stories this entry still does not lay out, keyed by story so the map is total
|
|
70
71
|
* over the union. `satisfies Record<…>` is what makes it total in both
|
|
@@ -17,7 +17,8 @@ import { TaggedError } from "better-result";
|
|
|
17
17
|
* that touches `document`, `window`, or React. The protocol module is
|
|
18
18
|
* deliberately dependency-free.
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
const WorkerInitErrorBase = TaggedError("WorkerInitError");
|
|
21
|
+
var WorkerInitError = class extends WorkerInitErrorBase {};
|
|
21
22
|
let ctx = null;
|
|
22
23
|
let initError = null;
|
|
23
24
|
const FONT_FINGERPRINT_EPSILON = .01;
|
|
@@ -1,28 +1,11 @@
|
|
|
1
|
+
import { TaggedErrorClass } from "better-result";
|
|
1
2
|
//#region src/layout-engine/measure/hyphenationDictionaries.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* On-demand hyphenation dictionaries for automatic hyphenation.
|
|
4
|
-
*
|
|
5
|
-
* Each `hyphen` pattern set is tens to hundreds of kilobytes of source whose
|
|
6
|
-
* evaluation builds a pattern trie, and most documents never enable
|
|
7
|
-
* `w:autoHyphenation`. A dictionary is therefore imported only once measurement
|
|
8
|
-
* asks to hyphenate a word in its language. Measurement is synchronous, so the
|
|
9
|
-
* first request starts the import and hyphenates nothing. A layout run wrapped
|
|
10
|
-
* in {@link collectRequestedHyphenationDictionaries} learns which dictionaries
|
|
11
|
-
* it lacked, so its own editor can re-run layout on load or report the failure
|
|
12
|
-
* (`controller/hyphenationReadiness`). Hosts that must lay out correctly on the
|
|
13
|
-
* first pass (headless layout, tests) await `preloadHyphenationDictionaries`
|
|
14
|
-
* (`./hyphenationPreload`) before measuring.
|
|
15
|
-
*
|
|
16
|
-
* This module sits on every editor's import graph, so it speaks in its own
|
|
17
|
-
* settled-state union rather than `Result`, keeping the `Result` API out of
|
|
18
|
-
* adapters' type checks; the preload boundary converts.
|
|
19
|
-
*/
|
|
20
3
|
export type HyphenateWord = (text: string) => string;
|
|
21
4
|
declare const HYPHENATION_DICTIONARY_IDS: readonly ["cs", "en-gb", "en-us", "sk"];
|
|
22
5
|
export type HyphenationDictionaryId = (typeof HYPHENATION_DICTIONARY_IDS)[number];
|
|
23
6
|
export type HyphenationDictionaryLoaders = Readonly<Record<HyphenationDictionaryId, () => Promise<HyphenateWord>>>;
|
|
24
|
-
declare const
|
|
25
|
-
export declare class HyphenationDictionaryError extends
|
|
7
|
+
declare const HyphenationDictionaryErrorBase: TaggedErrorClass<"HyphenationDictionaryError">;
|
|
8
|
+
export declare class HyphenationDictionaryError extends HyphenationDictionaryErrorBase<{
|
|
26
9
|
message: string;
|
|
27
10
|
dictionary: HyphenationDictionaryId;
|
|
28
11
|
cause: unknown;
|
|
@@ -32,7 +32,8 @@ const HYPHENATION_DICTIONARY_LOADERS = {
|
|
|
32
32
|
sk: async () => (await import("hyphen/sk")).default.hyphenateSync
|
|
33
33
|
};
|
|
34
34
|
let dictionaryLoaders = HYPHENATION_DICTIONARY_LOADERS;
|
|
35
|
-
|
|
35
|
+
const HyphenationDictionaryErrorBase = TaggedError("HyphenationDictionaryError");
|
|
36
|
+
var HyphenationDictionaryError = class extends HyphenationDictionaryErrorBase {};
|
|
36
37
|
const createInitialStates = () => ({
|
|
37
38
|
cs: { status: "unloaded" },
|
|
38
39
|
"en-gb": { status: "unloaded" },
|
|
@@ -55,7 +55,7 @@ export type BreakDecision = {
|
|
|
55
55
|
requiredParity?: "even" | "odd";
|
|
56
56
|
};
|
|
57
57
|
/** `w:sectPr` may omit `w:type`; §17.6.22's omitted value is `nextPage`. */
|
|
58
|
-
export declare const DEFAULT_SECTION_BREAK_TYPE
|
|
58
|
+
export declare const DEFAULT_SECTION_BREAK_TYPE: "nextPage";
|
|
59
59
|
/**
|
|
60
60
|
* The section start a boundary states, with the omitted value resolved.
|
|
61
61
|
*
|
package/dist/pdf/fonts.js
CHANGED
|
@@ -6,7 +6,8 @@ import { bytesToHex, decodeText, encodeUtf16BE, encodeUtf8 } from "../utils/text
|
|
|
6
6
|
import { pdfArray, pdfAsciiString, pdfDict, pdfFlateStream, pdfName, pdfNumber, pdfNumberArray } from "./objects.js";
|
|
7
7
|
import { Result, TaggedError, panic } from "better-result";
|
|
8
8
|
//#region src/pdf/fonts.ts
|
|
9
|
-
|
|
9
|
+
const PdfFontErrorBase = TaggedError("PdfFontError");
|
|
10
|
+
var PdfFontError = class extends PdfFontErrorBase {};
|
|
10
11
|
/** Text space is 1000 units to the em whatever the font's own head is. */
|
|
11
12
|
const TEXT_SPACE_UNITS_PER_EM = 1e3;
|
|
12
13
|
/** `fsType` bit 1: the vendor forbids embedding this face outright. */
|
package/dist/pdf/images.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DisplayImageSource } from "../display-list/types.js";
|
|
2
2
|
import { PdfValue } from "./objects.js";
|
|
3
|
-
import { Result } from "better-result";
|
|
3
|
+
import { Result, TaggedErrorClass } from "better-result";
|
|
4
4
|
//#region src/pdf/images.d.ts
|
|
5
|
-
declare const
|
|
6
|
-
export declare class PdfImageError extends
|
|
5
|
+
declare const PdfImageErrorBase: TaggedErrorClass<"PdfImageError">;
|
|
6
|
+
export declare class PdfImageError extends PdfImageErrorBase<{
|
|
7
7
|
message: string;
|
|
8
8
|
}> {}
|
|
9
9
|
/** A soft mask: one alpha sample per pixel, matching the image's dimensions. */
|
package/dist/pdf/images.js
CHANGED
|
@@ -18,7 +18,8 @@ import { inflateSync } from "node:zlib";
|
|
|
18
18
|
* refusing the page. Adam7 interlacing is not such a form — it is seven
|
|
19
19
|
* ordinary rasters of the same samples — so it is decoded rather than refused.
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
const PdfImageErrorBase = TaggedError("PdfImageError");
|
|
22
|
+
var PdfImageError = class extends PdfImageErrorBase {};
|
|
22
23
|
const PNG_SIGNATURE = [
|
|
23
24
|
137,
|
|
24
25
|
80,
|
package/dist/pdf/paint.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DisplayPage } from "../display-list/types.js";
|
|
2
2
|
import { PreparedFont, ShapedRunRequest } from "./fonts.js";
|
|
3
3
|
import { ContentPart } from "./contentStream.js";
|
|
4
|
-
import { Result } from "better-result";
|
|
4
|
+
import { Result, TaggedErrorClass } from "better-result";
|
|
5
5
|
//#region src/pdf/paint.d.ts
|
|
6
|
-
declare const
|
|
7
|
-
export declare class PaintError extends
|
|
6
|
+
declare const PaintErrorBase: TaggedErrorClass<"PaintError">;
|
|
7
|
+
export declare class PaintError extends PaintErrorBase<{
|
|
8
8
|
message: string;
|
|
9
9
|
}> {}
|
|
10
10
|
export type PaintPageOptions = {
|
package/dist/pdf/paint.js
CHANGED
|
@@ -12,7 +12,8 @@ import { Result, TaggedError, panic } from "better-result";
|
|
|
12
12
|
* converts once, at the stream's first operator, which is why no primitive
|
|
13
13
|
* below does any arithmetic on the page height.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
const PaintErrorBase = TaggedError("PaintError");
|
|
16
|
+
var PaintError = class extends PaintErrorBase {};
|
|
16
17
|
/** Thousandths of an em, the unit of a `TJ` adjustment. */
|
|
17
18
|
const TEXT_SPACE_UNITS_PER_EM = 1e3;
|
|
18
19
|
const OPAQUE = 1;
|
package/dist/pdf/writePdf.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DisplayList } from "../display-list/types.js";
|
|
2
2
|
import { PdfFontSource, PdfSubstitution } from "./fonts.js";
|
|
3
|
-
import { Result } from "better-result";
|
|
3
|
+
import { Result, TaggedErrorClass } from "better-result";
|
|
4
4
|
//#region src/pdf/writePdf.d.ts
|
|
5
5
|
export type WritePdfOptions = {
|
|
6
6
|
readonly fonts: PdfFontSource;
|
|
@@ -38,8 +38,8 @@ export type WritePdfResult = {
|
|
|
38
38
|
/** Code points painted as `.notdef` because no supplied face covers them. */
|
|
39
39
|
readonly unencodable: readonly PdfUnencodable[];
|
|
40
40
|
};
|
|
41
|
-
declare const
|
|
42
|
-
export declare class WritePdfError extends
|
|
41
|
+
declare const WritePdfErrorBase: TaggedErrorClass<"WritePdfError">;
|
|
42
|
+
export declare class WritePdfError extends WritePdfErrorBase<{
|
|
43
43
|
message: string;
|
|
44
44
|
cause?: unknown;
|
|
45
45
|
}> {}
|
package/dist/pdf/writePdf.js
CHANGED
|
@@ -20,7 +20,8 @@ import { createHash } from "node:crypto";
|
|
|
20
20
|
* deflate level) exists to keep it true. Nothing here reads a clock or a
|
|
21
21
|
* random source.
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
const WritePdfErrorBase = TaggedError("WritePdfError");
|
|
24
|
+
var WritePdfError = class extends WritePdfErrorBase {};
|
|
24
25
|
const DEFAULT_PRODUCER = "folio";
|
|
25
26
|
/** How many code points the strict-coverage refusal names before counting. */
|
|
26
27
|
const UNENCODABLE_SAMPLE = 5;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { document_d_exports } from "../types/document.js";
|
|
2
2
|
import { Node } from "prosemirror-model";
|
|
3
3
|
import { Command, EditorState } from "prosemirror-state";
|
|
4
|
-
import { ParagraphPropsPatch, RunPropsPatch } from "@stll/docx-core/ops";
|
|
4
|
+
import { FormattingPatch, ParagraphPropsPatch, RunPropsPatch } from "@stll/docx-core/ops";
|
|
5
5
|
//#region src/prosemirror/canonicalCommands.d.ts
|
|
6
6
|
/** Command meaning before canonical positions are resolved by the session. */
|
|
7
7
|
export type CanonicalCommandIntent = {
|
|
@@ -78,14 +78,14 @@ export declare const canonicalRunFormatting: (state: EditorState, patch: RunProp
|
|
|
78
78
|
type: "formatRun";
|
|
79
79
|
from: number;
|
|
80
80
|
to: number;
|
|
81
|
-
patch:
|
|
81
|
+
patch: FormattingPatch<{
|
|
82
82
|
bold?: boolean | undefined;
|
|
83
83
|
boldCs?: boolean | undefined;
|
|
84
84
|
italic?: boolean | undefined;
|
|
85
85
|
italicCs?: boolean | undefined;
|
|
86
86
|
underline?: {
|
|
87
|
-
style:
|
|
88
|
-
color?:
|
|
87
|
+
style: document_d_exports.UnderlineStyle;
|
|
88
|
+
color?: document_d_exports.ColorValue;
|
|
89
89
|
} | undefined;
|
|
90
90
|
strike?: boolean | undefined;
|
|
91
91
|
doubleStrike?: boolean | undefined;
|
|
@@ -94,9 +94,9 @@ export declare const canonicalRunFormatting: (state: EditorState, patch: RunProp
|
|
|
94
94
|
allCaps?: boolean | undefined;
|
|
95
95
|
hidden?: boolean | undefined;
|
|
96
96
|
noProof?: boolean | undefined;
|
|
97
|
-
color?:
|
|
97
|
+
color?: document_d_exports.ColorValue | undefined;
|
|
98
98
|
highlight?: "black" | "blue" | "cyan" | "darkBlue" | "darkCyan" | "darkGray" | "darkGreen" | "darkMagenta" | "darkRed" | "darkYellow" | "green" | "lightGray" | "magenta" | "none" | "red" | "white" | "yellow" | undefined;
|
|
99
|
-
shading?:
|
|
99
|
+
shading?: document_d_exports.ShadingProperties | undefined;
|
|
100
100
|
fontSize?: number | undefined;
|
|
101
101
|
fontSizeCs?: number | undefined;
|
|
102
102
|
fontFamily?: {
|
|
@@ -119,8 +119,8 @@ export declare const canonicalRunFormatting: (state: EditorState, patch: RunProp
|
|
|
119
119
|
position?: number | undefined;
|
|
120
120
|
scale?: number | undefined;
|
|
121
121
|
kerning?: number | undefined;
|
|
122
|
-
effect?:
|
|
123
|
-
emphasisMark?:
|
|
122
|
+
effect?: document_d_exports.TextEffect | undefined;
|
|
123
|
+
emphasisMark?: document_d_exports.EmphasisMark | undefined;
|
|
124
124
|
emboss?: boolean | undefined;
|
|
125
125
|
imprint?: boolean | undefined;
|
|
126
126
|
outline?: boolean | undefined;
|
|
@@ -128,7 +128,7 @@ export declare const canonicalRunFormatting: (state: EditorState, patch: RunProp
|
|
|
128
128
|
rtl?: boolean | undefined;
|
|
129
129
|
cs?: boolean | undefined;
|
|
130
130
|
styleId?: string | undefined;
|
|
131
|
-
preserved?:
|
|
131
|
+
preserved?: document_d_exports.PreservedMarkup | undefined;
|
|
132
132
|
}>;
|
|
133
133
|
}[];
|
|
134
134
|
export declare const withCanonicalParagraphFormatting: (command: Command, patch: ParagraphPropsPatch | ((paragraph: Node) => ParagraphPropsPatch)) => Command;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Node } from "prosemirror-model";
|
|
2
|
+
import { CellMargins, ConditionalFormatStyle, PreservedMarkup, ShadingProperties, TableCellBorders, TableMeasurement, TextDirection } from "@stll/docx-core/model";
|
|
2
3
|
//#region src/prosemirror/commands/tableMergeFoldDecisions.d.ts
|
|
3
4
|
type TableMergeFoldDecisionsOptions = {
|
|
4
5
|
table: Node;
|
|
@@ -15,18 +16,18 @@ export declare const tableMergeFoldDecisions: ({ table, mode, revisionSet }: Tab
|
|
|
15
16
|
export declare const resolvedTableMergeOriginAttrs: (cell: Node) => {
|
|
16
17
|
_originalFormatting: {
|
|
17
18
|
vMerge: string;
|
|
18
|
-
width?:
|
|
19
|
-
borders?:
|
|
20
|
-
margins?:
|
|
21
|
-
shading?:
|
|
19
|
+
width?: TableMeasurement;
|
|
20
|
+
borders?: TableCellBorders;
|
|
21
|
+
margins?: CellMargins;
|
|
22
|
+
shading?: ShadingProperties;
|
|
22
23
|
verticalAlign?: "top" | "center" | "bottom";
|
|
23
|
-
textDirection?:
|
|
24
|
+
textDirection?: TextDirection;
|
|
24
25
|
gridSpan?: number;
|
|
25
26
|
fitText?: boolean;
|
|
26
27
|
noWrap?: boolean;
|
|
27
28
|
hideMark?: boolean;
|
|
28
|
-
conditionalFormat?:
|
|
29
|
-
preserved?:
|
|
29
|
+
conditionalFormat?: ConditionalFormatStyle;
|
|
30
|
+
preserved?: PreservedMarkup;
|
|
30
31
|
sourceXml?: string;
|
|
31
32
|
};
|
|
32
33
|
_preserveVMergeRestart: boolean;
|
|
@@ -40,19 +41,19 @@ type ResolvedVisibleTableCellMergeOptions = {
|
|
|
40
41
|
export declare const resolvedVisibleTableCellMergeAttrs: ({ cell, mode, origin }: ResolvedVisibleTableCellMergeOptions) => {
|
|
41
42
|
cellMarker: null;
|
|
42
43
|
_originalFormatting: {
|
|
43
|
-
width?:
|
|
44
|
-
borders?:
|
|
45
|
-
margins?:
|
|
46
|
-
shading?:
|
|
44
|
+
width?: TableMeasurement;
|
|
45
|
+
borders?: TableCellBorders;
|
|
46
|
+
margins?: CellMargins;
|
|
47
|
+
shading?: ShadingProperties;
|
|
47
48
|
verticalAlign?: "top" | "center" | "bottom";
|
|
48
|
-
textDirection?:
|
|
49
|
+
textDirection?: TextDirection;
|
|
49
50
|
gridSpan?: number;
|
|
50
51
|
vMerge?: "restart" | "continue";
|
|
51
52
|
fitText?: boolean;
|
|
52
53
|
noWrap?: boolean;
|
|
53
54
|
hideMark?: boolean;
|
|
54
|
-
conditionalFormat?:
|
|
55
|
-
preserved?:
|
|
55
|
+
conditionalFormat?: ConditionalFormatStyle;
|
|
56
|
+
preserved?: PreservedMarkup;
|
|
56
57
|
sourceXml?: string;
|
|
57
58
|
};
|
|
58
59
|
_preserveVMergeRestart: boolean;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Comment } from "../types/content.js";
|
|
2
|
+
import { TaggedErrorClass } from "better-result";
|
|
2
3
|
import { EditorView } from "prosemirror-view";
|
|
3
4
|
//#region src/prosemirror/commentIdAllocator.d.ts
|
|
4
5
|
/** Sentinel ID for a comment that hasn't been persisted yet (anchored to selection). */
|
|
5
6
|
export declare const PENDING_COMMENT_ID = -1;
|
|
6
|
-
declare const
|
|
7
|
-
export declare class CommentIdSpaceExhaustedError extends
|
|
7
|
+
declare const CommentIdSpaceExhaustedErrorBase: TaggedErrorClass<"CommentIdSpaceExhaustedError">;
|
|
8
|
+
export declare class CommentIdSpaceExhaustedError extends CommentIdSpaceExhaustedErrorBase<{
|
|
8
9
|
message: string;
|
|
9
10
|
}> {}
|
|
10
11
|
/** Allocate a valid, unused comment ID in this realm. */
|
|
@@ -10,7 +10,8 @@ import { MAX_REVISION_ID } from "@stll/docx-core/model";
|
|
|
10
10
|
*/
|
|
11
11
|
/** Sentinel ID for a comment that hasn't been persisted yet (anchored to selection). */
|
|
12
12
|
const PENDING_COMMENT_ID = -1;
|
|
13
|
-
|
|
13
|
+
const CommentIdSpaceExhaustedErrorBase = TaggedError("CommentIdSpaceExhaustedError");
|
|
14
|
+
var CommentIdSpaceExhaustedError = class extends CommentIdSpaceExhaustedErrorBase {};
|
|
14
15
|
let nextId = 1;
|
|
15
16
|
const reservedIds = /* @__PURE__ */ new Set();
|
|
16
17
|
/** Allocate a valid, unused comment ID in this realm. */
|
|
@@ -280,7 +280,8 @@ const restoreLinkedParagraphPropertySources = (content) => {
|
|
|
280
280
|
sources: new Set(targetsBySource.keys())
|
|
281
281
|
};
|
|
282
282
|
};
|
|
283
|
-
|
|
283
|
+
const SaveStylesheetSourceMismatchBase = TaggedError("SaveStylesheetSourceMismatch");
|
|
284
|
+
var SaveStylesheetSourceMismatch = class extends SaveStylesheetSourceMismatchBase {};
|
|
284
285
|
const parsedPackageStyles = (document, liveStyles) => {
|
|
285
286
|
const source = getDocumentSourceStyles(document, liveStyles);
|
|
286
287
|
switch (source.type) {
|
|
@@ -358,7 +359,8 @@ const saveStylesheet = (source, baseDocument) => {
|
|
|
358
359
|
default: return panic(`Unexpected stylesheet source: ${JSON.stringify(source)}`);
|
|
359
360
|
}
|
|
360
361
|
};
|
|
361
|
-
|
|
362
|
+
const MissingSaveStylesheetBase = TaggedError("MissingSaveStylesheet");
|
|
363
|
+
var MissingSaveStylesheet = class extends MissingSaveStylesheetBase {};
|
|
362
364
|
const assertSaveStylesheetAvailable = ({ pmDoc, styles, baseDocument, stylesheetSource }) => {
|
|
363
365
|
if (styles !== void 0) return;
|
|
364
366
|
if (stylesheetSource.type === "package" && baseDocument !== void 0) return;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { NodeExtension } from "../types.js";
|
|
2
2
|
//#region src/prosemirror/extensions/core/DocExtension.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Doc Extension — top-level document node
|
|
5
|
-
*/
|
|
6
3
|
export declare const DocExtension: (options?: Partial<Record<string, unknown>> | undefined) => NodeExtension;
|
|
7
4
|
//#endregion
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { Extension } from "../types.js";
|
|
2
2
|
//#region src/prosemirror/extensions/core/HistoryExtension.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* History Extension — undo/redo via prosemirror-history
|
|
5
|
-
*/
|
|
6
3
|
/**
|
|
7
4
|
* Who answers the undo and redo keys (Mod-z, Mod-y, Mod-Shift-z).
|
|
8
5
|
* - `"editor"`: the extension binds them. Default.
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { NodeExtension } from "../types.js";
|
|
2
2
|
//#region src/prosemirror/extensions/core/TextExtension.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Text Extension — inline text node
|
|
5
|
-
*/
|
|
6
3
|
export declare const TextExtension: (options?: Partial<Record<string, unknown>> | undefined) => NodeExtension;
|
|
7
4
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Extension } from "../types.js";
|
|
2
|
-
import { EditorState, Plugin } from "prosemirror-state";
|
|
2
|
+
import { EditorState, Plugin, PluginKey } from "prosemirror-state";
|
|
3
3
|
//#region src/prosemirror/extensions/features/AutoBidiDetectionExtension.d.ts
|
|
4
4
|
export declare const autoBidiDetectionKey: Readonly<{
|
|
5
5
|
key: string;
|
|
6
|
-
createKey: () =>
|
|
6
|
+
createKey: () => PluginKey<unknown>;
|
|
7
7
|
owns: (plugin: Plugin<unknown>) => boolean;
|
|
8
8
|
get: (state: EditorState) => Plugin<unknown> | undefined;
|
|
9
9
|
getState: (state: EditorState) => unknown;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import { Extension } from "../types.js";
|
|
2
2
|
//#region src/prosemirror/extensions/features/BidiShortcutExtension.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Bidi Shortcut Extension — Ctrl/Cmd+Left Shift → LTR, Ctrl/Cmd+Right Shift → RTL
|
|
5
|
-
*
|
|
6
|
-
* Uses KeyboardEvent.code to distinguish ShiftLeft vs ShiftRight, matching the
|
|
7
|
-
* standard Google Docs shortcut behavior. The keydown/keyup state machine lives
|
|
8
|
-
* in {@link createBidiShortcutController}; this module only wires it to the
|
|
9
|
-
* editor view and dispatches the schema command on keyup.
|
|
10
|
-
*
|
|
11
|
-
* Priority: High (50) — should intercept before other keymaps
|
|
12
|
-
*/
|
|
13
3
|
export declare const BidiShortcutExtension: (options?: Partial<Record<string, unknown>> | undefined) => Extension;
|
|
14
4
|
//#endregion
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import { Extension } from "../types.js";
|
|
2
2
|
//#region src/prosemirror/extensions/features/ContentControlWidgetsExtension.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Content-Control Widgets Extension — wires the interactive widget plugin
|
|
5
|
-
* into the editor so clicking inside a typed content control invokes the
|
|
6
|
-
* appropriate transaction.
|
|
7
|
-
*
|
|
8
|
-
* The plugin owns checkbox toggling outright; dropdown / date picker chrome
|
|
9
|
-
* is delegated to the editor shell via the `onWidgetEvent` callback (the
|
|
10
|
-
* shell renders the menu / picker and dispatches via `dispatchDropdownPick`
|
|
11
|
-
* / `dispatchDatePick`).
|
|
12
|
-
*/
|
|
13
3
|
export declare const ContentControlWidgetsExtension: (options?: Partial<Record<string, unknown>> | undefined) => Extension;
|
|
14
4
|
//#endregion
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { Extension } from "../types.js";
|
|
2
2
|
//#region src/prosemirror/extensions/features/DropCursorExtension.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Drop Cursor Extension — shows a visual indicator when dragging content
|
|
5
|
-
*
|
|
6
|
-
* Uses prosemirror-dropcursor to display a cursor line at the drop position
|
|
7
|
-
* when dragging images or other content within the editor.
|
|
8
|
-
*/
|
|
9
3
|
export declare const DropCursorExtension: (options?: Partial<Record<string, unknown>> | undefined) => Extension;
|
|
10
4
|
//#endregion
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Extension } from "../types.js";
|
|
2
|
-
import { Plugin } from "prosemirror-state";
|
|
2
|
+
import { EditorState, Plugin, PluginKey } from "prosemirror-state";
|
|
3
3
|
//#region src/prosemirror/extensions/features/EmptyParagraphFormatExtension.d.ts
|
|
4
4
|
export declare const emptyParagraphFormatKey: Readonly<{
|
|
5
5
|
key: string;
|
|
6
|
-
createKey: () =>
|
|
6
|
+
createKey: () => PluginKey<unknown>;
|
|
7
7
|
owns: (plugin: Plugin<unknown>) => boolean;
|
|
8
|
-
get: (state:
|
|
9
|
-
getState: (state:
|
|
8
|
+
get: (state: EditorState) => Plugin<unknown> | undefined;
|
|
9
|
+
getState: (state: EditorState) => unknown;
|
|
10
10
|
}>;
|
|
11
11
|
export declare const EmptyParagraphFormatExtension: (options?: Partial<Record<string, unknown>> | undefined) => Extension;
|
|
12
12
|
//#endregion
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
import { Extension } from "../types.js";
|
|
2
2
|
//#region src/prosemirror/extensions/features/GapCursorExtension.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* GapCursor Extension — provides a caret slot before / between / after
|
|
5
|
-
* isolating block nodes (notably `blockSdt`).
|
|
6
|
-
*
|
|
7
|
-
* Without gapcursor, a user cannot place the caret before a doc-starting
|
|
8
|
-
* SDT, between two adjacent SDTs, or after a doc-final SDT — the
|
|
9
|
-
* `isolating` boundary makes regular text selections refuse those
|
|
10
|
-
* positions. The prosemirror-gapcursor plugin paints a thin "gap" caret
|
|
11
|
-
* at those slots so the document stays fully navigable.
|
|
12
|
-
*
|
|
13
|
-
* The plugin also exposes `Backspace` / `Delete` handlers that join the
|
|
14
|
-
* gap into the neighbour when sensible.
|
|
15
|
-
*/
|
|
16
3
|
export declare const GapCursorExtension: (options?: Partial<Record<string, unknown>> | undefined) => Extension;
|
|
17
4
|
//#endregion
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import { Extension } from "../types.js";
|
|
2
2
|
//#region src/prosemirror/extensions/features/ImageDragExtension.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Image Drag Extension — handles drag-to-reposition for images
|
|
5
|
-
*
|
|
6
|
-
* Provides:
|
|
7
|
-
* - Ghost outline visual during drag
|
|
8
|
-
* - Drop indicator showing where image will land
|
|
9
|
-
* - Inline images: reorder within text flow via ProseMirror's default drag
|
|
10
|
-
* - Custom drag initiation from mousedown on selected images
|
|
11
|
-
*/
|
|
12
3
|
export declare const ImageDragExtension: (options?: Partial<Record<string, unknown>> | undefined) => Extension;
|
|
13
4
|
//#endregion
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { Extension } from "../types.js";
|
|
2
2
|
//#region src/prosemirror/extensions/features/ImagePasteExtension.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Image Paste Extension — handles image files pasted from the clipboard
|
|
5
|
-
*
|
|
6
|
-
* When an image file is present on the clipboard, this intercepts the paste,
|
|
7
|
-
* reads the image data, and inserts an image node instead of a file icon.
|
|
8
|
-
*/
|
|
9
3
|
export declare const ImagePasteExtension: (options?: Partial<Record<string, unknown>> | undefined) => Extension;
|
|
10
4
|
//#endregion
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import { Extension } from "../types.js";
|
|
2
2
|
//#region src/prosemirror/extensions/features/JoinedRunStyleExtension.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Runs that a join moves into another paragraph take that paragraph's style.
|
|
5
|
-
*
|
|
6
|
-
* Deleting across a paragraph break (Backspace or Delete at the break, a
|
|
7
|
-
* deletion or typing over a selection that spans paragraphs) runs the later
|
|
8
|
-
* paragraph's remaining text on into the earlier one. A run's direct
|
|
9
|
-
* formatting is its own and stays; what the later paragraph's style lent it
|
|
10
|
-
* does not travel, and it reads in the style of the paragraph it now belongs
|
|
11
|
-
* to. The document styles plugin re-reads those runs after an ordinary edit.
|
|
12
|
-
*
|
|
13
|
-
* A transaction that re-reads the runs it moves itself (resolving a tracked
|
|
14
|
-
* change, an operation that merges paragraphs) says so with
|
|
15
|
-
* {@link JOINED_RUNS_RESTYLED_META}, and is left as it is.
|
|
16
|
-
*/
|
|
17
3
|
export declare const JOINED_RUNS_RESTYLED_META = "joinedRunsRestyled";
|
|
18
4
|
export declare const JoinedRunStyleExtension: (options?: Partial<{}> | undefined) => Extension;
|
|
19
5
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Extension } from "../types.js";
|
|
2
2
|
import { Node } from "prosemirror-model";
|
|
3
|
-
import { EditorState, Plugin, Transaction } from "prosemirror-state";
|
|
3
|
+
import { EditorState, Plugin, PluginKey, Transaction } from "prosemirror-state";
|
|
4
4
|
//#region src/prosemirror/extensions/features/ParaIdAllocatorExtension.d.ts
|
|
5
5
|
type ParagraphPropertySourceSeed = {
|
|
6
6
|
contract: string | null;
|
|
@@ -8,7 +8,7 @@ type ParagraphPropertySourceSeed = {
|
|
|
8
8
|
};
|
|
9
9
|
export declare const paraIdAllocatorKey: Readonly<{
|
|
10
10
|
key: string;
|
|
11
|
-
createKey: () =>
|
|
11
|
+
createKey: () => PluginKey<ParagraphPropertySourceSeed>;
|
|
12
12
|
owns: (plugin: Plugin<ParagraphPropertySourceSeed>) => boolean;
|
|
13
13
|
get: (state: EditorState) => Plugin<ParagraphPropertySourceSeed> | undefined;
|
|
14
14
|
getState: (state: EditorState) => ParagraphPropertySourceSeed | undefined;
|
|
@@ -51,6 +51,7 @@ export declare const mapParagraphKeepers: (oldDoc: Node, transactions: readonly
|
|
|
51
51
|
* below so history, mappings, and duplicate ownership retain their semantics.
|
|
52
52
|
*/
|
|
53
53
|
export declare const ensureParaIdsInDoc: (doc: Node) => Node;
|
|
54
|
+
/** {@link ensureParaIdsInDoc} for a state that already exists. */
|
|
54
55
|
export declare const ensureParaIdsInState: (state: EditorState) => EditorState;
|
|
55
56
|
export declare const ParaIdAllocatorExtension: (options?: Partial<{}> | undefined) => Extension;
|
|
56
57
|
//#endregion
|