@measured/puck 0.21.0-canary.a1b03d38 → 0.21.0-canary.a4bfae4f

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-O447AVCX.mjs → Editor-STTYPZJ4.mjs} +9 -9
  2. package/dist/{actions-CJibIB0m.d.mts → actions-tsxxcX1z.d.mts} +22 -8
  3. package/dist/{actions-CJibIB0m.d.ts → actions-tsxxcX1z.d.ts} +22 -8
  4. package/dist/{chunk-2Q4PACDA.mjs → chunk-5ATHPL4L.mjs} +3 -3
  5. package/dist/{chunk-Y656T6AQ.mjs → chunk-6K3HTV5G.mjs} +2 -2
  6. package/dist/{chunk-QBGM4ELA.mjs → chunk-DBBPIWHH.mjs} +1 -1
  7. package/dist/{chunk-Z476VA6G.mjs → chunk-FYH73R7R.mjs} +4627 -4059
  8. package/dist/{chunk-DAQLMM2T.mjs → chunk-IDHXWXYL.mjs} +89 -4
  9. package/dist/{chunk-62AAYNXG.mjs → chunk-MML4TKL2.mjs} +1 -1
  10. package/dist/{chunk-BSDEIOEK.mjs → chunk-O7X34GXV.mjs} +10 -8
  11. package/dist/{chunk-NLUHDYVR.mjs → chunk-ODDSBBX3.mjs} +20 -1
  12. package/dist/{chunk-QAWJTCV5.mjs → chunk-PRRLVCLF.mjs} +1 -1
  13. package/dist/{chunk-T3WX7XJ6.mjs → chunk-QV3IXRNS.mjs} +5 -3
  14. package/dist/{chunk-PLXSMBAA.mjs → chunk-VL2VNWXO.mjs} +1 -1
  15. package/dist/{full-BEMDJKDS.mjs → full-C4C2K2OO.mjs} +8 -8
  16. package/dist/{index-Bss1jupB.d.ts → index-Ca6V6NQD.d.ts} +3 -1
  17. package/dist/{index-DOcD_H3b.d.mts → index-mQvUCH3C.d.mts} +3 -1
  18. package/dist/index.css +704 -314
  19. package/dist/index.d.mts +27 -8
  20. package/dist/index.d.ts +27 -8
  21. package/dist/index.js +2890 -2158
  22. package/dist/index.mjs +20 -17
  23. package/dist/internal.d.mts +2 -2
  24. package/dist/internal.d.ts +2 -2
  25. package/dist/internal.js +20 -1
  26. package/dist/internal.mjs +2 -2
  27. package/dist/{loaded-N3FYGF2Y.mjs → loaded-DB2OXVC5.mjs} +5 -5
  28. package/dist/{loaded-JU3A7Y4L.mjs → loaded-GEFHNL7S.mjs} +5 -5
  29. package/dist/{loaded-OBY7OMS6.mjs → loaded-TVTW742N.mjs} +5 -5
  30. package/dist/no-external.css +842 -448
  31. package/dist/no-external.d.mts +4 -4
  32. package/dist/no-external.d.ts +4 -4
  33. package/dist/no-external.js +2891 -2156
  34. package/dist/no-external.mjs +19 -11
  35. package/dist/rsc.d.mts +2 -2
  36. package/dist/rsc.d.ts +2 -2
  37. package/dist/rsc.js +24 -3
  38. package/dist/rsc.mjs +3 -3
  39. package/dist/{walk-tree-BL55zQ9b.d.ts → walk-tree-Bh85NMeo.d.ts} +1 -1
  40. package/dist/{walk-tree-BYuI81Ik.d.mts → walk-tree-CDA3K5S3.d.mts} +1 -1
  41. package/package.json +1 -1
@@ -4,20 +4,20 @@ import {
4
4
  import {
5
5
  EditorInner,
6
6
  LoadedRichTextMenu
7
- } from "./chunk-2Q4PACDA.mjs";
7
+ } from "./chunk-5ATHPL4L.mjs";
8
8
  import "./chunk-CSSRLPHM.mjs";
