@progress/kendo-editor-common 1.12.7-develop.3 → 1.12.7-develop.4
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/es/DOMSerializer.js
CHANGED
|
@@ -10,7 +10,7 @@ export class DOMSerializer {
|
|
|
10
10
|
if (structure.nodeType != null) {
|
|
11
11
|
return { dom: structure };
|
|
12
12
|
}
|
|
13
|
-
if (structure
|
|
13
|
+
if (isRenderedSpec(structure)) {
|
|
14
14
|
return structure;
|
|
15
15
|
}
|
|
16
16
|
let tagName = structure[0], space = tagName.indexOf(' ');
|
|
@@ -117,7 +117,10 @@ export class DOMSerializer {
|
|
|
117
117
|
rendered++;
|
|
118
118
|
}
|
|
119
119
|
while (keep < active.length) {
|
|
120
|
-
|
|
120
|
+
const previous = active.pop();
|
|
121
|
+
if (previous) {
|
|
122
|
+
top = previous[1];
|
|
123
|
+
}
|
|
121
124
|
}
|
|
122
125
|
while (rendered < node.marks.length) {
|
|
123
126
|
const add = node.marks[rendered++];
|
|
@@ -178,6 +181,9 @@ function gatherToDOM(obj) {
|
|
|
178
181
|
}
|
|
179
182
|
return result;
|
|
180
183
|
}
|
|
184
|
+
function isRenderedSpec(structure) {
|
|
185
|
+
return typeof structure === 'object' && structure !== null && 'dom' in structure && !!structure.dom && structure.dom.nodeType != null;
|
|
186
|
+
}
|
|
181
187
|
function doc(options) {
|
|
182
188
|
return options.document || window.document;
|
|
183
189
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { DOMOutputSpec, Fragment, Mark, Node, Schema } from 'prosemirror-model';
|
|
2
2
|
type DOMNode = InstanceType<typeof window.Node>;
|
|
3
|
+
type RenderedSpec = {
|
|
4
|
+
dom: DOMNode;
|
|
5
|
+
contentDOM?: HTMLElement;
|
|
6
|
+
};
|
|
7
|
+
type RenderSpec = DOMOutputSpec | RenderedSpec;
|
|
3
8
|
export declare class DOMSerializer {
|
|
4
9
|
readonly nodes: {
|
|
5
10
|
[node: string]: (node: Node) => DOMOutputSpec;
|
|
@@ -7,10 +12,7 @@ export declare class DOMSerializer {
|
|
|
7
12
|
readonly marks: {
|
|
8
13
|
[mark: string]: (mark: Mark, inline: boolean) => DOMOutputSpec;
|
|
9
14
|
};
|
|
10
|
-
static renderSpec(docum: Document, structure:
|
|
11
|
-
dom: DOMNode;
|
|
12
|
-
contentDOM?: HTMLElement;
|
|
13
|
-
};
|
|
15
|
+
static renderSpec(docum: Document, structure: RenderSpec, xmlNS?: string | null): RenderedSpec;
|
|
14
16
|
static fromSchema(schema: Schema): DOMSerializer;
|
|
15
17
|
static nodesFromSchema(schema: Schema): {
|
|
16
18
|
[node: string]: (node: Node) => DOMOutputSpec;
|
|
@@ -13,7 +13,7 @@ class DOMSerializer {
|
|
|
13
13
|
if (structure.nodeType != null) {
|
|
14
14
|
return { dom: structure };
|
|
15
15
|
}
|
|
16
|
-
if (structure
|
|
16
|
+
if (isRenderedSpec(structure)) {
|
|
17
17
|
return structure;
|
|
18
18
|
}
|
|
19
19
|
let tagName = structure[0], space = tagName.indexOf(' ');
|
|
@@ -120,7 +120,10 @@ class DOMSerializer {
|
|
|
120
120
|
rendered++;
|
|
121
121
|
}
|
|
122
122
|
while (keep < active.length) {
|
|
123
|
-
|
|
123
|
+
const previous = active.pop();
|
|
124
|
+
if (previous) {
|
|
125
|
+
top = previous[1];
|
|
126
|
+
}
|
|
124
127
|
}
|
|
125
128
|
while (rendered < node.marks.length) {
|
|
126
129
|
const add = node.marks[rendered++];
|
|
@@ -182,6 +185,9 @@ function gatherToDOM(obj) {
|
|
|
182
185
|
}
|
|
183
186
|
return result;
|
|
184
187
|
}
|
|
188
|
+
function isRenderedSpec(structure) {
|
|
189
|
+
return typeof structure === 'object' && structure !== null && 'dom' in structure && !!structure.dom && structure.dom.nodeType != null;
|
|
190
|
+
}
|
|
185
191
|
function doc(options) {
|
|
186
192
|
return options.document || window.document;
|
|
187
193
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-editor-common",
|
|
3
3
|
"description": "Kendo UI TypeScript package exporting functions for Editor component",
|
|
4
|
-
"version": "1.12.7-develop.
|
|
4
|
+
"version": "1.12.7-develop.4",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Kendo UI"
|
|
7
7
|
],
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"prosemirror-history": "1.5.0",
|
|
34
34
|
"prosemirror-inputrules": "1.5.1",
|
|
35
35
|
"prosemirror-keymap": "1.2.3",
|
|
36
|
-
"prosemirror-model": "1.25.
|
|
36
|
+
"prosemirror-model": "1.25.11",
|
|
37
37
|
"prosemirror-schema-list": "1.5.1",
|
|
38
38
|
"prosemirror-state": "1.4.4",
|
|
39
39
|
"prosemirror-tables": "1.8.5",
|