@uniweb/semantic-parser 1.1.0 → 1.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/semantic-parser",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Semantic parser for ProseMirror/TipTap content structures",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -16,6 +16,7 @@ function flattenGroup(group) {
16
16
  icons: group.body.icons || [],
17
17
  lists: group.body.lists || [],
18
18
  videos: group.body.videos || [],
19
+ insets: group.body.insets || [],
19
20
  data: group.body.data || {},
20
21
  quotes: group.body.quotes || [],
21
22
  headings: group.body.headings || [],
@@ -42,6 +43,7 @@ function processGroups(sequence, options = {}) {
42
43
  icons: [],
43
44
  lists: [],
44
45
  videos: [],
46
+ insets: [],
45
47
  data: {},
46
48
  quotes: [],
47
49
  headings: [],
@@ -78,6 +80,7 @@ function processGroups(sequence, options = {}) {
78
80
  icons: [],
79
81
  lists: [],
80
82
  videos: [],
83
+ insets: [],
81
84
  data: {},
82
85
  quotes: [],
83
86
  headings: [],
@@ -216,6 +219,7 @@ function processGroupContent(elements) {
216
219
  imgs: [],
217
220
  icons: [],
218
221
  videos: [],
222
+ insets: [],
219
223
  paragraphs: [],
220
224
  links: [],
221
225
  lists: [],
@@ -343,6 +347,10 @@ function processGroupContent(elements) {
343
347
  }
344
348
  break;
345
349
 
350
+ case "inset":
351
+ body.insets.push({ refId: element.refId });
352
+ break;
353
+
346
354
  case "form":
347
355
  // Map FormBlock to data.form
348
356
  body.data.form = element.data || element.attrs;
@@ -153,6 +153,11 @@ function createSequenceElement(node, options = {}) {
153
153
  attrs,
154
154
  };
155
155
 
156
+ case "inset_placeholder":
157
+ return {
158
+ type: "inset",
159
+ refId: attrs.refId,
160
+ };
156
161
  case "ImageBlock":
157
162
  return {
158
163
  type: "image",