@measured/puck 0.21.0-canary.eb8ea5ce → 0.21.0-canary.ece26d91

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 (46) hide show
  1. package/dist/{Editor-DR57V55X.mjs → Editor-O447AVCX.mjs} +17 -7
  2. package/dist/{Render-6Q5WP25Y.mjs → Render-OFE6QLI2.mjs} +8 -4
  3. package/dist/{walk-tree-Ja9bNCM9.d.mts → actions-ONhOkrvf.d.mts} +1 -27
  4. package/dist/{walk-tree-Ja9bNCM9.d.ts → actions-ONhOkrvf.d.ts} +1 -27
  5. package/dist/chunk-2Q4PACDA.mjs +111 -0
  6. package/dist/chunk-62AAYNXG.mjs +63 -0
  7. package/dist/chunk-BSDEIOEK.mjs +706 -0
  8. package/dist/chunk-CSSRLPHM.mjs +11 -0
  9. package/dist/{chunk-OPXWLTPM.mjs → chunk-DAQLMM2T.mjs} +1377 -2795
  10. package/dist/chunk-M6W7YEVX.mjs +95 -0
  11. package/dist/{chunk-YZQENDBP.mjs → chunk-NLUHDYVR.mjs} +2 -123
  12. package/dist/chunk-PLXSMBAA.mjs +53 -0
  13. package/dist/chunk-QAWJTCV5.mjs +33 -0
  14. package/dist/chunk-QBGM4ELA.mjs +528 -0
  15. package/dist/{chunk-MSIUWPEI.mjs → chunk-QBJ2LDJB.mjs} +36 -20
  16. package/dist/chunk-T3WX7XJ6.mjs +132 -0
  17. package/dist/{chunk-CF5XA6LF.mjs → chunk-V5I7CVLT.mjs} +1 -1
  18. package/dist/chunk-Y2EFNT5P.mjs +108 -0
  19. package/dist/{chunk-A7EMVTSK.mjs → chunk-Y656T6AQ.mjs} +13 -7
  20. package/dist/full-2GJTAAZE.css +301 -0
  21. package/dist/full-BEMDJKDS.mjs +93 -0
  22. package/dist/index-BEoNHRI1.d.ts +116 -0
  23. package/dist/index-DfxZ7tZF.d.mts +116 -0
  24. package/dist/index.d.mts +9 -125
  25. package/dist/index.d.ts +9 -125
  26. package/dist/index.js +1002 -775
  27. package/dist/index.mjs +14 -5
  28. package/dist/internal.d.mts +27 -0
  29. package/dist/internal.d.ts +27 -0
  30. package/dist/internal.js +908 -0
  31. package/dist/internal.mjs +13 -0
  32. package/dist/loaded-JU3A7Y4L.mjs +57 -0
  33. package/dist/loaded-N3FYGF2Y.mjs +57 -0
  34. package/dist/loaded-OBY7OMS6.mjs +60 -0
  35. package/dist/loaded-RVWBFK7L.css +87 -0
  36. package/dist/no-external.d.mts +3 -1
  37. package/dist/no-external.d.ts +3 -1
  38. package/dist/no-external.js +1002 -775
  39. package/dist/no-external.mjs +14 -5
  40. package/dist/rsc.d.mts +2 -2
  41. package/dist/rsc.d.ts +2 -2
  42. package/dist/rsc.mjs +6 -3
  43. package/dist/walk-tree-CdriEzFJ.d.mts +29 -0
  44. package/dist/walk-tree-DHbAZ4wF.d.ts +29 -0
  45. package/package.json +7 -2
  46. package/dist/chunk-GQ457KMA.mjs +0 -199
@@ -0,0 +1,95 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
+ var __objRest = (source, exclude) => {
25
+ var target = {};
26
+ for (var prop in source)
27
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
28
+ target[prop] = source[prop];
29
+ if (source != null && __getOwnPropSymbols)
30
+ for (var prop of __getOwnPropSymbols(source)) {
31
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
32
+ target[prop] = source[prop];
33
+ }
34
+ return target;
35
+ };
36
+ var __esm = (fn, res) => function __init() {
37
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
38
+ };
39
+ var __commonJS = (cb, mod) => function __require() {
40
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
41
+ };
42
+ var __copyProps = (to, from, except, desc) => {
43
+ if (from && typeof from === "object" || typeof from === "function") {
44
+ for (let key of __getOwnPropNames(from))
45
+ if (!__hasOwnProp.call(to, key) && key !== except)
46
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
47
+ }
48
+ return to;
49
+ };
50
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
51
+ // If the importer is in node compatibility mode or this is not an ESM
52
+ // file that has been converted to a CommonJS file using a Babel-
53
+ // compatible transform (i.e. "__esModule" has not been set), then set
54
+ // "default" to the CommonJS "module.exports" for node compatibility.
55
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
56
+ mod
57
+ ));
58
+ var __async = (__this, __arguments, generator) => {
59
+ return new Promise((resolve, reject) => {
60
+ var fulfilled = (value) => {
61
+ try {
62
+ step(generator.next(value));
63
+ } catch (e) {
64
+ reject(e);
65
+ }
66
+ };
67
+ var rejected = (value) => {
68
+ try {
69
+ step(generator.throw(value));
70
+ } catch (e) {
71
+ reject(e);
72
+ }
73
+ };
74
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
75
+ step((generator = generator.apply(__this, __arguments)).next());
76
+ });
77
+ };
78
+
79
+ // ../tsup-config/react-import.js
80
+ import React from "react";
81
+ var init_react_import = __esm({
82
+ "../tsup-config/react-import.js"() {
83
+ "use strict";
84
+ }
85
+ });
86
+
87
+ export {
88
+ __spreadValues,
89
+ __spreadProps,
90
+ __objRest,
91
+ __commonJS,
92
+ __toESM,
93
+ __async,
94
+ init_react_import
95
+ };
@@ -1,9 +1,8 @@
1
1
  import {
2
- __async,
3
2
  __spreadProps,
4
3
  __spreadValues,
5
4
  init_react_import
6
- } from "./chunk-GQ457KMA.mjs";
5
+ } from "./chunk-M6W7YEVX.mjs";
7
6
 
8
7
  // lib/data/walk-tree.ts
9
8
  init_react_import();
@@ -403,122 +402,6 @@ var setupZone = (data, zoneKey) => {
403
402
  return newData;
404
403
  };
405
404
 
406
- // components/ViewportControls/default-viewports.ts
407
- init_react_import();
408
- var defaultViewports = [
409
- { width: 360, height: "auto", icon: "Smartphone", label: "Small" },
410
- { width: 768, height: "auto", icon: "Tablet", label: "Medium" },
411
- { width: 1280, height: "auto", icon: "Monitor", label: "Large" }
412
- ];
413
-
414
- // lib/resolve-component-data.ts
415
- init_react_import();
416
-
417
- // lib/get-changed.ts
418
- init_react_import();
419
- import { deepEqual } from "fast-equals";
420
- var getChanged = (newItem, oldItem) => {
421
- return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
422
- const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
423
- const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
424
- return __spreadProps(__spreadValues({}, acc), {
425
- [item]: !deepEqual(oldItemProps[item], newItemProps[item])
426
- });
427
- }, {}) : {};
428
- };
429
-
430
- // lib/resolve-component-data.ts
431
- import { deepEqual as deepEqual2 } from "fast-equals";
432
- var cache = { lastChange: {} };
433
- var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
434
- const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
435
- const resolvedItem = __spreadValues({}, item);
436
- const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
437
- const id = "id" in item.props ? item.props.id : "root";
438
- if (shouldRunResolver) {
439
- const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
440
- if (trigger !== "force" && item && deepEqual2(item, oldItem)) {
441
- return { node: resolved, didChange: false };
442
- }
443
- const changed = getChanged(item, oldItem);
444
- if (onResolveStart) {
445
- onResolveStart(item);
446
- }
447
- const { props: resolvedProps, readOnly = {} } = yield configForItem.resolveData(item, {
448
- changed,
449
- lastData: oldItem,
450
- metadata: __spreadValues(__spreadValues({}, metadata), configForItem.metadata),
451
- trigger
452
- });
453
- resolvedItem.props = __spreadValues(__spreadValues({}, item.props), resolvedProps);
454
- if (Object.keys(readOnly).length) {
455
- resolvedItem.readOnly = readOnly;
456
- }
457
- }
458
- let itemWithResolvedChildren = yield mapFields(
459
- resolvedItem,
460
- {
461
- slot: (_02) => __async(null, [_02], function* ({ value }) {
462
- const content = value;
463
- return yield Promise.all(
464
- content.map(
465
- (childItem) => __async(null, null, function* () {
466
- return (yield resolveComponentData(
467
- childItem,
468
- config,
469
- metadata,
470
- onResolveStart,
471
- onResolveEnd,
472
- trigger
473
- )).node;
474
- })
475
- )
476
- );
477
- })
478
- },
479
- config
480
- );
481
- if (shouldRunResolver && onResolveEnd) {
482
- onResolveEnd(resolvedItem);
483
- }
484
- cache.lastChange[id] = {
485
- item,
486
- resolved: itemWithResolvedChildren
487
- };
488
- return {
489
- node: itemWithResolvedChildren,
490
- didChange: !deepEqual2(item, itemWithResolvedChildren)
491
- };
492
- });
493
-
494
- // store/default-app-state.ts
495
- init_react_import();
496
- var defaultAppState = {
497
- data: { content: [], root: {}, zones: {} },
498
- ui: {
499
- leftSideBarVisible: true,
500
- rightSideBarVisible: true,
501
- arrayState: {},
502
- itemSelector: null,
503
- componentList: {},
504
- isDragging: false,
505
- previewMode: "edit",
506
- viewports: {
507
- current: {
508
- width: defaultViewports[0].width,
509
- height: defaultViewports[0].height || "auto"
510
- },
511
- options: [],
512
- controlsVisible: true
513
- },
514
- field: { focus: null }
515
- },
516
- indexes: {
517
- nodes: {},
518
- zones: {}
519
- }
520
- };
521
-
522
405
  export {
523
406
  rootAreaId,
524
407
  rootZone,
@@ -529,9 +412,5 @@ export {
529
412
  expandNode,
530
413
  walkAppState,
531
414
  walkTree,
532
- setupZone,
533
- defaultViewports,
534
- getChanged,
535
- resolveComponentData,
536
- defaultAppState
415
+ setupZone
537
416
  };
@@ -0,0 +1,53 @@
1
+ import {
2
+ AlignCenter,
3
+ AlignJustify,
4
+ AlignLeft,
5
+ AlignRight
6
+ } from "./chunk-DAQLMM2T.mjs";
7
+ import {
8
+ init_react_import
9
+ } from "./chunk-M6W7YEVX.mjs";
10
+
11
+ // components/RichTextMenu/controls/AlignSelect/use-options.ts
12
+ init_react_import();
13
+ import { useMemo } from "react";
14
+ var optionNodes = {
15
+ left: { label: "Left", icon: AlignLeft },
16
+ center: { label: "Center", icon: AlignCenter },
17
+ right: { label: "Right", icon: AlignRight },
18
+ justify: { label: "Justify", icon: AlignJustify }
19
+ };
20
+ var useAlignOptions = (fieldOptions) => {
21
+ var _a;
22
+ let blockOptions = [];
23
+ if ((fieldOptions == null ? void 0 : fieldOptions.textAlign) !== false) {
24
+ if (!((_a = fieldOptions == null ? void 0 : fieldOptions.textAlign) == null ? void 0 : _a.alignments)) {
25
+ blockOptions = ["left", "center", "right", "justify"];
26
+ } else {
27
+ if (fieldOptions == null ? void 0 : fieldOptions.textAlign.alignments.includes("left")) {
28
+ blockOptions.push("left");
29
+ }
30
+ if (fieldOptions == null ? void 0 : fieldOptions.textAlign.alignments.includes("center")) {
31
+ blockOptions.push("center");
32
+ }
33
+ if (fieldOptions == null ? void 0 : fieldOptions.textAlign.alignments.includes("right")) {
34
+ blockOptions.push("right");
35
+ }
36
+ if (fieldOptions == null ? void 0 : fieldOptions.textAlign.alignments.includes("justify")) {
37
+ blockOptions.push("justify");
38
+ }
39
+ }
40
+ }
41
+ return useMemo(
42
+ () => blockOptions.map((item) => ({
43
+ value: item,
44
+ label: optionNodes[item].label,
45
+ icon: optionNodes[item].icon
46
+ })),
47
+ [blockOptions]
48
+ );
49
+ };
50
+
51
+ export {
52
+ useAlignOptions
53
+ };
@@ -0,0 +1,33 @@
1
+ import {
2
+ List,
3
+ ListOrdered
4
+ } from "./chunk-DAQLMM2T.mjs";
5
+ import {
6
+ init_react_import
7
+ } from "./chunk-M6W7YEVX.mjs";
8
+
9
+ // components/RichTextMenu/controls/ListSelect/use-options.ts
10
+ init_react_import();
11
+ import { useMemo } from "react";
12
+ var optionNodes = {
13
+ ul: { label: "Bullet list", icon: List },
14
+ ol: { label: "Numbered list", icon: ListOrdered }
15
+ };
16
+ var useListOptions = (fieldOptions) => {
17
+ let blockOptions = [];
18
+ if ((fieldOptions == null ? void 0 : fieldOptions.listItem) !== false) {
19
+ blockOptions = ["ul", "ol"];
20
+ }
21
+ return useMemo(
22
+ () => blockOptions.map((item) => ({
23
+ value: item,
24
+ label: optionNodes[item].label,
25
+ icon: optionNodes[item].icon
26
+ })),
27
+ [blockOptions]
28
+ );
29
+ };
30
+
31
+ export {
32
+ useListOptions
33
+ };