remoraid 1.1.44 → 2.1.7
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 +100 -74
- package/dist/core/index.d.ts +22 -8
- package/dist/core/index.js +100 -74
- package/dist/jsonforms/index.cjs +1 -0
- package/dist/jsonforms/index.d.ts +1 -1
- package/dist/jsonforms/index.js +1 -0
- package/dist/modals/index.cjs +288 -0
- package/dist/modals/index.d.ts +15 -0
- package/dist/modals/index.js +319 -0
- package/dist/server/index.cjs +31 -31
- package/dist/server/index.d.ts +8 -4
- package/dist/server/index.js +31 -31
- package/package.json +11 -3
@@ -0,0 +1,288 @@
|
|
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/modals/index.ts
|
44
|
+
var exports_modals = {};
|
45
|
+
__export(exports_modals, {
|
46
|
+
remoraidModals: () => remoraidModals,
|
47
|
+
JSONModal: () => JSONModal
|
48
|
+
});
|
49
|
+
module.exports = __toCommonJS(exports_modals);
|
50
|
+
|
51
|
+
// 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
|
+
var import_core = require("@mantine/core");
|
70
|
+
var import_icons_react = require("@tabler/icons-react");
|
71
|
+
var import_react = __toESM(require("react"));
|
72
|
+
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
|
+
function JSONModal({
|
268
|
+
innerProps
|
269
|
+
}) {
|
270
|
+
const theme = useRemoraidTheme();
|
271
|
+
const stringValue = typeof innerProps.content === "string" ? innerProps.content : JSON.stringify(innerProps.content, null, theme.jsonStringifySpace);
|
272
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
|
273
|
+
children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(import_core16.JsonInput, {
|
274
|
+
variant: "filled",
|
275
|
+
value: stringValue,
|
276
|
+
validationError: "Invalid JSON",
|
277
|
+
formatOnBlur: true,
|
278
|
+
autosize: true,
|
279
|
+
minRows: 4,
|
280
|
+
maxRows: 24,
|
281
|
+
...innerProps.componentsProps?.jsonInput
|
282
|
+
}, undefined, false, undefined, this)
|
283
|
+
}, undefined, false, undefined, this);
|
284
|
+
}
|
285
|
+
// src/modals/lib/utils.ts
|
286
|
+
var remoraidModals = {
|
287
|
+
json: JSONModal
|
288
|
+
};
|
@@ -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,319 @@
|
|
1
|
+
"use client";
|
2
|
+
// src/modals/components/JSONModal/index.tsx
|
3
|
+
import { JsonInput } from "@mantine/core";
|
4
|
+
|
5
|
+
// src/core/components/RemoraidProvider/UserExperienceProvider/index.tsx
|
6
|
+
import React3, {
|
7
|
+
useContext as useContext2,
|
8
|
+
useEffect,
|
9
|
+
useState as useState2
|
10
|
+
} from "react";
|
11
|
+
import { useCookies } from "react-cookie";
|
12
|
+
|
13
|
+
// src/core/components/AppShell/NavbarMinimal/index.tsx
|
14
|
+
import {
|
15
|
+
Tooltip,
|
16
|
+
UnstyledButton,
|
17
|
+
Stack,
|
18
|
+
rem,
|
19
|
+
useMantineColorScheme as useMantineColorScheme2,
|
20
|
+
Flex,
|
21
|
+
Paper,
|
22
|
+
Divider,
|
23
|
+
Indicator
|
24
|
+
} from "@mantine/core";
|
25
|
+
import {
|
26
|
+
IconLogin,
|
27
|
+
IconLogout,
|
28
|
+
IconMoon,
|
29
|
+
IconSun
|
30
|
+
} from "@tabler/icons-react";
|
31
|
+
import Link from "next/link";
|
32
|
+
import { usePathname } from "next/navigation";
|
33
|
+
import { useState } from "react";
|
34
|
+
|
35
|
+
// src/core/lib/utils.ts
|
36
|
+
var co = (condition, value, fallback) => condition(value) ? value : fallback;
|
37
|
+
|
38
|
+
// src/core/components/RemoraidProvider/ThemeProvider/index.tsx
|
39
|
+
import {
|
40
|
+
px,
|
41
|
+
rgba,
|
42
|
+
useMantineColorScheme,
|
43
|
+
useMantineTheme
|
44
|
+
} from "@mantine/core";
|
45
|
+
import {
|
46
|
+
IconAlertCircle,
|
47
|
+
IconCircleCheck,
|
48
|
+
IconInfoCircle
|
49
|
+
} from "@tabler/icons-react";
|
50
|
+
import React2, {
|
51
|
+
useContext,
|
52
|
+
useMemo
|
53
|
+
} from "react";
|
54
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
55
|
+
var isMantinePrimaryShade = (primaryShade) => {
|
56
|
+
if (isNaN(Number(primaryShade))) {
|
57
|
+
return true;
|
58
|
+
}
|
59
|
+
return false;
|
60
|
+
};
|
61
|
+
var createRemoraidTheme = (customTheme, mantineTheme, colorScheme) => {
|
62
|
+
const defaultMediumIconProps = { size: "1.125em" };
|
63
|
+
let transparentBackground;
|
64
|
+
let primaryColor;
|
65
|
+
let spacingPx;
|
66
|
+
if (mantineTheme && colorScheme) {
|
67
|
+
transparentBackground = colorScheme === "dark" ? rgba(mantineTheme.colors.dark[8], 0.8) : rgba(mantineTheme.white, 0.8);
|
68
|
+
primaryColor = mantineTheme.colors[mantineTheme.primaryColor][isMantinePrimaryShade(mantineTheme.primaryShade) ? mantineTheme.primaryShade[colorScheme === "auto" ? "light" : colorScheme] : mantineTheme.primaryShade];
|
69
|
+
spacingPx = {
|
70
|
+
xs: Number(co((v) => !Number.isNaN(v), Number(px(mantineTheme.spacing.xs)), 0)),
|
71
|
+
sm: Number(co((v) => !Number.isNaN(v), Number(px(mantineTheme.spacing.sm)), 0)),
|
72
|
+
md: Number(co((v) => !Number.isNaN(v), Number(px(mantineTheme.spacing.md)), 0)),
|
73
|
+
lg: Number(co((v) => !Number.isNaN(v), Number(px(mantineTheme.spacing.lg)), 0)),
|
74
|
+
xl: Number(co((v) => !Number.isNaN(v), Number(px(mantineTheme.spacing.xl)), 0))
|
75
|
+
};
|
76
|
+
}
|
77
|
+
return {
|
78
|
+
complete: true,
|
79
|
+
transitionDurations: {
|
80
|
+
short: 200,
|
81
|
+
medium: 350,
|
82
|
+
long: 500
|
83
|
+
},
|
84
|
+
breakpoints: {
|
85
|
+
buttonCollapse: "md",
|
86
|
+
badgeGroupCollapse: "md"
|
87
|
+
},
|
88
|
+
scrollAreaProps: {
|
89
|
+
scrollbarSize: 8,
|
90
|
+
scrollHideDelay: 20,
|
91
|
+
type: "hover"
|
92
|
+
},
|
93
|
+
containerSize: 1300,
|
94
|
+
alertProps: {
|
95
|
+
negative: {
|
96
|
+
icon: /* @__PURE__ */ jsxDEV(IconAlertCircle, {
|
97
|
+
...defaultMediumIconProps
|
98
|
+
}, undefined, false, undefined, this),
|
99
|
+
variant: "light",
|
100
|
+
color: "red",
|
101
|
+
title: "Attention!"
|
102
|
+
},
|
103
|
+
neutral: {
|
104
|
+
icon: /* @__PURE__ */ jsxDEV(IconInfoCircle, {
|
105
|
+
...defaultMediumIconProps
|
106
|
+
}, undefined, false, undefined, this),
|
107
|
+
variant: "light",
|
108
|
+
color: mantineTheme?.primaryColor,
|
109
|
+
title: "Information"
|
110
|
+
},
|
111
|
+
positive: {
|
112
|
+
icon: /* @__PURE__ */ jsxDEV(IconCircleCheck, {
|
113
|
+
...defaultMediumIconProps
|
114
|
+
}, undefined, false, undefined, this),
|
115
|
+
variant: "light",
|
116
|
+
color: "green",
|
117
|
+
title: "Success"
|
118
|
+
}
|
119
|
+
},
|
120
|
+
iconProps: {
|
121
|
+
medium: defaultMediumIconProps,
|
122
|
+
tiny: { size: 14, stroke: 3 }
|
123
|
+
},
|
124
|
+
jsonStringifySpace: 2,
|
125
|
+
transparentBackground,
|
126
|
+
primaryColor,
|
127
|
+
spacingPx,
|
128
|
+
...customTheme
|
129
|
+
};
|
130
|
+
};
|
131
|
+
var themeContext = React2.createContext(createRemoraidTheme());
|
132
|
+
var useRemoraidTheme = () => {
|
133
|
+
return useContext(themeContext);
|
134
|
+
};
|
135
|
+
|
136
|
+
// src/core/components/AppShell/NavbarMinimal/index.tsx
|
137
|
+
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
138
|
+
var defaultSettings = {
|
139
|
+
hiddenPages: [],
|
140
|
+
linkSize: rem("50px"),
|
141
|
+
iconSize: "50%",
|
142
|
+
px: "sm",
|
143
|
+
py: "md"
|
144
|
+
};
|
145
|
+
|
146
|
+
// src/core/components/RemoraidProvider/UserExperienceProvider/index.tsx
|
147
|
+
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
148
|
+
var defaultNavbarSettings = {
|
149
|
+
minimal: defaultSettings
|
150
|
+
};
|
151
|
+
var defaultUserExperience = {
|
152
|
+
navbarVariant: "minimal",
|
153
|
+
navbarSettings: defaultNavbarSettings.minimal,
|
154
|
+
showWelcomeMessage: true
|
155
|
+
};
|
156
|
+
var userExperienceContext = React3.createContext({
|
157
|
+
userExperience: defaultUserExperience,
|
158
|
+
updateUserExperience: () => {},
|
159
|
+
processedCookie: false
|
160
|
+
});
|
161
|
+
|
162
|
+
// src/core/components/RemoraidProvider/WidgetsProvider/index.tsx
|
163
|
+
import React4, {
|
164
|
+
useState as useState3,
|
165
|
+
useContext as useContext3
|
166
|
+
} from "react";
|
167
|
+
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
|
168
|
+
var widgetsContext = React4.createContext({
|
169
|
+
widgets: {},
|
170
|
+
activeWidget: null,
|
171
|
+
updateActiveWidget: () => {},
|
172
|
+
registerWidget: () => {},
|
173
|
+
registerPage: () => {},
|
174
|
+
isWidgetRegistered: () => false,
|
175
|
+
isPageRegistered: () => false,
|
176
|
+
updateWidgetSelection: () => {},
|
177
|
+
updateWidgetSelectionBulk: () => {},
|
178
|
+
isWidgetSelected: () => false
|
179
|
+
});
|
180
|
+
|
181
|
+
// src/core/components/RemoraidProvider/index.tsx
|
182
|
+
import { CookiesProvider } from "react-cookie";
|
183
|
+
import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
|
184
|
+
// src/core/components/AppShell/index.tsx
|
185
|
+
import {
|
186
|
+
AppShell as MantineAppShell,
|
187
|
+
Burger,
|
188
|
+
rem as rem2,
|
189
|
+
Group as Group2,
|
190
|
+
useMantineTheme as useMantineTheme3,
|
191
|
+
useMantineColorScheme as useMantineColorScheme4,
|
192
|
+
Paper as Paper2,
|
193
|
+
px as px2
|
194
|
+
} from "@mantine/core";
|
195
|
+
import { useDisclosure } from "@mantine/hooks";
|
196
|
+
|
197
|
+
// src/core/components/AppShell/Footer/index.tsx
|
198
|
+
import { Group, useMantineColorScheme as useMantineColorScheme3, useMantineTheme as useMantineTheme2 } from "@mantine/core";
|
199
|
+
import { IconPennant } from "@tabler/icons-react";
|
200
|
+
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
|
201
|
+
|
202
|
+
// src/core/components/AppShell/index.tsx
|
203
|
+
import { jsxDEV as jsxDEV7, Fragment } from "react/jsx-dev-runtime";
|
204
|
+
// src/core/components/WidgetSelectionHeader/index.tsx
|
205
|
+
import {
|
206
|
+
Chip,
|
207
|
+
Divider as Divider2,
|
208
|
+
Flex as Flex2,
|
209
|
+
ScrollArea,
|
210
|
+
Text
|
211
|
+
} from "@mantine/core";
|
212
|
+
|
213
|
+
// src/core/components/Page/index.tsx
|
214
|
+
import React5, {
|
215
|
+
useContext as useContext4,
|
216
|
+
useEffect as useEffect2
|
217
|
+
} from "react";
|
218
|
+
import { usePathname as usePathname2 } from "next/navigation";
|
219
|
+
|
220
|
+
// src/core/components/Page/PageContainer/index.tsx
|
221
|
+
import { Container } from "@mantine/core";
|
222
|
+
import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
|
223
|
+
|
224
|
+
// src/core/components/Page/index.tsx
|
225
|
+
import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
|
226
|
+
var pageContext = React5.createContext(null);
|
227
|
+
|
228
|
+
// src/core/components/WidgetSelectionHeader/index.tsx
|
229
|
+
import { IconCheck } from "@tabler/icons-react";
|
230
|
+
import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
|
231
|
+
// src/core/components/CloseButton/index.tsx
|
232
|
+
import { ActionIcon, Transition } from "@mantine/core";
|
233
|
+
import { IconX } from "@tabler/icons-react";
|
234
|
+
import { jsxDEV as jsxDEV11 } from "react/jsx-dev-runtime";
|
235
|
+
// src/core/components/BadgeGroup/index.tsx
|
236
|
+
import {
|
237
|
+
Badge as Badge2,
|
238
|
+
Group as Group3,
|
239
|
+
Tooltip as Tooltip3
|
240
|
+
} from "@mantine/core";
|
241
|
+
import React6 from "react";
|
242
|
+
|
243
|
+
// src/core/components/BadgeMinimal/index.tsx
|
244
|
+
import {
|
245
|
+
Badge,
|
246
|
+
Tooltip as Tooltip2,
|
247
|
+
Transition as Transition2
|
248
|
+
} from "@mantine/core";
|
249
|
+
import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
|
250
|
+
|
251
|
+
// src/core/components/BadgeGroup/index.tsx
|
252
|
+
import { jsxDEV as jsxDEV13, Fragment as Fragment2 } from "react/jsx-dev-runtime";
|
253
|
+
import { createElement } from "react";
|
254
|
+
// src/core/components/AlertMinimal/index.tsx
|
255
|
+
import {
|
256
|
+
Alert,
|
257
|
+
Transition as Transition3
|
258
|
+
} from "@mantine/core";
|
259
|
+
import { jsxDEV as jsxDEV14 } from "react/jsx-dev-runtime";
|
260
|
+
// src/core/components/ResponsiveButton/index.tsx
|
261
|
+
import {
|
262
|
+
ActionIcon as ActionIcon2,
|
263
|
+
Button,
|
264
|
+
Tooltip as Tooltip4
|
265
|
+
} from "@mantine/core";
|
266
|
+
import { IconClick } from "@tabler/icons-react";
|
267
|
+
import { jsxDEV as jsxDEV15, Fragment as Fragment3 } from "react/jsx-dev-runtime";
|
268
|
+
// src/core/components/Widget/WidgetWrapper/index.tsx
|
269
|
+
import {
|
270
|
+
Paper as Paper3,
|
271
|
+
Transition as Transition4
|
272
|
+
} from "@mantine/core";
|
273
|
+
import { useEffect as useEffect3 } from "react";
|
274
|
+
import { jsxDEV as jsxDEV16 } from "react/jsx-dev-runtime";
|
275
|
+
// src/core/components/Widget/index.tsx
|
276
|
+
import {
|
277
|
+
Center,
|
278
|
+
Divider as Divider3,
|
279
|
+
Group as Group4,
|
280
|
+
Loader,
|
281
|
+
Title
|
282
|
+
} from "@mantine/core";
|
283
|
+
import { jsxDEV as jsxDEV17, Fragment as Fragment4 } from "react/jsx-dev-runtime";
|
284
|
+
import { createElement as createElement2 } from "react";
|
285
|
+
// src/core/components/Page/NotFoundPage/index.tsx
|
286
|
+
import { Alert as Alert2 } from "@mantine/core";
|
287
|
+
import { usePathname as usePathname3 } from "next/navigation";
|
288
|
+
import { jsxDEV as jsxDEV18 } from "react/jsx-dev-runtime";
|
289
|
+
// src/core/components/EnvironmentShell/index.tsx
|
290
|
+
import { Alert as Alert3 } from "@mantine/core";
|
291
|
+
import { jsxDEV as jsxDEV19, Fragment as Fragment5 } from "react/jsx-dev-runtime";
|
292
|
+
// src/modals/components/JSONModal/index.tsx
|
293
|
+
import { jsxDEV as jsxDEV20, Fragment as Fragment6 } from "react/jsx-dev-runtime";
|
294
|
+
function JSONModal({
|
295
|
+
innerProps
|
296
|
+
}) {
|
297
|
+
const theme = useRemoraidTheme();
|
298
|
+
const stringValue = typeof innerProps.content === "string" ? innerProps.content : JSON.stringify(innerProps.content, null, theme.jsonStringifySpace);
|
299
|
+
return /* @__PURE__ */ jsxDEV20(Fragment6, {
|
300
|
+
children: /* @__PURE__ */ jsxDEV20(JsonInput, {
|
301
|
+
variant: "filled",
|
302
|
+
value: stringValue,
|
303
|
+
validationError: "Invalid JSON",
|
304
|
+
formatOnBlur: true,
|
305
|
+
autosize: true,
|
306
|
+
minRows: 4,
|
307
|
+
maxRows: 24,
|
308
|
+
...innerProps.componentsProps?.jsonInput
|
309
|
+
}, undefined, false, undefined, this)
|
310
|
+
}, undefined, false, undefined, this);
|
311
|
+
}
|
312
|
+
// src/modals/lib/utils.ts
|
313
|
+
var remoraidModals = {
|
314
|
+
json: JSONModal
|
315
|
+
};
|
316
|
+
export {
|
317
|
+
remoraidModals,
|
318
|
+
JSONModal
|
319
|
+
};
|
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
|
}
|