@puckeditor/core 0.22.0-canary.d4985bc0 → 0.22.0-canary.e741fbb0

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/dist/{Editor-NK3TZSR6.mjs → Editor-B4XBFE6T.mjs} +9 -9
  2. package/dist/{actions-BrxBrqKj.d.mts → actions-WBE4JXM_.d.mts} +3 -3
  3. package/dist/{actions-BrxBrqKj.d.ts → actions-WBE4JXM_.d.ts} +3 -3
  4. package/dist/{chunk-MDUBGHWF.mjs → chunk-6MDV6FPH.mjs} +10 -15
  5. package/dist/{chunk-PMXRXC2B.mjs → chunk-754HNMU2.mjs} +18 -11
  6. package/dist/{chunk-MSZPUXZP.mjs → chunk-FVCNE73M.mjs} +1 -1
  7. package/dist/{chunk-KOUWDQ4Q.mjs → chunk-IRT55QMB.mjs} +1 -1
  8. package/dist/{chunk-5V242HXR.mjs → chunk-LFUXRW6C.mjs} +7 -7
  9. package/dist/{chunk-TNORMHZU.mjs → chunk-LWA6664X.mjs} +15 -11
  10. package/dist/{chunk-RHVK562Z.mjs → chunk-MODCHPUF.mjs} +3 -3
  11. package/dist/{chunk-SKJTJUWU.mjs → chunk-R27N4Y2L.mjs} +1 -1
  12. package/dist/{chunk-UMTU6EA7.mjs → chunk-TTQH6OMN.mjs} +59 -48
  13. package/dist/{chunk-37HTE4KO.mjs → chunk-YLLE6KXH.mjs} +1 -1
  14. package/dist/{chunk-ZUKMN2UE.mjs → chunk-Z6HTWEAL.mjs} +4355 -3832
  15. package/dist/{full-KLPRWVS4.mjs → full-JULOSDQK.mjs} +8 -8
  16. package/dist/{index-GB3Q5h0c.d.ts → index-DH7q-bs9.d.ts} +9 -10
  17. package/dist/{index-sczExwEC.d.mts → index-rW_NN8GM.d.mts} +9 -10
  18. package/dist/index.css +21 -20
  19. package/dist/index.d.mts +5 -4
  20. package/dist/index.d.ts +5 -4
  21. package/dist/index.js +1351 -827
  22. package/dist/index.mjs +17 -12
  23. package/dist/internal.d.mts +2 -2
  24. package/dist/internal.d.ts +2 -2
  25. package/dist/internal.js +16 -11
  26. package/dist/internal.mjs +2 -2
  27. package/dist/{loaded-362ACKSQ.mjs → loaded-33PTDNED.mjs} +5 -5
  28. package/dist/{loaded-DIHUQBWF.mjs → loaded-ON3FMYL5.mjs} +5 -5
  29. package/dist/{loaded-SJJ63OY2.mjs → loaded-S64W25CI.mjs} +5 -5
  30. package/dist/no-external.css +164 -167
  31. package/dist/no-external.d.mts +3 -3
  32. package/dist/no-external.d.ts +3 -3
  33. package/dist/no-external.js +1345 -824
  34. package/dist/no-external.mjs +11 -11
  35. package/dist/rsc.d.mts +2 -2
  36. package/dist/rsc.d.ts +2 -2
  37. package/dist/rsc.js +68 -45
  38. package/dist/rsc.mjs +45 -27
  39. package/dist/{walk-tree-CQfHfM9_.d.mts → walk-tree-BAQ1Jdlh.d.mts} +1 -1
  40. package/dist/{walk-tree-B8hGlO4f.d.ts → walk-tree-CagzlNEC.d.ts} +1 -1
  41. package/package.json +2 -1
@@ -4,20 +4,20 @@ import {
4
4
  import {
5
5
  EditorInner,
6
6
  LoadedRichTextMenu
7
- } from "./chunk-RHVK562Z.mjs";
7
+ } from "./chunk-MODCHPUF.mjs";
8
8
  import "./chunk-AOEDIUVK.mjs";
