@puckeditor/core 0.21.0 → 0.21.1-canary.3d56139a

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.
@@ -4,16 +4,16 @@ import {
4
4
  import {
5
5
  EditorInner,
6
6
  LoadedRichTextMenu
7
- } from "./chunk-ZPR7EC3T.mjs";
7
+ } from "./chunk-TROL7JRD.mjs";
8
8
  import "./chunk-AOEDIUVK.mjs";
9
- import "./chunk-RYILZVCB.mjs";
10
- import "./chunk-UFXHMVJE.mjs";
11
- import "./chunk-MNNPATDB.mjs";
12
- import "./chunk-YBJ32VYI.mjs";
9
+ import "./chunk-FQ2H4O5Z.mjs";
10
+ import "./chunk-Y56V6PHT.mjs";
11
+ import "./chunk-74NIJIFH.mjs";
12
+ import "./chunk-W5GVFMJ2.mjs";
13
13
  import {
14
14
  useAppStore,
15
15
  useAppStoreApi
16
- } from "./chunk-HLB66X4S.mjs";
16
+ } from "./chunk-7BNZGUYT.mjs";
17
17
  import "./chunk-QIJR53IK.mjs";
18
18
  import "./chunk-AHX7X7NZ.mjs";
19
19
  import "./chunk-Y2EFNT5P.mjs";
@@ -5,7 +5,7 @@ import {
5
5
  Heading4,
6
6
  Heading5,
7
7
  Heading6
8
- } from "./chunk-HLB66X4S.mjs";
8
+ } from "./chunk-7BNZGUYT.mjs";
9
9
  import {
10
10
  init_react_import
11
11
  } from "./chunk-M6W7YEVX.mjs";
