remoraid 2.14.7 → 2.19.4
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 +795 -446
- package/dist/core/index.d.ts +233 -175
- package/dist/core/index.js +791 -428
- package/dist/core/styles.css +56 -5
- package/dist/server/index.d.ts +5 -5
- package/package.json +2 -1
package/dist/core/index.js
CHANGED
@@ -701,7 +701,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
701
701
|
}
|
702
702
|
var runInContext = function runInContext(context) {
|
703
703
|
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
|
704
|
-
var { Array: Array2, Date, Error: Error2, Function: Function2, Math, Object: Object2, RegExp: RegExp2, String, TypeError: TypeError2 } = context;
|
704
|
+
var { Array: Array2, Date, Error: Error2, Function: Function2, Math: Math2, Object: Object2, RegExp: RegExp2, String, TypeError: TypeError2 } = context;
|
705
705
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
706
706
|
var coreJsData = context["__core-js_shared__"];
|
707
707
|
var funcToString = funcProto.toString;
|
@@ -724,7 +724,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
724
724
|
} catch (e) {}
|
725
725
|
}();
|
726
726
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
|
727
|
-
var { ceil: nativeCeil, floor: nativeFloor } =
|
727
|
+
var { ceil: nativeCeil, floor: nativeFloor } = Math2, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined2, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
|
728
728
|
var DataView = getNative(context, "DataView"), Map = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
|
729
729
|
var metaMap = WeakMap2 && new WeakMap2;
|
730
730
|
var realNames = {};
|
@@ -977,7 +977,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
977
977
|
}
|
978
978
|
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
979
979
|
SetCache.prototype.has = setCacheHas;
|
980
|
-
function
|
980
|
+
function Stack2(entries) {
|
981
981
|
var data = this.__data__ = new ListCache(entries);
|
982
982
|
this.size = data.size;
|
983
983
|
}
|
@@ -1011,11 +1011,11 @@ var require_lodash = __commonJS((exports, module) => {
|
|
1011
1011
|
this.size = data.size;
|
1012
1012
|
return this;
|
1013
1013
|
}
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1014
|
+
Stack2.prototype.clear = stackClear;
|
1015
|
+
Stack2.prototype["delete"] = stackDelete;
|
1016
|
+
Stack2.prototype.get = stackGet;
|
1017
|
+
Stack2.prototype.has = stackHas;
|
1018
|
+
Stack2.prototype.set = stackSet;
|
1019
1019
|
function arrayLikeKeys(value, inherited) {
|
1020
1020
|
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String) : [], length = result2.length;
|
1021
1021
|
for (var key in value) {
|
@@ -1131,7 +1131,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
1131
1131
|
result2 = initCloneByTag(value, tag, isDeep);
|
1132
1132
|
}
|
1133
1133
|
}
|
1134
|
-
stack || (stack = new
|
1134
|
+
stack || (stack = new Stack2);
|
1135
1135
|
var stacked = stack.get(value);
|
1136
1136
|
if (stacked) {
|
1137
1137
|
return stacked;
|
@@ -1400,21 +1400,21 @@ var require_lodash = __commonJS((exports, module) => {
|
|
1400
1400
|
objIsObj = false;
|
1401
1401
|
}
|
1402
1402
|
if (isSameTag && !objIsObj) {
|
1403
|
-
stack || (stack = new
|
1403
|
+
stack || (stack = new Stack2);
|
1404
1404
|
return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
1405
1405
|
}
|
1406
1406
|
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
1407
1407
|
var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
|
1408
1408
|
if (objIsWrapped || othIsWrapped) {
|
1409
1409
|
var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
|
1410
|
-
stack || (stack = new
|
1410
|
+
stack || (stack = new Stack2);
|
1411
1411
|
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
1412
1412
|
}
|
1413
1413
|
}
|
1414
1414
|
if (!isSameTag) {
|
1415
1415
|
return false;
|
1416
1416
|
}
|
1417
|
-
stack || (stack = new
|
1417
|
+
stack || (stack = new Stack2);
|
1418
1418
|
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
1419
1419
|
}
|
1420
1420
|
function baseIsMap(value) {
|
@@ -1440,7 +1440,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
1440
1440
|
return false;
|
1441
1441
|
}
|
1442
1442
|
} else {
|
1443
|
-
var stack = new
|
1443
|
+
var stack = new Stack2;
|
1444
1444
|
if (customizer) {
|
1445
1445
|
var result2 = customizer(objValue, srcValue, key, object, source, stack);
|
1446
1446
|
}
|
@@ -1536,7 +1536,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
1536
1536
|
return;
|
1537
1537
|
}
|
1538
1538
|
baseFor(source, function(srcValue, key) {
|
1539
|
-
stack || (stack = new
|
1539
|
+
stack || (stack = new Stack2);
|
1540
1540
|
if (isObject(srcValue)) {
|
1541
1541
|
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
1542
1542
|
} else {
|
@@ -2405,7 +2405,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
2405
2405
|
return setWrapToString(result2, func, bitmask);
|
2406
2406
|
}
|
2407
2407
|
function createRound(methodName) {
|
2408
|
-
var func =
|
2408
|
+
var func = Math2[methodName];
|
2409
2409
|
return function(number, precision) {
|
2410
2410
|
number = toNumber(number);
|
2411
2411
|
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
|
@@ -5439,6 +5439,11 @@ import React2, {
|
|
5439
5439
|
useContext
|
5440
5440
|
} from "react";
|
5441
5441
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
5442
|
+
var getDefaultWidgetContext = (configuration) => ({
|
5443
|
+
name: configuration.widgetId,
|
5444
|
+
selected: true,
|
5445
|
+
...configuration.initialValues
|
5446
|
+
});
|
5442
5447
|
var widgetsContext = React2.createContext({
|
5443
5448
|
widgets: {},
|
5444
5449
|
activeWidget: null,
|
@@ -5454,6 +5459,10 @@ var widgetsContext = React2.createContext({
|
|
5454
5459
|
var useWidgets = () => {
|
5455
5460
|
return useContext(widgetsContext);
|
5456
5461
|
};
|
5462
|
+
var useWidget = (pageId, widgetId) => {
|
5463
|
+
const { widgets } = useWidgets();
|
5464
|
+
return widgets?.[pageId]?.[widgetId] ?? null;
|
5465
|
+
};
|
5457
5466
|
function WidgetsProvider({
|
5458
5467
|
children
|
5459
5468
|
}) {
|
@@ -5499,13 +5508,10 @@ function WidgetsProvider({
|
|
5499
5508
|
const registerPage = (pageId, initialWidgets) => {
|
5500
5509
|
setWidgets((prev) => ({
|
5501
5510
|
...prev,
|
5502
|
-
[pageId]: initialWidgets.reduce((t,
|
5511
|
+
[pageId]: initialWidgets.reduce((t, widget) => {
|
5503
5512
|
return {
|
5504
5513
|
...t,
|
5505
|
-
[
|
5506
|
-
name: w.name,
|
5507
|
-
selected: w.initialValue === undefined ? true : w.initialValue
|
5508
|
-
}
|
5514
|
+
[widget.widgetId]: getDefaultWidgetContext(widget)
|
5509
5515
|
};
|
5510
5516
|
}, {})
|
5511
5517
|
}));
|
@@ -5529,10 +5535,7 @@ function WidgetsProvider({
|
|
5529
5535
|
...prev,
|
5530
5536
|
[pageId]: {
|
5531
5537
|
...prev[pageId],
|
5532
|
-
[widget.widgetId]:
|
5533
|
-
name: widget.name,
|
5534
|
-
selected: widget.initialValue === undefined ? true : widget.initialValue
|
5535
|
-
}
|
5538
|
+
[widget.widgetId]: getDefaultWidgetContext(widget)
|
5536
5539
|
}
|
5537
5540
|
}));
|
5538
5541
|
};
|
@@ -5611,11 +5614,6 @@ var FrameLayoutSection;
|
|
5611
5614
|
FrameLayoutSection2["Right"] = "right";
|
5612
5615
|
FrameLayoutSection2["Content"] = "content";
|
5613
5616
|
})(FrameLayoutSection ||= {});
|
5614
|
-
var FrameLayoutVariant;
|
5615
|
-
((FrameLayoutVariant2) => {
|
5616
|
-
FrameLayoutVariant2["Plain"] = "plain";
|
5617
|
-
FrameLayoutVariant2["Sticky"] = "sticky";
|
5618
|
-
})(FrameLayoutVariant ||= {});
|
5619
5617
|
|
5620
5618
|
// src/core/lib/utils.ts
|
5621
5619
|
import {
|
@@ -5801,7 +5799,8 @@ var createRemoraidTheme = (customTheme, dependencies) => {
|
|
5801
5799
|
stroke: 3,
|
5802
5800
|
...customTheme?.iconProps?.tiny
|
5803
5801
|
}
|
5804
|
-
}
|
5802
|
+
},
|
5803
|
+
primaryGutter: "md"
|
5805
5804
|
};
|
5806
5805
|
};
|
5807
5806
|
var themeContext = React3.createContext(createRemoraidTheme());
|
@@ -5984,7 +5983,7 @@ function RemoraidProvider({
|
|
5984
5983
|
}, undefined, false, undefined, this);
|
5985
5984
|
}
|
5986
5985
|
// src/core/components/AppShell/index.tsx
|
5987
|
-
import { Box as
|
5986
|
+
import { Box as Box2 } from "@mantine/core";
|
5988
5987
|
|
5989
5988
|
// src/core/components/AppShell/NavbarMinimal/index.tsx
|
5990
5989
|
import {
|
@@ -6205,7 +6204,6 @@ function FooterMinimal({
|
|
6205
6204
|
return /* @__PURE__ */ jsxDEV10(Group, {
|
6206
6205
|
justify: "center",
|
6207
6206
|
w: "100%",
|
6208
|
-
py: "md",
|
6209
6207
|
...componentsProps?.container,
|
6210
6208
|
children: /* @__PURE__ */ jsxDEV10(IconPennant, {
|
6211
6209
|
size: 50,
|
@@ -6217,7 +6215,6 @@ function FooterMinimal({
|
|
6217
6215
|
|
6218
6216
|
// src/core/components/FrameLayout/index.tsx
|
6219
6217
|
import {
|
6220
|
-
Box as Box2,
|
6221
6218
|
Group as Group2,
|
6222
6219
|
ScrollArea,
|
6223
6220
|
Stack as Stack2
|
@@ -6231,269 +6228,314 @@ import {
|
|
6231
6228
|
|
6232
6229
|
// src/core/components/FrameLayout/Element/index.tsx
|
6233
6230
|
import { Box, Portal } from "@mantine/core";
|
6231
|
+
|
6232
|
+
// src/core/lib/errors.ts
|
6233
|
+
class InvalidComponentUsageError extends Error {
|
6234
|
+
constructor(component, rule) {
|
6235
|
+
super(`Invalid usage of '${component}': ${rule}`);
|
6236
|
+
this.name = "InvalidComponentUsageError";
|
6237
|
+
}
|
6238
|
+
}
|
6239
|
+
|
6240
|
+
// src/core/components/Page/PageContainer/index.tsx
|
6241
|
+
import { Container } from "@mantine/core";
|
6242
|
+
|
6243
|
+
// node_modules/clsx/dist/clsx.mjs
|
6244
|
+
function r(e) {
|
6245
|
+
var t, f, n = "";
|
6246
|
+
if (typeof e == "string" || typeof e == "number")
|
6247
|
+
n += e;
|
6248
|
+
else if (typeof e == "object")
|
6249
|
+
if (Array.isArray(e)) {
|
6250
|
+
var o = e.length;
|
6251
|
+
for (t = 0;t < o; t++)
|
6252
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
6253
|
+
} else
|
6254
|
+
for (f in e)
|
6255
|
+
e[f] && (n && (n += " "), n += f);
|
6256
|
+
return n;
|
6257
|
+
}
|
6258
|
+
function clsx() {
|
6259
|
+
for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
|
6260
|
+
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
6261
|
+
return n;
|
6262
|
+
}
|
6263
|
+
var clsx_default = clsx;
|
6264
|
+
|
6265
|
+
// src/core/components/Page/PageContainer/index.tsx
|
6234
6266
|
import { jsxDEV as jsxDEV11 } from "react/jsx-dev-runtime";
|
6235
|
-
function
|
6267
|
+
function PageContainer({
|
6268
|
+
children,
|
6269
|
+
p = 0,
|
6270
|
+
hidden = false,
|
6271
|
+
componentsProps
|
6272
|
+
}) {
|
6273
|
+
const theme = useRemoraidTheme();
|
6274
|
+
return /* @__PURE__ */ jsxDEV11(Container, {
|
6275
|
+
size: theme.containerSize,
|
6276
|
+
p,
|
6277
|
+
w: "100%",
|
6278
|
+
"data-hidden": hidden,
|
6279
|
+
...componentsProps?.container,
|
6280
|
+
className: clsx_default("remoraid-page-container", componentsProps?.container?.className),
|
6281
|
+
children
|
6282
|
+
}, undefined, false, undefined, this);
|
6283
|
+
}
|
6284
|
+
|
6285
|
+
// src/core/components/FrameLayout/Element/index.tsx
|
6286
|
+
var import_lodash = __toESM(require_lodash(), 1);
|
6287
|
+
import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
|
6288
|
+
function Element2({
|
6236
6289
|
section,
|
6237
6290
|
includeContainer = true,
|
6291
|
+
includePageContainer = false,
|
6238
6292
|
layoutId,
|
6293
|
+
hidden = false,
|
6239
6294
|
componentsProps,
|
6240
6295
|
children
|
6241
6296
|
}) {
|
6242
6297
|
const { layouts } = useLayouts();
|
6243
6298
|
const closestLayout = useFrameLayout();
|
6244
|
-
if (closestLayout
|
6245
|
-
|
6299
|
+
if (!closestLayout) {
|
6300
|
+
throw new InvalidComponentUsageError("FrameLayout.Element", "must be used as child of 'FrameLayout'.");
|
6246
6301
|
}
|
6247
6302
|
const layout = layouts[layoutId ?? closestLayout.layoutId];
|
6248
|
-
if (!
|
6303
|
+
if (!layout) {
|
6249
6304
|
return null;
|
6250
6305
|
}
|
6251
|
-
if (layout.
|
6306
|
+
if (layout.type !== "frame" /* Frame */) {
|
6307
|
+
throw new TypeError("Prop 'layoutId' in 'FrameLayout.Element' must refer to a valid 'FrameLayout' component. Leave 'layoutId' undefined, if you want to use the closest 'FrameLayout' as reference layout.");
|
6308
|
+
}
|
6309
|
+
if (!layout.sections[section]) {
|
6252
6310
|
return null;
|
6253
6311
|
}
|
6254
6312
|
let containerProps = {};
|
6255
6313
|
if (section === "left" /* Left */ || section === "right" /* Right */) {
|
6256
6314
|
containerProps.h = "100%";
|
6257
6315
|
}
|
6258
|
-
|
6316
|
+
const element = includePageContainer ? /* @__PURE__ */ jsxDEV12(PageContainer, {
|
6317
|
+
p: 0,
|
6318
|
+
hidden,
|
6319
|
+
...componentsProps?.PageContainer,
|
6320
|
+
children
|
6321
|
+
}, undefined, false, undefined, this) : children;
|
6322
|
+
return /* @__PURE__ */ jsxDEV12(Portal, {
|
6259
6323
|
target: layout.sections[section],
|
6260
|
-
children: includeContainer ? /* @__PURE__ */
|
6261
|
-
|
6262
|
-
...componentsProps?.container,
|
6263
|
-
|
6264
|
-
|
6324
|
+
children: includeContainer ? /* @__PURE__ */ jsxDEV12(Box, {
|
6325
|
+
"data-hidden": hidden,
|
6326
|
+
...import_lodash.merge(containerProps, componentsProps?.container),
|
6327
|
+
className: clsx_default("remoraid-frame-layout-element", containerProps?.className, componentsProps?.container?.className),
|
6328
|
+
children: element
|
6329
|
+
}, undefined, false, undefined, this) : element
|
6265
6330
|
}, undefined, false, undefined, this);
|
6266
6331
|
}
|
6267
6332
|
|
6268
6333
|
// src/core/components/FrameLayout/index.tsx
|
6269
|
-
import { jsxDEV as
|
6270
|
-
var
|
6271
|
-
if (typeof layout !== "object" || layout === null) {
|
6272
|
-
return false;
|
6273
|
-
}
|
6274
|
-
if (!("sections" in layout)) {
|
6275
|
-
return false;
|
6276
|
-
}
|
6277
|
-
if (typeof layout.sections !== "object" || layout.sections === null) {
|
6278
|
-
return false;
|
6279
|
-
}
|
6280
|
-
return true;
|
6281
|
-
};
|
6282
|
-
var defaultFrameLayoutVariant = "sticky" /* Sticky */;
|
6283
|
-
var defaultFrameLayoutContext = {
|
6284
|
-
layoutId: null,
|
6285
|
-
layout: {
|
6286
|
-
sections: {
|
6287
|
-
["top" /* Top */]: null,
|
6288
|
-
["bottom" /* Bottom */]: null,
|
6289
|
-
["left" /* Left */]: null,
|
6290
|
-
["right" /* Right */]: null
|
6291
|
-
}
|
6292
|
-
},
|
6293
|
-
setLayout: () => {}
|
6294
|
-
};
|
6295
|
-
var layoutContext = createContext5(defaultFrameLayoutContext);
|
6334
|
+
import { jsxDEV as jsxDEV13 } from "react/jsx-dev-runtime";
|
6335
|
+
var layoutContext = createContext5(null);
|
6296
6336
|
var useFrameLayout = () => {
|
6297
6337
|
return useContext7(layoutContext);
|
6298
6338
|
};
|
6299
6339
|
function FrameLayout({
|
6300
|
-
variant = defaultFrameLayoutVariant,
|
6301
6340
|
layoutId,
|
6341
|
+
includeScrollArea = true,
|
6342
|
+
gutter = 0,
|
6302
6343
|
componentsProps,
|
6303
6344
|
children
|
6304
6345
|
}) {
|
6305
6346
|
const theme = useRemoraidTheme();
|
6306
6347
|
const { layouts, setLayouts } = useLayouts();
|
6307
6348
|
const layout = layouts[layoutId];
|
6308
|
-
const
|
6309
|
-
|
6310
|
-
|
6311
|
-
|
6312
|
-
|
6313
|
-
|
6314
|
-
|
6315
|
-
|
6316
|
-
|
6317
|
-
|
6349
|
+
const defaultSections = useMemo3(() => ({
|
6350
|
+
["bottom" /* Bottom */]: null,
|
6351
|
+
["right" /* Right */]: null,
|
6352
|
+
["top" /* Top */]: null,
|
6353
|
+
["left" /* Left */]: null,
|
6354
|
+
["content" /* Content */]: null
|
6355
|
+
}), []);
|
6356
|
+
const setSections = useCallback((value) => {
|
6357
|
+
setLayouts((prev) => ({
|
6358
|
+
...prev,
|
6359
|
+
[layoutId]: {
|
6360
|
+
type: "frame" /* Frame */,
|
6361
|
+
sections: typeof value === "function" ? value(prev[layoutId]?.sections ?? defaultSections) : value
|
6362
|
+
}
|
6363
|
+
}));
|
6364
|
+
}, [layoutId, setLayouts, defaultSections]);
|
6365
|
+
const topSectionRef = useCallback((n) => {
|
6366
|
+
setSections((prev) => ({
|
6318
6367
|
...prev,
|
6319
|
-
|
6368
|
+
["top" /* Top */]: n
|
6320
6369
|
}));
|
6321
|
-
}, [
|
6322
|
-
const
|
6323
|
-
|
6370
|
+
}, [setSections]);
|
6371
|
+
const bottomSectionRef = useCallback((n) => {
|
6372
|
+
setSections((prev) => ({
|
6324
6373
|
...prev,
|
6325
|
-
|
6374
|
+
["bottom" /* Bottom */]: n
|
6326
6375
|
}));
|
6327
|
-
}, [
|
6328
|
-
const
|
6329
|
-
|
6376
|
+
}, [setSections]);
|
6377
|
+
const leftSectionRef = useCallback((n) => {
|
6378
|
+
setSections((prev) => ({
|
6330
6379
|
...prev,
|
6331
|
-
|
6380
|
+
["left" /* Left */]: n
|
6332
6381
|
}));
|
6333
|
-
}, [
|
6334
|
-
const
|
6335
|
-
|
6382
|
+
}, [setSections]);
|
6383
|
+
const rightSectionRef = useCallback((n) => {
|
6384
|
+
setSections((prev) => ({
|
6336
6385
|
...prev,
|
6337
|
-
|
6386
|
+
["right" /* Right */]: n
|
6338
6387
|
}));
|
6339
|
-
}, [
|
6340
|
-
|
6341
|
-
|
6388
|
+
}, [setSections]);
|
6389
|
+
const contentSectionRef = useCallback((n) => {
|
6390
|
+
setSections((prev) => ({
|
6391
|
+
...prev,
|
6392
|
+
["content" /* Content */]: n
|
6393
|
+
}));
|
6394
|
+
}, [setSections]);
|
6395
|
+
const contentSection = /* @__PURE__ */ jsxDEV13(Stack2, {
|
6396
|
+
ref: contentSectionRef,
|
6397
|
+
h: "100%",
|
6398
|
+
gap: gutter,
|
6342
6399
|
flex: 1,
|
6343
|
-
...componentsProps?.
|
6344
|
-
|
6345
|
-
|
6346
|
-
|
6347
|
-
|
6348
|
-
|
6349
|
-
|
6350
|
-
|
6351
|
-
|
6352
|
-
|
6353
|
-
|
6354
|
-
|
6355
|
-
|
6356
|
-
}
|
6357
|
-
return /* @__PURE__ */ jsxDEV12(layoutContext.Provider, {
|
6358
|
-
value: { layoutId, layout, setLayout },
|
6359
|
-
children: /* @__PURE__ */ jsxDEV12(Group2, {
|
6400
|
+
...componentsProps?.sectionContainers?.["content" /* Content */],
|
6401
|
+
className: clsx_default("remoraid-frame-layout-section", "remoraid-frame-layout-content-section", componentsProps?.sectionContainers?.["content" /* Content */]?.className),
|
6402
|
+
children
|
6403
|
+
}, undefined, false, undefined, this);
|
6404
|
+
const layoutContextValue = useMemo3(() => ({
|
6405
|
+
type: "frame" /* Frame */,
|
6406
|
+
sections: defaultSections,
|
6407
|
+
...layout,
|
6408
|
+
layoutId
|
6409
|
+
}), [layout?.sections, defaultSections, layoutId]);
|
6410
|
+
return /* @__PURE__ */ jsxDEV13(layoutContext.Provider, {
|
6411
|
+
value: layoutContextValue,
|
6412
|
+
children: /* @__PURE__ */ jsxDEV13(Group2, {
|
6360
6413
|
gap: 0,
|
6361
6414
|
h: "100%",
|
6362
6415
|
w: "100%",
|
6363
6416
|
wrap: "nowrap",
|
6364
6417
|
...componentsProps?.horizontalContainer,
|
6418
|
+
style: {
|
6419
|
+
"--remoraid-frame-layout-gutter": typeof gutter === "string" ? `var(--mantine-spacing-${gutter})` : `${gutter}px`
|
6420
|
+
},
|
6421
|
+
className: clsx_default("remoraid-frame-layout", componentsProps?.horizontalContainer?.className),
|
6365
6422
|
children: [
|
6366
|
-
/* @__PURE__ */
|
6367
|
-
ref:
|
6423
|
+
/* @__PURE__ */ jsxDEV13(Group2, {
|
6424
|
+
ref: leftSectionRef,
|
6368
6425
|
h: "100%",
|
6369
|
-
gap: 0,
|
6370
6426
|
wrap: "nowrap",
|
6371
|
-
|
6427
|
+
gap: gutter,
|
6428
|
+
pr: 0,
|
6429
|
+
...componentsProps?.sectionContainers?.["left" /* Left */],
|
6430
|
+
className: clsx_default("remoraid-frame-layout-section", componentsProps?.sectionContainers?.["left" /* Left */]?.className)
|
6372
6431
|
}, undefined, false, undefined, this),
|
6373
|
-
/* @__PURE__ */
|
6432
|
+
/* @__PURE__ */ jsxDEV13(Stack2, {
|
6374
6433
|
h: "100%",
|
6375
6434
|
flex: 1,
|
6376
6435
|
gap: 0,
|
6377
6436
|
...componentsProps?.verticalContainer,
|
6437
|
+
className: clsx_default("remoraid-frame-layout-vertical-container", componentsProps?.verticalContainer?.className),
|
6378
6438
|
children: [
|
6379
|
-
/* @__PURE__ */
|
6380
|
-
|
6381
|
-
|
6382
|
-
gap: 0,
|
6439
|
+
/* @__PURE__ */ jsxDEV13(Stack2, {
|
6440
|
+
ref: topSectionRef,
|
6441
|
+
gap: gutter,
|
6383
6442
|
flex: 0,
|
6384
|
-
...componentsProps?.sectionContainers?.["top" /* Top */]
|
6443
|
+
...componentsProps?.sectionContainers?.["top" /* Top */],
|
6444
|
+
className: clsx_default("remoraid-frame-layout-section", "remoraid-frame-layout-top-section", componentsProps?.sectionContainers?.["top" /* Top */]?.className)
|
6385
6445
|
}, undefined, false, undefined, this),
|
6386
|
-
|
6387
|
-
|
6388
|
-
|
6389
|
-
|
6390
|
-
|
6446
|
+
includeScrollArea ? /* @__PURE__ */ jsxDEV13(ScrollArea, {
|
6447
|
+
flex: 1,
|
6448
|
+
...theme.scrollAreaProps,
|
6449
|
+
...componentsProps?.ScrollArea,
|
6450
|
+
children: contentSection
|
6451
|
+
}, undefined, false, undefined, this) : contentSection,
|
6452
|
+
/* @__PURE__ */ jsxDEV13(Stack2, {
|
6453
|
+
ref: bottomSectionRef,
|
6454
|
+
gap: gutter,
|
6391
6455
|
flex: 0,
|
6392
|
-
...componentsProps?.sectionContainers?.["bottom" /* Bottom */]
|
6456
|
+
...componentsProps?.sectionContainers?.["bottom" /* Bottom */],
|
6457
|
+
className: clsx_default("remoraid-frame-layout-section", "remoraid-frame-layout-bottom-section", componentsProps?.sectionContainers?.["bottom" /* Bottom */]?.className)
|
6393
6458
|
}, undefined, false, undefined, this)
|
6394
6459
|
]
|
6395
6460
|
}, undefined, true, undefined, this),
|
6396
|
-
/* @__PURE__ */
|
6397
|
-
|
6398
|
-
ref: rightSection,
|
6461
|
+
/* @__PURE__ */ jsxDEV13(Group2, {
|
6462
|
+
ref: rightSectionRef,
|
6399
6463
|
h: "100%",
|
6464
|
+
gap: gutter,
|
6465
|
+
pl: 0,
|
6400
6466
|
wrap: "nowrap",
|
6401
|
-
...componentsProps?.sectionContainers?.["right" /* Right */]
|
6467
|
+
...componentsProps?.sectionContainers?.["right" /* Right */],
|
6468
|
+
className: clsx_default("remoraid-frame-layout-section", componentsProps?.sectionContainers?.["right" /* Right */]?.className)
|
6402
6469
|
}, undefined, false, undefined, this)
|
6403
6470
|
]
|
6404
6471
|
}, undefined, true, undefined, this)
|
6405
6472
|
}, undefined, false, undefined, this);
|
6406
6473
|
}
|
6407
6474
|
var FrameLayout_default = Object.assign(FrameLayout, {
|
6408
|
-
Element
|
6475
|
+
Element: Element2
|
6409
6476
|
});
|
6410
6477
|
|
6411
6478
|
// src/core/components/AppShell/index.tsx
|
6412
|
-
|
6413
|
-
|
6479
|
+
var import_lodash2 = __toESM(require_lodash(), 1);
|
6480
|
+
import { jsxDEV as jsxDEV14 } from "react/jsx-dev-runtime";
|
6481
|
+
var remoraidAppShellLayoutId = "remoraid-app-shell";
|
6414
6482
|
var defaultAppShellNavbarPositions = { ["minimal" /* Minimal */]: "left" /* Left */ };
|
6415
6483
|
var defaultAppShellFooterPositions = { ["minimal" /* Minimal */]: "content" /* Content */ };
|
6416
|
-
function AppShell(
|
6417
|
-
|
6418
|
-
|
6419
|
-
|
6420
|
-
|
6421
|
-
|
6422
|
-
|
6423
|
-
|
6424
|
-
|
6425
|
-
|
6426
|
-
|
6427
|
-
|
6428
|
-
|
6429
|
-
|
6430
|
-
|
6431
|
-
}
|
6432
|
-
if (footerVariant !== null && footerPosition === undefined) {
|
6433
|
-
footerPosition = defaultAppShellFooterPositions[footerVariant];
|
6434
|
-
}
|
6484
|
+
function AppShell({
|
6485
|
+
navbarVariant: navbarVariantProp,
|
6486
|
+
footerVariant: footerVariantProp,
|
6487
|
+
navbarPosition: navbarPositionProp,
|
6488
|
+
footerPosition: footerPositionProp,
|
6489
|
+
gutter,
|
6490
|
+
appContext: appContext2,
|
6491
|
+
componentsProps,
|
6492
|
+
children
|
6493
|
+
}) {
|
6494
|
+
const navbarVariant = navbarVariantProp ?? null;
|
6495
|
+
const footerVariant = footerVariantProp ?? null;
|
6496
|
+
const navbarPosition = navbarPositionProp ?? (navbarVariant === null ? null : defaultAppShellNavbarPositions[navbarVariant]);
|
6497
|
+
const footerPosition = footerPositionProp ?? (footerVariant === null ? null : defaultAppShellFooterPositions[footerVariant]);
|
6498
|
+
const theme = useRemoraidTheme();
|
6435
6499
|
let navbar;
|
6436
6500
|
let footer;
|
6437
|
-
let
|
6438
|
-
|
6501
|
+
let navbarLayoutElementProps = {
|
6502
|
+
includeContainer: false
|
6503
|
+
};
|
6504
|
+
let footerLayoutElementProps = {
|
6505
|
+
includeContainer: true,
|
6506
|
+
componentsProps: { container: { style: { order: 1 } } }
|
6507
|
+
};
|
6439
6508
|
if (navbarVariant === "minimal" /* Minimal */) {
|
6440
|
-
navbar = /* @__PURE__ */
|
6509
|
+
navbar = /* @__PURE__ */ jsxDEV14(NavbarMinimal, {
|
6441
6510
|
...componentsProps?.navbar
|
6442
6511
|
}, undefined, false, undefined, this);
|
6443
|
-
navbarContainerProps.py = "md";
|
6444
|
-
if (navbarPosition === "left" /* Left */) {
|
6445
|
-
navbarContainerProps.pl = "md";
|
6446
|
-
} else if (navbarPosition === "right" /* Right */) {
|
6447
|
-
navbarContainerProps.pr = "md";
|
6448
|
-
}
|
6449
6512
|
}
|
6450
6513
|
if (footerVariant === "minimal" /* Minimal */) {
|
6451
|
-
footer = /* @__PURE__ */
|
6514
|
+
footer = /* @__PURE__ */ jsxDEV14(FooterMinimal, {
|
6452
6515
|
...componentsProps?.footer
|
6453
6516
|
}, undefined, false, undefined, this);
|
6454
6517
|
}
|
6455
|
-
return /* @__PURE__ */
|
6518
|
+
return /* @__PURE__ */ jsxDEV14(AppProvider, {
|
6456
6519
|
appContext: appContext2,
|
6457
6520
|
...componentsProps?.AppProvider,
|
6458
|
-
children: /* @__PURE__ */
|
6521
|
+
children: /* @__PURE__ */ jsxDEV14(Box2, {
|
6459
6522
|
h: "100vh",
|
6460
6523
|
...componentsProps?.container,
|
6461
|
-
children: /* @__PURE__ */
|
6462
|
-
layoutId:
|
6524
|
+
children: /* @__PURE__ */ jsxDEV14(FrameLayout_default, {
|
6525
|
+
layoutId: remoraidAppShellLayoutId,
|
6526
|
+
gutter: gutter ?? theme.primaryGutter,
|
6463
6527
|
...componentsProps?.layout,
|
6464
6528
|
children: [
|
6465
|
-
navbarPosition !==
|
6529
|
+
navbarPosition !== null && /* @__PURE__ */ jsxDEV14(FrameLayout_default.Element, {
|
6466
6530
|
section: navbarPosition,
|
6467
|
-
|
6468
|
-
componentsProps
|
6469
|
-
...componentsProps?.navbarLayoutElement?.componentsProps,
|
6470
|
-
container: {
|
6471
|
-
...navbarContainerProps,
|
6472
|
-
...componentsProps?.navbarLayoutElement?.componentsProps?.container
|
6473
|
-
}
|
6474
|
-
},
|
6531
|
+
includeContainer: false,
|
6532
|
+
...import_lodash2.merge(navbarLayoutElementProps, componentsProps?.navbarLayoutElement),
|
6475
6533
|
children: navbar
|
6476
6534
|
}, undefined, false, undefined, this),
|
6477
|
-
|
6535
|
+
children,
|
6536
|
+
footerPosition !== null && /* @__PURE__ */ jsxDEV14(FrameLayout_default.Element, {
|
6478
6537
|
section: footerPosition,
|
6479
|
-
...componentsProps?.footerLayoutElement,
|
6480
|
-
componentsProps: {
|
6481
|
-
...componentsProps?.footerLayoutElement?.componentsProps,
|
6482
|
-
container: {
|
6483
|
-
...footerContainerProps,
|
6484
|
-
...componentsProps?.footerLayoutElement?.componentsProps?.container
|
6485
|
-
}
|
6486
|
-
},
|
6487
|
-
children: footer
|
6488
|
-
}, undefined, false, undefined, this),
|
6489
|
-
navbarPosition !== undefined && navbarPosition === "content" /* Content */ && /* @__PURE__ */ jsxDEV13(Fragment2, {
|
6490
|
-
children: navbar
|
6491
|
-
}, undefined, false, undefined, this),
|
6492
|
-
/* @__PURE__ */ jsxDEV13(Box3, {
|
6493
|
-
...componentsProps?.childrenContainer,
|
6494
|
-
children
|
6495
|
-
}, undefined, false, undefined, this),
|
6496
|
-
footerPosition !== undefined && footerPosition === "content" /* Content */ && /* @__PURE__ */ jsxDEV13(Fragment2, {
|
6538
|
+
...import_lodash2.merge(footerLayoutElementProps, componentsProps?.footerLayoutElement),
|
6497
6539
|
children: footer
|
6498
6540
|
}, undefined, false, undefined, this)
|
6499
6541
|
]
|
@@ -6509,30 +6551,12 @@ var AppShell_default = Object.assign(AppShell, {
|
|
6509
6551
|
import { Chip as Chip2, Divider as Divider2, Flex as Flex3, Text } from "@mantine/core";
|
6510
6552
|
|
6511
6553
|
// src/core/components/Page/index.tsx
|
6554
|
+
import { Stack as Stack3 } from "@mantine/core";
|
6512
6555
|
import React6, {
|
6513
6556
|
useContext as useContext8,
|
6514
6557
|
useEffect as useEffect3
|
6515
6558
|
} from "react";
|
6516
6559
|
import { usePathname as usePathname2 } from "next/navigation";
|
6517
|
-
|
6518
|
-
// src/core/components/Page/PageContainer/index.tsx
|
6519
|
-
import { Container } from "@mantine/core";
|
6520
|
-
import { jsxDEV as jsxDEV14 } from "react/jsx-dev-runtime";
|
6521
|
-
function PageContainer({
|
6522
|
-
children,
|
6523
|
-
pt,
|
6524
|
-
componentsProps
|
6525
|
-
}) {
|
6526
|
-
const theme = useRemoraidTheme();
|
6527
|
-
return /* @__PURE__ */ jsxDEV14(Container, {
|
6528
|
-
size: theme.containerSize,
|
6529
|
-
pt: pt ?? "md",
|
6530
|
-
...componentsProps?.container,
|
6531
|
-
children
|
6532
|
-
}, undefined, false, undefined, this);
|
6533
|
-
}
|
6534
|
-
|
6535
|
-
// src/core/components/Page/index.tsx
|
6536
6560
|
import { jsxDEV as jsxDEV15 } from "react/jsx-dev-runtime";
|
6537
6561
|
var pageContext = React6.createContext(null);
|
6538
6562
|
var usePage = () => {
|
@@ -6542,9 +6566,10 @@ function Page({
|
|
6542
6566
|
children,
|
6543
6567
|
name,
|
6544
6568
|
config,
|
6545
|
-
|
6569
|
+
gap,
|
6546
6570
|
componentsProps
|
6547
6571
|
}) {
|
6572
|
+
const theme = useRemoraidTheme();
|
6548
6573
|
const pathname = usePathname2();
|
6549
6574
|
const { isPageRegistered, registerPage } = useWidgets();
|
6550
6575
|
const pageId = config?.pageId ?? pathname;
|
@@ -6558,9 +6583,13 @@ function Page({
|
|
6558
6583
|
return /* @__PURE__ */ jsxDEV15(pageContext.Provider, {
|
6559
6584
|
value: { name: name ?? pathname, pageId, ...config },
|
6560
6585
|
children: /* @__PURE__ */ jsxDEV15(PageContainer, {
|
6561
|
-
|
6562
|
-
|
6563
|
-
|
6586
|
+
...componentsProps?.PageContainer,
|
6587
|
+
children: /* @__PURE__ */ jsxDEV15(Stack3, {
|
6588
|
+
gap: gap ?? theme.primaryGutter,
|
6589
|
+
...componentsProps?.Stack,
|
6590
|
+
className: clsx_default("remoraid-page", componentsProps?.Stack?.className),
|
6591
|
+
children
|
6592
|
+
}, undefined, false, undefined, this)
|
6564
6593
|
}, undefined, false, undefined, this)
|
6565
6594
|
}, undefined, false, undefined, this);
|
6566
6595
|
}
|
@@ -6580,8 +6609,9 @@ function ScrollableChipGroup({
|
|
6580
6609
|
onChange,
|
6581
6610
|
gap,
|
6582
6611
|
componentsProps,
|
6583
|
-
children
|
6612
|
+
children: childrenProp
|
6584
6613
|
}) {
|
6614
|
+
const children = asChildrenOfType(Chip, childrenProp, "Check children passed to 'ScrollableChipGroup' component.");
|
6585
6615
|
const theme = useRemoraidTheme();
|
6586
6616
|
return /* @__PURE__ */ jsxDEV16(ScrollArea2, {
|
6587
6617
|
...theme.scrollAreaProps,
|
@@ -6611,12 +6641,12 @@ function WidgetSelectionHeader({
|
|
6611
6641
|
mt
|
6612
6642
|
}) {
|
6613
6643
|
const theme = useRemoraidTheme();
|
6614
|
-
const {
|
6644
|
+
const { isPageRegistered, updateWidgetSelectionBulk, ...widgetsContext2 } = useWidgets();
|
6615
6645
|
const page = usePage();
|
6616
6646
|
if (!page) {
|
6617
|
-
|
6618
|
-
return null;
|
6647
|
+
throw new InvalidComponentUsageError("WidgetSelectionHeader", "must be used as child of 'Page'.");
|
6619
6648
|
}
|
6649
|
+
const widgets = widgetsContext2.widgets[page.pageId] ?? {};
|
6620
6650
|
return /* @__PURE__ */ jsxDEV17(Flex3, {
|
6621
6651
|
justify: "flex-start",
|
6622
6652
|
align: "center",
|
@@ -6632,56 +6662,27 @@ function WidgetSelectionHeader({
|
|
6632
6662
|
orientation: "vertical"
|
6633
6663
|
}, undefined, false, undefined, this),
|
6634
6664
|
isPageRegistered(page.pageId) && /* @__PURE__ */ jsxDEV17(ScrollableChipGroup, {
|
6635
|
-
value: Object.keys(widgets
|
6665
|
+
value: Object.keys(widgets).filter((widgetId) => widgets[widgetId]?.selected),
|
6636
6666
|
onChange: (value) => {
|
6637
6667
|
updateWidgetSelectionBulk(page.pageId, value);
|
6638
6668
|
},
|
6639
6669
|
componentsProps: { scrollArea: { flex: 1 } },
|
6640
|
-
children: Object.keys(widgets
|
6641
|
-
|
6642
|
-
|
6643
|
-
|
6644
|
-
|
6645
|
-
|
6646
|
-
|
6647
|
-
|
6648
|
-
|
6670
|
+
children: Object.keys(widgets).map((widgetId) => {
|
6671
|
+
const widget = widgets[widgetId] ?? getDefaultWidgetContext({ widgetId });
|
6672
|
+
return /* @__PURE__ */ jsxDEV17(Chip2, {
|
6673
|
+
value: widgetId,
|
6674
|
+
size: "sm",
|
6675
|
+
disabled: disabledWidgets && disabledWidgets.includes(widgetId),
|
6676
|
+
icon: /* @__PURE__ */ jsxDEV17(IconCheck, {
|
6677
|
+
...theme.iconProps.tiny
|
6678
|
+
}, undefined, false, undefined, this),
|
6679
|
+
children: widget.name
|
6680
|
+
}, widgetId, false, undefined, this);
|
6681
|
+
})
|
6649
6682
|
}, undefined, false, undefined, this)
|
6650
6683
|
]
|
6651
6684
|
}, undefined, true, undefined, this);
|
6652
6685
|
}
|
6653
|
-
// src/core/components/Widget/WidgetWrapper/CloseButton/index.tsx
|
6654
|
-
import { ActionIcon, Transition } from "@mantine/core";
|
6655
|
-
import { IconX } from "@tabler/icons-react";
|
6656
|
-
import { jsxDEV as jsxDEV18 } from "react/jsx-dev-runtime";
|
6657
|
-
function CloseButton({ widgetId }) {
|
6658
|
-
const theme = useRemoraidTheme();
|
6659
|
-
const { activeWidget, updateWidgetSelection } = useWidgets();
|
6660
|
-
const page = usePage();
|
6661
|
-
return /* @__PURE__ */ jsxDEV18(Transition, {
|
6662
|
-
mounted: activeWidget === widgetId,
|
6663
|
-
transition: "pop-top-right",
|
6664
|
-
duration: theme.transitionDurations.short,
|
6665
|
-
timingFunction: "ease",
|
6666
|
-
children: (transitionStyle) => /* @__PURE__ */ jsxDEV18(ActionIcon, {
|
6667
|
-
pos: "absolute",
|
6668
|
-
size: "xs",
|
6669
|
-
className: "remoraid-close-button",
|
6670
|
-
radius: "xl",
|
6671
|
-
color: "red",
|
6672
|
-
onClick: () => {
|
6673
|
-
if (!page) {
|
6674
|
-
return;
|
6675
|
-
}
|
6676
|
-
updateWidgetSelection(page.pageId, widgetId, false);
|
6677
|
-
},
|
6678
|
-
style: transitionStyle,
|
6679
|
-
children: /* @__PURE__ */ jsxDEV18(IconX, {
|
6680
|
-
...theme.iconProps.tiny
|
6681
|
-
}, undefined, false, undefined, this)
|
6682
|
-
}, undefined, false, undefined, this)
|
6683
|
-
}, undefined, false, undefined, this);
|
6684
|
-
}
|
6685
6686
|
// src/core/components/BadgeGroup/index.tsx
|
6686
6687
|
import {
|
6687
6688
|
Badge as Badge2,
|
@@ -6694,23 +6695,27 @@ import React7, { isValidElement as isValidElement2 } from "react";
|
|
6694
6695
|
import {
|
6695
6696
|
Badge,
|
6696
6697
|
Tooltip as Tooltip2,
|
6697
|
-
Transition
|
6698
|
+
Transition
|
6698
6699
|
} from "@mantine/core";
|
6699
|
-
import { jsxDEV as
|
6700
|
-
function BadgeMinimal(
|
6701
|
-
|
6700
|
+
import { jsxDEV as jsxDEV18 } from "react/jsx-dev-runtime";
|
6701
|
+
function BadgeMinimal({
|
6702
|
+
label,
|
6703
|
+
tooltip,
|
6704
|
+
mounted = true,
|
6705
|
+
componentsProps
|
6706
|
+
}) {
|
6702
6707
|
const theme = useRemoraidTheme();
|
6703
|
-
return /* @__PURE__ */
|
6704
|
-
mounted
|
6708
|
+
return /* @__PURE__ */ jsxDEV18(Transition, {
|
6709
|
+
mounted,
|
6705
6710
|
transition: "fade",
|
6706
6711
|
duration: theme.transitionDurations.short,
|
6707
6712
|
timingFunction: "ease",
|
6708
6713
|
...componentsProps?.transition,
|
6709
|
-
children: (transitionStyle) => /* @__PURE__ */
|
6714
|
+
children: (transitionStyle) => /* @__PURE__ */ jsxDEV18(Tooltip2, {
|
6710
6715
|
disabled: !tooltip,
|
6711
6716
|
label: tooltip,
|
6712
6717
|
...componentsProps?.tooltip,
|
6713
|
-
children: /* @__PURE__ */
|
6718
|
+
children: /* @__PURE__ */ jsxDEV18(Badge, {
|
6714
6719
|
variant: "default",
|
6715
6720
|
...componentsProps?.badge,
|
6716
6721
|
style: {
|
@@ -6725,7 +6730,7 @@ function BadgeMinimal(props) {
|
|
6725
6730
|
}
|
6726
6731
|
|
6727
6732
|
// src/core/components/BadgeGroup/index.tsx
|
6728
|
-
import { jsxDEV as
|
6733
|
+
import { jsxDEV as jsxDEV19, Fragment as Fragment2 } from "react/jsx-dev-runtime";
|
6729
6734
|
import { createElement } from "react";
|
6730
6735
|
function BadgeGroup({
|
6731
6736
|
badges: badgesProp,
|
@@ -6736,9 +6741,9 @@ function BadgeGroup({
|
|
6736
6741
|
const theme = useRemoraidTheme();
|
6737
6742
|
const badges = badgesProp.map((badge) => asElementOrPropsOfType(BadgeMinimal, badge, "Check 'badges' property passed to 'BadgeGroup'."));
|
6738
6743
|
const numVisibleBadges = badges.filter((badge) => isValidElementOfType(BadgeMinimal, badge) ? badge.props.mounted : badge.mounted !== false).length;
|
6739
|
-
return /* @__PURE__ */
|
6744
|
+
return /* @__PURE__ */ jsxDEV19(Fragment2, {
|
6740
6745
|
children: [
|
6741
|
-
/* @__PURE__ */
|
6746
|
+
/* @__PURE__ */ jsxDEV19(Group3, {
|
6742
6747
|
gap: gap ?? "xs",
|
6743
6748
|
wrap: "nowrap",
|
6744
6749
|
visibleFrom: breakpoint ?? theme.breakpoints.badgeGroupCollapse,
|
@@ -6754,10 +6759,10 @@ function BadgeGroup({
|
|
6754
6759
|
});
|
6755
6760
|
})
|
6756
6761
|
}, undefined, false, undefined, this),
|
6757
|
-
/* @__PURE__ */
|
6762
|
+
/* @__PURE__ */ jsxDEV19(Tooltip3, {
|
6758
6763
|
label: `${numVisibleBadges} badge${numVisibleBadges === 1 ? "" : "s"}`,
|
6759
6764
|
...componentsProps?.tooltip,
|
6760
|
-
children: /* @__PURE__ */
|
6765
|
+
children: /* @__PURE__ */ jsxDEV19(Badge2, {
|
6761
6766
|
hiddenFrom: breakpoint ?? theme.breakpoints.badgeGroupCollapse,
|
6762
6767
|
hidden: numVisibleBadges === 0,
|
6763
6768
|
variant: "light",
|
@@ -6773,28 +6778,28 @@ function BadgeGroup({
|
|
6773
6778
|
// src/core/components/AlertMinimal/index.tsx
|
6774
6779
|
import {
|
6775
6780
|
Alert,
|
6776
|
-
Transition as
|
6781
|
+
Transition as Transition2
|
6777
6782
|
} from "@mantine/core";
|
6778
|
-
import { jsxDEV as
|
6783
|
+
import { jsxDEV as jsxDEV20 } from "react/jsx-dev-runtime";
|
6779
6784
|
function AlertMinimal({
|
6780
6785
|
title,
|
6781
6786
|
category,
|
6782
6787
|
text,
|
6783
6788
|
onClose,
|
6784
|
-
mounted,
|
6789
|
+
mounted = true,
|
6785
6790
|
mt,
|
6786
6791
|
mb,
|
6787
6792
|
componentsProps,
|
6788
6793
|
children
|
6789
6794
|
}) {
|
6790
6795
|
const theme = useRemoraidTheme();
|
6791
|
-
return /* @__PURE__ */
|
6796
|
+
return /* @__PURE__ */ jsxDEV20(Transition2, {
|
6792
6797
|
mounted: mounted !== false,
|
6793
6798
|
transition: "fade",
|
6794
6799
|
duration: theme.transitionDurations.short,
|
6795
6800
|
timingFunction: "ease",
|
6796
6801
|
...componentsProps?.transition,
|
6797
|
-
children: (transitionStyle) => /* @__PURE__ */
|
6802
|
+
children: (transitionStyle) => /* @__PURE__ */ jsxDEV20(Alert, {
|
6798
6803
|
...theme.alertProps[category],
|
6799
6804
|
title: title ?? theme.alertProps[category].title,
|
6800
6805
|
withCloseButton: onClose !== undefined,
|
@@ -6815,154 +6820,509 @@ function AlertMinimal({
|
|
6815
6820
|
}
|
6816
6821
|
// src/core/components/RemoraidButton/index.tsx
|
6817
6822
|
import {
|
6818
|
-
ActionIcon
|
6823
|
+
ActionIcon,
|
6819
6824
|
Button,
|
6820
|
-
Tooltip as Tooltip4
|
6825
|
+
Tooltip as Tooltip4,
|
6826
|
+
Transition as Transition3
|
6821
6827
|
} from "@mantine/core";
|
6822
6828
|
import { IconClick } from "@tabler/icons-react";
|
6823
|
-
import {
|
6829
|
+
import { createElement as createElement2 } from "react";
|
6830
|
+
import { jsxDEV as jsxDEV21, Fragment as Fragment3 } from "react/jsx-dev-runtime";
|
6824
6831
|
function RemoraidButton({
|
6825
6832
|
label,
|
6826
|
-
responsive,
|
6827
|
-
breakpoint,
|
6828
|
-
collapsed,
|
6833
|
+
responsive: ResponsiveProp,
|
6834
|
+
breakpoint: breakpointProp,
|
6835
|
+
collapsed: collapsedProp,
|
6829
6836
|
size,
|
6830
6837
|
color,
|
6831
6838
|
onClick,
|
6832
6839
|
loading,
|
6833
|
-
variant,
|
6834
|
-
|
6835
|
-
|
6840
|
+
variant = "default",
|
6841
|
+
mounted = true,
|
6842
|
+
icon: iconProp,
|
6843
|
+
iconSize = "medium" /* Medium */,
|
6844
|
+
componentsProps
|
6836
6845
|
}) {
|
6846
|
+
const responsive = ResponsiveProp ?? true;
|
6847
|
+
const breakpoint = breakpointProp ?? "md";
|
6848
|
+
const collapsed = collapsedProp ?? false;
|
6849
|
+
const icon = iconProp ?? IconClick;
|
6837
6850
|
const theme = useRemoraidTheme();
|
6838
|
-
const iconProps = { ...theme.iconProps
|
6839
|
-
const
|
6840
|
-
|
6841
|
-
|
6842
|
-
|
6843
|
-
|
6844
|
-
|
6845
|
-
|
6846
|
-
|
6847
|
-
|
6848
|
-
|
6849
|
-
|
6850
|
-
|
6851
|
-
|
6851
|
+
const iconProps = { ...theme.iconProps[iconSize], ...componentsProps?.icon };
|
6852
|
+
const iconElement = createElement2(icon, iconProps);
|
6853
|
+
return /* @__PURE__ */ jsxDEV21(Transition3, {
|
6854
|
+
mounted,
|
6855
|
+
transition: "fade",
|
6856
|
+
duration: theme.transitionDurations.short,
|
6857
|
+
timingFunction: "ease",
|
6858
|
+
...componentsProps?.transition,
|
6859
|
+
children: (transitionStyle) => /* @__PURE__ */ jsxDEV21(Fragment3, {
|
6860
|
+
children: [
|
6861
|
+
/* @__PURE__ */ jsxDEV21(Tooltip4, {
|
6862
|
+
label,
|
6863
|
+
...componentsProps?.tooltip,
|
6864
|
+
children: /* @__PURE__ */ jsxDEV21(ActionIcon, {
|
6865
|
+
"aria-label": label,
|
6866
|
+
variant,
|
6867
|
+
onClick,
|
6868
|
+
loading,
|
6869
|
+
size: size ? `input-${size}` : "input-sm",
|
6870
|
+
color,
|
6871
|
+
...componentsProps?.button,
|
6872
|
+
...componentsProps?.ActionIcon,
|
6873
|
+
hiddenFrom: !responsive ? undefined : breakpoint,
|
6874
|
+
display: !responsive && !collapsed ? "none" : componentsProps?.ActionIcon?.display ?? componentsProps?.button?.display,
|
6875
|
+
style: {
|
6876
|
+
...transitionStyle,
|
6877
|
+
...componentsProps?.ActionIcon?.style ?? componentsProps?.button?.style
|
6878
|
+
},
|
6879
|
+
children: iconElement
|
6880
|
+
}, undefined, false, undefined, this)
|
6881
|
+
}, undefined, false, undefined, this),
|
6882
|
+
/* @__PURE__ */ jsxDEV21(Button, {
|
6852
6883
|
onClick,
|
6853
6884
|
loading,
|
6854
|
-
|
6885
|
+
variant,
|
6886
|
+
size,
|
6855
6887
|
color,
|
6888
|
+
leftSection: iconProp ? iconElement : undefined,
|
6856
6889
|
...componentsProps?.button,
|
6857
|
-
...componentsProps?.
|
6858
|
-
|
6859
|
-
display: responsive
|
6860
|
-
|
6890
|
+
...componentsProps?.Button,
|
6891
|
+
visibleFrom: !responsive ? undefined : breakpoint,
|
6892
|
+
display: !responsive && collapsed ? "none" : componentsProps?.Button?.display ?? componentsProps?.button?.display,
|
6893
|
+
style: {
|
6894
|
+
...transitionStyle,
|
6895
|
+
...componentsProps?.Button?.style ?? componentsProps?.button?.style
|
6896
|
+
},
|
6897
|
+
children: label
|
6861
6898
|
}, undefined, false, undefined, this)
|
6862
|
-
|
6863
|
-
|
6864
|
-
|
6865
|
-
|
6866
|
-
|
6899
|
+
]
|
6900
|
+
}, undefined, true, undefined, this)
|
6901
|
+
}, undefined, false, undefined, this);
|
6902
|
+
}
|
6903
|
+
// src/core/components/Controls/ControlButton/index.tsx
|
6904
|
+
import {
|
6905
|
+
ActionIcon as ActionIcon2,
|
6906
|
+
Tooltip as Tooltip5,
|
6907
|
+
Transition as Transition4
|
6908
|
+
} from "@mantine/core";
|
6909
|
+
import { IconClick as IconClick2 } from "@tabler/icons-react";
|
6910
|
+
import { jsxDEV as jsxDEV22 } from "react/jsx-dev-runtime";
|
6911
|
+
function ControlButton({
|
6912
|
+
icon: Icon4 = IconClick2,
|
6913
|
+
mounted = true,
|
6914
|
+
size = "xs",
|
6915
|
+
iconSize = "tiny" /* Tiny */,
|
6916
|
+
onClick,
|
6917
|
+
order,
|
6918
|
+
color,
|
6919
|
+
tooltip,
|
6920
|
+
componentsProps
|
6921
|
+
}) {
|
6922
|
+
const theme = useRemoraidTheme();
|
6923
|
+
return /* @__PURE__ */ jsxDEV22(Transition4, {
|
6924
|
+
mounted,
|
6925
|
+
transition: "pop-top-right",
|
6926
|
+
duration: theme.transitionDurations.short,
|
6927
|
+
timingFunction: "ease",
|
6928
|
+
...componentsProps?.transition,
|
6929
|
+
children: (transitionStyle) => /* @__PURE__ */ jsxDEV22(Tooltip5, {
|
6930
|
+
label: tooltip,
|
6931
|
+
disabled: !Boolean(tooltip),
|
6932
|
+
...componentsProps?.tooltip,
|
6933
|
+
children: /* @__PURE__ */ jsxDEV22(ActionIcon2, {
|
6934
|
+
"data-control-button": true,
|
6867
6935
|
size,
|
6868
6936
|
color,
|
6869
|
-
|
6937
|
+
onClick,
|
6938
|
+
radius: "xl",
|
6870
6939
|
...componentsProps?.button,
|
6871
|
-
|
6872
|
-
|
6873
|
-
|
6874
|
-
|
6940
|
+
style: {
|
6941
|
+
...transitionStyle,
|
6942
|
+
order,
|
6943
|
+
...componentsProps?.button?.style
|
6944
|
+
},
|
6945
|
+
children: /* @__PURE__ */ jsxDEV22(Icon4, {
|
6946
|
+
...theme.iconProps[iconSize],
|
6947
|
+
...componentsProps?.icon
|
6948
|
+
}, undefined, false, undefined, this)
|
6875
6949
|
}, undefined, false, undefined, this)
|
6876
|
-
|
6877
|
-
}, undefined,
|
6950
|
+
}, undefined, false, undefined, this)
|
6951
|
+
}, undefined, false, undefined, this);
|
6878
6952
|
}
|
6879
|
-
|
6953
|
+
|
6954
|
+
// src/core/components/Controls/index.tsx
|
6955
|
+
import { useRef, useState as useState6 } from "react";
|
6880
6956
|
import {
|
6957
|
+
Group as Group4,
|
6881
6958
|
Paper as Paper2,
|
6882
|
-
Transition as
|
6959
|
+
Transition as Transition5
|
6883
6960
|
} from "@mantine/core";
|
6884
|
-
import {
|
6961
|
+
import { IconGripHorizontal } from "@tabler/icons-react";
|
6962
|
+
var import_lodash3 = __toESM(require_lodash(), 1);
|
6885
6963
|
import { jsxDEV as jsxDEV23 } from "react/jsx-dev-runtime";
|
6964
|
+
function Controls({
|
6965
|
+
groupRef,
|
6966
|
+
mounted = true,
|
6967
|
+
dragContainerRef,
|
6968
|
+
gutter = 5,
|
6969
|
+
iconSize = "tiny" /* Tiny */,
|
6970
|
+
additionalButtons: additionalButtonsProp,
|
6971
|
+
componentsProps,
|
6972
|
+
children: childrenProp
|
6973
|
+
}) {
|
6974
|
+
const additionalButtons = additionalButtonsProp?.map((additionalButton) => asElementOrPropsOfType(ControlButton, additionalButton, "Check the 'additionalButtons' property of 'Controls'."));
|
6975
|
+
const children = asChildrenOfType(ControlButton, childrenProp, "Check children passed to 'Controls' component.");
|
6976
|
+
const theme = useRemoraidTheme();
|
6977
|
+
const [pos, setPos] = useState6({
|
6978
|
+
x: 0,
|
6979
|
+
y: 0
|
6980
|
+
});
|
6981
|
+
const offsetRef = useRef({ x: 0, y: 0 });
|
6982
|
+
const containerRef = useRef(null);
|
6983
|
+
const clamp = (v, min, max) => {
|
6984
|
+
return Math.min(Math.max(v, min), max);
|
6985
|
+
};
|
6986
|
+
const handlePointerDown = (e) => {
|
6987
|
+
if (e.target instanceof Element && e.target.closest("button,[data-control-button]")) {
|
6988
|
+
return;
|
6989
|
+
}
|
6990
|
+
if (!containerRef.current) {
|
6991
|
+
return;
|
6992
|
+
}
|
6993
|
+
const paperRect = containerRef.current.getBoundingClientRect();
|
6994
|
+
offsetRef.current = {
|
6995
|
+
x: e.clientX - paperRect.right,
|
6996
|
+
y: e.clientY - paperRect.top
|
6997
|
+
};
|
6998
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
6999
|
+
};
|
7000
|
+
const handlePointerMove = (e) => {
|
7001
|
+
if (!e.currentTarget.hasPointerCapture(e.pointerId)) {
|
7002
|
+
return;
|
7003
|
+
}
|
7004
|
+
if (!containerRef.current || !dragContainerRef.current) {
|
7005
|
+
return;
|
7006
|
+
}
|
7007
|
+
const boxRect = dragContainerRef.current.getBoundingClientRect();
|
7008
|
+
const paperRect = containerRef.current.getBoundingClientRect();
|
7009
|
+
const rawX = e.clientX - boxRect.right - offsetRef.current.x;
|
7010
|
+
const rawY = e.clientY - boxRect.top - offsetRef.current.y;
|
7011
|
+
const maxX = boxRect.width - paperRect.width;
|
7012
|
+
const maxY = boxRect.height - paperRect.height;
|
7013
|
+
setPos({
|
7014
|
+
x: clamp(-rawX, 0, maxX),
|
7015
|
+
y: clamp(rawY, 0, maxY)
|
7016
|
+
});
|
7017
|
+
};
|
7018
|
+
const handlePointerUp = (e) => {
|
7019
|
+
e.currentTarget.releasePointerCapture(e.pointerId);
|
7020
|
+
};
|
7021
|
+
return /* @__PURE__ */ jsxDEV23(Transition5, {
|
7022
|
+
mounted,
|
7023
|
+
keepMounted: true,
|
7024
|
+
transition: "pop",
|
7025
|
+
duration: theme.transitionDurations.short,
|
7026
|
+
timingFunction: "ease",
|
7027
|
+
...componentsProps?.transition,
|
7028
|
+
children: (transitionStyle) => /* @__PURE__ */ jsxDEV23(Paper2, {
|
7029
|
+
ref: containerRef,
|
7030
|
+
pos: "absolute",
|
7031
|
+
p: gutter,
|
7032
|
+
bg: theme.transparentBackground,
|
7033
|
+
shadow: "md",
|
7034
|
+
onPointerDown: handlePointerDown,
|
7035
|
+
onPointerMove: handlePointerMove,
|
7036
|
+
onPointerUp: handlePointerUp,
|
7037
|
+
...componentsProps?.container,
|
7038
|
+
style: {
|
7039
|
+
right: pos.x,
|
7040
|
+
top: pos.y,
|
7041
|
+
...import_lodash3.merge(transitionStyle, componentsProps?.container?.style)
|
7042
|
+
},
|
7043
|
+
className: clsx_default("remoraid-controls", componentsProps?.container?.className),
|
7044
|
+
children: /* @__PURE__ */ jsxDEV23(Group4, {
|
7045
|
+
gap: gutter,
|
7046
|
+
ref: groupRef,
|
7047
|
+
wrap: "nowrap",
|
7048
|
+
...componentsProps?.group,
|
7049
|
+
className: clsx_default("remoraid-controls-group", componentsProps?.group?.className),
|
7050
|
+
children: [
|
7051
|
+
/* @__PURE__ */ jsxDEV23(IconGripHorizontal, {
|
7052
|
+
order: -100,
|
7053
|
+
color: "var(--mantine-color-default-border)",
|
7054
|
+
...import_lodash3.merge(theme.iconProps[iconSize], componentsProps?.gripIcon)
|
7055
|
+
}, undefined, false, undefined, this),
|
7056
|
+
children,
|
7057
|
+
additionalButtons && additionalButtons.map((button, i) => {
|
7058
|
+
if (isValidElementOfType(ControlButton, button)) {
|
7059
|
+
return button;
|
7060
|
+
}
|
7061
|
+
return /* @__PURE__ */ jsxDEV23(ControlButton, {
|
7062
|
+
...button
|
7063
|
+
}, i, false, undefined, this);
|
7064
|
+
})
|
7065
|
+
]
|
7066
|
+
}, undefined, true, undefined, this)
|
7067
|
+
}, undefined, false, undefined, this)
|
7068
|
+
}, undefined, false, undefined, this);
|
7069
|
+
}
|
7070
|
+
// src/core/components/Widget/WidgetWrapper/index.tsx
|
7071
|
+
import { Paper as Paper3, Transition as Transition6 } from "@mantine/core";
|
7072
|
+
import {
|
7073
|
+
useCallback as useCallback2,
|
7074
|
+
useEffect as useEffect4,
|
7075
|
+
useRef as useRef3,
|
7076
|
+
useState as useState8
|
7077
|
+
} from "react";
|
7078
|
+
import { IconX } from "@tabler/icons-react";
|
7079
|
+
|
7080
|
+
// src/core/components/Pinnable/index.tsx
|
7081
|
+
import {
|
7082
|
+
useMemo as useMemo4,
|
7083
|
+
useRef as useRef2,
|
7084
|
+
useState as useState7
|
7085
|
+
} from "react";
|
7086
|
+
import { IconPin, IconPinnedOff } from "@tabler/icons-react";
|
7087
|
+
import { Box as Box3, Portal as Portal2 } from "@mantine/core";
|
7088
|
+
import { jsxDEV as jsxDEV24 } from "react/jsx-dev-runtime";
|
7089
|
+
function Pinnable({
|
7090
|
+
layoutType: layoutTypeProp,
|
7091
|
+
section,
|
7092
|
+
initialValue = false,
|
7093
|
+
layoutId,
|
7094
|
+
controlsContainer,
|
7095
|
+
hidden = false,
|
7096
|
+
componentsProps,
|
7097
|
+
children
|
7098
|
+
}) {
|
7099
|
+
const layoutType = layoutTypeProp ?? "frame" /* Frame */;
|
7100
|
+
const { layouts } = useLayouts();
|
7101
|
+
const [pinned, setPinned] = useState7(initialValue);
|
7102
|
+
const containerRef = useRef2(null);
|
7103
|
+
const layout = layouts[layoutId ?? remoraidAppShellLayoutId];
|
7104
|
+
if (layout && layout.type !== layoutType) {
|
7105
|
+
throw new TypeError(`Prop 'layoutId' in '${Pinnable.name}' refers to a layout of type ${layout.type}, expected ${layoutType}. Leave 'layoutId' undefined, if you want to use the layout in '${AppShell_default.name}' as reference layout.`);
|
7106
|
+
}
|
7107
|
+
const controlButton = useMemo4(() => /* @__PURE__ */ jsxDEV24(ControlButton, {
|
7108
|
+
icon: pinned ? IconPinnedOff : IconPin,
|
7109
|
+
tooltip: pinned ? "Unpin" : "Pin",
|
7110
|
+
color: "green",
|
7111
|
+
order: 100,
|
7112
|
+
...componentsProps?.button,
|
7113
|
+
onClick: (e) => {
|
7114
|
+
setPinned((p) => !p);
|
7115
|
+
componentsProps?.button?.onClick?.(e);
|
7116
|
+
}
|
7117
|
+
}, undefined, false, undefined, this), [pinned, componentsProps?.button]);
|
7118
|
+
const element = /* @__PURE__ */ jsxDEV24(Box3, {
|
7119
|
+
pos: "relative",
|
7120
|
+
ref: containerRef,
|
7121
|
+
"data-hidden": hidden,
|
7122
|
+
...componentsProps?.container,
|
7123
|
+
className: clsx_default("remoraid-pinnable", componentsProps?.container?.className),
|
7124
|
+
children: [
|
7125
|
+
controlsContainer === undefined ? /* @__PURE__ */ jsxDEV24(Controls, {
|
7126
|
+
dragContainerRef: containerRef,
|
7127
|
+
...componentsProps?.controls,
|
7128
|
+
children: controlButton
|
7129
|
+
}, undefined, false, undefined, this) : controlsContainer !== null && /* @__PURE__ */ jsxDEV24(Portal2, {
|
7130
|
+
target: controlsContainer,
|
7131
|
+
children: controlButton
|
7132
|
+
}, undefined, false, undefined, this),
|
7133
|
+
children
|
7134
|
+
]
|
7135
|
+
}, undefined, true, undefined, this);
|
7136
|
+
if (!layout) {
|
7137
|
+
return null;
|
7138
|
+
}
|
7139
|
+
if (pinned && layoutType === "frame" /* Frame */) {
|
7140
|
+
return /* @__PURE__ */ jsxDEV24(FrameLayout_default.Element, {
|
7141
|
+
layoutId,
|
7142
|
+
section,
|
7143
|
+
hidden,
|
7144
|
+
...componentsProps?.layoutElement,
|
7145
|
+
children: element
|
7146
|
+
}, undefined, false, undefined, this);
|
7147
|
+
}
|
7148
|
+
return element;
|
7149
|
+
}
|
7150
|
+
|
7151
|
+
// src/core/components/Widget/WidgetWrapper/index.tsx
|
7152
|
+
var import_lodash4 = __toESM(require_lodash(), 1);
|
7153
|
+
import { jsxDEV as jsxDEV25 } from "react/jsx-dev-runtime";
|
6886
7154
|
function WidgetWrapper({
|
6887
|
-
children,
|
6888
7155
|
config,
|
6889
|
-
mt,
|
6890
|
-
withCloseButton,
|
6891
|
-
|
7156
|
+
mt = 0,
|
7157
|
+
withCloseButton = true,
|
7158
|
+
pinnableSection,
|
7159
|
+
componentsProps,
|
7160
|
+
children
|
6892
7161
|
}) {
|
6893
7162
|
const {
|
6894
7163
|
isWidgetSelected,
|
6895
7164
|
isPageRegistered,
|
6896
7165
|
isWidgetRegistered,
|
6897
7166
|
registerWidget,
|
6898
|
-
updateActiveWidget
|
7167
|
+
updateActiveWidget,
|
7168
|
+
updateWidgetSelection,
|
7169
|
+
activeWidget
|
6899
7170
|
} = useWidgets();
|
6900
7171
|
const page = usePage();
|
6901
7172
|
const theme = useRemoraidTheme();
|
7173
|
+
const mounted = page !== null && isWidgetSelected(page.pageId, config.widgetId);
|
7174
|
+
const [controlsContainer, setControlsContainer] = useState8(null);
|
7175
|
+
const [hidden, setHidden] = useState8(!mounted);
|
6902
7176
|
const pageRegistered = page ? isPageRegistered(page.pageId) : false;
|
6903
|
-
|
6904
|
-
|
6905
|
-
|
6906
|
-
|
6907
|
-
|
6908
|
-
|
6909
|
-
|
6910
|
-
|
6911
|
-
|
6912
|
-
|
7177
|
+
const containerRef = useRef3(null);
|
7178
|
+
const controlsContainerRef = useCallback2((n) => {
|
7179
|
+
setControlsContainer(n);
|
7180
|
+
}, [setControlsContainer]);
|
7181
|
+
const handleEnter = () => {
|
7182
|
+
updateActiveWidget(config.widgetId);
|
7183
|
+
};
|
7184
|
+
const handleLeave = () => {
|
7185
|
+
updateActiveWidget(null);
|
7186
|
+
};
|
7187
|
+
let element = /* @__PURE__ */ jsxDEV25(Transition6, {
|
7188
|
+
mounted,
|
6913
7189
|
transition: "fade-left",
|
6914
7190
|
duration: theme.transitionDurations.medium,
|
6915
7191
|
timingFunction: "ease",
|
6916
|
-
|
7192
|
+
...componentsProps?.transition,
|
7193
|
+
onExited: () => {
|
7194
|
+
setHidden(true);
|
7195
|
+
componentsProps?.transition?.onExited?.();
|
7196
|
+
},
|
7197
|
+
children: (transitionStyle) => /* @__PURE__ */ jsxDEV25(Paper3, {
|
7198
|
+
ref: containerRef,
|
6917
7199
|
p: "md",
|
6918
7200
|
shadow: "md",
|
6919
7201
|
bg: theme.transparentBackground,
|
6920
|
-
mt
|
7202
|
+
mt,
|
6921
7203
|
pos: "relative",
|
6922
7204
|
h: "fit-content",
|
6923
7205
|
...componentsProps?.container,
|
6924
|
-
|
6925
|
-
|
6926
|
-
|
7206
|
+
onMouseEnter: (e) => {
|
7207
|
+
if (!pinnableSection) {
|
7208
|
+
handleEnter();
|
7209
|
+
}
|
7210
|
+
componentsProps?.container?.onMouseEnter?.(e);
|
6927
7211
|
},
|
6928
|
-
onMouseLeave: () => {
|
6929
|
-
|
7212
|
+
onMouseLeave: (e) => {
|
7213
|
+
if (!pinnableSection) {
|
7214
|
+
handleLeave();
|
7215
|
+
}
|
7216
|
+
componentsProps?.container?.onMouseLeave?.(e);
|
6930
7217
|
},
|
7218
|
+
style: import_lodash4.merge(transitionStyle, componentsProps?.container?.style),
|
7219
|
+
id: config.widgetId,
|
6931
7220
|
children: [
|
6932
|
-
|
6933
|
-
|
7221
|
+
/* @__PURE__ */ jsxDEV25(Controls, {
|
7222
|
+
dragContainerRef: containerRef,
|
7223
|
+
groupRef: controlsContainerRef,
|
7224
|
+
mounted: activeWidget === config.widgetId,
|
7225
|
+
...componentsProps?.controls,
|
7226
|
+
children: /* @__PURE__ */ jsxDEV25(ControlButton, {
|
7227
|
+
mounted: withCloseButton,
|
7228
|
+
icon: IconX,
|
7229
|
+
tooltip: "Hide widget",
|
7230
|
+
color: "red",
|
7231
|
+
order: 200,
|
7232
|
+
...componentsProps?.closeButton,
|
7233
|
+
onClick: (e) => {
|
7234
|
+
if (!page) {
|
7235
|
+
return;
|
7236
|
+
}
|
7237
|
+
updateWidgetSelection(page.pageId, config.widgetId, false);
|
7238
|
+
handleLeave();
|
7239
|
+
componentsProps?.closeButton?.onClick?.(e);
|
7240
|
+
}
|
7241
|
+
}, undefined, false, undefined, this)
|
6934
7242
|
}, undefined, false, undefined, this),
|
6935
7243
|
children
|
6936
7244
|
]
|
6937
7245
|
}, undefined, true, undefined, this)
|
6938
7246
|
}, undefined, false, undefined, this);
|
7247
|
+
if (pinnableSection !== undefined) {
|
7248
|
+
element = /* @__PURE__ */ jsxDEV25(Pinnable, {
|
7249
|
+
section: pinnableSection,
|
7250
|
+
controlsContainer,
|
7251
|
+
hidden,
|
7252
|
+
...componentsProps?.Pinnable,
|
7253
|
+
componentsProps: {
|
7254
|
+
...componentsProps?.Pinnable?.componentsProps,
|
7255
|
+
container: {
|
7256
|
+
...componentsProps?.Pinnable?.componentsProps?.container,
|
7257
|
+
onMouseEnter: (e) => {
|
7258
|
+
handleEnter();
|
7259
|
+
componentsProps?.Pinnable?.componentsProps?.container?.onMouseEnter?.(e);
|
7260
|
+
},
|
7261
|
+
onMouseLeave: (e) => {
|
7262
|
+
handleLeave();
|
7263
|
+
componentsProps?.Pinnable?.componentsProps?.container?.onMouseLeave?.(e);
|
7264
|
+
}
|
7265
|
+
},
|
7266
|
+
button: {
|
7267
|
+
...componentsProps?.Pinnable?.componentsProps?.button,
|
7268
|
+
onClick: (e) => {
|
7269
|
+
handleLeave();
|
7270
|
+
componentsProps?.Pinnable?.componentsProps?.button?.onClick?.(e);
|
7271
|
+
}
|
7272
|
+
},
|
7273
|
+
layoutElement: {
|
7274
|
+
includeContainer: false,
|
7275
|
+
includePageContainer: pinnableSection === "top" /* Top */ || pinnableSection === "bottom" /* Bottom */,
|
7276
|
+
...componentsProps?.Pinnable?.componentsProps?.layoutElement
|
7277
|
+
}
|
7278
|
+
},
|
7279
|
+
children: element
|
7280
|
+
}, undefined, false, undefined, this);
|
7281
|
+
}
|
7282
|
+
useEffect4(() => {
|
7283
|
+
if (!page) {
|
7284
|
+
return;
|
7285
|
+
}
|
7286
|
+
if (!isWidgetRegistered(page.pageId, config.widgetId)) {
|
7287
|
+
registerWidget(page.pageId, config);
|
7288
|
+
}
|
7289
|
+
}, [pageRegistered]);
|
7290
|
+
useEffect4(() => {
|
7291
|
+
if (mounted) {
|
7292
|
+
const id = requestAnimationFrame(() => {
|
7293
|
+
setHidden(false);
|
7294
|
+
});
|
7295
|
+
return () => {
|
7296
|
+
cancelAnimationFrame(id);
|
7297
|
+
};
|
7298
|
+
}
|
7299
|
+
}, [mounted]);
|
7300
|
+
return element;
|
6939
7301
|
}
|
6940
|
-
var WidgetWrapper_default = Object.assign(WidgetWrapper, {
|
6941
|
-
CloseButton
|
6942
|
-
});
|
6943
7302
|
// src/core/components/Widget/index.tsx
|
6944
7303
|
import {
|
6945
7304
|
Center,
|
6946
7305
|
Divider as Divider3,
|
6947
|
-
Group as
|
7306
|
+
Group as Group5,
|
6948
7307
|
Loader,
|
6949
7308
|
Title,
|
6950
|
-
Stack as
|
7309
|
+
Stack as Stack4
|
6951
7310
|
} from "@mantine/core";
|
6952
|
-
import { jsxDEV as
|
6953
|
-
import { createElement as
|
7311
|
+
import { jsxDEV as jsxDEV26, Fragment as Fragment4 } from "react/jsx-dev-runtime";
|
7312
|
+
import { createElement as createElement3 } from "react";
|
6954
7313
|
function Widget({
|
6955
|
-
children,
|
6956
7314
|
id,
|
6957
|
-
config,
|
6958
7315
|
title,
|
7316
|
+
config,
|
6959
7317
|
badges: badgesProp,
|
6960
7318
|
buttons: buttonsProp,
|
6961
7319
|
alerts: alertsProp,
|
6962
7320
|
gaps,
|
6963
7321
|
loading,
|
6964
7322
|
mt,
|
6965
|
-
|
7323
|
+
pinnableSection,
|
7324
|
+
componentsProps,
|
7325
|
+
children
|
6966
7326
|
}) {
|
6967
7327
|
const buttons = buttonsProp?.map((button) => asElementOrPropsOfType(RemoraidButton, button, "Check the 'buttons' property of this widget."));
|
6968
7328
|
const alerts = alertsProp?.map((alert) => asElementOrPropsOfType(AlertMinimal, alert, "Check the 'alerts' property of this widget."));
|
@@ -6970,48 +7330,48 @@ function Widget({
|
|
6970
7330
|
const badgesGap = (typeof gaps === "object" ? gaps.badges : gaps) ?? "xs";
|
6971
7331
|
const buttonsGap = (typeof gaps === "object" ? gaps.buttons : gaps) ?? "xs";
|
6972
7332
|
const alertsGap = (typeof gaps === "object" ? gaps.alerts : gaps) ?? "xs";
|
6973
|
-
return /* @__PURE__ */
|
7333
|
+
return /* @__PURE__ */ jsxDEV26(WidgetWrapper, {
|
6974
7334
|
config: {
|
6975
7335
|
widgetId: id,
|
6976
|
-
|
6977
|
-
|
7336
|
+
...config,
|
7337
|
+
initialValues: {
|
7338
|
+
name: title,
|
7339
|
+
...config?.initialValues
|
7340
|
+
}
|
6978
7341
|
},
|
6979
7342
|
mt,
|
6980
|
-
componentsProps: {
|
6981
|
-
container: componentsProps?.container,
|
6982
|
-
transition: componentsProps?.transition
|
6983
|
-
},
|
6984
7343
|
...componentsProps?.wrapper,
|
7344
|
+
pinnableSection: pinnableSection ?? componentsProps?.wrapper?.pinnableSection,
|
6985
7345
|
children: [
|
6986
|
-
/* @__PURE__ */
|
7346
|
+
/* @__PURE__ */ jsxDEV26(Group5, {
|
6987
7347
|
justify: "space-between",
|
6988
7348
|
wrap: "nowrap",
|
6989
7349
|
children: [
|
6990
|
-
/* @__PURE__ */
|
7350
|
+
/* @__PURE__ */ jsxDEV26(Group5, {
|
6991
7351
|
gap: badgesGap,
|
6992
7352
|
wrap: "nowrap",
|
6993
7353
|
children: [
|
6994
|
-
/* @__PURE__ */
|
7354
|
+
/* @__PURE__ */ jsxDEV26(Title, {
|
6995
7355
|
order: 1,
|
6996
7356
|
size: "h3",
|
6997
7357
|
lineClamp: 1,
|
6998
|
-
children: title
|
7358
|
+
children: title ?? id
|
6999
7359
|
}, undefined, false, undefined, this),
|
7000
|
-
badges !== undefined && /* @__PURE__ */
|
7360
|
+
badges !== undefined && /* @__PURE__ */ jsxDEV26(BadgeGroup, {
|
7001
7361
|
badges,
|
7002
7362
|
gap: badgesGap,
|
7003
7363
|
...componentsProps?.badgeGroup
|
7004
7364
|
}, undefined, false, undefined, this)
|
7005
7365
|
]
|
7006
7366
|
}, undefined, true, undefined, this),
|
7007
|
-
/* @__PURE__ */
|
7367
|
+
/* @__PURE__ */ jsxDEV26(Group5, {
|
7008
7368
|
gap: buttonsGap,
|
7009
7369
|
wrap: "nowrap",
|
7010
7370
|
children: buttons !== undefined && buttons.map((button, i) => {
|
7011
7371
|
if (isValidElementOfType(RemoraidButton, button)) {
|
7012
7372
|
return button;
|
7013
7373
|
}
|
7014
|
-
return /* @__PURE__ */
|
7374
|
+
return /* @__PURE__ */ createElement3(RemoraidButton, {
|
7015
7375
|
...button,
|
7016
7376
|
key: i
|
7017
7377
|
});
|
@@ -7019,11 +7379,11 @@ function Widget({
|
|
7019
7379
|
}, undefined, false, undefined, this)
|
7020
7380
|
]
|
7021
7381
|
}, undefined, true, undefined, this),
|
7022
|
-
/* @__PURE__ */
|
7382
|
+
/* @__PURE__ */ jsxDEV26(Divider3, {
|
7023
7383
|
my: "md",
|
7024
7384
|
...componentsProps?.divider
|
7025
7385
|
}, undefined, false, undefined, this),
|
7026
|
-
/* @__PURE__ */
|
7386
|
+
/* @__PURE__ */ jsxDEV26(Stack4, {
|
7027
7387
|
align: "stretch",
|
7028
7388
|
gap: alertsGap,
|
7029
7389
|
mb: alerts && alerts.length > 0 ? "md" : 0,
|
@@ -7032,17 +7392,17 @@ function Widget({
|
|
7032
7392
|
if (isValidElementOfType(AlertMinimal, alert)) {
|
7033
7393
|
return alert;
|
7034
7394
|
}
|
7035
|
-
return /* @__PURE__ */
|
7395
|
+
return /* @__PURE__ */ createElement3(AlertMinimal, {
|
7036
7396
|
...alert,
|
7037
7397
|
key: i
|
7038
7398
|
});
|
7039
7399
|
})
|
7040
7400
|
}, undefined, false, undefined, this),
|
7041
|
-
loading ? /* @__PURE__ */
|
7042
|
-
children: /* @__PURE__ */
|
7401
|
+
loading ? /* @__PURE__ */ jsxDEV26(Center, {
|
7402
|
+
children: /* @__PURE__ */ jsxDEV26(Loader, {
|
7043
7403
|
...componentsProps?.loader
|
7044
7404
|
}, undefined, false, undefined, this)
|
7045
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
7405
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV26(Fragment4, {
|
7046
7406
|
children
|
7047
7407
|
}, undefined, false, undefined, this)
|
7048
7408
|
]
|
@@ -7051,7 +7411,7 @@ function Widget({
|
|
7051
7411
|
// src/core/components/NotFoundPage/index.tsx
|
7052
7412
|
import { Alert as Alert2 } from "@mantine/core";
|
7053
7413
|
import { usePathname as usePathname3 } from "next/navigation";
|
7054
|
-
import { jsxDEV as
|
7414
|
+
import { jsxDEV as jsxDEV27 } from "react/jsx-dev-runtime";
|
7055
7415
|
function NotFoundPage({
|
7056
7416
|
children,
|
7057
7417
|
message,
|
@@ -7059,11 +7419,11 @@ function NotFoundPage({
|
|
7059
7419
|
}) {
|
7060
7420
|
const pathname = usePathname3();
|
7061
7421
|
const theme = useRemoraidTheme();
|
7062
|
-
return /* @__PURE__ */
|
7422
|
+
return /* @__PURE__ */ jsxDEV27(Page, {
|
7063
7423
|
name: "Not Found",
|
7064
7424
|
...componentsProps?.page,
|
7065
7425
|
children: [
|
7066
|
-
/* @__PURE__ */
|
7426
|
+
/* @__PURE__ */ jsxDEV27(Alert2, {
|
7067
7427
|
...theme.alertProps.negative,
|
7068
7428
|
title: "404 - Page Not Found",
|
7069
7429
|
children: message ?? `Could not find page ${pathname}.`
|
@@ -7074,7 +7434,7 @@ function NotFoundPage({
|
|
7074
7434
|
}
|
7075
7435
|
// src/core/components/EnvironmentShell/index.tsx
|
7076
7436
|
import { Alert as Alert3 } from "@mantine/core";
|
7077
|
-
import { jsxDEV as
|
7437
|
+
import { jsxDEV as jsxDEV28, Fragment as Fragment5 } from "react/jsx-dev-runtime";
|
7078
7438
|
function EnvironmentShell({
|
7079
7439
|
children,
|
7080
7440
|
environment,
|
@@ -7088,7 +7448,7 @@ function EnvironmentShell({
|
|
7088
7448
|
const undefinedKeys = Object.keys(environment).filter((key) => environment[key] === undefined);
|
7089
7449
|
const alertTitle = `Please Specify Environment Variable${undefinedKeys.length > 1 ? "s" : ""}`;
|
7090
7450
|
const alertMessage = `Components could not be rendered because the following environment variables are not specified: ${undefinedKeys.join(", ")}.`;
|
7091
|
-
const alert = /* @__PURE__ */
|
7451
|
+
const alert = /* @__PURE__ */ jsxDEV28(Alert3, {
|
7092
7452
|
...theme.alertProps.neutral,
|
7093
7453
|
title: alertTitle,
|
7094
7454
|
m,
|
@@ -7096,12 +7456,12 @@ function EnvironmentShell({
|
|
7096
7456
|
children: message ?? alertMessage
|
7097
7457
|
}, undefined, false, undefined, this);
|
7098
7458
|
if (undefinedKeys.length === 0) {
|
7099
|
-
return /* @__PURE__ */
|
7459
|
+
return /* @__PURE__ */ jsxDEV28(Fragment5, {
|
7100
7460
|
children
|
7101
7461
|
}, undefined, false, undefined, this);
|
7102
7462
|
}
|
7103
7463
|
if (withContainer) {
|
7104
|
-
return /* @__PURE__ */
|
7464
|
+
return /* @__PURE__ */ jsxDEV28(PageContainer, {
|
7105
7465
|
componentsProps: { container: componentsProps?.container },
|
7106
7466
|
children: alert
|
7107
7467
|
}, undefined, false, undefined, this);
|
@@ -7114,15 +7474,15 @@ import { IconRestore } from "@tabler/icons-react";
|
|
7114
7474
|
|
7115
7475
|
// src/core/components/SettingsWidget/SaveButton/index.tsx
|
7116
7476
|
import { IconDeviceFloppy } from "@tabler/icons-react";
|
7117
|
-
import { Group as
|
7118
|
-
import { jsxDEV as
|
7477
|
+
import { Group as Group6 } from "@mantine/core";
|
7478
|
+
import { jsxDEV as jsxDEV29 } from "react/jsx-dev-runtime";
|
7119
7479
|
function SaveButton({
|
7120
7480
|
onSaveChanges,
|
7121
7481
|
insideContainer,
|
7122
7482
|
componentsProps
|
7123
7483
|
}) {
|
7124
7484
|
const settingsWidgetOptions = useSettingsWidgetContext();
|
7125
|
-
const button = /* @__PURE__ */
|
7485
|
+
const button = /* @__PURE__ */ jsxDEV29(RemoraidButton, {
|
7126
7486
|
label: "Save Changes",
|
7127
7487
|
icon: IconDeviceFloppy,
|
7128
7488
|
onClick: onSaveChanges,
|
@@ -7137,7 +7497,7 @@ function SaveButton({
|
|
7137
7497
|
}
|
7138
7498
|
}, undefined, false, undefined, this);
|
7139
7499
|
if (insideContainer !== false) {
|
7140
|
-
return /* @__PURE__ */
|
7500
|
+
return /* @__PURE__ */ jsxDEV29(Group6, {
|
7141
7501
|
w: "100%",
|
7142
7502
|
justify: "flex-end",
|
7143
7503
|
mt: "md",
|
@@ -7149,7 +7509,7 @@ function SaveButton({
|
|
7149
7509
|
}
|
7150
7510
|
|
7151
7511
|
// src/core/components/SettingsWidget/index.tsx
|
7152
|
-
import { jsxDEV as
|
7512
|
+
import { jsxDEV as jsxDEV30 } from "react/jsx-dev-runtime";
|
7153
7513
|
var defaultSettingsWidgetContext = {};
|
7154
7514
|
var settingsWidgetContext = createContext6(defaultSettingsWidgetContext);
|
7155
7515
|
var useSettingsWidgetContext = () => {
|
@@ -7162,9 +7522,9 @@ function SettingsWidget({
|
|
7162
7522
|
custom,
|
7163
7523
|
widgetProps
|
7164
7524
|
}) {
|
7165
|
-
return /* @__PURE__ */
|
7525
|
+
return /* @__PURE__ */ jsxDEV30(settingsWidgetContext.Provider, {
|
7166
7526
|
value: { custom, unsavedChanges },
|
7167
|
-
children: /* @__PURE__ */
|
7527
|
+
children: /* @__PURE__ */ jsxDEV30(Widget, {
|
7168
7528
|
title: "Settings",
|
7169
7529
|
id: "settings",
|
7170
7530
|
mt: "md",
|
@@ -7205,22 +7565,22 @@ import { Table as Table2 } from "@mantine/core";
|
|
7205
7565
|
|
7206
7566
|
// src/core/components/SettingsWidget/SettingsTable/Row/index.tsx
|
7207
7567
|
import { Table, Text as Text2 } from "@mantine/core";
|
7208
|
-
import { jsxDEV as
|
7568
|
+
import { jsxDEV as jsxDEV31 } from "react/jsx-dev-runtime";
|
7209
7569
|
function Row({
|
7210
7570
|
children,
|
7211
7571
|
label
|
7212
7572
|
}) {
|
7213
7573
|
const options = useSettingsTableOptions();
|
7214
|
-
return /* @__PURE__ */
|
7574
|
+
return /* @__PURE__ */ jsxDEV31(Table.Tr, {
|
7215
7575
|
children: [
|
7216
|
-
/* @__PURE__ */
|
7576
|
+
/* @__PURE__ */ jsxDEV31(Table.Th, {
|
7217
7577
|
w: options.leftColumnWidth,
|
7218
|
-
children: /* @__PURE__ */
|
7578
|
+
children: /* @__PURE__ */ jsxDEV31(Text2, {
|
7219
7579
|
size: "sm",
|
7220
7580
|
children: label
|
7221
7581
|
}, undefined, false, undefined, this)
|
7222
7582
|
}, undefined, false, undefined, this),
|
7223
|
-
/* @__PURE__ */
|
7583
|
+
/* @__PURE__ */ jsxDEV31(Table.Td, {
|
7224
7584
|
py: "xs",
|
7225
7585
|
children
|
7226
7586
|
}, undefined, false, undefined, this)
|
@@ -7229,7 +7589,7 @@ function Row({
|
|
7229
7589
|
}
|
7230
7590
|
|
7231
7591
|
// src/core/components/SettingsWidget/SettingsTable/index.tsx
|
7232
|
-
import { jsxDEV as
|
7592
|
+
import { jsxDEV as jsxDEV32 } from "react/jsx-dev-runtime";
|
7233
7593
|
var defaultSettingsTableOptions = {
|
7234
7594
|
leftColumnWidth: "38.2%"
|
7235
7595
|
};
|
@@ -7241,18 +7601,18 @@ function SettingsTable({
|
|
7241
7601
|
leftColumnWidth,
|
7242
7602
|
children: childrenProp
|
7243
7603
|
}) {
|
7244
|
-
const theme = useRemoraidTheme();
|
7245
7604
|
const children = asChildrenOfType(Row, childrenProp, "Check children passed to 'SettingsTable' component.");
|
7246
|
-
|
7605
|
+
const theme = useRemoraidTheme();
|
7606
|
+
return /* @__PURE__ */ jsxDEV32(settingsTableOptionsContext.Provider, {
|
7247
7607
|
value: {
|
7248
7608
|
leftColumnWidth: leftColumnWidth ?? defaultSettingsTableOptions.leftColumnWidth
|
7249
7609
|
},
|
7250
|
-
children: /* @__PURE__ */
|
7610
|
+
children: /* @__PURE__ */ jsxDEV32(Table2, {
|
7251
7611
|
bg: theme.transparentBackground,
|
7252
7612
|
withTableBorder: true,
|
7253
7613
|
variant: "vertical",
|
7254
7614
|
layout: "fixed",
|
7255
|
-
children: /* @__PURE__ */
|
7615
|
+
children: /* @__PURE__ */ jsxDEV32(Table2.Tbody, {
|
7256
7616
|
children
|
7257
7617
|
}, undefined, false, undefined, this)
|
7258
7618
|
}, undefined, false, undefined, this)
|
@@ -7262,20 +7622,21 @@ var SettingsTable_default = Object.assign(SettingsTable, {
|
|
7262
7622
|
Row
|
7263
7623
|
});
|
7264
7624
|
// src/core/components/NavbarSettingsWidget/index.tsx
|
7265
|
-
var
|
7266
|
-
import { Chip as Chip3, Group as
|
7625
|
+
var import_lodash5 = __toESM(require_lodash(), 1);
|
7626
|
+
import { Chip as Chip3, Group as Group7 } from "@mantine/core";
|
7267
7627
|
import { IconLink as IconLink2 } from "@tabler/icons-react";
|
7268
|
-
import { jsxDEV as
|
7628
|
+
import { jsxDEV as jsxDEV33 } from "react/jsx-dev-runtime";
|
7269
7629
|
var defaultNavbarSettingsWidgetId = "navbar-settings";
|
7270
7630
|
function NavbarSettingsWidget({
|
7271
|
-
additionalRows,
|
7631
|
+
additionalRows: additionalRowsProp,
|
7272
7632
|
widgetProps,
|
7273
7633
|
componentsProps
|
7274
7634
|
}) {
|
7635
|
+
const additionalRows = additionalRowsProp?.map((additionalRow) => asElementOrPropsOfType(SettingsTable_default.Row, additionalRow, "Check the 'additionalRows' property of 'NavbarSettingsWidget'."));
|
7275
7636
|
const { userExperience, updateUserExperience, initialUserExperience } = useRemoraidUserExperience();
|
7276
7637
|
const app = useRemoraidApp();
|
7277
7638
|
const theme = useRemoraidTheme();
|
7278
|
-
return /* @__PURE__ */
|
7639
|
+
return /* @__PURE__ */ jsxDEV33(SettingsWidget_default, {
|
7279
7640
|
widgetProps: {
|
7280
7641
|
id: defaultNavbarSettingsWidgetId,
|
7281
7642
|
title: "Navbar Settings",
|
@@ -7287,13 +7648,13 @@ function NavbarSettingsWidget({
|
|
7287
7648
|
navbar: initialUserExperience.navbar
|
7288
7649
|
}));
|
7289
7650
|
},
|
7290
|
-
custom: !
|
7291
|
-
children: /* @__PURE__ */
|
7651
|
+
custom: !import_lodash5.isEqual(userExperience.navbar, initialUserExperience.navbar),
|
7652
|
+
children: /* @__PURE__ */ jsxDEV33(SettingsTable_default, {
|
7292
7653
|
...componentsProps?.table,
|
7293
7654
|
children: [
|
7294
|
-
/* @__PURE__ */
|
7655
|
+
/* @__PURE__ */ jsxDEV33(SettingsTable_default.Row, {
|
7295
7656
|
label: "Select which pages you want to display or hide",
|
7296
|
-
children: /* @__PURE__ */
|
7657
|
+
children: /* @__PURE__ */ jsxDEV33(Chip3.Group, {
|
7297
7658
|
multiple: true,
|
7298
7659
|
value: app.navigablePages.filter((p) => !userExperience.navbar.hiddenPages.includes(p.href)).map((p) => p.href),
|
7299
7660
|
onChange: (newValue) => {
|
@@ -7305,12 +7666,12 @@ function NavbarSettingsWidget({
|
|
7305
7666
|
}
|
7306
7667
|
}));
|
7307
7668
|
},
|
7308
|
-
children: /* @__PURE__ */
|
7669
|
+
children: /* @__PURE__ */ jsxDEV33(Group7, {
|
7309
7670
|
justify: "flex-start",
|
7310
7671
|
gap: "xs",
|
7311
|
-
children: app.navigablePages.map((p) => ({ ...p, icon: p.icon ?? IconLink2 })).map((p, i) => /* @__PURE__ */
|
7672
|
+
children: app.navigablePages.map((p) => ({ ...p, icon: p.icon ?? IconLink2 })).map((p, i) => /* @__PURE__ */ jsxDEV33(Chip3, {
|
7312
7673
|
value: p.href,
|
7313
|
-
icon: /* @__PURE__ */
|
7674
|
+
icon: /* @__PURE__ */ jsxDEV33(p.icon, {
|
7314
7675
|
...theme.iconProps.tiny,
|
7315
7676
|
color: theme.primaryColor
|
7316
7677
|
}, undefined, false, undefined, this),
|
@@ -7324,7 +7685,7 @@ function NavbarSettingsWidget({
|
|
7324
7685
|
if (isValidElementOfType(SettingsTable_default.Row, row)) {
|
7325
7686
|
return row;
|
7326
7687
|
}
|
7327
|
-
return /* @__PURE__ */
|
7688
|
+
return /* @__PURE__ */ jsxDEV33(SettingsTable_default.Row, {
|
7328
7689
|
...row
|
7329
7690
|
}, i, false, undefined, this);
|
7330
7691
|
})
|
@@ -7334,7 +7695,7 @@ function NavbarSettingsWidget({
|
|
7334
7695
|
}
|
7335
7696
|
// src/core/components/ContextClusterProvider/index.tsx
|
7336
7697
|
import React8 from "react";
|
7337
|
-
import { jsxDEV as
|
7698
|
+
import { jsxDEV as jsxDEV34 } from "react/jsx-dev-runtime";
|
7338
7699
|
var createContextCluster = (generalDefaultValue, staticIds) => {
|
7339
7700
|
const isStaticId = (id) => {
|
7340
7701
|
if (staticIds?.find((staticId) => staticId === id)) {
|
@@ -7369,13 +7730,14 @@ function ContextClusterProvider({
|
|
7369
7730
|
values = {},
|
7370
7731
|
children
|
7371
7732
|
}) {
|
7372
|
-
return Object.entries(cluster.contexts).reduceRight((t, [id, context]) => /* @__PURE__ */
|
7733
|
+
return Object.entries(cluster.contexts).reduceRight((t, [id, context]) => context ? /* @__PURE__ */ jsxDEV34(context.Provider, {
|
7373
7734
|
value: values[id] ?? cluster.defaultValues[id] ?? cluster.generalDefaultValue,
|
7374
7735
|
children: t
|
7375
|
-
}, undefined, false, undefined, this), children);
|
7736
|
+
}, undefined, false, undefined, this) : t, children);
|
7376
7737
|
}
|
7377
7738
|
export {
|
7378
7739
|
useWidgets,
|
7740
|
+
useWidget,
|
7379
7741
|
useSettingsWidgetContext as useSettingsWidgetOptions,
|
7380
7742
|
useSettingsTableOptions,
|
7381
7743
|
useRemoraidUserExperience,
|
@@ -7386,18 +7748,17 @@ export {
|
|
7386
7748
|
useHydrationStatus,
|
7387
7749
|
useHydratedMantineColorScheme,
|
7388
7750
|
useFrameLayout,
|
7751
|
+
remoraidAppShellLayoutId,
|
7389
7752
|
isValidElementOfType,
|
7390
|
-
isFrameLayout,
|
7391
7753
|
getElementTypeName,
|
7754
|
+
getDefaultWidgetContext,
|
7392
7755
|
defaultUserExperienceCookieName,
|
7393
7756
|
defaultUserExperience,
|
7394
7757
|
defaultSettingsWidgetContext as defaultSettingsWidgetOptions,
|
7395
7758
|
defaultSettingsTableOptions,
|
7396
7759
|
defaultNavbarSettingsWidgetId,
|
7397
7760
|
defaultLayoutsContext,
|
7398
|
-
defaultFrameLayoutContext,
|
7399
7761
|
defaultAppShellNavbarPositions,
|
7400
|
-
defaultAppShellLayoutId,
|
7401
7762
|
defaultAppShellFooterPositions,
|
7402
7763
|
defaultAppContext,
|
7403
7764
|
createUserExperienceContext,
|
@@ -7407,7 +7768,7 @@ export {
|
|
7407
7768
|
asElementOrPropsOfType,
|
7408
7769
|
asElementOfType,
|
7409
7770
|
asChildrenOfType,
|
7410
|
-
|
7771
|
+
WidgetWrapper,
|
7411
7772
|
WidgetSelectionHeader,
|
7412
7773
|
Widget,
|
7413
7774
|
UserExperienceProviderWrapper,
|
@@ -7419,6 +7780,7 @@ export {
|
|
7419
7780
|
RemoraidIconSize,
|
7420
7781
|
RemoraidButton,
|
7421
7782
|
RemoraidBreakpoint,
|
7783
|
+
Pinnable,
|
7422
7784
|
PageContainer,
|
7423
7785
|
Page,
|
7424
7786
|
NotFoundPage,
|
@@ -7426,11 +7788,12 @@ export {
|
|
7426
7788
|
NavbarSettingsWidget,
|
7427
7789
|
LayoutType,
|
7428
7790
|
HydrationStatusProvider,
|
7429
|
-
FrameLayoutVariant,
|
7430
7791
|
FrameLayoutSection,
|
7431
7792
|
FrameLayout_default as FrameLayout,
|
7432
7793
|
FooterVariant,
|
7433
7794
|
EnvironmentShell,
|
7795
|
+
Controls,
|
7796
|
+
ControlButton,
|
7434
7797
|
ContextClusterProvider,
|
7435
7798
|
BadgeMinimal,
|
7436
7799
|
BadgeGroup,
|