remoraid 2.0.0 → 2.2.1
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 +191 -108
- package/dist/core/index.d.ts +74 -44
- package/dist/core/index.js +191 -106
- package/dist/jsonforms/index.cjs +66 -155
- package/dist/jsonforms/index.d.ts +1 -1
- package/dist/jsonforms/index.js +48 -149
- package/dist/modals/index.cjs +63 -0
- package/dist/modals/index.d.ts +15 -0
- package/dist/modals/index.js +31 -0
- package/dist/server/index.cjs +31 -31
- package/dist/server/index.d.ts +11 -7
- package/dist/server/index.js +31 -31
- package/package.json +7 -1
package/dist/jsonforms/index.js
CHANGED
@@ -133,115 +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
|
-
transparentBackground,
|
231
|
-
primaryColor,
|
232
|
-
spacingPx,
|
233
|
-
...customTheme
|
234
|
-
};
|
235
|
-
};
|
236
|
-
var themeContext = React2.createContext(createRemoraidTheme());
|
237
|
-
var useRemoraidTheme = () => {
|
238
|
-
return useContext2(themeContext);
|
239
|
-
};
|
240
|
-
|
241
|
-
// src/jsonforms/renderers/ArrayControl.tsx
|
242
|
-
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";
|
243
142
|
function PlainArrayControl(props) {
|
244
|
-
const mantineTheme =
|
143
|
+
const mantineTheme = useMantineTheme();
|
245
144
|
const theme = useRemoraidTheme();
|
246
145
|
const { label, schema, data, handleChange, path, required } = props;
|
247
146
|
const {
|
@@ -253,7 +152,7 @@ function PlainArrayControl(props) {
|
|
253
152
|
if (schema.items && !Array.isArray(schema.items)) {
|
254
153
|
schemaItems = schema.items;
|
255
154
|
} else {
|
256
|
-
return /* @__PURE__ */
|
155
|
+
return /* @__PURE__ */ jsxDEV3(Fragment2, {
|
257
156
|
children: [
|
258
157
|
"No applicable renderer found for '",
|
259
158
|
label,
|
@@ -261,37 +160,37 @@ function PlainArrayControl(props) {
|
|
261
160
|
]
|
262
161
|
}, undefined, true, undefined, this);
|
263
162
|
}
|
264
|
-
return /* @__PURE__ */
|
265
|
-
children: /* @__PURE__ */
|
163
|
+
return /* @__PURE__ */ jsxDEV3(Fragment2, {
|
164
|
+
children: /* @__PURE__ */ jsxDEV3(Input2.Wrapper, {
|
266
165
|
label,
|
267
166
|
description: withDescriptions ? schema.description : undefined,
|
268
167
|
withAsterisk: required,
|
269
|
-
children: /* @__PURE__ */
|
168
|
+
children: /* @__PURE__ */ jsxDEV3(Paper2, {
|
270
169
|
withBorder: Array.isArray(data) && data.length > 0,
|
271
170
|
shadow: "0",
|
272
171
|
p: Array.isArray(data) && data.length > 0 ? "sm" : 0,
|
273
172
|
mt: withDescriptions && schema.description && schema.description.length > 0 ? 4 : 0,
|
274
|
-
children: /* @__PURE__ */
|
173
|
+
children: /* @__PURE__ */ jsxDEV3(Stack, {
|
275
174
|
align: "stretch",
|
276
175
|
justify: "flex-start",
|
277
176
|
gap: "sm",
|
278
177
|
children: [
|
279
178
|
Array.isArray(data) ? data.map((item, i) => {
|
280
|
-
return /* @__PURE__ */
|
179
|
+
return /* @__PURE__ */ jsxDEV3(Flex, {
|
281
180
|
gap: "xs",
|
282
181
|
justify: "flex-start",
|
283
182
|
align: "center",
|
284
183
|
direction: "row",
|
285
184
|
wrap: "nowrap",
|
286
185
|
children: [
|
287
|
-
/* @__PURE__ */
|
186
|
+
/* @__PURE__ */ jsxDEV3(Paper2, {
|
288
187
|
p: schemaItems.type === "object" ? "sm" : 0,
|
289
188
|
withBorder: schemaItems.type === "object",
|
290
189
|
style: {
|
291
190
|
borderColor: isHoveringDelete === i ? mantineTheme.colors.red[6] : undefined
|
292
191
|
},
|
293
192
|
flex: 1,
|
294
|
-
children: /* @__PURE__ */
|
193
|
+
children: /* @__PURE__ */ jsxDEV3(JsonForms2, {
|
295
194
|
schema: {
|
296
195
|
...schemaItems,
|
297
196
|
$schema: undefined
|
@@ -307,9 +206,9 @@ function PlainArrayControl(props) {
|
|
307
206
|
validationMode: "NoValidation"
|
308
207
|
}, undefined, false, undefined, this)
|
309
208
|
}, undefined, false, undefined, this),
|
310
|
-
/* @__PURE__ */
|
209
|
+
/* @__PURE__ */ jsxDEV3(Tooltip, {
|
311
210
|
label: "Delete Item",
|
312
|
-
children: /* @__PURE__ */
|
211
|
+
children: /* @__PURE__ */ jsxDEV3(ActionIcon, {
|
313
212
|
variant: "default",
|
314
213
|
onClick: () => {
|
315
214
|
const dataCopy = [...data];
|
@@ -325,17 +224,17 @@ function PlainArrayControl(props) {
|
|
325
224
|
onMouseLeave: () => {
|
326
225
|
setIsHoveringDelete(null);
|
327
226
|
},
|
328
|
-
children: /* @__PURE__ */
|
227
|
+
children: /* @__PURE__ */ jsxDEV3(IconTrash, {
|
329
228
|
...theme.iconProps.medium
|
330
229
|
}, undefined, false, undefined, this)
|
331
230
|
}, undefined, false, undefined, this)
|
332
231
|
}, undefined, false, undefined, this)
|
333
232
|
]
|
334
233
|
}, i, true, undefined, this);
|
335
|
-
}) : /* @__PURE__ */
|
336
|
-
/* @__PURE__ */
|
234
|
+
}) : /* @__PURE__ */ jsxDEV3(Fragment2, {}, undefined, false, undefined, this),
|
235
|
+
/* @__PURE__ */ jsxDEV3(Button, {
|
337
236
|
variant: "default",
|
338
|
-
leftSection: /* @__PURE__ */
|
237
|
+
leftSection: /* @__PURE__ */ jsxDEV3(IconPlus, {
|
339
238
|
...theme.iconProps.medium
|
340
239
|
}, undefined, false, undefined, this),
|
341
240
|
onClick: () => {
|
@@ -365,7 +264,7 @@ var ArrayControl_default = ArrayControl;
|
|
365
264
|
// src/jsonforms/renderers/CheckboxControl.tsx
|
366
265
|
import { withJsonFormsControlProps as withJsonFormsControlProps3 } from "@jsonforms/react";
|
367
266
|
import { Checkbox } from "@mantine/core";
|
368
|
-
import { jsxDEV as
|
267
|
+
import { jsxDEV as jsxDEV4, Fragment as Fragment3 } from "react/jsx-dev-runtime";
|
369
268
|
function PlainCheckboxControl({
|
370
269
|
data,
|
371
270
|
handleChange,
|
@@ -377,8 +276,8 @@ function PlainCheckboxControl({
|
|
377
276
|
const {
|
378
277
|
formOptions: { withDescriptions }
|
379
278
|
} = useFormOptions();
|
380
|
-
return /* @__PURE__ */
|
381
|
-
children: /* @__PURE__ */
|
279
|
+
return /* @__PURE__ */ jsxDEV4(Fragment3, {
|
280
|
+
children: /* @__PURE__ */ jsxDEV4(Checkbox, {
|
382
281
|
label,
|
383
282
|
py: "sm",
|
384
283
|
size: "sm",
|
@@ -398,7 +297,7 @@ var CheckboxControl_default = CheckboxControl;
|
|
398
297
|
// src/jsonforms/renderers/NumberControl.tsx
|
399
298
|
import { withJsonFormsControlProps as withJsonFormsControlProps4 } from "@jsonforms/react";
|
400
299
|
import { NumberInput } from "@mantine/core";
|
401
|
-
import { jsxDEV as
|
300
|
+
import { jsxDEV as jsxDEV5, Fragment as Fragment4 } from "react/jsx-dev-runtime";
|
402
301
|
function PlainNumberControl({
|
403
302
|
data,
|
404
303
|
handleChange,
|
@@ -410,8 +309,8 @@ function PlainNumberControl({
|
|
410
309
|
const {
|
411
310
|
formOptions: { withDescriptions }
|
412
311
|
} = useFormOptions();
|
413
|
-
return /* @__PURE__ */
|
414
|
-
children: /* @__PURE__ */
|
312
|
+
return /* @__PURE__ */ jsxDEV5(Fragment4, {
|
313
|
+
children: /* @__PURE__ */ jsxDEV5(NumberInput, {
|
415
314
|
label,
|
416
315
|
variant: "filled",
|
417
316
|
value: data,
|
@@ -436,24 +335,24 @@ import {
|
|
436
335
|
withJsonFormsControlProps as withJsonFormsControlProps5
|
437
336
|
} from "@jsonforms/react";
|
438
337
|
import { Input as Input3, Paper as Paper3 } from "@mantine/core";
|
439
|
-
import { jsxDEV as
|
338
|
+
import { jsxDEV as jsxDEV6, Fragment as Fragment5 } from "react/jsx-dev-runtime";
|
440
339
|
function PlainObjectControl(props) {
|
441
340
|
const { label, schema, data, handleChange, path, required } = props;
|
442
341
|
const {
|
443
342
|
formOptions: { withDescriptions }
|
444
343
|
} = useFormOptions();
|
445
344
|
const { renderers, cells } = useJsonForms3();
|
446
|
-
return /* @__PURE__ */
|
447
|
-
children: /* @__PURE__ */
|
345
|
+
return /* @__PURE__ */ jsxDEV6(Fragment5, {
|
346
|
+
children: /* @__PURE__ */ jsxDEV6(Input3.Wrapper, {
|
448
347
|
label,
|
449
348
|
description: withDescriptions ? schema.description : undefined,
|
450
349
|
withAsterisk: required,
|
451
|
-
children: /* @__PURE__ */
|
350
|
+
children: /* @__PURE__ */ jsxDEV6(Paper3, {
|
452
351
|
withBorder: true,
|
453
352
|
shadow: "0",
|
454
353
|
p: "sm",
|
455
354
|
mt: withDescriptions && schema.description && schema.description.length > 0 ? 4 : 0,
|
456
|
-
children: /* @__PURE__ */
|
355
|
+
children: /* @__PURE__ */ jsxDEV6(JsonForms3, {
|
457
356
|
schema: {
|
458
357
|
...schema,
|
459
358
|
$schema: undefined
|
@@ -476,7 +375,7 @@ var ObjectControl_default = ObjectControl;
|
|
476
375
|
// src/jsonforms/renderers/StringSelectControl.tsx
|
477
376
|
import { withJsonFormsControlProps as withJsonFormsControlProps6 } from "@jsonforms/react";
|
478
377
|
import { Select as Select2 } from "@mantine/core";
|
479
|
-
import { jsxDEV as
|
378
|
+
import { jsxDEV as jsxDEV7, Fragment as Fragment6 } from "react/jsx-dev-runtime";
|
480
379
|
function PlainTimestampControl({
|
481
380
|
data,
|
482
381
|
handleChange,
|
@@ -488,8 +387,8 @@ function PlainTimestampControl({
|
|
488
387
|
const {
|
489
388
|
formOptions: { withDescriptions }
|
490
389
|
} = useFormOptions();
|
491
|
-
return /* @__PURE__ */
|
492
|
-
children: /* @__PURE__ */
|
390
|
+
return /* @__PURE__ */ jsxDEV7(Fragment6, {
|
391
|
+
children: /* @__PURE__ */ jsxDEV7(Select2, {
|
493
392
|
label,
|
494
393
|
data: schema.enum,
|
495
394
|
value: data,
|
@@ -562,7 +461,7 @@ var verticalLayoutTester_default = rankWith9(2, uiTypeIs9("VerticalLayout"));
|
|
562
461
|
// src/jsonforms/renderers/TextControl.tsx
|
563
462
|
import { withJsonFormsControlProps as withJsonFormsControlProps7 } from "@jsonforms/react";
|
564
463
|
import { TextInput } from "@mantine/core";
|
565
|
-
import { jsxDEV as
|
464
|
+
import { jsxDEV as jsxDEV8, Fragment as Fragment7 } from "react/jsx-dev-runtime";
|
566
465
|
function PlainTextControl({
|
567
466
|
data,
|
568
467
|
handleChange,
|
@@ -574,8 +473,8 @@ function PlainTextControl({
|
|
574
473
|
const {
|
575
474
|
formOptions: { withDescriptions }
|
576
475
|
} = useFormOptions();
|
577
|
-
return /* @__PURE__ */
|
578
|
-
children: /* @__PURE__ */
|
476
|
+
return /* @__PURE__ */ jsxDEV8(Fragment7, {
|
477
|
+
children: /* @__PURE__ */ jsxDEV8(TextInput, {
|
579
478
|
label,
|
580
479
|
variant: "filled",
|
581
480
|
placeholder: "",
|
@@ -594,7 +493,7 @@ var TextControl_default = TextControl;
|
|
594
493
|
// src/jsonforms/renderers/TimestampControl.tsx
|
595
494
|
import { withJsonFormsControlProps as withJsonFormsControlProps8 } from "@jsonforms/react";
|
596
495
|
import { DatePickerInput } from "@mantine/dates";
|
597
|
-
import { jsxDEV as
|
496
|
+
import { jsxDEV as jsxDEV9, Fragment as Fragment8 } from "react/jsx-dev-runtime";
|
598
497
|
function PlainTimestampControl2({
|
599
498
|
data,
|
600
499
|
handleChange,
|
@@ -606,8 +505,8 @@ function PlainTimestampControl2({
|
|
606
505
|
const {
|
607
506
|
formOptions: { withDescriptions }
|
608
507
|
} = useFormOptions();
|
609
|
-
return /* @__PURE__ */
|
610
|
-
children: /* @__PURE__ */
|
508
|
+
return /* @__PURE__ */ jsxDEV9(Fragment8, {
|
509
|
+
children: /* @__PURE__ */ jsxDEV9(DatePickerInput, {
|
611
510
|
label,
|
612
511
|
placeholder: "Pick a date",
|
613
512
|
value: new Date(data * 1000),
|
@@ -625,18 +524,18 @@ var TimestampControl2 = withJsonFormsControlProps8(PlainTimestampControl2);
|
|
625
524
|
var TimestampControl_default = TimestampControl2;
|
626
525
|
|
627
526
|
// src/jsonforms/renderers/VerticalLayout.tsx
|
628
|
-
import
|
527
|
+
import React2 from "react";
|
629
528
|
import { withJsonFormsLayoutProps } from "@jsonforms/react";
|
630
529
|
import { JsonFormsDispatch, useJsonForms as useJsonForms4 } from "@jsonforms/react";
|
631
|
-
import { useMantineTheme as
|
632
|
-
import { jsxDEV as
|
530
|
+
import { useMantineTheme as useMantineTheme2 } from "@mantine/core";
|
531
|
+
import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
|
633
532
|
"use client";
|
634
533
|
var JsonFormsLayout = ({
|
635
534
|
className,
|
636
535
|
children,
|
637
536
|
visible
|
638
537
|
}) => {
|
639
|
-
return /* @__PURE__ */
|
538
|
+
return /* @__PURE__ */ jsxDEV10("div", {
|
640
539
|
className,
|
641
540
|
hidden: visible === undefined || visible === null ? false : !visible,
|
642
541
|
children
|
@@ -644,12 +543,12 @@ var JsonFormsLayout = ({
|
|
644
543
|
};
|
645
544
|
var renderChildren = (layout, schema, className, path, enabled) => {
|
646
545
|
const { renderers, cells } = useJsonForms4();
|
647
|
-
const theme =
|
546
|
+
const theme = useMantineTheme2();
|
648
547
|
return layout.elements.map((child, index) => {
|
649
|
-
return /* @__PURE__ */
|
548
|
+
return /* @__PURE__ */ jsxDEV10("div", {
|
650
549
|
className,
|
651
550
|
style: { marginTop: index === 0 ? 0 : theme.spacing.xs },
|
652
|
-
children: /* @__PURE__ */
|
551
|
+
children: /* @__PURE__ */ jsxDEV10(JsonFormsDispatch, {
|
653
552
|
renderers,
|
654
553
|
cells,
|
655
554
|
uischema: child,
|
@@ -662,11 +561,11 @@ var renderChildren = (layout, schema, className, path, enabled) => {
|
|
662
561
|
};
|
663
562
|
var VerticalLayoutRenderer = (props) => {
|
664
563
|
const { data: _data, ...otherProps } = props;
|
665
|
-
return /* @__PURE__ */
|
564
|
+
return /* @__PURE__ */ jsxDEV10(VerticalLayoutRendererComponent, {
|
666
565
|
...otherProps
|
667
566
|
}, undefined, false, undefined, this);
|
668
567
|
};
|
669
|
-
var VerticalLayoutRendererComponent =
|
568
|
+
var VerticalLayoutRendererComponent = React2.memo(function VerticalLayoutRendererComponent2({
|
670
569
|
schema,
|
671
570
|
uischema,
|
672
571
|
path,
|
@@ -676,7 +575,7 @@ var VerticalLayoutRendererComponent = React3.memo(function VerticalLayoutRendere
|
|
676
575
|
const verticalLayout = uischema;
|
677
576
|
const layoutClassName = "";
|
678
577
|
const childClassNames = "";
|
679
|
-
return /* @__PURE__ */
|
578
|
+
return /* @__PURE__ */ jsxDEV10(JsonFormsLayout, {
|
680
579
|
className: layoutClassName,
|
681
580
|
uischema,
|
682
581
|
schema,
|
@@ -0,0 +1,63 @@
|
|
1
|
+
"use client";
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
7
|
+
var __toCommonJS = (from) => {
|
8
|
+
var entry = __moduleCache.get(from), desc;
|
9
|
+
if (entry)
|
10
|
+
return entry;
|
11
|
+
entry = __defProp({}, "__esModule", { value: true });
|
12
|
+
if (from && typeof from === "object" || typeof from === "function")
|
13
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
14
|
+
get: () => from[key],
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
16
|
+
}));
|
17
|
+
__moduleCache.set(from, entry);
|
18
|
+
return entry;
|
19
|
+
};
|
20
|
+
var __export = (target, all) => {
|
21
|
+
for (var name in all)
|
22
|
+
__defProp(target, name, {
|
23
|
+
get: all[name],
|
24
|
+
enumerable: true,
|
25
|
+
configurable: true,
|
26
|
+
set: (newValue) => all[name] = () => newValue
|
27
|
+
});
|
28
|
+
};
|
29
|
+
|
30
|
+
// src/modals/index.ts
|
31
|
+
var exports_modals = {};
|
32
|
+
__export(exports_modals, {
|
33
|
+
remoraidModals: () => remoraidModals,
|
34
|
+
JSONModal: () => JSONModal
|
35
|
+
});
|
36
|
+
module.exports = __toCommonJS(exports_modals);
|
37
|
+
|
38
|
+
// src/modals/components/JSONModal/index.tsx
|
39
|
+
var import_core = require("@mantine/core");
|
40
|
+
var import_core2 = require("remoraid/core");
|
41
|
+
var jsx_dev_runtime = require("react/jsx-dev-runtime");
|
42
|
+
function JSONModal({
|
43
|
+
innerProps
|
44
|
+
}) {
|
45
|
+
const theme = import_core2.useRemoraidTheme();
|
46
|
+
const stringValue = typeof innerProps.content === "string" ? innerProps.content : JSON.stringify(innerProps.content, null, theme.jsonStringifySpace);
|
47
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
48
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_core.JsonInput, {
|
49
|
+
variant: "filled",
|
50
|
+
value: stringValue,
|
51
|
+
validationError: "Invalid JSON",
|
52
|
+
formatOnBlur: true,
|
53
|
+
autosize: true,
|
54
|
+
minRows: 4,
|
55
|
+
maxRows: 24,
|
56
|
+
...innerProps.componentsProps?.jsonInput
|
57
|
+
}, undefined, false, undefined, this)
|
58
|
+
}, undefined, false, undefined, this);
|
59
|
+
}
|
60
|
+
// src/modals/lib/utils.ts
|
61
|
+
var remoraidModals = {
|
62
|
+
json: JSONModal
|
63
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { ReactNode } from "react";
|
2
|
+
import { ContextModalProps } from "@mantine/modals";
|
3
|
+
import { JsonInputProps } from "@mantine/core";
|
4
|
+
interface JSONModalProps {
|
5
|
+
content: any;
|
6
|
+
componentsProps?: {
|
7
|
+
jsonInput?: JsonInputProps
|
8
|
+
};
|
9
|
+
}
|
10
|
+
declare function JSONModal({ innerProps }: ContextModalProps<JSONModalProps>): ReactNode;
|
11
|
+
import { ContextModalProps as ContextModalProps2 } from "@mantine/modals";
|
12
|
+
import { FC } from "react";
|
13
|
+
type RemoraidModalProps = JSONModalProps;
|
14
|
+
declare const remoraidModals: Record<string, FC<ContextModalProps2<RemoraidModalProps>>>;
|
15
|
+
export { remoraidModals, RemoraidModalProps, JSONModalProps, JSONModal };
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use client";
|
2
|
+
// src/modals/components/JSONModal/index.tsx
|
3
|
+
import { JsonInput } from "@mantine/core";
|
4
|
+
import { useRemoraidTheme } from "remoraid/core";
|
5
|
+
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
|
6
|
+
function JSONModal({
|
7
|
+
innerProps
|
8
|
+
}) {
|
9
|
+
const theme = useRemoraidTheme();
|
10
|
+
const stringValue = typeof innerProps.content === "string" ? innerProps.content : JSON.stringify(innerProps.content, null, theme.jsonStringifySpace);
|
11
|
+
return /* @__PURE__ */ jsxDEV(Fragment, {
|
12
|
+
children: /* @__PURE__ */ jsxDEV(JsonInput, {
|
13
|
+
variant: "filled",
|
14
|
+
value: stringValue,
|
15
|
+
validationError: "Invalid JSON",
|
16
|
+
formatOnBlur: true,
|
17
|
+
autosize: true,
|
18
|
+
minRows: 4,
|
19
|
+
maxRows: 24,
|
20
|
+
...innerProps.componentsProps?.jsonInput
|
21
|
+
}, undefined, false, undefined, this)
|
22
|
+
}, undefined, false, undefined, this);
|
23
|
+
}
|
24
|
+
// src/modals/lib/utils.ts
|
25
|
+
var remoraidModals = {
|
26
|
+
json: JSONModal
|
27
|
+
};
|
28
|
+
export {
|
29
|
+
remoraidModals,
|
30
|
+
JSONModal
|
31
|
+
};
|
package/dist/server/index.cjs
CHANGED
@@ -37,38 +37,38 @@ module.exports = __toCommonJS(exports_server);
|
|
37
37
|
var jsx_dev_runtime = require("react/jsx-dev-runtime");
|
38
38
|
function EnvironmentShell({
|
39
39
|
children,
|
40
|
-
|
40
|
+
environment,
|
41
41
|
message
|
42
42
|
}) {
|
43
|
-
const
|
44
|
-
if (
|
45
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(
|
46
|
-
|
47
|
-
|
48
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("h1", {
|
49
|
-
style: { fontWeight: 700 },
|
50
|
-
children: [
|
51
|
-
"Environment variable",
|
52
|
-
missingVars.length > 1 ? "s" : "",
|
53
|
-
" missing:"
|
54
|
-
]
|
55
|
-
}, undefined, true, undefined, this),
|
56
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("ul", {
|
57
|
-
style: { margin: 5 },
|
58
|
-
children: missingVars.map((v, i) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV("li", {
|
59
|
-
children: v
|
60
|
-
}, i, false, undefined, this))
|
61
|
-
}, undefined, false, undefined, this),
|
62
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("p", {
|
63
|
-
children: "Please specify in your '.env' file."
|
64
|
-
}, undefined, false, undefined, this),
|
65
|
-
message !== undefined && /* @__PURE__ */ jsx_dev_runtime.jsxDEV("p", {
|
66
|
-
children: "message"
|
67
|
-
}, undefined, false, undefined, this)
|
68
|
-
]
|
69
|
-
}, undefined, true, undefined, this);
|
43
|
+
const undefinedKeys = Object.keys(environment).filter((key) => environment[key] === undefined);
|
44
|
+
if (undefinedKeys.length === 0) {
|
45
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
|
46
|
+
children
|
47
|
+
}, undefined, false, undefined, this);
|
70
48
|
}
|
71
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(
|
72
|
-
|
73
|
-
|
49
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
50
|
+
style: { padding: 5 },
|
51
|
+
children: [
|
52
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("h1", {
|
53
|
+
style: { fontWeight: 700 },
|
54
|
+
children: [
|
55
|
+
"Environment variable",
|
56
|
+
undefinedKeys.length > 1 ? "s" : "",
|
57
|
+
" missing:"
|
58
|
+
]
|
59
|
+
}, undefined, true, undefined, this),
|
60
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("ul", {
|
61
|
+
style: { margin: 5 },
|
62
|
+
children: undefinedKeys.map((v, i) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV("li", {
|
63
|
+
children: v
|
64
|
+
}, i, false, undefined, this))
|
65
|
+
}, undefined, false, undefined, this),
|
66
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("p", {
|
67
|
+
children: "Please specify in your '.env' file."
|
68
|
+
}, undefined, false, undefined, this),
|
69
|
+
message !== undefined && /* @__PURE__ */ jsx_dev_runtime.jsxDEV("p", {
|
70
|
+
children: "message"
|
71
|
+
}, undefined, false, undefined, this)
|
72
|
+
]
|
73
|
+
}, undefined, true, undefined, this);
|
74
74
|
}
|
package/dist/server/index.d.ts
CHANGED
@@ -1,11 +1,15 @@
|
|
1
|
-
import { MantineSize } from "@mantine/core";
|
1
|
+
import { ContainerProps as ContainerProps3, MantineSize as MantineSize9 } from "@mantine/core";
|
2
2
|
interface EnvironmentShellProps {
|
3
|
-
|
3
|
+
environment: Record<string, string | undefined>;
|
4
4
|
message?: string;
|
5
|
-
m?:
|
6
|
-
mt?:
|
5
|
+
m?: MantineSize9 | number;
|
6
|
+
mt?: MantineSize9 | number;
|
7
|
+
withContainer?: boolean;
|
8
|
+
componentsProps?: {
|
9
|
+
container?: ContainerProps3
|
10
|
+
};
|
7
11
|
}
|
8
|
-
import { PropsWithChildren as
|
12
|
+
import { PropsWithChildren as PropsWithChildren13, ReactNode as ReactNode20 } from "react";
|
9
13
|
interface ServerEnvironmentShellProps extends EnvironmentShellProps {}
|
10
|
-
declare function
|
11
|
-
export { EnvironmentShell };
|
14
|
+
declare function EnvironmentShell2({ children, environment, message }: PropsWithChildren13<ServerEnvironmentShellProps>): ReactNode20;
|
15
|
+
export { ServerEnvironmentShellProps, EnvironmentShell2 as EnvironmentShell };
|
package/dist/server/index.js
CHANGED
@@ -2,40 +2,40 @@
|
|
2
2
|
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
|
3
3
|
function EnvironmentShell({
|
4
4
|
children,
|
5
|
-
|
5
|
+
environment,
|
6
6
|
message
|
7
7
|
}) {
|
8
|
-
const
|
9
|
-
if (
|
10
|
-
return /* @__PURE__ */ jsxDEV(
|
11
|
-
|
12
|
-
|
13
|
-
/* @__PURE__ */ jsxDEV("h1", {
|
14
|
-
style: { fontWeight: 700 },
|
15
|
-
children: [
|
16
|
-
"Environment variable",
|
17
|
-
missingVars.length > 1 ? "s" : "",
|
18
|
-
" missing:"
|
19
|
-
]
|
20
|
-
}, undefined, true, undefined, this),
|
21
|
-
/* @__PURE__ */ jsxDEV("ul", {
|
22
|
-
style: { margin: 5 },
|
23
|
-
children: missingVars.map((v, i) => /* @__PURE__ */ jsxDEV("li", {
|
24
|
-
children: v
|
25
|
-
}, i, false, undefined, this))
|
26
|
-
}, undefined, false, undefined, this),
|
27
|
-
/* @__PURE__ */ jsxDEV("p", {
|
28
|
-
children: "Please specify in your '.env' file."
|
29
|
-
}, undefined, false, undefined, this),
|
30
|
-
message !== undefined && /* @__PURE__ */ jsxDEV("p", {
|
31
|
-
children: "message"
|
32
|
-
}, undefined, false, undefined, this)
|
33
|
-
]
|
34
|
-
}, undefined, true, undefined, this);
|
8
|
+
const undefinedKeys = Object.keys(environment).filter((key) => environment[key] === undefined);
|
9
|
+
if (undefinedKeys.length === 0) {
|
10
|
+
return /* @__PURE__ */ jsxDEV(Fragment, {
|
11
|
+
children
|
12
|
+
}, undefined, false, undefined, this);
|
35
13
|
}
|
36
|
-
return /* @__PURE__ */ jsxDEV(
|
37
|
-
|
38
|
-
|
14
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
15
|
+
style: { padding: 5 },
|
16
|
+
children: [
|
17
|
+
/* @__PURE__ */ jsxDEV("h1", {
|
18
|
+
style: { fontWeight: 700 },
|
19
|
+
children: [
|
20
|
+
"Environment variable",
|
21
|
+
undefinedKeys.length > 1 ? "s" : "",
|
22
|
+
" missing:"
|
23
|
+
]
|
24
|
+
}, undefined, true, undefined, this),
|
25
|
+
/* @__PURE__ */ jsxDEV("ul", {
|
26
|
+
style: { margin: 5 },
|
27
|
+
children: undefinedKeys.map((v, i) => /* @__PURE__ */ jsxDEV("li", {
|
28
|
+
children: v
|
29
|
+
}, i, false, undefined, this))
|
30
|
+
}, undefined, false, undefined, this),
|
31
|
+
/* @__PURE__ */ jsxDEV("p", {
|
32
|
+
children: "Please specify in your '.env' file."
|
33
|
+
}, undefined, false, undefined, this),
|
34
|
+
message !== undefined && /* @__PURE__ */ jsxDEV("p", {
|
35
|
+
children: "message"
|
36
|
+
}, undefined, false, undefined, this)
|
37
|
+
]
|
38
|
+
}, undefined, true, undefined, this);
|
39
39
|
}
|
40
40
|
export {
|
41
41
|
EnvironmentShell
|