@measured/puck 0.21.0-canary.6dae6cb7 → 0.21.0-canary.74d9a160

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.
@@ -18,14 +18,14 @@ import {
18
18
  setDeep,
19
19
  useGetPuck,
20
20
  usePuck
21
- } from "./chunk-NBNCSA43.mjs";
21
+ } from "./chunk-EXX4ZSCK.mjs";
22
22
  import {
23
23
  init_react_import,
24
24
  migrate,
25
25
  resolveAllData,
26
26
  transformProps,
27
27
  walkTree
28
- } from "./chunk-OOLYDXKW.mjs";
28
+ } from "./chunk-VBJEDLUM.mjs";
29
29
 
30
30
  // bundle/no-external.ts
31
31
  init_react_import();
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-Ctf3FZQI.mjs';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-Ctf3FZQI.mjs';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-DkTSFbz_.mjs';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-DkTSFbz_.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-Ctf3FZQI.js';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-Ctf3FZQI.js';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './walk-tree-DkTSFbz_.js';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-DkTSFbz_.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
@@ -460,19 +460,19 @@ function Render({
460
460
  }
461
461
 
462
462
  // lib/get-changed.ts
463
- var import_fast_deep_equal = __toESM(require("fast-deep-equal"));
463
+ var import_fast_equals = require("fast-equals");
464
464
  var getChanged = (newItem, oldItem) => {
465
465
  return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
466
466
  const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
467
467
  const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
468
468
  return __spreadProps(__spreadValues({}, acc), {
469
- [item]: !(0, import_fast_deep_equal.default)(oldItemProps[item], newItemProps[item])
469
+ [item]: !(0, import_fast_equals.deepEqual)(oldItemProps[item], newItemProps[item])
470
470
  });
471
471
  }, {}) : {};
472
472
  };
473
473
 
474
474
  // lib/resolve-component-data.ts
475
- var import_fast_deep_equal2 = __toESM(require("fast-deep-equal"));
475
+ var import_fast_equals2 = require("fast-equals");
476
476
  var cache = { lastChange: {} };
477
477
  var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_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;
@@ -481,7 +481,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
481
481
  const id = "id" in item.props ? item.props.id : "root";
482
482
  if (shouldRunResolver) {
483
483
  const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
484
- if (trigger !== "force" && item && (0, import_fast_deep_equal2.default)(item, oldItem)) {
484
+ if (trigger !== "force" && item && (0, import_fast_equals2.deepEqual)(item, oldItem)) {
485
485
  return { node: resolved, didChange: false };
486
486
  }
487
487
  const changed = getChanged(item, oldItem);
@@ -531,7 +531,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
531
531
  };
532
532
  return {
533
533
  node: itemWithResolvedChildren,
534
- didChange: !(0, import_fast_deep_equal2.default)(item, itemWithResolvedChildren)
534
+ didChange: !(0, import_fast_equals2.deepEqual)(item, itemWithResolvedChildren)
535
535
  };
536
536
  });
537
537
 
package/dist/rsc.mjs CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  transformProps,
13
13
  useSlots,
14
14
  walkTree
15
- } from "./chunk-OOLYDXKW.mjs";
15
+ } from "./chunk-VBJEDLUM.mjs";
16
16
 
17
17
  // bundle/rsc.tsx
18
18
  init_react_import();
@@ -82,10 +82,14 @@ type ExternalFieldWithAdaptor<Props extends any = {
82
82
  adaptorParams?: object;
83
83
  getItemSummary: (item: NotUndefined<Props>, index?: number) => string;
84
84
  };
