@stll/folio-core 0.73.0 → 0.74.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.
- package/dist/ai-edits/headless.js +2 -5
- package/dist/ai-edits/pendingJoin.js +6 -1
- package/dist/ai-edits/result-validation.js +1 -1
- package/dist/ai-edits/snapshot.js +1 -1
- package/dist/ai-edits/table-cell-mutations.js +1 -1
- package/dist/ai-edits/tracked-batch-fidelity.js +1 -1
- package/dist/canonical/canonicalInlineGaps.d.ts +56 -0
- package/dist/canonical/canonicalInlineGaps.js +118 -0
- package/dist/canonical/canonicalInlineProjection.d.ts +4 -13
- package/dist/canonical/canonicalInlineProjection.js +6 -28
- package/dist/canonical/canonicalProjectionBlocks.d.ts +4 -4
- package/dist/canonical/canonicalPublicOperations.js +70 -27
- package/dist/canonical/canonicalSelection.js +1 -1
- package/dist/canonical/canonicalSession.js +14 -21
- package/dist/controller/autocompleteSuggestion.js +1 -1
- package/dist/controller/canonicalClipboard.js +2 -2
- package/dist/controller/canonicalComposition.js +1 -1
- package/dist/controller/canonicalInput.js +1 -1
- package/dist/controller/canonicalPresence.js +1 -1
- package/dist/controller/canonicalRoomAuthority.js +1 -1
- package/dist/controller/canonicalRoomWire.js +1 -1
- package/dist/controller/canonicalStructure.js +1 -1
- package/dist/controller/canonicalTabRoom.js +1 -1
- package/dist/controller/canonicalYjsRoom.js +1 -1
- package/dist/controller/hiddenEditorApi.js +2 -17
- package/dist/controller/hiddenEditorManager.js +4 -8
- package/dist/document-operations.js +1 -1
- package/dist/docx/canonicalSave.d.ts +1 -1
- package/dist/docx/canonicalSave.js +1 -1
- package/dist/docx/canonicalSessionInput.js +1 -1
- package/dist/docx/containerChildren.js +1 -1
- package/dist/docx/createDocx.d.ts +4 -0
- package/dist/docx/createDocx.js +6 -0
- package/dist/docx/modelValidation.js +1 -1
- package/dist/docx/parser.js +1 -1
- package/dist/docx/reviewResolutionProvenance.js +1 -1
- package/dist/docx/rezip.d.ts +1 -1
- package/dist/docx/rezip.js +2 -2
- package/dist/docx/serializer/borderSerializer.js +1 -1
- package/dist/docx/serializer/commentSerializer.js +1 -1
- package/dist/docx/serializer/documentSerializer.js +1 -1
- package/dist/docx/serializer/paragraphSerializer.js +3 -3
- package/dist/docx/serializer/runSerializer.js +1 -1
- package/dist/docx/serializer/sectionPropertiesSerializer.js +1 -1
- package/dist/docx/serializer/tableSerializer.js +1 -1
- package/dist/docx/serializer/textFormattingSerializer.js +1 -1
- package/dist/docx/serializer/trackedChangeAttributes.js +1 -1
- package/dist/docx/server/templatePlan/apply.js +69 -11
- package/dist/docx/server/templatePlan/inspect.js +88 -35
- package/dist/docx/server/templatePlan/labels.d.ts +10 -1
- package/dist/docx/server/templatePlan/labels.js +31 -2
- package/dist/docx/server/templatePlan/plan.d.ts +2 -0
- package/dist/docx/server/templatePlan/plan.js +41 -7
- package/dist/docx/server/templatePlan/planShape.js +22 -3
- package/dist/docx/server/templatePlan/types.d.ts +38 -2
- package/dist/docx/server/templatePlan/types.js +1 -0
- package/dist/docx/server/templatePlan/verify.js +11 -3
- package/dist/docx/server/templatePlan/xml.d.ts +5 -0
- package/dist/docx/server/templatePlan/xml.js +7 -1
- package/dist/docx/storyBlockReplay.js +1 -1
- package/dist/docx/xmlParser.js +1 -1
- package/dist/i18n/loadMessages.d.ts +5 -0
- package/dist/i18n/loadMessages.js +46 -0
- package/dist/i18n/locales.d.ts +3 -0
- package/dist/i18n/locales.js +17 -0
- package/dist/i18n/messages.d.ts +3 -2
- package/dist/i18n/messages.js +4 -16
- package/dist/internal/clipboardTransformPlugin.d.ts +3 -0
- package/dist/internal/clipboardTransformPlugin.js +13 -0
- package/dist/internal/extensionRuntime.d.ts +7 -0
- package/dist/internal/extensionRuntime.js +28 -0
- package/dist/internal/paragraphFormattingSerialization.js +1 -1
- package/dist/internal/starterKitExtensions.d.ts +20 -0
- package/dist/internal/starterKitExtensions.js +123 -0
- package/dist/internal/wholeStoryRevisionResolution.js +2 -2
- package/dist/prosemirror/attrs/index.js +1 -1
- package/dist/prosemirror/canonicalSelectionRange.js +1 -1
- package/dist/prosemirror/canonicalTableCommands.js +1 -1
- package/dist/prosemirror/commands/comments.js +3 -3
- package/dist/prosemirror/commands/contentControls.js +1 -1
- package/dist/prosemirror/commands/pastePlainText.js +2 -3
- package/dist/prosemirror/commands/replaceRangeText.js +1 -1
- package/dist/prosemirror/commentRecords.js +2 -2
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +0 -5
- package/dist/prosemirror/conversion/fromProseDoc.js +2 -9
- package/dist/prosemirror/conversion/index.d.ts +2 -2
- package/dist/prosemirror/conversion/index.js +2 -2
- package/dist/prosemirror/extensions/ExtensionManager.js +4 -22
- package/dist/prosemirror/extensions/StarterKit.d.ts +4 -27
- package/dist/prosemirror/extensions/StarterKit.js +29 -115
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +2 -2
- package/dist/prosemirror/extensions/features/BaseKeymapExtension.js +1 -1
- package/dist/prosemirror/extensions/features/ListExtension.js +7 -2
- package/dist/prosemirror/extensions/features/pastedHeadingStyles.js +1 -1
- package/dist/prosemirror/extensions/index.d.ts +2 -1
- package/dist/prosemirror/extensions/marks/FootnoteRefExtension.js +8 -3
- package/dist/prosemirror/extensions/nodes/TableExtension.js +7 -40
- package/dist/prosemirror/hyperlinkRemoval.js +7 -2
- package/dist/prosemirror/index.d.ts +2 -2
- package/dist/prosemirror/index.js +2 -2
- package/dist/prosemirror/keptRangeBoundaries.js +1 -1
- package/dist/prosemirror/listNumbering.js +1 -1
- package/dist/prosemirror/noteReferenceOccurrences.js +1 -1
- package/dist/prosemirror/noteReferenceReview.d.ts +2 -56
- package/dist/prosemirror/noteReferenceReview.js +2 -243
- package/dist/prosemirror/pastedCommentCopies.js +1 -1
- package/dist/prosemirror/plugins/documentNumbering.js +1 -1
- package/dist/prosemirror/plugins/documentStyles.js +1 -1
- package/dist/prosemirror/replacedAnnotations.js +1 -1
- package/dist/prosemirror/suggestionCommands.d.ts +47 -0
- package/dist/prosemirror/suggestionCommands.js +31 -0
- package/dist/prosemirror/tableCellPaste.js +1 -1
- package/dist/prosemirror/tableRunIn.js +1 -1
- package/dist/prosemirror/textInput.js +1 -1
- package/dist/types/canonicalCapabilities.d.ts +6 -52
- package/dist/types/canonicalCapabilities.js +6 -52
- package/package.json +2 -2
- package/dist/ai-edits/apply.d.ts +0 -94
- package/dist/ai-edits/apply.js +0 -6637
- package/dist/ai-edits/note-story-inventory.d.ts +0 -5
- package/dist/ai-edits/note-story-inventory.js +0 -10
- package/dist/ai-edits/revisionStretches.d.ts +0 -32
- package/dist/ai-edits/revisionStretches.js +0 -147
- package/dist/document-operations-apply.d.ts +0 -15
- package/dist/document-operations-apply.js +0 -280
- package/dist/prosemirror/extensions/core/HistoryExtension.d.ts +0 -12
- package/dist/prosemirror/extensions/core/HistoryExtension.js +0 -114
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.d.ts +0 -23
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.js +0 -270
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.d.ts +0 -51
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.js +0 -411
- package/dist/prosemirror/plugins/suggestionMode.d.ts +0 -92
- package/dist/prosemirror/plugins/suggestionMode.js +0 -1515
- package/dist/prosemirror/tablePositionedBookmarks.d.ts +0 -8
- package/dist/prosemirror/tablePositionedBookmarks.js +0 -80
|
@@ -34,12 +34,12 @@ import { mapTocSelection } from "./canonicalTocSelection.js";
|
|
|
34
34
|
import { controlEdgesAt } from "./controlEdges.js";
|
|
35
35
|
import { ownedSourceCopies, preservePropertySources, preservePropertySourcesWholeStories } from "./propertySourcePreservation.js";
|
|
36
36
|
import { Result, TaggedError, panic } from "better-result";
|
|
37
|
-
import {
|
|
38
|
-
import { CellSelection } from "prosemirror-tables";
|
|
37
|
+
import { hasIllegalXmlCharacters } from "@stll/docx-core";
|
|
39
38
|
import { lockedControlMessage } from "@stll/docx-core/model";
|
|
40
39
|
import { DOCUMENT_OP_REFUSAL_REASONS, DOCUMENT_OP_TYPES, ID_LEASE_KINDS, OP_STORIES, applyDocumentOp, applyDocumentOps, combineEdits, combineRecordedRevisions, compileEditorIntent, createEditorIntentIdAllocator, documentStories, editorParagraphGroups, findStoryBody, formatParaId, freshLeasedIds, inverseMeetingDocument, isBlockBoundary, normalizeForOps, packageParagraphIds, paragraphIdsIn, paragraphsThroughTextBoxes, planWholeParagraphReplacement, sameStory, suggestedCommentIds, suggestionRevisionInfos, survivingComments, validateOpsDocument, withParagraphCopies } from "@stll/docx-core/ops";
|
|
41
|
-
import { hasIllegalXmlCharacters } from "@stll/docx-core";
|
|
42
40
|
import { AllSelection, NodeSelection, Selection, TextSelection } from "prosemirror-state";
|
|
41
|
+
import { CellSelection } from "prosemirror-tables";
|
|
42
|
+
import { Fragment } from "prosemirror-model";
|
|
43
43
|
// src/canonical/canonicalSession.ts
|
|
44
44
|
const CanonicalSessionErrorBase = TaggedError("CanonicalSessionError");
|
|
45
45
|
var CanonicalSessionError = class extends CanonicalSessionErrorBase {};
|
|
@@ -279,8 +279,7 @@ var CanonicalProjection = class CanonicalProjection {
|
|
|
279
279
|
container: entry.container ?? this.content,
|
|
280
280
|
start: (this.starts[block] ?? panic("Missing block start")) + entry.offset,
|
|
281
281
|
text: entry.inline.text,
|
|
282
|
-
|
|
283
|
-
seams: entry.inline.seams,
|
|
282
|
+
gaps: entry.inline.gaps,
|
|
284
283
|
node: entry.node,
|
|
285
284
|
source: entry.source
|
|
286
285
|
};
|
|
@@ -328,21 +327,19 @@ var CanonicalProjection = class CanonicalProjection {
|
|
|
328
327
|
const paragraph = this.paragraphAround(position);
|
|
329
328
|
if (paragraph === void 0) return this.insideTextBox(position) ? refuseUnder({ gap: CANONICAL_GAP.publicUnsupportedInline }, "The canonical session holds no address in this paragraph, such as one in a text box.") : refuse("The input is outside a plain paragraph.");
|
|
330
329
|
const relative = position - paragraph.start;
|
|
331
|
-
const offset = paragraph.
|
|
330
|
+
const offset = paragraph.gaps.offsetOf(relative);
|
|
332
331
|
if (offset < 0) return refuse("The input splits an indivisible inline element.");
|
|
333
332
|
if (splitsSurrogatePair(paragraph.text, offset)) return refuse("The input would split a surrogate pair.");
|
|
334
|
-
const gaps = paragraph.
|
|
335
|
-
const
|
|
336
|
-
const gap = gaps[index] ?? panic("Missing canonical native gap");
|
|
337
|
-
const seam = paragraph.seams.at(offset)?.[index] ?? panic("Missing canonical seam");
|
|
333
|
+
const gaps = paragraph.gaps.at(offset) ?? panic("Missing canonical boundary");
|
|
334
|
+
const gap = gaps.find((entry) => entry.position === relative) ?? panic("Missing canonical native gap");
|
|
338
335
|
let ordinal = gap.zeroWidthBefore;
|
|
339
|
-
if (edge === "afterMarkers") ordinal =
|
|
340
|
-
if (edge === "beforeMarkers") ordinal =
|
|
336
|
+
if (edge === "afterMarkers") ordinal = gap.last;
|
|
337
|
+
if (edge === "beforeMarkers") ordinal = gap.first;
|
|
341
338
|
return Result.ok({
|
|
342
339
|
story: this.story,
|
|
343
340
|
blockId: paragraph.blockId,
|
|
344
341
|
offset,
|
|
345
|
-
...gaps.length > 1 || ordinal > 0 ||
|
|
342
|
+
...gaps.length > 1 || ordinal > 0 || gap.first !== gap.last ? { zeroWidthBefore: ordinal } : {}
|
|
346
343
|
});
|
|
347
344
|
}
|
|
348
345
|
/**
|
|
@@ -381,14 +378,10 @@ var CanonicalProjection = class CanonicalProjection {
|
|
|
381
378
|
positionAt(address) {
|
|
382
379
|
const paragraph = this.paragraph(address.blockId);
|
|
383
380
|
if (!sameStory(address.story, this.story) || paragraph === void 0 || !Number.isInteger(address.offset) || address.offset < 0 || address.offset > paragraph.text.length || splitsSurrogatePair(paragraph.text, address.offset)) return refuse("The canonical selection is outside a plain paragraph.");
|
|
384
|
-
const gaps = paragraph.
|
|
385
|
-
const
|
|
386
|
-
const lastOrdinal = (seams.at(-1) ?? panic("Missing canonical seam")).last;
|
|
381
|
+
const gaps = paragraph.gaps.at(address.offset) ?? panic("Missing canonical boundary");
|
|
382
|
+
const lastOrdinal = (gaps.at(-1) ?? panic("Missing canonical seam")).last;
|
|
387
383
|
const ordinal = address.zeroWidthBefore ?? lastOrdinal;
|
|
388
|
-
const gap = gaps.find(({ zeroWidthBefore }) => zeroWidthBefore === ordinal) ?? gaps.find((
|
|
389
|
-
const seam = seams[index];
|
|
390
|
-
return seam !== void 0 && seam.first <= ordinal && ordinal <= seam.last;
|
|
391
|
-
});
|
|
384
|
+
const gap = gaps.find(({ zeroWidthBefore }) => zeroWidthBefore === ordinal) ?? gaps.find(({ first, last }) => first <= ordinal && ordinal <= last);
|
|
392
385
|
if (!Number.isInteger(ordinal) || ordinal < 0 || ordinal > lastOrdinal) return refuse("The canonical selection is outside a paragraph gap.");
|
|
393
386
|
if (gap === void 0) return refuse("This source gap is inside a collapsed or erased inline boundary and has no editor position.");
|
|
394
387
|
return Result.ok(paragraph.start + gap.position);
|
|
@@ -1449,7 +1442,7 @@ var CanonicalSession = class {
|
|
|
1449
1442
|
}
|
|
1450
1443
|
captureSaveSnapshot() {
|
|
1451
1444
|
if (this.isComposing) throw new CanonicalSessionError({
|
|
1452
|
-
ground: { gap: CANONICAL_GAP.
|
|
1445
|
+
ground: { gap: CANONICAL_GAP.saveSerialization },
|
|
1453
1446
|
reason: "refused",
|
|
1454
1447
|
message: "Composition must finish before saving the canonical document."
|
|
1455
1448
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { canonicalTypingOf } from "../internal/canonicalTyping.js";
|
|
2
2
|
import { Subscribable } from "../managers/Subscribable.js";
|
|
3
3
|
import { legacyTextAddressAt } from "./legacyTextAddress.js";
|
|
4
|
-
import { ReplaceStep } from "prosemirror-transform";
|
|
5
4
|
import { DOCUMENT_OP_SCHEMA_VERSION, sameStory, transformPosition } from "@stll/docx-core/ops";
|
|
5
|
+
import { ReplaceStep } from "prosemirror-transform";
|
|
6
6
|
import { isHistoryTransaction } from "prosemirror-history";
|
|
7
7
|
// src/controller/autocompleteSuggestion.ts
|
|
8
8
|
/**
|
|
@@ -14,10 +14,10 @@ import { bytesToDataUrl } from "../utils/base64.js";
|
|
|
14
14
|
import { base64ToBytes } from "../utils/textEncoding.js";
|
|
15
15
|
import { flattenClipboardStyleReferences, importClipboardStyles } from "./canonicalClipboardResources.js";
|
|
16
16
|
import { Result, panic } from "better-result";
|
|
17
|
-
import { Fragment, Slice } from "prosemirror-model";
|
|
18
|
-
import { CellSelection } from "prosemirror-tables";
|
|
19
17
|
import { NUMBER_FORMATS, paragraphNumberingReference, relationshipIdOf } from "@stll/docx-core/model";
|
|
20
18
|
import { packageResourcesOpOf } from "@stll/docx-core/ops";
|
|
19
|
+
import { CellSelection } from "prosemirror-tables";
|
|
20
|
+
import { Fragment, Slice } from "prosemirror-model";
|
|
21
21
|
// src/controller/canonicalClipboard.ts
|
|
22
22
|
const refuse = (message) => Result.err(new CanonicalSessionError({
|
|
23
23
|
ground: { gap: CANONICAL_GAP.dispatch },
|
|
@@ -3,8 +3,8 @@ import { CanonicalSessionError } from "../canonical/canonicalSession.js";
|
|
|
3
3
|
import { CANONICAL_GAP } from "../types/canonicalCapabilities.js";
|
|
4
4
|
import { setCanonicalInputTimer } from "./canonicalInputTimer.js";
|
|
5
5
|
import { Result } from "better-result";
|
|
6
|
-
import { DOMParser, DOMSerializer, Fragment } from "prosemirror-model";
|
|
7
6
|
import { EditorState, TextSelection } from "prosemirror-state";
|
|
7
|
+
import { DOMParser, DOMSerializer, Fragment } from "prosemirror-model";
|
|
8
8
|
// src/controller/canonicalComposition.ts
|
|
9
9
|
/** A composition over content the session cannot project, restored. */
|
|
10
10
|
const UNSUPPORTED_COMPOSITION = { gap: CANONICAL_GAP.storyContentProjection };
|
|
@@ -2,9 +2,9 @@ import { deletionRange, isCanonicalJoinBoundary, measuredDeletionRange } from ".
|
|
|
2
2
|
import { textCaretOf } from "../prosemirror/nativeSelection.js";
|
|
3
3
|
import { getEditorInputTargetRange, handleEditorBeforeInput } from "../prosemirror/textInput.js";
|
|
4
4
|
import { createCanonicalComposition } from "./canonicalComposition.js";
|
|
5
|
+
import { Selection, TextSelection } from "prosemirror-state";
|
|
5
6
|
import { CellSelection } from "prosemirror-tables";
|
|
6
7
|
import { ReplaceStep } from "prosemirror-transform";
|
|
7
|
-
import { Selection, TextSelection } from "prosemirror-state";
|
|
8
8
|
// src/controller/canonicalInput.ts
|
|
9
9
|
/** Deletions whose extent the browser measures: by word or by line. */
|
|
10
10
|
const WORD_AND_LINE_DELETIONS = /* @__PURE__ */ new Set([
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { remapSelection } from "../canonical/canonicalRemoteHistory.js";
|
|
2
|
-
import { OP_STORIES } from "@stll/docx-core/ops";
|
|
3
2
|
import * as v from "valibot";
|
|
3
|
+
import { OP_STORIES } from "@stll/docx-core/ops";
|
|
4
4
|
// src/controller/canonicalPresence.ts
|
|
5
5
|
const COUNT = v.pipe(v.number(), v.safeInteger(), v.minValue(0));
|
|
6
6
|
const STORY = v.union([
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Result, TaggedError } from "better-result";
|
|
2
|
-
import { DEFAULT_ID_BLOCK_SIZES, DOCUMENT_OP_SCHEMA_VERSION, ID_LEASE_KINDS, createSequencer, validateSequencedBatch } from "@stll/docx-core/ops";
|
|
3
2
|
import * as v from "valibot";
|
|
3
|
+
import { DEFAULT_ID_BLOCK_SIZES, DOCUMENT_OP_SCHEMA_VERSION, ID_LEASE_KINDS, createSequencer, validateSequencedBatch } from "@stll/docx-core/ops";
|
|
4
4
|
// src/controller/canonicalRoomAuthority.ts
|
|
5
5
|
const CanonicalRoomAuthorityErrorBase = TaggedError("CanonicalRoomAuthorityError");
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Result } from "better-result";
|
|
2
|
-
import { BATCH_REJECTION_REASONS, BatchRejection, DOCUMENT_OP_TYPES, EXCLUSIVE_PARTS, ID_LEASE_KINDS, ID_LEASE_REFUSAL_REASONS, IdLeaseRefusal } from "@stll/docx-core/ops";
|
|
3
2
|
import * as v from "valibot";
|
|
3
|
+
import { BATCH_REJECTION_REASONS, BatchRejection, DOCUMENT_OP_TYPES, EXCLUSIVE_PARTS, ID_LEASE_KINDS, ID_LEASE_REFUSAL_REASONS, IdLeaseRefusal } from "@stll/docx-core/ops";
|
|
4
4
|
// src/controller/canonicalRoomWire.ts
|
|
5
5
|
const LEASE_KINDS = v.picklist(Object.values(ID_LEASE_KINDS));
|
|
6
6
|
const REVISION = v.pipe(v.number(), v.integer(), v.minValue(0));
|
|
@@ -15,9 +15,9 @@ import { collectHeadings } from "../utils/headingCollector.js";
|
|
|
15
15
|
import { itemBefore } from "../utils/listItems.js";
|
|
16
16
|
import { prepareContentControlValue } from "./canonicalContentControlValue.js";
|
|
17
17
|
import { Result, panic } from "better-result";
|
|
18
|
-
import { CellSelection } from "prosemirror-tables";
|
|
19
18
|
import { NO_PARAGRAPH_NUMBERING, headingOutlineLevel, paragraphNumberingReference, resolveParagraphNumbering } from "@stll/docx-core/model";
|
|
20
19
|
import { DOCUMENT_OP_TYPES, OP_STORIES, editorParagraphGroups, editorPositionAtPhysicalPosition, physicalPositionAtEditorOffset } from "@stll/docx-core/ops";
|
|
20
|
+
import { CellSelection } from "prosemirror-tables";
|
|
21
21
|
// src/controller/canonicalStructure.ts
|
|
22
22
|
const DEFAULT_TOC_PAGE_WIDTH_TWIPS = 12240;
|
|
23
23
|
const DEFAULT_TOC_MARGIN_TWIPS = 1440;
|
|
@@ -2,8 +2,8 @@ import { parseCanonicalPresence } from "./canonicalPresence.js";
|
|
|
2
2
|
import { restoreCanonicalRoomAuthority } from "./canonicalRoomAuthority.js";
|
|
3
3
|
import { UNAVAILABLE_LEASE_ANSWER, decodeLeaseGrant, decodeLeaseRenewal, decodeRoomSubmission, encodeLeaseGrant, encodeLeaseRenewal, encodeRoomSubmission } from "./canonicalRoomWire.js";
|
|
4
4
|
import { Result, TaggedError } from "better-result";
|
|
5
|
-
import { ID_LEASE_KINDS, validateDocumentBatch, validateSequencedBatch } from "@stll/docx-core/ops";
|
|
6
5
|
import * as v from "valibot";
|
|
6
|
+
import { ID_LEASE_KINDS, validateDocumentBatch, validateSequencedBatch } from "@stll/docx-core/ops";
|
|
7
7
|
// src/controller/canonicalTabRoom.ts
|
|
8
8
|
/** BroadcastChannel and the Web Locks API, as a browser tab has them. */
|
|
9
9
|
const browserTabEnvironment = () => ({
|
|
@@ -2,8 +2,8 @@ import { itemBefore } from "../utils/listItems.js";
|
|
|
2
2
|
import { decodeRoomRecord, restoreCanonicalRoomAuthority } from "./canonicalRoomAuthority.js";
|
|
3
3
|
import { UNAVAILABLE_LEASE_ANSWER, decodeLeaseGrant, decodeLeaseRenewal, decodeRoomSubmission, encodeLeaseGrant, encodeLeaseRenewal, encodeRoomSubmission, toWireJson } from "./canonicalRoomWire.js";
|
|
4
4
|
import { Result, TaggedError } from "better-result";
|
|
5
|
-
import { ID_LEASE_KINDS, validateDocumentBatch } from "@stll/docx-core/ops";
|
|
6
5
|
import * as v from "valibot";
|
|
6
|
+
import { ID_LEASE_KINDS, validateDocumentBatch } from "@stll/docx-core/ops";
|
|
7
7
|
// src/controller/canonicalYjsRoom.ts
|
|
8
8
|
/** The Yjs client id the authority writes the journal under, unless the host picks another. */
|
|
9
9
|
const CANONICAL_YJS_AUTHORITY = 1179601993;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { cloneDocumentWithParagraphPropertySources } from "../docx/paragraphPropertySource.js";
|
|
2
|
-
import { fromProseDoc } from "../prosemirror/conversion/fromProseDoc.js";
|
|
3
|
-
import { readModel } from "../types/documentModel.js";
|
|
4
2
|
import { NO_ANONYMIZATION_HIGHLIGHTS } from "./anonymizationHighlights.js";
|
|
5
3
|
import { IDLE_AUTOCOMPLETE } from "./autocompleteSuggestion.js";
|
|
6
4
|
import { legacyEditorPositionAt } from "./textPositionLookup.js";
|
|
7
|
-
import { CellSelection } from "prosemirror-tables";
|
|
8
5
|
import { NodeSelection, Selection, TextSelection } from "prosemirror-state";
|
|
6
|
+
import { CellSelection } from "prosemirror-tables";
|
|
9
7
|
import { redo, undo } from "prosemirror-history";
|
|
10
8
|
// src/controller/hiddenEditorApi.ts
|
|
11
9
|
/** No editor: nothing to suggest in. */
|
|
@@ -30,13 +28,6 @@ const delegateAutocomplete = (current) => ({
|
|
|
30
28
|
get: () => current().get(),
|
|
31
29
|
canTrigger: () => current().canTrigger()
|
|
32
30
|
});
|
|
33
|
-
/**
|
|
34
|
-
* Convert PM state to Document
|
|
35
|
-
*/
|
|
36
|
-
const stateToDocument = (state, originalDoc) => {
|
|
37
|
-
if (!originalDoc) return null;
|
|
38
|
-
return fromProseDoc(state.doc, readModel(originalDoc), { stylesheetSource: { type: "package" } });
|
|
39
|
-
};
|
|
40
31
|
const createHiddenEditorApi = (deps) => {
|
|
41
32
|
const dispatchTr = (view, tr) => {
|
|
42
33
|
if (!deps.isDestroying()) view.dispatch(tr);
|
|
@@ -82,13 +73,7 @@ const createHiddenEditorApi = (deps) => {
|
|
|
82
73
|
getAnonymizationHighlights: () => deps.getAnonymizationHighlights?.() ?? NO_ANONYMIZATION_HIGHLIGHTS,
|
|
83
74
|
insertField: (field) => deps.insertField?.(field) ?? false,
|
|
84
75
|
autocomplete: deps.autocomplete ?? NO_AUTOCOMPLETE,
|
|
85
|
-
getDocument: () =>
|
|
86
|
-
const canonical = deps.getCanonicalDocument?.();
|
|
87
|
-
if (canonical) return canonical;
|
|
88
|
-
const view = deps.getView();
|
|
89
|
-
if (!view) return null;
|
|
90
|
-
return stateToDocument(view.state, deps.getDocumentContext());
|
|
91
|
-
},
|
|
76
|
+
getDocument: () => deps.getCanonicalDocument?.() ?? deps.getDocumentContext(),
|
|
92
77
|
updateCanonicalInputLifecycle: (action) => deps.canonicalOperations?.updateCanonicalInputLifecycle(action) ?? false,
|
|
93
78
|
applyCanonicalStoryHistory: (options) => deps.canonicalOperations?.applyCanonicalStoryHistory(options) ?? false,
|
|
94
79
|
applyCanonicalComment: (request) => deps.canonicalOperations?.applyCanonicalComment(request) ?? null,
|
|
@@ -5,6 +5,7 @@ import { restoreCanonicalSelection } from "../canonical/canonicalSelection.js";
|
|
|
5
5
|
import { CanonicalSessionError, createCanonicalSession, publishCanonicalProjection } from "../canonical/canonicalSession.js";
|
|
6
6
|
import { derivedFieldOps, fieldInsertionParagraph } from "../canonical/derivedFields.js";
|
|
7
7
|
import { parseDocx } from "../docx/parser.js";
|
|
8
|
+
import { clipboardTransformPlugin } from "../internal/clipboardTransformPlugin.js";
|
|
8
9
|
import { editingFontContextOf, editingFontFamily } from "../layout-bridge/convert/editingFont.js";
|
|
9
10
|
import { recordHiddenEditorPhase, recordHiddenEditorStateCreate } from "../layout-engine/layoutInstrumentation.js";
|
|
10
11
|
import { suppressHiddenEditorScrollToSelection } from "../paged-layout/hiddenEditorScroll.js";
|
|
@@ -38,10 +39,10 @@ import { isCanonicalListParagraph, prepareCanonicalAutoformat, prepareCanonicalC
|
|
|
38
39
|
import { createHiddenEditorApi } from "./hiddenEditorApi.js";
|
|
39
40
|
import { handleReadOnlySelectionKeyDown } from "./readOnlySelection.js";
|
|
40
41
|
import { Result, TaggedError } from "better-result";
|
|
41
|
-
import { DOMParser, DOMSerializer } from "prosemirror-model";
|
|
42
|
-
import { CellSelection } from "prosemirror-tables";
|
|
43
42
|
import { OP_STORIES, documentStories, freshCommentId, sameStory } from "@stll/docx-core/ops";
|
|
44
43
|
import { EditorState, Plugin, Selection } from "prosemirror-state";
|
|
44
|
+
import { CellSelection } from "prosemirror-tables";
|
|
45
|
+
import { DOMParser, DOMSerializer } from "prosemirror-model";
|
|
45
46
|
import { EditorView } from "prosemirror-view";
|
|
46
47
|
// src/controller/hiddenEditorManager.ts
|
|
47
48
|
/**
|
|
@@ -266,12 +267,7 @@ const createHiddenEditorManager = (hostDeps) => {
|
|
|
266
267
|
createNativeNavigationPlugin(),
|
|
267
268
|
createDocumentStyleContextPlugin(deps.getStyles() ?? document.package.styles),
|
|
268
269
|
new Plugin({ props: { clipboardTextParser: parseCanonicalClipboardText } }),
|
|
269
|
-
...[...deps.getExtensionManager()?.getPlugins() ?? [], ...deps.getExternalPlugins()].flatMap(({ props }) =>
|
|
270
|
-
...props.transformCopied === void 0 ? {} : { transformCopied: props.transformCopied },
|
|
271
|
-
...props.clipboardTextSerializer === void 0 ? {} : { clipboardTextSerializer: props.clipboardTextSerializer },
|
|
272
|
-
...props.transformPastedHTML === void 0 ? {} : { transformPastedHTML: props.transformPastedHTML },
|
|
273
|
-
...props.transformPasted === void 0 ? {} : { transformPasted: props.transformPasted }
|
|
274
|
-
} })]),
|
|
270
|
+
...[...deps.getExtensionManager()?.getPlugins() ?? [], ...deps.getExternalPlugins()].flatMap(({ props }) => clipboardTransformPlugin(props)),
|
|
275
271
|
...deps.getExternalPlugins().flatMap(({ spec }) => spec.view === void 0 ? [] : [new Plugin({ view: spec.view })])
|
|
276
272
|
]
|
|
277
273
|
});
|
|
@@ -5,8 +5,8 @@ import "./docx/tableParser.js";
|
|
|
5
5
|
import { outlineLevelFromAttrValue } from "./prosemirror/outlineLevelAttr.js";
|
|
6
6
|
import { HIGHLIGHT_COLOR_VALUES, LINE_SPACING_RULE_VALUES, PARAGRAPH_ALIGNMENT_VALUES } from "./types/documentEnumValues.js";
|
|
7
7
|
import { TaggedError } from "better-result";
|
|
8
|
-
import { NUMBER_FORMATS, isNumberingReference, paragraphNumberingReference } from "@stll/docx-core/model";
|
|
9
8
|
import { sanitizeXmlCharacters } from "@stll/docx-core";
|
|
9
|
+
import { NUMBER_FORMATS, isNumberingReference, paragraphNumberingReference } from "@stll/docx-core/model";
|
|
10
10
|
// src/document-operations.ts
|
|
11
11
|
const FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION = 1;
|
|
12
12
|
/** Direct paragraph-alignment values accepted by the operation contract. */
|
|
@@ -10,7 +10,7 @@ declare const CanonicalSaveDiagnosticErrorBase: TaggedErrorClass<"CanonicalSaveD
|
|
|
10
10
|
/** Forward a fidelity fallback through the adapters' existing error channel. */
|
|
11
11
|
export declare class CanonicalSaveDiagnosticError extends CanonicalSaveDiagnosticErrorBase<{
|
|
12
12
|
message: string;
|
|
13
|
-
gap: typeof CANONICAL_GAP.
|
|
13
|
+
gap: typeof CANONICAL_GAP.saveSerialization;
|
|
14
14
|
diagnostic: SaveDiagnostic;
|
|
15
15
|
}> {}
|
|
16
16
|
/** The adapters' error channel for one fidelity fallback. */
|
|
@@ -16,7 +16,7 @@ const CanonicalSaveDiagnosticErrorBase = TaggedError("CanonicalSaveDiagnosticErr
|
|
|
16
16
|
var CanonicalSaveDiagnosticError = class extends CanonicalSaveDiagnosticErrorBase {};
|
|
17
17
|
/** The adapters' error channel for one fidelity fallback. */
|
|
18
18
|
const canonicalSaveDiagnosticError = (diagnostic) => new CanonicalSaveDiagnosticError({
|
|
19
|
-
gap: CANONICAL_GAP.
|
|
19
|
+
gap: CANONICAL_GAP.saveSerialization,
|
|
20
20
|
diagnostic,
|
|
21
21
|
message: `Canonical save used a fidelity fallback: ${diagnostic.type} (${diagnostic.part}).`
|
|
22
22
|
});
|
|
@@ -7,8 +7,8 @@ import { keepNormalizedSourceParts } from "./normalizedSourceParts.js";
|
|
|
7
7
|
import { MalformedPackageRelationshipsError } from "./packageRelationshipsRoot.js";
|
|
8
8
|
import { parseDocx } from "./parser.js";
|
|
9
9
|
import { Result, TaggedError } from "better-result";
|
|
10
|
-
import { documentStories, idKey, packageParagraphIds, paragraphsThroughTextBoxes } from "@stll/docx-core/ops";
|
|
11
10
|
import { MalformedXmlReferenceError } from "@stll/docx-core/xml";
|
|
11
|
+
import { documentStories, idKey, packageParagraphIds, paragraphsThroughTextBoxes } from "@stll/docx-core/ops";
|
|
12
12
|
// src/docx/canonicalSessionInput.ts
|
|
13
13
|
const CanonicalDocxInputErrorBase = TaggedError("CanonicalDocxInputError");
|
|
14
14
|
var CanonicalDocxInputError = class extends CanonicalDocxInputErrorBase {};
|
|
@@ -2,8 +2,8 @@ import { TRANSITIONAL_NAMESPACE_BY_STRICT_URI } from "./strictValueEncodings.gen
|
|
|
2
2
|
import { captureVerbatimXml } from "./verbatimCapture.js";
|
|
3
3
|
import { WORDPROCESSINGML_NAMESPACE_URIS, getChildElements, getLocalName, getNamespaceUri } from "./xmlParser.js";
|
|
4
4
|
import { preservedChildGap } from "@stll/docx-core/model";
|
|
5
|
-
import { SEQUENCE_CHILDREN } from "@stll/docx-core/schema";
|
|
6
5
|
import { OOXML_NS } from "@stll/docx-core/xml/namespaces";
|
|
6
|
+
import { SEQUENCE_CHILDREN } from "@stll/docx-core/schema";
|
|
7
7
|
// src/docx/containerChildren.ts
|
|
8
8
|
/**
|
|
9
9
|
* The shared child dispatcher: one way to walk a container's children.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { document_d_exports } from "../types/document.js";
|
|
2
|
+
import { DocumentPropertiesOptions } from "./rezip.js";
|
|
3
|
+
/** Create a DOCX from a document, loading the package writer on demand. */
|
|
4
|
+
export declare function createDocx(document: document_d_exports.Document, properties?: DocumentPropertiesOptions): Promise<ArrayBuffer>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isCanonicallyEmptyParagraphFormatting } from "@stll/docx-core/model";
|
|
2
1
|
import { validateDocumentModel } from "@stll/docx-core";
|
|
2
|
+
import { isCanonicallyEmptyParagraphFormatting } from "@stll/docx-core/model";
|
|
3
3
|
// src/docx/modelValidation.ts
|
|
4
4
|
var DocxModelValidationError = class extends Error {
|
|
5
5
|
issues;
|
package/dist/docx/parser.js
CHANGED
|
@@ -48,9 +48,9 @@ import { renderWmfSvg } from "./wmfSvg.js";
|
|
|
48
48
|
import { getAttribute, getChildElements, getLocalName, parseXml, parseXmlDocument } from "./xmlParser.js";
|
|
49
49
|
import { TaggedError, panic } from "better-result";
|
|
50
50
|
import { PARSE_WARNING_CODES, setDocumentBodyComments } from "@stll/docx-core/model";
|
|
51
|
-
import { isCommentExhausted, orphanRootCommentIds } from "@stll/docx-core/ops";
|
|
52
51
|
import { MalformedXmlReferenceError, malformedXmlReferenceError } from "@stll/docx-core/xml";
|
|
53
52
|
import { FOLIO_XML_RESOURCE_LIMITS } from "@stll/docx-core/xml/limits";
|
|
53
|
+
import { isCommentExhausted, orphanRootCommentIds } from "@stll/docx-core/ops";
|
|
54
54
|
// src/docx/parser.ts
|
|
55
55
|
/**
|
|
56
56
|
* Main Parser Orchestrator - Unified parseDocx function
|
|
@@ -2,9 +2,9 @@ import "../reviewHistoryLimits.js";
|
|
|
2
2
|
import { FOLIO_REVIEW_HISTORY_NAMESPACE } from "./reviewHistoryNamespace.js";
|
|
3
3
|
import { getAttributeByNamespaceUri } from "./xmlParser.js";
|
|
4
4
|
import { Result, TaggedError, panic } from "better-result";
|
|
5
|
+
import { escapeXmlAttribute } from "@stll/docx-core";
|
|
5
6
|
import { MAX_REVISION_ID } from "@stll/docx-core/model";
|
|
6
7
|
import { isCopyOriginAncestors, isKeptCut, isKeptCutPiece } from "@stll/docx-core/ops";
|
|
7
|
-
import { escapeXmlAttribute } from "@stll/docx-core";
|
|
8
8
|
// src/docx/reviewResolutionProvenance.ts
|
|
9
9
|
const NAMESPACES = /* @__PURE__ */ new Set([FOLIO_REVIEW_HISTORY_NAMESPACE]);
|
|
10
10
|
/**
|
package/dist/docx/rezip.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export declare function readRelsOrStub(zip: ZipArchive, relsPath: string): Promi
|
|
|
61
61
|
declare const CanonicalImageRelationshipRefusalErrorBase: TaggedErrorClass<"CanonicalImageRelationshipRefusalError">;
|
|
62
62
|
export declare class CanonicalImageRelationshipRefusalError extends CanonicalImageRelationshipRefusalErrorBase<{
|
|
63
63
|
message: string;
|
|
64
|
-
gap: typeof CANONICAL_GAP.
|
|
64
|
+
gap: typeof CANONICAL_GAP.saveSerialization;
|
|
65
65
|
part: string;
|
|
66
66
|
relationshipId: string;
|
|
67
67
|
reason: "conflict" | "unresolved" | "missingMedia" | "unsafeTarget";
|
package/dist/docx/rezip.js
CHANGED
|
@@ -44,8 +44,8 @@ import { captureVerbatimXml } from "./verbatimCapture.js";
|
|
|
44
44
|
import { hasCanonicalWordprocessingPrefixes } from "./wordprocessingPrefixes.js";
|
|
45
45
|
import { OFFICE_RELATIONSHIP_NAMESPACE_URIS, OOXML_NAMESPACE_SCOPE, WORDPROCESSINGML_NAMESPACE_URIS, findAttributeByNamespaceUri, findChild, findChildByNamespaceUri, findChildrenByNamespaceUri, getAttribute, getAttributeByNamespaceUri, getChildElements, getLocalName, getNamespaceUri, matchesName, parseXml, parseXmlDocument, resolveAttributeNamespaceUri } from "./xmlParser.js";
|
|
46
46
|
import { Result, TaggedError, panic } from "better-result";
|
|
47
|
-
import { mintRelationshipId, numberingInstanceResolves } from "@stll/docx-core/model";
|
|
48
47
|
import { assertValidOoxmlNumericIds, escapeXmlAttribute, escapeXmlText, validateDocxPackage } from "@stll/docx-core";
|
|
48
|
+
import { mintRelationshipId, numberingInstanceResolves } from "@stll/docx-core/model";
|
|
49
49
|
import { getXmlSourceRange, parseStreamingXmlWithSourceRanges } from "@stll/docx-core/xml";
|
|
50
50
|
import { ZipArchive } from "@stll/docx-core/zip";
|
|
51
51
|
// src/docx/rezip.ts
|
|
@@ -531,7 +531,7 @@ const publishCanonicalImageResources = async ({ document, zip, compressionLevel
|
|
|
531
531
|
const refuse = (reason, message) => {
|
|
532
532
|
throw new CanonicalImageRelationshipRefusalError({
|
|
533
533
|
message,
|
|
534
|
-
gap: CANONICAL_GAP.
|
|
534
|
+
gap: CANONICAL_GAP.saveSerialization,
|
|
535
535
|
part: relsPath,
|
|
536
536
|
relationshipId: id,
|
|
537
537
|
reason
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { serializePreservedAttributes } from "../attributeRemainder.js";
|
|
2
2
|
import { intAttr } from "./xmlUtils.js";
|
|
3
|
-
import { borderStyleToken, themeColorToken } from "@stll/docx-core/model";
|
|
4
3
|
import { escapeXmlAttribute } from "@stll/docx-core";
|
|
4
|
+
import { borderStyleToken, themeColorToken } from "@stll/docx-core/model";
|
|
5
5
|
// src/docx/serializer/borderSerializer.ts
|
|
6
6
|
/**
|
|
7
7
|
* Shared single-border serializer for every `CT_Border` field — table borders
|
|
@@ -7,8 +7,8 @@ import { serializeParagraph } from "./paragraphSerializer.js";
|
|
|
7
7
|
import { serializePartElement } from "./partNamespaces.js";
|
|
8
8
|
import { serializeTextFormatting } from "./textFormattingSerializer.js";
|
|
9
9
|
import { Result } from "better-result";
|
|
10
|
-
import { COMMENT_PART_RELATIONSHIPS } from "@stll/docx-core/model";
|
|
11
10
|
import { assertValidOoxmlNumericIds, escapeXmlAttribute } from "@stll/docx-core";
|
|
11
|
+
import { COMMENT_PART_RELATIONSHIPS } from "@stll/docx-core/model";
|
|
12
12
|
// src/docx/serializer/commentSerializer.ts
|
|
13
13
|
/**
|
|
14
14
|
* Comment Serializer
|
|
@@ -10,8 +10,8 @@ import { serializePartElement } from "./partNamespaces.js";
|
|
|
10
10
|
import { resetAutoIdCounter } from "./runSerializer.js";
|
|
11
11
|
import { serializeSectionProperties } from "./sectionPropertiesSerializer.js";
|
|
12
12
|
import { serializeTable } from "./tableSerializer.js";
|
|
13
|
-
import { themeColorToken } from "@stll/docx-core/model";
|
|
14
13
|
import { escapeXmlAttribute } from "@stll/docx-core";
|
|
14
|
+
import { themeColorToken } from "@stll/docx-core/model";
|
|
15
15
|
// src/docx/serializer/documentSerializer.ts
|
|
16
16
|
/**
|
|
17
17
|
* Document Serializer - Serialize complete document.xml
|
|
@@ -17,8 +17,8 @@ import { serializeSectionProperties } from "./sectionPropertiesSerializer.js";
|
|
|
17
17
|
import { serializeTextFormatting } from "./textFormattingSerializer.js";
|
|
18
18
|
import { serializeTrackedChangeAttributes, trackedChangeAttributeRecord } from "./trackedChangeAttributes.js";
|
|
19
19
|
import { TaggedError, panic } from "better-result";
|
|
20
|
-
import { PARAGRAPH_MARK_CHANGE_KINDS, finalizeParagraphFormatting } from "@stll/docx-core/model";
|
|
21
20
|
import { escapeXmlAttribute, escapeXmlText } from "@stll/docx-core";
|
|
21
|
+
import { PARAGRAPH_MARK_CHANGE_KINDS, finalizeParagraphFormatting as finalizeParagraphFormatting$1 } from "@stll/docx-core/model";
|
|
22
22
|
import { SEQUENCE_CHILDREN } from "@stll/docx-core/schema";
|
|
23
23
|
// src/docx/serializer/paragraphSerializer.ts
|
|
24
24
|
/**
|
|
@@ -883,7 +883,7 @@ function hasParagraphFormatting(paragraph) {
|
|
|
883
883
|
* Create an empty paragraph
|
|
884
884
|
*/
|
|
885
885
|
function createEmptyParagraph(formatting) {
|
|
886
|
-
const finalizedFormatting = finalizeParagraphFormatting(formatting);
|
|
886
|
+
const finalizedFormatting = finalizeParagraphFormatting$1(formatting);
|
|
887
887
|
return {
|
|
888
888
|
type: "paragraph",
|
|
889
889
|
...finalizedFormatting !== void 0 ? { formatting: finalizedFormatting } : {},
|
|
@@ -894,7 +894,7 @@ function createEmptyParagraph(formatting) {
|
|
|
894
894
|
* Create a paragraph with a single text run
|
|
895
895
|
*/
|
|
896
896
|
function createTextParagraph(text, paragraphFormatting, textFormatting) {
|
|
897
|
-
const finalizedFormatting = finalizeParagraphFormatting(paragraphFormatting);
|
|
897
|
+
const finalizedFormatting = finalizeParagraphFormatting$1(paragraphFormatting);
|
|
898
898
|
return {
|
|
899
899
|
type: "paragraph",
|
|
900
900
|
...finalizedFormatting !== void 0 ? { formatting: finalizedFormatting } : {},
|
|
@@ -18,8 +18,8 @@ import { serializeTextFormatting } from "./textFormattingSerializer.js";
|
|
|
18
18
|
import { serializeTrackedChangeAttributes } from "./trackedChangeAttributes.js";
|
|
19
19
|
import { intAttr } from "./xmlUtils.js";
|
|
20
20
|
import { panic } from "better-result";
|
|
21
|
-
import { SCHEME_COLOR_VALUE_BY_THEME_COLOR, getSingularRunPropertyChange, knownThemeColor, presetLineDashToken } from "@stll/docx-core/model";
|
|
22
21
|
import { escapeXmlAttribute, escapeXmlText, isValidOoxmlNumericId, requiresXmlSpacePreserve } from "@stll/docx-core";
|
|
22
|
+
import { SCHEME_COLOR_VALUE_BY_THEME_COLOR, getSingularRunPropertyChange, knownThemeColor, presetLineDashToken } from "@stll/docx-core/model";
|
|
23
23
|
// src/docx/serializer/runSerializer.ts
|
|
24
24
|
/**
|
|
25
25
|
* Run Serializer - Serialize runs to OOXML XML
|
|
@@ -3,8 +3,8 @@ import { serializeSectionReferenceHistory } from "../sectionReferenceHistory.js"
|
|
|
3
3
|
import { serializeBorder } from "./borderSerializer.js";
|
|
4
4
|
import { serializeTrackedChangeAttributes } from "./trackedChangeAttributes.js";
|
|
5
5
|
import { intAttr } from "./xmlUtils.js";
|
|
6
|
-
import { themeColorToken } from "@stll/docx-core/model";
|
|
7
6
|
import { escapeXmlAttribute, serializeOnOffElement } from "@stll/docx-core";
|
|
7
|
+
import { themeColorToken } from "@stll/docx-core/model";
|
|
8
8
|
import { serializeSequenceChildren } from "@stll/docx-core/schema";
|
|
9
9
|
// src/docx/serializer/sectionPropertiesSerializer.ts
|
|
10
10
|
const serializeHeaderReference = (ref) => `<w:headerReference w:type="${ref.type}" r:id="${escapeXmlAttribute(ref.rId)}"/>`;
|
|
@@ -15,8 +15,8 @@ import { serializeBookmarkMarker, serializeCommentRangeMarker, serializeMoveRang
|
|
|
15
15
|
import { serializeSdtWrapper } from "./sdtPropertiesSerializer.js";
|
|
16
16
|
import { serializeTrackedChangeAttributes } from "./trackedChangeAttributes.js";
|
|
17
17
|
import { intAttr } from "./xmlUtils.js";
|
|
18
|
-
import { themeColorToken } from "@stll/docx-core/model";
|
|
19
18
|
import { escapeXmlAttribute, serializeOnOffElement } from "@stll/docx-core";
|
|
19
|
+
import { themeColorToken } from "@stll/docx-core/model";
|
|
20
20
|
import { serializeSequenceChildren } from "@stll/docx-core/schema";
|
|
21
21
|
// src/docx/serializer/tableSerializer.ts
|
|
22
22
|
/**
|
|
@@ -3,8 +3,8 @@ import { isValidHexColor } from "../../utils/colorResolver.js";
|
|
|
3
3
|
import { roundHorizontalScalePercentForSerialization } from "../../utils/horizontalScale.js";
|
|
4
4
|
import { serializePreservedAttributes } from "../attributeRemainder.js";
|
|
5
5
|
import { intAttr } from "./xmlUtils.js";
|
|
6
|
-
import { themeColorToken } from "@stll/docx-core/model";
|
|
7
6
|
import { escapeXmlAttribute, serializeOnOffElement } from "@stll/docx-core";
|
|
7
|
+
import { themeColorToken } from "@stll/docx-core/model";
|
|
8
8
|
import { serializeSequenceChildren } from "@stll/docx-core/schema";
|
|
9
9
|
// src/docx/serializer/textFormattingSerializer.ts
|
|
10
10
|
const VALID_HIGHLIGHT_COLORS = new Set(HIGHLIGHT_COLOR_VALUES);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DATE_UTC_ATTRIBUTE } from "../trackedChangeInfo.js";
|
|
2
|
-
import { normalizeRevisionId } from "@stll/docx-core/model";
|
|
3
2
|
import { assertValidOoxmlNumericId, escapeXmlAttribute } from "@stll/docx-core";
|
|
3
|
+
import { normalizeRevisionId } from "@stll/docx-core/model";
|
|
4
4
|
// src/docx/serializer/trackedChangeAttributes.ts
|
|
5
5
|
/** Normalized, unescaped attributes in schema order for an XML element or string serializer. */
|
|
6
6
|
const trackedChangeAttributeEntries = (info) => {
|