@measured/puck 0.20.0-canary.def0ecb5 → 0.20.0-canary.e25949a6
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-VATSTM62.mjs → chunk-FYXJ5FPS.mjs} +725 -501
- package/dist/{chunk-32MJ3X3H.mjs → chunk-HUKJ36SA.mjs} +131 -69
- package/dist/index.css +79 -45
- package/dist/index.d.mts +15 -3
- package/dist/index.d.ts +15 -3
- package/dist/index.js +875 -591
- package/dist/index.mjs +6 -2
- package/dist/no-external.css +79 -45
- package/dist/no-external.d.mts +2 -2
- package/dist/no-external.d.ts +2 -2
- package/dist/no-external.js +875 -591
- package/dist/no-external.mjs +6 -2
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +138 -70
- package/dist/rsc.mjs +1 -1
- package/dist/{walk-tree-mCPqBAls.d.mts → walk-tree-B57SgEEc.d.mts} +26 -2
- package/dist/{walk-tree-mCPqBAls.d.ts → walk-tree-B57SgEEc.d.ts} +26 -2
- package/package.json +1 -1
|
@@ -87,7 +87,7 @@ var init_react_import = __esm({
|
|
|
87
87
|
// lib/data/walk-tree.ts
|
|
88
88
|
init_react_import();
|
|
89
89
|
|
|
90
|
-
// lib/data/map-
|
|
90
|
+
// lib/data/map-fields.ts
|
|
91
91
|
init_react_import();
|
|
92
92
|
|
|
93
93
|
// lib/data/default-slots.ts
|
|
@@ -97,14 +97,14 @@ var defaultSlots = (value, fields) => Object.keys(fields).reduce(
|
|
|
97
97
|
value
|
|
98
98
|
);
|
|
99
99
|
|
|
100
|
-
// lib/data/map-
|
|
100
|
+
// lib/data/map-fields.ts
|
|
101
101
|
var isPromise = (v) => !!v && typeof v.then === "function";
|
|
102
102
|
var flatten = (values) => values.reduce((acc, item) => __spreadValues(__spreadValues({}, acc), item), {});
|
|
103
103
|
var containsPromise = (arr) => arr.some(isPromise);
|
|
104
104
|
var walkField = ({
|
|
105
105
|
value,
|
|
106
106
|
fields,
|
|
107
|
-
|
|
107
|
+
mappers,
|
|
108
108
|
propKey = "",
|
|
109
109
|
propPath = "",
|
|
110
110
|
id = "",
|
|
@@ -112,7 +112,9 @@ var walkField = ({
|
|
|
112
112
|
recurseSlots = false
|
|
113
113
|
}) => {
|
|
114
114
|
var _a, _b, _c;
|
|
115
|
-
|
|
115
|
+
const fieldType = (_a = fields[propKey]) == null ? void 0 : _a.type;
|
|
116
|
+
const map = mappers[fieldType];
|
|
117
|
+
if (map && fieldType === "slot") {
|
|
116
118
|
const content = value || [];
|
|
117
119
|
const mappedContent = recurseSlots ? content.map((el) => {
|
|
118
120
|
var _a2;
|
|
@@ -124,7 +126,7 @@ var walkField = ({
|
|
|
124
126
|
return walkField({
|
|
125
127
|
value: __spreadProps(__spreadValues({}, el), { props: defaultSlots(el.props, fields2) }),
|
|
126
128
|
fields: fields2,
|
|
127
|
-
|
|
129
|
+
mappers,
|
|
128
130
|
id: el.props.id,
|
|
129
131
|
config,
|
|
130
132
|
recurseSlots
|
|
@@ -133,7 +135,21 @@ var walkField = ({
|
|
|
133
135
|
if (containsPromise(mappedContent)) {
|
|
134
136
|
return Promise.all(mappedContent);
|
|
135
137
|
}
|
|
136
|
-
return map(
|
|
138
|
+
return map({
|
|
139
|
+
value: mappedContent,
|
|
140
|
+
parentId: id,
|
|
141
|
+
propName: propKey,
|
|
142
|
+
field: fields[propKey],
|
|
143
|
+
propPath
|
|
144
|
+
});
|
|
145
|
+
} else if (map && fields[propKey]) {
|
|
146
|
+
return map({
|
|
147
|
+
value,
|
|
148
|
+
parentId: id,
|
|
149
|
+
propName: propKey,
|
|
150
|
+
field: fields[propKey],
|
|
151
|
+
propPath
|
|
152
|
+
});
|
|
137
153
|
}
|
|
138
154
|
if (value && typeof value === "object") {
|
|
139
155
|
if (Array.isArray(value)) {
|
|
@@ -143,7 +159,7 @@ var walkField = ({
|
|
|
143
159
|
(el, idx) => walkField({
|
|
144
160
|
value: el,
|
|
145
161
|
fields: arrayFields,
|
|
146
|
-
|
|
162
|
+
mappers,
|
|
147
163
|
propKey,
|
|
148
164
|
propPath: `${propPath}[${idx}]`,
|
|
149
165
|
id,
|
|
@@ -162,7 +178,7 @@ var walkField = ({
|
|
|
162
178
|
return walkObject({
|
|
163
179
|
value,
|
|
164
180
|
fields: objectFields,
|
|
165
|
-
|
|
181
|
+
mappers,
|
|
166
182
|
id,
|
|
167
183
|
getPropPath: (k) => `${propPath}.${k}`,
|
|
168
184
|
config,
|
|
@@ -175,7 +191,7 @@ var walkField = ({
|
|
|
175
191
|
var walkObject = ({
|
|
176
192
|
value,
|
|
177
193
|
fields,
|
|
178
|
-
|
|
194
|
+
mappers,
|
|
179
195
|
id,
|
|
180
196
|
getPropPath,
|
|
181
197
|
config,
|
|
@@ -185,7 +201,7 @@ var walkObject = ({
|
|
|
185
201
|
const opts = {
|
|
186
202
|
value: v,
|
|
187
203
|
fields,
|
|
188
|
-
|
|
204
|
+
mappers,
|
|
189
205
|
propKey: k,
|
|
190
206
|
propPath: getPropPath(k),
|
|
191
207
|
id,
|
|
@@ -207,14 +223,14 @@ var walkObject = ({
|
|
|
207
223
|
}
|
|
208
224
|
return flatten(newProps);
|
|
209
225
|
};
|
|
210
|
-
function
|
|
226
|
+
function mapFields(item, mappers, config, recurseSlots = false) {
|
|
211
227
|
var _a, _b, _c, _d, _e;
|
|
212
228
|
const itemType = "type" in item ? item.type : "root";
|
|
213
229
|
const componentConfig = itemType === "root" ? config.root : (_a = config.components) == null ? void 0 : _a[itemType];
|
|
214
230
|
const newProps = walkObject({
|
|
215
231
|
value: defaultSlots((_b = item.props) != null ? _b : {}, (_c = componentConfig == null ? void 0 : componentConfig.fields) != null ? _c : {}),
|
|
216
232
|
fields: (_d = componentConfig == null ? void 0 : componentConfig.fields) != null ? _d : {},
|
|
217
|
-
|
|
233
|
+
mappers,
|
|
218
234
|
id: item.props ? (_e = item.props.id) != null ? _e : "root" : "root",
|
|
219
235
|
getPropPath: (k) => k,
|
|
220
236
|
config,
|
|
@@ -234,11 +250,14 @@ function mapSlots(item, map, config, recurseSlots = false) {
|
|
|
234
250
|
function walkTree(data, config, callbackFn) {
|
|
235
251
|
var _a, _b;
|
|
236
252
|
const walkItem = (item) => {
|
|
237
|
-
return
|
|
253
|
+
return mapFields(
|
|
238
254
|
item,
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
255
|
+
{
|
|
256
|
+
slot: ({ value, parentId, propName }) => {
|
|
257
|
+
var _a2;
|
|
258
|
+
const content = value;
|
|
259
|
+
return (_a2 = callbackFn(content, { parentId, propName })) != null ? _a2 : content;
|
|
260
|
+
}
|
|
242
261
|
},
|
|
243
262
|
config,
|
|
244
263
|
true
|
|
@@ -289,35 +308,70 @@ var setupZone = (data, zoneKey) => {
|
|
|
289
308
|
|
|
290
309
|
// lib/use-slots.tsx
|
|
291
310
|
init_react_import();
|
|
311
|
+
|
|
312
|
+
// lib/field-transforms/use-field-transforms.tsx
|
|
313
|
+
init_react_import();
|
|
292
314
|
import { useMemo } from "react";
|
|
293
|
-
function
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
(
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
315
|
+
function useFieldTransforms(config, item, transforms, readOnly, forceReadOnly) {
|
|
316
|
+
const mappers = useMemo(() => {
|
|
317
|
+
return Object.keys(transforms).reduce((acc, _fieldType) => {
|
|
318
|
+
const fieldType = _fieldType;
|
|
319
|
+
return __spreadProps(__spreadValues({}, acc), {
|
|
320
|
+
[fieldType]: (_a) => {
|
|
321
|
+
var _b = _a, {
|
|
322
|
+
parentId
|
|
323
|
+
} = _b, params = __objRest(_b, [
|
|
324
|
+
"parentId"
|
|
325
|
+
]);
|
|
326
|
+
const wildcardPath = params.propPath.replace(/\[\d+\]/g, "[*]");
|
|
327
|
+
const isReadOnly = (readOnly == null ? void 0 : readOnly[params.propPath]) || (readOnly == null ? void 0 : readOnly[wildcardPath]) || forceReadOnly || false;
|
|
328
|
+
const fn = transforms[fieldType];
|
|
329
|
+
return fn == null ? void 0 : fn(__spreadProps(__spreadValues({}, params), {
|
|
330
|
+
isReadOnly,
|
|
331
|
+
componentId: parentId
|
|
332
|
+
}));
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
}, {});
|
|
336
|
+
}, [transforms, readOnly, forceReadOnly]);
|
|
337
|
+
const transformedProps = useMemo(() => {
|
|
338
|
+
const mapped = mapFields(item, mappers, config).props;
|
|
312
339
|
return mapped;
|
|
313
|
-
}, [config, item,
|
|
340
|
+
}, [config, item, mappers]);
|
|
314
341
|
const mergedProps = useMemo(
|
|
315
|
-
() => __spreadValues(__spreadValues({}, item.props),
|
|
316
|
-
[item.props,
|
|
342
|
+
() => __spreadValues(__spreadValues({}, item.props), transformedProps),
|
|
343
|
+
[item.props, transformedProps]
|
|
317
344
|
);
|
|
318
345
|
return mergedProps;
|
|
319
346
|
}
|
|
320
347
|
|
|
348
|
+
// lib/field-transforms/default-transforms/slot-transform.tsx
|
|
349
|
+
init_react_import();
|
|
350
|
+
var getSlotTransform = (renderSlotEdit, renderSlotRender = renderSlotEdit) => ({
|
|
351
|
+
slot: ({ value: content, propName, field, isReadOnly }) => {
|
|
352
|
+
const render = isReadOnly ? renderSlotRender : renderSlotEdit;
|
|
353
|
+
const Slot = (dzProps) => render(__spreadProps(__spreadValues({
|
|
354
|
+
allow: (field == null ? void 0 : field.type) === "slot" ? field.allow : [],
|
|
355
|
+
disallow: (field == null ? void 0 : field.type) === "slot" ? field.disallow : []
|
|
356
|
+
}, dzProps), {
|
|
357
|
+
zone: propName,
|
|
358
|
+
content
|
|
359
|
+
}));
|
|
360
|
+
return Slot;
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
// lib/use-slots.tsx
|
|
365
|
+
function useSlots(config, item, renderSlotEdit, renderSlotRender = renderSlotEdit, readOnly, forceReadOnly) {
|
|
366
|
+
return useFieldTransforms(
|
|
367
|
+
config,
|
|
368
|
+
item,
|
|
369
|
+
getSlotTransform(renderSlotEdit, renderSlotRender),
|
|
370
|
+
readOnly,
|
|
371
|
+
forceReadOnly
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
|
|
321
375
|
// components/SlotRender/server.tsx
|
|
322
376
|
init_react_import();
|
|
323
377
|
import { forwardRef } from "react";
|
|
@@ -530,7 +584,7 @@ import flat from "flat";
|
|
|
530
584
|
// lib/data/strip-slots.ts
|
|
531
585
|
init_react_import();
|
|
532
586
|
var stripSlots = (data, config) => {
|
|
533
|
-
return
|
|
587
|
+
return mapFields(data, { slot: () => null }, config);
|
|
534
588
|
};
|
|
535
589
|
|
|
536
590
|
// lib/data/flatten-node.ts
|
|
@@ -589,18 +643,21 @@ function walkAppState(state, config, mapContent = (content) => content, mapNodeO
|
|
|
589
643
|
const mappedItem = mapNodeOrSkip(item, path, index);
|
|
590
644
|
if (!mappedItem) return item;
|
|
591
645
|
const id = mappedItem.props.id;
|
|
592
|
-
const newProps = __spreadProps(__spreadValues({},
|
|
646
|
+
const newProps = __spreadProps(__spreadValues({}, mapFields(
|
|
593
647
|
mappedItem,
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
648
|
+
{
|
|
649
|
+
slot: ({ value, parentId: parentId2, propPath }) => {
|
|
650
|
+
const content = value;
|
|
651
|
+
const zoneCompound = `${parentId2}:${propPath}`;
|
|
652
|
+
const [_2, newContent2] = processContent(
|
|
653
|
+
path,
|
|
654
|
+
zoneCompound,
|
|
655
|
+
content,
|
|
656
|
+
"slot",
|
|
657
|
+
parentId2
|
|
658
|
+
);
|
|
659
|
+
return newContent2;
|
|
660
|
+
}
|
|
604
661
|
},
|
|
605
662
|
config
|
|
606
663
|
).props), {
|
|
@@ -879,24 +936,27 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
|
879
936
|
resolvedItem.readOnly = readOnly;
|
|
880
937
|
}
|
|
881
938
|
}
|
|
882
|
-
let itemWithResolvedChildren = yield
|
|
939
|
+
let itemWithResolvedChildren = yield mapFields(
|
|
883
940
|
resolvedItem,
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
content
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
941
|
+
{
|
|
942
|
+
slot: (_02) => __async(void 0, [_02], function* ({ value }) {
|
|
943
|
+
const content = value;
|
|
944
|
+
return yield Promise.all(
|
|
945
|
+
content.map(
|
|
946
|
+
(childItem) => __async(void 0, null, function* () {
|
|
947
|
+
return (yield resolveComponentData(
|
|
948
|
+
childItem,
|
|
949
|
+
config,
|
|
950
|
+
metadata,
|
|
951
|
+
onResolveStart,
|
|
952
|
+
onResolveEnd,
|
|
953
|
+
trigger
|
|
954
|
+
)).node;
|
|
955
|
+
})
|
|
956
|
+
)
|
|
957
|
+
);
|
|
958
|
+
})
|
|
959
|
+
},
|
|
900
960
|
config
|
|
901
961
|
);
|
|
902
962
|
if (shouldRunResolver && onResolveEnd) {
|
|
@@ -939,9 +999,9 @@ function resolveAllData(_0, _1) {
|
|
|
939
999
|
},
|
|
940
1000
|
"force"
|
|
941
1001
|
)).node;
|
|
942
|
-
const resolvedDeep = yield
|
|
1002
|
+
const resolvedDeep = yield mapFields(
|
|
943
1003
|
resolved,
|
|
944
|
-
processContent,
|
|
1004
|
+
{ slot: ({ value }) => processContent(value) },
|
|
945
1005
|
config
|
|
946
1006
|
);
|
|
947
1007
|
onResolveEnd == null ? void 0 : onResolveEnd(toComponent(resolvedDeep));
|
|
@@ -992,6 +1052,8 @@ export {
|
|
|
992
1052
|
getChanged,
|
|
993
1053
|
resolveComponentData,
|
|
994
1054
|
defaultAppState,
|
|
1055
|
+
useFieldTransforms,
|
|
1056
|
+
getSlotTransform,
|
|
995
1057
|
useSlots,
|
|
996
1058
|
Render,
|
|
997
1059
|
SlotRenderPure,
|
package/dist/index.css
CHANGED
|
@@ -231,10 +231,10 @@
|
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/AutoField/styles.module.css/#css-module-data */
|
|
234
|
-
.
|
|
234
|
+
._InputWrapper_bsxfo_1 + ._InputWrapper_bsxfo_1 {
|
|
235
235
|
margin-top: 12px;
|
|
236
236
|
}
|
|
237
|
-
._Input-
|
|
237
|
+
._Input-label_bsxfo_5 {
|
|
238
238
|
align-items: center;
|
|
239
239
|
color: var(--puck-color-grey-04);
|
|
240
240
|
display: flex;
|
|
@@ -242,17 +242,17 @@
|
|
|
242
242
|
font-size: var(--puck-font-size-xxs);
|
|
243
243
|
font-weight: 600;
|
|
244
244
|
}
|
|
245
|
-
._Input-
|
|
245
|
+
._Input-labelIcon_bsxfo_14 {
|
|
246
246
|
color: var(--puck-color-grey-07);
|
|
247
247
|
display: flex;
|
|
248
248
|
margin-inline-end: 4px;
|
|
249
249
|
padding-inline-start: 4px;
|
|
250
250
|
}
|
|
251
|
-
._Input-
|
|
251
|
+
._Input-disabledIcon_bsxfo_21 {
|
|
252
252
|
color: var(--puck-color-grey-05);
|
|
253
253
|
margin-inline-start: auto;
|
|
254
254
|
}
|
|
255
|
-
._Input-
|
|
255
|
+
._Input-input_bsxfo_26 {
|
|
256
256
|
background: var(--puck-color-white);
|
|
257
257
|
border-width: 1px;
|
|
258
258
|
border-style: solid;
|
|
@@ -260,13 +260,18 @@
|
|
|
260
260
|
border-radius: 4px;
|
|
261
261
|
box-sizing: border-box;
|
|
262
262
|
font-family: inherit;
|
|
263
|
-
font-size:
|
|
263
|
+
font-size: 16px;
|
|
264
264
|
padding: 12px 15px;
|
|
265
265
|
transition: border-color 50ms ease-in;
|
|
266
266
|
width: 100%;
|
|
267
267
|
max-width: 100%;
|
|
268
268
|
}
|
|
269
|
-
|
|
269
|
+
@media (min-width: 458px) {
|
|
270
|
+
._Input-input_bsxfo_26 {
|
|
271
|
+
font-size: 14px;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
select._Input-input_bsxfo_26 {
|
|
270
275
|
appearance: none;
|
|
271
276
|
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23c3c3c3'><polygon points='0,0 100,0 50,50'/></svg>") no-repeat;
|
|
272
277
|
background-size: 12px;
|
|
@@ -275,29 +280,29 @@ select._Input-input_py9hf_26 {
|
|
|
275
280
|
background-color: var(--puck-color-white);
|
|
276
281
|
cursor: pointer;
|
|
277
282
|
}
|
|
278
|
-
select._Input-
|
|
283
|
+
select._Input-input_bsxfo_26:dir(rtl) {
|
|
279
284
|
background-position: 12px calc(50% + 3px);
|
|
280
285
|
}
|
|
281
286
|
@media (hover: hover) and (pointer: fine) {
|
|
282
|
-
.
|
|
283
|
-
.
|
|
287
|
+
._Input_bsxfo_1:has(> input):hover ._Input-input_bsxfo_26:not([readonly]),
|
|
288
|
+
._Input_bsxfo_1:has(> textarea):hover ._Input-input_bsxfo_26:not([readonly]) {
|
|
284
289
|
border-color: var(--puck-color-grey-05);
|
|
285
290
|
transition: none;
|
|
286
291
|
}
|
|
287
|
-
.
|
|
292
|
+
._Input_bsxfo_1:has(> select):hover ._Input-input_bsxfo_26:not([disabled]) {
|
|
288
293
|
background-color: var(--puck-color-azure-12);
|
|
289
294
|
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%235a5a5a'><polygon points='0,0 100,0 50,50'/></svg>");
|
|
290
295
|
border-color: var(--puck-color-grey-05);
|
|
291
296
|
transition: none;
|
|
292
297
|
}
|
|
293
298
|
}
|
|
294
|
-
._Input-
|
|
299
|
+
._Input-input_bsxfo_26:focus {
|
|
295
300
|
border-color: var(--puck-color-grey-05);
|
|
296
301
|
outline: 2px solid var(--puck-color-azure-05);
|
|
297
302
|
transition: none;
|
|
298
303
|
}
|
|
299
|
-
._Input--
|
|
300
|
-
._Input--
|
|
304
|
+
._Input--readOnly_bsxfo_82 > ._Input-input_bsxfo_26,
|
|
305
|
+
._Input--readOnly_bsxfo_82 > select._Input-input_bsxfo_26 {
|
|
301
306
|
background-color: var(--puck-color-grey-11);
|
|
302
307
|
border-color: var(--puck-color-grey-09);
|
|
303
308
|
color: var(--puck-color-grey-04);
|
|
@@ -306,34 +311,34 @@ select._Input-input_py9hf_26:dir(rtl) {
|
|
|
306
311
|
outline: 0;
|
|
307
312
|
transition: none;
|
|
308
313
|
}
|
|
309
|
-
._Input-
|
|
314
|
+
._Input-radioGroupItems_bsxfo_93 {
|
|
310
315
|
display: flex;
|
|
311
316
|
border: 1px solid var(--puck-color-grey-09);
|
|
312
317
|
border-radius: 4px;
|
|
313
318
|
flex-wrap: wrap;
|
|
314
319
|
}
|
|
315
|
-
._Input-
|
|
320
|
+
._Input-radio_bsxfo_93 {
|
|
316
321
|
border-inline-end: 1px solid var(--puck-color-grey-09);
|
|
317
322
|
flex-grow: 1;
|
|
318
323
|
}
|
|
319
|
-
._Input-
|
|
324
|
+
._Input-radio_bsxfo_93:first-of-type {
|
|
320
325
|
border-bottom-left-radius: 4px;
|
|
321
326
|
border-top-left-radius: 4px;
|
|
322
327
|
}
|
|
323
|
-
._Input-
|
|
328
|
+
._Input-radio_bsxfo_93:first-of-type ._Input-radioInner_bsxfo_110 {
|
|
324
329
|
border-bottom-left-radius: 3px;
|
|
325
330
|
border-top-left-radius: 3px;
|
|
326
331
|
}
|
|
327
|
-
._Input-
|
|
332
|
+
._Input-radio_bsxfo_93:last-of-type {
|
|
328
333
|
border-bottom-right-radius: 4px;
|
|
329
334
|
border-inline-end: 0;
|
|
330
335
|
border-top-right-radius: 4px;
|
|
331
336
|
}
|
|
332
|
-
._Input-
|
|
337
|
+
._Input-radio_bsxfo_93:last-of-type ._Input-radioInner_bsxfo_110 {
|
|
333
338
|
border-bottom-right-radius: 3px;
|
|
334
339
|
border-top-right-radius: 3px;
|
|
335
340
|
}
|
|
336
|
-
._Input-
|
|
341
|
+
._Input-radioInner_bsxfo_110 {
|
|
337
342
|
background-color: var(--puck-color-white);
|
|
338
343
|
color: var(--puck-color-grey-04);
|
|
339
344
|
cursor: pointer;
|
|
@@ -342,32 +347,32 @@ select._Input-input_py9hf_26:dir(rtl) {
|
|
|
342
347
|
text-align: center;
|
|
343
348
|
transition: background-color 50ms ease-in;
|
|
344
349
|
}
|
|
345
|
-
._Input-
|
|
350
|
+
._Input-radio_bsxfo_93:has(:focus-visible) {
|
|
346
351
|
outline: 2px solid var(--puck-color-azure-05);
|
|
347
352
|
outline-offset: 2px;
|
|
348
353
|
position: relative;
|
|
349
354
|
}
|
|
350
355
|
@media (hover: hover) and (pointer: fine) {
|
|
351
|
-
._Input-
|
|
356
|
+
._Input-radioInner_bsxfo_110:hover {
|
|
352
357
|
background-color: var(--puck-color-azure-12);
|
|
353
358
|
transition: none;
|
|
354
359
|
}
|
|
355
360
|
}
|
|
356
|
-
._Input--
|
|
361
|
+
._Input--readOnly_bsxfo_82 ._Input-radioInner_bsxfo_110 {
|
|
357
362
|
background-color: var(--puck-color-white);
|
|
358
363
|
color: var(--puck-color-grey-04);
|
|
359
364
|
cursor: default;
|
|
360
365
|
}
|
|
361
|
-
._Input-
|
|
366
|
+
._Input-radio_bsxfo_93 ._Input-radioInput_bsxfo_155:checked ~ ._Input-radioInner_bsxfo_110 {
|
|
362
367
|
background-color: var(--puck-color-azure-11);
|
|
363
368
|
color: var(--puck-color-azure-04);
|
|
364
369
|
font-weight: 500;
|
|
365
370
|
}
|
|
366
|
-
._Input--
|
|
371
|
+
._Input--readOnly_bsxfo_82 ._Input-radioInput_bsxfo_155:checked ~ ._Input-radioInner_bsxfo_110 {
|
|
367
372
|
background-color: var(--puck-color-grey-11);
|
|
368
373
|
color: var(--puck-color-grey-04);
|
|
369
374
|
}
|
|
370
|
-
._Input-
|
|
375
|
+
._Input-radio_bsxfo_93 ._Input-radioInput_bsxfo_155 {
|
|
371
376
|
clip: rect(0 0 0 0);
|
|
372
377
|
clip-path: inset(100%);
|
|
373
378
|
height: 1px;
|
|
@@ -376,7 +381,7 @@ select._Input-input_py9hf_26:dir(rtl) {
|
|
|
376
381
|
white-space: nowrap;
|
|
377
382
|
width: 1px;
|
|
378
383
|
}
|
|
379
|
-
textarea._Input-
|
|
384
|
+
textarea._Input-input_bsxfo_26 {
|
|
380
385
|
margin-bottom: -4px;
|
|
381
386
|
}
|
|
382
387
|
|
|
@@ -1311,6 +1316,33 @@ body:has(._DropZone--isAnimating_1i2sv_68:empty) [data-puck-overlay] {
|
|
|
1311
1316
|
opacity: 0 !important;
|
|
1312
1317
|
}
|
|
1313
1318
|
|
|
1319
|
+
/* lib/overlay-portal/styles.css */
|
|
1320
|
+
[data-puck-overlay-portal],
|
|
1321
|
+
[data-puck-overlay-portal] * {
|
|
1322
|
+
pointer-events: auto !important;
|
|
1323
|
+
}
|
|
1324
|
+
[data-puck-overlay-portal]:hover {
|
|
1325
|
+
outline: 2px var(--puck-color-azure-09) dashed;
|
|
1326
|
+
outline-offset: 2px;
|
|
1327
|
+
}
|
|
1328
|
+
[data-puck-overlay-portal]:focus-within {
|
|
1329
|
+
outline: 2px var(--puck-color-azure-07) solid;
|
|
1330
|
+
outline-offset: 2px;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css/#css-module-data */
|
|
1334
|
+
._InlineTextField_ilw2a_1 {
|
|
1335
|
+
cursor: text;
|
|
1336
|
+
display: inline-block;
|
|
1337
|
+
}
|
|
1338
|
+
[data-dnd-dragging] ._InlineTextField_ilw2a_1 {
|
|
1339
|
+
cursor: none;
|
|
1340
|
+
caret-color: transparent;
|
|
1341
|
+
}
|
|
1342
|
+
[data-dnd-dragging] ._InlineTextField_ilw2a_1::selection {
|
|
1343
|
+
display: none;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1314
1346
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css/#css-module-data */
|
|
1315
1347
|
._SidebarSection_8boj8_1 {
|
|
1316
1348
|
display: flex;
|
|
@@ -1883,23 +1915,25 @@ body:has(._DropZone--isAnimating_1i2sv_68:empty) [data-puck-overlay] {
|
|
|
1883
1915
|
}
|
|
1884
1916
|
|
|
1885
1917
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/ResizeHandle/styles.module.css/#css-module-data */
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1918
|
+
@media (min-width: 766px) {
|
|
1919
|
+
._ResizeHandle_144bf_2 {
|
|
1920
|
+
position: absolute;
|
|
1921
|
+
width: 5px;
|
|
1922
|
+
height: 100%;
|
|
1923
|
+
cursor: col-resize;
|
|
1924
|
+
z-index: 10;
|
|
1925
|
+
background: transparent;
|
|
1926
|
+
top: 0;
|
|
1927
|
+
}
|
|
1928
|
+
._ResizeHandle_144bf_2:hover {
|
|
1929
|
+
background: rgba(0, 0, 0, 0.1);
|
|
1930
|
+
}
|
|
1931
|
+
._ResizeHandle--left_144bf_16 {
|
|
1932
|
+
right: -3px;
|
|
1933
|
+
}
|
|
1934
|
+
._ResizeHandle--right_144bf_20 {
|
|
1935
|
+
left: -3px;
|
|
1936
|
+
}
|
|
1903
1937
|
}
|
|
1904
1938
|
|
|
1905
1939
|
/* components/Puck/components/ResizeHandle/styles.css */
|
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
|
|
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-B57SgEEc.mjs';
|
|
2
|
+
export { a5 as Adaptor, a3 as ArrayField, B as ArrayState, ai as AsFieldProps, K as BaseData, Z as BaseField, X as ComponentDataMap, Q as ComponentDataOptionalId, Y as Content, a9 as CustomField, a8 as CustomFieldRender, af as DefaultComponentProps, ac as DefaultRootFieldProps, ae as DefaultRootProps, ad as DefaultRootRenderProps, o as Direction, p as DragAxis, a7 as ExternalField, a6 as ExternalFieldWithAdaptor, am as ExtractField, ak as ExtractPropsFromConfig, al as ExtractRootPropsFromConfig, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, z as ItemWithId, T as MappedItem, $ as NumberField, a4 as ObjectField, x as OverrideKey, G as PuckComponent, ab as PuckContext, a2 as RadioField, J as RootConfig, N as RootData, L as RootDataWithoutProps, a1 as SelectField, S as Slot, E as SlotComponent, aa as SlotField, _ as TextField, a0 as TextareaField, q as Viewport, aj as WithChildren, ag as WithId, ah as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-B57SgEEc.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';
|
|
@@ -105,6 +105,7 @@ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserCon
|
|
|
105
105
|
history: HistorySlice;
|
|
106
106
|
nodes: NodesSlice;
|
|
107
107
|
permissions: PermissionsSlice;
|
|
108
|
+
fieldTransforms: FieldTransforms;
|
|
108
109
|
};
|
|
109
110
|
|
|
110
111
|
declare const ActionBar: {
|
|
@@ -207,6 +208,7 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
|
|
|
207
208
|
permissions?: Partial<Permissions>;
|
|
208
209
|
plugins?: Plugin[];
|
|
209
210
|
overrides?: Partial<Overrides>;
|
|
211
|
+
fieldTransforms?: FieldTransforms;
|
|
210
212
|
renderHeader?: (props: {
|
|
211
213
|
children: ReactNode;
|
|
212
214
|
dispatch: (action: PuckAction) => void;
|
|
@@ -249,6 +251,16 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
|
|
|
249
251
|
metadata?: Metadata;
|
|
250
252
|
}): react_jsx_runtime.JSX.Element;
|
|
251
253
|
|
|
254
|
+
declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?: {
|
|
255
|
+
disableDrag?: boolean;
|
|
256
|
+
disableDragOnFocus?: boolean;
|
|
257
|
+
}) => (() => void) | undefined;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Helper function to set a value based on a dot-notated path
|
|
261
|
+
*/
|
|
262
|
+
declare function setDeep<T extends Record<string, any>>(node: T, path: string, newVal: any): T;
|
|
263
|
+
|
|
252
264
|
type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
253
265
|
appState: G["UserPublicAppState"];
|
|
254
266
|
config: UserConfig;
|
|
@@ -290,4 +302,4 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
|
|
|
290
302
|
*/
|
|
291
303
|
declare function useGetPuck(): () => UsePuckStore<Config>;
|
|
292
304
|
|
|
293
|
-
export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, createUsePuck, renderContext, useGetPuck, usePuck };
|
|
305
|
+
export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, createUsePuck, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
|