@bbl-digital/snorre 3.0.39 → 3.0.41

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/bundle.js CHANGED
@@ -32156,20 +32156,8 @@
32156
32156
 
32157
32157
  const toolbar = type === 'basic' ? basicToolbar : type === 'rich' ? richToolbar : customToolbar;
32158
32158
  React.useEffect(() => {
32159
- const editor = editorRef?.current;
32160
- if (!editor) return;
32161
-
32162
- if (overrideValue === null) {
32163
- editor.setContent('', {
32164
- no_selection: true
32165
- });
32166
- return;
32167
- }
32168
-
32169
- if (!overrideValue?.length) return;
32170
- editor.setContent(overrideValue, {
32171
- no_selection: true
32172
- }); // eslint-disable-next-line react-hooks/exhaustive-deps
32159
+ if (!overrideValue) return;
32160
+ setValue(() => overrideValue); // eslint-disable-next-line react-hooks/exhaustive-deps
32173
32161
  }, [overrideValue]);
32174
32162
  return jsxRuntime$1.jsxs("div", {
32175
32163
  css: theme => [styles$3.default(theme), !loaded && styles$3.hideEditor],
@@ -52,20 +52,8 @@ const Editor = ({
52
52
 
53
53
  const toolbar = type === 'basic' ? basicToolbar : type === 'rich' ? richToolbar : customToolbar;
54
54
  useEffect(() => {
55
- const editor = editorRef?.current;
56
- if (!editor) return;
57
-
58
- if (overrideValue === null) {
59
- editor.setContent('', {
60
- no_selection: true
61
- });
62
- return;
63
- }
64
-
65
- if (!overrideValue?.length) return;
66
- editor.setContent(overrideValue, {
67
- no_selection: true
68
- }); // eslint-disable-next-line react-hooks/exhaustive-deps
55
+ if (!overrideValue) return;
56
+ setValue(() => overrideValue); // eslint-disable-next-line react-hooks/exhaustive-deps
69
57
  }, [overrideValue]);
70
58
  return _jsxs("div", {
71
59
  css: theme => [styles.default(theme), !loaded && styles.hideEditor],
@@ -4,7 +4,7 @@ interface IProps {
4
4
  /** Input text */
5
5
  initialValue?: string;
6
6
  /** Input text that overrides the initialValue or already existing text value, if null is sent in we reset the field */
7
- overrideValue?: string | null;
7
+ overrideValue?: string;
8
8
  /** Editor type, defaults to basic */
9
9
  type?: 'basic' | 'rich' | 'custom';
10
10
  /** Adds a custom toolbar if type is set to custom */
@@ -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;AAmBpC,UAAU,MAAM;IACd,iBAAiB;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,wHAAwH;IACxH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,qCAAqC;IACrC,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAA;IAClC,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oBAAoB;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,8BAA8B;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACzB,2EAA2E;IAC3E,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,mDAAmD;IACnD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iBAAiB;IACjB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,mBAAmB;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,eA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,eAAe,EAAE,MAAM,KAAK,IAAI,CAAA;CAC3D;AAID,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,MAAM,CAmHtB,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -52,20 +52,8 @@ const Editor = ({
52
52
 
53
53
  const toolbar = type === 'basic' ? basicToolbar : type === 'rich' ? richToolbar : customToolbar;
54
54
  useEffect(() => {
55
- const editor = editorRef?.current;
56
- if (!editor) return;
57
-
58
- if (overrideValue === null) {
59
- editor.setContent('', {
60
- no_selection: true
61
- });
62
- return;
63
- }
64
-
65
- if (!overrideValue?.length) return;
66
- editor.setContent(overrideValue, {
67
- no_selection: true
68
- }); // eslint-disable-next-line react-hooks/exhaustive-deps
55
+ if (!overrideValue) return;
56
+ setValue(() => overrideValue); // eslint-disable-next-line react-hooks/exhaustive-deps
69
57
  }, [overrideValue]);
70
58
  return _jsxs("div", {
71
59
  css: theme => [styles.default(theme), !loaded && styles.hideEditor],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbl-digital/snorre",
3
- "version": "3.0.39",
3
+ "version": "3.0.41",
4
4
  "description": "Design library for BBL Digital",
5
5
  "license": "MIT",
6
6
  "main": "./lib/index.js",