@puckeditor/core 0.21.3 → 0.22.0-canary.08eaa6ba

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 (41) hide show
  1. package/README.md +1 -4
  2. package/dist/{Editor-MCVDFQH6.mjs → Editor-K6FPIMNH.mjs} +8 -8
  3. package/dist/{actions-C3e2nJ9v.d.mts → actions-Csn3gOP8.d.mts} +3 -1
  4. package/dist/{actions-C3e2nJ9v.d.ts → actions-Csn3gOP8.d.ts} +3 -1
  5. package/dist/{chunk-DPDJ67KA.mjs → chunk-4X2SLJRQ.mjs} +1 -1
  6. package/dist/{chunk-4HOGLOEA.mjs → chunk-6MO3E35Y.mjs} +5 -3
  7. package/dist/{chunk-X2ZFWNCU.mjs → chunk-CO6PRTVM.mjs} +12 -9
  8. package/dist/{chunk-6XCJ3Y7O.mjs → chunk-DVZWVU66.mjs} +55 -2
  9. package/dist/{chunk-TDQEUXB2.mjs → chunk-FE7T3PZI.mjs} +3 -3
  10. package/dist/{chunk-ZMTK7SMX.mjs → chunk-GFIZBMKN.mjs} +1 -1
  11. package/dist/{chunk-LODTL5KW.mjs → chunk-MQKADUDK.mjs} +1 -1
  12. package/dist/{chunk-YXFTA2VL.mjs → chunk-MYHXN3XX.mjs} +3131 -319
  13. package/dist/{chunk-HGJWUFLT.mjs → chunk-NWL4JLKR.mjs} +7 -7
  14. package/dist/{chunk-O7FT3KAM.mjs → chunk-OVPTKQ2P.mjs} +4 -3
  15. package/dist/{full-5QCBHXRC.mjs → full-L4ITHDQO.mjs} +7 -7
  16. package/dist/{index-Cx46WIFC.d.ts → index-B1b1cFug.d.ts} +1 -1
  17. package/dist/{index-zHrchQGY.d.mts → index-ClzBCbx_.d.mts} +1 -1
  18. package/dist/index.css +60 -54
  19. package/dist/index.d.mts +4 -4
  20. package/dist/index.d.ts +4 -4
  21. package/dist/index.js +3206 -326
  22. package/dist/index.mjs +10 -10
  23. package/dist/internal.d.mts +2 -2
  24. package/dist/internal.d.ts +2 -2
  25. package/dist/internal.js +48 -2
  26. package/dist/internal.mjs +1 -1
  27. package/dist/{loaded-Y4ZWZC55.mjs → loaded-2QS7VXZ6.mjs} +4 -4
  28. package/dist/{loaded-OMRIYZIQ.mjs → loaded-A7UUCT2O.mjs} +4 -4
  29. package/dist/{loaded-54625GTL.mjs → loaded-JHBS3QYA.mjs} +4 -4
  30. package/dist/no-external.css +60 -54
  31. package/dist/no-external.d.mts +3 -3
  32. package/dist/no-external.d.ts +3 -3
  33. package/dist/no-external.js +3206 -326
  34. package/dist/no-external.mjs +10 -10
  35. package/dist/rsc.d.mts +2 -2
  36. package/dist/rsc.d.ts +2 -2
  37. package/dist/rsc.js +16 -11
  38. package/dist/rsc.mjs +2 -2
  39. package/dist/{walk-tree-BJoNgZ0l.d.mts → walk-tree-BrW9VQ_t.d.mts} +1 -1
  40. package/dist/{walk-tree-f8Yzs5o3.d.ts → walk-tree-CWrsBHHe.d.ts} +1 -1
  41. package/package.json +13 -5
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  </picture>
10
10
  </a>
11
11
 
12
- _Create your own AI page builder_
12
+ _The visual editor for React_
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
 
@@ -42,7 +42,6 @@ Render the editor:
42
42
  ```jsx
43
43
  // Editor.jsx
44
44
  import { Puck } from "@puckeditor/core";
45
- import "@puckeditor/core/puck.css";
46
45
 
47
46
  // Create Puck component config
48
47
  const config = {
@@ -77,7 +76,6 @@ Render the page:
77
76
  ```jsx
78
77
  // Page.jsx
