@measured/puck 0.19.0-canary.0ea6ce4 → 0.19.0-canary.24030a9

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.
@@ -22,6 +22,7 @@ type FieldOption = {
22
22
  type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
23
23
  type BaseField = {
24
24
  label?: string;
25
+ labelIcon?: ReactElement;
25
26
  };
26
27
  type TextField = BaseField & {
27
28
  type: "text";
@@ -468,4 +469,4 @@ type PuckAction = {
468
469
 
469
470
  declare function resolveAllData<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, metadata?: Metadata, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Props, RootProps>>;
470
471
 
471
- export { type PuckContext as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type ExtractPropsFromConfig as E, type FieldProps as F, type BaseField as G, type History as H, type IframeConfig as I, type TextareaField as J, type RadioField as K, type ArrayField as L, type Metadata as M, type NumberField as N, type OnAction as O, type Permissions as P, type ObjectField as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UserGenerics as U, type Viewports as V, type Adaptor as W, type ExternalFieldWithAdaptor as X, type ExternalField as Y, type CustomField as Z, type Fields as _, type Field as a, type DefaultRootRenderProps as a0, type DefaultRootProps as a1, type WithId as a2, type WithPuckProps as a3, type AsFieldProps as a4, type WithChildren as a5, resolveAllData as a6, type Data as b, type UiState as c, type Plugin as d, type Overrides as e, type PuckAction as f, type InitialHistory as g, type DefaultComponentProps as h, type DefaultRootFieldProps as i, type ExtractRootPropsFromConfig as j, type ComponentDataMap as k, type Direction as l, type DragAxis as m, type Viewport as n, overrideKeys as o, type OverrideKey as p, type FieldRenderFunctions as q, type ItemWithId as r, type ArrayState as s, type PuckComponent as t, type ComponentConfig as u, type RootDataWithoutProps as v, type RootData as w, type ComponentData as x, type MappedItem as y, type Content as z };
472
+ export { type DefaultRootProps as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type BaseField as E, type FieldProps as F, type TextareaField as G, type History as H, type IframeConfig as I, type RadioField as J, type ArrayField as K, type ObjectField as L, type Metadata as M, type NumberField as N, type OnAction as O, type Permissions as P, type Adaptor as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UserGenerics as U, type Viewports as V, type ExternalFieldWithAdaptor as W, type ExternalField as X, type CustomField as Y, type PuckContext as Z, type DefaultRootRenderProps as _, type Field as a, type WithId as a0, type WithPuckProps as a1, type AsFieldProps as a2, type WithChildren as a3, type ExtractPropsFromConfig as a4, type ExtractRootPropsFromConfig as a5, resolveAllData as a6, type Data as b, type UiState as c, type Plugin as d, type Overrides as e, type PuckAction as f, type InitialHistory as g, type DefaultComponentProps as h, type DefaultRootFieldProps as i, type ComponentData as j, type Fields as k, type ComponentConfig as l, type Direction as m, type DragAxis as n, type Viewport as o, overrideKeys as p, type OverrideKey as q, type FieldRenderFunctions as r, type ItemWithId as s, type ArrayState as t, type PuckComponent as u, type RootDataWithoutProps as v, type RootData as w, type MappedItem as x, type ComponentDataMap as y, type Content as z };
@@ -22,6 +22,7 @@ type FieldOption = {
22
22
  type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
23
23
  type BaseField = {
24
24
  label?: string;
25
+ labelIcon?: ReactElement;
25
26
  };
26
27
  type TextField = BaseField & {
27
28
  type: "text";
@@ -468,4 +469,4 @@ type PuckAction = {
468
469
 
469
470
  declare function resolveAllData<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, metadata?: Metadata, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Props, RootProps>>;
470
471
 
471
- export { type PuckContext as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type ExtractPropsFromConfig as E, type FieldProps as F, type BaseField as G, type History as H, type IframeConfig as I, type TextareaField as J, type RadioField as K, type ArrayField as L, type Metadata as M, type NumberField as N, type OnAction as O, type Permissions as P, type ObjectField as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UserGenerics as U, type Viewports as V, type Adaptor as W, type ExternalFieldWithAdaptor as X, type ExternalField as Y, type CustomField as Z, type Fields as _, type Field as a, type DefaultRootRenderProps as a0, type DefaultRootProps as a1, type WithId as a2, type WithPuckProps as a3, type AsFieldProps as a4, type WithChildren as a5, resolveAllData as a6, type Data as b, type UiState as c, type Plugin as d, type Overrides as e, type PuckAction as f, type InitialHistory as g, type DefaultComponentProps as h, type DefaultRootFieldProps as i, type ExtractRootPropsFromConfig as j, type ComponentDataMap as k, type Direction as l, type DragAxis as m, type Viewport as n, overrideKeys as o, type OverrideKey as p, type FieldRenderFunctions as q, type ItemWithId as r, type ArrayState as s, type PuckComponent as t, type ComponentConfig as u, type RootDataWithoutProps as v, type RootData as w, type ComponentData as x, type MappedItem as y, type Content as z };
472
+ export { type DefaultRootProps as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type BaseField as E, type FieldProps as F, type TextareaField as G, type History as H, type IframeConfig as I, type RadioField as J, type ArrayField as K, type ObjectField as L, type Metadata as M, type NumberField as N, type OnAction as O, type Permissions as P, type Adaptor as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UserGenerics as U, type Viewports as V, type ExternalFieldWithAdaptor as W, type ExternalField as X, type CustomField as Y, type PuckContext as Z, type DefaultRootRenderProps as _, type Field as a, type WithId as a0, type WithPuckProps as a1, type AsFieldProps as a2, type WithChildren as a3, type ExtractPropsFromConfig as a4, type ExtractRootPropsFromConfig as a5, resolveAllData as a6, type Data as b, type UiState as c, type Plugin as d, type Overrides as e, type PuckAction as f, type InitialHistory as g, type DefaultComponentProps as h, type DefaultRootFieldProps as i, type ComponentData as j, type Fields as k, type ComponentConfig as l, type Direction as m, type DragAxis as n, type Viewport as o, overrideKeys as p, type OverrideKey as q, type FieldRenderFunctions as r, type ItemWithId as s, type ArrayState as t, type PuckComponent as u, type RootDataWithoutProps as v, type RootData as w, type MappedItem as x, type ComponentDataMap as y, type Content as z };
package/dist/rsc.d.mts CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, U as UserGenerics, M as Metadata } from './resolve-all-data-D4okkICg.mjs';
3
- export { a6 as resolveAllData } from './resolve-all-data-D4okkICg.mjs';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './resolve-all-data-DleIzc4N.mjs';
3
+ export { a6 as resolveAllData } from './resolve-all-data-DleIzc4N.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, }: {
7
7
  config: UserConfig;
8
8
  data: G["UserData"];
9
- metadata: Metadata;
9
+ metadata?: Metadata;
10
10
  }): react_jsx_runtime.JSX.Element;
11
11
 
12
12
  export { Render };
package/dist/rsc.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, U as UserGenerics, M as Metadata } from './resolve-all-data-D4okkICg.js';
3
- export { a6 as resolveAllData } from './resolve-all-data-D4okkICg.js';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './resolve-all-data-DleIzc4N.js';
3
+ export { a6 as resolveAllData } from './resolve-all-data-DleIzc4N.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, }: {
7
7
  config: UserConfig;
8
8
  data: G["UserData"];
9
- metadata: Metadata;
9
+ metadata?: Metadata;
10
10
  }): react_jsx_runtime.JSX.Element;
