@bbl-digital/snorre 3.0.37 → 3.0.39
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bundle.js +12 -6
- package/esm/core/Editor/index.js +12 -6
- package/lib/core/Editor/index.d.ts.map +1 -1
- package/lib/core/Editor/index.js +12 -6
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
@@ -32152,20 +32152,24 @@
|
|
32152
32152
|
}).length);
|
32153
32153
|
};
|
32154
32154
|
|
32155
|
-
const handleBlur = () => onBlur
|
32155
|
+
const handleBlur = () => onBlur?.(value);
|
32156
32156
|
|
32157
32157
|
const toolbar = type === 'basic' ? basicToolbar : type === 'rich' ? richToolbar : customToolbar;
|
32158
32158
|
React.useEffect(() => {
|
32159
|
-
const editor = editorRef
|
32159
|
+
const editor = editorRef?.current;
|
32160
32160
|
if (!editor) return;
|
32161
32161
|
|
32162
32162
|
if (overrideValue === null) {
|
32163
|
-
editor
|
32163
|
+
editor.setContent('', {
|
32164
|
+
no_selection: true
|
32165
|
+
});
|
32164
32166
|
return;
|
32165
32167
|
}
|
32166
32168
|
|
32167
32169
|
if (!overrideValue?.length) return;
|
32168
|
-
editor.
|
32170
|
+
editor.setContent(overrideValue, {
|
32171
|
+
no_selection: true
|
32172
|
+
}); // eslint-disable-next-line react-hooks/exhaustive-deps
|
32169
32173
|
}, [overrideValue]);
|
32170
32174
|
return jsxRuntime$1.jsxs("div", {
|
32171
32175
|
css: theme => [styles$3.default(theme), !loaded && styles$3.hideEditor],
|
@@ -32174,9 +32178,11 @@
|
|
32174
32178
|
}), jsxRuntime$1.jsx("div", {
|
32175
32179
|
className: "editor-wrapper",
|
32176
32180
|
children: jsxRuntime$1.jsx(tinymceReact.Editor, {
|
32177
|
-
ref: editorRef,
|
32178
32181
|
onBlur: handleBlur,
|
32179
|
-
onInit: () =>
|
32182
|
+
onInit: (_e, editor) => {
|
32183
|
+
setLoaded(true);
|
32184
|
+
editorRef.current = editor;
|
32185
|
+
},
|
32180
32186
|
apiKey: TINYMCE_API_KEY,
|
32181
32187
|
value: value,
|
32182
32188
|
onEditorChange: handleChange,
|
package/esm/core/Editor/index.js
CHANGED
@@ -48,20 +48,24 @@ const Editor = ({
|
|
48
48
|
}).length);
|
49
49
|
};
|
50
50
|
|
51
|
-
const handleBlur = () => onBlur
|
51
|
+
const handleBlur = () => onBlur?.(value);
|
52
52
|
|
53
53
|
const toolbar = type === 'basic' ? basicToolbar : type === 'rich' ? richToolbar : customToolbar;
|
54
54
|
useEffect(() => {
|
55
|
-
const editor = editorRef
|
55
|
+
const editor = editorRef?.current;
|
56
56
|
if (!editor) return;
|
57
57
|
|
58
58
|
if (overrideValue === null) {
|
59
|
-
editor
|
59
|
+
editor.setContent('', {
|
60
|
+
no_selection: true
|
61
|
+
});
|
60
62
|
return;
|
61
63
|
}
|
62
64
|
|
63
65
|
if (!overrideValue?.length) return;
|
64
|
-
editor.
|
66
|
+
editor.setContent(overrideValue, {
|
67
|
+
no_selection: true
|
68
|
+
}); // eslint-disable-next-line react-hooks/exhaustive-deps
|
65
69
|
}, [overrideValue]);
|
66
70
|
return _jsxs("div", {
|
67
71
|
css: theme => [styles.default(theme), !loaded && styles.hideEditor],
|
@@ -70,9 +74,11 @@ const Editor = ({
|
|
70
74
|
}), _jsx("div", {
|
71
75
|
className: "editor-wrapper",
|
72
76
|
children: _jsx(TinyEditor, {
|
73
|
-
ref: editorRef,
|
74
77
|
onBlur: handleBlur,
|
75
|
-
onInit: () =>
|
78
|
+
onInit: (_e, editor) => {
|
79
|
+
setLoaded(true);
|
80
|
+
editorRef.current = editor;
|
81
|
+
},
|
76
82
|
apiKey: TINYMCE_API_KEY,
|
77
83
|
value: value,
|
78
84
|
onEditorChange: handleChange,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Editor/index.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"index.d.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lib/core/Editor/index.js
CHANGED
@@ -48,20 +48,24 @@ const Editor = ({
|
|
48
48
|
}).length);
|
49
49
|
};
|
50
50
|
|
51
|
-
const handleBlur = () => onBlur
|
51
|
+
const handleBlur = () => onBlur?.(value);
|
52
52
|
|
53
53
|
const toolbar = type === 'basic' ? basicToolbar : type === 'rich' ? richToolbar : customToolbar;
|
54
54
|
useEffect(() => {
|
55
|
-
const editor = editorRef
|
55
|
+
const editor = editorRef?.current;
|
56
56
|
if (!editor) return;
|
57
57
|
|
58
58
|
if (overrideValue === null) {
|
59
|
-
editor
|
59
|
+
editor.setContent('', {
|
60
|
+
no_selection: true
|
61
|
+
});
|
60
62
|
return;
|
61
63
|
}
|
62
64
|
|
63
65
|
if (!overrideValue?.length) return;
|
64
|
-
editor.
|
66
|
+
editor.setContent(overrideValue, {
|
67
|
+
no_selection: true
|
68
|
+
}); // eslint-disable-next-line react-hooks/exhaustive-deps
|
65
69
|
}, [overrideValue]);
|
66
70
|
return _jsxs("div", {
|
67
71
|
css: theme => [styles.default(theme), !loaded && styles.hideEditor],
|
@@ -70,9 +74,11 @@ const Editor = ({
|
|
70
74
|
}), _jsx("div", {
|
71
75
|
className: "editor-wrapper",
|
72
76
|
children: _jsx(TinyEditor, {
|
73
|
-
ref: editorRef,
|
74
77
|
onBlur: handleBlur,
|
75
|
-
onInit: () =>
|
78
|
+
onInit: (_e, editor) => {
|
79
|
+
setLoaded(true);
|
80
|
+
editorRef.current = editor;
|
81
|
+
},
|
76
82
|
apiKey: TINYMCE_API_KEY,
|
77
83
|
value: value,
|
78
84
|
onEditorChange: handleChange,
|