@bbl-digital/snorre 4.1.3 → 4.1.5

Sign up to get free protection for your applications and to get access to all the features.
package/dist/bundle.js CHANGED
@@ -35594,6 +35594,12 @@ to {top: 100vh;}
35594
35594
  });
35595
35595
  // Move the last binding in the list, to the top. Ensure that the custom binding is called first.
35596
35596
  quillInstance.keyboard.bindings['Backspace'].unshift(quillInstance.keyboard.bindings['Backspace'].pop());
35597
+ quillInstance.keyboard.addBinding({
35598
+ key: 'Escape'
35599
+ }, () => {
35600
+ // Remove focus from editor
35601
+ quillInstance.blur();
35602
+ });
35597
35603
  if (initialValue !== undefined) {
35598
35604
  if (quillInstance.root.innerHTML !== initialValue) {
35599
35605
  const delta = quillInstance.clipboard.convert({
@@ -35646,18 +35652,18 @@ to {top: 100vh;}
35646
35652
  if (!quill) return;
35647
35653
  quill.on('text-change', handleChange);
35648
35654
  quill.on('selection-change', (range, oldRange, source) => {
35655
+ // onSelectionChange && onSelectionChange(range, source, quill)
35649
35656
  if (range) {
35650
35657
  handelFocus();
35651
35658
  } else {
35652
35659
  handleBlur();
35653
35660
  }
35654
- onSelectionChange && onSelectionChange(range, source, quill);
35655
35661
  });
35656
35662
  return () => {
35657
35663
  quill.off('text-change', handleChange);
35658
35664
  quill.off('selection-change');
35659
35665
  };
35660
- }, [quill?.container]);
35666
+ }, [quill]);
35661
35667
  return jsxRuntime.jsxs("div", {
35662
35668
  css: theme => [styles.default(theme, maxHeight)],
35663
35669
  children: [label && jsxRuntime.jsx(Label, {
@@ -191,6 +191,12 @@ const QuillEditor = ({
191
191
  });
192
192
  // Move the last binding in the list, to the top. Ensure that the custom binding is called first.
193
193
  quillInstance.keyboard.bindings['Backspace'].unshift(quillInstance.keyboard.bindings['Backspace'].pop());
194
+ quillInstance.keyboard.addBinding({
195
+ key: 'Escape'
196
+ }, () => {
197
+ // Remove focus from editor
198
+ quillInstance.blur();
199
+ });
194
200
  if (initialValue !== undefined) {
195
201
  if (quillInstance.root.innerHTML !== initialValue) {
196
202
  const delta = quillInstance.clipboard.convert({
@@ -243,18 +249,18 @@ const QuillEditor = ({
243
249
  if (!quill) return;
244
250
  quill.on('text-change', handleChange);
245
251
  quill.on('selection-change', (range, oldRange, source) => {
252
+ // onSelectionChange && onSelectionChange(range, source, quill)
246
253
  if (range) {
247
254
  handelFocus();
248
255
  } else {
249
256
  handleBlur();
250
257
  }
251
- onSelectionChange && onSelectionChange(range, source, quill);
252
258
  });
253
259
  return () => {
254
260
  quill.off('text-change', handleChange);
255
261
  quill.off('selection-change');
256
262
  };
257
- }, [quill?.container]);
263
+ }, [quill]);
258
264
  return _jsxs("div", {
259
265
  css: theme => [styles.default(theme, maxHeight)],
260
266
  children: [label && _jsx(Label, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/QuillEditor/index.tsx"],"names":[],"mappings":"AAGA,OAAO,2BAA2B,CAAA;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AA+D3C,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAoQ3C,CAAA;AAED,eAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/QuillEditor/index.tsx"],"names":[],"mappings":"AAGA,OAAO,2BAA2B,CAAA;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AA+D3C,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAwQ3C,CAAA;AAED,eAAe,WAAW,CAAA"}
@@ -191,6 +191,12 @@ const QuillEditor = ({
191
191
  });
192
192
  // Move the last binding in the list, to the top. Ensure that the custom binding is called first.
193
193
  quillInstance.keyboard.bindings['Backspace'].unshift(quillInstance.keyboard.bindings['Backspace'].pop());
194
+ quillInstance.keyboard.addBinding({
195
+ key: 'Escape'
196
+ }, () => {
197
+ // Remove focus from editor
198
+ quillInstance.blur();
199
+ });
194
200
  if (initialValue !== undefined) {
195
201
  if (quillInstance.root.innerHTML !== initialValue) {
196
202
  const delta = quillInstance.clipboard.convert({
@@ -243,18 +249,18 @@ const QuillEditor = ({
243
249
  if (!quill) return;
244
250
  quill.on('text-change', handleChange);
245
251
  quill.on('selection-change', (range, oldRange, source) => {
252
+ // onSelectionChange && onSelectionChange(range, source, quill)
246
253
  if (range) {
247
254
  handelFocus();
248
255
  } else {
249
256
  handleBlur();
250
257
  }
251
- onSelectionChange && onSelectionChange(range, source, quill);
252
258
  });
253
259
  return () => {
254
260
  quill.off('text-change', handleChange);
255
261
  quill.off('selection-change');
256
262
  };
257
- }, [quill?.container]);
263
+ }, [quill]);
258
264
  return _jsxs("div", {
259
265
  css: theme => [styles.default(theme, maxHeight)],
260
266
  children: [label && _jsx(Label, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbl-digital/snorre",
3
- "version": "4.1.3",
3
+ "version": "4.1.5",
4
4
  "description": "Design library for BBL Digital",
5
5
  "license": "MIT",
6
6
  "main": "./lib/index.js",