@raketa-builder/builder 0.41.0 → 0.43.0
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/.turbo/turbo-build.log +11 -11
- package/.turbo/turbo-format.log +50 -0
- package/.turbo/turbo-lint.log +0 -0
- package/dist/index.js +963 -945
- package/package.json +1 -1
- package/src/AdminForm/SchemaInput.js +0 -0
- package/src/AdminForm/SimpleInput.js +28 -0
- package/src/AdminForm/index.js +131 -0
- package/src/PageBuilder.js +7 -1
- package/src/dialogs/SettingsDialog.js +17 -144
- package/src/forms/ButtonSettings.js +3 -7
- package/src/forms/LinkSettings.js +3 -7
- package/src/forms/SelectMenu.js +1 -1
- package/src/index.js +2 -7
- package/src/lib/AdminWidget.js +23 -5
- package/src/styles.css +8 -6
- package/src/forms/RichText.js +0 -22
- package/src/pickers/ImagePicker/ImageInput.js +0 -17
- package/src/pickers/ImagePicker/ImagePicker.js +0 -22
package/dist/index.js
CHANGED
|
@@ -120,6 +120,7 @@ var require_dist = __commonJS({
|
|
|
120
120
|
DataGrid: () => DataGrid_default,
|
|
121
121
|
DefaultAvatar: () => DefaultAvatar_default,
|
|
122
122
|
Field: () => Field_default,
|
|
123
|
+
FieldSet: () => FieldSet_default,
|
|
123
124
|
FormGroup: () => FormGroup_default,
|
|
124
125
|
H: () => H_default,
|
|
125
126
|
Handle: () => Handle_default,
|
|
@@ -144,7 +145,7 @@ var require_dist = __commonJS({
|
|
|
144
145
|
Tabs: () => Tabs_default,
|
|
145
146
|
Textarea: () => Textarea_default,
|
|
146
147
|
Toolbar: () => Toolbar_default,
|
|
147
|
-
cn: () =>
|
|
148
|
+
cn: () => cn13,
|
|
148
149
|
theme: () => theme_default
|
|
149
150
|
});
|
|
150
151
|
module2.exports = __toCommonJS2(src_exports2);
|
|
@@ -195,17 +196,17 @@ var require_dist = __commonJS({
|
|
|
195
196
|
}
|
|
196
197
|
};
|
|
197
198
|
var theme_default = theme;
|
|
198
|
-
var
|
|
199
|
-
function
|
|
199
|
+
var import_react30 = __toESM2(require("react"));
|
|
200
|
+
function cn13() {
|
|
200
201
|
return Array.from(arguments).filter(Boolean).map(String).join(" ");
|
|
201
202
|
}
|
|
202
|
-
var
|
|
203
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
203
204
|
var H5 = (_a) => {
|
|
204
205
|
var _b = _a, { size = "base", className = "" } = _b, props = __objRest2(_b, ["size", "className"]);
|
|
205
|
-
return /* @__PURE__ */ (0,
|
|
206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
206
207
|
"div",
|
|
207
208
|
__spreadValues2({
|
|
208
|
-
className:
|
|
209
|
+
className: cn13("r-reset", "r-heading", `r-fs-${size}`, className)
|
|
209
210
|
}, props)
|
|
210
211
|
);
|
|
211
212
|
};
|
|
@@ -214,11 +215,11 @@ var require_dist = __commonJS({
|
|
|
214
215
|
var import_jsx_runtime210 = require("react/jsx-runtime");
|
|
215
216
|
var P4 = (_a) => {
|
|
216
217
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
217
|
-
return /* @__PURE__ */ (0, import_jsx_runtime210.jsx)("div", __spreadValues2({ className:
|
|
218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime210.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-paragraph", className) }, props));
|
|
218
219
|
};
|
|
219
220
|
var P_default = P4;
|
|
220
|
-
var
|
|
221
|
-
var
|
|
221
|
+
var import_react32 = __toESM2(require("react"));
|
|
222
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
222
223
|
var Button5 = (_a) => {
|
|
223
224
|
var _b = _a, {
|
|
224
225
|
as = "button",
|
|
@@ -234,11 +235,11 @@ var require_dist = __commonJS({
|
|
|
234
235
|
"type"
|
|
235
236
|
]);
|
|
236
237
|
const Component2 = as;
|
|
237
|
-
return /* @__PURE__ */ (0,
|
|
238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
238
239
|
Component2,
|
|
239
240
|
__spreadValues2({
|
|
240
241
|
type,
|
|
241
|
-
className:
|
|
242
|
+
className: cn13(
|
|
242
243
|
"r-reset",
|
|
243
244
|
"r-reset-button",
|
|
244
245
|
"r-button",
|
|
@@ -260,14 +261,14 @@ var require_dist = __commonJS({
|
|
|
260
261
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
261
262
|
var TabsWrapper = (_a) => {
|
|
262
263
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
263
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", __spreadProps2(__spreadValues2({}, props), { className:
|
|
264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", __spreadProps2(__spreadValues2({}, props), { className: cn13("r-reset", "r-tab-wrapper", className) }));
|
|
264
265
|
};
|
|
265
266
|
var Tab = (_a) => {
|
|
266
267
|
var _b = _a, { active, className } = _b, props = __objRest2(_b, ["active", "className"]);
|
|
267
268
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
268
269
|
"button",
|
|
269
270
|
__spreadValues2({
|
|
270
|
-
className:
|
|
271
|
+
className: cn13(
|
|
271
272
|
`r-reset-button r-tab-button ${active ? "r-tab-button-active" : ""}`,
|
|
272
273
|
className
|
|
273
274
|
)
|
|
@@ -295,7 +296,7 @@ var require_dist = __commonJS({
|
|
|
295
296
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
296
297
|
var Input2 = (_a) => {
|
|
297
298
|
var _b = _a, { className } = _b, rest = __objRest2(_b, ["className"]);
|
|
298
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("input", __spreadValues2({ className:
|
|
299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("input", __spreadValues2({ className: cn13("r-reset", "r-input", className) }, rest));
|
|
299
300
|
};
|
|
300
301
|
var Input_default = Input2;
|
|
301
302
|
var import_react62 = __toESM2(require("react"));
|
|
@@ -305,7 +306,7 @@ var require_dist = __commonJS({
|
|
|
305
306
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
306
307
|
"textarea",
|
|
307
308
|
__spreadValues2({
|
|
308
|
-
className:
|
|
309
|
+
className: cn13("r-reset", "r-input r-textarea", className)
|
|
309
310
|
}, props)
|
|
310
311
|
);
|
|
311
312
|
};
|
|
@@ -314,16 +315,16 @@ var require_dist = __commonJS({
|
|
|
314
315
|
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
315
316
|
var Select2 = (_a) => {
|
|
316
317
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
317
|
-
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("select", __spreadValues2({ className:
|
|
318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("select", __spreadValues2({ className: cn13("r-reset", "r-input r-select", className) }, props));
|
|
318
319
|
};
|
|
319
320
|
var Select_default = Select2;
|
|
320
321
|
var import_react82 = __toESM2(require("react"));
|
|
321
322
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
322
|
-
var
|
|
323
|
+
var FormGroup6 = (_a) => {
|
|
323
324
|
var _b = _a, { type, className } = _b, props = __objRest2(_b, ["type", "className"]);
|
|
324
|
-
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", __spreadValues2({ className:
|
|
325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-form-group", className) }, props));
|
|
325
326
|
};
|
|
326
|
-
var FormGroup_default =
|
|
327
|
+
var FormGroup_default = FormGroup6;
|
|
327
328
|
var import_react92 = __toESM2(require("react"));
|
|
328
329
|
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
329
330
|
var Label4 = (_a) => {
|
|
@@ -331,7 +332,7 @@ var require_dist = __commonJS({
|
|
|
331
332
|
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
332
333
|
"label",
|
|
333
334
|
__spreadValues2({
|
|
334
|
-
className:
|
|
335
|
+
className: cn13("r-reset", "r-fs-small r-label", className)
|
|
335
336
|
}, props)
|
|
336
337
|
);
|
|
337
338
|
};
|
|
@@ -339,12 +340,12 @@ var require_dist = __commonJS({
|
|
|
339
340
|
var import_react112 = __toESM2(require("react"));
|
|
340
341
|
var import_react102 = __toESM2(require("react"));
|
|
341
342
|
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
342
|
-
var
|
|
343
|
+
var Hint5 = (_a) => {
|
|
343
344
|
var _b = _a, { type, className } = _b, props = __objRest2(_b, ["type", "className"]);
|
|
344
345
|
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
345
346
|
"div",
|
|
346
347
|
__spreadValues2({
|
|
347
|
-
className:
|
|
348
|
+
className: cn13(
|
|
348
349
|
"r-reset",
|
|
349
350
|
"r-fs-small r-hint",
|
|
350
351
|
className,
|
|
@@ -353,7 +354,7 @@ var require_dist = __commonJS({
|
|
|
353
354
|
}, props)
|
|
354
355
|
);
|
|
355
356
|
};
|
|
356
|
-
var Hint_default =
|
|
357
|
+
var Hint_default = Hint5;
|
|
357
358
|
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
358
359
|
var Field = (_a) => {
|
|
359
360
|
var _b = _a, {
|
|
@@ -395,7 +396,7 @@ var require_dist = __commonJS({
|
|
|
395
396
|
"div",
|
|
396
397
|
__spreadValues2({
|
|
397
398
|
style: { marginBottom: mb || 0 },
|
|
398
|
-
className:
|
|
399
|
+
className: cn13("r-reset", "r-toolbar", className)
|
|
399
400
|
}, props)
|
|
400
401
|
);
|
|
401
402
|
};
|
|
@@ -404,58 +405,58 @@ var require_dist = __commonJS({
|
|
|
404
405
|
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
405
406
|
var Stack = (_a) => {
|
|
406
407
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
407
|
-
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", __spreadValues2({ className:
|
|
408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", __spreadValues2({ className: cn13("r-stack", className) }, props));
|
|
408
409
|
};
|
|
409
410
|
var Stack_default = Stack;
|
|
410
411
|
var import_react142 = __toESM2(require("react"));
|
|
411
412
|
var import_jsx_runtime142 = require("react/jsx-runtime");
|
|
412
413
|
var Container2 = (_a) => {
|
|
413
414
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
414
|
-
return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", __spreadValues2({ className:
|
|
415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-container", className) }, props));
|
|
415
416
|
};
|
|
416
417
|
var Container_default = Container2;
|
|
417
418
|
var import_react152 = __toESM2(require("react"));
|
|
418
419
|
var import_jsx_runtime152 = require("react/jsx-runtime");
|
|
419
420
|
var Panel = (_a) => {
|
|
420
421
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
421
|
-
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", __spreadValues2({ className:
|
|
422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-panel", className) }, props));
|
|
422
423
|
};
|
|
423
424
|
var PanelTitle = (_a) => {
|
|
424
425
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
425
|
-
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", __spreadValues2({ className:
|
|
426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-panel-title", className) }, props));
|
|
426
427
|
};
|
|
427
428
|
var PanelContent = (_a) => {
|
|
428
429
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
429
|
-
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", __spreadValues2({ className:
|
|
430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", __spreadValues2({ className: cn13("r-panel-content", className) }, props));
|
|
430
431
|
};
|
|
431
432
|
var import_react162 = __toESM2(require("react"));
|
|
432
433
|
var import_jsx_runtime162 = require("react/jsx-runtime");
|
|
433
434
|
var Handle2 = (_a) => {
|
|
434
435
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
435
|
-
return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("div", __spreadValues2({ className:
|
|
436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-drag-handle", className) }, props));
|
|
436
437
|
};
|
|
437
438
|
var Handle_default = Handle2;
|
|
438
439
|
var import_react172 = __toESM2(require("react"));
|
|
439
440
|
var import_jsx_runtime172 = require("react/jsx-runtime");
|
|
440
441
|
var Overlay = (_a) => {
|
|
441
442
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
442
|
-
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", __spreadValues2({ className:
|
|
443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-modal-overlay", className) }, props));
|
|
443
444
|
};
|
|
444
445
|
var Wrapper = (_a) => {
|
|
445
446
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
446
|
-
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", __spreadValues2({ className:
|
|
447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-modal", className) }, props));
|
|
447
448
|
};
|
|
448
449
|
var Inner = (_a) => {
|
|
449
450
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
450
|
-
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", __spreadValues2({ className:
|
|
451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-modal-inner", className) }, props));
|
|
451
452
|
};
|
|
452
453
|
var TitleBar2 = (_a) => {
|
|
453
454
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
454
|
-
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", __spreadValues2({ className:
|
|
455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-modal-title-bar", className) }, props));
|
|
455
456
|
};
|
|
456
457
|
var Title2 = (_a) => {
|
|
457
458
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
458
|
-
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", __spreadValues2({ className:
|
|
459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-modal-title", className) }, props));
|
|
459
460
|
};
|
|
460
461
|
var CloseButton = (_a) => {
|
|
461
462
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
@@ -463,17 +464,17 @@ var require_dist = __commonJS({
|
|
|
463
464
|
"button",
|
|
464
465
|
__spreadValues2({
|
|
465
466
|
type: "button",
|
|
466
|
-
className:
|
|
467
|
+
className: cn13("r-reset-button r-modal-close-btn", className)
|
|
467
468
|
}, props)
|
|
468
469
|
);
|
|
469
470
|
};
|
|
470
471
|
var FooterBar = (_a) => {
|
|
471
472
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
472
|
-
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", __spreadValues2({ className:
|
|
473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-modal-footer-bar", className) }, props));
|
|
473
474
|
};
|
|
474
475
|
var Content = (_a) => {
|
|
475
476
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
476
|
-
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", __spreadValues2({ className:
|
|
477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-modal-content", className) }, props));
|
|
477
478
|
};
|
|
478
479
|
function checkForChanges2(hasChanges, onClose) {
|
|
479
480
|
if (!hasChanges) {
|
|
@@ -527,7 +528,7 @@ var require_dist = __commonJS({
|
|
|
527
528
|
var import_jsx_runtime182 = require("react/jsx-runtime");
|
|
528
529
|
var Wrapper2 = (_a) => {
|
|
529
530
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
530
|
-
return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)("div", __spreadValues2({ className:
|
|
531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)("div", __spreadValues2({ className: cn13("r-reset", className) }, props));
|
|
531
532
|
};
|
|
532
533
|
var DataGrid = ({ list, header, row }) => /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(Wrapper2, { children: /* @__PURE__ */ (0, import_jsx_runtime182.jsxs)("table", { className: "r-table", children: [
|
|
533
534
|
/* @__PURE__ */ (0, import_jsx_runtime182.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime182.jsx)("tr", { children: header() }) }),
|
|
@@ -552,7 +553,7 @@ var require_dist = __commonJS({
|
|
|
552
553
|
style: {
|
|
553
554
|
gridColumn: getShift(s) || "2 / span 10"
|
|
554
555
|
},
|
|
555
|
-
className:
|
|
556
|
+
className: cn13("r-reset", className)
|
|
556
557
|
}, props)
|
|
557
558
|
);
|
|
558
559
|
};
|
|
@@ -564,7 +565,7 @@ var require_dist = __commonJS({
|
|
|
564
565
|
style: {
|
|
565
566
|
gridColumn: `span ${s || "12"}`
|
|
566
567
|
},
|
|
567
|
-
className:
|
|
568
|
+
className: cn13("r-reset", className)
|
|
568
569
|
}, props)
|
|
569
570
|
);
|
|
570
571
|
};
|
|
@@ -577,7 +578,7 @@ var require_dist = __commonJS({
|
|
|
577
578
|
columnGap: gutter || "1em",
|
|
578
579
|
rowGap: gutter || "1em"
|
|
579
580
|
},
|
|
580
|
-
className:
|
|
581
|
+
className: cn13("r-reset", "r-row", className)
|
|
581
582
|
}, props)
|
|
582
583
|
);
|
|
583
584
|
};
|
|
@@ -585,14 +586,14 @@ var require_dist = __commonJS({
|
|
|
585
586
|
var import_jsx_runtime202 = require("react/jsx-runtime");
|
|
586
587
|
var Navigation = (_a) => {
|
|
587
588
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
588
|
-
return /* @__PURE__ */ (0, import_jsx_runtime202.jsx)("div", __spreadValues2({ className:
|
|
589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime202.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-navigation", className) }, props));
|
|
589
590
|
};
|
|
590
591
|
var NavItem2 = (_a) => {
|
|
591
592
|
var _b = _a, { active, className } = _b, props = __objRest2(_b, ["active", "className"]);
|
|
592
593
|
return /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
593
594
|
"div",
|
|
594
595
|
__spreadValues2({
|
|
595
|
-
className:
|
|
596
|
+
className: cn13(
|
|
596
597
|
"r-reset",
|
|
597
598
|
"r-navigation-item",
|
|
598
599
|
active ? "r-navigation-item-active" : "",
|
|
@@ -605,7 +606,7 @@ var require_dist = __commonJS({
|
|
|
605
606
|
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
606
607
|
var Wrapper3 = (_a) => {
|
|
607
608
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
608
|
-
return /* @__PURE__ */ (0, import_jsx_runtime212.jsx)("div", __spreadValues2({ className:
|
|
609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime212.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-page-title", className) }, props));
|
|
609
610
|
};
|
|
610
611
|
var PageTitle = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(Wrapper3, { children: /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
611
612
|
H_default,
|
|
@@ -621,7 +622,7 @@ var require_dist = __commonJS({
|
|
|
621
622
|
var import_jsx_runtime222 = require("react/jsx-runtime");
|
|
622
623
|
var Wrapper4 = (_a) => {
|
|
623
624
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
624
|
-
return /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", __spreadValues2({ className:
|
|
625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-pagination", className) }, props));
|
|
625
626
|
};
|
|
626
627
|
var Prev = ({ LinkComponent, router, currentPage }) => {
|
|
627
628
|
if (currentPage === 1) {
|
|
@@ -702,26 +703,26 @@ var require_dist = __commonJS({
|
|
|
702
703
|
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
703
704
|
var LanguageSwitcherWrapper2 = (_a) => {
|
|
704
705
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
705
|
-
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)("div", __spreadValues2({ className:
|
|
706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-language-switcher", className) }, props));
|
|
706
707
|
};
|
|
707
708
|
var LanguageSwitcherMenu2 = (_a) => {
|
|
708
709
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
709
|
-
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)("div", __spreadValues2({ className:
|
|
710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-language-menu", className) }, props));
|
|
710
711
|
};
|
|
711
712
|
var LanguageSwitcherItem2 = (_a) => {
|
|
712
713
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
713
|
-
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)("div", __spreadValues2({ className:
|
|
714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-language-item", className) }, props));
|
|
714
715
|
};
|
|
715
716
|
var LanguageSwitcherNewItem2 = (_a) => {
|
|
716
717
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
717
|
-
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)("div", __spreadValues2({ className:
|
|
718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)("div", __spreadValues2({ className: cn13("r-reset", "r-language-new-item", className) }, props));
|
|
718
719
|
};
|
|
719
720
|
var LanguageSwitcherCurrent2 = (_a) => {
|
|
720
721
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
721
722
|
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
722
723
|
"div",
|
|
723
724
|
__spreadValues2({
|
|
724
|
-
className:
|
|
725
|
+
className: cn13("r-reset", "r-language-current-item", className)
|
|
725
726
|
}, props)
|
|
726
727
|
);
|
|
727
728
|
};
|
|
@@ -759,7 +760,7 @@ var require_dist = __commonJS({
|
|
|
759
760
|
width: size || "2.5rem",
|
|
760
761
|
height: size || "2.5rem"
|
|
761
762
|
},
|
|
762
|
-
className:
|
|
763
|
+
className: cn13("r-reset", "r-image-avatar", className)
|
|
763
764
|
}, props)
|
|
764
765
|
);
|
|
765
766
|
};
|
|
@@ -798,7 +799,7 @@ var require_dist = __commonJS({
|
|
|
798
799
|
fontSize: `calc(${size} * 0.4)`,
|
|
799
800
|
backgroundColor: initialsToColor(initials, AVATAR_COLORS)
|
|
800
801
|
},
|
|
801
|
-
className:
|
|
802
|
+
className: cn13("r-reset", "r-default-avatar", className)
|
|
802
803
|
}, props)
|
|
803
804
|
);
|
|
804
805
|
};
|
|
@@ -850,6 +851,16 @@ var require_dist = __commonJS({
|
|
|
850
851
|
/* @__PURE__ */ (0, import_jsx_runtime262.jsx)(CategoriesHiddenMenu, { paths })
|
|
851
852
|
] });
|
|
852
853
|
var CategoriesMenu_default = CategoriesMenu;
|
|
854
|
+
var import_react272 = __toESM2(require("react"));
|
|
855
|
+
var import_jsx_runtime272 = require("react/jsx-runtime");
|
|
856
|
+
var FieldSet2 = (_a) => {
|
|
857
|
+
var _b = _a, { legend, children, className } = _b, props = __objRest2(_b, ["legend", "children", "className"]);
|
|
858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)("fieldset", __spreadProps2(__spreadValues2({ className: cn13("r-reset", "r-fieldset", className) }, props), { children: [
|
|
859
|
+
legend && /* @__PURE__ */ (0, import_jsx_runtime272.jsx)("legend", { className: cn13("r-reset", "r-legend", "r-fs-small"), children: legend }),
|
|
860
|
+
children
|
|
861
|
+
] }));
|
|
862
|
+
};
|
|
863
|
+
var FieldSet_default = FieldSet2;
|
|
853
864
|
}
|
|
854
865
|
});
|
|
855
866
|
|
|
@@ -6421,8 +6432,8 @@ var require_dist2 = __commonJS({
|
|
|
6421
6432
|
toHTML: () => toHTML_default
|
|
6422
6433
|
});
|
|
6423
6434
|
module2.exports = __toCommonJS2(src_exports2);
|
|
6424
|
-
var
|
|
6425
|
-
var
|
|
6435
|
+
var import_react30 = __toESM2(require("react"));
|
|
6436
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
6426
6437
|
var getWebp2 = (url) => {
|
|
6427
6438
|
if (!url)
|
|
6428
6439
|
return null;
|
|
@@ -6497,10 +6508,10 @@ var require_dist2 = __commonJS({
|
|
|
6497
6508
|
const [width, height] = getDimensions2(imageObjOrSrc, variant);
|
|
6498
6509
|
const altAttr = alt || getAlt2(src);
|
|
6499
6510
|
const [webp, fallback] = getSrc2(imageObjOrSrc, variant);
|
|
6500
|
-
return /* @__PURE__ */ (0,
|
|
6501
|
-
webp && /* @__PURE__ */ (0,
|
|
6502
|
-
/* @__PURE__ */ (0,
|
|
6503
|
-
/* @__PURE__ */ (0,
|
|
6511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("picture", { children: [
|
|
6512
|
+
webp && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("source", { srcSet: encodeURI(webp), type: "image/webp" }),
|
|
6513
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("source", { srcSet: encodeURI(fallback), type: src.mime_type }),
|
|
6514
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6504
6515
|
"img",
|
|
6505
6516
|
__spreadValues2({
|
|
6506
6517
|
src: fallback,
|
|
@@ -6537,9 +6548,9 @@ var require_dist2 = __commonJS({
|
|
|
6537
6548
|
return /* @__PURE__ */ (0, import_jsx_runtime210.jsx)("div", { id: containerID, className: cssClasses, children });
|
|
6538
6549
|
};
|
|
6539
6550
|
var Container_default = Container2;
|
|
6540
|
-
var
|
|
6541
|
-
var
|
|
6542
|
-
var VimeoEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0,
|
|
6551
|
+
var import_react32 = __toESM2(require("react"));
|
|
6552
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
6553
|
+
var VimeoEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6543
6554
|
"iframe",
|
|
6544
6555
|
{
|
|
6545
6556
|
frameBorder: "0",
|
|
@@ -6549,7 +6560,7 @@ var require_dist2 = __commonJS({
|
|
|
6549
6560
|
allow: "autoplay"
|
|
6550
6561
|
}
|
|
6551
6562
|
);
|
|
6552
|
-
var YoukuEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0,
|
|
6563
|
+
var YoukuEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6553
6564
|
"iframe",
|
|
6554
6565
|
{
|
|
6555
6566
|
height: "0",
|
|
@@ -6561,7 +6572,7 @@ var require_dist2 = __commonJS({
|
|
|
6561
6572
|
allow: "autoplay"
|
|
6562
6573
|
}
|
|
6563
6574
|
);
|
|
6564
|
-
var YouTubeEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0,
|
|
6575
|
+
var YouTubeEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6565
6576
|
"iframe",
|
|
6566
6577
|
{
|
|
6567
6578
|
frameBorder: "0",
|
|
@@ -6571,7 +6582,7 @@ var require_dist2 = __commonJS({
|
|
|
6571
6582
|
allow: "autoplay"
|
|
6572
6583
|
}
|
|
6573
6584
|
);
|
|
6574
|
-
var YouTubeNoCookieEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0,
|
|
6585
|
+
var YouTubeNoCookieEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6575
6586
|
"iframe",
|
|
6576
6587
|
{
|
|
6577
6588
|
frameBorder: "0",
|
|
@@ -6581,7 +6592,7 @@ var require_dist2 = __commonJS({
|
|
|
6581
6592
|
allow: "autoplay"
|
|
6582
6593
|
}
|
|
6583
6594
|
);
|
|
6584
|
-
var WistiaEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0,
|
|
6595
|
+
var WistiaEmbed = ({ videoId: videoId2, autoplay }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6585
6596
|
"iframe",
|
|
6586
6597
|
{
|
|
6587
6598
|
frameBorder: "0",
|
|
@@ -6666,7 +6677,7 @@ var require_dist2 = __commonJS({
|
|
|
6666
6677
|
const vId = videoId(videoUrl);
|
|
6667
6678
|
const VideoComponent = VideoComponentType(vType, noCookieDomains);
|
|
6668
6679
|
if (VideoComponent) {
|
|
6669
|
-
return /* @__PURE__ */ (0,
|
|
6680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(VideoComponent, { videoId: vId, autoplay });
|
|
6670
6681
|
}
|
|
6671
6682
|
return null;
|
|
6672
6683
|
};
|
|
@@ -6731,19 +6742,19 @@ var require_dist2 = __commonJS({
|
|
|
6731
6742
|
);
|
|
6732
6743
|
var IconButton_default2 = IconButton2;
|
|
6733
6744
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
6734
|
-
function
|
|
6745
|
+
function cn13() {
|
|
6735
6746
|
return Array.from(arguments).filter(Boolean).map(String).join(" ");
|
|
6736
6747
|
}
|
|
6737
6748
|
var AdminWidgetWrapper2 = (_a) => {
|
|
6738
6749
|
var _b = _a, { className } = _b, rest = __objRest2(_b, ["className"]);
|
|
6739
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", __spreadValues2({ className:
|
|
6750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", __spreadValues2({ className: cn13("r-admin-widget-wrapper", className) }, rest));
|
|
6740
6751
|
};
|
|
6741
6752
|
var AdminWidgetToolbar2 = (_a) => {
|
|
6742
6753
|
var _b = _a, { className } = _b, rest = __objRest2(_b, ["className"]);
|
|
6743
6754
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6744
6755
|
"div",
|
|
6745
6756
|
__spreadValues2({
|
|
6746
|
-
className:
|
|
6757
|
+
className: cn13("r-reset", "r-admin-widget-toolbar", className)
|
|
6747
6758
|
}, rest)
|
|
6748
6759
|
);
|
|
6749
6760
|
};
|
|
@@ -6752,7 +6763,7 @@ var require_dist2 = __commonJS({
|
|
|
6752
6763
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6753
6764
|
"div",
|
|
6754
6765
|
__spreadValues2({
|
|
6755
|
-
className:
|
|
6766
|
+
className: cn13("r-reset", "r-fs-small", "r-admin-widget-label", className)
|
|
6756
6767
|
}, rest)
|
|
6757
6768
|
);
|
|
6758
6769
|
};
|
|
@@ -6777,7 +6788,7 @@ var require_dist2 = __commonJS({
|
|
|
6777
6788
|
const isSelected = selectedWidgets.filter((w) => w === widget.widgetId).length > 0;
|
|
6778
6789
|
if (!currentWidget || !currentAdminWidget) {
|
|
6779
6790
|
console.error(`Unknown widget: ${widget.component}`);
|
|
6780
|
-
return
|
|
6791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(AdminWidgetWrapper2, { "data-widget": widget.component, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: cn13("r-reset", "r-fs-large", "r-admin-missing-widget"), children: `Unknown widget: ${widget.component}` }) });
|
|
6781
6792
|
}
|
|
6782
6793
|
const handleCopyWidget = () => {
|
|
6783
6794
|
const widgetsToCopy = [widget];
|
|
@@ -6944,32 +6955,29 @@ var require_dist2 = __commonJS({
|
|
|
6944
6955
|
// src/index.js
|
|
6945
6956
|
var src_exports = {};
|
|
6946
6957
|
__export(src_exports, {
|
|
6958
|
+
AdminForm: () => AdminForm_default,
|
|
6947
6959
|
BuilderContext: () => BuilderContext_default,
|
|
6948
6960
|
Button: () => Button_default,
|
|
6949
6961
|
ButtonSettings: () => ButtonSettings_default,
|
|
6950
6962
|
Dialog: () => Dialog_default,
|
|
6951
|
-
FormGroup: () =>
|
|
6952
|
-
ImageInput: () => ImageInput_default,
|
|
6953
|
-
ImagePicker: () => ImagePicker_default,
|
|
6963
|
+
FormGroup: () => import_ui20.FormGroup,
|
|
6954
6964
|
Img: () => Image_default,
|
|
6955
|
-
Label: () =>
|
|
6965
|
+
Label: () => import_ui20.Label,
|
|
6956
6966
|
Link: () => Link_default,
|
|
6957
6967
|
LinkSettings: () => LinkSettings_default,
|
|
6958
6968
|
List: () => List_default,
|
|
6959
6969
|
ListInput: () => ListInput_default,
|
|
6960
6970
|
MediaManager: () => MediaManager,
|
|
6961
6971
|
PageBuilder: () => PageBuilder_default,
|
|
6962
|
-
RichText: () => RichText_default,
|
|
6963
6972
|
SelectMenu: () => SelectMenu_default,
|
|
6964
6973
|
TextArea: () => TextArea_default,
|
|
6965
6974
|
TextInput: () => TextInput_default
|
|
6966
6975
|
});
|
|
6967
6976
|
module.exports = __toCommonJS(src_exports);
|
|
6968
|
-
var
|
|
6969
|
-
var import_ui18 = __toESM(require_dist());
|
|
6977
|
+
var import_ui20 = __toESM(require_dist());
|
|
6970
6978
|
|
|
6971
6979
|
// src/PageBuilder.js
|
|
6972
|
-
var
|
|
6980
|
+
var import_react25 = __toESM(require("react"));
|
|
6973
6981
|
|
|
6974
6982
|
// src/lists/index.js
|
|
6975
6983
|
var add = (items, item) => [...items, item];
|
|
@@ -7015,7 +7023,7 @@ var LibraryContext_default = LibraryContext;
|
|
|
7015
7023
|
// src/Canvas.js
|
|
7016
7024
|
var import_react6 = __toESM(require("react"));
|
|
7017
7025
|
var import_react_sortablejs = require("react-sortablejs");
|
|
7018
|
-
var
|
|
7026
|
+
var import_ui5 = __toESM(require_dist());
|
|
7019
7027
|
|
|
7020
7028
|
// src/lib/AdminWidget.js
|
|
7021
7029
|
var import_react4 = __toESM(require("react"));
|
|
@@ -7131,6 +7139,7 @@ var widgetData_default = widgetData;
|
|
|
7131
7139
|
|
|
7132
7140
|
// src/lib/AdminWidget.js
|
|
7133
7141
|
var import_support = __toESM(require_dist2());
|
|
7142
|
+
var import_ui4 = __toESM(require_dist());
|
|
7134
7143
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
7135
7144
|
var AdminWidget = ({
|
|
7136
7145
|
library,
|
|
@@ -7146,10 +7155,6 @@ var AdminWidget = ({
|
|
|
7146
7155
|
const currentWidget = library[widget.component];
|
|
7147
7156
|
const currentAdminWidget = adminLibrary[widget.component];
|
|
7148
7157
|
const containerSettings = ((_a = widget == null ? void 0 : widget.settings) == null ? void 0 : _a.containerSettings) || {};
|
|
7149
|
-
if (!currentWidget || !currentAdminWidget) {
|
|
7150
|
-
console.error(`Unknown widget: ${widget.component}`);
|
|
7151
|
-
return null;
|
|
7152
|
-
}
|
|
7153
7158
|
const isSelected = selectedWidgets.filter((w) => w === widget.widgetId).length > 0;
|
|
7154
7159
|
const handleSelectWidget = () => onSelectWidget(widget.widgetId);
|
|
7155
7160
|
const handleDeleteWidget = () => {
|
|
@@ -7161,6 +7166,20 @@ var AdminWidget = ({
|
|
|
7161
7166
|
const widgetsToCopy = [widget];
|
|
7162
7167
|
onCopy(widgetsToCopy);
|
|
7163
7168
|
};
|
|
7169
|
+
if (!currentWidget || !currentAdminWidget) {
|
|
7170
|
+
console.error(`Unknown widget: ${widget.component}`);
|
|
7171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(AdminWidgetWrapper_default, { "data-widget": widget.component, children: [
|
|
7172
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AdminWidgetToolbar_default, { "data-toolbar": true, children: !isSelected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
7173
|
+
IconButton_default,
|
|
7174
|
+
{
|
|
7175
|
+
icon: "iconDelete",
|
|
7176
|
+
type: "danger",
|
|
7177
|
+
onClick: () => handleDeleteWidget(widget.widgetId)
|
|
7178
|
+
}
|
|
7179
|
+
) }),
|
|
7180
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_ui4.cn)("r-reset", "r-fs-large", "r-admin-missing-widget"), children: `Unknown widget: ${widget.component}` })
|
|
7181
|
+
] });
|
|
7182
|
+
}
|
|
7164
7183
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(AdminWidgetWrapper_default, { "data-widget": widget.component, children: [
|
|
7165
7184
|
isSelected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "r-selected-widget" }),
|
|
7166
7185
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(AdminWidgetToolbar_default, { "data-toolbar": true, children: [
|
|
@@ -7245,7 +7264,7 @@ var ErrorBoundary_default2 = ErrorBoundary_default;
|
|
|
7245
7264
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
7246
7265
|
var EmptyCanvas = (_a) => {
|
|
7247
7266
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
7248
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", __spreadValues({ className: (0,
|
|
7267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", __spreadValues({ className: (0, import_ui5.cn)("r-reset", "r-empty-canvas", className) }, rest));
|
|
7249
7268
|
};
|
|
7250
7269
|
var Canvas = import_react6.default.memo(
|
|
7251
7270
|
function Canvas2({
|
|
@@ -7261,8 +7280,8 @@ var Canvas = import_react6.default.memo(
|
|
|
7261
7280
|
const { library, adminLibrary } = import_react6.default.useContext(LibraryContext_default);
|
|
7262
7281
|
if (widgets.length === 0) {
|
|
7263
7282
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(EmptyCanvas, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
|
|
7264
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
7265
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
7283
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ui5.H, { size: "xxlarge", children: "It's always good to start with a clean slate." }),
|
|
7284
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ui5.P, { children: "Use the sidebar to add content." })
|
|
7266
7285
|
] }) });
|
|
7267
7286
|
}
|
|
7268
7287
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -7302,22 +7321,22 @@ var Canvas_default = Canvas;
|
|
|
7302
7321
|
|
|
7303
7322
|
// src/lib/AdminSidebar.js
|
|
7304
7323
|
var import_react10 = __toESM(require("react"));
|
|
7305
|
-
var
|
|
7324
|
+
var import_ui10 = __toESM(require_dist());
|
|
7306
7325
|
|
|
7307
7326
|
// src/lib/SideNav.js
|
|
7308
7327
|
var import_react7 = __toESM(require("react"));
|
|
7309
|
-
var
|
|
7328
|
+
var import_ui6 = __toESM(require_dist());
|
|
7310
7329
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
7311
7330
|
var SideNav = (_a) => {
|
|
7312
7331
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7313
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", __spreadValues({ className: (0,
|
|
7332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", __spreadValues({ className: (0, import_ui6.cn)("r-reset", "r-admin-sidenav", className) }, props));
|
|
7314
7333
|
};
|
|
7315
7334
|
var NavGroup = (_a) => {
|
|
7316
7335
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7317
7336
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
7318
7337
|
"div",
|
|
7319
7338
|
__spreadValues({
|
|
7320
|
-
className: (0,
|
|
7339
|
+
className: (0, import_ui6.cn)("r-reset", "r-admin-sidenav-group", className)
|
|
7321
7340
|
}, props)
|
|
7322
7341
|
);
|
|
7323
7342
|
};
|
|
@@ -7326,7 +7345,7 @@ var NavItem = (_a) => {
|
|
|
7326
7345
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
7327
7346
|
"div",
|
|
7328
7347
|
__spreadValues({
|
|
7329
|
-
className: (0,
|
|
7348
|
+
className: (0, import_ui6.cn)("r-reset", "r-admin-sidenav-item", className)
|
|
7330
7349
|
}, props)
|
|
7331
7350
|
);
|
|
7332
7351
|
};
|
|
@@ -7348,7 +7367,7 @@ var NavButtonStyle = (_a) => {
|
|
|
7348
7367
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
7349
7368
|
"div",
|
|
7350
7369
|
__spreadValues({
|
|
7351
|
-
className: (0,
|
|
7370
|
+
className: (0, import_ui6.cn)(
|
|
7352
7371
|
"r-reset",
|
|
7353
7372
|
"r-reset-button",
|
|
7354
7373
|
"r-fs-medium",
|
|
@@ -7369,7 +7388,7 @@ var TooltipWrapper = (_a) => {
|
|
|
7369
7388
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
7370
7389
|
"div",
|
|
7371
7390
|
__spreadValues({
|
|
7372
|
-
className: (0,
|
|
7391
|
+
className: (0, import_ui6.cn)("r-reset", "r-admin-sidenav-tooltip-wrapper", className)
|
|
7373
7392
|
}, props)
|
|
7374
7393
|
);
|
|
7375
7394
|
};
|
|
@@ -7378,7 +7397,7 @@ var Tooltip = (_a) => {
|
|
|
7378
7397
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
7379
7398
|
"div",
|
|
7380
7399
|
__spreadValues({
|
|
7381
|
-
className: (0,
|
|
7400
|
+
className: (0, import_ui6.cn)("r-reset", "r-admin-sidenav-tooltip", className)
|
|
7382
7401
|
}, props)
|
|
7383
7402
|
);
|
|
7384
7403
|
};
|
|
@@ -7394,7 +7413,7 @@ var NavPanel = (_a) => {
|
|
|
7394
7413
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
7395
7414
|
"div",
|
|
7396
7415
|
__spreadValues({
|
|
7397
|
-
className: (0,
|
|
7416
|
+
className: (0, import_ui6.cn)("r-reset", "r-admin-sidenav-nav-panel", className)
|
|
7398
7417
|
}, props)
|
|
7399
7418
|
);
|
|
7400
7419
|
};
|
|
@@ -7403,7 +7422,7 @@ var SideNavSearchWrapper = (_a) => {
|
|
|
7403
7422
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
7404
7423
|
"div",
|
|
7405
7424
|
__spreadValues({
|
|
7406
|
-
className: (0,
|
|
7425
|
+
className: (0, import_ui6.cn)(
|
|
7407
7426
|
"r-reset",
|
|
7408
7427
|
"r-fs-medium",
|
|
7409
7428
|
"r-admin-sidenav-search-wrapper",
|
|
@@ -7415,14 +7434,14 @@ var SideNavSearchWrapper = (_a) => {
|
|
|
7415
7434
|
|
|
7416
7435
|
// src/lib/LanguageSwitcher.js
|
|
7417
7436
|
var import_react8 = __toESM(require("react"));
|
|
7418
|
-
var
|
|
7437
|
+
var import_ui7 = __toESM(require_dist());
|
|
7419
7438
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
7420
7439
|
var LanguageSwitcherWrapper = (_a) => {
|
|
7421
7440
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7422
7441
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
7423
7442
|
"div",
|
|
7424
7443
|
__spreadValues({
|
|
7425
|
-
className: (0,
|
|
7444
|
+
className: (0, import_ui7.cn)("r-reset", "r-admin-language-switcher", className)
|
|
7426
7445
|
}, props)
|
|
7427
7446
|
);
|
|
7428
7447
|
};
|
|
@@ -7431,7 +7450,7 @@ var LanguageSwitcherMenu = (_a) => {
|
|
|
7431
7450
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
7432
7451
|
"div",
|
|
7433
7452
|
__spreadValues({
|
|
7434
|
-
className: (0,
|
|
7453
|
+
className: (0, import_ui7.cn)("r-reset", "r-admin-language-switcher-menu", className)
|
|
7435
7454
|
}, props)
|
|
7436
7455
|
);
|
|
7437
7456
|
};
|
|
@@ -7440,7 +7459,7 @@ var LanguageSwitcherItem = (_a) => {
|
|
|
7440
7459
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
7441
7460
|
"div",
|
|
7442
7461
|
__spreadValues({
|
|
7443
|
-
className: (0,
|
|
7462
|
+
className: (0, import_ui7.cn)(
|
|
7444
7463
|
"r-reset",
|
|
7445
7464
|
"r-fs-medium r-admin-language-switcher-item",
|
|
7446
7465
|
className
|
|
@@ -7453,7 +7472,7 @@ var LanguageSwitcherNewItem = (_a) => {
|
|
|
7453
7472
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
7454
7473
|
"div",
|
|
7455
7474
|
__spreadValues({
|
|
7456
|
-
className: (0,
|
|
7475
|
+
className: (0, import_ui7.cn)(
|
|
7457
7476
|
"r-reset",
|
|
7458
7477
|
"r-fs-medium r-admin-language-switcher-new-item",
|
|
7459
7478
|
className
|
|
@@ -7466,7 +7485,7 @@ var LanguageSwitcherCurrent = (_a) => {
|
|
|
7466
7485
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
7467
7486
|
"div",
|
|
7468
7487
|
__spreadValues({
|
|
7469
|
-
className: (0,
|
|
7488
|
+
className: (0, import_ui7.cn)(
|
|
7470
7489
|
"r-reset",
|
|
7471
7490
|
"r-fs-medium r-admin-language-switcher-current",
|
|
7472
7491
|
className
|
|
@@ -7498,14 +7517,14 @@ var LanguageSwitcher = ({ current, navigation }) => {
|
|
|
7498
7517
|
var LanguageSwitcher_default = LanguageSwitcher;
|
|
7499
7518
|
|
|
7500
7519
|
// src/lib/SidebarItem.js
|
|
7501
|
-
var
|
|
7520
|
+
var import_ui8 = __toESM(require_dist());
|
|
7502
7521
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
7503
7522
|
var SidebarItem = (_a) => {
|
|
7504
7523
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7505
7524
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
7506
7525
|
"div",
|
|
7507
7526
|
__spreadValues({
|
|
7508
|
-
className: (0,
|
|
7527
|
+
className: (0, import_ui8.cn)(
|
|
7509
7528
|
"r-reset",
|
|
7510
7529
|
"r-reset-button",
|
|
7511
7530
|
"r-fs-base",
|
|
@@ -7518,7 +7537,7 @@ var SidebarItem = (_a) => {
|
|
|
7518
7537
|
|
|
7519
7538
|
// src/forms/TextInput.js
|
|
7520
7539
|
var import_react9 = __toESM(require("react"));
|
|
7521
|
-
var
|
|
7540
|
+
var import_ui9 = __toESM(require_dist());
|
|
7522
7541
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
7523
7542
|
var TextField = (_a) => {
|
|
7524
7543
|
var _b = _a, {
|
|
@@ -7539,9 +7558,9 @@ var TextField = (_a) => {
|
|
|
7539
7558
|
"placeholder"
|
|
7540
7559
|
]);
|
|
7541
7560
|
const id = randomString();
|
|
7542
|
-
const Component2 = multiline ?
|
|
7543
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
7544
|
-
label ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
7561
|
+
const Component2 = multiline ? import_ui9.Textarea : import_ui9.Input;
|
|
7562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_ui9.FormGroup, { children: [
|
|
7563
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ui9.Label, { htmlFor: id, error, children: label }) : "",
|
|
7545
7564
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
7546
7565
|
Component2,
|
|
7547
7566
|
__spreadValues({
|
|
@@ -7551,7 +7570,7 @@ var TextField = (_a) => {
|
|
|
7551
7570
|
placeholder
|
|
7552
7571
|
}, rest)
|
|
7553
7572
|
),
|
|
7554
|
-
hint ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
7573
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ui9.Hint, { children: hint }) : ""
|
|
7555
7574
|
] });
|
|
7556
7575
|
};
|
|
7557
7576
|
var TextInput = (props) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TextField, __spreadValues({}, props));
|
|
@@ -7598,7 +7617,7 @@ var WidgetsList = ({ library, onAddWidget }) => {
|
|
|
7598
7617
|
}
|
|
7599
7618
|
) }),
|
|
7600
7619
|
widgetsCategories.map((categoryName, idx) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { marginBottom: "25px" }, children: [
|
|
7601
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
7620
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_ui10.H, { size: "medium", style: { color: "#fff" }, children: categoryName }),
|
|
7602
7621
|
widgets.filter(
|
|
7603
7622
|
(widgetName) => widgetData_default.category(library[widgetName]) === categoryName
|
|
7604
7623
|
).map((widgetName) => ({
|
|
@@ -7635,7 +7654,7 @@ var AdminSidebar = ({
|
|
|
7635
7654
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(NavItem, { children: [
|
|
7636
7655
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(NavButton, { icon: ICONS.add }),
|
|
7637
7656
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(NavPanel, { children: [
|
|
7638
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
7657
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_ui10.H, { size: "large", style: { color: "#fff" }, children: "Library" }),
|
|
7639
7658
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WidgetsList, { library: adminLibrary, onAddWidget })
|
|
7640
7659
|
] })
|
|
7641
7660
|
] }),
|
|
@@ -7699,11 +7718,11 @@ var AdminSidebar_default = AdminSidebar;
|
|
|
7699
7718
|
// src/dialogs/ReorderDialog.js
|
|
7700
7719
|
var import_react13 = __toESM(require("react"));
|
|
7701
7720
|
var import_react_sortablejs2 = require("react-sortablejs");
|
|
7702
|
-
var
|
|
7721
|
+
var import_ui12 = __toESM(require_dist());
|
|
7703
7722
|
|
|
7704
7723
|
// src/dialogs/Dialog.js
|
|
7705
7724
|
var import_react11 = __toESM(require("react"));
|
|
7706
|
-
var
|
|
7725
|
+
var import_ui11 = __toESM(require_dist());
|
|
7707
7726
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
7708
7727
|
function checkForChanges(hasChanges, onClose) {
|
|
7709
7728
|
if (!hasChanges) {
|
|
@@ -7726,16 +7745,16 @@ var Dialog = ({
|
|
|
7726
7745
|
onPrimary,
|
|
7727
7746
|
areChanges
|
|
7728
7747
|
}) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
7729
|
-
|
|
7748
|
+
import_ui11.Modal,
|
|
7730
7749
|
{
|
|
7731
7750
|
open,
|
|
7732
7751
|
title: title2,
|
|
7733
7752
|
onClose,
|
|
7734
7753
|
areChanges,
|
|
7735
7754
|
FooterContent: () => (primaryLabel || secondaryLabel) && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
7736
|
-
primaryLabel && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
7755
|
+
primaryLabel && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_ui11.Button, { type: "button", variant: "primary", onClick: onPrimary, children: primaryLabel }),
|
|
7737
7756
|
secondaryLabel && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
7738
|
-
|
|
7757
|
+
import_ui11.Button,
|
|
7739
7758
|
{
|
|
7740
7759
|
type: "button",
|
|
7741
7760
|
variant: "secondary",
|
|
@@ -7814,7 +7833,7 @@ var ModalSelectedWidgetsToolbar_default = ModalSelectedWidgetsToolbar;
|
|
|
7814
7833
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
7815
7834
|
var ReorderDialogItem = (_a) => {
|
|
7816
7835
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
7817
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", __spreadValues({ className: (0,
|
|
7836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", __spreadValues({ className: (0, import_ui12.cn)("r-reorder-dialog-item", className) }, props));
|
|
7818
7837
|
};
|
|
7819
7838
|
var cleanup = (string) => string.replace(/<[^>]*>?/gm, "");
|
|
7820
7839
|
var truncate = (str, num) => {
|
|
@@ -7869,7 +7888,7 @@ var ReorderDialog = ({
|
|
|
7869
7888
|
secondaryLabel: "Close",
|
|
7870
7889
|
children: [
|
|
7871
7890
|
widgets.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
7872
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
7891
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui12.P, { children: "Drag and drop elements below to reorder the page layout." }),
|
|
7873
7892
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
7874
7893
|
ModalSelectedWidgetsToolbar_default,
|
|
7875
7894
|
{
|
|
@@ -7880,7 +7899,7 @@ var ReorderDialog = ({
|
|
|
7880
7899
|
onRemove
|
|
7881
7900
|
}
|
|
7882
7901
|
)
|
|
7883
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
7902
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui12.P, { children: "It's always good to start with a clean slate. Use the sidebar to add content." }),
|
|
7884
7903
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
7885
7904
|
import_react_sortablejs2.ReactSortable,
|
|
7886
7905
|
{
|
|
@@ -7910,7 +7929,7 @@ var ReorderDialog = ({
|
|
|
7910
7929
|
}
|
|
7911
7930
|
),
|
|
7912
7931
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
7913
|
-
|
|
7932
|
+
import_ui12.H,
|
|
7914
7933
|
{
|
|
7915
7934
|
size: "base",
|
|
7916
7935
|
style: {
|
|
@@ -7930,7 +7949,7 @@ var ReorderDialog = ({
|
|
|
7930
7949
|
},
|
|
7931
7950
|
children: [
|
|
7932
7951
|
adminLibrary[widget.component] && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
7933
|
-
|
|
7952
|
+
import_ui12.Button,
|
|
7934
7953
|
{
|
|
7935
7954
|
type: "button",
|
|
7936
7955
|
variant: "primary",
|
|
@@ -7942,7 +7961,7 @@ var ReorderDialog = ({
|
|
|
7942
7961
|
}
|
|
7943
7962
|
),
|
|
7944
7963
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
7945
|
-
|
|
7964
|
+
import_ui12.Button,
|
|
7946
7965
|
{
|
|
7947
7966
|
type: "button",
|
|
7948
7967
|
variant: "danger",
|
|
@@ -7969,8 +7988,8 @@ var ReorderDialog = ({
|
|
|
7969
7988
|
var ReorderDialog_default = ReorderDialog;
|
|
7970
7989
|
|
|
7971
7990
|
// src/dialogs/SettingsDialog.js
|
|
7972
|
-
var
|
|
7973
|
-
var
|
|
7991
|
+
var import_react22 = __toESM(require("react"));
|
|
7992
|
+
var import_ui19 = __toESM(require_dist());
|
|
7974
7993
|
|
|
7975
7994
|
// src/contexts/BuilderContext.js
|
|
7976
7995
|
var import_react14 = __toESM(require("react"));
|
|
@@ -7980,133 +7999,390 @@ var BuilderContext = import_react14.default.createContext({
|
|
|
7980
7999
|
});
|
|
7981
8000
|
var BuilderContext_default = BuilderContext;
|
|
7982
8001
|
|
|
7983
|
-
// src/
|
|
7984
|
-
var
|
|
7985
|
-
var
|
|
7986
|
-
function TextArea(_a) {
|
|
7987
|
-
var _b = _a, { value = "", placeholder = "" } = _b, rest = __objRest(_b, ["value", "placeholder"]);
|
|
7988
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TextInput_default, __spreadValues({ multiline: true, value, placeholder }, rest));
|
|
7989
|
-
}
|
|
7990
|
-
var TextArea_default = TextArea;
|
|
7991
|
-
|
|
7992
|
-
// src/forms/RichText.js
|
|
7993
|
-
var import_react16 = __toESM(require("react"));
|
|
7994
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
7995
|
-
var RichText = () => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
|
|
7996
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { children: "RichText is no longer part of @raketa-builder/builder. Please use @raketa-cms/raketa-rte" }),
|
|
7997
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("strong", { children: "Update your imports" }),
|
|
7998
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("code", { children: `import {RichText} from '@raketa-cms/raketa-rte';` }) }),
|
|
7999
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("strong", { children: "Update usage in JSON adminFields" }),
|
|
8000
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("code", { children: `text: { type: 'custom', component: RichText },` }) })
|
|
8001
|
-
] });
|
|
8002
|
-
var RichText_default = RichText;
|
|
8002
|
+
// src/AdminForm/index.js
|
|
8003
|
+
var import_react21 = __toESM(require("react"));
|
|
8004
|
+
var import_ui18 = __toESM(require_dist());
|
|
8003
8005
|
|
|
8004
|
-
// src/
|
|
8005
|
-
var
|
|
8006
|
-
var
|
|
8007
|
-
var
|
|
8008
|
-
|
|
8009
|
-
|
|
8010
|
-
|
|
8011
|
-
return [...initialOptions, ...preparedOptions];
|
|
8012
|
-
};
|
|
8013
|
-
var SelectField = (props) => {
|
|
8014
|
-
const id = randomString();
|
|
8015
|
-
const { label, hint, options, placeholder, onChange } = props;
|
|
8016
|
-
const inputProps = Object.assign({}, props);
|
|
8017
|
-
delete inputProps.label;
|
|
8018
|
-
delete inputProps.hint;
|
|
8019
|
-
delete inputProps.options;
|
|
8020
|
-
delete inputProps.placeholder;
|
|
8021
|
-
delete inputProps.onChange;
|
|
8022
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_ui12.FormGroup, { children: [
|
|
8023
|
-
label ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui12.Label, { htmlFor: id, error: props.error, children: label }) : "",
|
|
8024
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
8025
|
-
import_ui12.Select,
|
|
8026
|
-
__spreadProps(__spreadValues({
|
|
8027
|
-
id,
|
|
8028
|
-
onChange: (e) => onChange(e.target.value)
|
|
8029
|
-
}, inputProps), {
|
|
8030
|
-
children: [
|
|
8031
|
-
placeholder ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: null, children: placeholder }, "placeholder") : "",
|
|
8032
|
-
options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: o.value, children: o.text }, o.value))
|
|
8033
|
-
]
|
|
8034
|
-
})
|
|
8035
|
-
),
|
|
8036
|
-
hint ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui12.Hint, { children: hint }) : ""
|
|
8037
|
-
] });
|
|
8006
|
+
// src/helpers/humanize.js
|
|
8007
|
+
var toUnderscore = (string) => string.replace(/([A-Z])/g, ($1) => `_${$1.toLowerCase()}`);
|
|
8008
|
+
var humanize = (string) => toUnderscore(string).replace(/_/g, " ");
|
|
8009
|
+
var capitalize = (s) => {
|
|
8010
|
+
if (typeof s !== "string")
|
|
8011
|
+
return "";
|
|
8012
|
+
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
8038
8013
|
};
|
|
8039
|
-
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8044
|
-
|
|
8045
|
-
|
|
8046
|
-
|
|
8014
|
+
|
|
8015
|
+
// src/List.js
|
|
8016
|
+
var import_react15 = __toESM(require("react"));
|
|
8017
|
+
var import_react_sortablejs3 = require("react-sortablejs");
|
|
8018
|
+
var import_ui13 = __toESM(require_dist());
|
|
8019
|
+
var import_ui14 = __toESM(require_dist());
|
|
8020
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
8021
|
+
var Handle = (props) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(HandleWrapper, { "data-drag": true, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
8022
|
+
"img",
|
|
8023
|
+
__spreadProps(__spreadValues({}, props), {
|
|
8024
|
+
src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjUiIHZpZXdCb3g9IjAgMCAyNCAyNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTggMTguNUwxMiAyMi41TDE2IDE4LjUiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik04IDYuNUwxMiAyLjVMMTYgNi41IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMTIgMi41VjIyLjUiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=",
|
|
8025
|
+
style: {
|
|
8026
|
+
width: "42px",
|
|
8027
|
+
height: "42px",
|
|
8028
|
+
padding: "0 12px"
|
|
8029
|
+
},
|
|
8030
|
+
alt: "handle"
|
|
8031
|
+
})
|
|
8032
|
+
) });
|
|
8033
|
+
var IconDelete = () => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
8034
|
+
"img",
|
|
8047
8035
|
{
|
|
8048
|
-
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
onChange
|
|
8036
|
+
src: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItdHJhc2giPjxwb2x5bGluZSBwb2ludHM9IjMgNiA1IDYgMjEgNiI+PC9wb2x5bGluZT48cGF0aCBkPSJNMTkgNnYxNGEyIDIgMCAwIDEtMiAySDdhMiAyIDAgMCAxLTItMlY2bTMgMFY0YTIgMiAwIDAgMSAyLTJoNGEyIDIgMCAwIDEgMiAydjIiPjwvcGF0aD48L3N2Zz4=",
|
|
8037
|
+
style: { width: "42px", height: "42px", padding: "12px 12px 12px 8px" },
|
|
8038
|
+
alt: "delete"
|
|
8052
8039
|
}
|
|
8053
8040
|
);
|
|
8054
|
-
var
|
|
8055
|
-
|
|
8056
|
-
|
|
8057
|
-
|
|
8058
|
-
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8062
|
-
|
|
8041
|
+
var IconDuplicate = () => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
8042
|
+
"img",
|
|
8043
|
+
{
|
|
8044
|
+
src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjUiIHZpZXdCb3g9IjAgMCAyNCAyNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIwIDguNUgxMEM4Ljg5NTQzIDguNSA4IDkuMzk1NDMgOCAxMC41VjIwLjVDOCAyMS42MDQ2IDguODk1NDMgMjIuNSAxMCAyMi41SDIwQzIxLjEwNDYgMjIuNSAyMiAyMS42MDQ2IDIyIDIwLjVWMTAuNUMyMiA5LjM5NTQzIDIxLjEwNDYgOC41IDIwIDguNVoiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik00IDE2LjVDMi45IDE2LjUgMiAxNS42IDIgMTQuNVY0LjVDMiAzLjQgMi45IDIuNSA0IDIuNUgxNEMxNS4xIDIuNSAxNiAzLjQgMTYgNC41IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K",
|
|
8045
|
+
style: { width: "42px", height: "42px", padding: "12px 8px 12px 12px" },
|
|
8046
|
+
alt: "maximize"
|
|
8047
|
+
}
|
|
8048
|
+
);
|
|
8049
|
+
var ListWrapper = (_a) => {
|
|
8050
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", __spreadValues({ className: (0, import_ui14.cn)("r-reset", "r-list-wrapper", className) }, rest));
|
|
8063
8052
|
};
|
|
8064
|
-
var
|
|
8065
|
-
var _b = _a, { className } = _b,
|
|
8066
|
-
return /* @__PURE__ */ (0,
|
|
8053
|
+
var AddButtonWrapepr = (_a) => {
|
|
8054
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
8056
|
+
"div",
|
|
8057
|
+
__spreadValues({
|
|
8058
|
+
className: (0, import_ui14.cn)("r-reset", "r-list-add-button-wrapper", className)
|
|
8059
|
+
}, rest)
|
|
8060
|
+
);
|
|
8067
8061
|
};
|
|
8068
|
-
var
|
|
8069
|
-
var _b = _a, { className } = _b,
|
|
8070
|
-
return /* @__PURE__ */ (0,
|
|
8062
|
+
var HandleWrapper = (_a) => {
|
|
8063
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
8071
8065
|
"div",
|
|
8072
8066
|
__spreadValues({
|
|
8073
|
-
className: (0,
|
|
8074
|
-
},
|
|
8067
|
+
className: (0, import_ui14.cn)("r-reset", "r-list-handle-wrapper", className)
|
|
8068
|
+
}, rest)
|
|
8075
8069
|
);
|
|
8076
8070
|
};
|
|
8077
|
-
var
|
|
8078
|
-
var _b = _a, { className } = _b,
|
|
8079
|
-
return /* @__PURE__ */ (0,
|
|
8071
|
+
var ItemWrapper = (_a) => {
|
|
8072
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", __spreadValues({ className: (0, import_ui14.cn)("r-reset", "r-list-item-wrapper", className) }, rest));
|
|
8080
8074
|
};
|
|
8081
|
-
var
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
["text", "Text"]
|
|
8085
|
-
];
|
|
8086
|
-
var mergeSettings = (settings, key, value) => Object.assign({}, settings, { [key]: value });
|
|
8087
|
-
var DEFAULTS = {
|
|
8088
|
-
label: "Button",
|
|
8089
|
-
link: "#",
|
|
8090
|
-
id: "",
|
|
8091
|
-
type: "primary",
|
|
8092
|
-
target: "_self",
|
|
8093
|
-
rel: "follow"
|
|
8075
|
+
var TitleBar = (_a) => {
|
|
8076
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", __spreadValues({ className: (0, import_ui14.cn)("r-reset", "r-list-title-bar", className) }, rest));
|
|
8094
8078
|
};
|
|
8095
|
-
var
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8079
|
+
var TitleWrapper = (_a) => {
|
|
8080
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", __spreadValues({ className: (0, import_ui14.cn)("r-reset", "r-list-title-wrapper", className) }, rest));
|
|
8082
|
+
};
|
|
8083
|
+
var ContentWrapper = (_a) => {
|
|
8084
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
8086
|
+
"div",
|
|
8087
|
+
__spreadValues({
|
|
8088
|
+
className: (0, import_ui14.cn)("r-reset", className),
|
|
8089
|
+
style: { padding: "12px 8px" }
|
|
8090
|
+
}, rest)
|
|
8091
|
+
);
|
|
8092
|
+
};
|
|
8093
|
+
var ListButton = (_a) => {
|
|
8094
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
8096
|
+
"div",
|
|
8097
|
+
__spreadValues({
|
|
8098
|
+
className: (0, import_ui14.cn)("r-reset", "r-button-reset r-list-button", className)
|
|
8099
|
+
}, rest)
|
|
8100
|
+
);
|
|
8101
|
+
};
|
|
8102
|
+
var Title = (_a) => {
|
|
8103
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
8105
|
+
"div",
|
|
8106
|
+
__spreadValues({
|
|
8107
|
+
className: (0, import_ui14.cn)("r-reset", className),
|
|
8108
|
+
style: { fontWeight: "700", fontSize: "16px", minHeight: "16px" }
|
|
8109
|
+
}, rest)
|
|
8110
|
+
);
|
|
8111
|
+
};
|
|
8112
|
+
var extractPrimaryField = (primaryField2, item, idx) => {
|
|
8113
|
+
if (!primaryField2) {
|
|
8114
|
+
return `Item ${idx + 1}`;
|
|
8115
|
+
}
|
|
8116
|
+
const keys = primaryField2.split(".");
|
|
8117
|
+
if (keys.length === 1) {
|
|
8118
|
+
return item[primaryField2];
|
|
8119
|
+
}
|
|
8120
|
+
return primaryField2.split(".").reduce((acc, key) => {
|
|
8121
|
+
const newValue = acc && acc[key] || "";
|
|
8122
|
+
return newValue;
|
|
8123
|
+
}, item);
|
|
8124
|
+
};
|
|
8125
|
+
var Item = ({
|
|
8126
|
+
idx,
|
|
8127
|
+
items,
|
|
8128
|
+
item,
|
|
8129
|
+
alwaysOpened,
|
|
8130
|
+
primaryField: primaryField2,
|
|
8131
|
+
template,
|
|
8132
|
+
handleRemove,
|
|
8133
|
+
handleChangeField,
|
|
8134
|
+
handleDuplicate,
|
|
8135
|
+
listItem
|
|
8100
8136
|
}) => {
|
|
8101
|
-
const
|
|
8102
|
-
return /* @__PURE__ */ (0,
|
|
8103
|
-
/* @__PURE__ */ (0,
|
|
8104
|
-
/* @__PURE__ */ (0,
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
/* @__PURE__ */ (0,
|
|
8137
|
+
const [open, setOpen] = import_react15.default.useState(alwaysOpened);
|
|
8138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(ItemWrapper, { children: [
|
|
8139
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(TitleBar, { children: [
|
|
8140
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Handle, {}),
|
|
8141
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(TitleWrapper, { onClick: () => setOpen(!open), children: [
|
|
8142
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Title, { children: extractPrimaryField(primaryField2, item, idx) }),
|
|
8143
|
+
!alwaysOpened && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ListButton, { type: "button" })
|
|
8144
|
+
] }),
|
|
8145
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
8146
|
+
"div",
|
|
8147
|
+
{
|
|
8148
|
+
style: {
|
|
8149
|
+
display: "flex"
|
|
8150
|
+
},
|
|
8151
|
+
children: [
|
|
8152
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
8153
|
+
ListButton,
|
|
8154
|
+
{
|
|
8155
|
+
type: "button",
|
|
8156
|
+
danger: true,
|
|
8157
|
+
onClick: () => handleDuplicate(item, idx),
|
|
8158
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconDuplicate, {})
|
|
8159
|
+
}
|
|
8160
|
+
),
|
|
8161
|
+
(template || !template && items.length !== 1) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ListButton, { type: "button", danger: true, onClick: () => handleRemove(idx), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconDelete, {}) })
|
|
8162
|
+
]
|
|
8163
|
+
}
|
|
8164
|
+
)
|
|
8165
|
+
] }),
|
|
8166
|
+
(alwaysOpened || open) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentWrapper, { children: listItem(
|
|
8167
|
+
item,
|
|
8168
|
+
(field, value) => handleChangeField(idx, field, value),
|
|
8169
|
+
idx
|
|
8170
|
+
) })
|
|
8171
|
+
] });
|
|
8172
|
+
};
|
|
8173
|
+
var List = ({
|
|
8174
|
+
label,
|
|
8175
|
+
items: defaultItems = [],
|
|
8176
|
+
listItem,
|
|
8177
|
+
template,
|
|
8178
|
+
primaryField: primaryField2,
|
|
8179
|
+
onChangeList,
|
|
8180
|
+
itemsAlwaysOpen = false
|
|
8181
|
+
}) => {
|
|
8182
|
+
const [items, setItems] = import_react15.default.useState(defaultItems);
|
|
8183
|
+
const factory = (template2) => {
|
|
8184
|
+
if (!template2)
|
|
8185
|
+
throw new Error("Template not specified for this list");
|
|
8186
|
+
return Object.assign({}, template2, { id: randomId() });
|
|
8187
|
+
};
|
|
8188
|
+
const handleChangeField = (idx, field, value) => {
|
|
8189
|
+
const newItems = updateFieldByIndex(items, field, value, idx);
|
|
8190
|
+
setItems(newItems);
|
|
8191
|
+
notifyChange(newItems);
|
|
8192
|
+
};
|
|
8193
|
+
const notifyChange = (items2) => {
|
|
8194
|
+
onChangeList("list", items2);
|
|
8195
|
+
};
|
|
8196
|
+
const handleAdd = () => {
|
|
8197
|
+
const newItems = add(items, factory(template));
|
|
8198
|
+
setItems(newItems);
|
|
8199
|
+
notifyChange(newItems);
|
|
8200
|
+
};
|
|
8201
|
+
const handleDuplicateField = (item, idx) => {
|
|
8202
|
+
const newItems = duplicate(items, factory(item), idx);
|
|
8203
|
+
setItems(newItems);
|
|
8204
|
+
notifyChange(newItems);
|
|
8205
|
+
};
|
|
8206
|
+
const handleAddAtBeggining = () => {
|
|
8207
|
+
const newItems = addAtBeggining(items, factory(template));
|
|
8208
|
+
setItems(newItems);
|
|
8209
|
+
notifyChange(newItems);
|
|
8210
|
+
};
|
|
8211
|
+
const handleReorder = (items2) => {
|
|
8212
|
+
setItems(items2);
|
|
8213
|
+
notifyChange(items2);
|
|
8214
|
+
};
|
|
8215
|
+
const handleRemove = (idx) => {
|
|
8216
|
+
if (!template && items.length === 1)
|
|
8217
|
+
return;
|
|
8218
|
+
const newItems = removeByIndex(items, idx);
|
|
8219
|
+
setItems(newItems);
|
|
8220
|
+
notifyChange(newItems);
|
|
8221
|
+
};
|
|
8222
|
+
if (!primaryField2)
|
|
8223
|
+
console.warn("No primaryField provided for a list", items);
|
|
8224
|
+
if (!label)
|
|
8225
|
+
console.warn("No label provided for a list", items);
|
|
8226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(ListWrapper, { children: [
|
|
8227
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui13.H, { size: "base", style: { fontWeight: 700 }, children: label }),
|
|
8228
|
+
items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui13.P, { children: "There are no items yet." }),
|
|
8229
|
+
items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react15.default.Fragment, { children: [
|
|
8230
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AddButtonWrapepr, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
8231
|
+
import_ui13.Button,
|
|
8232
|
+
{
|
|
8233
|
+
type: "button",
|
|
8234
|
+
variant: "success",
|
|
8235
|
+
onClick: handleAddAtBeggining,
|
|
8236
|
+
children: "Add item"
|
|
8237
|
+
}
|
|
8238
|
+
) }),
|
|
8239
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
8240
|
+
import_react_sortablejs3.ReactSortable,
|
|
8241
|
+
{
|
|
8242
|
+
list: items,
|
|
8243
|
+
setList: handleReorder,
|
|
8244
|
+
handle: "[data-drag]",
|
|
8245
|
+
direction: "horizontal",
|
|
8246
|
+
dragoverBubble: true,
|
|
8247
|
+
children: items.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
8248
|
+
Item,
|
|
8249
|
+
{
|
|
8250
|
+
"data-id": idx,
|
|
8251
|
+
idx,
|
|
8252
|
+
items,
|
|
8253
|
+
item,
|
|
8254
|
+
alwaysOpened: itemsAlwaysOpen,
|
|
8255
|
+
primaryField: primaryField2,
|
|
8256
|
+
template,
|
|
8257
|
+
handleRemove,
|
|
8258
|
+
handleChangeField,
|
|
8259
|
+
handleDuplicate: handleDuplicateField,
|
|
8260
|
+
listItem
|
|
8261
|
+
},
|
|
8262
|
+
item.id
|
|
8263
|
+
))
|
|
8264
|
+
}
|
|
8265
|
+
)
|
|
8266
|
+
] }),
|
|
8267
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui13.Button, { type: "button", variant: "success", onClick: handleAdd, children: "Add item" })
|
|
8268
|
+
] });
|
|
8269
|
+
};
|
|
8270
|
+
var List_default = List;
|
|
8271
|
+
|
|
8272
|
+
// src/AdminForm/SimpleInput.js
|
|
8273
|
+
var import_react20 = __toESM(require("react"));
|
|
8274
|
+
|
|
8275
|
+
// src/forms/TextArea.js
|
|
8276
|
+
var import_react16 = __toESM(require("react"));
|
|
8277
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
8278
|
+
function TextArea(_a) {
|
|
8279
|
+
var _b = _a, { value = "", placeholder = "" } = _b, rest = __objRest(_b, ["value", "placeholder"]);
|
|
8280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TextInput_default, __spreadValues({ multiline: true, value, placeholder }, rest));
|
|
8281
|
+
}
|
|
8282
|
+
var TextArea_default = TextArea;
|
|
8283
|
+
|
|
8284
|
+
// src/forms/SelectMenu.js
|
|
8285
|
+
var import_react17 = __toESM(require("react"));
|
|
8286
|
+
var import_ui15 = __toESM(require_dist());
|
|
8287
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
8288
|
+
var getOptions = (options, placeholder) => {
|
|
8289
|
+
const initialOptions = placeholder ? [{ value: "", text: placeholder }] : [];
|
|
8290
|
+
const preparedOptions = options.map((o) => ({ value: o[0], text: o[1] }));
|
|
8291
|
+
return [...initialOptions, ...preparedOptions];
|
|
8292
|
+
};
|
|
8293
|
+
var SelectField = (props) => {
|
|
8294
|
+
const id = props.id || randomString();
|
|
8295
|
+
const { label, hint, options, placeholder, onChange } = props;
|
|
8296
|
+
const inputProps = Object.assign({}, props);
|
|
8297
|
+
delete inputProps.label;
|
|
8298
|
+
delete inputProps.hint;
|
|
8299
|
+
delete inputProps.options;
|
|
8300
|
+
delete inputProps.placeholder;
|
|
8301
|
+
delete inputProps.onChange;
|
|
8302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_ui15.FormGroup, { children: [
|
|
8303
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui15.Label, { htmlFor: id, error: props.error, children: label }) : "",
|
|
8304
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
8305
|
+
import_ui15.Select,
|
|
8306
|
+
__spreadProps(__spreadValues({
|
|
8307
|
+
id,
|
|
8308
|
+
onChange: (e) => onChange(e.target.value)
|
|
8309
|
+
}, inputProps), {
|
|
8310
|
+
children: [
|
|
8311
|
+
placeholder ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: null, children: placeholder }, "placeholder") : "",
|
|
8312
|
+
options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: o.value, children: o.text }, o.value))
|
|
8313
|
+
]
|
|
8314
|
+
})
|
|
8315
|
+
),
|
|
8316
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui15.Hint, { children: hint }) : ""
|
|
8317
|
+
] });
|
|
8318
|
+
};
|
|
8319
|
+
var SelectMenu = ({
|
|
8320
|
+
label,
|
|
8321
|
+
options,
|
|
8322
|
+
placeholder = "Please select...",
|
|
8323
|
+
onChange,
|
|
8324
|
+
value = ""
|
|
8325
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
8326
|
+
SelectField,
|
|
8327
|
+
{
|
|
8328
|
+
label,
|
|
8329
|
+
options: getOptions(options, placeholder),
|
|
8330
|
+
value,
|
|
8331
|
+
onChange
|
|
8332
|
+
}
|
|
8333
|
+
);
|
|
8334
|
+
var SelectMenu_default = SelectMenu;
|
|
8335
|
+
|
|
8336
|
+
// src/forms/ButtonSettings.js
|
|
8337
|
+
var import_react18 = __toESM(require("react"));
|
|
8338
|
+
var import_ui16 = __toESM(require_dist());
|
|
8339
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
8340
|
+
var SettingsIcon = (_a) => {
|
|
8341
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", __spreadValues({ className: (0, import_ui16.cn)("r-settings-icon", className) }, props));
|
|
8343
|
+
};
|
|
8344
|
+
var ThreeColumns = (_a) => {
|
|
8345
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", __spreadValues({ className: (0, import_ui16.cn)("r-reset", "r-three-columns", className) }, props));
|
|
8347
|
+
};
|
|
8348
|
+
var FormSectionTitle = (_a) => {
|
|
8349
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
8351
|
+
"div",
|
|
8352
|
+
__spreadValues({
|
|
8353
|
+
className: (0, import_ui16.cn)("r-reset", "r-form-section-title", className)
|
|
8354
|
+
}, props)
|
|
8355
|
+
);
|
|
8356
|
+
};
|
|
8357
|
+
var DEFAULT_BUTTON_STYLES = [
|
|
8358
|
+
["primary", "Primary"],
|
|
8359
|
+
["secondary", "Secondary"],
|
|
8360
|
+
["text", "Text"]
|
|
8361
|
+
];
|
|
8362
|
+
var mergeSettings = (settings, key, value) => Object.assign({}, settings, { [key]: value });
|
|
8363
|
+
var DEFAULTS = {
|
|
8364
|
+
label: "Button",
|
|
8365
|
+
link: "#",
|
|
8366
|
+
id: "",
|
|
8367
|
+
type: "primary",
|
|
8368
|
+
target: "_self",
|
|
8369
|
+
rel: "follow"
|
|
8370
|
+
};
|
|
8371
|
+
var ButtonSettings = ({
|
|
8372
|
+
label = "Button",
|
|
8373
|
+
hint,
|
|
8374
|
+
value = DEFAULTS,
|
|
8375
|
+
onChange
|
|
8376
|
+
}) => {
|
|
8377
|
+
const { buttonStyles } = import_react18.default.useContext(BuilderContext_default) || DEFAULT_BUTTON_STYLES;
|
|
8378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_ui16.FormGroup, { children: [
|
|
8379
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(FormSectionTitle, { children: [
|
|
8380
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SettingsIcon, {}),
|
|
8381
|
+
" ",
|
|
8382
|
+
label
|
|
8383
|
+
] }),
|
|
8384
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(ThreeColumns, { children: [
|
|
8385
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
8110
8386
|
TextInput_default,
|
|
8111
8387
|
{
|
|
8112
8388
|
label: "Label",
|
|
@@ -8166,153 +8442,260 @@ var ButtonSettings = ({
|
|
|
8166
8442
|
}
|
|
8167
8443
|
)
|
|
8168
8444
|
] }),
|
|
8169
|
-
hint ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
8445
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui16.Hint, { children: hint }) : ""
|
|
8170
8446
|
] });
|
|
8171
8447
|
};
|
|
8172
8448
|
ButtonSettings.defaults = DEFAULTS;
|
|
8173
8449
|
ButtonSettings.defaultButtonStyles = DEFAULT_BUTTON_STYLES;
|
|
8174
8450
|
var ButtonSettings_default = ButtonSettings;
|
|
8175
8451
|
|
|
8176
|
-
// src/
|
|
8177
|
-
var toUnderscore = (string) => string.replace(/([A-Z])/g, ($1) => `_${$1.toLowerCase()}`);
|
|
8178
|
-
var humanize = (string) => toUnderscore(string).replace(/_/g, " ");
|
|
8179
|
-
var capitalize = (s) => {
|
|
8180
|
-
if (typeof s !== "string")
|
|
8181
|
-
return "";
|
|
8182
|
-
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
8183
|
-
};
|
|
8184
|
-
|
|
8185
|
-
// src/pickers/ImagePicker/ImagePicker.js
|
|
8452
|
+
// src/forms/LinkSettings.js
|
|
8186
8453
|
var import_react19 = __toESM(require("react"));
|
|
8454
|
+
var import_ui17 = __toESM(require_dist());
|
|
8187
8455
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
8188
|
-
var
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8456
|
+
var SettingsIcon2 = (_a) => {
|
|
8457
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", __spreadValues({ className: (0, import_ui17.cn)("r-settings-icon", className) }, props));
|
|
8459
|
+
};
|
|
8460
|
+
var ThreeColumns2 = (_a) => {
|
|
8461
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", __spreadValues({ className: (0, import_ui17.cn)("r-reset", "r-three-columns", className) }, props));
|
|
8463
|
+
};
|
|
8464
|
+
var FormSectionTitle2 = (_a) => {
|
|
8465
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
8467
|
+
"div",
|
|
8468
|
+
__spreadValues({
|
|
8469
|
+
className: (0, import_ui17.cn)("r-reset", "r-form-section-title", className)
|
|
8470
|
+
}, props)
|
|
8471
|
+
);
|
|
8472
|
+
};
|
|
8473
|
+
var mergeSettings2 = (settings, key, value) => Object.assign({}, settings, { [key]: value });
|
|
8474
|
+
var DEFAULTS2 = {
|
|
8475
|
+
label: "link",
|
|
8476
|
+
link: "#",
|
|
8477
|
+
id: "",
|
|
8478
|
+
className: "",
|
|
8479
|
+
target: "_self",
|
|
8480
|
+
rel: "follow"
|
|
8481
|
+
};
|
|
8482
|
+
var LinkSettings = ({ label = "Link", hint, value = DEFAULTS2, onChange }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_ui17.FormGroup, { children: [
|
|
8483
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(FormSectionTitle2, { children: [
|
|
8484
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SettingsIcon2, {}),
|
|
8485
|
+
" ",
|
|
8486
|
+
label
|
|
8192
8487
|
] }),
|
|
8193
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8205
|
-
|
|
8206
|
-
|
|
8207
|
-
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
8255
|
-
|
|
8256
|
-
|
|
8257
|
-
|
|
8258
|
-
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
|
|
8268
|
-
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
|
|
8277
|
-
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
|
|
8488
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(ThreeColumns2, { children: [
|
|
8489
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
8490
|
+
TextInput_default,
|
|
8491
|
+
{
|
|
8492
|
+
label: "Label",
|
|
8493
|
+
value: value.label,
|
|
8494
|
+
onChange: (label2) => onChange(mergeSettings2(value, "label", label2))
|
|
8495
|
+
}
|
|
8496
|
+
),
|
|
8497
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
8498
|
+
TextInput_default,
|
|
8499
|
+
{
|
|
8500
|
+
label: "Link",
|
|
8501
|
+
value: value.link,
|
|
8502
|
+
onChange: (link) => onChange(mergeSettings2(value, "link", link))
|
|
8503
|
+
}
|
|
8504
|
+
),
|
|
8505
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
8506
|
+
TextInput_default,
|
|
8507
|
+
{
|
|
8508
|
+
label: "ID",
|
|
8509
|
+
value: value.id,
|
|
8510
|
+
onChange: (id) => onChange(mergeSettings2(value, "id", id))
|
|
8511
|
+
}
|
|
8512
|
+
)
|
|
8513
|
+
] }),
|
|
8514
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(ThreeColumns2, { children: [
|
|
8515
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
8516
|
+
TextInput_default,
|
|
8517
|
+
{
|
|
8518
|
+
label: "CSS Class",
|
|
8519
|
+
value: value.className,
|
|
8520
|
+
onChange: (className) => onChange(mergeSettings2(value, "className", className))
|
|
8521
|
+
}
|
|
8522
|
+
),
|
|
8523
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
8524
|
+
SelectMenu_default,
|
|
8525
|
+
{
|
|
8526
|
+
label: "Target",
|
|
8527
|
+
options: [
|
|
8528
|
+
["_self", "Self"],
|
|
8529
|
+
["_blank", "New Tab"]
|
|
8530
|
+
],
|
|
8531
|
+
value: value.target,
|
|
8532
|
+
onChange: (target) => onChange(mergeSettings2(value, "target", target))
|
|
8533
|
+
}
|
|
8534
|
+
),
|
|
8535
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
8536
|
+
SelectMenu_default,
|
|
8537
|
+
{
|
|
8538
|
+
label: "Follow Link",
|
|
8539
|
+
options: [
|
|
8540
|
+
["follow", "Follow"],
|
|
8541
|
+
["nofollow", "No Follow"]
|
|
8542
|
+
],
|
|
8543
|
+
value: value.rel,
|
|
8544
|
+
onChange: (rel) => onChange(mergeSettings2(value, "rel", rel))
|
|
8545
|
+
}
|
|
8546
|
+
)
|
|
8547
|
+
] }),
|
|
8548
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui17.Hint, { children: hint }) : ""
|
|
8549
|
+
] });
|
|
8550
|
+
LinkSettings.defaults = DEFAULTS2;
|
|
8551
|
+
var LinkSettings_default = LinkSettings;
|
|
8552
|
+
|
|
8553
|
+
// src/AdminForm/SimpleInput.js
|
|
8554
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
8555
|
+
var FIELDS_MAPPING = {
|
|
8556
|
+
text: TextInput_default,
|
|
8557
|
+
textarea: TextArea_default,
|
|
8558
|
+
select: SelectMenu_default,
|
|
8559
|
+
button: ButtonSettings_default,
|
|
8560
|
+
link: LinkSettings_default
|
|
8561
|
+
};
|
|
8562
|
+
function fetchComponent(opts) {
|
|
8563
|
+
return FIELDS_MAPPING[opts.type];
|
|
8564
|
+
}
|
|
8565
|
+
var SimpleInput = ({ label, value, opts, onChange }) => {
|
|
8566
|
+
const Component2 = fetchComponent(opts);
|
|
8567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Component2, __spreadValues({ label, value, onChange }, opts));
|
|
8568
|
+
};
|
|
8569
|
+
var SimpleInput_default = SimpleInput;
|
|
8570
|
+
|
|
8571
|
+
// src/AdminForm/index.js
|
|
8572
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
8573
|
+
var ListWrapper2 = ({ field, path, value, opts, onChange }) => {
|
|
8574
|
+
const { label, template, primaryField: primaryField2, itemsAlwaysOpen = false } = opts;
|
|
8575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
8576
|
+
List_default,
|
|
8577
|
+
{
|
|
8578
|
+
label,
|
|
8579
|
+
items: value,
|
|
8580
|
+
listItem: (settings, onChangeItem) => {
|
|
8581
|
+
return Object.keys(opts.schema).map((subField) => {
|
|
8582
|
+
const subOpts = Object.assign(
|
|
8583
|
+
{ label: capitalize(humanize(subField)) },
|
|
8584
|
+
opts.schema[subField]
|
|
8585
|
+
);
|
|
8586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
8587
|
+
FormField,
|
|
8588
|
+
{
|
|
8589
|
+
path: `${path}.${subField}`,
|
|
8590
|
+
field: subField,
|
|
8591
|
+
value: settings == null ? void 0 : settings[subField],
|
|
8592
|
+
opts: subOpts,
|
|
8593
|
+
onChange: (newValue) => onChangeItem(subField, newValue)
|
|
8594
|
+
},
|
|
8595
|
+
`${field}.${subField}`
|
|
8596
|
+
);
|
|
8597
|
+
});
|
|
8598
|
+
},
|
|
8599
|
+
template,
|
|
8600
|
+
primaryField: primaryField2,
|
|
8601
|
+
itemsAlwaysOpen,
|
|
8602
|
+
onChangeList: (_key, newList) => onChange(newList)
|
|
8283
8603
|
}
|
|
8284
|
-
|
|
8285
|
-
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8604
|
+
);
|
|
8605
|
+
};
|
|
8606
|
+
var SchemaInput = ({ field, value, path, opts, onChange }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_ui18.FieldSet, { legend: opts == null ? void 0 : opts.label, children: Object.keys(opts.schema).map((subField) => {
|
|
8607
|
+
const subOpts = Object.assign(
|
|
8608
|
+
{ label: capitalize(humanize(subField)) },
|
|
8609
|
+
opts.schema[subField]
|
|
8610
|
+
);
|
|
8611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
8612
|
+
FormField,
|
|
8613
|
+
{
|
|
8614
|
+
path: `${path}.${subField}`,
|
|
8615
|
+
field: subField,
|
|
8616
|
+
value: value == null ? void 0 : value[subField],
|
|
8617
|
+
opts: subOpts,
|
|
8618
|
+
onChange: (newValue) => onChange(__spreadProps(__spreadValues({}, value), { [subField]: newValue }))
|
|
8619
|
+
},
|
|
8620
|
+
`${field}.${subField}`
|
|
8621
|
+
);
|
|
8622
|
+
}) });
|
|
8623
|
+
var FIELDS_MAPPING2 = {
|
|
8624
|
+
text: SimpleInput_default,
|
|
8625
|
+
textarea: SimpleInput_default,
|
|
8626
|
+
select: SimpleInput_default,
|
|
8627
|
+
button: SimpleInput_default,
|
|
8628
|
+
link: SimpleInput_default,
|
|
8629
|
+
list: ListWrapper2
|
|
8630
|
+
};
|
|
8631
|
+
function fetchComponent2(opts) {
|
|
8632
|
+
if (opts.type === "custom" && opts.schema) {
|
|
8633
|
+
return SchemaInput;
|
|
8634
|
+
}
|
|
8635
|
+
if (opts.type === "custom" && opts.component) {
|
|
8636
|
+
return opts.component;
|
|
8637
|
+
}
|
|
8638
|
+
return FIELDS_MAPPING2[opts.type];
|
|
8639
|
+
}
|
|
8640
|
+
var FormField = ({ field, value, path, opts, onChange }) => {
|
|
8641
|
+
const Component2 = fetchComponent2(opts);
|
|
8642
|
+
if (!Component2) {
|
|
8643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
8644
|
+
"p",
|
|
8645
|
+
{
|
|
8646
|
+
style: {
|
|
8647
|
+
marginBlock: "1rem"
|
|
8291
8648
|
},
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8649
|
+
children: [
|
|
8650
|
+
"Component of type ",
|
|
8651
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("strong", { children: opts.type }),
|
|
8652
|
+
" for",
|
|
8653
|
+
" ",
|
|
8654
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("strong", { children: field }),
|
|
8655
|
+
" does not exist!"
|
|
8656
|
+
]
|
|
8657
|
+
}
|
|
8658
|
+
);
|
|
8295
8659
|
}
|
|
8296
|
-
|
|
8297
|
-
|
|
8298
|
-
|
|
8299
|
-
|
|
8300
|
-
|
|
8660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
8661
|
+
Component2,
|
|
8662
|
+
{
|
|
8663
|
+
label: opts.label,
|
|
8664
|
+
value,
|
|
8665
|
+
path,
|
|
8666
|
+
opts,
|
|
8667
|
+
onChange
|
|
8668
|
+
}
|
|
8301
8669
|
);
|
|
8302
|
-
|
|
8303
|
-
})
|
|
8670
|
+
};
|
|
8671
|
+
var AdminForm = ({ schema = {}, value = {}, onChange }) => {
|
|
8672
|
+
return Object.keys(schema).map((field) => {
|
|
8673
|
+
const opts = Object.assign(
|
|
8674
|
+
{ label: capitalize(humanize(field)) },
|
|
8675
|
+
schema[field]
|
|
8676
|
+
);
|
|
8677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
8678
|
+
FormField,
|
|
8679
|
+
{
|
|
8680
|
+
path: field,
|
|
8681
|
+
field,
|
|
8682
|
+
value: value[field],
|
|
8683
|
+
onChange: (newValue) => onChange(__spreadProps(__spreadValues({}, value), { [field]: newValue })),
|
|
8684
|
+
opts
|
|
8685
|
+
},
|
|
8686
|
+
`${field}`
|
|
8687
|
+
);
|
|
8688
|
+
});
|
|
8689
|
+
};
|
|
8690
|
+
var AdminForm_default = AdminForm;
|
|
8691
|
+
|
|
8692
|
+
// src/dialogs/SettingsDialog.js
|
|
8693
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
8304
8694
|
var SettingsDialog = ({ widget, settings, onSave, onClose }) => {
|
|
8305
|
-
const { containerAdmin } =
|
|
8306
|
-
const [localSettings, setLocalSettings] =
|
|
8307
|
-
const
|
|
8308
|
-
setLocalSettings(__spreadProps(__spreadValues({}, localSettings), {
|
|
8309
|
-
[field]: value
|
|
8310
|
-
}));
|
|
8311
|
-
};
|
|
8312
|
-
const handleChangeContainer = (field, value) => {
|
|
8313
|
-
handleChange("containerSettings", __spreadProps(__spreadValues({}, localSettings.containerSettings), {
|
|
8314
|
-
[field]: value
|
|
8315
|
-
}));
|
|
8695
|
+
const { containerAdmin } = import_react22.default.useContext(BuilderContext_default);
|
|
8696
|
+
const [localSettings, setLocalSettings] = import_react22.default.useState(settings);
|
|
8697
|
+
const handleChangeContainer = (value) => {
|
|
8698
|
+
setLocalSettings(__spreadProps(__spreadValues({}, localSettings), { containerSettings: __spreadValues({}, value) }));
|
|
8316
8699
|
};
|
|
8317
8700
|
const schema = widgetData_default.adminFields(widget);
|
|
8318
8701
|
if (typeof schema !== "object") {
|
|
@@ -8322,15 +8705,8 @@ var SettingsDialog = ({ widget, settings, onSave, onClose }) => {
|
|
|
8322
8705
|
)}. Update to custom inputs. `
|
|
8323
8706
|
);
|
|
8324
8707
|
}
|
|
8325
|
-
const fields = renderAdmin(schema, localSettings, handleChange);
|
|
8326
|
-
const { containerSettings } = localSettings;
|
|
8327
|
-
const containerAdminFields = renderAdmin(
|
|
8328
|
-
containerAdmin,
|
|
8329
|
-
containerSettings,
|
|
8330
|
-
handleChangeContainer
|
|
8331
|
-
);
|
|
8332
8708
|
const areChanges = JSON.stringify(settings) !== JSON.stringify(localSettings);
|
|
8333
|
-
return /* @__PURE__ */ (0,
|
|
8709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
8334
8710
|
Dialog_default,
|
|
8335
8711
|
{
|
|
8336
8712
|
open: true,
|
|
@@ -8339,9 +8715,23 @@ var SettingsDialog = ({ widget, settings, onSave, onClose }) => {
|
|
|
8339
8715
|
onPrimary: () => onSave(localSettings),
|
|
8340
8716
|
onClose,
|
|
8341
8717
|
areChanges,
|
|
8342
|
-
children: /* @__PURE__ */ (0,
|
|
8343
|
-
/* @__PURE__ */ (0,
|
|
8344
|
-
|
|
8718
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_ui19.Tabs, { children: [
|
|
8719
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { title: "Content", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
8720
|
+
AdminForm_default,
|
|
8721
|
+
{
|
|
8722
|
+
schema,
|
|
8723
|
+
value: localSettings,
|
|
8724
|
+
onChange: (newValue) => setLocalSettings(__spreadValues({}, newValue))
|
|
8725
|
+
}
|
|
8726
|
+
) }),
|
|
8727
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { title: "Container", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
8728
|
+
AdminForm_default,
|
|
8729
|
+
{
|
|
8730
|
+
schema: containerAdmin,
|
|
8731
|
+
value: localSettings.containerSettings,
|
|
8732
|
+
onChange: handleChangeContainer
|
|
8733
|
+
}
|
|
8734
|
+
) })
|
|
8345
8735
|
] })
|
|
8346
8736
|
}
|
|
8347
8737
|
);
|
|
@@ -8349,11 +8739,11 @@ var SettingsDialog = ({ widget, settings, onSave, onClose }) => {
|
|
|
8349
8739
|
var SettingsDialog_default = SettingsDialog;
|
|
8350
8740
|
|
|
8351
8741
|
// src/lib/SelectedWidgetsToolbar.js
|
|
8352
|
-
var
|
|
8742
|
+
var import_react23 = __toESM(require("react"));
|
|
8353
8743
|
|
|
8354
8744
|
// src/icons/IconCopy.js
|
|
8355
|
-
var
|
|
8356
|
-
var IconCopy = () => /* @__PURE__ */ (0,
|
|
8745
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
8746
|
+
var IconCopy = () => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
8357
8747
|
"svg",
|
|
8358
8748
|
{
|
|
8359
8749
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8362,8 +8752,8 @@ var IconCopy = () => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
8362
8752
|
viewBox: "0 0 16 16",
|
|
8363
8753
|
fill: "none",
|
|
8364
8754
|
children: [
|
|
8365
|
-
/* @__PURE__ */ (0,
|
|
8366
|
-
/* @__PURE__ */ (0,
|
|
8755
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("g", { clipPath: "url(#clip0_2312_498)", children: [
|
|
8756
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
8367
8757
|
"path",
|
|
8368
8758
|
{
|
|
8369
8759
|
d: "M13.3334 5.33331H6.66671C5.93033 5.33331 5.33337 5.93027 5.33337 6.66665V13.3333C5.33337 14.0697 5.93033 14.6666 6.66671 14.6666H13.3334C14.0698 14.6666 14.6667 14.0697 14.6667 13.3333V6.66665C14.6667 5.93027 14.0698 5.33331 13.3334 5.33331Z",
|
|
@@ -8373,7 +8763,7 @@ var IconCopy = () => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
8373
8763
|
strokeLinejoin: "round"
|
|
8374
8764
|
}
|
|
8375
8765
|
),
|
|
8376
|
-
/* @__PURE__ */ (0,
|
|
8766
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
8377
8767
|
"path",
|
|
8378
8768
|
{
|
|
8379
8769
|
d: "M2.66671 10.6666C1.93337 10.6666 1.33337 10.0666 1.33337 9.33331V2.66665C1.33337 1.93331 1.93337 1.33331 2.66671 1.33331H9.33337C10.0667 1.33331 10.6667 1.93331 10.6667 2.66665",
|
|
@@ -8384,15 +8774,15 @@ var IconCopy = () => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
|
8384
8774
|
}
|
|
8385
8775
|
)
|
|
8386
8776
|
] }),
|
|
8387
|
-
/* @__PURE__ */ (0,
|
|
8777
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("clipPath", { id: "clip0_2312_498", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
8388
8778
|
]
|
|
8389
8779
|
}
|
|
8390
8780
|
);
|
|
8391
8781
|
var IconCopy_default = IconCopy;
|
|
8392
8782
|
|
|
8393
8783
|
// src/icons/IconDelete.js
|
|
8394
|
-
var
|
|
8395
|
-
var
|
|
8784
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
8785
|
+
var IconDelete2 = () => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
8396
8786
|
"svg",
|
|
8397
8787
|
{
|
|
8398
8788
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8401,7 +8791,7 @@ var IconDelete = () => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
|
8401
8791
|
viewBox: "0 0 16 16",
|
|
8402
8792
|
fill: "none",
|
|
8403
8793
|
children: [
|
|
8404
|
-
/* @__PURE__ */ (0,
|
|
8794
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8405
8795
|
"path",
|
|
8406
8796
|
{
|
|
8407
8797
|
d: "M2 4H14",
|
|
@@ -8411,7 +8801,7 @@ var IconDelete = () => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
|
8411
8801
|
strokeLinejoin: "round"
|
|
8412
8802
|
}
|
|
8413
8803
|
),
|
|
8414
|
-
/* @__PURE__ */ (0,
|
|
8804
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8415
8805
|
"path",
|
|
8416
8806
|
{
|
|
8417
8807
|
d: "M12.6667 4V13.3333C12.6667 14 12 14.6667 11.3334 14.6667H4.66671C4.00004 14.6667 3.33337 14 3.33337 13.3333V4",
|
|
@@ -8421,7 +8811,7 @@ var IconDelete = () => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
|
8421
8811
|
strokeLinejoin: "round"
|
|
8422
8812
|
}
|
|
8423
8813
|
),
|
|
8424
|
-
/* @__PURE__ */ (0,
|
|
8814
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8425
8815
|
"path",
|
|
8426
8816
|
{
|
|
8427
8817
|
d: "M5.33337 3.99998V2.66665C5.33337 1.99998 6.00004 1.33331 6.66671 1.33331H9.33337C10 1.33331 10.6667 1.99998 10.6667 2.66665V3.99998",
|
|
@@ -8434,33 +8824,33 @@ var IconDelete = () => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
|
8434
8824
|
]
|
|
8435
8825
|
}
|
|
8436
8826
|
);
|
|
8437
|
-
var IconDelete_default =
|
|
8827
|
+
var IconDelete_default = IconDelete2;
|
|
8438
8828
|
|
|
8439
8829
|
// src/lib/SelectedWidgetsToolbar.js
|
|
8440
|
-
var
|
|
8441
|
-
var SelectedWidgetsToolbar = ({ length, onRemove, onCopy }) => /* @__PURE__ */ (0,
|
|
8442
|
-
/* @__PURE__ */ (0,
|
|
8830
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
8831
|
+
var SelectedWidgetsToolbar = ({ length, onRemove, onCopy }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "r-selected-widgets-toolbar", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "r-toolbar-inner", children: [
|
|
8832
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
8443
8833
|
"button",
|
|
8444
8834
|
{
|
|
8445
8835
|
type: "button",
|
|
8446
8836
|
className: "r-button-reset r-toolbar-button r-toolbar-button-copy",
|
|
8447
8837
|
onClick: onCopy,
|
|
8448
8838
|
children: [
|
|
8449
|
-
/* @__PURE__ */ (0,
|
|
8839
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IconCopy_default, {}),
|
|
8450
8840
|
"Copy selected (",
|
|
8451
8841
|
length,
|
|
8452
8842
|
")"
|
|
8453
8843
|
]
|
|
8454
8844
|
}
|
|
8455
8845
|
),
|
|
8456
|
-
/* @__PURE__ */ (0,
|
|
8846
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
8457
8847
|
"button",
|
|
8458
8848
|
{
|
|
8459
8849
|
type: "button",
|
|
8460
8850
|
className: "r-button-reset r-toolbar-button r-toolbar-button-delete",
|
|
8461
8851
|
onClick: onRemove,
|
|
8462
8852
|
children: [
|
|
8463
|
-
/* @__PURE__ */ (0,
|
|
8853
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IconDelete_default, {}),
|
|
8464
8854
|
"Delete selected"
|
|
8465
8855
|
]
|
|
8466
8856
|
}
|
|
@@ -8469,17 +8859,17 @@ var SelectedWidgetsToolbar = ({ length, onRemove, onCopy }) => /* @__PURE__ */ (
|
|
|
8469
8859
|
var SelectedWidgetsToolbar_default = SelectedWidgetsToolbar;
|
|
8470
8860
|
|
|
8471
8861
|
// src/AutoSaveNotification.js
|
|
8472
|
-
var
|
|
8473
|
-
var
|
|
8862
|
+
var import_react24 = __toESM(require("react"));
|
|
8863
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
8474
8864
|
var Notification = ({ text }) => {
|
|
8475
|
-
const [show, setShow] =
|
|
8865
|
+
const [show, setShow] = import_react24.default.useState(true);
|
|
8476
8866
|
setTimeout(() => {
|
|
8477
8867
|
setShow(false);
|
|
8478
8868
|
}, 3e3);
|
|
8479
8869
|
if (show) {
|
|
8480
|
-
return /* @__PURE__ */ (0,
|
|
8481
|
-
/* @__PURE__ */ (0,
|
|
8482
|
-
/* @__PURE__ */ (0,
|
|
8870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "r-autosave-notification", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "r-autosave-wrapper", children: [
|
|
8871
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "r-autosave-text", children: text || "Revision saved" }),
|
|
8872
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "r-autosave-flash" })
|
|
8483
8873
|
] }) });
|
|
8484
8874
|
}
|
|
8485
8875
|
return null;
|
|
@@ -8487,7 +8877,7 @@ var Notification = ({ text }) => {
|
|
|
8487
8877
|
var AutoSaveNotification_default = Notification;
|
|
8488
8878
|
|
|
8489
8879
|
// src/PageBuilder.js
|
|
8490
|
-
var
|
|
8880
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
8491
8881
|
var saveToLocalStorage = (identifier, widgets) => window.localStorage.setItem(
|
|
8492
8882
|
`clipboard\u2013${identifier}`,
|
|
8493
8883
|
JSON.stringify(widgets)
|
|
@@ -8506,12 +8896,12 @@ var PageBuilder = ({
|
|
|
8506
8896
|
canvasClassName = "",
|
|
8507
8897
|
notifications
|
|
8508
8898
|
}) => {
|
|
8509
|
-
const [page, setPage] =
|
|
8510
|
-
const [pageHistory, setPageHistory] =
|
|
8511
|
-
const [historyIndex, setHistoryIndex] =
|
|
8512
|
-
const [selectedWidget, setSelectedWidget] =
|
|
8513
|
-
const [reorderOpen, setReorderOpen] =
|
|
8514
|
-
const [selectedWidgets, setSelectedWidgets] =
|
|
8899
|
+
const [page, setPage] = import_react25.default.useState(initialPage);
|
|
8900
|
+
const [pageHistory, setPageHistory] = import_react25.default.useState([initialPage]);
|
|
8901
|
+
const [historyIndex, setHistoryIndex] = import_react25.default.useState(0);
|
|
8902
|
+
const [selectedWidget, setSelectedWidget] = import_react25.default.useState(null);
|
|
8903
|
+
const [reorderOpen, setReorderOpen] = import_react25.default.useState(false);
|
|
8904
|
+
const [selectedWidgets, setSelectedWidgets] = import_react25.default.useState([]);
|
|
8515
8905
|
const handleUndoChanges = () => {
|
|
8516
8906
|
const newPage = pageHistory[historyIndex - 1];
|
|
8517
8907
|
if (historyIndex > 0)
|
|
@@ -8591,7 +8981,12 @@ var PageBuilder = ({
|
|
|
8591
8981
|
const widgetName = page.widgets.filter(
|
|
8592
8982
|
(current) => current.widgetId === id
|
|
8593
8983
|
)[0].component;
|
|
8594
|
-
|
|
8984
|
+
let widgetTitle = null;
|
|
8985
|
+
if (adminLibrary[widgetName]) {
|
|
8986
|
+
widgetTitle = widgetData_default.title(adminLibrary[widgetName]);
|
|
8987
|
+
} else {
|
|
8988
|
+
widgetTitle = widgetName;
|
|
8989
|
+
}
|
|
8595
8990
|
setPage(newPage);
|
|
8596
8991
|
handlePageHistory(newPage);
|
|
8597
8992
|
onSave(newPage, `${widgetTitle} removed`);
|
|
@@ -8673,12 +9068,12 @@ var PageBuilder = ({
|
|
|
8673
9068
|
chosen: false,
|
|
8674
9069
|
selected: false
|
|
8675
9070
|
}));
|
|
8676
|
-
return /* @__PURE__ */ (0,
|
|
9071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(HostContext_default.Provider, { value: { host }, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(LibraryContext_default.Provider, { value: { library, adminLibrary }, children: [
|
|
8677
9072
|
notifications.length > 0 && notifications.map((notif) => {
|
|
8678
|
-
return /* @__PURE__ */ (0,
|
|
9073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(AutoSaveNotification_default, __spreadValues({}, notif), notif.id);
|
|
8679
9074
|
}),
|
|
8680
|
-
/* @__PURE__ */ (0,
|
|
8681
|
-
!reorderOpen && selectedWidgets.length > 0 && /* @__PURE__ */ (0,
|
|
9075
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { style: { paddingLeft: "64px" }, children: [
|
|
9076
|
+
!reorderOpen && selectedWidgets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
8682
9077
|
SelectedWidgetsToolbar_default,
|
|
8683
9078
|
{
|
|
8684
9079
|
length: selectedWidgets.length,
|
|
@@ -8686,428 +9081,158 @@ var PageBuilder = ({
|
|
|
8686
9081
|
onRemove: handleRemoveMultiple
|
|
8687
9082
|
}
|
|
8688
9083
|
),
|
|
8689
|
-
reorderOpen && /* @__PURE__ */ (0,
|
|
8690
|
-
ReorderDialog_default,
|
|
8691
|
-
{
|
|
8692
|
-
widgets: sortableWidgets,
|
|
8693
|
-
onChange: handleReorder,
|
|
8694
|
-
onDelete: handleRemove,
|
|
8695
|
-
onSelectWidget: setSelectedWidget,
|
|
8696
|
-
onClose: () => setReorderOpen(false),
|
|
8697
|
-
selectedWidgets,
|
|
8698
|
-
onSelectWidgets: handleSelectWidget,
|
|
8699
|
-
onCopy: () => handleCopyWidgets(selectedWidgets, "multiple"),
|
|
8700
|
-
onRemove: handleRemoveMultiple,
|
|
8701
|
-
onSelectAll: handleSelectAll
|
|
8702
|
-
}
|
|
8703
|
-
),
|
|
8704
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8705
|
-
AdminSidebar_default,
|
|
8706
|
-
{
|
|
8707
|
-
languageSwitcherSettings,
|
|
8708
|
-
buttons: sidebarButtons,
|
|
8709
|
-
onAddWidget: (widgetName) => handleAdd(widgetName),
|
|
8710
|
-
onReorderDialog: () => setReorderOpen(true),
|
|
8711
|
-
onExit,
|
|
8712
|
-
onPasteWidget: handlePasteWidget,
|
|
8713
|
-
pageHistory,
|
|
8714
|
-
setPage,
|
|
8715
|
-
undoChanges: handleUndoChanges,
|
|
8716
|
-
redoChanges: handleRedoChanges,
|
|
8717
|
-
historyIndex
|
|
8718
|
-
}
|
|
8719
|
-
),
|
|
8720
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8721
|
-
Canvas_default,
|
|
8722
|
-
{
|
|
8723
|
-
widgets: sortableWidgets,
|
|
8724
|
-
onReorder: handleReorder,
|
|
8725
|
-
onEdit: setSelectedWidget,
|
|
8726
|
-
onRemove: handleRemove,
|
|
8727
|
-
onCopy: handleCopyWidgets,
|
|
8728
|
-
selectedWidgets,
|
|
8729
|
-
onSelectWidget: handleSelectWidget,
|
|
8730
|
-
canvasClassName
|
|
8731
|
-
}
|
|
8732
|
-
),
|
|
8733
|
-
selectedWidget && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8734
|
-
SettingsDialog_default,
|
|
8735
|
-
{
|
|
8736
|
-
widget: currentWidget,
|
|
8737
|
-
settings: selectedWidget.settings,
|
|
8738
|
-
onSave: handleSaveWidget,
|
|
8739
|
-
onClose: handleClose
|
|
8740
|
-
}
|
|
8741
|
-
)
|
|
8742
|
-
] })
|
|
8743
|
-
] }) });
|
|
8744
|
-
};
|
|
8745
|
-
var PageBuilder_default = PageBuilder;
|
|
8746
|
-
|
|
8747
|
-
// src/pickers/ImagePicker/ImageInput.js
|
|
8748
|
-
var import_react24 = __toESM(require("react"));
|
|
8749
|
-
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
8750
|
-
var ImageInput = () => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
|
|
8751
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("p", { children: [
|
|
8752
|
-
"ImageInput is no longer part of @raketa-builder/builder. Please use @raketa-builder/image-input.",
|
|
8753
|
-
" "
|
|
8754
|
-
] }),
|
|
8755
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("strong", { children: "Update imports" }),
|
|
8756
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("code", { children: `import { ImageInput } from '@raketa-builder/image-input';` }) })
|
|
8757
|
-
] });
|
|
8758
|
-
var ImageInput_default = ImageInput;
|
|
8759
|
-
|
|
8760
|
-
// src/lib/Image.js
|
|
8761
|
-
var import_react25 = __toESM(require("react"));
|
|
8762
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
8763
|
-
var getWebp = (url) => {
|
|
8764
|
-
if (!url)
|
|
8765
|
-
return null;
|
|
8766
|
-
const segments = url.split(".");
|
|
8767
|
-
segments[segments.length - 1] = "webp";
|
|
8768
|
-
return segments.join(".");
|
|
8769
|
-
};
|
|
8770
|
-
var getDimensions = (src, variant) => {
|
|
8771
|
-
var _a, _b, _c;
|
|
8772
|
-
if (typeof src === "object" && ((_a = src == null ? void 0 : src.name) == null ? void 0 : _a.includes(".svg"))) {
|
|
8773
|
-
const width = src.width;
|
|
8774
|
-
const height = src.height;
|
|
8775
|
-
return [width, height];
|
|
8776
|
-
}
|
|
8777
|
-
if (typeof src === "object") {
|
|
8778
|
-
const width = ((_b = src.sizes[variant]) == null ? void 0 : _b.width) || null;
|
|
8779
|
-
const height = ((_c = src.sizes[variant]) == null ? void 0 : _c.height) || null;
|
|
8780
|
-
return [width, height];
|
|
8781
|
-
}
|
|
8782
|
-
return [null, null];
|
|
8783
|
-
};
|
|
8784
|
-
var getAlt = (src) => {
|
|
8785
|
-
const type = typeof src;
|
|
8786
|
-
if (type === "object" && src.alt) {
|
|
8787
|
-
return src.alt;
|
|
8788
|
-
}
|
|
8789
|
-
if (type === "object") {
|
|
8790
|
-
const imageObj = src.image || src;
|
|
8791
|
-
const altSetting = ((imageObj == null ? void 0 : imageObj.settings) || []).find(
|
|
8792
|
-
(setting) => setting.key === "alt"
|
|
8793
|
-
);
|
|
8794
|
-
if (altSetting) {
|
|
8795
|
-
return altSetting.value;
|
|
8796
|
-
}
|
|
8797
|
-
}
|
|
8798
|
-
return "";
|
|
8799
|
-
};
|
|
8800
|
-
var getSrc = (src, variant) => {
|
|
8801
|
-
var _a, _b, _c;
|
|
8802
|
-
if (typeof src === "object") {
|
|
8803
|
-
if (((_a = src == null ? void 0 : src.name) == null ? void 0 : _a.includes(".svg")) || ((_b = src == null ? void 0 : src.name) == null ? void 0 : _b.includes(".gif"))) {
|
|
8804
|
-
return [null, (_c = src.urls) == null ? void 0 : _c.original];
|
|
8805
|
-
}
|
|
8806
|
-
const fallback = src.urls[variant];
|
|
8807
|
-
const webp = getWebp(fallback);
|
|
8808
|
-
return [webp, fallback];
|
|
8809
|
-
}
|
|
8810
|
-
return [null, src];
|
|
8811
|
-
};
|
|
8812
|
-
var getImageObjOrSrc = (value) => {
|
|
8813
|
-
const type = typeof value;
|
|
8814
|
-
if (type === "object" && value.hasOwnProperty("image")) {
|
|
8815
|
-
return value.image;
|
|
8816
|
-
}
|
|
8817
|
-
return value;
|
|
8818
|
-
};
|
|
8819
|
-
var Image = (_a) => {
|
|
8820
|
-
var _b = _a, { variant, src, alt, loading = "lazy" } = _b, props = __objRest(_b, ["variant", "src", "alt", "loading"]);
|
|
8821
|
-
console.log(props);
|
|
8822
|
-
if (!variant) {
|
|
8823
|
-
console.error("Image with no variant", { variant, src, alt, props });
|
|
8824
|
-
return null;
|
|
8825
|
-
}
|
|
8826
|
-
if (!src) {
|
|
8827
|
-
console.error("Image with no src", { variant, src, alt, props });
|
|
8828
|
-
return null;
|
|
8829
|
-
}
|
|
8830
|
-
const imageObjOrSrc = getImageObjOrSrc(src);
|
|
8831
|
-
if (imageObjOrSrc && typeof imageObjOrSrc === "object" && !imageObjOrSrc.sizes) {
|
|
8832
|
-
console.error("Image with no sizes", { variant, src, alt, props });
|
|
8833
|
-
return null;
|
|
8834
|
-
}
|
|
8835
|
-
const [width, height] = getDimensions(imageObjOrSrc, variant);
|
|
8836
|
-
const altAttr = alt || getAlt(src);
|
|
8837
|
-
const [webp, fallback] = getSrc(imageObjOrSrc, variant);
|
|
8838
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("picture", { children: [
|
|
8839
|
-
webp && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("source", { srcSet: encodeURI(webp), type: "image/webp" }),
|
|
8840
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("source", { srcSet: encodeURI(fallback), type: src.mime_type }),
|
|
8841
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
8842
|
-
"img",
|
|
8843
|
-
__spreadValues({
|
|
8844
|
-
src: fallback,
|
|
8845
|
-
alt: altAttr,
|
|
8846
|
-
width,
|
|
8847
|
-
height,
|
|
8848
|
-
loading
|
|
8849
|
-
}, props)
|
|
8850
|
-
)
|
|
8851
|
-
] });
|
|
8852
|
-
};
|
|
8853
|
-
var Image_default = Image;
|
|
8854
|
-
|
|
8855
|
-
// src/List.js
|
|
8856
|
-
var import_react26 = __toESM(require("react"));
|
|
8857
|
-
var import_react_sortablejs3 = require("react-sortablejs");
|
|
8858
|
-
var import_ui15 = __toESM(require_dist());
|
|
8859
|
-
var import_ui16 = __toESM(require_dist());
|
|
8860
|
-
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
8861
|
-
var Handle = (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(HandleWrapper, { "data-drag": true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8862
|
-
"img",
|
|
8863
|
-
__spreadProps(__spreadValues({}, props), {
|
|
8864
|
-
src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjUiIHZpZXdCb3g9IjAgMCAyNCAyNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTggMTguNUwxMiAyMi41TDE2IDE4LjUiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik04IDYuNUwxMiAyLjVMMTYgNi41IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMTIgMi41VjIyLjUiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=",
|
|
8865
|
-
style: {
|
|
8866
|
-
width: "42px",
|
|
8867
|
-
height: "42px",
|
|
8868
|
-
padding: "0 12px"
|
|
8869
|
-
},
|
|
8870
|
-
alt: "handle"
|
|
8871
|
-
})
|
|
8872
|
-
) });
|
|
8873
|
-
var IconDelete2 = () => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8874
|
-
"img",
|
|
8875
|
-
{
|
|
8876
|
-
src: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItdHJhc2giPjxwb2x5bGluZSBwb2ludHM9IjMgNiA1IDYgMjEgNiI+PC9wb2x5bGluZT48cGF0aCBkPSJNMTkgNnYxNGEyIDIgMCAwIDEtMiAySDdhMiAyIDAgMCAxLTItMlY2bTMgMFY0YTIgMiAwIDAgMSAyLTJoNGEyIDIgMCAwIDEgMiAydjIiPjwvcGF0aD48L3N2Zz4=",
|
|
8877
|
-
style: { width: "42px", height: "42px", padding: "12px 12px 12px 8px" },
|
|
8878
|
-
alt: "delete"
|
|
8879
|
-
}
|
|
8880
|
-
);
|
|
8881
|
-
var IconDuplicate = () => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8882
|
-
"img",
|
|
8883
|
-
{
|
|
8884
|
-
src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjUiIHZpZXdCb3g9IjAgMCAyNCAyNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIwIDguNUgxMEM4Ljg5NTQzIDguNSA4IDkuMzk1NDMgOCAxMC41VjIwLjVDOCAyMS42MDQ2IDguODk1NDMgMjIuNSAxMCAyMi41SDIwQzIxLjEwNDYgMjIuNSAyMiAyMS42MDQ2IDIyIDIwLjVWMTAuNUMyMiA5LjM5NTQzIDIxLjEwNDYgOC41IDIwIDguNVoiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik00IDE2LjVDMi45IDE2LjUgMiAxNS42IDIgMTQuNVY0LjVDMiAzLjQgMi45IDIuNSA0IDIuNUgxNEMxNS4xIDIuNSAxNiAzLjQgMTYgNC41IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K",
|
|
8885
|
-
style: { width: "42px", height: "42px", padding: "12px 8px 12px 12px" },
|
|
8886
|
-
alt: "maximize"
|
|
8887
|
-
}
|
|
8888
|
-
);
|
|
8889
|
-
var ListWrapper = (_a) => {
|
|
8890
|
-
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8891
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", __spreadValues({ className: (0, import_ui16.cn)("r-reset", "r-list-wrapper", className) }, rest));
|
|
8892
|
-
};
|
|
8893
|
-
var AddButtonWrapepr = (_a) => {
|
|
8894
|
-
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8895
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8896
|
-
"div",
|
|
8897
|
-
__spreadValues({
|
|
8898
|
-
className: (0, import_ui16.cn)("r-reset", "r-list-add-button-wrapper", className)
|
|
8899
|
-
}, rest)
|
|
8900
|
-
);
|
|
8901
|
-
};
|
|
8902
|
-
var HandleWrapper = (_a) => {
|
|
8903
|
-
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8904
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8905
|
-
"div",
|
|
8906
|
-
__spreadValues({
|
|
8907
|
-
className: (0, import_ui16.cn)("r-reset", "r-list-handle-wrapper", className)
|
|
8908
|
-
}, rest)
|
|
8909
|
-
);
|
|
8910
|
-
};
|
|
8911
|
-
var ItemWrapper = (_a) => {
|
|
8912
|
-
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8913
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", __spreadValues({ className: (0, import_ui16.cn)("r-reset", "r-list-item-wrapper", className) }, rest));
|
|
8914
|
-
};
|
|
8915
|
-
var TitleBar = (_a) => {
|
|
8916
|
-
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8917
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", __spreadValues({ className: (0, import_ui16.cn)("r-reset", "r-list-title-bar", className) }, rest));
|
|
8918
|
-
};
|
|
8919
|
-
var TitleWrapper = (_a) => {
|
|
8920
|
-
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8921
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", __spreadValues({ className: (0, import_ui16.cn)("r-reset", "r-list-title-wrapper", className) }, rest));
|
|
8922
|
-
};
|
|
8923
|
-
var ContentWrapper = (_a) => {
|
|
8924
|
-
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8925
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8926
|
-
"div",
|
|
8927
|
-
__spreadValues({
|
|
8928
|
-
className: (0, import_ui16.cn)("r-reset", className),
|
|
8929
|
-
style: { padding: "12px 8px" }
|
|
8930
|
-
}, rest)
|
|
8931
|
-
);
|
|
8932
|
-
};
|
|
8933
|
-
var ListButton = (_a) => {
|
|
8934
|
-
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8935
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8936
|
-
"div",
|
|
8937
|
-
__spreadValues({
|
|
8938
|
-
className: (0, import_ui16.cn)("r-reset", "r-button-reset r-list-button", className)
|
|
8939
|
-
}, rest)
|
|
8940
|
-
);
|
|
8941
|
-
};
|
|
8942
|
-
var Title = (_a) => {
|
|
8943
|
-
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
8944
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8945
|
-
"div",
|
|
8946
|
-
__spreadValues({
|
|
8947
|
-
className: (0, import_ui16.cn)("r-reset", className),
|
|
8948
|
-
style: { fontWeight: "700", fontSize: "16px", minHeight: "16px" }
|
|
8949
|
-
}, rest)
|
|
8950
|
-
);
|
|
8951
|
-
};
|
|
8952
|
-
var extractPrimaryField = (primaryField2, item, idx) => {
|
|
8953
|
-
if (!primaryField2) {
|
|
8954
|
-
return `Item ${idx + 1}`;
|
|
8955
|
-
}
|
|
8956
|
-
const keys = primaryField2.split(".");
|
|
8957
|
-
if (keys.length === 1) {
|
|
8958
|
-
return item[primaryField2];
|
|
8959
|
-
}
|
|
8960
|
-
return primaryField2.split(".").reduce((acc, key) => {
|
|
8961
|
-
const newValue = acc && acc[key] || "";
|
|
8962
|
-
return newValue;
|
|
8963
|
-
}, item);
|
|
8964
|
-
};
|
|
8965
|
-
var Item = ({
|
|
8966
|
-
idx,
|
|
8967
|
-
items,
|
|
8968
|
-
item,
|
|
8969
|
-
alwaysOpened,
|
|
8970
|
-
primaryField: primaryField2,
|
|
8971
|
-
template,
|
|
8972
|
-
handleRemove,
|
|
8973
|
-
handleChangeField,
|
|
8974
|
-
handleDuplicate,
|
|
8975
|
-
listItem
|
|
8976
|
-
}) => {
|
|
8977
|
-
const [open, setOpen] = import_react26.default.useState(alwaysOpened);
|
|
8978
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(ItemWrapper, { children: [
|
|
8979
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(TitleBar, { children: [
|
|
8980
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Handle, {}),
|
|
8981
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(TitleWrapper, { onClick: () => setOpen(!open), children: [
|
|
8982
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Title, { children: extractPrimaryField(primaryField2, item, idx) }),
|
|
8983
|
-
!alwaysOpened && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ListButton, { type: "button" })
|
|
8984
|
-
] }),
|
|
8985
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
8986
|
-
"div",
|
|
8987
|
-
{
|
|
8988
|
-
style: {
|
|
8989
|
-
display: "flex"
|
|
8990
|
-
},
|
|
8991
|
-
children: [
|
|
8992
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8993
|
-
ListButton,
|
|
8994
|
-
{
|
|
8995
|
-
type: "button",
|
|
8996
|
-
danger: true,
|
|
8997
|
-
onClick: () => handleDuplicate(item, idx),
|
|
8998
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(IconDuplicate, {})
|
|
8999
|
-
}
|
|
9000
|
-
),
|
|
9001
|
-
(template || !template && items.length !== 1) && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ListButton, { type: "button", danger: true, onClick: () => handleRemove(idx), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(IconDelete2, {}) })
|
|
9002
|
-
]
|
|
9003
|
-
}
|
|
9004
|
-
)
|
|
9005
|
-
] }),
|
|
9006
|
-
(alwaysOpened || open) && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ContentWrapper, { children: listItem(
|
|
9007
|
-
item,
|
|
9008
|
-
(field, value) => handleChangeField(idx, field, value),
|
|
9009
|
-
idx
|
|
9010
|
-
) })
|
|
9011
|
-
] });
|
|
9012
|
-
};
|
|
9013
|
-
var List = ({
|
|
9014
|
-
label,
|
|
9015
|
-
items: defaultItems = [],
|
|
9016
|
-
listItem,
|
|
9017
|
-
template,
|
|
9018
|
-
primaryField: primaryField2,
|
|
9019
|
-
onChangeList,
|
|
9020
|
-
itemsAlwaysOpen = false
|
|
9021
|
-
}) => {
|
|
9022
|
-
const [items, setItems] = import_react26.default.useState(defaultItems);
|
|
9023
|
-
const factory = (template2) => {
|
|
9024
|
-
if (!template2)
|
|
9025
|
-
throw new Error("Template not specified for this list");
|
|
9026
|
-
return Object.assign({}, template2, { id: randomId() });
|
|
9027
|
-
};
|
|
9028
|
-
const handleChangeField = (idx, field, value) => {
|
|
9029
|
-
const newItems = updateFieldByIndex(items, field, value, idx);
|
|
9030
|
-
setItems(newItems);
|
|
9031
|
-
notifyChange(newItems);
|
|
9032
|
-
};
|
|
9033
|
-
const notifyChange = (items2) => {
|
|
9034
|
-
onChangeList("list", items2);
|
|
9035
|
-
};
|
|
9036
|
-
const handleAdd = () => {
|
|
9037
|
-
const newItems = add(items, factory(template));
|
|
9038
|
-
setItems(newItems);
|
|
9039
|
-
notifyChange(newItems);
|
|
9040
|
-
};
|
|
9041
|
-
const handleDuplicateField = (item, idx) => {
|
|
9042
|
-
const newItems = duplicate(items, factory(item), idx);
|
|
9043
|
-
setItems(newItems);
|
|
9044
|
-
notifyChange(newItems);
|
|
9045
|
-
};
|
|
9046
|
-
const handleAddAtBeggining = () => {
|
|
9047
|
-
const newItems = addAtBeggining(items, factory(template));
|
|
9048
|
-
setItems(newItems);
|
|
9049
|
-
notifyChange(newItems);
|
|
9050
|
-
};
|
|
9051
|
-
const handleReorder = (items2) => {
|
|
9052
|
-
setItems(items2);
|
|
9053
|
-
notifyChange(items2);
|
|
9054
|
-
};
|
|
9055
|
-
const handleRemove = (idx) => {
|
|
9056
|
-
if (!template && items.length === 1)
|
|
9057
|
-
return;
|
|
9058
|
-
const newItems = removeByIndex(items, idx);
|
|
9059
|
-
setItems(newItems);
|
|
9060
|
-
notifyChange(newItems);
|
|
9061
|
-
};
|
|
9062
|
-
if (!primaryField2)
|
|
9063
|
-
console.warn("No primaryField provided for a list", items);
|
|
9064
|
-
if (!label)
|
|
9065
|
-
console.warn("No label provided for a list", items);
|
|
9066
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(ListWrapper, { children: [
|
|
9067
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_ui15.H, { size: "base", style: { fontWeight: 700 }, children: label }),
|
|
9068
|
-
items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_ui15.P, { children: "There are no items yet." }),
|
|
9069
|
-
items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react26.default.Fragment, { children: [
|
|
9070
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(AddButtonWrapepr, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9071
|
-
import_ui15.Button,
|
|
9084
|
+
reorderOpen && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9085
|
+
ReorderDialog_default,
|
|
9072
9086
|
{
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9087
|
+
widgets: sortableWidgets,
|
|
9088
|
+
onChange: handleReorder,
|
|
9089
|
+
onDelete: handleRemove,
|
|
9090
|
+
onSelectWidget: setSelectedWidget,
|
|
9091
|
+
onClose: () => setReorderOpen(false),
|
|
9092
|
+
selectedWidgets,
|
|
9093
|
+
onSelectWidgets: handleSelectWidget,
|
|
9094
|
+
onCopy: () => handleCopyWidgets(selectedWidgets, "multiple"),
|
|
9095
|
+
onRemove: handleRemoveMultiple,
|
|
9096
|
+
onSelectAll: handleSelectAll
|
|
9077
9097
|
}
|
|
9078
|
-
)
|
|
9079
|
-
/* @__PURE__ */ (0,
|
|
9080
|
-
|
|
9098
|
+
),
|
|
9099
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9100
|
+
AdminSidebar_default,
|
|
9081
9101
|
{
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9102
|
+
languageSwitcherSettings,
|
|
9103
|
+
buttons: sidebarButtons,
|
|
9104
|
+
onAddWidget: (widgetName) => handleAdd(widgetName),
|
|
9105
|
+
onReorderDialog: () => setReorderOpen(true),
|
|
9106
|
+
onExit,
|
|
9107
|
+
onPasteWidget: handlePasteWidget,
|
|
9108
|
+
pageHistory,
|
|
9109
|
+
setPage,
|
|
9110
|
+
undoChanges: handleUndoChanges,
|
|
9111
|
+
redoChanges: handleRedoChanges,
|
|
9112
|
+
historyIndex
|
|
9113
|
+
}
|
|
9114
|
+
),
|
|
9115
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9116
|
+
Canvas_default,
|
|
9117
|
+
{
|
|
9118
|
+
widgets: sortableWidgets,
|
|
9119
|
+
onReorder: handleReorder,
|
|
9120
|
+
onEdit: setSelectedWidget,
|
|
9121
|
+
onRemove: handleRemove,
|
|
9122
|
+
onCopy: handleCopyWidgets,
|
|
9123
|
+
selectedWidgets,
|
|
9124
|
+
onSelectWidget: handleSelectWidget,
|
|
9125
|
+
canvasClassName
|
|
9126
|
+
}
|
|
9127
|
+
),
|
|
9128
|
+
selectedWidget && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9129
|
+
SettingsDialog_default,
|
|
9130
|
+
{
|
|
9131
|
+
widget: currentWidget,
|
|
9132
|
+
settings: selectedWidget.settings,
|
|
9133
|
+
onSave: handleSaveWidget,
|
|
9134
|
+
onClose: handleClose
|
|
9104
9135
|
}
|
|
9105
9136
|
)
|
|
9106
|
-
] })
|
|
9107
|
-
|
|
9137
|
+
] })
|
|
9138
|
+
] }) });
|
|
9139
|
+
};
|
|
9140
|
+
var PageBuilder_default = PageBuilder;
|
|
9141
|
+
|
|
9142
|
+
// src/lib/Image.js
|
|
9143
|
+
var import_react26 = __toESM(require("react"));
|
|
9144
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
9145
|
+
var getWebp = (url) => {
|
|
9146
|
+
if (!url)
|
|
9147
|
+
return null;
|
|
9148
|
+
const segments = url.split(".");
|
|
9149
|
+
segments[segments.length - 1] = "webp";
|
|
9150
|
+
return segments.join(".");
|
|
9151
|
+
};
|
|
9152
|
+
var getDimensions = (src, variant) => {
|
|
9153
|
+
var _a, _b, _c;
|
|
9154
|
+
if (typeof src === "object" && ((_a = src == null ? void 0 : src.name) == null ? void 0 : _a.includes(".svg"))) {
|
|
9155
|
+
const width = src.width;
|
|
9156
|
+
const height = src.height;
|
|
9157
|
+
return [width, height];
|
|
9158
|
+
}
|
|
9159
|
+
if (typeof src === "object") {
|
|
9160
|
+
const width = ((_b = src.sizes[variant]) == null ? void 0 : _b.width) || null;
|
|
9161
|
+
const height = ((_c = src.sizes[variant]) == null ? void 0 : _c.height) || null;
|
|
9162
|
+
return [width, height];
|
|
9163
|
+
}
|
|
9164
|
+
return [null, null];
|
|
9165
|
+
};
|
|
9166
|
+
var getAlt = (src) => {
|
|
9167
|
+
const type = typeof src;
|
|
9168
|
+
if (type === "object" && src.alt) {
|
|
9169
|
+
return src.alt;
|
|
9170
|
+
}
|
|
9171
|
+
if (type === "object") {
|
|
9172
|
+
const imageObj = src.image || src;
|
|
9173
|
+
const altSetting = ((imageObj == null ? void 0 : imageObj.settings) || []).find(
|
|
9174
|
+
(setting) => setting.key === "alt"
|
|
9175
|
+
);
|
|
9176
|
+
if (altSetting) {
|
|
9177
|
+
return altSetting.value;
|
|
9178
|
+
}
|
|
9179
|
+
}
|
|
9180
|
+
return "";
|
|
9181
|
+
};
|
|
9182
|
+
var getSrc = (src, variant) => {
|
|
9183
|
+
var _a, _b, _c;
|
|
9184
|
+
if (typeof src === "object") {
|
|
9185
|
+
if (((_a = src == null ? void 0 : src.name) == null ? void 0 : _a.includes(".svg")) || ((_b = src == null ? void 0 : src.name) == null ? void 0 : _b.includes(".gif"))) {
|
|
9186
|
+
return [null, (_c = src.urls) == null ? void 0 : _c.original];
|
|
9187
|
+
}
|
|
9188
|
+
const fallback = src.urls[variant];
|
|
9189
|
+
const webp = getWebp(fallback);
|
|
9190
|
+
return [webp, fallback];
|
|
9191
|
+
}
|
|
9192
|
+
return [null, src];
|
|
9193
|
+
};
|
|
9194
|
+
var getImageObjOrSrc = (value) => {
|
|
9195
|
+
const type = typeof value;
|
|
9196
|
+
if (type === "object" && value.hasOwnProperty("image")) {
|
|
9197
|
+
return value.image;
|
|
9198
|
+
}
|
|
9199
|
+
return value;
|
|
9200
|
+
};
|
|
9201
|
+
var Image = (_a) => {
|
|
9202
|
+
var _b = _a, { variant, src, alt, loading = "lazy" } = _b, props = __objRest(_b, ["variant", "src", "alt", "loading"]);
|
|
9203
|
+
console.log(props);
|
|
9204
|
+
if (!variant) {
|
|
9205
|
+
console.error("Image with no variant", { variant, src, alt, props });
|
|
9206
|
+
return null;
|
|
9207
|
+
}
|
|
9208
|
+
if (!src) {
|
|
9209
|
+
console.error("Image with no src", { variant, src, alt, props });
|
|
9210
|
+
return null;
|
|
9211
|
+
}
|
|
9212
|
+
const imageObjOrSrc = getImageObjOrSrc(src);
|
|
9213
|
+
if (imageObjOrSrc && typeof imageObjOrSrc === "object" && !imageObjOrSrc.sizes) {
|
|
9214
|
+
console.error("Image with no sizes", { variant, src, alt, props });
|
|
9215
|
+
return null;
|
|
9216
|
+
}
|
|
9217
|
+
const [width, height] = getDimensions(imageObjOrSrc, variant);
|
|
9218
|
+
const altAttr = alt || getAlt(src);
|
|
9219
|
+
const [webp, fallback] = getSrc(imageObjOrSrc, variant);
|
|
9220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("picture", { children: [
|
|
9221
|
+
webp && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("source", { srcSet: encodeURI(webp), type: "image/webp" }),
|
|
9222
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("source", { srcSet: encodeURI(fallback), type: src.mime_type }),
|
|
9223
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9224
|
+
"img",
|
|
9225
|
+
__spreadValues({
|
|
9226
|
+
src: fallback,
|
|
9227
|
+
alt: altAttr,
|
|
9228
|
+
width,
|
|
9229
|
+
height,
|
|
9230
|
+
loading
|
|
9231
|
+
}, props)
|
|
9232
|
+
)
|
|
9108
9233
|
] });
|
|
9109
9234
|
};
|
|
9110
|
-
var
|
|
9235
|
+
var Image_default = Image;
|
|
9111
9236
|
|
|
9112
9237
|
// src/MediaManager.js
|
|
9113
9238
|
var MediaManager = class {
|
|
@@ -9167,117 +9292,12 @@ var Button4 = ({ settings, className }) => {
|
|
|
9167
9292
|
};
|
|
9168
9293
|
var Button_default = Button4;
|
|
9169
9294
|
|
|
9170
|
-
// src/
|
|
9295
|
+
// src/lib/Link.js
|
|
9171
9296
|
var import_react29 = __toESM(require("react"));
|
|
9172
|
-
var import_ui17 = __toESM(require_dist());
|
|
9173
9297
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
9174
|
-
var SettingsIcon2 = (_a) => {
|
|
9175
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9176
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", __spreadValues({ className: (0, import_ui17.cn)("r-settings-icon", className) }, props));
|
|
9177
|
-
};
|
|
9178
|
-
var ThreeColumns2 = (_a) => {
|
|
9179
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9180
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", __spreadValues({ className: (0, import_ui17.cn)("r-reset", "r-three-columns", className) }, props));
|
|
9181
|
-
};
|
|
9182
|
-
var FormSectionTitle2 = (_a) => {
|
|
9183
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9184
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
9185
|
-
"div",
|
|
9186
|
-
__spreadValues({
|
|
9187
|
-
className: (0, import_ui17.cn)("r-reset", "r-form-section-title", className)
|
|
9188
|
-
}, props)
|
|
9189
|
-
);
|
|
9190
|
-
};
|
|
9191
|
-
var ButtonControl2 = (_a) => {
|
|
9192
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9193
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", __spreadValues({ className: (0, import_ui17.cn)("r-reset", "r-button-control", className) }, props));
|
|
9194
|
-
};
|
|
9195
|
-
var mergeSettings2 = (settings, key, value) => Object.assign({}, settings, { [key]: value });
|
|
9196
|
-
var DEFAULTS2 = {
|
|
9197
|
-
label: "link",
|
|
9198
|
-
link: "#",
|
|
9199
|
-
id: "",
|
|
9200
|
-
className: "",
|
|
9201
|
-
target: "_self",
|
|
9202
|
-
rel: "follow"
|
|
9203
|
-
};
|
|
9204
|
-
var LinkSettings = ({ label = "Link", hint, value = DEFAULTS2, onChange }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(ButtonControl2, { children: [
|
|
9205
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(FormSectionTitle2, { children: [
|
|
9206
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SettingsIcon2, {}),
|
|
9207
|
-
" ",
|
|
9208
|
-
label
|
|
9209
|
-
] }),
|
|
9210
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(ThreeColumns2, { children: [
|
|
9211
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
9212
|
-
TextInput_default,
|
|
9213
|
-
{
|
|
9214
|
-
label: "Label",
|
|
9215
|
-
value: value.label,
|
|
9216
|
-
onChange: (label2) => onChange(mergeSettings2(value, "label", label2))
|
|
9217
|
-
}
|
|
9218
|
-
),
|
|
9219
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
9220
|
-
TextInput_default,
|
|
9221
|
-
{
|
|
9222
|
-
label: "Link",
|
|
9223
|
-
value: value.link,
|
|
9224
|
-
onChange: (link) => onChange(mergeSettings2(value, "link", link))
|
|
9225
|
-
}
|
|
9226
|
-
),
|
|
9227
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
9228
|
-
TextInput_default,
|
|
9229
|
-
{
|
|
9230
|
-
label: "ID",
|
|
9231
|
-
value: value.id,
|
|
9232
|
-
onChange: (id) => onChange(mergeSettings2(value, "id", id))
|
|
9233
|
-
}
|
|
9234
|
-
)
|
|
9235
|
-
] }),
|
|
9236
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(ThreeColumns2, { children: [
|
|
9237
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
9238
|
-
TextInput_default,
|
|
9239
|
-
{
|
|
9240
|
-
label: "CSS Class",
|
|
9241
|
-
value: value.className,
|
|
9242
|
-
onChange: (className) => onChange(mergeSettings2(value, "className", className))
|
|
9243
|
-
}
|
|
9244
|
-
),
|
|
9245
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
9246
|
-
SelectMenu_default,
|
|
9247
|
-
{
|
|
9248
|
-
label: "Target",
|
|
9249
|
-
options: [
|
|
9250
|
-
["_self", "Self"],
|
|
9251
|
-
["_blank", "New Tab"]
|
|
9252
|
-
],
|
|
9253
|
-
value: value.target,
|
|
9254
|
-
onChange: (target) => onChange(mergeSettings2(value, "target", target))
|
|
9255
|
-
}
|
|
9256
|
-
),
|
|
9257
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
9258
|
-
SelectMenu_default,
|
|
9259
|
-
{
|
|
9260
|
-
label: "Follow Link",
|
|
9261
|
-
options: [
|
|
9262
|
-
["follow", "Follow"],
|
|
9263
|
-
["nofollow", "No Follow"]
|
|
9264
|
-
],
|
|
9265
|
-
value: value.rel,
|
|
9266
|
-
onChange: (rel) => onChange(mergeSettings2(value, "rel", rel))
|
|
9267
|
-
}
|
|
9268
|
-
)
|
|
9269
|
-
] }),
|
|
9270
|
-
hint ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui17.Hint, { children: hint }) : ""
|
|
9271
|
-
] });
|
|
9272
|
-
LinkSettings.defaults = DEFAULTS2;
|
|
9273
|
-
var LinkSettings_default = LinkSettings;
|
|
9274
|
-
|
|
9275
|
-
// src/lib/Link.js
|
|
9276
|
-
var import_react30 = __toESM(require("react"));
|
|
9277
|
-
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
9278
9298
|
var Link = ({ settings, children, className }) => {
|
|
9279
9299
|
const { id, label, link, target, rel } = settings;
|
|
9280
|
-
return /* @__PURE__ */ (0,
|
|
9300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
9281
9301
|
"a",
|
|
9282
9302
|
{
|
|
9283
9303
|
href: link,
|
|
@@ -9292,13 +9312,12 @@ var Link = ({ settings, children, className }) => {
|
|
|
9292
9312
|
var Link_default = Link;
|
|
9293
9313
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9294
9314
|
0 && (module.exports = {
|
|
9315
|
+
AdminForm,
|
|
9295
9316
|
BuilderContext,
|
|
9296
9317
|
Button,
|
|
9297
9318
|
ButtonSettings,
|
|
9298
9319
|
Dialog,
|
|
9299
9320
|
FormGroup,
|
|
9300
|
-
ImageInput,
|
|
9301
|
-
ImagePicker,
|
|
9302
9321
|
Img,
|
|
9303
9322
|
Label,
|
|
9304
9323
|
Link,
|
|
@@ -9307,7 +9326,6 @@ var Link_default = Link;
|
|
|
9307
9326
|
ListInput,
|
|
9308
9327
|
MediaManager,
|
|
9309
9328
|
PageBuilder,
|
|
9310
|
-
RichText,
|
|
9311
9329
|
SelectMenu,
|
|
9312
9330
|
TextArea,
|
|
9313
9331
|
TextInput
|