9
- import "./chunk-5V242HXR.mjs";
10
- import "./chunk-MSZPUXZP.mjs";
11
- import "./chunk-KOUWDQ4Q.mjs";
12
- import "./chunk-SKJTJUWU.mjs";
9
+ import "./chunk-LFUXRW6C.mjs";
10
+ import "./chunk-FVCNE73M.mjs";
11
+ import "./chunk-IRT55QMB.mjs";
12
+ import "./chunk-R27N4Y2L.mjs";
13
13
  import {
14
14
  useAppStore,
15
15
  useAppStoreApi
16
- } from "./chunk-UMTU6EA7.mjs";
17
- import "./chunk-37HTE4KO.mjs";
18
- import "./chunk-MDUBGHWF.mjs";
16
+ } from "./chunk-TTQH6OMN.mjs";
17
+ import "./chunk-YLLE6KXH.mjs";
18
+ import "./chunk-6MDV6FPH.mjs";
19
19
  import "./chunk-Y2EFNT5P.mjs";
20
- import "./chunk-PMXRXC2B.mjs";
20
+ import "./chunk-754HNMU2.mjs";
21
21
  import {
22
22
  __spreadProps,
23
23
  __spreadValues,
@@ -308,7 +308,7 @@ type CustomFieldRender<Value extends any> = (props: {
308
308
  name: string;
309
309
  id: string;
310
310
  value: Value;
311
- onChange: (value: Value) => void;
311
+ onChange: (value: Value, uiState?: Partial<UiState>) => void;
312
312
  readOnly?: boolean;
313
313
  }) => ReactElement;
314
314
  interface CustomField<Value extends any> extends BaseField {
@@ -430,6 +430,7 @@ UserField extends BaseField = {}> = {
430
430
  metadata: ComponentMetadata;
431
431
  trigger: ResolveDataTrigger;
432
432
  parent: ComponentData | null;
433
+ root: ComponentData | null;
433
434
  }) => Promise<WithPartialProps<DataShape, FieldProps>> | WithPartialProps<DataShape, FieldProps>;
434
435
  resolvePermissions?: (data: DataShape, params: {
435
436
  changed: Partial<Record<keyof FieldProps, boolean> & {
@@ -733,7 +734,6 @@ type Permissions = {
733
734
  type IframeConfig = {
734
735
  enabled?: boolean;
735
736
  waitForStyles?: boolean;
736
- srcDoc?: string;
737
737
  };
738
738
  type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
739
739
  type Plugin<UserConfig extends Config = Config> = {
@@ -836,4 +836,4 @@ type PuckAction = {
836
836
  recordHistory?: boolean;
837
837
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
838
838
 
839
- export { type ComponentConfigParams as $, type AppState as A, type FieldTransformFnParams as B, type Config as C, type Data as D, type FieldTransformFn as E, type Fields as F, overrideKeys as G, type History as H, type IframeConfig as I, type OverrideKey as J, type FieldRenderFunctions as K, type ItemWithId as L, type Metadata as M, type ArrayState as N, type OnAction as O, type PrivateAppState as P, type SlotComponent as Q, type RootData as R, type Slot as S, type PuckComponent as T, type UserGenerics as U, type Viewports as V, type WithId as W, type ComponentConfigExtensions as X, type RootConfig as Y, type ExtractConfigParams as Z, type ConfigParams as _, type PuckAction as a, type BaseData as a0, type RootDataWithoutProps as a1, type ComponentDataOptionalId as a2, type MappedItem as a3, type ComponentDataMap as a4, type PuckMetadata as a5, type ComponentMetadata as a6, type FieldMetadata as a7, type BaseField as a8, type TextField as a9, type NumberField as aa, type TextareaField as ab, type SelectField as ac, type RadioField as ad, type ArrayField as ae, type ObjectField as af, type Adaptor as ag, type ExternalFieldWithAdaptor as ah, type CacheOpts as ai, type ExternalField as aj, type CustomFieldRender as ak, type CustomField as al, type SlotField as am, type PuckContext as an, type DefaultRootRenderProps as ao, type DefaultRootProps as ap, type WithPuckProps as aq, type AsFieldProps as ar, type WithChildren as as, type ExtractField 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 WithSlotProps as v, type RichText as w, type Direction as x, type DragAxis as y, type Viewport as z };
839
+ 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 };
@@ -308,7 +308,7 @@ type CustomFieldRender<Value extends any> = (props: {
308
308
  name: string;
309
309
  id: string;
310
310
  value: Value;
311
- onChange: (value: Value) => void;
311
+ onChange: (value: Value, uiState?: Partial<UiState>) => void;
312
312
  readOnly?: boolean;
313
313
  }) => ReactElement;
314
314
  interface CustomField<Value extends any> extends BaseField {
@@ -430,6 +430,7 @@ UserField extends BaseField = {}> = {
430
430
  metadata: ComponentMetadata;
431
431
  trigger: ResolveDataTrigger;
432
432
  parent: ComponentData | null;
433
+ root: ComponentData | null;
433
434
  }) => Promise<WithPartialProps<DataShape, FieldProps>> | WithPartialProps<DataShape, FieldProps>;
434
435
  resolvePermissions?: (data: DataShape, params: {
435
436
  changed: Partial<Record<keyof FieldProps, boolean> & {
@@ -733,7 +734,6 @@ type Permissions = {
733
734
  type IframeConfig = {
734
735
  enabled?: boolean;
735
736
  waitForStyles?: boolean;
736
- srcDoc?: string;
737
737
  };
738
738
  type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
739
739
  type Plugin<UserConfig extends Config = Config> = {
@@ -836,4 +836,4 @@ type PuckAction = {
836
836
  recordHistory?: boolean;
837
837
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
838
838
 
839
- export { type ComponentConfigParams as $, type AppState as A, type FieldTransformFnParams as B, type Config as C, type Data as D, type FieldTransformFn as E, type Fields as F, overrideKeys as G, type History as H, type IframeConfig as I, type OverrideKey as J, type FieldRenderFunctions as K, type ItemWithId as L, type Metadata as M, type ArrayState as N, type OnAction as O, type PrivateAppState as P, type SlotComponent as Q, type RootData as R, type Slot as S, type PuckComponent as T, type UserGenerics as U, type Viewports as V, type WithId as W, type ComponentConfigExtensions as X, type RootConfig as Y, type ExtractConfigParams as Z, type ConfigParams as _, type PuckAction as a, type BaseData as a0, type RootDataWithoutProps as a1, type ComponentDataOptionalId as a2, type MappedItem as a3, type ComponentDataMap as a4, type PuckMetadata as a5, type ComponentMetadata as a6, type FieldMetadata as a7, type BaseField as a8, type TextField as a9, type NumberField as aa, type TextareaField as ab, type SelectField as ac, type RadioField as ad, type ArrayField as ae, type ObjectField as af, type Adaptor as ag, type ExternalFieldWithAdaptor as ah, type CacheOpts as ai, type ExternalField as aj, type CustomFieldRender as ak, type CustomField as al, type SlotField as am, type PuckContext as an, type DefaultRootRenderProps as ao, type DefaultRootProps as ap, type WithPuckProps as aq, type AsFieldProps as ar, type WithChildren as as, type ExtractField 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 WithSlotProps as v, type RichText as w, type Direction as x, type DragAxis as y, type Viewport as z };
839
+ 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 };
@@ -1,6 +1,7 @@
1
1
  import {
2
- mapFields
3
- } from "./chunk-PMXRXC2B.mjs";
2
+ mapFields,
3
+ toComponent
4
+ } from "./chunk-754HNMU2.mjs";
4
5
  import {
5
6
  __async,
6
7
  __spreadProps,
@@ -17,15 +18,6 @@ var defaultViewports = [
17
18
  { width: "100%", height: "auto", icon: "FullWidth", label: "Full-width" }
18
19
  ];
19
20
 
20
- // lib/data/to-component.ts
21
- init_react_import();
22
- var toComponent = (item) => {
23
- return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
24
- props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
25
- type: "root"
26
- });
27
- };
28
-
29
21
  // lib/resolve-component-data.ts
30
22
  init_react_import();
31
23
 
@@ -45,11 +37,12 @@ var getChanged = (newItem, oldItem) => {
45
37
  // lib/resolve-component-data.ts
46
38
  import { deepEqual as deepEqual2 } from "fast-equals";
47
39
  var cache = { lastChange: {} };
48
- 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 = null) {
49
41
  const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
50
42
  const resolvedItem = __spreadValues({}, item);
51
43
  const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
52
44
  const id = "id" in item.props ? item.props.id : "root";
45
+ const rootForItem = root != null ? root : "type" in item && item.type === "root" ? toComponent(item) : null;
53
46
  if (shouldRunResolver) {
54
47
  const {
55
48
  item: oldItem = null,
@@ -72,7 +65,8 @@ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], fun
72
65
  lastData: oldItem,
73
66
  metadata: __spreadValues(__spreadValues({}, metadata), configForItem.metadata),
74
67
  trigger,
75
- parent
68
+ parent,
69
+ root: rootForItem
76
70
  });
77
71
  resolvedItem.props = __spreadValues(__spreadValues({}, item.props), resolvedProps);
78
72
  if (Object.keys(readOnly).length) {
@@ -80,6 +74,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], fun
80
74
  }
81
75
  }
82
76
  const itemAsComponentData = toComponent(resolvedItem);
77
+ const rootForChildren = itemAsComponentData.type === "root" ? itemAsComponentData : rootForItem;
83
78
  let itemWithResolvedChildren = yield mapFields(
84
79
  resolvedItem,
85
80
  {
@@ -95,7 +90,8 @@ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], fun
95
90
  onResolveStart,
96
91
  onResolveEnd,
97
92
  trigger,
98
- itemAsComponentData
93
+ itemAsComponentData,
94
+ rootForChildren
99
95
  )).node;
100
96
  })
101
97
  )
@@ -150,7 +146,6 @@ var defaultAppState = {
150
146
  export {
151
147
  defaultViewports,
152
148
  getChanged,
153
- toComponent,
154
149
  resolveComponentData,
155
150
  defaultAppState
156
151
  };
@@ -267,6 +267,15 @@ var expandNode = (node) => {
267
267
  });
268
268
  };
269
269
 
270
+ // lib/data/to-component.ts
271
+ init_react_import();
272
+ var toComponent = (item) => {
273
+ return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
274
+ props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
275
+ type: "root"
276
+ });
277
+ };
278
+
270
279
  // lib/data/walk-app-state.ts
