@raketa-builder/builder 0.12.0 → 0.20.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 +2 -2
- package/dist/index.js +943 -1425
- package/package.json +1 -2
- package/src/Canvas.js +4 -9
- package/src/List.js +54 -70
- package/src/ListInput.js +1 -8
- package/src/PageBuilder.js +41 -46
- package/src/dialogs/Dialog.js +7 -10
- package/src/dialogs/ReorderDialog.js +4 -18
- package/src/forms/ButtonSettings.js +19 -51
- package/src/forms/LinkSettings.js +19 -52
- package/src/index.js +4 -5
- package/src/lib/AdminSidebar.js +6 -1
- package/src/lib/AdminWidgetLabel.js +7 -16
- package/src/lib/AdminWidgetToolbar.js +7 -8
- package/src/lib/AdminWidgetWrapper.js +7 -12
- package/src/lib/IconButton.js +1 -1
- package/src/lib/LanguageSwitcher.js +43 -118
- package/src/lib/SideNav.js +70 -149
- package/src/lib/SidebarItem.js +13 -19
- package/src/styles.css +394 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raketa-builder/builder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"dev": "tsup src/index.js --format cjs --loader \".js=jsx\" --watch"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"styled-components": "^5.1.0",
|
|
14
13
|
"react": "18.2.0",
|
|
15
14
|
"react-dom": "18.2.0"
|
|
16
15
|
},
|
package/src/Canvas.js
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
import { H, P } from "@raketa-builder/ui";
|
|
4
|
-
|
|
5
2
|
import { ReactSortable } from "react-sortablejs";
|
|
3
|
+
import { H, P, cn } from "@raketa-builder/ui";
|
|
6
4
|
import AdminWidget from "./lib/AdminWidget";
|
|
7
5
|
import ErrorBoundary from "./ErrorBoundary";
|
|
8
6
|
import LibraryContext from "./LibraryContext";
|
|
9
7
|
|
|
10
|
-
const EmptyCanvas =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
align-items: center;
|
|
14
|
-
height: 100vh;
|
|
15
|
-
`;
|
|
8
|
+
const EmptyCanvas = ({ className, ...rest }) => (
|
|
9
|
+
<div className={cn("r-reset", "r-empty-canvas", className)} {...rest} />
|
|
10
|
+
);
|
|
16
11
|
|
|
17
12
|
const Canvas = React.memo(
|
|
18
13
|
function Canvas({ widgets, onReorder, onEdit, onRemove, identifier }) {
|
package/src/List.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @next/next/no-img-element */
|
|
2
2
|
import React from "react";
|
|
3
|
-
import styled from "styled-components";
|
|
4
3
|
import { ReactSortable } from "react-sortablejs";
|
|
5
|
-
import {
|
|
4
|
+
import { Button, P, H } from "@raketa-builder/ui";
|
|
6
5
|
|
|
7
6
|
import {
|
|
8
7
|
add,
|
|
@@ -11,6 +10,7 @@ import {
|
|
|
11
10
|
updateFieldByIndex,
|
|
12
11
|
randomId,
|
|
13
12
|
} from "./lists";
|
|
13
|
+
import { cn } from "@raketa-builder/ui";
|
|
14
14
|
|
|
15
15
|
const Handle = (props) => (
|
|
16
16
|
<HandleWrapper data-drag>
|
|
@@ -46,74 +46,58 @@ const IconMinimize = () => (
|
|
|
46
46
|
/>
|
|
47
47
|
);
|
|
48
48
|
|
|
49
|
-
const ListWrapper =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const ContentWrapper = styled.div`
|
|
102
|
-
${reset};
|
|
103
|
-
padding: 8px;
|
|
104
|
-
`;
|
|
105
|
-
|
|
106
|
-
const ListButton = styled.button`
|
|
107
|
-
${buttonReset};
|
|
108
|
-
display: flex;
|
|
109
|
-
justify-content: center;
|
|
110
|
-
align-items: center;
|
|
111
|
-
`;
|
|
112
|
-
|
|
113
|
-
const Title = styled.span`
|
|
114
|
-
${reset};
|
|
115
|
-
font-weight: 700;
|
|
116
|
-
`;
|
|
49
|
+
const ListWrapper = ({ className, ...rest }) => (
|
|
50
|
+
<div className={cn("r-reset", "r-list-wrapper", className)} {...rest} />
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const AddButtonWrapepr = ({ className, ...rest }) => (
|
|
54
|
+
<div
|
|
55
|
+
className={cn("r-reset", "r-list-add-button-wrapper", className)}
|
|
56
|
+
{...rest}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const HandleWrapper = ({ className, ...rest }) => (
|
|
61
|
+
<div
|
|
62
|
+
className={cn("r-reset", "r-list-handle-wrapper", className)}
|
|
63
|
+
{...rest}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const ItemWrapper = ({ className, ...rest }) => (
|
|
68
|
+
<div className={cn("r-reset", "r-list-item-wrapper", className)} {...rest} />
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const TitleBar = ({ className, ...rest }) => (
|
|
72
|
+
<div className={cn("r-reset", "r-list-title-bar", className)} {...rest} />
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
const TitleWrapper = ({ className, ...rest }) => (
|
|
76
|
+
<div className={cn("r-reset", "r-list-title-wrapper", className)} {...rest} />
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const ContentWrapper = ({ className, ...rest }) => (
|
|
80
|
+
<div
|
|
81
|
+
className={cn("r-reset", className)}
|
|
82
|
+
style={{ padding: "8px" }}
|
|
83
|
+
{...rest}
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const ListButton = ({ className, ...rest }) => (
|
|
88
|
+
<div
|
|
89
|
+
className={cn("r-reset", "r-button-reset r-list-button", className)}
|
|
90
|
+
{...rest}
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
const Title = ({ className, ...rest }) => (
|
|
95
|
+
<div
|
|
96
|
+
className={cn("r-reset", className)}
|
|
97
|
+
style={{ fontWeight: "700" }}
|
|
98
|
+
{...rest}
|
|
99
|
+
/>
|
|
100
|
+
);
|
|
117
101
|
|
|
118
102
|
const extractPrimaryField = (primaryField, item, idx) => {
|
|
119
103
|
if (!primaryField) {
|
package/src/ListInput.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ThemeProvider } from "styled-components";
|
|
3
|
-
import { theme } from "@raketa-builder/ui";
|
|
4
|
-
|
|
5
2
|
import List from "./List";
|
|
6
3
|
|
|
7
|
-
const ListInput = (props) =>
|
|
8
|
-
<ThemeProvider theme={theme}>
|
|
9
|
-
<List {...props} />
|
|
10
|
-
</ThemeProvider>
|
|
11
|
-
);
|
|
4
|
+
const ListInput = (props) => <List {...props} />;
|
|
12
5
|
|
|
13
6
|
export default ListInput;
|
package/src/PageBuilder.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-undef */
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { theme } from "@raketa-builder/ui";
|
|
5
|
-
|
|
6
3
|
import { add, removeById, updateFieldById, randomString } from "./lists";
|
|
7
4
|
|
|
8
5
|
import HostContext from "./HostContext";
|
|
@@ -183,51 +180,49 @@ const PageBuilder = ({
|
|
|
183
180
|
}));
|
|
184
181
|
|
|
185
182
|
return (
|
|
186
|
-
<
|
|
187
|
-
<
|
|
188
|
-
<
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
<ReorderDialog
|
|
192
|
-
widgets={sortableWidgets}
|
|
193
|
-
onChange={handleReorder}
|
|
194
|
-
onDelete={handleRemove}
|
|
195
|
-
onSelectWidget={setSelectedWidget}
|
|
196
|
-
onClose={() => setReorderOpen(false)}
|
|
197
|
-
/>
|
|
198
|
-
)}
|
|
199
|
-
|
|
200
|
-
<AdminSidebar
|
|
201
|
-
languageSwitcherSettings={languageSwitcherSettings}
|
|
202
|
-
dirty={dirty}
|
|
203
|
-
buttons={sidebarButtons}
|
|
204
|
-
onSave={handleSave}
|
|
205
|
-
onAddWidget={(widgetName) => handleAdd(widgetName)}
|
|
206
|
-
onReorderDialog={() => setReorderOpen(true)}
|
|
207
|
-
onExit={onExit}
|
|
208
|
-
onPasteWidget={handlePasteWidget}
|
|
209
|
-
/>
|
|
210
|
-
|
|
211
|
-
<Canvas
|
|
183
|
+
<HostContext.Provider value={{ host }}>
|
|
184
|
+
<LibraryContext.Provider value={{ library, adminLibrary }}>
|
|
185
|
+
<div style={{ paddingLeft: "64px" }}>
|
|
186
|
+
{reorderOpen && (
|
|
187
|
+
<ReorderDialog
|
|
212
188
|
widgets={sortableWidgets}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
189
|
+
onChange={handleReorder}
|
|
190
|
+
onDelete={handleRemove}
|
|
191
|
+
onSelectWidget={setSelectedWidget}
|
|
192
|
+
onClose={() => setReorderOpen(false)}
|
|
217
193
|
/>
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
)}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
194
|
+
)}
|
|
195
|
+
|
|
196
|
+
<AdminSidebar
|
|
197
|
+
languageSwitcherSettings={languageSwitcherSettings}
|
|
198
|
+
dirty={dirty}
|
|
199
|
+
buttons={sidebarButtons}
|
|
200
|
+
onSave={handleSave}
|
|
201
|
+
onAddWidget={(widgetName) => handleAdd(widgetName)}
|
|
202
|
+
onReorderDialog={() => setReorderOpen(true)}
|
|
203
|
+
onExit={onExit}
|
|
204
|
+
onPasteWidget={handlePasteWidget}
|
|
205
|
+
/>
|
|
206
|
+
|
|
207
|
+
<Canvas
|
|
208
|
+
widgets={sortableWidgets}
|
|
209
|
+
identifier={identifier}
|
|
210
|
+
onReorder={handleReorder}
|
|
211
|
+
onEdit={setSelectedWidget}
|
|
212
|
+
onRemove={handleRemove}
|
|
213
|
+
/>
|
|
214
|
+
|
|
215
|
+
{selectedWidget && (
|
|
216
|
+
<SettingsDialog
|
|
217
|
+
widget={currentWidget}
|
|
218
|
+
settings={selectedWidget.settings}
|
|
219
|
+
onSave={handleSaveWidget}
|
|
220
|
+
onClose={handleClose}
|
|
221
|
+
/>
|
|
222
|
+
)}
|
|
223
|
+
</div>
|
|
224
|
+
</LibraryContext.Provider>
|
|
225
|
+
</HostContext.Provider>
|
|
231
226
|
);
|
|
232
227
|
};
|
|
233
228
|
|
package/src/dialogs/Dialog.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import { Modal, Button } from "@raketa-builder/ui";
|
|
2
|
+
import { Modal, Button, cn } from "@raketa-builder/ui";
|
|
4
3
|
|
|
5
|
-
const ModalContent =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
`;
|
|
4
|
+
const ModalContent = ({ className, ...props }) => (
|
|
5
|
+
<div className={cn("r-modal-content", className)} {...props} />
|
|
6
|
+
);
|
|
9
7
|
|
|
10
|
-
const ModalFooter =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
`;
|
|
8
|
+
const ModalFooter = ({ className, ...props }) => (
|
|
9
|
+
<div className={cn("r-modal-footer", className)} {...props} />
|
|
10
|
+
);
|
|
14
11
|
|
|
15
12
|
const Dialog = ({
|
|
16
13
|
open,
|
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
/* eslint-disable no-undef */
|
|
2
2
|
import React from "react";
|
|
3
|
-
import styled from "styled-components";
|
|
4
3
|
import { ReactSortable } from "react-sortablejs";
|
|
5
|
-
import { H, P, Button } from "@raketa-builder/ui";
|
|
4
|
+
import { H, P, Button, cn } from "@raketa-builder/ui";
|
|
6
5
|
import Dialog from "./Dialog";
|
|
7
6
|
import LibraryContext from "../LibraryContext";
|
|
8
7
|
import widgetData from "../helpers/widgetData";
|
|
9
8
|
|
|
10
|
-
const ReorderDialogItem =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
align-items: center;
|
|
14
|
-
padding: ${(props) => `calc(${props.theme.font.base} / 2)`};
|
|
15
|
-
margin-bottom: ${(props) => `calc(${props.theme.font.base} / 2)`};
|
|
16
|
-
border: 1px solid ${(props) => props.theme.colors.gray};
|
|
17
|
-
border-radius: 3px;
|
|
18
|
-
color: ${(props) => props.theme.colors.black};
|
|
19
|
-
cursor: move;
|
|
20
|
-
|
|
21
|
-
h6 {
|
|
22
|
-
margin-bottom: 0;
|
|
23
|
-
margin-left: ${(props) => `calc(${props.theme.font.base} / 2)`};
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
9
|
+
const ReorderDialogItem = ({ className, ...props }) => (
|
|
10
|
+
<div className={cn("r-reorder-dialog-item", className)} {...props} />
|
|
11
|
+
);
|
|
26
12
|
|
|
27
13
|
const cleanup = (string) => string.replace(/<[^>]*>?/gm, "");
|
|
28
14
|
|
|
@@ -1,60 +1,28 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import { reset, Hint } from "@raketa-builder/ui";
|
|
2
|
+
import { Hint, cn } from "@raketa-builder/ui";
|
|
4
3
|
import BuilderContext from "../contexts/BuilderContext";
|
|
5
4
|
|
|
6
5
|
import TextInput from "./TextInput";
|
|
7
6
|
import SelectMenu from "./SelectMenu";
|
|
8
7
|
|
|
9
|
-
const SettingsIcon =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
&:last-child {
|
|
28
|
-
padding-right: 0;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&:last-child {
|
|
33
|
-
& > div {
|
|
34
|
-
margin-bottom: 0;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
`;
|
|
38
|
-
|
|
39
|
-
const FormSectionTitle = styled.h6`
|
|
40
|
-
${reset}
|
|
41
|
-
display: flex;
|
|
42
|
-
align-items: center;
|
|
43
|
-
width: 100%;
|
|
44
|
-
margin-bottom: ${(props) => `calc(${props.theme.font.base} / 2)`};
|
|
45
|
-
font-size: ${(props) => props.theme.font.small};
|
|
46
|
-
text-transform: uppercase;
|
|
47
|
-
font-weight: bold;
|
|
48
|
-
`;
|
|
49
|
-
|
|
50
|
-
const ButtonControl = styled.div`
|
|
51
|
-
${reset}
|
|
52
|
-
margin-bottom: 0;
|
|
53
|
-
|
|
54
|
-
& + div {
|
|
55
|
-
margin-top: ${(props) => props.theme.font.base};
|
|
56
|
-
}
|
|
57
|
-
`;
|
|
8
|
+
const SettingsIcon = ({ className, ...props }) => (
|
|
9
|
+
<div className={cn("r-settings-icon", className)} {...props} />
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
const ThreeColumns = ({ className, ...props }) => (
|
|
13
|
+
<div className={cn("r-reset", "r-three-columns", className)} {...props} />
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
const FormSectionTitle = ({ className, ...props }) => (
|
|
17
|
+
<div
|
|
18
|
+
className={cn("r-reset", "r-form-section-title", className)}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const ButtonControl = ({ className, ...props }) => (
|
|
24
|
+
<div className={cn("r-reset", "r-button-control", className)} {...props} />
|
|
25
|
+
);
|
|
58
26
|
|
|
59
27
|
const DEFAULT_BUTTON_STYLES = [
|
|
60
28
|
["primary", "Primary"],
|
|
@@ -1,60 +1,27 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import { reset, Hint } from "@raketa-builder/ui";
|
|
2
|
+
import { Hint, cn } from "@raketa-builder/ui";
|
|
4
3
|
|
|
5
4
|
import TextInput from "./TextInput";
|
|
6
5
|
import SelectMenu from "./SelectMenu";
|
|
7
6
|
|
|
8
|
-
const SettingsIcon =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
&:last-child {
|
|
28
|
-
padding-right: 0;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&:last-child {
|
|
33
|
-
& > div {
|
|
34
|
-
margin-bottom: 0;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
`;
|
|
38
|
-
|
|
39
|
-
const FormSectionTitle = styled.h6`
|
|
40
|
-
${reset}
|
|
41
|
-
display: flex;
|
|
42
|
-
align-items: center;
|
|
43
|
-
width: 100%;
|
|
44
|
-
margin-bottom: ${(props) => `calc(${props.theme.font.base} / 2)`};
|
|
45
|
-
font-size: ${(props) => props.theme.font.small};
|
|
46
|
-
text-transform: uppercase;
|
|
47
|
-
font-weight: bold;
|
|
48
|
-
`;
|
|
49
|
-
|
|
50
|
-
const ButtonControl = styled.div`
|
|
51
|
-
${reset}
|
|
52
|
-
margin-bottom: 0;
|
|
53
|
-
|
|
54
|
-
& + div {
|
|
55
|
-
margin-top: ${(props) => props.theme.font.base};
|
|
56
|
-
}
|
|
57
|
-
`;
|
|
7
|
+
const SettingsIcon = ({ className, ...props }) => (
|
|
8
|
+
<div className={cn("r-settings-icon", className)} {...props} />
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
const ThreeColumns = ({ className, ...props }) => (
|
|
12
|
+
<div className={cn("r-reset", "r-three-columns", className)} {...props} />
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const FormSectionTitle = ({ className, ...props }) => (
|
|
16
|
+
<div
|
|
17
|
+
className={cn("r-reset", "r-form-section-title", className)}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const ButtonControl = ({ className, ...props }) => (
|
|
23
|
+
<div className={cn("r-reset", "r-button-control", className)} {...props} />
|
|
24
|
+
);
|
|
58
25
|
|
|
59
26
|
const mergeSettings = (settings, key, value) =>
|
|
60
27
|
Object.assign({}, settings, { [key]: value });
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { theme, Label, FormGroup } from "@raketa-builder/ui";
|
|
4
|
-
|
|
2
|
+
import { Label, FormGroup } from "@raketa-builder/ui";
|
|
5
3
|
import PageBuilder from "./PageBuilder";
|
|
6
4
|
import TextInput from "./forms/TextInput";
|
|
7
5
|
import TextArea from "./forms/TextArea";
|
|
@@ -24,8 +22,9 @@ import Link from "./lib/Link";
|
|
|
24
22
|
import BuilderContext from "./contexts/BuilderContext";
|
|
25
23
|
import AdminPageRender from "./AdminPageRender";
|
|
26
24
|
|
|
27
|
-
const
|
|
28
|
-
|
|
25
|
+
const theme = {};
|
|
26
|
+
const RaketaUIProvider = ({ children }) => (
|
|
27
|
+
<React.Fragment>{children}</React.Fragment>
|
|
29
28
|
);
|
|
30
29
|
|
|
31
30
|
RaketaUIProvider.defaultProps = {
|
package/src/lib/AdminSidebar.js
CHANGED
|
@@ -64,7 +64,12 @@ const WidgetsList = ({ library, onAddWidget }) => {
|
|
|
64
64
|
return (
|
|
65
65
|
<div>
|
|
66
66
|
<SideNavSearchWrapper>
|
|
67
|
-
<TextInput
|
|
67
|
+
<TextInput
|
|
68
|
+
className="r-admin-sidenav-search-input"
|
|
69
|
+
value={q}
|
|
70
|
+
onChange={setQ}
|
|
71
|
+
placeholder="Search..."
|
|
72
|
+
/>
|
|
68
73
|
</SideNavSearchWrapper>
|
|
69
74
|
|
|
70
75
|
{widgetsCategories.map((categoryName, idx) => (
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { reset } from "@raketa-builder/ui";
|
|
1
|
+
import { cn } from "@raketa-builder/ui";
|
|
3
2
|
|
|
4
|
-
const AdminWidgetLabel =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
display: none;
|
|
11
|
-
padding: 4px 12px;
|
|
12
|
-
border-radius: 16px;
|
|
13
|
-
background-color: rgba(64, 64, 64, 0.8);
|
|
14
|
-
color: ${(props) => props.theme.colors.trueWhite};
|
|
15
|
-
font-size: ${(props) => props.theme.font.small};
|
|
16
|
-
backdrop-filter: blur(4px);
|
|
17
|
-
`;
|
|
3
|
+
const AdminWidgetLabel = ({ className, ...rest }) => (
|
|
4
|
+
<div
|
|
5
|
+
className={cn("r-reset", "r-fs-small", "r-admin-widget-label", className)}
|
|
6
|
+
{...rest}
|
|
7
|
+
/>
|
|
8
|
+
);
|
|
18
9
|
|
|
19
10
|
export default AdminWidgetLabel;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { cn } from "@raketa-builder/ui";
|
|
2
2
|
|
|
3
|
-
const AdminWidgetToolbar =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
`;
|
|
3
|
+
const AdminWidgetToolbar = ({ className, ...rest }) => (
|
|
4
|
+
<div
|
|
5
|
+
className={cn("r-reset", "r-admin-widget-toolbar", className)}
|
|
6
|
+
{...rest}
|
|
7
|
+
/>
|
|
8
|
+
);
|
|
10
9
|
|
|
11
10
|
export default AdminWidgetToolbar;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { cn } from "@raketa-builder/ui";
|
|
2
2
|
|
|
3
|
-
const AdminWidgetWrapper =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
& > div[data-toolbar] { display: flex; }
|
|
10
|
-
& > div[data-widget-label] { display: block; }
|
|
11
|
-
}
|
|
12
|
-
`}
|
|
13
|
-
`;
|
|
3
|
+
const AdminWidgetWrapper = ({ className, ...rest }) => (
|
|
4
|
+
<div
|
|
5
|
+
className={cn("r-reset", "r-admin-widget-wrapper", className)}
|
|
6
|
+
{...rest}
|
|
7
|
+
/>
|
|
8
|
+
);
|
|
14
9
|
|
|
15
10
|
export default AdminWidgetWrapper;
|
package/src/lib/IconButton.js
CHANGED