@measured/puck 0.21.0-canary.e9d5c0ea → 0.21.0-canary.f3ce0d72

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.
@@ -697,7 +697,7 @@ var getChanged = (newItem, oldItem) => {
697
697
  // lib/resolve-component-data.ts
698
698
  import { deepEqual as deepEqual2 } from "fast-equals";
699
699
  var cache = { lastChange: {} };
700
- var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
700
+ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
701
701
  const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
702
702
  const resolvedItem = __spreadValues({}, item);
703
703
  const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
@@ -725,11 +725,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
725
725
  let itemWithResolvedChildren = yield mapFields(
726
726
  resolvedItem,
727
727
  {
728
- slot: (_02) => __async(void 0, [_02], function* ({ value }) {
728
+ slot: (_02) => __async(null, [_02], function* ({ value }) {
729
729
  const content = value;
730
730
  return yield Promise.all(
731
731
  content.map(
732
- (childItem) => __async(void 0, null, function* () {
732
+ (childItem) => __async(null, null, function* () {
733
733
  return (yield resolveComponentData(
734
734
  childItem,
735
735
  config,
@@ -772,7 +772,7 @@ function resolveAllData(_0, _1) {
772
772
  return __async(this, arguments, function* (data, config, metadata = {}, onResolveStart, onResolveEnd) {
773
773
  var _a;
774
774
  const defaultedData = defaultData(data);
775
- const resolveNode = (_node) => __async(this, null, function* () {
775
+ const resolveNode = (_node) => __async(null, null, function* () {
776
776
  const node = toComponent(_node);
777
777
  onResolveStart == null ? void 0 : onResolveStart(node);
778
778
  const resolved = (yield resolveComponentData(
@@ -793,13 +793,13 @@ function resolveAllData(_0, _1) {
793
793
  onResolveEnd == null ? void 0 : onResolveEnd(toComponent(resolvedDeep));
794
794
  return resolvedDeep;
795
795
  });
796
- const processContent = (content) => __async(this, null, function* () {
796
+ const processContent = (content) => __async(null, null, function* () {
797
797
  return Promise.all(content.map(resolveNode));
798
798
  });
799
- const processZones = () => __async(this, null, function* () {
799
+ const processZones = () => __async(null, null, function* () {
800
800
  var _a2;
801
801
  const zones = (_a2 = data.zones) != null ? _a2 : {};
802
- Object.entries(zones).forEach((_02) => __async(this, [_02], function* ([zoneKey, content]) {
802
+ Object.entries(zones).forEach((_02) => __async(null, [_02], function* ([zoneKey, content]) {
803
803
  zones[zoneKey] = yield Promise.all(content.map(resolveNode));
804
804
  }));
805
805
  return zones;
@@ -809,7 +809,7 @@ function resolveAllData(_0, _1) {
809
809
  content: yield processContent(defaultedData.content),
810
810
  zones: yield processZones()
811
811
  };
812
- Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(this, null, function* () {
812
+ Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(null, null, function* () {
813
813
  const content = defaultedData.zones[zoneKey];
814
814
  dynamic.zones[zoneKey] = yield processContent(content);
815
815
  }), {});
package/dist/index.css CHANGED
@@ -1567,24 +1567,25 @@ body:has(._DropZone--isAnimating_1i2sv_68:empty) [data-puck-overlay] {
1567
1567
  }
1568
1568
 
1569
1569
  /* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Layout/styles.module.css/#css-module-data */
1570
- ._Puck_hv23j_19 {
1570
+ ._Puck_lqzmv_19 {
1571
1571
  --puck-space-px: 16px;
1572
1572
  font-family: var(--puck-font-family);
1573
+ height: 100%;
1573
1574
  overflow-x: hidden;
1574
1575
  }
1575
1576
  @media (min-width: 766px) {
1576
- ._Puck_hv23j_19 {
1577
+ ._Puck_lqzmv_19 {
1577
1578
  overflow-x: auto;
1578
1579
  }
1579
1580
  }
1580
- ._Puck-portal_hv23j_31 {
1581
+ ._Puck-portal_lqzmv_32 {
1581
1582
  position: relative;
1582
1583
  z-index: 2;
1583
1584
  }
1584
- ._PuckLayout_hv23j_36 {
1585
- height: 100%;
1585
+ ._PuckLayout_lqzmv_37 {
1586
+ height: 100dvh;
1586
1587
  }
1587
- ._PuckLayout-inner_hv23j_40 {
1588
+ ._PuckLayout-inner_lqzmv_41 {
1588
1589
  --puck-frame-width: auto;
1589
1590
  --puck-side-nav-width: min-content;
1590
1591
  --puck-side-bar-width: 0px;
@@ -1602,87 +1603,87 @@ body:has(._DropZone--isAnimating_1i2sv_68:empty) [data-puck-overlay] {
1602
1603
  overflow: hidden;
1603
1604
  }
1604
1605
  @media (min-width: 638px) {
1605
- ._PuckLayout-inner_hv23j_40 {
1606
+ ._PuckLayout-inner_lqzmv_41 {
1606
1607
  --puck-side-nav-width: 68px;
1607
1608
  grid-template-areas: "header header header header" "sidenav left editor right";
1608
1609
  grid-template-columns: var(--puck-side-nav-width) 0 var(--puck-frame-width) 0;
1609
1610
  grid-template-rows: min-content auto;
1610
1611
  }
1611
1612
  }
1612
- ._PuckLayout--mounted_hv23j_73 ._PuckLayout-inner_hv23j_40 {
1613
+ ._PuckLayout--mounted_lqzmv_74 ._PuckLayout-inner_lqzmv_41 {
1613
1614
  --puck-side-bar-width: 186px;
1614
1615
  }
1615
- ._PuckLayout--mobilePanelHeightToggle_hv23j_77._PuckLayout--leftSideBarVisible_hv23j_77 ._PuckLayout-inner_hv23j_40 {
1616
+ ._PuckLayout--mobilePanelHeightToggle_lqzmv_78._PuckLayout--leftSideBarVisible_lqzmv_78 ._PuckLayout-inner_lqzmv_41 {
1616
1617
  grid-template-rows: 0 auto 30% 0 var(--puck-side-nav-width);
1617
1618
  }
1618
- ._PuckLayout--mobilePanelHeightToggle_hv23j_77._PuckLayout--leftSideBarVisible_hv23j_77._PuckLayout--isExpanded_hv23j_83 ._PuckLayout-inner_hv23j_40 {
1619
+ ._PuckLayout--mobilePanelHeightToggle_lqzmv_78._PuckLayout--leftSideBarVisible_lqzmv_78._PuckLayout--isExpanded_lqzmv_84 ._PuckLayout-inner_lqzmv_41 {
1619
1620
  grid-template-rows: 0 auto 55% 0 var(--puck-side-nav-width);
1620
1621
  }
1621
1622
  @media (min-width: 638px) {
1622
- ._PuckLayout--mobilePanelHeightToggle_hv23j_77._PuckLayout--leftSideBarVisible_hv23j_77 ._PuckLayout-inner_hv23j_40 {
1623
+ ._PuckLayout--mobilePanelHeightToggle_lqzmv_78._PuckLayout--leftSideBarVisible_lqzmv_78 ._PuckLayout-inner_lqzmv_41 {
1623
1624
  grid-template-columns: var(--puck-side-nav-width) var(--puck-left-side-bar-width) var( --puck-frame-width ) 0;
1624
1625
  grid-template-rows: min-content auto;
1625
1626
  }
1626
1627
  }
1627
- ._PuckLayout--mobilePanelHeightMinContent_hv23j_101._PuckLayout--leftSideBarVisible_hv23j_77 ._PuckLayout-inner_hv23j_40,
1628
- ._PuckLayout--mobilePanelHeightMinContent_hv23j_101._PuckLayout--leftSideBarVisible_hv23j_77._PuckLayout--isExpanded_hv23j_83 ._PuckLayout-inner_hv23j_40 {
1628
+ ._PuckLayout--mobilePanelHeightMinContent_lqzmv_102._PuckLayout--leftSideBarVisible_lqzmv_78 ._PuckLayout-inner_lqzmv_41,
1629
+ ._PuckLayout--mobilePanelHeightMinContent_lqzmv_102._PuckLayout--leftSideBarVisible_lqzmv_78._PuckLayout--isExpanded_lqzmv_84 ._PuckLayout-inner_lqzmv_41 {
1629
1630
  grid-template-rows: 0 auto min-content 0 var(--puck-side-nav-width);
1630
1631
  }
1631
1632
  @media (min-width: 638px) {
1632
- ._PuckLayout--mobilePanelHeightToggle_hv23j_77._PuckLayout--leftSideBarVisible_hv23j_77 ._PuckLayout-inner_hv23j_40,
1633
- ._PuckLayout--mobilePanelHeightToggle_hv23j_77._PuckLayout--leftSideBarVisible_hv23j_77._PuckLayout--isExpanded_hv23j_83 ._PuckLayout-inner_hv23j_40,
1634
- ._PuckLayout--mobilePanelHeightMinContent_hv23j_101._PuckLayout--leftSideBarVisible_hv23j_77 ._PuckLayout-inner_hv23j_40,
1635
- ._PuckLayout--mobilePanelHeightMinContent_hv23j_101._PuckLayout--leftSideBarVisible_hv23j_77._PuckLayout--isExpanded_hv23j_83 ._PuckLayout-inner_hv23j_40 {
1633
+ ._PuckLayout--mobilePanelHeightToggle_lqzmv_78._PuckLayout--leftSideBarVisible_lqzmv_78 ._PuckLayout-inner_lqzmv_41,
1634
+ ._PuckLayout--mobilePanelHeightToggle_lqzmv_78._PuckLayout--leftSideBarVisible_lqzmv_78._PuckLayout--isExpanded_lqzmv_84 ._PuckLayout-inner_lqzmv_41,
1635
+ ._PuckLayout--mobilePanelHeightMinContent_lqzmv_102._PuckLayout--leftSideBarVisible_lqzmv_78 ._PuckLayout-inner_lqzmv_41,
1636
+ ._PuckLayout--mobilePanelHeightMinContent_lqzmv_102._PuckLayout--leftSideBarVisible_lqzmv_78._PuckLayout--isExpanded_lqzmv_84 ._PuckLayout-inner_lqzmv_41 {
1636
1637
  grid-template-columns: var(--puck-side-nav-width) var(--puck-left-side-bar-width) var( --puck-frame-width ) 0;
1637
1638
  grid-template-rows: min-content auto;
1638
1639
  }
1639
1640
  }
1640
1641
  @media (min-width: 638px) {
1641
- ._PuckLayout--rightSideBarVisible_hv23j_128 ._PuckLayout-inner_hv23j_40 {
1642
+ ._PuckLayout--rightSideBarVisible_lqzmv_129 ._PuckLayout-inner_lqzmv_41 {
1642
1643
  grid-template-columns: var(--puck-side-nav-width) 0 var(--puck-frame-width) var(--puck-right-side-bar-width);
1643
1644
  }
1644
1645
  }
1645
1646
  @media (min-width: 638px) {
1646
- ._PuckLayout--leftSideBarVisible_hv23j_77._PuckLayout--rightSideBarVisible_hv23j_128 ._PuckLayout-inner_hv23j_40 {
1647
+ ._PuckLayout--leftSideBarVisible_lqzmv_78._PuckLayout--rightSideBarVisible_lqzmv_129 ._PuckLayout-inner_lqzmv_41 {
1647
1648
  grid-template-columns: var(--puck-side-nav-width) var(--puck-left-side-bar-width) var( --puck-frame-width ) var(--puck-right-side-bar-width);
1648
1649
  }
1649
1650
  }
1650
1651
  @media (min-width: 458px) {
1651
- ._PuckLayout-mounted_hv23j_147 ._PuckLayout-inner_hv23j_40 {
1652
+ ._PuckLayout-mounted_lqzmv_148 ._PuckLayout-inner_lqzmv_41 {
1652
1653
  --puck-frame-width: minmax(266px, auto);
1653
1654
  }
1654
1655
  }
1655
1656
  @media (min-width: 638px) {
1656
- ._PuckLayout_hv23j_36 ._PuckLayout-inner_hv23j_40 {
1657
+ ._PuckLayout_lqzmv_37 ._PuckLayout-inner_lqzmv_41 {
1657
1658
  --puck-side-bar-width: minmax(186px, 250px);
1658
1659
  }
1659
1660
  }
1660
1661
  @media (min-width: 766px) {
1661
- ._PuckLayout_hv23j_36 ._PuckLayout-inner_hv23j_40 {
1662
+ ._PuckLayout_lqzmv_37 ._PuckLayout-inner_lqzmv_41 {
1662
1663
  --puck-frame-width: auto;
1663
1664
  }
1664
1665
  }
1665
1666
  @media (min-width: 990px) {
1666
- ._PuckLayout_hv23j_36 ._PuckLayout-inner_hv23j_40 {
1667
+ ._PuckLayout_lqzmv_37 ._PuckLayout-inner_lqzmv_41 {
1667
1668
  --puck-side-bar-width: 256px;
1668
1669
  }
1669
1670
  }
1670
1671
  @media (min-width: 1198px) {
1671
- ._PuckLayout_hv23j_36 ._PuckLayout-inner_hv23j_40 {
1672
+ ._PuckLayout_lqzmv_37 ._PuckLayout-inner_lqzmv_41 {
1672
1673
  --puck-side-bar-width: 274px;
1673
1674
  }
1674
1675
  }
1675
1676
  @media (min-width: 1398px) {
1676
- ._PuckLayout_hv23j_36 ._PuckLayout-inner_hv23j_40 {
1677
+ ._PuckLayout_lqzmv_37 ._PuckLayout-inner_lqzmv_41 {
1677
1678
  --puck-side-bar-width: 290px;
1678
1679
  }
1679
1680
  }
1680
1681
  @media (min-width: 1598px) {
1681
- ._PuckLayout_hv23j_36 ._PuckLayout-inner_hv23j_40 {
1682
+ ._PuckLayout_lqzmv_37 ._PuckLayout-inner_lqzmv_41 {
1682
1683
  --puck-side-bar-width: 320px;
1683
1684
  }
1684
1685
  }
1685
- ._PuckLayout-nav_hv23j_188 {
1686
+ ._PuckLayout-nav_lqzmv_189 {
1686
1687
  border-top: 1px solid var(--puck-color-grey-09);
1687
1688
  background-color: var(--puck-color-grey-12);
1688
1689
  grid-area: sidenav;
@@ -1690,33 +1691,33 @@ body:has(._DropZone--isAnimating_1i2sv_68:empty) [data-puck-overlay] {
1690
1691
  width: 100%;
1691
1692
  }
1692
1693
  @media (min-width: 638px) {
1693
- ._PuckLayout-nav_hv23j_188 {
1694
+ ._PuckLayout-nav_lqzmv_189 {
1694
1695
  border-top: 0;
1695
1696
  border-right: 1px solid var(--puck-color-grey-09);
1696
1697
  box-sizing: border-box;
1697
1698
  }
1698
1699
  }
1699
- ._PuckLayout-header_hv23j_204 {
1700
+ ._PuckLayout-header_lqzmv_205 {
1700
1701
  grid-area: header;
1701
1702
  }
1702
- ._PuckLayout--leftSideBarVisible_hv23j_77 ._PuckLayout-header_hv23j_204 {
1703
+ ._PuckLayout--leftSideBarVisible_lqzmv_78 ._PuckLayout-header_lqzmv_205 {
1703
1704
  overflow: hidden;
1704
1705
  }
1705
1706
  @media (min-width: 638px) {
1706
- ._PuckLayout--leftSideBarVisible_hv23j_77 ._PuckLayout-header_hv23j_204 {
1707
+ ._PuckLayout--leftSideBarVisible_lqzmv_78 ._PuckLayout-header_lqzmv_205 {
1707
1708
  overflow: auto;
1708
1709
  }
1709
1710
  }
1710
- ._PuckPluginTab_hv23j_218 {
1711
+ ._PuckPluginTab_lqzmv_219 {
1711
1712
  display: none;
1712
1713
  flex-grow: 1;
1713
1714
  overflow: hidden;
1714
1715
  }
1715
- ._PuckPluginTab--visible_hv23j_224 {
1716
+ ._PuckPluginTab--visible_lqzmv_225 {
1716
1717
  display: flex;
1717
1718
  flex-direction: column;
1718
1719
  }
1719
- ._PuckPluginTab-body_hv23j_229 {
1720
+ ._PuckPluginTab-body_lqzmv_230 {
1720
1721
  flex-grow: 1;
1721
1722
  overflow: hidden;
1722
1723
  }
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector, o as PluginInternal } from './walk-tree-CD9WQheJ.mjs';
2
- export { ae as Adaptor, ac as ArrayField, E as ArrayState, as as AsFieldProps, Y as BaseData, a6 as BaseField, ag as CacheOpts, K as ComponentConfigExtensions, X as ComponentConfigParams, a1 as ComponentDataMap, $ as ComponentDataOptionalId, a4 as ComponentMetadata, T as ConfigParams, a2 as Content, aj as CustomField, ai as CustomFieldRender, ap as DefaultComponentProps, N as DefaultComponents, am as DefaultRootFieldProps, ao as DefaultRootProps, an as DefaultRootRenderProps, p as Direction, q as DragAxis, ah as ExternalField, af as ExternalFieldWithAdaptor, Q as ExtractConfigParams, au as ExtractField, a5 as FieldMetadata, z as FieldRenderFunctions, v as FieldTransformFn, u as FieldTransformFnParams, B as ItemWithId, a0 as MappedItem, a8 as NumberField, ad as ObjectField, y as OverrideKey, J as PuckComponent, al as PuckContext, a3 as PuckMetadata, ab as RadioField, L as RootConfig, _ as RootData, Z as RootDataWithoutProps, aa as SelectField, S as Slot, G as SlotComponent, ak as SlotField, a7 as TextField, a9 as TextareaField, s as Viewport, at as WithChildren, aq as WithId, ar as WithPuckProps, W as WithSlotProps, m as migrate, x as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CD9WQheJ.mjs';
1
+ import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, D as Data, h as OnAction, i as PrivateAppState, j as Field, k as FieldProps, l as DropZoneProps, n as InitialHistory, o as ItemSelector, p as PluginInternal } from './walk-tree-CL-j099F.mjs';
2
+ export { af as Adaptor, ad as ArrayField, G as ArrayState, at as AsFieldProps, Z as BaseData, a7 as BaseField, ah as CacheOpts, L as ComponentConfigExtensions, Y as ComponentConfigParams, a2 as ComponentDataMap, a0 as ComponentDataOptionalId, a5 as ComponentMetadata, X as ConfigParams, a3 as Content, ak as CustomField, aj as CustomFieldRender, aq as DefaultComponentProps, Q as DefaultComponents, an as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, q as Direction, s as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, T as ExtractConfigParams, av as ExtractField, a6 as FieldMetadata, B as FieldRenderFunctions, x as FieldTransformFn, v as FieldTransformFnParams, E as ItemWithId, a1 as MappedItem, a9 as NumberField, ae as ObjectField, z as OverrideKey, K as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, N as RootConfig, $ as RootData, _ as RootDataWithoutProps, ab as SelectField, S as Slot, J as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, u as Viewport, au as WithChildren, ar as WithId, as as WithPuckProps, W as WithSlotProps, m as migrate, y as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CL-j099F.mjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
- import react__default, { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
5
+ import react__default, { Reducer, ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
6
6
 
7
7
  type HistorySlice<D = any> = {
8
8
  index: number;
@@ -109,6 +109,13 @@ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserCon
109
109
  fieldTransforms: FieldTransforms;
110
110
  };
111
111
 
112
+ type StateReducer<UserData extends Data = Data> = Reducer<PrivateAppState<UserData>, PuckAction>;
113
+ declare function createReducer<UserData extends Data>({ record, onAction, appStore, }: {
114
+ record?: (appState: AppState<UserData>) => void;
115
+ onAction?: OnAction<UserData>;
116
+ appStore: AppStore;
117
+ }): StateReducer<UserData>;
118
+
112
119
  declare const ActionBar: {
113
120
  ({ label, children, }: {
114
121
  label?: string;
@@ -314,4 +321,4 @@ declare const fieldsPlugin: (params?: {
314
321
 
315
322
  declare const outlinePlugin: () => Plugin;
316
323
 
317
- export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, blocksPlugin, createUsePuck, fieldsPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
324
+ export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, blocksPlugin, createReducer, createUsePuck, fieldsPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector, o as PluginInternal } from './walk-tree-CD9WQheJ.js';
2
- export { ae as Adaptor, ac as ArrayField, E as ArrayState, as as AsFieldProps, Y as BaseData, a6 as BaseField, ag as CacheOpts, K as ComponentConfigExtensions, X as ComponentConfigParams, a1 as ComponentDataMap, $ as ComponentDataOptionalId, a4 as ComponentMetadata, T as ConfigParams, a2 as Content, aj as CustomField, ai as CustomFieldRender, ap as DefaultComponentProps, N as DefaultComponents, am as DefaultRootFieldProps, ao as DefaultRootProps, an as DefaultRootRenderProps, p as Direction, q as DragAxis, ah as ExternalField, af as ExternalFieldWithAdaptor, Q as ExtractConfigParams, au as ExtractField, a5 as FieldMetadata, z as FieldRenderFunctions, v as FieldTransformFn, u as FieldTransformFnParams, B as ItemWithId, a0 as MappedItem, a8 as NumberField, ad as ObjectField, y as OverrideKey, J as PuckComponent, al as PuckContext, a3 as PuckMetadata, ab as RadioField, L as RootConfig, _ as RootData, Z as RootDataWithoutProps, aa as SelectField, S as Slot, G as SlotComponent, ak as SlotField, a7 as TextField, a9 as TextareaField, s as Viewport, at as WithChildren, aq as WithId, ar as WithPuckProps, W as WithSlotProps, m as migrate, x as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CD9WQheJ.js';
1
+ import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, D as Data, h as OnAction, i as PrivateAppState, j as Field, k as FieldProps, l as DropZoneProps, n as InitialHistory, o as ItemSelector, p as PluginInternal } from './walk-tree-CL-j099F.js';
2
+ export { af as Adaptor, ad as ArrayField, G as ArrayState, at as AsFieldProps, Z as BaseData, a7 as BaseField, ah as CacheOpts, L as ComponentConfigExtensions, Y as ComponentConfigParams, a2 as ComponentDataMap, a0 as ComponentDataOptionalId, a5 as ComponentMetadata, X as ConfigParams, a3 as Content, ak as CustomField, aj as CustomFieldRender, aq as DefaultComponentProps, Q as DefaultComponents, an as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, q as Direction, s as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, T as ExtractConfigParams, av as ExtractField, a6 as FieldMetadata, B as FieldRenderFunctions, x as FieldTransformFn, v as FieldTransformFnParams, E as ItemWithId, a1 as MappedItem, a9 as NumberField, ae as ObjectField, z as OverrideKey, K as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, N as RootConfig, $ as RootData, _ as RootDataWithoutProps, ab as SelectField, S as Slot, J as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, u as Viewport, au as WithChildren, ar as WithId, as as WithPuckProps, W as WithSlotProps, m as migrate, y as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CL-j099F.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
- import react__default, { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
5
+ import react__default, { Reducer, ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
6
6
 
7
7
  type HistorySlice<D = any> = {
8
8
  index: number;
@@ -109,6 +109,13 @@ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserCon
109
109
  fieldTransforms: FieldTransforms;
110
110
  };
111
111
 
112
+ type StateReducer<UserData extends Data = Data> = Reducer<PrivateAppState<UserData>, PuckAction>;
113
+ declare function createReducer<UserData extends Data>({ record, onAction, appStore, }: {
114
+ record?: (appState: AppState<UserData>) => void;
115
+ onAction?: OnAction<UserData>;
116
+ appStore: AppStore;
117
+ }): StateReducer<UserData>;
118
+
112
119
  declare const ActionBar: {
113
120
  ({ label, children, }: {
114
121
  label?: string;
@@ -314,4 +321,4 @@ declare const fieldsPlugin: (params?: {
314
321
 
315
322
  declare const outlinePlugin: () => Plugin;
316
323
 
317
- export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, blocksPlugin, createUsePuck, fieldsPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
324
+ export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, blocksPlugin, createReducer, createUsePuck, fieldsPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };