@measured/puck 0.21.0-canary.a62292fd → 0.21.0-canary.a7a65997

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.
Files changed (41) hide show
  1. package/dist/{Editor-O447AVCX.mjs → Editor-HG76DBFU.mjs} +9 -9
  2. package/dist/{actions-ONhOkrvf.d.mts → actions-tsxxcX1z.d.mts} +24 -9
  3. package/dist/{actions-ONhOkrvf.d.ts → actions-tsxxcX1z.d.ts} +24 -9
  4. package/dist/{chunk-QBGM4ELA.mjs → chunk-23IZFPL7.mjs} +1 -1
  5. package/dist/{chunk-T3WX7XJ6.mjs → chunk-45I5SDOI.mjs} +5 -3
  6. package/dist/{chunk-62AAYNXG.mjs → chunk-5ZZVX2Z3.mjs} +1 -1
  7. package/dist/{chunk-NLUHDYVR.mjs → chunk-B7REOAA7.mjs} +22 -3
  8. package/dist/{chunk-BSDEIOEK.mjs → chunk-BXQQARCR.mjs} +10 -8
  9. package/dist/{chunk-DAQLMM2T.mjs → chunk-D2SRL6YA.mjs} +89 -4
  10. package/dist/{chunk-Y656T6AQ.mjs → chunk-IQKX6A5D.mjs} +49 -39
  11. package/dist/{chunk-PLXSMBAA.mjs → chunk-LJEGWHDD.mjs} +1 -1
  12. package/dist/{chunk-2Q4PACDA.mjs → chunk-LR6HIXPR.mjs} +3 -3
  13. package/dist/{chunk-7GESFTRA.mjs → chunk-Q6MNES6D.mjs} +4315 -3693
  14. package/dist/{chunk-QAWJTCV5.mjs → chunk-U4VSQKO3.mjs} +1 -1
  15. package/dist/{full-BEMDJKDS.mjs → full-L7DWVNTZ.mjs} +8 -8
  16. package/dist/{index-BEoNHRI1.d.ts → index-Ca6V6NQD.d.ts} +3 -1
  17. package/dist/{index-DfxZ7tZF.d.mts → index-mQvUCH3C.d.mts} +3 -1
  18. package/dist/index.css +704 -314
  19. package/dist/index.d.mts +28 -9
  20. package/dist/index.d.ts +28 -9
  21. package/dist/index.js +2975 -2181
  22. package/dist/index.mjs +20 -17
  23. package/dist/internal.d.mts +2 -2
  24. package/dist/internal.d.ts +2 -2
  25. package/dist/internal.js +22 -3
  26. package/dist/internal.mjs +2 -2
  27. package/dist/{loaded-N3FYGF2Y.mjs → loaded-2HLHDP2G.mjs} +5 -5
  28. package/dist/{loaded-OBY7OMS6.mjs → loaded-LZUXYAGW.mjs} +5 -5
  29. package/dist/{loaded-JU3A7Y4L.mjs → loaded-UHVTB6OD.mjs} +5 -5
  30. package/dist/no-external.css +842 -448
  31. package/dist/no-external.d.mts +4 -4
  32. package/dist/no-external.d.ts +4 -4
  33. package/dist/no-external.js +2972 -2175
  34. package/dist/no-external.mjs +19 -11
  35. package/dist/rsc.d.mts +2 -2
  36. package/dist/rsc.d.ts +2 -2
  37. package/dist/rsc.js +55 -28
  38. package/dist/rsc.mjs +3 -3
  39. package/dist/{walk-tree-DHbAZ4wF.d.ts → walk-tree-Bh85NMeo.d.ts} +1 -1
  40. package/dist/{walk-tree-CdriEzFJ.d.mts → walk-tree-CDA3K5S3.d.mts} +1 -1
  41. package/package.json +1 -1
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  defaultAppState,
6
6
  resolveComponentData
7
- } from "./chunk-T3WX7XJ6.mjs";
7
+ } from "./chunk-45I5SDOI.mjs";
8
8
  import {
9
9
  get_class_name_factory_default
10
10
  } from "./chunk-Y2EFNT5P.mjs";
@@ -12,7 +12,7 @@ import {
12
12
  mapFields,
13
13
  walkAppState,
14
14
  walkTree
15
- } from "./chunk-NLUHDYVR.mjs";
15
+ } from "./chunk-B7REOAA7.mjs";
16
16
  import {
17
17
  __async,
18
18
  __objRest,
@@ -245,42 +245,6 @@ function resolveAllData(_0, _1) {
245
245
  });
246
246
  }
247
247
 
248
- // lib/field-transforms/use-field-transforms.tsx
249
- init_react_import();
250
- import { useMemo } from "react";
251
- function useFieldTransforms(config, item, transforms, readOnly, forceReadOnly) {
252
- const mappers = useMemo(() => {
253
- return Object.keys(transforms).reduce((acc, _fieldType) => {
254
- const fieldType = _fieldType;
255
- return __spreadProps(__spreadValues({}, acc), {
256
- [fieldType]: (_a) => {
257
- var _b = _a, {
258
- parentId
259
- } = _b, params = __objRest(_b, [
260
- "parentId"
261
- ]);
262
- const wildcardPath = params.propPath.replace(/\[\d+\]/g, "[*]");
263
- const isReadOnly = (readOnly == null ? void 0 : readOnly[params.propPath]) || (readOnly == null ? void 0 : readOnly[wildcardPath]) || forceReadOnly || false;
264
- const fn = transforms[fieldType];
265
- return fn == null ? void 0 : fn(__spreadProps(__spreadValues({}, params), {
266
- isReadOnly,
267
- componentId: parentId
268
- }));
269
- }
270
- });
271
- }, {});
272
- }, [transforms, readOnly, forceReadOnly]);
273
- const transformedProps = useMemo(() => {
274
- const mapped = mapFields(item, mappers, config).props;
275
- return mapped;
276
- }, [config, item, mappers]);
277
- const mergedProps = useMemo(
278
- () => __spreadValues(__spreadValues({}, item.props), transformedProps),
279
- [item.props, transformedProps]
280
- );
281
- return mergedProps;
282
- }
283
-
284
248
  // lib/field-transforms/default-transforms/slot-transform.tsx
285
249
  init_react_import();
286
250
  var getSlotTransform = (renderSlotEdit, renderSlotRender = renderSlotEdit) => ({
@@ -299,6 +263,52 @@ var getSlotTransform = (renderSlotEdit, renderSlotRender = renderSlotEdit) => ({
299
263
 
300
264
  // lib/use-slots.tsx
301
265
  init_react_import();
266
+
267
+ // lib/field-transforms/use-field-transforms.tsx
268
+ init_react_import();
269
+ import { useMemo } from "react";
270
+
271
+ // lib/field-transforms/build-mappers.ts
272
+ init_react_import();
273
+ function buildMappers(transforms, readOnly, forceReadOnly) {
274
+ return Object.keys(transforms).reduce((acc, _fieldType) => {
275
+ const fieldType = _fieldType;
276
+ return __spreadProps(__spreadValues({}, acc), {
277
+ [fieldType]: (_a) => {
278
+ var _b = _a, {
279
+ parentId
280
+ } = _b, params = __objRest(_b, [
281
+ "parentId"
282
+ ]);
283
+ const wildcardPath = params.propPath.replace(/\[\d+\]/g, "[*]");
284
+ const isReadOnly = (readOnly == null ? void 0 : readOnly[params.propPath]) || (readOnly == null ? void 0 : readOnly[wildcardPath]) || forceReadOnly || false;
285
+ const fn = transforms[fieldType];
286
+ return fn == null ? void 0 : fn(__spreadProps(__spreadValues({}, params), {
287
+ isReadOnly,
288
+ componentId: parentId
289
+ }));
290
+ }
291
+ });
292
+ }, {});
293
+ }
294
+
295
+ // lib/field-transforms/use-field-transforms.tsx
296
+ function useFieldTransforms(config, item, transforms, readOnly, forceReadOnly) {
297
+ const mappers = useMemo(
298
+ () => buildMappers(transforms, readOnly, forceReadOnly),
299
+ [transforms, readOnly, forceReadOnly]
300
+ );
301
+ const transformedProps = useMemo(() => {
302
+ return mapFields(item, mappers, config).props;
303
+ }, [config, item, mappers]);
304
+ const mergedProps = useMemo(
305
+ () => __spreadValues(__spreadValues({}, item.props), transformedProps),
306
+ [item.props, transformedProps]
307
+ );
308
+ return mergedProps;
309
+ }
310
+
311
+ // lib/use-slots.tsx
302
312
  function useSlots(config, item, renderSlotEdit, renderSlotRender = renderSlotEdit, readOnly, forceReadOnly) {
303
313
  return useFieldTransforms(
304
314
  config,
@@ -405,7 +415,7 @@ var SlotRender = forwardRef(
405
415
  );
406
416
 
407
417
  export {
408
- useFieldTransforms,
418
+ buildMappers,
409
419
  getSlotTransform,
410
420
  useSlots,
411
421
  RichTextRenderFallback,
@@ -3,7 +3,7 @@ import {
3
3
  AlignJustify,
4
4
  AlignLeft,
5
5
  AlignRight
6
- } from "./chunk-DAQLMM2T.mjs";
6
+ } from "./chunk-D2SRL6YA.mjs";
7
7
  import {
8
8
  init_react_import
9
9
  } from "./chunk-M6W7YEVX.mjs";
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-CSSRLPHM.mjs";
4
4
  import {
5
5
  LoadedRichTextMenuInner
6
- } from "./chunk-BSDEIOEK.mjs";
6
+ } from "./chunk-BXQQARCR.mjs";
7
7
  import {
8
8
  useAppStore,
9
9
  useAppStoreApi
10
- } from "./chunk-DAQLMM2T.mjs";
10
+ } from "./chunk-D2SRL6YA.mjs";
11
11
  import {
12
12
  get_class_name_factory_default
13
13
  } from "./chunk-Y2EFNT5P.mjs";
@@ -97,7 +97,7 @@ init_react_import();
97
97
  import { lazy, Suspense } from "react";
98
98
  import { jsx as jsx2 } from "react/jsx-runtime";
99
99
  var LoadedRichTextMenuFull = lazy(
100
- () => import("./full-BEMDJKDS.mjs").then((m) => ({
100
+ () => import("./full-L7DWVNTZ.mjs").then((m) => ({
101
101
  default: m.LoadedRichTextMenuFull
102
102
  }))
103
103
  );