@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.
- package/dist/{chunk-J6I4S2BQ.mjs → chunk-73365SXB.mjs} +138 -425
- package/dist/{chunk-6SIKCDJJ.mjs → chunk-FY5AZKYD.mjs} +8 -8
- package/dist/index.css +35 -34
- package/dist/index.d.mts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +110 -394
- package/dist/index.mjs +4 -2
- package/dist/no-external.css +35 -34
- package/dist/no-external.d.mts +2 -2
- package/dist/no-external.d.ts +2 -2
- package/dist/no-external.js +107 -391
- package/dist/no-external.mjs +4 -2
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +8 -8
- package/dist/rsc.mjs +1 -1
- package/dist/{walk-tree-CD9WQheJ.d.mts → walk-tree-CL-j099F.d.mts} +2 -1
- package/dist/{walk-tree-CD9WQheJ.d.ts → walk-tree-CL-j099F.d.ts} +2 -1
- package/package.json +1 -1
package/dist/no-external.mjs
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
3
|
-
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
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-
|
|
3
|
-
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
578
|
+
const processContent = (content) => __async(null, null, function* () {
|
|
579
579
|
return Promise.all(content.map(resolveNode));
|
|
580
580
|
});
|
|
581
|
-
const processZones = () => __async(
|
|
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(
|
|
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(
|
|
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
|
@@ -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
|
|
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
|
|
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