@fibery/prosemirror-schema 7.1.0 → 7.1.1

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.
@@ -15,7 +15,7 @@ const getBlockId = (node) => {
15
15
  const buildBlockIdAttrs = (node, nextId) => ({
16
16
  ...node.attrs,
17
17
  id: nextId,
18
- ...hasLegacyGuidAttr(node.type) ? { guid: nextId } : {}
18
+ ...hasLegacyGuidAttr(node.type) && { guid: nextId }
19
19
  });
20
20
  const FIBERY_VIEW_TYPE = "fiberyView";
21
21
  const getFiberyViewRef = (node) => {
@@ -15,10 +15,10 @@ const createMark = (markType, backgroundProperty, sharedColorGenerator) => {
15
15
  getAttrs: ({ dataset }) => {
16
16
  return {
17
17
  id: dataset.id || false,
18
- meta: Object.keys(dataset).filter((key) => key !== "id" && dataset[key] !== "false").reduce((out, key) => ({
19
- ...out,
20
- [key]: preserveBool(JSON.parse(dataset[key]))
21
- }), { type: markType })
18
+ meta: {
19
+ type: markType,
20
+ ...Object.fromEntries(Object.keys(dataset).filter((key) => key !== "id" && dataset[key] !== "false").map((key) => [key, preserveBool(JSON.parse(dataset[key]))]))
21
+ }
22
22
  };
23
23
  }
24
24
  }],
@@ -126,7 +126,7 @@ const modification = {
126
126
  "data-type": "modification",
127
127
  ...suggestionDomAttrs(mark),
128
128
  "data-mod-type": String(mark.attrs.type),
129
- ...mark.attrs.attrName !== null ? { "data-mod-attr-name": String(mark.attrs.attrName) } : {},
129
+ ...mark.attrs.attrName !== null && { "data-mod-attr-name": String(mark.attrs.attrName) },
130
130
  "data-mod-prev-val": JSON.stringify(mark.attrs.previousValue ?? null),
131
131
  "data-mod-new-val": JSON.stringify(mark.attrs.newValue ?? null)
132
132
  },
@@ -163,7 +163,7 @@ const blockBoundarySuggestion = {
163
163
  {
164
164
  "data-type": "block-boundary-suggestion",
165
165
  ...suggestionDomAttrs(mark),
166
- ...mark.attrs.type !== null ? { "data-change-type": String(mark.attrs.type) } : {}
166
+ ...mark.attrs.type !== null && { "data-change-type": String(mark.attrs.type) }
167
167
  },
168
168
  0
169
169
  ],
@@ -10,8 +10,8 @@ function toBoolean(attr) {
10
10
  }
11
11
  function toNumberOrNull(value) {
12
12
  if (!value) return null;
13
- const parsed = parseFloat(value);
14
- return isNaN(parsed) ? null : parsed;
13
+ const parsed = Number.parseFloat(value);
14
+ return Number.isNaN(parsed) ? null : parsed;
15
15
  }
16
16
  const makeMedia = ({ mediaToDom }) => ({
17
17
  inline: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fibery/prosemirror-schema",
3
- "version": "7.1.0",
3
+ "version": "7.1.1",
4
4
  "description": "Fibery prosemirror schema",
5
5
  "license": "UNLICENSED",
6
6
  "files": [
@@ -17,7 +17,7 @@
17
17
  }
18
18
  },
19
19
  "dependencies": {
20
- "@fibery/helpers": "7.0.0",
20
+ "@fibery/helpers": "7.1.0",
21
21
  "prosemirror-model": "1.25.4",
22
22
  "prosemirror-schema-basic": "1.2.2",
23
23
  "prosemirror-schema-list": "1.5.1",