85
+ type CacheOpts = {
86
+ enabled?: boolean;
87
+ };
85
88
  type ExternalField<Props extends any = {
86
89
  [key: string]: any;
87
90
  }> = BaseField & {
88
91
  type: "external";
92
+ cache?: CacheOpts;
89
93
  placeholder?: string;
90
94
  fetchList: (params: {
91
95
  query: string;
@@ -631,4 +635,4 @@ type WalkTreeOptions = {
631
635
  };
632
636
  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;
633
637
 
634
- export { type BaseField as $, type AppState as A, type ArrayState as B, type Config as C, type DropZoneProps as D, type SlotComponent as E, type Fields as F, type PuckComponent as G, type History as H, type IframeConfig as I, type RootConfig as J, type DefaultComponents as K, type ExtractConfigParams as L, type Metadata as M, type BaseData as N, type Overrides as O, type Permissions as P, type RootDataWithoutProps as Q, type RootDataWithProps as R, type Slot as S, type RootData as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type ComponentDataOptionalId as X, type MappedItem as Y, type ComponentDataMap as Z, type Content as _, type ComponentData as a, type TextField as a0, type NumberField as a1, type TextareaField as a2, type SelectField as a3, type RadioField as a4, type ArrayField as a5, type ObjectField as a6, type Adaptor as a7, type ExternalFieldWithAdaptor as a8, type ExternalField as a9, type CustomFieldRender as aa, type CustomField as ab, type SlotField as ac, type PuckContext as ad, type DefaultRootFieldProps as ae, type DefaultRootRenderProps as af, type DefaultRootProps as ag, type DefaultComponentProps as ah, type WithId as ai, type WithPuckProps as aj, type AsFieldProps as ak, type WithChildren as al, type ExtractField as am, 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 Direction as o, type DragAxis as p, type Viewport as q, resolveAllData as r, type FieldTransformFnParams as s, transformProps as t, type FieldTransformFn as u, overrideKeys as v, walkTree as w, type OverrideKey as x, type FieldRenderFunctions as y, type ItemWithId as z };
638
+ export { type BaseField as $, type AppState as A, type ArrayState as B, type Config as C, type DropZoneProps as D, type SlotComponent as E, type Fields as F, type PuckComponent as G, type History as H, type IframeConfig as I, type RootConfig as J, type DefaultComponents as K, type ExtractConfigParams as L, type Metadata as M, type BaseData as N, type Overrides as O, type Permissions as P, type RootDataWithoutProps as Q, type RootDataWithProps as R, type Slot as S, type RootData as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type ComponentDataOptionalId as X, type MappedItem as Y, type ComponentDataMap as Z, type Content as _, type ComponentData as a, type TextField as a0, type NumberField as a1, type TextareaField as a2, type SelectField as a3, type RadioField as a4, type ArrayField as a5, type ObjectField as a6, type Adaptor as a7, type ExternalFieldWithAdaptor as a8, type CacheOpts as a9, type ExternalField as aa, type CustomFieldRender as ab, type CustomField as ac, type SlotField as ad, type PuckContext as ae, type DefaultRootFieldProps as af, type DefaultRootRenderProps as ag, type DefaultRootProps as ah, type DefaultComponentProps as ai, type WithId as aj, type WithPuckProps as ak, type AsFieldProps as al, type WithChildren as am, type ExtractField as an, 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 Direction as o, type DragAxis as p, type Viewport as q, resolveAllData as r, type FieldTransformFnParams as s, transformProps as t, type FieldTransformFn as u, overrideKeys as v, walkTree as w, type OverrideKey as x, type FieldRenderFunctions as y, type ItemWithId as z };
@@ -82,10 +82,14 @@ type ExternalFieldWithAdaptor<Props extends any = {
82
82
  adaptorParams?: object;
83
83
  getItemSummary: (item: NotUndefined<Props>, index?: number) => string;
84
84
  };
85
+ type CacheOpts = {
86
+ enabled?: boolean;
87
+ };
85
88
  type ExternalField<Props extends any = {
86
89
  [key: string]: any;
87
90
  }> = BaseField & {
88
91
  type: "external";
92
+ cache?: CacheOpts;
89
93
  placeholder?: string;
90
94
  fetchList: (params: {
91
95
  query: string;
@@ -631,4 +635,4 @@ type WalkTreeOptions = {
631
635
  };
632
636
  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;
633
637
 
634
- export { type BaseField as $, type AppState as A, type ArrayState as B, type Config as C, type DropZoneProps as D, type SlotComponent as E, type Fields as F, type PuckComponent as G, type History as H, type IframeConfig as I, type RootConfig as J, type DefaultComponents as K, type ExtractConfigParams as L, type Metadata as M, type BaseData as N, type Overrides as O, type Permissions as P, type RootDataWithoutProps as Q, type RootDataWithProps as R, type Slot as S, type RootData as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type ComponentDataOptionalId as X, type MappedItem as Y, type ComponentDataMap as Z, type Content as _, type ComponentData as a, type TextField as a0, type NumberField as a1, type TextareaField as a2, type SelectField as a3, type RadioField as a4, type ArrayField as a5, type ObjectField as a6, type Adaptor as a7, type ExternalFieldWithAdaptor as a8, type ExternalField as a9, type CustomFieldRender as aa, type CustomField as ab, type SlotField as ac, type PuckContext as ad, type DefaultRootFieldProps as ae, type DefaultRootRenderProps as af, type DefaultRootProps as ag, type DefaultComponentProps as ah, type WithId as ai, type WithPuckProps as aj, type AsFieldProps as ak, type WithChildren as al, type ExtractField as am, 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 Direction as o, type DragAxis as p, type Viewport as q, resolveAllData as r, type FieldTransformFnParams as s, transformProps as t, type FieldTransformFn as u, overrideKeys as v, walkTree as w, type OverrideKey as x, type FieldRenderFunctions as y, type ItemWithId as z };
638
+ export { type BaseField as $, type AppState as A, type ArrayState as B, type Config as C, type DropZoneProps as D, type SlotComponent as E, type Fields as F, type PuckComponent as G, type History as H, type IframeConfig as I, type RootConfig as J, type DefaultComponents as K, type ExtractConfigParams as L, type Metadata as M, type BaseData as N, type Overrides as O, type Permissions as P, type RootDataWithoutProps as Q, type RootDataWithProps as R, type Slot as S, type RootData as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type ComponentDataOptionalId as X, type MappedItem as Y, type ComponentDataMap as Z, type Content as _, type ComponentData as a, type TextField as a0, type NumberField as a1, type TextareaField as a2, type SelectField as a3, type RadioField as a4, type ArrayField as a5, type ObjectField as a6, type Adaptor as a7, type ExternalFieldWithAdaptor as a8, type CacheOpts as a9, type ExternalField as aa, type CustomFieldRender as ab, type CustomField as ac, type SlotField as ad, type PuckContext as ae, type DefaultRootFieldProps as af, type DefaultRootRenderProps as ag, type DefaultRootProps as ah, type DefaultComponentProps as ai, type WithId as aj, type WithPuckProps as ak, type AsFieldProps as al, type WithChildren as am, type ExtractField as an, 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 Direction as o, type DragAxis as p, type Viewport as q, resolveAllData as r, type FieldTransformFnParams as s, transformProps as t, type FieldTransformFn as u, overrideKeys as v, walkTree as w, type OverrideKey as x, type FieldRenderFunctions as y, type ItemWithId as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.21.0-canary.6dae6cb7",
3
+ "version": "0.21.0-canary.74d9a160",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Chris Villa <chris@puckeditor.com>",
6
6
  "repository": "measuredco/puck",
@@ -96,7 +96,7 @@
96
96
  "@dnd-kit/helpers": "0.1.18",
97
97
  "@dnd-kit/react": "0.1.18",
98
98
  "deep-diff": "^1.0.2",
99
- "fast-deep-equal": "^3.1.3",
99
+ "fast-equals": "5.2.2",
100
100
  "flat": "^5.0.2",
101
101
  "object-hash": "^3.0.0",
102
102
  "react-hotkeys-hook": "^4.6.1",