11
11
 
12
12
  export { Render };
package/dist/rsc.js CHANGED
@@ -76,7 +76,9 @@ module.exports = __toCommonJS(rsc_exports);
76
76
  var import_react = __toESM(require("react"));
77
77
 
78
78
  // lib/root-droppable-id.ts
79
- var rootDroppableId = "default-zone";
79
+ var rootAreaId = "root";
80
+ var rootZone = "default-zone";
81
+ var rootDroppableId = `${rootAreaId}:${rootZone}`;
80
82
 
81
83
  // lib/setup-zone.ts
82
84
  var setupZone = (data, zoneKey) => {
@@ -104,7 +106,7 @@ function DropZoneRender({
104
106
  if (!data || !config) {
105
107
  return null;
106
108
  }
107
- if (areaId && zone && zone !== rootDroppableId) {
109
+ if (areaId !== rootAreaId && zone !== rootZone) {
108
110
  zoneCompound = `${areaId}:${zone}`;
109
111
  content = setupZone(data, zoneCompound).zones[zoneCompound];
110
112
  }
@@ -167,7 +169,7 @@ function Render({
167
169
  {
168
170
  config,
169
171
  data,
170
- zone: rootDroppableId,
172
+ zone: rootZone,
171
173
  metadata
172
174
  }
173
175
  )
@@ -179,7 +181,7 @@ function Render({
179
181
  {
180
182
  config,
181
183
  data,
182
- zone: rootDroppableId,
184
+ zone: rootZone,
183
185
  metadata
184
186
  }
185
187
  );
package/dist/rsc.mjs CHANGED
@@ -3,9 +3,11 @@ import {
3
3
  __spreadValues,
4
4
  init_react_import,
5
5
  resolveAllData,
6
+ rootAreaId,
6
7
  rootDroppableId,
8
+ rootZone,
7
9
  setupZone
8
- } from "./chunk-FNRHXUGA.mjs";
10
+ } from "./chunk-T6VJEBJD.mjs";
9
11
 
10
12
  // rsc.tsx
11
13
  init_react_import();
@@ -25,7 +27,7 @@ function DropZoneRender({
25
27
  if (!data || !config) {
26
28
  return null;
27
29
  }
28
- if (areaId && zone && zone !== rootDroppableId) {
30
+ if (areaId !== rootAreaId && zone !== rootZone) {
29
31
  zoneCompound = `${areaId}:${zone}`;
30
32
  content = setupZone(data, zoneCompound).zones[zoneCompound];
31
33
  }
@@ -88,7 +90,7 @@ function Render({
88
90
  {
89
91
  config,
90
92
  data,
91
- zone: rootDroppableId,
93
+ zone: rootZone,
92
94
  metadata
93
95
  }
94
96
  )
@@ -100,7 +102,7 @@ function Render({
100
102
  {
101
103
  config,
102
104
  data,
103
- zone: rootDroppableId,
105
+ zone: rootZone,
104
106
  metadata
105
107
  }
106
108
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.19.0-canary.0ea6ce4",
3
+ "version": "0.19.0-canary.24030a9",
4
4
  "author": "Measured Corporation Ltd <hello@measured.co>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",
@@ -27,7 +27,8 @@
27
27
  "require": "./dist/rsc.js"
28
28
  },
29
29
  "./puck.css": "./dist/index.css",
30
- "./dist/index.css": "./dist/index.css"
30
+ "./dist/index.css": "./dist/index.css",
31
+ "./package.json": "./package.json"
31
32
  },
32
33
  "typesVersions": {
33
34
  "*": {
@@ -71,6 +72,7 @@
71
72
  "@dnd-kit/helpers": "0.0.7-beta-20250130032138",
72
73
  "@dnd-kit/react": "0.0.7-beta-20250130032138",
73
74
  "deep-diff": "^1.0.2",
75
+ "fast-deep-equal": "^3.1.3",
74
76
  "object-hash": "^3.0.0",
75
77
  "react-hotkeys-hook": "^4.6.1",
76
78
  "use-debounce": "^9.0.4",