@measured/puck 0.21.0-canary.16a3eee1 → 0.21.0-canary.1df9ddeb

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.
@@ -856,6 +856,10 @@ var monitorHotkeys = (doc) => {
856
856
  useHotkeyStore.getState().reset();
857
857
  }
858
858
  };
859
+ const onBlur = () => {
860
+ useHotkeyStore.getState().reset();
861
+ };
862
+ window.addEventListener("blur", onBlur);
859
863
  doc.addEventListener("keydown", onKeyDown);
860
864
  doc.addEventListener("keyup", onKeyUp);
861
865
  doc.addEventListener("visibilitychange", onVisibilityChanged);
@@ -863,6 +867,7 @@ var monitorHotkeys = (doc) => {
863
867
  doc.removeEventListener("keydown", onKeyDown);
864
868
  doc.removeEventListener("keyup", onKeyUp);
865
869
  doc.removeEventListener("visibilitychange", onVisibilityChanged);
870
+ window.removeEventListener("blur", onBlur);
866
871
  };
867
872
  };
868
873
  var useMonitorHotkeys = () => {
@@ -5674,26 +5679,26 @@ var registerOverlayPortal = (el, opts = {}) => {
5674
5679
  capture: true
5675
5680
  });
5676
5681
  };
5677
- if (disableDragOnFocus) {
5678
- el.addEventListener("focus", onFocus, { capture: true });
5679
- el.addEventListener("blur", onBlur, { capture: true });
5680
- } else if (disableDrag) {
5682
+ if (disableDrag) {
5681
5683
  el.addEventListener("pointerdown", stopPropagation, {
5682
5684
  capture: true
5683
5685
  });
5686
+ } else if (disableDragOnFocus) {
5687
+ el.addEventListener("focus", onFocus, { capture: true });
5688
+ el.addEventListener("blur", onBlur, { capture: true });
5684
5689
  }
5685
5690
  el.setAttribute("data-puck-overlay-portal", "true");
5686
5691
  return () => {
5687
5692
  el.removeEventListener("mouseover", stopPropagation, {
5688
5693
  capture: true
5689
5694
  });
5690
- if (disableDragOnFocus) {
5691
- el.removeEventListener("focus", onFocus, { capture: true });
5692
- el.removeEventListener("blur", onFocus, { capture: true });
5693
- } else if (disableDrag) {
5695
+ if (disableDrag) {
5694
5696
  el.removeEventListener("pointerdown", stopPropagation, {
5695
5697
  capture: true
5696
5698
  });
5699
+ } else if (disableDragOnFocus) {
5700
+ el.removeEventListener("focus", onFocus, { capture: true });
5701
+ el.removeEventListener("blur", onBlur, { capture: true });
5697
5702
  }
5698
5703
  el.removeAttribute("data-puck-overlay-portal");
5699
5704
  };
@@ -5701,7 +5706,7 @@ var registerOverlayPortal = (el, opts = {}) => {
5701
5706
 
5702
5707
  // css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css#css-module
5703
5708
  init_react_import();
5704
- var styles_module_default13 = { "InlineTextField": "_InlineTextField_1xph6_1" };
5709
+ var styles_module_default13 = { "InlineTextField": "_InlineTextField_104qp_1" };
5705
5710
 
5706
5711
  // lib/data/set-deep.ts
5707
5712
  init_react_import();
package/dist/index.css CHANGED
@@ -1331,16 +1331,17 @@ body:has(._DropZone--isAnimating_1i2sv_68:empty) [data-puck-overlay] {
1331
1331
  }
1332
1332
 
1333
1333
  /* css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css/#css-module-data */
1334
- ._InlineTextField_1xph6_1 {
1334
+ ._InlineTextField_104qp_1 {
1335
1335
  cursor: text;
1336
1336
  display: inline-block;
1337
1337
  white-space: pre-wrap;
1338
+ text-decoration: inherit;
1338
1339
  }
1339
- [data-dnd-dragging] ._InlineTextField_1xph6_1 {
1340
+ [data-dnd-dragging] ._InlineTextField_104qp_1 {
1340
1341
  cursor: none;
1341
1342
  caret-color: transparent;
1342
1343
  }
1343
- [data-dnd-dragging] ._InlineTextField_1xph6_1::selection {
1344
+ [data-dnd-dragging] ._InlineTextField_104qp_1::selection {
1344
1345
  display: none;
1345
1346
  }
1346
1347
 
package/dist/index.js CHANGED
@@ -1749,6 +1749,10 @@ var monitorHotkeys = (doc) => {
1749
1749
  useHotkeyStore.getState().reset();
1750
1750
  }
1751
1751
  };
1752
+ const onBlur = () => {
1753
+ useHotkeyStore.getState().reset();
1754
+ };
1755
+ window.addEventListener("blur", onBlur);
1752
1756
  doc.addEventListener("keydown", onKeyDown);
1753
1757
  doc.addEventListener("keyup", onKeyUp);
1754
1758
  doc.addEventListener("visibilitychange", onVisibilityChanged);
@@ -1756,6 +1760,7 @@ var monitorHotkeys = (doc) => {
1756
1760
  doc.removeEventListener("keydown", onKeyDown);
1757
1761
  doc.removeEventListener("keyup", onKeyUp);
1758
1762
  doc.removeEventListener("visibilitychange", onVisibilityChanged);
1763
+ window.removeEventListener("blur", onBlur);
1759
1764
  };
1760
1765
  };
1761
1766
  var useMonitorHotkeys = () => {
@@ -5571,26 +5576,26 @@ var registerOverlayPortal = (el, opts = {}) => {
5571
5576
  capture: true
5572
5577
  });
5573
5578
  };
5574
- if (disableDragOnFocus) {
5575
- el.addEventListener("focus", onFocus, { capture: true });
5576
- el.addEventListener("blur", onBlur, { capture: true });
5577
- } else if (disableDrag) {
5579
+ if (disableDrag) {
5578
5580
  el.addEventListener("pointerdown", stopPropagation, {
5579
5581
  capture: true
5580
5582
  });
5583
+ } else if (disableDragOnFocus) {
5584
+ el.addEventListener("focus", onFocus, { capture: true });
5585
+ el.addEventListener("blur", onBlur, { capture: true });
5581
5586
  }
5582
5587
  el.setAttribute("data-puck-overlay-portal", "true");
5583
5588
  return () => {
5584
5589
  el.removeEventListener("mouseover", stopPropagation, {
5585
5590
  capture: true
5586
5591
  });
5587
- if (disableDragOnFocus) {
5588
- el.removeEventListener("focus", onFocus, { capture: true });
5589
- el.removeEventListener("blur", onFocus, { capture: true });
5590
- } else if (disableDrag) {
5592
+ if (disableDrag) {
5591
5593
  el.removeEventListener("pointerdown", stopPropagation, {
5592
5594
  capture: true
5593
5595
  });
5596
+ } else if (disableDragOnFocus) {
5597
+ el.removeEventListener("focus", onFocus, { capture: true });
5598
+ el.removeEventListener("blur", onBlur, { capture: true });
5594
5599
  }
5595
5600
  el.removeAttribute("data-puck-overlay-portal");
5596
5601
  };
@@ -5598,7 +5603,7 @@ var registerOverlayPortal = (el, opts = {}) => {
5598
5603
 
5599
5604
  // css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css#css-module
5600
5605
  init_react_import();
5601
- var styles_module_default13 = { "InlineTextField": "_InlineTextField_1xph6_1" };
5606
+ var styles_module_default13 = { "InlineTextField": "_InlineTextField_104qp_1" };
5602
5607
 
5603
5608
  // lib/data/set-deep.ts
5604
5609
  init_react_import();
package/dist/index.mjs CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  setDeep,
19
19
  useGetPuck,
20
20
  usePuck
21
- } from "./chunk-JZ2BPCUI.mjs";
21
+ } from "./chunk-KHAM6QNU.mjs";
22
22
  import {
23
23
  init_react_import,
24
24
  migrate,
@@ -1329,16 +1329,17 @@ body:has(._DropZone--isAnimating_1i2sv_68:empty) [data-puck-overlay] {
1329
1329
  }
1330
1330
 
1331
1331
  /* css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css/#css-module-data */
1332
- ._InlineTextField_1xph6_1 {
1332
+ ._InlineTextField_104qp_1 {
1333
1333
  cursor: text;
1334
1334
  display: inline-block;
1335
1335
  white-space: pre-wrap;
1336
+ text-decoration: inherit;
1336
1337
  }
1337
- [data-dnd-dragging] ._InlineTextField_1xph6_1 {
1338
+ [data-dnd-dragging] ._InlineTextField_104qp_1 {
1338
1339
  cursor: none;
1339
1340
  caret-color: transparent;
1340
1341
  }
1341
- [data-dnd-dragging] ._InlineTextField_1xph6_1::selection {
1342
+ [data-dnd-dragging] ._InlineTextField_104qp_1::selection {
1342
1343
  display: none;
1343
1344
  }
1344
1345
 
@@ -1749,6 +1749,10 @@ var monitorHotkeys = (doc) => {
1749
1749
  useHotkeyStore.getState().reset();
1750
1750
  }
1751
1751
  };
1752
+ const onBlur = () => {
1753
+ useHotkeyStore.getState().reset();
1754
+ };
1755
+ window.addEventListener("blur", onBlur);
1752
1756
  doc.addEventListener("keydown", onKeyDown);
1753
1757
  doc.addEventListener("keyup", onKeyUp);
1754
1758
  doc.addEventListener("visibilitychange", onVisibilityChanged);
@@ -1756,6 +1760,7 @@ var monitorHotkeys = (doc) => {
1756
1760
  doc.removeEventListener("keydown", onKeyDown);
1757
1761
  doc.removeEventListener("keyup", onKeyUp);
1758
1762
  doc.removeEventListener("visibilitychange", onVisibilityChanged);
1763
+ window.removeEventListener("blur", onBlur);
1759
1764
  };
1760
1765
  };
1761
1766
  var useMonitorHotkeys = () => {
@@ -5571,26 +5576,26 @@ var registerOverlayPortal = (el, opts = {}) => {
5571
5576
  capture: true
5572
5577
  });
5573
5578
  };
5574
- if (disableDragOnFocus) {
5575
- el.addEventListener("focus", onFocus, { capture: true });
5576
- el.addEventListener("blur", onBlur, { capture: true });
5577
- } else if (disableDrag) {
5579
+ if (disableDrag) {
5578
5580
  el.addEventListener("pointerdown", stopPropagation, {
5579
5581
  capture: true
5580
5582
  });
5583
+ } else if (disableDragOnFocus) {
5584
+ el.addEventListener("focus", onFocus, { capture: true });
5585
+ el.addEventListener("blur", onBlur, { capture: true });
5581
5586
  }
5582
5587
  el.setAttribute("data-puck-overlay-portal", "true");
5583
5588
  return () => {
5584
5589
  el.removeEventListener("mouseover", stopPropagation, {
5585
5590
  capture: true
5586
5591
  });
5587
- if (disableDragOnFocus) {
5588
- el.removeEventListener("focus", onFocus, { capture: true });
5589
- el.removeEventListener("blur", onFocus, { capture: true });
5590
- } else if (disableDrag) {
5592
+ if (disableDrag) {
5591
5593
  el.removeEventListener("pointerdown", stopPropagation, {
5592
5594
  capture: true
5593
5595
  });
5596
+ } else if (disableDragOnFocus) {
5597
+ el.removeEventListener("focus", onFocus, { capture: true });
5598
+ el.removeEventListener("blur", onBlur, { capture: true });
5594
5599
  }
5595
5600
  el.removeAttribute("data-puck-overlay-portal");
5596
5601
  };
@@ -5598,7 +5603,7 @@ var registerOverlayPortal = (el, opts = {}) => {
5598
5603
 
5599
5604
  // css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css#css-module
5600
5605
  init_react_import();
5601
- var styles_module_default13 = { "InlineTextField": "_InlineTextField_1xph6_1" };
5606
+ var styles_module_default13 = { "InlineTextField": "_InlineTextField_104qp_1" };
5602
5607
 
5603
5608
  // lib/data/set-deep.ts
5604
5609
  init_react_import();
@@ -18,7 +18,7 @@ import {
18
18
  setDeep,
19
19
  useGetPuck,
20
20
  usePuck
21
- } from "./chunk-JZ2BPCUI.mjs";
21
+ } from "./chunk-KHAM6QNU.mjs";
22
22
  import {
23
23
  init_react_import,
24
24
  migrate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.21.0-canary.16a3eee1",
3
+ "version": "0.21.0-canary.1df9ddeb",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Chris Villa <chris@puckeditor.com>",
6
6
  "repository": "measuredco/puck",