@puckeditor/core 0.21.3-canary.d7750318 → 0.21.3

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.
Files changed (31) hide show
  1. package/README.md +1 -1
  2. package/dist/{Editor-EPSED64A.mjs → Editor-MCVDFQH6.mjs} +9 -9
  3. package/dist/{Editor-IQP25PUX.css → Editor-SWYBDXGU.css} +6 -15
  4. package/dist/{Render-CU35UAWV.mjs → Render-MJ563JES.mjs} +3 -0
  5. package/dist/{chunk-BOKX3EBR.mjs → chunk-4HOGLOEA.mjs} +1 -1
  6. package/dist/{chunk-YLLE6KXH.mjs → chunk-6XCJ3Y7O.mjs} +7 -2
  7. package/dist/{chunk-BCL7VBTL.mjs → chunk-DPDJ67KA.mjs} +1 -1
  8. package/dist/{chunk-G74MZKKD.mjs → chunk-HGJWUFLT.mjs} +9 -9
  9. package/dist/{chunk-U6THAD4G.mjs → chunk-LODTL5KW.mjs} +1 -1
  10. package/dist/{chunk-22UJFAFA.mjs → chunk-O7FT3KAM.mjs} +4 -4
  11. package/dist/{chunk-754HNMU2.mjs → chunk-SHVCBQDY.mjs} +2 -18
  12. package/dist/{chunk-WCC2G7U7.mjs → chunk-TDQEUXB2.mjs} +3 -3
  13. package/dist/{chunk-FOGDNETJ.mjs → chunk-X2ZFWNCU.mjs} +4 -5
  14. package/dist/{chunk-Y72HCWJK.mjs → chunk-YXFTA2VL.mjs} +24 -18
  15. package/dist/{chunk-K23YHISE.mjs → chunk-ZMTK7SMX.mjs} +1 -1
  16. package/dist/{full-N67EAB2Q.mjs → full-5QCBHXRC.mjs} +9 -9
  17. package/dist/{full-2GJTAAZE.css → full-FFFM5OTN.css} +6 -15
  18. package/dist/index.css +22 -30
  19. package/dist/index.js +22 -26
  20. package/dist/index.mjs +11 -11
  21. package/dist/internal.js +2 -12
  22. package/dist/internal.mjs +2 -2
  23. package/dist/{loaded-MIY725CK.mjs → loaded-54625GTL.mjs} +5 -5
  24. package/dist/{loaded-F37CNCVG.mjs → loaded-OMRIYZIQ.mjs} +5 -5
  25. package/dist/{loaded-H325ZSK5.mjs → loaded-Y4ZWZC55.mjs} +5 -5
  26. package/dist/no-external.css +22 -30
  27. package/dist/no-external.js +22 -26
  28. package/dist/no-external.mjs +11 -11
  29. package/dist/rsc.js +6 -18
  30. package/dist/rsc.mjs +3 -3
  31. package/package.json +1 -1
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  </picture>
10
10
  </a>
11
11
 
12
- _The visual editor for React_
12
+ _Create your own AI page builder_
13
13
 
14
14
  [Documentation](https://puckeditor.com/docs?utm_source=readme&utm_medium=code&utm_campaign=repo&utm_contents=docs_link) • [Demo](https://demo.puckeditor.com/edit?utm_source=readme&utm_medium=code&utm_campaign=repo&utm_contents=demo_link) • [Discord](https://discord.gg/V9mDAhuxyZ) • [Contributing](https://github.com/puckeditor/puck/blob/main/CONTRIBUTING.md)
15
15
 
@@ -4,20 +4,20 @@ import {
4
4
  import {
5
5
  EditorInner,
6
6
  LoadedRichTextMenu
7
- } from "./chunk-WCC2G7U7.mjs";
7
+ } from "./chunk-TDQEUXB2.mjs";
8
8
  import "./chunk-AOEDIUVK.mjs";
9
- import "./chunk-G74MZKKD.mjs";
10
- import "./chunk-BCL7VBTL.mjs";
11
- import "./chunk-K23YHISE.mjs";
12
- import "./chunk-U6THAD4G.mjs";
9
+ import "./chunk-HGJWUFLT.mjs";
10
+ import "./chunk-DPDJ67KA.mjs";
11
+ import "./chunk-ZMTK7SMX.mjs";
12
+ import "./chunk-LODTL5KW.mjs";
13
13
  import {
14
14
  useAppStore,
15
15
  useAppStoreApi
16
- } from "./chunk-22UJFAFA.mjs";
17
- import "./chunk-YLLE6KXH.mjs";
18
- import "./chunk-BOKX3EBR.mjs";
16
+ } from "./chunk-O7FT3KAM.mjs";
17
+ import "./chunk-6XCJ3Y7O.mjs";
18
+ import "./chunk-4HOGLOEA.mjs";
19
19
  import "./chunk-Y2EFNT5P.mjs";
