@bbl-digital/snorre 3.0.41 → 3.0.42

Sign up to get free protection for your applications and to get access to all the features.
package/dist/bundle.js CHANGED
@@ -32137,7 +32137,6 @@
32137
32137
  onChange,
32138
32138
  onBlur
32139
32139
  }) => {
32140
- const editorRef = React.useRef(null);
32141
32140
  const [loaded, setLoaded] = React.useState(false);
32142
32141
  const [value, setValue] = React.useState(initialValue || '');
32143
32142
  const {
@@ -32156,7 +32155,7 @@
32156
32155
 
32157
32156
  const toolbar = type === 'basic' ? basicToolbar : type === 'rich' ? richToolbar : customToolbar;
32158
32157
  React.useEffect(() => {
32159
- if (!overrideValue) return;
32158
+ if (overrideValue === undefined) return;
32160
32159
  setValue(() => overrideValue); // eslint-disable-next-line react-hooks/exhaustive-deps
32161
32160
  }, [overrideValue]);
32162
32161
  return jsxRuntime$1.jsxs("div", {
@@ -32167,10 +32166,7 @@
32167
32166
  className: "editor-wrapper",
32168
32167
  children: jsxRuntime$1.jsx(tinymceReact.Editor, {
32169
32168
  onBlur: handleBlur,
32170
- onInit: (_e, editor) => {
32171
- setLoaded(true);
32172
- editorRef.current = editor;
32173
- },
32169
+ onInit: _e => setLoaded(true),
32174
32170
  apiKey: TINYMCE_API_KEY,
32175
32171
  value: value,
32176
32172
  onEditorChange: handleChange,
@@ -9,7 +9,6 @@ import IconErrorOutline from '../../icons/General/IconErrorOutline';
9
9
  import { useTheme } from '@emotion/react';
10
10
  import { useIsMobile } from '../../hooks/useIsMobile';
11
11
  import { useEffect } from 'react';
12
- import { useRef } from 'react';
13
12
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
14
13
  import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
15
14
  const TINYMCE_API_KEY = 'v1hbb9qthd0z2fr0keceoglnwbzhyjqwsj4q7n193ovikt8s';
@@ -33,7 +32,6 @@ const Editor = ({
33
32
  onChange,
34
33
  onBlur
35
34
  }) => {
36
- const editorRef = useRef(null);
37
35
  const [loaded, setLoaded] = useState(false);
38
36
  const [value, setValue] = useState(initialValue || '');
39
37
  const {
@@ -52,7 +50,7 @@ const Editor = ({
52
50
 
53
51
  const toolbar = type === 'basic' ? basicToolbar : type === 'rich' ? richToolbar : customToolbar;
54
52
  useEffect(() => {
55
- if (!overrideValue) return;
53
+ if (overrideValue === undefined) return;
56
54
  setValue(() => overrideValue); // eslint-disable-next-line react-hooks/exhaustive-deps
57
55
  }, [overrideValue]);
58
56
  return _jsxs("div", {
@@ -63,10 +61,7 @@ const Editor = ({
63
61
  className: "editor-wrapper",
64
62
  children: _jsx(TinyEditor, {
65
63
  onBlur: handleBlur,
66
- onInit: (_e, editor) => {
67
- setLoaded(true);
68
- editorRef.current = editor;
69
- },
64
+ onInit: _e => setLoaded(true),
70
65
  apiKey: TINYMCE_API_KEY,
71
66
  value: value,
72
67
  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;AAmBpC,UAAU,MAAM;IACd,iBAAiB;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,wHAAwH;IACxH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,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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AAW,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,eAAe,EAAE,MAAM,KAAK,IAAI,CAAA;CAC3D;AAID,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,MAAM,CA+GtB,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -9,7 +9,6 @@ import IconErrorOutline from '../../icons/General/IconErrorOutline';
9
9
  import { useTheme } from '@emotion/react';
10
10
  import { useIsMobile } from '../../hooks/useIsMobile';
11
11
  import { useEffect } from 'react';
12
- import { useRef } from 'react';
13
12
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
14
13
  import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
15
14
  const TINYMCE_API_KEY = 'v1hbb9qthd0z2fr0keceoglnwbzhyjqwsj4q7n193ovikt8s';
@@ -33,7 +32,6 @@ const Editor = ({
33
32
  onChange,
34
33
  onBlur
35
34
  }) => {
36
- const editorRef = useRef(null);
37
35
  const [loaded, setLoaded] = useState(false);
38
36
  const [value, setValue] = useState(initialValue || '');
39
37
  const {
@@ -52,7 +50,7 @@ const Editor = ({
52
50
 
53
51
  const toolbar = type === 'basic' ? basicToolbar : type === 'rich' ? richToolbar : customToolbar;
54
52
  useEffect(() => {
55
- if (!overrideValue) return;
53
+ if (overrideValue === undefined) return;
56
54
  setValue(() => overrideValue); // eslint-disable-next-line react-hooks/exhaustive-deps
57
55
  }, [overrideValue]);
58
56
  return _jsxs("div", {
@@ -63,10 +61,7 @@ const Editor = ({
63
61
  className: "editor-wrapper",
64
62
  children: _jsx(TinyEditor, {
65
63
  onBlur: handleBlur,
66
- onInit: (_e, editor) => {
67
- setLoaded(true);
68
- editorRef.current = editor;
69
- },
64
+ onInit: _e => setLoaded(true),
70
65
  apiKey: TINYMCE_API_KEY,
71
66
  value: value,
72
67
  onEditorChange: handleChange,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbl-digital/snorre",
3
- "version": "3.0.41",
3
+ "version": "3.0.42",
4
4
  "description": "Design library for BBL Digital",
5
5
  "license": "MIT",
6
6
  "main": "./lib/index.js",