79
78
  import { Render } from "@puckeditor/core";
80
- import "@puckeditor/core/puck.css";
81
79
 
82
80
  export function Page() {
83
81
  return <Render config={config} data={data} />;
@@ -95,7 +93,6 @@ npx create-puck-app my-app
95
93
  Available recipes include:
96
94
 
97
95
  - [**next**](https://github.com/puckeditor/puck/tree/main/recipes/next): Next.js example, using App Router and static page generation
98
- - [**remix**](https://github.com/puckeditor/puck/tree/main/recipes/remix): Remix Run v2 example, using dynamic routes at root-level
99
96
  - [**react-router**](https://github.com/puckeditor/puck/tree/main/recipes/react-router): React Router v7 app example, using dynamic routes to create pages at any level
100
97
 
101
98
  ## Community
@@ -4,18 +4,18 @@ import {
4
4
  import {
5
5
  EditorInner,
6
6
  LoadedRichTextMenu
7
- } from "./chunk-TDQEUXB2.mjs";
7
+ } from "./chunk-FE7T3PZI.mjs";
8
8
  import "./chunk-AOEDIUVK.mjs";
9
- import "./chunk-HGJWUFLT.mjs";
10
- import "./chunk-DPDJ67KA.mjs";
11
- import "./chunk-ZMTK7SMX.mjs";
12
- import "./chunk-LODTL5KW.mjs";
9
+ import "./chunk-NWL4JLKR.mjs";
10
+ import "./chunk-4X2SLJRQ.mjs";
11
+ import "./chunk-GFIZBMKN.mjs";
12
+ import "./chunk-MQKADUDK.mjs";
13
13
  import {
14
14
  useAppStore,
15
15
  useAppStoreApi
16
- } from "./chunk-O7FT3KAM.mjs";
17
- import "./chunk-6XCJ3Y7O.mjs";
18
- import "./chunk-4HOGLOEA.mjs";
16
+ } from "./chunk-OVPTKQ2P.mjs";
17
+ import "./chunk-DVZWVU66.mjs";
18
+ import "./chunk-6MO3E35Y.mjs";
19
19
  import "./chunk-Y2EFNT5P.mjs";
20
20
  import "./chunk-SHVCBQDY.mjs";
21
21
  import {
@@ -430,6 +430,7 @@ UserField extends BaseField = {}> = {
430
430
  metadata: ComponentMetadata;
431
431
  trigger: ResolveDataTrigger;
432
432
  parent: ComponentData | null;
433
+ root: RootData;
433
434
  }) => Promise<WithPartialProps<DataShape, FieldProps>> | WithPartialProps<DataShape, FieldProps>;
434
435
  resolvePermissions?: (data: DataShape, params: {
435
436
  changed: Partial<Record<keyof FieldProps, boolean> & {
@@ -733,6 +734,7 @@ type Permissions = {
733
734
  type IframeConfig = {
734
735
  enabled?: boolean;
735
736
  waitForStyles?: boolean;
737
+ syncHostStyles?: boolean;
736
738
  };
737
739
  type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
738
740
  type Plugin<UserConfig extends Config = Config> = {
@@ -835,4 +837,4 @@ type PuckAction = {
835
837
  recordHistory?: boolean;
836
838
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
837
839
 
838
- export { type ExternalField as $, type AppState as A, type BaseData as B, type Config as C, type Data as D, type CacheOpts as E, type Fields as F, type ComponentConfigExtensions as G, type History as H, type IframeConfig as I, type ComponentConfigParams as J, type ComponentDataMap as K, type ComponentDataOptionalId as L, type Metadata as M, type ComponentMetadata as N, type OnAction as O, type PrivateAppState as P, type ConfigParams as Q, type RootData as R, type CustomField as S, type CustomFieldRender as T, type UserGenerics as U, type Viewports as V, type WithId as W, type DefaultRootProps as X, type DefaultRootRenderProps as Y, type Direction as Z, type DragAxis as _, type PuckAction as a, type ExternalFieldWithAdaptor as a0, type ExtractConfigParams as a1, type ExtractField as a2, type FieldMetadata as a3, type FieldRenderFunctions as a4, type FieldTransformFn as a5, type FieldTransformFnParams as a6, type ItemWithId as a7, type MappedItem as a8, type NumberField as a9, type ObjectField as aa, type OverrideKey as ab, type PuckComponent as ac, type PuckContext as ad, type PuckMetadata as ae, type RadioField as af, type RichText as ag, type RootConfig as ah, type RootDataWithoutProps as ai, type SelectField as aj, type Slot as ak, type SlotComponent as al, type SlotField as am, type TextField as an, type TextareaField as ao, type Viewport as ap, type WithChildren as aq, type WithPuckProps as ar, type WithSlotProps as as, overrideKeys as at, type Content as b, type ComponentData as c, type DefaultComponents as d, type DefaultComponentProps as e, type DefaultRootFieldProps as f, type Permissions as g, type RootDataWithProps as h, type ResolveDataTrigger as i, type Plugin as j, type Overrides as k, type UiState as l, type ComponentConfig as m, type FieldTransforms as n, type RichtextField as o, type Field as p, type FieldProps as q, type DropZoneProps as r, type InitialHistory as s, type ItemSelector as t, type PluginInternal as u, type Adaptor as v, type ArrayField as w, type ArrayState as x, type AsFieldProps as y, type BaseField as z };
840
+ export { type Permissions as $, type Adaptor as A, type BaseData as B, type CacheOpts as C, type Data as D, type ExternalField as E, type ExtractConfigParams as F, type ExtractField as G, type Field as H, type FieldMetadata as I, type FieldProps as J, type FieldRenderFunctions as K, type FieldTransformFn as L, type FieldTransformFnParams as M, type FieldTransforms as N, type Fields as O, type History as P, type IframeConfig as Q, type InitialHistory as R, type ItemSelector as S, type ItemWithId as T, type MappedItem as U, type Metadata as V, type NumberField as W, type ObjectField as X, type OnAction as Y, type OverrideKey as Z, type Overrides as _, type AppState as a, type Plugin as a0, type PluginInternal as a1, type PrivateAppState as a2, type PuckAction as a3, type PuckComponent as a4, type PuckContext as a5, type PuckMetadata as a6, type RadioField as a7, type ResolveDataTrigger as a8, type RichText as a9, type RichtextField as aa, type RootConfig as ab, type RootData as ac, type RootDataWithProps as ad, type RootDataWithoutProps as ae, type SelectField as af, type Slot as ag, type SlotComponent as ah, type SlotField as ai, type TextField as aj, type TextareaField as ak, type UiState as al, type UserGenerics as am, type Viewport as an, type Viewports as ao, type WithChildren as ap, type WithId as aq, type WithPuckProps as ar, type WithSlotProps as as, overrideKeys as at, type ArrayField as b, type ArrayState as c, type AsFieldProps as d, type BaseField as e, type ComponentConfig as f, type ComponentConfigExtensions as g, type ComponentConfigParams as h, type ComponentData as i, type ComponentDataMap as j, type ComponentDataOptionalId as k, type ComponentMetadata as l, type Config as m, type ConfigParams as n, type Content as o, type CustomField as p, type CustomFieldRender as q, type DefaultComponentProps as r, type DefaultComponents as s, type DefaultRootFieldProps as t, type DefaultRootProps as u, type DefaultRootRenderProps as v, type Direction as w, type DragAxis as x, type DropZoneProps as y, type ExternalFieldWithAdaptor as z };
@@ -430,6 +430,7 @@ UserField extends BaseField = {}> = {
430
430
  metadata: ComponentMetadata;
431
431
  trigger: ResolveDataTrigger;
432
432
  parent: ComponentData | null;
433
+ root: RootData;
433
434
  }) => Promise<WithPartialProps<DataShape, FieldProps>> | WithPartialProps<DataShape, FieldProps>;
434
435
  resolvePermissions?: (data: DataShape, params: {
435
436
  changed: Partial<Record<keyof FieldProps, boolean> & {
@@ -733,6 +734,7 @@ type Permissions = {
733
734
  type IframeConfig = {
734
735
  enabled?: boolean;
735
736
  waitForStyles?: boolean;
737
+ syncHostStyles?: boolean;
736
738
  };
737
739
  type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
738
740
  type Plugin<UserConfig extends Config = Config> = {
@@ -835,4 +837,4 @@ type PuckAction = {
835
837
  recordHistory?: boolean;
836
838
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
837
839
 
838
- export { type ExternalField as $, type AppState as A, type BaseData as B, type Config as C, type Data as D, type CacheOpts as E, type Fields as F, type ComponentConfigExtensions as G, type History as H, type IframeConfig as I, type ComponentConfigParams as J, type ComponentDataMap as K, type ComponentDataOptionalId as L, type Metadata as M, type ComponentMetadata as N, type OnAction as O, type PrivateAppState as P, type ConfigParams as Q, type RootData as R, type CustomField as S, type CustomFieldRender as T, type UserGenerics as U, type Viewports as V, type WithId as W, type DefaultRootProps as X, type DefaultRootRenderProps as Y, type Direction as Z, type DragAxis as _, type PuckAction as a, type ExternalFieldWithAdaptor as a0, type ExtractConfigParams as a1, type ExtractField as a2, type FieldMetadata as a3, type FieldRenderFunctions as a4, type FieldTransformFn as a5, type FieldTransformFnParams as a6, type ItemWithId as a7, type MappedItem as a8, type NumberField as a9, type ObjectField as aa, type OverrideKey as ab, type PuckComponent as ac, type PuckContext as ad, type PuckMetadata as ae, type RadioField as af, type RichText as ag, type RootConfig as ah, type RootDataWithoutProps as ai, type SelectField as aj, type Slot as ak, type SlotComponent as al, type SlotField as am, type TextField as an, type TextareaField as ao, type Viewport as ap, type WithChildren as aq, type WithPuckProps as ar, type WithSlotProps as as, overrideKeys as at, type Content as b, type ComponentData as c, type DefaultComponents as d, type DefaultComponentProps as e, type DefaultRootFieldProps as f, type Permissions as g, type RootDataWithProps as h, type ResolveDataTrigger as i, type Plugin as j, type Overrides as k, type UiState as l, type ComponentConfig as m, type FieldTransforms as n, type RichtextField as o, type Field as p, type FieldProps as q, type DropZoneProps as r, type InitialHistory as s, type ItemSelector as t, type PluginInternal as u, type Adaptor as v, type ArrayField as w, type ArrayState as x, type AsFieldProps as y, type BaseField as z };
840
+ export { type Permissions as $, type Adaptor as A, type BaseData as B, type CacheOpts as C, type Data as D, type ExternalField as E, type ExtractConfigParams as F, type ExtractField as G, type Field as H, type FieldMetadata as I, type FieldProps as J, type FieldRenderFunctions as K, type FieldTransformFn as L, type FieldTransformFnParams as M, type FieldTransforms as N, type Fields as O, type History as P, type IframeConfig as Q, type InitialHistory as R, type ItemSelector as S, type ItemWithId as T, type MappedItem as U, type Metadata as V, type NumberField as W, type ObjectField as X, type OnAction as Y, type OverrideKey as Z, type Overrides as _, type AppState as a, type Plugin as a0, type PluginInternal as a1, type PrivateAppState as a2, type PuckAction as a3, type PuckComponent as a4, type PuckContext as a5, type PuckMetadata as a6, type RadioField as a7, type ResolveDataTrigger as a8, type RichText as a9, type RichtextField as aa, type RootConfig as ab, type RootData as ac, type RootDataWithProps as ad, type RootDataWithoutProps as ae, type SelectField as af, type Slot as ag, type SlotComponent as ah, type SlotField as ai, type TextField as aj, type TextareaField as ak, type UiState as al, type UserGenerics as am, type Viewport as an, type Viewports as ao, type WithChildren as ap, type WithId as aq, type WithPuckProps as ar, type WithSlotProps as as, overrideKeys as at, type ArrayField as b, type ArrayState as c, type AsFieldProps as d, type BaseField as e, type ComponentConfig as f, type ComponentConfigExtensions as g, type ComponentConfigParams as h, type ComponentData as i, type ComponentDataMap as j, type ComponentDataOptionalId as k, type ComponentMetadata as l, type Config as m, type ConfigParams as n, type Content as o, type CustomField as p, type CustomFieldRender as q, type DefaultComponentProps as r, type DefaultComponents as s, type DefaultRootFieldProps as t, type DefaultRootProps as u, type DefaultRootRenderProps as v, type Direction as w, type DragAxis as x, type DropZoneProps as y, type ExternalFieldWithAdaptor as z };
@@ -3,7 +3,7 @@ import {
3
3
  AlignJustify,
4
4
  AlignLeft,
5
5
  AlignRight
6
- } from "./chunk-O7FT3KAM.mjs";
6
+ } from "./chunk-OVPTKQ2P.mjs";
7
7
  import {
8
8
  init_react_import
9
9
  } from "./chunk-M6W7YEVX.mjs";
@@ -37,7 +37,7 @@ var getChanged = (newItem, oldItem) => {
37
37
  // lib/resolve-component-data.ts
38
38
  import { deepEqual as deepEqual2 } from "fast-equals";
39
39
  var cache = { lastChange: {} };
40
- var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace", parent = null) {
40
+ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace", parent = null, root = { props: {} }) {
41
41
  const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
42
42
  const resolvedItem = __spreadValues({}, item);
43
43
  const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
@@ -64,7 +64,8 @@ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], fun
64
64
  lastData: oldItem,
65
65
  metadata: __spreadValues(__spreadValues({}, metadata), configForItem.metadata),
66
66
  trigger,
67
- parent
67
+ parent,
68
+ root
68
69
  });
69
70
  resolvedItem.props = __spreadValues(__spreadValues({}, item.props), resolvedProps);
70
71
  if (Object.keys(readOnly).length) {
@@ -87,7 +88,8 @@ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], fun
87
88
  onResolveStart,
88
89
  onResolveEnd,
89
90
  trigger,
90
- itemAsComponentData
91
+ itemAsComponentData,
92
+ root
91
93
  )).node;
92
94
  })
93
95
  )
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  defaultAppState,
6
6
  resolveComponentData
7
- } from "./chunk-4HOGLOEA.mjs";
7
+ } from "./chunk-6MO3E35Y.mjs";
8
8
  import {
9
9
  get_class_name_factory_default
10
10
  } from "./chunk-Y2EFNT5P.mjs";
@@ -210,7 +210,7 @@ function resolveAllData(_0, _1) {
210
210
  const defaultedData = defaultData(data);
211
211
  const zonesByComponent = groupZonesByComponent(defaultedData);
212
212
  let resolvedZones = {};
213
- const resolveNode = (_node, parent) => __async(null, null, function* () {
213
+ const resolveNode = (_node, parent, root) => __async(null, null, function* () {
214
214
  const node = toComponent(_node);
215
215
  onResolveStart == null ? void 0 : onResolveStart(node);
216
216
  const resolved = (yield resolveComponentData(
@@ -222,13 +222,14 @@ function resolveAllData(_0, _1) {
222
222
  () => {
223
223
  },
224
224
  "force",
225
- parent
225
+ parent,
226
+ root
226
227
  )).node;
227
228
  const resolvedAsComponent = toComponent(resolved);
228
229
  const resolvedDeepPromise = mapFields(
229
230
  resolved,
230
231
  {
231
- slot: ({ value }) => processContent(value, resolvedAsComponent)
232
+ slot: ({ value }) => processContent(value, resolvedAsComponent, root)
232
233
  },
233
234
  config
234
235
  );
@@ -238,7 +239,8 @@ function resolveAllData(_0, _1) {
238
239
  (_02) => __async(null, [_02], function* ({ zoneCompound, content }) {
239
240
  resolvedZones[zoneCompound] = yield processContent(
240
241
  content,
241
- resolvedAsComponent
242
+ resolvedAsComponent,
243
+ root
242
244
  );
243
245
  })
244
246
  );
@@ -248,14 +250,15 @@ function resolveAllData(_0, _1) {
248
250
  onResolveEnd == null ? void 0 : onResolveEnd(toComponent(resolvedDeep));
249
251
  return resolvedDeep;
250
252
  });
251
- const processContent = (content, parent) => __async(null, null, function* () {
252
- return Promise.all(content.map((item) => resolveNode(item, parent)));
253
+ const processContent = (content, parent, root) => __async(null, null, function* () {
254
+ return Promise.all(content.map((item) => resolveNode(item, parent, root)));
253
255
  });
254
256
  const result = defaultData({});
255
- result.root = yield resolveNode(defaultedData.root, null);
257
+ result.root = yield resolveNode(defaultedData.root, null, defaultedData.root);
256
258
  result.content = yield processContent(
257
259
  defaultedData.content,
258
- toComponent(result.root)
260
+ toComponent(result.root),
261
+ result.root
259
262
  );
260
263
  result.zones = resolvedZones;
261
264
  return result;
@@ -42,8 +42,61 @@ var insert = (list, index, item) => {
42
42
 
43
43
  // lib/generate-id.ts
44
44
  init_react_import();
45
- import { v4 as uuidv4 } from "uuid";
46
- var generateId = (type) => type ? `${type}-${uuidv4()}` : uuidv4();
45
+
46
+ // lib/uuid/index.ts
47
+ init_react_import();
48
+
49
+ // lib/uuid/rng.ts
50
+ init_react_import();
51
+ var rnds8 = new Uint8Array(16);
52
+ function rng() {
53
+ return crypto.getRandomValues(rnds8);
54
+ }
55
+
56
+ // lib/uuid/stringify.ts
57
+ init_react_import();
58
+ var byteToHex = [];
59
+ for (let i = 0; i < 256; ++i) {
60
+ byteToHex.push((i + 256).toString(16).slice(1));
61
+ }
62
+ function unsafeStringify(arr, offset = 0) {
63
+ return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
64
+ }
65
+
66
+ // lib/uuid/index.ts
67
+ function v4(options, buf, offset) {
68
+ if (!buf && !options && crypto.randomUUID) {
69
+ return crypto.randomUUID();
70
+ }
71
+ return _v4(options, buf, offset);
72
+ }
73
+ function _v4(options, buf, offset) {
74
+ var _a, _b, _c;
75
+ options = options || {};
76
+ const rnds = (_c = (_b = options.random) != null ? _b : (_a = options.rng) == null ? void 0 : _a.call(options)) != null ? _c : rng();
77
+ if (rnds.length < 16) {
78
+ throw new Error("Random bytes length must be >= 16");
79
+ }
80
+ rnds[6] = rnds[6] & 15 | 64;
81
+ rnds[8] = rnds[8] & 63 | 128;
82
+ if (buf) {
83
+ offset = offset || 0;
84
+ if (offset < 0 || offset + 16 > buf.length) {
85
+ throw new RangeError(
86
+ `UUID byte range ${offset}:${offset + 15} is out of buffer bounds`
87
+ );
88
+ }
89
+ for (let i = 0; i < 16; ++i) {
90
+ buf[offset + i] = rnds[i];
91
+ }
92
+ return buf;
93
+ }
94
+ return unsafeStringify(rnds);
95
+ }
96
+ var uuid_default = v4;
97
+
98
+ // lib/generate-id.ts
99
+ var generateId = (type) => type ? `${type}-${uuid_default()}` : uuid_default();
47
100
 
48
101
  // lib/data/get-ids-for-parent.ts
49
102
  init_react_import();
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-AOEDIUVK.mjs";
4
4
  import {
5
5
  LoadedRichTextMenuInner
6
- } from "./chunk-HGJWUFLT.mjs";
6
+ } from "./chunk-NWL4JLKR.mjs";
7
7
  import {
8
8
  useAppStore,
9
9
  useAppStoreApi
10
- } from "./chunk-O7FT3KAM.mjs";
10
+ } from "./chunk-OVPTKQ2P.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-5QCBHXRC.mjs").then((m) => ({
103
+ () => import("./full-L4ITHDQO.mjs").then((m) => ({
104
104
  default: m.LoadedRichTextMenuFull
105
105
  }))
106
106
  );
@@ -5,7 +5,7 @@ import {
5
5
  Heading4,
6
6
  Heading5,
7
7
  Heading6
8
- } from "./chunk-O7FT3KAM.mjs";
8
+ } from "./chunk-OVPTKQ2P.mjs";
9
9
  import {
10
10
  init_react_import
11
11
  } from "./chunk-M6W7YEVX.mjs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  List,
3
3
  ListOrdered
4
- } from "./chunk-O7FT3KAM.mjs";
4
+ } from "./chunk-OVPTKQ2P.mjs";
5
5
  import {
6
6
  init_react_import
7
7
  } from "./chunk-M6W7YEVX.mjs";