@raketa-builder/menu-builder 0.6.0 → 0.8.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 +6 -3
- package/.turbo/turbo-format.log +23 -0
- package/.turbo/turbo-lint.log +243 -13
- package/biome.json +3 -0
- package/dist/index.js +171 -67
- package/package.json +6 -5
- package/src/MenuBuilder/AdminWidget.js +30 -2
- package/src/MenuBuilder/ColumnBuilder.js +2 -2
- package/src/MenuBuilder/ContentBuilder.js +17 -4
- package/src/MenuBuilder/MainNavigation.js +1 -1
- package/src/MenuBuilder/RowBuilder.js +1 -1
- package/src/MenuBuilder/icons.js +3 -3
- package/src/styles.css +0 -1
- package/tsconfig.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
> @raketa-builder/menu-builder@0.8.0 build
|
|
3
|
+
> tsup src/index.js --format cjs --loader ".js=jsx"
|
|
4
|
+
|
|
2
5
|
CLI Building entry: src/index.js
|
|
3
6
|
CLI Using tsconfig: tsconfig.json
|
|
4
7
|
CLI tsup v6.5.0
|
|
5
8
|
CLI Target: es6
|
|
6
9
|
CJS Build start
|
|
7
|
-
CJS dist/index.js
|
|
8
|
-
CJS ⚡️ Build success in
|
|
10
|
+
CJS dist/index.js 63.14 KB
|
|
11
|
+
CJS ⚡️ Build success in 275ms
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
> @raketa-builder/menu-builder@0.7.0 format
|
|
3
|
+
> prettier --write .
|
|
4
|
+
|
|
5
|
+
biome.json 520ms (unchanged)
|
|
6
|
+
CHANGELOG.md 526ms (unchanged)
|
|
7
|
+
dist/index.js 5061ms
|
|
8
|
+
package.json 52ms (unchanged)
|
|
9
|
+
src/index.js 51ms (unchanged)
|
|
10
|
+
src/MenuBuilder/AddWidget.js 76ms (unchanged)
|
|
11
|
+
src/MenuBuilder/AdminWidget.js 83ms (unchanged)
|
|
12
|
+
src/MenuBuilder/ColumnBuilder.js 257ms (unchanged)
|
|
13
|
+
src/MenuBuilder/ContentBuilder.js 140ms
|
|
14
|
+
src/MenuBuilder/Factories.js 29ms (unchanged)
|
|
15
|
+
src/MenuBuilder/icons.js 54ms
|
|
16
|
+
src/MenuBuilder/index.js 50ms (unchanged)
|
|
17
|
+
src/MenuBuilder/ItemForm.js 88ms (unchanged)
|
|
18
|
+
src/MenuBuilder/MainNavigation.js 65ms
|
|
19
|
+
src/MenuBuilder/RowBuilder.js 48ms (unchanged)
|
|
20
|
+
src/MenuBuilder/utils.js 16ms (unchanged)
|
|
21
|
+
src/MenuBuilder/WidgetContext.js 3ms (unchanged)
|
|
22
|
+
src/styles.css 275ms
|
|
23
|
+
tsconfig.json 7ms
|
package/.turbo/turbo-lint.log
CHANGED
|
@@ -1,13 +1,243 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
|
|
2
|
+
> @raketa-builder/menu-builder@0.7.0 lint
|
|
3
|
+
> biome lint --max-diagnostics=5000 .
|
|
4
|
+
|
|
5
|
+
./src/MenuBuilder/icons.js:11:5 lint/a11y/noSvgWithoutTitle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
6
|
+
|
|
7
|
+
× Alternative text title element cannot be empty
|
|
8
|
+
|
|
9
|
+
9 │ export function Edit({ className, ...rest }) {
|
|
10
|
+
10 │ return (
|
|
11
|
+
> 11 │ <svg
|
|
12
|
+
│ ^^^^
|
|
13
|
+
> 12 │ className={cn(
|
|
14
|
+
...
|
|
15
|
+
> 29 │ {...rest}
|
|
16
|
+
> 30 │ >
|
|
17
|
+
│ ^
|
|
18
|
+
31 │ <path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path>
|
|
19
|
+
32 │ </svg>
|
|
20
|
+
|
|
21
|
+
i For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
./src/MenuBuilder/icons.js:31:7 lint/style/useSelfClosingElements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━
|
|
25
|
+
|
|
26
|
+
× JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
|
|
27
|
+
|
|
28
|
+
29 │ {...rest}
|
|
29
|
+
30 │ >
|
|
30
|
+
> 31 │ <path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path>
|
|
31
|
+
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
32
|
+
32 │ </svg>
|
|
33
|
+
33 │ );
|
|
34
|
+
|
|
35
|
+
i Unsafe fix: Use a SelfClosingElement instead
|
|
36
|
+
|
|
37
|
+
29 29 │ {...rest}
|
|
38
|
+
30 30 │ >
|
|
39
|
+
31 │ - ······<path·d="M17·3a2.828·2.828·0·1·1·4·4L7.5·20.5·2·22l1.5-5.5L17·3z"></path>
|
|
40
|
+
31 │ + ······<path·d="M17·3a2.828·2.828·0·1·1·4·4L7.5·20.5·2·22l1.5-5.5L17·3z"·/>
|
|
41
|
+
32 32 │ </svg>
|
|
42
|
+
33 33 │ );
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
./src/MenuBuilder/icons.js:38:5 lint/a11y/noSvgWithoutTitle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
46
|
+
|
|
47
|
+
× Alternative text title element cannot be empty
|
|
48
|
+
|
|
49
|
+
36 │ export function Delete({ className, ...rest }) {
|
|
50
|
+
37 │ return (
|
|
51
|
+
> 38 │ <svg
|
|
52
|
+
│ ^^^^
|
|
53
|
+
> 39 │ className={cn(
|
|
54
|
+
...
|
|
55
|
+
> 56 │ {...rest}
|
|
56
|
+
> 57 │ >
|
|
57
|
+
│ ^
|
|
58
|
+
58 │ <polyline points="3 6 5 6 21 6"></polyline>
|
|
59
|
+
59 │ <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
|
|
60
|
+
|
|
61
|
+
i For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
./src/MenuBuilder/icons.js:58:7 lint/style/useSelfClosingElements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━
|
|
65
|
+
|
|
66
|
+
× JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
|
|
67
|
+
|
|
68
|
+
56 │ {...rest}
|
|
69
|
+
57 │ >
|
|
70
|
+
> 58 │ <polyline points="3 6 5 6 21 6"></polyline>
|
|
71
|
+
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
72
|
+
59 │ <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
|
|
73
|
+
60 │ </svg>
|
|
74
|
+
|
|
75
|
+
i Unsafe fix: Use a SelfClosingElement instead
|
|
76
|
+
|
|
77
|
+
56 56 │ {...rest}
|
|
78
|
+
57 57 │ >
|
|
79
|
+
58 │ - ······<polyline·points="3·6·5·6·21·6"></polyline>
|
|
80
|
+
58 │ + ······<polyline·points="3·6·5·6·21·6"·/>
|
|
81
|
+
59 59 │ <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
|
|
82
|
+
60 60 │ </svg>
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
./src/MenuBuilder/icons.js:59:7 lint/style/useSelfClosingElements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━
|
|
86
|
+
|
|
87
|
+
× JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
|
|
88
|
+
|
|
89
|
+
57 │ >
|
|
90
|
+
58 │ <polyline points="3 6 5 6 21 6"></polyline>
|
|
91
|
+
> 59 │ <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
|
|
92
|
+
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
93
|
+
60 │ </svg>
|
|
94
|
+
61 │ );
|
|
95
|
+
|
|
96
|
+
i Unsafe fix: Use a SelfClosingElement instead
|
|
97
|
+
|
|
98
|
+
57 57 │ >
|
|
99
|
+
58 58 │ <polyline points="3 6 5 6 21 6"></polyline>
|
|
100
|
+
59 │ - ······<path·d="M19·6v14a2·2·0·0·1-2·2H7a2·2·0·0·1-2-2V6m3·0V4a2·2·0·0·1·2-2h4a2·2·0·0·1·2·2v2"></path>
|
|
101
|
+
59 │ + ······<path·d="M19·6v14a2·2·0·0·1-2·2H7a2·2·0·0·1-2-2V6m3·0V4a2·2·0·0·1·2-2h4a2·2·0·0·1·2·2v2"·/>
|
|
102
|
+
60 60 │ </svg>
|
|
103
|
+
61 61 │ );
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
./src/MenuBuilder/icons.js:66:5 lint/a11y/noSvgWithoutTitle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
107
|
+
|
|
108
|
+
× Alternative text title element cannot be empty
|
|
109
|
+
|
|
110
|
+
64 │ export function Plus({ className, ...rest }) {
|
|
111
|
+
65 │ return (
|
|
112
|
+
> 66 │ <svg
|
|
113
|
+
│ ^^^^
|
|
114
|
+
> 67 │ className={cn(
|
|
115
|
+
...
|
|
116
|
+
> 84 │ {...rest}
|
|
117
|
+
> 85 │ >
|
|
118
|
+
│ ^
|
|
119
|
+
86 │ <line x1="12" y1="5" x2="12" y2="19"></line>
|
|
120
|
+
87 │ <line x1="5" y1="12" x2="19" y2="12"></line>
|
|
121
|
+
|
|
122
|
+
i For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
./src/MenuBuilder/icons.js:86:7 lint/style/useSelfClosingElements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━
|
|
126
|
+
|
|
127
|
+
× JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
|
|
128
|
+
|
|
129
|
+
84 │ {...rest}
|
|
130
|
+
85 │ >
|
|
131
|
+
> 86 │ <line x1="12" y1="5" x2="12" y2="19"></line>
|
|
132
|
+
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
133
|
+
87 │ <line x1="5" y1="12" x2="19" y2="12"></line>
|
|
134
|
+
88 │ </svg>
|
|
135
|
+
|
|
136
|
+
i Unsafe fix: Use a SelfClosingElement instead
|
|
137
|
+
|
|
138
|
+
84 84 │ {...rest}
|
|
139
|
+
85 85 │ >
|
|
140
|
+
86 │ - ······<line·x1="12"·y1="5"·x2="12"·y2="19"></line>
|
|
141
|
+
86 │ + ······<line·x1="12"·y1="5"·x2="12"·y2="19"·/>
|
|
142
|
+
87 87 │ <line x1="5" y1="12" x2="19" y2="12"></line>
|
|
143
|
+
88 88 │ </svg>
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
./src/MenuBuilder/icons.js:87:7 lint/style/useSelfClosingElements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━
|
|
147
|
+
|
|
148
|
+
× JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
|
|
149
|
+
|
|
150
|
+
85 │ >
|
|
151
|
+
86 │ <line x1="12" y1="5" x2="12" y2="19"></line>
|
|
152
|
+
> 87 │ <line x1="5" y1="12" x2="19" y2="12"></line>
|
|
153
|
+
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
154
|
+
88 │ </svg>
|
|
155
|
+
89 │ );
|
|
156
|
+
|
|
157
|
+
i Unsafe fix: Use a SelfClosingElement instead
|
|
158
|
+
|
|
159
|
+
85 85 │ >
|
|
160
|
+
86 86 │ <line x1="12" y1="5" x2="12" y2="19"></line>
|
|
161
|
+
87 │ - ······<line·x1="5"·y1="12"·x2="19"·y2="12"></line>
|
|
162
|
+
87 │ + ······<line·x1="5"·y1="12"·x2="19"·y2="12"·/>
|
|
163
|
+
88 88 │ </svg>
|
|
164
|
+
89 89 │ );
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
./src/MenuBuilder/icons.js:94:5 lint/a11y/noSvgWithoutTitle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
168
|
+
|
|
169
|
+
× Alternative text title element cannot be empty
|
|
170
|
+
|
|
171
|
+
92 │ export function Copy({ className, ...rest }) {
|
|
172
|
+
93 │ return (
|
|
173
|
+
> 94 │ <svg
|
|
174
|
+
│ ^^^^
|
|
175
|
+
> 95 │ className={cn(
|
|
176
|
+
...
|
|
177
|
+
> 112 │ {...rest}
|
|
178
|
+
> 113 │ >
|
|
179
|
+
│ ^
|
|
180
|
+
114 │ <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
|
|
181
|
+
115 │ <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
|
|
182
|
+
|
|
183
|
+
i For accessibility purposes, SVGs should have an alternative text, provided via title element. If the svg element has role="img", you should add the aria-label or aria-labelledby attribute.
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
./src/MenuBuilder/icons.js:114:7 lint/style/useSelfClosingElements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━
|
|
187
|
+
|
|
188
|
+
× JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
|
|
189
|
+
|
|
190
|
+
112 │ {...rest}
|
|
191
|
+
113 │ >
|
|
192
|
+
> 114 │ <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
|
|
193
|
+
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
194
|
+
115 │ <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
|
|
195
|
+
116 │ </svg>
|
|
196
|
+
|
|
197
|
+
i Unsafe fix: Use a SelfClosingElement instead
|
|
198
|
+
|
|
199
|
+
112 112 │ {...rest}
|
|
200
|
+
113 113 │ >
|
|
201
|
+
114 │ - ······<rect·x="9"·y="9"·width="13"·height="13"·rx="2"·ry="2"></rect>
|
|
202
|
+
114 │ + ······<rect·x="9"·y="9"·width="13"·height="13"·rx="2"·ry="2"·/>
|
|
203
|
+
115 115 │ <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
|
|
204
|
+
116 116 │ </svg>
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
./src/MenuBuilder/icons.js:115:7 lint/style/useSelfClosingElements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━
|
|
208
|
+
|
|
209
|
+
× JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
|
|
210
|
+
|
|
211
|
+
113 │ >
|
|
212
|
+
114 │ <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
|
|
213
|
+
> 115 │ <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
|
|
214
|
+
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
215
|
+
116 │ </svg>
|
|
216
|
+
117 │ );
|
|
217
|
+
|
|
218
|
+
i Unsafe fix: Use a SelfClosingElement instead
|
|
219
|
+
|
|
220
|
+
113 113 │ >
|
|
221
|
+
114 114 │ <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
|
|
222
|
+
115 │ - ······<path·d="M5·15H4a2·2·0·0·1-2-2V4a2·2·0·0·1·2-2h9a2·2·0·0·1·2·2v1"></path>
|
|
223
|
+
115 │ + ······<path·d="M5·15H4a2·2·0·0·1-2-2V4a2·2·0·0·1·2-2h9a2·2·0·0·1·2·2v1"·/>
|
|
224
|
+
116 116 │ </svg>
|
|
225
|
+
117 117 │ );
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
./src/MenuBuilder/icons.js lint ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
229
|
+
|
|
230
|
+
× The file contains diagnostics that needs to be addressed.
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
Checked 14 file(s) in 115ms
|
|
234
|
+
Found 12 error(s)
|
|
235
|
+
lint ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
236
|
+
|
|
237
|
+
× Some errors were emitted while running checks.
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
npm ERR! Lifecycle script `lint` failed with error:
|
|
241
|
+
npm ERR! Error: command failed
|
|
242
|
+
npm ERR! in workspace: @raketa-builder/menu-builder@0.7.0
|
|
243
|
+
npm ERR! at location: /home/sve/dev/StudioRaketa/cloud/frontend/raketa-builder/packages/menu-builder
|
package/biome.json
ADDED
package/dist/index.js
CHANGED
|
@@ -114,6 +114,7 @@ var require_dist = __commonJS({
|
|
|
114
114
|
var src_exports2 = {};
|
|
115
115
|
__export2(src_exports2, {
|
|
116
116
|
Button: () => Button_default,
|
|
117
|
+
CategoriesMenu: () => CategoriesMenu_default,
|
|
117
118
|
Col: () => Col,
|
|
118
119
|
Container: () => Container_default,
|
|
119
120
|
DataGrid: () => DataGrid_default,
|
|
@@ -219,11 +220,23 @@ var require_dist = __commonJS({
|
|
|
219
220
|
var import_react32 = __toESM2(require("react"));
|
|
220
221
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
221
222
|
var Button7 = (_a) => {
|
|
222
|
-
var _b = _a, {
|
|
223
|
+
var _b = _a, {
|
|
224
|
+
as = "button",
|
|
225
|
+
size = "md",
|
|
226
|
+
variant = "primary",
|
|
227
|
+
className,
|
|
228
|
+
type = "button"
|
|
229
|
+
} = _b, rest = __objRest2(_b, [
|
|
230
|
+
"as",
|
|
231
|
+
"size",
|
|
232
|
+
"variant",
|
|
233
|
+
"className",
|
|
234
|
+
"type"
|
|
235
|
+
]);
|
|
236
|
+
const Component = as;
|
|
223
237
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
224
|
-
|
|
238
|
+
Component,
|
|
225
239
|
__spreadValues2({
|
|
226
|
-
type,
|
|
227
240
|
className: cn5(
|
|
228
241
|
"r-reset",
|
|
229
242
|
"r-reset-button",
|
|
@@ -232,14 +245,9 @@ var require_dist = __commonJS({
|
|
|
232
245
|
`r-button-${variant}`,
|
|
233
246
|
className
|
|
234
247
|
)
|
|
235
|
-
},
|
|
248
|
+
}, rest)
|
|
236
249
|
);
|
|
237
250
|
};
|
|
238
|
-
Button7.defaultProps = {
|
|
239
|
-
type: "button",
|
|
240
|
-
size: "md",
|
|
241
|
-
variant: "primary"
|
|
242
|
-
};
|
|
243
251
|
Button7.variants = ["primary", "secondary", "success", "danger"];
|
|
244
252
|
Button7.sizes = {
|
|
245
253
|
sm: "sm",
|
|
@@ -285,8 +293,8 @@ var require_dist = __commonJS({
|
|
|
285
293
|
var import_react52 = __toESM2(require("react"));
|
|
286
294
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
287
295
|
var Input2 = (_a) => {
|
|
288
|
-
var _b = _a, { className } = _b,
|
|
289
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("input", __spreadValues2({ className: cn5("r-reset", "r-input", className) },
|
|
296
|
+
var _b = _a, { className } = _b, rest = __objRest2(_b, ["className"]);
|
|
297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("input", __spreadValues2({ className: cn5("r-reset", "r-input", className) }, rest));
|
|
290
298
|
};
|
|
291
299
|
var Input_default = Input2;
|
|
292
300
|
var import_react62 = __toESM2(require("react"));
|
|
@@ -394,18 +402,8 @@ var require_dist = __commonJS({
|
|
|
394
402
|
var import_react13 = __toESM2(require("react"));
|
|
395
403
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
396
404
|
var Stack6 = (_a) => {
|
|
397
|
-
var _b = _a, {
|
|
398
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
399
|
-
"div",
|
|
400
|
-
__spreadValues2({
|
|
401
|
-
style: {
|
|
402
|
-
justifyContent: h || "flex-start",
|
|
403
|
-
alignItems: v || "flex-start",
|
|
404
|
-
gap: g || "1em"
|
|
405
|
-
},
|
|
406
|
-
className: cn5("r-stack", className)
|
|
407
|
-
}, props)
|
|
408
|
-
);
|
|
405
|
+
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", __spreadValues2({ className: cn5("r-stack", className) }, props));
|
|
409
407
|
};
|
|
410
408
|
var Stack_default = Stack6;
|
|
411
409
|
var import_react14 = __toESM2(require("react"));
|
|
@@ -467,30 +465,59 @@ var require_dist = __commonJS({
|
|
|
467
465
|
}, props)
|
|
468
466
|
);
|
|
469
467
|
};
|
|
468
|
+
var FooterBar = (_a) => {
|
|
469
|
+
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", __spreadValues2({ className: cn5("r-reset", "r-modal-footer-bar", className) }, props));
|
|
471
|
+
};
|
|
470
472
|
var Content = (_a) => {
|
|
471
473
|
var _b = _a, { className } = _b, props = __objRest2(_b, ["className"]);
|
|
472
474
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", __spreadValues2({ className: cn5("r-reset", "r-modal-content", className) }, props));
|
|
473
475
|
};
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
476
|
+
function checkForChanges2(hasChanges, onClose) {
|
|
477
|
+
if (!hasChanges) {
|
|
478
|
+
onClose();
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
if (!confirm(
|
|
482
|
+
"You\u2019ve made changes to the widget. Are you sure you want to cancel?"
|
|
483
|
+
))
|
|
484
|
+
return;
|
|
485
|
+
onClose();
|
|
486
|
+
}
|
|
487
|
+
var Modal3 = (_a) => {
|
|
488
|
+
var _b = _a, {
|
|
489
|
+
title,
|
|
490
|
+
children,
|
|
491
|
+
customWrapper,
|
|
492
|
+
FooterContent,
|
|
493
|
+
onClose,
|
|
494
|
+
areChanges
|
|
495
|
+
} = _b, rest = __objRest2(_b, [
|
|
496
|
+
"title",
|
|
497
|
+
"children",
|
|
498
|
+
"customWrapper",
|
|
499
|
+
"FooterContent",
|
|
500
|
+
"onClose",
|
|
501
|
+
"areChanges"
|
|
502
|
+
]);
|
|
503
|
+
const ModalWrapper = customWrapper ? customWrapper : Wrapper2;
|
|
485
504
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react17.default.Fragment, { children: [
|
|
486
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Overlay, {
|
|
487
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
505
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Overlay, {}),
|
|
506
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ModalWrapper, __spreadProps2(__spreadValues2({}, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Inner, { children: [
|
|
488
507
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TitleBar, { children: [
|
|
489
508
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Title, { children: title }),
|
|
490
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
509
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
510
|
+
CloseButton,
|
|
511
|
+
{
|
|
512
|
+
type: "button",
|
|
513
|
+
onClick: () => checkForChanges2(areChanges, onClose),
|
|
514
|
+
children: "\xD7"
|
|
515
|
+
}
|
|
516
|
+
)
|
|
491
517
|
] }),
|
|
492
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Content, { children })
|
|
493
|
-
|
|
518
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Content, { children }),
|
|
519
|
+
FooterContent && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FooterBar, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FooterContent, {}) })
|
|
520
|
+
] }) }))
|
|
494
521
|
] });
|
|
495
522
|
};
|
|
496
523
|
var Modal_default = Modal3;
|
|
@@ -721,7 +748,7 @@ var require_dist = __commonJS({
|
|
|
721
748
|
var import_react24 = __toESM2(require("react"));
|
|
722
749
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
723
750
|
var ImageAvatar = (_a) => {
|
|
724
|
-
var _b = _a, { size, className } = _b, props = __objRest2(_b, ["size", "className"]);
|
|
751
|
+
var _b = _a, { size = "24px", className } = _b, props = __objRest2(_b, ["size", "className"]);
|
|
725
752
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
726
753
|
"img",
|
|
727
754
|
__spreadValues2({
|
|
@@ -734,9 +761,6 @@ var require_dist = __commonJS({
|
|
|
734
761
|
}, props)
|
|
735
762
|
);
|
|
736
763
|
};
|
|
737
|
-
ImageAvatar.defaultProps = {
|
|
738
|
-
size: "24px"
|
|
739
|
-
};
|
|
740
764
|
var ImageAvatar_default = ImageAvatar;
|
|
741
765
|
var import_react25 = __toESM2(require("react"));
|
|
742
766
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
@@ -777,14 +801,53 @@ var require_dist = __commonJS({
|
|
|
777
801
|
);
|
|
778
802
|
};
|
|
779
803
|
var DefaultAvatar = (_a) => {
|
|
780
|
-
var _b = _a, { initials } = _b, props = __objRest2(_b, ["initials"]);
|
|
781
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DefaultAvatarStyles, __spreadProps2(__spreadValues2({ initials }, props), { children: initials }));
|
|
782
|
-
};
|
|
783
|
-
DefaultAvatar.defaultProps = {
|
|
784
|
-
size: "24px",
|
|
785
|
-
initials: "AA"
|
|
804
|
+
var _b = _a, { initials = "AA", size = "24px" } = _b, props = __objRest2(_b, ["initials", "size"]);
|
|
805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DefaultAvatarStyles, __spreadProps2(__spreadValues2({ initials, size }, props), { children: initials }));
|
|
786
806
|
};
|
|
787
807
|
var DefaultAvatar_default = DefaultAvatar;
|
|
808
|
+
var import_react26 = __toESM2(require("react"));
|
|
809
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
810
|
+
var IconsWrapper = () => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "r-reset r-categories-icons-wrapper", children: [
|
|
811
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
812
|
+
"img",
|
|
813
|
+
{
|
|
814
|
+
style: {
|
|
815
|
+
color: "#fff",
|
|
816
|
+
width: "24px",
|
|
817
|
+
height: "24px",
|
|
818
|
+
filter: "invert(1)"
|
|
819
|
+
},
|
|
820
|
+
alt: "directions",
|
|
821
|
+
src: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItZ3JpZCI+PHJlY3QgeD0iMyIgeT0iMyIgd2lkdGg9IjciIGhlaWdodD0iNyI+PC9yZWN0PjxyZWN0IHg9IjE0IiB5PSIzIiB3aWR0aD0iNyIgaGVpZ2h0PSI3Ij48L3JlY3Q+PHJlY3QgeD0iMTQiIHk9IjE0IiB3aWR0aD0iNyIgaGVpZ2h0PSI3Ij48L3JlY3Q+PHJlY3QgeD0iMyIgeT0iMTQiIHdpZHRoPSI3IiBoZWlnaHQ9IjciPjwvcmVjdD48L3N2Zz4="
|
|
822
|
+
}
|
|
823
|
+
),
|
|
824
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
825
|
+
"img",
|
|
826
|
+
{
|
|
827
|
+
className: "r-reset r-category-chevron",
|
|
828
|
+
alt: "directions",
|
|
829
|
+
src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMTMiIHZpZXdCb3g9IjAgMCAyMiAxMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIxIDExLjVMMTEgMS41TDEgMTEuNSIgc3Ryb2tlPSIjMEMwQTA5IiBzdHJva2Utd2lkdGg9IjIiLz4KPC9zdmc+Cg=="
|
|
830
|
+
}
|
|
831
|
+
)
|
|
832
|
+
] });
|
|
833
|
+
var Title2 = () => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "r-categories-title", children: "Categories" });
|
|
834
|
+
var CategoriesInner = (_a) => {
|
|
835
|
+
var props = __objRest2(_a, []);
|
|
836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", __spreadProps2(__spreadValues2({}, props), { className: "r-reset r-categories-inner" }));
|
|
837
|
+
};
|
|
838
|
+
var CategoriesHiddenMenu = ({ paths }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "r-reset r-categories-hidden-menu", children: paths.map(({ title, link }, idx) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("a", { href: link, className: "r-reset r-category-link", children: title }, `${idx}-${link}`)) });
|
|
839
|
+
var CategoriesMenuWrapper = (_a) => {
|
|
840
|
+
var props = __objRest2(_a, []);
|
|
841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", __spreadValues2({ className: "r-reset r-categories-menu" }, props));
|
|
842
|
+
};
|
|
843
|
+
var CategoriesMenu = ({ paths }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(CategoriesMenuWrapper, { children: [
|
|
844
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(CategoriesInner, { children: [
|
|
845
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(IconsWrapper, {}),
|
|
846
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Title2, {})
|
|
847
|
+
] }),
|
|
848
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CategoriesHiddenMenu, { paths })
|
|
849
|
+
] });
|
|
850
|
+
var CategoriesMenu_default = CategoriesMenu;
|
|
788
851
|
}
|
|
789
852
|
});
|
|
790
853
|
|
|
@@ -873,7 +936,7 @@ var MainNavigation = ({ items, tab, onTab, onChange }) => /* @__PURE__ */ (0, im
|
|
|
873
936
|
TabButton,
|
|
874
937
|
{
|
|
875
938
|
type: "button",
|
|
876
|
-
active: idx === tab,
|
|
939
|
+
active: (idx === tab).toString(),
|
|
877
940
|
onClick: () => onTab(idx),
|
|
878
941
|
children: item.label
|
|
879
942
|
}
|
|
@@ -947,7 +1010,7 @@ function Delete(_a) {
|
|
|
947
1010
|
viewBox: "0 0 24 24",
|
|
948
1011
|
fill: "none",
|
|
949
1012
|
stroke: "#000",
|
|
950
|
-
|
|
1013
|
+
strokeWidth: "2",
|
|
951
1014
|
strokeLinecap: "round",
|
|
952
1015
|
strokeLinejoin: "round"
|
|
953
1016
|
}, rest), {
|
|
@@ -977,7 +1040,7 @@ function Copy(_a) {
|
|
|
977
1040
|
viewBox: "0 0 24 24",
|
|
978
1041
|
fill: "none",
|
|
979
1042
|
stroke: "#000",
|
|
980
|
-
|
|
1043
|
+
strokeWidth: "2",
|
|
981
1044
|
strokeLinecap: "round",
|
|
982
1045
|
strokeLinejoin: "round"
|
|
983
1046
|
}, rest), {
|
|
@@ -1094,9 +1157,27 @@ var import_react_sortablejs2 = require("react-sortablejs");
|
|
|
1094
1157
|
var import_react4 = __toESM(require("react"));
|
|
1095
1158
|
var import_ui4 = __toESM(require_dist());
|
|
1096
1159
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1097
|
-
|
|
1160
|
+
function checkForChanges(hasChanges, onClose) {
|
|
1161
|
+
if (!hasChanges) {
|
|
1162
|
+
onClose();
|
|
1163
|
+
return;
|
|
1164
|
+
}
|
|
1165
|
+
if (!confirm(
|
|
1166
|
+
"You\u2019ve made changes to the widget. Are you sure you want to cancel?"
|
|
1167
|
+
))
|
|
1168
|
+
return;
|
|
1169
|
+
onClose();
|
|
1170
|
+
}
|
|
1171
|
+
var AdminWidget = ({
|
|
1172
|
+
Component,
|
|
1173
|
+
settings,
|
|
1174
|
+
onChange,
|
|
1175
|
+
handleChanges,
|
|
1176
|
+
onCancel
|
|
1177
|
+
}) => {
|
|
1098
1178
|
const [state, setState] = import_react4.default.useState(settings);
|
|
1099
1179
|
const Form = Component.admin;
|
|
1180
|
+
const areChanges = JSON.stringify(state) !== JSON.stringify(settings);
|
|
1100
1181
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
1101
1182
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1102
1183
|
Form,
|
|
@@ -1104,6 +1185,7 @@ var AdminWidget = ({ Component, settings, onChange, onCancel }) => {
|
|
|
1104
1185
|
settings: state,
|
|
1105
1186
|
onChange: (key, value) => {
|
|
1106
1187
|
setState(__spreadValues(__spreadValues({}, state), { [key]: value }));
|
|
1188
|
+
handleChanges(__spreadValues(__spreadValues({}, state), { [key]: value }));
|
|
1107
1189
|
}
|
|
1108
1190
|
}
|
|
1109
1191
|
),
|
|
@@ -1116,7 +1198,14 @@ var AdminWidget = ({ Component, settings, onChange, onCancel }) => {
|
|
|
1116
1198
|
children: "Save"
|
|
1117
1199
|
}
|
|
1118
1200
|
),
|
|
1119
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1201
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1202
|
+
import_ui4.Button,
|
|
1203
|
+
{
|
|
1204
|
+
variant: "secondary",
|
|
1205
|
+
onClick: () => checkForChanges(areChanges, onCancel),
|
|
1206
|
+
children: "Cancel"
|
|
1207
|
+
}
|
|
1208
|
+
)
|
|
1120
1209
|
] });
|
|
1121
1210
|
};
|
|
1122
1211
|
var AdminWidget_default = AdminWidget;
|
|
@@ -1157,6 +1246,7 @@ var ContentBuilder = ({ value, onChange }) => {
|
|
|
1157
1246
|
});
|
|
1158
1247
|
const [open, setOpen] = import_react6.default.useState(false);
|
|
1159
1248
|
const [state, setState] = import_react6.default.useState(value);
|
|
1249
|
+
const [areChanges, setAreChanges] = import_react6.default.useState(false);
|
|
1160
1250
|
(0, import_react6.useEffect)(() => {
|
|
1161
1251
|
setState(value);
|
|
1162
1252
|
}, [value]);
|
|
@@ -1182,7 +1272,10 @@ var ContentBuilder = ({ value, onChange }) => {
|
|
|
1182
1272
|
setState(newState);
|
|
1183
1273
|
onChange(newState);
|
|
1184
1274
|
};
|
|
1185
|
-
const closeWidget = () =>
|
|
1275
|
+
const closeWidget = () => {
|
|
1276
|
+
setWidget({ open: false, current: null });
|
|
1277
|
+
setAreChanges(false);
|
|
1278
|
+
};
|
|
1186
1279
|
const updateWidget = (widget2, settings) => {
|
|
1187
1280
|
const newState = __spreadProps(__spreadValues({}, state), {
|
|
1188
1281
|
widgets: update(state.widgets, __spreadProps(__spreadValues({}, widget2), { settings }))
|
|
@@ -1191,6 +1284,7 @@ var ContentBuilder = ({ value, onChange }) => {
|
|
|
1191
1284
|
setState(newState);
|
|
1192
1285
|
onChange(newState);
|
|
1193
1286
|
};
|
|
1287
|
+
const handleChanges = (settings) => setAreChanges(widget.current.settings !== settings);
|
|
1194
1288
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WidgetContext_default.Consumer, { children: (WIDGETS) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react6.default.Fragment, { children: [
|
|
1195
1289
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1196
1290
|
import_react_sortablejs2.ReactSortable,
|
|
@@ -1200,11 +1294,11 @@ var ContentBuilder = ({ value, onChange }) => {
|
|
|
1200
1294
|
handle: ".r-handle",
|
|
1201
1295
|
direction: "vertical",
|
|
1202
1296
|
children: state.widgets.map((widget2) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ui6.Panel, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_ui6.PanelTitle, { children: [
|
|
1203
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_ui6.Stack, {
|
|
1297
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_ui6.Stack, { className: "r-stack-align-center", children: [
|
|
1204
1298
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ui6.Handle, { className: "r-handle" }),
|
|
1205
1299
|
getTitle(WIDGETS, widget2)
|
|
1206
1300
|
] }),
|
|
1207
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_ui6.Stack, {
|
|
1301
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_ui6.Stack, { className: "r-stack-align-center", children: [
|
|
1208
1302
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1209
1303
|
import_ui6.Button,
|
|
1210
1304
|
{
|
|
@@ -1226,15 +1320,25 @@ var ContentBuilder = ({ value, onChange }) => {
|
|
|
1226
1320
|
}
|
|
1227
1321
|
),
|
|
1228
1322
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ui6.Button, { variant: "secondary", onClick: () => setOpen(true), children: "Add widget" }),
|
|
1229
|
-
widget.open && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1230
|
-
|
|
1323
|
+
widget.open && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1324
|
+
import_ui6.Modal,
|
|
1231
1325
|
{
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1326
|
+
title: "Settings",
|
|
1327
|
+
open: widget.open,
|
|
1328
|
+
areChanges,
|
|
1329
|
+
onClose: closeWidget,
|
|
1330
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1331
|
+
AdminWidget_default,
|
|
1332
|
+
{
|
|
1333
|
+
Component: getWidget(WIDGETS, widget.current.component),
|
|
1334
|
+
settings: widget.current.settings,
|
|
1335
|
+
onChange: (settings) => updateWidget(widget.current, settings),
|
|
1336
|
+
handleChanges,
|
|
1337
|
+
onCancel: closeWidget
|
|
1338
|
+
}
|
|
1339
|
+
)
|
|
1236
1340
|
}
|
|
1237
|
-
)
|
|
1341
|
+
),
|
|
1238
1342
|
open && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1239
1343
|
AddWidget_default,
|
|
1240
1344
|
{
|
|
@@ -1316,12 +1420,12 @@ var ColumnBuilder = ({ value, onChange }) => {
|
|
|
1316
1420
|
direction: "vertical",
|
|
1317
1421
|
children: state.columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_ui7.Panel, { style: { flex: 1, marginRight: "0.5em" }, children: [
|
|
1318
1422
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_ui7.PanelTitle, { children: [
|
|
1319
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_ui7.Stack, {
|
|
1423
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_ui7.Stack, { className: "r-stack-align-center", children: [
|
|
1320
1424
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ui7.Handle, { className: "r-chandle" }),
|
|
1321
1425
|
"Column #",
|
|
1322
1426
|
idx + 1
|
|
1323
1427
|
] }),
|
|
1324
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_ui7.Stack, {
|
|
1428
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_ui7.Stack, { className: "r-stack-align-center", children: [
|
|
1325
1429
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1326
1430
|
import_ui7.Button,
|
|
1327
1431
|
{
|
|
@@ -1400,7 +1504,7 @@ var RowBuilder = ({ value, onChange }) => {
|
|
|
1400
1504
|
direction: "vertical",
|
|
1401
1505
|
children: state.rows.map((row, idx) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_ui8.Panel, { children: [
|
|
1402
1506
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_ui8.PanelTitle, { children: [
|
|
1403
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_ui8.Stack, {
|
|
1507
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_ui8.Stack, { className: "r-stack-align-center", children: [
|
|
1404
1508
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ui8.Handle, { className: "r-handle" }),
|
|
1405
1509
|
"Row #",
|
|
1406
1510
|
idx + 1
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raketa-builder/menu-builder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"lint": "TIMING=1 eslint \"**/*.js\"",
|
|
9
8
|
"build": "tsup src/index.js --format cjs --loader \".js=jsx\"",
|
|
10
|
-
"dev": "tsup src/index.js --format cjs --loader \".js=jsx\" --watch"
|
|
9
|
+
"dev": "tsup src/index.js --format cjs --loader \".js=jsx\" --watch",
|
|
10
|
+
"format": "prettier --write .",
|
|
11
|
+
"lint": "biome lint --max-diagnostics=5000 ."
|
|
11
12
|
},
|
|
12
13
|
"peerDependencies": {
|
|
13
14
|
"react": "18.2.0",
|
|
@@ -18,10 +19,10 @@
|
|
|
18
19
|
"ui": "*"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
22
|
+
"@biomejs/biome": "1.5.2",
|
|
21
23
|
"@types/react": "17.0.37",
|
|
22
24
|
"@types/react-dom": "17.0.11",
|
|
23
|
-
"
|
|
24
|
-
"eslint-config-custom": "*",
|
|
25
|
+
"prettier": "3.2.4",
|
|
25
26
|
"react": "18.2.0",
|
|
26
27
|
"tsconfig": "*",
|
|
27
28
|
"tsup": "6.5.0",
|
|
@@ -1,16 +1,41 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Button } from "@raketa-builder/ui";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
function checkForChanges(hasChanges, onClose) {
|
|
5
|
+
if (!hasChanges) {
|
|
6
|
+
onClose();
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
if (
|
|
11
|
+
!confirm(
|
|
12
|
+
"You’ve made changes to the widget. Are you sure you want to cancel?"
|
|
13
|
+
)
|
|
14
|
+
)
|
|
15
|
+
return;
|
|
16
|
+
|
|
17
|
+
onClose();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const AdminWidget = ({
|
|
21
|
+
Component,
|
|
22
|
+
settings,
|
|
23
|
+
onChange,
|
|
24
|
+
handleChanges,
|
|
25
|
+
onCancel,
|
|
26
|
+
}) => {
|
|
5
27
|
const [state, setState] = React.useState(settings);
|
|
6
28
|
const Form = Component.admin;
|
|
7
29
|
|
|
30
|
+
const areChanges = JSON.stringify(state) !== JSON.stringify(settings);
|
|
31
|
+
|
|
8
32
|
return (
|
|
9
33
|
<div>
|
|
10
34
|
<Form
|
|
11
35
|
settings={state}
|
|
12
36
|
onChange={(key, value) => {
|
|
13
37
|
setState({ ...state, ...{ [key]: value } });
|
|
38
|
+
handleChanges({ ...state, ...{ [key]: value } });
|
|
14
39
|
}}
|
|
15
40
|
/>
|
|
16
41
|
|
|
@@ -21,7 +46,10 @@ const AdminWidget = ({ Component, settings, onChange, onCancel }) => {
|
|
|
21
46
|
>
|
|
22
47
|
Save
|
|
23
48
|
</Button>
|
|
24
|
-
<Button
|
|
49
|
+
<Button
|
|
50
|
+
variant="secondary"
|
|
51
|
+
onClick={() => checkForChanges(areChanges, onCancel)}
|
|
52
|
+
>
|
|
25
53
|
Cancel
|
|
26
54
|
</Button>
|
|
27
55
|
</div>
|
|
@@ -99,12 +99,12 @@ const ColumnBuilder = ({ value, onChange }) => {
|
|
|
99
99
|
{state.columns.map((column, idx) => (
|
|
100
100
|
<Panel key={column.id} style={{ flex: 1, marginRight: "0.5em" }}>
|
|
101
101
|
<PanelTitle>
|
|
102
|
-
<Stack
|
|
102
|
+
<Stack className="r-stack-align-center">
|
|
103
103
|
<Handle className="r-chandle" />
|
|
104
104
|
Column #{idx + 1}
|
|
105
105
|
</Stack>
|
|
106
106
|
|
|
107
|
-
<Stack
|
|
107
|
+
<Stack className="r-stack-align-center">
|
|
108
108
|
<Button
|
|
109
109
|
variant="secondary"
|
|
110
110
|
onClick={() => duplicateColumn(state.columns, column)}
|
|
@@ -31,6 +31,7 @@ const ContentBuilder = ({ value, onChange }) => {
|
|
|
31
31
|
});
|
|
32
32
|
const [open, setOpen] = React.useState(false);
|
|
33
33
|
const [state, setState] = React.useState(value);
|
|
34
|
+
const [areChanges, setAreChanges] = React.useState(false);
|
|
34
35
|
|
|
35
36
|
useEffect(() => {
|
|
36
37
|
setState(value);
|
|
@@ -66,7 +67,10 @@ const ContentBuilder = ({ value, onChange }) => {
|
|
|
66
67
|
onChange(newState);
|
|
67
68
|
};
|
|
68
69
|
|
|
69
|
-
const closeWidget = () =>
|
|
70
|
+
const closeWidget = () => {
|
|
71
|
+
setWidget({ open: false, current: null });
|
|
72
|
+
setAreChanges(false);
|
|
73
|
+
};
|
|
70
74
|
|
|
71
75
|
const updateWidget = (widget, settings) => {
|
|
72
76
|
const newState = {
|
|
@@ -79,6 +83,9 @@ const ContentBuilder = ({ value, onChange }) => {
|
|
|
79
83
|
onChange(newState);
|
|
80
84
|
};
|
|
81
85
|
|
|
86
|
+
const handleChanges = (settings) =>
|
|
87
|
+
setAreChanges(widget.current.settings !== settings);
|
|
88
|
+
|
|
82
89
|
return (
|
|
83
90
|
<WidgetContext.Consumer>
|
|
84
91
|
{(WIDGETS) => (
|
|
@@ -92,12 +99,12 @@ const ContentBuilder = ({ value, onChange }) => {
|
|
|
92
99
|
{state.widgets.map((widget) => (
|
|
93
100
|
<Panel key={widget.id}>
|
|
94
101
|
<PanelTitle>
|
|
95
|
-
<Stack
|
|
102
|
+
<Stack className="r-stack-align-center">
|
|
96
103
|
<Handle className="r-handle" />
|
|
97
104
|
{getTitle(WIDGETS, widget)}
|
|
98
105
|
</Stack>
|
|
99
106
|
|
|
100
|
-
<Stack
|
|
107
|
+
<Stack className="r-stack-align-center">
|
|
101
108
|
<Button
|
|
102
109
|
variant="secondary"
|
|
103
110
|
onClick={() => setWidget({ open: true, current: widget })}
|
|
@@ -121,11 +128,17 @@ const ContentBuilder = ({ value, onChange }) => {
|
|
|
121
128
|
</Button>
|
|
122
129
|
|
|
123
130
|
{widget.open && (
|
|
124
|
-
<Modal
|
|
131
|
+
<Modal
|
|
132
|
+
title="Settings"
|
|
133
|
+
open={widget.open}
|
|
134
|
+
areChanges={areChanges}
|
|
135
|
+
onClose={closeWidget}
|
|
136
|
+
>
|
|
125
137
|
<AdminWidget
|
|
126
138
|
Component={getWidget(WIDGETS, widget.current.component)}
|
|
127
139
|
settings={widget.current.settings}
|
|
128
140
|
onChange={(settings) => updateWidget(widget.current, settings)}
|
|
141
|
+
handleChanges={handleChanges}
|
|
129
142
|
onCancel={closeWidget}
|
|
130
143
|
/>
|
|
131
144
|
</Modal>
|
package/src/MenuBuilder/icons.js
CHANGED
|
@@ -50,7 +50,7 @@ export function Delete({ className, ...rest }) {
|
|
|
50
50
|
viewBox="0 0 24 24"
|
|
51
51
|
fill="none"
|
|
52
52
|
stroke="#000"
|
|
53
|
-
|
|
53
|
+
strokeWidth="2"
|
|
54
54
|
strokeLinecap="round"
|
|
55
55
|
strokeLinejoin="round"
|
|
56
56
|
{...rest}
|
|
@@ -78,7 +78,7 @@ export function Plus({ className, ...rest }) {
|
|
|
78
78
|
viewBox="0 0 24 24"
|
|
79
79
|
fill="none"
|
|
80
80
|
stroke="#000"
|
|
81
|
-
|
|
81
|
+
strokeWidth="2"
|
|
82
82
|
strokeLinecap="round"
|
|
83
83
|
strokeLinejoin="round"
|
|
84
84
|
{...rest}
|
|
@@ -106,7 +106,7 @@ export function Copy({ className, ...rest }) {
|
|
|
106
106
|
viewBox="0 0 24 24"
|
|
107
107
|
fill="none"
|
|
108
108
|
stroke="#000"
|
|
109
|
-
|
|
109
|
+
strokeWidth="2"
|
|
110
110
|
strokeLinecap="round"
|
|
111
111
|
strokeLinejoin="round"
|
|
112
112
|
{...rest}
|
package/src/styles.css
CHANGED
package/tsconfig.json
CHANGED