@lazlon-platform/html-editor 0.3.3 → 0.3.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.
@@ -12,8 +12,8 @@ export type EditableNodeProps = NodeProps &
12
12
 
13
13
  export abstract class EditableNode extends Node {
14
14
  @state accessor contentRef: HTMLElement | null = null
15
- @state private accessor _isEmpty: boolean
16
- @state private accessor _content: JSONContent
15
+ @state private accessor _isEmpty: boolean = true
16
+ @state private accessor _content: JSONContent = { type: "doc", content: [] }
17
17
 
18
18
  @state accessor lineHeight: number
19
19
 
@@ -22,6 +22,7 @@ export abstract class EditableNode extends Node {
22
22
  emitUpdate: false,
23
23
  })
24
24
  this._content = this.tiptap.getJSON()
25
+ this._isEmpty = this.tiptap.isEmpty
25
26
  }
26
27
 
27
28
  @computed get content() {
@@ -56,10 +57,8 @@ export abstract class EditableNode extends Node {
56
57
  { content, lineHeight, ...props }: EditableNodeProps,
57
58
  ) {
58
59
  super(editor, page, props)
59
- this._content = content ?? { type: "doc", content: [] }
60
- this._isEmpty = this.tiptap.isEmpty
61
60
  this.lineHeight = lineHeight ?? 1.2
62
- this.content = this._content
61
+ this.content = content ?? { type: "doc", content: [] }
63
62
  }
64
63
 
65
64
  blockMove(event: React.PointerEvent): boolean {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazlon-platform/html-editor",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "lib"