@measured/puck 0.21.0-canary.cf074bc6 → 0.21.0-canary.dfecd012
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-MYJB3LKU.mjs → chunk-5MWIJTZQ.mjs} +143 -304
- package/dist/{chunk-OOLYDXKW.mjs → chunk-JA7SEUEH.mjs} +17 -15
- package/dist/index.css +4 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +157 -322
- package/dist/index.mjs +2 -2
- package/dist/no-external.css +4 -3
- package/dist/no-external.d.mts +1 -1
- package/dist/no-external.d.ts +1 -1
- package/dist/no-external.js +154 -319
- package/dist/no-external.mjs +2 -2
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +16 -15
- package/dist/rsc.mjs +1 -1
- package/dist/{walk-tree-Ctf3FZQI.d.mts → walk-tree-BqwnaCVe.d.mts} +58 -44
- package/dist/{walk-tree-Ctf3FZQI.d.ts → walk-tree-BqwnaCVe.d.ts} +58 -44
- package/package.json +2 -2
|
@@ -681,28 +681,28 @@ init_react_import();
|
|
|
681
681
|
|
|
682
682
|
// lib/get-changed.ts
|
|
683
683
|
init_react_import();
|
|
684
|
-
import
|
|
684
|
+
import { deepEqual } from "fast-equals";
|
|
685
685
|
var getChanged = (newItem, oldItem) => {
|
|
686
686
|
return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
|
|
687
687
|
const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
|
|
688
688
|
const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
|
|
689
689
|
return __spreadProps(__spreadValues({}, acc), {
|
|
690
|
-
[item]: !
|
|
690
|
+
[item]: !deepEqual(oldItemProps[item], newItemProps[item])
|
|
691
691
|
});
|
|
692
692
|
}, {}) : {};
|
|
693
693
|
};
|
|
694
694
|
|
|
695
695
|
// lib/resolve-component-data.ts
|
|
696
|
-
import
|
|
696
|
+
import { deepEqual as deepEqual2 } from "fast-equals";
|
|
697
697
|
var cache = { lastChange: {} };
|
|
698
|
-
var resolveComponentData = (_0, _1, ..._2) => __async(
|
|
698
|
+
var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
|
|
699
699
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
|
700
700
|
const resolvedItem = __spreadValues({}, item);
|
|
701
701
|
const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
|
|
702
702
|
const id = "id" in item.props ? item.props.id : "root";
|
|
703
703
|
if (shouldRunResolver) {
|
|
704
704
|
const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
|
|
705
|
-
if (trigger !== "force" && item &&
|
|
705
|
+
if (trigger !== "force" && item && deepEqual2(item, oldItem)) {
|
|
706
706
|
return { node: resolved, didChange: false };
|
|
707
707
|
}
|
|
708
708
|
const changed = getChanged(item, oldItem);
|
|
@@ -723,11 +723,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
|
723
723
|
let itemWithResolvedChildren = yield mapFields(
|
|
724
724
|
resolvedItem,
|
|
725
725
|
{
|
|
726
|
-
slot: (_02) => __async(
|
|
726
|
+
slot: (_02) => __async(null, [_02], function* ({ value }) {
|
|
727
727
|
const content = value;
|
|
728
728
|
return yield Promise.all(
|
|
729
729
|
content.map(
|
|
730
|
-
(childItem) => __async(
|
|
730
|
+
(childItem) => __async(null, null, function* () {
|
|
731
731
|
return (yield resolveComponentData(
|
|
732
732
|
childItem,
|
|
733
733
|
config,
|
|
@@ -752,7 +752,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
|
752
752
|
};
|
|
753
753
|
return {
|
|
754
754
|
node: itemWithResolvedChildren,
|
|
755
|
-
didChange: !
|
|
755
|
+
didChange: !deepEqual2(item, itemWithResolvedChildren)
|
|
756
756
|
};
|
|
757
757
|
});
|
|
758
758
|
|
|
@@ -770,7 +770,7 @@ function resolveAllData(_0, _1) {
|
|
|
770
770
|
return __async(this, arguments, function* (data, config, metadata = {}, onResolveStart, onResolveEnd) {
|
|
771
771
|
var _a;
|
|
772
772
|
const defaultedData = defaultData(data);
|
|
773
|
-
const resolveNode = (_node) => __async(
|
|
773
|
+
const resolveNode = (_node) => __async(null, null, function* () {
|
|
774
774
|
const node = toComponent(_node);
|
|
775
775
|
onResolveStart == null ? void 0 : onResolveStart(node);
|
|
776
776
|
const resolved = (yield resolveComponentData(
|
|
@@ -791,13 +791,13 @@ function resolveAllData(_0, _1) {
|
|
|
791
791
|
onResolveEnd == null ? void 0 : onResolveEnd(toComponent(resolvedDeep));
|
|
792
792
|
return resolvedDeep;
|
|
793
793
|
});
|
|
794
|
-
const processContent = (content) => __async(
|
|
794
|
+
const processContent = (content) => __async(null, null, function* () {
|
|
795
795
|
return Promise.all(content.map(resolveNode));
|
|
796
796
|
});
|
|
797
|
-
const processZones = () => __async(
|
|
797
|
+
const processZones = () => __async(null, null, function* () {
|
|
798
798
|
var _a2;
|
|
799
799
|
const zones = (_a2 = data.zones) != null ? _a2 : {};
|
|
800
|
-
Object.entries(zones).forEach((_02) => __async(
|
|
800
|
+
Object.entries(zones).forEach((_02) => __async(null, [_02], function* ([zoneKey, content]) {
|
|
801
801
|
zones[zoneKey] = yield Promise.all(content.map(resolveNode));
|
|
802
802
|
}));
|
|
803
803
|
return zones;
|
|
@@ -807,7 +807,7 @@ function resolveAllData(_0, _1) {
|
|
|
807
807
|
content: yield processContent(defaultedData.content),
|
|
808
808
|
zones: yield processZones()
|
|
809
809
|
};
|
|
810
|
-
Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(
|
|
810
|
+
Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(null, null, function* () {
|
|
811
811
|
const content = defaultedData.zones[zoneKey];
|
|
812
812
|
dynamic.zones[zoneKey] = yield processContent(content);
|
|
813
813
|
}), {});
|
|
@@ -914,8 +914,9 @@ var Item = ({
|
|
|
914
914
|
);
|
|
915
915
|
};
|
|
916
916
|
var SlotRender = forwardRef(
|
|
917
|
-
function SlotRenderInternal({ className, style, content, config, metadata }, ref) {
|
|
918
|
-
|
|
917
|
+
function SlotRenderInternal({ className, style, content, config, metadata, as }, ref) {
|
|
918
|
+
const El = as != null ? as : "div";
|
|
919
|
+
return /* @__PURE__ */ jsx(El, { className, style, ref, children: content.map((item) => {
|
|
919
920
|
if (!config.components[item.type]) {
|
|
920
921
|
return null;
|
|
921
922
|
}
|
|
@@ -958,6 +959,7 @@ export {
|
|
|
958
959
|
useSlots,
|
|
959
960
|
SlotRenderPure,
|
|
960
961
|
SlotRender,
|
|
962
|
+
toComponent,
|
|
961
963
|
migrate,
|
|
962
964
|
transformProps,
|
|
963
965
|
resolveAllData
|
package/dist/index.css
CHANGED
|
@@ -1331,16 +1331,17 @@ body:has(._DropZone--isAnimating_1i2sv_68:empty) [data-puck-overlay] {
|
|
|
1331
1331
|
}
|
|
1332
1332
|
|
|
1333
1333
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css/#css-module-data */
|
|
1334
|
-
.
|
|
1334
|
+
._InlineTextField_104qp_1 {
|
|
1335
1335
|
cursor: text;
|
|
1336
1336
|
display: inline-block;
|
|
1337
1337
|
white-space: pre-wrap;
|
|
1338
|
+
text-decoration: inherit;
|
|
1338
1339
|
}
|
|
1339
|
-
[data-dnd-dragging] .
|
|
1340
|
+
[data-dnd-dragging] ._InlineTextField_104qp_1 {
|
|
1340
1341
|
cursor: none;
|
|
1341
1342
|
caret-color: transparent;
|
|
1342
1343
|
}
|
|
1343
|
-
[data-dnd-dragging] .
|
|
1344
|
+
[data-dnd-dragging] ._InlineTextField_104qp_1::selection {
|
|
1344
1345
|
display: none;
|
|
1345
1346
|
}
|
|
1346
1347
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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 } from './walk-tree-
|
|
2
|
-
export {
|
|
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 } from './walk-tree-BqwnaCVe.mjs';
|
|
2
|
+
export { ad as Adaptor, ab as ArrayField, B as ArrayState, ar as AsFieldProps, X as BaseData, a5 as BaseField, af as CacheOpts, J as ComponentConfigExtensions, T as ComponentConfigParams, a0 as ComponentDataMap, _ as ComponentDataOptionalId, a3 as ComponentMetadata, Q as ConfigParams, a1 as Content, ai as CustomField, ah as CustomFieldRender, ao as DefaultComponentProps, L as DefaultComponents, al as DefaultRootFieldProps, an as DefaultRootProps, am as DefaultRootRenderProps, o as Direction, p as DragAxis, ag as ExternalField, ae as ExternalFieldWithAdaptor, N as ExtractConfigParams, at as ExtractField, a4 as FieldMetadata, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, z as ItemWithId, $ as MappedItem, a7 as NumberField, ac as ObjectField, x as OverrideKey, G as PuckComponent, ak as PuckContext, a2 as PuckMetadata, aa as RadioField, K as RootConfig, Z as RootData, Y as RootDataWithoutProps, a9 as SelectField, S as Slot, E as SlotComponent, aj as SlotField, a6 as TextField, a8 as TextareaField, q as Viewport, as as WithChildren, ap as WithId, aq as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BqwnaCVe.mjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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 } from './walk-tree-
|
|
2
|
-
export {
|
|
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 } from './walk-tree-BqwnaCVe.js';
|
|
2
|
+
export { ad as Adaptor, ab as ArrayField, B as ArrayState, ar as AsFieldProps, X as BaseData, a5 as BaseField, af as CacheOpts, J as ComponentConfigExtensions, T as ComponentConfigParams, a0 as ComponentDataMap, _ as ComponentDataOptionalId, a3 as ComponentMetadata, Q as ConfigParams, a1 as Content, ai as CustomField, ah as CustomFieldRender, ao as DefaultComponentProps, L as DefaultComponents, al as DefaultRootFieldProps, an as DefaultRootProps, am as DefaultRootRenderProps, o as Direction, p as DragAxis, ag as ExternalField, ae as ExternalFieldWithAdaptor, N as ExtractConfigParams, at as ExtractField, a4 as FieldMetadata, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, z as ItemWithId, $ as MappedItem, a7 as NumberField, ac as ObjectField, x as OverrideKey, G as PuckComponent, ak as PuckContext, a2 as PuckMetadata, aa as RadioField, K as RootConfig, Z as RootData, Y as RootDataWithoutProps, a9 as SelectField, S as Slot, E as SlotComponent, aj as SlotField, a6 as TextField, a8 as TextareaField, q as Viewport, as as WithChildren, ap as WithId, aq as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BqwnaCVe.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
|