@measured/puck 0.21.0-canary.eb8ea5ce → 0.21.0-canary.ed10e2a4
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-YZQENDBP.mjs → chunk-JA7SEUEH.mjs} +499 -70
- package/dist/{chunk-MSIUWPEI.mjs → chunk-UABEUL66.mjs} +2681 -913
- package/dist/index.css +22 -278
- package/dist/index.d.mts +7 -104
- package/dist/index.d.ts +7 -104
- package/dist/index.js +2494 -5508
- package/dist/index.mjs +9 -19
- package/dist/no-external.css +22 -278
- package/dist/no-external.d.mts +2 -17
- package/dist/no-external.d.ts +2 -17
- package/dist/no-external.js +2494 -5508
- package/dist/no-external.mjs +9 -19
- package/dist/rsc.d.mts +2 -17
- package/dist/rsc.d.ts +2 -17
- package/dist/rsc.js +21 -407
- package/dist/rsc.mjs +9 -15
- package/dist/{walk-tree-Ja9bNCM9.d.mts → walk-tree-CgWnYC1X.d.mts} +3 -202
- package/dist/{walk-tree-Ja9bNCM9.d.ts → walk-tree-CgWnYC1X.d.ts} +3 -202
- package/package.json +1 -23
- package/dist/Editor-DR57V55X.mjs +0 -194
- package/dist/Editor-F2LSS6SE.css +0 -403
- package/dist/Render-6Q5WP25Y.mjs +0 -51
- package/dist/Render-QEMDIDQC.css +0 -101
- package/dist/chunk-A7EMVTSK.mjs +0 -413
- package/dist/chunk-CF5XA6LF.mjs +0 -103
- package/dist/chunk-GQ457KMA.mjs +0 -199
- package/dist/chunk-OPXWLTPM.mjs +0 -3140
- package/dist/rsc.css +0 -101
package/dist/rsc.js
CHANGED
|
@@ -34,12 +34,6 @@ 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
|
-
};
|
|
43
37
|
var __export = (target, all) => {
|
|
44
38
|
for (var name in all)
|
|
45
39
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -82,276 +76,6 @@ var __async = (__this, __arguments, generator) => {
|
|
|
82
76
|
});
|
|
83
77
|
};
|
|
84
78
|
|
|
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
|
-
|
|
156
|
-
// lib/get-class-name-factory.ts
|
|
157
|
-
var import_classnames, getClassNameFactory, get_class_name_factory_default;
|
|
158
|
-
var init_get_class_name_factory = __esm({
|
|
159
|
-
"lib/get-class-name-factory.ts"() {
|
|
160
|
-
"use strict";
|
|
161
|
-
init_react_import();
|
|
162
|
-
import_classnames = __toESM(require_classnames());
|
|
163
|
-
getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (options = {}) => {
|
|
164
|
-
if (typeof options === "string") {
|
|
165
|
-
const descendant = options;
|
|
166
|
-
const style = styles[`${rootClass}-${descendant}`];
|
|
167
|
-
if (style) {
|
|
168
|
-
return config.baseClass + styles[`${rootClass}-${descendant}`] || "";
|
|
169
|
-
}
|
|
170
|
-
return "";
|
|
171
|
-
} else if (typeof options === "object") {
|
|
172
|
-
const modifiers = options;
|
|
173
|
-
const prefixedModifiers = {};
|
|
174
|
-
for (let modifier in modifiers) {
|
|
175
|
-
prefixedModifiers[styles[`${rootClass}--${modifier}`]] = modifiers[modifier];
|
|
176
|
-
}
|
|
177
|
-
const c = styles[rootClass];
|
|
178
|
-
return config.baseClass + (0, import_classnames.default)(__spreadValues({
|
|
179
|
-
[c]: !!c
|
|
180
|
-
}, prefixedModifiers));
|
|
181
|
-
} else {
|
|
182
|
-
return config.baseClass + styles[rootClass] || "";
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
get_class_name_factory_default = getClassNameFactory;
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
// css-module:/home/runner/work/puck/puck/packages/core/components/RichTextEditor/styles.module.css/#css-module-data
|
|
190
|
-
var init_css_module_data = __esm({
|
|
191
|
-
"css-module:/home/runner/work/puck/puck/packages/core/components/RichTextEditor/styles.module.css/#css-module-data"() {
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
// css-module:/home/runner/work/puck/puck/packages/core/components/RichTextEditor/styles.module.css#css-module
|
|
196
|
-
var styles_module_default;
|
|
197
|
-
var init_styles_module = __esm({
|
|
198
|
-
"css-module:/home/runner/work/puck/puck/packages/core/components/RichTextEditor/styles.module.css#css-module"() {
|
|
199
|
-
"use strict";
|
|
200
|
-
init_react_import();
|
|
201
|
-
init_css_module_data();
|
|
202
|
-
styles_module_default = { "RichTextEditor": "_RichTextEditor_1elol_1", "RichTextEditor--editor": "_RichTextEditor--editor_1elol_50", "RichTextEditor--disabled": "_RichTextEditor--disabled_1elol_106", "RichTextEditor--isActive": "_RichTextEditor--isActive_1elol_110", "RichTextEditor-menu": "_RichTextEditor-menu_1elol_116" };
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
// components/RichTextEditor/extension.ts
|
|
207
|
-
var import_core, import_extension_blockquote, import_extension_bold, import_extension_code, import_extension_code_block, import_extension_document, import_extension_hard_break, import_extension_heading, import_extension_horizontal_rule, import_extension_italic, import_extension_link, import_extension_list, import_extension_paragraph, import_extension_strike, import_extension_text, import_extension_text_align, import_extension_underline, defaultPuckRichTextOptions, PuckRichText;
|
|
208
|
-
var init_extension = __esm({
|
|
209
|
-
"components/RichTextEditor/extension.ts"() {
|
|
210
|
-
"use strict";
|
|
211
|
-
init_react_import();
|
|
212
|
-
import_core = require("@tiptap/core");
|
|
213
|
-
import_extension_blockquote = require("@tiptap/extension-blockquote");
|
|
214
|
-
import_extension_bold = require("@tiptap/extension-bold");
|
|
215
|
-
import_extension_code = require("@tiptap/extension-code");
|
|
216
|
-
import_extension_code_block = require("@tiptap/extension-code-block");
|
|
217
|
-
import_extension_document = require("@tiptap/extension-document");
|
|
218
|
-
import_extension_hard_break = require("@tiptap/extension-hard-break");
|
|
219
|
-
import_extension_heading = require("@tiptap/extension-heading");
|
|
220
|
-
import_extension_horizontal_rule = require("@tiptap/extension-horizontal-rule");
|
|
221
|
-
import_extension_italic = require("@tiptap/extension-italic");
|
|
222
|
-
import_extension_link = require("@tiptap/extension-link");
|
|
223
|
-
import_extension_list = require("@tiptap/extension-list");
|
|
224
|
-
import_extension_paragraph = require("@tiptap/extension-paragraph");
|
|
225
|
-
import_extension_strike = require("@tiptap/extension-strike");
|
|
226
|
-
import_extension_text = require("@tiptap/extension-text");
|
|
227
|
-
import_extension_text_align = __toESM(require("@tiptap/extension-text-align"));
|
|
228
|
-
import_extension_underline = require("@tiptap/extension-underline");
|
|
229
|
-
defaultPuckRichTextOptions = {
|
|
230
|
-
textAlign: {
|
|
231
|
-
types: ["heading", "paragraph"]
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
PuckRichText = import_core.Extension.create({
|
|
235
|
-
name: "puckRichText",
|
|
236
|
-
addExtensions() {
|
|
237
|
-
const extensions = [];
|
|
238
|
-
const options = __spreadValues(__spreadValues({}, this.options), defaultPuckRichTextOptions);
|
|
239
|
-
if (options.bold !== false) {
|
|
240
|
-
extensions.push(import_extension_bold.Bold.configure(options.bold));
|
|
241
|
-
}
|
|
242
|
-
if (options.blockquote !== false) {
|
|
243
|
-
extensions.push(import_extension_blockquote.Blockquote.configure(options.blockquote));
|
|
244
|
-
}
|
|
245
|
-
if (options.bulletList !== false) {
|
|
246
|
-
extensions.push(import_extension_list.BulletList.configure(options.bulletList));
|
|
247
|
-
}
|
|
248
|
-
if (options.code !== false) {
|
|
249
|
-
extensions.push(import_extension_code.Code.configure(options.code));
|
|
250
|
-
}
|
|
251
|
-
if (options.codeBlock !== false) {
|
|
252
|
-
extensions.push(import_extension_code_block.CodeBlock.configure(options.codeBlock));
|
|
253
|
-
}
|
|
254
|
-
if (options.document !== false) {
|
|
255
|
-
extensions.push(import_extension_document.Document.configure(options.document));
|
|
256
|
-
}
|
|
257
|
-
if (options.hardBreak !== false) {
|
|
258
|
-
extensions.push(import_extension_hard_break.HardBreak.configure(options.hardBreak));
|
|
259
|
-
}
|
|
260
|
-
if (options.heading !== false) {
|
|
261
|
-
extensions.push(import_extension_heading.Heading.configure(options.heading));
|
|
262
|
-
}
|
|
263
|
-
if (options.horizontalRule !== false) {
|
|
264
|
-
extensions.push(import_extension_horizontal_rule.HorizontalRule.configure(options.horizontalRule));
|
|
265
|
-
}
|
|
266
|
-
if (options.italic !== false) {
|
|
267
|
-
extensions.push(import_extension_italic.Italic.configure(options.italic));
|
|
268
|
-
}
|
|
269
|
-
if (options.listItem !== false) {
|
|
270
|
-
extensions.push(import_extension_list.ListItem.configure(options.listItem));
|
|
271
|
-
}
|
|
272
|
-
if (options.listKeymap !== false) {
|
|
273
|
-
extensions.push(import_extension_list.ListKeymap.configure(options == null ? void 0 : options.listKeymap));
|
|
274
|
-
}
|
|
275
|
-
if (options.link !== false) {
|
|
276
|
-
extensions.push(import_extension_link.Link.configure(options == null ? void 0 : options.link));
|
|
277
|
-
}
|
|
278
|
-
if (options.orderedList !== false) {
|
|
279
|
-
extensions.push(import_extension_list.OrderedList.configure(options.orderedList));
|
|
280
|
-
}
|
|
281
|
-
if (options.paragraph !== false) {
|
|
282
|
-
extensions.push(import_extension_paragraph.Paragraph.configure(options.paragraph));
|
|
283
|
-
}
|
|
284
|
-
if (options.strike !== false) {
|
|
285
|
-
extensions.push(import_extension_strike.Strike.configure(options.strike));
|
|
286
|
-
}
|
|
287
|
-
if (options.text !== false) {
|
|
288
|
-
extensions.push(import_extension_text.Text.configure(options.text));
|
|
289
|
-
}
|
|
290
|
-
if (options.textAlign !== false) {
|
|
291
|
-
extensions.push(import_extension_text_align.default.configure(options.textAlign));
|
|
292
|
-
}
|
|
293
|
-
if (options.underline !== false) {
|
|
294
|
-
extensions.push(import_extension_underline.Underline.configure(options == null ? void 0 : options.underline));
|
|
295
|
-
}
|
|
296
|
-
return extensions;
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
// components/RichTextEditor/components/Render.tsx
|
|
303
|
-
var Render_exports = {};
|
|
304
|
-
__export(Render_exports, {
|
|
305
|
-
RichTextRender: () => RichTextRender
|
|
306
|
-
});
|
|
307
|
-
function RichTextRender({
|
|
308
|
-
content,
|
|
309
|
-
field
|
|
310
|
-
}) {
|
|
311
|
-
const { tiptap = {}, options } = field;
|
|
312
|
-
const { extensions = [] } = tiptap;
|
|
313
|
-
const loadedExtensions = (0, import_react3.useMemo)(
|
|
314
|
-
() => [PuckRichText.configure(options), ...extensions],
|
|
315
|
-
[field, extensions]
|
|
316
|
-
);
|
|
317
|
-
const normalized = (0, import_react3.useMemo)(() => {
|
|
318
|
-
if (typeof content === "object" && (content == null ? void 0 : content.type) === "doc") {
|
|
319
|
-
return content;
|
|
320
|
-
}
|
|
321
|
-
if (typeof content === "string") {
|
|
322
|
-
const isHtml = /<\/?[a-z][\s\S]*>/i.test(content);
|
|
323
|
-
if (isHtml) {
|
|
324
|
-
return (0, import_html.generateJSON)(content, loadedExtensions);
|
|
325
|
-
}
|
|
326
|
-
return {
|
|
327
|
-
type: "doc",
|
|
328
|
-
content: [
|
|
329
|
-
{ type: "paragraph", content: [{ type: "text", text: content }] }
|
|
330
|
-
]
|
|
331
|
-
};
|
|
332
|
-
}
|
|
333
|
-
return { type: "doc", content: [] };
|
|
334
|
-
}, [content, loadedExtensions]);
|
|
335
|
-
const html = (0, import_react3.useMemo)(() => {
|
|
336
|
-
return (0, import_html.generateHTML)(normalized, loadedExtensions);
|
|
337
|
-
}, [normalized, loadedExtensions]);
|
|
338
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: getClassName2(), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "rich-text", dangerouslySetInnerHTML: { __html: html } }) });
|
|
339
|
-
}
|
|
340
|
-
var import_html, import_react3, import_jsx_runtime2, getClassName2;
|
|
341
|
-
var init_Render = __esm({
|
|
342
|
-
"components/RichTextEditor/components/Render.tsx"() {
|
|
343
|
-
"use strict";
|
|
344
|
-
init_react_import();
|
|
345
|
-
import_html = require("@tiptap/html");
|
|
346
|
-
import_react3 = require("react");
|
|
347
|
-
init_get_class_name_factory();
|
|
348
|
-
init_styles_module();
|
|
349
|
-
init_extension();
|
|
350
|
-
import_jsx_runtime2 = require("react/jsx-runtime");
|
|
351
|
-
getClassName2 = get_class_name_factory_default("RichTextEditor", styles_module_default);
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
|
-
|
|
355
79
|
// bundle/rsc.tsx
|
|
356
80
|
var rsc_exports = {};
|
|
357
81
|
__export(rsc_exports, {
|
|
@@ -362,19 +86,16 @@ __export(rsc_exports, {
|
|
|
362
86
|
walkTree: () => walkTree
|
|
363
87
|
});
|
|
364
88
|
module.exports = __toCommonJS(rsc_exports);
|
|
365
|
-
init_react_import();
|
|
366
89
|
|
|
367
|
-
//
|
|
368
|
-
|
|
90
|
+
// ../tsup-config/react-import.js
|
|
91
|
+
var import_react = __toESM(require("react"));
|
|
369
92
|
|
|
370
93
|
// lib/root-droppable-id.ts
|
|
371
|
-
init_react_import();
|
|
372
94
|
var rootAreaId = "root";
|
|
373
95
|
var rootZone = "default-zone";
|
|
374
96
|
var rootDroppableId = `${rootAreaId}:${rootZone}`;
|
|
375
97
|
|
|
376
98
|
// lib/data/setup-zone.ts
|
|
377
|
-
init_react_import();
|
|
378
99
|
var setupZone = (data, zoneKey) => {
|
|
379
100
|
if (zoneKey === rootDroppableId) {
|
|
380
101
|
return data;
|
|
@@ -386,18 +107,10 @@ var setupZone = (data, zoneKey) => {
|
|
|
386
107
|
return newData;
|
|
387
108
|
};
|
|
388
109
|
|
|
389
|
-
// lib/use-slots.tsx
|
|
390
|
-
init_react_import();
|
|
391
|
-
|
|
392
110
|
// lib/field-transforms/use-field-transforms.tsx
|
|
393
|
-
init_react_import();
|
|
394
111
|
var import_react2 = require("react");
|
|
395
112
|
|
|
396
|
-
// lib/data/map-fields.ts
|
|
397
|
-
init_react_import();
|
|
398
|
-
|
|
399
113
|
// lib/data/default-slots.ts
|
|
400
|
-
init_react_import();
|
|
401
114
|
var defaultSlots = (value, fields) => Object.keys(fields).reduce(
|
|
402
115
|
(acc, fieldName) => fields[fieldName].type === "slot" ? __spreadValues({ [fieldName]: [] }, acc) : acc,
|
|
403
116
|
value
|
|
@@ -587,7 +300,6 @@ function useFieldTransforms(config, item, transforms, readOnly, forceReadOnly) {
|
|
|
587
300
|
}
|
|
588
301
|
|
|
589
302
|
// lib/field-transforms/default-transforms/slot-transform.tsx
|
|
590
|
-
init_react_import();
|
|
591
303
|
var getSlotTransform = (renderSlotEdit, renderSlotRender = renderSlotEdit) => ({
|
|
592
304
|
slot: ({ value: content, propName, field, isReadOnly }) => {
|
|
593
305
|
const render = isReadOnly ? renderSlotRender : renderSlotEdit;
|
|
@@ -614,92 +326,33 @@ function useSlots(config, item, renderSlotEdit, renderSlotRender = renderSlotEdi
|
|
|
614
326
|
}
|
|
615
327
|
|
|
616
328
|
// components/SlotRender/server.tsx
|
|
617
|
-
|
|
618
|
-
var import_react5 = require("react");
|
|
619
|
-
|
|
620
|
-
// components/RichTextEditor/lib/use-richtext-props.tsx
|
|
621
|
-
init_react_import();
|
|
622
|
-
var import_react4 = require("react");
|
|
623
|
-
|
|
624
|
-
// components/RichTextEditor/components/RenderFallback.tsx
|
|
625
|
-
init_react_import();
|
|
626
|
-
init_get_class_name_factory();
|
|
627
|
-
init_styles_module();
|
|
329
|
+
var import_react3 = require("react");
|
|
628
330
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
629
|
-
var
|
|
630
|
-
function RichTextRenderFallback({ content }) {
|
|
631
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: getClassName(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
632
|
-
"div",
|
|
633
|
-
{
|
|
634
|
-
className: "rich-text",
|
|
635
|
-
dangerouslySetInnerHTML: { __html: content }
|
|
636
|
-
}
|
|
637
|
-
) });
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
// components/RichTextEditor/lib/use-richtext-props.tsx
|
|
641
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
642
|
-
function useRichtextProps(fields, props) {
|
|
643
|
-
const findAllRichtextKeys = (fields2) => {
|
|
644
|
-
if (!fields2) return [];
|
|
645
|
-
const result = [];
|
|
646
|
-
for (const [key, field] of Object.entries(fields2)) {
|
|
647
|
-
if (field.type === "richtext") {
|
|
648
|
-
result.push(key);
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
return result;
|
|
652
|
-
};
|
|
653
|
-
const richtextKeys = (0, import_react4.useMemo)(() => findAllRichtextKeys(fields), [fields]);
|
|
654
|
-
const richtextProps = (0, import_react4.useMemo)(() => {
|
|
655
|
-
if (!(richtextKeys == null ? void 0 : richtextKeys.length)) return {};
|
|
656
|
-
const RichTextRender2 = (0, import_react4.lazy)(
|
|
657
|
-
() => Promise.resolve().then(() => (init_Render(), Render_exports)).then((m) => ({
|
|
658
|
-
default: m.RichTextRender
|
|
659
|
-
}))
|
|
660
|
-
);
|
|
661
|
-
return richtextKeys.reduce((acc, key) => {
|
|
662
|
-
acc[key] = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react4.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(RichTextRenderFallback, { content: props[key] }), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
663
|
-
RichTextRender2,
|
|
664
|
-
{
|
|
665
|
-
content: props[key],
|
|
666
|
-
field: fields[key]
|
|
667
|
-
}
|
|
668
|
-
) });
|
|
669
|
-
return acc;
|
|
670
|
-
}, {});
|
|
671
|
-
}, [richtextKeys, props, fields]);
|
|
672
|
-
return richtextProps;
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
// components/SlotRender/server.tsx
|
|
676
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
677
|
-
var SlotRenderPure = (props) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SlotRender, __spreadValues({}, props));
|
|
331
|
+
var SlotRenderPure = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SlotRender, __spreadValues({}, props));
|
|
678
332
|
var Item = ({
|
|
679
333
|
config,
|
|
680
334
|
item,
|
|
681
335
|
metadata
|
|
682
336
|
}) => {
|
|
683
337
|
const Component = config.components[item.type];
|
|
684
|
-
const props = useSlots(config, item, (slotProps) => /* @__PURE__ */ (0,
|
|
685
|
-
|
|
686
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
338
|
+
const props = useSlots(config, item, (slotProps) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SlotRenderPure, __spreadProps(__spreadValues({}, slotProps), { config, metadata })));
|
|
339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
687
340
|
Component.render,
|
|
688
|
-
__spreadProps(__spreadValues(
|
|
341
|
+
__spreadProps(__spreadValues({}, props), {
|
|
689
342
|
puck: __spreadProps(__spreadValues({}, props.puck), {
|
|
690
343
|
metadata: metadata || {}
|
|
691
344
|
})
|
|
692
345
|
})
|
|
693
346
|
);
|
|
694
347
|
};
|
|
695
|
-
var SlotRender = (0,
|
|
348
|
+
var SlotRender = (0, import_react3.forwardRef)(
|
|
696
349
|
function SlotRenderInternal({ className, style, content, config, metadata, as }, ref) {
|
|
697
350
|
const El = as != null ? as : "div";
|
|
698
|
-
return /* @__PURE__ */ (0,
|
|
351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(El, { className, style, ref, children: content.map((item) => {
|
|
699
352
|
if (!config.components[item.type]) {
|
|
700
353
|
return null;
|
|
701
354
|
}
|
|
702
|
-
return /* @__PURE__ */ (0,
|
|
355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
703
356
|
Item,
|
|
704
357
|
{
|
|
705
358
|
config,
|
|
@@ -713,7 +366,7 @@ var SlotRender = (0, import_react5.forwardRef)(
|
|
|
713
366
|
);
|
|
714
367
|
|
|
715
368
|
// components/ServerRender/index.tsx
|
|
716
|
-
var
|
|
369
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
717
370
|
function DropZoneRender({
|
|
718
371
|
zone,
|
|
719
372
|
data,
|
|
@@ -730,11 +383,11 @@ function DropZoneRender({
|
|
|
730
383
|
zoneCompound = `${areaId}:${zone}`;
|
|
731
384
|
content = setupZone(data, zoneCompound).zones[zoneCompound];
|
|
732
385
|
}
|
|
733
|
-
return /* @__PURE__ */ (0,
|
|
386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: content.map((item) => {
|
|
734
387
|
const Component = config.components[item.type];
|
|
735
388
|
const props = __spreadProps(__spreadValues({}, item.props), {
|
|
736
389
|
puck: {
|
|
737
|
-
renderDropZone: ({ zone: zone2 }) => /* @__PURE__ */ (0,
|
|
390
|
+
renderDropZone: ({ zone: zone2 }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
738
391
|
DropZoneRender,
|
|
739
392
|
{
|
|
740
393
|
zone: zone2,
|
|
@@ -750,9 +403,9 @@ function DropZoneRender({
|
|
|
750
403
|
}
|
|
751
404
|
});
|
|
752
405
|
const renderItem = __spreadProps(__spreadValues({}, item), { props });
|
|
753
|
-
const propsWithSlots = useSlots(config, renderItem, (props2) => /* @__PURE__ */ (0,
|
|
406
|
+
const propsWithSlots = useSlots(config, renderItem, (props2) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotRenderPure, __spreadProps(__spreadValues({}, props2), { config, metadata })));
|
|
754
407
|
if (Component) {
|
|
755
|
-
return /* @__PURE__ */ (0,
|
|
408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Component.render, __spreadValues({}, propsWithSlots), renderItem.props.id);
|
|
756
409
|
}
|
|
757
410
|
return null;
|
|
758
411
|
}) });
|
|
@@ -762,12 +415,12 @@ function Render({
|
|
|
762
415
|
data,
|
|
763
416
|
metadata = {}
|
|
764
417
|
}) {
|
|
765
|
-
var _a
|
|
418
|
+
var _a;
|
|
766
419
|
const rootProps = "props" in data.root ? data.root.props : data.root;
|
|
767
420
|
const title = rootProps.title || "";
|
|
768
421
|
const props = __spreadProps(__spreadValues({}, rootProps), {
|
|
769
422
|
puck: {
|
|
770
|
-
renderDropZone: ({ zone }) => /* @__PURE__ */ (0,
|
|
423
|
+
renderDropZone: ({ zone }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
771
424
|
DropZoneRender,
|
|
772
425
|
{
|
|
773
426
|
zone,
|
|
@@ -784,10 +437,9 @@ function Render({
|
|
|
784
437
|
editMode: false,
|
|
785
438
|
id: "puck-root"
|
|
786
439
|
});
|
|
787
|
-
const propsWithSlots = useSlots(config, { type: "root", props }, (props2) => /* @__PURE__ */ (0,
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(config.root.render, __spreadProps(__spreadValues(__spreadValues({}, propsWithSlots), richtextProps), { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
440
|
+
const propsWithSlots = useSlots(config, { type: "root", props }, (props2) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotRenderPure, __spreadProps(__spreadValues({}, props2), { config, metadata })));
|
|
441
|
+
if ((_a = config.root) == null ? void 0 : _a.render) {
|
|
442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(config.root.render, __spreadProps(__spreadValues({}, propsWithSlots), { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
791
443
|
DropZoneRender,
|
|
792
444
|
{
|
|
793
445
|
config,
|
|
@@ -797,7 +449,7 @@ function Render({
|
|
|
797
449
|
}
|
|
798
450
|
) }));
|
|
799
451
|
}
|
|
800
|
-
return /* @__PURE__ */ (0,
|
|
452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
801
453
|
DropZoneRender,
|
|
802
454
|
{
|
|
803
455
|
config,
|
|
@@ -808,14 +460,7 @@ function Render({
|
|
|
808
460
|
);
|
|
809
461
|
}
|
|
810
462
|
|
|
811
|
-
// lib/resolve-all-data.ts
|
|
812
|
-
init_react_import();
|
|
813
|
-
|
|
814
|
-
// lib/resolve-component-data.ts
|
|
815
|
-
init_react_import();
|
|
816
|
-
|
|
817
463
|
// lib/get-changed.ts
|
|
818
|
-
init_react_import();
|
|
819
464
|
var import_fast_equals = require("fast-equals");
|
|
820
465
|
var getChanged = (newItem, oldItem) => {
|
|
821
466
|
return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
|
|
@@ -892,14 +537,12 @@ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], fun
|
|
|
892
537
|
});
|
|
893
538
|
|
|
894
539
|
// lib/data/default-data.ts
|
|
895
|
-
init_react_import();
|
|
896
540
|
var defaultData = (data) => __spreadProps(__spreadValues({}, data), {
|
|
897
541
|
root: data.root || {},
|
|
898
542
|
content: data.content || []
|
|
899
543
|
});
|
|
900
544
|
|
|
901
545
|
// lib/data/to-component.ts
|
|
902
|
-
init_react_import();
|
|
903
546
|
var toComponent = (item) => {
|
|
904
547
|
return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
|
|
905
548
|
props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
|
|
@@ -957,11 +600,7 @@ function resolveAllData(_0, _1) {
|
|
|
957
600
|
});
|
|
958
601
|
}
|
|
959
602
|
|
|
960
|
-
// lib/transform-props.ts
|
|
961
|
-
init_react_import();
|
|
962
|
-
|
|
963
603
|
// lib/data/walk-tree.ts
|
|
964
|
-
init_react_import();
|
|
965
604
|
function walkTree(data, config, callbackFn) {
|
|
966
605
|
var _a, _b;
|
|
967
606
|
const walkItem = (item) => {
|
|
@@ -1029,14 +668,7 @@ function transformProps(data, propTransforms, config = { components: {} }) {
|
|
|
1029
668
|
return updatedData;
|
|
1030
669
|
}
|
|
1031
670
|
|
|
1032
|
-
// lib/migrate.ts
|
|
1033
|
-
init_react_import();
|
|
1034
|
-
|
|
1035
|
-
// store/default-app-state.ts
|
|
1036
|
-
init_react_import();
|
|
1037
|
-
|
|
1038
671
|
// components/ViewportControls/default-viewports.ts
|
|
1039
|
-
init_react_import();
|
|
1040
672
|
var defaultViewports = [
|
|
1041
673
|
{ width: 360, height: "auto", icon: "Smartphone", label: "Small" },
|
|
1042
674
|
{ width: 768, height: "auto", icon: "Tablet", label: "Medium" },
|
|
@@ -1070,14 +702,7 @@ var defaultAppState = {
|
|
|
1070
702
|
}
|
|
1071
703
|
};
|
|
1072
704
|
|
|
1073
|
-
// lib/data/walk-app-state.ts
|
|
1074
|
-
init_react_import();
|
|
1075
|
-
|
|
1076
|
-
// lib/data/for-related-zones.ts
|
|
1077
|
-
init_react_import();
|
|
1078
|
-
|
|
1079
705
|
// lib/get-zone-id.ts
|
|
1080
|
-
init_react_import();
|
|
1081
706
|
var getZoneId = (zoneCompound) => {
|
|
1082
707
|
if (!zoneCompound) {
|
|
1083
708
|
return [];
|
|
@@ -1099,11 +724,9 @@ function forRelatedZones(item, data, cb, path = []) {
|
|
|
1099
724
|
}
|
|
1100
725
|
|
|
1101
726
|
// lib/data/flatten-node.ts
|
|
1102
|
-
init_react_import();
|
|
1103
727
|
var import_flat = __toESM(require("flat"));
|
|
1104
728
|
|
|
1105
729
|
// lib/data/strip-slots.ts
|
|
1106
|
-
init_react_import();
|
|
1107
730
|
var stripSlots = (data, config) => {
|
|
1108
731
|
return mapFields(data, { slot: () => null }, config);
|
|
1109
732
|
};
|
|
@@ -1371,12 +994,3 @@ function migrate(data, config, migrationOptions) {
|
|
|
1371
994
|
transformProps,
|
|
1372
995
|
walkTree
|
|
1373
996
|
});
|
|
1374
|
-
/*! Bundled license information:
|
|
1375
|
-
|
|
1376
|
-
classnames/index.js:
|
|
1377
|
-
(*!
|
|
1378
|
-
Copyright (c) 2018 Jed Watson.
|
|
1379
|
-
Licensed under the MIT License (MIT), see
|
|
1380
|
-
http://jedwatson.github.io/classnames
|
|
1381
|
-
*)
|
|
1382
|
-
*/
|
package/dist/rsc.mjs
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SlotRenderPure,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues,
|
|
5
|
+
init_react_import,
|
|
3
6
|
migrate,
|
|
4
7
|
resolveAllData,
|
|
5
|
-
transformProps,
|
|
6
|
-
useRichtextProps,
|
|
7
|
-
useSlots
|
|
8
|
-
} from "./chunk-A7EMVTSK.mjs";
|
|
9
|
-
import {
|
|
10
8
|
rootAreaId,
|
|
11
9
|
rootDroppableId,
|
|
12
10
|
rootZone,
|
|
13
11
|
setupZone,
|
|
12
|
+
transformProps,
|
|
13
|
+
useSlots,
|
|
14
14
|
walkTree
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
__spreadProps,
|
|
18
|
-
__spreadValues,
|
|
19
|
-
init_react_import
|
|
20
|
-
} from "./chunk-GQ457KMA.mjs";
|
|
15
|
+
} from "./chunk-JA7SEUEH.mjs";
|
|
21
16
|
|
|
22
17
|
// bundle/rsc.tsx
|
|
23
18
|
init_react_import();
|
|
@@ -73,7 +68,7 @@ function Render({
|
|
|
73
68
|
data,
|
|
74
69
|
metadata = {}
|
|
75
70
|
}) {
|
|
76
|
-
var _a
|
|
71
|
+
var _a;
|
|
77
72
|
const rootProps = "props" in data.root ? data.root.props : data.root;
|
|
78
73
|
const title = rootProps.title || "";
|
|
79
74
|
const props = __spreadProps(__spreadValues({}, rootProps), {
|
|
@@ -96,9 +91,8 @@ function Render({
|
|
|
96
91
|
id: "puck-root"
|
|
97
92
|
});
|
|
98
93
|
const propsWithSlots = useSlots(config, { type: "root", props }, (props2) => /* @__PURE__ */ jsx(SlotRenderPure, __spreadProps(__spreadValues({}, props2), { config, metadata })));
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return /* @__PURE__ */ jsx(config.root.render, __spreadProps(__spreadValues(__spreadValues({}, propsWithSlots), richtextProps), { children: /* @__PURE__ */ jsx(
|
|
94
|
+
if ((_a = config.root) == null ? void 0 : _a.render) {
|
|
95
|
+
return /* @__PURE__ */ jsx(config.root.render, __spreadProps(__spreadValues({}, propsWithSlots), { children: /* @__PURE__ */ jsx(
|
|
102
96
|
DropZoneRender,
|
|
103
97
|
{
|
|
104
98
|
config,
|