remoraid 2.41.3 → 2.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/index.cjs +62 -47
- package/dist/core/index.d.ts +16 -12
- package/dist/core/index.js +20 -5
- package/dist/jsonforms/index.cjs +97 -83
- package/dist/jsonforms/index.js +18 -4
- package/package.json +1 -1
package/dist/core/index.cjs
CHANGED
|
@@ -5479,6 +5479,7 @@ __export(exports_core, {
|
|
|
5479
5479
|
scrollToWidget: () => scrollToWidget,
|
|
5480
5480
|
remoraidAppShellLayoutId: () => remoraidAppShellLayoutId,
|
|
5481
5481
|
isValidElementOfType: () => isValidElementOfType,
|
|
5482
|
+
isIcon: () => isIcon,
|
|
5482
5483
|
getElementTypeName: () => getElementTypeName,
|
|
5483
5484
|
getDefaultWidgetContext: () => getDefaultWidgetContext,
|
|
5484
5485
|
getDefaultNavigationElements: () => getDefaultNavigationElements,
|
|
@@ -5855,6 +5856,13 @@ var scrollToWidget = (widgetId) => {
|
|
|
5855
5856
|
block: "start"
|
|
5856
5857
|
});
|
|
5857
5858
|
};
|
|
5859
|
+
var isIcon = (value) => {
|
|
5860
|
+
if (typeof value !== "object" || value === null) {
|
|
5861
|
+
return false;
|
|
5862
|
+
}
|
|
5863
|
+
const candidate = value;
|
|
5864
|
+
return "render" in candidate && typeof candidate.render === "function";
|
|
5865
|
+
};
|
|
5858
5866
|
|
|
5859
5867
|
// src/core/components/RemoraidProvider/ThemeProvider/index.tsx
|
|
5860
5868
|
var import_core2 = require("@mantine/core");
|
|
@@ -6181,8 +6189,9 @@ function AppProvider({
|
|
|
6181
6189
|
appContext: appContextProp,
|
|
6182
6190
|
children
|
|
6183
6191
|
}) {
|
|
6192
|
+
const { logo, ...appContextPropWithoutLogo } = appContextProp;
|
|
6184
6193
|
return /* @__PURE__ */ jsx_runtime8.jsx(appContext.Provider, {
|
|
6185
|
-
value: import_lodash4.merge(defaultAppContext,
|
|
6194
|
+
value: { ...import_lodash4.merge(defaultAppContext, appContextPropWithoutLogo), logo },
|
|
6186
6195
|
children
|
|
6187
6196
|
});
|
|
6188
6197
|
}
|
|
@@ -6191,7 +6200,7 @@ function AppProvider({
|
|
|
6191
6200
|
var import_lodash13 = __toESM(require_lodash());
|
|
6192
6201
|
|
|
6193
6202
|
// src/core/components/AppShell/AppShellUserExperienceProvider/index.tsx
|
|
6194
|
-
var
|
|
6203
|
+
var import_react17 = require("react");
|
|
6195
6204
|
var import_lodash12 = __toESM(require_lodash());
|
|
6196
6205
|
|
|
6197
6206
|
// src/core/components/AppShell/Footer/FooterMinimal/index.tsx
|
|
@@ -6521,9 +6530,10 @@ var Footer_default = Object.assign(Footer, {
|
|
|
6521
6530
|
});
|
|
6522
6531
|
|
|
6523
6532
|
// src/core/components/AppShell/Navbar/NavbarMinimal/index.tsx
|
|
6524
|
-
var
|
|
6533
|
+
var import_react16 = require("react");
|
|
6525
6534
|
|
|
6526
6535
|
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6536
|
+
var import_react13 = require("react");
|
|
6527
6537
|
var import_core9 = require("@mantine/core");
|
|
6528
6538
|
var import_navigation2 = require("next/navigation");
|
|
6529
6539
|
var import_lodash8 = __toESM(require_lodash());
|
|
@@ -6685,6 +6695,7 @@ function RemoraidButton({
|
|
|
6685
6695
|
}
|
|
6686
6696
|
|
|
6687
6697
|
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6698
|
+
var import_image = __toESM(require("next/image"));
|
|
6688
6699
|
var jsx_runtime16 = require("react/jsx-runtime");
|
|
6689
6700
|
function NavbarMinimalContent({
|
|
6690
6701
|
orientation,
|
|
@@ -6722,10 +6733,14 @@ function NavbarMinimalContent({
|
|
|
6722
6733
|
const logoButton = app.logo ? /* @__PURE__ */ jsx_runtime16.jsx(RemoraidButton, {
|
|
6723
6734
|
label: app.name,
|
|
6724
6735
|
variant: "subtle",
|
|
6725
|
-
icon: app.logo({
|
|
6736
|
+
icon: import_react13.isValidElement(app.logo) || isIcon(app.logo) ? app.logo : /* @__PURE__ */ jsx_runtime16.jsx(import_image.default, {
|
|
6737
|
+
src: app.logo,
|
|
6738
|
+
alt: "App logo",
|
|
6739
|
+
...componentsProps?.logo,
|
|
6726
6740
|
style: {
|
|
6727
6741
|
width: theme.componentsProps.icons[logoIconSize].size,
|
|
6728
|
-
height: theme.componentsProps.icons[logoIconSize].size
|
|
6742
|
+
height: theme.componentsProps.icons[logoIconSize].size,
|
|
6743
|
+
...componentsProps?.logo?.style
|
|
6729
6744
|
}
|
|
6730
6745
|
}),
|
|
6731
6746
|
responsive: buttonResponsive,
|
|
@@ -6789,7 +6804,7 @@ function NavbarMinimalContent({
|
|
|
6789
6804
|
const buttons = elements.filter((element) => !element.static).sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0)).slice(0, maxElements).map((element, i) => button(element, `nav-element-${i}`));
|
|
6790
6805
|
const staticElements = elements.filter((element) => element.static);
|
|
6791
6806
|
const staticButtons = staticElements.sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0)).map((element, i) => button(element, `static-nav-element-${i}`));
|
|
6792
|
-
const collapseStaticElements = staticElements.length > 1;
|
|
6807
|
+
const collapseStaticElements = staticElements.filter((element) => element.mounted ?? true).length > 1;
|
|
6793
6808
|
const staticMenuButton = collapseStaticElements ? /* @__PURE__ */ jsx_runtime16.jsx(import_core9.Box, {
|
|
6794
6809
|
hiddenFrom: collapseStaticElementsBreakpoint,
|
|
6795
6810
|
children: /* @__PURE__ */ jsx_runtime16.jsx(NavigationMenu, {
|
|
@@ -6864,7 +6879,7 @@ function NavbarMinimalContent({
|
|
|
6864
6879
|
var import_lodash11 = __toESM(require_lodash());
|
|
6865
6880
|
|
|
6866
6881
|
// src/core/components/Pinnable/index.tsx
|
|
6867
|
-
var
|
|
6882
|
+
var import_react15 = require("react");
|
|
6868
6883
|
var import_icons_react7 = require("@tabler/icons-react");
|
|
6869
6884
|
var import_core12 = require("@mantine/core");
|
|
6870
6885
|
|
|
@@ -6915,7 +6930,7 @@ function ControlButton({
|
|
|
6915
6930
|
}
|
|
6916
6931
|
|
|
6917
6932
|
// src/core/components/Controls/index.tsx
|
|
6918
|
-
var
|
|
6933
|
+
var import_react14 = require("react");
|
|
6919
6934
|
var import_core11 = require("@mantine/core");
|
|
6920
6935
|
var import_icons_react6 = require("@tabler/icons-react");
|
|
6921
6936
|
var import_lodash10 = __toESM(require_lodash());
|
|
@@ -6933,12 +6948,12 @@ function Controls({
|
|
|
6933
6948
|
const additionalButtons = additionalButtonsProp?.map((additionalButton) => asElementOrPropsOfType(ControlButton, additionalButton, "Check the 'additionalButtons' property of 'Controls'."));
|
|
6934
6949
|
const children = asChildrenOfType(ControlButton, childrenProp, "Check children passed to 'Controls' component.");
|
|
6935
6950
|
const theme = useRemoraidTheme();
|
|
6936
|
-
const [pos, setPos] =
|
|
6951
|
+
const [pos, setPos] = import_react14.useState({
|
|
6937
6952
|
x: 0,
|
|
6938
6953
|
y: 0
|
|
6939
6954
|
});
|
|
6940
|
-
const offsetRef =
|
|
6941
|
-
const containerRef =
|
|
6955
|
+
const offsetRef = import_react14.useRef({ x: 0, y: 0 });
|
|
6956
|
+
const containerRef = import_react14.useRef(null);
|
|
6942
6957
|
const clamp = (v, min, max) => {
|
|
6943
6958
|
return Math.min(Math.max(v, min), max);
|
|
6944
6959
|
};
|
|
@@ -7040,13 +7055,13 @@ function Pinnable({
|
|
|
7040
7055
|
}) {
|
|
7041
7056
|
const layoutType = layoutTypeProp ?? "frame" /* Frame */;
|
|
7042
7057
|
const { layouts } = useLayouts();
|
|
7043
|
-
const [pinned, setPinned] =
|
|
7044
|
-
const containerRef =
|
|
7058
|
+
const [pinned, setPinned] = import_react15.useState(initialValue);
|
|
7059
|
+
const containerRef = import_react15.useRef(null);
|
|
7045
7060
|
const layout = layouts[layoutId ?? remoraidAppShellLayoutId];
|
|
7046
7061
|
if (layout && layout.type !== layoutType) {
|
|
7047
7062
|
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.`);
|
|
7048
7063
|
}
|
|
7049
|
-
const controlButton =
|
|
7064
|
+
const controlButton = import_react15.useMemo(() => /* @__PURE__ */ jsx_runtime19.jsx(ControlButton, {
|
|
7050
7065
|
icon: pinned ? import_icons_react7.IconPinnedOff : import_icons_react7.IconPin,
|
|
7051
7066
|
tooltip: pinned ? "Unpin" : "Pin",
|
|
7052
7067
|
color: "green",
|
|
@@ -7076,7 +7091,7 @@ function Pinnable({
|
|
|
7076
7091
|
children
|
|
7077
7092
|
]
|
|
7078
7093
|
});
|
|
7079
|
-
|
|
7094
|
+
import_react15.useEffect(() => {
|
|
7080
7095
|
onPinnedValueChange?.(pinned);
|
|
7081
7096
|
}, [pinned]);
|
|
7082
7097
|
if (!layout) {
|
|
@@ -7105,7 +7120,7 @@ function NavbarMinimal({
|
|
|
7105
7120
|
navbar: { position }
|
|
7106
7121
|
}
|
|
7107
7122
|
} = useAppShellUserExperience();
|
|
7108
|
-
const [hover, setHover] =
|
|
7123
|
+
const [hover, setHover] = import_react16.useState(false);
|
|
7109
7124
|
const handleEnter = () => {
|
|
7110
7125
|
setHover(true);
|
|
7111
7126
|
};
|
|
@@ -7277,7 +7292,7 @@ var defaultAppShellUserExperience = {
|
|
|
7277
7292
|
var defaultAppShellUserExperienceCookieName = "remoraid-app-shell-user-experience";
|
|
7278
7293
|
var appShellUserExperienceContext = createUserExperienceContext(defaultAppShellUserExperience);
|
|
7279
7294
|
var useAppShellUserExperience = () => {
|
|
7280
|
-
return
|
|
7295
|
+
return import_react17.useContext(appShellUserExperienceContext);
|
|
7281
7296
|
};
|
|
7282
7297
|
function AppShellUserExperienceProvider({
|
|
7283
7298
|
children,
|
|
@@ -7364,12 +7379,12 @@ var import_core16 = require("@mantine/core");
|
|
|
7364
7379
|
|
|
7365
7380
|
// src/core/components/Page/index.tsx
|
|
7366
7381
|
var import_core14 = require("@mantine/core");
|
|
7367
|
-
var
|
|
7382
|
+
var import_react18 = __toESM(require("react"));
|
|
7368
7383
|
var import_navigation3 = require("next/navigation");
|
|
7369
7384
|
var jsx_runtime24 = require("react/jsx-runtime");
|
|
7370
|
-
var pageContext =
|
|
7385
|
+
var pageContext = import_react18.default.createContext(null);
|
|
7371
7386
|
var usePage = () => {
|
|
7372
|
-
return
|
|
7387
|
+
return import_react18.useContext(pageContext);
|
|
7373
7388
|
};
|
|
7374
7389
|
function Page({
|
|
7375
7390
|
children,
|
|
@@ -7382,7 +7397,7 @@ function Page({
|
|
|
7382
7397
|
const pathname = import_navigation3.usePathname();
|
|
7383
7398
|
const { isPageRegistered, registerPage } = useWidgets();
|
|
7384
7399
|
const pageId = config?.pageId ?? pathname;
|
|
7385
|
-
|
|
7400
|
+
import_react18.useEffect(() => {
|
|
7386
7401
|
if (!isPageRegistered(pageId)) {
|
|
7387
7402
|
if (config?.registerPageDirectly) {
|
|
7388
7403
|
registerPage(pageId, []);
|
|
@@ -7405,7 +7420,7 @@ function Page({
|
|
|
7405
7420
|
|
|
7406
7421
|
// src/core/components/WidgetSelectionHeader/index.tsx
|
|
7407
7422
|
var import_icons_react9 = require("@tabler/icons-react");
|
|
7408
|
-
var
|
|
7423
|
+
var import_react19 = require("react");
|
|
7409
7424
|
|
|
7410
7425
|
// src/core/components/ScrollableChipGroup/index.tsx
|
|
7411
7426
|
var import_core15 = require("@mantine/core");
|
|
@@ -7461,15 +7476,15 @@ function WidgetSelectionHeader({
|
|
|
7461
7476
|
if (!page) {
|
|
7462
7477
|
throw new InvalidComponentUsageError("WidgetSelectionHeader", "must be used as child of 'Page'.");
|
|
7463
7478
|
}
|
|
7464
|
-
const [hover, setHover] =
|
|
7465
|
-
const [isPinned, setIsPinned] =
|
|
7479
|
+
const [hover, setHover] = import_react19.useState(false);
|
|
7480
|
+
const [isPinned, setIsPinned] = import_react19.useState(initiallyPinned);
|
|
7466
7481
|
const handleEnter = () => {
|
|
7467
7482
|
setHover(true);
|
|
7468
7483
|
};
|
|
7469
7484
|
const handleLeave = () => {
|
|
7470
7485
|
setHover(false);
|
|
7471
7486
|
};
|
|
7472
|
-
const scrollAreaRef =
|
|
7487
|
+
const scrollAreaRef = import_react19.useRef(null);
|
|
7473
7488
|
const widgets = widgetsContext2.widgets[page.pageId] ?? {};
|
|
7474
7489
|
const selectedWidgets = Object.entries(widgets).reduce((t, [widgetId, widget]) => widget?.selected ? [...t, widgetId] : t, []);
|
|
7475
7490
|
const element = /* @__PURE__ */ jsx_runtime26.jsxs(import_core16.Flex, {
|
|
@@ -7485,7 +7500,7 @@ function WidgetSelectionHeader({
|
|
|
7485
7500
|
},
|
|
7486
7501
|
onMouseLeave: (e) => {
|
|
7487
7502
|
if (!pinnableSection) {
|
|
7488
|
-
|
|
7503
|
+
handleLeave();
|
|
7489
7504
|
}
|
|
7490
7505
|
componentsProps?.container?.onMouseEnter?.(e);
|
|
7491
7506
|
},
|
|
@@ -7570,7 +7585,7 @@ function WidgetSelectionHeader({
|
|
|
7570
7585
|
})
|
|
7571
7586
|
]
|
|
7572
7587
|
});
|
|
7573
|
-
|
|
7588
|
+
import_react19.useEffect(() => {
|
|
7574
7589
|
if (!activeWidget) {
|
|
7575
7590
|
return;
|
|
7576
7591
|
}
|
|
@@ -7633,7 +7648,7 @@ function WidgetSelectionHeader({
|
|
|
7633
7648
|
}
|
|
7634
7649
|
// src/core/components/BadgeGroup/index.tsx
|
|
7635
7650
|
var import_core18 = require("@mantine/core");
|
|
7636
|
-
var
|
|
7651
|
+
var import_react20 = __toESM(require("react"));
|
|
7637
7652
|
|
|
7638
7653
|
// src/core/components/BadgeMinimal/index.tsx
|
|
7639
7654
|
var import_core17 = require("@mantine/core");
|
|
@@ -7785,7 +7800,7 @@ function AlertMinimal({
|
|
|
7785
7800
|
}
|
|
7786
7801
|
// src/core/components/Widget/WidgetWrapper/index.tsx
|
|
7787
7802
|
var import_core20 = require("@mantine/core");
|
|
7788
|
-
var
|
|
7803
|
+
var import_react21 = require("react");
|
|
7789
7804
|
var import_icons_react10 = require("@tabler/icons-react");
|
|
7790
7805
|
var import_lodash17 = __toESM(require_lodash());
|
|
7791
7806
|
var jsx_runtime30 = require("react/jsx-runtime");
|
|
@@ -7809,11 +7824,11 @@ function WidgetWrapper({
|
|
|
7809
7824
|
} = useWidgets();
|
|
7810
7825
|
const page = usePage();
|
|
7811
7826
|
const theme = useRemoraidTheme();
|
|
7812
|
-
const [controlsContainer, setControlsContainer] =
|
|
7827
|
+
const [controlsContainer, setControlsContainer] = import_react21.useState(null);
|
|
7813
7828
|
const widget = page ? widgets[page.pageId]?.[config.widgetId] : undefined;
|
|
7814
7829
|
const pageRegistered = page ? isPageRegistered(page.pageId) : false;
|
|
7815
|
-
const containerRef =
|
|
7816
|
-
const controlsContainerRef =
|
|
7830
|
+
const containerRef = import_react21.useRef(null);
|
|
7831
|
+
const controlsContainerRef = import_react21.useCallback((n) => {
|
|
7817
7832
|
setControlsContainer(n);
|
|
7818
7833
|
}, [setControlsContainer]);
|
|
7819
7834
|
const handleEnter = () => {
|
|
@@ -7919,7 +7934,7 @@ function WidgetWrapper({
|
|
|
7919
7934
|
children: element
|
|
7920
7935
|
});
|
|
7921
7936
|
}
|
|
7922
|
-
|
|
7937
|
+
import_react21.useEffect(() => {
|
|
7923
7938
|
if (!page) {
|
|
7924
7939
|
return;
|
|
7925
7940
|
}
|
|
@@ -7931,7 +7946,7 @@ function WidgetWrapper({
|
|
|
7931
7946
|
}
|
|
7932
7947
|
// src/core/components/Widget/index.tsx
|
|
7933
7948
|
var import_core21 = require("@mantine/core");
|
|
7934
|
-
var
|
|
7949
|
+
var import_react22 = require("react");
|
|
7935
7950
|
var import_lodash18 = __toESM(require_lodash());
|
|
7936
7951
|
var jsx_runtime31 = require("react/jsx-runtime");
|
|
7937
7952
|
var react2 = require("react");
|
|
@@ -8045,7 +8060,7 @@ function Widget({
|
|
|
8045
8060
|
});
|
|
8046
8061
|
})
|
|
8047
8062
|
}),
|
|
8048
|
-
(loading ||
|
|
8063
|
+
(loading || import_react22.Children.toArray(children).length > 0) && /* @__PURE__ */ jsx_runtime31.jsx(import_core21.ScrollArea.Autosize, {
|
|
8049
8064
|
flex: 1,
|
|
8050
8065
|
...componentsProps?.childrenContainer,
|
|
8051
8066
|
className: clsx_default("remoraid-widget-children-container", componentsProps?.childrenContainer?.className),
|
|
@@ -8124,7 +8139,7 @@ function EnvironmentShell({
|
|
|
8124
8139
|
return null;
|
|
8125
8140
|
}
|
|
8126
8141
|
// src/core/components/SettingsWidget/index.tsx
|
|
8127
|
-
var
|
|
8142
|
+
var import_react23 = require("react");
|
|
8128
8143
|
var import_icons_react12 = require("@tabler/icons-react");
|
|
8129
8144
|
|
|
8130
8145
|
// src/core/components/SettingsWidget/SaveButton/index.tsx
|
|
@@ -8166,9 +8181,9 @@ function SaveButton({
|
|
|
8166
8181
|
// src/core/components/SettingsWidget/index.tsx
|
|
8167
8182
|
var jsx_runtime35 = require("react/jsx-runtime");
|
|
8168
8183
|
var defaultSettingsWidgetContext = {};
|
|
8169
|
-
var settingsWidgetContext =
|
|
8184
|
+
var settingsWidgetContext = import_react23.createContext(defaultSettingsWidgetContext);
|
|
8170
8185
|
var useSettingsWidgetContext = () => {
|
|
8171
|
-
return
|
|
8186
|
+
return import_react23.useContext(settingsWidgetContext);
|
|
8172
8187
|
};
|
|
8173
8188
|
function SettingsWidget({
|
|
8174
8189
|
children,
|
|
@@ -8214,7 +8229,7 @@ var SettingsWidget_default = Object.assign(SettingsWidget, {
|
|
|
8214
8229
|
SaveButton
|
|
8215
8230
|
});
|
|
8216
8231
|
// src/core/components/SettingsWidget/SettingsTable/index.tsx
|
|
8217
|
-
var
|
|
8232
|
+
var import_react24 = require("react");
|
|
8218
8233
|
var import_core24 = require("@mantine/core");
|
|
8219
8234
|
|
|
8220
8235
|
// src/core/components/SettingsWidget/SettingsTable/Row/index.tsx
|
|
@@ -8247,9 +8262,9 @@ var jsx_runtime37 = require("react/jsx-runtime");
|
|
|
8247
8262
|
var defaultSettingsTableOptions = {
|
|
8248
8263
|
leftColumnWidth: "38.2%"
|
|
8249
8264
|
};
|
|
8250
|
-
var settingsTableOptionsContext =
|
|
8265
|
+
var settingsTableOptionsContext = import_react24.createContext(defaultSettingsTableOptions);
|
|
8251
8266
|
var useSettingsTableOptions = () => {
|
|
8252
|
-
return
|
|
8267
|
+
return import_react24.useContext(settingsTableOptionsContext);
|
|
8253
8268
|
};
|
|
8254
8269
|
function SettingsTable({
|
|
8255
8270
|
leftColumnWidth,
|
|
@@ -8440,7 +8455,7 @@ function FooterSettingsWidget({
|
|
|
8440
8455
|
});
|
|
8441
8456
|
}
|
|
8442
8457
|
// src/core/components/ContextClusterProvider/index.tsx
|
|
8443
|
-
var
|
|
8458
|
+
var import_react25 = __toESM(require("react"));
|
|
8444
8459
|
var jsx_runtime40 = require("react/jsx-runtime");
|
|
8445
8460
|
var createContextCluster = (generalDefaultValue, staticIds) => {
|
|
8446
8461
|
const isStaticId = (id) => {
|
|
@@ -8452,16 +8467,16 @@ var createContextCluster = (generalDefaultValue, staticIds) => {
|
|
|
8452
8467
|
const contexts = {};
|
|
8453
8468
|
const defaultValues = {};
|
|
8454
8469
|
const createContext9 = (id, defaultValue) => {
|
|
8455
|
-
const context =
|
|
8470
|
+
const context = import_react25.default.createContext(defaultValue ?? generalDefaultValue);
|
|
8456
8471
|
contexts[id] = context;
|
|
8457
8472
|
defaultValues[id] = defaultValue ?? generalDefaultValue;
|
|
8458
8473
|
return context;
|
|
8459
8474
|
};
|
|
8460
8475
|
const useContext13 = (id) => {
|
|
8461
8476
|
if (isStaticId(id)) {
|
|
8462
|
-
return contexts[id] ?
|
|
8477
|
+
return contexts[id] ? import_react25.default.useContext(contexts[id]) : generalDefaultValue;
|
|
8463
8478
|
}
|
|
8464
|
-
return contexts[id] ?
|
|
8479
|
+
return contexts[id] ? import_react25.default.useContext(contexts[id]) : null;
|
|
8465
8480
|
};
|
|
8466
8481
|
return {
|
|
8467
8482
|
contexts,
|
|
@@ -8483,7 +8498,7 @@ function ContextClusterProvider({
|
|
|
8483
8498
|
}
|
|
8484
8499
|
// src/core/components/InputWrapperScrollArea/index.tsx
|
|
8485
8500
|
var import_core27 = require("@mantine/core");
|
|
8486
|
-
var
|
|
8501
|
+
var import_react26 = require("react");
|
|
8487
8502
|
var jsx_runtime41 = require("react/jsx-runtime");
|
|
8488
8503
|
function InputWrapperScrollArea({
|
|
8489
8504
|
children,
|
|
@@ -8495,7 +8510,7 @@ function InputWrapperScrollArea({
|
|
|
8495
8510
|
componentsProps
|
|
8496
8511
|
}) {
|
|
8497
8512
|
const theme = useRemoraidTheme();
|
|
8498
|
-
const [isHovering, setIsHovering] =
|
|
8513
|
+
const [isHovering, setIsHovering] = import_react26.useState(false);
|
|
8499
8514
|
return /* @__PURE__ */ jsx_runtime41.jsx(import_core27.Input.Wrapper, {
|
|
8500
8515
|
label,
|
|
8501
8516
|
error,
|
package/dist/core/index.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ interface StaticRemoraidAppContext {
|
|
|
73
73
|
navbarVariant: AppShellNavbarVariant;
|
|
74
74
|
navbarMobileVariant: AppShellNavbarMobileVariant;
|
|
75
75
|
footerVariant: AppShellFooterVariant;
|
|
76
|
-
logo?:
|
|
76
|
+
logo?: Icon2 | ImageProps["src"] | ReactElement;
|
|
77
77
|
auth?: RemoraidAuthContext;
|
|
78
78
|
}
|
|
79
79
|
type CustomAppVariables = { [K in Exclude<string, keyof StaticRemoraidAppContext>] : any };
|
|
@@ -286,11 +286,11 @@ declare function RemoraidProvider({ children, theme, initialUserExperience, comp
|
|
|
286
286
|
import { BoxProps as BoxProps2 } from "@mantine/core";
|
|
287
287
|
import { ComponentProps as ComponentProps7, PropsWithChildren as PropsWithChildren12, ReactNode as ReactNode21 } from "react";
|
|
288
288
|
import { PropsWithChildren as PropsWithChildren7, ReactNode as ReactNode7 } from "react";
|
|
289
|
-
import {
|
|
289
|
+
import { SetOptional } from "type-fest";
|
|
290
290
|
declare const defaultAppContext: RemoraidAppContext<CustomAppVariables>;
|
|
291
291
|
declare const useRemoraidApp: () => RemoraidAppContext<CustomAppVariables>;
|
|
292
292
|
interface AppProviderProps<V extends CustomAppVariables> {
|
|
293
|
-
appContext:
|
|
293
|
+
appContext: SetOptional<RemoraidAppContext<V>, "navbarVariant" | "footerVariant" | "navbarMobileVariant">;
|
|
294
294
|
}
|
|
295
295
|
declare function AppProvider2<V extends CustomAppVariables>({ appContext: appContextProp, children }: PropsWithChildren7<AppProviderProps<V>>): ReactNode7;
|
|
296
296
|
import { ComponentProps as ComponentProps4, ReactNode as ReactNode17 } from "react";
|
|
@@ -308,10 +308,11 @@ interface NavigationMenuProps {
|
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
310
|
import { ActionIconProps, ActionIconVariant, ButtonProps, ButtonVariant, MantineBreakpoint as MantineBreakpoint2, MantineColor, MantineSize as MantineSize3, TooltipProps, TransitionProps as TransitionProps3 } from "@mantine/core";
|
|
311
|
-
import { Icon as
|
|
311
|
+
import { Icon as Icon4, IconProps as IconProps3 } from "@tabler/icons-react";
|
|
312
312
|
import { MouseEventHandler as MouseEventHandler2, ReactElement as ReactElement4, ReactNode as ReactNode9 } from "react";
|
|
313
313
|
import { MantineSize as MantineSize2 } from "@mantine/core";
|
|
314
314
|
import { ComponentProps, ElementType, ReactElement as ReactElement3 } from "react";
|
|
315
|
+
import { Icon as Icon3 } from "@tabler/icons-react";
|
|
315
316
|
declare const co: <T>(condition: (value: T) => boolean, value: T, fallback: T) => T;
|
|
316
317
|
type Common<
|
|
317
318
|
A,
|
|
@@ -352,6 +353,7 @@ declare const asElementOrPropsOfType: <
|
|
|
352
353
|
>(type: T, elementOrProps: ReactElement3 | P, additionalErrorMessage?: string) => ElementOrPropsOfType<T, P>;
|
|
353
354
|
declare const getDefaultButtonIconSize: (buttonSize: MantineSize2) => RemoraidIconSize;
|
|
354
355
|
declare const scrollToWidget: (widgetId: string) => void;
|
|
356
|
+
declare const isIcon: (value: unknown) => value is Icon3;
|
|
355
357
|
type RemoraidButtonDefaultResponsivity = true;
|
|
356
358
|
interface ExplicitRemoraidButtonProps<Responsive extends boolean> {
|
|
357
359
|
responsive: Responsive;
|
|
@@ -360,7 +362,7 @@ interface ExplicitRemoraidButtonProps<Responsive extends boolean> {
|
|
|
360
362
|
color?: MantineColor;
|
|
361
363
|
breakpoint?: true extends Responsive ? MantineBreakpoint2 : never;
|
|
362
364
|
collapsed?: false extends Responsive ? boolean : never;
|
|
363
|
-
icon?:
|
|
365
|
+
icon?: Icon4 | ReactElement4;
|
|
364
366
|
iconSize?: RemoraidIconSize;
|
|
365
367
|
onClick?: MouseEventHandler2;
|
|
366
368
|
loading?: boolean;
|
|
@@ -378,6 +380,7 @@ interface ExplicitRemoraidButtonProps<Responsive extends boolean> {
|
|
|
378
380
|
}
|
|
379
381
|
type RemoraidButtonProps<Responsive extends boolean = RemoraidButtonDefaultResponsivity> = OptionalIfExtends<ExplicitRemoraidButtonProps<Responsive>, "responsive", true, Responsive>;
|
|
380
382
|
declare function RemoraidButton<Responsive extends boolean = RemoraidButtonDefaultResponsivity>({ label, responsive: responsiveProp, breakpoint: breakpointProp, collapsed: collapsedProp, size, color, onClick, loading, variant, mounted, icon: iconProp, iconSize: iconSizeProp, clickTransformation, componentsProps }: RemoraidButtonProps<Responsive>): ReactNode9;
|
|
383
|
+
import { ImageProps as ImageProps2 } from "next/image";
|
|
381
384
|
interface NavbarMinimalContentProps {
|
|
382
385
|
orientation: NavbarOrientation;
|
|
383
386
|
maxElements?: number;
|
|
@@ -386,6 +389,7 @@ interface NavbarMinimalContentProps {
|
|
|
386
389
|
container?: Partial<PaperProps>
|
|
387
390
|
button?: Partial<RemoraidButtonProps<true>> | Partial<RemoraidButtonProps<false>>
|
|
388
391
|
logoButton?: Partial<RemoraidButtonProps<true>> | Partial<RemoraidButtonProps<false>>
|
|
392
|
+
logo?: Partial<ImageProps2>
|
|
389
393
|
NavigationMenu?: Partial<NavigationMenuProps>
|
|
390
394
|
};
|
|
391
395
|
}
|
|
@@ -417,10 +421,10 @@ declare function Element2({ section, includeContainer, includePageContainer, lay
|
|
|
417
421
|
import { ComponentProps as ComponentProps3, PropsWithChildren as PropsWithChildren10, ReactNode as ReactNode15 } from "react";
|
|
418
422
|
import { Box } from "@mantine/core";
|
|
419
423
|
import { ActionIcon as ActionIcon2, ActionIconProps as ActionIconProps2, TooltipProps as TooltipProps2, TransitionProps as TransitionProps4 } from "@mantine/core";
|
|
420
|
-
import { Icon as
|
|
424
|
+
import { Icon as Icon5, IconProps as IconProps4 } from "@tabler/icons-react";
|
|
421
425
|
import { ComponentProps as ComponentProps2, ReactNode as ReactNode13 } from "react";
|
|
422
426
|
interface ControlButtonProps {
|
|
423
|
-
icon:
|
|
427
|
+
icon: Icon5;
|
|
424
428
|
mounted?: boolean;
|
|
425
429
|
tooltip?: string;
|
|
426
430
|
size?: ActionIconProps2["size"];
|
|
@@ -435,7 +439,7 @@ interface ControlButtonProps {
|
|
|
435
439
|
icon?: Partial<IconProps4>
|
|
436
440
|
};
|
|
437
441
|
}
|
|
438
|
-
declare function ControlButton({ icon:
|
|
442
|
+
declare function ControlButton({ icon: Icon5, mounted, size, iconSize, onClick, order, color, tooltip, componentsProps }: ControlButtonProps): ReactNode13;
|
|
439
443
|
import { ReactNode as ReactNode14, Ref, RefObject } from "react";
|
|
440
444
|
import { GroupProps, MantineSize as MantineSize5, PaperProps as PaperProps2, TransitionProps as TransitionProps5 } from "@mantine/core";
|
|
441
445
|
import { IconProps as IconProps5 } from "@tabler/icons-react";
|
|
@@ -496,17 +500,17 @@ interface Navbar extends React.FC<ComponentProps4<typeof Navbar>> {
|
|
|
496
500
|
}
|
|
497
501
|
declare const _default: Navbar;
|
|
498
502
|
import { ComponentProps as ComponentProps5, ReactNode as ReactNode19 } from "react";
|
|
499
|
-
import { Icon as
|
|
503
|
+
import { Icon as Icon6, IconProps as IconProps6 } from "@tabler/icons-react";
|
|
500
504
|
import { ReactNode as ReactNode18 } from "react";
|
|
501
505
|
interface FooterMinimalProps {
|
|
502
|
-
icon?:
|
|
506
|
+
icon?: Icon6;
|
|
503
507
|
componentsProps?: {
|
|
504
508
|
layoutElement?: Partial<FrameLayoutElementProps>
|
|
505
509
|
container?: Partial<PageContainerProps>
|
|
506
510
|
icon?: Partial<IconProps6>
|
|
507
511
|
};
|
|
508
512
|
}
|
|
509
|
-
declare function FooterMinimal({ icon:
|
|
513
|
+
declare function FooterMinimal({ icon: Icon6, componentsProps }: FooterMinimalProps): ReactNode18;
|
|
510
514
|
declare const supportedFooterPositions: Record<Exclude<AppShellFooterVariant, null>, FooterPosition[]>;
|
|
511
515
|
declare const defaultFooterPositions: Record<Exclude<AppShellFooterVariant, null>, FooterPosition>;
|
|
512
516
|
interface FooterProps {
|
|
@@ -821,4 +825,4 @@ interface InputWrapperScrollAreaProps {
|
|
|
821
825
|
};
|
|
822
826
|
}
|
|
823
827
|
declare function InputWrapperScrollArea({ children, label, mah, description, error, required, componentsProps }: PropsWithChildren25<InputWrapperScrollAreaProps>): ReactNode41;
|
|
824
|
-
export { useWidgets, useWidget, useSettingsWidgetContext as useSettingsWidgetOptions, useSettingsTableOptions, useRemoraidUserExperience, useRemoraidTheme, useRemoraidApp, usePage, useLayouts, useHydrationStatus, useHydratedMantineColorScheme, useFrameLayoutElement, useFrameLayout, useAppShellUserExperience, supportedNavbarPositions, supportedFooterPositions, scrollToWidget, remoraidAppShellLayoutId, isValidElementOfType, getElementTypeName, getDefaultWidgetContext, getDefaultNavigationElements, getDefaultButtonIconSize, getCssVars, defaultUserExperienceCookieName, defaultUserExperience, defaultTransitionDurations, defaultSettingsWidgetContext as defaultSettingsWidgetOptions, defaultSettingsTableOptions, defaultNavbarSettingsWidgetId, defaultNavbarPositions, defaultLayoutsContext, defaultFooterSettingsWidgetId, defaultFooterPositions, defaultAppShellUserExperienceCookieName, defaultAppShellUserExperience, defaultAppContext, createUserExperienceContext, createRemoraidTheme, createContextCluster, co, asElementOrPropsOfType, asElementOfType, asChildrenOfType, WidgetsProviderProps, WidgetsContext, WidgetWrapperProps, WidgetWrapper, WidgetSelectionHeaderProps, WidgetSelectionHeader, WidgetProps, WidgetContext, WidgetConfiguration, Widget, UserExperienceProviderWrapperProps, UserExperienceProviderWrapper, UserExperienceProviderProps, UserExperienceContext, UserExperience, TransitionDuration, ThemeProviderProps, StaticRemoraidAppContext, SettingsWidgetSaveButtonProps, SettingsWidgetProps, SettingsWidgetContext, _default5 as SettingsWidget, SettingsTableRowProps, SettingsTableOptions, _default6 as SettingsTable, ScrollableChipGroupProps, ScrollableChipGroup2 as ScrollableChipGroup, RemoraidUser, RemoraidThemeDependencies, RemoraidThemeCallback, RemoraidTheme, RemoraidProviderProps, RemoraidProvider, RemoraidIconSize, RemoraidButtonProps, RemoraidButtonDefaultResponsivity, RemoraidButton, RemoraidBreakpoint, RemoraidAuthContext, RemoraidAppContext, PropsWithChildrenOfType, PrimitiveUserExperience, PinnableProps, PinnableDefaultLayoutType, Pinnable2 as Pinnable, PageProps, PageContainerProps, PageContainer2 as PageContainer, PageConfiguration, Page, OptionalIfExtends, Optional, NotFoundPageProps, NotFoundPage, NavigationMenuProps, NavigationElementType, NavigationElementButton, NavigationElementBase, NavigationElementAnchor, NavigationElement, NavbarVariant, NavbarSettingsWidgetProps, NavbarSettingsWidget, NavbarProps, NavbarPosition, NavbarOrientation, NavbarMode, NavbarMobileVariant, NavbarMobilePosition, NavbarMinimalProps, NavbarMinimalContentProps, _default as Navbar, LayoutsProviderProps, LayoutsContext, LayoutType, LayoutSection, LayoutElementContext, LayoutContext, InputWrapperScrollAreaProps, InputWrapperScrollArea, HydrationStatusProviderProps, HydrationStatusProvider, HydrationStatus, FrameLayoutSection, FrameLayoutProps, FrameLayoutElementProps, _default3 as FrameLayout, FooterVariant, FooterSettingsWidgetProps, FooterSettingsWidget, FooterProps, FooterPosition, FooterMinimalProps, _default2 as Footer, EnvironmentShellVariant, EnvironmentShellProps, EnvironmentShell, ElementOrPropsOfType, ElementOfType, DefaultNavigationElementsDependencies, CustomAppVariables, CoreUserExperience, ControlsProps, Controls, ControlButtonProps, ControlButton, ContextClusterProviderProps, ContextClusterProvider, ContextCluster, Common, ClickTransformation, ChildrenOfType, BadgeMinimalProps, BadgeMinimal, BadgeGroupProps, BadgeGroup, AppShellUserExperience, AppShellProps, AppShellNavbarVariant, AppShellNavbarMobileVariant, AppShellFooterVariant, _default4 as AppShell, AppProviderProps, AppProvider2 as AppProvider, AppLogo, AlertMinimalProps, AlertMinimal, AlertCategory };
|
|
828
|
+
export { useWidgets, useWidget, useSettingsWidgetContext as useSettingsWidgetOptions, useSettingsTableOptions, useRemoraidUserExperience, useRemoraidTheme, useRemoraidApp, usePage, useLayouts, useHydrationStatus, useHydratedMantineColorScheme, useFrameLayoutElement, useFrameLayout, useAppShellUserExperience, supportedNavbarPositions, supportedFooterPositions, scrollToWidget, remoraidAppShellLayoutId, isValidElementOfType, isIcon, getElementTypeName, getDefaultWidgetContext, getDefaultNavigationElements, getDefaultButtonIconSize, getCssVars, defaultUserExperienceCookieName, defaultUserExperience, defaultTransitionDurations, defaultSettingsWidgetContext as defaultSettingsWidgetOptions, defaultSettingsTableOptions, defaultNavbarSettingsWidgetId, defaultNavbarPositions, defaultLayoutsContext, defaultFooterSettingsWidgetId, defaultFooterPositions, defaultAppShellUserExperienceCookieName, defaultAppShellUserExperience, defaultAppContext, createUserExperienceContext, createRemoraidTheme, createContextCluster, co, asElementOrPropsOfType, asElementOfType, asChildrenOfType, WidgetsProviderProps, WidgetsContext, WidgetWrapperProps, WidgetWrapper, WidgetSelectionHeaderProps, WidgetSelectionHeader, WidgetProps, WidgetContext, WidgetConfiguration, Widget, UserExperienceProviderWrapperProps, UserExperienceProviderWrapper, UserExperienceProviderProps, UserExperienceContext, UserExperience, TransitionDuration, ThemeProviderProps, StaticRemoraidAppContext, SettingsWidgetSaveButtonProps, SettingsWidgetProps, SettingsWidgetContext, _default5 as SettingsWidget, SettingsTableRowProps, SettingsTableOptions, _default6 as SettingsTable, ScrollableChipGroupProps, ScrollableChipGroup2 as ScrollableChipGroup, RemoraidUser, RemoraidThemeDependencies, RemoraidThemeCallback, RemoraidTheme, RemoraidProviderProps, RemoraidProvider, RemoraidIconSize, RemoraidButtonProps, RemoraidButtonDefaultResponsivity, RemoraidButton, RemoraidBreakpoint, RemoraidAuthContext, RemoraidAppContext, PropsWithChildrenOfType, PrimitiveUserExperience, PinnableProps, PinnableDefaultLayoutType, Pinnable2 as Pinnable, PageProps, PageContainerProps, PageContainer2 as PageContainer, PageConfiguration, Page, OptionalIfExtends, Optional, NotFoundPageProps, NotFoundPage, NavigationMenuProps, NavigationElementType, NavigationElementButton, NavigationElementBase, NavigationElementAnchor, NavigationElement, NavbarVariant, NavbarSettingsWidgetProps, NavbarSettingsWidget, NavbarProps, NavbarPosition, NavbarOrientation, NavbarMode, NavbarMobileVariant, NavbarMobilePosition, NavbarMinimalProps, NavbarMinimalContentProps, _default as Navbar, LayoutsProviderProps, LayoutsContext, LayoutType, LayoutSection, LayoutElementContext, LayoutContext, InputWrapperScrollAreaProps, InputWrapperScrollArea, HydrationStatusProviderProps, HydrationStatusProvider, HydrationStatus, FrameLayoutSection, FrameLayoutProps, FrameLayoutElementProps, _default3 as FrameLayout, FooterVariant, FooterSettingsWidgetProps, FooterSettingsWidget, FooterProps, FooterPosition, FooterMinimalProps, _default2 as Footer, EnvironmentShellVariant, EnvironmentShellProps, EnvironmentShell, ElementOrPropsOfType, ElementOfType, DefaultNavigationElementsDependencies, CustomAppVariables, CoreUserExperience, ControlsProps, Controls, ControlButtonProps, ControlButton, ContextClusterProviderProps, ContextClusterProvider, ContextCluster, Common, ClickTransformation, ChildrenOfType, BadgeMinimalProps, BadgeMinimal, BadgeGroupProps, BadgeGroup, AppShellUserExperience, AppShellProps, AppShellNavbarVariant, AppShellNavbarMobileVariant, AppShellFooterVariant, _default4 as AppShell, AppProviderProps, AppProvider2 as AppProvider, AppLogo, AlertMinimalProps, AlertMinimal, AlertCategory };
|
package/dist/core/index.js
CHANGED
|
@@ -5744,6 +5744,13 @@ var scrollToWidget = (widgetId) => {
|
|
|
5744
5744
|
block: "start"
|
|
5745
5745
|
});
|
|
5746
5746
|
};
|
|
5747
|
+
var isIcon = (value) => {
|
|
5748
|
+
if (typeof value !== "object" || value === null) {
|
|
5749
|
+
return false;
|
|
5750
|
+
}
|
|
5751
|
+
const candidate = value;
|
|
5752
|
+
return "render" in candidate && typeof candidate.render === "function";
|
|
5753
|
+
};
|
|
5747
5754
|
|
|
5748
5755
|
// src/core/components/RemoraidProvider/ThemeProvider/index.tsx
|
|
5749
5756
|
import { px, rgba, useMantineTheme } from "@mantine/core";
|
|
@@ -6092,8 +6099,9 @@ function AppProvider({
|
|
|
6092
6099
|
appContext: appContextProp,
|
|
6093
6100
|
children
|
|
6094
6101
|
}) {
|
|
6102
|
+
const { logo, ...appContextPropWithoutLogo } = appContextProp;
|
|
6095
6103
|
return /* @__PURE__ */ jsx8(appContext.Provider, {
|
|
6096
|
-
value: import_lodash4.merge(defaultAppContext,
|
|
6104
|
+
value: { ...import_lodash4.merge(defaultAppContext, appContextPropWithoutLogo), logo },
|
|
6097
6105
|
children
|
|
6098
6106
|
});
|
|
6099
6107
|
}
|
|
@@ -6444,6 +6452,7 @@ var Footer_default = Object.assign(Footer, {
|
|
|
6444
6452
|
import { useState as useState7 } from "react";
|
|
6445
6453
|
|
|
6446
6454
|
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6455
|
+
import { isValidElement as isValidElement4 } from "react";
|
|
6447
6456
|
import {
|
|
6448
6457
|
Box as Box3,
|
|
6449
6458
|
Group as Group2,
|
|
@@ -6623,6 +6632,7 @@ function RemoraidButton({
|
|
|
6623
6632
|
}
|
|
6624
6633
|
|
|
6625
6634
|
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6635
|
+
import Image from "next/image";
|
|
6626
6636
|
import { jsx as jsx16, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
6627
6637
|
function NavbarMinimalContent({
|
|
6628
6638
|
orientation,
|
|
@@ -6660,10 +6670,14 @@ function NavbarMinimalContent({
|
|
|
6660
6670
|
const logoButton = app.logo ? /* @__PURE__ */ jsx16(RemoraidButton, {
|
|
6661
6671
|
label: app.name,
|
|
6662
6672
|
variant: "subtle",
|
|
6663
|
-
icon: app.logo({
|
|
6673
|
+
icon: isValidElement4(app.logo) || isIcon(app.logo) ? app.logo : /* @__PURE__ */ jsx16(Image, {
|
|
6674
|
+
src: app.logo,
|
|
6675
|
+
alt: "App logo",
|
|
6676
|
+
...componentsProps?.logo,
|
|
6664
6677
|
style: {
|
|
6665
6678
|
width: theme.componentsProps.icons[logoIconSize].size,
|
|
6666
|
-
height: theme.componentsProps.icons[logoIconSize].size
|
|
6679
|
+
height: theme.componentsProps.icons[logoIconSize].size,
|
|
6680
|
+
...componentsProps?.logo?.style
|
|
6667
6681
|
}
|
|
6668
6682
|
}),
|
|
6669
6683
|
responsive: buttonResponsive,
|
|
@@ -6727,7 +6741,7 @@ function NavbarMinimalContent({
|
|
|
6727
6741
|
const buttons = elements.filter((element) => !element.static).sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0)).slice(0, maxElements).map((element, i) => button(element, `nav-element-${i}`));
|
|
6728
6742
|
const staticElements = elements.filter((element) => element.static);
|
|
6729
6743
|
const staticButtons = staticElements.sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0)).map((element, i) => button(element, `static-nav-element-${i}`));
|
|
6730
|
-
const collapseStaticElements = staticElements.length > 1;
|
|
6744
|
+
const collapseStaticElements = staticElements.filter((element) => element.mounted ?? true).length > 1;
|
|
6731
6745
|
const staticMenuButton = collapseStaticElements ? /* @__PURE__ */ jsx16(Box3, {
|
|
6732
6746
|
hiddenFrom: collapseStaticElementsBreakpoint,
|
|
6733
6747
|
children: /* @__PURE__ */ jsx16(NavigationMenu, {
|
|
@@ -7451,7 +7465,7 @@ function WidgetSelectionHeader({
|
|
|
7451
7465
|
},
|
|
7452
7466
|
onMouseLeave: (e) => {
|
|
7453
7467
|
if (!pinnableSection) {
|
|
7454
|
-
|
|
7468
|
+
handleLeave();
|
|
7455
7469
|
}
|
|
7456
7470
|
componentsProps?.container?.onMouseEnter?.(e);
|
|
7457
7471
|
},
|
|
@@ -8545,6 +8559,7 @@ export {
|
|
|
8545
8559
|
scrollToWidget,
|
|
8546
8560
|
remoraidAppShellLayoutId,
|
|
8547
8561
|
isValidElementOfType,
|
|
8562
|
+
isIcon,
|
|
8548
8563
|
getElementTypeName,
|
|
8549
8564
|
getDefaultWidgetContext,
|
|
8550
8565
|
getDefaultNavigationElements,
|
package/dist/jsonforms/index.cjs
CHANGED
|
@@ -5543,6 +5543,13 @@ var getDefaultButtonIconSize = (buttonSize) => {
|
|
|
5543
5543
|
}
|
|
5544
5544
|
return "large" /* Large */;
|
|
5545
5545
|
};
|
|
5546
|
+
var isIcon = (value) => {
|
|
5547
|
+
if (typeof value !== "object" || value === null) {
|
|
5548
|
+
return false;
|
|
5549
|
+
}
|
|
5550
|
+
const candidate = value;
|
|
5551
|
+
return "render" in candidate && typeof candidate.render === "function";
|
|
5552
|
+
};
|
|
5546
5553
|
|
|
5547
5554
|
// src/core/components/RemoraidProvider/ThemeProvider/index.tsx
|
|
5548
5555
|
var import_core2 = require("@mantine/core");
|
|
@@ -5736,8 +5743,9 @@ function AppProvider({
|
|
|
5736
5743
|
appContext: appContextProp,
|
|
5737
5744
|
children
|
|
5738
5745
|
}) {
|
|
5746
|
+
const { logo, ...appContextPropWithoutLogo } = appContextProp;
|
|
5739
5747
|
return /* @__PURE__ */ jsx_runtime8.jsx(appContext.Provider, {
|
|
5740
|
-
value: import_lodash4.merge(defaultAppContext,
|
|
5748
|
+
value: { ...import_lodash4.merge(defaultAppContext, appContextPropWithoutLogo), logo },
|
|
5741
5749
|
children
|
|
5742
5750
|
});
|
|
5743
5751
|
}
|
|
@@ -5746,7 +5754,7 @@ function AppProvider({
|
|
|
5746
5754
|
var import_lodash13 = __toESM(require_lodash());
|
|
5747
5755
|
|
|
5748
5756
|
// src/core/components/AppShell/AppShellUserExperienceProvider/index.tsx
|
|
5749
|
-
var
|
|
5757
|
+
var import_react17 = require("react");
|
|
5750
5758
|
var import_lodash12 = __toESM(require_lodash());
|
|
5751
5759
|
|
|
5752
5760
|
// src/core/components/AppShell/Footer/FooterMinimal/index.tsx
|
|
@@ -6076,9 +6084,10 @@ var Footer_default = Object.assign(Footer, {
|
|
|
6076
6084
|
});
|
|
6077
6085
|
|
|
6078
6086
|
// src/core/components/AppShell/Navbar/NavbarMinimal/index.tsx
|
|
6079
|
-
var
|
|
6087
|
+
var import_react16 = require("react");
|
|
6080
6088
|
|
|
6081
6089
|
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6090
|
+
var import_react13 = require("react");
|
|
6082
6091
|
var import_core9 = require("@mantine/core");
|
|
6083
6092
|
var import_navigation2 = require("next/navigation");
|
|
6084
6093
|
var import_lodash8 = __toESM(require_lodash());
|
|
@@ -6240,6 +6249,7 @@ function RemoraidButton({
|
|
|
6240
6249
|
}
|
|
6241
6250
|
|
|
6242
6251
|
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6252
|
+
var import_image = __toESM(require("next/image"));
|
|
6243
6253
|
var jsx_runtime16 = require("react/jsx-runtime");
|
|
6244
6254
|
function NavbarMinimalContent({
|
|
6245
6255
|
orientation,
|
|
@@ -6277,10 +6287,14 @@ function NavbarMinimalContent({
|
|
|
6277
6287
|
const logoButton = app.logo ? /* @__PURE__ */ jsx_runtime16.jsx(RemoraidButton, {
|
|
6278
6288
|
label: app.name,
|
|
6279
6289
|
variant: "subtle",
|
|
6280
|
-
icon: app.logo({
|
|
6290
|
+
icon: import_react13.isValidElement(app.logo) || isIcon(app.logo) ? app.logo : /* @__PURE__ */ jsx_runtime16.jsx(import_image.default, {
|
|
6291
|
+
src: app.logo,
|
|
6292
|
+
alt: "App logo",
|
|
6293
|
+
...componentsProps?.logo,
|
|
6281
6294
|
style: {
|
|
6282
6295
|
width: theme.componentsProps.icons[logoIconSize].size,
|
|
6283
|
-
height: theme.componentsProps.icons[logoIconSize].size
|
|
6296
|
+
height: theme.componentsProps.icons[logoIconSize].size,
|
|
6297
|
+
...componentsProps?.logo?.style
|
|
6284
6298
|
}
|
|
6285
6299
|
}),
|
|
6286
6300
|
responsive: buttonResponsive,
|
|
@@ -6344,7 +6358,7 @@ function NavbarMinimalContent({
|
|
|
6344
6358
|
const buttons = elements.filter((element) => !element.static).sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0)).slice(0, maxElements).map((element, i) => button(element, `nav-element-${i}`));
|
|
6345
6359
|
const staticElements = elements.filter((element) => element.static);
|
|
6346
6360
|
const staticButtons = staticElements.sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0)).map((element, i) => button(element, `static-nav-element-${i}`));
|
|
6347
|
-
const collapseStaticElements = staticElements.length > 1;
|
|
6361
|
+
const collapseStaticElements = staticElements.filter((element) => element.mounted ?? true).length > 1;
|
|
6348
6362
|
const staticMenuButton = collapseStaticElements ? /* @__PURE__ */ jsx_runtime16.jsx(import_core9.Box, {
|
|
6349
6363
|
hiddenFrom: collapseStaticElementsBreakpoint,
|
|
6350
6364
|
children: /* @__PURE__ */ jsx_runtime16.jsx(NavigationMenu, {
|
|
@@ -6419,7 +6433,7 @@ function NavbarMinimalContent({
|
|
|
6419
6433
|
var import_lodash11 = __toESM(require_lodash());
|
|
6420
6434
|
|
|
6421
6435
|
// src/core/components/Pinnable/index.tsx
|
|
6422
|
-
var
|
|
6436
|
+
var import_react15 = require("react");
|
|
6423
6437
|
var import_icons_react7 = require("@tabler/icons-react");
|
|
6424
6438
|
var import_core12 = require("@mantine/core");
|
|
6425
6439
|
|
|
@@ -6470,7 +6484,7 @@ function ControlButton({
|
|
|
6470
6484
|
}
|
|
6471
6485
|
|
|
6472
6486
|
// src/core/components/Controls/index.tsx
|
|
6473
|
-
var
|
|
6487
|
+
var import_react14 = require("react");
|
|
6474
6488
|
var import_core11 = require("@mantine/core");
|
|
6475
6489
|
var import_icons_react6 = require("@tabler/icons-react");
|
|
6476
6490
|
var import_lodash10 = __toESM(require_lodash());
|
|
@@ -6488,12 +6502,12 @@ function Controls({
|
|
|
6488
6502
|
const additionalButtons = additionalButtonsProp?.map((additionalButton) => asElementOrPropsOfType(ControlButton, additionalButton, "Check the 'additionalButtons' property of 'Controls'."));
|
|
6489
6503
|
const children = asChildrenOfType(ControlButton, childrenProp, "Check children passed to 'Controls' component.");
|
|
6490
6504
|
const theme = useRemoraidTheme();
|
|
6491
|
-
const [pos, setPos] =
|
|
6505
|
+
const [pos, setPos] = import_react14.useState({
|
|
6492
6506
|
x: 0,
|
|
6493
6507
|
y: 0
|
|
6494
6508
|
});
|
|
6495
|
-
const offsetRef =
|
|
6496
|
-
const containerRef =
|
|
6509
|
+
const offsetRef = import_react14.useRef({ x: 0, y: 0 });
|
|
6510
|
+
const containerRef = import_react14.useRef(null);
|
|
6497
6511
|
const clamp = (v, min, max) => {
|
|
6498
6512
|
return Math.min(Math.max(v, min), max);
|
|
6499
6513
|
};
|
|
@@ -6595,13 +6609,13 @@ function Pinnable({
|
|
|
6595
6609
|
}) {
|
|
6596
6610
|
const layoutType = layoutTypeProp ?? "frame" /* Frame */;
|
|
6597
6611
|
const { layouts } = useLayouts();
|
|
6598
|
-
const [pinned, setPinned] =
|
|
6599
|
-
const containerRef =
|
|
6612
|
+
const [pinned, setPinned] = import_react15.useState(initialValue);
|
|
6613
|
+
const containerRef = import_react15.useRef(null);
|
|
6600
6614
|
const layout = layouts[layoutId ?? remoraidAppShellLayoutId];
|
|
6601
6615
|
if (layout && layout.type !== layoutType) {
|
|
6602
6616
|
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.`);
|
|
6603
6617
|
}
|
|
6604
|
-
const controlButton =
|
|
6618
|
+
const controlButton = import_react15.useMemo(() => /* @__PURE__ */ jsx_runtime19.jsx(ControlButton, {
|
|
6605
6619
|
icon: pinned ? import_icons_react7.IconPinnedOff : import_icons_react7.IconPin,
|
|
6606
6620
|
tooltip: pinned ? "Unpin" : "Pin",
|
|
6607
6621
|
color: "green",
|
|
@@ -6631,7 +6645,7 @@ function Pinnable({
|
|
|
6631
6645
|
children
|
|
6632
6646
|
]
|
|
6633
6647
|
});
|
|
6634
|
-
|
|
6648
|
+
import_react15.useEffect(() => {
|
|
6635
6649
|
onPinnedValueChange?.(pinned);
|
|
6636
6650
|
}, [pinned]);
|
|
6637
6651
|
if (!layout) {
|
|
@@ -6660,7 +6674,7 @@ function NavbarMinimal({
|
|
|
6660
6674
|
navbar: { position }
|
|
6661
6675
|
}
|
|
6662
6676
|
} = useAppShellUserExperience();
|
|
6663
|
-
const [hover, setHover] =
|
|
6677
|
+
const [hover, setHover] = import_react16.useState(false);
|
|
6664
6678
|
const handleEnter = () => {
|
|
6665
6679
|
setHover(true);
|
|
6666
6680
|
};
|
|
@@ -6832,7 +6846,7 @@ var defaultAppShellUserExperience = {
|
|
|
6832
6846
|
var defaultAppShellUserExperienceCookieName = "remoraid-app-shell-user-experience";
|
|
6833
6847
|
var appShellUserExperienceContext = createUserExperienceContext(defaultAppShellUserExperience);
|
|
6834
6848
|
var useAppShellUserExperience = () => {
|
|
6835
|
-
return
|
|
6849
|
+
return import_react17.useContext(appShellUserExperienceContext);
|
|
6836
6850
|
};
|
|
6837
6851
|
function AppShellUserExperienceProvider({
|
|
6838
6852
|
children,
|
|
@@ -6919,17 +6933,17 @@ var import_core16 = require("@mantine/core");
|
|
|
6919
6933
|
|
|
6920
6934
|
// src/core/components/Page/index.tsx
|
|
6921
6935
|
var import_core14 = require("@mantine/core");
|
|
6922
|
-
var
|
|
6936
|
+
var import_react18 = __toESM(require("react"));
|
|
6923
6937
|
var import_navigation3 = require("next/navigation");
|
|
6924
6938
|
var jsx_runtime24 = require("react/jsx-runtime");
|
|
6925
|
-
var pageContext =
|
|
6939
|
+
var pageContext = import_react18.default.createContext(null);
|
|
6926
6940
|
var usePage = () => {
|
|
6927
|
-
return
|
|
6941
|
+
return import_react18.useContext(pageContext);
|
|
6928
6942
|
};
|
|
6929
6943
|
|
|
6930
6944
|
// src/core/components/WidgetSelectionHeader/index.tsx
|
|
6931
6945
|
var import_icons_react9 = require("@tabler/icons-react");
|
|
6932
|
-
var
|
|
6946
|
+
var import_react19 = require("react");
|
|
6933
6947
|
|
|
6934
6948
|
// src/core/components/ScrollableChipGroup/index.tsx
|
|
6935
6949
|
var import_core15 = require("@mantine/core");
|
|
@@ -6940,7 +6954,7 @@ var import_lodash14 = __toESM(require_lodash());
|
|
|
6940
6954
|
var jsx_runtime26 = require("react/jsx-runtime");
|
|
6941
6955
|
// src/core/components/BadgeGroup/index.tsx
|
|
6942
6956
|
var import_core18 = require("@mantine/core");
|
|
6943
|
-
var
|
|
6957
|
+
var import_react20 = __toESM(require("react"));
|
|
6944
6958
|
|
|
6945
6959
|
// src/core/components/BadgeMinimal/index.tsx
|
|
6946
6960
|
var import_core17 = require("@mantine/core");
|
|
@@ -7092,7 +7106,7 @@ function AlertMinimal({
|
|
|
7092
7106
|
}
|
|
7093
7107
|
// src/core/components/Widget/WidgetWrapper/index.tsx
|
|
7094
7108
|
var import_core20 = require("@mantine/core");
|
|
7095
|
-
var
|
|
7109
|
+
var import_react21 = require("react");
|
|
7096
7110
|
var import_icons_react10 = require("@tabler/icons-react");
|
|
7097
7111
|
var import_lodash17 = __toESM(require_lodash());
|
|
7098
7112
|
var jsx_runtime30 = require("react/jsx-runtime");
|
|
@@ -7116,11 +7130,11 @@ function WidgetWrapper({
|
|
|
7116
7130
|
} = useWidgets();
|
|
7117
7131
|
const page = usePage();
|
|
7118
7132
|
const theme = useRemoraidTheme();
|
|
7119
|
-
const [controlsContainer, setControlsContainer] =
|
|
7133
|
+
const [controlsContainer, setControlsContainer] = import_react21.useState(null);
|
|
7120
7134
|
const widget = page ? widgets[page.pageId]?.[config.widgetId] : undefined;
|
|
7121
7135
|
const pageRegistered = page ? isPageRegistered(page.pageId) : false;
|
|
7122
|
-
const containerRef =
|
|
7123
|
-
const controlsContainerRef =
|
|
7136
|
+
const containerRef = import_react21.useRef(null);
|
|
7137
|
+
const controlsContainerRef = import_react21.useCallback((n) => {
|
|
7124
7138
|
setControlsContainer(n);
|
|
7125
7139
|
}, [setControlsContainer]);
|
|
7126
7140
|
const handleEnter = () => {
|
|
@@ -7226,7 +7240,7 @@ function WidgetWrapper({
|
|
|
7226
7240
|
children: element
|
|
7227
7241
|
});
|
|
7228
7242
|
}
|
|
7229
|
-
|
|
7243
|
+
import_react21.useEffect(() => {
|
|
7230
7244
|
if (!page) {
|
|
7231
7245
|
return;
|
|
7232
7246
|
}
|
|
@@ -7238,7 +7252,7 @@ function WidgetWrapper({
|
|
|
7238
7252
|
}
|
|
7239
7253
|
// src/core/components/Widget/index.tsx
|
|
7240
7254
|
var import_core21 = require("@mantine/core");
|
|
7241
|
-
var
|
|
7255
|
+
var import_react22 = require("react");
|
|
7242
7256
|
var import_lodash18 = __toESM(require_lodash());
|
|
7243
7257
|
var jsx_runtime31 = require("react/jsx-runtime");
|
|
7244
7258
|
var react2 = require("react");
|
|
@@ -7352,7 +7366,7 @@ function Widget({
|
|
|
7352
7366
|
});
|
|
7353
7367
|
})
|
|
7354
7368
|
}),
|
|
7355
|
-
(loading ||
|
|
7369
|
+
(loading || import_react22.Children.toArray(children).length > 0) && /* @__PURE__ */ jsx_runtime31.jsx(import_core21.ScrollArea.Autosize, {
|
|
7356
7370
|
flex: 1,
|
|
7357
7371
|
...componentsProps?.childrenContainer,
|
|
7358
7372
|
className: clsx_default("remoraid-widget-children-container", componentsProps?.childrenContainer?.className),
|
|
@@ -7372,7 +7386,7 @@ var jsx_runtime32 = require("react/jsx-runtime");
|
|
|
7372
7386
|
// src/core/components/EnvironmentShell/index.tsx
|
|
7373
7387
|
var jsx_runtime33 = require("react/jsx-runtime");
|
|
7374
7388
|
// src/core/components/SettingsWidget/index.tsx
|
|
7375
|
-
var
|
|
7389
|
+
var import_react23 = require("react");
|
|
7376
7390
|
var import_icons_react12 = require("@tabler/icons-react");
|
|
7377
7391
|
|
|
7378
7392
|
// src/core/components/SettingsWidget/SaveButton/index.tsx
|
|
@@ -7414,9 +7428,9 @@ function SaveButton({
|
|
|
7414
7428
|
// src/core/components/SettingsWidget/index.tsx
|
|
7415
7429
|
var jsx_runtime35 = require("react/jsx-runtime");
|
|
7416
7430
|
var defaultSettingsWidgetContext = {};
|
|
7417
|
-
var settingsWidgetContext =
|
|
7431
|
+
var settingsWidgetContext = import_react23.createContext(defaultSettingsWidgetContext);
|
|
7418
7432
|
var useSettingsWidgetContext = () => {
|
|
7419
|
-
return
|
|
7433
|
+
return import_react23.useContext(settingsWidgetContext);
|
|
7420
7434
|
};
|
|
7421
7435
|
function SettingsWidget({
|
|
7422
7436
|
children,
|
|
@@ -7462,7 +7476,7 @@ var SettingsWidget_default = Object.assign(SettingsWidget, {
|
|
|
7462
7476
|
SaveButton
|
|
7463
7477
|
});
|
|
7464
7478
|
// src/core/components/SettingsWidget/SettingsTable/index.tsx
|
|
7465
|
-
var
|
|
7479
|
+
var import_react24 = require("react");
|
|
7466
7480
|
var import_core24 = require("@mantine/core");
|
|
7467
7481
|
|
|
7468
7482
|
// src/core/components/SettingsWidget/SettingsTable/Row/index.tsx
|
|
@@ -7495,9 +7509,9 @@ var jsx_runtime37 = require("react/jsx-runtime");
|
|
|
7495
7509
|
var defaultSettingsTableOptions = {
|
|
7496
7510
|
leftColumnWidth: "38.2%"
|
|
7497
7511
|
};
|
|
7498
|
-
var settingsTableOptionsContext =
|
|
7512
|
+
var settingsTableOptionsContext = import_react24.createContext(defaultSettingsTableOptions);
|
|
7499
7513
|
var useSettingsTableOptions = () => {
|
|
7500
|
-
return
|
|
7514
|
+
return import_react24.useContext(settingsTableOptionsContext);
|
|
7501
7515
|
};
|
|
7502
7516
|
function SettingsTable({
|
|
7503
7517
|
leftColumnWidth,
|
|
@@ -7532,11 +7546,11 @@ var import_lodash20 = __toESM(require_lodash());
|
|
|
7532
7546
|
var import_core26 = require("@mantine/core");
|
|
7533
7547
|
var jsx_runtime39 = require("react/jsx-runtime");
|
|
7534
7548
|
// src/core/components/ContextClusterProvider/index.tsx
|
|
7535
|
-
var
|
|
7549
|
+
var import_react25 = __toESM(require("react"));
|
|
7536
7550
|
var jsx_runtime40 = require("react/jsx-runtime");
|
|
7537
7551
|
// src/core/components/InputWrapperScrollArea/index.tsx
|
|
7538
7552
|
var import_core27 = require("@mantine/core");
|
|
7539
|
-
var
|
|
7553
|
+
var import_react26 = require("react");
|
|
7540
7554
|
var import_core28 = require("remoraid/core");
|
|
7541
7555
|
var jsx_runtime41 = require("react/jsx-runtime");
|
|
7542
7556
|
function InputWrapperScrollArea({
|
|
@@ -7549,7 +7563,7 @@ function InputWrapperScrollArea({
|
|
|
7549
7563
|
componentsProps
|
|
7550
7564
|
}) {
|
|
7551
7565
|
const theme = import_core28.useRemoraidTheme();
|
|
7552
|
-
const [isHovering, setIsHovering] =
|
|
7566
|
+
const [isHovering, setIsHovering] = import_react26.useState(false);
|
|
7553
7567
|
return /* @__PURE__ */ jsx_runtime41.jsx(import_core27.Input.Wrapper, {
|
|
7554
7568
|
label,
|
|
7555
7569
|
error,
|
|
@@ -7583,27 +7597,27 @@ function InputWrapperScrollArea({
|
|
|
7583
7597
|
});
|
|
7584
7598
|
}
|
|
7585
7599
|
// src/jsonforms/renderers/AnyControl.tsx
|
|
7586
|
-
var
|
|
7600
|
+
var import_react28 = require("@jsonforms/react");
|
|
7587
7601
|
var import_core30 = require("@mantine/core");
|
|
7588
|
-
var
|
|
7602
|
+
var import_react29 = require("react");
|
|
7589
7603
|
|
|
7590
7604
|
// src/jsonforms/components/FormOptionsProvider/index.tsx
|
|
7591
|
-
var
|
|
7605
|
+
var import_react27 = __toESM(require("react"));
|
|
7592
7606
|
var jsx_runtime42 = require("react/jsx-runtime");
|
|
7593
7607
|
var defaultFormOptions = {
|
|
7594
7608
|
withDescriptions: false,
|
|
7595
7609
|
gutter: "md"
|
|
7596
7610
|
};
|
|
7597
|
-
var formOptionsContext =
|
|
7611
|
+
var formOptionsContext = import_react27.default.createContext({
|
|
7598
7612
|
formOptions: defaultFormOptions,
|
|
7599
7613
|
updateFormOptions: () => {}
|
|
7600
7614
|
});
|
|
7601
|
-
var useFormOptions = () =>
|
|
7615
|
+
var useFormOptions = () => import_react27.useContext(formOptionsContext);
|
|
7602
7616
|
function FormOptionsProvider({
|
|
7603
7617
|
children,
|
|
7604
7618
|
initialValue
|
|
7605
7619
|
}) {
|
|
7606
|
-
const [formOptions, setFormOptions] =
|
|
7620
|
+
const [formOptions, setFormOptions] = import_react27.useState({
|
|
7607
7621
|
...defaultFormOptions,
|
|
7608
7622
|
...initialValue
|
|
7609
7623
|
});
|
|
@@ -7630,8 +7644,8 @@ function PlainAnyControl({
|
|
|
7630
7644
|
const {
|
|
7631
7645
|
formOptions: { withDescriptions }
|
|
7632
7646
|
} = useFormOptions();
|
|
7633
|
-
const [input, setInput] =
|
|
7634
|
-
const [error, setError] =
|
|
7647
|
+
const [input, setInput] = import_react29.useState(JSON.stringify(data, null, theme.jsonStringifySpace));
|
|
7648
|
+
const [error, setError] = import_react29.useState(false);
|
|
7635
7649
|
const label = labelProp !== "remoraid-array-item" ? labelProp : null;
|
|
7636
7650
|
const description = withDescriptions ? schema.description : undefined;
|
|
7637
7651
|
return /* @__PURE__ */ jsx_runtime43.jsx(InputWrapperScrollArea, {
|
|
@@ -7661,14 +7675,14 @@ function PlainAnyControl({
|
|
|
7661
7675
|
})
|
|
7662
7676
|
});
|
|
7663
7677
|
}
|
|
7664
|
-
var AnyControl =
|
|
7678
|
+
var AnyControl = import_react28.withJsonFormsControlProps(PlainAnyControl);
|
|
7665
7679
|
var AnyControl_default = AnyControl;
|
|
7666
7680
|
|
|
7667
7681
|
// src/jsonforms/renderers/AnyOfControl.tsx
|
|
7668
|
-
var
|
|
7682
|
+
var import_react30 = require("@jsonforms/react");
|
|
7669
7683
|
var import_core31 = require("@jsonforms/core");
|
|
7670
7684
|
var import_core32 = require("@mantine/core");
|
|
7671
|
-
var
|
|
7685
|
+
var import_react31 = require("react");
|
|
7672
7686
|
var jsx_runtime44 = require("react/jsx-runtime");
|
|
7673
7687
|
function PlainAnyOfControl({
|
|
7674
7688
|
data,
|
|
@@ -7680,7 +7694,7 @@ function PlainAnyOfControl({
|
|
|
7680
7694
|
rootSchema
|
|
7681
7695
|
}) {
|
|
7682
7696
|
const { formOptions } = useFormOptions();
|
|
7683
|
-
const { core, renderers, cells } =
|
|
7697
|
+
const { core, renderers, cells } = import_react30.useJsonForms();
|
|
7684
7698
|
const inferType = (schema2) => {
|
|
7685
7699
|
if (!schema2) {
|
|
7686
7700
|
return;
|
|
@@ -7700,7 +7714,7 @@ function PlainAnyOfControl({
|
|
|
7700
7714
|
}
|
|
7701
7715
|
return;
|
|
7702
7716
|
};
|
|
7703
|
-
const options =
|
|
7717
|
+
const options = import_react31.useMemo(() => {
|
|
7704
7718
|
const anyOf = schema.anyOf ?? [];
|
|
7705
7719
|
return anyOf.map((opt, idx) => {
|
|
7706
7720
|
const resolved = opt.$ref ? import_core31.Resolve.schema(rootSchema, opt.$ref, rootSchema) : opt;
|
|
@@ -7710,7 +7724,7 @@ function PlainAnyOfControl({
|
|
|
7710
7724
|
return { original: opt, resolved, label: label2 };
|
|
7711
7725
|
});
|
|
7712
7726
|
}, [schema.anyOf, rootSchema]);
|
|
7713
|
-
const isValidOptionIndex =
|
|
7727
|
+
const isValidOptionIndex = import_react31.useMemo(() => {
|
|
7714
7728
|
return (optionIndex) => {
|
|
7715
7729
|
if (!core?.ajv || data === undefined) {
|
|
7716
7730
|
return false;
|
|
@@ -7719,7 +7733,7 @@ function PlainAnyOfControl({
|
|
|
7719
7733
|
return validate(data);
|
|
7720
7734
|
};
|
|
7721
7735
|
}, [core?.ajv, data, options]);
|
|
7722
|
-
const validOptionIndex =
|
|
7736
|
+
const validOptionIndex = import_react31.useMemo(() => {
|
|
7723
7737
|
for (let i = 0;i < options.length; i++) {
|
|
7724
7738
|
if (isValidOptionIndex(i)) {
|
|
7725
7739
|
return i;
|
|
@@ -7727,7 +7741,7 @@ function PlainAnyOfControl({
|
|
|
7727
7741
|
}
|
|
7728
7742
|
return -1;
|
|
7729
7743
|
}, [options, isValidOptionIndex]);
|
|
7730
|
-
const [selectedOption, setSelectedOption] =
|
|
7744
|
+
const [selectedOption, setSelectedOption] = import_react31.useState(validOptionIndex >= 0 ? String(validOptionIndex) : null);
|
|
7731
7745
|
const schemaDefaultValue = (opt) => {
|
|
7732
7746
|
const t = opt.type ?? (opt.properties ? "object" : opt.items ? "array" : undefined);
|
|
7733
7747
|
switch (t) {
|
|
@@ -7786,7 +7800,7 @@ function PlainAnyOfControl({
|
|
|
7786
7800
|
variant: "default",
|
|
7787
7801
|
mb: selectedOption !== null && inferType(selectedSchema) !== "null" ? formOptions.gutter : undefined
|
|
7788
7802
|
}),
|
|
7789
|
-
selectedOption !== null && /* @__PURE__ */ jsx_runtime44.jsx(
|
|
7803
|
+
selectedOption !== null && /* @__PURE__ */ jsx_runtime44.jsx(import_react30.JsonForms, {
|
|
7790
7804
|
schema: {
|
|
7791
7805
|
...selectedSchema,
|
|
7792
7806
|
$schema: undefined
|
|
@@ -7804,11 +7818,11 @@ function PlainAnyOfControl({
|
|
|
7804
7818
|
})
|
|
7805
7819
|
});
|
|
7806
7820
|
}
|
|
7807
|
-
var AnyOfControl =
|
|
7821
|
+
var AnyOfControl = import_react30.withJsonFormsControlProps(PlainAnyOfControl);
|
|
7808
7822
|
var AnyOfControl_default = AnyOfControl;
|
|
7809
7823
|
|
|
7810
7824
|
// src/jsonforms/renderers/ArrayControl.tsx
|
|
7811
|
-
var
|
|
7825
|
+
var import_react32 = require("@jsonforms/react");
|
|
7812
7826
|
var import_core33 = require("@mantine/core");
|
|
7813
7827
|
var import_icons_react13 = require("@tabler/icons-react");
|
|
7814
7828
|
var import_core34 = require("remoraid/core");
|
|
@@ -7818,7 +7832,7 @@ function PlainArrayControl(props) {
|
|
|
7818
7832
|
const theme = import_core34.useRemoraidTheme();
|
|
7819
7833
|
const { label, schema, data, handleChange, path, required } = props;
|
|
7820
7834
|
const { formOptions } = useFormOptions();
|
|
7821
|
-
const { renderers, cells } =
|
|
7835
|
+
const { renderers, cells } = import_react32.useJsonForms();
|
|
7822
7836
|
let schemaItems;
|
|
7823
7837
|
if (schema.items && !Array.isArray(schema.items)) {
|
|
7824
7838
|
schemaItems = {
|
|
@@ -7864,7 +7878,7 @@ function PlainArrayControl(props) {
|
|
|
7864
7878
|
children: [
|
|
7865
7879
|
/* @__PURE__ */ jsx_runtime45.jsx(import_core33.Box, {
|
|
7866
7880
|
flex: 1,
|
|
7867
|
-
children: /* @__PURE__ */ jsx_runtime45.jsx(
|
|
7881
|
+
children: /* @__PURE__ */ jsx_runtime45.jsx(import_react32.JsonForms, {
|
|
7868
7882
|
schema: schemaItems,
|
|
7869
7883
|
data: { item },
|
|
7870
7884
|
renderers: renderers ?? [],
|
|
@@ -7919,11 +7933,11 @@ function PlainArrayControl(props) {
|
|
|
7919
7933
|
})
|
|
7920
7934
|
});
|
|
7921
7935
|
}
|
|
7922
|
-
var ArrayControl =
|
|
7936
|
+
var ArrayControl = import_react32.withJsonFormsControlProps(PlainArrayControl);
|
|
7923
7937
|
var ArrayControl_default = ArrayControl;
|
|
7924
7938
|
|
|
7925
7939
|
// src/jsonforms/renderers/CheckboxControl.tsx
|
|
7926
|
-
var
|
|
7940
|
+
var import_react33 = require("@jsonforms/react");
|
|
7927
7941
|
var import_core35 = require("@mantine/core");
|
|
7928
7942
|
var jsx_runtime46 = require("react/jsx-runtime");
|
|
7929
7943
|
function PlainCheckboxControl({
|
|
@@ -7949,11 +7963,11 @@ function PlainCheckboxControl({
|
|
|
7949
7963
|
})
|
|
7950
7964
|
});
|
|
7951
7965
|
}
|
|
7952
|
-
var CheckboxControl =
|
|
7966
|
+
var CheckboxControl = import_react33.withJsonFormsControlProps(PlainCheckboxControl);
|
|
7953
7967
|
var CheckboxControl_default = CheckboxControl;
|
|
7954
7968
|
|
|
7955
7969
|
// src/jsonforms/renderers/NumberControl.tsx
|
|
7956
|
-
var
|
|
7970
|
+
var import_react34 = require("@jsonforms/react");
|
|
7957
7971
|
var import_core36 = require("@mantine/core");
|
|
7958
7972
|
var jsx_runtime47 = require("react/jsx-runtime");
|
|
7959
7973
|
function PlainNumberControl({
|
|
@@ -7983,14 +7997,14 @@ function PlainNumberControl({
|
|
|
7983
7997
|
})
|
|
7984
7998
|
});
|
|
7985
7999
|
}
|
|
7986
|
-
var NumberControl =
|
|
8000
|
+
var NumberControl = import_react34.withJsonFormsControlProps(PlainNumberControl);
|
|
7987
8001
|
var NumberControl_default = NumberControl;
|
|
7988
8002
|
|
|
7989
8003
|
// src/jsonforms/renderers/ObjectControl.tsx
|
|
7990
|
-
var
|
|
8004
|
+
var import_react35 = require("@jsonforms/react");
|
|
7991
8005
|
var import_core37 = require("@mantine/core");
|
|
7992
8006
|
var import_core38 = require("@jsonforms/core");
|
|
7993
|
-
var
|
|
8007
|
+
var import_react36 = require("react");
|
|
7994
8008
|
var import_icons_react14 = require("@tabler/icons-react");
|
|
7995
8009
|
var jsx_runtime48 = require("react/jsx-runtime");
|
|
7996
8010
|
function PlainObjectControl({
|
|
@@ -8002,8 +8016,8 @@ function PlainObjectControl({
|
|
|
8002
8016
|
required
|
|
8003
8017
|
}) {
|
|
8004
8018
|
const { formOptions } = useFormOptions();
|
|
8005
|
-
const { renderers, cells } =
|
|
8006
|
-
const [newKey, setNewKey] =
|
|
8019
|
+
const { renderers, cells } = import_react35.useJsonForms();
|
|
8020
|
+
const [newKey, setNewKey] = import_react36.useState("");
|
|
8007
8021
|
const hasProperties = schema.properties && Object.keys(schema.properties).length > 0;
|
|
8008
8022
|
const hasAdditionalProperties = schema.additionalProperties === true || schema.additionalProperties !== undefined && Object.keys(schema.additionalProperties).length > 0;
|
|
8009
8023
|
const label = labelProp !== "remoraid-array-item" ? labelProp : null;
|
|
@@ -8026,7 +8040,7 @@ function PlainObjectControl({
|
|
|
8026
8040
|
justify: "flex-start",
|
|
8027
8041
|
gap: formOptions.gutter,
|
|
8028
8042
|
children: [
|
|
8029
|
-
hasProperties && /* @__PURE__ */ jsx_runtime48.jsx(
|
|
8043
|
+
hasProperties && /* @__PURE__ */ jsx_runtime48.jsx(import_react35.JsonForms, {
|
|
8030
8044
|
schema: {
|
|
8031
8045
|
...schema,
|
|
8032
8046
|
$schema: undefined
|
|
@@ -8054,7 +8068,7 @@ function PlainObjectControl({
|
|
|
8054
8068
|
children: [
|
|
8055
8069
|
/* @__PURE__ */ jsx_runtime48.jsx(import_core37.Box, {
|
|
8056
8070
|
flex: 1,
|
|
8057
|
-
children: /* @__PURE__ */ jsx_runtime48.jsx(
|
|
8071
|
+
children: /* @__PURE__ */ jsx_runtime48.jsx(import_react35.JsonForms, {
|
|
8058
8072
|
schema: {
|
|
8059
8073
|
...schema.additionalProperties === true ? {} : schema.additionalProperties,
|
|
8060
8074
|
title: key,
|
|
@@ -8141,11 +8155,11 @@ function PlainObjectControl({
|
|
|
8141
8155
|
})
|
|
8142
8156
|
});
|
|
8143
8157
|
}
|
|
8144
|
-
var ObjectControl =
|
|
8158
|
+
var ObjectControl = import_react35.withJsonFormsControlProps(PlainObjectControl);
|
|
8145
8159
|
var ObjectControl_default = ObjectControl;
|
|
8146
8160
|
|
|
8147
8161
|
// src/jsonforms/renderers/StringSelectControl.tsx
|
|
8148
|
-
var
|
|
8162
|
+
var import_react37 = require("@jsonforms/react");
|
|
8149
8163
|
var import_core40 = require("@mantine/core");
|
|
8150
8164
|
var jsx_runtime49 = require("react/jsx-runtime");
|
|
8151
8165
|
function PlainTimestampControl({
|
|
@@ -8174,7 +8188,7 @@ function PlainTimestampControl({
|
|
|
8174
8188
|
})
|
|
8175
8189
|
});
|
|
8176
8190
|
}
|
|
8177
|
-
var TimestampControl =
|
|
8191
|
+
var TimestampControl = import_react37.withJsonFormsControlProps(PlainTimestampControl);
|
|
8178
8192
|
var StringSelectControl_default = TimestampControl;
|
|
8179
8193
|
|
|
8180
8194
|
// src/jsonforms/renderers/testers/anyControlTesters.ts
|
|
@@ -8244,7 +8258,7 @@ var tester9 = import_core50.rankWith(2, import_core50.uiTypeIs("VerticalLayout")
|
|
|
8244
8258
|
var verticalLayoutTester_default = tester9;
|
|
8245
8259
|
|
|
8246
8260
|
// src/jsonforms/renderers/TextControl.tsx
|
|
8247
|
-
var
|
|
8261
|
+
var import_react38 = require("@jsonforms/react");
|
|
8248
8262
|
var import_core51 = require("@mantine/core");
|
|
8249
8263
|
var jsx_runtime50 = require("react/jsx-runtime");
|
|
8250
8264
|
function PlainTextControl({
|
|
@@ -8272,11 +8286,11 @@ function PlainTextControl({
|
|
|
8272
8286
|
})
|
|
8273
8287
|
});
|
|
8274
8288
|
}
|
|
8275
|
-
var TextControl =
|
|
8289
|
+
var TextControl = import_react38.withJsonFormsControlProps(PlainTextControl);
|
|
8276
8290
|
var TextControl_default = TextControl;
|
|
8277
8291
|
|
|
8278
8292
|
// src/jsonforms/renderers/TimestampControl.tsx
|
|
8279
|
-
var
|
|
8293
|
+
var import_react39 = require("@jsonforms/react");
|
|
8280
8294
|
var import_dates = require("@mantine/dates");
|
|
8281
8295
|
var jsx_runtime51 = require("react/jsx-runtime");
|
|
8282
8296
|
function PlainTimestampControl2({
|
|
@@ -8306,13 +8320,13 @@ function PlainTimestampControl2({
|
|
|
8306
8320
|
})
|
|
8307
8321
|
});
|
|
8308
8322
|
}
|
|
8309
|
-
var TimestampControl2 =
|
|
8323
|
+
var TimestampControl2 = import_react39.withJsonFormsControlProps(PlainTimestampControl2);
|
|
8310
8324
|
var TimestampControl_default = TimestampControl2;
|
|
8311
8325
|
|
|
8312
8326
|
// src/jsonforms/renderers/VerticalLayout.tsx
|
|
8313
|
-
var
|
|
8314
|
-
var import_react40 = require("@jsonforms/react");
|
|
8327
|
+
var import_react40 = __toESM(require("react"));
|
|
8315
8328
|
var import_react41 = require("@jsonforms/react");
|
|
8329
|
+
var import_react42 = require("@jsonforms/react");
|
|
8316
8330
|
var jsx_runtime52 = require("react/jsx-runtime");
|
|
8317
8331
|
"use client";
|
|
8318
8332
|
var JsonFormsLayout = ({
|
|
@@ -8327,14 +8341,14 @@ var JsonFormsLayout = ({
|
|
|
8327
8341
|
});
|
|
8328
8342
|
};
|
|
8329
8343
|
var renderChildren = (layout, schema, className, path, enabled) => {
|
|
8330
|
-
const { renderers, cells } =
|
|
8344
|
+
const { renderers, cells } = import_react42.useJsonForms();
|
|
8331
8345
|
const { formOptions } = useFormOptions();
|
|
8332
8346
|
const gutter = typeof formOptions.gutter === "string" ? `var(--mantine-spacing-${formOptions.gutter})` : `${formOptions.gutter}px`;
|
|
8333
8347
|
return layout.elements.map((child, index) => {
|
|
8334
8348
|
return /* @__PURE__ */ jsx_runtime52.jsx("div", {
|
|
8335
8349
|
className,
|
|
8336
8350
|
style: { marginTop: index === 0 ? 0 : gutter },
|
|
8337
|
-
children: /* @__PURE__ */ jsx_runtime52.jsx(
|
|
8351
|
+
children: /* @__PURE__ */ jsx_runtime52.jsx(import_react42.JsonFormsDispatch, {
|
|
8338
8352
|
renderers,
|
|
8339
8353
|
cells,
|
|
8340
8354
|
uischema: child,
|
|
@@ -8351,7 +8365,7 @@ var VerticalLayoutRenderer = (props) => {
|
|
|
8351
8365
|
...otherProps
|
|
8352
8366
|
});
|
|
8353
8367
|
};
|
|
8354
|
-
var VerticalLayoutRendererComponent =
|
|
8368
|
+
var VerticalLayoutRendererComponent = import_react40.default.memo(function VerticalLayoutRendererComponent2({
|
|
8355
8369
|
schema,
|
|
8356
8370
|
uischema,
|
|
8357
8371
|
path,
|
|
@@ -8371,7 +8385,7 @@ var VerticalLayoutRendererComponent = import_react39.default.memo(function Verti
|
|
|
8371
8385
|
children: renderChildren(verticalLayout, schema, childClassNames, path, enabled)
|
|
8372
8386
|
});
|
|
8373
8387
|
});
|
|
8374
|
-
var VerticalLayout =
|
|
8388
|
+
var VerticalLayout = import_react41.withJsonFormsLayoutProps(VerticalLayoutRenderer, false);
|
|
8375
8389
|
var VerticalLayout_default = VerticalLayout;
|
|
8376
8390
|
|
|
8377
8391
|
// src/jsonforms/renderers/index.ts
|
package/dist/jsonforms/index.js
CHANGED
|
@@ -5510,6 +5510,13 @@ var getDefaultButtonIconSize = (buttonSize) => {
|
|
|
5510
5510
|
}
|
|
5511
5511
|
return "large" /* Large */;
|
|
5512
5512
|
};
|
|
5513
|
+
var isIcon = (value) => {
|
|
5514
|
+
if (typeof value !== "object" || value === null) {
|
|
5515
|
+
return false;
|
|
5516
|
+
}
|
|
5517
|
+
const candidate = value;
|
|
5518
|
+
return "render" in candidate && typeof candidate.render === "function";
|
|
5519
|
+
};
|
|
5513
5520
|
|
|
5514
5521
|
// src/core/components/RemoraidProvider/ThemeProvider/index.tsx
|
|
5515
5522
|
import { px, rgba, useMantineTheme } from "@mantine/core";
|
|
@@ -5725,8 +5732,9 @@ function AppProvider({
|
|
|
5725
5732
|
appContext: appContextProp,
|
|
5726
5733
|
children
|
|
5727
5734
|
}) {
|
|
5735
|
+
const { logo, ...appContextPropWithoutLogo } = appContextProp;
|
|
5728
5736
|
return /* @__PURE__ */ jsx8(appContext.Provider, {
|
|
5729
|
-
value: import_lodash4.merge(defaultAppContext,
|
|
5737
|
+
value: { ...import_lodash4.merge(defaultAppContext, appContextPropWithoutLogo), logo },
|
|
5730
5738
|
children
|
|
5731
5739
|
});
|
|
5732
5740
|
}
|
|
@@ -6077,6 +6085,7 @@ var Footer_default = Object.assign(Footer, {
|
|
|
6077
6085
|
import { useState as useState7 } from "react";
|
|
6078
6086
|
|
|
6079
6087
|
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6088
|
+
import { isValidElement as isValidElement4 } from "react";
|
|
6080
6089
|
import {
|
|
6081
6090
|
Box as Box3,
|
|
6082
6091
|
Group as Group2,
|
|
@@ -6256,6 +6265,7 @@ function RemoraidButton({
|
|
|
6256
6265
|
}
|
|
6257
6266
|
|
|
6258
6267
|
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6268
|
+
import Image from "next/image";
|
|
6259
6269
|
import { jsx as jsx16, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
6260
6270
|
function NavbarMinimalContent({
|
|
6261
6271
|
orientation,
|
|
@@ -6293,10 +6303,14 @@ function NavbarMinimalContent({
|
|
|
6293
6303
|
const logoButton = app.logo ? /* @__PURE__ */ jsx16(RemoraidButton, {
|
|
6294
6304
|
label: app.name,
|
|
6295
6305
|
variant: "subtle",
|
|
6296
|
-
icon: app.logo({
|
|
6306
|
+
icon: isValidElement4(app.logo) || isIcon(app.logo) ? app.logo : /* @__PURE__ */ jsx16(Image, {
|
|
6307
|
+
src: app.logo,
|
|
6308
|
+
alt: "App logo",
|
|
6309
|
+
...componentsProps?.logo,
|
|
6297
6310
|
style: {
|
|
6298
6311
|
width: theme.componentsProps.icons[logoIconSize].size,
|
|
6299
|
-
height: theme.componentsProps.icons[logoIconSize].size
|
|
6312
|
+
height: theme.componentsProps.icons[logoIconSize].size,
|
|
6313
|
+
...componentsProps?.logo?.style
|
|
6300
6314
|
}
|
|
6301
6315
|
}),
|
|
6302
6316
|
responsive: buttonResponsive,
|
|
@@ -6360,7 +6374,7 @@ function NavbarMinimalContent({
|
|
|
6360
6374
|
const buttons = elements.filter((element) => !element.static).sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0)).slice(0, maxElements).map((element, i) => button(element, `nav-element-${i}`));
|
|
6361
6375
|
const staticElements = elements.filter((element) => element.static);
|
|
6362
6376
|
const staticButtons = staticElements.sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0)).map((element, i) => button(element, `static-nav-element-${i}`));
|
|
6363
|
-
const collapseStaticElements = staticElements.length > 1;
|
|
6377
|
+
const collapseStaticElements = staticElements.filter((element) => element.mounted ?? true).length > 1;
|
|
6364
6378
|
const staticMenuButton = collapseStaticElements ? /* @__PURE__ */ jsx16(Box3, {
|
|
6365
6379
|
hiddenFrom: collapseStaticElementsBreakpoint,
|
|
6366
6380
|
children: /* @__PURE__ */ jsx16(NavigationMenu, {
|