remoraid 2.20.2 → 2.26.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5440,7 +5440,10 @@ import React2, {
5440
5440
  useContext
5441
5441
  } from "react";
5442
5442
  import { jsxDEV } from "react/jsx-dev-runtime";
5443
- var getDefaultWidgetContext = (configuration) => import_lodash.merge({ name: configuration.widgetId, selected: true }, configuration.initialValues);
5443
+ var getDefaultWidgetContext = (configuration) => {
5444
+ const mergedConfiguration = import_lodash.merge({ name: configuration.widgetId, selected: true }, configuration.initialValues);
5445
+ return { ...mergedConfiguration, hidden: !mergedConfiguration.selected };
5446
+ };
5444
5447
  var widgetsContext = React2.createContext({
5445
5448
  widgets: {},
5446
5449
  activeWidget: null,
@@ -5451,7 +5454,8 @@ var widgetsContext = React2.createContext({
5451
5454
  isPageRegistered: () => false,
5452
5455
  updateWidgetSelection: () => {},
5453
5456
  updateWidgetSelectionBulk: () => {},
5454
- isWidgetSelected: () => false
5457
+ isWidgetSelected: () => false,
5458
+ hideWidget: () => {}
5455
5459
  });
5456
5460
  var useWidgets = () => {
5457
5461
  return useContext(widgetsContext);
@@ -5469,38 +5473,57 @@ function WidgetsProvider({
5469
5473
  setActiveWidget(widgetId);
5470
5474
  };
5471
5475
  const updateWidgetSelection = (pageId, widgetId, value) => {
5472
- if (!widgets[pageId]) {
5476
+ const page = widgets[pageId];
5477
+ if (!page) {
5473
5478
  console.error(`Cannot change selection of widget in page ${pageId}. Because this page does exist.`);
5474
5479
  return;
5475
5480
  }
5476
- if (!widgets[pageId][widgetId]) {
5481
+ const widget = page[widgetId];
5482
+ if (!widget) {
5477
5483
  console.error(`Cannot change selection of widget ${widgetId}. Because this widget does not exist on page ${pageId}.`);
5478
5484
  return;
5479
5485
  }
5480
5486
  setWidgets((prev) => ({
5481
5487
  ...prev,
5482
5488
  [pageId]: {
5483
- ...widgets[pageId],
5484
- [widgetId]: { ...widgets[pageId][widgetId], selected: value }
5489
+ ...page,
5490
+ [widgetId]: {
5491
+ ...widget,
5492
+ selected: value,
5493
+ hidden: false
5494
+ }
5485
5495
  }
5486
5496
  }));
5487
5497
  };
5488
5498
  const updateWidgetSelectionBulk = (pageId, selectedWidgetIds) => {
5489
- if (!widgets[pageId]) {
5499
+ const page = widgets[pageId];
5500
+ if (!page) {
5490
5501
  console.error(`Cannot change selection of widget in page ${pageId}. Because this page does exist.`);
5491
5502
  return;
5492
5503
  }
5493
- const updatedPage = widgets[pageId];
5494
- for (let widgetId of Object.keys(updatedPage)) {
5495
- updatedPage[widgetId] = {
5496
- ...updatedPage[widgetId],
5497
- selected: selectedWidgetIds.includes(widgetId)
5504
+ setWidgets((prev) => {
5505
+ const updatedPage = {};
5506
+ for (const [widgetId, widget] of Object.entries(page)) {
5507
+ if (!widget) {
5508
+ continue;
5509
+ }
5510
+ const selected = selectedWidgetIds.includes(widgetId);
5511
+ const selectionChanged = widget.selected !== selected;
5512
+ if (!selectionChanged) {
5513
+ updatedPage[widgetId] = widget;
5514
+ continue;
5515
+ }
5516
+ updatedPage[widgetId] = {
5517
+ ...widget,
5518
+ selected,
5519
+ hidden: false
5520
+ };
5521
+ }
5522
+ return {
5523
+ ...prev,
5524
+ [pageId]: updatedPage
5498
5525
  };
5499
- }
5500
- setWidgets((prev) => ({
5501
- ...prev,
5502
- [pageId]: updatedPage
5503
- }));
5526
+ });
5504
5527
  };
5505
5528
  const registerPage = (pageId, initialWidgets) => {
5506
5529
  setWidgets((prev) => ({
@@ -5546,10 +5569,21 @@ function WidgetsProvider({
5546
5569
  return true;
5547
5570
  };
5548
5571
  const isWidgetSelected = (pageId, widgetId) => {
5549
- if (!isWidgetRegistered(pageId, widgetId)) {
5550
- return false;
5572
+ return Boolean(widgets[pageId]?.[widgetId]?.selected);
5573
+ };
5574
+ const hideWidget = (pageId, widgetId) => {
5575
+ const widget = widgets[pageId]?.[widgetId];
5576
+ if (!widget) {
5577
+ console.error(`Cannot call 'hideWidget' for widget ${widgetId}. Because this widget does not exist on page ${pageId}.`);
5578
+ return;
5551
5579
  }
5552
- return widgets[pageId][widgetId].selected;
5580
+ setWidgets((prev) => ({
5581
+ ...prev,
5582
+ [pageId]: {
5583
+ ...prev[pageId],
5584
+ [widgetId]: { ...widget, selected: false, hidden: true }
5585
+ }
5586
+ }));
5553
5587
  };
5554
5588
  return /* @__PURE__ */ jsxDEV(widgetsContext.Provider, {
5555
5589
  value: {
@@ -5562,7 +5596,8 @@ function WidgetsProvider({
5562
5596
  registerWidget,
5563
5597
  registerPage,
5564
5598
  isWidgetRegistered,
5565
- isPageRegistered
5599
+ isPageRegistered,
5600
+ hideWidget
5566
5601
  },
5567
5602
  children
5568
5603
  }, undefined, false, undefined, this);
@@ -5657,6 +5692,16 @@ var getDefaultButtonIconSize = (buttonSize) => {
5657
5692
  }
5658
5693
  return "medium" /* Medium */;
5659
5694
  };
5695
+ var scrollToWidget = (widgetId) => {
5696
+ const widgetElement = document.getElementById(widgetId);
5697
+ if (!widgetElement) {
5698
+ return;
5699
+ }
5700
+ widgetElement.scrollIntoView({
5701
+ behavior: "smooth",
5702
+ block: "start"
5703
+ });
5704
+ };
5660
5705
 
5661
5706
  // src/core/components/RemoraidProvider/ThemeProvider/index.tsx
5662
5707
  import { px, rgba, useMantineTheme } from "@mantine/core";
@@ -5667,7 +5712,8 @@ import {
5667
5712
  } from "@tabler/icons-react";
5668
5713
  import React3, {
5669
5714
  useContext as useContext3,
5670
- useMemo as useMemo2
5715
+ useMemo as useMemo2,
5716
+ useLayoutEffect
5671
5717
  } from "react";
5672
5718
 
5673
5719
  // src/core/components/RemoraidProvider/HydrationStatusProvider/index.tsx
@@ -5733,6 +5779,7 @@ var createRemoraidTheme = (customTheme, dependencies) => {
5733
5779
  };
5734
5780
  }
5735
5781
  const defaultTheme = {
5782
+ bodyColor: "light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-9))",
5736
5783
  containerSize: 1300,
5737
5784
  jsonStringifySpace: 2,
5738
5785
  transparentBackground,
@@ -5778,27 +5825,52 @@ var createRemoraidTheme = (customTheme, dependencies) => {
5778
5825
  ScrollArea: {
5779
5826
  scrollbarSize: 8,
5780
5827
  scrollHideDelay: 20,
5781
- type: "hover"
5828
+ type: "hover",
5829
+ styles: { thumb: { zIndex: 5 } }
5782
5830
  },
5783
5831
  HoverCard: {
5784
- shadow: "md",
5785
5832
  withArrow: true,
5786
5833
  transitionProps: {
5787
- transition: "pop",
5788
5834
  duration: transitionDurations.short
5789
- },
5790
- styles: {
5791
- dropdown: { border: "none", background: transparentBackground },
5792
- arrow: { border: "none" }
5793
5835
  }
5794
5836
  },
5795
5837
  Tooltip: {
5796
- withArrow: true
5838
+ withArrow: true,
5839
+ transitionProps: {
5840
+ duration: transitionDurations.short
5841
+ }
5842
+ },
5843
+ Menu: {
5844
+ withArrow: true,
5845
+ transitionProps: {
5846
+ duration: transitionDurations.short
5847
+ }
5797
5848
  }
5798
5849
  }
5799
5850
  };
5800
5851
  return import_lodash2.merge(defaultTheme, customTheme);
5801
5852
  };
5853
+ var getCssVars = (theme) => {
5854
+ const {
5855
+ bodyColor,
5856
+ transitionDurations,
5857
+ primaryGutter,
5858
+ containerSize,
5859
+ transparentBackground
5860
+ } = theme;
5861
+ return {
5862
+ "--mantine-color-body": bodyColor,
5863
+ "--remoraid-container-size": `${containerSize}px`,
5864
+ "--remoraid-primary-gutter": typeof primaryGutter === "string" ? `var(--mantine-spacing-${primaryGutter})` : `${primaryGutter}px`,
5865
+ ...transparentBackground && {
5866
+ "--remoraid-transparent-background": transparentBackground
5867
+ },
5868
+ ...Object.entries(transitionDurations).reduce((t, [key, value]) => ({
5869
+ ...t,
5870
+ [`--remoraid-transition-duration-${key}`]: `${value}ms`
5871
+ }), {})
5872
+ };
5873
+ };
5802
5874
  var themeContext = React3.createContext(createRemoraidTheme());
5803
5875
  var useRemoraidTheme = () => {
5804
5876
  return useContext3(themeContext);
@@ -5816,6 +5888,14 @@ function ThemeProvider({
5816
5888
  };
5817
5889
  return createRemoraidTheme(typeof theme === "function" ? theme(dependencies) : theme, dependencies);
5818
5890
  }, [colorScheme, theme]);
5891
+ useLayoutEffect(() => {
5892
+ const root = document.documentElement;
5893
+ const entries = Object.entries(getCssVars(remoraidTheme));
5894
+ entries.forEach(([key, value]) => root.style.setProperty(key, value));
5895
+ return () => {
5896
+ entries.forEach(([key]) => root.style.removeProperty(key));
5897
+ };
5898
+ }, [remoraidTheme]);
5819
5899
  return /* @__PURE__ */ jsxDEV3(themeContext.Provider, {
5820
5900
  value: remoraidTheme,
5821
5901
  children
@@ -6543,7 +6623,15 @@ var AppShell_default = Object.assign(AppShell, {
6543
6623
  FooterMinimal
6544
6624
  });
6545
6625
  // src/core/components/WidgetSelectionHeader/index.tsx
6546
- import { Chip as Chip2, Divider as Divider2, Flex as Flex3, Text } from "@mantine/core";
6626
+ import {
6627
+ Box as Box4,
6628
+ Chip as Chip2,
6629
+ Divider as Divider2,
6630
+ Flex as Flex3,
6631
+ Menu,
6632
+ Text,
6633
+ useMantineTheme as useMantineTheme2
6634
+ } from "@mantine/core";
6547
6635
 
6548
6636
  // src/core/components/Page/index.tsx
6549
6637
  import { Stack as Stack3 } from "@mantine/core";
@@ -6590,7 +6678,8 @@ function Page({
6590
6678
  }
6591
6679
 
6592
6680
  // src/core/components/WidgetSelectionHeader/index.tsx
6593
- import { IconCheck } from "@tabler/icons-react";
6681
+ import { IconCheck, IconFocus, IconNavigation } from "@tabler/icons-react";
6682
+ import { useEffect as useEffect4, useRef as useRef3, useState as useState8 } from "react";
6594
6683
 
6595
6684
  // src/core/components/ScrollableChipGroup/index.tsx
6596
6685
  import {
@@ -6602,15 +6691,16 @@ var import_lodash7 = __toESM(require_lodash(), 1);
6602
6691
  import { jsxDEV as jsxDEV16 } from "react/jsx-dev-runtime";
6603
6692
  function ScrollableChipGroup({
6604
6693
  value,
6694
+ ref,
6605
6695
  onChange,
6606
- gap,
6696
+ gap = "xs",
6607
6697
  componentsProps,
6608
- children: childrenProp
6698
+ children
6609
6699
  }) {
6610
- const children = asChildrenOfType(Chip, childrenProp, "Check children passed to 'ScrollableChipGroup' component.");
6611
6700
  const theme = useRemoraidTheme();
6612
6701
  return /* @__PURE__ */ jsxDEV16(ScrollArea2, {
6613
- ...import_lodash7.merge({}, theme.componentsProps.ScrollArea, componentsProps?.ScrollArea),
6702
+ ref,
6703
+ ...import_lodash7.merge({}, theme.componentsProps.ScrollArea, { style: { contain: "inline-size" } }, componentsProps?.ScrollArea),
6614
6704
  children: /* @__PURE__ */ jsxDEV16(Chip.Group, {
6615
6705
  value,
6616
6706
  onChange,
@@ -6619,7 +6709,7 @@ function ScrollableChipGroup({
6619
6709
  children: /* @__PURE__ */ jsxDEV16(Flex2, {
6620
6710
  justify: "flex-start",
6621
6711
  align: "center",
6622
- gap: gap ?? "xs",
6712
+ gap,
6623
6713
  h: "auto",
6624
6714
  ...componentsProps?.container,
6625
6715
  children
@@ -6629,163 +6719,543 @@ function ScrollableChipGroup({
6629
6719
  }
6630
6720
 
6631
6721
  // src/core/components/WidgetSelectionHeader/index.tsx
6632
- import { jsxDEV as jsxDEV17 } from "react/jsx-dev-runtime";
6633
- function WidgetSelectionHeader({
6634
- title,
6635
- disabledWidgets,
6636
- mt
6637
- }) {
6638
- const theme = useRemoraidTheme();
6639
- const { isPageRegistered, updateWidgetSelectionBulk, ...widgetsContext2 } = useWidgets();
6640
- const page = usePage();
6641
- if (!page) {
6642
- throw new InvalidComponentUsageError("WidgetSelectionHeader", "must be used as child of 'Page'.");
6643
- }
6644
- const widgets = widgetsContext2.widgets[page.pageId] ?? {};
6645
- return /* @__PURE__ */ jsxDEV17(Flex3, {
6646
- justify: "flex-start",
6647
- align: "center",
6648
- gap: "xs",
6649
- mt,
6650
- children: [
6651
- /* @__PURE__ */ jsxDEV17(Text, {
6652
- size: "lg",
6653
- fw: 400,
6654
- children: title ?? page.name
6655
- }, undefined, false, undefined, this),
6656
- /* @__PURE__ */ jsxDEV17(Divider2, {
6657
- orientation: "vertical"
6658
- }, undefined, false, undefined, this),
6659
- isPageRegistered(page.pageId) && /* @__PURE__ */ jsxDEV17(ScrollableChipGroup, {
6660
- value: Object.keys(widgets).filter((widgetId) => widgets[widgetId]?.selected),
6661
- onChange: (value) => {
6662
- updateWidgetSelectionBulk(page.pageId, value);
6663
- },
6664
- componentsProps: { ScrollArea: { flex: 1 } },
6665
- children: Object.keys(widgets).map((widgetId) => {
6666
- const widget = widgets[widgetId] ?? getDefaultWidgetContext({ widgetId });
6667
- return /* @__PURE__ */ jsxDEV17(Chip2, {
6668
- value: widgetId,
6669
- size: "sm",
6670
- disabled: disabledWidgets && disabledWidgets.includes(widgetId),
6671
- icon: /* @__PURE__ */ jsxDEV17(IconCheck, {
6672
- ...theme.componentsProps.icons.small
6673
- }, undefined, false, undefined, this),
6674
- children: widget.name
6675
- }, widgetId, false, undefined, this);
6676
- })
6677
- }, undefined, false, undefined, this)
6678
- ]
6679
- }, undefined, true, undefined, this);
6680
- }
6681
- // src/core/components/BadgeGroup/index.tsx
6722
+ var import_lodash10 = __toESM(require_lodash(), 1);
6723
+
6724
+ // src/core/components/Pinnable/index.tsx
6682
6725
  import {
6683
- Badge as Badge2,
6684
- Group as Group3,
6685
- HoverCard,
6686
- Stack as Stack4,
6687
- Transition as Transition2
6688
- } from "@mantine/core";
6689
- import React7 from "react";
6726
+ useMemo as useMemo4,
6727
+ useRef as useRef2,
6728
+ useState as useState7
6729
+ } from "react";
6730
+ import { IconPin, IconPinnedOff } from "@tabler/icons-react";
6731
+ import { Box as Box3, Portal as Portal2 } from "@mantine/core";
6690
6732
 
6691
- // src/core/components/BadgeMinimal/index.tsx
6733
+ // src/core/components/Controls/ControlButton/index.tsx
6692
6734
  import {
6693
- Badge,
6735
+ ActionIcon,
6694
6736
  Tooltip as Tooltip2,
6695
6737
  Transition
6696
6738
  } from "@mantine/core";
6739
+ import { IconClick } from "@tabler/icons-react";
6697
6740
  var import_lodash8 = __toESM(require_lodash(), 1);
6698
- import { jsxDEV as jsxDEV18 } from "react/jsx-dev-runtime";
6699
- function BadgeMinimal({
6700
- label,
6701
- tooltip,
6741
+ import { jsxDEV as jsxDEV17 } from "react/jsx-dev-runtime";
6742
+ function ControlButton({
6743
+ icon: Icon3 = IconClick,
6702
6744
  mounted = true,
6745
+ size = "xs",
6746
+ iconSize = "tiny" /* Tiny */,
6747
+ onClick,
6748
+ order,
6749
+ color,
6750
+ tooltip,
6703
6751
  componentsProps
6704
6752
  }) {
6705
6753
  const theme = useRemoraidTheme();
6706
- return /* @__PURE__ */ jsxDEV18(Transition, {
6754
+ return /* @__PURE__ */ jsxDEV17(Transition, {
6707
6755
  mounted,
6708
6756
  transition: "fade",
6709
6757
  duration: theme.transitionDurations.short,
6710
6758
  timingFunction: "ease",
6711
6759
  ...componentsProps?.transition,
6712
- children: (transitionStyle) => /* @__PURE__ */ jsxDEV18(Tooltip2, {
6760
+ children: (transitionStyle) => /* @__PURE__ */ jsxDEV17(Tooltip2, {
6713
6761
  ...import_lodash8.merge({}, theme.componentsProps.Tooltip, { label: tooltip, disabled: !Boolean(tooltip) }, componentsProps?.tooltip),
6714
- children: /* @__PURE__ */ jsxDEV18(Badge, {
6715
- variant: "default",
6716
- ...componentsProps?.badge,
6762
+ children: /* @__PURE__ */ jsxDEV17(ActionIcon, {
6763
+ "data-control-button": true,
6764
+ size,
6765
+ color,
6766
+ onClick,
6767
+ radius: "xl",
6768
+ ...componentsProps?.button,
6717
6769
  style: {
6718
- ...transitionStyle,
6719
- cursor: "pointer",
6720
- ...componentsProps?.badge?.style
6770
+ order,
6771
+ ...import_lodash8.merge(transitionStyle, componentsProps?.button?.style)
6721
6772
  },
6722
- children: label
6773
+ children: /* @__PURE__ */ jsxDEV17(Icon3, {
6774
+ ...import_lodash8.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
6775
+ }, undefined, false, undefined, this)
6723
6776
  }, undefined, false, undefined, this)
6724
6777
  }, undefined, false, undefined, this)
6725
6778
  }, undefined, false, undefined, this);
6726
6779
  }
6727
6780
 
6728
- // src/core/components/BadgeGroup/index.tsx
6781
+ // src/core/components/Controls/index.tsx
6782
+ import { useRef, useState as useState6 } from "react";
6783
+ import {
6784
+ Group as Group3,
6785
+ Paper as Paper2,
6786
+ Transition as Transition2
6787
+ } from "@mantine/core";
6788
+ import { IconGripHorizontal } from "@tabler/icons-react";
6729
6789
  var import_lodash9 = __toESM(require_lodash(), 1);
6730
- import { jsxDEV as jsxDEV19, Fragment as Fragment2 } from "react/jsx-dev-runtime";
6731
- import { createElement } from "react";
6732
- function BadgeGroup({
6733
- badges: badgesProp,
6734
- gap = "xs",
6735
- breakpoint: breakpointProp,
6736
- componentsProps
6790
+ import { jsxDEV as jsxDEV18 } from "react/jsx-dev-runtime";
6791
+ function Controls({
6792
+ groupRef,
6793
+ mounted = true,
6794
+ dragContainerRef,
6795
+ gutter = 5,
6796
+ iconSize = "tiny" /* Tiny */,
6797
+ additionalButtons: additionalButtonsProp,
6798
+ componentsProps,
6799
+ children: childrenProp
6737
6800
  }) {
6738
- const badges = badgesProp.map((badge) => asElementOrPropsOfType(BadgeMinimal, badge, "Check 'badges' property passed to 'BadgeGroup'."));
6801
+ const additionalButtons = additionalButtonsProp?.map((additionalButton) => asElementOrPropsOfType(ControlButton, additionalButton, "Check the 'additionalButtons' property of 'Controls'."));
6802
+ const children = asChildrenOfType(ControlButton, childrenProp, "Check children passed to 'Controls' component.");
6739
6803
  const theme = useRemoraidTheme();
6740
- const breakpoint = breakpointProp ?? theme.breakpoints.badgeGroupCollapse;
6741
- const numVisibleBadges = badges.filter((badge) => isValidElementOfType(BadgeMinimal, badge) ? badge.props.mounted : badge.mounted !== false).length;
6742
- const badgesElement = badges.map((badge, i) => {
6743
- if (isValidElementOfType(BadgeMinimal, badge)) {
6744
- return badge;
6804
+ const [pos, setPos] = useState6({
6805
+ x: 0,
6806
+ y: 0
6807
+ });
6808
+ const offsetRef = useRef({ x: 0, y: 0 });
6809
+ const containerRef = useRef(null);
6810
+ const clamp = (v, min, max) => {
6811
+ return Math.min(Math.max(v, min), max);
6812
+ };
6813
+ const handlePointerDown = (e) => {
6814
+ if (e.target instanceof Element && e.target.closest("button,[data-control-button]")) {
6815
+ return;
6745
6816
  }
6746
- return /* @__PURE__ */ createElement(BadgeMinimal, {
6747
- ...badge,
6748
- key: i
6817
+ if (!containerRef.current) {
6818
+ return;
6819
+ }
6820
+ const paperRect = containerRef.current.getBoundingClientRect();
6821
+ offsetRef.current = {
6822
+ x: e.clientX - paperRect.right,
6823
+ y: e.clientY - paperRect.top
6824
+ };
6825
+ e.currentTarget.setPointerCapture(e.pointerId);
6826
+ };
6827
+ const handlePointerMove = (e) => {
6828
+ if (!e.currentTarget.hasPointerCapture(e.pointerId)) {
6829
+ return;
6830
+ }
6831
+ if (!containerRef.current || !dragContainerRef.current) {
6832
+ return;
6833
+ }
6834
+ const boxRect = dragContainerRef.current.getBoundingClientRect();
6835
+ const paperRect = containerRef.current.getBoundingClientRect();
6836
+ const rawX = e.clientX - boxRect.right - offsetRef.current.x;
6837
+ const rawY = e.clientY - boxRect.top - offsetRef.current.y;
6838
+ const maxX = boxRect.width - paperRect.width;
6839
+ const maxY = boxRect.height - paperRect.height;
6840
+ setPos({
6841
+ x: clamp(-rawX, 0, maxX),
6842
+ y: clamp(rawY, 0, maxY)
6749
6843
  });
6750
- });
6751
- return /* @__PURE__ */ jsxDEV19(Fragment2, {
6752
- children: [
6753
- /* @__PURE__ */ jsxDEV19(Group3, {
6754
- gap,
6844
+ };
6845
+ const handlePointerUp = (e) => {
6846
+ e.currentTarget.releasePointerCapture(e.pointerId);
6847
+ };
6848
+ return /* @__PURE__ */ jsxDEV18(Transition2, {
6849
+ mounted,
6850
+ keepMounted: true,
6851
+ transition: "pop",
6852
+ duration: theme.transitionDurations.short,
6853
+ timingFunction: "ease",
6854
+ ...componentsProps?.transition,
6855
+ children: (transitionStyle) => /* @__PURE__ */ jsxDEV18(Paper2, {
6856
+ ref: containerRef,
6857
+ pos: "absolute",
6858
+ p: gutter,
6859
+ bg: theme.transparentBackground,
6860
+ shadow: "md",
6861
+ onPointerDown: handlePointerDown,
6862
+ onPointerMove: handlePointerMove,
6863
+ onPointerUp: handlePointerUp,
6864
+ ...componentsProps?.container,
6865
+ style: {
6866
+ right: pos.x,
6867
+ top: pos.y,
6868
+ ...import_lodash9.merge(transitionStyle, componentsProps?.container?.style)
6869
+ },
6870
+ className: clsx_default("remoraid-controls", componentsProps?.container?.className),
6871
+ children: /* @__PURE__ */ jsxDEV18(Group3, {
6872
+ gap: gutter,
6873
+ ref: groupRef,
6755
6874
  wrap: "nowrap",
6756
- visibleFrom: numVisibleBadges > 1 ? breakpoint : undefined,
6757
- ...componentsProps?.container,
6758
- className: clsx_default("remoraid-badge-group", componentsProps?.container?.className),
6759
- children: badgesElement
6760
- }, undefined, false, undefined, this),
6761
- /* @__PURE__ */ jsxDEV19(Transition2, {
6762
- mounted: numVisibleBadges > 1,
6763
- transition: "fade",
6764
- duration: theme.transitionDurations.short,
6765
- timingFunction: "ease",
6766
- ...componentsProps?.cumulativeBadgeTransition,
6767
- children: (transitionStyle) => /* @__PURE__ */ jsxDEV19(HoverCard, {
6768
- ...import_lodash9.merge({}, theme.componentsProps.HoverCard, componentsProps?.HoverCard),
6769
- children: [
6770
- /* @__PURE__ */ jsxDEV19(HoverCard.Target, {
6771
- children: /* @__PURE__ */ jsxDEV19(Badge2, {
6772
- hiddenFrom: breakpoint,
6773
- variant: "dot",
6774
- ...componentsProps?.cumulativeBadge,
6775
- style: {
6776
- cursor: "pointer",
6777
- ...import_lodash9.merge(transitionStyle, componentsProps?.cumulativeBadge?.style)
6778
- },
6779
- children: [
6780
- numVisibleBadges,
6781
- " badges"
6782
- ]
6783
- }, undefined, true, undefined, this)
6784
- }, undefined, false, undefined, this),
6785
- /* @__PURE__ */ jsxDEV19(HoverCard.Dropdown, {
6786
- p: gap,
6787
- children: /* @__PURE__ */ jsxDEV19(Stack4, {
6788
- gap,
6875
+ ...componentsProps?.group,
6876
+ className: clsx_default("remoraid-controls-group", componentsProps?.group?.className),
6877
+ children: [
6878
+ /* @__PURE__ */ jsxDEV18(IconGripHorizontal, {
6879
+ ...import_lodash9.merge({}, theme.componentsProps.icons[iconSize], { order: -100, color: "var(--mantine-color-default-border)" }, componentsProps?.gripIcon)
6880
+ }, undefined, false, undefined, this),
6881
+ children,
6882
+ additionalButtons && additionalButtons.map((button, i) => {
6883
+ if (isValidElementOfType(ControlButton, button)) {
6884
+ return button;
6885
+ }
6886
+ return /* @__PURE__ */ jsxDEV18(ControlButton, {
6887
+ ...button
6888
+ }, i, false, undefined, this);
6889
+ })
6890
+ ]
6891
+ }, undefined, true, undefined, this)
6892
+ }, undefined, false, undefined, this)
6893
+ }, undefined, false, undefined, this);
6894
+ }
6895
+
6896
+ // src/core/components/Pinnable/index.tsx
6897
+ import { jsxDEV as jsxDEV19 } from "react/jsx-dev-runtime";
6898
+ function Pinnable({
6899
+ layoutType: layoutTypeProp,
6900
+ section,
6901
+ initialValue = false,
6902
+ layoutId,
6903
+ controlsContainer,
6904
+ hidden = false,
6905
+ componentsProps,
6906
+ children
6907
+ }) {
6908
+ const layoutType = layoutTypeProp ?? "frame" /* Frame */;
6909
+ const { layouts } = useLayouts();
6910
+ const [pinned, setPinned] = useState7(initialValue);
6911
+ const containerRef = useRef2(null);
6912
+ const layout = layouts[layoutId ?? remoraidAppShellLayoutId];
6913
+ if (layout && layout.type !== layoutType) {
6914
+ throw new TypeError(`Prop 'layoutId' in '${Pinnable.name}' refers to a layout of type ${layout.type}, expected ${layoutType}. Leave 'layoutId' undefined, if you want to use the layout in '${AppShell_default.name}' as reference layout.`);
6915
+ }
6916
+ const controlButton = useMemo4(() => /* @__PURE__ */ jsxDEV19(ControlButton, {
6917
+ icon: pinned ? IconPinnedOff : IconPin,
6918
+ tooltip: pinned ? "Unpin" : "Pin",
6919
+ color: "green",
6920
+ order: 100,
6921
+ ...componentsProps?.button,
6922
+ onClick: (e) => {
6923
+ setPinned((p) => !p);
6924
+ componentsProps?.button?.onClick?.(e);
6925
+ }
6926
+ }, undefined, false, undefined, this), [pinned, componentsProps?.button]);
6927
+ const element = /* @__PURE__ */ jsxDEV19(Box3, {
6928
+ pos: "relative",
6929
+ ref: containerRef,
6930
+ "data-hidden": hidden,
6931
+ h: "100%",
6932
+ ...componentsProps?.container,
6933
+ className: clsx_default("remoraid-pinnable", componentsProps?.container?.className),
6934
+ children: [
6935
+ controlsContainer === undefined ? /* @__PURE__ */ jsxDEV19(Controls, {
6936
+ dragContainerRef: containerRef,
6937
+ ...componentsProps?.controls,
6938
+ children: controlButton
6939
+ }, undefined, false, undefined, this) : controlsContainer !== null && /* @__PURE__ */ jsxDEV19(Portal2, {
6940
+ target: controlsContainer,
6941
+ children: controlButton
6942
+ }, undefined, false, undefined, this),
6943
+ children
6944
+ ]
6945
+ }, undefined, true, undefined, this);
6946
+ if (!layout) {
6947
+ return null;
6948
+ }
6949
+ if (pinned && layoutType === "frame" /* Frame */) {
6950
+ return /* @__PURE__ */ jsxDEV19(FrameLayout_default.Element, {
6951
+ layoutId,
6952
+ section,
6953
+ hidden,
6954
+ ...componentsProps?.layoutElement,
6955
+ children: element
6956
+ }, undefined, false, undefined, this);
6957
+ }
6958
+ return element;
6959
+ }
6960
+
6961
+ // src/core/components/WidgetSelectionHeader/index.tsx
6962
+ import { jsxDEV as jsxDEV20 } from "react/jsx-dev-runtime";
6963
+ function WidgetSelectionHeader({
6964
+ title,
6965
+ pinnableSection = "top" /* Top */,
6966
+ initiallyPinned = true,
6967
+ disabledWidgets,
6968
+ componentsProps
6969
+ }) {
6970
+ const theme = useRemoraidTheme();
6971
+ const mantineTheme = useMantineTheme2();
6972
+ const {
6973
+ activeWidget,
6974
+ isPageRegistered,
6975
+ updateWidgetSelectionBulk,
6976
+ ...widgetsContext2
6977
+ } = useWidgets();
6978
+ const page = usePage();
6979
+ if (!page) {
6980
+ throw new InvalidComponentUsageError("WidgetSelectionHeader", "must be used as child of 'Page'.");
6981
+ }
6982
+ const [hover, setHover] = useState8(false);
6983
+ const [isPinned, setIsPinned] = useState8(initiallyPinned);
6984
+ const handleEnter = () => {
6985
+ setHover(true);
6986
+ };
6987
+ const handleLeave = () => {
6988
+ setHover(false);
6989
+ };
6990
+ const scrollAreaRef = useRef3(null);
6991
+ const widgets = widgetsContext2.widgets[page.pageId] ?? {};
6992
+ const selectedWidgets = Object.entries(widgets).reduce((t, [widgetId, widget]) => widget?.selected ? [...t, widgetId] : t, []);
6993
+ const element = /* @__PURE__ */ jsxDEV20(Flex3, {
6994
+ justify: "flex-start",
6995
+ align: "center",
6996
+ gap: "md",
6997
+ ...componentsProps?.container,
6998
+ onMouseEnter: (e) => {
6999
+ if (!pinnableSection) {
7000
+ handleEnter();
7001
+ }
7002
+ componentsProps?.container?.onMouseEnter?.(e);
7003
+ },
7004
+ onMouseLeave: (e) => {
7005
+ if (!pinnableSection) {
7006
+ handleEnter();
7007
+ }
7008
+ componentsProps?.container?.onMouseEnter?.(e);
7009
+ },
7010
+ className: clsx_default(!pinnableSection ? "remoraid-non-widget-segment" : undefined, !pinnableSection ? "remoraid-segment" : undefined, componentsProps?.container?.className),
7011
+ children: [
7012
+ /* @__PURE__ */ jsxDEV20(Text, {
7013
+ size: "md",
7014
+ ...componentsProps?.title,
7015
+ children: title ?? page.name
7016
+ }, undefined, false, undefined, this),
7017
+ /* @__PURE__ */ jsxDEV20(Divider2, {
7018
+ orientation: "vertical"
7019
+ }, undefined, false, undefined, this),
7020
+ isPageRegistered(page.pageId) && /* @__PURE__ */ jsxDEV20(ScrollableChipGroup, {
7021
+ value: selectedWidgets,
7022
+ ref: scrollAreaRef,
7023
+ ...componentsProps?.ScrollableChipGroup,
7024
+ onChange: (value) => {
7025
+ updateWidgetSelectionBulk(page.pageId, value);
7026
+ componentsProps?.ScrollableChipGroup?.onChange?.(value);
7027
+ },
7028
+ componentsProps: import_lodash10.merge({ ScrollArea: { flex: 1 } }, componentsProps?.ScrollableChipGroup?.componentsProps),
7029
+ children: Object.entries(widgets).map(([widgetId, widget]) => {
7030
+ if (!widget) {
7031
+ return;
7032
+ }
7033
+ return /* @__PURE__ */ jsxDEV20(Menu, {
7034
+ ...import_lodash10.merge({}, theme.componentsProps.Menu, { trigger: "hover" }, componentsProps?.widgetMenu),
7035
+ children: [
7036
+ /* @__PURE__ */ jsxDEV20(Menu.Target, {
7037
+ children: /* @__PURE__ */ jsxDEV20(Box4, {
7038
+ children: /* @__PURE__ */ jsxDEV20(Chip2, {
7039
+ variant: selectedWidgets.includes(widgetId) ? "filled" : "outline",
7040
+ color: activeWidget === widgetId ? mantineTheme.primaryColor : "gray",
7041
+ value: widgetId,
7042
+ size: "sm",
7043
+ disabled: disabledWidgets?.includes(widgetId),
7044
+ icon: /* @__PURE__ */ jsxDEV20(IconCheck, {
7045
+ ...theme.componentsProps.icons.small
7046
+ }, undefined, false, undefined, this),
7047
+ ...componentsProps?.Chip,
7048
+ styles: import_lodash10.merge({
7049
+ label: {
7050
+ transition: "background-color var(--remoraid-transition-duration-short)"
7051
+ }
7052
+ }, componentsProps?.Chip?.styles),
7053
+ id: `remoraid-widget-selection-header-chip-${widgetId}`,
7054
+ children: widget.name
7055
+ }, undefined, false, undefined, this)
7056
+ }, undefined, false, undefined, this)
7057
+ }, undefined, false, undefined, this),
7058
+ /* @__PURE__ */ jsxDEV20(Menu.Dropdown, {
7059
+ children: [
7060
+ /* @__PURE__ */ jsxDEV20(Menu.Item, {
7061
+ leftSection: /* @__PURE__ */ jsxDEV20(IconNavigation, {
7062
+ ...theme.componentsProps.icons.small
7063
+ }, undefined, false, undefined, this),
7064
+ onClick: () => {
7065
+ scrollToWidget(widgetId);
7066
+ handleLeave();
7067
+ },
7068
+ disabled: !widget.selected,
7069
+ children: "Scroll to widget"
7070
+ }, undefined, false, undefined, this),
7071
+ /* @__PURE__ */ jsxDEV20(Menu.Item, {
7072
+ leftSection: /* @__PURE__ */ jsxDEV20(IconFocus, {
7073
+ ...theme.componentsProps.icons.small
7074
+ }, undefined, false, undefined, this),
7075
+ onClick: () => {
7076
+ updateWidgetSelectionBulk(page.pageId, [widgetId]);
7077
+ handleLeave();
7078
+ },
7079
+ disabled: selectedWidgets.length === 1 && selectedWidgets.includes(widgetId),
7080
+ children: "Isolate widget"
7081
+ }, undefined, false, undefined, this)
7082
+ ]
7083
+ }, undefined, true, undefined, this)
7084
+ ]
7085
+ }, widgetId, true, undefined, this);
7086
+ })
7087
+ }, undefined, false, undefined, this)
7088
+ ]
7089
+ }, undefined, true, undefined, this);
7090
+ useEffect4(() => {
7091
+ if (!activeWidget) {
7092
+ return;
7093
+ }
7094
+ if (!isPinned) {
7095
+ return;
7096
+ }
7097
+ if (!scrollAreaRef?.current) {
7098
+ return;
7099
+ }
7100
+ const activeWidgetChipElement = scrollAreaRef.current.querySelector(`#remoraid-widget-selection-header-chip-${activeWidget}`);
7101
+ if (!activeWidgetChipElement) {
7102
+ return;
7103
+ }
7104
+ activeWidgetChipElement.scrollIntoView({
7105
+ behavior: "smooth",
7106
+ inline: "center"
7107
+ });
7108
+ }, [activeWidget]);
7109
+ if (pinnableSection) {
7110
+ return /* @__PURE__ */ jsxDEV20(Pinnable, {
7111
+ section: pinnableSection,
7112
+ initialValue: initiallyPinned,
7113
+ ...componentsProps?.Pinnable,
7114
+ componentsProps: {
7115
+ ...componentsProps?.Pinnable?.componentsProps,
7116
+ container: {
7117
+ ...componentsProps?.Pinnable?.componentsProps?.container,
7118
+ onMouseEnter: (e) => {
7119
+ handleEnter();
7120
+ componentsProps?.Pinnable?.componentsProps?.container?.onMouseEnter?.(e);
7121
+ },
7122
+ onMouseLeave: (e) => {
7123
+ handleLeave();
7124
+ componentsProps?.Pinnable?.componentsProps?.container?.onMouseLeave?.(e);
7125
+ },
7126
+ className: clsx_default("remoraid-segment", "remoraid-non-widget-segment", componentsProps?.Pinnable?.componentsProps?.container?.className)
7127
+ },
7128
+ button: {
7129
+ ...componentsProps?.Pinnable?.componentsProps?.button,
7130
+ onClick: (e) => {
7131
+ setIsPinned(!isPinned);
7132
+ handleLeave();
7133
+ componentsProps?.Pinnable?.componentsProps?.button?.onClick?.(e);
7134
+ }
7135
+ },
7136
+ layoutElement: {
7137
+ includeContainer: false,
7138
+ includePageContainer: pinnableSection === "top" /* Top */ || pinnableSection === "bottom" /* Bottom */,
7139
+ ...componentsProps?.Pinnable?.componentsProps?.layoutElement
7140
+ },
7141
+ controls: {
7142
+ mounted: hover,
7143
+ ...componentsProps?.Pinnable?.componentsProps?.controls
7144
+ }
7145
+ },
7146
+ children: element
7147
+ }, undefined, false, undefined, this);
7148
+ }
7149
+ return element;
7150
+ }
7151
+ // src/core/components/BadgeGroup/index.tsx
7152
+ import {
7153
+ Badge as Badge2,
7154
+ Group as Group4,
7155
+ HoverCard,
7156
+ Stack as Stack4,
7157
+ Transition as Transition4
7158
+ } from "@mantine/core";
7159
+ import React7 from "react";
7160
+
7161
+ // src/core/components/BadgeMinimal/index.tsx
7162
+ import {
7163
+ Badge,
7164
+ Tooltip as Tooltip3,
7165
+ Transition as Transition3
7166
+ } from "@mantine/core";
7167
+ var import_lodash11 = __toESM(require_lodash(), 1);
7168
+ import { jsxDEV as jsxDEV21 } from "react/jsx-dev-runtime";
7169
+ function BadgeMinimal({
7170
+ label,
7171
+ tooltip,
7172
+ mounted = true,
7173
+ componentsProps
7174
+ }) {
7175
+ const theme = useRemoraidTheme();
7176
+ return /* @__PURE__ */ jsxDEV21(Transition3, {
7177
+ mounted,
7178
+ transition: "fade",
7179
+ duration: theme.transitionDurations.short,
7180
+ timingFunction: "ease",
7181
+ ...componentsProps?.transition,
7182
+ children: (transitionStyle) => /* @__PURE__ */ jsxDEV21(Tooltip3, {
7183
+ ...import_lodash11.merge({}, theme.componentsProps.Tooltip, { label: tooltip, disabled: !Boolean(tooltip) }, componentsProps?.tooltip),
7184
+ children: /* @__PURE__ */ jsxDEV21(Badge, {
7185
+ variant: "default",
7186
+ ...componentsProps?.badge,
7187
+ style: {
7188
+ ...transitionStyle,
7189
+ cursor: "pointer",
7190
+ ...componentsProps?.badge?.style
7191
+ },
7192
+ children: label
7193
+ }, undefined, false, undefined, this)
7194
+ }, undefined, false, undefined, this)
7195
+ }, undefined, false, undefined, this);
7196
+ }
7197
+
7198
+ // src/core/components/BadgeGroup/index.tsx
7199
+ var import_lodash12 = __toESM(require_lodash(), 1);
7200
+ import { jsxDEV as jsxDEV22, Fragment as Fragment2 } from "react/jsx-dev-runtime";
7201
+ import { createElement } from "react";
7202
+ function BadgeGroup({
7203
+ badges: badgesProp,
7204
+ gap = "xs",
7205
+ breakpoint: breakpointProp,
7206
+ componentsProps
7207
+ }) {
7208
+ const badges = badgesProp.map((badge) => asElementOrPropsOfType(BadgeMinimal, badge, "Check 'badges' property passed to 'BadgeGroup'."));
7209
+ const theme = useRemoraidTheme();
7210
+ const breakpoint = breakpointProp ?? theme.breakpoints.badgeGroupCollapse;
7211
+ const numVisibleBadges = badges.filter((badge) => isValidElementOfType(BadgeMinimal, badge) ? badge.props.mounted : badge.mounted !== false).length;
7212
+ const badgesElement = badges.map((badge, i) => {
7213
+ if (isValidElementOfType(BadgeMinimal, badge)) {
7214
+ return badge;
7215
+ }
7216
+ return /* @__PURE__ */ createElement(BadgeMinimal, {
7217
+ ...badge,
7218
+ key: i
7219
+ });
7220
+ });
7221
+ return /* @__PURE__ */ jsxDEV22(Fragment2, {
7222
+ children: [
7223
+ /* @__PURE__ */ jsxDEV22(Group4, {
7224
+ gap,
7225
+ wrap: "nowrap",
7226
+ visibleFrom: numVisibleBadges > 1 ? breakpoint : undefined,
7227
+ ...componentsProps?.container,
7228
+ className: clsx_default("remoraid-badge-group", componentsProps?.container?.className),
7229
+ children: badgesElement
7230
+ }, undefined, false, undefined, this),
7231
+ /* @__PURE__ */ jsxDEV22(Transition4, {
7232
+ mounted: numVisibleBadges > 1,
7233
+ transition: "fade",
7234
+ duration: theme.transitionDurations.short,
7235
+ timingFunction: "ease",
7236
+ ...componentsProps?.cumulativeBadgeTransition,
7237
+ children: (transitionStyle) => /* @__PURE__ */ jsxDEV22(HoverCard, {
7238
+ ...import_lodash12.merge({}, theme.componentsProps.HoverCard, componentsProps?.HoverCard),
7239
+ children: [
7240
+ /* @__PURE__ */ jsxDEV22(HoverCard.Target, {
7241
+ children: /* @__PURE__ */ jsxDEV22(Badge2, {
7242
+ hiddenFrom: breakpoint,
7243
+ variant: "dot",
7244
+ ...componentsProps?.cumulativeBadge,
7245
+ style: {
7246
+ cursor: "pointer",
7247
+ ...import_lodash12.merge(transitionStyle, componentsProps?.cumulativeBadge?.style)
7248
+ },
7249
+ children: [
7250
+ numVisibleBadges,
7251
+ " badges"
7252
+ ]
7253
+ }, undefined, true, undefined, this)
7254
+ }, undefined, false, undefined, this),
7255
+ /* @__PURE__ */ jsxDEV22(HoverCard.Dropdown, {
7256
+ p: gap,
7257
+ children: /* @__PURE__ */ jsxDEV22(Stack4, {
7258
+ gap,
6789
7259
  ...componentsProps?.hoverContainer,
6790
7260
  children: badgesElement
6791
7261
  }, undefined, false, undefined, this)
@@ -6797,9 +7267,9 @@ function BadgeGroup({
6797
7267
  }, undefined, true, undefined, this);
6798
7268
  }
6799
7269
  // src/core/components/AlertMinimal/index.tsx
6800
- import { Alert, Transition as Transition3 } from "@mantine/core";
6801
- var import_lodash10 = __toESM(require_lodash(), 1);
6802
- import { jsxDEV as jsxDEV20 } from "react/jsx-dev-runtime";
7270
+ import { Alert, Transition as Transition5 } from "@mantine/core";
7271
+ var import_lodash13 = __toESM(require_lodash(), 1);
7272
+ import { jsxDEV as jsxDEV23 } from "react/jsx-dev-runtime";
6803
7273
  function AlertMinimal({
6804
7274
  category,
6805
7275
  children,
@@ -6812,26 +7282,26 @@ function AlertMinimal({
6812
7282
  color,
6813
7283
  onClose,
6814
7284
  mounted = true,
6815
- icon: Icon2,
7285
+ icon: Icon3,
6816
7286
  iconSize = "medium" /* Medium */,
6817
7287
  componentsProps
6818
- } = import_lodash10.merge({}, theme.componentsProps.alerts[category], props);
6819
- return /* @__PURE__ */ jsxDEV20(Transition3, {
7288
+ } = import_lodash13.merge({}, theme.componentsProps.alerts[category], props);
7289
+ return /* @__PURE__ */ jsxDEV23(Transition5, {
6820
7290
  mounted,
6821
7291
  transition: "fade",
6822
7292
  duration: theme.transitionDurations.short,
6823
7293
  timingFunction: "ease",
6824
7294
  ...componentsProps?.transition,
6825
- children: (transitionStyle) => /* @__PURE__ */ jsxDEV20(Alert, {
7295
+ children: (transitionStyle) => /* @__PURE__ */ jsxDEV23(Alert, {
6826
7296
  title,
6827
7297
  color,
6828
7298
  variant: "light",
6829
7299
  onClose,
6830
7300
  withCloseButton: onClose !== undefined,
6831
- icon: Icon2 ? /* @__PURE__ */ jsxDEV20(Icon2, {
6832
- ...import_lodash10.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
7301
+ icon: Icon3 ? /* @__PURE__ */ jsxDEV23(Icon3, {
7302
+ ...import_lodash13.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
6833
7303
  }, undefined, false, undefined, this) : undefined,
6834
- style: import_lodash10.merge(transitionStyle, componentsProps?.alert?.style),
7304
+ style: import_lodash13.merge(transitionStyle, componentsProps?.alert?.style),
6835
7305
  children: [
6836
7306
  text,
6837
7307
  children
@@ -6840,333 +7310,98 @@ function AlertMinimal({
6840
7310
  }, undefined, false, undefined, this);
6841
7311
  }
6842
7312
  // src/core/components/RemoraidButton/index.tsx
6843
- import {
6844
- ActionIcon,
6845
- Button,
6846
- Tooltip as Tooltip3,
6847
- Transition as Transition4
6848
- } from "@mantine/core";
6849
- import { IconClick } from "@tabler/icons-react";
6850
- var import_lodash11 = __toESM(require_lodash(), 1);
6851
- import { jsxDEV as jsxDEV21, Fragment as Fragment3 } from "react/jsx-dev-runtime";
6852
- function RemoraidButton({
6853
- label,
6854
- responsive: ResponsiveProp,
6855
- breakpoint: breakpointProp,
6856
- collapsed: collapsedProp,
6857
- size = "sm",
6858
- color,
6859
- onClick,
6860
- loading,
6861
- variant = "default",
6862
- mounted = true,
6863
- icon: iconProp,
6864
- iconSize: iconSizeProp,
6865
- componentsProps
6866
- }) {
6867
- const responsive = ResponsiveProp ?? true;
6868
- const breakpoint = breakpointProp ?? "md";
6869
- const collapsed = collapsedProp ?? false;
6870
- const iconSize = iconSizeProp ?? getDefaultButtonIconSize(size);
6871
- const Icon3 = iconProp ?? IconClick;
6872
- const theme = useRemoraidTheme();
6873
- const iconElement = /* @__PURE__ */ jsxDEV21(Icon3, {
6874
- ...import_lodash11.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
6875
- }, undefined, false, undefined, this);
6876
- return /* @__PURE__ */ jsxDEV21(Transition4, {
6877
- mounted,
6878
- transition: "fade",
6879
- duration: theme.transitionDurations.short,
6880
- timingFunction: "ease",
6881
- ...componentsProps?.transition,
6882
- children: (transitionStyle) => /* @__PURE__ */ jsxDEV21(Fragment3, {
6883
- children: [
6884
- /* @__PURE__ */ jsxDEV21(Tooltip3, {
6885
- ...import_lodash11.merge({}, theme.componentsProps.Tooltip, { label }, componentsProps?.tooltip),
6886
- children: /* @__PURE__ */ jsxDEV21(ActionIcon, {
6887
- "aria-label": label,
6888
- variant,
6889
- onClick,
6890
- loading,
6891
- size: size ? `input-${size}` : "input-sm",
6892
- color,
6893
- ...componentsProps?.button,
6894
- ...componentsProps?.ActionIcon,
6895
- hiddenFrom: !responsive ? undefined : breakpoint,
6896
- display: !responsive && !collapsed ? "none" : componentsProps?.ActionIcon?.display ?? componentsProps?.button?.display,
6897
- style: {
6898
- ...transitionStyle,
6899
- ...componentsProps?.ActionIcon?.style ?? componentsProps?.button?.style
6900
- },
6901
- children: iconElement
6902
- }, undefined, false, undefined, this)
6903
- }, undefined, false, undefined, this),
6904
- /* @__PURE__ */ jsxDEV21(Button, {
6905
- onClick,
6906
- loading,
6907
- variant,
6908
- size,
6909
- color,
6910
- leftSection: iconProp ? iconElement : undefined,
6911
- ...componentsProps?.button,
6912
- ...componentsProps?.Button,
6913
- visibleFrom: !responsive ? undefined : breakpoint,
6914
- display: !responsive && collapsed ? "none" : componentsProps?.Button?.display ?? componentsProps?.button?.display,
6915
- style: {
6916
- ...transitionStyle,
6917
- ...componentsProps?.Button?.style ?? componentsProps?.button?.style
6918
- },
6919
- children: label
6920
- }, undefined, false, undefined, this)
6921
- ]
6922
- }, undefined, true, undefined, this)
6923
- }, undefined, false, undefined, this);
6924
- }
6925
- // src/core/components/Controls/ControlButton/index.tsx
6926
7313
  import {
6927
7314
  ActionIcon as ActionIcon2,
7315
+ Button,
6928
7316
  Tooltip as Tooltip4,
6929
- Transition as Transition5
6930
- } from "@mantine/core";
6931
- import { IconClick as IconClick2 } from "@tabler/icons-react";
6932
- var import_lodash12 = __toESM(require_lodash(), 1);
6933
- import { jsxDEV as jsxDEV22 } from "react/jsx-dev-runtime";
6934
- function ControlButton({
6935
- icon: Icon4 = IconClick2,
6936
- mounted = true,
6937
- size = "xs",
6938
- iconSize = "tiny" /* Tiny */,
6939
- onClick,
6940
- order,
6941
- color,
6942
- tooltip,
6943
- componentsProps
6944
- }) {
6945
- const theme = useRemoraidTheme();
6946
- return /* @__PURE__ */ jsxDEV22(Transition5, {
6947
- mounted,
6948
- transition: "fade",
6949
- duration: theme.transitionDurations.short,
6950
- timingFunction: "ease",
6951
- ...componentsProps?.transition,
6952
- children: (transitionStyle) => /* @__PURE__ */ jsxDEV22(Tooltip4, {
6953
- ...import_lodash12.merge({}, theme.componentsProps.Tooltip, { label: tooltip, disabled: !Boolean(tooltip) }, componentsProps?.tooltip),
6954
- children: /* @__PURE__ */ jsxDEV22(ActionIcon2, {
6955
- "data-control-button": true,
6956
- size,
6957
- color,
6958
- onClick,
6959
- radius: "xl",
6960
- ...componentsProps?.button,
6961
- style: {
6962
- order,
6963
- ...import_lodash12.merge(transitionStyle, componentsProps?.button?.style)
6964
- },
6965
- children: /* @__PURE__ */ jsxDEV22(Icon4, {
6966
- ...import_lodash12.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
6967
- }, undefined, false, undefined, this)
6968
- }, undefined, false, undefined, this)
6969
- }, undefined, false, undefined, this)
6970
- }, undefined, false, undefined, this);
6971
- }
6972
-
6973
- // src/core/components/Controls/index.tsx
6974
- import { useRef, useState as useState6 } from "react";
6975
- import {
6976
- Group as Group4,
6977
- Paper as Paper2,
6978
7317
  Transition as Transition6
6979
7318
  } from "@mantine/core";
6980
- import { IconGripHorizontal } from "@tabler/icons-react";
6981
- var import_lodash13 = __toESM(require_lodash(), 1);
6982
- import { jsxDEV as jsxDEV23 } from "react/jsx-dev-runtime";
6983
- function Controls({
6984
- groupRef,
7319
+ import { IconClick as IconClick2 } from "@tabler/icons-react";
7320
+ var import_lodash14 = __toESM(require_lodash(), 1);
7321
+ import { jsxDEV as jsxDEV24, Fragment as Fragment3 } from "react/jsx-dev-runtime";
7322
+ function RemoraidButton({
7323
+ label,
7324
+ responsive: ResponsiveProp,
7325
+ breakpoint: breakpointProp,
7326
+ collapsed: collapsedProp,
7327
+ size = "sm",
7328
+ color,
7329
+ onClick,
7330
+ loading,
7331
+ variant = "default",
6985
7332
  mounted = true,
6986
- dragContainerRef,
6987
- gutter = 5,
6988
- iconSize = "tiny" /* Tiny */,
6989
- additionalButtons: additionalButtonsProp,
6990
- componentsProps,
6991
- children: childrenProp
7333
+ icon: iconProp,
7334
+ iconSize: iconSizeProp,
7335
+ componentsProps
6992
7336
  }) {
6993
- const additionalButtons = additionalButtonsProp?.map((additionalButton) => asElementOrPropsOfType(ControlButton, additionalButton, "Check the 'additionalButtons' property of 'Controls'."));
6994
- const children = asChildrenOfType(ControlButton, childrenProp, "Check children passed to 'Controls' component.");
7337
+ const responsive = ResponsiveProp ?? true;
7338
+ const breakpoint = breakpointProp ?? "md";
7339
+ const collapsed = collapsedProp ?? false;
7340
+ const iconSize = iconSizeProp ?? getDefaultButtonIconSize(size);
7341
+ const Icon4 = iconProp ?? IconClick2;
6995
7342
  const theme = useRemoraidTheme();
6996
- const [pos, setPos] = useState6({
6997
- x: 0,
6998
- y: 0
6999
- });
7000
- const offsetRef = useRef({ x: 0, y: 0 });
7001
- const containerRef = useRef(null);
7002
- const clamp = (v, min, max) => {
7003
- return Math.min(Math.max(v, min), max);
7004
- };
7005
- const handlePointerDown = (e) => {
7006
- if (e.target instanceof Element && e.target.closest("button,[data-control-button]")) {
7007
- return;
7008
- }
7009
- if (!containerRef.current) {
7010
- return;
7011
- }
7012
- const paperRect = containerRef.current.getBoundingClientRect();
7013
- offsetRef.current = {
7014
- x: e.clientX - paperRect.right,
7015
- y: e.clientY - paperRect.top
7016
- };
7017
- e.currentTarget.setPointerCapture(e.pointerId);
7018
- };
7019
- const handlePointerMove = (e) => {
7020
- if (!e.currentTarget.hasPointerCapture(e.pointerId)) {
7021
- return;
7022
- }
7023
- if (!containerRef.current || !dragContainerRef.current) {
7024
- return;
7025
- }
7026
- const boxRect = dragContainerRef.current.getBoundingClientRect();
7027
- const paperRect = containerRef.current.getBoundingClientRect();
7028
- const rawX = e.clientX - boxRect.right - offsetRef.current.x;
7029
- const rawY = e.clientY - boxRect.top - offsetRef.current.y;
7030
- const maxX = boxRect.width - paperRect.width;
7031
- const maxY = boxRect.height - paperRect.height;
7032
- setPos({
7033
- x: clamp(-rawX, 0, maxX),
7034
- y: clamp(rawY, 0, maxY)
7035
- });
7036
- };
7037
- const handlePointerUp = (e) => {
7038
- e.currentTarget.releasePointerCapture(e.pointerId);
7039
- };
7040
- return /* @__PURE__ */ jsxDEV23(Transition6, {
7343
+ const iconElement = /* @__PURE__ */ jsxDEV24(Icon4, {
7344
+ ...import_lodash14.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
7345
+ }, undefined, false, undefined, this);
7346
+ return /* @__PURE__ */ jsxDEV24(Transition6, {
7041
7347
  mounted,
7042
- keepMounted: true,
7043
- transition: "pop",
7348
+ transition: "fade",
7044
7349
  duration: theme.transitionDurations.short,
7045
7350
  timingFunction: "ease",
7046
7351
  ...componentsProps?.transition,
7047
- children: (transitionStyle) => /* @__PURE__ */ jsxDEV23(Paper2, {
7048
- ref: containerRef,
7049
- pos: "absolute",
7050
- p: gutter,
7051
- bg: theme.transparentBackground,
7052
- shadow: "md",
7053
- onPointerDown: handlePointerDown,
7054
- onPointerMove: handlePointerMove,
7055
- onPointerUp: handlePointerUp,
7056
- ...componentsProps?.container,
7057
- style: {
7058
- right: pos.x,
7059
- top: pos.y,
7060
- ...import_lodash13.merge(transitionStyle, componentsProps?.container?.style)
7061
- },
7062
- className: clsx_default("remoraid-controls", componentsProps?.container?.className),
7063
- children: /* @__PURE__ */ jsxDEV23(Group4, {
7064
- gap: gutter,
7065
- ref: groupRef,
7066
- wrap: "nowrap",
7067
- ...componentsProps?.group,
7068
- className: clsx_default("remoraid-controls-group", componentsProps?.group?.className),
7069
- children: [
7070
- /* @__PURE__ */ jsxDEV23(IconGripHorizontal, {
7071
- ...import_lodash13.merge({}, theme.componentsProps.icons[iconSize], { order: -100, color: "var(--mantine-color-default-border)" }, componentsProps?.gripIcon)
7072
- }, undefined, false, undefined, this),
7073
- children,
7074
- additionalButtons && additionalButtons.map((button, i) => {
7075
- if (isValidElementOfType(ControlButton, button)) {
7076
- return button;
7077
- }
7078
- return /* @__PURE__ */ jsxDEV23(ControlButton, {
7079
- ...button
7080
- }, i, false, undefined, this);
7081
- })
7082
- ]
7083
- }, undefined, true, undefined, this)
7084
- }, undefined, false, undefined, this)
7352
+ children: (transitionStyle) => /* @__PURE__ */ jsxDEV24(Fragment3, {
7353
+ children: [
7354
+ /* @__PURE__ */ jsxDEV24(Tooltip4, {
7355
+ ...import_lodash14.merge({}, theme.componentsProps.Tooltip, { label }, componentsProps?.tooltip),
7356
+ children: /* @__PURE__ */ jsxDEV24(ActionIcon2, {
7357
+ "aria-label": label,
7358
+ variant,
7359
+ onClick,
7360
+ loading,
7361
+ size: size ? `input-${size}` : "input-sm",
7362
+ color,
7363
+ ...componentsProps?.button,
7364
+ ...componentsProps?.ActionIcon,
7365
+ hiddenFrom: !responsive ? undefined : breakpoint,
7366
+ display: !responsive && !collapsed ? "none" : componentsProps?.ActionIcon?.display ?? componentsProps?.button?.display,
7367
+ style: {
7368
+ ...transitionStyle,
7369
+ ...componentsProps?.ActionIcon?.style ?? componentsProps?.button?.style
7370
+ },
7371
+ children: iconElement
7372
+ }, undefined, false, undefined, this)
7373
+ }, undefined, false, undefined, this),
7374
+ /* @__PURE__ */ jsxDEV24(Button, {
7375
+ onClick,
7376
+ loading,
7377
+ variant,
7378
+ size,
7379
+ color,
7380
+ leftSection: iconProp ? iconElement : undefined,
7381
+ ...componentsProps?.button,
7382
+ ...componentsProps?.Button,
7383
+ visibleFrom: !responsive ? undefined : breakpoint,
7384
+ display: !responsive && collapsed ? "none" : componentsProps?.Button?.display ?? componentsProps?.button?.display,
7385
+ style: {
7386
+ ...transitionStyle,
7387
+ ...componentsProps?.Button?.style ?? componentsProps?.button?.style
7388
+ },
7389
+ children: label
7390
+ }, undefined, false, undefined, this)
7391
+ ]
7392
+ }, undefined, true, undefined, this)
7085
7393
  }, undefined, false, undefined, this);
7086
7394
  }
7087
7395
  // src/core/components/Widget/WidgetWrapper/index.tsx
7088
7396
  import { Paper as Paper3, Transition as Transition7 } from "@mantine/core";
7089
7397
  import {
7090
7398
  useCallback as useCallback2,
7091
- useEffect as useEffect4,
7092
- useRef as useRef3,
7093
- useState as useState8
7399
+ useEffect as useEffect5,
7400
+ useRef as useRef4,
7401
+ useState as useState9
7094
7402
  } from "react";
7095
7403
  import { IconX } from "@tabler/icons-react";
7096
-
7097
- // src/core/components/Pinnable/index.tsx
7098
- import {
7099
- useMemo as useMemo4,
7100
- useRef as useRef2,
7101
- useState as useState7
7102
- } from "react";
7103
- import { IconPin, IconPinnedOff } from "@tabler/icons-react";
7104
- import { Box as Box3, Portal as Portal2 } from "@mantine/core";
7105
- import { jsxDEV as jsxDEV24 } from "react/jsx-dev-runtime";
7106
- function Pinnable({
7107
- layoutType: layoutTypeProp,
7108
- section,
7109
- initialValue = false,
7110
- layoutId,
7111
- controlsContainer,
7112
- hidden = false,
7113
- componentsProps,
7114
- children
7115
- }) {
7116
- const layoutType = layoutTypeProp ?? "frame" /* Frame */;
7117
- const { layouts } = useLayouts();
7118
- const [pinned, setPinned] = useState7(initialValue);
7119
- const containerRef = useRef2(null);
7120
- const layout = layouts[layoutId ?? remoraidAppShellLayoutId];
7121
- if (layout && layout.type !== layoutType) {
7122
- throw new TypeError(`Prop 'layoutId' in '${Pinnable.name}' refers to a layout of type ${layout.type}, expected ${layoutType}. Leave 'layoutId' undefined, if you want to use the layout in '${AppShell_default.name}' as reference layout.`);
7123
- }
7124
- const controlButton = useMemo4(() => /* @__PURE__ */ jsxDEV24(ControlButton, {
7125
- icon: pinned ? IconPinnedOff : IconPin,
7126
- tooltip: pinned ? "Unpin" : "Pin",
7127
- color: "green",
7128
- order: 100,
7129
- ...componentsProps?.button,
7130
- onClick: (e) => {
7131
- setPinned((p) => !p);
7132
- componentsProps?.button?.onClick?.(e);
7133
- }
7134
- }, undefined, false, undefined, this), [pinned, componentsProps?.button]);
7135
- const element = /* @__PURE__ */ jsxDEV24(Box3, {
7136
- pos: "relative",
7137
- ref: containerRef,
7138
- "data-hidden": hidden,
7139
- ...componentsProps?.container,
7140
- className: clsx_default("remoraid-pinnable", componentsProps?.container?.className),
7141
- children: [
7142
- controlsContainer === undefined ? /* @__PURE__ */ jsxDEV24(Controls, {
7143
- dragContainerRef: containerRef,
7144
- ...componentsProps?.controls,
7145
- children: controlButton
7146
- }, undefined, false, undefined, this) : controlsContainer !== null && /* @__PURE__ */ jsxDEV24(Portal2, {
7147
- target: controlsContainer,
7148
- children: controlButton
7149
- }, undefined, false, undefined, this),
7150
- children
7151
- ]
7152
- }, undefined, true, undefined, this);
7153
- if (!layout) {
7154
- return null;
7155
- }
7156
- if (pinned && layoutType === "frame" /* Frame */) {
7157
- return /* @__PURE__ */ jsxDEV24(FrameLayout_default.Element, {
7158
- layoutId,
7159
- section,
7160
- hidden,
7161
- ...componentsProps?.layoutElement,
7162
- children: element
7163
- }, undefined, false, undefined, this);
7164
- }
7165
- return element;
7166
- }
7167
-
7168
- // src/core/components/Widget/WidgetWrapper/index.tsx
7169
- var import_lodash14 = __toESM(require_lodash(), 1);
7404
+ var import_lodash15 = __toESM(require_lodash(), 1);
7170
7405
  import { jsxDEV as jsxDEV25 } from "react/jsx-dev-runtime";
7171
7406
  function WidgetWrapper({
7172
7407
  config,
@@ -7177,7 +7412,8 @@ function WidgetWrapper({
7177
7412
  children
7178
7413
  }) {
7179
7414
  const {
7180
- isWidgetSelected,
7415
+ widgets,
7416
+ hideWidget,
7181
7417
  isPageRegistered,
7182
7418
  isWidgetRegistered,
7183
7419
  registerWidget,
@@ -7187,11 +7423,10 @@ function WidgetWrapper({
7187
7423
  } = useWidgets();
7188
7424
  const page = usePage();
7189
7425
  const theme = useRemoraidTheme();
7190
- const mounted = page !== null && isWidgetSelected(page.pageId, config.widgetId);
7191
- const [controlsContainer, setControlsContainer] = useState8(null);
7192
- const [hidden, setHidden] = useState8(!mounted);
7426
+ const [controlsContainer, setControlsContainer] = useState9(null);
7427
+ const widget = page ? widgets[page.pageId]?.[config.widgetId] : undefined;
7193
7428
  const pageRegistered = page ? isPageRegistered(page.pageId) : false;
7194
- const containerRef = useRef3(null);
7429
+ const containerRef = useRef4(null);
7195
7430
  const controlsContainerRef = useCallback2((n) => {
7196
7431
  setControlsContainer(n);
7197
7432
  }, [setControlsContainer]);
@@ -7201,6 +7436,7 @@ function WidgetWrapper({
7201
7436
  const handleLeave = () => {
7202
7437
  updateActiveWidget(null);
7203
7438
  };
7439
+ const mounted = Boolean(widget?.selected);
7204
7440
  let element = /* @__PURE__ */ jsxDEV25(Transition7, {
7205
7441
  mounted,
7206
7442
  transition: "fade-left",
@@ -7208,7 +7444,9 @@ function WidgetWrapper({
7208
7444
  timingFunction: "ease",
7209
7445
  ...componentsProps?.transition,
7210
7446
  onExited: () => {
7211
- setHidden(true);
7447
+ if (page) {
7448
+ hideWidget(page.pageId, config.widgetId);
7449
+ }
7212
7450
  componentsProps?.transition?.onExited?.();
7213
7451
  },
7214
7452
  children: (transitionStyle) => /* @__PURE__ */ jsxDEV25(Paper3, {
@@ -7219,6 +7457,8 @@ function WidgetWrapper({
7219
7457
  mt,
7220
7458
  pos: "relative",
7221
7459
  h: "fit-content",
7460
+ mah: "100%",
7461
+ display: "flex",
7222
7462
  ...componentsProps?.container,
7223
7463
  onMouseEnter: (e) => {
7224
7464
  if (!pinnableSection) {
@@ -7232,7 +7472,8 @@ function WidgetWrapper({
7232
7472
  }
7233
7473
  componentsProps?.container?.onMouseLeave?.(e);
7234
7474
  },
7235
- style: import_lodash14.merge(transitionStyle, componentsProps?.container?.style),
7475
+ style: import_lodash15.merge(transitionStyle, { flexDirection: "column" }, componentsProps?.container?.style),
7476
+ className: clsx_default("remoraid-segment", componentsProps?.container?.className),
7236
7477
  id: config.widgetId,
7237
7478
  children: [
7238
7479
  /* @__PURE__ */ jsxDEV25(Controls, {
@@ -7247,6 +7488,13 @@ function WidgetWrapper({
7247
7488
  color: "red",
7248
7489
  order: 200,
7249
7490
  ...componentsProps?.closeButton,
7491
+ componentsProps: {
7492
+ ...componentsProps?.closeButton?.componentsProps,
7493
+ tooltip: {
7494
+ disabled: !mounted,
7495
+ ...componentsProps?.closeButton?.componentsProps?.tooltip
7496
+ }
7497
+ },
7250
7498
  onClick: (e) => {
7251
7499
  if (!page) {
7252
7500
  return;
@@ -7265,7 +7513,7 @@ function WidgetWrapper({
7265
7513
  element = /* @__PURE__ */ jsxDEV25(Pinnable, {
7266
7514
  section: pinnableSection,
7267
7515
  controlsContainer,
7268
- hidden,
7516
+ hidden: Boolean(widget?.hidden),
7269
7517
  ...componentsProps?.Pinnable,
7270
7518
  componentsProps: {
7271
7519
  ...componentsProps?.Pinnable?.componentsProps,
@@ -7296,7 +7544,7 @@ function WidgetWrapper({
7296
7544
  children: element
7297
7545
  }, undefined, false, undefined, this);
7298
7546
  }
7299
- useEffect4(() => {
7547
+ useEffect5(() => {
7300
7548
  if (!page) {
7301
7549
  return;
7302
7550
  }
@@ -7304,16 +7552,6 @@ function WidgetWrapper({
7304
7552
  registerWidget(page.pageId, config);
7305
7553
  }
7306
7554
  }, [pageRegistered]);
7307
- useEffect4(() => {
7308
- if (mounted) {
7309
- const id = requestAnimationFrame(() => {
7310
- setHidden(false);
7311
- });
7312
- return () => {
7313
- cancelAnimationFrame(id);
7314
- };
7315
- }
7316
- }, [mounted]);
7317
7555
  return element;
7318
7556
  }
7319
7557
  // src/core/components/Widget/index.tsx
@@ -7323,9 +7561,12 @@ import {
7323
7561
  Group as Group5,
7324
7562
  Loader,
7325
7563
  Title,
7326
- Stack as Stack5
7564
+ Stack as Stack5,
7565
+ Box as Box5,
7566
+ ScrollArea as ScrollArea3
7327
7567
  } from "@mantine/core";
7328
- import { jsxDEV as jsxDEV26, Fragment as Fragment4 } from "react/jsx-dev-runtime";
7568
+ var import_lodash16 = __toESM(require_lodash(), 1);
7569
+ import { jsxDEV as jsxDEV26 } from "react/jsx-dev-runtime";
7329
7570
  import { createElement as createElement2 } from "react";
7330
7571
  function Widget({
7331
7572
  id,
@@ -7344,6 +7585,7 @@ function Widget({
7344
7585
  const buttons = buttonsProp?.map((button) => asElementOrPropsOfType(RemoraidButton, button, "Check the 'buttons' property of this widget."));
7345
7586
  const alerts = alertsProp?.map((alert) => asElementOrPropsOfType(AlertMinimal, alert, "Check the 'alerts' property of this widget."));
7346
7587
  const badges = badgesProp?.map((badge) => asElementOrPropsOfType(BadgeMinimal, badge, "Check the 'badges' property of this widget."));
7588
+ const theme = useRemoraidTheme();
7347
7589
  const badgesGap = (typeof gaps === "object" ? gaps.badges : gaps) ?? "xs";
7348
7590
  const buttonsGap = (typeof gaps === "object" ? gaps.buttons : gaps) ?? "xs";
7349
7591
  const alertsGap = (typeof gaps === "object" ? gaps.alerts : gaps) ?? "xs";
@@ -7359,72 +7601,79 @@ function Widget({
7359
7601
  mt,
7360
7602
  ...componentsProps?.wrapper,
7361
7603
  pinnableSection: pinnableSection ?? componentsProps?.wrapper?.pinnableSection,
7362
- children: [
7363
- /* @__PURE__ */ jsxDEV26(Group5, {
7364
- justify: "space-between",
7365
- wrap: "nowrap",
7366
- children: [
7367
- /* @__PURE__ */ jsxDEV26(Group5, {
7368
- gap: badgesGap,
7369
- wrap: "nowrap",
7370
- children: [
7371
- /* @__PURE__ */ jsxDEV26(Title, {
7372
- order: 1,
7373
- size: "h2",
7374
- lineClamp: 1,
7375
- ...componentsProps?.title,
7376
- children: title ?? id
7377
- }, undefined, false, undefined, this),
7378
- badges !== undefined && /* @__PURE__ */ jsxDEV26(BadgeGroup, {
7379
- badges,
7380
- gap: badgesGap,
7381
- ...componentsProps?.badgeGroup
7382
- }, undefined, false, undefined, this)
7383
- ]
7384
- }, undefined, true, undefined, this),
7385
- /* @__PURE__ */ jsxDEV26(Group5, {
7386
- gap: buttonsGap,
7387
- wrap: "nowrap",
7388
- children: buttons !== undefined && buttons.map((button, i) => {
7389
- if (isValidElementOfType(RemoraidButton, button)) {
7390
- return button;
7391
- }
7392
- return /* @__PURE__ */ createElement2(RemoraidButton, {
7393
- ...button,
7394
- key: i
7395
- });
7396
- })
7604
+ children: /* @__PURE__ */ jsxDEV26(Stack5, {
7605
+ gap: "md",
7606
+ mih: 0,
7607
+ ...componentsProps?.contentContainer,
7608
+ children: [
7609
+ /* @__PURE__ */ jsxDEV26(Group5, {
7610
+ justify: "space-between",
7611
+ wrap: "nowrap",
7612
+ children: [
7613
+ /* @__PURE__ */ jsxDEV26(Group5, {
7614
+ gap: badgesGap,
7615
+ wrap: "nowrap",
7616
+ children: [
7617
+ /* @__PURE__ */ jsxDEV26(Title, {
7618
+ order: 1,
7619
+ size: "h2",
7620
+ lineClamp: 1,
7621
+ ...componentsProps?.title,
7622
+ children: title ?? id
7623
+ }, undefined, false, undefined, this),
7624
+ badges !== undefined && /* @__PURE__ */ jsxDEV26(BadgeGroup, {
7625
+ badges,
7626
+ gap: badgesGap,
7627
+ ...componentsProps?.badgeGroup
7628
+ }, undefined, false, undefined, this)
7629
+ ]
7630
+ }, undefined, true, undefined, this),
7631
+ /* @__PURE__ */ jsxDEV26(Group5, {
7632
+ gap: buttonsGap,
7633
+ wrap: "nowrap",
7634
+ children: buttons !== undefined && buttons.map((button, i) => {
7635
+ if (isValidElementOfType(RemoraidButton, button)) {
7636
+ return button;
7637
+ }
7638
+ return /* @__PURE__ */ createElement2(RemoraidButton, {
7639
+ ...button,
7640
+ key: i
7641
+ });
7642
+ })
7643
+ }, undefined, false, undefined, this)
7644
+ ]
7645
+ }, undefined, true, undefined, this),
7646
+ /* @__PURE__ */ jsxDEV26(Box5, {
7647
+ children: /* @__PURE__ */ jsxDEV26(Divider3, {
7648
+ ...componentsProps?.divider
7397
7649
  }, undefined, false, undefined, this)
7398
- ]
7399
- }, undefined, true, undefined, this),
7400
- /* @__PURE__ */ jsxDEV26(Divider3, {
7401
- my: "md",
7402
- ...componentsProps?.divider
7403
- }, undefined, false, undefined, this),
7404
- /* @__PURE__ */ jsxDEV26(Stack5, {
7405
- align: "stretch",
7406
- gap: alertsGap,
7407
- mb: alerts && alerts.length > 0 ? "md" : 0,
7408
- ...componentsProps?.alertsContainer,
7409
- children: alerts?.map((alert, i) => {
7410
- if (isValidElementOfType(AlertMinimal, alert)) {
7411
- return alert;
7412
- }
7413
- return /* @__PURE__ */ createElement2(AlertMinimal, {
7414
- ...alert,
7415
- key: i
7416
- });
7417
- })
7418
- }, undefined, false, undefined, this),
7419
- loading ? /* @__PURE__ */ jsxDEV26(Center, {
7420
- children: /* @__PURE__ */ jsxDEV26(Loader, {
7421
- ...componentsProps?.loader
7650
+ }, undefined, false, undefined, this),
7651
+ /* @__PURE__ */ jsxDEV26(Stack5, {
7652
+ align: "stretch",
7653
+ gap: alertsGap,
7654
+ ...componentsProps?.alertsContainer,
7655
+ className: clsx_default("remoraid-widget-alerts-container", componentsProps?.alertsContainer?.className),
7656
+ children: alerts?.map((alert, i) => {
7657
+ if (isValidElementOfType(AlertMinimal, alert)) {
7658
+ return alert;
7659
+ }
7660
+ return /* @__PURE__ */ createElement2(AlertMinimal, {
7661
+ ...alert,
7662
+ key: i
7663
+ });
7664
+ })
7665
+ }, undefined, false, undefined, this),
7666
+ /* @__PURE__ */ jsxDEV26(ScrollArea3.Autosize, {
7667
+ ...import_lodash16.merge(theme.componentsProps.ScrollArea, { flex: 1 }, componentsProps?.childrenContainer),
7668
+ children: loading ? /* @__PURE__ */ jsxDEV26(Center, {
7669
+ children: /* @__PURE__ */ jsxDEV26(Loader, {
7670
+ ...componentsProps?.loader
7671
+ }, undefined, false, undefined, this)
7672
+ }, undefined, false, undefined, this) : children
7422
7673
  }, undefined, false, undefined, this)
7423
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV26(Fragment4, {
7424
- children
7425
- }, undefined, false, undefined, this)
7426
- ]
7427
- }, undefined, true, undefined, this);
7674
+ ]
7675
+ }, undefined, true, undefined, this)
7676
+ }, undefined, false, undefined, this);
7428
7677
  }
7429
7678
  // src/core/components/NotFoundPage/index.tsx
7430
7679
  import { usePathname as usePathname3 } from "next/navigation";
@@ -7643,7 +7892,7 @@ var SettingsTable_default = Object.assign(SettingsTable, {
7643
7892
  Row
7644
7893
  });
7645
7894
  // src/core/components/NavbarSettingsWidget/index.tsx
7646
- var import_lodash15 = __toESM(require_lodash(), 1);
7895
+ var import_lodash17 = __toESM(require_lodash(), 1);
7647
7896
  import { Chip as Chip3, Group as Group7 } from "@mantine/core";
7648
7897
  import { IconLink as IconLink2 } from "@tabler/icons-react";
7649
7898
  import { jsxDEV as jsxDEV33 } from "react/jsx-dev-runtime";
@@ -7669,7 +7918,7 @@ function NavbarSettingsWidget({
7669
7918
  navbar: initialUserExperience.navbar
7670
7919
  }));
7671
7920
  },
7672
- custom: !import_lodash15.isEqual(userExperience.navbar, initialUserExperience.navbar),
7921
+ custom: !import_lodash17.isEqual(userExperience.navbar, initialUserExperience.navbar),
7673
7922
  children: /* @__PURE__ */ jsxDEV33(SettingsTable_default, {
7674
7923
  ...componentsProps?.table,
7675
7924
  children: [
@@ -7698,6 +7947,7 @@ function NavbarSettingsWidget({
7698
7947
  color: "var(--mantine-primary-color-filled)"
7699
7948
  }, undefined, false, undefined, this),
7700
7949
  variant: "outline",
7950
+ size: "sm",
7701
7951
  children: label
7702
7952
  }, i, false, undefined, this);
7703
7953
  })
@@ -7771,11 +8021,13 @@ export {
7771
8021
  useHydrationStatus,
7772
8022
  useHydratedMantineColorScheme,
7773
8023
  useFrameLayout,
8024
+ scrollToWidget,
7774
8025
  remoraidAppShellLayoutId,
7775
8026
  isValidElementOfType,
7776
8027
  getElementTypeName,
7777
8028
  getDefaultWidgetContext,
7778
8029
  getDefaultButtonIconSize,
8030
+ getCssVars,
7779
8031
  defaultUserExperienceCookieName,
7780
8032
  defaultUserExperience,
7781
8033
  defaultSettingsWidgetContext as defaultSettingsWidgetOptions,