9
- import "./chunk-BSDEIOEK.mjs";
10
- import "./chunk-PLXSMBAA.mjs";
11
- import "./chunk-62AAYNXG.mjs";
12
- import "./chunk-QAWJTCV5.mjs";
9
+ import "./chunk-O7X34GXV.mjs";
10
+ import "./chunk-VL2VNWXO.mjs";
11
+ import "./chunk-MML4TKL2.mjs";
12
+ import "./chunk-PRRLVCLF.mjs";
13
13
  import {
14
14
  useAppStore,
15
15
  useAppStoreApi
16
- } from "./chunk-DAQLMM2T.mjs";
17
- import "./chunk-QBGM4ELA.mjs";
18
- import "./chunk-T3WX7XJ6.mjs";
16
+ } from "./chunk-IDHXWXYL.mjs";
17
+ import "./chunk-DBBPIWHH.mjs";
18
+ import "./chunk-QV3IXRNS.mjs";
19
19
  import "./chunk-Y2EFNT5P.mjs";
20
- import "./chunk-NLUHDYVR.mjs";
20
+ import "./chunk-ODDSBBX3.mjs";
21
21
  import {
22
22
  __spreadProps,
23
23
  __spreadValues,
@@ -532,6 +532,7 @@ interface FieldMetadata extends Metadata {
532
532
  type ItemWithId = {
533
533
  _arrayId: string;
534
534
  _originalIndex: number;
535
+ _currentIndex: number;
535
536
  };
536
537
  type ArrayState = {
537
538
  items: ItemWithId[];
@@ -542,6 +543,7 @@ type UiState = {
542
543
  rightSideBarVisible: boolean;
543
544
  leftSideBarWidth?: number | null;
544
545
  rightSideBarWidth?: number | null;
546
+ mobilePanelExpanded?: boolean;
545
547
  itemSelector: ItemSelector | null;
546
548
  arrayState: Record<string, ArrayState | undefined>;
547
549
  previewMode: "interactive" | "edit";
@@ -554,7 +556,7 @@ type UiState = {
554
556
  isDragging: boolean;
555
557
  viewports: {
556
558
  current: {
557
- width: number;
559
+ width: number | "100%";
558
560
  height: number | "auto";
559
561
  };
560
562
  controlsVisible: boolean;
@@ -564,6 +566,9 @@ type UiState = {
564
566
  focus?: string | null;
565
567
  metadata?: Record<string, any>;
566
568
  };
569
+ plugin: {
570
+ current: string | null;
571
+ };
567
572
  };
568
573
  type AppState<UserData extends Data = Data> = {
569
574
  data: UserData;
@@ -607,6 +612,15 @@ type LeftOrExactRight<Union, Left, Right> = (Left & Union extends Right ? Exact<
607
612
  type AssertHasValue<T, True = T, False = never> = [keyof T] extends [
608
613
  never
609
614
  ] ? False : True;
615
+ type RenderFunc<Props extends {
616
+ [key: string]: any;
617
+ } = {
618
+ children: ReactNode;
619
+ }> = (props: Props) => ReactElement;
620
+ type PluginInternal = Plugin & {
621
+ mobileOnly?: boolean;
622
+ desktopOnly?: boolean;
623
+ };
610
624
 
611
625
  type MapFnParams<ThisField = Field> = {
612
626
  value: any;
@@ -630,11 +644,6 @@ G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>, UserField extends
630
644
  [Type in UserField["type"]]: FieldTransformFn<ExtractField<UserField, Type>>;
631
645
  }>;
632
646
 
633
- type RenderFunc<Props extends {
634
- [key: string]: any;
635
- } = {
636
- children: ReactNode;
637
- }> = (props: Props) => ReactElement;
638
647
  declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
639
648
  type OverrideKey = (typeof overrideKeys)[number];
640
649
  type OverridesGeneric<Shape extends {
@@ -706,7 +715,7 @@ type DragAxis = "dynamic" | "y" | "x";
706
715
 
707
716
  type iconTypes = "Smartphone" | "Monitor" | "Tablet";
708
717
  type Viewport = {
709
- width: number;
718
+ width: number | "100%";
710
719
  height?: number | "auto";
711
720
  label?: string;
712
721
  icon?: iconTypes | ReactNode;
@@ -726,8 +735,13 @@ type IframeConfig = {
726
735
  };
727
736
  type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
728
737
  type Plugin<UserConfig extends Config = Config> = {
738
+ name?: string;
739
+ label?: string;
740
+ icon?: ReactNode;
741
+ render?: () => ReactElement;
729
742
  overrides?: Partial<Overrides<UserConfig>>;
730
743
  fieldTransforms?: FieldTransforms<UserConfig>;
744
+ mobilePanelHeight?: "toggle" | "min-content";
731
745
  };
732
746
  type History<D = any> = {
733
747
  state: D;
@@ -820,4 +834,4 @@ type PuckAction = {
820
834
  recordHistory?: boolean;
821
835
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
822
836
 
823
- export { type BaseData as $, type AppState as A, type FieldTransformFn as B, type Config as C, type Data as D, overrideKeys as E, type Fields as F, type OverrideKey as G, type History as H, type IframeConfig as I, type FieldRenderFunctions as J, type ItemWithId as K, type ArrayState as L, type Metadata as M, type SlotComponent as N, type OnAction as O, type PrivateAppState as P, type PuckComponent as Q, type RootData as R, type Slot as S, type ComponentConfigExtensions as T, type UserGenerics as U, type Viewports as V, type WithId as W, type RootConfig as X, type ExtractConfigParams as Y, type ConfigParams as Z, type ComponentConfigParams as _, type PuckAction as a, type RootDataWithoutProps as a0, type ComponentDataOptionalId as a1, type MappedItem as a2, type ComponentDataMap as a3, type PuckMetadata as a4, type ComponentMetadata as a5, type FieldMetadata as a6, type BaseField as a7, type TextField as a8, type NumberField as a9, type TextareaField as aa, type SelectField as ab, type RadioField as ac, type ArrayField as ad, type ObjectField as ae, type Adaptor as af, type ExternalFieldWithAdaptor as ag, type CacheOpts as ah, type ExternalField as ai, type CustomFieldRender as aj, type CustomField as ak, type SlotField as al, type PuckContext as am, type DefaultRootRenderProps as an, type DefaultRootProps as ao, type WithPuckProps as ap, type AsFieldProps as aq, type WithChildren as ar, type ExtractField as as, 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 WithSlotProps as u, type RichText as v, type Direction as w, type DragAxis as x, type Viewport as y, type FieldTransformFnParams as z };
837
+ 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 };
@@ -532,6 +532,7 @@ interface FieldMetadata extends Metadata {
532
532
  type ItemWithId = {
533
533
  _arrayId: string;
534
534
  _originalIndex: number;
535
+ _currentIndex: number;
535
536
  };
536
537
  type ArrayState = {
537
538
  items: ItemWithId[];
@@ -542,6 +543,7 @@ type UiState = {
542
543
  rightSideBarVisible: boolean;
543
544
  leftSideBarWidth?: number | null;
544
545
  rightSideBarWidth?: number | null;
546
+ mobilePanelExpanded?: boolean;
545
547
  itemSelector: ItemSelector | null;
546
548
  arrayState: Record<string, ArrayState | undefined>;
547
549
  previewMode: "interactive" | "edit";
@@ -554,7 +556,7 @@ type UiState = {
554
556
  isDragging: boolean;
555
557
  viewports: {
556
558
  current: {
557
- width: number;
559
+ width: number | "100%";
558
560
  height: number | "auto";
559
561
  };
560
562
  controlsVisible: boolean;
@@ -564,6 +566,9 @@ type UiState = {
564
566
  focus?: string | null;
565
567
  metadata?: Record<string, any>;
566
568
  };
569
+ plugin: {
570
+ current: string | null;
571
+ };
567
572
  };
568
573
  type AppState<UserData extends Data = Data> = {
569
574
  data: UserData;
@@ -607,6 +612,15 @@ type LeftOrExactRight<Union, Left, Right> = (Left & Union extends Right ? Exact<
607
612
  type AssertHasValue<T, True = T, False = never> = [keyof T] extends [
608
613
  never
609
614
  ] ? False : True;
615
+ type RenderFunc<Props extends {
616
+ [key: string]: any;
617
+ } = {
618
+ children: ReactNode;
619
+ }> = (props: Props) => ReactElement;
620
+ type PluginInternal = Plugin & {
621
+ mobileOnly?: boolean;
622
+ desktopOnly?: boolean;
623
+ };
610
624
 
611
625
  type MapFnParams<ThisField = Field> = {
612
626
  value: any;
@@ -630,11 +644,6 @@ G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>, UserField extends
630
644
  [Type in UserField["type"]]: FieldTransformFn<ExtractField<UserField, Type>>;
631
645
  }>;
632
646
 
633
- type RenderFunc<Props extends {
634
- [key: string]: any;
635
- } = {
636
- children: ReactNode;
637
- }> = (props: Props) => ReactElement;
638
647
  declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
639
648
  type OverrideKey = (typeof overrideKeys)[number];
640
649
  type OverridesGeneric<Shape extends {
@@ -706,7 +715,7 @@ type DragAxis = "dynamic" | "y" | "x";
706
715
 
707
716
  type iconTypes = "Smartphone" | "Monitor" | "Tablet";
708
717
  type Viewport = {
709
- width: number;
718
+ width: number | "100%";
710
719
  height?: number | "auto";
711
720
  label?: string;
712
721
  icon?: iconTypes | ReactNode;
@@ -726,8 +735,13 @@ type IframeConfig = {
726
735
  };
727
736
  type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
728
737
  type Plugin<UserConfig extends Config = Config> = {
738
+ name?: string;
739
+ label?: string;
740
+ icon?: ReactNode;
741
+ render?: () => ReactElement;
729
742
  overrides?: Partial<Overrides<UserConfig>>;
730
743
  fieldTransforms?: FieldTransforms<UserConfig>;
744
+ mobilePanelHeight?: "toggle" | "min-content";
731
745
  };
732
746
  type History<D = any> = {
733
747
  state: D;
@@ -820,4 +834,4 @@ type PuckAction = {
820
834
  recordHistory?: boolean;
821
835
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
822
836
 
823
- export { type BaseData as $, type AppState as A, type FieldTransformFn as B, type Config as C, type Data as D, overrideKeys as E, type Fields as F, type OverrideKey as G, type History as H, type IframeConfig as I, type FieldRenderFunctions as J, type ItemWithId as K, type ArrayState as L, type Metadata as M, type SlotComponent as N, type OnAction as O, type PrivateAppState as P, type PuckComponent as Q, type RootData as R, type Slot as S, type ComponentConfigExtensions as T, type UserGenerics as U, type Viewports as V, type WithId as W, type RootConfig as X, type ExtractConfigParams as Y, type ConfigParams as Z, type ComponentConfigParams as _, type PuckAction as a, type RootDataWithoutProps as a0, type ComponentDataOptionalId as a1, type MappedItem as a2, type ComponentDataMap as a3, type PuckMetadata as a4, type ComponentMetadata as a5, type FieldMetadata as a6, type BaseField as a7, type TextField as a8, type NumberField as a9, type TextareaField as aa, type SelectField as ab, type RadioField as ac, type ArrayField as ad, type ObjectField as ae, type Adaptor as af, type ExternalFieldWithAdaptor as ag, type CacheOpts as ah, type ExternalField as ai, type CustomFieldRender as aj, type CustomField as ak, type SlotField as al, type PuckContext as am, type DefaultRootRenderProps as an, type DefaultRootProps as ao, type WithPuckProps as ap, type AsFieldProps as aq, type WithChildren as ar, type ExtractField as as, 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 WithSlotProps as u, type RichText as v, type Direction as w, type DragAxis as x, type Viewport as y, type FieldTransformFnParams as z };
837
+ 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 };
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-CSSRLPHM.mjs";
4
4
  import {
5
5
  LoadedRichTextMenuInner
6
- } from "./chunk-BSDEIOEK.mjs";
6
+ } from "./chunk-O7X34GXV.mjs";
7
7
  import {
8
8
  useAppStore,
9
9
  useAppStoreApi
10
- } from "./chunk-DAQLMM2T.mjs";
10
+ } from "./chunk-IDHXWXYL.mjs";
11
11
  import {
12
12
  get_class_name_factory_default
13
13
  } from "./chunk-Y2EFNT5P.mjs";
@@ -97,7 +97,7 @@ init_react_import();
97
97
  import { lazy, Suspense } from "react";
98
98
  import { jsx as jsx2 } from "react/jsx-runtime";
99
99
  var LoadedRichTextMenuFull = lazy(
100
- () => import("./full-BEMDJKDS.mjs").then((m) => ({
100
+ () => import("./full-C4C2K2OO.mjs").then((m) => ({
101
101
  default: m.LoadedRichTextMenuFull
102
102
  }))
103
103
  );
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  defaultAppState,
6
6
  resolveComponentData
7
- } from "./chunk-T3WX7XJ6.mjs";
7
+ } from "./chunk-QV3IXRNS.mjs";
8
8
  import {
9
9
  get_class_name_factory_default
10
10
  } from "./chunk-Y2EFNT5P.mjs";
@@ -12,7 +12,7 @@ import {
12
12
  mapFields,
13
13
  walkAppState,
14
14
  walkTree
15
- } from "./chunk-NLUHDYVR.mjs";
15
+ } from "./chunk-ODDSBBX3.mjs";
16
16
  import {
17
17
  __async,
18
18
  __objRest,
@@ -3,7 +3,7 @@ import {
3
3
  setupZone,
4
4
  walkAppState,
5
5
  walkTree
6
- } from "./chunk-NLUHDYVR.mjs";
6
+ } from "./chunk-ODDSBBX3.mjs";
7
7
  import {
8
8
  __spreadProps,
9
9
  __spreadValues,