@@ -1593,6 +1593,7 @@ var Select = ({
1593
1593
  }) => {
1594
1594
  const [open, setOpen] = useState(false);
1595
1595
  const hasOptions = options.length > 0;
1596
+ const isDisabled = disabled || !hasOptions;
1596
1597
  return /* @__PURE__ */ jsx(
1597
1598
  "div",
1598
1599
  {
@@ -1601,7 +1602,7 @@ var Select = ({
1601
1602
  hasOptions,
1602
1603
  actionBar: mode === "actionBar",
1603
1604
  standalone: mode === "standalone",
1604
- disabled
1605
+ disabled: isDisabled
1605
1606
  }),
1606
1607
  children: /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
1607
1608
  hasOptions ? /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("button", { className: getClassName("button"), children: [
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EditorInner,
3
3
  LoadedRichTextMenu
4
- } from "./chunk-ZPR7EC3T.mjs";
4
+ } from "./chunk-TROL7JRD.mjs";
5
5
  import {
6
6
  RichTextRenderFallback,
7
7
  SlotRender,
@@ -16,7 +16,7 @@ import {
16
16
  IconButton,
17
17
  LoadedRichTextMenuInner,
18
18
  Loader
19
- } from "./chunk-RYILZVCB.mjs";
19
+ } from "./chunk-FQ2H4O5Z.mjs";
20
20
  import {
21
21
  ChevronDown,
22
22
  ChevronRight,
@@ -68,7 +68,7 @@ import {
68
68
  useRegisterHistorySlice,
69
69
  useRegisterPermissionsSlice,
70
70
  useResetAutoZoom
71
- } from "./chunk-HLB66X4S.mjs";
71
+ } from "./chunk-7BNZGUYT.mjs";
72
72
  import {
73
73
  generateId,
74
74
  getItem,
@@ -1971,7 +1971,7 @@ EditorFallback.displayName = "EditorFallback";
1971
1971
  // components/AutoField/fields/RichtextField/index.tsx
1972
1972
  import { Fragment as Fragment4, jsx as jsx17 } from "react/jsx-runtime";
1973
1973
  var Editor = lazy(
1974
- () => import("./Editor-L7XD2QW3.mjs").then((m) => ({
1974
+ () => import("./Editor-WN45CTYD.mjs").then((m) => ({
1975
1975
  default: m.Editor
1976
1976
  }))
1977
1977
  );
@@ -3604,7 +3604,7 @@ import {
3604
3604
  } from "react";
3605
3605
  import { jsx as jsx27 } from "react/jsx-runtime";
3606
3606
  var Editor2 = lazy2(
3607
- () => import("./Editor-L7XD2QW3.mjs").then((m) => ({
3607
+ () => import("./Editor-WN45CTYD.mjs").then((m) => ({
3608
3608
  default: m.Editor
3609
3609
  }))
3610
3610
  );
@@ -7715,10 +7715,11 @@ var Layout = ({ children }) => {
7715
7715
  const pluginItems = useMemo23(() => {
7716
7716
  const details = {};
7717
7717
  const defaultPlugins = [blocksPlugin(), outlinePlugin()];
7718
+ const isLegacy = (plugin) => plugin.name === "legacy-side-bar" ? -1 : 0;
7718
7719
  const combinedPlugins = [
7719
7720
  ...defaultPlugins,
7720
7721
  ...plugins != null ? plugins : []
7721
- ].sort((a) => a.name === "legacy-side-bar" ? -1 : 1);
7722
+ ].sort((a, b) => isLegacy(a) - isLegacy(b));
7722
7723
  if (!(plugins == null ? void 0 : plugins.some((p) => p.name === "fields"))) {
7723
7724
  combinedPlugins.push(fieldsPlugin());
7724
7725
  }
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  useAlignOptions
3
- } from "./chunk-UFXHMVJE.mjs";
3
+ } from "./chunk-Y56V6PHT.mjs";
4
4
  import {
5
5
  useHeadingOptions
6
- } from "./chunk-MNNPATDB.mjs";
6
+ } from "./chunk-74NIJIFH.mjs";
7
7
  import {
8
8
  useListOptions
9
- } from "./chunk-YBJ32VYI.mjs";
9
+ } from "./chunk-W5GVFMJ2.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-HLB66X4S.mjs";
29
+ } from "./chunk-7BNZGUYT.mjs";
30
30
  import {
31
31
  get_class_name_factory_default
32
32
  } from "./chunk-Y2EFNT5P.mjs";
@@ -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-G2WSQZO7.mjs").then((m) => ({
352
+ () => import("./loaded-TUEVI7HD.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-MYALJBRK.mjs").then((m) => ({
583
+ () => import("./loaded-CCI7CDRT.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-5AM4V5PV.mjs").then((m) => ({
615
+ () => import("./loaded-GY5Y56UO.mjs").then((m) => ({
616
616
  default: m.ListSelectLoaded
617
617
  }))
618
618
  );
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-AOEDIUVK.mjs";
4
4
  import {
5
5
  LoadedRichTextMenuInner
6
- } from "./chunk-RYILZVCB.mjs";
6
+ } from "./chunk-FQ2H4O5Z.mjs";
7
7
  import {
8
8
  useAppStore,
9
9
  useAppStoreApi
10
- } from "./chunk-HLB66X4S.mjs";
10
+ } from "./chunk-7BNZGUYT.mjs";
11
11
  import {
12
12
  get_class_name_factory_default
13
13
  } from "./chunk-Y2EFNT5P.mjs";
@@ -50,6 +50,9 @@ var EditorInner = memo(
50
50
  event.preventDefault();
51
51
  (_b = editor == null ? void 0 : (_a = editor.commands).toggleItalic) == null ? void 0 : _b.call(_a);
52
52
  }
53
+ if (event.key.toLowerCase() === "backspace") {
54
+ event.stopPropagation();
55
+ }
53
56
  },
54
57
  [editor]
55
58
  );
@@ -97,7 +100,7 @@ init_react_import();
97
100
  import { lazy, Suspense } from "react";
98
101
  import { jsx as jsx2 } from "react/jsx-runtime";
99
102
  var LoadedRichTextMenuFull = lazy(
100
- () => import("./full-4UGAOTTB.mjs").then((m) => ({
103
+ () => import("./full-VFWTJNMI.mjs").then((m) => ({
101
104
  default: m.LoadedRichTextMenuFull
102
105
  }))
103
106
  );
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  List,
3
3
  ListOrdered
4
- } from "./chunk-HLB66X4S.mjs";
4
+ } from "./chunk-7BNZGUYT.mjs";
5
5
  import {
6
6
  init_react_import
7
7
  } from "./chunk-M6W7YEVX.mjs";
@@ -3,7 +3,7 @@ import {
3
3
  AlignJustify,
4
4
  AlignLeft,
5
5
  AlignRight
6
- } from "./chunk-HLB66X4S.mjs";
6
+ } from "./chunk-7BNZGUYT.mjs";
7
7
  import {
8
8
  init_react_import
9
9
  } from "./chunk-M6W7YEVX.mjs";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  LoadedRichTextMenuInner
3
- } from "./chunk-RYILZVCB.mjs";
4
- import "./chunk-UFXHMVJE.mjs";
5
- import "./chunk-MNNPATDB.mjs";
6
- import "./chunk-YBJ32VYI.mjs";
7
- import "./chunk-HLB66X4S.mjs";
3
+ } from "./chunk-FQ2H4O5Z.mjs";
4
+ import "./chunk-Y56V6PHT.mjs";
5
+ import "./chunk-74NIJIFH.mjs";
6
+ import "./chunk-W5GVFMJ2.mjs";
7
+ import "./chunk-7BNZGUYT.mjs";
8
8
  import "./chunk-QIJR53IK.mjs";
9
9
  import "./chunk-AHX7X7NZ.mjs";
10
10
  import "./chunk-Y2EFNT5P.mjs";
package/dist/index.js CHANGED
@@ -4081,6 +4081,7 @@ var init_Select = __esm({
4081
4081
  }) => {
4082
4082
  const [open, setOpen] = (0, import_react24.useState)(false);
4083
4083
  const hasOptions = options.length > 0;
4084
+ const isDisabled = disabled || !hasOptions;
4084
4085
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4085
4086
  "div",
4086
4087
  {
@@ -4089,7 +4090,7 @@ var init_Select = __esm({
4089
4090
  hasOptions,
4090
4091
  actionBar: mode === "actionBar",
4091
4092
  standalone: mode === "standalone",
4092
- disabled
4093
+ disabled: isDisabled
4093
4094
  }),
4094
4095
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_popover.Popover, { open, onOpenChange: setOpen, children: [
4095
4096
  hasOptions ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_popover.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("button", { className: getClassName15("button"), children: [
@@ -5060,6 +5061,9 @@ var init_EditorInner = __esm({
5060
5061
  event.preventDefault();
5061
5062
  (_b = editor == null ? void 0 : (_a = editor.commands).toggleItalic) == null ? void 0 : _b.call(_a);
5062
5063
  }
5064
+ if (event.key.toLowerCase() === "backspace") {
5065
+ event.stopPropagation();
5066
+ }
5063
5067
  },
5064
5068
  [editor]
5065
5069
  );
@@ -13491,10 +13495,11 @@ var Layout = ({ children }) => {
13491
13495
  const pluginItems = (0, import_react92.useMemo)(() => {
13492
13496
  const details = {};
13493
13497
  const defaultPlugins = [blocksPlugin(), outlinePlugin()];
13498
+ const isLegacy = (plugin) => plugin.name === "legacy-side-bar" ? -1 : 0;
13494
13499
  const combinedPlugins = [
13495
13500
  ...defaultPlugins,
13496
13501
  ...plugins != null ? plugins : []
13497
- ].sort((a) => a.name === "legacy-side-bar" ? -1 : 1);
13502
+ ].sort((a, b) => isLegacy(a) - isLegacy(b));
13498
13503
  if (!(plugins == null ? void 0 : plugins.some((p) => p.name === "fields"))) {
13499
13504
  combinedPlugins.push(fieldsPlugin());
13500
13505
  }
package/dist/index.mjs CHANGED
@@ -17,8 +17,8 @@ import {
17
17
  setDeep,
18
18
  useGetPuck,
19
19
  usePuck
20
- } from "./chunk-K66K75HC.mjs";
21
- import "./chunk-ZPR7EC3T.mjs";
20
+ } from "./chunk-DTIQ2L3Z.mjs";
21
+ import "./chunk-TROL7JRD.mjs";
22
22
  import {
23
23
  migrate,
24
24
  resolveAllData,
@@ -33,11 +33,11 @@ import {
33
33
  Label,
34
34
  RichTextMenu,
35
35
  Separator
36
- } from "./chunk-RYILZVCB.mjs";
37
- import "./chunk-UFXHMVJE.mjs";
38
- import "./chunk-MNNPATDB.mjs";
39
- import "./chunk-YBJ32VYI.mjs";
40
- import "./chunk-HLB66X4S.mjs";
36
+ } from "./chunk-FQ2H4O5Z.mjs";
37
+ import "./chunk-Y56V6PHT.mjs";
38
+ import "./chunk-74NIJIFH.mjs";
39
+ import "./chunk-W5GVFMJ2.mjs";
40
+ import "./chunk-7BNZGUYT.mjs";
41
41
  import "./chunk-QIJR53IK.mjs";
42
42
  import "./chunk-AHX7X7NZ.mjs";
43
43
  import "./chunk-Y2EFNT5P.mjs";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  useHeadingOptions
3
- } from "./chunk-MNNPATDB.mjs";
3
+ } from "./chunk-74NIJIFH.mjs";
4
4
  import {
5
5
  Heading,
6
6
  SelectControl,
7
7
  useControlContext
8
- } from "./chunk-HLB66X4S.mjs";
8
+ } from "./chunk-7BNZGUYT.mjs";
9
9
  import "./chunk-QIJR53IK.mjs";
10
10
  import "./chunk-AHX7X7NZ.mjs";
11
11
  import "./chunk-Y2EFNT5P.mjs";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  useListOptions
3
- } from "./chunk-YBJ32VYI.mjs";
3
+ } from "./chunk-W5GVFMJ2.mjs";
4
4
  import {
5
5
  List,
6
6
  SelectControl,
7
7
  useControlContext
8
- } from "./chunk-HLB66X4S.mjs";
8
+ } from "./chunk-7BNZGUYT.mjs";
9
9
  import "./chunk-QIJR53IK.mjs";
10
10
  import "./chunk-AHX7X7NZ.mjs";
11
11
  import "./chunk-Y2EFNT5P.mjs";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  useAlignOptions
3
- } from "./chunk-UFXHMVJE.mjs";
3
+ } from "./chunk-Y56V6PHT.mjs";
4
4
  import {
5
5
  AlignLeft,
6
6
  SelectControl,
7
7
  useControlContext
8
- } from "./chunk-HLB66X4S.mjs";
8
+ } from "./chunk-7BNZGUYT.mjs";
9
9
  import "./chunk-QIJR53IK.mjs";
10
10
  import "./chunk-AHX7X7NZ.mjs";
11
11
  import "./chunk-Y2EFNT5P.mjs";
@@ -4081,6 +4081,7 @@ var init_Select = __esm({
4081
4081
  }) => {
4082
4082
  const [open, setOpen] = (0, import_react24.useState)(false);
4083
4083
  const hasOptions = options.length > 0;
4084
+ const isDisabled = disabled || !hasOptions;
4084
4085
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4085
4086
  "div",
4086
4087
  {
@@ -4089,7 +4090,7 @@ var init_Select = __esm({
4089
4090
  hasOptions,
4090
4091
  actionBar: mode === "actionBar",
4091
4092
  standalone: mode === "standalone",
4092
- disabled
4093
+ disabled: isDisabled
4093
4094
  }),
4094
4095
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_popover.Popover, { open, onOpenChange: setOpen, children: [
4095
4096
  hasOptions ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_popover.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("button", { className: getClassName15("button"), children: [
@@ -5060,6 +5061,9 @@ var init_EditorInner = __esm({
5060
5061
  event.preventDefault();
5061
5062
  (_b = editor == null ? void 0 : (_a = editor.commands).toggleItalic) == null ? void 0 : _b.call(_a);
5062
5063
  }
5064
+ if (event.key.toLowerCase() === "backspace") {
5065
+ event.stopPropagation();
5066
+ }
5063
5067
  },
5064
5068
  [editor]
5065
5069
  );
@@ -13494,10 +13498,11 @@ var Layout = ({ children }) => {
13494
13498
  const pluginItems = (0, import_react92.useMemo)(() => {
13495
13499
  const details = {};
13496
13500
  const defaultPlugins = [blocksPlugin(), outlinePlugin()];
13501
+ const isLegacy = (plugin) => plugin.name === "legacy-side-bar" ? -1 : 0;
13497
13502
  const combinedPlugins = [
13498
13503
  ...defaultPlugins,
13499
13504
  ...plugins != null ? plugins : []
13500
- ].sort((a) => a.name === "legacy-side-bar" ? -1 : 1);
13505
+ ].sort((a, b) => isLegacy(a) - isLegacy(b));
13501
13506
  if (!(plugins == null ? void 0 : plugins.some((p) => p.name === "fields"))) {
13502
13507
  combinedPlugins.push(fieldsPlugin());
13503
13508
  }
@@ -17,8 +17,8 @@ import {
17
17
  setDeep,
18
18
  useGetPuck,
19
19
  usePuck
20
- } from "./chunk-K66K75HC.mjs";
21
- import "./chunk-ZPR7EC3T.mjs";
20
+ } from "./chunk-DTIQ2L3Z.mjs";
21
+ import "./chunk-TROL7JRD.mjs";
22
22
  import {
23
23
  migrate,
24
24
  resolveAllData,
@@ -33,11 +33,11 @@ import {
33
33
  Label,
34
34
  RichTextMenu,
35
35
  Separator
36
- } from "./chunk-RYILZVCB.mjs";
37
- import "./chunk-UFXHMVJE.mjs";
38
- import "./chunk-MNNPATDB.mjs";
39
- import "./chunk-YBJ32VYI.mjs";
40
- import "./chunk-HLB66X4S.mjs";
36
+ } from "./chunk-FQ2H4O5Z.mjs";
37
+ import "./chunk-Y56V6PHT.mjs";
38
+ import "./chunk-74NIJIFH.mjs";
39
+ import "./chunk-W5GVFMJ2.mjs";
40
+ import "./chunk-7BNZGUYT.mjs";
41
41
  import "./chunk-QIJR53IK.mjs";
42
42
  import "./chunk-AHX7X7NZ.mjs";
43
43
  import "./chunk-Y2EFNT5P.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puckeditor/core",
3
- "version": "0.21.0",
3
+ "version": "0.21.1-canary.3d56139a",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Chris Villa <chris@puckeditor.com>",
6
6
  "repository": "puckeditor/puck",