@kerebron/extension-odt 0.4.8 → 0.4.9
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/esm/ExtensionOdt.js +1 -6
- package/esm/OdtParser.js +13 -48
- package/esm/lists.js +6 -38
- package/package.json +3 -3
package/esm/ExtensionOdt.js
CHANGED
|
@@ -3,14 +3,9 @@ import { parse_content, parse_styles, unzip } from '@kerebron/odt-wasm';
|
|
|
3
3
|
import { OdtParser } from './OdtParser.js';
|
|
4
4
|
import { getDefaultsPostProcessFilters } from './postprocess/postProcess.js';
|
|
5
5
|
export class ExtensionOdt extends Extension {
|
|
6
|
+
name = 'odt';
|
|
6
7
|
constructor(config = {}) {
|
|
7
8
|
super(config);
|
|
8
|
-
Object.defineProperty(this, "name", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
configurable: true,
|
|
11
|
-
writable: true,
|
|
12
|
-
value: 'odt'
|
|
13
|
-
});
|
|
14
9
|
}
|
|
15
10
|
getConverters(editor, schema) {
|
|
16
11
|
const config = this.config;
|
package/esm/OdtParser.js
CHANGED
|
@@ -73,43 +73,16 @@ export function iterateEnum($value) {
|
|
|
73
73
|
return $value.map(tagEnum);
|
|
74
74
|
}
|
|
75
75
|
export class OdtStashContext {
|
|
76
|
+
schema;
|
|
77
|
+
stylesTree;
|
|
78
|
+
automaticStyles;
|
|
79
|
+
ctxStash = [];
|
|
80
|
+
currentCtx;
|
|
81
|
+
listTracker = new ListTracker();
|
|
76
82
|
constructor(schema, handlers, stylesTree, automaticStyles) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
writable: true,
|
|
81
|
-
value: schema
|
|
82
|
-
});
|
|
83
|
-
Object.defineProperty(this, "stylesTree", {
|
|
84
|
-
enumerable: true,
|
|
85
|
-
configurable: true,
|
|
86
|
-
writable: true,
|
|
87
|
-
value: stylesTree
|
|
88
|
-
});
|
|
89
|
-
Object.defineProperty(this, "automaticStyles", {
|
|
90
|
-
enumerable: true,
|
|
91
|
-
configurable: true,
|
|
92
|
-
writable: true,
|
|
93
|
-
value: automaticStyles
|
|
94
|
-
});
|
|
95
|
-
Object.defineProperty(this, "ctxStash", {
|
|
96
|
-
enumerable: true,
|
|
97
|
-
configurable: true,
|
|
98
|
-
writable: true,
|
|
99
|
-
value: []
|
|
100
|
-
});
|
|
101
|
-
Object.defineProperty(this, "currentCtx", {
|
|
102
|
-
enumerable: true,
|
|
103
|
-
configurable: true,
|
|
104
|
-
writable: true,
|
|
105
|
-
value: void 0
|
|
106
|
-
});
|
|
107
|
-
Object.defineProperty(this, "listTracker", {
|
|
108
|
-
enumerable: true,
|
|
109
|
-
configurable: true,
|
|
110
|
-
writable: true,
|
|
111
|
-
value: new ListTracker()
|
|
112
|
-
});
|
|
83
|
+
this.schema = schema;
|
|
84
|
+
this.stylesTree = stylesTree;
|
|
85
|
+
this.automaticStyles = automaticStyles;
|
|
113
86
|
this.currentCtx = {
|
|
114
87
|
handlers,
|
|
115
88
|
content: [],
|
|
@@ -210,19 +183,11 @@ export class OdtStashContext {
|
|
|
210
183
|
}
|
|
211
184
|
}
|
|
212
185
|
export class OdtParser {
|
|
186
|
+
schema;
|
|
187
|
+
config;
|
|
213
188
|
constructor(schema, config = {}) {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
configurable: true,
|
|
217
|
-
writable: true,
|
|
218
|
-
value: schema
|
|
219
|
-
});
|
|
220
|
-
Object.defineProperty(this, "config", {
|
|
221
|
-
enumerable: true,
|
|
222
|
-
configurable: true,
|
|
223
|
-
writable: true,
|
|
224
|
-
value: config
|
|
225
|
-
});
|
|
189
|
+
this.schema = schema;
|
|
190
|
+
this.config = config;
|
|
226
191
|
}
|
|
227
192
|
parse(files) {
|
|
228
193
|
const contentTree = files.contentTree;
|
package/esm/lists.js
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
export class ListNumbering {
|
|
2
|
+
levels = {};
|
|
3
|
+
levelNodes = {};
|
|
2
4
|
constructor() {
|
|
3
|
-
Object.defineProperty(this, "levels", {
|
|
4
|
-
enumerable: true,
|
|
5
|
-
configurable: true,
|
|
6
|
-
writable: true,
|
|
7
|
-
value: {}
|
|
8
|
-
});
|
|
9
|
-
Object.defineProperty(this, "levelNodes", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
configurable: true,
|
|
12
|
-
writable: true,
|
|
13
|
-
value: {}
|
|
14
|
-
});
|
|
15
5
|
for (let i = 0; i < 20; i++) {
|
|
16
6
|
this.levels[i] = 1;
|
|
17
7
|
}
|
|
@@ -26,30 +16,8 @@ export class ListNumbering {
|
|
|
26
16
|
}
|
|
27
17
|
}
|
|
28
18
|
export class ListTracker {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
writable: true,
|
|
34
|
-
value: []
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(this, "listNumberings", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
configurable: true,
|
|
39
|
-
writable: true,
|
|
40
|
-
value: new Map()
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(this, "lastNumbering", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
configurable: true,
|
|
45
|
-
writable: true,
|
|
46
|
-
value: void 0
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(this, "preserveMinLevel", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
configurable: true,
|
|
51
|
-
writable: true,
|
|
52
|
-
value: 999
|
|
53
|
-
});
|
|
54
|
-
}
|
|
19
|
+
listStack = [];
|
|
20
|
+
listNumberings = new Map();
|
|
21
|
+
lastNumbering;
|
|
22
|
+
preserveMinLevel = 999;
|
|
55
23
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kerebron/extension-odt",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"module": "./esm/ExtensionOdt.js",
|
|
6
6
|
"exports": {
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
},
|
|
11
11
|
"scripts": {},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@kerebron/editor": "0.4.
|
|
14
|
-
"@kerebron/odt-wasm": "0.4.
|
|
13
|
+
"@kerebron/editor": "0.4.9",
|
|
14
|
+
"@kerebron/odt-wasm": "0.4.9",
|
|
15
15
|
"prosemirror-model": "1.25.3",
|
|
16
16
|
"prosemirror-state": "1.4.3"
|
|
17
17
|
},
|