20
- import "./chunk-754HNMU2.mjs";
20
+ import "./chunk-SHVCBQDY.mjs";
21
21
  import {
22
22
  __spreadProps,
23
23
  __spreadValues,
@@ -41,7 +41,7 @@
41
41
  }
42
42
 
43
43
  /* css-module:/home/runner/work/puck/puck/packages/core/components/IconButton/IconButton.module.css/#css-module-data */
44
- ._IconButton_ffob9_1 {
44
+ ._IconButton_1c68y_1 {
45
45
  align-items: center;
46
46
  background: transparent;
47
47
  border: none;
@@ -53,35 +53,26 @@
53
53
  padding: 4px;
54
54
  transition: background-color 50ms ease-in, color 50ms ease-in;
55
55
  }
56
- ._IconButton--active_ffob9_14 {
56
+ ._IconButton--active_1c68y_14 {
57
57
  color: var(--puck-color-azure-04);
58
58
  }
59
- ._IconButton_ffob9_1:focus-visible {
59
+ ._IconButton_1c68y_1:focus-visible {
60
60
  outline: 2px solid var(--puck-color-azure-05);
61
61
  outline-offset: -2px;
62
62
  }
63
63
  @media (hover: hover) and (pointer: fine) {
64
- ._IconButton_ffob9_1:hover:not(._IconButton--disabled_ffob9_24) {
64
+ ._IconButton_1c68y_1:hover:not(._IconButton--disabled_1c68y_24) {
65
65
  background: var(--puck-color-grey-10);
66
66
  color: var(--puck-color-azure-04);
67
67
  cursor: pointer;
68
68
  transition: none;
69
69
  }
70
70
  }
71
- ._IconButton_ffob9_1:active {
71
+ ._IconButton_1c68y_1:active {
72
72
  background: var(--puck-color-azure-11);
73
73
  transition: none;
74
74
  }
75
- ._IconButton-title_ffob9_37 {
76
- clip: rect(0 0 0 0);
77
- clip-path: inset(100%);
78
- height: 1px;
79
- overflow: hidden;
80
- position: absolute;
81
- white-space: nowrap;
82
- width: 1px;
83
- }
84
- ._IconButton--disabled_ffob9_24 {
75
+ ._IconButton--disabled_1c68y_24 {
85
76
  color: var(--puck-color-grey-07);
86
77
  }
87
78
 
@@ -32,6 +32,9 @@ function RichTextRender({
32
32
  return content;
33
33
  }
34
34
  if (typeof content === "string") {
35
+ if (!content) {
36
+ return { type: "doc", content: [] };
37
+ }
35
38
  const isHtml = /<\/?[a-z][\s\S]*>/i.test(content);
36
39
  if (isHtml) {
37
40
  return generateJSON(content, loadedExtensions);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  mapFields,
3
3
  toComponent
4
- } from "./chunk-754HNMU2.mjs";
4
+ } from "./chunk-SHVCBQDY.mjs";
5
5
  import {
6
6
  __async,
7
7
  __spreadProps,
@@ -1,10 +1,9 @@
1
1
  import {
2
- generateId,
3
2
  rootDroppableId,
4
3
  setupZone,
5
4
  walkAppState,
6
5
  walkTree
7
- } from "./chunk-754HNMU2.mjs";
6
+ } from "./chunk-SHVCBQDY.mjs";
8
7
  import {
9
8
  __spreadProps,
10
9
  __spreadValues,
@@ -41,6 +40,11 @@ var insert = (list, index, item) => {
41
40
  return result;
42
41
  };
43
42
 
43
+ // lib/generate-id.ts
44
+ init_react_import();
45
+ import { v4 as uuidv4 } from "uuid";
46
+ var generateId = (type) => type ? `${type}-${uuidv4()}` : uuidv4();
47
+
44
48
  // lib/data/get-ids-for-parent.ts
45
49
  init_react_import();
46
50
  var getIdsForParent = (zoneCompound, state) => {
@@ -515,6 +519,7 @@ function createReducer({
515
519
 
516
520
  export {
517
521
  insert,
522
+ generateId,
518
523
  populateIds,
519
524
  insertAction,
520
525
  getItem,
@@ -3,7 +3,7 @@ import {
3
3
  AlignJustify,
4
4
  AlignLeft,
5
5
  AlignRight
6
- } from "./chunk-22UJFAFA.mjs";
6
+ } from "./chunk-O7FT3KAM.mjs";
7
7
  import {
8
8
  init_react_import
9
9
  } from "./chunk-M6W7YEVX.mjs";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  useAlignOptions
3
- } from "./chunk-BCL7VBTL.mjs";
3
+ } from "./chunk-DPDJ67KA.mjs";
4
4
  import {
5
5
  useHeadingOptions
6
- } from "./chunk-K23YHISE.mjs";
6
+ } from "./chunk-ZMTK7SMX.mjs";
7
7
  import {
8
8
  useListOptions
9
- } from "./chunk-U6THAD4G.mjs";
9
+ } from "./chunk-LODTL5KW.mjs";
10
10
  import {
11
11
  AlignCenter,
12
12
  AlignJustify,
@@ -26,7 +26,7 @@ import {
26
26
  Strikethrough,
27
27
  Underline,
28
28
  useControlContext
29
- } from "./chunk-22UJFAFA.mjs";
29
+ } from "./chunk-O7FT3KAM.mjs";
30
30
  import {
31
31
  get_class_name_factory_default
32
32
  } from "./chunk-Y2EFNT5P.mjs";
@@ -95,7 +95,7 @@ import { useState } from "react";
95
95
 
96
96
  // css-module:/home/runner/work/puck/puck/packages/core/components/IconButton/IconButton.module.css#css-module
97
97
  init_react_import();
98
- var IconButton_module_default = { "IconButton": "_IconButton_ffob9_1", "IconButton--active": "_IconButton--active_ffob9_14", "IconButton--disabled": "_IconButton--disabled_ffob9_24", "IconButton-title": "_IconButton-title_ffob9_37" };
98
+ var IconButton_module_default = { "IconButton": "_IconButton_1c68y_1", "IconButton--active": "_IconButton--active_1c68y_14", "IconButton--disabled": "_IconButton--disabled_1c68y_24" };
99
99
 
100
100
  // components/Loader/index.tsx
101
101
  init_react_import();
@@ -169,9 +169,9 @@ var IconButton = ({
169
169
  rel: newTab ? "noreferrer" : void 0,
170
170
  href,
171
171
  title,
172
+ "aria-label": title,
172
173
  suppressHydrationWarning,
173
174
  children: [
174
- /* @__PURE__ */ jsx3("span", { className: getClassName3("title"), children: title }),
175
175
  children,
176
176
  loading && /* @__PURE__ */ jsxs2(Fragment, { children: [
177
177
  "\xA0\xA0",
@@ -349,7 +349,7 @@ function AlignSelectFallback() {
349
349
  // components/RichTextMenu/controls/AlignSelect/index.tsx
350
350
  import { jsx as jsx10 } from "react/jsx-runtime";
351
351
  var AlignSelectLoaded = lazy(
352
- () => import("./loaded-MIY725CK.mjs").then((m) => ({
352
+ () => import("./loaded-54625GTL.mjs").then((m) => ({
353
353
  default: m.AlignSelectLoaded
354
354
  }))
355
355
  );
@@ -580,7 +580,7 @@ function HeadingSelectFallback() {
580
580
  // components/RichTextMenu/controls/HeadingSelect/index.tsx
581
581
  import { jsx as jsx22 } from "react/jsx-runtime";
582
582
  var HeadingSelectLoaded = lazy2(
583
- () => import("./loaded-F37CNCVG.mjs").then((m) => ({
583
+ () => import("./loaded-OMRIYZIQ.mjs").then((m) => ({
584
584
  default: m.HeadingSelectLoaded
585
585
  }))
586
586
  );
@@ -612,7 +612,7 @@ function ListSelectFallback() {
612
612
  // components/RichTextMenu/controls/ListSelect/index.tsx
613
613
  import { jsx as jsx24 } from "react/jsx-runtime";
614
614
  var ListSelectLoaded = lazy3(
615
- () => import("./loaded-H325ZSK5.mjs").then((m) => ({
615
+ () => import("./loaded-Y4ZWZC55.mjs").then((m) => ({
616
616
  default: m.ListSelectLoaded
617
617
  }))
618
618
  );
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  List,
3
3
  ListOrdered
4
- } from "./chunk-22UJFAFA.mjs";
4
+ } from "./chunk-O7FT3KAM.mjs";
5
5
  import {
6
6
  init_react_import
7
7
  } from "./chunk-M6W7YEVX.mjs";
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  createReducer,
3
+ generateId,
3
4
  getItem,
4
5
  makeStatePublic
5
- } from "./chunk-YLLE6KXH.mjs";
6
+ } from "./chunk-6XCJ3Y7O.mjs";
6
7
  import {
7
8
  defaultAppState,
8
9
  defaultViewports,
9
10
  getChanged,
10
11
  resolveComponentData
11
- } from "./chunk-BOKX3EBR.mjs";
12
+ } from "./chunk-4HOGLOEA.mjs";
12
13
  import {
13
14
  get_class_name_factory_default
14
15
  } from "./chunk-Y2EFNT5P.mjs";
15
16
  import {
16
- generateId,
17
17
  walkAppState
18
- } from "./chunk-754HNMU2.mjs";
18
+ } from "./chunk-SHVCBQDY.mjs";
19
19
  import {
20
20
  __async,
21
21
  __objRest,
@@ -37,20 +37,10 @@ var walkField = ({
37
37
  if (map && fieldType === "slot") {
38
38
  const content = value || [];
39
39
  const mappedContent = recurseSlots ? content.map((el) => {
40
- var _a2;
41
- const componentConfig = config.components[el.type];
42
- if (!componentConfig) {
40
+ if (!config.components[el.type]) {
43
41
  throw new Error(`Could not find component config for ${el.type}`);
44
42
  }
45
- const fields2 = (_a2 = componentConfig.fields) != null ? _a2 : {};
46
- return walkField({
47
- value: __spreadProps(__spreadValues({}, el), { props: defaultSlots(el.props, fields2) }),
48
- fields: fields2,
49
- mappers,
50
- id: el.props.id,
51
- config,
52
- recurseSlots
53
- });
43
+ return mapFields(el, mappers, config, recurseSlots);
54
44
  }) : content;
55
45
  if (containsPromise(mappedContent)) {
56
46
  return Promise.all(mappedContent);
@@ -428,11 +418,6 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
428
418
  });
429
419
  }
430
420
 
431
- // lib/generate-id.ts
432
- init_react_import();
433
- import { v4 as uuidv4 } from "uuid";
434
- var generateId = (type) => type ? `${type}-${uuidv4()}` : uuidv4();
435
-
436
421
  // lib/data/setup-zone.ts
437
422
  init_react_import();
438
423
  var setupZone = (data, zoneKey) => {
@@ -457,7 +442,6 @@ export {
457
442
  expandNode,
458
443
  toComponent,
459
444
  walkAppState,
460
- generateId,
461
445
  walkTree,
462
446
  setupZone
463
447
  };
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-AOEDIUVK.mjs";
4
4
  import {
5
5
  LoadedRichTextMenuInner
6
- } from "./chunk-G74MZKKD.mjs";
6
+ } from "./chunk-HGJWUFLT.mjs";
7
7
  import {
8
8
  useAppStore,
9
9
  useAppStoreApi
10
- } from "./chunk-22UJFAFA.mjs";
10
+ } from "./chunk-O7FT3KAM.mjs";
11
11
  import {
12
12
  get_class_name_factory_default
13
13
  } from "./chunk-Y2EFNT5P.mjs";
@@ -100,7 +100,7 @@ init_react_import();
100
100
  import { lazy, Suspense } from "react";
101
101
  import { jsx as jsx2 } from "react/jsx-runtime";
102
102
  var LoadedRichTextMenuFull = lazy(
103
- () => import("./full-N67EAB2Q.mjs").then((m) => ({
103
+ () => import("./full-5QCBHXRC.mjs").then((m) => ({
104
104
  default: m.LoadedRichTextMenuFull
105
105
  }))
106
106
  );
@@ -4,18 +4,17 @@ import {
4
4
  import {
5
5
  defaultAppState,
6
6
  resolveComponentData
7
- } from "./chunk-BOKX3EBR.mjs";
7
+ } from "./chunk-4HOGLOEA.mjs";
8
8
  import {
9
9
  get_class_name_factory_default
10
10
  } from "./chunk-Y2EFNT5P.mjs";
11
11
  import {
12
- generateId,
13
12
  getZoneId,
14
13
  mapFields,
15
14
  toComponent,
16
15
  walkAppState,
17
16
  walkTree
18
- } from "./chunk-754HNMU2.mjs";
17
+ } from "./chunk-SHVCBQDY.mjs";
19
18
  import {
20
19
  __async,
21
20
  __objRest,
@@ -400,7 +399,7 @@ function useRichtextProps(fields, props) {
400
399
  const richtextProps = useMemo2(() => {
401
400
  if (!(richtextKeys == null ? void 0 : richtextKeys.length)) return {};
402
401
  const RichTextRender = lazy(
403
- () => import("./Render-CU35UAWV.mjs").then((m) => ({
402
+ () => import("./Render-MJ563JES.mjs").then((m) => ({
404
403
  default: m.RichTextRender
405
404
  }))
406
405
  );
@@ -412,7 +411,7 @@ function useRichtextProps(fields, props) {
412
411
  fallback: /* @__PURE__ */ jsx2(RichTextRenderFallback, { content }),
413
412
  children: /* @__PURE__ */ jsx2(RichTextRender, { content, field })
414
413
  },
415
- generateId()
414
+ path.join(".")
416
415
  ));
417
416
  }
418
417
  return result;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EditorInner,
3
3
  LoadedRichTextMenu
4
- } from "./chunk-WCC2G7U7.mjs";
4
+ } from "./chunk-TDQEUXB2.mjs";
5
5
  import {
6
6
  RichTextRenderFallback,
7
7
  SlotRender,
@@ -10,13 +10,13 @@ import {
10
10
  getSlotTransform,
11
11
  useRichtextProps,
12
12
  useSlots
13
- } from "./chunk-FOGDNETJ.mjs";
13
+ } from "./chunk-X2ZFWNCU.mjs";
14
14
  import {
15
15
  ActionBar,
16
16
  IconButton,
17
17
  LoadedRichTextMenuInner,
18
18
  Loader
19
- } from "./chunk-G74MZKKD.mjs";
19
+ } from "./chunk-HGJWUFLT.mjs";
20
20
  import {
21
21
  ChevronDown,
22
22
  ChevronRight,
@@ -68,25 +68,25 @@ import {
68
68
  useRegisterHistorySlice,
69
69
  useRegisterPermissionsSlice,
70
70
  useResetAutoZoom
71
- } from "./chunk-22UJFAFA.mjs";
71
+ } from "./chunk-O7FT3KAM.mjs";
72
72
  import {
73
+ generateId,
73
74
  getItem,
74
75
  insert,
75
76
  insertAction,
76
77
  makeStatePublic,
77
78
  populateIds
78
- } from "./chunk-YLLE6KXH.mjs";
79
+ } from "./chunk-6XCJ3Y7O.mjs";
79
80
  import {
80
81
  defaultAppState,
81
82
  defaultViewports
82
- } from "./chunk-BOKX3EBR.mjs";
83
+ } from "./chunk-4HOGLOEA.mjs";
83
84
  import {
84
85
  get_class_name_factory_default
85
86
  } from "./chunk-Y2EFNT5P.mjs";
86
87
  import {
87
88
  defaultSlots,
88
89
  expandNode,
89
- generateId,
90
90
  mapFields,
91
91
  rootAreaId,
92
92
  rootDroppableId,
@@ -95,7 +95,7 @@ import {
95
95
  toComponent,
96
96
  walkAppState,
97
97
  walkField
98
- } from "./chunk-754HNMU2.mjs";
98
+ } from "./chunk-SHVCBQDY.mjs";
99
99
  import {
100
100
  __async,
101
101
  __objRest,
@@ -1991,7 +1991,7 @@ EditorFallback.displayName = "EditorFallback";
1991
1991
  // components/AutoField/fields/RichtextField/index.tsx
1992
1992
  import { Fragment as Fragment5, jsx as jsx18 } from "react/jsx-runtime";
1993
1993
  var Editor = lazy(
1994
- () => import("./Editor-EPSED64A.mjs").then((m) => ({
1994
+ () => import("./Editor-MCVDFQH6.mjs").then((m) => ({
1995
1995
  default: m.Editor
1996
1996
  }))
1997
1997
  );
@@ -2914,6 +2914,10 @@ var DraggableComponent = ({
2914
2914
  },
2915
2915
  [zoom]
2916
2916
  );
2917
+ const actionBarRef = useRef2(null);
2918
+ useEffect8(() => {
2919
+ syncActionsPosition(actionBarRef.current);
2920
+ }, [actionBarRef.current, syncActionsPosition]);
2917
2921
  useEffect8(() => {
2918
2922
  if (userDragAxis) {
2919
2923
  setDragAxis(userDragAxis);
@@ -2991,7 +2995,7 @@ var DraggableComponent = ({
2991
2995
  paddingLeft: actionsSide,
2992
2996
  paddingRight: actionsSide
2993
2997
  },
2994
- ref: syncActionsPosition,
2998
+ ref: actionBarRef,
2995
2999
  children: /* @__PURE__ */ jsxs7(
2996
3000
  CustomActionBar,
2997
3001
  {
@@ -3665,7 +3669,7 @@ var DragDropContextClient = ({
3665
3669
  const { previewIndex = {} } = zoneStore.getState() || {};
3666
3670
  const thisPreview = ((_b = previewIndex[zone]) == null ? void 0 : _b.props.id) === source.id ? previewIndex[zone] : null;
3667
3671
  const onAnimationEnd = () => {
3668
- var _a2, _b2;
3672
+ var _a2, _b2, _c, _d;
3669
3673
  zoneStore.setState({ draggedItem: null });
3670
3674
  if (event.canceled || (target == null ? void 0 : target.type) === "void") {
3671
3675
  zoneStore.setState({ previewIndex: {} });
@@ -3699,15 +3703,16 @@ var DragDropContextClient = ({
3699
3703
  );
3700
3704
  }
3701
3705
  }
3706
+ const movedToNewPosition = ((_b2 = initialSelector.current) == null ? void 0 : _b2.zone) !== (thisPreview == null ? void 0 : thisPreview.zone) || ((_c = initialSelector.current) == null ? void 0 : _c.index) !== (thisPreview == null ? void 0 : thisPreview.index);
3702
3707
  dispatch({
3703
3708
  type: "setUi",
3704
3709
  ui: {
3705
3710
  itemSelector: { index, zone },
3706
3711
  isDragging: false
3707
3712
  },
3708
- recordHistory: false
3713
+ recordHistory: movedToNewPosition
3709
3714
  });
3710
- (_b2 = dragListeners.dragend) == null ? void 0 : _b2.forEach((fn) => {
3715
+ (_d = dragListeners.dragend) == null ? void 0 : _d.forEach((fn) => {
3711
3716
  fn(event, manager);
3712
3717
  });
3713
3718
  };
@@ -4342,8 +4347,9 @@ var InlineTextFieldInternal = ({
4342
4347
  );
4343
4348
  }
4344
4349
  if (ref.current) {
4345
- if (value !== ref.current.innerText) {
4346
- ref.current.replaceChildren(value);
4350
+ const safeValue = value != null ? value : "";
4351
+ if (safeValue !== ref.current.innerText) {
4352
+ ref.current.replaceChildren(safeValue);
4347
4353
  }
4348
4354
  const cleanupPortal = registerOverlayPortal(ref.current);
4349
4355
  const handleInput = (e) => __async(null, null, function* () {
@@ -4478,12 +4484,12 @@ import {
4478
4484
  } from "react";
4479
4485
  import { jsx as jsx28 } from "react/jsx-runtime";
4480
4486
  var Editor2 = lazy2(
4481
- () => import("./Editor-EPSED64A.mjs").then((m) => ({
4487
+ () => import("./Editor-MCVDFQH6.mjs").then((m) => ({
4482
4488
  default: m.Editor
4483
4489
  }))
4484
4490
  );
4485
4491
  var RichTextRender = lazy2(
4486
- () => import("./Render-CU35UAWV.mjs").then((m) => ({
4492
+ () => import("./Render-MJ563JES.mjs").then((m) => ({
4487
4493
  default: m.RichTextRender
4488
4494
  }))
4489
4495
  );
@@ -7463,7 +7469,7 @@ var ViewportControls = ({
7463
7469
 
7464
7470
  // css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Canvas/styles.module.css#css-module
7465
7471
  init_react_import();
7466
- var styles_module_default25 = { "PuckCanvas": "_PuckCanvas_t6s9b_1", "PuckCanvas-controls": "_PuckCanvas-controls_t6s9b_17", "PuckCanvas--fullScreen": "_PuckCanvas--fullScreen_t6s9b_22", "PuckCanvas-inner": "_PuckCanvas-inner_t6s9b_33", "PuckCanvas-root": "_PuckCanvas-root_t6s9b_42", "PuckCanvas--ready": "_PuckCanvas--ready_t6s9b_67", "PuckCanvas-loader": "_PuckCanvas-loader_t6s9b_72", "PuckCanvas--showLoader": "_PuckCanvas--showLoader_t6s9b_82" };
7472
+ var styles_module_default25 = { "PuckCanvas": "_PuckCanvas_ur8dl_1", "PuckCanvas-controls": "_PuckCanvas-controls_ur8dl_17", "PuckCanvas--fullScreen": "_PuckCanvas--fullScreen_ur8dl_22", "PuckCanvas-inner": "_PuckCanvas-inner_ur8dl_33", "PuckCanvas-root": "_PuckCanvas-root_ur8dl_42", "PuckCanvas--ready": "_PuckCanvas--ready_ur8dl_67", "PuckCanvas-loader": "_PuckCanvas-loader_ur8dl_72", "PuckCanvas--showLoader": "_PuckCanvas--showLoader_ur8dl_83" };
7467
7473
 
7468
7474
  // components/Puck/components/Canvas/index.tsx
7469
7475
  import { useShallow as useShallow9 } from "zustand/react/shallow";
@@ -5,7 +5,7 @@ import {
5
5
  Heading4,
6
6
  Heading5,
7
7
  Heading6
8
- } from "./chunk-22UJFAFA.mjs";
8
+ } from "./chunk-O7FT3KAM.mjs";
9
9
  import {
10
10
  init_react_import
11
11
  } from "./chunk-M6W7YEVX.mjs";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  LoadedRichTextMenuInner
3
- } from "./chunk-G74MZKKD.mjs";
4
- import "./chunk-BCL7VBTL.mjs";
5
- import "./chunk-K23YHISE.mjs";
6
- import "./chunk-U6THAD4G.mjs";
7
- import "./chunk-22UJFAFA.mjs";
8
- import "./chunk-YLLE6KXH.mjs";
9
- import "./chunk-BOKX3EBR.mjs";
3
+ } from "./chunk-HGJWUFLT.mjs";
4
+ import "./chunk-DPDJ67KA.mjs";
5
+ import "./chunk-ZMTK7SMX.mjs";
6
+ import "./chunk-LODTL5KW.mjs";
7
+ import "./chunk-O7FT3KAM.mjs";
8
+ import "./chunk-6XCJ3Y7O.mjs";
9
+ import "./chunk-4HOGLOEA.mjs";
10
10
  import "./chunk-Y2EFNT5P.mjs";
11
- import "./chunk-754HNMU2.mjs";
11
+ import "./chunk-SHVCBQDY.mjs";
12
12
  import {
13
13
  __spreadValues,
14
14
  init_react_import
@@ -24,7 +24,7 @@ init_react_import();
24
24
  var defaultEditorState = (ctx, readOnly) => {
25
25
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;
26
26
  const editor = ctx.editor;
27
- if (!editor) return {};
27
+ if (!editor || editor.isDestroyed) return {};
28
28
  const canChain = () => editor.can().chain();
29
29
  return {
30
30
  isAlignLeft: editor.isActive({ textAlign: "left" }),
@@ -41,7 +41,7 @@
41
41
  }
42
42
 
43
43
  /* css-module:/home/runner/work/puck/puck/packages/core/components/IconButton/IconButton.module.css/#css-module-data */
44
- ._IconButton_ffob9_1 {
44
+ ._IconButton_1c68y_1 {
45
45
  align-items: center;
46
46
  background: transparent;
47
47
  border: none;
@@ -53,35 +53,26 @@
53
53
  padding: 4px;
54
54
  transition: background-color 50ms ease-in, color 50ms ease-in;
55
55
  }
56
- ._IconButton--active_ffob9_14 {
56
+ ._IconButton--active_1c68y_14 {
57
57
  color: var(--puck-color-azure-04);
58
58
  }
59
- ._IconButton_ffob9_1:focus-visible {
59
+ ._IconButton_1c68y_1:focus-visible {
60
60
  outline: 2px solid var(--puck-color-azure-05);
61
61
  outline-offset: -2px;
62
62
  }
63
63
  @media (hover: hover) and (pointer: fine) {
64
- ._IconButton_ffob9_1:hover:not(._IconButton--disabled_ffob9_24) {
64
+ ._IconButton_1c68y_1:hover:not(._IconButton--disabled_1c68y_24) {
65
65
  background: var(--puck-color-grey-10);
66
66
  color: var(--puck-color-azure-04);
67
67
  cursor: pointer;
68
68
  transition: none;
69
69
  }
70
70
  }
71
- ._IconButton_ffob9_1:active {
71
+ ._IconButton_1c68y_1:active {
72
72
  background: var(--puck-color-azure-11);
73
73
  transition: none;
74
74
  }
75
- ._IconButton-title_ffob9_37 {
76
- clip: rect(0 0 0 0);
77
- clip-path: inset(100%);
78
- height: 1px;
79
- overflow: hidden;
80
- position: absolute;
81
- white-space: nowrap;
82
- width: 1px;
83
- }
84
- ._IconButton--disabled_ffob9_24 {
75
+ ._IconButton--disabled_1c68y_24 {
85
76
  color: var(--puck-color-grey-07);
86
77
  }
87
78