271
280
  init_react_import();
272
281
 
@@ -358,7 +367,7 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
358
367
  id
359
368
  });
360
369
  processRelatedZones(item, id, path);
361
- const newItem = __spreadProps(__spreadValues({}, item), { props: newProps });
370
+ const newItem = __spreadProps(__spreadValues({}, mappedItem), { props: newProps });
362
371
  const thisZoneCompound = path[path.length - 1];
363
372
  const [parentId, zone] = thisZoneCompound ? thisZoneCompound.split(":") : [null, ""];
364
373
  newNodeIndex[id] = {
@@ -398,17 +407,14 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
398
407
  );
399
408
  newZones[zoneCompound] = newContent2;
400
409
  }, newZones);
401
- const processedRoot = processItem(
402
- {
403
- type: "root",
404
- props: __spreadProps(__spreadValues({}, (_a = state.data.root.props) != null ? _a : state.data.root), { id: "root" })
405
- },
406
- [],
407
- -1
408
- );
409
- const root = __spreadProps(__spreadValues({}, state.data.root), {
410
- props: processedRoot.props
410
+ let rootAsComponent = toComponent({
411
+ props: __spreadValues({}, (_a = state.data.root.props) != null ? _a : state.data.root)
411
412
  });
413
+ if (state.data.root.readOnly) {
414
+ rootAsComponent.readOnly = state.data.root.readOnly;
415
+ }
416
+ const processedRoot = processItem(rootAsComponent, [], -1);
417
+ const root = __spreadValues(__spreadValues({}, state.data.root), processedRoot);
412
418
  return __spreadProps(__spreadValues({}, state), {
413
419
  data: {
414
420
  root,
@@ -449,6 +455,7 @@ export {
449
455
  walkField,
450
456
  mapFields,
451
457
  expandNode,
458
+ toComponent,
452
459
  walkAppState,
453
460
  generateId,
454
461
  walkTree,
@@ -3,7 +3,7 @@ import {
3
3
  AlignJustify,
4
4
  AlignLeft,
5
5
  AlignRight
6
- } from "./chunk-UMTU6EA7.mjs";
6
+ } from "./chunk-TTQH6OMN.mjs";
7
7
  import {
8
8
  init_react_import
9
9
  } from "./chunk-M6W7YEVX.mjs";
@@ -5,7 +5,7 @@ import {
5
5
  Heading4,
6
6
  Heading5,
7
7
  Heading6
8
- } from "./chunk-UMTU6EA7.mjs";
8
+ } from "./chunk-TTQH6OMN.mjs";
9
9
  import {
10
10
  init_react_import
11
11
  } from "./chunk-M6W7YEVX.mjs";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  useAlignOptions
3
- } from "./chunk-MSZPUXZP.mjs";
3
+ } from "./chunk-FVCNE73M.mjs";
4
4
  import {
5
5
  useHeadingOptions
6
- } from "./chunk-KOUWDQ4Q.mjs";
6
+ } from "./chunk-IRT55QMB.mjs";
7
7
  import {
8
8
  useListOptions
9
- } from "./chunk-SKJTJUWU.mjs";
9
+ } from "./chunk-R27N4Y2L.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-UMTU6EA7.mjs";
29
+ } from "./chunk-TTQH6OMN.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-362ACKSQ.mjs").then((m) => ({
352
+ () => import("./loaded-33PTDNED.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-DIHUQBWF.mjs").then((m) => ({
583
+ () => import("./loaded-ON3FMYL5.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-SJJ63OY2.mjs").then((m) => ({
615
+ () => import("./loaded-S64W25CI.mjs").then((m) => ({
616
616
  default: m.ListSelectLoaded
617
617
  }))
618
618
  );
@@ -3,9 +3,8 @@ import {
3
3
  } from "./chunk-AOEDIUVK.mjs";
4
4
  import {
5
5
  defaultAppState,
6
- resolveComponentData,
7
- toComponent
8
- } from "./chunk-MDUBGHWF.mjs";
6
+ resolveComponentData
7
+ } from "./chunk-6MDV6FPH.mjs";
9
8
  import {
10
9
  get_class_name_factory_default
11
10
  } from "./chunk-Y2EFNT5P.mjs";
@@ -13,9 +12,10 @@ import {
13
12
  generateId,
14
13
  getZoneId,
15
14
  mapFields,
15
+ toComponent,
16
16
  walkAppState,
17
17
  walkTree
18
- } from "./chunk-PMXRXC2B.mjs";
18
+ } from "./chunk-754HNMU2.mjs";
19
19
  import {
20
20
  __async,
21
21
  __objRest,
@@ -211,7 +211,7 @@ function resolveAllData(_0, _1) {
211
211
  const defaultedData = defaultData(data);
212
212
  const zonesByComponent = groupZonesByComponent(defaultedData);
213
213
  let resolvedZones = {};
214
- const resolveNode = (_node, parent) => __async(null, null, function* () {
214
+ const resolveNode = (_node, parent, root) => __async(null, null, function* () {
215
215
  const node = toComponent(_node);
216
216
  onResolveStart == null ? void 0 : onResolveStart(node);
217
217
  const resolved = (yield resolveComponentData(
@@ -223,13 +223,15 @@ function resolveAllData(_0, _1) {
223
223
  () => {
224
224
  },
225
225
  "force",
226
- parent
226
+ parent,
227
+ root
227
228
  )).node;
228
229
  const resolvedAsComponent = toComponent(resolved);
230
+ const rootForChildren = resolvedAsComponent.type === "root" ? resolvedAsComponent : root;
229
231
  const resolvedDeepPromise = mapFields(
230
232
  resolved,
231
233
  {
232
- slot: ({ value }) => processContent(value, resolvedAsComponent)
234
+ slot: ({ value }) => processContent(value, resolvedAsComponent, rootForChildren)
233
235
  },
234
236
  config
235
237
  );
@@ -239,7 +241,8 @@ function resolveAllData(_0, _1) {
239
241
  (_02) => __async(null, [_02], function* ({ zoneCompound, content }) {
240
242
  resolvedZones[zoneCompound] = yield processContent(
241
243
  content,
242
- resolvedAsComponent
244
+ resolvedAsComponent,
245
+ rootForChildren
243
246
  );
244
247
  })
245
248
  );
@@ -249,13 +252,14 @@ function resolveAllData(_0, _1) {
249
252
  onResolveEnd == null ? void 0 : onResolveEnd(toComponent(resolvedDeep));
250
253
  return resolvedDeep;
251
254
  });
252
- const processContent = (content, parent) => __async(null, null, function* () {
253
- return Promise.all(content.map((item) => resolveNode(item, parent)));
255
+ const processContent = (content, parent, root) => __async(null, null, function* () {
256
+ return Promise.all(content.map((item) => resolveNode(item, parent, root)));
254
257
  });
255
258
  const result = defaultData({});
256
- result.root = yield resolveNode(defaultedData.root, null);
259
+ result.root = yield resolveNode(defaultedData.root, null, null);
257
260
  result.content = yield processContent(
258
261
  defaultedData.content,
262
+ toComponent(result.root),
259
263
  toComponent(result.root)
260
264
  );
261
265
  result.zones = resolvedZones;
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-AOEDIUVK.mjs";
4
4
  import {
5
5
  LoadedRichTextMenuInner
6
- } from "./chunk-5V242HXR.mjs";
6
+ } from "./chunk-LFUXRW6C.mjs";
7
7
  import {
8
8
  useAppStore,
9
9
  useAppStoreApi
10
- } from "./chunk-UMTU6EA7.mjs";
10
+ } from "./chunk-TTQH6OMN.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-KLPRWVS4.mjs").then((m) => ({
103
+ () => import("./full-JULOSDQK.mjs").then((m) => ({
104
104
  default: m.LoadedRichTextMenuFull
105
105
  }))
106
106
  );
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  List,
3
3
  ListOrdered
4
- } from "./chunk-UMTU6EA7.mjs";
4
+ } from "./chunk-TTQH6OMN.mjs";
5
5
  import {
6
6
  init_react_import
7
7
  } from "./chunk-M6W7YEVX.mjs";
@@ -2,20 +2,21 @@ import {
2
2
  createReducer,
3
3
  getItem,
4
4
  makeStatePublic
5
- } from "./chunk-37HTE4KO.mjs";
5
+ } from "./chunk-YLLE6KXH.mjs";
6
6
  import {
7
7
  defaultAppState,
8
8
  defaultViewports,
9
9
  getChanged,
10
10
  resolveComponentData
11
- } from "./chunk-MDUBGHWF.mjs";
11
+ } from "./chunk-6MDV6FPH.mjs";
12
12
  import {
13
13
  get_class_name_factory_default
14
14
  } from "./chunk-Y2EFNT5P.mjs";
15
15
  import {
16
16
  generateId,
17
+ toComponent,
17
18
  walkAppState
18
- } from "./chunk-PMXRXC2B.mjs";
19
+ } from "./chunk-754HNMU2.mjs";
19
20
  import {
20
21
  __async,
21
22
  __objRest,
@@ -649,7 +650,8 @@ var keyCodeMap = {
649
650
  KeyY: "y",
650
651
  KeyZ: "z",
651
652
  Delete: "delete",
652
- Backspace: "backspace"
653
+ Backspace: "backspace",
654
+ AltRight: "altRight"
653
655
  };
654
656
  var useHotkeyStore = create()(
655
657
  subscribeWithSelector((set) => ({
@@ -662,6 +664,10 @@ var useHotkeyStore = create()(
662
664
  );
663
665
  var monitorHotkeys = (doc) => {
664
666
  const onKeyDown = (e) => {
667
+ if (e.getModifierState("AltGraph")) {
668
+ useHotkeyStore.getState().hold("altRight");
669
+ return;
670
+ }
665
671
  const key = keyCodeMap[e.code];
666
672
  if (key) {
667
673
  useHotkeyStore.getState().hold(key);
@@ -685,6 +691,10 @@ var monitorHotkeys = (doc) => {
685
691
  }
686
692
  };
687
693
  const onKeyUp = (e) => {
694
+ if (!e.getModifierState("AltGraph") && e.code === "ControlRight") {
695
+ useHotkeyStore.getState().release("altRight");
696
+ return;
697
+ }
688
698
  const key = keyCodeMap[e.code];
689
699
  if (key) {
690
700
  if (key === "meta") {
@@ -842,54 +852,49 @@ function useRegisterHistorySlice(appStore, {
842
852
  const forward = () => {
843
853
  appStore.getState().history.forward();
844
854
  };
845
- useHotkey({ meta: true, z: true }, back);
846
- useHotkey({ meta: true, shift: true, z: true }, forward);
847
- useHotkey({ meta: true, y: true }, forward);
848
- useHotkey({ ctrl: true, z: true }, back);
849
- useHotkey({ ctrl: true, shift: true, z: true }, forward);
850
- useHotkey({ ctrl: true, y: true }, forward);
855
+ useHotkey({ altRight: false, meta: true, z: true }, back);
856
+ useHotkey({ altRight: false, meta: true, shift: true, z: true }, forward);
857
+ useHotkey({ altRight: false, meta: true, y: true }, forward);
858
+ useHotkey({ altRight: false, ctrl: true, z: true }, back);
859
+ useHotkey({ altRight: false, ctrl: true, shift: true, z: true }, forward);
860
+ useHotkey({ altRight: false, ctrl: true, y: true }, forward);
851
861
  }
852
862
 
853
863
  // store/slices/nodes.ts
854
864
  init_react_import();
855
- var createNodesSlice = (set, get) => ({
856
- nodes: {},
857
- registerNode: (id, node) => {
858
- const s = get().nodes;
859
- const emptyNode = {
860
- id,
861
- methods: {
862
- sync: () => null,
863
- hideOverlay: () => null,
864
- showOverlay: () => null
865
- },
866
- element: null
867
- };
868
- const existingNode = s.nodes[id];
869
- set({
870
- nodes: __spreadProps(__spreadValues({}, s), {
871
- nodes: __spreadProps(__spreadValues({}, s.nodes), {
872
- [id]: __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, emptyNode), existingNode), node), {
873
- id
874
- })
875
- })
876
- })
877
- });
878
- },
879
- unregisterNode: (id) => {
880
- const s = get().nodes;
881
- const existingNode = s.nodes[id];
882
- if (existingNode) {
883
- const newNodes = __spreadValues({}, s.nodes);
884
- delete newNodes[id];
885
- set({
886
- nodes: __spreadProps(__spreadValues({}, s), {
887
- nodes: newNodes
888
- })
865
+ var createNodesSlice = (_set, _get) => {
866
+ const registry = /* @__PURE__ */ new Map();
867
+ return {
868
+ registerNode: (id, handle) => {
869
+ registry.set(id, handle);
870
+ },
871
+ unregisterNode: (id) => {
872
+ registry.delete(id);
873
+ },
874
+ syncNode: (id) => {
875
+ var _a;
876
+ if (!id) return;
877
+ (_a = registry.get(id)) == null ? void 0 : _a.sync();
878
+ },
879
+ syncNodes: (ids) => {
880
+ ids.forEach((id) => {
881
+ var _a;
882
+ if (!id) return;
883
+ (_a = registry.get(id)) == null ? void 0 : _a.sync();
889
884
  });
885
+ },
886
+ setOverlayVisible: (id, visible) => {
887
+ if (!id) return;
888
+ const node = registry.get(id);
889
+ if (!node) return;
890
+ if (visible) {
891
+ node.showOverlay();
892
+ return;
893
+ }
894
+ node.hideOverlay();
890
895
  }
891
- }
892
- });
896
+ };
897
+ };
893
898
 
894
899
  // store/slices/permissions.ts
895
900
  init_react_import();
@@ -1173,6 +1178,8 @@ var createAppStore = (initialAppStore) => create2()(
1173
1178
  },
1174
1179
  status: "LOADING",
1175
1180
  iframe: {},
1181
+ _experimentalFullScreenCanvas: false,
1182
+ _experimentalVirtualization: false,
1176
1183
  metadata: {},
1177
1184
  fieldTransforms: {}
1178
1185
  }, initialAppStore), {
@@ -1280,6 +1287,7 @@ var createAppStore = (initialAppStore) => create2()(
1280
1287
  const parentId = (_a2 = state.indexes.nodes[componentId]) == null ? void 0 : _a2.parentId;
1281
1288
  const parentNode = parentId ? state.indexes.nodes[parentId] : null;
1282
1289
  const parentData = (_b2 = parentNode == null ? void 0 : parentNode.data) != null ? _b2 : null;
1290
+ const rootData = componentId === "root" ? toComponent(componentData) : toComponent(state.data.root);
1283
1291
  const timeouts = {};
1284
1292
  return yield resolveComponentData(
1285
1293
  componentData,
@@ -1299,7 +1307,8 @@ var createAppStore = (initialAppStore) => create2()(
1299
1307
  timeouts[id]();
1300
1308
  }),
1301
1309
  trigger,
1302
- parentData
1310
+ parentData,
1311
+ rootData
1303
1312
  );
1304
1313
  }),
1305
1314
  resolveAndCommitData: () => __async(null, null, function* () {
@@ -1308,7 +1317,8 @@ var createAppStore = (initialAppStore) => create2()(
1308
1317
  state,
1309
1318
  config,
1310
1319
  (content) => content,
1311
- (childItem) => {
1320
+ (childItem, path) => {
1321
+ if (path.length > 1) return childItem;
1312
1322
  resolveComponentData2(childItem, "load").then((resolved) => {
1313
1323
  const { state: state2 } = get();
1314
1324
  const node = state2.indexes.nodes[resolved.node.props.id];
@@ -1732,6 +1742,7 @@ export {
1732
1742
  useRegisterHistorySlice,
1733
1743
  useRegisterPermissionsSlice,
1734
1744
  useRegisterFieldsSlice,
1745
+ toRoot,
1735
1746
  createAppStore,
1736
1747
  appStoreContext,
1737
1748
  useAppStore,
@@ -4,7 +4,7 @@ import {
4
4
  setupZone,
5
5
  walkAppState,
6
6
  walkTree
7
- } from "./chunk-PMXRXC2B.mjs";
7
+ } from "./chunk-754HNMU2.mjs";
8
8
  import {
9
9
  __spreadProps,
10
10
  __spreadValues,