@zipify/wysiwyg 2.0.0-4 → 2.0.0-5

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/wysiwyg.mjs CHANGED
@@ -21024,8 +21024,8 @@ iterateNodes_fn2 = function(handler) {
21024
21024
  _iterateChildNodes = new WeakSet();
21025
21025
  iterateChildNodes_fn = function(node, handler) {
21026
21026
  for (const child of node.content) {
21027
- handler.call(this, child);
21028
21027
  child.content && __privateMethod(this, _iterateChildNodes, iterateChildNodes_fn).call(this, child, handler);
21028
+ handler.call(this, child);
21029
21029
  }
21030
21030
  };
21031
21031
  _bubbleMarks = new WeakSet();
@@ -21056,6 +21056,8 @@ canBubbleMark_fn = function(node, childMark) {
21056
21056
  if (__privateMethod(this, _includesMarkType, includesMarkType_fn).call(this, node, childMark.type))
21057
21057
  return false;
21058
21058
  for (const child of node.content) {
21059
+ if (!child.content && node.type === NodeTypes.LIST_ITEM)
21060
+ continue;
21059
21061
  if (!child.marks)
21060
21062
  return false;
21061
21063
  if (!__privateMethod(this, _includesMark, includesMark_fn).call(this, child, childMark))
@@ -14,8 +14,8 @@ export class JsonNormalizer extends BaseNormalizer {
14
14
 
15
15
  #iterateChildNodes(node, handler) {
16
16
  for (const child of node.content) {
17
- handler.call(this, child);
18
17
  child.content && this.#iterateChildNodes(child, handler);
18
+ handler.call(this, child);
19
19
  }
20
20
  }
21
21
 
@@ -45,6 +45,7 @@ export class JsonNormalizer extends BaseNormalizer {
45
45
  if (this.#includesMarkType(node, childMark.type)) return false;
46
46
 
47
47
  for (const child of node.content) {
48
+ if (!child.content && node.type === NodeTypes.LIST_ITEM) continue;
48
49
  if (!child.marks) return false;
49
50
  if (!this.#includesMark(child, childMark)) return false;
50
51
  }
@@ -34,9 +34,11 @@ describe('normalize json content', () => {
34
34
  test('should bubble mark from text to list item', () => {
35
35
  const input = NodeFactory.doc([
36
36
  NodeFactory.list(ListTypes.DISC, [
37
- NodeFactory.paragraph(null, [
38
- NodeFactory.mark(TextSettings.FONT_WEIGHT, { value: '700' })
39
- ], 'lorem ipsum')
37
+ NodeFactory.paragraph([
38
+ NodeFactory.text('lorem ipsum', [
39
+ NodeFactory.mark(TextSettings.FONT_WEIGHT, { value: '700' })
40
+ ])
41
+ ])
40
42
  ])
41
43
  ]);
42
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zipify/wysiwyg",
3
- "version": "2.0.0-4",
3
+ "version": "2.0.0-5",
4
4
  "description": "Zipify modification of TipTap text editor",
5
5
  "main": "dist/wysiwyg.mjs",
6
6
  "bin": {