oasis-editor 0.0.145 → 0.0.147
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-CskQWKEC.js → OasisEditorApp-DM9mi2EU.js} +4258 -4167
- package/dist/__tests__/ooxml/markupCompatibilityEngine.test.d.ts +1 -0
- package/dist/__tests__/ooxml/milestone2Integration.test.d.ts +1 -0
- package/dist/__tests__/ooxml/namespaceRegistry.test.d.ts +1 -0
- package/dist/__tests__/ooxml/preservationBag.test.d.ts +1 -0
- package/dist/__tests__/ooxml/universalContainerPatcher.test.d.ts +1 -0
- package/dist/app/controllers/tableOpsMutationCommands.d.ts +14 -3
- package/dist/app/controllers/tableOpsSelectionRanges.d.ts +4 -1
- package/dist/app/controllers/useEditorTableOperations.d.ts +2 -2
- package/dist/assets/importDocxWorker-BLm3QMHu.js +12 -0
- package/dist/core/commands/table/tableCommandUtils.d.ts +7 -1
- package/dist/core/editorState/nodeFactories.d.ts +1 -1
- package/dist/core/model/documentIndex.d.ts +35 -2
- package/dist/core/model/index.d.ts +2 -2
- package/dist/core/model/types/docxSourcePackage.d.ts +7 -0
- package/dist/core/model/types/nodes.d.ts +2 -1
- package/dist/export/docx/docxNumbering.d.ts +4 -1
- package/dist/export/docx/endnotesXml.d.ts +2 -5
- package/dist/export/docx/footnotesXml.d.ts +3 -21
- package/dist/export/docx/noteDocxIds.d.ts +9 -0
- package/dist/export/docx/opc/commentEntrySourcePatcher.d.ts +5 -0
- package/dist/export/docx/opc/commentsExtendedSourcePatcher.d.ts +5 -0
- package/dist/export/docx/opc/documentRootSourcePatcher.d.ts +5 -0
- package/dist/export/docx/opc/extensionMarkupMerge.d.ts +9 -0
- package/dist/export/docx/opc/headerFooterRootSourcePatcher.d.ts +11 -0
- package/dist/export/docx/opc/headerFooterSourcePatcher.d.ts +9 -0
- package/dist/export/docx/opc/headerFooterStoryReferences.d.ts +14 -0
- package/dist/export/docx/opc/noteEntrySourcePatcher.d.ts +4 -0
- package/dist/export/docx/opc/numberingSourcePatcher.d.ts +5 -0
- package/dist/export/docx/opc/rebuiltPartHashes.d.ts +5 -0
- package/dist/export/docx/opc/relatedStoryRootSourcePatcher.d.ts +11 -0
- package/dist/export/docx/opc/sectionPropertiesSourcePatcher.d.ts +10 -0
- package/dist/export/docx/opc/sourceBackedDocxPatcher.d.ts +4 -0
- package/dist/export/docx/opc/sourceOnlySingletonFilter.d.ts +19 -0
- package/dist/export/docx/opc/sourcePackagePatcher.d.ts +7 -3
- package/dist/export/docx/opc/styleParagraphPropertiesSourcePatcher.d.ts +5 -0
- package/dist/export/docx/opc/styleRunPropertiesSourcePatcher.d.ts +5 -0
- package/dist/export/docx/opc/styleTablePropertiesSourcePatcher.d.ts +5 -0
- package/dist/export/docx/opc/universalContainerPatcher.d.ts +1 -0
- package/dist/export/docx/opc/wordPartRootSourcePatcher.d.ts +21 -0
- package/dist/export/docx/opc/wordSingletonSourcePatcher.d.ts +14 -0
- package/dist/export/docx/tableSourcePropertiesXml.d.ts +13 -0
- package/dist/export/docx/tableSourceXml.d.ts +10 -0
- package/dist/export/docx/tableXml.d.ts +5 -3
- package/dist/export/docx/text/sourceParagraphPropertiesXml.d.ts +8 -0
- package/dist/export/docx/text/sourceRunPropertiesXml.d.ts +7 -0
- package/dist/import/docx/opc/sourcePackage.d.ts +1 -0
- package/dist/{index-DOtfE4EA.js → index-CXKg4TC3.js} +5960 -875
- package/dist/oasis-editor.js +79 -79
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/ooxml/markupCompatibilityEngine.d.ts +16 -0
- package/dist/ooxml/namespaceRegistry.d.ts +17 -0
- package/dist/ooxml/preservationBag.d.ts +21 -0
- package/dist/ooxml/schemaOrder.d.ts +7 -0
- package/dist/ooxml/word/numberingMetadata.d.ts +4 -0
- package/dist/ooxml/word/sourceFragments.d.ts +39 -3
- package/dist/ui/tableGeometry.d.ts +2 -3
- package/package.json +1 -1
- package/dist/assets/importDocxWorker-5S8lX4CZ.js +0 -12
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Element as XmlElement } from '@xmldom/xmldom';
|
|
2
|
+
|
|
3
|
+
export declare const MARKUP_COMPATIBILITY_NS = "http://schemas.openxmlformats.org/markup-compatibility/2006";
|
|
4
|
+
export interface MarkupCompatibilityCapabilities {
|
|
5
|
+
supportedNamespaces: ReadonlySet<string>;
|
|
6
|
+
}
|
|
7
|
+
export declare const DEFAULT_MARKUP_COMPATIBILITY_CAPABILITIES: MarkupCompatibilityCapabilities;
|
|
8
|
+
export interface PreservedMcMetadata {
|
|
9
|
+
ignorable?: string;
|
|
10
|
+
processContent?: string;
|
|
11
|
+
preserveElements?: string;
|
|
12
|
+
preserveAttributes?: string;
|
|
13
|
+
alternateContentBlocks: string[];
|
|
14
|
+
}
|
|
15
|
+
export declare function extractMarkupCompatibilityMetadata(element: XmlElement): PreservedMcMetadata;
|
|
16
|
+
export declare function serializeMcAttributes(metadata: PreservedMcMetadata): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const WELL_KNOWN_NAMESPACES: Record<string, string>;
|
|
2
|
+
export declare class NamespaceRegistry {
|
|
3
|
+
private prefixToUriMap;
|
|
4
|
+
private uriToPrefixMap;
|
|
5
|
+
constructor();
|
|
6
|
+
register(prefix: string, uri: string): void;
|
|
7
|
+
getUri(prefix: string): string | undefined;
|
|
8
|
+
getPrefix(uri: string): string | undefined;
|
|
9
|
+
collectFromElement(element: {
|
|
10
|
+
attributes?: ArrayLike<{
|
|
11
|
+
name: string;
|
|
12
|
+
value: string;
|
|
13
|
+
}> | null;
|
|
14
|
+
}): void;
|
|
15
|
+
serializeNamespaces(neededPrefixes?: Iterable<string>): string;
|
|
16
|
+
clone(): NamespaceRegistry;
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Element as XmlElement } from '@xmldom/xmldom';
|
|
2
|
+
|
|
3
|
+
export interface PreservedXmlAttribute {
|
|
4
|
+
name: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
export interface PreservedXmlElement {
|
|
8
|
+
tagName: string;
|
|
9
|
+
localName: string;
|
|
10
|
+
prefix?: string;
|
|
11
|
+
xml: string;
|
|
12
|
+
schemaIndex: number;
|
|
13
|
+
}
|
|
14
|
+
export declare class PreservationBag {
|
|
15
|
+
attributes: PreservedXmlAttribute[];
|
|
16
|
+
children: PreservedXmlElement[];
|
|
17
|
+
captureAttributes(element: XmlElement, knownAttributeNames?: ReadonlySet<string>): void;
|
|
18
|
+
captureUnmappedChildren(element: XmlElement, knownChildNames: ReadonlySet<string>, schemaOrder: readonly string[]): void;
|
|
19
|
+
serializeAttributes(): string;
|
|
20
|
+
getChildrenForInsertion(schemaOrder: readonly string[], currentLocalName: string): PreservedXmlElement[];
|
|
21
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const P_PR_CHILD_ORDER: readonly string[];
|
|
2
|
+
export declare const R_PR_CHILD_ORDER: readonly string[];
|
|
3
|
+
export declare const TBL_PR_CHILD_ORDER: readonly string[];
|
|
4
|
+
export declare const SECT_PR_CHILD_ORDER: readonly string[];
|
|
5
|
+
export declare const STYLE_CHILD_ORDER: readonly string[];
|
|
6
|
+
export declare function getOrderIndex(childName: string, schemaOrder: readonly string[]): number;
|
|
7
|
+
export declare function sortXmlNodesBySchemaOrder<T>(nodes: T[], getName: (node: T) => string, schemaOrder: readonly string[]): T[];
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { EditorParagraphListStyle } from '../../core/model.js';
|
|
2
2
|
|
|
3
3
|
export interface EditorListOoxmlNumberingMetadata {
|
|
4
|
+
/** Original `w:num/@w:numId` for an imported list instance. */
|
|
5
|
+
sourceNumId?: number;
|
|
6
|
+
/** Original `w:abstractNum/@w:abstractNumId` referenced by that instance. */
|
|
7
|
+
sourceAbstractNumId?: number;
|
|
4
8
|
/** Original ST_NumberFormat token, including formats Oasis cannot render. */
|
|
5
9
|
format?: string;
|
|
6
10
|
/** Modelled format/kind at import time, used to detect an explicit edit. */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { EditorParagraphNode, EditorTextRun } from '../../core/model.js';
|
|
1
|
+
import { EditorParagraphNode, EditorTableCellNode, EditorTableNode, EditorTableRowNode, EditorTextRun } from '../../core/model.js';
|
|
2
2
|
|
|
3
3
|
export interface EditorOoxmlRunSource {
|
|
4
4
|
xml: string;
|
|
5
5
|
semanticSignature: string;
|
|
6
6
|
structureSignature: string;
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface EditorOoxmlPropertiesSource {
|
|
9
9
|
xml: string;
|
|
10
10
|
semanticSignature: string;
|
|
11
11
|
}
|
|
@@ -13,7 +13,20 @@ export interface EditorOoxmlParagraphSource {
|
|
|
13
13
|
xml?: string;
|
|
14
14
|
semanticSignature?: string;
|
|
15
15
|
attributes?: string;
|
|
16
|
-
paragraphProperties?:
|
|
16
|
+
paragraphProperties?: EditorOoxmlPropertiesSource;
|
|
17
|
+
}
|
|
18
|
+
export interface EditorOoxmlTableSource {
|
|
19
|
+
xml: string;
|
|
20
|
+
semanticSignature: string;
|
|
21
|
+
tableProperties?: EditorOoxmlPropertiesSource;
|
|
22
|
+
tableGrid?: EditorOoxmlPropertiesSource;
|
|
23
|
+
}
|
|
24
|
+
export interface EditorOoxmlTableRowSource {
|
|
25
|
+
rowProperties?: EditorOoxmlPropertiesSource;
|
|
26
|
+
propertyExceptions?: EditorOoxmlPropertiesSource;
|
|
27
|
+
}
|
|
28
|
+
export interface EditorOoxmlTableCellSource {
|
|
29
|
+
cellProperties?: EditorOoxmlPropertiesSource;
|
|
17
30
|
}
|
|
18
31
|
/**
|
|
19
32
|
* Imported run properties are parsed into the editor model and must be emitted
|
|
@@ -41,3 +54,26 @@ export declare function getReusableEditorParagraphXml(paragraph: EditorParagraph
|
|
|
41
54
|
}): string | undefined;
|
|
42
55
|
export declare function getEditorParagraphOoxmlAttributes(paragraph: EditorParagraphNode): string | undefined;
|
|
43
56
|
export declare function getReusableEditorParagraphPropertiesXml(paragraph: EditorParagraphNode, hasOverrides: boolean): string | undefined;
|
|
57
|
+
export declare function createEditorTableSemanticSignature(table: EditorTableNode): string;
|
|
58
|
+
export declare function createEditorTablePropertiesSignature(table: EditorTableNode): string;
|
|
59
|
+
export declare function createEditorTableGridSignature(table: EditorTableNode): string;
|
|
60
|
+
export declare function createEditorTableRowPropertiesSignature(row: EditorTableRowNode): string;
|
|
61
|
+
export declare function createEditorTableRowPropertyExceptionsSignature(row: EditorTableRowNode): string;
|
|
62
|
+
export declare function createEditorTableCellPropertiesSignature(cell: EditorTableCellNode): string;
|
|
63
|
+
export declare function setEditorTableRowOoxmlSource(row: EditorTableRowNode, source: {
|
|
64
|
+
rowPropertiesXml?: string;
|
|
65
|
+
propertyExceptionsXml?: string;
|
|
66
|
+
}): void;
|
|
67
|
+
export declare function getEditorTableRowOoxmlSource(row: EditorTableRowNode): EditorOoxmlTableRowSource | undefined;
|
|
68
|
+
export declare function setEditorTableCellOoxmlSource(cell: EditorTableCellNode, cellPropertiesXml: string): void;
|
|
69
|
+
export declare function getEditorTableCellOoxmlSource(cell: EditorTableCellNode): EditorOoxmlTableCellSource | undefined;
|
|
70
|
+
export declare function setEditorTableOoxmlSource(table: EditorTableNode, source: string | {
|
|
71
|
+
xml: string;
|
|
72
|
+
tablePropertiesXml?: string;
|
|
73
|
+
tableGridXml?: string;
|
|
74
|
+
}): void;
|
|
75
|
+
export declare function getEditorTableOoxmlSource(table: EditorTableNode): EditorOoxmlTableSource | undefined;
|
|
76
|
+
export declare function getReusableEditorTableXml(table: EditorTableNode, options: {
|
|
77
|
+
hasBoundaryTokens: boolean;
|
|
78
|
+
}): string | undefined;
|
|
79
|
+
export declare function ooxmlPropertiesSourceHasRelationships(source: EditorOoxmlPropertiesSource | undefined): boolean;
|
|
@@ -8,9 +8,8 @@ import { EditorDocument, EditorState, EditorTableNode } from '../core/model.js';
|
|
|
8
8
|
export declare function resolveTableColumnWidthsPx(table: EditorTableNode, pageContentWidthPx: number): number[];
|
|
9
9
|
/**
|
|
10
10
|
* Returns the inner content width (in CSS pixels) of the cell that contains the
|
|
11
|
-
* paragraph with the given id
|
|
12
|
-
*
|
|
13
|
-
* inline content (subtracts borders and horizontal padding).
|
|
11
|
+
* paragraph with the given id. For nested tables, each table is resolved
|
|
12
|
+
* relative to the content width of its parent cell rather than the page.
|
|
14
13
|
*/
|
|
15
14
|
export declare function getTableCellContentWidthForParagraph(document: EditorDocument, paragraphId: string, activeSectionIndex: number): number | null;
|
|
16
15
|
export declare function getTableCellContentWidthForParagraphInState(state: EditorState, paragraphId: string): number | null;
|