remoraid 2.7.2 → 2.14.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/index.cjs +819 -503
- package/dist/core/index.d.ts +312 -118
- package/dist/core/index.js +814 -489
- package/dist/server/index.d.ts +2 -2
- package/package.json +2 -1
package/dist/core/index.cjs
CHANGED
@@ -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 Stack4(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
|
+
Stack4.prototype.clear = stackClear;
|
1039
|
+
Stack4.prototype["delete"] = stackDelete;
|
1040
|
+
Stack4.prototype.get = stackGet;
|
1041
|
+
Stack4.prototype.has = stackHas;
|
1042
|
+
Stack4.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 Stack4);
|
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 Stack4);
|
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 Stack4);
|
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 Stack4);
|
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 Stack4;
|
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 Stack4);
|
1564
1564
|
if (isObject(srcValue)) {
|
1565
1565
|
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
1566
1566
|
} else {
|
@@ -5467,17 +5467,31 @@ __export(exports_core, {
|
|
5467
5467
|
useRemoraidTheme: () => useRemoraidTheme,
|
5468
5468
|
useRemoraidApp: () => useRemoraidApp,
|
5469
5469
|
usePage: () => usePage,
|
5470
|
+
useLayouts: () => useLayouts,
|
5470
5471
|
useHydrationStatus: () => useHydrationStatus,
|
5471
5472
|
useHydratedMantineColorScheme: () => useHydratedMantineColorScheme,
|
5473
|
+
useFrameLayout: () => useFrameLayout,
|
5474
|
+
isValidElementOfType: () => isValidElementOfType,
|
5475
|
+
isFrameLayout: () => isFrameLayout,
|
5476
|
+
getElementTypeName: () => getElementTypeName,
|
5472
5477
|
defaultUserExperienceCookieName: () => defaultUserExperienceCookieName,
|
5473
5478
|
defaultUserExperience: () => defaultUserExperience,
|
5474
5479
|
defaultSettingsWidgetOptions: () => defaultSettingsWidgetContext,
|
5475
5480
|
defaultSettingsTableOptions: () => defaultSettingsTableOptions,
|
5476
5481
|
defaultNavbarSettingsWidgetId: () => defaultNavbarSettingsWidgetId,
|
5477
|
-
|
5482
|
+
defaultLayoutsContext: () => defaultLayoutsContext,
|
5483
|
+
defaultFrameLayoutContext: () => defaultFrameLayoutContext,
|
5484
|
+
defaultAppShellNavbarPositions: () => defaultAppShellNavbarPositions,
|
5485
|
+
defaultAppShellLayoutId: () => defaultAppShellLayoutId,
|
5486
|
+
defaultAppShellFooterPositions: () => defaultAppShellFooterPositions,
|
5478
5487
|
defaultAppContext: () => defaultAppContext,
|
5479
5488
|
createUserExperienceContext: () => createUserExperienceContext,
|
5480
5489
|
createRemoraidTheme: () => createRemoraidTheme,
|
5490
|
+
createContextCluster: () => createContextCluster,
|
5491
|
+
co: () => co,
|
5492
|
+
asElementOrPropsOfType: () => asElementOrPropsOfType,
|
5493
|
+
asElementOfType: () => asElementOfType,
|
5494
|
+
asChildrenOfType: () => asChildrenOfType,
|
5481
5495
|
WidgetWrapper: () => WidgetWrapper_default,
|
5482
5496
|
WidgetSelectionHeader: () => WidgetSelectionHeader,
|
5483
5497
|
Widget: () => Widget,
|
@@ -5495,11 +5509,17 @@ __export(exports_core, {
|
|
5495
5509
|
NotFoundPage: () => NotFoundPage,
|
5496
5510
|
NavbarVariant: () => NavbarVariant,
|
5497
5511
|
NavbarSettingsWidget: () => NavbarSettingsWidget,
|
5512
|
+
LayoutType: () => LayoutType,
|
5498
5513
|
HydrationStatusProvider: () => HydrationStatusProvider,
|
5514
|
+
FrameLayoutVariant: () => FrameLayoutVariant,
|
5515
|
+
FrameLayoutSection: () => FrameLayoutSection,
|
5516
|
+
FrameLayout: () => FrameLayout_default,
|
5517
|
+
FooterVariant: () => FooterVariant,
|
5499
5518
|
EnvironmentShell: () => EnvironmentShell,
|
5519
|
+
ContextClusterProvider: () => ContextClusterProvider,
|
5500
5520
|
BadgeMinimal: () => BadgeMinimal,
|
5501
5521
|
BadgeGroup: () => BadgeGroup,
|
5502
|
-
AppShell: () =>
|
5522
|
+
AppShell: () => AppShell_default,
|
5503
5523
|
AppProvider: () => AppProvider,
|
5504
5524
|
AlertMinimal: () => AlertMinimal,
|
5505
5525
|
AlertCategory: () => AlertCategory
|
@@ -5643,6 +5663,10 @@ var NavbarVariant;
|
|
5643
5663
|
((NavbarVariant2) => {
|
5644
5664
|
NavbarVariant2["Minimal"] = "minimal";
|
5645
5665
|
})(NavbarVariant ||= {});
|
5666
|
+
var FooterVariant;
|
5667
|
+
((FooterVariant2) => {
|
5668
|
+
FooterVariant2["Minimal"] = "minimal";
|
5669
|
+
})(FooterVariant ||= {});
|
5646
5670
|
var AlertCategory;
|
5647
5671
|
((AlertCategory2) => {
|
5648
5672
|
AlertCategory2["Negative"] = "negative";
|
@@ -5665,18 +5689,69 @@ var RemoraidIconSize;
|
|
5665
5689
|
RemoraidIconSize2["Tiny"] = "tiny";
|
5666
5690
|
RemoraidIconSize2["Medium"] = "medium";
|
5667
5691
|
})(RemoraidIconSize ||= {});
|
5692
|
+
var LayoutType;
|
5693
|
+
((LayoutType2) => {
|
5694
|
+
LayoutType2["Frame"] = "frame";
|
5695
|
+
})(LayoutType ||= {});
|
5696
|
+
var FrameLayoutSection;
|
5697
|
+
((FrameLayoutSection2) => {
|
5698
|
+
FrameLayoutSection2["Top"] = "top";
|
5699
|
+
FrameLayoutSection2["Bottom"] = "bottom";
|
5700
|
+
FrameLayoutSection2["Left"] = "left";
|
5701
|
+
FrameLayoutSection2["Right"] = "right";
|
5702
|
+
FrameLayoutSection2["Content"] = "content";
|
5703
|
+
})(FrameLayoutSection ||= {});
|
5704
|
+
var FrameLayoutVariant;
|
5705
|
+
((FrameLayoutVariant2) => {
|
5706
|
+
FrameLayoutVariant2["Plain"] = "plain";
|
5707
|
+
FrameLayoutVariant2["Sticky"] = "sticky";
|
5708
|
+
})(FrameLayoutVariant ||= {});
|
5668
5709
|
|
5669
5710
|
// src/core/lib/utils.ts
|
5711
|
+
var import_react2 = require("react");
|
5670
5712
|
var co = (condition, value, fallback) => condition(value) ? value : fallback;
|
5713
|
+
var isValidElementOfType = (type, value) => {
|
5714
|
+
return import_react2.isValidElement(value) && value.type === type;
|
5715
|
+
};
|
5716
|
+
var getElementTypeName = (type) => {
|
5717
|
+
if (typeof type === "string") {
|
5718
|
+
return type;
|
5719
|
+
}
|
5720
|
+
if (typeof type === "function") {
|
5721
|
+
return type.displayName ?? type.name ?? "anonymous component";
|
5722
|
+
}
|
5723
|
+
return "unknown";
|
5724
|
+
};
|
5725
|
+
var asElementOfType = (type, element, additionalErrorMessage) => {
|
5726
|
+
if (isValidElementOfType(type, element)) {
|
5727
|
+
return element;
|
5728
|
+
}
|
5729
|
+
throw new TypeError(`Expected React element of type ${getElementTypeName(type)}, but received type: ${getElementTypeName(element.type)}.${additionalErrorMessage !== undefined && additionalErrorMessage.length > 0 ? ` ${additionalErrorMessage}` : ""}`);
|
5730
|
+
};
|
5731
|
+
var asChildrenOfType = (type, children, additionalErrorMessage) => {
|
5732
|
+
if (children === undefined || children === null) {
|
5733
|
+
return children;
|
5734
|
+
}
|
5735
|
+
if (Array.isArray(children)) {
|
5736
|
+
return children.map((child) => asChildrenOfType(type, child, additionalErrorMessage));
|
5737
|
+
}
|
5738
|
+
return asElementOfType(type, children, additionalErrorMessage);
|
5739
|
+
};
|
5740
|
+
var asElementOrPropsOfType = (type, elementOrProps, additionalErrorMessage) => {
|
5741
|
+
if (import_react2.isValidElement(elementOrProps)) {
|
5742
|
+
return asElementOfType(type, elementOrProps, additionalErrorMessage);
|
5743
|
+
}
|
5744
|
+
return elementOrProps;
|
5745
|
+
};
|
5671
5746
|
|
5672
5747
|
// src/core/components/RemoraidProvider/ThemeProvider/index.tsx
|
5673
5748
|
var import_core2 = require("@mantine/core");
|
5674
5749
|
var import_icons_react = require("@tabler/icons-react");
|
5675
|
-
var
|
5750
|
+
var import_react4 = __toESM(require("react"));
|
5676
5751
|
|
5677
5752
|
// src/core/components/RemoraidProvider/HydrationStatusProvider/index.tsx
|
5678
5753
|
var import_core = require("@mantine/core");
|
5679
|
-
var
|
5754
|
+
var import_react3 = require("react");
|
5680
5755
|
var jsx_dev_runtime2 = require("react/jsx-dev-runtime");
|
5681
5756
|
var defaultHydrationStatus = {
|
5682
5757
|
hasHydrated: false,
|
@@ -5684,9 +5759,9 @@ var defaultHydrationStatus = {
|
|
5684
5759
|
return;
|
5685
5760
|
}
|
5686
5761
|
};
|
5687
|
-
var hydrationStatusContext =
|
5762
|
+
var hydrationStatusContext = import_react3.createContext(defaultHydrationStatus);
|
5688
5763
|
var useHydrationStatus = () => {
|
5689
|
-
return
|
5764
|
+
return import_react3.useContext(hydrationStatusContext);
|
5690
5765
|
};
|
5691
5766
|
var useHydratedMantineColorScheme = () => {
|
5692
5767
|
const { ensureHydration } = useHydrationStatus();
|
@@ -5695,12 +5770,12 @@ var useHydratedMantineColorScheme = () => {
|
|
5695
5770
|
function HydrationStatusProvider({
|
5696
5771
|
children
|
5697
5772
|
}) {
|
5698
|
-
const [hasHydrated, setHasHydrated] =
|
5699
|
-
const hydrationStatus =
|
5773
|
+
const [hasHydrated, setHasHydrated] = import_react3.useState(defaultHydrationStatus.hasHydrated);
|
5774
|
+
const hydrationStatus = import_react3.useMemo(() => ({
|
5700
5775
|
hasHydrated,
|
5701
5776
|
ensureHydration: (v) => hasHydrated ? v : undefined
|
5702
5777
|
}), [hasHydrated]);
|
5703
|
-
|
5778
|
+
import_react3.useEffect(() => {
|
5704
5779
|
setHasHydrated(true);
|
5705
5780
|
}, []);
|
5706
5781
|
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(hydrationStatusContext.Provider, {
|
@@ -5800,9 +5875,9 @@ var createRemoraidTheme = (customTheme, dependencies) => {
|
|
5800
5875
|
}
|
5801
5876
|
};
|
5802
5877
|
};
|
5803
|
-
var themeContext =
|
5878
|
+
var themeContext = import_react4.default.createContext(createRemoraidTheme());
|
5804
5879
|
var useRemoraidTheme = () => {
|
5805
|
-
return
|
5880
|
+
return import_react4.useContext(themeContext);
|
5806
5881
|
};
|
5807
5882
|
function ThemeProvider({
|
5808
5883
|
theme,
|
@@ -5810,7 +5885,7 @@ function ThemeProvider({
|
|
5810
5885
|
}) {
|
5811
5886
|
const mantineTheme = import_core2.useMantineTheme();
|
5812
5887
|
const { colorScheme } = useHydratedMantineColorScheme();
|
5813
|
-
const remoraidTheme =
|
5888
|
+
const remoraidTheme = import_react4.useMemo(() => {
|
5814
5889
|
const dependencies = {
|
5815
5890
|
mantineTheme,
|
5816
5891
|
colorScheme
|
@@ -5827,85 +5902,232 @@ function ThemeProvider({
|
|
5827
5902
|
var import_react_cookie2 = require("react-cookie");
|
5828
5903
|
|
5829
5904
|
// src/core/components/RemoraidProvider/CoreUserExperienceProvider/index.tsx
|
5905
|
+
var import_react6 = require("react");
|
5906
|
+
|
5907
|
+
// src/core/components/UserExperienceProviderWrapper/index.tsx
|
5908
|
+
var import_react5 = require("react");
|
5909
|
+
var import_react_cookie = require("react-cookie");
|
5910
|
+
var jsx_dev_runtime4 = require("react/jsx-dev-runtime");
|
5911
|
+
var createUserExperienceContext = (defaultUserExperience) => import_react5.createContext({
|
5912
|
+
userExperience: defaultUserExperience,
|
5913
|
+
updateUserExperience: () => {},
|
5914
|
+
processedCookie: false,
|
5915
|
+
initialUserExperience: defaultUserExperience
|
5916
|
+
});
|
5917
|
+
function UserExperienceProviderWrapper({
|
5918
|
+
children,
|
5919
|
+
context,
|
5920
|
+
cookieName,
|
5921
|
+
defaultUserExperience,
|
5922
|
+
isValidUserExperience,
|
5923
|
+
initialValue
|
5924
|
+
}) {
|
5925
|
+
const [cookies, setCookie] = import_react_cookie.useCookies();
|
5926
|
+
let initialUserExperience = defaultUserExperience;
|
5927
|
+
if (typeof initialValue === "object" && typeof initialUserExperience === "object") {
|
5928
|
+
initialUserExperience = { ...initialUserExperience, ...initialValue };
|
5929
|
+
}
|
5930
|
+
const [userExperience, setUserExperience] = import_react5.useState(initialUserExperience);
|
5931
|
+
const [processedCookie, setProcessedCookie] = import_react5.useState(false);
|
5932
|
+
const updateUserExperience = (p) => {
|
5933
|
+
const updatedUserExperience = typeof p === "function" ? p(userExperience) : p;
|
5934
|
+
setCookie(cookieName, updatedUserExperience, { path: "/" });
|
5935
|
+
setUserExperience(updatedUserExperience);
|
5936
|
+
};
|
5937
|
+
import_react5.useEffect(() => {
|
5938
|
+
const userExperienceCookie = cookies[cookieName];
|
5939
|
+
if (userExperienceCookie && isValidUserExperience(userExperienceCookie)) {
|
5940
|
+
setUserExperience(userExperienceCookie);
|
5941
|
+
}
|
5942
|
+
if (cookies && !processedCookie) {
|
5943
|
+
setProcessedCookie(true);
|
5944
|
+
}
|
5945
|
+
}, [cookies]);
|
5946
|
+
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(context.Provider, {
|
5947
|
+
value: {
|
5948
|
+
userExperience,
|
5949
|
+
updateUserExperience,
|
5950
|
+
processedCookie,
|
5951
|
+
initialUserExperience
|
5952
|
+
},
|
5953
|
+
children
|
5954
|
+
}, undefined, false, undefined, this);
|
5955
|
+
}
|
5956
|
+
|
5957
|
+
// src/core/components/RemoraidProvider/CoreUserExperienceProvider/index.tsx
|
5958
|
+
var jsx_dev_runtime5 = require("react/jsx-dev-runtime");
|
5959
|
+
var defaultUserExperience = {
|
5960
|
+
showWelcomeMessage: true,
|
5961
|
+
navbar: { hiddenPages: [] }
|
5962
|
+
};
|
5963
|
+
var defaultUserExperienceCookieName = "remoraid-core-user-experience";
|
5964
|
+
var coreUserExperienceContext = createUserExperienceContext(defaultUserExperience);
|
5965
|
+
var useRemoraidUserExperience = () => {
|
5966
|
+
return import_react6.useContext(coreUserExperienceContext);
|
5967
|
+
};
|
5968
|
+
function CoreUserExperienceProvider({
|
5969
|
+
children,
|
5970
|
+
initialValue,
|
5971
|
+
cookieName
|
5972
|
+
}) {
|
5973
|
+
const isValidUserExperience = (x) => {
|
5974
|
+
if (typeof x !== "object") {
|
5975
|
+
return false;
|
5976
|
+
}
|
5977
|
+
if (x === null) {
|
5978
|
+
return false;
|
5979
|
+
}
|
5980
|
+
if (!("showWelcomeMessage" in x)) {
|
5981
|
+
return false;
|
5982
|
+
}
|
5983
|
+
if (!("navbar" in x)) {
|
5984
|
+
return false;
|
5985
|
+
}
|
5986
|
+
return true;
|
5987
|
+
};
|
5988
|
+
return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(UserExperienceProviderWrapper, {
|
5989
|
+
context: coreUserExperienceContext,
|
5990
|
+
isValidUserExperience,
|
5991
|
+
cookieName: cookieName ?? defaultUserExperienceCookieName,
|
5992
|
+
defaultUserExperience,
|
5993
|
+
initialValue,
|
5994
|
+
children
|
5995
|
+
}, undefined, false, undefined, this);
|
5996
|
+
}
|
5997
|
+
|
5998
|
+
// src/core/components/RemoraidProvider/LayoutsProvider/index.tsx
|
5830
5999
|
var import_react7 = require("react");
|
6000
|
+
var jsx_dev_runtime6 = require("react/jsx-dev-runtime");
|
6001
|
+
var defaultLayoutsContext = {
|
6002
|
+
layouts: {},
|
6003
|
+
setLayouts: () => {}
|
6004
|
+
};
|
6005
|
+
var layoutsContext = import_react7.createContext(defaultLayoutsContext);
|
6006
|
+
var useLayouts = () => {
|
6007
|
+
return import_react7.useContext(layoutsContext);
|
6008
|
+
};
|
6009
|
+
function LayoutsProvider({
|
6010
|
+
children
|
6011
|
+
}) {
|
6012
|
+
const [layouts, setLayouts] = import_react7.useState({});
|
6013
|
+
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(layoutsContext.Provider, {
|
6014
|
+
value: { layouts, setLayouts },
|
6015
|
+
children
|
6016
|
+
}, undefined, false, undefined, this);
|
6017
|
+
}
|
6018
|
+
|
6019
|
+
// src/core/components/RemoraidProvider/index.tsx
|
6020
|
+
var jsx_dev_runtime7 = require("react/jsx-dev-runtime");
|
6021
|
+
function RemoraidProvider({
|
6022
|
+
children,
|
6023
|
+
theme,
|
6024
|
+
initialUserExperience,
|
6025
|
+
componentsProps
|
6026
|
+
}) {
|
6027
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_react_cookie2.CookiesProvider, {
|
6028
|
+
...componentsProps?.CookiesProvider,
|
6029
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(HydrationStatusProvider, {
|
6030
|
+
...componentsProps?.HydrationStatusProviderProps,
|
6031
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemeProvider, {
|
6032
|
+
theme,
|
6033
|
+
...componentsProps?.ThemeProvider,
|
6034
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(CoreUserExperienceProvider, {
|
6035
|
+
initialValue: initialUserExperience,
|
6036
|
+
...componentsProps?.CoreUserExperienceProvider,
|
6037
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(WidgetsProvider, {
|
6038
|
+
...componentsProps?.WidgetsProvider,
|
6039
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(LayoutsProvider, {
|
6040
|
+
...componentsProps?.LayoutsProviderProps,
|
6041
|
+
children
|
6042
|
+
}, undefined, false, undefined, this)
|
6043
|
+
}, undefined, false, undefined, this)
|
6044
|
+
}, undefined, false, undefined, this)
|
6045
|
+
}, undefined, false, undefined, this)
|
6046
|
+
}, undefined, false, undefined, this)
|
6047
|
+
}, undefined, false, undefined, this);
|
6048
|
+
}
|
6049
|
+
// src/core/components/AppShell/index.tsx
|
6050
|
+
var import_core7 = require("@mantine/core");
|
5831
6051
|
|
5832
6052
|
// src/core/components/AppShell/NavbarMinimal/index.tsx
|
5833
6053
|
var import_core3 = require("@mantine/core");
|
5834
6054
|
var import_icons_react2 = require("@tabler/icons-react");
|
5835
6055
|
var import_link = __toESM(require("next/link"));
|
5836
6056
|
var import_navigation = require("next/navigation");
|
5837
|
-
var
|
6057
|
+
var import_react9 = require("react");
|
5838
6058
|
|
5839
6059
|
// src/core/components/AppShell/AppProvider/index.tsx
|
5840
|
-
var
|
5841
|
-
var
|
5842
|
-
var defaultAppContext = {
|
5843
|
-
|
6060
|
+
var import_react8 = require("react");
|
6061
|
+
var jsx_dev_runtime8 = require("react/jsx-dev-runtime");
|
6062
|
+
var defaultAppContext = {
|
6063
|
+
navigablePages: []
|
6064
|
+
};
|
6065
|
+
var appContext = import_react8.createContext(defaultAppContext);
|
5844
6066
|
var useRemoraidApp = () => {
|
5845
|
-
return
|
6067
|
+
return import_react8.useContext(appContext);
|
5846
6068
|
};
|
5847
6069
|
function AppProvider({
|
5848
|
-
|
5849
|
-
|
5850
|
-
user
|
6070
|
+
appContext: appContextProps,
|
6071
|
+
children
|
5851
6072
|
}) {
|
5852
|
-
return /* @__PURE__ */
|
5853
|
-
value: {
|
6073
|
+
return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(appContext.Provider, {
|
6074
|
+
value: { ...appContextProps },
|
5854
6075
|
children
|
5855
6076
|
}, undefined, false, undefined, this);
|
5856
6077
|
}
|
5857
6078
|
|
5858
6079
|
// src/core/components/AppShell/NavbarMinimal/index.tsx
|
5859
|
-
var
|
6080
|
+
var jsx_dev_runtime9 = require("react/jsx-dev-runtime");
|
5860
6081
|
function NavbarLink({
|
5861
6082
|
icon,
|
6083
|
+
linkSize,
|
6084
|
+
iconSize,
|
5862
6085
|
label,
|
5863
6086
|
active,
|
5864
6087
|
onClick,
|
5865
6088
|
href,
|
5866
|
-
indicator
|
5867
|
-
settings
|
6089
|
+
indicator
|
5868
6090
|
}) {
|
5869
|
-
const [isHoveringRoleIndicator, setIsHoveringRoleIndicator] =
|
6091
|
+
const [isHoveringRoleIndicator, setIsHoveringRoleIndicator] = import_react9.useState(false);
|
5870
6092
|
const iconProps = {
|
5871
|
-
size:
|
6093
|
+
size: iconSize,
|
5872
6094
|
stroke: 1.5
|
5873
6095
|
};
|
5874
6096
|
const Icon2 = icon ?? import_icons_react2.IconLink;
|
5875
6097
|
if (!href) {
|
5876
|
-
return /* @__PURE__ */
|
6098
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Tooltip, {
|
5877
6099
|
label,
|
5878
6100
|
position: "right",
|
5879
6101
|
transitionProps: { duration: 0 },
|
5880
|
-
children: /* @__PURE__ */
|
6102
|
+
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.UnstyledButton, {
|
5881
6103
|
onClick,
|
5882
6104
|
className: "remoraid-navbar-minimal-link",
|
5883
6105
|
"data-active": active || undefined,
|
5884
|
-
w:
|
5885
|
-
h:
|
5886
|
-
children: /* @__PURE__ */
|
6106
|
+
w: linkSize,
|
6107
|
+
h: linkSize,
|
6108
|
+
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Icon2, {
|
5887
6109
|
...iconProps
|
5888
6110
|
}, undefined, false, undefined, this)
|
5889
6111
|
}, undefined, false, undefined, this)
|
5890
6112
|
}, undefined, false, undefined, this);
|
5891
6113
|
}
|
5892
|
-
const button = /* @__PURE__ */
|
6114
|
+
const button = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.UnstyledButton, {
|
5893
6115
|
onClick,
|
5894
6116
|
className: "remoraid-navbar-minimal-link",
|
5895
6117
|
"data-active": active || undefined,
|
5896
|
-
w:
|
5897
|
-
h:
|
6118
|
+
w: linkSize,
|
6119
|
+
h: linkSize,
|
5898
6120
|
component: import_link.default,
|
5899
6121
|
href,
|
5900
|
-
children: /* @__PURE__ */
|
6122
|
+
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Icon2, {
|
5901
6123
|
...iconProps
|
5902
6124
|
}, undefined, false, undefined, this)
|
5903
6125
|
}, undefined, false, undefined, this);
|
5904
|
-
return /* @__PURE__ */
|
6126
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Tooltip, {
|
5905
6127
|
label,
|
5906
6128
|
position: "right",
|
5907
6129
|
transitionProps: { duration: 0 },
|
5908
|
-
children: indicator === undefined ? button : /* @__PURE__ */
|
6130
|
+
children: indicator === undefined ? button : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Indicator, {
|
5909
6131
|
withBorder: true,
|
5910
6132
|
size: 13,
|
5911
6133
|
offset: 2,
|
@@ -5916,98 +6138,94 @@ function NavbarLink({
|
|
5916
6138
|
}, undefined, false, undefined, this)
|
5917
6139
|
}, undefined, false, undefined, this);
|
5918
6140
|
}
|
5919
|
-
var defaultSettings = {
|
5920
|
-
hiddenPages: [],
|
5921
|
-
linkSize: import_core3.rem("50px"),
|
5922
|
-
iconSize: "50%",
|
5923
|
-
px: "sm",
|
5924
|
-
py: "md"
|
5925
|
-
};
|
5926
6141
|
function NavbarMinimal({
|
5927
|
-
|
5928
|
-
|
5929
|
-
settings: settingsProp,
|
6142
|
+
linkSize = import_core3.rem("50px"),
|
6143
|
+
iconSize = "50%",
|
5930
6144
|
linkIndicator,
|
5931
6145
|
logoIndicator,
|
5932
|
-
|
6146
|
+
componentsProps
|
5933
6147
|
}) {
|
5934
|
-
const { userExperience } = useRemoraidUserExperience();
|
5935
6148
|
const pathname = import_navigation.usePathname();
|
5936
6149
|
const theme = useRemoraidTheme();
|
5937
6150
|
const { setColorScheme, colorScheme } = useHydratedMantineColorScheme();
|
5938
|
-
const
|
5939
|
-
const
|
5940
|
-
const
|
5941
|
-
|
5942
|
-
|
6151
|
+
const { userExperience } = useRemoraidUserExperience();
|
6152
|
+
const { navigablePages, logo, auth } = useRemoraidApp();
|
6153
|
+
const [isHoveringRoleIndicator, setIsHoveringRoleIndicator] = import_react9.useState(false);
|
6154
|
+
const linkProps = {
|
6155
|
+
linkSize,
|
6156
|
+
iconSize,
|
6157
|
+
...componentsProps?.link
|
5943
6158
|
};
|
5944
|
-
const links =
|
6159
|
+
const links = navigablePages.filter((link) => !userExperience.navbar.hiddenPages.includes(link.href)).map((link) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(NavbarLink, {
|
5945
6160
|
active: link.href === pathname,
|
5946
6161
|
indicator: linkIndicator,
|
5947
|
-
|
5948
|
-
...
|
6162
|
+
...link,
|
6163
|
+
...linkProps
|
5949
6164
|
}, link.label, false, undefined, this));
|
5950
|
-
const
|
6165
|
+
const logoProps = {
|
5951
6166
|
style: {
|
5952
6167
|
cursor: "pointer",
|
5953
|
-
width:
|
5954
|
-
height:
|
6168
|
+
width: linkSize,
|
6169
|
+
height: linkSize
|
5955
6170
|
}
|
5956
|
-
}
|
5957
|
-
return /* @__PURE__ */
|
6171
|
+
};
|
6172
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Paper, {
|
5958
6173
|
h: "100%",
|
5959
|
-
|
5960
|
-
bg: theme.transparentBackground,
|
5961
|
-
radius: 0,
|
6174
|
+
p: "md",
|
5962
6175
|
shadow: "md",
|
5963
|
-
|
6176
|
+
bg: theme.transparentBackground,
|
6177
|
+
...componentsProps?.container,
|
6178
|
+
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Flex, {
|
5964
6179
|
direction: "column",
|
5965
6180
|
h: "100%",
|
5966
6181
|
align: "center",
|
5967
|
-
px: settings.px,
|
5968
6182
|
children: [
|
5969
|
-
|
5970
|
-
|
5971
|
-
|
5972
|
-
|
5973
|
-
|
5974
|
-
|
5975
|
-
|
5976
|
-
|
5977
|
-
|
5978
|
-
|
5979
|
-
|
5980
|
-
|
5981
|
-
|
5982
|
-
|
5983
|
-
|
6183
|
+
logo !== undefined && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
|
6184
|
+
children: [
|
6185
|
+
logoIndicator === undefined ? logo(logoProps) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Indicator, {
|
6186
|
+
withBorder: true,
|
6187
|
+
offset: 2,
|
6188
|
+
size: 13,
|
6189
|
+
onMouseEnter: () => setIsHoveringRoleIndicator(true),
|
6190
|
+
onMouseLeave: () => setIsHoveringRoleIndicator(false),
|
6191
|
+
...logoIndicator(isHoveringRoleIndicator),
|
6192
|
+
children: logo(logoProps)
|
6193
|
+
}, undefined, false, undefined, this),
|
6194
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Divider, {
|
6195
|
+
my: "md",
|
6196
|
+
variant: "dashed",
|
6197
|
+
w: "100%"
|
6198
|
+
}, undefined, false, undefined, this)
|
6199
|
+
]
|
6200
|
+
}, undefined, true, undefined, this),
|
6201
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Stack, {
|
5984
6202
|
justify: "flex-start",
|
5985
6203
|
gap: 0,
|
5986
6204
|
flex: 1,
|
5987
6205
|
children: links
|
5988
6206
|
}, undefined, false, undefined, this),
|
5989
|
-
/* @__PURE__ */
|
6207
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Stack, {
|
5990
6208
|
justify: "center",
|
5991
6209
|
gap: 0,
|
5992
6210
|
children: [
|
5993
|
-
|
6211
|
+
auth !== undefined && (auth.user === null ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(NavbarLink, {
|
5994
6212
|
icon: import_icons_react2.IconLogin,
|
5995
6213
|
label: "Login",
|
5996
6214
|
href: "/login",
|
5997
6215
|
active: pathname === "/login",
|
5998
|
-
|
5999
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
6216
|
+
...linkProps
|
6217
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(NavbarLink, {
|
6000
6218
|
icon: import_icons_react2.IconLogout,
|
6001
6219
|
label: "Logout",
|
6002
6220
|
onClick: () => {
|
6003
|
-
if (onLogout) {
|
6004
|
-
onLogout();
|
6221
|
+
if (auth.onLogout) {
|
6222
|
+
auth.onLogout();
|
6005
6223
|
}
|
6006
6224
|
},
|
6007
6225
|
href: "/login",
|
6008
|
-
|
6226
|
+
...linkProps
|
6009
6227
|
}, undefined, false, undefined, this)),
|
6010
|
-
/* @__PURE__ */
|
6228
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(NavbarLink, {
|
6011
6229
|
icon: colorScheme === "dark" ? import_icons_react2.IconSun : import_icons_react2.IconMoon,
|
6012
6230
|
onClick: () => {
|
6013
6231
|
if (!colorScheme || !setColorScheme) {
|
@@ -6016,7 +6234,7 @@ function NavbarMinimal({
|
|
6016
6234
|
setColorScheme(colorScheme === "dark" ? "light" : "dark");
|
6017
6235
|
},
|
6018
6236
|
label: "Toggle Color Scheme",
|
6019
|
-
|
6237
|
+
...linkProps
|
6020
6238
|
}, undefined, false, undefined, this)
|
6021
6239
|
]
|
6022
6240
|
}, undefined, true, undefined, this)
|
@@ -6025,259 +6243,323 @@ function NavbarMinimal({
|
|
6025
6243
|
}, undefined, false, undefined, this);
|
6026
6244
|
}
|
6027
6245
|
|
6028
|
-
// src/core/components/
|
6029
|
-
var import_react6 = require("react");
|
6030
|
-
var import_react_cookie = require("react-cookie");
|
6031
|
-
var jsx_dev_runtime6 = require("react/jsx-dev-runtime");
|
6032
|
-
var createUserExperienceContext = (defaultUserExperience) => import_react6.createContext({
|
6033
|
-
userExperience: defaultUserExperience,
|
6034
|
-
updateUserExperience: () => {},
|
6035
|
-
processedCookie: false,
|
6036
|
-
initialUserExperience: defaultUserExperience
|
6037
|
-
});
|
6038
|
-
function UserExperienceProviderWrapper({
|
6039
|
-
children,
|
6040
|
-
context,
|
6041
|
-
cookieName,
|
6042
|
-
defaultUserExperience,
|
6043
|
-
isValidUserExperience,
|
6044
|
-
initialValue
|
6045
|
-
}) {
|
6046
|
-
const [cookies, setCookie] = import_react_cookie.useCookies();
|
6047
|
-
const initialUserExperience = {
|
6048
|
-
...defaultUserExperience,
|
6049
|
-
...initialValue
|
6050
|
-
};
|
6051
|
-
const [userExperience, setUserExperience] = import_react6.useState(initialUserExperience);
|
6052
|
-
const [processedCookie, setProcessedCookie] = import_react6.useState(false);
|
6053
|
-
const updateUserExperience = (p) => {
|
6054
|
-
const updatedUserExperience = typeof p === "function" ? p(userExperience) : p;
|
6055
|
-
setCookie(cookieName, updatedUserExperience, { path: "/" });
|
6056
|
-
setUserExperience(updatedUserExperience);
|
6057
|
-
};
|
6058
|
-
import_react6.useEffect(() => {
|
6059
|
-
const userExperienceCookie = cookies[cookieName];
|
6060
|
-
if (userExperienceCookie && isValidUserExperience(userExperienceCookie)) {
|
6061
|
-
setUserExperience(userExperienceCookie);
|
6062
|
-
}
|
6063
|
-
if (cookies && !processedCookie) {
|
6064
|
-
setProcessedCookie(true);
|
6065
|
-
}
|
6066
|
-
}, [cookies]);
|
6067
|
-
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(context.Provider, {
|
6068
|
-
value: {
|
6069
|
-
userExperience,
|
6070
|
-
updateUserExperience,
|
6071
|
-
processedCookie,
|
6072
|
-
initialUserExperience
|
6073
|
-
},
|
6074
|
-
children
|
6075
|
-
}, undefined, false, undefined, this);
|
6076
|
-
}
|
6077
|
-
|
6078
|
-
// src/core/components/RemoraidProvider/CoreUserExperienceProvider/index.tsx
|
6079
|
-
var jsx_dev_runtime7 = require("react/jsx-dev-runtime");
|
6080
|
-
var defaultNavbarSettings = {
|
6081
|
-
["minimal" /* Minimal */]: defaultSettings
|
6082
|
-
};
|
6083
|
-
var defaultUserExperience = {
|
6084
|
-
navbarVariant: "minimal" /* Minimal */,
|
6085
|
-
navbarSettings: defaultNavbarSettings["minimal" /* Minimal */],
|
6086
|
-
showWelcomeMessage: true
|
6087
|
-
};
|
6088
|
-
var defaultUserExperienceCookieName = "remoraid-core-user-experience";
|
6089
|
-
var coreUserExperienceContext = createUserExperienceContext(defaultUserExperience);
|
6090
|
-
var useRemoraidUserExperience = () => {
|
6091
|
-
return import_react7.useContext(coreUserExperienceContext);
|
6092
|
-
};
|
6093
|
-
function CoreUserExperienceProvider({
|
6094
|
-
children,
|
6095
|
-
initialValue,
|
6096
|
-
cookieName
|
6097
|
-
}) {
|
6098
|
-
const isValidUserExperience = (x) => {
|
6099
|
-
if (typeof x !== "object") {
|
6100
|
-
return false;
|
6101
|
-
}
|
6102
|
-
if (x === null) {
|
6103
|
-
return false;
|
6104
|
-
}
|
6105
|
-
if (!("showWelcomeMessage" in x)) {
|
6106
|
-
return false;
|
6107
|
-
}
|
6108
|
-
if (!("navbarVariant" in x)) {
|
6109
|
-
return false;
|
6110
|
-
}
|
6111
|
-
if (!("navbarSettings" in x)) {
|
6112
|
-
return false;
|
6113
|
-
}
|
6114
|
-
if (typeof x.navbarSettings !== "object") {
|
6115
|
-
return false;
|
6116
|
-
}
|
6117
|
-
if (x.navbarSettings === null) {
|
6118
|
-
return false;
|
6119
|
-
}
|
6120
|
-
if (!("hiddenPages" in x.navbarSettings)) {
|
6121
|
-
return false;
|
6122
|
-
}
|
6123
|
-
if (!("linkSize" in x.navbarSettings)) {
|
6124
|
-
return false;
|
6125
|
-
}
|
6126
|
-
if (!("px" in x.navbarSettings)) {
|
6127
|
-
return false;
|
6128
|
-
}
|
6129
|
-
if (!("py" in x.navbarSettings)) {
|
6130
|
-
return false;
|
6131
|
-
}
|
6132
|
-
return true;
|
6133
|
-
};
|
6134
|
-
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(UserExperienceProviderWrapper, {
|
6135
|
-
context: coreUserExperienceContext,
|
6136
|
-
isValidUserExperience,
|
6137
|
-
cookieName: cookieName ?? defaultUserExperienceCookieName,
|
6138
|
-
defaultUserExperience,
|
6139
|
-
initialValue,
|
6140
|
-
children
|
6141
|
-
}, undefined, false, undefined, this);
|
6142
|
-
}
|
6143
|
-
|
6144
|
-
// src/core/components/RemoraidProvider/index.tsx
|
6145
|
-
var jsx_dev_runtime8 = require("react/jsx-dev-runtime");
|
6146
|
-
function RemoraidProvider({
|
6147
|
-
children,
|
6148
|
-
theme,
|
6149
|
-
initialUserExperience,
|
6150
|
-
componentsProps
|
6151
|
-
}) {
|
6152
|
-
return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(import_react_cookie2.CookiesProvider, {
|
6153
|
-
...componentsProps?.CookiesProvider,
|
6154
|
-
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(HydrationStatusProvider, {
|
6155
|
-
...componentsProps?.HydrationStatusProviderProps,
|
6156
|
-
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemeProvider, {
|
6157
|
-
theme,
|
6158
|
-
...componentsProps?.ThemeProvider,
|
6159
|
-
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(CoreUserExperienceProvider, {
|
6160
|
-
initialValue: initialUserExperience,
|
6161
|
-
...componentsProps?.CoreUserExperienceProvider,
|
6162
|
-
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(WidgetsProvider, {
|
6163
|
-
...componentsProps?.WidgetsProvider,
|
6164
|
-
children
|
6165
|
-
}, undefined, false, undefined, this)
|
6166
|
-
}, undefined, false, undefined, this)
|
6167
|
-
}, undefined, false, undefined, this)
|
6168
|
-
}, undefined, false, undefined, this)
|
6169
|
-
}, undefined, false, undefined, this);
|
6170
|
-
}
|
6171
|
-
// src/core/components/AppShell/index.tsx
|
6172
|
-
var import_core5 = require("@mantine/core");
|
6173
|
-
var import_hooks = require("@mantine/hooks");
|
6174
|
-
|
6175
|
-
// src/core/components/AppShell/Footer/index.tsx
|
6246
|
+
// src/core/components/AppShell/FooterMinimal/index.tsx
|
6176
6247
|
var import_core4 = require("@mantine/core");
|
6177
6248
|
var import_icons_react3 = require("@tabler/icons-react");
|
6178
|
-
var
|
6179
|
-
function
|
6180
|
-
|
6249
|
+
var jsx_dev_runtime10 = require("react/jsx-dev-runtime");
|
6250
|
+
function FooterMinimal({
|
6251
|
+
componentsProps
|
6252
|
+
}) {
|
6253
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_core4.Group, {
|
6181
6254
|
justify: "center",
|
6182
6255
|
w: "100%",
|
6183
6256
|
py: "md",
|
6184
|
-
|
6257
|
+
...componentsProps?.container,
|
6258
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_icons_react3.IconPennant, {
|
6185
6259
|
size: 50,
|
6186
|
-
color: "var(--mantine-color-default-border)"
|
6260
|
+
color: "var(--mantine-color-default-border)",
|
6261
|
+
...componentsProps?.icon
|
6187
6262
|
}, undefined, false, undefined, this)
|
6188
6263
|
}, undefined, false, undefined, this);
|
6189
6264
|
}
|
6190
6265
|
|
6191
|
-
// src/core/components/
|
6192
|
-
var
|
6193
|
-
|
6194
|
-
|
6195
|
-
|
6196
|
-
|
6197
|
-
|
6198
|
-
|
6266
|
+
// src/core/components/FrameLayout/index.tsx
|
6267
|
+
var import_core6 = require("@mantine/core");
|
6268
|
+
var import_react10 = require("react");
|
6269
|
+
|
6270
|
+
// src/core/components/FrameLayout/Element/index.tsx
|
6271
|
+
var import_core5 = require("@mantine/core");
|
6272
|
+
var jsx_dev_runtime11 = require("react/jsx-dev-runtime");
|
6273
|
+
function Element({
|
6274
|
+
section,
|
6275
|
+
includeContainer = true,
|
6276
|
+
layoutId,
|
6277
|
+
componentsProps,
|
6278
|
+
children
|
6279
|
+
}) {
|
6280
|
+
const { layouts } = useLayouts();
|
6281
|
+
const closestLayout = useFrameLayout();
|
6282
|
+
if (closestLayout.layoutId === null) {
|
6283
|
+
return null;
|
6284
|
+
}
|
6285
|
+
const layout = layouts[layoutId ?? closestLayout.layoutId];
|
6286
|
+
if (!isFrameLayout(layout)) {
|
6287
|
+
return null;
|
6288
|
+
}
|
6289
|
+
if (layout.sections[section] === null) {
|
6290
|
+
return null;
|
6291
|
+
}
|
6292
|
+
let containerProps = {};
|
6293
|
+
if (section === "left" /* Left */ || section === "right" /* Right */) {
|
6294
|
+
containerProps.h = "100%";
|
6295
|
+
}
|
6296
|
+
return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(import_core5.Portal, {
|
6297
|
+
target: layout.sections[section],
|
6298
|
+
children: includeContainer ? /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(import_core5.Box, {
|
6299
|
+
...containerProps,
|
6300
|
+
...componentsProps?.container,
|
6301
|
+
children
|
6302
|
+
}, undefined, false, undefined, this) : children
|
6303
|
+
}, undefined, false, undefined, this);
|
6304
|
+
}
|
6305
|
+
|
6306
|
+
// src/core/components/FrameLayout/index.tsx
|
6307
|
+
var jsx_dev_runtime12 = require("react/jsx-dev-runtime");
|
6308
|
+
var isFrameLayout = (layout) => {
|
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);
|
6334
|
+
var useFrameLayout = () => {
|
6335
|
+
return import_react10.useContext(layoutContext);
|
6336
|
+
};
|
6337
|
+
function FrameLayout({
|
6338
|
+
variant = defaultFrameLayoutVariant,
|
6339
|
+
layoutId,
|
6340
|
+
componentsProps,
|
6341
|
+
children
|
6199
6342
|
}) {
|
6200
|
-
const { userExperience } = useRemoraidUserExperience();
|
6201
|
-
const mantineTheme = import_core5.useMantineTheme();
|
6202
6343
|
const theme = useRemoraidTheme();
|
6203
|
-
const {
|
6204
|
-
const
|
6205
|
-
const
|
6206
|
-
|
6207
|
-
|
6208
|
-
|
6344
|
+
const { layouts, setLayouts } = useLayouts();
|
6345
|
+
const layout = layouts[layoutId];
|
6346
|
+
const setLayout = import_react10.useMemo(() => {
|
6347
|
+
return (value) => {
|
6348
|
+
setLayouts((prev) => ({
|
6349
|
+
...prev,
|
6350
|
+
[layoutId]: typeof value === "function" ? value(prev[layoutId]) : value
|
6351
|
+
}));
|
6352
|
+
};
|
6353
|
+
}, [layoutId, setLayouts]);
|
6354
|
+
const topSection = import_react10.useCallback((n) => {
|
6355
|
+
setLayout((prev) => ({
|
6356
|
+
...prev,
|
6357
|
+
sections: { ...prev?.sections, ["top" /* Top */]: n }
|
6358
|
+
}));
|
6359
|
+
}, [setLayout]);
|
6360
|
+
const bottomSection = import_react10.useCallback((n) => {
|
6361
|
+
setLayout((prev) => ({
|
6362
|
+
...prev,
|
6363
|
+
sections: { ...prev?.sections, ["bottom" /* Bottom */]: n }
|
6364
|
+
}));
|
6365
|
+
}, [setLayout]);
|
6366
|
+
const leftSection = import_react10.useCallback((n) => {
|
6367
|
+
setLayout((prev) => ({
|
6368
|
+
...prev,
|
6369
|
+
sections: { ...prev?.sections, ["left" /* Left */]: n }
|
6370
|
+
}));
|
6371
|
+
}, [setLayout]);
|
6372
|
+
const rightSection = import_react10.useCallback((n) => {
|
6373
|
+
setLayout((prev) => ({
|
6374
|
+
...prev,
|
6375
|
+
sections: { ...prev?.sections, ["right" /* Right */]: n }
|
6376
|
+
}));
|
6377
|
+
}, [setLayout]);
|
6378
|
+
let contentSection = children;
|
6379
|
+
const childrenContainerProps = {
|
6380
|
+
flex: 1,
|
6381
|
+
...componentsProps?.childrenContainer
|
6209
6382
|
};
|
6210
|
-
|
6211
|
-
|
6212
|
-
|
6213
|
-
|
6214
|
-
|
6215
|
-
|
6216
|
-
|
6217
|
-
|
6218
|
-
|
6219
|
-
|
6220
|
-
|
6221
|
-
|
6222
|
-
|
6383
|
+
if (variant === "plain" /* Plain */) {
|
6384
|
+
contentSection = /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Box, {
|
6385
|
+
...childrenContainerProps,
|
6386
|
+
children: contentSection
|
6387
|
+
}, undefined, false, undefined, this);
|
6388
|
+
} else if (variant === "sticky" /* Sticky */) {
|
6389
|
+
contentSection = /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.ScrollArea, {
|
6390
|
+
...theme.scrollAreaProps,
|
6391
|
+
...childrenContainerProps,
|
6392
|
+
children
|
6393
|
+
}, undefined, false, undefined, this);
|
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, {
|
6398
|
+
gap: 0,
|
6399
|
+
h: "100%",
|
6400
|
+
w: "100%",
|
6401
|
+
wrap: "nowrap",
|
6402
|
+
...componentsProps?.horizontalContainer,
|
6223
6403
|
children: [
|
6224
|
-
/* @__PURE__ */
|
6225
|
-
|
6226
|
-
|
6227
|
-
|
6228
|
-
|
6229
|
-
|
6230
|
-
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_core5.Burger, {
|
6231
|
-
opened,
|
6232
|
-
onClick: toggle,
|
6233
|
-
h: 20,
|
6234
|
-
size: 18
|
6235
|
-
}, undefined, false, undefined, this)
|
6236
|
-
}, undefined, false, undefined, this)
|
6237
|
-
}, undefined, false, undefined, this),
|
6238
|
-
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_core5.AppShell.Navbar, {
|
6239
|
-
withBorder: false,
|
6240
|
-
children: navbarVariant === "minimal" /* Minimal */ && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(NavbarMinimal, {
|
6241
|
-
logo,
|
6242
|
-
user,
|
6243
|
-
...navbar
|
6244
|
-
}, undefined, false, undefined, this)
|
6404
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Group, {
|
6405
|
+
ref: leftSection,
|
6406
|
+
h: "100%",
|
6407
|
+
gap: 0,
|
6408
|
+
wrap: "nowrap",
|
6409
|
+
...componentsProps?.sectionContainers?.["left" /* Left */]
|
6245
6410
|
}, undefined, false, undefined, this),
|
6246
|
-
/* @__PURE__ */
|
6247
|
-
|
6248
|
-
|
6249
|
-
|
6250
|
-
|
6251
|
-
|
6252
|
-
|
6253
|
-
|
6254
|
-
|
6255
|
-
|
6256
|
-
|
6257
|
-
|
6258
|
-
|
6411
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Stack, {
|
6412
|
+
h: "100%",
|
6413
|
+
flex: 1,
|
6414
|
+
gap: 0,
|
6415
|
+
...componentsProps?.verticalContainer,
|
6416
|
+
children: [
|
6417
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Stack, {
|
6418
|
+
h: "100%",
|
6419
|
+
ref: topSection,
|
6420
|
+
gap: 0,
|
6421
|
+
flex: 0,
|
6422
|
+
...componentsProps?.sectionContainers?.["top" /* Top */]
|
6423
|
+
}, undefined, false, undefined, this),
|
6424
|
+
contentSection,
|
6425
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Stack, {
|
6426
|
+
h: "100%",
|
6427
|
+
ref: bottomSection,
|
6428
|
+
gap: 0,
|
6429
|
+
flex: 0,
|
6430
|
+
...componentsProps?.sectionContainers?.["bottom" /* Bottom */]
|
6431
|
+
}, undefined, false, undefined, this)
|
6432
|
+
]
|
6433
|
+
}, undefined, true, undefined, this),
|
6434
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Group, {
|
6435
|
+
gap: 0,
|
6436
|
+
ref: rightSection,
|
6437
|
+
h: "100%",
|
6438
|
+
wrap: "nowrap",
|
6439
|
+
...componentsProps?.sectionContainers?.["right" /* Right */]
|
6259
6440
|
}, undefined, false, undefined, this)
|
6260
6441
|
]
|
6261
6442
|
}, undefined, true, undefined, this)
|
6262
6443
|
}, undefined, false, undefined, this);
|
6263
6444
|
}
|
6445
|
+
var FrameLayout_default = Object.assign(FrameLayout, {
|
6446
|
+
Element
|
6447
|
+
});
|
6448
|
+
|
6449
|
+
// src/core/components/AppShell/index.tsx
|
6450
|
+
var jsx_dev_runtime13 = require("react/jsx-dev-runtime");
|
6451
|
+
var defaultAppShellLayoutId = "remoraidAppShell";
|
6452
|
+
var defaultAppShellNavbarPositions = { ["minimal" /* Minimal */]: "left" /* Left */ };
|
6453
|
+
var defaultAppShellFooterPositions = { ["minimal" /* Minimal */]: "content" /* Content */ };
|
6454
|
+
function AppShell(props) {
|
6455
|
+
const {
|
6456
|
+
children,
|
6457
|
+
navbarVariant,
|
6458
|
+
footerVariant,
|
6459
|
+
appContext: appContext2,
|
6460
|
+
componentsProps
|
6461
|
+
} = {
|
6462
|
+
navbarVariant: null,
|
6463
|
+
footerVariant: null,
|
6464
|
+
...props
|
6465
|
+
};
|
6466
|
+
let { navbarPosition, footerPosition } = props;
|
6467
|
+
if (navbarVariant !== null && navbarPosition === undefined) {
|
6468
|
+
navbarPosition = defaultAppShellNavbarPositions[navbarVariant];
|
6469
|
+
}
|
6470
|
+
if (footerVariant !== null && footerPosition === undefined) {
|
6471
|
+
footerPosition = defaultAppShellFooterPositions[footerVariant];
|
6472
|
+
}
|
6473
|
+
let navbar;
|
6474
|
+
let footer;
|
6475
|
+
let navbarContainerProps = {};
|
6476
|
+
let footerContainerProps = {};
|
6477
|
+
if (navbarVariant === "minimal" /* Minimal */) {
|
6478
|
+
navbar = /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(NavbarMinimal, {
|
6479
|
+
...componentsProps?.navbar
|
6480
|
+
}, 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
|
+
}
|
6488
|
+
if (footerVariant === "minimal" /* Minimal */) {
|
6489
|
+
footer = /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(FooterMinimal, {
|
6490
|
+
...componentsProps?.footer
|
6491
|
+
}, undefined, false, undefined, this);
|
6492
|
+
}
|
6493
|
+
return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(AppProvider, {
|
6494
|
+
appContext: appContext2,
|
6495
|
+
...componentsProps?.AppProvider,
|
6496
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_core7.Box, {
|
6497
|
+
h: "100vh",
|
6498
|
+
...componentsProps?.container,
|
6499
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(FrameLayout_default, {
|
6500
|
+
layoutId: defaultAppShellLayoutId,
|
6501
|
+
...componentsProps?.layout,
|
6502
|
+
children: [
|
6503
|
+
navbarPosition !== undefined && navbarPosition !== "content" /* Content */ && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(FrameLayout_default.Element, {
|
6504
|
+
section: navbarPosition,
|
6505
|
+
...componentsProps?.navbarLayoutElement,
|
6506
|
+
componentsProps: {
|
6507
|
+
...componentsProps?.navbarLayoutElement?.componentsProps,
|
6508
|
+
container: {
|
6509
|
+
...navbarContainerProps,
|
6510
|
+
...componentsProps?.navbarLayoutElement?.componentsProps?.container
|
6511
|
+
}
|
6512
|
+
},
|
6513
|
+
children: navbar
|
6514
|
+
}, undefined, false, undefined, this),
|
6515
|
+
footerPosition !== undefined && footerPosition !== "content" /* Content */ && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(FrameLayout_default.Element, {
|
6516
|
+
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, {
|
6535
|
+
children: footer
|
6536
|
+
}, undefined, false, undefined, this)
|
6537
|
+
]
|
6538
|
+
}, undefined, true, undefined, this)
|
6539
|
+
}, undefined, false, undefined, this)
|
6540
|
+
}, undefined, false, undefined, this);
|
6541
|
+
}
|
6542
|
+
var AppShell_default = Object.assign(AppShell, {
|
6543
|
+
NavbarMinimal,
|
6544
|
+
FooterMinimal
|
6545
|
+
});
|
6264
6546
|
// src/core/components/WidgetSelectionHeader/index.tsx
|
6265
|
-
var
|
6547
|
+
var import_core10 = require("@mantine/core");
|
6266
6548
|
|
6267
6549
|
// src/core/components/Page/index.tsx
|
6268
|
-
var
|
6550
|
+
var import_react11 = __toESM(require("react"));
|
6269
6551
|
var import_navigation2 = require("next/navigation");
|
6270
6552
|
|
6271
6553
|
// src/core/components/Page/PageContainer/index.tsx
|
6272
|
-
var
|
6273
|
-
var
|
6554
|
+
var import_core8 = require("@mantine/core");
|
6555
|
+
var jsx_dev_runtime14 = require("react/jsx-dev-runtime");
|
6274
6556
|
function PageContainer({
|
6275
6557
|
children,
|
6276
6558
|
pt,
|
6277
6559
|
componentsProps
|
6278
6560
|
}) {
|
6279
6561
|
const theme = useRemoraidTheme();
|
6280
|
-
return /* @__PURE__ */
|
6562
|
+
return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(import_core8.Container, {
|
6281
6563
|
size: theme.containerSize,
|
6282
6564
|
pt: pt ?? "md",
|
6283
6565
|
...componentsProps?.container,
|
@@ -6286,10 +6568,10 @@ function PageContainer({
|
|
6286
6568
|
}
|
6287
6569
|
|
6288
6570
|
// src/core/components/Page/index.tsx
|
6289
|
-
var
|
6290
|
-
var pageContext =
|
6571
|
+
var jsx_dev_runtime15 = require("react/jsx-dev-runtime");
|
6572
|
+
var pageContext = import_react11.default.createContext(null);
|
6291
6573
|
var usePage = () => {
|
6292
|
-
return
|
6574
|
+
return import_react11.useContext(pageContext);
|
6293
6575
|
};
|
6294
6576
|
function Page({
|
6295
6577
|
children,
|
@@ -6301,16 +6583,16 @@ function Page({
|
|
6301
6583
|
const pathname = import_navigation2.usePathname();
|
6302
6584
|
const { isPageRegistered, registerPage } = useWidgets();
|
6303
6585
|
const pageId = config?.pageId ?? pathname;
|
6304
|
-
|
6586
|
+
import_react11.useEffect(() => {
|
6305
6587
|
if (!isPageRegistered(pageId)) {
|
6306
6588
|
if (config?.registerPageDirectly) {
|
6307
6589
|
registerPage(pageId, []);
|
6308
6590
|
}
|
6309
6591
|
}
|
6310
6592
|
}, []);
|
6311
|
-
return /* @__PURE__ */
|
6593
|
+
return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(pageContext.Provider, {
|
6312
6594
|
value: { name: name ?? pathname, pageId, ...config },
|
6313
|
-
children: /* @__PURE__ */
|
6595
|
+
children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(PageContainer, {
|
6314
6596
|
pt,
|
6315
6597
|
componentsProps: { container: componentsProps?.container },
|
6316
6598
|
children
|
@@ -6322,8 +6604,8 @@ function Page({
|
|
6322
6604
|
var import_icons_react4 = require("@tabler/icons-react");
|
6323
6605
|
|
6324
6606
|
// src/core/components/ScrollableChipGroup/index.tsx
|
6325
|
-
var
|
6326
|
-
var
|
6607
|
+
var import_core9 = require("@mantine/core");
|
6608
|
+
var jsx_dev_runtime16 = require("react/jsx-dev-runtime");
|
6327
6609
|
function ScrollableChipGroup({
|
6328
6610
|
value,
|
6329
6611
|
onChange,
|
@@ -6332,15 +6614,15 @@ function ScrollableChipGroup({
|
|
6332
6614
|
children
|
6333
6615
|
}) {
|
6334
6616
|
const theme = useRemoraidTheme();
|
6335
|
-
return /* @__PURE__ */
|
6617
|
+
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(import_core9.ScrollArea, {
|
6336
6618
|
...theme.scrollAreaProps,
|
6337
6619
|
...componentsProps?.scrollArea,
|
6338
|
-
children: /* @__PURE__ */
|
6620
|
+
children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(import_core9.Chip.Group, {
|
6339
6621
|
value,
|
6340
6622
|
onChange,
|
6341
6623
|
...componentsProps?.chipGroup,
|
6342
6624
|
multiple: true,
|
6343
|
-
children: /* @__PURE__ */
|
6625
|
+
children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(import_core9.Flex, {
|
6344
6626
|
justify: "flex-start",
|
6345
6627
|
align: "center",
|
6346
6628
|
gap: gap ?? "xs",
|
@@ -6353,7 +6635,7 @@ function ScrollableChipGroup({
|
|
6353
6635
|
}
|
6354
6636
|
|
6355
6637
|
// src/core/components/WidgetSelectionHeader/index.tsx
|
6356
|
-
var
|
6638
|
+
var jsx_dev_runtime17 = require("react/jsx-dev-runtime");
|
6357
6639
|
function WidgetSelectionHeader({
|
6358
6640
|
title,
|
6359
6641
|
disabledWidgets,
|
@@ -6366,31 +6648,31 @@ function WidgetSelectionHeader({
|
|
6366
6648
|
console.error("'WidgetSelectionHeader' must be rendered inside of a 'Page' component.");
|
6367
6649
|
return null;
|
6368
6650
|
}
|
6369
|
-
return /* @__PURE__ */
|
6651
|
+
return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core10.Flex, {
|
6370
6652
|
justify: "flex-start",
|
6371
6653
|
align: "center",
|
6372
6654
|
gap: "xs",
|
6373
6655
|
mt,
|
6374
6656
|
children: [
|
6375
|
-
/* @__PURE__ */
|
6657
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core10.Text, {
|
6376
6658
|
size: "lg",
|
6377
6659
|
fw: 400,
|
6378
6660
|
children: title ?? page.name
|
6379
6661
|
}, undefined, false, undefined, this),
|
6380
|
-
/* @__PURE__ */
|
6662
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core10.Divider, {
|
6381
6663
|
orientation: "vertical"
|
6382
6664
|
}, undefined, false, undefined, this),
|
6383
|
-
isPageRegistered(page.pageId) && /* @__PURE__ */
|
6665
|
+
isPageRegistered(page.pageId) && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ScrollableChipGroup, {
|
6384
6666
|
value: Object.keys(widgets[page.pageId]).filter((widgetId) => widgets[page.pageId][widgetId].selected),
|
6385
6667
|
onChange: (value) => {
|
6386
6668
|
updateWidgetSelectionBulk(page.pageId, value);
|
6387
6669
|
},
|
6388
6670
|
componentsProps: { scrollArea: { flex: 1 } },
|
6389
|
-
children: Object.keys(widgets[page.pageId]).map((widgetId) => /* @__PURE__ */
|
6671
|
+
children: Object.keys(widgets[page.pageId]).map((widgetId) => /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core10.Chip, {
|
6390
6672
|
value: widgetId,
|
6391
6673
|
size: "sm",
|
6392
6674
|
disabled: disabledWidgets && disabledWidgets.includes(widgetId),
|
6393
|
-
icon: /* @__PURE__ */
|
6675
|
+
icon: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_icons_react4.IconCheck, {
|
6394
6676
|
...theme.iconProps.tiny
|
6395
6677
|
}, undefined, false, undefined, this),
|
6396
6678
|
children: widgets[page.pageId][widgetId].name
|
@@ -6400,19 +6682,19 @@ function WidgetSelectionHeader({
|
|
6400
6682
|
}, undefined, true, undefined, this);
|
6401
6683
|
}
|
6402
6684
|
// src/core/components/Widget/WidgetWrapper/CloseButton/index.tsx
|
6403
|
-
var
|
6685
|
+
var import_core11 = require("@mantine/core");
|
6404
6686
|
var import_icons_react5 = require("@tabler/icons-react");
|
6405
|
-
var
|
6687
|
+
var jsx_dev_runtime18 = require("react/jsx-dev-runtime");
|
6406
6688
|
function CloseButton({ widgetId }) {
|
6407
6689
|
const theme = useRemoraidTheme();
|
6408
6690
|
const { activeWidget, updateWidgetSelection } = useWidgets();
|
6409
6691
|
const page = usePage();
|
6410
|
-
return /* @__PURE__ */
|
6692
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(import_core11.Transition, {
|
6411
6693
|
mounted: activeWidget === widgetId,
|
6412
6694
|
transition: "pop-top-right",
|
6413
6695
|
duration: theme.transitionDurations.short,
|
6414
6696
|
timingFunction: "ease",
|
6415
|
-
children: (transitionStyle) => /* @__PURE__ */
|
6697
|
+
children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(import_core11.ActionIcon, {
|
6416
6698
|
pos: "absolute",
|
6417
6699
|
size: "xs",
|
6418
6700
|
className: "remoraid-close-button",
|
@@ -6425,42 +6707,33 @@ function CloseButton({ widgetId }) {
|
|
6425
6707
|
updateWidgetSelection(page.pageId, widgetId, false);
|
6426
6708
|
},
|
6427
6709
|
style: transitionStyle,
|
6428
|
-
children: /* @__PURE__ */
|
6710
|
+
children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(import_icons_react5.IconX, {
|
6429
6711
|
...theme.iconProps.tiny
|
6430
6712
|
}, undefined, false, undefined, this)
|
6431
6713
|
}, undefined, false, undefined, this)
|
6432
6714
|
}, undefined, false, undefined, this);
|
6433
6715
|
}
|
6434
6716
|
// src/core/components/BadgeGroup/index.tsx
|
6435
|
-
var
|
6436
|
-
var
|
6717
|
+
var import_core13 = require("@mantine/core");
|
6718
|
+
var import_react12 = __toESM(require("react"));
|
6437
6719
|
|
6438
6720
|
// src/core/components/BadgeMinimal/index.tsx
|
6439
|
-
var
|
6440
|
-
var
|
6441
|
-
var isBadgeMinimalProps = (e) => {
|
6442
|
-
if (typeof e !== "object") {
|
6443
|
-
return false;
|
6444
|
-
}
|
6445
|
-
if (!("label" in e)) {
|
6446
|
-
return false;
|
6447
|
-
}
|
6448
|
-
return true;
|
6449
|
-
};
|
6721
|
+
var import_core12 = require("@mantine/core");
|
6722
|
+
var jsx_dev_runtime19 = require("react/jsx-dev-runtime");
|
6450
6723
|
function BadgeMinimal(props) {
|
6451
6724
|
const { label, tooltip, mounted, componentsProps } = props;
|
6452
6725
|
const theme = useRemoraidTheme();
|
6453
|
-
return /* @__PURE__ */
|
6726
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core12.Transition, {
|
6454
6727
|
mounted: mounted !== false,
|
6455
6728
|
transition: "fade",
|
6456
6729
|
duration: theme.transitionDurations.short,
|
6457
6730
|
timingFunction: "ease",
|
6458
6731
|
...componentsProps?.transition,
|
6459
|
-
children: (transitionStyle) => /* @__PURE__ */
|
6732
|
+
children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core12.Tooltip, {
|
6460
6733
|
disabled: !tooltip,
|
6461
6734
|
label: tooltip,
|
6462
6735
|
...componentsProps?.tooltip,
|
6463
|
-
children: /* @__PURE__ */
|
6736
|
+
children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core12.Badge, {
|
6464
6737
|
variant: "default",
|
6465
6738
|
...componentsProps?.badge,
|
6466
6739
|
style: {
|
@@ -6475,36 +6748,39 @@ function BadgeMinimal(props) {
|
|
6475
6748
|
}
|
6476
6749
|
|
6477
6750
|
// src/core/components/BadgeGroup/index.tsx
|
6478
|
-
var
|
6751
|
+
var jsx_dev_runtime20 = require("react/jsx-dev-runtime");
|
6479
6752
|
var react = require("react");
|
6480
6753
|
function BadgeGroup({
|
6481
|
-
badges,
|
6754
|
+
badges: badgesProp,
|
6482
6755
|
gap,
|
6483
6756
|
breakpoint,
|
6484
6757
|
componentsProps
|
6485
6758
|
}) {
|
6486
6759
|
const theme = useRemoraidTheme();
|
6487
|
-
const
|
6488
|
-
|
6760
|
+
const badges = badgesProp.map((badge) => asElementOrPropsOfType(BadgeMinimal, badge, "Check 'badges' property passed to 'BadgeGroup'."));
|
6761
|
+
const numVisibleBadges = badges.filter((badge) => isValidElementOfType(BadgeMinimal, badge) ? badge.props.mounted : badge.mounted !== false).length;
|
6762
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
|
6489
6763
|
children: [
|
6490
|
-
/* @__PURE__ */
|
6764
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(import_core13.Group, {
|
6491
6765
|
gap: gap ?? "xs",
|
6492
6766
|
wrap: "nowrap",
|
6493
6767
|
visibleFrom: breakpoint ?? theme.breakpoints.badgeGroupCollapse,
|
6494
|
-
children: badges.map((
|
6495
|
-
if (
|
6496
|
-
return
|
6497
|
-
|
6498
|
-
|
6499
|
-
|
6500
|
-
|
6501
|
-
|
6768
|
+
children: badges.map((badge, i) => {
|
6769
|
+
if (isValidElementOfType(BadgeMinimal, badge)) {
|
6770
|
+
return badge;
|
6771
|
+
} else if (import_react12.isValidElement(badge)) {
|
6772
|
+
throw new TypeError(`Expected React element of type ${BadgeMinimal.name}, but received type: ${typeof badge.type === "string" ? badge.type : badge.type?.name ?? "unknown"}. Check the 'badges' property of this widget.`);
|
6773
|
+
}
|
6774
|
+
return /* @__PURE__ */ react.createElement(BadgeMinimal, {
|
6775
|
+
...badge,
|
6776
|
+
key: i
|
6777
|
+
});
|
6502
6778
|
})
|
6503
6779
|
}, undefined, false, undefined, this),
|
6504
|
-
/* @__PURE__ */
|
6780
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(import_core13.Tooltip, {
|
6505
6781
|
label: `${numVisibleBadges} badge${numVisibleBadges === 1 ? "" : "s"}`,
|
6506
6782
|
...componentsProps?.tooltip,
|
6507
|
-
children: /* @__PURE__ */
|
6783
|
+
children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(import_core13.Badge, {
|
6508
6784
|
hiddenFrom: breakpoint ?? theme.breakpoints.badgeGroupCollapse,
|
6509
6785
|
hidden: numVisibleBadges === 0,
|
6510
6786
|
variant: "light",
|
@@ -6518,19 +6794,9 @@ function BadgeGroup({
|
|
6518
6794
|
}, undefined, true, undefined, this);
|
6519
6795
|
}
|
6520
6796
|
// src/core/components/AlertMinimal/index.tsx
|
6521
|
-
var
|
6522
|
-
var
|
6523
|
-
var isAlertMinimalProps = (e) => {
|
6524
|
-
if (typeof e !== "object") {
|
6525
|
-
return false;
|
6526
|
-
}
|
6527
|
-
if (!("category" in e)) {
|
6528
|
-
return false;
|
6529
|
-
}
|
6530
|
-
return true;
|
6531
|
-
};
|
6797
|
+
var import_core14 = require("@mantine/core");
|
6798
|
+
var jsx_dev_runtime21 = require("react/jsx-dev-runtime");
|
6532
6799
|
function AlertMinimal({
|
6533
|
-
children,
|
6534
6800
|
title,
|
6535
6801
|
category,
|
6536
6802
|
text,
|
@@ -6538,16 +6804,17 @@ function AlertMinimal({
|
|
6538
6804
|
mounted,
|
6539
6805
|
mt,
|
6540
6806
|
mb,
|
6541
|
-
componentsProps
|
6807
|
+
componentsProps,
|
6808
|
+
children
|
6542
6809
|
}) {
|
6543
6810
|
const theme = useRemoraidTheme();
|
6544
|
-
return /* @__PURE__ */
|
6811
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(import_core14.Transition, {
|
6545
6812
|
mounted: mounted !== false,
|
6546
6813
|
transition: "fade",
|
6547
6814
|
duration: theme.transitionDurations.short,
|
6548
6815
|
timingFunction: "ease",
|
6549
6816
|
...componentsProps?.transition,
|
6550
|
-
children: (transitionStyle) => /* @__PURE__ */
|
6817
|
+
children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(import_core14.Alert, {
|
6551
6818
|
...theme.alertProps[category],
|
6552
6819
|
title: title ?? theme.alertProps[category].title,
|
6553
6820
|
withCloseButton: onClose !== undefined,
|
@@ -6567,18 +6834,9 @@ function AlertMinimal({
|
|
6567
6834
|
}, undefined, false, undefined, this);
|
6568
6835
|
}
|
6569
6836
|
// src/core/components/RemoraidButton/index.tsx
|
6570
|
-
var
|
6837
|
+
var import_core15 = require("@mantine/core");
|
6571
6838
|
var import_icons_react6 = require("@tabler/icons-react");
|
6572
|
-
var
|
6573
|
-
var isRemoraidButtonProps = (e) => {
|
6574
|
-
if (typeof e !== "object") {
|
6575
|
-
return false;
|
6576
|
-
}
|
6577
|
-
if (!("label" in e)) {
|
6578
|
-
return false;
|
6579
|
-
}
|
6580
|
-
return true;
|
6581
|
-
};
|
6839
|
+
var jsx_dev_runtime22 = require("react/jsx-dev-runtime");
|
6582
6840
|
function RemoraidButton({
|
6583
6841
|
label,
|
6584
6842
|
responsive,
|
@@ -6594,17 +6852,17 @@ function RemoraidButton({
|
|
6594
6852
|
}) {
|
6595
6853
|
const theme = useRemoraidTheme();
|
6596
6854
|
const iconProps = { ...theme.iconProps.medium, ...componentsProps?.icon };
|
6597
|
-
const icon = props.icon ? /* @__PURE__ */
|
6855
|
+
const icon = props.icon ? /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(props.icon, {
|
6598
6856
|
...iconProps
|
6599
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
6857
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(import_icons_react6.IconClick, {
|
6600
6858
|
...iconProps
|
6601
6859
|
}, undefined, false, undefined, this);
|
6602
|
-
return /* @__PURE__ */
|
6860
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(jsx_dev_runtime22.Fragment, {
|
6603
6861
|
children: [
|
6604
|
-
/* @__PURE__ */
|
6862
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(import_core15.Tooltip, {
|
6605
6863
|
label,
|
6606
6864
|
...componentsProps?.tooltip,
|
6607
|
-
children: /* @__PURE__ */
|
6865
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(import_core15.ActionIcon, {
|
6608
6866
|
"aria-label": label,
|
6609
6867
|
variant: variant ?? "default",
|
6610
6868
|
onClick,
|
@@ -6618,7 +6876,7 @@ function RemoraidButton({
|
|
6618
6876
|
children: icon
|
6619
6877
|
}, undefined, false, undefined, this)
|
6620
6878
|
}, undefined, false, undefined, this),
|
6621
|
-
/* @__PURE__ */
|
6879
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(import_core15.Button, {
|
6622
6880
|
onClick,
|
6623
6881
|
loading,
|
6624
6882
|
variant: variant ?? "default",
|
@@ -6635,9 +6893,9 @@ function RemoraidButton({
|
|
6635
6893
|
}, undefined, true, undefined, this);
|
6636
6894
|
}
|
6637
6895
|
// src/core/components/Widget/WidgetWrapper/index.tsx
|
6638
|
-
var
|
6639
|
-
var
|
6640
|
-
var
|
6896
|
+
var import_core16 = require("@mantine/core");
|
6897
|
+
var import_react13 = require("react");
|
6898
|
+
var jsx_dev_runtime23 = require("react/jsx-dev-runtime");
|
6641
6899
|
function WidgetWrapper({
|
6642
6900
|
children,
|
6643
6901
|
config,
|
@@ -6655,7 +6913,7 @@ function WidgetWrapper({
|
|
6655
6913
|
const page = usePage();
|
6656
6914
|
const theme = useRemoraidTheme();
|
6657
6915
|
const pageRegistered = page ? isPageRegistered(page.pageId) : false;
|
6658
|
-
|
6916
|
+
import_react13.useEffect(() => {
|
6659
6917
|
if (!page) {
|
6660
6918
|
return;
|
6661
6919
|
}
|
@@ -6663,12 +6921,12 @@ function WidgetWrapper({
|
|
6663
6921
|
registerWidget(page.pageId, config);
|
6664
6922
|
}
|
6665
6923
|
}, [pageRegistered]);
|
6666
|
-
return /* @__PURE__ */
|
6924
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(import_core16.Transition, {
|
6667
6925
|
mounted: page !== null && isWidgetSelected(page.pageId, config.widgetId),
|
6668
6926
|
transition: "fade-left",
|
6669
6927
|
duration: theme.transitionDurations.medium,
|
6670
6928
|
timingFunction: "ease",
|
6671
|
-
children: (transitionStyle) => /* @__PURE__ */
|
6929
|
+
children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(import_core16.Paper, {
|
6672
6930
|
p: "md",
|
6673
6931
|
shadow: "md",
|
6674
6932
|
bg: theme.transparentBackground,
|
@@ -6684,7 +6942,7 @@ function WidgetWrapper({
|
|
6684
6942
|
updateActiveWidget(null);
|
6685
6943
|
},
|
6686
6944
|
children: [
|
6687
|
-
withCloseButton !== false && /* @__PURE__ */
|
6945
|
+
withCloseButton !== false && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(CloseButton, {
|
6688
6946
|
widgetId: config.widgetId
|
6689
6947
|
}, undefined, false, undefined, this),
|
6690
6948
|
children
|
@@ -6696,26 +6954,29 @@ var WidgetWrapper_default = Object.assign(WidgetWrapper, {
|
|
6696
6954
|
CloseButton
|
6697
6955
|
});
|
6698
6956
|
// src/core/components/Widget/index.tsx
|
6699
|
-
var
|
6700
|
-
var
|
6957
|
+
var import_core17 = require("@mantine/core");
|
6958
|
+
var jsx_dev_runtime24 = require("react/jsx-dev-runtime");
|
6701
6959
|
var react2 = require("react");
|
6702
6960
|
function Widget({
|
6703
6961
|
children,
|
6704
6962
|
id,
|
6705
6963
|
config,
|
6706
6964
|
title,
|
6707
|
-
badges,
|
6708
|
-
buttons,
|
6709
|
-
alerts,
|
6965
|
+
badges: badgesProp,
|
6966
|
+
buttons: buttonsProp,
|
6967
|
+
alerts: alertsProp,
|
6710
6968
|
gaps,
|
6711
6969
|
loading,
|
6712
6970
|
mt,
|
6713
6971
|
componentsProps
|
6714
6972
|
}) {
|
6973
|
+
const buttons = buttonsProp?.map((button) => asElementOrPropsOfType(RemoraidButton, button, "Check the 'buttons' property of this widget."));
|
6974
|
+
const alerts = alertsProp?.map((alert) => asElementOrPropsOfType(AlertMinimal, alert, "Check the 'alerts' property of this widget."));
|
6975
|
+
const badges = badgesProp?.map((badge) => asElementOrPropsOfType(BadgeMinimal, badge, "Check the 'badges' property of this widget."));
|
6715
6976
|
const badgesGap = (typeof gaps === "object" ? gaps.badges : gaps) ?? "xs";
|
6716
6977
|
const buttonsGap = (typeof gaps === "object" ? gaps.buttons : gaps) ?? "xs";
|
6717
6978
|
const alertsGap = (typeof gaps === "object" ? gaps.alerts : gaps) ?? "xs";
|
6718
|
-
return /* @__PURE__ */
|
6979
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(WidgetWrapper_default, {
|
6719
6980
|
config: {
|
6720
6981
|
widgetId: id,
|
6721
6982
|
name: title,
|
@@ -6728,69 +6989,75 @@ function Widget({
|
|
6728
6989
|
},
|
6729
6990
|
...componentsProps?.wrapper,
|
6730
6991
|
children: [
|
6731
|
-
/* @__PURE__ */
|
6992
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Group, {
|
6732
6993
|
justify: "space-between",
|
6733
6994
|
wrap: "nowrap",
|
6734
6995
|
children: [
|
6735
|
-
/* @__PURE__ */
|
6996
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Group, {
|
6736
6997
|
gap: badgesGap,
|
6737
6998
|
wrap: "nowrap",
|
6738
6999
|
children: [
|
6739
|
-
/* @__PURE__ */
|
7000
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Title, {
|
6740
7001
|
order: 1,
|
6741
7002
|
size: "h3",
|
6742
7003
|
lineClamp: 1,
|
6743
7004
|
children: title
|
6744
7005
|
}, undefined, false, undefined, this),
|
6745
|
-
badges !== undefined && /* @__PURE__ */
|
7006
|
+
badges !== undefined && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(BadgeGroup, {
|
6746
7007
|
badges,
|
6747
7008
|
gap: badgesGap,
|
6748
7009
|
...componentsProps?.badgeGroup
|
6749
7010
|
}, undefined, false, undefined, this)
|
6750
7011
|
]
|
6751
7012
|
}, undefined, true, undefined, this),
|
6752
|
-
/* @__PURE__ */
|
7013
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Group, {
|
6753
7014
|
gap: buttonsGap,
|
6754
7015
|
wrap: "nowrap",
|
6755
|
-
children: buttons !== undefined && buttons.map((
|
6756
|
-
if (
|
6757
|
-
return
|
6758
|
-
...e,
|
6759
|
-
key: i
|
6760
|
-
});
|
7016
|
+
children: buttons !== undefined && buttons.map((button, i) => {
|
7017
|
+
if (isValidElementOfType(RemoraidButton, button)) {
|
7018
|
+
return button;
|
6761
7019
|
}
|
6762
|
-
return
|
7020
|
+
return /* @__PURE__ */ react2.createElement(RemoraidButton, {
|
7021
|
+
...button,
|
7022
|
+
key: i
|
7023
|
+
});
|
6763
7024
|
})
|
6764
7025
|
}, undefined, false, undefined, this)
|
6765
7026
|
]
|
6766
7027
|
}, undefined, true, undefined, this),
|
6767
|
-
/* @__PURE__ */
|
6768
|
-
my: "md"
|
7028
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Divider, {
|
7029
|
+
my: "md",
|
7030
|
+
...componentsProps?.divider
|
6769
7031
|
}, undefined, false, undefined, this),
|
6770
|
-
|
6771
|
-
|
7032
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Stack, {
|
7033
|
+
align: "stretch",
|
7034
|
+
gap: alertsGap,
|
7035
|
+
mb: alerts && alerts.length > 0 ? "md" : 0,
|
7036
|
+
...componentsProps?.alertsContainer,
|
7037
|
+
children: alerts?.map((alert, i) => {
|
7038
|
+
if (isValidElementOfType(AlertMinimal, alert)) {
|
7039
|
+
return alert;
|
7040
|
+
}
|
6772
7041
|
return /* @__PURE__ */ react2.createElement(AlertMinimal, {
|
6773
|
-
...
|
6774
|
-
mb: alertsGap,
|
7042
|
+
...alert,
|
6775
7043
|
key: i
|
6776
7044
|
});
|
6777
|
-
}
|
6778
|
-
|
6779
|
-
|
6780
|
-
|
6781
|
-
children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(import_core15.Loader, {
|
7045
|
+
})
|
7046
|
+
}, undefined, false, undefined, this),
|
7047
|
+
loading ? /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Center, {
|
7048
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Loader, {
|
6782
7049
|
...componentsProps?.loader
|
6783
7050
|
}, undefined, false, undefined, this)
|
6784
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
7051
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(jsx_dev_runtime24.Fragment, {
|
6785
7052
|
children
|
6786
7053
|
}, undefined, false, undefined, this)
|
6787
7054
|
]
|
6788
7055
|
}, undefined, true, undefined, this);
|
6789
7056
|
}
|
6790
7057
|
// src/core/components/NotFoundPage/index.tsx
|
6791
|
-
var
|
7058
|
+
var import_core18 = require("@mantine/core");
|
6792
7059
|
var import_navigation3 = require("next/navigation");
|
6793
|
-
var
|
7060
|
+
var jsx_dev_runtime25 = require("react/jsx-dev-runtime");
|
6794
7061
|
function NotFoundPage({
|
6795
7062
|
children,
|
6796
7063
|
message,
|
@@ -6798,11 +7065,11 @@ function NotFoundPage({
|
|
6798
7065
|
}) {
|
6799
7066
|
const pathname = import_navigation3.usePathname();
|
6800
7067
|
const theme = useRemoraidTheme();
|
6801
|
-
return /* @__PURE__ */
|
7068
|
+
return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Page, {
|
6802
7069
|
name: "Not Found",
|
6803
7070
|
...componentsProps?.page,
|
6804
7071
|
children: [
|
6805
|
-
/* @__PURE__ */
|
7072
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(import_core18.Alert, {
|
6806
7073
|
...theme.alertProps.negative,
|
6807
7074
|
title: "404 - Page Not Found",
|
6808
7075
|
children: message ?? `Could not find page ${pathname}.`
|
@@ -6812,8 +7079,8 @@ function NotFoundPage({
|
|
6812
7079
|
}, undefined, true, undefined, this);
|
6813
7080
|
}
|
6814
7081
|
// src/core/components/EnvironmentShell/index.tsx
|
6815
|
-
var
|
6816
|
-
var
|
7082
|
+
var import_core19 = require("@mantine/core");
|
7083
|
+
var jsx_dev_runtime26 = require("react/jsx-dev-runtime");
|
6817
7084
|
function EnvironmentShell({
|
6818
7085
|
children,
|
6819
7086
|
environment,
|
@@ -6827,7 +7094,7 @@ function EnvironmentShell({
|
|
6827
7094
|
const undefinedKeys = Object.keys(environment).filter((key) => environment[key] === undefined);
|
6828
7095
|
const alertTitle = `Please Specify Environment Variable${undefinedKeys.length > 1 ? "s" : ""}`;
|
6829
7096
|
const alertMessage = `Components could not be rendered because the following environment variables are not specified: ${undefinedKeys.join(", ")}.`;
|
6830
|
-
const alert = /* @__PURE__ */
|
7097
|
+
const alert = /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(import_core19.Alert, {
|
6831
7098
|
...theme.alertProps.neutral,
|
6832
7099
|
title: alertTitle,
|
6833
7100
|
m,
|
@@ -6835,12 +7102,12 @@ function EnvironmentShell({
|
|
6835
7102
|
children: message ?? alertMessage
|
6836
7103
|
}, undefined, false, undefined, this);
|
6837
7104
|
if (undefinedKeys.length === 0) {
|
6838
|
-
return /* @__PURE__ */
|
7105
|
+
return /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(jsx_dev_runtime26.Fragment, {
|
6839
7106
|
children
|
6840
7107
|
}, undefined, false, undefined, this);
|
6841
7108
|
}
|
6842
7109
|
if (withContainer) {
|
6843
|
-
return /* @__PURE__ */
|
7110
|
+
return /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(PageContainer, {
|
6844
7111
|
componentsProps: { container: componentsProps?.container },
|
6845
7112
|
children: alert
|
6846
7113
|
}, undefined, false, undefined, this);
|
@@ -6848,20 +7115,20 @@ function EnvironmentShell({
|
|
6848
7115
|
return alert;
|
6849
7116
|
}
|
6850
7117
|
// src/core/components/SettingsWidget/index.tsx
|
6851
|
-
var
|
7118
|
+
var import_react14 = require("react");
|
6852
7119
|
var import_icons_react8 = require("@tabler/icons-react");
|
6853
7120
|
|
6854
7121
|
// src/core/components/SettingsWidget/SaveButton/index.tsx
|
6855
7122
|
var import_icons_react7 = require("@tabler/icons-react");
|
6856
|
-
var
|
6857
|
-
var
|
7123
|
+
var import_core20 = require("@mantine/core");
|
7124
|
+
var jsx_dev_runtime27 = require("react/jsx-dev-runtime");
|
6858
7125
|
function SaveButton({
|
6859
7126
|
onSaveChanges,
|
6860
7127
|
insideContainer,
|
6861
7128
|
componentsProps
|
6862
7129
|
}) {
|
6863
7130
|
const settingsWidgetOptions = useSettingsWidgetContext();
|
6864
|
-
const button = /* @__PURE__ */
|
7131
|
+
const button = /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(RemoraidButton, {
|
6865
7132
|
label: "Save Changes",
|
6866
7133
|
icon: import_icons_react7.IconDeviceFloppy,
|
6867
7134
|
onClick: onSaveChanges,
|
@@ -6876,7 +7143,7 @@ function SaveButton({
|
|
6876
7143
|
}
|
6877
7144
|
}, undefined, false, undefined, this);
|
6878
7145
|
if (insideContainer !== false) {
|
6879
|
-
return /* @__PURE__ */
|
7146
|
+
return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_core20.Group, {
|
6880
7147
|
w: "100%",
|
6881
7148
|
justify: "flex-end",
|
6882
7149
|
mt: "md",
|
@@ -6888,11 +7155,11 @@ function SaveButton({
|
|
6888
7155
|
}
|
6889
7156
|
|
6890
7157
|
// src/core/components/SettingsWidget/index.tsx
|
6891
|
-
var
|
7158
|
+
var jsx_dev_runtime28 = require("react/jsx-dev-runtime");
|
6892
7159
|
var defaultSettingsWidgetContext = {};
|
6893
|
-
var settingsWidgetContext =
|
7160
|
+
var settingsWidgetContext = import_react14.createContext(defaultSettingsWidgetContext);
|
6894
7161
|
var useSettingsWidgetContext = () => {
|
6895
|
-
return
|
7162
|
+
return import_react14.useContext(settingsWidgetContext);
|
6896
7163
|
};
|
6897
7164
|
function SettingsWidget({
|
6898
7165
|
children,
|
@@ -6901,9 +7168,9 @@ function SettingsWidget({
|
|
6901
7168
|
custom,
|
6902
7169
|
widgetProps
|
6903
7170
|
}) {
|
6904
|
-
return /* @__PURE__ */
|
7171
|
+
return /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(settingsWidgetContext.Provider, {
|
6905
7172
|
value: { custom, unsavedChanges },
|
6906
|
-
children: /* @__PURE__ */
|
7173
|
+
children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Widget, {
|
6907
7174
|
title: "Settings",
|
6908
7175
|
id: "settings",
|
6909
7176
|
mt: "md",
|
@@ -6939,27 +7206,27 @@ var SettingsWidget_default = Object.assign(SettingsWidget, {
|
|
6939
7206
|
SaveButton
|
6940
7207
|
});
|
6941
7208
|
// src/core/components/SettingsWidget/SettingsTable/index.tsx
|
6942
|
-
var
|
6943
|
-
var
|
7209
|
+
var import_react15 = require("react");
|
7210
|
+
var import_core22 = require("@mantine/core");
|
6944
7211
|
|
6945
7212
|
// src/core/components/SettingsWidget/SettingsTable/Row/index.tsx
|
6946
|
-
var
|
6947
|
-
var
|
7213
|
+
var import_core21 = require("@mantine/core");
|
7214
|
+
var jsx_dev_runtime29 = require("react/jsx-dev-runtime");
|
6948
7215
|
function Row({
|
6949
7216
|
children,
|
6950
7217
|
label
|
6951
7218
|
}) {
|
6952
7219
|
const options = useSettingsTableOptions();
|
6953
|
-
return /* @__PURE__ */
|
7220
|
+
return /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(import_core21.Table.Tr, {
|
6954
7221
|
children: [
|
6955
|
-
/* @__PURE__ */
|
7222
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(import_core21.Table.Th, {
|
6956
7223
|
w: options.leftColumnWidth,
|
6957
|
-
children: /* @__PURE__ */
|
7224
|
+
children: /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(import_core21.Text, {
|
6958
7225
|
size: "sm",
|
6959
7226
|
children: label
|
6960
7227
|
}, undefined, false, undefined, this)
|
6961
7228
|
}, undefined, false, undefined, this),
|
6962
|
-
/* @__PURE__ */
|
7229
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(import_core21.Table.Td, {
|
6963
7230
|
py: "xs",
|
6964
7231
|
children
|
6965
7232
|
}, undefined, false, undefined, this)
|
@@ -6968,29 +7235,30 @@ function Row({
|
|
6968
7235
|
}
|
6969
7236
|
|
6970
7237
|
// src/core/components/SettingsWidget/SettingsTable/index.tsx
|
6971
|
-
var
|
7238
|
+
var jsx_dev_runtime30 = require("react/jsx-dev-runtime");
|
6972
7239
|
var defaultSettingsTableOptions = {
|
6973
7240
|
leftColumnWidth: "38.2%"
|
6974
7241
|
};
|
6975
|
-
var settingsTableOptionsContext =
|
7242
|
+
var settingsTableOptionsContext = import_react15.createContext(defaultSettingsTableOptions);
|
6976
7243
|
var useSettingsTableOptions = () => {
|
6977
|
-
return
|
7244
|
+
return import_react15.useContext(settingsTableOptionsContext);
|
6978
7245
|
};
|
6979
7246
|
function SettingsTable({
|
6980
|
-
|
6981
|
-
|
7247
|
+
leftColumnWidth,
|
7248
|
+
children: childrenProp
|
6982
7249
|
}) {
|
6983
7250
|
const theme = useRemoraidTheme();
|
6984
|
-
|
7251
|
+
const children = asChildrenOfType(Row, childrenProp, "Check children passed to 'SettingsTable' component.");
|
7252
|
+
return /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(settingsTableOptionsContext.Provider, {
|
6985
7253
|
value: {
|
6986
7254
|
leftColumnWidth: leftColumnWidth ?? defaultSettingsTableOptions.leftColumnWidth
|
6987
7255
|
},
|
6988
|
-
children: /* @__PURE__ */
|
7256
|
+
children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(import_core22.Table, {
|
6989
7257
|
bg: theme.transparentBackground,
|
6990
7258
|
withTableBorder: true,
|
6991
7259
|
variant: "vertical",
|
6992
7260
|
layout: "fixed",
|
6993
|
-
children: /* @__PURE__ */
|
7261
|
+
children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(import_core22.Table.Tbody, {
|
6994
7262
|
children
|
6995
7263
|
}, undefined, false, undefined, this)
|
6996
7264
|
}, undefined, false, undefined, this)
|
@@ -7000,11 +7268,10 @@ var SettingsTable_default = Object.assign(SettingsTable, {
|
|
7000
7268
|
Row
|
7001
7269
|
});
|
7002
7270
|
// src/core/components/NavbarSettingsWidget/index.tsx
|
7003
|
-
var import_react13 = require("react");
|
7004
7271
|
var import_lodash = __toESM(require_lodash());
|
7005
|
-
var
|
7272
|
+
var import_core23 = require("@mantine/core");
|
7006
7273
|
var import_icons_react9 = require("@tabler/icons-react");
|
7007
|
-
var
|
7274
|
+
var jsx_dev_runtime31 = require("react/jsx-dev-runtime");
|
7008
7275
|
var defaultNavbarSettingsWidgetId = "navbar-settings";
|
7009
7276
|
function NavbarSettingsWidget({
|
7010
7277
|
additionalRows,
|
@@ -7014,7 +7281,7 @@ function NavbarSettingsWidget({
|
|
7014
7281
|
const { userExperience, updateUserExperience, initialUserExperience } = useRemoraidUserExperience();
|
7015
7282
|
const app = useRemoraidApp();
|
7016
7283
|
const theme = useRemoraidTheme();
|
7017
|
-
return /* @__PURE__ */
|
7284
|
+
return /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(SettingsWidget_default, {
|
7018
7285
|
widgetProps: {
|
7019
7286
|
id: defaultNavbarSettingsWidgetId,
|
7020
7287
|
title: "Navbar Settings",
|
@@ -7023,32 +7290,33 @@ function NavbarSettingsWidget({
|
|
7023
7290
|
onRestoreDefaultValues: () => {
|
7024
7291
|
updateUserExperience((prev) => ({
|
7025
7292
|
...prev,
|
7026
|
-
|
7293
|
+
navbar: initialUserExperience.navbar
|
7027
7294
|
}));
|
7028
7295
|
},
|
7029
|
-
custom: !import_lodash.isEqual(userExperience.
|
7030
|
-
children: /* @__PURE__ */
|
7296
|
+
custom: !import_lodash.isEqual(userExperience.navbar, initialUserExperience.navbar),
|
7297
|
+
children: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(SettingsTable_default, {
|
7298
|
+
...componentsProps?.table,
|
7031
7299
|
children: [
|
7032
|
-
/* @__PURE__ */
|
7300
|
+
/* @__PURE__ */ jsx_dev_runtime31.jsxDEV(SettingsTable_default.Row, {
|
7033
7301
|
label: "Select which pages you want to display or hide",
|
7034
|
-
children: /* @__PURE__ */
|
7302
|
+
children: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(import_core23.Chip.Group, {
|
7035
7303
|
multiple: true,
|
7036
|
-
value: app.navigablePages.filter((p) => !userExperience.
|
7304
|
+
value: app.navigablePages.filter((p) => !userExperience.navbar.hiddenPages.includes(p.href)).map((p) => p.href),
|
7037
7305
|
onChange: (newValue) => {
|
7038
7306
|
updateUserExperience((prev) => ({
|
7039
7307
|
...prev,
|
7040
|
-
|
7041
|
-
...prev.
|
7308
|
+
navbar: {
|
7309
|
+
...prev.navbar,
|
7042
7310
|
hiddenPages: app.navigablePages.filter((p) => !newValue.includes(p.href)).map((p) => p.href)
|
7043
7311
|
}
|
7044
7312
|
}));
|
7045
7313
|
},
|
7046
|
-
children: /* @__PURE__ */
|
7314
|
+
children: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(import_core23.Group, {
|
7047
7315
|
justify: "flex-start",
|
7048
7316
|
gap: "xs",
|
7049
|
-
children: app.navigablePages.map((p) => ({ ...p, icon: p.icon ?? import_icons_react9.IconLink })).map((p, i) => /* @__PURE__ */
|
7317
|
+
children: app.navigablePages.map((p) => ({ ...p, icon: p.icon ?? import_icons_react9.IconLink })).map((p, i) => /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(import_core23.Chip, {
|
7050
7318
|
value: p.href,
|
7051
|
-
icon: /* @__PURE__ */
|
7319
|
+
icon: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(p.icon, {
|
7052
7320
|
...theme.iconProps.tiny,
|
7053
7321
|
color: theme.primaryColor
|
7054
7322
|
}, undefined, false, undefined, this),
|
@@ -7058,9 +7326,57 @@ function NavbarSettingsWidget({
|
|
7058
7326
|
}, undefined, false, undefined, this)
|
7059
7327
|
}, undefined, false, undefined, this)
|
7060
7328
|
}, "select-hidden-pages", false, undefined, this),
|
7061
|
-
|
7062
|
-
|
7063
|
-
|
7064
|
-
|
7329
|
+
additionalRows && additionalRows.map((row, i) => {
|
7330
|
+
if (isValidElementOfType(SettingsTable_default.Row, row)) {
|
7331
|
+
return row;
|
7332
|
+
}
|
7333
|
+
return /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(SettingsTable_default.Row, {
|
7334
|
+
...row
|
7335
|
+
}, i, false, undefined, this);
|
7336
|
+
})
|
7337
|
+
]
|
7338
|
+
}, undefined, true, undefined, this)
|
7065
7339
|
}, undefined, false, undefined, this);
|
7066
7340
|
}
|
7341
|
+
// src/core/components/ContextClusterProvider/index.tsx
|
7342
|
+
var import_react16 = __toESM(require("react"));
|
7343
|
+
var jsx_dev_runtime32 = require("react/jsx-dev-runtime");
|
7344
|
+
var createContextCluster = (generalDefaultValue, staticIds) => {
|
7345
|
+
const isStaticId = (id) => {
|
7346
|
+
if (staticIds?.find((staticId) => staticId === id)) {
|
7347
|
+
return true;
|
7348
|
+
}
|
7349
|
+
return false;
|
7350
|
+
};
|
7351
|
+
const contexts = {};
|
7352
|
+
const defaultValues = {};
|
7353
|
+
const createContext8 = (id, defaultValue) => {
|
7354
|
+
const context = import_react16.default.createContext(defaultValue ?? generalDefaultValue);
|
7355
|
+
contexts[id] = context;
|
7356
|
+
defaultValues[id] = defaultValue ?? generalDefaultValue;
|
7357
|
+
return context;
|
7358
|
+
};
|
7359
|
+
const useContext11 = (id) => {
|
7360
|
+
if (isStaticId(id)) {
|
7361
|
+
return contexts[id] ? import_react16.default.useContext(contexts[id]) : generalDefaultValue;
|
7362
|
+
}
|
7363
|
+
return contexts[id] ? import_react16.default.useContext(contexts[id]) : null;
|
7364
|
+
};
|
7365
|
+
return {
|
7366
|
+
contexts,
|
7367
|
+
defaultValues,
|
7368
|
+
generalDefaultValue,
|
7369
|
+
createContext: createContext8,
|
7370
|
+
useContext: useContext11
|
7371
|
+
};
|
7372
|
+
};
|
7373
|
+
function ContextClusterProvider({
|
7374
|
+
cluster,
|
7375
|
+
values = {},
|
7376
|
+
children
|
7377
|
+
}) {
|
7378
|
+
return Object.entries(cluster.contexts).reduceRight((t, [id, context]) => /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(context.Provider, {
|
7379
|
+
value: values[id] ?? cluster.defaultValues[id] ?? cluster.generalDefaultValue,
|
7380
|
+
children: t
|
7381
|
+
}, undefined, false, undefined, this), children);
|
7382
|
+
}
|