remoraid 2.5.6 → 2.10.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.
@@ -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 Stack2(entries) {
1004
+ function Stack3(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
- Stack2.prototype.clear = stackClear;
1039
- Stack2.prototype["delete"] = stackDelete;
1040
- Stack2.prototype.get = stackGet;
1041
- Stack2.prototype.has = stackHas;
1042
- Stack2.prototype.set = stackSet;
1038
+ Stack3.prototype.clear = stackClear;
1039
+ Stack3.prototype["delete"] = stackDelete;
1040
+ Stack3.prototype.get = stackGet;
1041
+ Stack3.prototype.has = stackHas;
1042
+ Stack3.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 Stack2);
1158
+ stack || (stack = new Stack3);
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 Stack2);
1427
+ stack || (stack = new Stack3);
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 Stack2);
1434
+ stack || (stack = new Stack3);
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 Stack2);
1441
+ stack || (stack = new Stack3);
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 Stack2;
1467
+ var stack = new Stack3;
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 Stack2);
1563
+ stack || (stack = new Stack3);
1564
1564
  if (isObject(srcValue)) {
1565
1565
  baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
1566
1566
  } else {
@@ -5466,12 +5466,20 @@ __export(exports_core, {
5466
5466
  useRemoraidUserExperience: () => useRemoraidUserExperience,
5467
5467
  useRemoraidTheme: () => useRemoraidTheme,
5468
5468
  useRemoraidApp: () => useRemoraidApp,
5469
+ usePage: () => usePage,
5470
+ useLayouts: () => useLayouts,
5471
+ useHydrationStatus: () => useHydrationStatus,
5472
+ useHydratedMantineColorScheme: () => useHydratedMantineColorScheme,
5473
+ useFrameLayout: () => useFrameLayout,
5474
+ isFrameLayout: () => isFrameLayout,
5469
5475
  defaultUserExperienceCookieName: () => defaultUserExperienceCookieName,
5470
5476
  defaultUserExperience: () => defaultUserExperience,
5471
5477
  defaultSettingsWidgetOptions: () => defaultSettingsWidgetContext,
5472
5478
  defaultSettingsTableOptions: () => defaultSettingsTableOptions,
5473
5479
  defaultNavbarSettingsWidgetId: () => defaultNavbarSettingsWidgetId,
5474
- defaultNavbarSettings: () => defaultNavbarSettings,
5480
+ defaultLayoutsContext: () => defaultLayoutsContext,
5481
+ defaultFrameLayoutContext: () => defaultFrameLayoutContext,
5482
+ defaultAppShellLayoutId: () => defaultAppShellLayoutId,
5475
5483
  defaultAppContext: () => defaultAppContext,
5476
5484
  createUserExperienceContext: () => createUserExperienceContext,
5477
5485
  createRemoraidTheme: () => createRemoraidTheme,
@@ -5482,6 +5490,7 @@ __export(exports_core, {
5482
5490
  TransitionDuration: () => TransitionDuration,
5483
5491
  SettingsWidget: () => SettingsWidget_default,
5484
5492
  SettingsTable: () => SettingsTable_default,
5493
+ ScrollableChipGroup: () => ScrollableChipGroup,
5485
5494
  RemoraidProvider: () => RemoraidProvider,
5486
5495
  RemoraidIconSize: () => RemoraidIconSize,
5487
5496
  RemoraidButton: () => RemoraidButton,
@@ -5491,10 +5500,16 @@ __export(exports_core, {
5491
5500
  NotFoundPage: () => NotFoundPage,
5492
5501
  NavbarVariant: () => NavbarVariant,
5493
5502
  NavbarSettingsWidget: () => NavbarSettingsWidget,
5503
+ LayoutType: () => LayoutType,
5504
+ HydrationStatusProvider: () => HydrationStatusProvider,
5505
+ FrameLayoutVariant: () => FrameLayoutVariant,
5506
+ FrameLayoutSection: () => FrameLayoutSection,
5507
+ FrameLayout: () => FrameLayout_default,
5508
+ FooterVariant: () => FooterVariant,
5494
5509
  EnvironmentShell: () => EnvironmentShell,
5495
5510
  BadgeMinimal: () => BadgeMinimal,
5496
5511
  BadgeGroup: () => BadgeGroup,
5497
- AppShell: () => AppShell,
5512
+ AppShell: () => AppShell_default,
5498
5513
  AppProvider: () => AppProvider,
5499
5514
  AlertMinimal: () => AlertMinimal,
5500
5515
  AlertCategory: () => AlertCategory
@@ -5638,6 +5653,10 @@ var NavbarVariant;
5638
5653
  ((NavbarVariant2) => {
5639
5654
  NavbarVariant2["Minimal"] = "minimal";
5640
5655
  })(NavbarVariant ||= {});
5656
+ var FooterVariant;
5657
+ ((FooterVariant2) => {
5658
+ FooterVariant2["Minimal"] = "minimal";
5659
+ })(FooterVariant ||= {});
5641
5660
  var AlertCategory;
5642
5661
  ((AlertCategory2) => {
5643
5662
  AlertCategory2["Negative"] = "negative";
@@ -5660,125 +5679,176 @@ var RemoraidIconSize;
5660
5679
  RemoraidIconSize2["Tiny"] = "tiny";
5661
5680
  RemoraidIconSize2["Medium"] = "medium";
5662
5681
  })(RemoraidIconSize ||= {});
5682
+ var LayoutType;
5683
+ ((LayoutType2) => {
5684
+ LayoutType2["Frame"] = "frame";
5685
+ })(LayoutType ||= {});
5686
+ var FrameLayoutSection;
5687
+ ((FrameLayoutSection2) => {
5688
+ FrameLayoutSection2["Top"] = "top";
5689
+ FrameLayoutSection2["Bottom"] = "bottom";
5690
+ FrameLayoutSection2["Left"] = "left";
5691
+ FrameLayoutSection2["Right"] = "right";
5692
+ FrameLayoutSection2["Content"] = "content";
5693
+ })(FrameLayoutSection ||= {});
5694
+ var FrameLayoutVariant;
5695
+ ((FrameLayoutVariant2) => {
5696
+ FrameLayoutVariant2["Plain"] = "plain";
5697
+ FrameLayoutVariant2["Sticky"] = "sticky";
5698
+ })(FrameLayoutVariant ||= {});
5663
5699
 
5664
5700
  // src/core/lib/utils.ts
5665
5701
  var co = (condition, value, fallback) => condition(value) ? value : fallback;
5666
5702
 
5667
5703
  // src/core/components/RemoraidProvider/ThemeProvider/index.tsx
5668
- var import_core = require("@mantine/core");
5704
+ var import_core2 = require("@mantine/core");
5669
5705
  var import_icons_react = require("@tabler/icons-react");
5670
- var import_react2 = __toESM(require("react"));
5706
+ var import_react3 = __toESM(require("react"));
5707
+
5708
+ // src/core/components/RemoraidProvider/HydrationStatusProvider/index.tsx
5709
+ var import_core = require("@mantine/core");
5710
+ var import_react2 = require("react");
5671
5711
  var jsx_dev_runtime2 = require("react/jsx-dev-runtime");
5712
+ var defaultHydrationStatus = {
5713
+ hasHydrated: false,
5714
+ ensureHydration: () => {
5715
+ return;
5716
+ }
5717
+ };
5718
+ var hydrationStatusContext = import_react2.createContext(defaultHydrationStatus);
5719
+ var useHydrationStatus = () => {
5720
+ return import_react2.useContext(hydrationStatusContext);
5721
+ };
5722
+ var useHydratedMantineColorScheme = () => {
5723
+ const { ensureHydration } = useHydrationStatus();
5724
+ return ensureHydration(import_core.useMantineColorScheme()) ?? {};
5725
+ };
5726
+ function HydrationStatusProvider({
5727
+ children
5728
+ }) {
5729
+ const [hasHydrated, setHasHydrated] = import_react2.useState(defaultHydrationStatus.hasHydrated);
5730
+ const hydrationStatus = import_react2.useMemo(() => ({
5731
+ hasHydrated,
5732
+ ensureHydration: (v) => hasHydrated ? v : undefined
5733
+ }), [hasHydrated]);
5734
+ import_react2.useEffect(() => {
5735
+ setHasHydrated(true);
5736
+ }, []);
5737
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(hydrationStatusContext.Provider, {
5738
+ value: hydrationStatus,
5739
+ children
5740
+ }, undefined, false, undefined, this);
5741
+ }
5742
+
5743
+ // src/core/components/RemoraidProvider/ThemeProvider/index.tsx
5744
+ var jsx_dev_runtime3 = require("react/jsx-dev-runtime");
5672
5745
  var isMantinePrimaryShade = (primaryShade) => {
5673
5746
  if (isNaN(Number(primaryShade))) {
5674
5747
  return true;
5675
5748
  }
5676
5749
  return false;
5677
5750
  };
5678
- var createRemoraidTheme = (customTheme, mantineTheme, colorScheme) => {
5751
+ var createRemoraidTheme = (customTheme, dependencies) => {
5752
+ const { mantineTheme, colorScheme } = dependencies ?? {};
5679
5753
  const defaultMediumIconProps = { size: "1.125em" };
5680
5754
  let transparentBackground;
5681
5755
  let primaryColor;
5682
5756
  let spacingPx;
5683
5757
  if (mantineTheme && colorScheme) {
5684
- transparentBackground = colorScheme === "dark" ? import_core.rgba(mantineTheme.colors.dark[8], 0.8) : import_core.rgba(mantineTheme.white, 0.8);
5758
+ transparentBackground = colorScheme === "dark" ? import_core2.rgba(mantineTheme.colors.dark[8], 0.8) : import_core2.rgba(mantineTheme.white, 0.8);
5685
5759
  primaryColor = mantineTheme.colors[mantineTheme.primaryColor][isMantinePrimaryShade(mantineTheme.primaryShade) ? mantineTheme.primaryShade[colorScheme === "auto" ? "light" : colorScheme] : mantineTheme.primaryShade];
5686
5760
  spacingPx = {
5687
- xs: Number(co((v) => !Number.isNaN(v), Number(import_core.px(mantineTheme.spacing.xs)), 0)),
5688
- sm: Number(co((v) => !Number.isNaN(v), Number(import_core.px(mantineTheme.spacing.sm)), 0)),
5689
- md: Number(co((v) => !Number.isNaN(v), Number(import_core.px(mantineTheme.spacing.md)), 0)),
5690
- lg: Number(co((v) => !Number.isNaN(v), Number(import_core.px(mantineTheme.spacing.lg)), 0)),
5691
- xl: Number(co((v) => !Number.isNaN(v), Number(import_core.px(mantineTheme.spacing.xl)), 0))
5761
+ xs: Number(co((v) => !Number.isNaN(v), Number(import_core2.px(mantineTheme.spacing.xs)), 0)),
5762
+ sm: Number(co((v) => !Number.isNaN(v), Number(import_core2.px(mantineTheme.spacing.sm)), 0)),
5763
+ md: Number(co((v) => !Number.isNaN(v), Number(import_core2.px(mantineTheme.spacing.md)), 0)),
5764
+ lg: Number(co((v) => !Number.isNaN(v), Number(import_core2.px(mantineTheme.spacing.lg)), 0)),
5765
+ xl: Number(co((v) => !Number.isNaN(v), Number(import_core2.px(mantineTheme.spacing.xl)), 0))
5692
5766
  };
5693
5767
  }
5694
5768
  return {
5695
- complete: true,
5769
+ containerSize: 1300,
5770
+ jsonStringifySpace: 2,
5771
+ transparentBackground,
5772
+ primaryColor,
5773
+ spacingPx,
5774
+ ...customTheme,
5696
5775
  transitionDurations: {
5697
5776
  ["short" /* Short */]: 200,
5698
5777
  ["medium" /* Medium */]: 350,
5699
- ["long" /* Long */]: 500
5778
+ ["long" /* Long */]: 500,
5779
+ ...customTheme?.transitionDurations
5700
5780
  },
5701
5781
  breakpoints: {
5702
5782
  ["buttonCollapse" /* ButtonCollapse */]: "md",
5703
- ["badgeGroupCollapse" /* BadgeGroupCollapse */]: "md"
5783
+ ["badgeGroupCollapse" /* BadgeGroupCollapse */]: "md",
5784
+ ...customTheme?.breakpoints
5704
5785
  },
5705
5786
  scrollAreaProps: {
5706
5787
  scrollbarSize: 8,
5707
5788
  scrollHideDelay: 20,
5708
- type: "hover"
5789
+ type: "hover",
5790
+ ...customTheme?.scrollAreaProps
5709
5791
  },
5710
- containerSize: 1300,
5711
5792
  alertProps: {
5712
5793
  ["negative" /* Negative */]: {
5713
- icon: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(import_icons_react.IconAlertCircle, {
5794
+ icon: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_icons_react.IconAlertCircle, {
5714
5795
  ...defaultMediumIconProps
5715
5796
  }, undefined, false, undefined, this),
5716
5797
  variant: "light",
5717
5798
  color: "red",
5718
- title: "Attention!"
5799
+ title: "Attention!",
5800
+ ...customTheme?.alertProps?.negative
5719
5801
  },
5720
5802
  ["neutral" /* Neutral */]: {
5721
- icon: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(import_icons_react.IconInfoCircle, {
5803
+ icon: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_icons_react.IconInfoCircle, {
5722
5804
  ...defaultMediumIconProps
5723
5805
  }, undefined, false, undefined, this),
5724
5806
  variant: "light",
5725
5807
  color: mantineTheme?.primaryColor,
5726
- title: "Information"
5808
+ title: "Information",
5809
+ ...customTheme?.alertProps?.neutral
5727
5810
  },
5728
5811
  ["positive" /* Positive */]: {
5729
- icon: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(import_icons_react.IconCircleCheck, {
5812
+ icon: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_icons_react.IconCircleCheck, {
5730
5813
  ...defaultMediumIconProps
5731
5814
  }, undefined, false, undefined, this),
5732
5815
  variant: "light",
5733
5816
  color: "green",
5734
- title: "Success"
5817
+ title: "Success",
5818
+ ...customTheme?.alertProps?.positive
5735
5819
  }
5736
5820
  },
5737
5821
  iconProps: {
5738
- ["medium" /* Medium */]: defaultMediumIconProps,
5739
- ["tiny" /* Tiny */]: { size: 14, stroke: 3 }
5740
- },
5741
- jsonStringifySpace: 2,
5742
- transparentBackground,
5743
- primaryColor,
5744
- spacingPx,
5745
- ...customTheme
5822
+ ["medium" /* Medium */]: {
5823
+ ...defaultMediumIconProps,
5824
+ ...customTheme?.iconProps?.medium
5825
+ },
5826
+ ["tiny" /* Tiny */]: {
5827
+ size: 14,
5828
+ stroke: 3,
5829
+ ...customTheme?.iconProps?.tiny
5830
+ }
5831
+ }
5746
5832
  };
5747
5833
  };
5748
- var isRemoraidTheme = (x) => {
5749
- if (!x) {
5750
- return false;
5751
- }
5752
- if (typeof x !== "object") {
5753
- return false;
5754
- }
5755
- if (!("complete" in x)) {
5756
- return false;
5757
- }
5758
- return true;
5759
- };
5760
- var themeContext = import_react2.default.createContext(createRemoraidTheme());
5834
+ var themeContext = import_react3.default.createContext(createRemoraidTheme());
5761
5835
  var useRemoraidTheme = () => {
5762
- return import_react2.useContext(themeContext);
5836
+ return import_react3.useContext(themeContext);
5763
5837
  };
5764
5838
  function ThemeProvider({
5765
- children,
5766
- theme
5839
+ theme,
5840
+ children
5767
5841
  }) {
5768
- const mantineTheme = import_core.useMantineTheme();
5769
- const { colorScheme } = import_core.useMantineColorScheme();
5770
- const remoraidTheme = import_react2.useMemo(() => {
5771
- let value;
5772
- if (isRemoraidTheme(theme)) {
5773
- value = theme;
5774
- } else if (typeof theme === "function") {
5775
- value = theme(mantineTheme, colorScheme);
5776
- } else {
5777
- value = createRemoraidTheme(theme, mantineTheme, colorScheme);
5778
- }
5779
- return value;
5780
- }, [colorScheme]);
5781
- return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(themeContext.Provider, {
5842
+ const mantineTheme = import_core2.useMantineTheme();
5843
+ const { colorScheme } = useHydratedMantineColorScheme();
5844
+ const remoraidTheme = import_react3.useMemo(() => {
5845
+ const dependencies = {
5846
+ mantineTheme,
5847
+ colorScheme
5848
+ };
5849
+ return createRemoraidTheme(typeof theme === "function" ? theme(dependencies) : theme, dependencies);
5850
+ }, [colorScheme, theme]);
5851
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(themeContext.Provider, {
5782
5852
  value: remoraidTheme,
5783
5853
  children
5784
5854
  }, undefined, false, undefined, this);
@@ -5788,85 +5858,232 @@ function ThemeProvider({
5788
5858
  var import_react_cookie2 = require("react-cookie");
5789
5859
 
5790
5860
  // src/core/components/RemoraidProvider/CoreUserExperienceProvider/index.tsx
5861
+ var import_react5 = require("react");
5862
+
5863
+ // src/core/components/UserExperienceProviderWrapper/index.tsx
5864
+ var import_react4 = require("react");
5865
+ var import_react_cookie = require("react-cookie");
5866
+ var jsx_dev_runtime4 = require("react/jsx-dev-runtime");
5867
+ var createUserExperienceContext = (defaultUserExperience) => import_react4.createContext({
5868
+ userExperience: defaultUserExperience,
5869
+ updateUserExperience: () => {},
5870
+ processedCookie: false,
5871
+ initialUserExperience: defaultUserExperience
5872
+ });
5873
+ function UserExperienceProviderWrapper({
5874
+ children,
5875
+ context,
5876
+ cookieName,
5877
+ defaultUserExperience,
5878
+ isValidUserExperience,
5879
+ initialValue
5880
+ }) {
5881
+ const [cookies, setCookie] = import_react_cookie.useCookies();
5882
+ const initialUserExperience = {
5883
+ ...defaultUserExperience,
5884
+ ...initialValue
5885
+ };
5886
+ const [userExperience, setUserExperience] = import_react4.useState(initialUserExperience);
5887
+ const [processedCookie, setProcessedCookie] = import_react4.useState(false);
5888
+ const updateUserExperience = (p) => {
5889
+ const updatedUserExperience = typeof p === "function" ? p(userExperience) : p;
5890
+ setCookie(cookieName, updatedUserExperience, { path: "/" });
5891
+ setUserExperience(updatedUserExperience);
5892
+ };
5893
+ import_react4.useEffect(() => {
5894
+ const userExperienceCookie = cookies[cookieName];
5895
+ if (userExperienceCookie && isValidUserExperience(userExperienceCookie)) {
5896
+ setUserExperience(userExperienceCookie);
5897
+ }
5898
+ if (cookies && !processedCookie) {
5899
+ setProcessedCookie(true);
5900
+ }
5901
+ }, [cookies]);
5902
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(context.Provider, {
5903
+ value: {
5904
+ userExperience,
5905
+ updateUserExperience,
5906
+ processedCookie,
5907
+ initialUserExperience
5908
+ },
5909
+ children
5910
+ }, undefined, false, undefined, this);
5911
+ }
5912
+
5913
+ // src/core/components/RemoraidProvider/CoreUserExperienceProvider/index.tsx
5914
+ var jsx_dev_runtime5 = require("react/jsx-dev-runtime");
5915
+ var defaultUserExperience = {
5916
+ showWelcomeMessage: true,
5917
+ navbar: { hiddenPages: [] }
5918
+ };
5919
+ var defaultUserExperienceCookieName = "remoraid-core-user-experience";
5920
+ var coreUserExperienceContext = createUserExperienceContext(defaultUserExperience);
5921
+ var useRemoraidUserExperience = () => {
5922
+ return import_react5.useContext(coreUserExperienceContext);
5923
+ };
5924
+ function CoreUserExperienceProvider({
5925
+ children,
5926
+ initialValue,
5927
+ cookieName
5928
+ }) {
5929
+ const isValidUserExperience = (x) => {
5930
+ if (typeof x !== "object") {
5931
+ return false;
5932
+ }
5933
+ if (x === null) {
5934
+ return false;
5935
+ }
5936
+ if (!("showWelcomeMessage" in x)) {
5937
+ return false;
5938
+ }
5939
+ if (!("navbar" in x)) {
5940
+ return false;
5941
+ }
5942
+ return true;
5943
+ };
5944
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(UserExperienceProviderWrapper, {
5945
+ context: coreUserExperienceContext,
5946
+ isValidUserExperience,
5947
+ cookieName: cookieName ?? defaultUserExperienceCookieName,
5948
+ defaultUserExperience,
5949
+ initialValue,
5950
+ children
5951
+ }, undefined, false, undefined, this);
5952
+ }
5953
+
5954
+ // src/core/components/RemoraidProvider/LayoutsProvider/index.tsx
5791
5955
  var import_react6 = require("react");
5956
+ var jsx_dev_runtime6 = require("react/jsx-dev-runtime");
5957
+ var defaultLayoutsContext = {
5958
+ layouts: {},
5959
+ setLayouts: () => {}
5960
+ };
5961
+ var layoutsContext = import_react6.createContext(defaultLayoutsContext);
5962
+ var useLayouts = () => {
5963
+ return import_react6.useContext(layoutsContext);
5964
+ };
5965
+ function LayoutsProvider({
5966
+ children
5967
+ }) {
5968
+ const [layouts, setLayouts] = import_react6.useState({});
5969
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(layoutsContext.Provider, {
5970
+ value: { layouts, setLayouts },
5971
+ children
5972
+ }, undefined, false, undefined, this);
5973
+ }
5974
+
5975
+ // src/core/components/RemoraidProvider/index.tsx
5976
+ var jsx_dev_runtime7 = require("react/jsx-dev-runtime");
5977
+ function RemoraidProvider({
5978
+ children,
5979
+ theme,
5980
+ initialUserExperience,
5981
+ componentsProps
5982
+ }) {
5983
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_react_cookie2.CookiesProvider, {
5984
+ ...componentsProps?.CookiesProvider,
5985
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(HydrationStatusProvider, {
5986
+ ...componentsProps?.HydrationStatusProviderProps,
5987
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemeProvider, {
5988
+ theme,
5989
+ ...componentsProps?.ThemeProvider,
5990
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(CoreUserExperienceProvider, {
5991
+ initialValue: initialUserExperience,
5992
+ ...componentsProps?.CoreUserExperienceProvider,
5993
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(WidgetsProvider, {
5994
+ ...componentsProps?.WidgetsProvider,
5995
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(LayoutsProvider, {
5996
+ ...componentsProps?.LayoutsProviderProps,
5997
+ children
5998
+ }, undefined, false, undefined, this)
5999
+ }, undefined, false, undefined, this)
6000
+ }, undefined, false, undefined, this)
6001
+ }, undefined, false, undefined, this)
6002
+ }, undefined, false, undefined, this)
6003
+ }, undefined, false, undefined, this);
6004
+ }
6005
+ // src/core/components/AppShell/index.tsx
6006
+ var import_core7 = require("@mantine/core");
5792
6007
 
5793
6008
  // src/core/components/AppShell/NavbarMinimal/index.tsx
5794
- var import_core2 = require("@mantine/core");
6009
+ var import_core3 = require("@mantine/core");
5795
6010
  var import_icons_react2 = require("@tabler/icons-react");
5796
6011
  var import_link = __toESM(require("next/link"));
5797
6012
  var import_navigation = require("next/navigation");
5798
- var import_react4 = require("react");
6013
+ var import_react8 = require("react");
5799
6014
 
5800
6015
  // src/core/components/AppShell/AppProvider/index.tsx
5801
- var import_react3 = require("react");
5802
- var jsx_dev_runtime3 = require("react/jsx-dev-runtime");
5803
- var defaultAppContext = { navigablePages: [] };
5804
- var appContext = import_react3.createContext(defaultAppContext);
6016
+ var import_react7 = require("react");
6017
+ var jsx_dev_runtime8 = require("react/jsx-dev-runtime");
6018
+ var defaultAppContext = {
6019
+ navigablePages: []
6020
+ };
6021
+ var appContext = import_react7.createContext(defaultAppContext);
5805
6022
  var useRemoraidApp = () => {
5806
- return import_react3.useContext(appContext);
6023
+ return import_react7.useContext(appContext);
5807
6024
  };
5808
6025
  function AppProvider({
5809
- children,
5810
- navigablePages,
5811
- user
6026
+ appContext: appContextProps,
6027
+ children
5812
6028
  }) {
5813
- return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(appContext.Provider, {
5814
- value: { navigablePages, user },
6029
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(appContext.Provider, {
6030
+ value: { ...appContextProps },
5815
6031
  children
5816
6032
  }, undefined, false, undefined, this);
5817
6033
  }
5818
6034
 
5819
6035
  // src/core/components/AppShell/NavbarMinimal/index.tsx
5820
- var jsx_dev_runtime4 = require("react/jsx-dev-runtime");
6036
+ var jsx_dev_runtime9 = require("react/jsx-dev-runtime");
5821
6037
  function NavbarLink({
5822
6038
  icon,
6039
+ linkSize,
6040
+ iconSize,
5823
6041
  label,
5824
6042
  active,
5825
6043
  onClick,
5826
6044
  href,
5827
- indicator,
5828
- settings
6045
+ indicator
5829
6046
  }) {
5830
- const [isHoveringRoleIndicator, setIsHoveringRoleIndicator] = import_react4.useState(false);
6047
+ const [isHoveringRoleIndicator, setIsHoveringRoleIndicator] = import_react8.useState(false);
5831
6048
  const iconProps = {
5832
- size: settings.iconSize,
6049
+ size: iconSize,
5833
6050
  stroke: 1.5
5834
6051
  };
5835
6052
  const Icon2 = icon ?? import_icons_react2.IconLink;
5836
6053
  if (!href) {
5837
- return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core2.Tooltip, {
6054
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Tooltip, {
5838
6055
  label,
5839
6056
  position: "right",
5840
6057
  transitionProps: { duration: 0 },
5841
- children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core2.UnstyledButton, {
6058
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.UnstyledButton, {
5842
6059
  onClick,
5843
6060
  className: "remoraid-navbar-minimal-link",
5844
6061
  "data-active": active || undefined,
5845
- w: settings.linkSize,
5846
- h: settings.linkSize,
5847
- children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Icon2, {
6062
+ w: linkSize,
6063
+ h: linkSize,
6064
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Icon2, {
5848
6065
  ...iconProps
5849
6066
  }, undefined, false, undefined, this)
5850
6067
  }, undefined, false, undefined, this)
5851
6068
  }, undefined, false, undefined, this);
5852
6069
  }
5853
- const button = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core2.UnstyledButton, {
6070
+ const button = /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.UnstyledButton, {
5854
6071
  onClick,
5855
6072
  className: "remoraid-navbar-minimal-link",
5856
6073
  "data-active": active || undefined,
5857
- w: settings.linkSize,
5858
- h: settings.linkSize,
6074
+ w: linkSize,
6075
+ h: linkSize,
5859
6076
  component: import_link.default,
5860
6077
  href,
5861
- children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Icon2, {
6078
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Icon2, {
5862
6079
  ...iconProps
5863
6080
  }, undefined, false, undefined, this)
5864
6081
  }, undefined, false, undefined, this);
5865
- return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core2.Tooltip, {
6082
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Tooltip, {
5866
6083
  label,
5867
6084
  position: "right",
5868
6085
  transitionProps: { duration: 0 },
5869
- children: indicator === undefined ? button : /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core2.Indicator, {
6086
+ children: indicator === undefined ? button : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Indicator, {
5870
6087
  withBorder: true,
5871
6088
  size: 13,
5872
6089
  offset: 2,
@@ -5877,108 +6094,103 @@ function NavbarLink({
5877
6094
  }, undefined, false, undefined, this)
5878
6095
  }, undefined, false, undefined, this);
5879
6096
  }
5880
- var defaultSettings = {
5881
- hiddenPages: [],
5882
- linkSize: import_core2.rem("50px"),
5883
- iconSize: "50%",
5884
- px: "sm",
5885
- py: "md"
5886
- };
5887
6097
  function NavbarMinimal({
5888
- logo,
5889
- user,
5890
- settings: settingsProp,
6098
+ linkSize = import_core3.rem("50px"),
6099
+ iconSize = "50%",
5891
6100
  linkIndicator,
5892
6101
  logoIndicator,
5893
- onLogout
6102
+ componentsProps
5894
6103
  }) {
5895
- const { userExperience } = useRemoraidUserExperience();
5896
6104
  const pathname = import_navigation.usePathname();
5897
6105
  const theme = useRemoraidTheme();
5898
- const { setColorScheme, colorScheme } = import_core2.useMantineColorScheme();
5899
- const app = useRemoraidApp();
5900
- const [isHoveringRoleIndicator, setIsHoveringRoleIndicator] = import_react4.useState(false);
5901
- const settings = {
5902
- ...userExperience.navbarSettings,
5903
- ...settingsProp
6106
+ const { setColorScheme, colorScheme } = useHydratedMantineColorScheme();
6107
+ const { userExperience } = useRemoraidUserExperience();
6108
+ const { navigablePages, logo, auth } = useRemoraidApp();
6109
+ const [isHoveringRoleIndicator, setIsHoveringRoleIndicator] = import_react8.useState(false);
6110
+ const linkProps = {
6111
+ linkSize,
6112
+ iconSize,
6113
+ ...componentsProps?.link
5904
6114
  };
5905
- const links = app.navigablePages.filter((link) => !settings.hiddenPages.includes(link.href)).map((link) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(NavbarLink, {
6115
+ const links = navigablePages.filter((link) => !userExperience.navbar.hiddenPages.includes(link.href)).map((link) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(NavbarLink, {
5906
6116
  active: link.href === pathname,
5907
6117
  indicator: linkIndicator,
5908
- settings,
5909
- ...link
6118
+ ...link,
6119
+ ...linkProps
5910
6120
  }, link.label, false, undefined, this));
5911
- const logoImage = logo({
6121
+ const logoProps = {
5912
6122
  style: {
5913
6123
  cursor: "pointer",
5914
- width: settings.linkSize,
5915
- height: settings.linkSize
6124
+ width: linkSize,
6125
+ height: linkSize
5916
6126
  }
5917
- });
5918
- return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core2.Paper, {
6127
+ };
6128
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Paper, {
5919
6129
  h: "100%",
5920
- py: settings.py,
5921
- bg: theme.transparentBackground,
5922
- radius: 0,
6130
+ p: "md",
5923
6131
  shadow: "md",
5924
- children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core2.Flex, {
6132
+ bg: theme.transparentBackground,
6133
+ ...componentsProps?.container,
6134
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Flex, {
5925
6135
  direction: "column",
5926
6136
  h: "100%",
5927
6137
  align: "center",
5928
- px: settings.px,
5929
6138
  children: [
5930
- logoIndicator === undefined ? logoImage : /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core2.Indicator, {
5931
- withBorder: true,
5932
- offset: 2,
5933
- size: 13,
5934
- onMouseEnter: () => setIsHoveringRoleIndicator(true),
5935
- onMouseLeave: () => setIsHoveringRoleIndicator(false),
5936
- ...logoIndicator(isHoveringRoleIndicator),
5937
- children: logoImage
5938
- }, undefined, false, undefined, this),
5939
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core2.Divider, {
5940
- my: "md",
5941
- variant: "dashed",
5942
- w: "100%"
5943
- }, undefined, false, undefined, this),
5944
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core2.Stack, {
6139
+ logo !== undefined && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
6140
+ children: [
6141
+ logoIndicator === undefined ? logo(logoProps) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Indicator, {
6142
+ withBorder: true,
6143
+ offset: 2,
6144
+ size: 13,
6145
+ onMouseEnter: () => setIsHoveringRoleIndicator(true),
6146
+ onMouseLeave: () => setIsHoveringRoleIndicator(false),
6147
+ ...logoIndicator(isHoveringRoleIndicator),
6148
+ children: logo(logoProps)
6149
+ }, undefined, false, undefined, this),
6150
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Divider, {
6151
+ my: "md",
6152
+ variant: "dashed",
6153
+ w: "100%"
6154
+ }, undefined, false, undefined, this)
6155
+ ]
6156
+ }, undefined, true, undefined, this),
6157
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Stack, {
5945
6158
  justify: "flex-start",
5946
6159
  gap: 0,
5947
6160
  flex: 1,
5948
6161
  children: links
5949
6162
  }, undefined, false, undefined, this),
5950
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_core2.Stack, {
6163
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core3.Stack, {
5951
6164
  justify: "center",
5952
6165
  gap: 0,
5953
6166
  children: [
5954
- user !== undefined && (user === null ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(NavbarLink, {
6167
+ auth !== undefined && (auth.user === null ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(NavbarLink, {
5955
6168
  icon: import_icons_react2.IconLogin,
5956
6169
  label: "Login",
5957
6170
  href: "/login",
5958
6171
  active: pathname === "/login",
5959
- settings
5960
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(NavbarLink, {
6172
+ ...linkProps
6173
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(NavbarLink, {
5961
6174
  icon: import_icons_react2.IconLogout,
5962
6175
  label: "Logout",
5963
6176
  onClick: () => {
5964
- if (onLogout) {
5965
- onLogout();
6177
+ if (auth.onLogout) {
6178
+ auth.onLogout();
5966
6179
  }
5967
6180
  },
5968
6181
  href: "/login",
5969
- settings
6182
+ ...linkProps
5970
6183
  }, undefined, false, undefined, this)),
5971
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(NavbarLink, {
6184
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(NavbarLink, {
5972
6185
  icon: colorScheme === "dark" ? import_icons_react2.IconSun : import_icons_react2.IconMoon,
5973
6186
  onClick: () => {
5974
- if (colorScheme === "dark") {
5975
- setColorScheme("light");
5976
- } else {
5977
- setColorScheme("dark");
6187
+ if (!colorScheme || !setColorScheme) {
6188
+ return;
5978
6189
  }
6190
+ setColorScheme(colorScheme === "dark" ? "light" : "dark");
5979
6191
  },
5980
6192
  label: "Toggle Color Scheme",
5981
- settings
6193
+ ...linkProps
5982
6194
  }, undefined, false, undefined, this)
5983
6195
  ]
5984
6196
  }, undefined, true, undefined, this)
@@ -5987,255 +6199,301 @@ function NavbarMinimal({
5987
6199
  }, undefined, false, undefined, this);
5988
6200
  }
5989
6201
 
5990
- // src/core/components/UserExperienceProviderWrapper/index.tsx
5991
- var import_react5 = require("react");
5992
- var import_react_cookie = require("react-cookie");
5993
- var jsx_dev_runtime5 = require("react/jsx-dev-runtime");
5994
- var createUserExperienceContext = (defaultUserExperience) => import_react5.createContext({
5995
- userExperience: defaultUserExperience,
5996
- updateUserExperience: () => {},
5997
- processedCookie: false,
5998
- initialUserExperience: defaultUserExperience
5999
- });
6000
- function UserExperienceProviderWrapper({
6001
- children,
6002
- context,
6003
- cookieName,
6004
- defaultUserExperience,
6005
- isValidUserExperience,
6006
- initialValue
6202
+ // src/core/components/AppShell/FooterMinimal/index.tsx
6203
+ var import_core4 = require("@mantine/core");
6204
+ var import_icons_react3 = require("@tabler/icons-react");
6205
+ var jsx_dev_runtime10 = require("react/jsx-dev-runtime");
6206
+ function FooterMinimal({
6207
+ componentsProps
6007
6208
  }) {
6008
- const [cookies, setCookie] = import_react_cookie.useCookies();
6009
- const initialUserExperience = {
6010
- ...defaultUserExperience,
6011
- ...initialValue
6012
- };
6013
- const [userExperience, setUserExperience] = import_react5.useState(initialUserExperience);
6014
- const [processedCookie, setProcessedCookie] = import_react5.useState(false);
6015
- const updateUserExperience = (p) => {
6016
- const updatedUserExperience = typeof p === "function" ? p(userExperience) : p;
6017
- setCookie(cookieName, updatedUserExperience, { path: "/" });
6018
- setUserExperience(updatedUserExperience);
6019
- };
6020
- import_react5.useEffect(() => {
6021
- const userExperienceCookie = cookies[cookieName];
6022
- if (userExperienceCookie && isValidUserExperience(userExperienceCookie)) {
6023
- setUserExperience(userExperienceCookie);
6024
- }
6025
- if (cookies && !processedCookie) {
6026
- setProcessedCookie(true);
6027
- }
6028
- }, [cookies]);
6029
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(context.Provider, {
6030
- value: {
6031
- userExperience,
6032
- updateUserExperience,
6033
- processedCookie,
6034
- initialUserExperience
6035
- },
6036
- children
6209
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_core4.Group, {
6210
+ justify: "center",
6211
+ w: "100%",
6212
+ py: "md",
6213
+ ...componentsProps?.container,
6214
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_icons_react3.IconPennant, {
6215
+ size: 50,
6216
+ color: "var(--mantine-color-default-border)",
6217
+ ...componentsProps?.icon
6218
+ }, undefined, false, undefined, this)
6037
6219
  }, undefined, false, undefined, this);
6038
6220
  }
6039
6221
 
6040
- // src/core/components/RemoraidProvider/CoreUserExperienceProvider/index.tsx
6041
- var jsx_dev_runtime6 = require("react/jsx-dev-runtime");
6042
- var defaultNavbarSettings = {
6043
- ["minimal" /* Minimal */]: defaultSettings
6044
- };
6045
- var defaultUserExperience = {
6046
- navbarVariant: "minimal" /* Minimal */,
6047
- navbarSettings: defaultNavbarSettings["minimal" /* Minimal */],
6048
- showWelcomeMessage: true
6049
- };
6050
- var defaultUserExperienceCookieName = "remoraid-core-user-experience";
6051
- var coreUserExperienceContext = createUserExperienceContext(defaultUserExperience);
6052
- var useRemoraidUserExperience = () => {
6053
- return import_react6.useContext(coreUserExperienceContext);
6054
- };
6055
- function CoreUserExperienceProvider({
6056
- children,
6057
- initialValue,
6058
- cookieName
6222
+ // src/core/components/FrameLayout/index.tsx
6223
+ var import_core6 = require("@mantine/core");
6224
+ var import_react9 = require("react");
6225
+
6226
+ // src/core/components/FrameLayout/Element/index.tsx
6227
+ var import_core5 = require("@mantine/core");
6228
+ var jsx_dev_runtime11 = require("react/jsx-dev-runtime");
6229
+ function Element({
6230
+ section,
6231
+ includeContainer = true,
6232
+ layoutId,
6233
+ componentsProps,
6234
+ children
6059
6235
  }) {
6060
- const isValidUserExperience = (x) => {
6061
- if (typeof x !== "object") {
6062
- return false;
6063
- }
6064
- if (x === null) {
6065
- return false;
6066
- }
6067
- if (!("showWelcomeMessage" in x)) {
6068
- return false;
6069
- }
6070
- if (!("navbarVariant" in x)) {
6071
- return false;
6072
- }
6073
- if (!("navbarSettings" in x)) {
6074
- return false;
6075
- }
6076
- if (typeof x.navbarSettings !== "object") {
6077
- return false;
6078
- }
6079
- if (x.navbarSettings === null) {
6080
- return false;
6081
- }
6082
- if (!("hiddenPages" in x.navbarSettings)) {
6083
- return false;
6084
- }
6085
- if (!("linkSize" in x.navbarSettings)) {
6086
- return false;
6087
- }
6088
- if (!("px" in x.navbarSettings)) {
6089
- return false;
6090
- }
6091
- if (!("py" in x.navbarSettings)) {
6092
- return false;
6093
- }
6094
- return true;
6095
- };
6096
- return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(UserExperienceProviderWrapper, {
6097
- context: coreUserExperienceContext,
6098
- isValidUserExperience,
6099
- cookieName: cookieName ?? defaultUserExperienceCookieName,
6100
- defaultUserExperience,
6101
- initialValue,
6102
- children
6236
+ const { layouts } = useLayouts();
6237
+ const closestLayout = useFrameLayout();
6238
+ if (closestLayout.layoutId === null) {
6239
+ return null;
6240
+ }
6241
+ const layout = layouts[layoutId ?? closestLayout.layoutId];
6242
+ if (!isFrameLayout(layout)) {
6243
+ return null;
6244
+ }
6245
+ if (layout.sections[section] === null) {
6246
+ return null;
6247
+ }
6248
+ let containerProps = {};
6249
+ if (section === "left" /* Left */ || section === "right" /* Right */) {
6250
+ containerProps.h = "100%";
6251
+ }
6252
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(import_core5.Portal, {
6253
+ target: layout.sections[section],
6254
+ children: includeContainer ? /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(import_core5.Box, {
6255
+ ...containerProps,
6256
+ ...componentsProps?.container,
6257
+ children
6258
+ }, undefined, false, undefined, this) : children
6103
6259
  }, undefined, false, undefined, this);
6104
6260
  }
6105
6261
 
6106
- // src/core/components/RemoraidProvider/index.tsx
6107
- var jsx_dev_runtime7 = require("react/jsx-dev-runtime");
6108
- function RemoraidProvider({
6109
- children,
6110
- theme,
6111
- initialUserExperience,
6112
- componentsProps
6262
+ // src/core/components/FrameLayout/index.tsx
6263
+ var jsx_dev_runtime12 = require("react/jsx-dev-runtime");
6264
+ var isFrameLayout = (layout) => {
6265
+ if (typeof layout !== "object" || layout === null) {
6266
+ return false;
6267
+ }
6268
+ if (!("sections" in layout)) {
6269
+ return false;
6270
+ }
6271
+ if (typeof layout.sections !== "object" || layout.sections === null) {
6272
+ return false;
6273
+ }
6274
+ return true;
6275
+ };
6276
+ var defaultFrameLayoutVariant = "sticky" /* Sticky */;
6277
+ var defaultFrameLayoutContext = {
6278
+ layoutId: null,
6279
+ layout: {
6280
+ sections: {
6281
+ ["top" /* Top */]: null,
6282
+ ["bottom" /* Bottom */]: null,
6283
+ ["left" /* Left */]: null,
6284
+ ["right" /* Right */]: null
6285
+ }
6286
+ },
6287
+ setLayout: () => {}
6288
+ };
6289
+ var layoutContext = import_react9.createContext(defaultFrameLayoutContext);
6290
+ var useFrameLayout = () => {
6291
+ return import_react9.useContext(layoutContext);
6292
+ };
6293
+ function FrameLayout({
6294
+ variant = defaultFrameLayoutVariant,
6295
+ layoutId,
6296
+ componentsProps,
6297
+ children
6113
6298
  }) {
6114
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_react_cookie2.CookiesProvider, {
6115
- ...componentsProps?.CookiesProvider,
6116
- children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemeProvider, {
6117
- theme,
6118
- ...componentsProps?.ThemeProvider,
6119
- children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(CoreUserExperienceProvider, {
6120
- initialValue: initialUserExperience,
6121
- ...componentsProps?.CoreUserExperienceProvider,
6122
- children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(WidgetsProvider, {
6123
- ...componentsProps?.WidgetsProvider,
6124
- children
6299
+ const theme = useRemoraidTheme();
6300
+ const { layouts, setLayouts } = useLayouts();
6301
+ const layout = layouts[layoutId];
6302
+ const setLayout = import_react9.useMemo(() => {
6303
+ return (value) => {
6304
+ setLayouts((prev) => ({
6305
+ ...prev,
6306
+ [layoutId]: typeof value === "function" ? value(prev[layoutId]) : value
6307
+ }));
6308
+ };
6309
+ }, [layoutId, setLayouts]);
6310
+ const topSection = import_react9.useCallback((n) => {
6311
+ setLayout((prev) => ({
6312
+ ...prev,
6313
+ sections: { ...prev?.sections, ["top" /* Top */]: n }
6314
+ }));
6315
+ }, [setLayout]);
6316
+ const bottomSection = import_react9.useCallback((n) => {
6317
+ setLayout((prev) => ({
6318
+ ...prev,
6319
+ sections: { ...prev?.sections, ["bottom" /* Bottom */]: n }
6320
+ }));
6321
+ }, [setLayout]);
6322
+ const leftSection = import_react9.useCallback((n) => {
6323
+ setLayout((prev) => ({
6324
+ ...prev,
6325
+ sections: { ...prev?.sections, ["left" /* Left */]: n }
6326
+ }));
6327
+ }, [setLayout]);
6328
+ const rightSection = import_react9.useCallback((n) => {
6329
+ setLayout((prev) => ({
6330
+ ...prev,
6331
+ sections: { ...prev?.sections, ["right" /* Right */]: n }
6332
+ }));
6333
+ }, [setLayout]);
6334
+ let contentSection = children;
6335
+ const childrenContainerProps = {
6336
+ flex: 1,
6337
+ ...componentsProps?.childrenContainer
6338
+ };
6339
+ if (variant === "plain" /* Plain */) {
6340
+ contentSection = /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Box, {
6341
+ ...childrenContainerProps,
6342
+ children: contentSection
6343
+ }, undefined, false, undefined, this);
6344
+ } else if (variant === "sticky" /* Sticky */) {
6345
+ contentSection = /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.ScrollArea, {
6346
+ ...theme.scrollAreaProps,
6347
+ ...childrenContainerProps,
6348
+ children
6349
+ }, undefined, false, undefined, this);
6350
+ }
6351
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(layoutContext.Provider, {
6352
+ value: { layoutId, layout, setLayout },
6353
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Group, {
6354
+ gap: 0,
6355
+ h: "100%",
6356
+ w: "100%",
6357
+ wrap: "nowrap",
6358
+ ...componentsProps?.horizontalContainer,
6359
+ children: [
6360
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Group, {
6361
+ ref: leftSection,
6362
+ h: "100%",
6363
+ gap: 0,
6364
+ wrap: "nowrap",
6365
+ ...componentsProps?.sectionContainers?.["left" /* Left */]
6366
+ }, undefined, false, undefined, this),
6367
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Stack, {
6368
+ h: "100%",
6369
+ flex: 1,
6370
+ gap: 0,
6371
+ ...componentsProps?.verticalContainer,
6372
+ children: [
6373
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Stack, {
6374
+ h: "100%",
6375
+ ref: topSection,
6376
+ gap: 0,
6377
+ flex: 0,
6378
+ ...componentsProps?.sectionContainers?.["top" /* Top */]
6379
+ }, undefined, false, undefined, this),
6380
+ contentSection,
6381
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Stack, {
6382
+ h: "100%",
6383
+ ref: bottomSection,
6384
+ gap: 0,
6385
+ flex: 0,
6386
+ ...componentsProps?.sectionContainers?.["bottom" /* Bottom */]
6387
+ }, undefined, false, undefined, this)
6388
+ ]
6389
+ }, undefined, true, undefined, this),
6390
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Group, {
6391
+ gap: 0,
6392
+ ref: rightSection,
6393
+ h: "100%",
6394
+ wrap: "nowrap",
6395
+ ...componentsProps?.sectionContainers?.["right" /* Right */]
6125
6396
  }, undefined, false, undefined, this)
6126
- }, undefined, false, undefined, this)
6127
- }, undefined, false, undefined, this)
6128
- }, undefined, false, undefined, this);
6129
- }
6130
- // src/core/components/AppShell/index.tsx
6131
- var import_core4 = require("@mantine/core");
6132
- var import_hooks = require("@mantine/hooks");
6133
-
6134
- // src/core/components/AppShell/Footer/index.tsx
6135
- var import_core3 = require("@mantine/core");
6136
- var import_icons_react3 = require("@tabler/icons-react");
6137
- var jsx_dev_runtime8 = require("react/jsx-dev-runtime");
6138
- function Footer() {
6139
- const theme = import_core3.useMantineTheme();
6140
- const { colorScheme } = import_core3.useMantineColorScheme();
6141
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(import_core3.Group, {
6142
- justify: "center",
6143
- w: "100%",
6144
- py: "md",
6145
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(import_icons_react3.IconPennant, {
6146
- size: 50,
6147
- color: colorScheme === "dark" ? theme.colors.dark[8] : theme.colors.gray[3]
6148
- }, undefined, false, undefined, this)
6397
+ ]
6398
+ }, undefined, true, undefined, this)
6149
6399
  }, undefined, false, undefined, this);
6150
6400
  }
6401
+ var FrameLayout_default = Object.assign(FrameLayout, {
6402
+ Element
6403
+ });
6151
6404
 
6152
6405
  // src/core/components/AppShell/index.tsx
6153
- var jsx_dev_runtime9 = require("react/jsx-dev-runtime");
6154
- function AppShell({
6155
- children,
6156
- logo,
6157
- navbar,
6158
- user,
6159
- navigablePages
6160
- }) {
6161
- const { userExperience } = useRemoraidUserExperience();
6162
- const mantineTheme = import_core4.useMantineTheme();
6163
- const theme = useRemoraidTheme();
6164
- const { colorScheme } = import_core4.useMantineColorScheme();
6165
- const [opened, { toggle }] = import_hooks.useDisclosure();
6166
- const navbarVariant = navbar && navbar.variant ? navbar.variant : userExperience.navbarVariant;
6167
- const navbarSettings = navbar && navbar.settings ? navbar.settings : userExperience.navbarSettings;
6168
- const navbarLinkSizePx = co((v) => !Number.isNaN(v), Number(import_core4.px(navbarSettings.linkSize)), 0);
6169
- const navbarPaddingPx = typeof navbarSettings.px === "number" ? navbarSettings.px : theme.spacingPx ? theme.spacingPx[navbarSettings.px] : 0;
6170
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(AppProvider, {
6171
- user,
6172
- navigablePages,
6173
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core4.AppShell, {
6174
- header: { height: 0 },
6175
- navbar: {
6176
- width: import_core4.rem(`${navbarLinkSizePx + 2 * navbarPaddingPx}px`),
6177
- breakpoint: "sm",
6178
- collapsed: { mobile: !opened }
6179
- },
6180
- bg: colorScheme === "dark" ? mantineTheme.colors.dark[9] : mantineTheme.colors.gray[0],
6406
+ var jsx_dev_runtime13 = require("react/jsx-dev-runtime");
6407
+ var defaultAppShellLayoutId = "remoraidAppShell";
6408
+ var defaultProps = {
6409
+ navbarVariant: null,
6410
+ footerVariant: null
6411
+ };
6412
+ function AppShell(props) {
6413
+ const {
6414
+ children,
6415
+ navbarVariant,
6416
+ footerVariant,
6417
+ navbarPosition,
6418
+ footerPosition,
6419
+ appContext: appContext2,
6420
+ componentsProps
6421
+ } = {
6422
+ ...defaultProps,
6423
+ ...props
6424
+ };
6425
+ let navbar;
6426
+ let footer;
6427
+ let navbarContainerProps = {};
6428
+ let footerContainerProps = {};
6429
+ if (navbarVariant === "minimal" /* Minimal */) {
6430
+ navbar = /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(NavbarMinimal, {
6431
+ ...componentsProps?.navbar
6432
+ }, undefined, false, undefined, this);
6433
+ navbarContainerProps.py = "md";
6434
+ if (navbarPosition === "left" /* Left */) {
6435
+ navbarContainerProps.pl = "md";
6436
+ } else if (navbarPosition === "right" /* Right */) {
6437
+ navbarContainerProps.pr = "md";
6438
+ }
6439
+ }
6440
+ if (footerVariant === "minimal" /* Minimal */) {
6441
+ footer = /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(FooterMinimal, {
6442
+ ...componentsProps?.footer
6443
+ }, undefined, false, undefined, this);
6444
+ }
6445
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(AppProvider, {
6446
+ appContext: appContext2,
6447
+ ...componentsProps?.AppProvider,
6448
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(FrameLayout_default, {
6449
+ layoutId: defaultAppShellLayoutId,
6450
+ ...componentsProps?.layout,
6181
6451
  children: [
6182
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core4.AppShell.Header, {
6183
- withBorder: false,
6184
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core4.Group, {
6185
- p: "md",
6186
- bg: colorScheme === "dark" ? mantineTheme.colors.dark[8] : mantineTheme.colors.gray[3],
6187
- hiddenFrom: "sm",
6188
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core4.Burger, {
6189
- opened,
6190
- onClick: toggle,
6191
- h: 20,
6192
- size: 18
6193
- }, undefined, false, undefined, this)
6194
- }, undefined, false, undefined, this)
6452
+ navbarPosition !== undefined && navbarPosition !== "content" /* Content */ && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(FrameLayout_default.Element, {
6453
+ section: navbarPosition,
6454
+ componentsProps: { container: { ...navbarContainerProps } },
6455
+ children: navbar
6195
6456
  }, undefined, false, undefined, this),
6196
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core4.AppShell.Navbar, {
6197
- withBorder: false,
6198
- children: navbarVariant === "minimal" /* Minimal */ && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(NavbarMinimal, {
6199
- logo,
6200
- user,
6201
- ...navbar
6202
- }, undefined, false, undefined, this)
6457
+ footerPosition !== undefined && footerPosition !== "content" /* Content */ && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(FrameLayout_default.Element, {
6458
+ section: footerPosition,
6459
+ componentsProps: { container: { ...footerContainerProps } },
6460
+ children: footer
6203
6461
  }, undefined, false, undefined, this),
6204
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core4.AppShell.Main, {
6205
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
6206
- children: [
6207
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_core4.Paper, {
6208
- radius: 0,
6209
- my: "md",
6210
- h: 20,
6211
- hiddenFrom: "sm"
6212
- }, undefined, false, undefined, this),
6213
- children,
6214
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Footer, {}, undefined, false, undefined, this)
6215
- ]
6216
- }, undefined, true, undefined, this)
6462
+ navbarPosition !== undefined && navbarPosition === "content" /* Content */ && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(jsx_dev_runtime13.Fragment, {
6463
+ children: navbar
6464
+ }, undefined, false, undefined, this),
6465
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_core7.Box, {
6466
+ ...componentsProps?.childrenContainer,
6467
+ children
6468
+ }, undefined, false, undefined, this),
6469
+ footerPosition !== undefined && footerPosition === "content" /* Content */ && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(jsx_dev_runtime13.Fragment, {
6470
+ children: footer
6217
6471
  }, undefined, false, undefined, this)
6218
6472
  ]
6219
6473
  }, undefined, true, undefined, this)
6220
6474
  }, undefined, false, undefined, this);
6221
6475
  }
6476
+ var AppShell_default = Object.assign(AppShell, {
6477
+ NavbarMinimal,
6478
+ FooterMinimal
6479
+ });
6222
6480
  // src/core/components/WidgetSelectionHeader/index.tsx
6223
- var import_core6 = require("@mantine/core");
6481
+ var import_core10 = require("@mantine/core");
6224
6482
 
6225
6483
  // src/core/components/Page/index.tsx
6226
- var import_react7 = __toESM(require("react"));
6484
+ var import_react10 = __toESM(require("react"));
6227
6485
  var import_navigation2 = require("next/navigation");
6228
6486
 
6229
6487
  // src/core/components/Page/PageContainer/index.tsx
6230
- var import_core5 = require("@mantine/core");
6231
- var jsx_dev_runtime10 = require("react/jsx-dev-runtime");
6488
+ var import_core8 = require("@mantine/core");
6489
+ var jsx_dev_runtime14 = require("react/jsx-dev-runtime");
6232
6490
  function PageContainer({
6233
6491
  children,
6234
6492
  pt,
6235
6493
  componentsProps
6236
6494
  }) {
6237
6495
  const theme = useRemoraidTheme();
6238
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_core5.Container, {
6496
+ return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(import_core8.Container, {
6239
6497
  size: theme.containerSize,
6240
6498
  pt: pt ?? "md",
6241
6499
  ...componentsProps?.container,
@@ -6244,10 +6502,10 @@ function PageContainer({
6244
6502
  }
6245
6503
 
6246
6504
  // src/core/components/Page/index.tsx
6247
- var jsx_dev_runtime11 = require("react/jsx-dev-runtime");
6248
- var pageContext = import_react7.default.createContext(null);
6505
+ var jsx_dev_runtime15 = require("react/jsx-dev-runtime");
6506
+ var pageContext = import_react10.default.createContext(null);
6249
6507
  var usePage = () => {
6250
- return import_react7.useContext(pageContext);
6508
+ return import_react10.useContext(pageContext);
6251
6509
  };
6252
6510
  function Page({
6253
6511
  children,
@@ -6259,16 +6517,16 @@ function Page({
6259
6517
  const pathname = import_navigation2.usePathname();
6260
6518
  const { isPageRegistered, registerPage } = useWidgets();
6261
6519
  const pageId = config?.pageId ?? pathname;
6262
- import_react7.useEffect(() => {
6520
+ import_react10.useEffect(() => {
6263
6521
  if (!isPageRegistered(pageId)) {
6264
6522
  if (config?.registerPageDirectly) {
6265
6523
  registerPage(pageId, []);
6266
6524
  }
6267
6525
  }
6268
6526
  }, []);
6269
- return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(pageContext.Provider, {
6527
+ return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(pageContext.Provider, {
6270
6528
  value: { name: name ?? pathname, pageId, ...config },
6271
- children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(PageContainer, {
6529
+ children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(PageContainer, {
6272
6530
  pt,
6273
6531
  componentsProps: { container: componentsProps?.container },
6274
6532
  children
@@ -6278,7 +6536,40 @@ function Page({
6278
6536
 
6279
6537
  // src/core/components/WidgetSelectionHeader/index.tsx
6280
6538
  var import_icons_react4 = require("@tabler/icons-react");
6281
- var jsx_dev_runtime12 = require("react/jsx-dev-runtime");
6539
+
6540
+ // src/core/components/ScrollableChipGroup/index.tsx
6541
+ var import_core9 = require("@mantine/core");
6542
+ var jsx_dev_runtime16 = require("react/jsx-dev-runtime");
6543
+ function ScrollableChipGroup({
6544
+ value,
6545
+ onChange,
6546
+ gap,
6547
+ componentsProps,
6548
+ children
6549
+ }) {
6550
+ const theme = useRemoraidTheme();
6551
+ return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(import_core9.ScrollArea, {
6552
+ ...theme.scrollAreaProps,
6553
+ ...componentsProps?.scrollArea,
6554
+ children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(import_core9.Chip.Group, {
6555
+ value,
6556
+ onChange,
6557
+ ...componentsProps?.chipGroup,
6558
+ multiple: true,
6559
+ children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(import_core9.Flex, {
6560
+ justify: "flex-start",
6561
+ align: "center",
6562
+ gap: gap ?? "xs",
6563
+ h: "auto",
6564
+ ...componentsProps?.container,
6565
+ children
6566
+ }, undefined, false, undefined, this)
6567
+ }, undefined, false, undefined, this)
6568
+ }, undefined, false, undefined, this);
6569
+ }
6570
+
6571
+ // src/core/components/WidgetSelectionHeader/index.tsx
6572
+ var jsx_dev_runtime17 = require("react/jsx-dev-runtime");
6282
6573
  function WidgetSelectionHeader({
6283
6574
  title,
6284
6575
  disabledWidgets,
@@ -6291,63 +6582,53 @@ function WidgetSelectionHeader({
6291
6582
  console.error("'WidgetSelectionHeader' must be rendered inside of a 'Page' component.");
6292
6583
  return null;
6293
6584
  }
6294
- return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Flex, {
6585
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core10.Flex, {
6295
6586
  justify: "flex-start",
6296
6587
  align: "center",
6297
6588
  gap: "xs",
6298
6589
  mt,
6299
6590
  children: [
6300
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Text, {
6591
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core10.Text, {
6301
6592
  size: "lg",
6302
6593
  fw: 400,
6303
6594
  children: title ?? page.name
6304
6595
  }, undefined, false, undefined, this),
6305
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Divider, {
6596
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core10.Divider, {
6306
6597
  orientation: "vertical"
6307
6598
  }, undefined, false, undefined, this),
6308
- isPageRegistered(page.pageId) && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.ScrollArea, {
6309
- flex: 1,
6310
- ...theme.scrollAreaProps,
6311
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Chip.Group, {
6312
- multiple: true,
6313
- value: Object.keys(widgets[page.pageId]).filter((widgetId) => widgets[page.pageId][widgetId].selected),
6314
- onChange: (value) => {
6315
- updateWidgetSelectionBulk(page.pageId, value);
6316
- },
6317
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Flex, {
6318
- justify: "flex-start",
6319
- align: "center",
6320
- gap: "xs",
6321
- h: "auto",
6322
- children: Object.keys(widgets[page.pageId]).map((widgetId) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core6.Chip, {
6323
- value: widgetId,
6324
- size: "sm",
6325
- disabled: disabledWidgets && disabledWidgets.includes(widgetId),
6326
- icon: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_icons_react4.IconCheck, {
6327
- ...theme.iconProps.tiny
6328
- }, undefined, false, undefined, this),
6329
- children: widgets[page.pageId][widgetId].name
6330
- }, widgetId, false, undefined, this))
6331
- }, undefined, false, undefined, this)
6332
- }, undefined, false, undefined, this)
6599
+ isPageRegistered(page.pageId) && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ScrollableChipGroup, {
6600
+ value: Object.keys(widgets[page.pageId]).filter((widgetId) => widgets[page.pageId][widgetId].selected),
6601
+ onChange: (value) => {
6602
+ updateWidgetSelectionBulk(page.pageId, value);
6603
+ },
6604
+ componentsProps: { scrollArea: { flex: 1 } },
6605
+ children: Object.keys(widgets[page.pageId]).map((widgetId) => /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core10.Chip, {
6606
+ value: widgetId,
6607
+ size: "sm",
6608
+ disabled: disabledWidgets && disabledWidgets.includes(widgetId),
6609
+ icon: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_icons_react4.IconCheck, {
6610
+ ...theme.iconProps.tiny
6611
+ }, undefined, false, undefined, this),
6612
+ children: widgets[page.pageId][widgetId].name
6613
+ }, widgetId, false, undefined, this))
6333
6614
  }, undefined, false, undefined, this)
6334
6615
  ]
6335
6616
  }, undefined, true, undefined, this);
6336
6617
  }
6337
6618
  // src/core/components/Widget/WidgetWrapper/CloseButton/index.tsx
6338
- var import_core7 = require("@mantine/core");
6619
+ var import_core11 = require("@mantine/core");
6339
6620
  var import_icons_react5 = require("@tabler/icons-react");
6340
- var jsx_dev_runtime13 = require("react/jsx-dev-runtime");
6621
+ var jsx_dev_runtime18 = require("react/jsx-dev-runtime");
6341
6622
  function CloseButton({ widgetId }) {
6342
6623
  const theme = useRemoraidTheme();
6343
6624
  const { activeWidget, updateWidgetSelection } = useWidgets();
6344
6625
  const page = usePage();
6345
- return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_core7.Transition, {
6626
+ return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(import_core11.Transition, {
6346
6627
  mounted: activeWidget === widgetId,
6347
6628
  transition: "pop-top-right",
6348
6629
  duration: theme.transitionDurations.short,
6349
6630
  timingFunction: "ease",
6350
- children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_core7.ActionIcon, {
6631
+ children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(import_core11.ActionIcon, {
6351
6632
  pos: "absolute",
6352
6633
  size: "xs",
6353
6634
  className: "remoraid-close-button",
@@ -6360,19 +6641,19 @@ function CloseButton({ widgetId }) {
6360
6641
  updateWidgetSelection(page.pageId, widgetId, false);
6361
6642
  },
6362
6643
  style: transitionStyle,
6363
- children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_icons_react5.IconX, {
6644
+ children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(import_icons_react5.IconX, {
6364
6645
  ...theme.iconProps.tiny
6365
6646
  }, undefined, false, undefined, this)
6366
6647
  }, undefined, false, undefined, this)
6367
6648
  }, undefined, false, undefined, this);
6368
6649
  }
6369
6650
  // src/core/components/BadgeGroup/index.tsx
6370
- var import_core9 = require("@mantine/core");
6371
- var import_react8 = __toESM(require("react"));
6651
+ var import_core13 = require("@mantine/core");
6652
+ var import_react11 = __toESM(require("react"));
6372
6653
 
6373
6654
  // src/core/components/BadgeMinimal/index.tsx
6374
- var import_core8 = require("@mantine/core");
6375
- var jsx_dev_runtime14 = require("react/jsx-dev-runtime");
6655
+ var import_core12 = require("@mantine/core");
6656
+ var jsx_dev_runtime19 = require("react/jsx-dev-runtime");
6376
6657
  var isBadgeMinimalProps = (e) => {
6377
6658
  if (typeof e !== "object") {
6378
6659
  return false;
@@ -6385,17 +6666,17 @@ var isBadgeMinimalProps = (e) => {
6385
6666
  function BadgeMinimal(props) {
6386
6667
  const { label, tooltip, mounted, componentsProps } = props;
6387
6668
  const theme = useRemoraidTheme();
6388
- return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(import_core8.Transition, {
6669
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core12.Transition, {
6389
6670
  mounted: mounted !== false,
6390
6671
  transition: "fade",
6391
6672
  duration: theme.transitionDurations.short,
6392
6673
  timingFunction: "ease",
6393
6674
  ...componentsProps?.transition,
6394
- children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(import_core8.Tooltip, {
6675
+ children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core12.Tooltip, {
6395
6676
  disabled: !tooltip,
6396
6677
  label: tooltip,
6397
6678
  ...componentsProps?.tooltip,
6398
- children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(import_core8.Badge, {
6679
+ children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core12.Badge, {
6399
6680
  variant: "default",
6400
6681
  ...componentsProps?.badge,
6401
6682
  style: {
@@ -6410,7 +6691,7 @@ function BadgeMinimal(props) {
6410
6691
  }
6411
6692
 
6412
6693
  // src/core/components/BadgeGroup/index.tsx
6413
- var jsx_dev_runtime15 = require("react/jsx-dev-runtime");
6694
+ var jsx_dev_runtime20 = require("react/jsx-dev-runtime");
6414
6695
  var react = require("react");
6415
6696
  function BadgeGroup({
6416
6697
  badges,
@@ -6420,9 +6701,9 @@ function BadgeGroup({
6420
6701
  }) {
6421
6702
  const theme = useRemoraidTheme();
6422
6703
  const numVisibleBadges = badges.filter((e) => isBadgeMinimalProps(e) ? e.mounted !== false : true).length;
6423
- return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(jsx_dev_runtime15.Fragment, {
6704
+ return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
6424
6705
  children: [
6425
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(import_core9.Group, {
6706
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(import_core13.Group, {
6426
6707
  gap: gap ?? "xs",
6427
6708
  wrap: "nowrap",
6428
6709
  visibleFrom: breakpoint ?? theme.breakpoints.badgeGroupCollapse,
@@ -6436,10 +6717,10 @@ function BadgeGroup({
6436
6717
  return e;
6437
6718
  })
6438
6719
  }, undefined, false, undefined, this),
6439
- /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(import_core9.Tooltip, {
6720
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(import_core13.Tooltip, {
6440
6721
  label: `${numVisibleBadges} badge${numVisibleBadges === 1 ? "" : "s"}`,
6441
6722
  ...componentsProps?.tooltip,
6442
- children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(import_core9.Badge, {
6723
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(import_core13.Badge, {
6443
6724
  hiddenFrom: breakpoint ?? theme.breakpoints.badgeGroupCollapse,
6444
6725
  hidden: numVisibleBadges === 0,
6445
6726
  variant: "light",
@@ -6453,8 +6734,8 @@ function BadgeGroup({
6453
6734
  }, undefined, true, undefined, this);
6454
6735
  }
6455
6736
  // src/core/components/AlertMinimal/index.tsx
6456
- var import_core10 = require("@mantine/core");
6457
- var jsx_dev_runtime16 = require("react/jsx-dev-runtime");
6737
+ var import_core14 = require("@mantine/core");
6738
+ var jsx_dev_runtime21 = require("react/jsx-dev-runtime");
6458
6739
  var isAlertMinimalProps = (e) => {
6459
6740
  if (typeof e !== "object") {
6460
6741
  return false;
@@ -6476,13 +6757,13 @@ function AlertMinimal({
6476
6757
  componentsProps
6477
6758
  }) {
6478
6759
  const theme = useRemoraidTheme();
6479
- return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(import_core10.Transition, {
6760
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(import_core14.Transition, {
6480
6761
  mounted: mounted !== false,
6481
6762
  transition: "fade",
6482
6763
  duration: theme.transitionDurations.short,
6483
6764
  timingFunction: "ease",
6484
6765
  ...componentsProps?.transition,
6485
- children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(import_core10.Alert, {
6766
+ children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(import_core14.Alert, {
6486
6767
  ...theme.alertProps[category],
6487
6768
  title: title ?? theme.alertProps[category].title,
6488
6769
  withCloseButton: onClose !== undefined,
@@ -6502,9 +6783,9 @@ function AlertMinimal({
6502
6783
  }, undefined, false, undefined, this);
6503
6784
  }
6504
6785
  // src/core/components/RemoraidButton/index.tsx
6505
- var import_core11 = require("@mantine/core");
6786
+ var import_core15 = require("@mantine/core");
6506
6787
  var import_icons_react6 = require("@tabler/icons-react");
6507
- var jsx_dev_runtime17 = require("react/jsx-dev-runtime");
6788
+ var jsx_dev_runtime22 = require("react/jsx-dev-runtime");
6508
6789
  var isRemoraidButtonProps = (e) => {
6509
6790
  if (typeof e !== "object") {
6510
6791
  return false;
@@ -6529,17 +6810,17 @@ function RemoraidButton({
6529
6810
  }) {
6530
6811
  const theme = useRemoraidTheme();
6531
6812
  const iconProps = { ...theme.iconProps.medium, ...componentsProps?.icon };
6532
- const icon = props.icon ? /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(props.icon, {
6813
+ const icon = props.icon ? /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(props.icon, {
6533
6814
  ...iconProps
6534
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_icons_react6.IconClick, {
6815
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(import_icons_react6.IconClick, {
6535
6816
  ...iconProps
6536
6817
  }, undefined, false, undefined, this);
6537
- return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
6818
+ return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(jsx_dev_runtime22.Fragment, {
6538
6819
  children: [
6539
- /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core11.Tooltip, {
6820
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(import_core15.Tooltip, {
6540
6821
  label,
6541
6822
  ...componentsProps?.tooltip,
6542
- children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core11.ActionIcon, {
6823
+ children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(import_core15.ActionIcon, {
6543
6824
  "aria-label": label,
6544
6825
  variant: variant ?? "default",
6545
6826
  onClick,
@@ -6553,7 +6834,7 @@ function RemoraidButton({
6553
6834
  children: icon
6554
6835
  }, undefined, false, undefined, this)
6555
6836
  }, undefined, false, undefined, this),
6556
- /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core11.Button, {
6837
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(import_core15.Button, {
6557
6838
  onClick,
6558
6839
  loading,
6559
6840
  variant: variant ?? "default",
@@ -6570,9 +6851,9 @@ function RemoraidButton({
6570
6851
  }, undefined, true, undefined, this);
6571
6852
  }
6572
6853
  // src/core/components/Widget/WidgetWrapper/index.tsx
6573
- var import_core12 = require("@mantine/core");
6574
- var import_react9 = require("react");
6575
- var jsx_dev_runtime18 = require("react/jsx-dev-runtime");
6854
+ var import_core16 = require("@mantine/core");
6855
+ var import_react12 = require("react");
6856
+ var jsx_dev_runtime23 = require("react/jsx-dev-runtime");
6576
6857
  function WidgetWrapper({
6577
6858
  children,
6578
6859
  config,
@@ -6590,7 +6871,7 @@ function WidgetWrapper({
6590
6871
  const page = usePage();
6591
6872
  const theme = useRemoraidTheme();
6592
6873
  const pageRegistered = page ? isPageRegistered(page.pageId) : false;
6593
- import_react9.useEffect(() => {
6874
+ import_react12.useEffect(() => {
6594
6875
  if (!page) {
6595
6876
  return;
6596
6877
  }
@@ -6598,12 +6879,12 @@ function WidgetWrapper({
6598
6879
  registerWidget(page.pageId, config);
6599
6880
  }
6600
6881
  }, [pageRegistered]);
6601
- return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(import_core12.Transition, {
6882
+ return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(import_core16.Transition, {
6602
6883
  mounted: page !== null && isWidgetSelected(page.pageId, config.widgetId),
6603
6884
  transition: "fade-left",
6604
6885
  duration: theme.transitionDurations.medium,
6605
6886
  timingFunction: "ease",
6606
- children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(import_core12.Paper, {
6887
+ children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(import_core16.Paper, {
6607
6888
  p: "md",
6608
6889
  shadow: "md",
6609
6890
  bg: theme.transparentBackground,
@@ -6619,7 +6900,7 @@ function WidgetWrapper({
6619
6900
  updateActiveWidget(null);
6620
6901
  },
6621
6902
  children: [
6622
- withCloseButton !== false && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(CloseButton, {
6903
+ withCloseButton !== false && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(CloseButton, {
6623
6904
  widgetId: config.widgetId
6624
6905
  }, undefined, false, undefined, this),
6625
6906
  children
@@ -6631,8 +6912,8 @@ var WidgetWrapper_default = Object.assign(WidgetWrapper, {
6631
6912
  CloseButton
6632
6913
  });
6633
6914
  // src/core/components/Widget/index.tsx
6634
- var import_core13 = require("@mantine/core");
6635
- var jsx_dev_runtime19 = require("react/jsx-dev-runtime");
6915
+ var import_core17 = require("@mantine/core");
6916
+ var jsx_dev_runtime24 = require("react/jsx-dev-runtime");
6636
6917
  var react2 = require("react");
6637
6918
  function Widget({
6638
6919
  children,
@@ -6650,7 +6931,7 @@ function Widget({
6650
6931
  const badgesGap = (typeof gaps === "object" ? gaps.badges : gaps) ?? "xs";
6651
6932
  const buttonsGap = (typeof gaps === "object" ? gaps.buttons : gaps) ?? "xs";
6652
6933
  const alertsGap = (typeof gaps === "object" ? gaps.alerts : gaps) ?? "xs";
6653
- return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(WidgetWrapper_default, {
6934
+ return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(WidgetWrapper_default, {
6654
6935
  config: {
6655
6936
  widgetId: id,
6656
6937
  name: title,
@@ -6663,28 +6944,28 @@ function Widget({
6663
6944
  },
6664
6945
  ...componentsProps?.wrapper,
6665
6946
  children: [
6666
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core13.Group, {
6947
+ /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Group, {
6667
6948
  justify: "space-between",
6668
6949
  wrap: "nowrap",
6669
6950
  children: [
6670
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core13.Group, {
6951
+ /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Group, {
6671
6952
  gap: badgesGap,
6672
6953
  wrap: "nowrap",
6673
6954
  children: [
6674
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core13.Title, {
6955
+ /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Title, {
6675
6956
  order: 1,
6676
6957
  size: "h3",
6677
6958
  lineClamp: 1,
6678
6959
  children: title
6679
6960
  }, undefined, false, undefined, this),
6680
- badges !== undefined && /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(BadgeGroup, {
6961
+ badges !== undefined && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(BadgeGroup, {
6681
6962
  badges,
6682
6963
  gap: badgesGap,
6683
6964
  ...componentsProps?.badgeGroup
6684
6965
  }, undefined, false, undefined, this)
6685
6966
  ]
6686
6967
  }, undefined, true, undefined, this),
6687
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core13.Group, {
6968
+ /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Group, {
6688
6969
  gap: buttonsGap,
6689
6970
  wrap: "nowrap",
6690
6971
  children: buttons !== undefined && buttons.map((e, i) => {
@@ -6699,7 +6980,7 @@ function Widget({
6699
6980
  }, undefined, false, undefined, this)
6700
6981
  ]
6701
6982
  }, undefined, true, undefined, this),
6702
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core13.Divider, {
6983
+ /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Divider, {
6703
6984
  my: "md"
6704
6985
  }, undefined, false, undefined, this),
6705
6986
  alerts !== undefined && alerts.map((a, i) => {
@@ -6712,20 +6993,20 @@ function Widget({
6712
6993
  }
6713
6994
  return a;
6714
6995
  }),
6715
- loading ? /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core13.Center, {
6716
- children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core13.Loader, {
6996
+ loading ? /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Center, {
6997
+ children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Loader, {
6717
6998
  ...componentsProps?.loader
6718
6999
  }, undefined, false, undefined, this)
6719
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(jsx_dev_runtime19.Fragment, {
7000
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(jsx_dev_runtime24.Fragment, {
6720
7001
  children
6721
7002
  }, undefined, false, undefined, this)
6722
7003
  ]
6723
7004
  }, undefined, true, undefined, this);
6724
7005
  }
6725
7006
  // src/core/components/NotFoundPage/index.tsx
6726
- var import_core14 = require("@mantine/core");
7007
+ var import_core18 = require("@mantine/core");
6727
7008
  var import_navigation3 = require("next/navigation");
6728
- var jsx_dev_runtime20 = require("react/jsx-dev-runtime");
7009
+ var jsx_dev_runtime25 = require("react/jsx-dev-runtime");
6729
7010
  function NotFoundPage({
6730
7011
  children,
6731
7012
  message,
@@ -6733,11 +7014,11 @@ function NotFoundPage({
6733
7014
  }) {
6734
7015
  const pathname = import_navigation3.usePathname();
6735
7016
  const theme = useRemoraidTheme();
6736
- return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Page, {
7017
+ return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Page, {
6737
7018
  name: "Not Found",
6738
7019
  ...componentsProps?.page,
6739
7020
  children: [
6740
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(import_core14.Alert, {
7021
+ /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(import_core18.Alert, {
6741
7022
  ...theme.alertProps.negative,
6742
7023
  title: "404 - Page Not Found",
6743
7024
  children: message ?? `Could not find page ${pathname}.`
@@ -6747,8 +7028,8 @@ function NotFoundPage({
6747
7028
  }, undefined, true, undefined, this);
6748
7029
  }
6749
7030
  // src/core/components/EnvironmentShell/index.tsx
6750
- var import_core15 = require("@mantine/core");
6751
- var jsx_dev_runtime21 = require("react/jsx-dev-runtime");
7031
+ var import_core19 = require("@mantine/core");
7032
+ var jsx_dev_runtime26 = require("react/jsx-dev-runtime");
6752
7033
  function EnvironmentShell({
6753
7034
  children,
6754
7035
  environment,
@@ -6762,7 +7043,7 @@ function EnvironmentShell({
6762
7043
  const undefinedKeys = Object.keys(environment).filter((key) => environment[key] === undefined);
6763
7044
  const alertTitle = `Please Specify Environment Variable${undefinedKeys.length > 1 ? "s" : ""}`;
6764
7045
  const alertMessage = `Components could not be rendered because the following environment variables are not specified: ${undefinedKeys.join(", ")}.`;
6765
- const alert = /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(import_core15.Alert, {
7046
+ const alert = /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(import_core19.Alert, {
6766
7047
  ...theme.alertProps.neutral,
6767
7048
  title: alertTitle,
6768
7049
  m,
@@ -6770,12 +7051,12 @@ function EnvironmentShell({
6770
7051
  children: message ?? alertMessage
6771
7052
  }, undefined, false, undefined, this);
6772
7053
  if (undefinedKeys.length === 0) {
6773
- return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
7054
+ return /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(jsx_dev_runtime26.Fragment, {
6774
7055
  children
6775
7056
  }, undefined, false, undefined, this);
6776
7057
  }
6777
7058
  if (withContainer) {
6778
- return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(PageContainer, {
7059
+ return /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(PageContainer, {
6779
7060
  componentsProps: { container: componentsProps?.container },
6780
7061
  children: alert
6781
7062
  }, undefined, false, undefined, this);
@@ -6783,26 +7064,27 @@ function EnvironmentShell({
6783
7064
  return alert;
6784
7065
  }
6785
7066
  // src/core/components/SettingsWidget/index.tsx
6786
- var import_react10 = require("react");
7067
+ var import_react13 = require("react");
6787
7068
  var import_icons_react8 = require("@tabler/icons-react");
6788
7069
 
6789
7070
  // src/core/components/SettingsWidget/SaveButton/index.tsx
6790
7071
  var import_icons_react7 = require("@tabler/icons-react");
6791
- var import_core16 = require("@mantine/core");
6792
- var jsx_dev_runtime22 = require("react/jsx-dev-runtime");
7072
+ var import_core20 = require("@mantine/core");
7073
+ var jsx_dev_runtime27 = require("react/jsx-dev-runtime");
6793
7074
  function SaveButton({
6794
7075
  onSaveChanges,
6795
7076
  insideContainer,
6796
7077
  componentsProps
6797
7078
  }) {
6798
7079
  const settingsWidgetOptions = useSettingsWidgetContext();
6799
- const button = /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(RemoraidButton, {
7080
+ const button = /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(RemoraidButton, {
6800
7081
  label: "Save Changes",
6801
7082
  icon: import_icons_react7.IconDeviceFloppy,
6802
7083
  onClick: onSaveChanges,
6803
7084
  responsive: false,
6804
7085
  ...componentsProps?.button,
6805
7086
  componentsProps: {
7087
+ ...componentsProps?.button?.componentsProps,
6806
7088
  button: {
6807
7089
  disabled: settingsWidgetOptions.unsavedChanges === false,
6808
7090
  ...componentsProps?.button?.componentsProps?.button
@@ -6810,7 +7092,7 @@ function SaveButton({
6810
7092
  }
6811
7093
  }, undefined, false, undefined, this);
6812
7094
  if (insideContainer !== false) {
6813
- return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(import_core16.Group, {
7095
+ return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_core20.Group, {
6814
7096
  w: "100%",
6815
7097
  justify: "flex-end",
6816
7098
  mt: "md",
@@ -6822,11 +7104,11 @@ function SaveButton({
6822
7104
  }
6823
7105
 
6824
7106
  // src/core/components/SettingsWidget/index.tsx
6825
- var jsx_dev_runtime23 = require("react/jsx-dev-runtime");
7107
+ var jsx_dev_runtime28 = require("react/jsx-dev-runtime");
6826
7108
  var defaultSettingsWidgetContext = {};
6827
- var settingsWidgetContext = import_react10.createContext(defaultSettingsWidgetContext);
7109
+ var settingsWidgetContext = import_react13.createContext(defaultSettingsWidgetContext);
6828
7110
  var useSettingsWidgetContext = () => {
6829
- return import_react10.useContext(settingsWidgetContext);
7111
+ return import_react13.useContext(settingsWidgetContext);
6830
7112
  };
6831
7113
  function SettingsWidget({
6832
7114
  children,
@@ -6835,9 +7117,9 @@ function SettingsWidget({
6835
7117
  custom,
6836
7118
  widgetProps
6837
7119
  }) {
6838
- return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(settingsWidgetContext.Provider, {
7120
+ return /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(settingsWidgetContext.Provider, {
6839
7121
  value: { custom, unsavedChanges },
6840
- children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Widget, {
7122
+ children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Widget, {
6841
7123
  title: "Settings",
6842
7124
  id: "settings",
6843
7125
  mt: "md",
@@ -6847,7 +7129,8 @@ function SettingsWidget({
6847
7129
  {
6848
7130
  label: "Restore Default Values",
6849
7131
  icon: import_icons_react8.IconRestore,
6850
- onClick: onRestoreDefaultValues
7132
+ onClick: onRestoreDefaultValues,
7133
+ componentsProps: { button: { disabled: custom === false } }
6851
7134
  }
6852
7135
  ] : [],
6853
7136
  ...widgetProps?.buttons ?? []
@@ -6872,27 +7155,27 @@ var SettingsWidget_default = Object.assign(SettingsWidget, {
6872
7155
  SaveButton
6873
7156
  });
6874
7157
  // src/core/components/SettingsWidget/SettingsTable/index.tsx
6875
- var import_react11 = require("react");
6876
- var import_core18 = require("@mantine/core");
7158
+ var import_react14 = require("react");
7159
+ var import_core22 = require("@mantine/core");
6877
7160
 
6878
7161
  // src/core/components/SettingsWidget/SettingsTable/Row/index.tsx
6879
- var import_core17 = require("@mantine/core");
6880
- var jsx_dev_runtime24 = require("react/jsx-dev-runtime");
7162
+ var import_core21 = require("@mantine/core");
7163
+ var jsx_dev_runtime29 = require("react/jsx-dev-runtime");
6881
7164
  function Row({
6882
7165
  children,
6883
7166
  label
6884
7167
  }) {
6885
7168
  const options = useSettingsTableOptions();
6886
- return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Table.Tr, {
7169
+ return /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(import_core21.Table.Tr, {
6887
7170
  children: [
6888
- /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Table.Th, {
7171
+ /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(import_core21.Table.Th, {
6889
7172
  w: options.leftColumnWidth,
6890
- children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Text, {
7173
+ children: /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(import_core21.Text, {
6891
7174
  size: "sm",
6892
7175
  children: label
6893
7176
  }, undefined, false, undefined, this)
6894
7177
  }, undefined, false, undefined, this),
6895
- /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_core17.Table.Td, {
7178
+ /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(import_core21.Table.Td, {
6896
7179
  py: "xs",
6897
7180
  children
6898
7181
  }, undefined, false, undefined, this)
@@ -6901,29 +7184,29 @@ function Row({
6901
7184
  }
6902
7185
 
6903
7186
  // src/core/components/SettingsWidget/SettingsTable/index.tsx
6904
- var jsx_dev_runtime25 = require("react/jsx-dev-runtime");
7187
+ var jsx_dev_runtime30 = require("react/jsx-dev-runtime");
6905
7188
  var defaultSettingsTableOptions = {
6906
7189
  leftColumnWidth: "38.2%"
6907
7190
  };
6908
- var settingsTableOptionsContext = import_react11.createContext(defaultSettingsTableOptions);
7191
+ var settingsTableOptionsContext = import_react14.createContext(defaultSettingsTableOptions);
6909
7192
  var useSettingsTableOptions = () => {
6910
- return import_react11.useContext(settingsTableOptionsContext);
7193
+ return import_react14.useContext(settingsTableOptionsContext);
6911
7194
  };
6912
7195
  function SettingsTable({
6913
7196
  children,
6914
7197
  leftColumnWidth
6915
7198
  }) {
6916
7199
  const theme = useRemoraidTheme();
6917
- return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(settingsTableOptionsContext.Provider, {
7200
+ return /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(settingsTableOptionsContext.Provider, {
6918
7201
  value: {
6919
7202
  leftColumnWidth: leftColumnWidth ?? defaultSettingsTableOptions.leftColumnWidth
6920
7203
  },
6921
- children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(import_core18.Table, {
7204
+ children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(import_core22.Table, {
6922
7205
  bg: theme.transparentBackground,
6923
7206
  withTableBorder: true,
6924
7207
  variant: "vertical",
6925
7208
  layout: "fixed",
6926
- children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(import_core18.Table.Tbody, {
7209
+ children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(import_core22.Table.Tbody, {
6927
7210
  children
6928
7211
  }, undefined, false, undefined, this)
6929
7212
  }, undefined, false, undefined, this)
@@ -6933,11 +7216,11 @@ var SettingsTable_default = Object.assign(SettingsTable, {
6933
7216
  Row
6934
7217
  });
6935
7218
  // src/core/components/NavbarSettingsWidget/index.tsx
6936
- var import_react12 = require("react");
7219
+ var import_react15 = require("react");
6937
7220
  var import_lodash = __toESM(require_lodash());
6938
- var import_core19 = require("@mantine/core");
7221
+ var import_core23 = require("@mantine/core");
6939
7222
  var import_icons_react9 = require("@tabler/icons-react");
6940
- var jsx_dev_runtime26 = require("react/jsx-dev-runtime");
7223
+ var jsx_dev_runtime31 = require("react/jsx-dev-runtime");
6941
7224
  var defaultNavbarSettingsWidgetId = "navbar-settings";
6942
7225
  function NavbarSettingsWidget({
6943
7226
  additionalRows,
@@ -6947,7 +7230,7 @@ function NavbarSettingsWidget({
6947
7230
  const { userExperience, updateUserExperience, initialUserExperience } = useRemoraidUserExperience();
6948
7231
  const app = useRemoraidApp();
6949
7232
  const theme = useRemoraidTheme();
6950
- return /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(SettingsWidget_default, {
7233
+ return /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(SettingsWidget_default, {
6951
7234
  widgetProps: {
6952
7235
  id: defaultNavbarSettingsWidgetId,
6953
7236
  title: "Navbar Settings",
@@ -6956,32 +7239,32 @@ function NavbarSettingsWidget({
6956
7239
  onRestoreDefaultValues: () => {
6957
7240
  updateUserExperience((prev) => ({
6958
7241
  ...prev,
6959
- navbarSettings: defaultNavbarSettings[userExperience.navbarVariant]
7242
+ navbar: initialUserExperience.navbar
6960
7243
  }));
6961
7244
  },
6962
- custom: !import_lodash.isEqual(userExperience.navbarSettings, initialUserExperience.navbarSettings),
6963
- children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(SettingsTable_default, {
7245
+ custom: !import_lodash.isEqual(userExperience.navbar, initialUserExperience.navbar),
7246
+ children: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(SettingsTable_default, {
6964
7247
  children: [
6965
- /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(SettingsTable_default.Row, {
7248
+ /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(SettingsTable_default.Row, {
6966
7249
  label: "Select which pages you want to display or hide",
6967
- children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(import_core19.Chip.Group, {
7250
+ children: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(import_core23.Chip.Group, {
6968
7251
  multiple: true,
6969
- value: app.navigablePages.filter((p) => !userExperience.navbarSettings.hiddenPages.includes(p.href)).map((p) => p.href),
7252
+ value: app.navigablePages.filter((p) => !userExperience.navbar.hiddenPages.includes(p.href)).map((p) => p.href),
6970
7253
  onChange: (newValue) => {
6971
7254
  updateUserExperience((prev) => ({
6972
7255
  ...prev,
6973
- navbarSettings: {
6974
- ...prev.navbarSettings,
7256
+ navbar: {
7257
+ ...prev.navbar,
6975
7258
  hiddenPages: app.navigablePages.filter((p) => !newValue.includes(p.href)).map((p) => p.href)
6976
7259
  }
6977
7260
  }));
6978
7261
  },
6979
- children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(import_core19.Group, {
7262
+ children: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(import_core23.Group, {
6980
7263
  justify: "flex-start",
6981
7264
  gap: "xs",
6982
- children: app.navigablePages.map((p) => ({ ...p, icon: p.icon ?? import_icons_react9.IconLink })).map((p, i) => /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(import_core19.Chip, {
7265
+ children: app.navigablePages.map((p) => ({ ...p, icon: p.icon ?? import_icons_react9.IconLink })).map((p, i) => /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(import_core23.Chip, {
6983
7266
  value: p.href,
6984
- icon: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(p.icon, {
7267
+ icon: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(p.icon, {
6985
7268
  ...theme.iconProps.tiny,
6986
7269
  color: theme.primaryColor
6987
7270
  }, undefined, false, undefined, this),
@@ -6991,7 +7274,7 @@ function NavbarSettingsWidget({
6991
7274
  }, undefined, false, undefined, this)
6992
7275
  }, undefined, false, undefined, this)
6993
7276
  }, "select-hidden-pages", false, undefined, this),
6994
- ...(additionalRows ?? []).map((row, i) => row.key ? row : import_react12.cloneElement(row, { key: i }))
7277
+ ...(additionalRows ?? []).map((row, i) => row.key ? row : import_react15.cloneElement(row, { key: i }))
6995
7278
  ],
6996
7279
  ...componentsProps?.table
6997
7280
  }, undefined, false, undefined, this)