@uniweb/content-reader 1.1.3 → 1.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/content-reader",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Markdown to ProseMirror document structure converter",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -113,7 +113,7 @@ function parseBlock(token, schema) {
113
113
  content.forEach((element) => {
114
114
  if (
115
115
  (element.type === "image" && element.attrs?.role !== "icon") ||
116
- element.type === "inline_child_ref"
116
+ element.type === "inset_ref"
117
117
  ) {
118
118
  // Extract non-icon images to root level so they become
119
119
  // block-level elements. Icons stay inline so the semantic
@@ -153,7 +153,7 @@ function parseInline(token, schema, removeNewLine = false) {
153
153
  const component = token.href.slice(1)
154
154
  const { role: _role, ...otherAttrs } = token.attrs || {}
155
155
  return [{
156
- type: "inline_child_ref",
156
+ type: "inset_ref",
157
157
  attrs: {
158
158
  component,
159
159
  alt: text || null,
@@ -60,6 +60,22 @@ const baseNodes = {
60
60
  // group: "block inline",
61
61
  },
62
62
 
63
+ inset_ref: {
64
+ attrs: {
65
+ component: {},
66
+ alt: { default: null },
67
+ // Dynamic attributes from {key=value} syntax are also stored here
68
+ },
69
+ group: "block",
70
+ },
71
+
72
+ inset_placeholder: {
73
+ attrs: {
74
+ refId: {},
75
+ },
76
+ group: "block",
77
+ },
78
+
63
79
  divider: {
64
80
  attrs: {
65
81
  style: { default: "line" },