remoraid 2.1.7 → 2.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/index.cjs +37 -16
- package/dist/core/index.d.ts +43 -38
- package/dist/core/index.js +37 -16
- package/dist/jsonforms/index.cjs +66 -156
- package/dist/jsonforms/index.js +48 -150
- package/dist/modals/index.cjs +4 -229
- package/dist/modals/index.js +4 -292
- package/dist/server/index.d.ts +7 -7
- package/package.json +1 -1
package/dist/jsonforms/index.js
CHANGED
@@ -133,116 +133,14 @@ import {
|
|
133
133
|
Paper as Paper2,
|
134
134
|
Stack,
|
135
135
|
Tooltip,
|
136
|
-
useMantineTheme
|
136
|
+
useMantineTheme
|
137
137
|
} from "@mantine/core";
|
138
138
|
import { IconPlus, IconTrash } from "@tabler/icons-react";
|
139
139
|
import { useState as useState2 } from "react";
|
140
|
-
|
141
|
-
|
142
|
-
var co = (condition, value, fallback) => condition(value) ? value : fallback;
|
143
|
-
|
144
|
-
// src/core/components/RemoraidProvider/ThemeProvider/index.tsx
|
145
|
-
import {
|
146
|
-
px,
|
147
|
-
rgba,
|
148
|
-
useMantineColorScheme,
|
149
|
-
useMantineTheme
|
150
|
-
} from "@mantine/core";
|
151
|
-
import {
|
152
|
-
IconAlertCircle,
|
153
|
-
IconCircleCheck,
|
154
|
-
IconInfoCircle
|
155
|
-
} from "@tabler/icons-react";
|
156
|
-
import React2, {
|
157
|
-
useContext as useContext2,
|
158
|
-
useMemo
|
159
|
-
} from "react";
|
160
|
-
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
161
|
-
var isMantinePrimaryShade = (primaryShade) => {
|
162
|
-
if (isNaN(Number(primaryShade))) {
|
163
|
-
return true;
|
164
|
-
}
|
165
|
-
return false;
|
166
|
-
};
|
167
|
-
var createRemoraidTheme = (customTheme, mantineTheme, colorScheme) => {
|
168
|
-
const defaultMediumIconProps = { size: "1.125em" };
|
169
|
-
let transparentBackground;
|
170
|
-
let primaryColor;
|
171
|
-
let spacingPx;
|
172
|
-
if (mantineTheme && colorScheme) {
|
173
|
-
transparentBackground = colorScheme === "dark" ? rgba(mantineTheme.colors.dark[8], 0.8) : rgba(mantineTheme.white, 0.8);
|
174
|
-
primaryColor = mantineTheme.colors[mantineTheme.primaryColor][isMantinePrimaryShade(mantineTheme.primaryShade) ? mantineTheme.primaryShade[colorScheme === "auto" ? "light" : colorScheme] : mantineTheme.primaryShade];
|
175
|
-
spacingPx = {
|
176
|
-
xs: Number(co((v) => !Number.isNaN(v), Number(px(mantineTheme.spacing.xs)), 0)),
|
177
|
-
sm: Number(co((v) => !Number.isNaN(v), Number(px(mantineTheme.spacing.sm)), 0)),
|
178
|
-
md: Number(co((v) => !Number.isNaN(v), Number(px(mantineTheme.spacing.md)), 0)),
|
179
|
-
lg: Number(co((v) => !Number.isNaN(v), Number(px(mantineTheme.spacing.lg)), 0)),
|
180
|
-
xl: Number(co((v) => !Number.isNaN(v), Number(px(mantineTheme.spacing.xl)), 0))
|
181
|
-
};
|
182
|
-
}
|
183
|
-
return {
|
184
|
-
complete: true,
|
185
|
-
transitionDurations: {
|
186
|
-
short: 200,
|
187
|
-
medium: 350,
|
188
|
-
long: 500
|
189
|
-
},
|
190
|
-
breakpoints: {
|
191
|
-
buttonCollapse: "md",
|
192
|
-
badgeGroupCollapse: "md"
|
193
|
-
},
|
194
|
-
scrollAreaProps: {
|
195
|
-
scrollbarSize: 8,
|
196
|
-
scrollHideDelay: 20,
|
197
|
-
type: "hover"
|
198
|
-
},
|
199
|
-
containerSize: 1300,
|
200
|
-
alertProps: {
|
201
|
-
negative: {
|
202
|
-
icon: /* @__PURE__ */ jsxDEV3(IconAlertCircle, {
|
203
|
-
...defaultMediumIconProps
|
204
|
-
}, undefined, false, undefined, this),
|
205
|
-
variant: "light",
|
206
|
-
color: "red",
|
207
|
-
title: "Attention!"
|
208
|
-
},
|
209
|
-
neutral: {
|
210
|
-
icon: /* @__PURE__ */ jsxDEV3(IconInfoCircle, {
|
211
|
-
...defaultMediumIconProps
|
212
|
-
}, undefined, false, undefined, this),
|
213
|
-
variant: "light",
|
214
|
-
color: mantineTheme?.primaryColor,
|
215
|
-
title: "Information"
|
216
|
-
},
|
217
|
-
positive: {
|
218
|
-
icon: /* @__PURE__ */ jsxDEV3(IconCircleCheck, {
|
219
|
-
...defaultMediumIconProps
|
220
|
-
}, undefined, false, undefined, this),
|
221
|
-
variant: "light",
|
222
|
-
color: "green",
|
223
|
-
title: "Success"
|
224
|
-
}
|
225
|
-
},
|
226
|
-
iconProps: {
|
227
|
-
medium: defaultMediumIconProps,
|
228
|
-
tiny: { size: 14, stroke: 3 }
|
229
|
-
},
|
230
|
-
jsonStringifySpace: 2,
|
231
|
-
transparentBackground,
|
232
|
-
primaryColor,
|
233
|
-
spacingPx,
|
234
|
-
...customTheme
|
235
|
-
};
|
236
|
-
};
|
237
|
-
var themeContext = React2.createContext(createRemoraidTheme());
|
238
|
-
var useRemoraidTheme = () => {
|
239
|
-
return useContext2(themeContext);
|
240
|
-
};
|
241
|
-
|
242
|
-
// src/jsonforms/renderers/ArrayControl.tsx
|
243
|
-
import { jsxDEV as jsxDEV4, Fragment as Fragment2 } from "react/jsx-dev-runtime";
|
140
|
+
import { useRemoraidTheme } from "remoraid/core";
|
141
|
+
import { jsxDEV as jsxDEV3, Fragment as Fragment2 } from "react/jsx-dev-runtime";
|
244
142
|
function PlainArrayControl(props) {
|
245
|
-
const mantineTheme =
|
143
|
+
const mantineTheme = useMantineTheme();
|
246
144
|
const theme = useRemoraidTheme();
|
247
145
|
const { label, schema, data, handleChange, path, required } = props;
|
248
146
|
const {
|
@@ -254,7 +152,7 @@ function PlainArrayControl(props) {
|
|
254
152
|
if (schema.items && !Array.isArray(schema.items)) {
|
255
153
|
schemaItems = schema.items;
|
256
154
|
} else {
|
257
|
-
return /* @__PURE__ */
|
155
|
+
return /* @__PURE__ */ jsxDEV3(Fragment2, {
|
258
156
|
children: [
|
259
157
|
"No applicable renderer found for '",
|
260
158
|
label,
|
@@ -262,37 +160,37 @@ function PlainArrayControl(props) {
|
|
262
160
|
]
|
263
161
|
}, undefined, true, undefined, this);
|
264
162
|
}
|
265
|
-
return /* @__PURE__ */
|
266
|
-
children: /* @__PURE__ */
|
163
|
+
return /* @__PURE__ */ jsxDEV3(Fragment2, {
|
164
|
+
children: /* @__PURE__ */ jsxDEV3(Input2.Wrapper, {
|
267
165
|
label,
|
268
166
|
description: withDescriptions ? schema.description : undefined,
|
269
167
|
withAsterisk: required,
|
270
|
-
children: /* @__PURE__ */
|
168
|
+
children: /* @__PURE__ */ jsxDEV3(Paper2, {
|
271
169
|
withBorder: Array.isArray(data) && data.length > 0,
|
272
170
|
shadow: "0",
|
273
171
|
p: Array.isArray(data) && data.length > 0 ? "sm" : 0,
|
274
172
|
mt: withDescriptions && schema.description && schema.description.length > 0 ? 4 : 0,
|
275
|
-
children: /* @__PURE__ */
|
173
|
+
children: /* @__PURE__ */ jsxDEV3(Stack, {
|
276
174
|
align: "stretch",
|
277
175
|
justify: "flex-start",
|
278
176
|
gap: "sm",
|
279
177
|
children: [
|
280
178
|
Array.isArray(data) ? data.map((item, i) => {
|
281
|
-
return /* @__PURE__ */
|
179
|
+
return /* @__PURE__ */ jsxDEV3(Flex, {
|
282
180
|
gap: "xs",
|
283
181
|
justify: "flex-start",
|
284
182
|
align: "center",
|
285
183
|
direction: "row",
|
286
184
|
wrap: "nowrap",
|
287
185
|
children: [
|
288
|
-
/* @__PURE__ */
|
186
|
+
/* @__PURE__ */ jsxDEV3(Paper2, {
|
289
187
|
p: schemaItems.type === "object" ? "sm" : 0,
|
290
188
|
withBorder: schemaItems.type === "object",
|
291
189
|
style: {
|
292
190
|
borderColor: isHoveringDelete === i ? mantineTheme.colors.red[6] : undefined
|
293
191
|
},
|
294
192
|
flex: 1,
|
295
|
-
children: /* @__PURE__ */
|
193
|
+
children: /* @__PURE__ */ jsxDEV3(JsonForms2, {
|
296
194
|
schema: {
|
297
195
|
...schemaItems,
|
298
196
|
$schema: undefined
|
@@ -308,9 +206,9 @@ function PlainArrayControl(props) {
|
|
308
206
|
validationMode: "NoValidation"
|
309
207
|
}, undefined, false, undefined, this)
|
310
208
|
}, undefined, false, undefined, this),
|
311
|
-
/* @__PURE__ */
|
209
|
+
/* @__PURE__ */ jsxDEV3(Tooltip, {
|
312
210
|
label: "Delete Item",
|
313
|
-
children: /* @__PURE__ */
|
211
|
+
children: /* @__PURE__ */ jsxDEV3(ActionIcon, {
|
314
212
|
variant: "default",
|
315
213
|
onClick: () => {
|
316
214
|
const dataCopy = [...data];
|
@@ -326,17 +224,17 @@ function PlainArrayControl(props) {
|
|
326
224
|
onMouseLeave: () => {
|
327
225
|
setIsHoveringDelete(null);
|
328
226
|
},
|
329
|
-
children: /* @__PURE__ */
|
227
|
+
children: /* @__PURE__ */ jsxDEV3(IconTrash, {
|
330
228
|
...theme.iconProps.medium
|
331
229
|
}, undefined, false, undefined, this)
|
332
230
|
}, undefined, false, undefined, this)
|
333
231
|
}, undefined, false, undefined, this)
|
334
232
|
]
|
335
233
|
}, i, true, undefined, this);
|
336
|
-
}) : /* @__PURE__ */
|
337
|
-
/* @__PURE__ */
|
234
|
+
}) : /* @__PURE__ */ jsxDEV3(Fragment2, {}, undefined, false, undefined, this),
|
235
|
+
/* @__PURE__ */ jsxDEV3(Button, {
|
338
236
|
variant: "default",
|
339
|
-
leftSection: /* @__PURE__ */
|
237
|
+
leftSection: /* @__PURE__ */ jsxDEV3(IconPlus, {
|
340
238
|
...theme.iconProps.medium
|
341
239
|
}, undefined, false, undefined, this),
|
342
240
|
onClick: () => {
|
@@ -366,7 +264,7 @@ var ArrayControl_default = ArrayControl;
|
|
366
264
|
// src/jsonforms/renderers/CheckboxControl.tsx
|
367
265
|
import { withJsonFormsControlProps as withJsonFormsControlProps3 } from "@jsonforms/react";
|
368
266
|
import { Checkbox } from "@mantine/core";
|
369
|
-
import { jsxDEV as
|
267
|
+
import { jsxDEV as jsxDEV4, Fragment as Fragment3 } from "react/jsx-dev-runtime";
|
370
268
|
function PlainCheckboxControl({
|
371
269
|
data,
|
372
270
|
handleChange,
|
@@ -378,8 +276,8 @@ function PlainCheckboxControl({
|
|
378
276
|
const {
|
379
277
|
formOptions: { withDescriptions }
|
380
278
|
} = useFormOptions();
|
381
|
-
return /* @__PURE__ */
|
382
|
-
children: /* @__PURE__ */
|
279
|
+
return /* @__PURE__ */ jsxDEV4(Fragment3, {
|
280
|
+
children: /* @__PURE__ */ jsxDEV4(Checkbox, {
|
383
281
|
label,
|
384
282
|
py: "sm",
|
385
283
|
size: "sm",
|
@@ -399,7 +297,7 @@ var CheckboxControl_default = CheckboxControl;
|
|
399
297
|
// src/jsonforms/renderers/NumberControl.tsx
|
400
298
|
import { withJsonFormsControlProps as withJsonFormsControlProps4 } from "@jsonforms/react";
|
401
299
|
import { NumberInput } from "@mantine/core";
|
402
|
-
import { jsxDEV as
|
300
|
+
import { jsxDEV as jsxDEV5, Fragment as Fragment4 } from "react/jsx-dev-runtime";
|
403
301
|
function PlainNumberControl({
|
404
302
|
data,
|
405
303
|
handleChange,
|
@@ -411,8 +309,8 @@ function PlainNumberControl({
|
|
411
309
|
const {
|
412
310
|
formOptions: { withDescriptions }
|
413
311
|
} = useFormOptions();
|
414
|
-
return /* @__PURE__ */
|
415
|
-
children: /* @__PURE__ */
|
312
|
+
return /* @__PURE__ */ jsxDEV5(Fragment4, {
|
313
|
+
children: /* @__PURE__ */ jsxDEV5(NumberInput, {
|
416
314
|
label,
|
417
315
|
variant: "filled",
|
418
316
|
value: data,
|
@@ -437,24 +335,24 @@ import {
|
|
437
335
|
withJsonFormsControlProps as withJsonFormsControlProps5
|
438
336
|
} from "@jsonforms/react";
|
439
337
|
import { Input as Input3, Paper as Paper3 } from "@mantine/core";
|
440
|
-
import { jsxDEV as
|
338
|
+
import { jsxDEV as jsxDEV6, Fragment as Fragment5 } from "react/jsx-dev-runtime";
|
441
339
|
function PlainObjectControl(props) {
|
442
340
|
const { label, schema, data, handleChange, path, required } = props;
|
443
341
|
const {
|
444
342
|
formOptions: { withDescriptions }
|
445
343
|
} = useFormOptions();
|
446
344
|
const { renderers, cells } = useJsonForms3();
|
447
|
-
return /* @__PURE__ */
|
448
|
-
children: /* @__PURE__ */
|
345
|
+
return /* @__PURE__ */ jsxDEV6(Fragment5, {
|
346
|
+
children: /* @__PURE__ */ jsxDEV6(Input3.Wrapper, {
|
449
347
|
label,
|
450
348
|
description: withDescriptions ? schema.description : undefined,
|
451
349
|
withAsterisk: required,
|
452
|
-
children: /* @__PURE__ */
|
350
|
+
children: /* @__PURE__ */ jsxDEV6(Paper3, {
|
453
351
|
withBorder: true,
|
454
352
|
shadow: "0",
|
455
353
|
p: "sm",
|
456
354
|
mt: withDescriptions && schema.description && schema.description.length > 0 ? 4 : 0,
|
457
|
-
children: /* @__PURE__ */
|
355
|
+
children: /* @__PURE__ */ jsxDEV6(JsonForms3, {
|
458
356
|
schema: {
|
459
357
|
...schema,
|
460
358
|
$schema: undefined
|
@@ -477,7 +375,7 @@ var ObjectControl_default = ObjectControl;
|
|
477
375
|
// src/jsonforms/renderers/StringSelectControl.tsx
|
478
376
|
import { withJsonFormsControlProps as withJsonFormsControlProps6 } from "@jsonforms/react";
|
479
377
|
import { Select as Select2 } from "@mantine/core";
|
480
|
-
import { jsxDEV as
|
378
|
+
import { jsxDEV as jsxDEV7, Fragment as Fragment6 } from "react/jsx-dev-runtime";
|
481
379
|
function PlainTimestampControl({
|
482
380
|
data,
|
483
381
|
handleChange,
|
@@ -489,8 +387,8 @@ function PlainTimestampControl({
|
|
489
387
|
const {
|
490
388
|
formOptions: { withDescriptions }
|
491
389
|
} = useFormOptions();
|
492
|
-
return /* @__PURE__ */
|
493
|
-
children: /* @__PURE__ */
|
390
|
+
return /* @__PURE__ */ jsxDEV7(Fragment6, {
|
391
|
+
children: /* @__PURE__ */ jsxDEV7(Select2, {
|
494
392
|
label,
|
495
393
|
data: schema.enum,
|
496
394
|
value: data,
|
@@ -563,7 +461,7 @@ var verticalLayoutTester_default = rankWith9(2, uiTypeIs9("VerticalLayout"));
|
|
563
461
|
// src/jsonforms/renderers/TextControl.tsx
|
564
462
|
import { withJsonFormsControlProps as withJsonFormsControlProps7 } from "@jsonforms/react";
|
565
463
|
import { TextInput } from "@mantine/core";
|
566
|
-
import { jsxDEV as
|
464
|
+
import { jsxDEV as jsxDEV8, Fragment as Fragment7 } from "react/jsx-dev-runtime";
|
567
465
|
function PlainTextControl({
|
568
466
|
data,
|
569
467
|
handleChange,
|
@@ -575,8 +473,8 @@ function PlainTextControl({
|
|
575
473
|
const {
|
576
474
|
formOptions: { withDescriptions }
|
577
475
|
} = useFormOptions();
|
578
|
-
return /* @__PURE__ */
|
579
|
-
children: /* @__PURE__ */
|
476
|
+
return /* @__PURE__ */ jsxDEV8(Fragment7, {
|
477
|
+
children: /* @__PURE__ */ jsxDEV8(TextInput, {
|
580
478
|
label,
|
581
479
|
variant: "filled",
|
582
480
|
placeholder: "",
|
@@ -595,7 +493,7 @@ var TextControl_default = TextControl;
|
|
595
493
|
// src/jsonforms/renderers/TimestampControl.tsx
|
596
494
|
import { withJsonFormsControlProps as withJsonFormsControlProps8 } from "@jsonforms/react";
|
597
495
|
import { DatePickerInput } from "@mantine/dates";
|
598
|
-
import { jsxDEV as
|
496
|
+
import { jsxDEV as jsxDEV9, Fragment as Fragment8 } from "react/jsx-dev-runtime";
|
599
497
|
function PlainTimestampControl2({
|
600
498
|
data,
|
601
499
|
handleChange,
|
@@ -607,8 +505,8 @@ function PlainTimestampControl2({
|
|
607
505
|
const {
|
608
506
|
formOptions: { withDescriptions }
|
609
507
|
} = useFormOptions();
|
610
|
-
return /* @__PURE__ */
|
611
|
-
children: /* @__PURE__ */
|
508
|
+
return /* @__PURE__ */ jsxDEV9(Fragment8, {
|
509
|
+
children: /* @__PURE__ */ jsxDEV9(DatePickerInput, {
|
612
510
|
label,
|
613
511
|
placeholder: "Pick a date",
|
614
512
|
value: new Date(data * 1000),
|
@@ -626,18 +524,18 @@ var TimestampControl2 = withJsonFormsControlProps8(PlainTimestampControl2);
|
|
626
524
|
var TimestampControl_default = TimestampControl2;
|
627
525
|
|
628
526
|
// src/jsonforms/renderers/VerticalLayout.tsx
|
629
|
-
import
|
527
|
+
import React2 from "react";
|
630
528
|
import { withJsonFormsLayoutProps } from "@jsonforms/react";
|
631
529
|
import { JsonFormsDispatch, useJsonForms as useJsonForms4 } from "@jsonforms/react";
|
632
|
-
import { useMantineTheme as
|
633
|
-
import { jsxDEV as
|
530
|
+
import { useMantineTheme as useMantineTheme2 } from "@mantine/core";
|
531
|
+
import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
|
634
532
|
"use client";
|
635
533
|
var JsonFormsLayout = ({
|
636
534
|
className,
|
637
535
|
children,
|
638
536
|
visible
|
639
537
|
}) => {
|
640
|
-
return /* @__PURE__ */
|
538
|
+
return /* @__PURE__ */ jsxDEV10("div", {
|
641
539
|
className,
|
642
540
|
hidden: visible === undefined || visible === null ? false : !visible,
|
643
541
|
children
|
@@ -645,12 +543,12 @@ var JsonFormsLayout = ({
|
|
645
543
|
};
|
646
544
|
var renderChildren = (layout, schema, className, path, enabled) => {
|
647
545
|
const { renderers, cells } = useJsonForms4();
|
648
|
-
const theme =
|
546
|
+
const theme = useMantineTheme2();
|
649
547
|
return layout.elements.map((child, index) => {
|
650
|
-
return /* @__PURE__ */
|
548
|
+
return /* @__PURE__ */ jsxDEV10("div", {
|
651
549
|
className,
|
652
550
|
style: { marginTop: index === 0 ? 0 : theme.spacing.xs },
|
653
|
-
children: /* @__PURE__ */
|
551
|
+
children: /* @__PURE__ */ jsxDEV10(JsonFormsDispatch, {
|
654
552
|
renderers,
|
655
553
|
cells,
|
656
554
|
uischema: child,
|
@@ -663,11 +561,11 @@ var renderChildren = (layout, schema, className, path, enabled) => {
|
|
663
561
|
};
|
664
562
|
var VerticalLayoutRenderer = (props) => {
|
665
563
|
const { data: _data, ...otherProps } = props;
|
666
|
-
return /* @__PURE__ */
|
564
|
+
return /* @__PURE__ */ jsxDEV10(VerticalLayoutRendererComponent, {
|
667
565
|
...otherProps
|
668
566
|
}, undefined, false, undefined, this);
|
669
567
|
};
|
670
|
-
var VerticalLayoutRendererComponent =
|
568
|
+
var VerticalLayoutRendererComponent = React2.memo(function VerticalLayoutRendererComponent2({
|
671
569
|
schema,
|
672
570
|
uischema,
|
673
571
|
path,
|
@@ -677,7 +575,7 @@ var VerticalLayoutRendererComponent = React3.memo(function VerticalLayoutRendere
|
|
677
575
|
const verticalLayout = uischema;
|
678
576
|
const layoutClassName = "";
|
679
577
|
const childClassNames = "";
|
680
|
-
return /* @__PURE__ */
|
578
|
+
return /* @__PURE__ */ jsxDEV10(JsonFormsLayout, {
|
681
579
|
className: layoutClassName,
|
682
580
|
uischema,
|
683
581
|
schema,
|
package/dist/modals/index.cjs
CHANGED
@@ -1,21 +1,8 @@
|
|
1
1
|
"use client";
|
2
|
-
var __create = Object.create;
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
4
2
|
var __defProp = Object.defineProperty;
|
5
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
-
var __toESM = (mod, isNodeMode, target) => {
|
9
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
10
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
11
|
-
for (let key of __getOwnPropNames(mod))
|
12
|
-
if (!__hasOwnProp.call(to, key))
|
13
|
-
__defProp(to, key, {
|
14
|
-
get: () => mod[key],
|
15
|
-
enumerable: true
|
16
|
-
});
|
17
|
-
return to;
|
18
|
-
};
|
19
6
|
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
20
7
|
var __toCommonJS = (from) => {
|
21
8
|
var entry = __moduleCache.get(from), desc;
|
@@ -49,228 +36,16 @@ __export(exports_modals, {
|
|
49
36
|
module.exports = __toCommonJS(exports_modals);
|
50
37
|
|
51
38
|
// src/modals/components/JSONModal/index.tsx
|
52
|
-
var import_core16 = require("@mantine/core");
|
53
|
-
|
54
|
-
// src/core/components/RemoraidProvider/UserExperienceProvider/index.tsx
|
55
|
-
var import_react3 = __toESM(require("react"));
|
56
|
-
var import_react_cookie = require("react-cookie");
|
57
|
-
|
58
|
-
// src/core/components/AppShell/NavbarMinimal/index.tsx
|
59
|
-
var import_core2 = require("@mantine/core");
|
60
|
-
var import_icons_react2 = require("@tabler/icons-react");
|
61
|
-
var import_link = __toESM(require("next/link"));
|
62
|
-
var import_navigation = require("next/navigation");
|
63
|
-
var import_react2 = require("react");
|
64
|
-
|
65
|
-
// src/core/lib/utils.ts
|
66
|
-
var co = (condition, value, fallback) => condition(value) ? value : fallback;
|
67
|
-
|
68
|
-
// src/core/components/RemoraidProvider/ThemeProvider/index.tsx
|
69
39
|
var import_core = require("@mantine/core");
|
70
|
-
var
|
71
|
-
var import_react = __toESM(require("react"));
|
40
|
+
var import_core2 = require("remoraid/core");
|
72
41
|
var jsx_dev_runtime = require("react/jsx-dev-runtime");
|
73
|
-
var isMantinePrimaryShade = (primaryShade) => {
|
74
|
-
if (isNaN(Number(primaryShade))) {
|
75
|
-
return true;
|
76
|
-
}
|
77
|
-
return false;
|
78
|
-
};
|
79
|
-
var createRemoraidTheme = (customTheme, mantineTheme, colorScheme) => {
|
80
|
-
const defaultMediumIconProps = { size: "1.125em" };
|
81
|
-
let transparentBackground;
|
82
|
-
let primaryColor;
|
83
|
-
let spacingPx;
|
84
|
-
if (mantineTheme && colorScheme) {
|
85
|
-
transparentBackground = colorScheme === "dark" ? import_core.rgba(mantineTheme.colors.dark[8], 0.8) : import_core.rgba(mantineTheme.white, 0.8);
|
86
|
-
primaryColor = mantineTheme.colors[mantineTheme.primaryColor][isMantinePrimaryShade(mantineTheme.primaryShade) ? mantineTheme.primaryShade[colorScheme === "auto" ? "light" : colorScheme] : mantineTheme.primaryShade];
|
87
|
-
spacingPx = {
|
88
|
-
xs: Number(co((v) => !Number.isNaN(v), Number(import_core.px(mantineTheme.spacing.xs)), 0)),
|
89
|
-
sm: Number(co((v) => !Number.isNaN(v), Number(import_core.px(mantineTheme.spacing.sm)), 0)),
|
90
|
-
md: Number(co((v) => !Number.isNaN(v), Number(import_core.px(mantineTheme.spacing.md)), 0)),
|
91
|
-
lg: Number(co((v) => !Number.isNaN(v), Number(import_core.px(mantineTheme.spacing.lg)), 0)),
|
92
|
-
xl: Number(co((v) => !Number.isNaN(v), Number(import_core.px(mantineTheme.spacing.xl)), 0))
|
93
|
-
};
|
94
|
-
}
|
95
|
-
return {
|
96
|
-
complete: true,
|
97
|
-
transitionDurations: {
|
98
|
-
short: 200,
|
99
|
-
medium: 350,
|
100
|
-
long: 500
|
101
|
-
},
|
102
|
-
breakpoints: {
|
103
|
-
buttonCollapse: "md",
|
104
|
-
badgeGroupCollapse: "md"
|
105
|
-
},
|
106
|
-
scrollAreaProps: {
|
107
|
-
scrollbarSize: 8,
|
108
|
-
scrollHideDelay: 20,
|
109
|
-
type: "hover"
|
110
|
-
},
|
111
|
-
containerSize: 1300,
|
112
|
-
alertProps: {
|
113
|
-
negative: {
|
114
|
-
icon: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_icons_react.IconAlertCircle, {
|
115
|
-
...defaultMediumIconProps
|
116
|
-
}, undefined, false, undefined, this),
|
117
|
-
variant: "light",
|
118
|
-
color: "red",
|
119
|
-
title: "Attention!"
|
120
|
-
},
|
121
|
-
neutral: {
|
122
|
-
icon: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_icons_react.IconInfoCircle, {
|
123
|
-
...defaultMediumIconProps
|
124
|
-
}, undefined, false, undefined, this),
|
125
|
-
variant: "light",
|
126
|
-
color: mantineTheme?.primaryColor,
|
127
|
-
title: "Information"
|
128
|
-
},
|
129
|
-
positive: {
|
130
|
-
icon: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_icons_react.IconCircleCheck, {
|
131
|
-
...defaultMediumIconProps
|
132
|
-
}, undefined, false, undefined, this),
|
133
|
-
variant: "light",
|
134
|
-
color: "green",
|
135
|
-
title: "Success"
|
136
|
-
}
|
137
|
-
},
|
138
|
-
iconProps: {
|
139
|
-
medium: defaultMediumIconProps,
|
140
|
-
tiny: { size: 14, stroke: 3 }
|
141
|
-
},
|
142
|
-
jsonStringifySpace: 2,
|
143
|
-
transparentBackground,
|
144
|
-
primaryColor,
|
145
|
-
spacingPx,
|
146
|
-
...customTheme
|
147
|
-
};
|
148
|
-
};
|
149
|
-
var themeContext = import_react.default.createContext(createRemoraidTheme());
|
150
|
-
var useRemoraidTheme = () => {
|
151
|
-
return import_react.useContext(themeContext);
|
152
|
-
};
|
153
|
-
|
154
|
-
// src/core/components/AppShell/NavbarMinimal/index.tsx
|
155
|
-
var jsx_dev_runtime2 = require("react/jsx-dev-runtime");
|
156
|
-
var defaultSettings = {
|
157
|
-
hiddenPages: [],
|
158
|
-
linkSize: import_core2.rem("50px"),
|
159
|
-
iconSize: "50%",
|
160
|
-
px: "sm",
|
161
|
-
py: "md"
|
162
|
-
};
|
163
|
-
|
164
|
-
// src/core/components/RemoraidProvider/UserExperienceProvider/index.tsx
|
165
|
-
var jsx_dev_runtime3 = require("react/jsx-dev-runtime");
|
166
|
-
var defaultNavbarSettings = {
|
167
|
-
minimal: defaultSettings
|
168
|
-
};
|
169
|
-
var defaultUserExperience = {
|
170
|
-
navbarVariant: "minimal",
|
171
|
-
navbarSettings: defaultNavbarSettings.minimal,
|
172
|
-
showWelcomeMessage: true
|
173
|
-
};
|
174
|
-
var userExperienceContext = import_react3.default.createContext({
|
175
|
-
userExperience: defaultUserExperience,
|
176
|
-
updateUserExperience: () => {},
|
177
|
-
processedCookie: false
|
178
|
-
});
|
179
|
-
|
180
|
-
// src/core/components/RemoraidProvider/WidgetsProvider/index.tsx
|
181
|
-
var import_react4 = __toESM(require("react"));
|
182
|
-
var jsx_dev_runtime4 = require("react/jsx-dev-runtime");
|
183
|
-
var widgetsContext = import_react4.default.createContext({
|
184
|
-
widgets: {},
|
185
|
-
activeWidget: null,
|
186
|
-
updateActiveWidget: () => {},
|
187
|
-
registerWidget: () => {},
|
188
|
-
registerPage: () => {},
|
189
|
-
isWidgetRegistered: () => false,
|
190
|
-
isPageRegistered: () => false,
|
191
|
-
updateWidgetSelection: () => {},
|
192
|
-
updateWidgetSelectionBulk: () => {},
|
193
|
-
isWidgetSelected: () => false
|
194
|
-
});
|
195
|
-
|
196
|
-
// src/core/components/RemoraidProvider/index.tsx
|
197
|
-
var import_react_cookie2 = require("react-cookie");
|
198
|
-
var jsx_dev_runtime5 = require("react/jsx-dev-runtime");
|
199
|
-
// src/core/components/AppShell/index.tsx
|
200
|
-
var import_core4 = require("@mantine/core");
|
201
|
-
var import_hooks = require("@mantine/hooks");
|
202
|
-
|
203
|
-
// src/core/components/AppShell/Footer/index.tsx
|
204
|
-
var import_core3 = require("@mantine/core");
|
205
|
-
var import_icons_react3 = require("@tabler/icons-react");
|
206
|
-
var jsx_dev_runtime6 = require("react/jsx-dev-runtime");
|
207
|
-
|
208
|
-
// src/core/components/AppShell/index.tsx
|
209
|
-
var jsx_dev_runtime7 = require("react/jsx-dev-runtime");
|
210
|
-
// src/core/components/WidgetSelectionHeader/index.tsx
|
211
|
-
var import_core6 = require("@mantine/core");
|
212
|
-
|
213
|
-
// src/core/components/Page/index.tsx
|
214
|
-
var import_react5 = __toESM(require("react"));
|
215
|
-
var import_navigation2 = require("next/navigation");
|
216
|
-
|
217
|
-
// src/core/components/Page/PageContainer/index.tsx
|
218
|
-
var import_core5 = require("@mantine/core");
|
219
|
-
var jsx_dev_runtime8 = require("react/jsx-dev-runtime");
|
220
|
-
|
221
|
-
// src/core/components/Page/index.tsx
|
222
|
-
var jsx_dev_runtime9 = require("react/jsx-dev-runtime");
|
223
|
-
var pageContext = import_react5.default.createContext(null);
|
224
|
-
|
225
|
-
// src/core/components/WidgetSelectionHeader/index.tsx
|
226
|
-
var import_icons_react4 = require("@tabler/icons-react");
|
227
|
-
var jsx_dev_runtime10 = require("react/jsx-dev-runtime");
|
228
|
-
// src/core/components/CloseButton/index.tsx
|
229
|
-
var import_core7 = require("@mantine/core");
|
230
|
-
var import_icons_react5 = require("@tabler/icons-react");
|
231
|
-
var jsx_dev_runtime11 = require("react/jsx-dev-runtime");
|
232
|
-
// src/core/components/BadgeGroup/index.tsx
|
233
|
-
var import_core9 = require("@mantine/core");
|
234
|
-
var import_react6 = __toESM(require("react"));
|
235
|
-
|
236
|
-
// src/core/components/BadgeMinimal/index.tsx
|
237
|
-
var import_core8 = require("@mantine/core");
|
238
|
-
var jsx_dev_runtime12 = require("react/jsx-dev-runtime");
|
239
|
-
|
240
|
-
// src/core/components/BadgeGroup/index.tsx
|
241
|
-
var jsx_dev_runtime13 = require("react/jsx-dev-runtime");
|
242
|
-
var react = require("react");
|
243
|
-
// src/core/components/AlertMinimal/index.tsx
|
244
|
-
var import_core10 = require("@mantine/core");
|
245
|
-
var jsx_dev_runtime14 = require("react/jsx-dev-runtime");
|
246
|
-
// src/core/components/ResponsiveButton/index.tsx
|
247
|
-
var import_core11 = require("@mantine/core");
|
248
|
-
var import_icons_react6 = require("@tabler/icons-react");
|
249
|
-
var jsx_dev_runtime15 = require("react/jsx-dev-runtime");
|
250
|
-
// src/core/components/Widget/WidgetWrapper/index.tsx
|
251
|
-
var import_core12 = require("@mantine/core");
|
252
|
-
var import_react7 = require("react");
|
253
|
-
var jsx_dev_runtime16 = require("react/jsx-dev-runtime");
|
254
|
-
// src/core/components/Widget/index.tsx
|
255
|
-
var import_core13 = require("@mantine/core");
|
256
|
-
var jsx_dev_runtime17 = require("react/jsx-dev-runtime");
|
257
|
-
var react2 = require("react");
|
258
|
-
// src/core/components/Page/NotFoundPage/index.tsx
|
259
|
-
var import_core14 = require("@mantine/core");
|
260
|
-
var import_navigation3 = require("next/navigation");
|
261
|
-
var jsx_dev_runtime18 = require("react/jsx-dev-runtime");
|
262
|
-
// src/core/components/EnvironmentShell/index.tsx
|
263
|
-
var import_core15 = require("@mantine/core");
|
264
|
-
var jsx_dev_runtime19 = require("react/jsx-dev-runtime");
|
265
|
-
// src/modals/components/JSONModal/index.tsx
|
266
|
-
var jsx_dev_runtime20 = require("react/jsx-dev-runtime");
|
267
42
|
function JSONModal({
|
268
43
|
innerProps
|
269
44
|
}) {
|
270
|
-
const theme = useRemoraidTheme();
|
45
|
+
const theme = import_core2.useRemoraidTheme();
|
271
46
|
const stringValue = typeof innerProps.content === "string" ? innerProps.content : JSON.stringify(innerProps.content, null, theme.jsonStringifySpace);
|
272
|
-
return /* @__PURE__ */
|
273
|
-
children: /* @__PURE__ */
|
47
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
48
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_core.JsonInput, {
|
274
49
|
variant: "filled",
|
275
50
|
value: stringValue,
|
276
51
|
validationError: "Invalid JSON",
|