@websline/system-components 1.3.13 → 1.3.14

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.
@@ -47,6 +47,7 @@
47
47
  /** @type {import("@tiptap/core").Editor} */
48
48
  let editor = $state.raw();
49
49
  let htmlInputValue = $state();
50
+ let isContentPropUpdate = false;
50
51
 
51
52
  let styles = $derived(richTextEditorVariants({ hideToolbar, size }));
52
53
 
@@ -97,7 +98,14 @@
97
98
  },
98
99
  onUpdate: () => {
99
100
  htmlInputValue = editor.getHTML();
100
- oninput?.(htmlInputValue);
101
+
102
+ if (!isContentPropUpdate) {
103
+ // inform parent about editor input
104
+ // skip prop update
105
+ oninput?.(htmlInputValue);
106
+ } else {
107
+ isContentPropUpdate = false;
108
+ }
101
109
  },
102
110
  });
103
111
 
@@ -118,6 +126,7 @@
118
126
  content;
119
127
  if (editor) {
120
128
  const sanitized = untrack(() => sanitizeContent(content));
129
+ isContentPropUpdate = true;
121
130
  editor.commands.setContent(sanitized ?? "");
122
131
  }
123
132
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websline/system-components",
3
- "version": "1.3.13",
3
+ "version": "1.3.14",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },