@measured/puck 0.21.0-canary.38e79ba8 → 0.21.0-canary.3aa27d1d
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-CISJM3HZ.mjs → chunk-GFIVKP2H.mjs} +2151 -840
- package/dist/{chunk-JA7SEUEH.mjs → chunk-SRDLYODX.mjs} +286 -7
- package/dist/index.css +270 -22
- package/dist/index.d.mts +104 -7
- package/dist/index.d.ts +104 -7
- package/dist/index.js +2175 -607
- package/dist/index.mjs +6 -2
- package/dist/no-external.css +270 -22
- package/dist/no-external.d.mts +17 -2
- package/dist/no-external.d.ts +17 -2
- package/dist/no-external.js +2175 -607
- package/dist/no-external.mjs +6 -2
- package/dist/rsc.css +93 -0
- package/dist/rsc.d.mts +17 -2
- package/dist/rsc.d.ts +17 -2
- package/dist/rsc.js +346 -18
- package/dist/rsc.mjs +1 -1
- package/dist/{walk-tree-bsPSSmt9.d.mts → walk-tree-16XYcbNo.d.mts} +203 -4
- package/dist/{walk-tree-bsPSSmt9.d.ts → walk-tree-16XYcbNo.d.ts} +203 -4
- package/package.json +23 -1
package/dist/rsc.js
CHANGED
|
@@ -34,6 +34,12 @@ var __objRest = (source, exclude) => {
|
|
|
34
34
|
}
|
|
35
35
|
return target;
|
|
36
36
|
};
|
|
37
|
+
var __esm = (fn, res) => function __init() {
|
|
38
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
39
|
+
};
|
|
40
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
41
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
42
|
+
};
|
|
37
43
|
var __export = (target, all) => {
|
|
38
44
|
for (var name in all)
|
|
39
45
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -76,6 +82,77 @@ var __async = (__this, __arguments, generator) => {
|
|
|
76
82
|
});
|
|
77
83
|
};
|
|
78
84
|
|
|
85
|
+
// ../tsup-config/react-import.js
|
|
86
|
+
var import_react;
|
|
87
|
+
var init_react_import = __esm({
|
|
88
|
+
"../tsup-config/react-import.js"() {
|
|
89
|
+
"use strict";
|
|
90
|
+
import_react = __toESM(require("react"));
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// ../../node_modules/classnames/index.js
|
|
95
|
+
var require_classnames = __commonJS({
|
|
96
|
+
"../../node_modules/classnames/index.js"(exports2, module2) {
|
|
97
|
+
"use strict";
|
|
98
|
+
init_react_import();
|
|
99
|
+
(function() {
|
|
100
|
+
"use strict";
|
|
101
|
+
var hasOwn = {}.hasOwnProperty;
|
|
102
|
+
function classNames() {
|
|
103
|
+
var classes = "";
|
|
104
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
105
|
+
var arg = arguments[i];
|
|
106
|
+
if (arg) {
|
|
107
|
+
classes = appendClass(classes, parseValue(arg));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return classes;
|
|
111
|
+
}
|
|
112
|
+
function parseValue(arg) {
|
|
113
|
+
if (typeof arg === "string" || typeof arg === "number") {
|
|
114
|
+
return arg;
|
|
115
|
+
}
|
|
116
|
+
if (typeof arg !== "object") {
|
|
117
|
+
return "";
|
|
118
|
+
}
|
|
119
|
+
if (Array.isArray(arg)) {
|
|
120
|
+
return classNames.apply(null, arg);
|
|
121
|
+
}
|
|
122
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
123
|
+
return arg.toString();
|
|
124
|
+
}
|
|
125
|
+
var classes = "";
|
|
126
|
+
for (var key in arg) {
|
|
127
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
128
|
+
classes = appendClass(classes, key);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return classes;
|
|
132
|
+
}
|
|
133
|
+
function appendClass(value, newClass) {
|
|
134
|
+
if (!newClass) {
|
|
135
|
+
return value;
|
|
136
|
+
}
|
|
137
|
+
if (value) {
|
|
138
|
+
return value + " " + newClass;
|
|
139
|
+
}
|
|
140
|
+
return value + newClass;
|
|
141
|
+
}
|
|
142
|
+
if (typeof module2 !== "undefined" && module2.exports) {
|
|
143
|
+
classNames.default = classNames;
|
|
144
|
+
module2.exports = classNames;
|
|
145
|
+
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
146
|
+
define("classnames", [], function() {
|
|
147
|
+
return classNames;
|
|
148
|
+
});
|
|
149
|
+
} else {
|
|
150
|
+
window.classNames = classNames;
|
|
151
|
+
}
|
|
152
|
+
})();
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
79
156
|
// bundle/rsc.tsx
|
|
80
157
|
var rsc_exports = {};
|
|
81
158
|
__export(rsc_exports, {
|
|
@@ -86,16 +163,19 @@ __export(rsc_exports, {
|
|
|
86
163
|
walkTree: () => walkTree
|
|
87
164
|
});
|
|
88
165
|
module.exports = __toCommonJS(rsc_exports);
|
|
166
|
+
init_react_import();
|
|
89
167
|
|
|
90
|
-
//
|
|
91
|
-
|
|
168
|
+
// components/ServerRender/index.tsx
|
|
169
|
+
init_react_import();
|
|
92
170
|
|
|
93
171
|
// lib/root-droppable-id.ts
|
|
172
|
+
init_react_import();
|
|
94
173
|
var rootAreaId = "root";
|
|
95
174
|
var rootZone = "default-zone";
|
|
96
175
|
var rootDroppableId = `${rootAreaId}:${rootZone}`;
|
|
97
176
|
|
|
98
177
|
// lib/data/setup-zone.ts
|
|
178
|
+
init_react_import();
|
|
99
179
|
var setupZone = (data, zoneKey) => {
|
|
100
180
|
if (zoneKey === rootDroppableId) {
|
|
101
181
|
return data;
|
|
@@ -107,10 +187,18 @@ var setupZone = (data, zoneKey) => {
|
|
|
107
187
|
return newData;
|
|
108
188
|
};
|
|
109
189
|
|
|
190
|
+
// lib/use-slots.tsx
|
|
191
|
+
init_react_import();
|
|
192
|
+
|
|
110
193
|
// lib/field-transforms/use-field-transforms.tsx
|
|
194
|
+
init_react_import();
|
|
111
195
|
var import_react2 = require("react");
|
|
112
196
|
|
|
197
|
+
// lib/data/map-fields.ts
|
|
198
|
+
init_react_import();
|
|
199
|
+
|
|
113
200
|
// lib/data/default-slots.ts
|
|
201
|
+
init_react_import();
|
|
114
202
|
var defaultSlots = (value, fields) => Object.keys(fields).reduce(
|
|
115
203
|
(acc, fieldName) => fields[fieldName].type === "slot" ? __spreadValues({ [fieldName]: [] }, acc) : acc,
|
|
116
204
|
value
|
|
@@ -300,6 +388,7 @@ function useFieldTransforms(config, item, transforms, readOnly, forceReadOnly) {
|
|
|
300
388
|
}
|
|
301
389
|
|
|
302
390
|
// lib/field-transforms/default-transforms/slot-transform.tsx
|
|
391
|
+
init_react_import();
|
|
303
392
|
var getSlotTransform = (renderSlotEdit, renderSlotRender = renderSlotEdit) => ({
|
|
304
393
|
slot: ({ value: content, propName, field, isReadOnly }) => {
|
|
305
394
|
const render = isReadOnly ? renderSlotRender : renderSlotEdit;
|
|
@@ -326,33 +415,234 @@ function useSlots(config, item, renderSlotEdit, renderSlotRender = renderSlotEdi
|
|
|
326
415
|
}
|
|
327
416
|
|
|
328
417
|
// components/SlotRender/server.tsx
|
|
418
|
+
init_react_import();
|
|
419
|
+
var import_react5 = require("react");
|
|
420
|
+
|
|
421
|
+
// components/RichTextEditor/lib/use-richtext-renderer.tsx
|
|
422
|
+
init_react_import();
|
|
423
|
+
var import_react4 = require("react");
|
|
424
|
+
|
|
425
|
+
// components/RichTextEditor/Render.tsx
|
|
426
|
+
init_react_import();
|
|
427
|
+
var import_html = require("@tiptap/html");
|
|
329
428
|
var import_react3 = require("react");
|
|
429
|
+
|
|
430
|
+
// lib/get-class-name-factory.ts
|
|
431
|
+
init_react_import();
|
|
432
|
+
var import_classnames = __toESM(require_classnames());
|
|
433
|
+
var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (options = {}) => {
|
|
434
|
+
if (typeof options === "string") {
|
|
435
|
+
const descendant = options;
|
|
436
|
+
const style = styles[`${rootClass}-${descendant}`];
|
|
437
|
+
if (style) {
|
|
438
|
+
return config.baseClass + styles[`${rootClass}-${descendant}`] || "";
|
|
439
|
+
}
|
|
440
|
+
return "";
|
|
441
|
+
} else if (typeof options === "object") {
|
|
442
|
+
const modifiers = options;
|
|
443
|
+
const prefixedModifiers = {};
|
|
444
|
+
for (let modifier in modifiers) {
|
|
445
|
+
prefixedModifiers[styles[`${rootClass}--${modifier}`]] = modifiers[modifier];
|
|
446
|
+
}
|
|
447
|
+
const c = styles[rootClass];
|
|
448
|
+
return config.baseClass + (0, import_classnames.default)(__spreadValues({
|
|
449
|
+
[c]: !!c
|
|
450
|
+
}, prefixedModifiers));
|
|
451
|
+
} else {
|
|
452
|
+
return config.baseClass + styles[rootClass] || "";
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
var get_class_name_factory_default = getClassNameFactory;
|
|
456
|
+
|
|
457
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/RichTextEditor/styles.module.css#css-module
|
|
458
|
+
init_react_import();
|
|
459
|
+
var styles_module_default = { "RichTextEditor": "_RichTextEditor_1819a_1", "RichTextEditor--editor": "_RichTextEditor--editor_1819a_46", "RichTextEditor--disabled": "_RichTextEditor--disabled_1819a_95", "RichTextEditor--isActive": "_RichTextEditor--isActive_1819a_99", "RichTextEditor-menu": "_RichTextEditor-menu_1819a_105" };
|
|
460
|
+
|
|
461
|
+
// components/RichTextEditor/extensions.ts
|
|
462
|
+
init_react_import();
|
|
463
|
+
var import_core = require("@tiptap/core");
|
|
464
|
+
var import_extension_blockquote = require("@tiptap/extension-blockquote");
|
|
465
|
+
var import_extension_bold = require("@tiptap/extension-bold");
|
|
466
|
+
var import_extension_code = require("@tiptap/extension-code");
|
|
467
|
+
var import_extension_code_block = require("@tiptap/extension-code-block");
|
|
468
|
+
var import_extension_document = require("@tiptap/extension-document");
|
|
469
|
+
var import_extension_hard_break = require("@tiptap/extension-hard-break");
|
|
470
|
+
var import_extension_heading = require("@tiptap/extension-heading");
|
|
471
|
+
var import_extension_horizontal_rule = require("@tiptap/extension-horizontal-rule");
|
|
472
|
+
var import_extension_italic = require("@tiptap/extension-italic");
|
|
473
|
+
var import_extension_link = require("@tiptap/extension-link");
|
|
474
|
+
var import_extension_list = require("@tiptap/extension-list");
|
|
475
|
+
var import_extension_paragraph = require("@tiptap/extension-paragraph");
|
|
476
|
+
var import_extension_strike = require("@tiptap/extension-strike");
|
|
477
|
+
var import_extension_text = require("@tiptap/extension-text");
|
|
478
|
+
var import_extension_text_align = __toESM(require("@tiptap/extension-text-align"));
|
|
479
|
+
var import_extension_underline = require("@tiptap/extension-underline");
|
|
480
|
+
var defaultPuckRichTextOptions = {
|
|
481
|
+
textAlign: {
|
|
482
|
+
types: ["heading", "paragraph"]
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
var PuckRichText = import_core.Extension.create({
|
|
486
|
+
name: "puckRichText",
|
|
487
|
+
addExtensions() {
|
|
488
|
+
const extensions = [];
|
|
489
|
+
const options = __spreadValues(__spreadValues({}, this.options), defaultPuckRichTextOptions);
|
|
490
|
+
if (options.bold !== false) {
|
|
491
|
+
extensions.push(import_extension_bold.Bold.configure(options.bold));
|
|
492
|
+
}
|
|
493
|
+
if (options.blockquote !== false) {
|
|
494
|
+
extensions.push(import_extension_blockquote.Blockquote.configure(options.blockquote));
|
|
495
|
+
}
|
|
496
|
+
if (options.bulletList !== false) {
|
|
497
|
+
extensions.push(import_extension_list.BulletList.configure(options.bulletList));
|
|
498
|
+
}
|
|
499
|
+
if (options.code !== false) {
|
|
500
|
+
extensions.push(import_extension_code.Code.configure(options.code));
|
|
501
|
+
}
|
|
502
|
+
if (options.codeBlock !== false) {
|
|
503
|
+
extensions.push(import_extension_code_block.CodeBlock.configure(options.codeBlock));
|
|
504
|
+
}
|
|
505
|
+
if (options.document !== false) {
|
|
506
|
+
extensions.push(import_extension_document.Document.configure(options.document));
|
|
507
|
+
}
|
|
508
|
+
if (options.hardBreak !== false) {
|
|
509
|
+
extensions.push(import_extension_hard_break.HardBreak.configure(options.hardBreak));
|
|
510
|
+
}
|
|
511
|
+
if (options.heading !== false) {
|
|
512
|
+
extensions.push(import_extension_heading.Heading.configure(options.heading));
|
|
513
|
+
}
|
|
514
|
+
if (options.horizontalRule !== false) {
|
|
515
|
+
extensions.push(import_extension_horizontal_rule.HorizontalRule.configure(options.horizontalRule));
|
|
516
|
+
}
|
|
517
|
+
if (options.italic !== false) {
|
|
518
|
+
extensions.push(import_extension_italic.Italic.configure(options.italic));
|
|
519
|
+
}
|
|
520
|
+
if (options.listItem !== false) {
|
|
521
|
+
extensions.push(import_extension_list.ListItem.configure(options.listItem));
|
|
522
|
+
}
|
|
523
|
+
if (options.listKeymap !== false) {
|
|
524
|
+
extensions.push(import_extension_list.ListKeymap.configure(options == null ? void 0 : options.listKeymap));
|
|
525
|
+
}
|
|
526
|
+
if (options.link !== false) {
|
|
527
|
+
extensions.push(import_extension_link.Link.configure(options == null ? void 0 : options.link));
|
|
528
|
+
}
|
|
529
|
+
if (options.orderedList !== false) {
|
|
530
|
+
extensions.push(import_extension_list.OrderedList.configure(options.orderedList));
|
|
531
|
+
}
|
|
532
|
+
if (options.paragraph !== false) {
|
|
533
|
+
extensions.push(import_extension_paragraph.Paragraph.configure(options.paragraph));
|
|
534
|
+
}
|
|
535
|
+
if (options.strike !== false) {
|
|
536
|
+
extensions.push(import_extension_strike.Strike.configure(options.strike));
|
|
537
|
+
}
|
|
538
|
+
if (options.text !== false) {
|
|
539
|
+
extensions.push(import_extension_text.Text.configure(options.text));
|
|
540
|
+
}
|
|
541
|
+
if (options.textAlign !== false) {
|
|
542
|
+
extensions.push(import_extension_text_align.default.configure(options.textAlign));
|
|
543
|
+
}
|
|
544
|
+
if (options.underline !== false) {
|
|
545
|
+
extensions.push(import_extension_underline.Underline.configure(options == null ? void 0 : options.underline));
|
|
546
|
+
}
|
|
547
|
+
return extensions;
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
|
|
551
|
+
// components/RichTextEditor/Render.tsx
|
|
330
552
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
331
|
-
var
|
|
553
|
+
var getClassName = get_class_name_factory_default("RichTextEditor", styles_module_default);
|
|
554
|
+
function RichTextRender({
|
|
555
|
+
content,
|
|
556
|
+
field
|
|
557
|
+
}) {
|
|
558
|
+
const { tiptap = {}, options } = field;
|
|
559
|
+
const { extensions = [] } = tiptap;
|
|
560
|
+
const loadedExtensions = (0, import_react3.useMemo)(
|
|
561
|
+
() => [PuckRichText.configure(options), ...extensions],
|
|
562
|
+
[field, extensions]
|
|
563
|
+
);
|
|
564
|
+
const normalized = (0, import_react3.useMemo)(() => {
|
|
565
|
+
if (typeof content === "object" && (content == null ? void 0 : content.type) === "doc") {
|
|
566
|
+
return content;
|
|
567
|
+
}
|
|
568
|
+
if (typeof content === "string") {
|
|
569
|
+
const isHtml = /<\/?[a-z][\s\S]*>/i.test(content);
|
|
570
|
+
if (isHtml) {
|
|
571
|
+
return (0, import_html.generateJSON)(content, loadedExtensions);
|
|
572
|
+
}
|
|
573
|
+
return {
|
|
574
|
+
type: "doc",
|
|
575
|
+
content: [
|
|
576
|
+
{ type: "paragraph", content: [{ type: "text", text: content }] }
|
|
577
|
+
]
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
return { type: "doc", content: [] };
|
|
581
|
+
}, [content, loadedExtensions]);
|
|
582
|
+
const html = (0, import_react3.useMemo)(() => {
|
|
583
|
+
return (0, import_html.generateHTML)(normalized, loadedExtensions);
|
|
584
|
+
}, [normalized, loadedExtensions]);
|
|
585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: getClassName(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "rich-text", dangerouslySetInnerHTML: { __html: html } }) });
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
// components/RichTextEditor/lib/use-richtext-renderer.tsx
|
|
589
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
590
|
+
function useRichtextRenderer(fields, props) {
|
|
591
|
+
const findAllRichtextKeys = (fields2) => {
|
|
592
|
+
if (!fields2) return [];
|
|
593
|
+
const result = [];
|
|
594
|
+
for (const [key, field] of Object.entries(fields2)) {
|
|
595
|
+
if (field.type === "richtext") {
|
|
596
|
+
result.push(key);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
return result;
|
|
600
|
+
};
|
|
601
|
+
const richtextKeys = (0, import_react4.useMemo)(() => findAllRichtextKeys(fields), [fields]);
|
|
602
|
+
const richTextRenderer = (0, import_react4.useMemo)(() => {
|
|
603
|
+
if (!richtextKeys) return {};
|
|
604
|
+
return richtextKeys.reduce((acc, key) => {
|
|
605
|
+
acc[key] = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
606
|
+
RichTextRender,
|
|
607
|
+
{
|
|
608
|
+
content: props[key],
|
|
609
|
+
field: fields[key]
|
|
610
|
+
}
|
|
611
|
+
);
|
|
612
|
+
return acc;
|
|
613
|
+
}, {});
|
|
614
|
+
}, [richtextKeys, props]);
|
|
615
|
+
return richTextRenderer;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
// components/SlotRender/server.tsx
|
|
619
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
620
|
+
var SlotRenderPure = (props) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SlotRender, __spreadValues({}, props));
|
|
332
621
|
var Item = ({
|
|
333
622
|
config,
|
|
334
623
|
item,
|
|
335
624
|
metadata
|
|
336
625
|
}) => {
|
|
337
626
|
const Component = config.components[item.type];
|
|
338
|
-
const props = useSlots(config, item, (slotProps) => /* @__PURE__ */ (0,
|
|
339
|
-
|
|
627
|
+
const props = useSlots(config, item, (slotProps) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SlotRenderPure, __spreadProps(__spreadValues({}, slotProps), { config, metadata })));
|
|
628
|
+
const richTextRenderer = useRichtextRenderer(Component.fields, props);
|
|
629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
340
630
|
Component.render,
|
|
341
|
-
__spreadProps(__spreadValues({}, props), {
|
|
631
|
+
__spreadProps(__spreadValues(__spreadValues({}, props), richTextRenderer), {
|
|
342
632
|
puck: __spreadProps(__spreadValues({}, props.puck), {
|
|
343
633
|
metadata: metadata || {}
|
|
344
634
|
})
|
|
345
635
|
})
|
|
346
636
|
);
|
|
347
637
|
};
|
|
348
|
-
var SlotRender = (0,
|
|
638
|
+
var SlotRender = (0, import_react5.forwardRef)(
|
|
349
639
|
function SlotRenderInternal({ className, style, content, config, metadata, as }, ref) {
|
|
350
640
|
const El = as != null ? as : "div";
|
|
351
|
-
return /* @__PURE__ */ (0,
|
|
641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(El, { className, style, ref, children: content.map((item) => {
|
|
352
642
|
if (!config.components[item.type]) {
|
|
353
643
|
return null;
|
|
354
644
|
}
|
|
355
|
-
return /* @__PURE__ */ (0,
|
|
645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
356
646
|
Item,
|
|
357
647
|
{
|
|
358
648
|
config,
|
|
@@ -366,7 +656,7 @@ var SlotRender = (0, import_react3.forwardRef)(
|
|
|
366
656
|
);
|
|
367
657
|
|
|
368
658
|
// components/ServerRender/index.tsx
|
|
369
|
-
var
|
|
659
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
370
660
|
function DropZoneRender({
|
|
371
661
|
zone,
|
|
372
662
|
data,
|
|
@@ -383,11 +673,11 @@ function DropZoneRender({
|
|
|
383
673
|
zoneCompound = `${areaId}:${zone}`;
|
|
384
674
|
content = setupZone(data, zoneCompound).zones[zoneCompound];
|
|
385
675
|
}
|
|
386
|
-
return /* @__PURE__ */ (0,
|
|
676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: content.map((item) => {
|
|
387
677
|
const Component = config.components[item.type];
|
|
388
678
|
const props = __spreadProps(__spreadValues({}, item.props), {
|
|
389
679
|
puck: {
|
|
390
|
-
renderDropZone: ({ zone: zone2 }) => /* @__PURE__ */ (0,
|
|
680
|
+
renderDropZone: ({ zone: zone2 }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
391
681
|
DropZoneRender,
|
|
392
682
|
{
|
|
393
683
|
zone: zone2,
|
|
@@ -403,9 +693,9 @@ function DropZoneRender({
|
|
|
403
693
|
}
|
|
404
694
|
});
|
|
405
695
|
const renderItem = __spreadProps(__spreadValues({}, item), { props });
|
|
406
|
-
const propsWithSlots = useSlots(config, renderItem, (props2) => /* @__PURE__ */ (0,
|
|
696
|
+
const propsWithSlots = useSlots(config, renderItem, (props2) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SlotRenderPure, __spreadProps(__spreadValues({}, props2), { config, metadata })));
|
|
407
697
|
if (Component) {
|
|
408
|
-
return /* @__PURE__ */ (0,
|
|
698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Component.render, __spreadValues({}, propsWithSlots), renderItem.props.id);
|
|
409
699
|
}
|
|
410
700
|
return null;
|
|
411
701
|
}) });
|
|
@@ -420,7 +710,7 @@ function Render({
|
|
|
420
710
|
const title = rootProps.title || "";
|
|
421
711
|
const props = __spreadProps(__spreadValues({}, rootProps), {
|
|
422
712
|
puck: {
|
|
423
|
-
renderDropZone: ({ zone }) => /* @__PURE__ */ (0,
|
|
713
|
+
renderDropZone: ({ zone }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
424
714
|
DropZoneRender,
|
|
425
715
|
{
|
|
426
716
|
zone,
|
|
@@ -437,9 +727,9 @@ function Render({
|
|
|
437
727
|
editMode: false,
|
|
438
728
|
id: "puck-root"
|
|
439
729
|
});
|
|
440
|
-
const propsWithSlots = useSlots(config, { type: "root", props }, (props2) => /* @__PURE__ */ (0,
|
|
730
|
+
const propsWithSlots = useSlots(config, { type: "root", props }, (props2) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SlotRenderPure, __spreadProps(__spreadValues({}, props2), { config, metadata })));
|
|
441
731
|
if ((_a = config.root) == null ? void 0 : _a.render) {
|
|
442
|
-
return /* @__PURE__ */ (0,
|
|
732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(config.root.render, __spreadProps(__spreadValues({}, propsWithSlots), { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
443
733
|
DropZoneRender,
|
|
444
734
|
{
|
|
445
735
|
config,
|
|
@@ -449,7 +739,7 @@ function Render({
|
|
|
449
739
|
}
|
|
450
740
|
) }));
|
|
451
741
|
}
|
|
452
|
-
return /* @__PURE__ */ (0,
|
|
742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
453
743
|
DropZoneRender,
|
|
454
744
|
{
|
|
455
745
|
config,
|
|
@@ -460,7 +750,14 @@ function Render({
|
|
|
460
750
|
);
|
|
461
751
|
}
|
|
462
752
|
|
|
753
|
+
// lib/resolve-all-data.ts
|
|
754
|
+
init_react_import();
|
|
755
|
+
|
|
756
|
+
// lib/resolve-component-data.ts
|
|
757
|
+
init_react_import();
|
|
758
|
+
|
|
463
759
|
// lib/get-changed.ts
|
|
760
|
+
init_react_import();
|
|
464
761
|
var import_fast_equals = require("fast-equals");
|
|
465
762
|
var getChanged = (newItem, oldItem) => {
|
|
466
763
|
return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
|
|
@@ -537,12 +834,14 @@ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], fun
|
|
|
537
834
|
});
|
|
538
835
|
|
|
539
836
|
// lib/data/default-data.ts
|
|
837
|
+
init_react_import();
|
|
540
838
|
var defaultData = (data) => __spreadProps(__spreadValues({}, data), {
|
|
541
839
|
root: data.root || {},
|
|
542
840
|
content: data.content || []
|
|
543
841
|
});
|
|
544
842
|
|
|
545
843
|
// lib/data/to-component.ts
|
|
844
|
+
init_react_import();
|
|
546
845
|
var toComponent = (item) => {
|
|
547
846
|
return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
|
|
548
847
|
props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
|
|
@@ -600,7 +899,11 @@ function resolveAllData(_0, _1) {
|
|
|
600
899
|
});
|
|
601
900
|
}
|
|
602
901
|
|
|
902
|
+
// lib/transform-props.ts
|
|
903
|
+
init_react_import();
|
|
904
|
+
|
|
603
905
|
// lib/data/walk-tree.ts
|
|
906
|
+
init_react_import();
|
|
604
907
|
function walkTree(data, config, callbackFn) {
|
|
605
908
|
var _a, _b;
|
|
606
909
|
const walkItem = (item) => {
|
|
@@ -668,7 +971,14 @@ function transformProps(data, propTransforms, config = { components: {} }) {
|
|
|
668
971
|
return updatedData;
|
|
669
972
|
}
|
|
670
973
|
|
|
974
|
+
// lib/migrate.ts
|
|
975
|
+
init_react_import();
|
|
976
|
+
|
|
977
|
+
// store/default-app-state.ts
|
|
978
|
+
init_react_import();
|
|
979
|
+
|
|
671
980
|
// components/ViewportControls/default-viewports.ts
|
|
981
|
+
init_react_import();
|
|
672
982
|
var defaultViewports = [
|
|
673
983
|
{ width: 360, height: "auto", icon: "Smartphone", label: "Small" },
|
|
674
984
|
{ width: 768, height: "auto", icon: "Tablet", label: "Medium" },
|
|
@@ -702,7 +1012,14 @@ var defaultAppState = {
|
|
|
702
1012
|
}
|
|
703
1013
|
};
|
|
704
1014
|
|
|
1015
|
+
// lib/data/walk-app-state.ts
|
|
1016
|
+
init_react_import();
|
|
1017
|
+
|
|
1018
|
+
// lib/data/for-related-zones.ts
|
|
1019
|
+
init_react_import();
|
|
1020
|
+
|
|
705
1021
|
// lib/get-zone-id.ts
|
|
1022
|
+
init_react_import();
|
|
706
1023
|
var getZoneId = (zoneCompound) => {
|
|
707
1024
|
if (!zoneCompound) {
|
|
708
1025
|
return [];
|
|
@@ -724,9 +1041,11 @@ function forRelatedZones(item, data, cb, path = []) {
|
|
|
724
1041
|
}
|
|
725
1042
|
|
|
726
1043
|
// lib/data/flatten-node.ts
|
|
1044
|
+
init_react_import();
|
|
727
1045
|
var import_flat = __toESM(require("flat"));
|
|
728
1046
|
|
|
729
1047
|
// lib/data/strip-slots.ts
|
|
1048
|
+
init_react_import();
|
|
730
1049
|
var stripSlots = (data, config) => {
|
|
731
1050
|
return mapFields(data, { slot: () => null }, config);
|
|
732
1051
|
};
|
|
@@ -994,3 +1313,12 @@ function migrate(data, config, migrationOptions) {
|
|
|
994
1313
|
transformProps,
|
|
995
1314
|
walkTree
|
|
996
1315
|
});
|
|
1316
|
+
/*! Bundled license information:
|
|
1317
|
+
|
|
1318
|
+
classnames/index.js:
|
|
1319
|
+
(*!
|
|
1320
|
+
Copyright (c) 2018 Jed Watson.
|
|
1321
|
+
Licensed under the MIT License (MIT), see
|
|
1322
|
+
http://jedwatson.github.io/classnames
|
|
1323
|
+
*)
|
|
1324
|
+
*/
|