@raketa-builder/builder 0.26.0 → 0.28.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 +3 -3
- package/dist/index.js +557 -298
- package/package.json +1 -1
- package/src/Canvas.js +20 -2
- package/src/PageBuilder.js +74 -8
- package/src/dialogs/ReorderDialog.js +77 -22
- package/src/icons/IconCopy.js +33 -0
- package/src/icons/IconDelete.js +33 -0
- package/src/icons/index.js +4 -0
- package/src/index.js +0 -2
- package/src/lib/AdminWidget.js +42 -17
- package/src/lib/IconButton.js +0 -1
- package/src/lib/ModalSelectedWidgetsToolbar.js +51 -0
- package/src/lib/SelectedWidgetsToolbar.js +28 -0
- package/src/lists/index.js +7 -2
- package/src/styles.css +124 -3
- package/src/AdminPageRender.js +0 -29
- package/src/lib/AdminWidgetMinimal.js +0 -48
package/src/styles.css
CHANGED
|
@@ -12,11 +12,12 @@
|
|
|
12
12
|
|
|
13
13
|
/* Reorder Dialog */
|
|
14
14
|
.r-reorder-dialog-item {
|
|
15
|
+
height: 48px;
|
|
15
16
|
display: flex;
|
|
16
17
|
justify-content: space-between;
|
|
17
18
|
align-items: center;
|
|
18
19
|
margin-bottom: 7px;
|
|
19
|
-
padding: 7px;
|
|
20
|
+
padding: 7px 7px 7px 9px;
|
|
20
21
|
border: 1px solid var(--r-gray);
|
|
21
22
|
border-radius: 3px;
|
|
22
23
|
color: var(--r-black);
|
|
@@ -95,14 +96,16 @@
|
|
|
95
96
|
z-index: 900;
|
|
96
97
|
display: none;
|
|
97
98
|
}
|
|
98
|
-
|
|
99
|
-
.r-admin-widget-wrapper:hover {
|
|
99
|
+
.r-admin-widget-wrapper {
|
|
100
100
|
position: relative;
|
|
101
|
+
}
|
|
102
|
+
.r-admin-widget-wrapper:hover {
|
|
101
103
|
outline: 1px dashed var(--r-gray);
|
|
102
104
|
}
|
|
103
105
|
|
|
104
106
|
.r-admin-widget-wrapper:hover [data-toolbar="true"] {
|
|
105
107
|
display: flex;
|
|
108
|
+
gap: 8px;
|
|
106
109
|
}
|
|
107
110
|
|
|
108
111
|
.r-admin-widget-wrapper:hover [data-widget-label="true"] {
|
|
@@ -387,6 +390,124 @@
|
|
|
387
390
|
align-items: center;
|
|
388
391
|
height: 100vh;
|
|
389
392
|
}
|
|
393
|
+
/* Custom Checkbox */
|
|
394
|
+
|
|
395
|
+
.r-checkbox-wrapper {
|
|
396
|
+
display: block;
|
|
397
|
+
position: relative;
|
|
398
|
+
padding-left: 30px;
|
|
399
|
+
margin-bottom: 15px;
|
|
400
|
+
cursor: pointer;
|
|
401
|
+
font-size: 18px;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/* Hide default browser input */
|
|
405
|
+
.r-checkbox-wrapper input {
|
|
406
|
+
position: absolute;
|
|
407
|
+
z-index: -1;
|
|
408
|
+
opacity: 0;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/* Canvas Selected Widgets Tray */
|
|
412
|
+
|
|
413
|
+
.r-selected-widgets-toolbar {
|
|
414
|
+
overflow: hidden;
|
|
415
|
+
position: fixed;
|
|
416
|
+
z-index: 20;
|
|
417
|
+
left: 50%;
|
|
418
|
+
bottom: 1rem;
|
|
419
|
+
border-radius: 9999px;
|
|
420
|
+
outline: 1px solid #444;
|
|
421
|
+
color: #fff;
|
|
422
|
+
background-color: var(--r-black);
|
|
423
|
+
font-size: 13px;
|
|
424
|
+
box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.75);
|
|
425
|
+
transform: translateX(-50%);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.r-toolbar-inner {
|
|
429
|
+
display: flex;
|
|
430
|
+
align-items: center;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.r-button-reset {
|
|
434
|
+
background: none;
|
|
435
|
+
color: inherit;
|
|
436
|
+
border: none;
|
|
437
|
+
padding: 0;
|
|
438
|
+
cursor: pointer;
|
|
439
|
+
outline: inherit;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
.r-toolbar-button {
|
|
443
|
+
padding: 16px 24px;
|
|
444
|
+
display: flex;
|
|
445
|
+
gap: 8px;
|
|
446
|
+
background-color: var(--r-black);
|
|
447
|
+
transition: 0.3s all ease-in-out;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
.r-toolbar-button:hover {
|
|
451
|
+
background-color: #444;
|
|
452
|
+
transition: 0.3s all ease-in-out;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.r-toolbar-button-copy {
|
|
456
|
+
padding-right: 16px;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.r-toolbar-button-delete {
|
|
460
|
+
padding-left: 16px;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.r-selected-widget {
|
|
464
|
+
position: absolute;
|
|
465
|
+
top: 0;
|
|
466
|
+
left: 0;
|
|
467
|
+
right: 0;
|
|
468
|
+
bottom: 0;
|
|
469
|
+
z-index: 15;
|
|
470
|
+
background-color: rgba(184, 96, 24, 0.308);
|
|
471
|
+
border: 1px solid rgb(231, 156, 15);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.r-selected-widget-toolbar-reorder {
|
|
475
|
+
padding-bottom: 16px;
|
|
476
|
+
display: flex;
|
|
477
|
+
align-items: center;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.r-label-select-all {
|
|
481
|
+
padding-bottom: 0;
|
|
482
|
+
margin-right: 32px;
|
|
483
|
+
display: flex;
|
|
484
|
+
align-items: center;
|
|
485
|
+
cursor: pointer;
|
|
486
|
+
font-weight: 500;
|
|
487
|
+
transition: 0.3s all ease-in-out;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.r-label-select-all:hover {
|
|
491
|
+
color: rgb(74, 76, 224);
|
|
492
|
+
transition: 0.3s all ease-in-out;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.r-selected {
|
|
496
|
+
background-color: rgba(184, 96, 24, 0.15);
|
|
497
|
+
border: 1px solid rgb(231, 156, 15);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
.r-button-toolbar-reorder {
|
|
501
|
+
font-weight: 500;
|
|
502
|
+
text-decoration: underline;
|
|
503
|
+
margin-right: 16px;
|
|
504
|
+
transition: 0.3s all ease-in-out;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
.r-button-toolbar-reorder:hover {
|
|
508
|
+
color: rgb(74, 76, 224);
|
|
509
|
+
transition: 0.3s all ease-in-out;
|
|
510
|
+
}
|
|
390
511
|
|
|
391
512
|
:root {
|
|
392
513
|
--settings-icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItc2xpZGVycyI+PGxpbmUgeDE9IjQiIHkxPSIyMSIgeDI9IjQiIHkyPSIxNCI+PC9saW5lPjxsaW5lIHgxPSI0IiB5MT0iMTAiIHgyPSI0IiB5Mj0iMyI+PC9saW5lPjxsaW5lIHgxPSIxMiIgeTE9IjIxIiB4Mj0iMTIiIHkyPSIxMiI+PC9saW5lPjxsaW5lIHgxPSIxMiIgeTE9IjgiIHgyPSIxMiIgeTI9IjMiPjwvbGluZT48bGluZSB4MT0iMjAiIHkxPSIyMSIgeDI9IjIwIiB5Mj0iMTYiPjwvbGluZT48bGluZSB4MT0iMjAiIHkxPSIxMiIgeDI9IjIwIiB5Mj0iMyI+PC9saW5lPjxsaW5lIHgxPSIxIiB5MT0iMTQiIHgyPSI3IiB5Mj0iMTQiPjwvbGluZT48bGluZSB4MT0iOSIgeTE9IjgiIHgyPSIxNSIgeTI9IjgiPjwvbGluZT48bGluZSB4MT0iMTciIHkxPSIxNiIgeDI9IjIzIiB5Mj0iMTYiPjwvbGluZT48L3N2Zz4=);
|
package/src/AdminPageRender.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import ErrorBoundary from "./ErrorBoundary";
|
|
3
|
-
import AdminWidgetMinimal from "./lib/AdminWidgetMinimal";
|
|
4
|
-
|
|
5
|
-
const AdminPageRender = ({ page, library, adminLibrary, identifier }) => {
|
|
6
|
-
const handleCopyWidgets = (widgets) => {
|
|
7
|
-
window.localStorage.setItem(
|
|
8
|
-
`clipboard–${identifier}`,
|
|
9
|
-
JSON.stringify(widgets)
|
|
10
|
-
);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<React.Fragment>
|
|
15
|
-
{page.widgets.map(({ widgetId, component, settings }) => (
|
|
16
|
-
<ErrorBoundary key={widgetId}>
|
|
17
|
-
<AdminWidgetMinimal
|
|
18
|
-
library={library}
|
|
19
|
-
adminLibrary={adminLibrary}
|
|
20
|
-
widget={{ widgetId, component, settings }}
|
|
21
|
-
onCopy={handleCopyWidgets}
|
|
22
|
-
/>
|
|
23
|
-
</ErrorBoundary>
|
|
24
|
-
))}
|
|
25
|
-
</React.Fragment>
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default AdminPageRender;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
import React from "react";
|
|
3
|
-
import AdminWidgetWrapper from "./AdminWidgetWrapper";
|
|
4
|
-
import AdminWidgetToolbar from "./AdminWidgetToolbar";
|
|
5
|
-
import AdminWidgetLabel from "./AdminWidgetLabel";
|
|
6
|
-
import IconButton from "./IconButton";
|
|
7
|
-
import widgetData from "../helpers/widgetData";
|
|
8
|
-
|
|
9
|
-
const AdminWidgetMinimal = ({ library, adminLibrary, widget, onCopy }) => {
|
|
10
|
-
const currentWidget = library[widget.component];
|
|
11
|
-
const currentAdminWidget = adminLibrary[widget.component];
|
|
12
|
-
|
|
13
|
-
if (!currentWidget || !currentAdminWidget) {
|
|
14
|
-
console.error(`Unknown widget: ${widget.component}`);
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const handleCopyWidget = () => {
|
|
19
|
-
const widgetsToCopy = [widget];
|
|
20
|
-
onCopy(widgetsToCopy);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<AdminWidgetWrapper data-widget={widget.component}>
|
|
25
|
-
<AdminWidgetToolbar data-toolbar>
|
|
26
|
-
{!widgetData.deprecated(currentAdminWidget) && (
|
|
27
|
-
<IconButton
|
|
28
|
-
icon="iconCopy"
|
|
29
|
-
type="neutral"
|
|
30
|
-
onClick={handleCopyWidget}
|
|
31
|
-
/>
|
|
32
|
-
)}
|
|
33
|
-
</AdminWidgetToolbar>
|
|
34
|
-
|
|
35
|
-
<AdminWidgetLabel data-widget-label>
|
|
36
|
-
{widgetData.title(currentAdminWidget)}
|
|
37
|
-
</AdminWidgetLabel>
|
|
38
|
-
|
|
39
|
-
{React.createElement(currentWidget, widget.settings)}
|
|
40
|
-
</AdminWidgetWrapper>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
AdminWidgetMinimal.defaultProps = {
|
|
45
|
-
containerSettings: {},
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export default AdminWidgetMinimal;
|