remoraid 2.14.7 → 2.18.43
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 +780 -439
- package/dist/core/index.d.ts +230 -175
- package/dist/core/index.js +779 -424
- package/dist/core/styles.css +49 -5
- package/dist/server/index.d.ts +5 -5
- package/package.json +2 -1
package/dist/core/index.cjs
CHANGED
@@ -725,7 +725,7 @@ var require_lodash = __commonJS((exports2, module2) => {
|
|
725
725
|
}
|
726
726
|
var runInContext = function runInContext(context) {
|
727
727
|
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
|
728
|
-
var { Array: Array2, Date, Error: Error2, Function: Function2, Math, Object: Object2, RegExp: RegExp2, String, TypeError: TypeError2 } = context;
|
728
|
+
var { Array: Array2, Date, Error: Error2, Function: Function2, Math: Math2, Object: Object2, RegExp: RegExp2, String, TypeError: TypeError2 } = context;
|
729
729
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
730
730
|
var coreJsData = context["__core-js_shared__"];
|
731
731
|
var funcToString = funcProto.toString;
|
@@ -748,7 +748,7 @@ var require_lodash = __commonJS((exports2, module2) => {
|
|
748
748
|
} catch (e) {}
|
749
749
|
}();
|
750
750
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
|
751
|
-
var { ceil: nativeCeil, floor: nativeFloor } =
|
751
|
+
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;
|
752
752
|
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");
|
753
753
|
var metaMap = WeakMap2 && new WeakMap2;
|
754
754
|
var realNames = {};
|
@@ -1001,7 +1001,7 @@ var require_lodash = __commonJS((exports2, module2) => {
|
|
1001
1001
|
}
|
1002
1002
|
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
1003
1003
|
SetCache.prototype.has = setCacheHas;
|
1004
|
-
function
|
1004
|
+
function Stack2(entries) {
|
1005
1005
|
var data = this.__data__ = new ListCache(entries);
|
1006
1006
|
this.size = data.size;
|
1007
1007
|
}
|
@@ -1035,11 +1035,11 @@ var require_lodash = __commonJS((exports2, module2) => {
|
|
1035
1035
|
this.size = data.size;
|
1036
1036
|
return this;
|
1037
1037
|
}
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1038
|
+
Stack2.prototype.clear = stackClear;
|
1039
|
+
Stack2.prototype["delete"] = stackDelete;
|
1040
|
+
Stack2.prototype.get = stackGet;
|
1041
|
+
Stack2.prototype.has = stackHas;
|
1042
|
+
Stack2.prototype.set = stackSet;
|
1043
1043
|
function arrayLikeKeys(value, inherited) {
|
1044
1044
|
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;
|
1045
1045
|
for (var key in value) {
|
@@ -1155,7 +1155,7 @@ var require_lodash = __commonJS((exports2, module2) => {
|
|
1155
1155
|
result2 = initCloneByTag(value, tag, isDeep);
|
1156
1156
|
}
|
1157
1157
|
}
|
1158
|
-
stack || (stack = new
|
1158
|
+
stack || (stack = new Stack2);
|
1159
1159
|
var stacked = stack.get(value);
|
1160
1160
|
if (stacked) {
|
1161
1161
|
return stacked;
|
@@ -1424,21 +1424,21 @@ var require_lodash = __commonJS((exports2, module2) => {
|
|
1424
1424
|
objIsObj = false;
|
1425
1425
|
}
|
1426
1426
|
if (isSameTag && !objIsObj) {
|
1427
|
-
stack || (stack = new
|
1427
|
+
stack || (stack = new Stack2);
|
1428
1428
|
return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
1429
1429
|
}
|
1430
1430
|
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
1431
1431
|
var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
|
1432
1432
|
if (objIsWrapped || othIsWrapped) {
|
1433
1433
|
var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
|
1434
|
-
stack || (stack = new
|
1434
|
+
stack || (stack = new Stack2);
|
1435
1435
|
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
1436
1436
|
}
|
1437
1437
|
}
|
1438
1438
|
if (!isSameTag) {
|
1439
1439
|
return false;
|
1440
1440
|
}
|
1441
|
-
stack || (stack = new
|
1441
|
+
stack || (stack = new Stack2);
|
1442
1442
|
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
1443
1443
|
}
|
1444
1444
|
function baseIsMap(value) {
|
@@ -1464,7 +1464,7 @@ var require_lodash = __commonJS((exports2, module2) => {
|
|
1464
1464
|
return false;
|
1465
1465
|
}
|
1466
1466
|
} else {
|
1467
|
-
var stack = new
|
1467
|
+
var stack = new Stack2;
|
1468
1468
|
if (customizer) {
|
1469
1469
|
var result2 = customizer(objValue, srcValue, key, object, source, stack);
|
1470
1470
|
}
|
@@ -1560,7 +1560,7 @@ var require_lodash = __commonJS((exports2, module2) => {
|
|
1560
1560
|
return;
|
1561
1561
|
}
|
1562
1562
|
baseFor(source, function(srcValue, key) {
|
1563
|
-
stack || (stack = new
|
1563
|
+
stack || (stack = new Stack2);
|
1564
1564
|
if (isObject(srcValue)) {
|
1565
1565
|
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
1566
1566
|
} else {
|
@@ -2429,7 +2429,7 @@ var require_lodash = __commonJS((exports2, module2) => {
|
|
2429
2429
|
return setWrapToString(result2, func, bitmask);
|
2430
2430
|
}
|
2431
2431
|
function createRound(methodName) {
|
2432
|
-
var func =
|
2432
|
+
var func = Math2[methodName];
|
2433
2433
|
return function(number, precision) {
|
2434
2434
|
number = toNumber(number);
|
2435
2435
|
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
|
@@ -5461,6 +5461,7 @@ __p += '`;
|
|
5461
5461
|
var exports_core = {};
|
5462
5462
|
__export(exports_core, {
|
5463
5463
|
useWidgets: () => useWidgets,
|
5464
|
+
useWidget: () => useWidget,
|
5464
5465
|
useSettingsWidgetOptions: () => useSettingsWidgetContext,
|
5465
5466
|
useSettingsTableOptions: () => useSettingsTableOptions,
|
5466
5467
|
useRemoraidUserExperience: () => useRemoraidUserExperience,
|
@@ -5471,18 +5472,17 @@ __export(exports_core, {
|
|
5471
5472
|
useHydrationStatus: () => useHydrationStatus,
|
5472
5473
|
useHydratedMantineColorScheme: () => useHydratedMantineColorScheme,
|
5473
5474
|
useFrameLayout: () => useFrameLayout,
|
5475
|
+
remoraidAppShellLayoutId: () => remoraidAppShellLayoutId,
|
5474
5476
|
isValidElementOfType: () => isValidElementOfType,
|
5475
|
-
isFrameLayout: () => isFrameLayout,
|
5476
5477
|
getElementTypeName: () => getElementTypeName,
|
5478
|
+
getDefaultWidgetContext: () => getDefaultWidgetContext,
|
5477
5479
|
defaultUserExperienceCookieName: () => defaultUserExperienceCookieName,
|
5478
5480
|
defaultUserExperience: () => defaultUserExperience,
|
5479
5481
|
defaultSettingsWidgetOptions: () => defaultSettingsWidgetContext,
|
5480
5482
|
defaultSettingsTableOptions: () => defaultSettingsTableOptions,
|
5481
5483
|
defaultNavbarSettingsWidgetId: () => defaultNavbarSettingsWidgetId,
|
5482
5484
|
defaultLayoutsContext: () => defaultLayoutsContext,
|
5483
|
-
defaultFrameLayoutContext: () => defaultFrameLayoutContext,
|
5484
5485
|
defaultAppShellNavbarPositions: () => defaultAppShellNavbarPositions,
|
5485
|
-
defaultAppShellLayoutId: () => defaultAppShellLayoutId,
|
5486
5486
|
defaultAppShellFooterPositions: () => defaultAppShellFooterPositions,
|
5487
5487
|
defaultAppContext: () => defaultAppContext,
|
5488
5488
|
createUserExperienceContext: () => createUserExperienceContext,
|
@@ -5492,7 +5492,7 @@ __export(exports_core, {
|
|
5492
5492
|
asElementOrPropsOfType: () => asElementOrPropsOfType,
|
5493
5493
|
asElementOfType: () => asElementOfType,
|
5494
5494
|
asChildrenOfType: () => asChildrenOfType,
|
5495
|
-
WidgetWrapper: () =>
|
5495
|
+
WidgetWrapper: () => WidgetWrapper,
|
5496
5496
|
WidgetSelectionHeader: () => WidgetSelectionHeader,
|
5497
5497
|
Widget: () => Widget,
|
5498
5498
|
UserExperienceProviderWrapper: () => UserExperienceProviderWrapper,
|
@@ -5504,6 +5504,7 @@ __export(exports_core, {
|
|
5504
5504
|
RemoraidIconSize: () => RemoraidIconSize,
|
5505
5505
|
RemoraidButton: () => RemoraidButton,
|
5506
5506
|
RemoraidBreakpoint: () => RemoraidBreakpoint,
|
5507
|
+
Pinnable: () => Pinnable,
|
5507
5508
|
PageContainer: () => PageContainer,
|
5508
5509
|
Page: () => Page,
|
5509
5510
|
NotFoundPage: () => NotFoundPage,
|
@@ -5511,11 +5512,12 @@ __export(exports_core, {
|
|
5511
5512
|
NavbarSettingsWidget: () => NavbarSettingsWidget,
|
5512
5513
|
LayoutType: () => LayoutType,
|
5513
5514
|
HydrationStatusProvider: () => HydrationStatusProvider,
|
5514
|
-
FrameLayoutVariant: () => FrameLayoutVariant,
|
5515
5515
|
FrameLayoutSection: () => FrameLayoutSection,
|
5516
5516
|
FrameLayout: () => FrameLayout_default,
|
5517
5517
|
FooterVariant: () => FooterVariant,
|
5518
5518
|
EnvironmentShell: () => EnvironmentShell,
|
5519
|
+
Controls: () => Controls,
|
5520
|
+
ControlButton: () => ControlButton,
|
5519
5521
|
ContextClusterProvider: () => ContextClusterProvider,
|
5520
5522
|
BadgeMinimal: () => BadgeMinimal,
|
5521
5523
|
BadgeGroup: () => BadgeGroup,
|
@@ -5529,6 +5531,11 @@ module.exports = __toCommonJS(exports_core);
|
|
5529
5531
|
// src/core/components/RemoraidProvider/WidgetsProvider/index.tsx
|
5530
5532
|
var import_react = __toESM(require("react"));
|
5531
5533
|
var jsx_dev_runtime = require("react/jsx-dev-runtime");
|
5534
|
+
var getDefaultWidgetContext = (configuration) => ({
|
5535
|
+
name: configuration.widgetId,
|
5536
|
+
selected: true,
|
5537
|
+
...configuration.initialValues
|
5538
|
+
});
|
5532
5539
|
var widgetsContext = import_react.default.createContext({
|
5533
5540
|
widgets: {},
|
5534
5541
|
activeWidget: null,
|
@@ -5544,6 +5551,10 @@ var widgetsContext = import_react.default.createContext({
|
|
5544
5551
|
var useWidgets = () => {
|
5545
5552
|
return import_react.useContext(widgetsContext);
|
5546
5553
|
};
|
5554
|
+
var useWidget = (pageId, widgetId) => {
|
5555
|
+
const { widgets } = useWidgets();
|
5556
|
+
return widgets?.[pageId]?.[widgetId] ?? null;
|
5557
|
+
};
|
5547
5558
|
function WidgetsProvider({
|
5548
5559
|
children
|
5549
5560
|
}) {
|
@@ -5589,13 +5600,10 @@ function WidgetsProvider({
|
|
5589
5600
|
const registerPage = (pageId, initialWidgets) => {
|
5590
5601
|
setWidgets((prev) => ({
|
5591
5602
|
...prev,
|
5592
|
-
[pageId]: initialWidgets.reduce((t,
|
5603
|
+
[pageId]: initialWidgets.reduce((t, widget) => {
|
5593
5604
|
return {
|
5594
5605
|
...t,
|
5595
|
-
[
|
5596
|
-
name: w.name,
|
5597
|
-
selected: w.initialValue === undefined ? true : w.initialValue
|
5598
|
-
}
|
5606
|
+
[widget.widgetId]: getDefaultWidgetContext(widget)
|
5599
5607
|
};
|
5600
5608
|
}, {})
|
5601
5609
|
}));
|
@@ -5619,10 +5627,7 @@ function WidgetsProvider({
|
|
5619
5627
|
...prev,
|
5620
5628
|
[pageId]: {
|
5621
5629
|
...prev[pageId],
|
5622
|
-
[widget.widgetId]:
|
5623
|
-
name: widget.name,
|
5624
|
-
selected: widget.initialValue === undefined ? true : widget.initialValue
|
5625
|
-
}
|
5630
|
+
[widget.widgetId]: getDefaultWidgetContext(widget)
|
5626
5631
|
}
|
5627
5632
|
}));
|
5628
5633
|
};
|
@@ -5701,11 +5706,6 @@ var FrameLayoutSection;
|
|
5701
5706
|
FrameLayoutSection2["Right"] = "right";
|
5702
5707
|
FrameLayoutSection2["Content"] = "content";
|
5703
5708
|
})(FrameLayoutSection ||= {});
|
5704
|
-
var FrameLayoutVariant;
|
5705
|
-
((FrameLayoutVariant2) => {
|
5706
|
-
FrameLayoutVariant2["Plain"] = "plain";
|
5707
|
-
FrameLayoutVariant2["Sticky"] = "sticky";
|
5708
|
-
})(FrameLayoutVariant ||= {});
|
5709
5709
|
|
5710
5710
|
// src/core/lib/utils.ts
|
5711
5711
|
var import_react2 = require("react");
|
@@ -6047,7 +6047,7 @@ function RemoraidProvider({
|
|
6047
6047
|
}, undefined, false, undefined, this);
|
6048
6048
|
}
|
6049
6049
|
// src/core/components/AppShell/index.tsx
|
6050
|
-
var
|
6050
|
+
var import_core8 = require("@mantine/core");
|
6051
6051
|
|
6052
6052
|
// src/core/components/AppShell/NavbarMinimal/index.tsx
|
6053
6053
|
var import_core3 = require("@mantine/core");
|
@@ -6253,7 +6253,6 @@ function FooterMinimal({
|
|
6253
6253
|
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_core4.Group, {
|
6254
6254
|
justify: "center",
|
6255
6255
|
w: "100%",
|
6256
|
-
py: "md",
|
6257
6256
|
...componentsProps?.container,
|
6258
6257
|
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_icons_react3.IconPennant, {
|
6259
6258
|
size: 50,
|
@@ -6264,274 +6263,318 @@ function FooterMinimal({
|
|
6264
6263
|
}
|
6265
6264
|
|
6266
6265
|
// src/core/components/FrameLayout/index.tsx
|
6267
|
-
var
|
6266
|
+
var import_core7 = require("@mantine/core");
|
6268
6267
|
var import_react10 = require("react");
|
6269
6268
|
|
6270
6269
|
// src/core/components/FrameLayout/Element/index.tsx
|
6270
|
+
var import_core6 = require("@mantine/core");
|
6271
|
+
|
6272
|
+
// src/core/lib/errors.ts
|
6273
|
+
class InvalidComponentUsageError extends Error {
|
6274
|
+
constructor(component, rule) {
|
6275
|
+
super(`Invalid usage of '${component}': ${rule}`);
|
6276
|
+
this.name = "InvalidComponentUsageError";
|
6277
|
+
}
|
6278
|
+
}
|
6279
|
+
|
6280
|
+
// src/core/components/Page/PageContainer/index.tsx
|
6271
6281
|
var import_core5 = require("@mantine/core");
|
6282
|
+
|
6283
|
+
// node_modules/clsx/dist/clsx.mjs
|
6284
|
+
function r(e) {
|
6285
|
+
var t, f, n = "";
|
6286
|
+
if (typeof e == "string" || typeof e == "number")
|
6287
|
+
n += e;
|
6288
|
+
else if (typeof e == "object")
|
6289
|
+
if (Array.isArray(e)) {
|
6290
|
+
var o = e.length;
|
6291
|
+
for (t = 0;t < o; t++)
|
6292
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
6293
|
+
} else
|
6294
|
+
for (f in e)
|
6295
|
+
e[f] && (n && (n += " "), n += f);
|
6296
|
+
return n;
|
6297
|
+
}
|
6298
|
+
function clsx() {
|
6299
|
+
for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
|
6300
|
+
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
6301
|
+
return n;
|
6302
|
+
}
|
6303
|
+
var clsx_default = clsx;
|
6304
|
+
|
6305
|
+
// src/core/components/Page/PageContainer/index.tsx
|
6272
6306
|
var jsx_dev_runtime11 = require("react/jsx-dev-runtime");
|
6273
|
-
function
|
6307
|
+
function PageContainer({
|
6308
|
+
children,
|
6309
|
+
p = 0,
|
6310
|
+
hidden = false,
|
6311
|
+
componentsProps
|
6312
|
+
}) {
|
6313
|
+
const theme = useRemoraidTheme();
|
6314
|
+
return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(import_core5.Container, {
|
6315
|
+
size: theme.containerSize,
|
6316
|
+
p,
|
6317
|
+
w: "100%",
|
6318
|
+
"data-hidden": hidden,
|
6319
|
+
...componentsProps?.container,
|
6320
|
+
className: clsx_default("remoraid-page-container", componentsProps?.container?.className),
|
6321
|
+
children
|
6322
|
+
}, undefined, false, undefined, this);
|
6323
|
+
}
|
6324
|
+
|
6325
|
+
// src/core/components/FrameLayout/Element/index.tsx
|
6326
|
+
var import_lodash = __toESM(require_lodash());
|
6327
|
+
var jsx_dev_runtime12 = require("react/jsx-dev-runtime");
|
6328
|
+
function Element2({
|
6274
6329
|
section,
|
6275
6330
|
includeContainer = true,
|
6331
|
+
includePageContainer = false,
|
6276
6332
|
layoutId,
|
6333
|
+
hidden = false,
|
6277
6334
|
componentsProps,
|
6278
6335
|
children
|
6279
6336
|
}) {
|
6280
6337
|
const { layouts } = useLayouts();
|
6281
6338
|
const closestLayout = useFrameLayout();
|
6282
|
-
if (closestLayout
|
6283
|
-
|
6339
|
+
if (!closestLayout) {
|
6340
|
+
throw new InvalidComponentUsageError("FrameLayout.Element", "must be used as child of 'FrameLayout'.");
|
6284
6341
|
}
|
6285
6342
|
const layout = layouts[layoutId ?? closestLayout.layoutId];
|
6286
|
-
if (!
|
6343
|
+
if (!layout) {
|
6287
6344
|
return null;
|
6288
6345
|
}
|
6289
|
-
if (layout.
|
6346
|
+
if (layout.type !== "frame" /* Frame */) {
|
6347
|
+
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.");
|
6348
|
+
}
|
6349
|
+
if (!layout.sections[section]) {
|
6290
6350
|
return null;
|
6291
6351
|
}
|
6292
6352
|
let containerProps = {};
|
6293
6353
|
if (section === "left" /* Left */ || section === "right" /* Right */) {
|
6294
6354
|
containerProps.h = "100%";
|
6295
6355
|
}
|
6296
|
-
|
6356
|
+
const element = includePageContainer ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(PageContainer, {
|
6357
|
+
p: 0,
|
6358
|
+
hidden,
|
6359
|
+
...componentsProps?.PageContainer,
|
6360
|
+
children
|
6361
|
+
}, undefined, false, undefined, this) : children;
|
6362
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Portal, {
|
6297
6363
|
target: layout.sections[section],
|
6298
|
-
children: includeContainer ? /* @__PURE__ */
|
6299
|
-
|
6300
|
-
...componentsProps?.container,
|
6301
|
-
|
6302
|
-
|
6364
|
+
children: includeContainer ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Box, {
|
6365
|
+
"data-hidden": hidden,
|
6366
|
+
...import_lodash.merge(containerProps, componentsProps?.container),
|
6367
|
+
className: clsx_default("remoraid-frame-layout-element", containerProps?.className, componentsProps?.container?.className),
|
6368
|
+
children: element
|
6369
|
+
}, undefined, false, undefined, this) : element
|
6303
6370
|
}, undefined, false, undefined, this);
|
6304
6371
|
}
|
6305
6372
|
|
6306
6373
|
// src/core/components/FrameLayout/index.tsx
|
6307
|
-
var
|
6308
|
-
var
|
6309
|
-
if (typeof layout !== "object" || layout === null) {
|
6310
|
-
return false;
|
6311
|
-
}
|
6312
|
-
if (!("sections" in layout)) {
|
6313
|
-
return false;
|
6314
|
-
}
|
6315
|
-
if (typeof layout.sections !== "object" || layout.sections === null) {
|
6316
|
-
return false;
|
6317
|
-
}
|
6318
|
-
return true;
|
6319
|
-
};
|
6320
|
-
var defaultFrameLayoutVariant = "sticky" /* Sticky */;
|
6321
|
-
var defaultFrameLayoutContext = {
|
6322
|
-
layoutId: null,
|
6323
|
-
layout: {
|
6324
|
-
sections: {
|
6325
|
-
["top" /* Top */]: null,
|
6326
|
-
["bottom" /* Bottom */]: null,
|
6327
|
-
["left" /* Left */]: null,
|
6328
|
-
["right" /* Right */]: null
|
6329
|
-
}
|
6330
|
-
},
|
6331
|
-
setLayout: () => {}
|
6332
|
-
};
|
6333
|
-
var layoutContext = import_react10.createContext(defaultFrameLayoutContext);
|
6374
|
+
var jsx_dev_runtime13 = require("react/jsx-dev-runtime");
|
6375
|
+
var layoutContext = import_react10.createContext(null);
|
6334
6376
|
var useFrameLayout = () => {
|
6335
6377
|
return import_react10.useContext(layoutContext);
|
6336
6378
|
};
|
6337
6379
|
function FrameLayout({
|
6338
|
-
variant = defaultFrameLayoutVariant,
|
6339
6380
|
layoutId,
|
6381
|
+
includeScrollArea = true,
|
6382
|
+
gutter = 0,
|
6340
6383
|
componentsProps,
|
6341
6384
|
children
|
6342
6385
|
}) {
|
6343
6386
|
const theme = useRemoraidTheme();
|
6344
6387
|
const { layouts, setLayouts } = useLayouts();
|
6345
6388
|
const layout = layouts[layoutId];
|
6346
|
-
const
|
6347
|
-
|
6348
|
-
|
6349
|
-
|
6350
|
-
|
6351
|
-
|
6352
|
-
|
6353
|
-
|
6354
|
-
|
6355
|
-
|
6389
|
+
const defaultSections = import_react10.useMemo(() => ({
|
6390
|
+
["bottom" /* Bottom */]: null,
|
6391
|
+
["right" /* Right */]: null,
|
6392
|
+
["top" /* Top */]: null,
|
6393
|
+
["left" /* Left */]: null,
|
6394
|
+
["content" /* Content */]: null
|
6395
|
+
}), []);
|
6396
|
+
const setSections = import_react10.useCallback((value) => {
|
6397
|
+
setLayouts((prev) => ({
|
6398
|
+
...prev,
|
6399
|
+
[layoutId]: {
|
6400
|
+
type: "frame" /* Frame */,
|
6401
|
+
sections: typeof value === "function" ? value(prev[layoutId]?.sections ?? defaultSections) : value
|
6402
|
+
}
|
6403
|
+
}));
|
6404
|
+
}, [layoutId, setLayouts, defaultSections]);
|
6405
|
+
const topSectionRef = import_react10.useCallback((n) => {
|
6406
|
+
setSections((prev) => ({
|
6407
|
+
...prev,
|
6408
|
+
["top" /* Top */]: n
|
6409
|
+
}));
|
6410
|
+
}, [setSections]);
|
6411
|
+
const bottomSectionRef = import_react10.useCallback((n) => {
|
6412
|
+
setSections((prev) => ({
|
6356
6413
|
...prev,
|
6357
|
-
|
6414
|
+
["bottom" /* Bottom */]: n
|
6358
6415
|
}));
|
6359
|
-
}, [
|
6360
|
-
const
|
6361
|
-
|
6416
|
+
}, [setSections]);
|
6417
|
+
const leftSectionRef = import_react10.useCallback((n) => {
|
6418
|
+
setSections((prev) => ({
|
6362
6419
|
...prev,
|
6363
|
-
|
6420
|
+
["left" /* Left */]: n
|
6364
6421
|
}));
|
6365
|
-
}, [
|
6366
|
-
const
|
6367
|
-
|
6422
|
+
}, [setSections]);
|
6423
|
+
const rightSectionRef = import_react10.useCallback((n) => {
|
6424
|
+
setSections((prev) => ({
|
6368
6425
|
...prev,
|
6369
|
-
|
6426
|
+
["right" /* Right */]: n
|
6370
6427
|
}));
|
6371
|
-
}, [
|
6372
|
-
const
|
6373
|
-
|
6428
|
+
}, [setSections]);
|
6429
|
+
const contentSectionRef = import_react10.useCallback((n) => {
|
6430
|
+
setSections((prev) => ({
|
6374
6431
|
...prev,
|
6375
|
-
|
6432
|
+
["content" /* Content */]: n
|
6376
6433
|
}));
|
6377
|
-
}, [
|
6378
|
-
|
6379
|
-
|
6434
|
+
}, [setSections]);
|
6435
|
+
const contentSection = /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_core7.Stack, {
|
6436
|
+
ref: contentSectionRef,
|
6437
|
+
h: "100%",
|
6438
|
+
gap: gutter,
|
6380
6439
|
flex: 1,
|
6381
|
-
...componentsProps?.
|
6382
|
-
|
6383
|
-
|
6384
|
-
|
6385
|
-
|
6386
|
-
|
6387
|
-
|
6388
|
-
|
6389
|
-
|
6390
|
-
|
6391
|
-
|
6392
|
-
|
6393
|
-
|
6394
|
-
}
|
6395
|
-
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(layoutContext.Provider, {
|
6396
|
-
value: { layoutId, layout, setLayout },
|
6397
|
-
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Group, {
|
6440
|
+
...componentsProps?.sectionContainers?.["content" /* Content */],
|
6441
|
+
className: clsx_default("remoraid-frame-layout-section", "remoraid-frame-layout-content-section", componentsProps?.sectionContainers?.["content" /* Content */]?.className),
|
6442
|
+
children
|
6443
|
+
}, undefined, false, undefined, this);
|
6444
|
+
const layoutContextValue = import_react10.useMemo(() => ({
|
6445
|
+
type: "frame" /* Frame */,
|
6446
|
+
sections: defaultSections,
|
6447
|
+
...layout,
|
6448
|
+
layoutId
|
6449
|
+
}), [layout?.sections, defaultSections, layoutId]);
|
6450
|
+
return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(layoutContext.Provider, {
|
6451
|
+
value: layoutContextValue,
|
6452
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_core7.Group, {
|
6398
6453
|
gap: 0,
|
6399
6454
|
h: "100%",
|
6400
6455
|
w: "100%",
|
6401
6456
|
wrap: "nowrap",
|
6402
6457
|
...componentsProps?.horizontalContainer,
|
6458
|
+
style: {
|
6459
|
+
"--remoraid-frame-layout-gutter": typeof gutter === "string" ? `var(--mantine-spacing-${gutter})` : `${gutter}px`
|
6460
|
+
},
|
6461
|
+
className: clsx_default("remoraid-frame-layout", componentsProps?.horizontalContainer?.className),
|
6403
6462
|
children: [
|
6404
|
-
/* @__PURE__ */
|
6405
|
-
ref:
|
6463
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_core7.Group, {
|
6464
|
+
ref: leftSectionRef,
|
6406
6465
|
h: "100%",
|
6407
|
-
gap: 0,
|
6408
6466
|
wrap: "nowrap",
|
6409
|
-
|
6467
|
+
gap: gutter,
|
6468
|
+
pr: 0,
|
6469
|
+
...componentsProps?.sectionContainers?.["left" /* Left */],
|
6470
|
+
className: clsx_default("remoraid-frame-layout-section", componentsProps?.sectionContainers?.["left" /* Left */]?.className)
|
6410
6471
|
}, undefined, false, undefined, this),
|
6411
|
-
/* @__PURE__ */
|
6472
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_core7.Stack, {
|
6412
6473
|
h: "100%",
|
6413
6474
|
flex: 1,
|
6414
6475
|
gap: 0,
|
6415
6476
|
...componentsProps?.verticalContainer,
|
6477
|
+
className: clsx_default("remoraid-frame-layout-vertical-container", componentsProps?.verticalContainer?.className),
|
6416
6478
|
children: [
|
6417
|
-
/* @__PURE__ */
|
6418
|
-
|
6419
|
-
|
6420
|
-
gap: 0,
|
6479
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_core7.Stack, {
|
6480
|
+
ref: topSectionRef,
|
6481
|
+
gap: gutter,
|
6421
6482
|
flex: 0,
|
6422
|
-
...componentsProps?.sectionContainers?.["top" /* Top */]
|
6483
|
+
...componentsProps?.sectionContainers?.["top" /* Top */],
|
6484
|
+
className: clsx_default("remoraid-frame-layout-section", "remoraid-frame-layout-top-section", componentsProps?.sectionContainers?.["top" /* Top */]?.className)
|
6423
6485
|
}, undefined, false, undefined, this),
|
6424
|
-
|
6425
|
-
|
6426
|
-
|
6427
|
-
|
6428
|
-
|
6486
|
+
includeScrollArea ? /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_core7.ScrollArea, {
|
6487
|
+
flex: 1,
|
6488
|
+
...theme.scrollAreaProps,
|
6489
|
+
...componentsProps?.ScrollArea,
|
6490
|
+
children: contentSection
|
6491
|
+
}, undefined, false, undefined, this) : contentSection,
|
6492
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_core7.Stack, {
|
6493
|
+
ref: bottomSectionRef,
|
6494
|
+
gap: gutter,
|
6429
6495
|
flex: 0,
|
6430
|
-
...componentsProps?.sectionContainers?.["bottom" /* Bottom */]
|
6496
|
+
...componentsProps?.sectionContainers?.["bottom" /* Bottom */],
|
6497
|
+
className: clsx_default("remoraid-frame-layout-section", "remoraid-frame-layout-bottom-section", componentsProps?.sectionContainers?.["bottom" /* Bottom */]?.className)
|
6431
6498
|
}, undefined, false, undefined, this)
|
6432
6499
|
]
|
6433
6500
|
}, undefined, true, undefined, this),
|
6434
|
-
/* @__PURE__ */
|
6435
|
-
|
6436
|
-
ref: rightSection,
|
6501
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_core7.Group, {
|
6502
|
+
ref: rightSectionRef,
|
6437
6503
|
h: "100%",
|
6504
|
+
gap: gutter,
|
6505
|
+
pl: 0,
|
6438
6506
|
wrap: "nowrap",
|
6439
|
-
...componentsProps?.sectionContainers?.["right" /* Right */]
|
6507
|
+
...componentsProps?.sectionContainers?.["right" /* Right */],
|
6508
|
+
className: clsx_default("remoraid-frame-layout-section", componentsProps?.sectionContainers?.["right" /* Right */]?.className)
|
6440
6509
|
}, undefined, false, undefined, this)
|
6441
6510
|
]
|
6442
6511
|
}, undefined, true, undefined, this)
|
6443
6512
|
}, undefined, false, undefined, this);
|
6444
6513
|
}
|
6445
6514
|
var FrameLayout_default = Object.assign(FrameLayout, {
|
6446
|
-
Element
|
6515
|
+
Element: Element2
|
6447
6516
|
});
|
6448
6517
|
|
6449
6518
|
// src/core/components/AppShell/index.tsx
|
6450
|
-
var
|
6451
|
-
var
|
6519
|
+
var import_lodash2 = __toESM(require_lodash());
|
6520
|
+
var jsx_dev_runtime14 = require("react/jsx-dev-runtime");
|
6521
|
+
var remoraidAppShellLayoutId = "remoraid-app-shell";
|
6452
6522
|
var defaultAppShellNavbarPositions = { ["minimal" /* Minimal */]: "left" /* Left */ };
|
6453
6523
|
var defaultAppShellFooterPositions = { ["minimal" /* Minimal */]: "content" /* Content */ };
|
6454
|
-
function AppShell(
|
6455
|
-
|
6456
|
-
|
6457
|
-
|
6458
|
-
|
6459
|
-
|
6460
|
-
|
6461
|
-
|
6462
|
-
|
6463
|
-
|
6464
|
-
|
6465
|
-
|
6466
|
-
|
6467
|
-
|
6468
|
-
navbarPosition = defaultAppShellNavbarPositions[navbarVariant];
|
6469
|
-
}
|
6470
|
-
if (footerVariant !== null && footerPosition === undefined) {
|
6471
|
-
footerPosition = defaultAppShellFooterPositions[footerVariant];
|
6472
|
-
}
|
6524
|
+
function AppShell({
|
6525
|
+
navbarVariant: navbarVariantProp,
|
6526
|
+
footerVariant: footerVariantProp,
|
6527
|
+
navbarPosition: navbarPositionProp,
|
6528
|
+
footerPosition: footerPositionProp,
|
6529
|
+
gutter = "md",
|
6530
|
+
appContext: appContext2,
|
6531
|
+
componentsProps,
|
6532
|
+
children
|
6533
|
+
}) {
|
6534
|
+
const navbarVariant = navbarVariantProp ?? null;
|
6535
|
+
const footerVariant = footerVariantProp ?? null;
|
6536
|
+
const navbarPosition = navbarPositionProp ?? (navbarVariant === null ? null : defaultAppShellNavbarPositions[navbarVariant]);
|
6537
|
+
const footerPosition = footerPositionProp ?? (footerVariant === null ? null : defaultAppShellFooterPositions[footerVariant]);
|
6473
6538
|
let navbar;
|
6474
6539
|
let footer;
|
6475
|
-
let
|
6476
|
-
|
6540
|
+
let navbarLayoutElementProps = {
|
6541
|
+
includeContainer: false
|
6542
|
+
};
|
6543
|
+
let footerLayoutElementProps = {
|
6544
|
+
includeContainer: true,
|
6545
|
+
componentsProps: { container: { style: { order: 1 } } }
|
6546
|
+
};
|
6477
6547
|
if (navbarVariant === "minimal" /* Minimal */) {
|
6478
|
-
navbar = /* @__PURE__ */
|
6548
|
+
navbar = /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(NavbarMinimal, {
|
6479
6549
|
...componentsProps?.navbar
|
6480
6550
|
}, undefined, false, undefined, this);
|
6481
|
-
navbarContainerProps.py = "md";
|
6482
|
-
if (navbarPosition === "left" /* Left */) {
|
6483
|
-
navbarContainerProps.pl = "md";
|
6484
|
-
} else if (navbarPosition === "right" /* Right */) {
|
6485
|
-
navbarContainerProps.pr = "md";
|
6486
|
-
}
|
6487
6551
|
}
|
6488
6552
|
if (footerVariant === "minimal" /* Minimal */) {
|
6489
|
-
footer = /* @__PURE__ */
|
6553
|
+
footer = /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(FooterMinimal, {
|
6490
6554
|
...componentsProps?.footer
|
6491
6555
|
}, undefined, false, undefined, this);
|
6492
6556
|
}
|
6493
|
-
return /* @__PURE__ */
|
6557
|
+
return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(AppProvider, {
|
6494
6558
|
appContext: appContext2,
|
6495
6559
|
...componentsProps?.AppProvider,
|
6496
|
-
children: /* @__PURE__ */
|
6560
|
+
children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(import_core8.Box, {
|
6497
6561
|
h: "100vh",
|
6498
6562
|
...componentsProps?.container,
|
6499
|
-
children: /* @__PURE__ */
|
6500
|
-
layoutId:
|
6563
|
+
children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(FrameLayout_default, {
|
6564
|
+
layoutId: remoraidAppShellLayoutId,
|
6565
|
+
gutter,
|
6501
6566
|
...componentsProps?.layout,
|
6502
6567
|
children: [
|
6503
|
-
navbarPosition !==
|
6568
|
+
navbarPosition !== null && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(FrameLayout_default.Element, {
|
6504
6569
|
section: navbarPosition,
|
6505
|
-
|
6506
|
-
componentsProps
|
6507
|
-
...componentsProps?.navbarLayoutElement?.componentsProps,
|
6508
|
-
container: {
|
6509
|
-
...navbarContainerProps,
|
6510
|
-
...componentsProps?.navbarLayoutElement?.componentsProps?.container
|
6511
|
-
}
|
6512
|
-
},
|
6570
|
+
includeContainer: false,
|
6571
|
+
...import_lodash2.merge(navbarLayoutElementProps, componentsProps?.navbarLayoutElement),
|
6513
6572
|
children: navbar
|
6514
6573
|
}, undefined, false, undefined, this),
|
6515
|
-
|
6574
|
+
children,
|
6575
|
+
footerPosition !== null && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(FrameLayout_default.Element, {
|
6516
6576
|
section: footerPosition,
|
6517
|
-
...componentsProps?.footerLayoutElement,
|
6518
|
-
componentsProps: {
|
6519
|
-
...componentsProps?.footerLayoutElement?.componentsProps,
|
6520
|
-
container: {
|
6521
|
-
...footerContainerProps,
|
6522
|
-
...componentsProps?.footerLayoutElement?.componentsProps?.container
|
6523
|
-
}
|
6524
|
-
},
|
6525
|
-
children: footer
|
6526
|
-
}, undefined, false, undefined, this),
|
6527
|
-
navbarPosition !== undefined && navbarPosition === "content" /* Content */ && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(jsx_dev_runtime13.Fragment, {
|
6528
|
-
children: navbar
|
6529
|
-
}, undefined, false, undefined, this),
|
6530
|
-
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_core7.Box, {
|
6531
|
-
...componentsProps?.childrenContainer,
|
6532
|
-
children
|
6533
|
-
}, undefined, false, undefined, this),
|
6534
|
-
footerPosition !== undefined && footerPosition === "content" /* Content */ && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(jsx_dev_runtime13.Fragment, {
|
6577
|
+
...import_lodash2.merge(footerLayoutElementProps, componentsProps?.footerLayoutElement),
|
6535
6578
|
children: footer
|
6536
6579
|
}, undefined, false, undefined, this)
|
6537
6580
|
]
|
@@ -6549,25 +6592,6 @@ var import_core10 = require("@mantine/core");
|
|
6549
6592
|
// src/core/components/Page/index.tsx
|
6550
6593
|
var import_react11 = __toESM(require("react"));
|
6551
6594
|
var import_navigation2 = require("next/navigation");
|
6552
|
-
|
6553
|
-
// src/core/components/Page/PageContainer/index.tsx
|
6554
|
-
var import_core8 = require("@mantine/core");
|
6555
|
-
var jsx_dev_runtime14 = require("react/jsx-dev-runtime");
|
6556
|
-
function PageContainer({
|
6557
|
-
children,
|
6558
|
-
pt,
|
6559
|
-
componentsProps
|
6560
|
-
}) {
|
6561
|
-
const theme = useRemoraidTheme();
|
6562
|
-
return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(import_core8.Container, {
|
6563
|
-
size: theme.containerSize,
|
6564
|
-
pt: pt ?? "md",
|
6565
|
-
...componentsProps?.container,
|
6566
|
-
children
|
6567
|
-
}, undefined, false, undefined, this);
|
6568
|
-
}
|
6569
|
-
|
6570
|
-
// src/core/components/Page/index.tsx
|
6571
6595
|
var jsx_dev_runtime15 = require("react/jsx-dev-runtime");
|
6572
6596
|
var pageContext = import_react11.default.createContext(null);
|
6573
6597
|
var usePage = () => {
|
@@ -6577,7 +6601,7 @@ function Page({
|
|
6577
6601
|
children,
|
6578
6602
|
name,
|
6579
6603
|
config,
|
6580
|
-
|
6604
|
+
p = 0,
|
6581
6605
|
componentsProps
|
6582
6606
|
}) {
|
6583
6607
|
const pathname = import_navigation2.usePathname();
|
@@ -6593,7 +6617,7 @@ function Page({
|
|
6593
6617
|
return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(pageContext.Provider, {
|
6594
6618
|
value: { name: name ?? pathname, pageId, ...config },
|
6595
6619
|
children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(PageContainer, {
|
6596
|
-
|
6620
|
+
p,
|
6597
6621
|
componentsProps: { container: componentsProps?.container },
|
6598
6622
|
children
|
6599
6623
|
}, undefined, false, undefined, this)
|
@@ -6611,8 +6635,9 @@ function ScrollableChipGroup({
|
|
6611
6635
|
onChange,
|
6612
6636
|
gap,
|
6613
6637
|
componentsProps,
|
6614
|
-
children
|
6638
|
+
children: childrenProp
|
6615
6639
|
}) {
|
6640
|
+
const children = asChildrenOfType(import_core9.Chip, childrenProp, "Check children passed to 'ScrollableChipGroup' component.");
|
6616
6641
|
const theme = useRemoraidTheme();
|
6617
6642
|
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(import_core9.ScrollArea, {
|
6618
6643
|
...theme.scrollAreaProps,
|
@@ -6642,12 +6667,12 @@ function WidgetSelectionHeader({
|
|
6642
6667
|
mt
|
6643
6668
|
}) {
|
6644
6669
|
const theme = useRemoraidTheme();
|
6645
|
-
const {
|
6670
|
+
const { isPageRegistered, updateWidgetSelectionBulk, ...widgetsContext2 } = useWidgets();
|
6646
6671
|
const page = usePage();
|
6647
6672
|
if (!page) {
|
6648
|
-
|
6649
|
-
return null;
|
6673
|
+
throw new InvalidComponentUsageError("WidgetSelectionHeader", "must be used as child of 'Page'.");
|
6650
6674
|
}
|
6675
|
+
const widgets = widgetsContext2.widgets[page.pageId] ?? {};
|
6651
6676
|
return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core10.Flex, {
|
6652
6677
|
justify: "flex-start",
|
6653
6678
|
align: "center",
|
@@ -6663,77 +6688,52 @@ function WidgetSelectionHeader({
|
|
6663
6688
|
orientation: "vertical"
|
6664
6689
|
}, undefined, false, undefined, this),
|
6665
6690
|
isPageRegistered(page.pageId) && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ScrollableChipGroup, {
|
6666
|
-
value: Object.keys(widgets
|
6691
|
+
value: Object.keys(widgets).filter((widgetId) => widgets[widgetId]?.selected),
|
6667
6692
|
onChange: (value) => {
|
6668
6693
|
updateWidgetSelectionBulk(page.pageId, value);
|
6669
6694
|
},
|
6670
6695
|
componentsProps: { scrollArea: { flex: 1 } },
|
6671
|
-
children: Object.keys(widgets
|
6672
|
-
|
6673
|
-
|
6674
|
-
|
6675
|
-
|
6676
|
-
|
6677
|
-
|
6678
|
-
|
6679
|
-
|
6696
|
+
children: Object.keys(widgets).map((widgetId) => {
|
6697
|
+
const widget = widgets[widgetId] ?? getDefaultWidgetContext({ widgetId });
|
6698
|
+
return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core10.Chip, {
|
6699
|
+
value: widgetId,
|
6700
|
+
size: "sm",
|
6701
|
+
disabled: disabledWidgets && disabledWidgets.includes(widgetId),
|
6702
|
+
icon: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_icons_react4.IconCheck, {
|
6703
|
+
...theme.iconProps.tiny
|
6704
|
+
}, undefined, false, undefined, this),
|
6705
|
+
children: widget.name
|
6706
|
+
}, widgetId, false, undefined, this);
|
6707
|
+
})
|
6680
6708
|
}, undefined, false, undefined, this)
|
6681
6709
|
]
|
6682
6710
|
}, undefined, true, undefined, this);
|
6683
6711
|
}
|
6684
|
-
// src/core/components/Widget/WidgetWrapper/CloseButton/index.tsx
|
6685
|
-
var import_core11 = require("@mantine/core");
|
6686
|
-
var import_icons_react5 = require("@tabler/icons-react");
|
6687
|
-
var jsx_dev_runtime18 = require("react/jsx-dev-runtime");
|
6688
|
-
function CloseButton({ widgetId }) {
|
6689
|
-
const theme = useRemoraidTheme();
|
6690
|
-
const { activeWidget, updateWidgetSelection } = useWidgets();
|
6691
|
-
const page = usePage();
|
6692
|
-
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(import_core11.Transition, {
|
6693
|
-
mounted: activeWidget === widgetId,
|
6694
|
-
transition: "pop-top-right",
|
6695
|
-
duration: theme.transitionDurations.short,
|
6696
|
-
timingFunction: "ease",
|
6697
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(import_core11.ActionIcon, {
|
6698
|
-
pos: "absolute",
|
6699
|
-
size: "xs",
|
6700
|
-
className: "remoraid-close-button",
|
6701
|
-
radius: "xl",
|
6702
|
-
color: "red",
|
6703
|
-
onClick: () => {
|
6704
|
-
if (!page) {
|
6705
|
-
return;
|
6706
|
-
}
|
6707
|
-
updateWidgetSelection(page.pageId, widgetId, false);
|
6708
|
-
},
|
6709
|
-
style: transitionStyle,
|
6710
|
-
children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(import_icons_react5.IconX, {
|
6711
|
-
...theme.iconProps.tiny
|
6712
|
-
}, undefined, false, undefined, this)
|
6713
|
-
}, undefined, false, undefined, this)
|
6714
|
-
}, undefined, false, undefined, this);
|
6715
|
-
}
|
6716
6712
|
// src/core/components/BadgeGroup/index.tsx
|
6717
|
-
var
|
6713
|
+
var import_core12 = require("@mantine/core");
|
6718
6714
|
var import_react12 = __toESM(require("react"));
|
6719
6715
|
|
6720
6716
|
// src/core/components/BadgeMinimal/index.tsx
|
6721
|
-
var
|
6722
|
-
var
|
6723
|
-
function BadgeMinimal(
|
6724
|
-
|
6717
|
+
var import_core11 = require("@mantine/core");
|
6718
|
+
var jsx_dev_runtime18 = require("react/jsx-dev-runtime");
|
6719
|
+
function BadgeMinimal({
|
6720
|
+
label,
|
6721
|
+
tooltip,
|
6722
|
+
mounted = true,
|
6723
|
+
componentsProps
|
6724
|
+
}) {
|
6725
6725
|
const theme = useRemoraidTheme();
|
6726
|
-
return /* @__PURE__ */
|
6727
|
-
mounted
|
6726
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(import_core11.Transition, {
|
6727
|
+
mounted,
|
6728
6728
|
transition: "fade",
|
6729
6729
|
duration: theme.transitionDurations.short,
|
6730
6730
|
timingFunction: "ease",
|
6731
6731
|
...componentsProps?.transition,
|
6732
|
-
children: (transitionStyle) => /* @__PURE__ */
|
6732
|
+
children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(import_core11.Tooltip, {
|
6733
6733
|
disabled: !tooltip,
|
6734
6734
|
label: tooltip,
|
6735
6735
|
...componentsProps?.tooltip,
|
6736
|
-
children: /* @__PURE__ */
|
6736
|
+
children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(import_core11.Badge, {
|
6737
6737
|
variant: "default",
|
6738
6738
|
...componentsProps?.badge,
|
6739
6739
|
style: {
|
@@ -6748,7 +6748,7 @@ function BadgeMinimal(props) {
|
|
6748
6748
|
}
|
6749
6749
|
|
6750
6750
|
// src/core/components/BadgeGroup/index.tsx
|
6751
|
-
var
|
6751
|
+
var jsx_dev_runtime19 = require("react/jsx-dev-runtime");
|
6752
6752
|
var react = require("react");
|
6753
6753
|
function BadgeGroup({
|
6754
6754
|
badges: badgesProp,
|
@@ -6759,9 +6759,9 @@ function BadgeGroup({
|
|
6759
6759
|
const theme = useRemoraidTheme();
|
6760
6760
|
const badges = badgesProp.map((badge) => asElementOrPropsOfType(BadgeMinimal, badge, "Check 'badges' property passed to 'BadgeGroup'."));
|
6761
6761
|
const numVisibleBadges = badges.filter((badge) => isValidElementOfType(BadgeMinimal, badge) ? badge.props.mounted : badge.mounted !== false).length;
|
6762
|
-
return /* @__PURE__ */
|
6762
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(jsx_dev_runtime19.Fragment, {
|
6763
6763
|
children: [
|
6764
|
-
/* @__PURE__ */
|
6764
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core12.Group, {
|
6765
6765
|
gap: gap ?? "xs",
|
6766
6766
|
wrap: "nowrap",
|
6767
6767
|
visibleFrom: breakpoint ?? theme.breakpoints.badgeGroupCollapse,
|
@@ -6777,10 +6777,10 @@ function BadgeGroup({
|
|
6777
6777
|
});
|
6778
6778
|
})
|
6779
6779
|
}, undefined, false, undefined, this),
|
6780
|
-
/* @__PURE__ */
|
6780
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core12.Tooltip, {
|
6781
6781
|
label: `${numVisibleBadges} badge${numVisibleBadges === 1 ? "" : "s"}`,
|
6782
6782
|
...componentsProps?.tooltip,
|
6783
|
-
children: /* @__PURE__ */
|
6783
|
+
children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core12.Badge, {
|
6784
6784
|
hiddenFrom: breakpoint ?? theme.breakpoints.badgeGroupCollapse,
|
6785
6785
|
hidden: numVisibleBadges === 0,
|
6786
6786
|
variant: "light",
|
@@ -6794,27 +6794,27 @@ function BadgeGroup({
|
|
6794
6794
|
}, undefined, true, undefined, this);
|
6795
6795
|
}
|
6796
6796
|
// src/core/components/AlertMinimal/index.tsx
|
6797
|
-
var
|
6798
|
-
var
|
6797
|
+
var import_core13 = require("@mantine/core");
|
6798
|
+
var jsx_dev_runtime20 = require("react/jsx-dev-runtime");
|
6799
6799
|
function AlertMinimal({
|
6800
6800
|
title,
|
6801
6801
|
category,
|
6802
6802
|
text,
|
6803
6803
|
onClose,
|
6804
|
-
mounted,
|
6804
|
+
mounted = true,
|
6805
6805
|
mt,
|
6806
6806
|
mb,
|
6807
6807
|
componentsProps,
|
6808
6808
|
children
|
6809
6809
|
}) {
|
6810
6810
|
const theme = useRemoraidTheme();
|
6811
|
-
return /* @__PURE__ */
|
6811
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(import_core13.Transition, {
|
6812
6812
|
mounted: mounted !== false,
|
6813
6813
|
transition: "fade",
|
6814
6814
|
duration: theme.transitionDurations.short,
|
6815
6815
|
timingFunction: "ease",
|
6816
6816
|
...componentsProps?.transition,
|
6817
|
-
children: (transitionStyle) => /* @__PURE__ */
|
6817
|
+
children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(import_core13.Alert, {
|
6818
6818
|
...theme.alertProps[category],
|
6819
6819
|
title: title ?? theme.alertProps[category].title,
|
6820
6820
|
withCloseButton: onClose !== undefined,
|
@@ -6834,141 +6834,481 @@ function AlertMinimal({
|
|
6834
6834
|
}, undefined, false, undefined, this);
|
6835
6835
|
}
|
6836
6836
|
// src/core/components/RemoraidButton/index.tsx
|
6837
|
-
var
|
6838
|
-
var
|
6839
|
-
var
|
6837
|
+
var import_core14 = require("@mantine/core");
|
6838
|
+
var import_icons_react5 = require("@tabler/icons-react");
|
6839
|
+
var import_react13 = require("react");
|
6840
|
+
var jsx_dev_runtime21 = require("react/jsx-dev-runtime");
|
6840
6841
|
function RemoraidButton({
|
6841
6842
|
label,
|
6842
|
-
responsive,
|
6843
|
-
breakpoint,
|
6844
|
-
collapsed,
|
6843
|
+
responsive: ResponsiveProp,
|
6844
|
+
breakpoint: breakpointProp,
|
6845
|
+
collapsed: collapsedProp,
|
6845
6846
|
size,
|
6846
6847
|
color,
|
6847
6848
|
onClick,
|
6848
6849
|
loading,
|
6849
|
-
variant,
|
6850
|
-
|
6851
|
-
|
6850
|
+
variant = "default",
|
6851
|
+
mounted = true,
|
6852
|
+
icon: iconProp,
|
6853
|
+
iconSize = "medium" /* Medium */,
|
6854
|
+
componentsProps
|
6852
6855
|
}) {
|
6856
|
+
const responsive = ResponsiveProp ?? true;
|
6857
|
+
const breakpoint = breakpointProp ?? "md";
|
6858
|
+
const collapsed = collapsedProp ?? false;
|
6859
|
+
const icon = iconProp ?? import_icons_react5.IconClick;
|
6853
6860
|
const theme = useRemoraidTheme();
|
6854
|
-
const iconProps = { ...theme.iconProps
|
6855
|
-
const
|
6856
|
-
|
6857
|
-
|
6858
|
-
|
6859
|
-
|
6860
|
-
|
6861
|
-
|
6862
|
-
|
6863
|
-
|
6864
|
-
|
6865
|
-
|
6866
|
-
|
6867
|
-
|
6861
|
+
const iconProps = { ...theme.iconProps[iconSize], ...componentsProps?.icon };
|
6862
|
+
const iconElement = import_react13.createElement(icon, iconProps);
|
6863
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(import_core14.Transition, {
|
6864
|
+
mounted,
|
6865
|
+
transition: "fade",
|
6866
|
+
duration: theme.transitionDurations.short,
|
6867
|
+
timingFunction: "ease",
|
6868
|
+
...componentsProps?.transition,
|
6869
|
+
children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
|
6870
|
+
children: [
|
6871
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(import_core14.Tooltip, {
|
6872
|
+
label,
|
6873
|
+
...componentsProps?.tooltip,
|
6874
|
+
children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(import_core14.ActionIcon, {
|
6875
|
+
"aria-label": label,
|
6876
|
+
variant,
|
6877
|
+
onClick,
|
6878
|
+
loading,
|
6879
|
+
size: size ? `input-${size}` : "input-sm",
|
6880
|
+
color,
|
6881
|
+
...componentsProps?.button,
|
6882
|
+
...componentsProps?.ActionIcon,
|
6883
|
+
hiddenFrom: !responsive ? undefined : breakpoint,
|
6884
|
+
display: !responsive && !collapsed ? "none" : componentsProps?.ActionIcon?.display ?? componentsProps?.button?.display,
|
6885
|
+
style: {
|
6886
|
+
...transitionStyle,
|
6887
|
+
...componentsProps?.ActionIcon?.style ?? componentsProps?.button?.style
|
6888
|
+
},
|
6889
|
+
children: iconElement
|
6890
|
+
}, undefined, false, undefined, this)
|
6891
|
+
}, undefined, false, undefined, this),
|
6892
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(import_core14.Button, {
|
6868
6893
|
onClick,
|
6869
6894
|
loading,
|
6870
|
-
|
6895
|
+
variant,
|
6896
|
+
size,
|
6871
6897
|
color,
|
6898
|
+
leftSection: iconProp ? iconElement : undefined,
|
6872
6899
|
...componentsProps?.button,
|
6873
|
-
...componentsProps?.
|
6874
|
-
|
6875
|
-
display: responsive
|
6876
|
-
|
6900
|
+
...componentsProps?.Button,
|
6901
|
+
visibleFrom: !responsive ? undefined : breakpoint,
|
6902
|
+
display: !responsive && collapsed ? "none" : componentsProps?.Button?.display ?? componentsProps?.button?.display,
|
6903
|
+
style: {
|
6904
|
+
...transitionStyle,
|
6905
|
+
...componentsProps?.Button?.style ?? componentsProps?.button?.style
|
6906
|
+
},
|
6907
|
+
children: label
|
6877
6908
|
}, undefined, false, undefined, this)
|
6878
|
-
|
6879
|
-
|
6880
|
-
|
6881
|
-
|
6882
|
-
|
6909
|
+
]
|
6910
|
+
}, undefined, true, undefined, this)
|
6911
|
+
}, undefined, false, undefined, this);
|
6912
|
+
}
|
6913
|
+
// src/core/components/Controls/ControlButton/index.tsx
|
6914
|
+
var import_core15 = require("@mantine/core");
|
6915
|
+
var import_icons_react6 = require("@tabler/icons-react");
|
6916
|
+
var jsx_dev_runtime22 = require("react/jsx-dev-runtime");
|
6917
|
+
function ControlButton({
|
6918
|
+
icon: Icon4 = import_icons_react6.IconClick,
|
6919
|
+
mounted = true,
|
6920
|
+
size = "xs",
|
6921
|
+
iconSize = "tiny" /* Tiny */,
|
6922
|
+
onClick,
|
6923
|
+
order,
|
6924
|
+
color,
|
6925
|
+
tooltip,
|
6926
|
+
componentsProps
|
6927
|
+
}) {
|
6928
|
+
const theme = useRemoraidTheme();
|
6929
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(import_core15.Transition, {
|
6930
|
+
mounted,
|
6931
|
+
transition: "pop-top-right",
|
6932
|
+
duration: theme.transitionDurations.short,
|
6933
|
+
timingFunction: "ease",
|
6934
|
+
...componentsProps?.transition,
|
6935
|
+
children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(import_core15.Tooltip, {
|
6936
|
+
label: tooltip,
|
6937
|
+
disabled: !Boolean(tooltip),
|
6938
|
+
...componentsProps?.tooltip,
|
6939
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(import_core15.ActionIcon, {
|
6940
|
+
"data-control-button": true,
|
6883
6941
|
size,
|
6884
6942
|
color,
|
6885
|
-
|
6943
|
+
onClick,
|
6944
|
+
radius: "xl",
|
6886
6945
|
...componentsProps?.button,
|
6887
|
-
|
6888
|
-
|
6889
|
-
|
6890
|
-
|
6946
|
+
style: {
|
6947
|
+
...transitionStyle,
|
6948
|
+
order,
|
6949
|
+
...componentsProps?.button?.style
|
6950
|
+
},
|
6951
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Icon4, {
|
6952
|
+
...theme.iconProps[iconSize],
|
6953
|
+
...componentsProps?.icon
|
6954
|
+
}, undefined, false, undefined, this)
|
6891
6955
|
}, undefined, false, undefined, this)
|
6956
|
+
}, undefined, false, undefined, this)
|
6957
|
+
}, undefined, false, undefined, this);
|
6958
|
+
}
|
6959
|
+
|
6960
|
+
// src/core/components/Controls/index.tsx
|
6961
|
+
var import_react14 = require("react");
|
6962
|
+
var import_core16 = require("@mantine/core");
|
6963
|
+
var import_icons_react7 = require("@tabler/icons-react");
|
6964
|
+
var import_lodash3 = __toESM(require_lodash());
|
6965
|
+
var jsx_dev_runtime23 = require("react/jsx-dev-runtime");
|
6966
|
+
function Controls({
|
6967
|
+
groupRef,
|
6968
|
+
mounted = true,
|
6969
|
+
dragContainerRef,
|
6970
|
+
gutter = 5,
|
6971
|
+
iconSize = "tiny" /* Tiny */,
|
6972
|
+
additionalButtons: additionalButtonsProp,
|
6973
|
+
componentsProps,
|
6974
|
+
children: childrenProp
|
6975
|
+
}) {
|
6976
|
+
const additionalButtons = additionalButtonsProp?.map((additionalButton) => asElementOrPropsOfType(ControlButton, additionalButton, "Check the 'additionalButtons' property of 'Controls'."));
|
6977
|
+
const children = asChildrenOfType(ControlButton, childrenProp, "Check children passed to 'Controls' component.");
|
6978
|
+
const theme = useRemoraidTheme();
|
6979
|
+
const [pos, setPos] = import_react14.useState({
|
6980
|
+
x: 0,
|
6981
|
+
y: 0
|
6982
|
+
});
|
6983
|
+
const offsetRef = import_react14.useRef({ x: 0, y: 0 });
|
6984
|
+
const containerRef = import_react14.useRef(null);
|
6985
|
+
const clamp = (v, min, max) => {
|
6986
|
+
return Math.min(Math.max(v, min), max);
|
6987
|
+
};
|
6988
|
+
const handlePointerDown = (e) => {
|
6989
|
+
if (e.target instanceof Element && e.target.closest("button,[data-control-button]")) {
|
6990
|
+
return;
|
6991
|
+
}
|
6992
|
+
if (!containerRef.current) {
|
6993
|
+
return;
|
6994
|
+
}
|
6995
|
+
const paperRect = containerRef.current.getBoundingClientRect();
|
6996
|
+
offsetRef.current = {
|
6997
|
+
x: e.clientX - paperRect.right,
|
6998
|
+
y: e.clientY - paperRect.top
|
6999
|
+
};
|
7000
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
7001
|
+
};
|
7002
|
+
const handlePointerMove = (e) => {
|
7003
|
+
if (!e.currentTarget.hasPointerCapture(e.pointerId)) {
|
7004
|
+
return;
|
7005
|
+
}
|
7006
|
+
if (!containerRef.current || !dragContainerRef.current) {
|
7007
|
+
return;
|
7008
|
+
}
|
7009
|
+
const boxRect = dragContainerRef.current.getBoundingClientRect();
|
7010
|
+
const paperRect = containerRef.current.getBoundingClientRect();
|
7011
|
+
const rawX = e.clientX - boxRect.right - offsetRef.current.x;
|
7012
|
+
const rawY = e.clientY - boxRect.top - offsetRef.current.y;
|
7013
|
+
const maxX = boxRect.width - paperRect.width;
|
7014
|
+
const maxY = boxRect.height - paperRect.height;
|
7015
|
+
setPos({
|
7016
|
+
x: clamp(-rawX, 0, maxX),
|
7017
|
+
y: clamp(rawY, 0, maxY)
|
7018
|
+
});
|
7019
|
+
};
|
7020
|
+
const handlePointerUp = (e) => {
|
7021
|
+
e.currentTarget.releasePointerCapture(e.pointerId);
|
7022
|
+
};
|
7023
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(import_core16.Transition, {
|
7024
|
+
mounted,
|
7025
|
+
keepMounted: true,
|
7026
|
+
transition: "pop",
|
7027
|
+
duration: theme.transitionDurations.short,
|
7028
|
+
timingFunction: "ease",
|
7029
|
+
...componentsProps?.transition,
|
7030
|
+
children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(import_core16.Paper, {
|
7031
|
+
ref: containerRef,
|
7032
|
+
pos: "absolute",
|
7033
|
+
p: gutter,
|
7034
|
+
bg: theme.transparentBackground,
|
7035
|
+
shadow: "md",
|
7036
|
+
onPointerDown: handlePointerDown,
|
7037
|
+
onPointerMove: handlePointerMove,
|
7038
|
+
onPointerUp: handlePointerUp,
|
7039
|
+
...componentsProps?.container,
|
7040
|
+
style: {
|
7041
|
+
right: pos.x,
|
7042
|
+
top: pos.y,
|
7043
|
+
...import_lodash3.merge(transitionStyle, componentsProps?.container?.style)
|
7044
|
+
},
|
7045
|
+
className: clsx_default("remoraid-controls", componentsProps?.container?.className),
|
7046
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(import_core16.Group, {
|
7047
|
+
gap: gutter,
|
7048
|
+
ref: groupRef,
|
7049
|
+
wrap: "nowrap",
|
7050
|
+
...componentsProps?.group,
|
7051
|
+
className: clsx_default("remoraid-controls-group", componentsProps?.group?.className),
|
7052
|
+
children: [
|
7053
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(import_icons_react7.IconGripHorizontal, {
|
7054
|
+
order: -100,
|
7055
|
+
color: "var(--mantine-color-default-border)",
|
7056
|
+
...import_lodash3.merge(theme.iconProps[iconSize], componentsProps?.gripIcon)
|
7057
|
+
}, undefined, false, undefined, this),
|
7058
|
+
children,
|
7059
|
+
additionalButtons && additionalButtons.map((button, i) => {
|
7060
|
+
if (isValidElementOfType(ControlButton, button)) {
|
7061
|
+
return button;
|
7062
|
+
}
|
7063
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(ControlButton, {
|
7064
|
+
...button
|
7065
|
+
}, i, false, undefined, this);
|
7066
|
+
})
|
7067
|
+
]
|
7068
|
+
}, undefined, true, undefined, this)
|
7069
|
+
}, undefined, false, undefined, this)
|
7070
|
+
}, undefined, false, undefined, this);
|
7071
|
+
}
|
7072
|
+
// src/core/components/Widget/WidgetWrapper/index.tsx
|
7073
|
+
var import_core18 = require("@mantine/core");
|
7074
|
+
var import_react16 = require("react");
|
7075
|
+
var import_icons_react9 = require("@tabler/icons-react");
|
7076
|
+
|
7077
|
+
// src/core/components/Pinnable/index.tsx
|
7078
|
+
var import_react15 = require("react");
|
7079
|
+
var import_icons_react8 = require("@tabler/icons-react");
|
7080
|
+
var import_core17 = require("@mantine/core");
|
7081
|
+
var jsx_dev_runtime24 = require("react/jsx-dev-runtime");
|
7082
|
+
function Pinnable({
|
7083
|
+
layoutType: layoutTypeProp,
|
7084
|
+
section,
|
7085
|
+
initialValue = false,
|
7086
|
+
layoutId,
|
7087
|
+
controlsContainer,
|
7088
|
+
hidden = false,
|
7089
|
+
componentsProps,
|
7090
|
+
children
|
7091
|
+
}) {
|
7092
|
+
const layoutType = layoutTypeProp ?? "frame" /* Frame */;
|
7093
|
+
const { layouts } = useLayouts();
|
7094
|
+
const [pinned, setPinned] = import_react15.useState(initialValue);
|
7095
|
+
const containerRef = import_react15.useRef(null);
|
7096
|
+
const layout = layouts[layoutId ?? remoraidAppShellLayoutId];
|
7097
|
+
if (layout && layout.type !== layoutType) {
|
7098
|
+
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.`);
|
7099
|
+
}
|
7100
|
+
const controlButton = import_react15.useMemo(() => /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(ControlButton, {
|
7101
|
+
icon: pinned ? import_icons_react8.IconPinnedOff : import_icons_react8.IconPin,
|
7102
|
+
tooltip: pinned ? "Unpin" : "Pin",
|
7103
|
+
color: "green",
|
7104
|
+
order: 100,
|
7105
|
+
...componentsProps?.button,
|
7106
|
+
onClick: (e) => {
|
7107
|
+
setPinned((p) => !p);
|
7108
|
+
componentsProps?.button?.onClick?.(e);
|
7109
|
+
}
|
7110
|
+
}, undefined, false, undefined, this), [pinned, componentsProps?.button]);
|
7111
|
+
const element = /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Box, {
|
7112
|
+
pos: "relative",
|
7113
|
+
ref: containerRef,
|
7114
|
+
"data-hidden": hidden,
|
7115
|
+
...componentsProps?.container,
|
7116
|
+
className: clsx_default("remoraid-pinnable", componentsProps?.container?.className),
|
7117
|
+
children: [
|
7118
|
+
controlsContainer === undefined ? /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Controls, {
|
7119
|
+
dragContainerRef: containerRef,
|
7120
|
+
...componentsProps?.controls,
|
7121
|
+
children: controlButton
|
7122
|
+
}, undefined, false, undefined, this) : controlsContainer !== null && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Portal, {
|
7123
|
+
target: controlsContainer,
|
7124
|
+
children: controlButton
|
7125
|
+
}, undefined, false, undefined, this),
|
7126
|
+
children
|
6892
7127
|
]
|
6893
7128
|
}, undefined, true, undefined, this);
|
7129
|
+
if (!layout) {
|
7130
|
+
return null;
|
7131
|
+
}
|
7132
|
+
if (pinned && layoutType === "frame" /* Frame */) {
|
7133
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(FrameLayout_default.Element, {
|
7134
|
+
layoutId,
|
7135
|
+
section,
|
7136
|
+
hidden,
|
7137
|
+
...componentsProps?.layoutElement,
|
7138
|
+
children: element
|
7139
|
+
}, undefined, false, undefined, this);
|
7140
|
+
}
|
7141
|
+
return element;
|
6894
7142
|
}
|
7143
|
+
|
6895
7144
|
// src/core/components/Widget/WidgetWrapper/index.tsx
|
6896
|
-
var
|
6897
|
-
var
|
6898
|
-
var jsx_dev_runtime23 = require("react/jsx-dev-runtime");
|
7145
|
+
var import_lodash4 = __toESM(require_lodash());
|
7146
|
+
var jsx_dev_runtime25 = require("react/jsx-dev-runtime");
|
6899
7147
|
function WidgetWrapper({
|
6900
|
-
children,
|
6901
7148
|
config,
|
6902
|
-
mt,
|
6903
|
-
withCloseButton,
|
6904
|
-
|
7149
|
+
mt = 0,
|
7150
|
+
withCloseButton = true,
|
7151
|
+
pinnableSection,
|
7152
|
+
componentsProps,
|
7153
|
+
children
|
6905
7154
|
}) {
|
6906
7155
|
const {
|
6907
7156
|
isWidgetSelected,
|
6908
7157
|
isPageRegistered,
|
6909
7158
|
isWidgetRegistered,
|
6910
7159
|
registerWidget,
|
6911
|
-
updateActiveWidget
|
7160
|
+
updateActiveWidget,
|
7161
|
+
updateWidgetSelection,
|
7162
|
+
activeWidget
|
6912
7163
|
} = useWidgets();
|
6913
7164
|
const page = usePage();
|
6914
7165
|
const theme = useRemoraidTheme();
|
7166
|
+
const mounted = page !== null && isWidgetSelected(page.pageId, config.widgetId);
|
7167
|
+
const [controlsContainer, setControlsContainer] = import_react16.useState(null);
|
7168
|
+
const [hidden, setHidden] = import_react16.useState(!mounted);
|
6915
7169
|
const pageRegistered = page ? isPageRegistered(page.pageId) : false;
|
6916
|
-
|
6917
|
-
|
6918
|
-
|
6919
|
-
|
6920
|
-
|
6921
|
-
|
6922
|
-
|
6923
|
-
|
6924
|
-
|
6925
|
-
|
7170
|
+
const containerRef = import_react16.useRef(null);
|
7171
|
+
const controlsContainerRef = import_react16.useCallback((n) => {
|
7172
|
+
setControlsContainer(n);
|
7173
|
+
}, [setControlsContainer]);
|
7174
|
+
const handleEnter = () => {
|
7175
|
+
updateActiveWidget(config.widgetId);
|
7176
|
+
};
|
7177
|
+
const handleLeave = () => {
|
7178
|
+
updateActiveWidget(null);
|
7179
|
+
};
|
7180
|
+
let element = /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(import_core18.Transition, {
|
7181
|
+
mounted,
|
6926
7182
|
transition: "fade-left",
|
6927
7183
|
duration: theme.transitionDurations.medium,
|
6928
7184
|
timingFunction: "ease",
|
6929
|
-
|
7185
|
+
...componentsProps?.transition,
|
7186
|
+
onExited: () => {
|
7187
|
+
setHidden(true);
|
7188
|
+
componentsProps?.transition?.onExited?.();
|
7189
|
+
},
|
7190
|
+
children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(import_core18.Paper, {
|
7191
|
+
ref: containerRef,
|
6930
7192
|
p: "md",
|
6931
7193
|
shadow: "md",
|
6932
7194
|
bg: theme.transparentBackground,
|
6933
|
-
mt
|
7195
|
+
mt,
|
6934
7196
|
pos: "relative",
|
6935
7197
|
h: "fit-content",
|
6936
7198
|
...componentsProps?.container,
|
6937
|
-
|
6938
|
-
|
6939
|
-
|
7199
|
+
onMouseEnter: (e) => {
|
7200
|
+
if (!pinnableSection) {
|
7201
|
+
handleEnter();
|
7202
|
+
}
|
7203
|
+
componentsProps?.container?.onMouseEnter?.(e);
|
6940
7204
|
},
|
6941
|
-
onMouseLeave: () => {
|
6942
|
-
|
7205
|
+
onMouseLeave: (e) => {
|
7206
|
+
if (!pinnableSection) {
|
7207
|
+
handleLeave();
|
7208
|
+
}
|
7209
|
+
componentsProps?.container?.onMouseLeave?.(e);
|
6943
7210
|
},
|
7211
|
+
style: import_lodash4.merge(transitionStyle, componentsProps?.container?.style),
|
7212
|
+
id: config.widgetId,
|
6944
7213
|
children: [
|
6945
|
-
|
6946
|
-
|
7214
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Controls, {
|
7215
|
+
dragContainerRef: containerRef,
|
7216
|
+
groupRef: controlsContainerRef,
|
7217
|
+
mounted: activeWidget === config.widgetId,
|
7218
|
+
...componentsProps?.controls,
|
7219
|
+
children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(ControlButton, {
|
7220
|
+
mounted: withCloseButton,
|
7221
|
+
icon: import_icons_react9.IconX,
|
7222
|
+
tooltip: "Hide widget",
|
7223
|
+
color: "red",
|
7224
|
+
order: 200,
|
7225
|
+
...componentsProps?.closeButton,
|
7226
|
+
onClick: (e) => {
|
7227
|
+
if (!page) {
|
7228
|
+
return;
|
7229
|
+
}
|
7230
|
+
updateWidgetSelection(page.pageId, config.widgetId, false);
|
7231
|
+
handleLeave();
|
7232
|
+
componentsProps?.closeButton?.onClick?.(e);
|
7233
|
+
}
|
7234
|
+
}, undefined, false, undefined, this)
|
6947
7235
|
}, undefined, false, undefined, this),
|
6948
7236
|
children
|
6949
7237
|
]
|
6950
7238
|
}, undefined, true, undefined, this)
|
6951
7239
|
}, undefined, false, undefined, this);
|
7240
|
+
if (pinnableSection !== undefined) {
|
7241
|
+
element = /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Pinnable, {
|
7242
|
+
section: pinnableSection,
|
7243
|
+
controlsContainer,
|
7244
|
+
hidden,
|
7245
|
+
...componentsProps?.Pinnable,
|
7246
|
+
componentsProps: {
|
7247
|
+
...componentsProps?.Pinnable?.componentsProps,
|
7248
|
+
container: {
|
7249
|
+
...componentsProps?.Pinnable?.componentsProps?.container,
|
7250
|
+
onMouseEnter: (e) => {
|
7251
|
+
handleEnter();
|
7252
|
+
componentsProps?.Pinnable?.componentsProps?.container?.onMouseEnter?.(e);
|
7253
|
+
},
|
7254
|
+
onMouseLeave: (e) => {
|
7255
|
+
handleLeave();
|
7256
|
+
componentsProps?.Pinnable?.componentsProps?.container?.onMouseLeave?.(e);
|
7257
|
+
}
|
7258
|
+
},
|
7259
|
+
button: {
|
7260
|
+
...componentsProps?.Pinnable?.componentsProps?.button,
|
7261
|
+
onClick: (e) => {
|
7262
|
+
handleLeave();
|
7263
|
+
componentsProps?.Pinnable?.componentsProps?.button?.onClick?.(e);
|
7264
|
+
}
|
7265
|
+
},
|
7266
|
+
layoutElement: {
|
7267
|
+
includeContainer: false,
|
7268
|
+
includePageContainer: pinnableSection === "top" /* Top */ || pinnableSection === "bottom" /* Bottom */,
|
7269
|
+
...componentsProps?.Pinnable?.componentsProps?.layoutElement
|
7270
|
+
}
|
7271
|
+
},
|
7272
|
+
children: element
|
7273
|
+
}, undefined, false, undefined, this);
|
7274
|
+
}
|
7275
|
+
import_react16.useEffect(() => {
|
7276
|
+
if (!page) {
|
7277
|
+
return;
|
7278
|
+
}
|
7279
|
+
if (!isWidgetRegistered(page.pageId, config.widgetId)) {
|
7280
|
+
registerWidget(page.pageId, config);
|
7281
|
+
}
|
7282
|
+
}, [pageRegistered]);
|
7283
|
+
import_react16.useEffect(() => {
|
7284
|
+
if (mounted) {
|
7285
|
+
const id = requestAnimationFrame(() => {
|
7286
|
+
setHidden(false);
|
7287
|
+
});
|
7288
|
+
return () => {
|
7289
|
+
cancelAnimationFrame(id);
|
7290
|
+
};
|
7291
|
+
}
|
7292
|
+
}, [mounted]);
|
7293
|
+
return element;
|
6952
7294
|
}
|
6953
|
-
var WidgetWrapper_default = Object.assign(WidgetWrapper, {
|
6954
|
-
CloseButton
|
6955
|
-
});
|
6956
7295
|
// src/core/components/Widget/index.tsx
|
6957
|
-
var
|
6958
|
-
var
|
7296
|
+
var import_core19 = require("@mantine/core");
|
7297
|
+
var jsx_dev_runtime26 = require("react/jsx-dev-runtime");
|
6959
7298
|
var react2 = require("react");
|
6960
7299
|
function Widget({
|
6961
|
-
children,
|
6962
7300
|
id,
|
6963
|
-
config,
|
6964
7301
|
title,
|
7302
|
+
config,
|
6965
7303
|
badges: badgesProp,
|
6966
7304
|
buttons: buttonsProp,
|
6967
7305
|
alerts: alertsProp,
|
6968
7306
|
gaps,
|
6969
7307
|
loading,
|
6970
7308
|
mt,
|
6971
|
-
|
7309
|
+
pinnableSection,
|
7310
|
+
componentsProps,
|
7311
|
+
children
|
6972
7312
|
}) {
|
6973
7313
|
const buttons = buttonsProp?.map((button) => asElementOrPropsOfType(RemoraidButton, button, "Check the 'buttons' property of this widget."));
|
6974
7314
|
const alerts = alertsProp?.map((alert) => asElementOrPropsOfType(AlertMinimal, alert, "Check the 'alerts' property of this widget."));
|
@@ -6976,41 +7316,41 @@ function Widget({
|
|
6976
7316
|
const badgesGap = (typeof gaps === "object" ? gaps.badges : gaps) ?? "xs";
|
6977
7317
|
const buttonsGap = (typeof gaps === "object" ? gaps.buttons : gaps) ?? "xs";
|
6978
7318
|
const alertsGap = (typeof gaps === "object" ? gaps.alerts : gaps) ?? "xs";
|
6979
|
-
return /* @__PURE__ */
|
7319
|
+
return /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(WidgetWrapper, {
|
6980
7320
|
config: {
|
6981
7321
|
widgetId: id,
|
6982
|
-
|
6983
|
-
|
7322
|
+
...config,
|
7323
|
+
initialValues: {
|
7324
|
+
name: title,
|
7325
|
+
...config?.initialValues
|
7326
|
+
}
|
6984
7327
|
},
|
6985
7328
|
mt,
|
6986
|
-
componentsProps: {
|
6987
|
-
container: componentsProps?.container,
|
6988
|
-
transition: componentsProps?.transition
|
6989
|
-
},
|
6990
7329
|
...componentsProps?.wrapper,
|
7330
|
+
pinnableSection: pinnableSection ?? componentsProps?.wrapper?.pinnableSection,
|
6991
7331
|
children: [
|
6992
|
-
/* @__PURE__ */
|
7332
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(import_core19.Group, {
|
6993
7333
|
justify: "space-between",
|
6994
7334
|
wrap: "nowrap",
|
6995
7335
|
children: [
|
6996
|
-
/* @__PURE__ */
|
7336
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(import_core19.Group, {
|
6997
7337
|
gap: badgesGap,
|
6998
7338
|
wrap: "nowrap",
|
6999
7339
|
children: [
|
7000
|
-
/* @__PURE__ */
|
7340
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(import_core19.Title, {
|
7001
7341
|
order: 1,
|
7002
7342
|
size: "h3",
|
7003
7343
|
lineClamp: 1,
|
7004
|
-
children: title
|
7344
|
+
children: title ?? id
|
7005
7345
|
}, undefined, false, undefined, this),
|
7006
|
-
badges !== undefined && /* @__PURE__ */
|
7346
|
+
badges !== undefined && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(BadgeGroup, {
|
7007
7347
|
badges,
|
7008
7348
|
gap: badgesGap,
|
7009
7349
|
...componentsProps?.badgeGroup
|
7010
7350
|
}, undefined, false, undefined, this)
|
7011
7351
|
]
|
7012
7352
|
}, undefined, true, undefined, this),
|
7013
|
-
/* @__PURE__ */
|
7353
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(import_core19.Group, {
|
7014
7354
|
gap: buttonsGap,
|
7015
7355
|
wrap: "nowrap",
|
7016
7356
|
children: buttons !== undefined && buttons.map((button, i) => {
|
@@ -7025,11 +7365,11 @@ function Widget({
|
|
7025
7365
|
}, undefined, false, undefined, this)
|
7026
7366
|
]
|
7027
7367
|
}, undefined, true, undefined, this),
|
7028
|
-
/* @__PURE__ */
|
7368
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(import_core19.Divider, {
|
7029
7369
|
my: "md",
|
7030
7370
|
...componentsProps?.divider
|
7031
7371
|
}, undefined, false, undefined, this),
|
7032
|
-
/* @__PURE__ */
|
7372
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(import_core19.Stack, {
|
7033
7373
|
align: "stretch",
|
7034
7374
|
gap: alertsGap,
|
7035
7375
|
mb: alerts && alerts.length > 0 ? "md" : 0,
|
@@ -7044,20 +7384,20 @@ function Widget({
|
|
7044
7384
|
});
|
7045
7385
|
})
|
7046
7386
|
}, undefined, false, undefined, this),
|
7047
|
-
loading ? /* @__PURE__ */
|
7048
|
-
children: /* @__PURE__ */
|
7387
|
+
loading ? /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(import_core19.Center, {
|
7388
|
+
children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(import_core19.Loader, {
|
7049
7389
|
...componentsProps?.loader
|
7050
7390
|
}, undefined, false, undefined, this)
|
7051
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
7391
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(jsx_dev_runtime26.Fragment, {
|
7052
7392
|
children
|
7053
7393
|
}, undefined, false, undefined, this)
|
7054
7394
|
]
|
7055
7395
|
}, undefined, true, undefined, this);
|
7056
7396
|
}
|
7057
7397
|
// src/core/components/NotFoundPage/index.tsx
|
7058
|
-
var
|
7398
|
+
var import_core20 = require("@mantine/core");
|
7059
7399
|
var import_navigation3 = require("next/navigation");
|
7060
|
-
var
|
7400
|
+
var jsx_dev_runtime27 = require("react/jsx-dev-runtime");
|
7061
7401
|
function NotFoundPage({
|
7062
7402
|
children,
|
7063
7403
|
message,
|
@@ -7065,11 +7405,11 @@ function NotFoundPage({
|
|
7065
7405
|
}) {
|
7066
7406
|
const pathname = import_navigation3.usePathname();
|
7067
7407
|
const theme = useRemoraidTheme();
|
7068
|
-
return /* @__PURE__ */
|
7408
|
+
return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Page, {
|
7069
7409
|
name: "Not Found",
|
7070
7410
|
...componentsProps?.page,
|
7071
7411
|
children: [
|
7072
|
-
/* @__PURE__ */
|
7412
|
+
/* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_core20.Alert, {
|
7073
7413
|
...theme.alertProps.negative,
|
7074
7414
|
title: "404 - Page Not Found",
|
7075
7415
|
children: message ?? `Could not find page ${pathname}.`
|
@@ -7079,8 +7419,8 @@ function NotFoundPage({
|
|
7079
7419
|
}, undefined, true, undefined, this);
|
7080
7420
|
}
|
7081
7421
|
// src/core/components/EnvironmentShell/index.tsx
|
7082
|
-
var
|
7083
|
-
var
|
7422
|
+
var import_core21 = require("@mantine/core");
|
7423
|
+
var jsx_dev_runtime28 = require("react/jsx-dev-runtime");
|
7084
7424
|
function EnvironmentShell({
|
7085
7425
|
children,
|
7086
7426
|
environment,
|
@@ -7094,7 +7434,7 @@ function EnvironmentShell({
|
|
7094
7434
|
const undefinedKeys = Object.keys(environment).filter((key) => environment[key] === undefined);
|
7095
7435
|
const alertTitle = `Please Specify Environment Variable${undefinedKeys.length > 1 ? "s" : ""}`;
|
7096
7436
|
const alertMessage = `Components could not be rendered because the following environment variables are not specified: ${undefinedKeys.join(", ")}.`;
|
7097
|
-
const alert = /* @__PURE__ */
|
7437
|
+
const alert = /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(import_core21.Alert, {
|
7098
7438
|
...theme.alertProps.neutral,
|
7099
7439
|
title: alertTitle,
|
7100
7440
|
m,
|
@@ -7102,12 +7442,12 @@ function EnvironmentShell({
|
|
7102
7442
|
children: message ?? alertMessage
|
7103
7443
|
}, undefined, false, undefined, this);
|
7104
7444
|
if (undefinedKeys.length === 0) {
|
7105
|
-
return /* @__PURE__ */
|
7445
|
+
return /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(jsx_dev_runtime28.Fragment, {
|
7106
7446
|
children
|
7107
7447
|
}, undefined, false, undefined, this);
|
7108
7448
|
}
|
7109
7449
|
if (withContainer) {
|
7110
|
-
return /* @__PURE__ */
|
7450
|
+
return /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(PageContainer, {
|
7111
7451
|
componentsProps: { container: componentsProps?.container },
|
7112
7452
|
children: alert
|
7113
7453
|
}, undefined, false, undefined, this);
|
@@ -7115,22 +7455,22 @@ function EnvironmentShell({
|
|
7115
7455
|
return alert;
|
7116
7456
|
}
|
7117
7457
|
// src/core/components/SettingsWidget/index.tsx
|
7118
|
-
var
|
7119
|
-
var
|
7458
|
+
var import_react17 = require("react");
|
7459
|
+
var import_icons_react11 = require("@tabler/icons-react");
|
7120
7460
|
|
7121
7461
|
// src/core/components/SettingsWidget/SaveButton/index.tsx
|
7122
|
-
var
|
7123
|
-
var
|
7124
|
-
var
|
7462
|
+
var import_icons_react10 = require("@tabler/icons-react");
|
7463
|
+
var import_core22 = require("@mantine/core");
|
7464
|
+
var jsx_dev_runtime29 = require("react/jsx-dev-runtime");
|
7125
7465
|
function SaveButton({
|
7126
7466
|
onSaveChanges,
|
7127
7467
|
insideContainer,
|
7128
7468
|
componentsProps
|
7129
7469
|
}) {
|
7130
7470
|
const settingsWidgetOptions = useSettingsWidgetContext();
|
7131
|
-
const button = /* @__PURE__ */
|
7471
|
+
const button = /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(RemoraidButton, {
|
7132
7472
|
label: "Save Changes",
|
7133
|
-
icon:
|
7473
|
+
icon: import_icons_react10.IconDeviceFloppy,
|
7134
7474
|
onClick: onSaveChanges,
|
7135
7475
|
responsive: false,
|
7136
7476
|
...componentsProps?.button,
|
@@ -7143,7 +7483,7 @@ function SaveButton({
|
|
7143
7483
|
}
|
7144
7484
|
}, undefined, false, undefined, this);
|
7145
7485
|
if (insideContainer !== false) {
|
7146
|
-
return /* @__PURE__ */
|
7486
|
+
return /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(import_core22.Group, {
|
7147
7487
|
w: "100%",
|
7148
7488
|
justify: "flex-end",
|
7149
7489
|
mt: "md",
|
@@ -7155,11 +7495,11 @@ function SaveButton({
|
|
7155
7495
|
}
|
7156
7496
|
|
7157
7497
|
// src/core/components/SettingsWidget/index.tsx
|
7158
|
-
var
|
7498
|
+
var jsx_dev_runtime30 = require("react/jsx-dev-runtime");
|
7159
7499
|
var defaultSettingsWidgetContext = {};
|
7160
|
-
var settingsWidgetContext =
|
7500
|
+
var settingsWidgetContext = import_react17.createContext(defaultSettingsWidgetContext);
|
7161
7501
|
var useSettingsWidgetContext = () => {
|
7162
|
-
return
|
7502
|
+
return import_react17.useContext(settingsWidgetContext);
|
7163
7503
|
};
|
7164
7504
|
function SettingsWidget({
|
7165
7505
|
children,
|
@@ -7168,9 +7508,9 @@ function SettingsWidget({
|
|
7168
7508
|
custom,
|
7169
7509
|
widgetProps
|
7170
7510
|
}) {
|
7171
|
-
return /* @__PURE__ */
|
7511
|
+
return /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(settingsWidgetContext.Provider, {
|
7172
7512
|
value: { custom, unsavedChanges },
|
7173
|
-
children: /* @__PURE__ */
|
7513
|
+
children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Widget, {
|
7174
7514
|
title: "Settings",
|
7175
7515
|
id: "settings",
|
7176
7516
|
mt: "md",
|
@@ -7179,7 +7519,7 @@ function SettingsWidget({
|
|
7179
7519
|
...onRestoreDefaultValues ? [
|
7180
7520
|
{
|
7181
7521
|
label: "Restore Default Values",
|
7182
|
-
icon:
|
7522
|
+
icon: import_icons_react11.IconRestore,
|
7183
7523
|
onClick: onRestoreDefaultValues,
|
7184
7524
|
componentsProps: { button: { disabled: custom === false } }
|
7185
7525
|
}
|
@@ -7206,27 +7546,27 @@ var SettingsWidget_default = Object.assign(SettingsWidget, {
|
|
7206
7546
|
SaveButton
|
7207
7547
|
});
|
7208
7548
|
// src/core/components/SettingsWidget/SettingsTable/index.tsx
|
7209
|
-
var
|
7210
|
-
var
|
7549
|
+
var import_react18 = require("react");
|
7550
|
+
var import_core24 = require("@mantine/core");
|
7211
7551
|
|
7212
7552
|
// src/core/components/SettingsWidget/SettingsTable/Row/index.tsx
|
7213
|
-
var
|
7214
|
-
var
|
7553
|
+
var import_core23 = require("@mantine/core");
|
7554
|
+
var jsx_dev_runtime31 = require("react/jsx-dev-runtime");
|
7215
7555
|
function Row({
|
7216
7556
|
children,
|
7217
7557
|
label
|
7218
7558
|
}) {
|
7219
7559
|
const options = useSettingsTableOptions();
|
7220
|
-
return /* @__PURE__ */
|
7560
|
+
return /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(import_core23.Table.Tr, {
|
7221
7561
|
children: [
|
7222
|
-
/* @__PURE__ */
|
7562
|
+
/* @__PURE__ */ jsx_dev_runtime31.jsxDEV(import_core23.Table.Th, {
|
7223
7563
|
w: options.leftColumnWidth,
|
7224
|
-
children: /* @__PURE__ */
|
7564
|
+
children: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(import_core23.Text, {
|
7225
7565
|
size: "sm",
|
7226
7566
|
children: label
|
7227
7567
|
}, undefined, false, undefined, this)
|
7228
7568
|
}, undefined, false, undefined, this),
|
7229
|
-
/* @__PURE__ */
|
7569
|
+
/* @__PURE__ */ jsx_dev_runtime31.jsxDEV(import_core23.Table.Td, {
|
7230
7570
|
py: "xs",
|
7231
7571
|
children
|
7232
7572
|
}, undefined, false, undefined, this)
|
@@ -7235,30 +7575,30 @@ function Row({
|
|
7235
7575
|
}
|
7236
7576
|
|
7237
7577
|
// src/core/components/SettingsWidget/SettingsTable/index.tsx
|
7238
|
-
var
|
7578
|
+
var jsx_dev_runtime32 = require("react/jsx-dev-runtime");
|
7239
7579
|
var defaultSettingsTableOptions = {
|
7240
7580
|
leftColumnWidth: "38.2%"
|
7241
7581
|
};
|
7242
|
-
var settingsTableOptionsContext =
|
7582
|
+
var settingsTableOptionsContext = import_react18.createContext(defaultSettingsTableOptions);
|
7243
7583
|
var useSettingsTableOptions = () => {
|
7244
|
-
return
|
7584
|
+
return import_react18.useContext(settingsTableOptionsContext);
|
7245
7585
|
};
|
7246
7586
|
function SettingsTable({
|
7247
7587
|
leftColumnWidth,
|
7248
7588
|
children: childrenProp
|
7249
7589
|
}) {
|
7250
|
-
const theme = useRemoraidTheme();
|
7251
7590
|
const children = asChildrenOfType(Row, childrenProp, "Check children passed to 'SettingsTable' component.");
|
7252
|
-
|
7591
|
+
const theme = useRemoraidTheme();
|
7592
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(settingsTableOptionsContext.Provider, {
|
7253
7593
|
value: {
|
7254
7594
|
leftColumnWidth: leftColumnWidth ?? defaultSettingsTableOptions.leftColumnWidth
|
7255
7595
|
},
|
7256
|
-
children: /* @__PURE__ */
|
7596
|
+
children: /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(import_core24.Table, {
|
7257
7597
|
bg: theme.transparentBackground,
|
7258
7598
|
withTableBorder: true,
|
7259
7599
|
variant: "vertical",
|
7260
7600
|
layout: "fixed",
|
7261
|
-
children: /* @__PURE__ */
|
7601
|
+
children: /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(import_core24.Table.Tbody, {
|
7262
7602
|
children
|
7263
7603
|
}, undefined, false, undefined, this)
|
7264
7604
|
}, undefined, false, undefined, this)
|
@@ -7268,20 +7608,21 @@ var SettingsTable_default = Object.assign(SettingsTable, {
|
|
7268
7608
|
Row
|
7269
7609
|
});
|
7270
7610
|
// src/core/components/NavbarSettingsWidget/index.tsx
|
7271
|
-
var
|
7272
|
-
var
|
7273
|
-
var
|
7274
|
-
var
|
7611
|
+
var import_lodash5 = __toESM(require_lodash());
|
7612
|
+
var import_core25 = require("@mantine/core");
|
7613
|
+
var import_icons_react12 = require("@tabler/icons-react");
|
7614
|
+
var jsx_dev_runtime33 = require("react/jsx-dev-runtime");
|
7275
7615
|
var defaultNavbarSettingsWidgetId = "navbar-settings";
|
7276
7616
|
function NavbarSettingsWidget({
|
7277
|
-
additionalRows,
|
7617
|
+
additionalRows: additionalRowsProp,
|
7278
7618
|
widgetProps,
|
7279
7619
|
componentsProps
|
7280
7620
|
}) {
|
7621
|
+
const additionalRows = additionalRowsProp?.map((additionalRow) => asElementOrPropsOfType(SettingsTable_default.Row, additionalRow, "Check the 'additionalRows' property of 'NavbarSettingsWidget'."));
|
7281
7622
|
const { userExperience, updateUserExperience, initialUserExperience } = useRemoraidUserExperience();
|
7282
7623
|
const app = useRemoraidApp();
|
7283
7624
|
const theme = useRemoraidTheme();
|
7284
|
-
return /* @__PURE__ */
|
7625
|
+
return /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(SettingsWidget_default, {
|
7285
7626
|
widgetProps: {
|
7286
7627
|
id: defaultNavbarSettingsWidgetId,
|
7287
7628
|
title: "Navbar Settings",
|
@@ -7293,13 +7634,13 @@ function NavbarSettingsWidget({
|
|
7293
7634
|
navbar: initialUserExperience.navbar
|
7294
7635
|
}));
|
7295
7636
|
},
|
7296
|
-
custom: !
|
7297
|
-
children: /* @__PURE__ */
|
7637
|
+
custom: !import_lodash5.isEqual(userExperience.navbar, initialUserExperience.navbar),
|
7638
|
+
children: /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(SettingsTable_default, {
|
7298
7639
|
...componentsProps?.table,
|
7299
7640
|
children: [
|
7300
|
-
/* @__PURE__ */
|
7641
|
+
/* @__PURE__ */ jsx_dev_runtime33.jsxDEV(SettingsTable_default.Row, {
|
7301
7642
|
label: "Select which pages you want to display or hide",
|
7302
|
-
children: /* @__PURE__ */
|
7643
|
+
children: /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(import_core25.Chip.Group, {
|
7303
7644
|
multiple: true,
|
7304
7645
|
value: app.navigablePages.filter((p) => !userExperience.navbar.hiddenPages.includes(p.href)).map((p) => p.href),
|
7305
7646
|
onChange: (newValue) => {
|
@@ -7311,12 +7652,12 @@ function NavbarSettingsWidget({
|
|
7311
7652
|
}
|
7312
7653
|
}));
|
7313
7654
|
},
|
7314
|
-
children: /* @__PURE__ */
|
7655
|
+
children: /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(import_core25.Group, {
|
7315
7656
|
justify: "flex-start",
|
7316
7657
|
gap: "xs",
|
7317
|
-
children: app.navigablePages.map((p) => ({ ...p, icon: p.icon ??
|
7658
|
+
children: app.navigablePages.map((p) => ({ ...p, icon: p.icon ?? import_icons_react12.IconLink })).map((p, i) => /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(import_core25.Chip, {
|
7318
7659
|
value: p.href,
|
7319
|
-
icon: /* @__PURE__ */
|
7660
|
+
icon: /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(p.icon, {
|
7320
7661
|
...theme.iconProps.tiny,
|
7321
7662
|
color: theme.primaryColor
|
7322
7663
|
}, undefined, false, undefined, this),
|
@@ -7330,7 +7671,7 @@ function NavbarSettingsWidget({
|
|
7330
7671
|
if (isValidElementOfType(SettingsTable_default.Row, row)) {
|
7331
7672
|
return row;
|
7332
7673
|
}
|
7333
|
-
return /* @__PURE__ */
|
7674
|
+
return /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(SettingsTable_default.Row, {
|
7334
7675
|
...row
|
7335
7676
|
}, i, false, undefined, this);
|
7336
7677
|
})
|
@@ -7339,8 +7680,8 @@ function NavbarSettingsWidget({
|
|
7339
7680
|
}, undefined, false, undefined, this);
|
7340
7681
|
}
|
7341
7682
|
// src/core/components/ContextClusterProvider/index.tsx
|
7342
|
-
var
|
7343
|
-
var
|
7683
|
+
var import_react19 = __toESM(require("react"));
|
7684
|
+
var jsx_dev_runtime34 = require("react/jsx-dev-runtime");
|
7344
7685
|
var createContextCluster = (generalDefaultValue, staticIds) => {
|
7345
7686
|
const isStaticId = (id) => {
|
7346
7687
|
if (staticIds?.find((staticId) => staticId === id)) {
|
@@ -7351,16 +7692,16 @@ var createContextCluster = (generalDefaultValue, staticIds) => {
|
|
7351
7692
|
const contexts = {};
|
7352
7693
|
const defaultValues = {};
|
7353
7694
|
const createContext8 = (id, defaultValue) => {
|
7354
|
-
const context =
|
7695
|
+
const context = import_react19.default.createContext(defaultValue ?? generalDefaultValue);
|
7355
7696
|
contexts[id] = context;
|
7356
7697
|
defaultValues[id] = defaultValue ?? generalDefaultValue;
|
7357
7698
|
return context;
|
7358
7699
|
};
|
7359
7700
|
const useContext11 = (id) => {
|
7360
7701
|
if (isStaticId(id)) {
|
7361
|
-
return contexts[id] ?
|
7702
|
+
return contexts[id] ? import_react19.default.useContext(contexts[id]) : generalDefaultValue;
|
7362
7703
|
}
|
7363
|
-
return contexts[id] ?
|
7704
|
+
return contexts[id] ? import_react19.default.useContext(contexts[id]) : null;
|
7364
7705
|
};
|
7365
7706
|
return {
|
7366
7707
|
contexts,
|
@@ -7375,8 +7716,8 @@ function ContextClusterProvider({
|
|
7375
7716
|
values = {},
|
7376
7717
|
children
|
7377
7718
|
}) {
|
7378
|
-
return Object.entries(cluster.contexts).reduceRight((t, [id, context]) => /* @__PURE__ */
|
7719
|
+
return Object.entries(cluster.contexts).reduceRight((t, [id, context]) => context ? /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(context.Provider, {
|
7379
7720
|
value: values[id] ?? cluster.defaultValues[id] ?? cluster.generalDefaultValue,
|
7380
7721
|
children: t
|
7381
|
-
}, undefined, false, undefined, this), children);
|
7722
|
+
}, undefined, false, undefined, this) : t, children);
|
7382
7723
|
}
|