@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.
@@ -12,6 +12,7 @@ import {
12
12
  Puck,
13
13
  Render,
14
14
  blocksPlugin,
15
+ createReducer,
15
16
  createUsePuck,
16
17
  fieldsPlugin,
17
18
  outlinePlugin,
@@ -21,14 +22,14 @@ import {
21
22
  setDeep,
22
23
  useGetPuck,
23
24
  usePuck
24
- } from "./chunk-J6I4S2BQ.mjs";
25
+ } from "./chunk-73365SXB.mjs";
25
26
  import {
26
27
  init_react_import,
27
28
  migrate,
28
29
  resolveAllData,
29
30
  transformProps,
30
31
  walkTree
31
- } from "./chunk-6SIKCDJJ.mjs";
32
+ } from "./chunk-FY5AZKYD.mjs";
32
33
 
33
34
  // bundle/no-external.ts
34
35
  init_react_import();
@@ -46,6 +47,7 @@ export {
46
47
  Puck,
47
48
  Render,
48
49
  blocksPlugin,
50
+ createReducer,
49
51
  createUsePuck,
50
52
  fieldsPlugin,
51
53
  migrate,
package/dist/rsc.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-CD9WQheJ.mjs';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CD9WQheJ.mjs';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-CL-j099F.mjs';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CL-j099F.mjs';
4
4
  import 'react';
5
5
 
6
6
  declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data, metadata, }: {
package/dist/rsc.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-CD9WQheJ.js';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CD9WQheJ.js';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-CL-j099F.js';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CL-j099F.js';
4
4
  import 'react';
5
5
 
6
6
  declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data, metadata, }: {
package/dist/rsc.js CHANGED
@@ -474,7 +474,7 @@ var getChanged = (newItem, oldItem) => {
474
474
  // lib/resolve-component-data.ts
475
475
  var import_fast_equals2 = require("fast-equals");
476
476
  var cache = { lastChange: {} };
477
- var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
477
+ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
478
478
  const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
479
479
  const resolvedItem = __spreadValues({}, item);
480
480
  const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
@@ -502,11 +502,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
502
502
  let itemWithResolvedChildren = yield mapFields(
503
503
  resolvedItem,
504
504
  {
505
- slot: (_02) => __async(void 0, [_02], function* ({ value }) {
505
+ slot: (_02) => __async(null, [_02], function* ({ value }) {
506
506
  const content = value;
507
507
  return yield Promise.all(
508
508
  content.map(
509
- (childItem) => __async(void 0, null, function* () {
509
+ (childItem) => __async(null, null, function* () {
510
510
  return (yield resolveComponentData(
511
511
  childItem,
512
512
  config,
@@ -554,7 +554,7 @@ function resolveAllData(_0, _1) {
554
554
  return __async(this, arguments, function* (data, config, metadata = {}, onResolveStart, onResolveEnd) {
555
555
  var _a;
556
556
  const defaultedData = defaultData(data);
557
- const resolveNode = (_node) => __async(this, null, function* () {
557
+ const resolveNode = (_node) => __async(null, null, function* () {
558
558
  const node = toComponent(_node);
559
559
  onResolveStart == null ? void 0 : onResolveStart(node);
560
560
  const resolved = (yield resolveComponentData(
@@ -575,13 +575,13 @@ function resolveAllData(_0, _1) {
575
575
  onResolveEnd == null ? void 0 : onResolveEnd(toComponent(resolvedDeep));
576
576
  return resolvedDeep;
577
577
  });
578
- const processContent = (content) => __async(this, null, function* () {
578
+ const processContent = (content) => __async(null, null, function* () {
579
579
  return Promise.all(content.map(resolveNode));
580
580
  });
581
- const processZones = () => __async(this, null, function* () {
581
+ const processZones = () => __async(null, null, function* () {
582
582
  var _a2;
583
583
  const zones = (_a2 = data.zones) != null ? _a2 : {};
584
- Object.entries(zones).forEach((_02) => __async(this, [_02], function* ([zoneKey, content]) {
584
+ Object.entries(zones).forEach((_02) => __async(null, [_02], function* ([zoneKey, content]) {
585
585
  zones[zoneKey] = yield Promise.all(content.map(resolveNode));
586
586
  }));
587
587
  return zones;
@@ -591,7 +591,7 @@ function resolveAllData(_0, _1) {
591
591
  content: yield processContent(defaultedData.content),
592
592
  zones: yield processZones()
593
593
  };
594
- Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(this, null, function* () {
594
+ Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(null, null, function* () {
595
595
  const content = defaultedData.zones[zoneKey];
596
596
  dynamic.zones[zoneKey] = yield processContent(content);
597
597
  }), {});
package/dist/rsc.mjs CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  transformProps,
13
13
  useSlots,
14
14
  walkTree
15
- } from "./chunk-6SIKCDJJ.mjs";
15
+ } from "./chunk-FY5AZKYD.mjs";
16
16
 
17
17
  // bundle/rsc.tsx
18
18
  init_react_import();
@@ -118,6 +118,7 @@ interface CustomField<Value extends any> extends BaseField {
118
118
  type: "custom";
119
119
  render: CustomFieldRender<Value>;
120
120
  contentEditable?: boolean;
121
+ key?: string;
121
122
  }
122
123
  interface SlotField extends BaseField {
123
124
  type: "slot";
@@ -656,4 +657,4 @@ type WalkTreeOptions = {
656
657
  };
657
658
  declare function walkTree<T extends ComponentData | RootData | G["UserData"], UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(data: T, config: UserConfig, callbackFn: (data: Content, options: WalkTreeOptions) => Content | null | void): T;
658
659
 
659
- export { type ComponentDataOptionalId as $, type AppState as A, type ItemWithId as B, type Config as C, type DropZoneProps as D, type ArrayState as E, type Fields as F, type SlotComponent as G, type History as H, type IframeConfig as I, type PuckComponent as J, type ComponentConfigExtensions as K, type RootConfig as L, type Metadata as M, type DefaultComponents as N, type Overrides as O, type Permissions as P, type ExtractConfigParams as Q, type RootDataWithProps as R, type Slot as S, type ConfigParams as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type ComponentConfigParams as X, type BaseData as Y, type RootDataWithoutProps as Z, type RootData as _, type ComponentData as a, type MappedItem as a0, type ComponentDataMap as a1, type Content as a2, type PuckMetadata as a3, type ComponentMetadata as a4, type FieldMetadata as a5, type BaseField as a6, type TextField as a7, type NumberField as a8, type TextareaField as a9, type SelectField as aa, type RadioField as ab, type ArrayField as ac, type ObjectField as ad, type Adaptor as ae, type ExternalFieldWithAdaptor as af, type CacheOpts as ag, type ExternalField as ah, type CustomFieldRender as ai, type CustomField as aj, type SlotField as ak, type PuckContext as al, type DefaultRootFieldProps as am, type DefaultRootRenderProps as an, type DefaultRootProps as ao, type DefaultComponentProps as ap, type WithId as aq, type WithPuckProps as ar, type AsFieldProps as as, type WithChildren as at, type ExtractField as au, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type FieldTransforms as g, type Field as h, type FieldProps as i, type Data as j, type OnAction as k, type InitialHistory as l, migrate as m, type ItemSelector as n, type PluginInternal as o, type Direction as p, type DragAxis as q, resolveAllData as r, type Viewport as s, transformProps as t, type FieldTransformFnParams as u, type FieldTransformFn as v, walkTree as w, overrideKeys as x, type OverrideKey as y, type FieldRenderFunctions as z };
660
+ export { type RootData as $, type AppState as A, type FieldRenderFunctions as B, type Config as C, type Data as D, type ItemWithId as E, type Fields as F, type ArrayState as G, type History as H, type IframeConfig as I, type SlotComponent as J, type PuckComponent as K, type ComponentConfigExtensions as L, type Metadata as M, type RootConfig as N, type Overrides as O, type Permissions as P, type DefaultComponents as Q, type RootDataWithProps as R, type Slot as S, type ExtractConfigParams as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type ConfigParams as X, type ComponentConfigParams as Y, type BaseData as Z, type RootDataWithoutProps as _, type ComponentData as a, type ComponentDataOptionalId as a0, type MappedItem as a1, type ComponentDataMap as a2, type Content 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 DefaultRootFieldProps as an, type DefaultRootRenderProps as ao, type DefaultRootProps as ap, type DefaultComponentProps as aq, type WithId as ar, type WithPuckProps as as, type AsFieldProps as at, type WithChildren as au, type ExtractField as av, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type FieldTransforms as g, type OnAction as h, type PrivateAppState as i, type Field as j, type FieldProps as k, type DropZoneProps as l, migrate as m, type InitialHistory as n, type ItemSelector as o, type PluginInternal as p, type Direction as q, resolveAllData as r, type DragAxis as s, transformProps as t, type Viewport as u, type FieldTransformFnParams as v, walkTree as w, type FieldTransformFn as x, overrideKeys as y, type OverrideKey as z };
@@ -118,6 +118,7 @@ interface CustomField<Value extends any> extends BaseField {
118
118
  type: "custom";
119
119
  render: CustomFieldRender<Value>;
120
120
  contentEditable?: boolean;
121
+ key?: string;
121
122
  }
122
123
  interface SlotField extends BaseField {
123
124
  type: "slot";
@@ -656,4 +657,4 @@ type WalkTreeOptions = {
656
657
  };
657
658
  declare function walkTree<T extends ComponentData | RootData | G["UserData"], UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(data: T, config: UserConfig, callbackFn: (data: Content, options: WalkTreeOptions) => Content | null | void): T;
658
659
 
659
- export { type ComponentDataOptionalId as $, type AppState as A, type ItemWithId as B, type Config as C, type DropZoneProps as D, type ArrayState as E, type Fields as F, type SlotComponent as G, type History as H, type IframeConfig as I, type PuckComponent as J, type ComponentConfigExtensions as K, type RootConfig as L, type Metadata as M, type DefaultComponents as N, type Overrides as O, type Permissions as P, type ExtractConfigParams as Q, type RootDataWithProps as R, type Slot as S, type ConfigParams as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type ComponentConfigParams as X, type BaseData as Y, type RootDataWithoutProps as Z, type RootData as _, type ComponentData as a, type MappedItem as a0, type ComponentDataMap as a1, type Content as a2, type PuckMetadata as a3, type ComponentMetadata as a4, type FieldMetadata as a5, type BaseField as a6, type TextField as a7, type NumberField as a8, type TextareaField as a9, type SelectField as aa, type RadioField as ab, type ArrayField as ac, type ObjectField as ad, type Adaptor as ae, type ExternalFieldWithAdaptor as af, type CacheOpts as ag, type ExternalField as ah, type CustomFieldRender as ai, type CustomField as aj, type SlotField as ak, type PuckContext as al, type DefaultRootFieldProps as am, type DefaultRootRenderProps as an, type DefaultRootProps as ao, type DefaultComponentProps as ap, type WithId as aq, type WithPuckProps as ar, type AsFieldProps as as, type WithChildren as at, type ExtractField as au, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type FieldTransforms as g, type Field as h, type FieldProps as i, type Data as j, type OnAction as k, type InitialHistory as l, migrate as m, type ItemSelector as n, type PluginInternal as o, type Direction as p, type DragAxis as q, resolveAllData as r, type Viewport as s, transformProps as t, type FieldTransformFnParams as u, type FieldTransformFn as v, walkTree as w, overrideKeys as x, type OverrideKey as y, type FieldRenderFunctions as z };
660
+ export { type RootData as $, type AppState as A, type FieldRenderFunctions as B, type Config as C, type Data as D, type ItemWithId as E, type Fields as F, type ArrayState as G, type History as H, type IframeConfig as I, type SlotComponent as J, type PuckComponent as K, type ComponentConfigExtensions as L, type Metadata as M, type RootConfig as N, type Overrides as O, type Permissions as P, type DefaultComponents as Q, type RootDataWithProps as R, type Slot as S, type ExtractConfigParams as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type ConfigParams as X, type ComponentConfigParams as Y, type BaseData as Z, type RootDataWithoutProps as _, type ComponentData as a, type ComponentDataOptionalId as a0, type MappedItem as a1, type ComponentDataMap as a2, type Content 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 DefaultRootFieldProps as an, type DefaultRootRenderProps as ao, type DefaultRootProps as ap, type DefaultComponentProps as aq, type WithId as ar, type WithPuckProps as as, type AsFieldProps as at, type WithChildren as au, type ExtractField as av, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type FieldTransforms as g, type OnAction as h, type PrivateAppState as i, type Field as j, type FieldProps as k, type DropZoneProps as l, migrate as m, type InitialHistory as n, type ItemSelector as o, type PluginInternal as p, type Direction as q, resolveAllData as r, type DragAxis as s, transformProps as t, type Viewport as u, type FieldTransformFnParams as v, walkTree as w, type FieldTransformFn as x, overrideKeys as y, type OverrideKey as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.21.0-canary.e9d5c0ea",
3
+ "version": "0.21.0-canary.f3ce0d72",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Chris Villa <chris@puckeditor.com>",
6
6
  "repository": "measuredco/puck",