remoraid 1.1.0 → 2.0.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.
@@ -0,0 +1,721 @@
1
+ "use client";
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ 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
+ var __moduleCache = /* @__PURE__ */ new WeakMap;
20
+ var __toCommonJS = (from) => {
21
+ var entry = __moduleCache.get(from), desc;
22
+ if (entry)
23
+ return entry;
24
+ entry = __defProp({}, "__esModule", { value: true });
25
+ if (from && typeof from === "object" || typeof from === "function")
26
+ __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
27
+ get: () => from[key],
28
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
29
+ }));
30
+ __moduleCache.set(from, entry);
31
+ return entry;
32
+ };
33
+ var __export = (target, all) => {
34
+ for (var name in all)
35
+ __defProp(target, name, {
36
+ get: all[name],
37
+ enumerable: true,
38
+ configurable: true,
39
+ set: (newValue) => all[name] = () => newValue
40
+ });
41
+ };
42
+
43
+ // src/jsonforms/index.ts
44
+ var exports_jsonforms = {};
45
+ __export(exports_jsonforms, {
46
+ useFormOptions: () => useFormOptions,
47
+ renderers: () => renderers,
48
+ remoraidRenderers: () => remoraidRenderers,
49
+ remoraidLayoutRenderers: () => remoraidLayoutRenderers,
50
+ remoraidControlRenderers: () => remoraidControlRenderers,
51
+ defaultFormOptions: () => defaultFormOptions,
52
+ FormOptionsProvider: () => FormOptionsProvider
53
+ });
54
+ module.exports = __toCommonJS(exports_jsonforms);
55
+
56
+ // src/jsonforms/renderers/AnyOfControl.tsx
57
+ var import_react2 = require("@jsonforms/react");
58
+ var import_core = require("@mantine/core");
59
+
60
+ // src/jsonforms/components/FormOptionsProvider/index.tsx
61
+ var import_react = __toESM(require("react"));
62
+ var jsx_dev_runtime = require("react/jsx-dev-runtime");
63
+ var defaultFormOptions = {
64
+ withDescriptions: false
65
+ };
66
+ var formOptionsContext = import_react.default.createContext({
67
+ formOptions: defaultFormOptions,
68
+ updateFormOptions: () => {}
69
+ });
70
+ var useFormOptions = () => import_react.useContext(formOptionsContext);
71
+ function FormOptionsProvider({
72
+ children,
73
+ initialValue
74
+ }) {
75
+ const [formOptions, setFormOptions] = import_react.useState({
76
+ ...defaultFormOptions,
77
+ ...initialValue
78
+ });
79
+ const updateFormOptions = (newFormOptions) => {
80
+ setFormOptions((prev) => ({ ...prev, ...newFormOptions }));
81
+ };
82
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(formOptionsContext.Provider, {
83
+ value: { formOptions, updateFormOptions },
84
+ children
85
+ }, undefined, false, undefined, this);
86
+ }
87
+
88
+ // src/jsonforms/renderers/AnyOfControl.tsx
89
+ var jsx_dev_runtime2 = require("react/jsx-dev-runtime");
90
+ function PlainAnyOfControl(props) {
91
+ const { data, schema, label, required, handleChange, path } = props;
92
+ const {
93
+ formOptions: { withDescriptions }
94
+ } = useFormOptions();
95
+ const { renderers, cells } = import_react2.useJsonForms();
96
+ const defaultValues = {
97
+ number: 0,
98
+ integer: 0,
99
+ string: "",
100
+ array: [],
101
+ object: {},
102
+ null: null,
103
+ boolean: false
104
+ };
105
+ let type = undefined;
106
+ if (typeof data === "number") {
107
+ if (Number.isInteger(data) && schema.anyOf && schema.anyOf.find((a) => a.type && a.type === "integer")) {
108
+ type = "integer";
109
+ } else {
110
+ type = "number";
111
+ }
112
+ } else if (typeof data === "string") {
113
+ type = "string";
114
+ } else if (data === null) {
115
+ type = "null";
116
+ } else if (typeof data === "object" && Array.isArray(data)) {
117
+ type = "array";
118
+ } else if (typeof data === "object") {
119
+ type = "object";
120
+ } else if (typeof data === "boolean") {
121
+ type = "boolean";
122
+ }
123
+ const typeProperties = schema.anyOf ? schema.anyOf.find((a) => a.type === type) || {} : {};
124
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(jsx_dev_runtime2.Fragment, {
125
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(import_core.Input.Wrapper, {
126
+ label,
127
+ description: withDescriptions ? schema.description || null : null,
128
+ withAsterisk: required,
129
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(import_core.Paper, {
130
+ withBorder: true,
131
+ shadow: "0",
132
+ p: "sm",
133
+ mt: withDescriptions && schema.description && schema.description.length > 0 ? 4 : 0,
134
+ children: [
135
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(import_core.Select, {
136
+ label: `Value Type`,
137
+ data: schema.anyOf ? schema.anyOf.map((a) => String(a.type)) : [],
138
+ value: type,
139
+ onChange: (newValue) => {
140
+ handleChange(path, newValue ? defaultValues[newValue] : undefined);
141
+ },
142
+ allowDeselect: true,
143
+ required,
144
+ placeholder: "Select Value Type",
145
+ variant: "default",
146
+ mb: type && type !== "null" ? "sm" : undefined
147
+ }, undefined, false, undefined, this),
148
+ type && type !== "null" && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(import_react2.JsonForms, {
149
+ schema: {
150
+ ...typeProperties,
151
+ $schema: undefined
152
+ },
153
+ data,
154
+ renderers: renderers ?? [],
155
+ cells: cells ?? [],
156
+ onChange: ({ data: newData }) => {
157
+ handleChange(path, newData);
158
+ },
159
+ validationMode: "NoValidation"
160
+ }, undefined, false, undefined, this)
161
+ ]
162
+ }, undefined, true, undefined, this)
163
+ }, undefined, false, undefined, this)
164
+ }, undefined, false, undefined, this);
165
+ }
166
+ var AnyOfControl = import_react2.withJsonFormsControlProps(PlainAnyOfControl);
167
+ var AnyOfControl_default = AnyOfControl;
168
+
169
+ // src/jsonforms/renderers/ArrayControl.tsx
170
+ var import_react4 = require("@jsonforms/react");
171
+ var import_core3 = require("@mantine/core");
172
+ var import_icons_react2 = require("@tabler/icons-react");
173
+ var import_react5 = require("react");
174
+
175
+ // src/core/lib/utils.ts
176
+ var co = (condition, value, fallback) => condition(value) ? value : fallback;
177
+
178
+ // src/core/components/RemoraidProvider/ThemeProvider/index.tsx
179
+ var import_core2 = require("@mantine/core");
180
+ var import_icons_react = require("@tabler/icons-react");
181
+ var import_react3 = __toESM(require("react"));
182
+ var jsx_dev_runtime3 = require("react/jsx-dev-runtime");
183
+ var isMantinePrimaryShade = (primaryShade) => {
184
+ if (isNaN(Number(primaryShade))) {
185
+ return true;
186
+ }
187
+ return false;
188
+ };
189
+ var createRemoraidTheme = (customTheme, mantineTheme, colorScheme) => {
190
+ const defaultMediumIconProps = { size: "1.125em" };
191
+ let transparentBackground;
192
+ let primaryColor;
193
+ let spacingPx;
194
+ if (mantineTheme && colorScheme) {
195
+ transparentBackground = colorScheme === "dark" ? import_core2.rgba(mantineTheme.colors.dark[8], 0.8) : import_core2.rgba(mantineTheme.white, 0.8);
196
+ primaryColor = mantineTheme.colors[mantineTheme.primaryColor][isMantinePrimaryShade(mantineTheme.primaryShade) ? mantineTheme.primaryShade[colorScheme === "auto" ? "light" : colorScheme] : mantineTheme.primaryShade];
197
+ spacingPx = {
198
+ xs: Number(co((v) => !Number.isNaN(v), Number(import_core2.px(mantineTheme.spacing.xs)), 0)),
199
+ sm: Number(co((v) => !Number.isNaN(v), Number(import_core2.px(mantineTheme.spacing.sm)), 0)),
200
+ md: Number(co((v) => !Number.isNaN(v), Number(import_core2.px(mantineTheme.spacing.md)), 0)),
201
+ lg: Number(co((v) => !Number.isNaN(v), Number(import_core2.px(mantineTheme.spacing.lg)), 0)),
202
+ xl: Number(co((v) => !Number.isNaN(v), Number(import_core2.px(mantineTheme.spacing.xl)), 0))
203
+ };
204
+ }
205
+ return {
206
+ complete: true,
207
+ transitionDurations: {
208
+ short: 200,
209
+ medium: 350,
210
+ long: 500
211
+ },
212
+ breakpoints: {
213
+ buttonCollapse: "md",
214
+ badgeGroupCollapse: "md"
215
+ },
216
+ scrollAreaProps: {
217
+ scrollbarSize: 8,
218
+ scrollHideDelay: 20,
219
+ type: "hover"
220
+ },
221
+ containerSize: 1300,
222
+ alertProps: {
223
+ negative: {
224
+ icon: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_icons_react.IconAlertCircle, {
225
+ ...defaultMediumIconProps
226
+ }, undefined, false, undefined, this),
227
+ variant: "light",
228
+ color: "red",
229
+ title: "Attention!"
230
+ },
231
+ neutral: {
232
+ icon: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_icons_react.IconInfoCircle, {
233
+ ...defaultMediumIconProps
234
+ }, undefined, false, undefined, this),
235
+ variant: "light",
236
+ color: mantineTheme?.primaryColor,
237
+ title: "Information"
238
+ },
239
+ positive: {
240
+ icon: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_icons_react.IconCircleCheck, {
241
+ ...defaultMediumIconProps
242
+ }, undefined, false, undefined, this),
243
+ variant: "light",
244
+ color: "green",
245
+ title: "Success"
246
+ }
247
+ },
248
+ iconProps: {
249
+ medium: defaultMediumIconProps,
250
+ tiny: { size: 14, stroke: 3 }
251
+ },
252
+ transparentBackground,
253
+ primaryColor,
254
+ spacingPx,
255
+ ...customTheme
256
+ };
257
+ };
258
+ var themeContext = import_react3.default.createContext(createRemoraidTheme());
259
+ var useRemoraidTheme = () => {
260
+ return import_react3.useContext(themeContext);
261
+ };
262
+
263
+ // src/jsonforms/renderers/ArrayControl.tsx
264
+ var jsx_dev_runtime4 = require("react/jsx-dev-runtime");
265
+ function PlainArrayControl(props) {
266
+ const mantineTheme = import_core3.useMantineTheme();
267
+ const theme = useRemoraidTheme();
268
+ const { label, schema, data, handleChange, path, required } = props;
269
+ const {
270
+ formOptions: { withDescriptions }
271
+ } = useFormOptions();
272
+ const { renderers, cells } = import_react4.useJsonForms();
273
+ const [isHoveringDelete, setIsHoveringDelete] = import_react5.useState(null);
274
+ let schemaItems;
275
+ if (schema.items && !Array.isArray(schema.items)) {
276
+ schemaItems = schema.items;
277
+ } else {
278
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
279
+ children: [
280
+ "No applicable renderer found for '",
281
+ label,
282
+ "'."
283
+ ]
284
+ }, undefined, true, undefined, this);
285
+ }
286
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
287
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core3.Input.Wrapper, {
288
+ label,
289
+ description: withDescriptions ? schema.description : undefined,
290
+ withAsterisk: required,
291
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core3.Paper, {
292
+ withBorder: Array.isArray(data) && data.length > 0,
293
+ shadow: "0",
294
+ p: Array.isArray(data) && data.length > 0 ? "sm" : 0,
295
+ mt: withDescriptions && schema.description && schema.description.length > 0 ? 4 : 0,
296
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core3.Stack, {
297
+ align: "stretch",
298
+ justify: "flex-start",
299
+ gap: "sm",
300
+ children: [
301
+ Array.isArray(data) ? data.map((item, i) => {
302
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core3.Flex, {
303
+ gap: "xs",
304
+ justify: "flex-start",
305
+ align: "center",
306
+ direction: "row",
307
+ wrap: "nowrap",
308
+ children: [
309
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core3.Paper, {
310
+ p: schemaItems.type === "object" ? "sm" : 0,
311
+ withBorder: schemaItems.type === "object",
312
+ style: {
313
+ borderColor: isHoveringDelete === i ? mantineTheme.colors.red[6] : undefined
314
+ },
315
+ flex: 1,
316
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_react4.JsonForms, {
317
+ schema: {
318
+ ...schemaItems,
319
+ $schema: undefined
320
+ },
321
+ data: item,
322
+ renderers: renderers ?? [],
323
+ cells: cells ?? [],
324
+ onChange: ({ data: newData }) => {
325
+ const dataCopy = [...data];
326
+ dataCopy[i] = newData;
327
+ handleChange(path, dataCopy);
328
+ },
329
+ validationMode: "NoValidation"
330
+ }, undefined, false, undefined, this)
331
+ }, undefined, false, undefined, this),
332
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core3.Tooltip, {
333
+ label: "Delete Item",
334
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core3.ActionIcon, {
335
+ variant: "default",
336
+ onClick: () => {
337
+ const dataCopy = [...data];
338
+ dataCopy.splice(i, 1);
339
+ handleChange(path, dataCopy);
340
+ setIsHoveringDelete(null);
341
+ },
342
+ size: "input-sm",
343
+ "aria-label": "Delete Item",
344
+ onMouseEnter: () => {
345
+ setIsHoveringDelete(i);
346
+ },
347
+ onMouseLeave: () => {
348
+ setIsHoveringDelete(null);
349
+ },
350
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_icons_react2.IconTrash, {
351
+ ...theme.iconProps.medium
352
+ }, undefined, false, undefined, this)
353
+ }, undefined, false, undefined, this)
354
+ }, undefined, false, undefined, this)
355
+ ]
356
+ }, i, true, undefined, this);
357
+ }) : /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {}, undefined, false, undefined, this),
358
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core3.Button, {
359
+ variant: "default",
360
+ leftSection: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_icons_react2.IconPlus, {
361
+ ...theme.iconProps.medium
362
+ }, undefined, false, undefined, this),
363
+ onClick: () => {
364
+ let defaultValue = "";
365
+ if (schemaItems.type === "string" && schemaItems.enum) {
366
+ if (schemaItems.enum.length > 0) {
367
+ defaultValue = schemaItems.enum[0];
368
+ }
369
+ } else if (schemaItems.type === "string") {
370
+ defaultValue = "";
371
+ } else if (schemaItems.type === "object") {
372
+ defaultValue = {};
373
+ }
374
+ handleChange(path, [...data || [], defaultValue]);
375
+ },
376
+ children: "Add Item"
377
+ }, undefined, false, undefined, this)
378
+ ]
379
+ }, undefined, true, undefined, this)
380
+ }, undefined, false, undefined, this)
381
+ }, undefined, false, undefined, this)
382
+ }, undefined, false, undefined, this);
383
+ }
384
+ var ArrayControl = import_react4.withJsonFormsControlProps(PlainArrayControl);
385
+ var ArrayControl_default = ArrayControl;
386
+
387
+ // src/jsonforms/renderers/CheckboxControl.tsx
388
+ var import_react6 = require("@jsonforms/react");
389
+ var import_core4 = require("@mantine/core");
390
+ var jsx_dev_runtime5 = require("react/jsx-dev-runtime");
391
+ function PlainCheckboxControl({
392
+ data,
393
+ handleChange,
394
+ path,
395
+ label,
396
+ required,
397
+ schema
398
+ }) {
399
+ const {
400
+ formOptions: { withDescriptions }
401
+ } = useFormOptions();
402
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
403
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_core4.Checkbox, {
404
+ label,
405
+ py: "sm",
406
+ size: "sm",
407
+ labelPosition: "left",
408
+ checked: data,
409
+ onChange: (event) => {
410
+ handleChange(path, event.target.checked);
411
+ },
412
+ required,
413
+ description: withDescriptions ? schema.description || null : null
414
+ }, undefined, false, undefined, this)
415
+ }, undefined, false, undefined, this);
416
+ }
417
+ var CheckboxControl = import_react6.withJsonFormsControlProps(PlainCheckboxControl);
418
+ var CheckboxControl_default = CheckboxControl;
419
+
420
+ // src/jsonforms/renderers/NumberControl.tsx
421
+ var import_react7 = require("@jsonforms/react");
422
+ var import_core5 = require("@mantine/core");
423
+ var jsx_dev_runtime6 = require("react/jsx-dev-runtime");
424
+ function PlainNumberControl({
425
+ data,
426
+ handleChange,
427
+ path,
428
+ label,
429
+ required,
430
+ schema
431
+ }) {
432
+ const {
433
+ formOptions: { withDescriptions }
434
+ } = useFormOptions();
435
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(jsx_dev_runtime6.Fragment, {
436
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(import_core5.NumberInput, {
437
+ label,
438
+ variant: "filled",
439
+ value: data,
440
+ onChange: (newValue) => {
441
+ if (newValue === "") {
442
+ handleChange(path, undefined);
443
+ }
444
+ handleChange(path, Number(newValue));
445
+ },
446
+ required,
447
+ description: withDescriptions ? schema.description || null : null
448
+ }, undefined, false, undefined, this)
449
+ }, undefined, false, undefined, this);
450
+ }
451
+ var NumberControl = import_react7.withJsonFormsControlProps(PlainNumberControl);
452
+ var NumberControl_default = NumberControl;
453
+
454
+ // src/jsonforms/renderers/ObjectControl.tsx
455
+ var import_react8 = require("@jsonforms/react");
456
+ var import_core6 = require("@mantine/core");
457
+ var jsx_dev_runtime7 = require("react/jsx-dev-runtime");
458
+ function PlainObjectControl(props) {
459
+ const { label, schema, data, handleChange, path, required } = props;
460
+ const {
461
+ formOptions: { withDescriptions }
462
+ } = useFormOptions();
463
+ const { renderers, cells } = import_react8.useJsonForms();
464
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
465
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_core6.Input.Wrapper, {
466
+ label,
467
+ description: withDescriptions ? schema.description : undefined,
468
+ withAsterisk: required,
469
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_core6.Paper, {
470
+ withBorder: true,
471
+ shadow: "0",
472
+ p: "sm",
473
+ mt: withDescriptions && schema.description && schema.description.length > 0 ? 4 : 0,
474
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_react8.JsonForms, {
475
+ schema: {
476
+ ...schema,
477
+ $schema: undefined
478
+ },
479
+ data,
480
+ renderers: renderers ?? [],
481
+ cells: cells ?? [],
482
+ onChange: ({ data: newData }) => {
483
+ handleChange(path, newData);
484
+ },
485
+ validationMode: "NoValidation"
486
+ }, undefined, false, undefined, this)
487
+ }, undefined, false, undefined, this)
488
+ }, undefined, false, undefined, this)
489
+ }, undefined, false, undefined, this);
490
+ }
491
+ var ObjectControl = import_react8.withJsonFormsControlProps(PlainObjectControl);
492
+ var ObjectControl_default = ObjectControl;
493
+
494
+ // src/jsonforms/renderers/StringSelectControl.tsx
495
+ var import_react9 = require("@jsonforms/react");
496
+ var import_core7 = require("@mantine/core");
497
+ var jsx_dev_runtime8 = require("react/jsx-dev-runtime");
498
+ function PlainTimestampControl({
499
+ data,
500
+ handleChange,
501
+ path,
502
+ label,
503
+ schema,
504
+ required
505
+ }) {
506
+ const {
507
+ formOptions: { withDescriptions }
508
+ } = useFormOptions();
509
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
510
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(import_core7.Select, {
511
+ label,
512
+ data: schema.enum,
513
+ value: data,
514
+ onChange: (newValue) => {
515
+ handleChange(path, newValue);
516
+ },
517
+ required,
518
+ placeholder: "Select an option",
519
+ variant: "filled",
520
+ description: withDescriptions ? schema.description || null : null
521
+ }, undefined, false, undefined, this)
522
+ }, undefined, false, undefined, this);
523
+ }
524
+ var TimestampControl = import_react9.withJsonFormsControlProps(PlainTimestampControl);
525
+ var StringSelectControl_default = TimestampControl;
526
+
527
+ // src/jsonforms/renderers/testers/anyOfTester.ts
528
+ var import_core8 = require("@jsonforms/core");
529
+ var anyOfTester_default = import_core8.rankWith(10, import_core8.and(import_core8.uiTypeIs("Control"), import_core8.isAnyOfControl));
530
+
531
+ // src/jsonforms/renderers/testers/arrayControlTester.ts
532
+ var import_core9 = require("@jsonforms/core");
533
+ var arrayControlTester_default = import_core9.rankWith(10, import_core9.and(import_core9.uiTypeIs("Control"), import_core9.schemaTypeIs("array")));
534
+
535
+ // src/jsonforms/renderers/testers/checkboxControlTester.ts
536
+ var import_core10 = require("@jsonforms/core");
537
+ var checkboxControlTester_default = import_core10.rankWith(10, import_core10.and(import_core10.uiTypeIs("Control"), import_core10.schemaTypeIs("boolean")));
538
+
539
+ // src/jsonforms/renderers/testers/numberControlTester.ts
540
+ var import_core11 = require("@jsonforms/core");
541
+ var numberControlTester_default = import_core11.rankWith(8, (a, b, c) => {
542
+ if (b.type === "integer") {
543
+ return true;
544
+ }
545
+ return import_core11.and(import_core11.uiTypeIs("Control"), import_core11.or(import_core11.schemaTypeIs("number"), import_core11.schemaTypeIs("integer")))(a, b, c);
546
+ });
547
+
548
+ // src/jsonforms/renderers/testers/objectControlTester.ts
549
+ var import_core12 = require("@jsonforms/core");
550
+ var objectControlTester_default = import_core12.rankWith(10, import_core12.and(import_core12.uiTypeIs("Control"), import_core12.schemaTypeIs("object")));
551
+
552
+ // src/jsonforms/renderers/testers/stringSelectControlTester.ts
553
+ var import_core13 = require("@jsonforms/core");
554
+ var stringSelectControlTester_default = import_core13.rankWith(11, import_core13.and(import_core13.uiTypeIs("Control"), import_core13.schemaTypeIs("string"), import_core13.isEnumControl));
555
+
556
+ // src/jsonforms/renderers/testers/textControlTester.ts
557
+ var import_core14 = require("@jsonforms/core");
558
+ var textControlTester_default = import_core14.rankWith(10, import_core14.and(import_core14.uiTypeIs("Control"), import_core14.schemaTypeIs("string")));
559
+
560
+ // src/jsonforms/renderers/testers/timestampControlTester.ts
561
+ var import_core15 = require("@jsonforms/core");
562
+ var timestampControlTester_default = import_core15.rankWith(11, import_core15.and(import_core15.uiTypeIs("Control"), import_core15.schemaTypeIs("integer"), import_core15.scopeEndsWith("startTime")));
563
+
564
+ // src/jsonforms/renderers/testers/verticalLayoutTester.ts
565
+ var import_core16 = require("@jsonforms/core");
566
+ var verticalLayoutTester_default = import_core16.rankWith(2, import_core16.uiTypeIs("VerticalLayout"));
567
+
568
+ // src/jsonforms/renderers/TextControl.tsx
569
+ var import_react10 = require("@jsonforms/react");
570
+ var import_core17 = require("@mantine/core");
571
+ var jsx_dev_runtime9 = require("react/jsx-dev-runtime");
572
+ function PlainTextControl({
573
+ data,
574
+ handleChange,
575
+ path,
576
+ label,
577
+ required,
578
+ schema
579
+ }) {
580
+ const {
581
+ formOptions: { withDescriptions }
582
+ } = useFormOptions();
583
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
584
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core17.TextInput, {
585
+ label,
586
+ variant: "filled",
587
+ placeholder: "",
588
+ value: data,
589
+ onChange: (event) => {
590
+ handleChange(path, event.currentTarget.value);
591
+ },
592
+ required,
593
+ description: withDescriptions ? schema.description || null : null
594
+ }, undefined, false, undefined, this)
595
+ }, undefined, false, undefined, this);
596
+ }
597
+ var TextControl = import_react10.withJsonFormsControlProps(PlainTextControl);
598
+ var TextControl_default = TextControl;
599
+
600
+ // src/jsonforms/renderers/TimestampControl.tsx
601
+ var import_react11 = require("@jsonforms/react");
602
+ var import_dates = require("@mantine/dates");
603
+ var jsx_dev_runtime10 = require("react/jsx-dev-runtime");
604
+ function PlainTimestampControl2({
605
+ data,
606
+ handleChange,
607
+ path,
608
+ label,
609
+ required,
610
+ schema
611
+ }) {
612
+ const {
613
+ formOptions: { withDescriptions }
614
+ } = useFormOptions();
615
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
616
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_dates.DatePickerInput, {
617
+ label,
618
+ placeholder: "Pick a date",
619
+ value: new Date(data * 1000),
620
+ onChange: (newValue) => {
621
+ if (newValue) {
622
+ handleChange(path, newValue.getTime() / 1000);
623
+ }
624
+ },
625
+ required,
626
+ description: withDescriptions ? schema.description || null : null
627
+ }, undefined, false, undefined, this)
628
+ }, undefined, false, undefined, this);
629
+ }
630
+ var TimestampControl2 = import_react11.withJsonFormsControlProps(PlainTimestampControl2);
631
+ var TimestampControl_default = TimestampControl2;
632
+
633
+ // src/jsonforms/renderers/VerticalLayout.tsx
634
+ var import_react12 = __toESM(require("react"));
635
+ var import_react13 = require("@jsonforms/react");
636
+ var import_react14 = require("@jsonforms/react");
637
+ var import_core18 = require("@mantine/core");
638
+ var jsx_dev_runtime11 = require("react/jsx-dev-runtime");
639
+ "use client";
640
+ var JsonFormsLayout = ({
641
+ className,
642
+ children,
643
+ visible
644
+ }) => {
645
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV("div", {
646
+ className,
647
+ hidden: visible === undefined || visible === null ? false : !visible,
648
+ children
649
+ }, undefined, false, undefined, this);
650
+ };
651
+ var renderChildren = (layout, schema, className, path, enabled) => {
652
+ const { renderers, cells } = import_react14.useJsonForms();
653
+ const theme = import_core18.useMantineTheme();
654
+ return layout.elements.map((child, index) => {
655
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV("div", {
656
+ className,
657
+ style: { marginTop: index === 0 ? 0 : theme.spacing.xs },
658
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(import_react14.JsonFormsDispatch, {
659
+ renderers,
660
+ cells,
661
+ uischema: child,
662
+ schema,
663
+ path,
664
+ enabled
665
+ }, undefined, false, undefined, this)
666
+ }, `${path}-${index}`, false, undefined, this);
667
+ });
668
+ };
669
+ var VerticalLayoutRenderer = (props) => {
670
+ const { data: _data, ...otherProps } = props;
671
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(VerticalLayoutRendererComponent, {
672
+ ...otherProps
673
+ }, undefined, false, undefined, this);
674
+ };
675
+ var VerticalLayoutRendererComponent = import_react12.default.memo(function VerticalLayoutRendererComponent2({
676
+ schema,
677
+ uischema,
678
+ path,
679
+ visible,
680
+ enabled
681
+ }) {
682
+ const verticalLayout = uischema;
683
+ const layoutClassName = "";
684
+ const childClassNames = "";
685
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(JsonFormsLayout, {
686
+ className: layoutClassName,
687
+ uischema,
688
+ schema,
689
+ visible,
690
+ enabled,
691
+ path,
692
+ children: renderChildren(verticalLayout, schema, childClassNames, path, enabled)
693
+ }, undefined, false, undefined, this);
694
+ });
695
+ var VerticalLayout = import_react13.withJsonFormsLayoutProps(VerticalLayoutRenderer, false);
696
+ var VerticalLayout_default = VerticalLayout;
697
+
698
+ // src/jsonforms/renderers/index.ts
699
+ var remoraidControlRenderers = [
700
+ { renderer: ArrayControl_default, tester: arrayControlTester_default },
701
+ { renderer: CheckboxControl_default, tester: checkboxControlTester_default },
702
+ { renderer: NumberControl_default, tester: numberControlTester_default },
703
+ { renderer: StringSelectControl_default, tester: stringSelectControlTester_default },
704
+ { renderer: TextControl_default, tester: textControlTester_default },
705
+ { renderer: TimestampControl_default, tester: timestampControlTester_default },
706
+ { renderer: ObjectControl_default, tester: objectControlTester_default },
707
+ { renderer: AnyOfControl_default, tester: anyOfTester_default }
708
+ ];
709
+ var remoraidLayoutRenderers = [
710
+ { renderer: VerticalLayout_default, tester: verticalLayoutTester_default }
711
+ ];
712
+ var remoraidRenderers = [
713
+ ...remoraidControlRenderers,
714
+ ...remoraidLayoutRenderers
715
+ ];
716
+ // src/jsonforms/lib/utils.ts
717
+ var import_vanilla_renderers = require("@jsonforms/vanilla-renderers");
718
+ var renderers = [
719
+ ...import_vanilla_renderers.vanillaRenderers,
720
+ ...remoraidRenderers
721
+ ];