oasis-editor 0.0.142 → 0.0.144
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/{OasisEditorApp-DNiy9Yze.js → OasisEditorApp-CskQWKEC.js} +765 -22
- package/dist/assets/{importDocxWorker-B1vHeo5L.js → importDocxWorker-5S8lX4CZ.js} +1 -1
- package/dist/core/model/index.d.ts +1 -0
- package/dist/core/model/types/document.d.ts +7 -0
- package/dist/core/model/types/docxSourcePackage.d.ts +46 -0
- package/dist/export/docx/docxTypes.d.ts +2 -0
- package/dist/export/docx/exportEditorDocumentToDocxPreservingSource.d.ts +4 -0
- package/dist/export/docx/opc/sourcePackagePatcher.d.ts +8 -0
- package/dist/export/docx/text/sourceParagraphPropertiesXml.d.ts +8 -0
- package/dist/export/docx/text/sourceParagraphXml.d.ts +12 -0
- package/dist/export/docx/text/sourceRunXml.d.ts +14 -0
- package/dist/import/docx/markupCompatibility.d.ts +20 -0
- package/dist/import/docx/numbering.d.ts +3 -0
- package/dist/import/docx/opc/legacyCompatibilityPackage.d.ts +10 -0
- package/dist/import/docx/opc/sourcePackage.d.ts +4 -0
- package/dist/import/docx/xmlHelpers.d.ts +3 -5
- package/dist/{index-PWJQT9bT.js → index-DOtfE4EA.js} +1116 -361
- package/dist/oasis-editor.js +79 -79
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/ooxml/opc/packageXml.d.ts +14 -0
- package/dist/ooxml/word/numberingMetadata.d.ts +20 -0
- package/dist/ooxml/word/sourceFragments.d.ts +43 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EditorOpcContentTypes, EditorOpcRelationship } from '../../core/model.js';
|
|
2
|
+
|
|
3
|
+
export declare const OPC_CONTENT_TYPES_PATH = "[Content_Types].xml";
|
|
4
|
+
export declare const OPC_ROOT_RELATIONSHIPS_PATH = "_rels/.rels";
|
|
5
|
+
export declare const OPC_RELATIONSHIPS_NAMESPACE = "http://schemas.openxmlformats.org/package/2006/relationships";
|
|
6
|
+
export declare const OPC_CONTENT_TYPES_NAMESPACE = "http://schemas.openxmlformats.org/package/2006/content-types";
|
|
7
|
+
export declare function normalizeOpcPartPath(path: string): string;
|
|
8
|
+
export declare function resolveOpcRelationshipTarget(ownerPartPath: string | null, target: string): string | null;
|
|
9
|
+
export declare function getOpcRelationshipOwnerPath(path: string): string | null | undefined;
|
|
10
|
+
export declare function parseOpcContentTypes(xml: string | null | undefined): EditorOpcContentTypes;
|
|
11
|
+
export declare function serializeOpcContentTypes(contentTypes: EditorOpcContentTypes): string;
|
|
12
|
+
export declare function parseOpcRelationships(xml: string | null | undefined): EditorOpcRelationship[];
|
|
13
|
+
export declare function serializeOpcRelationships(relationships: EditorOpcRelationship[]): string;
|
|
14
|
+
export declare function resolveOpcRelationships(ownerPartPath: string | null, relationships: EditorOpcRelationship[], onUnsafeTarget?: (relationship: EditorOpcRelationship) => void): EditorOpcRelationship[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { EditorParagraphListStyle } from '../../core/model.js';
|
|
2
|
+
|
|
3
|
+
export interface EditorListOoxmlNumberingMetadata {
|
|
4
|
+
/** Original ST_NumberFormat token, including formats Oasis cannot render. */
|
|
5
|
+
format?: string;
|
|
6
|
+
/** Modelled format/kind at import time, used to detect an explicit edit. */
|
|
7
|
+
importedFormat?: EditorParagraphListStyle["format"];
|
|
8
|
+
importedKind: EditorParagraphListStyle["kind"];
|
|
9
|
+
/** `w:lvlRestart/@w:val`. Zero means never restart. */
|
|
10
|
+
restartAfterLevel?: number;
|
|
11
|
+
/** `w:pStyle/@w:val` associated with this numbering level. */
|
|
12
|
+
paragraphStyleId?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function setEditorListOoxmlNumberingMetadata(list: EditorParagraphListStyle, metadata: Omit<EditorListOoxmlNumberingMetadata, "importedFormat" | "importedKind">): void;
|
|
15
|
+
export declare function getEditorListOoxmlNumberingMetadata(list: EditorParagraphListStyle): EditorListOoxmlNumberingMetadata | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Uses the source format only while the editor-visible kind/format still match
|
|
18
|
+
* their imported state. An explicit list-format edit therefore wins.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getEffectiveEditorListOoxmlFormat(list: EditorParagraphListStyle): string | undefined;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { EditorParagraphNode, EditorTextRun } from '../../core/model.js';
|
|
2
|
+
|
|
3
|
+
export interface EditorOoxmlRunSource {
|
|
4
|
+
xml: string;
|
|
5
|
+
semanticSignature: string;
|
|
6
|
+
structureSignature: string;
|
|
7
|
+
}
|
|
8
|
+
export interface EditorOoxmlParagraphPropertiesSource {
|
|
9
|
+
xml: string;
|
|
10
|
+
semanticSignature: string;
|
|
11
|
+
}
|
|
12
|
+
export interface EditorOoxmlParagraphSource {
|
|
13
|
+
xml?: string;
|
|
14
|
+
semanticSignature?: string;
|
|
15
|
+
attributes?: string;
|
|
16
|
+
paragraphProperties?: EditorOoxmlParagraphPropertiesSource;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Imported run properties are parsed into the editor model and must be emitted
|
|
20
|
+
* by the canonical serializer. This restores derived complex-script twins,
|
|
21
|
+
* resolved theme colors and compatibility wrappers while source-only children
|
|
22
|
+
* are retained by the structural merge layer.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ooxmlSourceNeedsCanonicalRunSerialization(xml: string): boolean;
|
|
25
|
+
export declare function createEditorRunSemanticSignature(run: EditorTextRun): string;
|
|
26
|
+
export declare function createEditorRunStructureSignature(run: EditorTextRun): string;
|
|
27
|
+
export declare function setEditorRunOoxmlSource(run: EditorTextRun, xml: string): void;
|
|
28
|
+
export declare function getEditorRunOoxmlSource(run: EditorTextRun): EditorOoxmlRunSource | undefined;
|
|
29
|
+
export declare function copyEditorRunOoxmlSource<T extends EditorTextRun>(source: EditorTextRun, target: T): T;
|
|
30
|
+
export declare function createEditorParagraphSemanticSignature(paragraph: EditorParagraphNode): string;
|
|
31
|
+
export declare function createEditorParagraphPropertiesSignature(paragraph: EditorParagraphNode): string;
|
|
32
|
+
export declare function setEditorParagraphOoxmlSource(paragraph: EditorParagraphNode, source: {
|
|
33
|
+
xml?: string;
|
|
34
|
+
attributes?: string;
|
|
35
|
+
paragraphPropertiesXml?: string;
|
|
36
|
+
}): void;
|
|
37
|
+
export declare function getEditorParagraphOoxmlSource(paragraph: EditorParagraphNode): EditorOoxmlParagraphSource | undefined;
|
|
38
|
+
export declare function getReusableEditorParagraphXml(paragraph: EditorParagraphNode, options: {
|
|
39
|
+
hasOverrides: boolean;
|
|
40
|
+
hasBoundaryTokens: boolean;
|
|
41
|
+
}): string | undefined;
|
|
42
|
+
export declare function getEditorParagraphOoxmlAttributes(paragraph: EditorParagraphNode): string | undefined;
|
|
43
|
+
export declare function getReusableEditorParagraphPropertiesXml(paragraph: EditorParagraphNode, hasOverrides: boolean): string | undefined;
|