@measured/puck 0.21.0-canary.f5820ce9 → 0.21.0-canary.fee2ba98
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/Editor-EHVB6NFF.mjs +204 -0
- package/dist/Editor-F2LSS6SE.css +403 -0
- package/dist/Render-OFE6QLI2.mjs +55 -0
- package/dist/Render-QEMDIDQC.css +101 -0
- package/dist/{walk-tree-Ctf3FZQI.d.mts → actions-DwdqNb63.d.mts} +265 -75
- package/dist/{walk-tree-Ctf3FZQI.d.ts → actions-DwdqNb63.d.ts} +265 -75
- package/dist/chunk-2334PLLL.mjs +111 -0
- package/dist/chunk-4N3WJM5Y.mjs +33 -0
- package/dist/{chunk-AO6Y47WD.mjs → chunk-6AGLD64M.mjs} +4819 -6477
- package/dist/chunk-CSSRLPHM.mjs +11 -0
- package/dist/chunk-D6RJOV2Z.mjs +1727 -0
- package/dist/chunk-M6W7YEVX.mjs +95 -0
- package/dist/chunk-NLUHDYVR.mjs +416 -0
- package/dist/chunk-NQEE2254.mjs +706 -0
- package/dist/chunk-PXYVL42X.mjs +53 -0
- package/dist/chunk-QBGM4ELA.mjs +528 -0
- package/dist/chunk-QLQZDFXM.mjs +63 -0
- package/dist/chunk-T3WX7XJ6.mjs +132 -0
- package/dist/chunk-V5I7CVLT.mjs +103 -0
- package/dist/chunk-Y2EFNT5P.mjs +108 -0
- package/dist/chunk-Y656T6AQ.mjs +419 -0
- package/dist/full-2GJTAAZE.css +301 -0
- package/dist/full-TVZATY2K.mjs +93 -0
- package/dist/index-AfAtzigt.d.ts +117 -0
- package/dist/index-jxA1wrW4.d.mts +117 -0
- package/dist/index.css +278 -22
- package/dist/index.d.mts +99 -113
- package/dist/index.d.ts +99 -113
- package/dist/index.js +6647 -3315
- package/dist/index.mjs +26 -12
- package/dist/internal.d.mts +27 -0
- package/dist/internal.d.ts +27 -0
- package/dist/internal.js +908 -0
- package/dist/internal.mjs +13 -0
- package/dist/loaded-ICVILKS6.mjs +60 -0
- package/dist/loaded-IHAGHNLA.mjs +57 -0
- package/dist/loaded-ONU7LATV.mjs +57 -0
- package/dist/loaded-RVWBFK7L.css +87 -0
- package/dist/no-external.css +425 -165
- package/dist/no-external.d.mts +19 -2
- package/dist/no-external.d.ts +19 -2
- package/dist/no-external.js +6646 -3311
- package/dist/no-external.mjs +28 -9
- package/dist/rsc.css +101 -0
- package/dist/rsc.d.mts +17 -2
- package/dist/rsc.d.ts +17 -2
- package/dist/rsc.js +417 -30
- package/dist/rsc.mjs +18 -9
- package/dist/walk-tree-DRy9ca1P.d.ts +29 -0
- package/dist/walk-tree-Dppc3XGY.d.mts +29 -0
- package/package.json +31 -4
- package/dist/chunk-VBJEDLUM.mjs +0 -965
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import {
|
|
2
|
+
styles_module_default
|
|
3
|
+
} from "./chunk-CSSRLPHM.mjs";
|
|
4
|
+
import {
|
|
5
|
+
defaultAppState,
|
|
6
|
+
resolveComponentData
|
|
7
|
+
} from "./chunk-T3WX7XJ6.mjs";
|
|
8
|
+
import {
|
|
9
|
+
get_class_name_factory_default
|
|
10
|
+
} from "./chunk-Y2EFNT5P.mjs";
|
|
11
|
+
import {
|
|
12
|
+
mapFields,
|
|
13
|
+
walkAppState,
|
|
14
|
+
walkTree
|
|
15
|
+
} from "./chunk-NLUHDYVR.mjs";
|
|
16
|
+
import {
|
|
17
|
+
__async,
|
|
18
|
+
__objRest,
|
|
19
|
+
__spreadProps,
|
|
20
|
+
__spreadValues,
|
|
21
|
+
init_react_import
|
|
22
|
+
} from "./chunk-M6W7YEVX.mjs";
|
|
23
|
+
|
|
24
|
+
// lib/migrate.ts
|
|
25
|
+
init_react_import();
|
|
26
|
+
var migrations = [
|
|
27
|
+
// Migrate root to root.props
|
|
28
|
+
(data) => {
|
|
29
|
+
const rootProps = data.root.props || data.root;
|
|
30
|
+
if (Object.keys(data.root).length > 0 && !data.root.props) {
|
|
31
|
+
console.warn(
|
|
32
|
+
"Migration applied: Root props moved from `root` to `root.props`."
|
|
33
|
+
);
|
|
34
|
+
return __spreadProps(__spreadValues({}, data), {
|
|
35
|
+
root: {
|
|
36
|
+
props: __spreadValues({}, rootProps)
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return data;
|
|
41
|
+
},
|
|
42
|
+
// Migrate zones to slots
|
|
43
|
+
(data, config, migrationOptions) => {
|
|
44
|
+
var _a, _b;
|
|
45
|
+
if (!config) return data;
|
|
46
|
+
console.log("Migrating DropZones to slots...");
|
|
47
|
+
const updatedItems = {};
|
|
48
|
+
const appState = __spreadProps(__spreadValues({}, defaultAppState), { data });
|
|
49
|
+
const { indexes } = walkAppState(appState, config);
|
|
50
|
+
const deletedCompounds = [];
|
|
51
|
+
walkAppState(appState, config, (content, zoneCompound, zoneType) => {
|
|
52
|
+
var _a2, _b2, _c;
|
|
53
|
+
if (zoneType === "dropzone") {
|
|
54
|
+
const [id, slotName] = zoneCompound.split(":");
|
|
55
|
+
const nodeData = indexes.nodes[id].data;
|
|
56
|
+
const componentType = nodeData.type;
|
|
57
|
+
const configForComponent = id === "root" ? config.root : config.components[componentType];
|
|
58
|
+
if (((_b2 = (_a2 = configForComponent == null ? void 0 : configForComponent.fields) == null ? void 0 : _a2[slotName]) == null ? void 0 : _b2.type) === "slot") {
|
|
59
|
+
updatedItems[id] = __spreadProps(__spreadValues({}, nodeData), {
|
|
60
|
+
props: __spreadProps(__spreadValues(__spreadValues({}, nodeData.props), (_c = updatedItems[id]) == null ? void 0 : _c.props), {
|
|
61
|
+
[slotName]: content
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
deletedCompounds.push(zoneCompound);
|
|
65
|
+
}
|
|
66
|
+
return content;
|
|
67
|
+
}
|
|
68
|
+
return content;
|
|
69
|
+
});
|
|
70
|
+
const updated = walkAppState(
|
|
71
|
+
appState,
|
|
72
|
+
config,
|
|
73
|
+
(content) => content,
|
|
74
|
+
(item) => {
|
|
75
|
+
var _a2;
|
|
76
|
+
return (_a2 = updatedItems[item.props.id]) != null ? _a2 : item;
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
deletedCompounds.forEach((zoneCompound) => {
|
|
80
|
+
var _a2;
|
|
81
|
+
const [_, propName] = zoneCompound.split(":");
|
|
82
|
+
console.log(
|
|
83
|
+
`\u2713 Success: Migrated "${zoneCompound}" from DropZone to slot field "${propName}"`
|
|
84
|
+
);
|
|
85
|
+
(_a2 = updated.data.zones) == null ? true : delete _a2[zoneCompound];
|
|
86
|
+
});
|
|
87
|
+
if (migrationOptions == null ? void 0 : migrationOptions.migrateDynamicZonesForComponent) {
|
|
88
|
+
const unmigratedZonesGrouped = {};
|
|
89
|
+
Object.keys((_a = updated.data.zones) != null ? _a : {}).forEach((zoneCompound) => {
|
|
90
|
+
var _a2;
|
|
91
|
+
const [componentId, propName] = zoneCompound.split(":");
|
|
92
|
+
const content = (_a2 = updated.data.zones) == null ? void 0 : _a2[zoneCompound];
|
|
93
|
+
if (!content) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (!unmigratedZonesGrouped[componentId]) {
|
|
97
|
+
unmigratedZonesGrouped[componentId] = {};
|
|
98
|
+
}
|
|
99
|
+
if (!unmigratedZonesGrouped[componentId][propName]) {
|
|
100
|
+
unmigratedZonesGrouped[componentId][propName] = content;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
Object.keys(unmigratedZonesGrouped).forEach((componentId) => {
|
|
104
|
+
updated.data = walkTree(updated.data, config, (content) => {
|
|
105
|
+
return content.map((child) => {
|
|
106
|
+
var _a2;
|
|
107
|
+
if (child.props.id !== componentId) {
|
|
108
|
+
return child;
|
|
109
|
+
}
|
|
110
|
+
const migrateFn = (_a2 = migrationOptions == null ? void 0 : migrationOptions.migrateDynamicZonesForComponent) == null ? void 0 : _a2[child.type];
|
|
111
|
+
if (!migrateFn) {
|
|
112
|
+
return child;
|
|
113
|
+
}
|
|
114
|
+
const zones = unmigratedZonesGrouped[componentId];
|
|
115
|
+
const migratedProps = migrateFn(child.props, zones);
|
|
116
|
+
Object.keys(zones).forEach((propName) => {
|
|
117
|
+
var _a3;
|
|
118
|
+
const zoneCompound = `${componentId}:${propName}`;
|
|
119
|
+
console.log(`\u2713 Success: Migrated "${zoneCompound}" DropZone`);
|
|
120
|
+
(_a3 = updated.data.zones) == null ? true : delete _a3[zoneCompound];
|
|
121
|
+
});
|
|
122
|
+
return __spreadProps(__spreadValues({}, child), {
|
|
123
|
+
props: migratedProps
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
Object.keys((_b = updated.data.zones) != null ? _b : {}).forEach((zoneCompound) => {
|
|
130
|
+
const [_, propName] = zoneCompound.split(":");
|
|
131
|
+
throw new Error(
|
|
132
|
+
`Could not migrate DropZone "${zoneCompound}" to slot field. No slot exists with the name "${propName}".`
|
|
133
|
+
);
|
|
134
|
+
});
|
|
135
|
+
delete updated.data.zones;
|
|
136
|
+
return updated.data;
|
|
137
|
+
}
|
|
138
|
+
];
|
|
139
|
+
function migrate(data, config, migrationOptions) {
|
|
140
|
+
return migrations == null ? void 0 : migrations.reduce(
|
|
141
|
+
(acc, migration) => migration(acc, config, migrationOptions),
|
|
142
|
+
data
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// lib/transform-props.ts
|
|
147
|
+
init_react_import();
|
|
148
|
+
|
|
149
|
+
// lib/data/default-data.ts
|
|
150
|
+
init_react_import();
|
|
151
|
+
var defaultData = (data) => __spreadProps(__spreadValues({}, data), {
|
|
152
|
+
root: data.root || {},
|
|
153
|
+
content: data.content || []
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// lib/transform-props.ts
|
|
157
|
+
function transformProps(data, propTransforms, config = { components: {} }) {
|
|
158
|
+
const mapItem = (item) => {
|
|
159
|
+
if (propTransforms[item.type]) {
|
|
160
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
161
|
+
props: __spreadValues({
|
|
162
|
+
id: item.props.id
|
|
163
|
+
}, propTransforms[item.type](item.props))
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return item;
|
|
167
|
+
};
|
|
168
|
+
const defaultedData = defaultData(data);
|
|
169
|
+
const rootProps = defaultedData.root.props || defaultedData.root;
|
|
170
|
+
let newRoot = __spreadValues({}, defaultedData.root);
|
|
171
|
+
if (propTransforms["root"]) {
|
|
172
|
+
newRoot.props = propTransforms["root"](rootProps);
|
|
173
|
+
}
|
|
174
|
+
const dataWithUpdatedRoot = __spreadProps(__spreadValues({}, defaultedData), { root: newRoot });
|
|
175
|
+
const updatedData = walkTree(
|
|
176
|
+
dataWithUpdatedRoot,
|
|
177
|
+
config,
|
|
178
|
+
(content) => content.map(mapItem)
|
|
179
|
+
);
|
|
180
|
+
if (!defaultedData.root.props) {
|
|
181
|
+
updatedData.root = updatedData.root.props;
|
|
182
|
+
}
|
|
183
|
+
return updatedData;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// lib/resolve-all-data.ts
|
|
187
|
+
init_react_import();
|
|
188
|
+
|
|
189
|
+
// lib/data/to-component.ts
|
|
190
|
+
init_react_import();
|
|
191
|
+
var toComponent = (item) => {
|
|
192
|
+
return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
|
|
193
|
+
props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
|
|
194
|
+
type: "root"
|
|
195
|
+
});
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
// lib/resolve-all-data.ts
|
|
199
|
+
function resolveAllData(_0, _1) {
|
|
200
|
+
return __async(this, arguments, function* (data, config, metadata = {}, onResolveStart, onResolveEnd) {
|
|
201
|
+
var _a;
|
|
202
|
+
const defaultedData = defaultData(data);
|
|
203
|
+
const resolveNode = (_node) => __async(null, null, function* () {
|
|
204
|
+
const node = toComponent(_node);
|
|
205
|
+
onResolveStart == null ? void 0 : onResolveStart(node);
|
|
206
|
+
const resolved = (yield resolveComponentData(
|
|
207
|
+
node,
|
|
208
|
+
config,
|
|
209
|
+
metadata,
|
|
210
|
+
() => {
|
|
211
|
+
},
|
|
212
|
+
() => {
|
|
213
|
+
},
|
|
214
|
+
"force"
|
|
215
|
+
)).node;
|
|
216
|
+
const resolvedDeep = yield mapFields(
|
|
217
|
+
resolved,
|
|
218
|
+
{ slot: ({ value }) => processContent(value) },
|
|
219
|
+
config
|
|
220
|
+
);
|
|
221
|
+
onResolveEnd == null ? void 0 : onResolveEnd(toComponent(resolvedDeep));
|
|
222
|
+
return resolvedDeep;
|
|
223
|
+
});
|
|
224
|
+
const processContent = (content) => __async(null, null, function* () {
|
|
225
|
+
return Promise.all(content.map(resolveNode));
|
|
226
|
+
});
|
|
227
|
+
const processZones = () => __async(null, null, function* () {
|
|
228
|
+
var _a2;
|
|
229
|
+
const zones = (_a2 = data.zones) != null ? _a2 : {};
|
|
230
|
+
Object.entries(zones).forEach((_02) => __async(null, [_02], function* ([zoneKey, content]) {
|
|
231
|
+
zones[zoneKey] = yield Promise.all(content.map(resolveNode));
|
|
232
|
+
}));
|
|
233
|
+
return zones;
|
|
234
|
+
});
|
|
235
|
+
const dynamic = {
|
|
236
|
+
root: yield resolveNode(defaultedData.root),
|
|
237
|
+
content: yield processContent(defaultedData.content),
|
|
238
|
+
zones: yield processZones()
|
|
239
|
+
};
|
|
240
|
+
Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(null, null, function* () {
|
|
241
|
+
const content = defaultedData.zones[zoneKey];
|
|
242
|
+
dynamic.zones[zoneKey] = yield processContent(content);
|
|
243
|
+
}), {});
|
|
244
|
+
return dynamic;
|
|
245
|
+
});
|
|
246
|
+
}
|
|
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
|
+
// lib/field-transforms/default-transforms/slot-transform.tsx
|
|
285
|
+
init_react_import();
|
|
286
|
+
var getSlotTransform = (renderSlotEdit, renderSlotRender = renderSlotEdit) => ({
|
|
287
|
+
slot: ({ value: content, propName, field, isReadOnly }) => {
|
|
288
|
+
const render = isReadOnly ? renderSlotRender : renderSlotEdit;
|
|
289
|
+
const Slot = (dzProps) => render(__spreadProps(__spreadValues({
|
|
290
|
+
allow: (field == null ? void 0 : field.type) === "slot" ? field.allow : [],
|
|
291
|
+
disallow: (field == null ? void 0 : field.type) === "slot" ? field.disallow : []
|
|
292
|
+
}, dzProps), {
|
|
293
|
+
zone: propName,
|
|
294
|
+
content
|
|
295
|
+
}));
|
|
296
|
+
return Slot;
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
// lib/use-slots.tsx
|
|
301
|
+
init_react_import();
|
|
302
|
+
function useSlots(config, item, renderSlotEdit, renderSlotRender = renderSlotEdit, readOnly, forceReadOnly) {
|
|
303
|
+
return useFieldTransforms(
|
|
304
|
+
config,
|
|
305
|
+
item,
|
|
306
|
+
getSlotTransform(renderSlotEdit, renderSlotRender),
|
|
307
|
+
readOnly,
|
|
308
|
+
forceReadOnly
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// components/RichTextEditor/lib/use-richtext-props.tsx
|
|
313
|
+
init_react_import();
|
|
314
|
+
import { lazy, Suspense, useMemo as useMemo2 } from "react";
|
|
315
|
+
|
|
316
|
+
// components/RichTextEditor/components/RenderFallback.tsx
|
|
317
|
+
init_react_import();
|
|
318
|
+
import { jsx } from "react/jsx-runtime";
|
|
319
|
+
var getClassName = get_class_name_factory_default("RichTextEditor", styles_module_default);
|
|
320
|
+
function RichTextRenderFallback({ content }) {
|
|
321
|
+
return /* @__PURE__ */ jsx("div", { className: getClassName(), children: /* @__PURE__ */ jsx(
|
|
322
|
+
"div",
|
|
323
|
+
{
|
|
324
|
+
className: "rich-text",
|
|
325
|
+
dangerouslySetInnerHTML: { __html: content }
|
|
326
|
+
}
|
|
327
|
+
) });
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// components/RichTextEditor/lib/use-richtext-props.tsx
|
|
331
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
332
|
+
function useRichtextProps(fields, props) {
|
|
333
|
+
const findAllRichtextKeys = (fields2) => {
|
|
334
|
+
if (!fields2) return [];
|
|
335
|
+
const result = [];
|
|
336
|
+
for (const [key, field] of Object.entries(fields2)) {
|
|
337
|
+
if (field.type === "richtext") {
|
|
338
|
+
result.push(key);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return result;
|
|
342
|
+
};
|
|
343
|
+
const richtextKeys = useMemo2(() => findAllRichtextKeys(fields), [fields]);
|
|
344
|
+
const richtextProps = useMemo2(() => {
|
|
345
|
+
if (!(richtextKeys == null ? void 0 : richtextKeys.length)) return {};
|
|
346
|
+
const RichTextRender = lazy(
|
|
347
|
+
() => import("./Render-OFE6QLI2.mjs").then((m) => ({
|
|
348
|
+
default: m.RichTextRender
|
|
349
|
+
}))
|
|
350
|
+
);
|
|
351
|
+
return richtextKeys.reduce((acc, key) => {
|
|
352
|
+
acc[key] = /* @__PURE__ */ jsx2(Suspense, { fallback: /* @__PURE__ */ jsx2(RichTextRenderFallback, { content: props[key] }), children: /* @__PURE__ */ jsx2(
|
|
353
|
+
RichTextRender,
|
|
354
|
+
{
|
|
355
|
+
content: props[key],
|
|
356
|
+
field: fields[key]
|
|
357
|
+
}
|
|
358
|
+
) });
|
|
359
|
+
return acc;
|
|
360
|
+
}, {});
|
|
361
|
+
}, [richtextKeys, props, fields]);
|
|
362
|
+
return richtextProps;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// components/SlotRender/server.tsx
|
|
366
|
+
init_react_import();
|
|
367
|
+
import { forwardRef } from "react";
|
|
368
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
369
|
+
var SlotRenderPure = (props) => /* @__PURE__ */ jsx3(SlotRender, __spreadValues({}, props));
|
|
370
|
+
var Item = ({
|
|
371
|
+
config,
|
|
372
|
+
item,
|
|
373
|
+
metadata
|
|
374
|
+
}) => {
|
|
375
|
+
const Component = config.components[item.type];
|
|
376
|
+
const props = useSlots(config, item, (slotProps) => /* @__PURE__ */ jsx3(SlotRenderPure, __spreadProps(__spreadValues({}, slotProps), { config, metadata })));
|
|
377
|
+
const richtextProps = useRichtextProps(Component.fields, props);
|
|
378
|
+
return /* @__PURE__ */ jsx3(
|
|
379
|
+
Component.render,
|
|
380
|
+
__spreadProps(__spreadValues(__spreadValues({}, props), richtextProps), {
|
|
381
|
+
puck: __spreadProps(__spreadValues({}, props.puck), {
|
|
382
|
+
metadata: metadata || {}
|
|
383
|
+
})
|
|
384
|
+
})
|
|
385
|
+
);
|
|
386
|
+
};
|
|
387
|
+
var SlotRender = forwardRef(
|
|
388
|
+
function SlotRenderInternal({ className, style, content, config, metadata, as }, ref) {
|
|
389
|
+
const El = as != null ? as : "div";
|
|
390
|
+
return /* @__PURE__ */ jsx3(El, { className, style, ref, children: content.map((item) => {
|
|
391
|
+
if (!config.components[item.type]) {
|
|
392
|
+
return null;
|
|
393
|
+
}
|
|
394
|
+
return /* @__PURE__ */ jsx3(
|
|
395
|
+
Item,
|
|
396
|
+
{
|
|
397
|
+
config,
|
|
398
|
+
item,
|
|
399
|
+
metadata
|
|
400
|
+
},
|
|
401
|
+
item.props.id
|
|
402
|
+
);
|
|
403
|
+
}) });
|
|
404
|
+
}
|
|
405
|
+
);
|
|
406
|
+
|
|
407
|
+
export {
|
|
408
|
+
useFieldTransforms,
|
|
409
|
+
getSlotTransform,
|
|
410
|
+
useSlots,
|
|
411
|
+
RichTextRenderFallback,
|
|
412
|
+
useRichtextProps,
|
|
413
|
+
SlotRenderPure,
|
|
414
|
+
SlotRender,
|
|
415
|
+
toComponent,
|
|
416
|
+
migrate,
|
|
417
|
+
transformProps,
|
|
418
|
+
resolveAllData
|
|
419
|
+
};
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/styles.module.css/#css-module-data */
|
|
2
|
+
._RichTextMenu_k97eh_1 {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: row;
|
|
5
|
+
flex-wrap: nowrap;
|
|
6
|
+
}
|
|
7
|
+
._RichTextMenu--form_k97eh_7 {
|
|
8
|
+
border-top-left-radius: 4px;
|
|
9
|
+
border-top-right-radius: 4px;
|
|
10
|
+
padding: 6px 6px;
|
|
11
|
+
background-color: var(--puck-color-grey-12);
|
|
12
|
+
position: relative;
|
|
13
|
+
scrollbar-width: none;
|
|
14
|
+
overflow-x: auto;
|
|
15
|
+
}
|
|
16
|
+
._RichTextMenu-group_k97eh_17 {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: space-between;
|
|
19
|
+
flex-direction: row;
|
|
20
|
+
flex-wrap: nowrap;
|
|
21
|
+
padding-inline: 6px;
|
|
22
|
+
gap: 2px;
|
|
23
|
+
position: relative;
|
|
24
|
+
}
|
|
25
|
+
._RichTextMenu-group_k97eh_17:first-of-type {
|
|
26
|
+
padding-left: 0;
|
|
27
|
+
}
|
|
28
|
+
._RichTextMenu-group_k97eh_17:last-of-type {
|
|
29
|
+
padding-right: 0;
|
|
30
|
+
}
|
|
31
|
+
._RichTextMenu--inline_k97eh_35 ._RichTextMenu-group_k97eh_17 {
|
|
32
|
+
color: var(--puck-color-grey-08);
|
|
33
|
+
gap: 0px;
|
|
34
|
+
flex-wrap: nowrap;
|
|
35
|
+
}
|
|
36
|
+
._RichTextMenu-group_k97eh_17 + ._RichTextMenu-group_k97eh_17 {
|
|
37
|
+
border-left: 1px solid var(--puck-color-grey-10);
|
|
38
|
+
}
|
|
39
|
+
._RichTextMenu--inline_k97eh_35 ._RichTextMenu-group_k97eh_17 + ._RichTextMenu-group_k97eh_17 {
|
|
40
|
+
border-left: 0.5px solid var(--puck-color-grey-05);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/IconButton/IconButton.module.css/#css-module-data */
|
|
44
|
+
._IconButton_ffob9_1 {
|
|
45
|
+
align-items: center;
|
|
46
|
+
background: transparent;
|
|
47
|
+
border: none;
|
|
48
|
+
border-radius: 4px;
|
|
49
|
+
color: currentColor;
|
|
50
|
+
display: flex;
|
|
51
|
+
font-family: var(--puck-font-family);
|
|
52
|
+
justify-content: center;
|
|
53
|
+
padding: 4px;
|
|
54
|
+
transition: background-color 50ms ease-in, color 50ms ease-in;
|
|
55
|
+
}
|
|
56
|
+
._IconButton--active_ffob9_14 {
|
|
57
|
+
color: var(--puck-color-azure-04);
|
|
58
|
+
}
|
|
59
|
+
._IconButton_ffob9_1:focus-visible {
|
|
60
|
+
outline: 2px solid var(--puck-color-azure-05);
|
|
61
|
+
outline-offset: -2px;
|
|
62
|
+
}
|
|
63
|
+
@media (hover: hover) and (pointer: fine) {
|
|
64
|
+
._IconButton_ffob9_1:hover:not(._IconButton--disabled_ffob9_24) {
|
|
65
|
+
background: var(--puck-color-grey-10);
|
|
66
|
+
color: var(--puck-color-azure-04);
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
transition: none;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
._IconButton_ffob9_1:active {
|
|
72
|
+
background: var(--puck-color-azure-11);
|
|
73
|
+
transition: none;
|
|
74
|
+
}
|
|
75
|
+
._IconButton-title_ffob9_37 {
|
|
76
|
+
clip: rect(0 0 0 0);
|
|
77
|
+
clip-path: inset(100%);
|
|
78
|
+
height: 1px;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
position: absolute;
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
width: 1px;
|
|
83
|
+
}
|
|
84
|
+
._IconButton--disabled_ffob9_24 {
|
|
85
|
+
color: var(--puck-color-grey-07);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css/#css-module-data */
|
|
89
|
+
@keyframes _loader-animation_nacdm_1 {
|
|
90
|
+
0% {
|
|
91
|
+
transform: rotate(0deg) scale(1);
|
|
92
|
+
}
|
|
93
|
+
50% {
|
|
94
|
+
transform: rotate(180deg) scale(0.8);
|
|
95
|
+
}
|
|
96
|
+
100% {
|
|
97
|
+
transform: rotate(360deg) scale(1);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
._Loader_nacdm_13 {
|
|
101
|
+
background: transparent;
|
|
102
|
+
border-radius: 100%;
|
|
103
|
+
border: 2px solid currentColor;
|
|
104
|
+
border-bottom-color: transparent;
|
|
105
|
+
display: inline-block;
|
|
106
|
+
animation: _loader-animation_nacdm_1 1s 0s infinite linear;
|
|
107
|
+
animation-fill-mode: both;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css/#css-module-data */
|
|
111
|
+
._ActionBar_1nmyk_1 {
|
|
112
|
+
align-items: center;
|
|
113
|
+
cursor: default;
|
|
114
|
+
display: flex;
|
|
115
|
+
width: auto;
|
|
116
|
+
padding: 4px;
|
|
117
|
+
padding-inline-start: 0;
|
|
118
|
+
padding-inline-end: 0;
|
|
119
|
+
border-top-left-radius: 8px;
|
|
120
|
+
border-top-right-radius: 8px;
|
|
121
|
+
border-radius: 8px;
|
|
122
|
+
background: var(--puck-color-grey-01);
|
|
123
|
+
color: var(--puck-color-white);
|
|
124
|
+
font-family: var(--puck-font-family);
|
|
125
|
+
min-height: 26px;
|
|
126
|
+
}
|
|
127
|
+
._ActionBar-label_1nmyk_18 {
|
|
128
|
+
color: var(--puck-color-grey-08);
|
|
129
|
+
font-size: var(--puck-font-size-xxxs);
|
|
130
|
+
font-weight: 500;
|
|
131
|
+
padding-inline-start: 8px;
|
|
132
|
+
padding-inline-end: 8px;
|
|
133
|
+
margin-inline-start: 4px;
|
|
134
|
+
margin-inline-end: 4px;
|
|
135
|
+
text-overflow: ellipsis;
|
|
136
|
+
white-space: nowrap;
|
|
137
|
+
}
|
|
138
|
+
._ActionBarAction_1nmyk_30 + ._ActionBar-label_1nmyk_18 {
|
|
139
|
+
padding-inline-start: 0;
|
|
140
|
+
}
|
|
141
|
+
._ActionBar-label_1nmyk_18 + ._ActionBarAction_1nmyk_30 {
|
|
142
|
+
margin-inline-start: -4px;
|
|
143
|
+
}
|
|
144
|
+
._ActionBar-group_1nmyk_38 {
|
|
145
|
+
align-items: center;
|
|
146
|
+
border-inline-start: 0.5px solid var(--puck-color-grey-05);
|
|
147
|
+
display: flex;
|
|
148
|
+
height: 100%;
|
|
149
|
+
padding-inline-start: 4px;
|
|
150
|
+
padding-inline-end: 4px;
|
|
151
|
+
}
|
|
152
|
+
._ActionBar-group_1nmyk_38:first-of-type {
|
|
153
|
+
border-inline-start: 0;
|
|
154
|
+
}
|
|
155
|
+
._ActionBar-group_1nmyk_38:empty {
|
|
156
|
+
display: none;
|
|
157
|
+
}
|
|
158
|
+
._ActionBarAction_1nmyk_30 {
|
|
159
|
+
background: transparent;
|
|
160
|
+
border: none;
|
|
161
|
+
color: var(--puck-color-grey-08);
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
padding: 6px;
|
|
164
|
+
margin-inline-start: 4px;
|
|
165
|
+
margin-inline-end: 4px;
|
|
166
|
+
border-radius: 4px;
|
|
167
|
+
overflow: hidden;
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
justify-content: center;
|
|
171
|
+
transition: color 50ms ease-in;
|
|
172
|
+
}
|
|
173
|
+
._ActionBarAction--disabled_1nmyk_71 {
|
|
174
|
+
cursor: auto;
|
|
175
|
+
color: var(--puck-color-grey-06);
|
|
176
|
+
}
|
|
177
|
+
._ActionBarAction_1nmyk_30 svg {
|
|
178
|
+
max-width: none !important;
|
|
179
|
+
}
|
|
180
|
+
._ActionBarAction_1nmyk_30:focus-visible {
|
|
181
|
+
outline: 2px solid var(--puck-color-azure-05);
|
|
182
|
+
outline-offset: -2px;
|
|
183
|
+
}
|
|
184
|
+
@media (hover: hover) and (pointer: fine) {
|
|
185
|
+
._ActionBarAction_1nmyk_30:hover:not(._ActionBarAction--disabled_1nmyk_71) {
|
|
186
|
+
color: var(--puck-color-azure-06);
|
|
187
|
+
transition: none;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
._ActionBarAction_1nmyk_30:active:not(._ActionBarAction--disabled_1nmyk_71),
|
|
191
|
+
._ActionBarAction--active_1nmyk_93 {
|
|
192
|
+
color: var(--puck-color-azure-07);
|
|
193
|
+
transition: none;
|
|
194
|
+
}
|
|
195
|
+
._ActionBar-group_1nmyk_38 * {
|
|
196
|
+
margin: 0;
|
|
197
|
+
}
|
|
198
|
+
._ActionBar-separator_1nmyk_102 {
|
|
199
|
+
background: var(--puck-color-grey-05);
|
|
200
|
+
margin-inline: 4px;
|
|
201
|
+
width: 0.5px;
|
|
202
|
+
height: 100%;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/components/Control/styles.module.css/#css-module-data */
|
|
206
|
+
._Control_1aveu_1 .lucide {
|
|
207
|
+
height: 18px;
|
|
208
|
+
width: 18px;
|
|
209
|
+
}
|
|
210
|
+
._Control--inline_1aveu_6 .lucide {
|
|
211
|
+
height: 16px;
|
|
212
|
+
width: 16px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/Select/styles.module.css/#css-module-data */
|
|
216
|
+
._Select_xjbef_1 {
|
|
217
|
+
position: relative;
|
|
218
|
+
z-index: 1;
|
|
219
|
+
}
|
|
220
|
+
._Select-button_xjbef_6 {
|
|
221
|
+
align-items: center;
|
|
222
|
+
background: transparent;
|
|
223
|
+
border: none;
|
|
224
|
+
border-radius: 4px;
|
|
225
|
+
display: flex;
|
|
226
|
+
justify-content: center;
|
|
227
|
+
gap: 0px;
|
|
228
|
+
height: 100%;
|
|
229
|
+
padding: 4px;
|
|
230
|
+
padding-right: 2px;
|
|
231
|
+
}
|
|
232
|
+
._Select--hasOptions_xjbef_19 ._Select-button_xjbef_6 {
|
|
233
|
+
color: currentColor;
|
|
234
|
+
}
|
|
235
|
+
._Select--hasOptions_xjbef_19:not(._Select--disabled_xjbef_23) ._Select-button_xjbef_6 {
|
|
236
|
+
cursor: pointer;
|
|
237
|
+
}
|
|
238
|
+
._Select-buttonIcon_xjbef_27 {
|
|
239
|
+
align-items: center;
|
|
240
|
+
display: flex;
|
|
241
|
+
justify-content: center;
|
|
242
|
+
}
|
|
243
|
+
._Select--standalone_xjbef_33 ._Select-buttonIcon_xjbef_27 .lucide {
|
|
244
|
+
height: 18px;
|
|
245
|
+
width: 18px;
|
|
246
|
+
}
|
|
247
|
+
._Select--actionBar_xjbef_38 ._Select-buttonIcon_xjbef_27 .lucide {
|
|
248
|
+
height: 16px;
|
|
249
|
+
width: 16px;
|
|
250
|
+
}
|
|
251
|
+
._Select--hasOptions_xjbef_19:not(._Select--disabled_xjbef_23) ._Select-button_xjbef_6:hover,
|
|
252
|
+
._Select--hasValue_xjbef_44 ._Select-button_xjbef_6 {
|
|
253
|
+
background: var(--puck-color-grey-10);
|
|
254
|
+
color: var(--puck-color-azure-04);
|
|
255
|
+
}
|
|
256
|
+
._Select--disabled_xjbef_23 ._Select-button_xjbef_6 {
|
|
257
|
+
color: var(--puck-color-grey-07);
|
|
258
|
+
}
|
|
259
|
+
._Select--actionBar_xjbef_38 {
|
|
260
|
+
&._Select--hasOptions_xjbef_19 ._Select-button_xjbef_6:hover,
|
|
261
|
+
&._Select--hasValue_xjbef_44 ._Select-button_xjbef_6 {
|
|
262
|
+
background: none;
|
|
263
|
+
color: var(--puck-color-azure-07);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
._Select-items_xjbef_61 {
|
|
267
|
+
background: white;
|
|
268
|
+
border: 1px solid var(--puck-color-grey-09);
|
|
269
|
+
border-radius: 8px;
|
|
270
|
+
margin: 10px 8px;
|
|
271
|
+
margin-left: 0;
|
|
272
|
+
padding: 4px;
|
|
273
|
+
z-index: 2;
|
|
274
|
+
list-style: none;
|
|
275
|
+
}
|
|
276
|
+
._SelectItem_xjbef_72 {
|
|
277
|
+
background: transparent;
|
|
278
|
+
border-radius: 4px;
|
|
279
|
+
border: none;
|
|
280
|
+
color: var(--puck-color-grey-04);
|
|
281
|
+
cursor: pointer;
|
|
282
|
+
display: flex;
|
|
283
|
+
gap: 8px;
|
|
284
|
+
align-items: center;
|
|
285
|
+
font-size: var(--puck-font-size-xxs);
|
|
286
|
+
margin: 0;
|
|
287
|
+
padding: 8px 12px;
|
|
288
|
+
width: 100%;
|
|
289
|
+
}
|
|
290
|
+
._SelectItem--isSelected_xjbef_87 {
|
|
291
|
+
background: var(--puck-color-azure-11);
|
|
292
|
+
color: var(--puck-color-azure-04);
|
|
293
|
+
font-weight: 500;
|
|
294
|
+
}
|
|
295
|
+
._SelectItem--isSelected_xjbef_87 ._SelectItem-icon_xjbef_93 {
|
|
296
|
+
color: var(--puck-color-azure-04);
|
|
297
|
+
}
|
|
298
|
+
._SelectItem_xjbef_72:hover {
|
|
299
|
+
background: var(--puck-color-azure-11);
|
|
300
|
+
color: var(--puck-color-azure-04);
|
|
301
|
+
}
|