remoraid 2.45.0 → 3.3.2
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/README.md +22 -3
- package/dist/core/index.cjs +113 -67
- package/dist/core/index.d.ts +19 -17
- package/dist/core/index.js +127 -79
- package/dist/core/styles.css +73 -16
- package/dist/data-visualization/index.cjs +6546 -0
- package/dist/data-visualization/index.d.ts +529 -0
- package/dist/data-visualization/index.js +6584 -0
- package/dist/jsonforms/index.cjs +155 -2287
- package/dist/jsonforms/index.js +104 -2352
- package/package.json +54 -24
package/dist/jsonforms/index.js
CHANGED
|
@@ -4070,7 +4070,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
|
4070
4070
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
4071
4071
|
return baseIsMatch(object, source, getMatchData(source), customizer);
|
|
4072
4072
|
}
|
|
4073
|
-
function
|
|
4073
|
+
function isNaN(value) {
|
|
4074
4074
|
return isNumber(value) && value != +value;
|
|
4075
4075
|
}
|
|
4076
4076
|
function isNative(value) {
|
|
@@ -5160,7 +5160,7 @@ __p += '`;
|
|
|
5160
5160
|
lodash.isMap = isMap;
|
|
5161
5161
|
lodash.isMatch = isMatch;
|
|
5162
5162
|
lodash.isMatchWith = isMatchWith;
|
|
5163
|
-
lodash.isNaN =
|
|
5163
|
+
lodash.isNaN = isNaN;
|
|
5164
5164
|
lodash.isNative = isNative;
|
|
5165
5165
|
lodash.isNil = isNil;
|
|
5166
5166
|
lodash.isNull = isNull;
|
|
@@ -5433,2295 +5433,46 @@ __p += '`;
|
|
|
5433
5433
|
}).call(exports);
|
|
5434
5434
|
});
|
|
5435
5435
|
|
|
5436
|
-
// src/core/components/RemoraidProvider/WidgetsProvider/index.tsx
|
|
5437
|
-
var import_lodash = __toESM(require_lodash(), 1);
|
|
5438
|
-
import React2, {
|
|
5439
|
-
useState,
|
|
5440
|
-
useContext
|
|
5441
|
-
} from "react";
|
|
5442
|
-
import { jsx } from "react/jsx-runtime";
|
|
5443
|
-
var widgetsContext = React2.createContext({
|
|
5444
|
-
widgets: {},
|
|
5445
|
-
activeWidget: null,
|
|
5446
|
-
updateActiveWidget: () => {},
|
|
5447
|
-
registerWidget: () => {},
|
|
5448
|
-
registerPage: () => {},
|
|
5449
|
-
isWidgetRegistered: () => false,
|
|
5450
|
-
isPageRegistered: () => false,
|
|
5451
|
-
updateWidgetSelection: () => {},
|
|
5452
|
-
updateWidgetSelectionBulk: () => {},
|
|
5453
|
-
isWidgetSelected: () => false,
|
|
5454
|
-
hideWidget: () => {}
|
|
5455
|
-
});
|
|
5456
|
-
var useWidgets = () => {
|
|
5457
|
-
return useContext(widgetsContext);
|
|
5458
|
-
};
|
|
5459
|
-
|
|
5460
|
-
// src/core/lib/utils.ts
|
|
5461
|
-
import {
|
|
5462
|
-
isValidElement
|
|
5463
|
-
} from "react";
|
|
5464
|
-
var co = (condition, value, fallback) => condition(value) ? value : fallback;
|
|
5465
|
-
var isValidElementOfType = (type, value) => {
|
|
5466
|
-
return isValidElement(value) && value.type === type;
|
|
5467
|
-
};
|
|
5468
|
-
var getElementTypeName = (type) => {
|
|
5469
|
-
if (typeof type === "string") {
|
|
5470
|
-
return type;
|
|
5471
|
-
}
|
|
5472
|
-
if (typeof type === "function") {
|
|
5473
|
-
return type.displayName ?? type.name ?? "anonymous component";
|
|
5474
|
-
}
|
|
5475
|
-
return "unknown";
|
|
5476
|
-
};
|
|
5477
|
-
var asElementOfType = (type, element, additionalErrorMessage) => {
|
|
5478
|
-
if (isValidElementOfType(type, element)) {
|
|
5479
|
-
return element;
|
|
5480
|
-
}
|
|
5481
|
-
throw new TypeError(`Expected React element of type ${getElementTypeName(type)}, but received type: ${getElementTypeName(element.type)}.${additionalErrorMessage !== undefined && additionalErrorMessage.length > 0 ? ` ${additionalErrorMessage}` : ""}`);
|
|
5482
|
-
};
|
|
5483
|
-
var asChildrenOfType = (type, children, additionalErrorMessage) => {
|
|
5484
|
-
if (children === undefined || children === null) {
|
|
5485
|
-
return children;
|
|
5486
|
-
}
|
|
5487
|
-
if (Array.isArray(children)) {
|
|
5488
|
-
return children.map((child) => asChildrenOfType(type, child, additionalErrorMessage));
|
|
5489
|
-
}
|
|
5490
|
-
return asElementOfType(type, children, additionalErrorMessage);
|
|
5491
|
-
};
|
|
5492
|
-
var asElementOrPropsOfType = (type, elementOrProps, additionalErrorMessage) => {
|
|
5493
|
-
if (isValidElement(elementOrProps)) {
|
|
5494
|
-
return asElementOfType(type, elementOrProps, additionalErrorMessage);
|
|
5495
|
-
}
|
|
5496
|
-
return elementOrProps;
|
|
5497
|
-
};
|
|
5498
|
-
var getDefaultButtonIconSize = (buttonSize) => {
|
|
5499
|
-
if (buttonSize === "xs") {
|
|
5500
|
-
return "extraSmall" /* ExtraSmall */;
|
|
5501
|
-
}
|
|
5502
|
-
if (buttonSize === "sm") {
|
|
5503
|
-
return "small" /* Small */;
|
|
5504
|
-
}
|
|
5505
|
-
if (buttonSize === "md") {
|
|
5506
|
-
return "medium" /* Medium */;
|
|
5507
|
-
}
|
|
5508
|
-
if (buttonSize === "lg") {
|
|
5509
|
-
return "large" /* Large */;
|
|
5510
|
-
}
|
|
5511
|
-
return "large" /* Large */;
|
|
5512
|
-
};
|
|
5513
|
-
|
|
5514
|
-
// src/core/components/RemoraidProvider/ThemeProvider/index.tsx
|
|
5515
|
-
import { px, rgba, useMantineTheme } from "@mantine/core";
|
|
5516
|
-
import {
|
|
5517
|
-
IconAlertCircle,
|
|
5518
|
-
IconCircleCheck,
|
|
5519
|
-
IconInfoCircle
|
|
5520
|
-
} from "@tabler/icons-react";
|
|
5521
|
-
import React3, {
|
|
5522
|
-
useContext as useContext3,
|
|
5523
|
-
useMemo as useMemo2,
|
|
5524
|
-
useLayoutEffect
|
|
5525
|
-
} from "react";
|
|
5526
|
-
|
|
5527
|
-
// src/core/components/RemoraidProvider/HydrationStatusProvider/index.tsx
|
|
5528
|
-
import { useMantineColorScheme } from "@mantine/core";
|
|
5529
|
-
import {
|
|
5530
|
-
createContext,
|
|
5531
|
-
useContext as useContext2,
|
|
5532
|
-
useEffect,
|
|
5533
|
-
useMemo,
|
|
5534
|
-
useState as useState2
|
|
5535
|
-
} from "react";
|
|
5536
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
5537
|
-
var defaultHydrationStatus = {
|
|
5538
|
-
hasHydrated: false,
|
|
5539
|
-
ensureHydration: () => {
|
|
5540
|
-
return;
|
|
5541
|
-
}
|
|
5542
|
-
};
|
|
5543
|
-
var hydrationStatusContext = createContext(defaultHydrationStatus);
|
|
5544
|
-
var useHydrationStatus = () => {
|
|
5545
|
-
return useContext2(hydrationStatusContext);
|
|
5546
|
-
};
|
|
5547
|
-
var useHydratedMantineColorScheme = () => {
|
|
5548
|
-
const { ensureHydration } = useHydrationStatus();
|
|
5549
|
-
return ensureHydration(useMantineColorScheme()) ?? {};
|
|
5550
|
-
};
|
|
5551
|
-
|
|
5552
|
-
// src/core/components/RemoraidProvider/ThemeProvider/index.tsx
|
|
5553
|
-
var import_lodash2 = __toESM(require_lodash(), 1);
|
|
5554
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
5555
|
-
var defaultTransitionDurations = {
|
|
5556
|
-
["short" /* Short */]: 200,
|
|
5557
|
-
["medium" /* Medium */]: 350,
|
|
5558
|
-
["long" /* Long */]: 500
|
|
5559
|
-
};
|
|
5560
|
-
var createRemoraidTheme = (customTheme, dependencies) => {
|
|
5561
|
-
const { mantineTheme, colorScheme } = dependencies ?? {};
|
|
5562
|
-
const transitionDurations = import_lodash2.merge(defaultTransitionDurations, customTheme?.transitionDurations);
|
|
5563
|
-
const transparentBackground = customTheme?.transparentBackground ?? (mantineTheme && colorScheme ? colorScheme === "dark" ? rgba(mantineTheme.colors.dark[8], 0.8) : rgba(mantineTheme.white, 0.8) : undefined);
|
|
5564
|
-
let spacingPx;
|
|
5565
|
-
if (mantineTheme && colorScheme) {
|
|
5566
|
-
spacingPx = {
|
|
5567
|
-
xs: Number(co((v) => !Number.isNaN(v), Number(px(mantineTheme.spacing.xs)), 0)),
|
|
5568
|
-
sm: Number(co((v) => !Number.isNaN(v), Number(px(mantineTheme.spacing.sm)), 0)),
|
|
5569
|
-
md: Number(co((v) => !Number.isNaN(v), Number(px(mantineTheme.spacing.md)), 0)),
|
|
5570
|
-
lg: Number(co((v) => !Number.isNaN(v), Number(px(mantineTheme.spacing.lg)), 0)),
|
|
5571
|
-
xl: Number(co((v) => !Number.isNaN(v), Number(px(mantineTheme.spacing.xl)), 0))
|
|
5572
|
-
};
|
|
5573
|
-
}
|
|
5574
|
-
const defaultTheme = {
|
|
5575
|
-
bodyColor: "light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-9))",
|
|
5576
|
-
containerSize: 1300,
|
|
5577
|
-
jsonStringifySpace: 2,
|
|
5578
|
-
transparentBackground,
|
|
5579
|
-
spacingPx,
|
|
5580
|
-
transitionDurations,
|
|
5581
|
-
breakpoints: {
|
|
5582
|
-
["buttonCollapse" /* ButtonCollapse */]: "md",
|
|
5583
|
-
["badgeGroupCollapse" /* BadgeGroupCollapse */]: "md",
|
|
5584
|
-
["navbarStaticElementsCollapse" /* NavbarStaticElementsCollapse */]: "xs"
|
|
5585
|
-
},
|
|
5586
|
-
primaryGutter: "md",
|
|
5587
|
-
componentsProps: {
|
|
5588
|
-
alerts: {
|
|
5589
|
-
["negative" /* Negative */]: {
|
|
5590
|
-
icon: IconAlertCircle,
|
|
5591
|
-
color: "red",
|
|
5592
|
-
title: "Attention!"
|
|
5593
|
-
},
|
|
5594
|
-
["neutral" /* Neutral */]: {
|
|
5595
|
-
icon: IconInfoCircle,
|
|
5596
|
-
color: mantineTheme?.primaryColor,
|
|
5597
|
-
title: "Information"
|
|
5598
|
-
},
|
|
5599
|
-
["positive" /* Positive */]: {
|
|
5600
|
-
icon: IconCircleCheck,
|
|
5601
|
-
color: "green",
|
|
5602
|
-
title: "Success"
|
|
5603
|
-
}
|
|
5604
|
-
},
|
|
5605
|
-
icons: {
|
|
5606
|
-
["tiny" /* Tiny */]: { size: 12, stroke: 2.6 },
|
|
5607
|
-
["extraSmall" /* ExtraSmall */]: { size: 16, stroke: 2.3 },
|
|
5608
|
-
["small" /* Small */]: { size: 20, stroke: 2 },
|
|
5609
|
-
["medium" /* Medium */]: { size: 24, stroke: 1.7 },
|
|
5610
|
-
["large" /* Large */]: { size: 28, stroke: 1.7 },
|
|
5611
|
-
["huge" /* Huge */]: { size: 44, stroke: 1.7 }
|
|
5612
|
-
}
|
|
5613
|
-
}
|
|
5614
|
-
};
|
|
5615
|
-
return import_lodash2.merge(defaultTheme, customTheme);
|
|
5616
|
-
};
|
|
5617
|
-
var themeContext = React3.createContext(createRemoraidTheme());
|
|
5618
|
-
var useRemoraidTheme = () => {
|
|
5619
|
-
return useContext3(themeContext);
|
|
5620
|
-
};
|
|
5621
|
-
|
|
5622
|
-
// src/core/components/RemoraidProvider/index.tsx
|
|
5623
|
-
import { CookiesProvider } from "react-cookie";
|
|
5624
|
-
|
|
5625
|
-
// src/core/components/RemoraidProvider/CoreUserExperienceProvider/index.tsx
|
|
5626
|
-
import { useContext as useContext4 } from "react";
|
|
5627
|
-
|
|
5628
|
-
// src/core/components/UserExperienceProviderWrapper/index.tsx
|
|
5629
|
-
var import_lodash3 = __toESM(require_lodash(), 1);
|
|
5630
|
-
import {
|
|
5631
|
-
createContext as createContext2,
|
|
5632
|
-
useEffect as useEffect2,
|
|
5633
|
-
useState as useState3
|
|
5634
|
-
} from "react";
|
|
5635
|
-
import { useCookies } from "react-cookie";
|
|
5636
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
5637
|
-
var createUserExperienceContext = (defaultUserExperience) => createContext2({
|
|
5638
|
-
userExperience: defaultUserExperience,
|
|
5639
|
-
updateUserExperience: () => {},
|
|
5640
|
-
processedCookie: false,
|
|
5641
|
-
initialUserExperience: defaultUserExperience
|
|
5642
|
-
});
|
|
5643
|
-
function UserExperienceProviderWrapper({
|
|
5644
|
-
children,
|
|
5645
|
-
context,
|
|
5646
|
-
cookieName,
|
|
5647
|
-
defaultUserExperience,
|
|
5648
|
-
isValidUserExperience,
|
|
5649
|
-
initialValue
|
|
5650
|
-
}) {
|
|
5651
|
-
const [cookies, setCookie] = useCookies();
|
|
5652
|
-
const initialUserExperience = import_lodash3.mergeWith({}, defaultUserExperience, initialValue, (_objValue, srcValue) => {
|
|
5653
|
-
if (Array.isArray(srcValue)) {
|
|
5654
|
-
return [...srcValue];
|
|
5655
|
-
}
|
|
5656
|
-
return;
|
|
5657
|
-
});
|
|
5658
|
-
const [userExperience, setUserExperience] = useState3(initialUserExperience);
|
|
5659
|
-
const [processedCookie, setProcessedCookie] = useState3(false);
|
|
5660
|
-
const updateUserExperience = (p) => {
|
|
5661
|
-
const updatedUserExperience = typeof p === "function" ? p(userExperience) : p;
|
|
5662
|
-
setCookie(cookieName, updatedUserExperience, { path: "/" });
|
|
5663
|
-
setUserExperience(updatedUserExperience);
|
|
5664
|
-
};
|
|
5665
|
-
useEffect2(() => {
|
|
5666
|
-
const userExperienceCookie = cookies[cookieName];
|
|
5667
|
-
if (userExperienceCookie && isValidUserExperience(userExperienceCookie)) {
|
|
5668
|
-
setUserExperience(userExperienceCookie);
|
|
5669
|
-
}
|
|
5670
|
-
if (cookies && !processedCookie) {
|
|
5671
|
-
setProcessedCookie(true);
|
|
5672
|
-
}
|
|
5673
|
-
}, [cookies]);
|
|
5674
|
-
return /* @__PURE__ */ jsx4(context.Provider, {
|
|
5675
|
-
value: {
|
|
5676
|
-
userExperience,
|
|
5677
|
-
updateUserExperience,
|
|
5678
|
-
processedCookie,
|
|
5679
|
-
initialUserExperience
|
|
5680
|
-
},
|
|
5681
|
-
children
|
|
5682
|
-
});
|
|
5683
|
-
}
|
|
5684
|
-
|
|
5685
|
-
// src/core/components/RemoraidProvider/CoreUserExperienceProvider/index.tsx
|
|
5686
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
5687
|
-
var defaultUserExperience = {
|
|
5688
|
-
showWelcomeMessage: true,
|
|
5689
|
-
navbar: { hiddenPages: [], mode: "responsive" /* Responsive */ }
|
|
5690
|
-
};
|
|
5691
|
-
var coreUserExperienceContext = createUserExperienceContext(defaultUserExperience);
|
|
5692
|
-
|
|
5693
|
-
// src/core/components/RemoraidProvider/LayoutsProvider/index.tsx
|
|
5694
|
-
import {
|
|
5695
|
-
createContext as createContext3,
|
|
5696
|
-
useContext as useContext5,
|
|
5697
|
-
useState as useState4
|
|
5698
|
-
} from "react";
|
|
5699
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
5700
|
-
var defaultLayoutsContext = {
|
|
5701
|
-
layouts: {},
|
|
5702
|
-
setLayouts: () => {}
|
|
5703
|
-
};
|
|
5704
|
-
var layoutsContext = createContext3(defaultLayoutsContext);
|
|
5705
|
-
var useLayouts = () => {
|
|
5706
|
-
return useContext5(layoutsContext);
|
|
5707
|
-
};
|
|
5708
|
-
|
|
5709
|
-
// src/core/components/RemoraidProvider/RouterProvider/index.tsx
|
|
5710
|
-
import {
|
|
5711
|
-
createContext as createContext4,
|
|
5712
|
-
useContext as useContext6
|
|
5713
|
-
} from "react";
|
|
5714
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
5715
|
-
var defaultRouter = {
|
|
5716
|
-
pathname: "/",
|
|
5717
|
-
push: () => {}
|
|
5718
|
-
};
|
|
5719
|
-
var routerContext = createContext4(defaultRouter);
|
|
5720
|
-
var useRemoraidRouter = () => {
|
|
5721
|
-
return useContext6(routerContext);
|
|
5722
|
-
};
|
|
5723
|
-
|
|
5724
|
-
// src/core/components/RemoraidProvider/index.tsx
|
|
5725
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
5726
|
-
// src/core/components/AppShell/index.tsx
|
|
5727
|
-
import { Box as Box5 } from "@mantine/core";
|
|
5728
|
-
import { useEffect as useEffect4 } from "react";
|
|
5729
|
-
|
|
5730
|
-
// src/core/components/AppShell/AppProvider/index.tsx
|
|
5731
|
-
var import_lodash4 = __toESM(require_lodash(), 1);
|
|
5732
|
-
import { createContext as createContext5, useContext as useContext7 } from "react";
|
|
5733
|
-
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
5734
|
-
var defaultAppContext = {
|
|
5735
|
-
name: "Hello, World!",
|
|
5736
|
-
nav: [],
|
|
5737
|
-
navbarVariant: "minimal" /* Minimal */,
|
|
5738
|
-
footerVariant: "minimal" /* Minimal */,
|
|
5739
|
-
navbarMobileVariant: null
|
|
5740
|
-
};
|
|
5741
|
-
var appContext = createContext5(defaultAppContext);
|
|
5742
|
-
var useRemoraidApp = () => {
|
|
5743
|
-
return useContext7(appContext);
|
|
5744
|
-
};
|
|
5745
|
-
function AppProvider({
|
|
5746
|
-
appContext: appContextProp,
|
|
5747
|
-
children
|
|
5748
|
-
}) {
|
|
5749
|
-
const { logo, ...appContextPropWithoutLogo } = appContextProp;
|
|
5750
|
-
return /* @__PURE__ */ jsx9(appContext.Provider, {
|
|
5751
|
-
value: { ...import_lodash4.merge(defaultAppContext, appContextPropWithoutLogo), logo },
|
|
5752
|
-
children
|
|
5753
|
-
});
|
|
5754
|
-
}
|
|
5755
|
-
|
|
5756
|
-
// src/core/components/AppShell/index.tsx
|
|
5757
|
-
var import_lodash13 = __toESM(require_lodash(), 1);
|
|
5758
|
-
|
|
5759
|
-
// src/core/components/AppShell/AppShellUserExperienceProvider/index.tsx
|
|
5760
|
-
var import_lodash12 = __toESM(require_lodash(), 1);
|
|
5761
|
-
import { useContext as useContext10 } from "react";
|
|
5762
|
-
|
|
5763
|
-
// src/core/components/AppShell/Footer/FooterMinimal/index.tsx
|
|
5764
|
-
import { Center } from "@mantine/core";
|
|
5765
|
-
import { IconPennant } from "@tabler/icons-react";
|
|
5766
|
-
var import_lodash6 = __toESM(require_lodash(), 1);
|
|
5767
|
-
|
|
5768
|
-
// src/core/components/Page/PageContainer/index.tsx
|
|
5769
|
-
import { Container } from "@mantine/core";
|
|
5770
|
-
|
|
5771
|
-
// node_modules/clsx/dist/clsx.mjs
|
|
5772
|
-
function r(e) {
|
|
5773
|
-
var t, f, n = "";
|
|
5774
|
-
if (typeof e == "string" || typeof e == "number")
|
|
5775
|
-
n += e;
|
|
5776
|
-
else if (typeof e == "object")
|
|
5777
|
-
if (Array.isArray(e)) {
|
|
5778
|
-
var o = e.length;
|
|
5779
|
-
for (t = 0;t < o; t++)
|
|
5780
|
-
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
5781
|
-
} else
|
|
5782
|
-
for (f in e)
|
|
5783
|
-
e[f] && (n && (n += " "), n += f);
|
|
5784
|
-
return n;
|
|
5785
|
-
}
|
|
5786
|
-
function clsx() {
|
|
5787
|
-
for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
|
|
5788
|
-
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
5789
|
-
return n;
|
|
5790
|
-
}
|
|
5791
|
-
var clsx_default = clsx;
|
|
5792
|
-
|
|
5793
|
-
// src/core/components/Page/PageContainer/index.tsx
|
|
5794
|
-
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
5795
|
-
function PageContainer({
|
|
5796
|
-
children,
|
|
5797
|
-
p = 0,
|
|
5798
|
-
hidden = false,
|
|
5799
|
-
componentsProps
|
|
5800
|
-
}) {
|
|
5801
|
-
const theme = useRemoraidTheme();
|
|
5802
|
-
return /* @__PURE__ */ jsx10(Container, {
|
|
5803
|
-
size: theme.containerSize,
|
|
5804
|
-
p,
|
|
5805
|
-
w: "100%",
|
|
5806
|
-
"data-hidden": hidden,
|
|
5807
|
-
...componentsProps?.container,
|
|
5808
|
-
className: clsx_default("remoraid-page-container", componentsProps?.container?.className),
|
|
5809
|
-
children
|
|
5810
|
-
});
|
|
5811
|
-
}
|
|
5812
|
-
|
|
5813
|
-
// src/core/components/FrameLayout/index.tsx
|
|
5814
|
-
import {
|
|
5815
|
-
Group,
|
|
5816
|
-
ScrollArea,
|
|
5817
|
-
Stack
|
|
5818
|
-
} from "@mantine/core";
|
|
5819
|
-
import {
|
|
5820
|
-
createContext as createContext7,
|
|
5821
|
-
useCallback,
|
|
5822
|
-
useContext as useContext9,
|
|
5823
|
-
useMemo as useMemo3
|
|
5824
|
-
} from "react";
|
|
5825
|
-
|
|
5826
|
-
// src/core/components/FrameLayout/Element/index.tsx
|
|
5827
|
-
import { createContext as createContext6, useContext as useContext8 } from "react";
|
|
5828
|
-
import { Box, Portal } from "@mantine/core";
|
|
5829
|
-
|
|
5830
|
-
// src/core/lib/errors.ts
|
|
5831
|
-
class InvalidComponentUsageError extends Error {
|
|
5832
|
-
constructor(component, rule) {
|
|
5833
|
-
super(`Invalid usage of '${component}': ${rule}`);
|
|
5834
|
-
this.name = "InvalidComponentUsageError";
|
|
5835
|
-
}
|
|
5836
|
-
}
|
|
5837
|
-
|
|
5838
|
-
// src/core/components/FrameLayout/Element/index.tsx
|
|
5839
|
-
var import_lodash5 = __toESM(require_lodash(), 1);
|
|
5840
|
-
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
5841
|
-
var layoutElementContext = createContext6(null);
|
|
5842
|
-
var useFrameLayoutElement = () => {
|
|
5843
|
-
return useContext8(layoutElementContext);
|
|
5844
|
-
};
|
|
5845
|
-
function Element2({
|
|
5846
|
-
section,
|
|
5847
|
-
includeContainer = true,
|
|
5848
|
-
includePageContainer = false,
|
|
5849
|
-
layoutId,
|
|
5850
|
-
hidden = false,
|
|
5851
|
-
componentsProps,
|
|
5852
|
-
children
|
|
5853
|
-
}) {
|
|
5854
|
-
const { layouts } = useLayouts();
|
|
5855
|
-
const closestLayout = useFrameLayout();
|
|
5856
|
-
if (!closestLayout) {
|
|
5857
|
-
throw new InvalidComponentUsageError("FrameLayout.Element", "must be used as child of 'FrameLayout'.");
|
|
5858
|
-
}
|
|
5859
|
-
const layout = layouts[layoutId ?? closestLayout.layoutId];
|
|
5860
|
-
if (!layout) {
|
|
5861
|
-
return null;
|
|
5862
|
-
}
|
|
5863
|
-
if (layout.type !== "frame" /* Frame */) {
|
|
5864
|
-
throw new TypeError("Prop 'layoutId' in 'FrameLayout.Element' must refer to a valid 'FrameLayout' component. Leave 'layoutId' undefined, if you want to use the closest 'FrameLayout' as reference layout.");
|
|
5865
|
-
}
|
|
5866
|
-
if (!layout.sections[section]) {
|
|
5867
|
-
return null;
|
|
5868
|
-
}
|
|
5869
|
-
let containerProps = {};
|
|
5870
|
-
if (section === "left" /* Left */ || section === "right" /* Right */) {
|
|
5871
|
-
containerProps.h = "100%";
|
|
5872
|
-
}
|
|
5873
|
-
const element = includePageContainer ? /* @__PURE__ */ jsx11(PageContainer, {
|
|
5874
|
-
p: 0,
|
|
5875
|
-
hidden,
|
|
5876
|
-
...componentsProps?.PageContainer,
|
|
5877
|
-
children
|
|
5878
|
-
}) : children;
|
|
5879
|
-
return /* @__PURE__ */ jsx11(Portal, {
|
|
5880
|
-
target: layout.sections[section],
|
|
5881
|
-
children: /* @__PURE__ */ jsx11(layoutElementContext.Provider, {
|
|
5882
|
-
value: { layoutType: "frame" /* Frame */, section },
|
|
5883
|
-
children: includeContainer ? /* @__PURE__ */ jsx11(Box, {
|
|
5884
|
-
"data-hidden": hidden,
|
|
5885
|
-
...import_lodash5.merge(containerProps, componentsProps?.container),
|
|
5886
|
-
className: clsx_default("remoraid-frame-layout-element", containerProps?.className, componentsProps?.container?.className),
|
|
5887
|
-
children: element
|
|
5888
|
-
}) : element
|
|
5889
|
-
})
|
|
5890
|
-
});
|
|
5891
|
-
}
|
|
5892
|
-
|
|
5893
|
-
// src/core/components/FrameLayout/index.tsx
|
|
5894
|
-
import { jsx as jsx12, jsxs } from "react/jsx-runtime";
|
|
5895
|
-
var layoutContext = createContext7(null);
|
|
5896
|
-
var useFrameLayout = () => {
|
|
5897
|
-
return useContext9(layoutContext);
|
|
5898
|
-
};
|
|
5899
|
-
function FrameLayout({
|
|
5900
|
-
layoutId,
|
|
5901
|
-
includeScrollArea = true,
|
|
5902
|
-
gutter = 0,
|
|
5903
|
-
componentsProps,
|
|
5904
|
-
children
|
|
5905
|
-
}) {
|
|
5906
|
-
const { layouts, setLayouts } = useLayouts();
|
|
5907
|
-
const layout = layouts[layoutId];
|
|
5908
|
-
const defaultSections = useMemo3(() => ({
|
|
5909
|
-
["bottom" /* Bottom */]: null,
|
|
5910
|
-
["right" /* Right */]: null,
|
|
5911
|
-
["top" /* Top */]: null,
|
|
5912
|
-
["left" /* Left */]: null,
|
|
5913
|
-
["content" /* Content */]: null
|
|
5914
|
-
}), []);
|
|
5915
|
-
const setSections = useCallback((value) => {
|
|
5916
|
-
setLayouts((prev) => ({
|
|
5917
|
-
...prev,
|
|
5918
|
-
[layoutId]: {
|
|
5919
|
-
type: "frame" /* Frame */,
|
|
5920
|
-
sections: typeof value === "function" ? value(prev[layoutId]?.sections ?? defaultSections) : value
|
|
5921
|
-
}
|
|
5922
|
-
}));
|
|
5923
|
-
}, [layoutId, setLayouts, defaultSections]);
|
|
5924
|
-
const topSectionRef = useCallback((n) => {
|
|
5925
|
-
setSections((prev) => ({
|
|
5926
|
-
...prev,
|
|
5927
|
-
["top" /* Top */]: n
|
|
5928
|
-
}));
|
|
5929
|
-
}, [setSections]);
|
|
5930
|
-
const bottomSectionRef = useCallback((n) => {
|
|
5931
|
-
setSections((prev) => ({
|
|
5932
|
-
...prev,
|
|
5933
|
-
["bottom" /* Bottom */]: n
|
|
5934
|
-
}));
|
|
5935
|
-
}, [setSections]);
|
|
5936
|
-
const leftSectionRef = useCallback((n) => {
|
|
5937
|
-
setSections((prev) => ({
|
|
5938
|
-
...prev,
|
|
5939
|
-
["left" /* Left */]: n
|
|
5940
|
-
}));
|
|
5941
|
-
}, [setSections]);
|
|
5942
|
-
const rightSectionRef = useCallback((n) => {
|
|
5943
|
-
setSections((prev) => ({
|
|
5944
|
-
...prev,
|
|
5945
|
-
["right" /* Right */]: n
|
|
5946
|
-
}));
|
|
5947
|
-
}, [setSections]);
|
|
5948
|
-
const contentSectionRef = useCallback((n) => {
|
|
5949
|
-
setSections((prev) => ({
|
|
5950
|
-
...prev,
|
|
5951
|
-
["content" /* Content */]: n
|
|
5952
|
-
}));
|
|
5953
|
-
}, [setSections]);
|
|
5954
|
-
const contentSection = /* @__PURE__ */ jsx12(Stack, {
|
|
5955
|
-
ref: contentSectionRef,
|
|
5956
|
-
h: "100%",
|
|
5957
|
-
gap: gutter,
|
|
5958
|
-
flex: 1,
|
|
5959
|
-
...componentsProps?.sectionContainers?.["content" /* Content */],
|
|
5960
|
-
className: clsx_default("remoraid-frame-layout-section", "remoraid-frame-layout-content-section", componentsProps?.sectionContainers?.["content" /* Content */]?.className),
|
|
5961
|
-
children
|
|
5962
|
-
});
|
|
5963
|
-
const layoutContextValue = useMemo3(() => ({
|
|
5964
|
-
type: "frame" /* Frame */,
|
|
5965
|
-
sections: defaultSections,
|
|
5966
|
-
...layout,
|
|
5967
|
-
layoutId
|
|
5968
|
-
}), [layout?.sections, defaultSections, layoutId]);
|
|
5969
|
-
return /* @__PURE__ */ jsx12(layoutContext.Provider, {
|
|
5970
|
-
value: layoutContextValue,
|
|
5971
|
-
children: /* @__PURE__ */ jsxs(Group, {
|
|
5972
|
-
gap: 0,
|
|
5973
|
-
h: "100%",
|
|
5974
|
-
w: "100%",
|
|
5975
|
-
wrap: "nowrap",
|
|
5976
|
-
...componentsProps?.horizontalContainer,
|
|
5977
|
-
style: {
|
|
5978
|
-
"--remoraid-frame-layout-gutter": typeof gutter === "string" ? `var(--mantine-spacing-${gutter})` : `${gutter}px`
|
|
5979
|
-
},
|
|
5980
|
-
className: clsx_default("remoraid-frame-layout", componentsProps?.horizontalContainer?.className),
|
|
5981
|
-
children: [
|
|
5982
|
-
/* @__PURE__ */ jsx12(Group, {
|
|
5983
|
-
ref: leftSectionRef,
|
|
5984
|
-
h: "100%",
|
|
5985
|
-
wrap: "nowrap",
|
|
5986
|
-
gap: gutter,
|
|
5987
|
-
pr: 0,
|
|
5988
|
-
...componentsProps?.sectionContainers?.["left" /* Left */],
|
|
5989
|
-
className: clsx_default("remoraid-frame-layout-section", "remoraid-frame-layout-left-section", componentsProps?.sectionContainers?.["left" /* Left */]?.className)
|
|
5990
|
-
}),
|
|
5991
|
-
/* @__PURE__ */ jsxs(Stack, {
|
|
5992
|
-
h: "100%",
|
|
5993
|
-
flex: 1,
|
|
5994
|
-
gap: 0,
|
|
5995
|
-
...componentsProps?.verticalContainer,
|
|
5996
|
-
className: clsx_default("remoraid-frame-layout-vertical-container", componentsProps?.verticalContainer?.className),
|
|
5997
|
-
children: [
|
|
5998
|
-
/* @__PURE__ */ jsx12(Stack, {
|
|
5999
|
-
ref: topSectionRef,
|
|
6000
|
-
gap: gutter,
|
|
6001
|
-
flex: 0,
|
|
6002
|
-
...componentsProps?.sectionContainers?.["top" /* Top */],
|
|
6003
|
-
className: clsx_default("remoraid-frame-layout-section", "remoraid-frame-layout-top-section", componentsProps?.sectionContainers?.["top" /* Top */]?.className)
|
|
6004
|
-
}),
|
|
6005
|
-
includeScrollArea ? /* @__PURE__ */ jsx12(ScrollArea, {
|
|
6006
|
-
flex: 1,
|
|
6007
|
-
...componentsProps?.ScrollArea,
|
|
6008
|
-
children: contentSection
|
|
6009
|
-
}) : contentSection,
|
|
6010
|
-
/* @__PURE__ */ jsx12(Stack, {
|
|
6011
|
-
ref: bottomSectionRef,
|
|
6012
|
-
gap: gutter,
|
|
6013
|
-
flex: 0,
|
|
6014
|
-
...componentsProps?.sectionContainers?.["bottom" /* Bottom */],
|
|
6015
|
-
className: clsx_default("remoraid-frame-layout-section", "remoraid-frame-layout-bottom-section", componentsProps?.sectionContainers?.["bottom" /* Bottom */]?.className)
|
|
6016
|
-
})
|
|
6017
|
-
]
|
|
6018
|
-
}),
|
|
6019
|
-
/* @__PURE__ */ jsx12(Group, {
|
|
6020
|
-
ref: rightSectionRef,
|
|
6021
|
-
h: "100%",
|
|
6022
|
-
gap: gutter,
|
|
6023
|
-
pl: 0,
|
|
6024
|
-
wrap: "nowrap",
|
|
6025
|
-
...componentsProps?.sectionContainers?.["right" /* Right */],
|
|
6026
|
-
className: clsx_default("remoraid-frame-layout-section", "remoraid-frame-layout-right-section", componentsProps?.sectionContainers?.["right" /* Right */]?.className)
|
|
6027
|
-
})
|
|
6028
|
-
]
|
|
6029
|
-
})
|
|
6030
|
-
});
|
|
6031
|
-
}
|
|
6032
|
-
var FrameLayout_default = Object.assign(FrameLayout, {
|
|
6033
|
-
Element: Element2
|
|
6034
|
-
});
|
|
6035
|
-
|
|
6036
|
-
// src/core/components/AppShell/Footer/FooterMinimal/index.tsx
|
|
6037
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
6038
|
-
function FooterMinimal({
|
|
6039
|
-
icon: Icon2 = IconPennant,
|
|
6040
|
-
componentsProps
|
|
6041
|
-
}) {
|
|
6042
|
-
const theme = useRemoraidTheme();
|
|
6043
|
-
const {
|
|
6044
|
-
userExperience: {
|
|
6045
|
-
footer: { position }
|
|
6046
|
-
}
|
|
6047
|
-
} = useAppShellUserExperience();
|
|
6048
|
-
const content = /* @__PURE__ */ jsx13(PageContainer, {
|
|
6049
|
-
...componentsProps?.container,
|
|
6050
|
-
children: /* @__PURE__ */ jsx13(Center, {
|
|
6051
|
-
children: /* @__PURE__ */ jsx13(Icon2, {
|
|
6052
|
-
color: "var(--mantine-color-default-border)",
|
|
6053
|
-
...theme.componentsProps.icons.huge,
|
|
6054
|
-
...componentsProps?.icon
|
|
6055
|
-
})
|
|
6056
|
-
})
|
|
6057
|
-
});
|
|
6058
|
-
if (position === "bottom" /* Bottom */) {
|
|
6059
|
-
return /* @__PURE__ */ jsx13(FrameLayout_default.Element, {
|
|
6060
|
-
section: position,
|
|
6061
|
-
includeContainer: true,
|
|
6062
|
-
...componentsProps?.layoutElement,
|
|
6063
|
-
componentsProps: import_lodash6.merge({ container: { style: { order: -50 } } }, componentsProps?.layoutElement?.componentsProps),
|
|
6064
|
-
children: content
|
|
6065
|
-
});
|
|
6066
|
-
}
|
|
6067
|
-
if (position === "content" /* Content */) {
|
|
6068
|
-
return content;
|
|
6069
|
-
}
|
|
6070
|
-
return null;
|
|
6071
|
-
}
|
|
6072
|
-
|
|
6073
|
-
// src/core/components/AppShell/Footer/index.tsx
|
|
6074
|
-
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
6075
|
-
var supportedFooterPositions = {
|
|
6076
|
-
["minimal" /* Minimal */]: [
|
|
6077
|
-
null,
|
|
6078
|
-
"bottom" /* Bottom */,
|
|
6079
|
-
"content" /* Content */
|
|
6080
|
-
]
|
|
6081
|
-
};
|
|
6082
|
-
var defaultFooterPositions = {
|
|
6083
|
-
["minimal" /* Minimal */]: "content" /* Content */
|
|
6084
|
-
};
|
|
6085
|
-
function Footer({ componentsProps }) {
|
|
6086
|
-
const { footerVariant } = useRemoraidApp();
|
|
6087
|
-
if (footerVariant === "minimal" /* Minimal */) {
|
|
6088
|
-
return /* @__PURE__ */ jsx14(FooterMinimal, {
|
|
6089
|
-
...componentsProps?.FooterMinimal
|
|
6090
|
-
});
|
|
6091
|
-
}
|
|
6092
|
-
return null;
|
|
6093
|
-
}
|
|
6094
|
-
var Footer_default = Object.assign(Footer, {
|
|
6095
|
-
FooterMinimal
|
|
6096
|
-
});
|
|
6097
|
-
|
|
6098
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/index.tsx
|
|
6099
|
-
import { useState as useState7 } from "react";
|
|
6100
|
-
|
|
6101
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6102
|
-
import {
|
|
6103
|
-
Box as Box3,
|
|
6104
|
-
Group as Group2,
|
|
6105
|
-
Paper,
|
|
6106
|
-
ScrollArea as ScrollArea2,
|
|
6107
|
-
Stack as Stack2
|
|
6108
|
-
} from "@mantine/core";
|
|
6109
|
-
var import_lodash8 = __toESM(require_lodash(), 1);
|
|
6110
|
-
|
|
6111
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/NavigationMenu/index.tsx
|
|
6112
|
-
import {
|
|
6113
|
-
Box as Box2,
|
|
6114
|
-
Menu,
|
|
6115
|
-
Transition,
|
|
6116
|
-
useMantineTheme as useMantineTheme2
|
|
6117
|
-
} from "@mantine/core";
|
|
6118
|
-
import { isValidElement as isValidElement2 } from "react";
|
|
6119
|
-
import { jsx as jsx15, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
6120
|
-
function NavigationMenu({
|
|
6121
|
-
target,
|
|
6122
|
-
elements,
|
|
6123
|
-
label,
|
|
6124
|
-
componentsProps
|
|
6125
|
-
}) {
|
|
6126
|
-
const theme = useRemoraidTheme();
|
|
6127
|
-
const mantineTheme = useMantineTheme2();
|
|
6128
|
-
const router = useRemoraidRouter();
|
|
6129
|
-
const { pathname } = router;
|
|
6130
|
-
const item = (element) => /* @__PURE__ */ jsx15(Transition, {
|
|
6131
|
-
mounted: element.mounted ?? true,
|
|
6132
|
-
...componentsProps?.transition,
|
|
6133
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx15(Menu.Item, {
|
|
6134
|
-
leftSection: element.icon ? /* @__PURE__ */ jsx15(element.icon, {
|
|
6135
|
-
...theme.componentsProps.icons.small
|
|
6136
|
-
}) : undefined,
|
|
6137
|
-
c: element.type === "anchor" /* Anchor */ && element.href === pathname ? mantineTheme.primaryColor : undefined,
|
|
6138
|
-
onClick: (e) => {
|
|
6139
|
-
if (element.type === "anchor" /* Anchor */) {
|
|
6140
|
-
router.push(element.href);
|
|
6141
|
-
}
|
|
6142
|
-
if (element.type === "button" /* Button */) {
|
|
6143
|
-
element.onClick(e);
|
|
6144
|
-
}
|
|
6145
|
-
},
|
|
6146
|
-
style: transitionStyle,
|
|
6147
|
-
children: element.label
|
|
6148
|
-
})
|
|
6149
|
-
});
|
|
6150
|
-
const targetElement = isValidElement2(target) ? target : item(target);
|
|
6151
|
-
if (elements === undefined || elements.length === 0) {
|
|
6152
|
-
return targetElement;
|
|
6153
|
-
}
|
|
6154
|
-
return /* @__PURE__ */ jsxs2(Menu, {
|
|
6155
|
-
trigger: "click-hover",
|
|
6156
|
-
...componentsProps?.Menu,
|
|
6157
|
-
children: [
|
|
6158
|
-
/* @__PURE__ */ jsx15(Menu.Target, {
|
|
6159
|
-
children: /* @__PURE__ */ jsx15(Box2, {
|
|
6160
|
-
children: targetElement
|
|
6161
|
-
})
|
|
6162
|
-
}),
|
|
6163
|
-
/* @__PURE__ */ jsxs2(Menu.Dropdown, {
|
|
6164
|
-
children: [
|
|
6165
|
-
label !== undefined && /* @__PURE__ */ jsx15(Menu.Label, {
|
|
6166
|
-
children: label
|
|
6167
|
-
}),
|
|
6168
|
-
elements.map((element, i) => /* @__PURE__ */ jsx15(NavigationMenu, {
|
|
6169
|
-
target: item(element),
|
|
6170
|
-
elements: element.children,
|
|
6171
|
-
componentsProps
|
|
6172
|
-
}, `navigation-menu-${i}`))
|
|
6173
|
-
]
|
|
6174
|
-
})
|
|
6175
|
-
]
|
|
6176
|
-
});
|
|
6177
|
-
}
|
|
6178
|
-
|
|
6179
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6180
|
-
import { IconDots } from "@tabler/icons-react";
|
|
6181
|
-
|
|
6182
|
-
// src/core/components/RemoraidButton/index.tsx
|
|
6183
|
-
var import_lodash7 = __toESM(require_lodash(), 1);
|
|
6184
|
-
import {
|
|
6185
|
-
ActionIcon,
|
|
6186
|
-
Button,
|
|
6187
|
-
Tooltip,
|
|
6188
|
-
Transition as Transition2
|
|
6189
|
-
} from "@mantine/core";
|
|
6190
|
-
import { IconClick } from "@tabler/icons-react";
|
|
6191
|
-
import {
|
|
6192
|
-
isValidElement as isValidElement3
|
|
6193
|
-
} from "react";
|
|
6194
|
-
import { jsx as jsx16, jsxs as jsxs3, Fragment } from "react/jsx-runtime";
|
|
6195
|
-
var defaultRemoraidButtonSize = "sm";
|
|
6196
|
-
function RemoraidButton({
|
|
6197
|
-
label,
|
|
6198
|
-
responsive: responsiveProp,
|
|
6199
|
-
breakpoint: breakpointProp,
|
|
6200
|
-
collapsed: collapsedProp,
|
|
6201
|
-
size = defaultRemoraidButtonSize,
|
|
6202
|
-
color,
|
|
6203
|
-
onClick,
|
|
6204
|
-
loading,
|
|
6205
|
-
variant = "default",
|
|
6206
|
-
mounted = true,
|
|
6207
|
-
icon: iconProp,
|
|
6208
|
-
iconSize: iconSizeProp,
|
|
6209
|
-
clickTransformation = "default" /* Default */,
|
|
6210
|
-
componentsProps
|
|
6211
|
-
}) {
|
|
6212
|
-
const theme = useRemoraidTheme();
|
|
6213
|
-
const responsive = responsiveProp ?? true;
|
|
6214
|
-
const breakpoint = breakpointProp ?? theme.breakpoints.buttonCollapse;
|
|
6215
|
-
const collapsed = collapsedProp ?? false;
|
|
6216
|
-
const iconSize = iconSizeProp ?? getDefaultButtonIconSize(size);
|
|
6217
|
-
const Icon3 = iconProp ?? IconClick;
|
|
6218
|
-
const iconElement = isValidElement3(Icon3) ? Icon3 : /* @__PURE__ */ jsx16(Icon3, {
|
|
6219
|
-
...import_lodash7.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
|
|
6220
|
-
});
|
|
6221
|
-
const clickTransformationClassNames = {
|
|
6222
|
-
["default" /* Default */]: null,
|
|
6223
|
-
["none" /* None */]: "remoraid-button-none",
|
|
6224
|
-
["scale" /* Scale */]: "remoraid-button-scale",
|
|
6225
|
-
["tiltDown" /* TiltDown */]: "remoraid-button-tilt-down",
|
|
6226
|
-
["tiltUp" /* TiltUp */]: "remoraid-button-tilt-up",
|
|
6227
|
-
["tiltLeft" /* TiltLeft */]: "remoraid-button-tilt-left",
|
|
6228
|
-
["tiltRight" /* TiltRight */]: "remoraid-button-tilt-right"
|
|
6229
|
-
};
|
|
6230
|
-
const clickTransformationClass = clickTransformationClassNames[clickTransformation];
|
|
6231
|
-
return /* @__PURE__ */ jsx16(Transition2, {
|
|
6232
|
-
mounted,
|
|
6233
|
-
transition: "fade",
|
|
6234
|
-
duration: theme.transitionDurations.short,
|
|
6235
|
-
timingFunction: "ease",
|
|
6236
|
-
...componentsProps?.transition,
|
|
6237
|
-
children: (transitionStyle) => /* @__PURE__ */ jsxs3(Fragment, {
|
|
6238
|
-
children: [
|
|
6239
|
-
/* @__PURE__ */ jsx16(Tooltip, {
|
|
6240
|
-
label,
|
|
6241
|
-
...componentsProps?.tooltip,
|
|
6242
|
-
children: /* @__PURE__ */ jsx16(ActionIcon, {
|
|
6243
|
-
"aria-label": label,
|
|
6244
|
-
variant,
|
|
6245
|
-
onClick,
|
|
6246
|
-
loading,
|
|
6247
|
-
size: size ? `input-${size}` : "input-sm",
|
|
6248
|
-
color,
|
|
6249
|
-
...componentsProps?.button,
|
|
6250
|
-
...componentsProps?.ActionIcon,
|
|
6251
|
-
hiddenFrom: !responsive ? undefined : breakpoint,
|
|
6252
|
-
display: !responsive && !collapsed ? "none" : componentsProps?.ActionIcon?.display ?? componentsProps?.button?.display,
|
|
6253
|
-
style: import_lodash7.merge(transitionStyle, componentsProps?.button?.style, componentsProps?.ActionIcon?.style),
|
|
6254
|
-
className: clsx_default(clickTransformationClass, componentsProps?.ActionIcon?.className, componentsProps?.button?.className),
|
|
6255
|
-
children: iconElement
|
|
6256
|
-
})
|
|
6257
|
-
}),
|
|
6258
|
-
/* @__PURE__ */ jsx16(Button, {
|
|
6259
|
-
onClick,
|
|
6260
|
-
loading,
|
|
6261
|
-
variant,
|
|
6262
|
-
size,
|
|
6263
|
-
color,
|
|
6264
|
-
leftSection: iconProp !== undefined ? iconElement : undefined,
|
|
6265
|
-
...componentsProps?.button,
|
|
6266
|
-
...componentsProps?.Button,
|
|
6267
|
-
visibleFrom: !responsive ? undefined : breakpoint,
|
|
6268
|
-
display: !responsive && collapsed ? "none" : componentsProps?.Button?.display ?? componentsProps?.button?.display,
|
|
6269
|
-
style: import_lodash7.merge(transitionStyle, componentsProps?.button?.style, componentsProps?.Button?.style),
|
|
6270
|
-
className: clsx_default(clickTransformationClass, componentsProps?.Button?.className, componentsProps?.button?.className),
|
|
6271
|
-
children: label
|
|
6272
|
-
})
|
|
6273
|
-
]
|
|
6274
|
-
})
|
|
6275
|
-
});
|
|
6276
|
-
}
|
|
6277
|
-
|
|
6278
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6279
|
-
import { jsx as jsx17, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
6280
|
-
function NavbarMinimalContent({
|
|
6281
|
-
orientation,
|
|
6282
|
-
maxElements,
|
|
6283
|
-
collapseStaticElementsBreakpoint: collapseStaticElementsBreakpointProp,
|
|
6284
|
-
componentsProps
|
|
6285
|
-
}) {
|
|
6286
|
-
const theme = useRemoraidTheme();
|
|
6287
|
-
const { userExperience: appShellUserExperience } = useAppShellUserExperience();
|
|
6288
|
-
const app = useRemoraidApp();
|
|
6289
|
-
const router = useRemoraidRouter();
|
|
6290
|
-
const { pathname } = router;
|
|
6291
|
-
const layoutElement = useFrameLayoutElement();
|
|
6292
|
-
const { colorScheme, setColorScheme } = useHydratedMantineColorScheme();
|
|
6293
|
-
const collapseStaticElementsBreakpoint = collapseStaticElementsBreakpointProp ?? theme.breakpoints.navbarStaticElementsCollapse;
|
|
6294
|
-
const mode = appShellUserExperience.navbar.mode;
|
|
6295
|
-
const floatingPositions = {
|
|
6296
|
-
["bottom" /* Bottom */]: "top",
|
|
6297
|
-
["left" /* Left */]: "right",
|
|
6298
|
-
["top" /* Top */]: "bottom",
|
|
6299
|
-
["right" /* Right */]: "left",
|
|
6300
|
-
["content" /* Content */]: undefined
|
|
6301
|
-
};
|
|
6302
|
-
const floatingPosition = layoutElement?.section ? floatingPositions[layoutElement.section] : undefined;
|
|
6303
|
-
const buttonResponsive = mode === "responsive" /* Responsive */;
|
|
6304
|
-
let buttonCollapsed = undefined;
|
|
6305
|
-
if (mode === "collapsed" /* Collapsed */) {
|
|
6306
|
-
buttonCollapsed = true;
|
|
6307
|
-
} else if (mode === "expanded" /* Expanded */) {
|
|
6308
|
-
buttonCollapsed = false;
|
|
6309
|
-
}
|
|
6310
|
-
const buttonClickTransformation = orientation === "horizontal" /* Horizontal */ ? "tiltRight" /* TiltRight */ : "default" /* Default */;
|
|
6311
|
-
const logoButton = app.logo ? /* @__PURE__ */ jsx17(RemoraidButton, {
|
|
6312
|
-
label: app.name,
|
|
6313
|
-
variant: "subtle",
|
|
6314
|
-
icon: app.logo,
|
|
6315
|
-
responsive: buttonResponsive,
|
|
6316
|
-
collapsed: buttonCollapsed,
|
|
6317
|
-
clickTransformation: buttonClickTransformation,
|
|
6318
|
-
...componentsProps?.button,
|
|
6319
|
-
...componentsProps?.logoButton,
|
|
6320
|
-
componentsProps: import_lodash8.merge({
|
|
6321
|
-
button: {
|
|
6322
|
-
c: "var(--mantine-color-text)"
|
|
6323
|
-
},
|
|
6324
|
-
Button: { justify: "flex-start" },
|
|
6325
|
-
tooltip: { position: floatingPosition }
|
|
6326
|
-
}, componentsProps?.button?.componentsProps, componentsProps?.logoButton?.componentsProps),
|
|
6327
|
-
onClick: (e) => {
|
|
6328
|
-
componentsProps?.button?.onClick?.(e);
|
|
6329
|
-
componentsProps?.logoButton?.onClick?.(e);
|
|
6330
|
-
}
|
|
6331
|
-
}) : undefined;
|
|
6332
|
-
const button = (element, key) => /* @__PURE__ */ jsx17(NavigationMenu, {
|
|
6333
|
-
label: element.label,
|
|
6334
|
-
target: /* @__PURE__ */ jsx17(RemoraidButton, {
|
|
6335
|
-
mounted: element.mounted,
|
|
6336
|
-
label: element.label,
|
|
6337
|
-
icon: element.icon,
|
|
6338
|
-
variant: element.type === "anchor" /* Anchor */ && element.href === pathname ? "light" : "default",
|
|
6339
|
-
responsive: buttonResponsive,
|
|
6340
|
-
collapsed: buttonCollapsed,
|
|
6341
|
-
clickTransformation: buttonClickTransformation,
|
|
6342
|
-
...componentsProps?.button,
|
|
6343
|
-
componentsProps: import_lodash8.merge({
|
|
6344
|
-
tooltip: {
|
|
6345
|
-
position: floatingPosition,
|
|
6346
|
-
disabled: element.children !== undefined && element.children.length > 0
|
|
6347
|
-
},
|
|
6348
|
-
Button: { justify: "flex-start" },
|
|
6349
|
-
button: {
|
|
6350
|
-
w: orientation === "vertical" /* Vertical */ ? "100%" : undefined
|
|
6351
|
-
}
|
|
6352
|
-
}, componentsProps?.button?.componentsProps),
|
|
6353
|
-
onClick: (e) => {
|
|
6354
|
-
if (element.type === "anchor" /* Anchor */) {
|
|
6355
|
-
router.push(element.href);
|
|
6356
|
-
}
|
|
6357
|
-
if (element.type === "button" /* Button */) {
|
|
6358
|
-
element.onClick(e);
|
|
6359
|
-
}
|
|
6360
|
-
componentsProps?.button?.onClick?.(e);
|
|
6361
|
-
}
|
|
6362
|
-
}),
|
|
6363
|
-
elements: element.children,
|
|
6364
|
-
...componentsProps?.NavigationMenu,
|
|
6365
|
-
componentsProps: import_lodash8.merge({
|
|
6366
|
-
Menu: { position: floatingPosition }
|
|
6367
|
-
}, componentsProps?.NavigationMenu?.componentsProps)
|
|
6368
|
-
}, key);
|
|
6369
|
-
const elements = [
|
|
6370
|
-
...app.nav,
|
|
6371
|
-
...getDefaultNavigationElements({ colorScheme, setColorScheme })
|
|
6372
|
-
];
|
|
6373
|
-
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}`));
|
|
6374
|
-
const staticElements = elements.filter((element) => element.static);
|
|
6375
|
-
const staticButtons = staticElements.sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0)).map((element, i) => button(element, `static-nav-element-${i}`));
|
|
6376
|
-
const collapseStaticElements = staticElements.filter((element) => element.mounted ?? true).length > 1;
|
|
6377
|
-
const staticMenuButton = collapseStaticElements ? /* @__PURE__ */ jsx17(Box3, {
|
|
6378
|
-
hiddenFrom: collapseStaticElementsBreakpoint,
|
|
6379
|
-
children: /* @__PURE__ */ jsx17(NavigationMenu, {
|
|
6380
|
-
elements: staticElements,
|
|
6381
|
-
target: /* @__PURE__ */ jsx17(RemoraidButton, {
|
|
6382
|
-
label: "Static elements",
|
|
6383
|
-
icon: IconDots,
|
|
6384
|
-
responsive: orientation === "vertical" /* Vertical */ ? buttonResponsive : false,
|
|
6385
|
-
collapsed: orientation === "vertical" /* Vertical */ ? buttonCollapsed : true,
|
|
6386
|
-
clickTransformation: buttonClickTransformation,
|
|
6387
|
-
...componentsProps?.button,
|
|
6388
|
-
componentsProps: import_lodash8.merge({
|
|
6389
|
-
tooltip: { disabled: true },
|
|
6390
|
-
Button: { justify: "flex-start" },
|
|
6391
|
-
button: {
|
|
6392
|
-
w: orientation === "vertical" /* Vertical */ ? "100%" : undefined
|
|
6393
|
-
}
|
|
6394
|
-
}, componentsProps?.button?.componentsProps)
|
|
6395
|
-
}),
|
|
6396
|
-
...componentsProps?.NavigationMenu,
|
|
6397
|
-
componentsProps: import_lodash8.merge({
|
|
6398
|
-
Menu: { position: floatingPosition }
|
|
6399
|
-
}, componentsProps?.NavigationMenu?.componentsProps)
|
|
6400
|
-
})
|
|
6401
|
-
}) : null;
|
|
6402
|
-
return /* @__PURE__ */ jsx17(Paper, {
|
|
6403
|
-
bg: theme.transparentBackground,
|
|
6404
|
-
h: "100%",
|
|
6405
|
-
p: "md",
|
|
6406
|
-
shadow: "md",
|
|
6407
|
-
...componentsProps?.container,
|
|
6408
|
-
children: orientation === "vertical" /* Vertical */ ? /* @__PURE__ */ jsxs4(Stack2, {
|
|
6409
|
-
h: "100%",
|
|
6410
|
-
children: [
|
|
6411
|
-
logoButton,
|
|
6412
|
-
/* @__PURE__ */ jsx17(ScrollArea2, {
|
|
6413
|
-
flex: 1,
|
|
6414
|
-
children: /* @__PURE__ */ jsx17(Stack2, {
|
|
6415
|
-
children: buttons
|
|
6416
|
-
})
|
|
6417
|
-
}),
|
|
6418
|
-
/* @__PURE__ */ jsx17(Stack2, {
|
|
6419
|
-
visibleFrom: collapseStaticElements ? collapseStaticElementsBreakpoint : undefined,
|
|
6420
|
-
children: staticButtons
|
|
6421
|
-
}),
|
|
6422
|
-
staticMenuButton
|
|
6423
|
-
]
|
|
6424
|
-
}) : /* @__PURE__ */ jsxs4(Group2, {
|
|
6425
|
-
wrap: "nowrap",
|
|
6426
|
-
children: [
|
|
6427
|
-
logoButton,
|
|
6428
|
-
/* @__PURE__ */ jsx17(ScrollArea2, {
|
|
6429
|
-
flex: 1,
|
|
6430
|
-
style: { contain: "inline-size" },
|
|
6431
|
-
children: /* @__PURE__ */ jsx17(Group2, {
|
|
6432
|
-
wrap: "nowrap",
|
|
6433
|
-
children: buttons
|
|
6434
|
-
})
|
|
6435
|
-
}),
|
|
6436
|
-
/* @__PURE__ */ jsx17(Group2, {
|
|
6437
|
-
wrap: "nowrap",
|
|
6438
|
-
visibleFrom: collapseStaticElements ? collapseStaticElementsBreakpoint : undefined,
|
|
6439
|
-
children: staticButtons
|
|
6440
|
-
}),
|
|
6441
|
-
staticMenuButton
|
|
6442
|
-
]
|
|
6443
|
-
})
|
|
6444
|
-
});
|
|
6445
|
-
}
|
|
6446
|
-
|
|
6447
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/index.tsx
|
|
6448
|
-
var import_lodash11 = __toESM(require_lodash(), 1);
|
|
6449
|
-
|
|
6450
|
-
// src/core/components/Pinnable/index.tsx
|
|
6451
|
-
import {
|
|
6452
|
-
useEffect as useEffect3,
|
|
6453
|
-
useMemo as useMemo4,
|
|
6454
|
-
useRef as useRef2,
|
|
6455
|
-
useState as useState6
|
|
6456
|
-
} from "react";
|
|
6457
|
-
import { IconPin, IconPinnedOff } from "@tabler/icons-react";
|
|
6458
|
-
import { Box as Box4, Portal as Portal2 } from "@mantine/core";
|
|
6459
|
-
|
|
6460
|
-
// src/core/components/Controls/ControlButton/index.tsx
|
|
6461
|
-
import {
|
|
6462
|
-
ActionIcon as ActionIcon2,
|
|
6463
|
-
Tooltip as Tooltip2,
|
|
6464
|
-
Transition as Transition3
|
|
6465
|
-
} from "@mantine/core";
|
|
6466
|
-
import { IconClick as IconClick2 } from "@tabler/icons-react";
|
|
6467
|
-
var import_lodash9 = __toESM(require_lodash(), 1);
|
|
6468
|
-
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
6469
|
-
function ControlButton({
|
|
6470
|
-
icon: Icon4 = IconClick2,
|
|
6471
|
-
mounted = true,
|
|
6472
|
-
size = "xs",
|
|
6473
|
-
iconSize = "tiny" /* Tiny */,
|
|
6474
|
-
onClick,
|
|
6475
|
-
order,
|
|
6476
|
-
color,
|
|
6477
|
-
tooltip,
|
|
6478
|
-
componentsProps
|
|
6479
|
-
}) {
|
|
6480
|
-
const theme = useRemoraidTheme();
|
|
6481
|
-
return /* @__PURE__ */ jsx18(Transition3, {
|
|
6482
|
-
mounted,
|
|
6483
|
-
transition: "fade",
|
|
6484
|
-
duration: theme.transitionDurations.short,
|
|
6485
|
-
timingFunction: "ease",
|
|
6486
|
-
...componentsProps?.transition,
|
|
6487
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx18(Tooltip2, {
|
|
6488
|
-
label: tooltip,
|
|
6489
|
-
disabled: !Boolean(tooltip),
|
|
6490
|
-
...componentsProps?.tooltip,
|
|
6491
|
-
children: /* @__PURE__ */ jsx18(ActionIcon2, {
|
|
6492
|
-
"data-control-button": true,
|
|
6493
|
-
size,
|
|
6494
|
-
color,
|
|
6495
|
-
onClick,
|
|
6496
|
-
radius: "xl",
|
|
6497
|
-
...componentsProps?.button,
|
|
6498
|
-
style: {
|
|
6499
|
-
order,
|
|
6500
|
-
...import_lodash9.merge(transitionStyle, componentsProps?.button?.style)
|
|
6501
|
-
},
|
|
6502
|
-
children: /* @__PURE__ */ jsx18(Icon4, {
|
|
6503
|
-
...import_lodash9.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
|
|
6504
|
-
})
|
|
6505
|
-
})
|
|
6506
|
-
})
|
|
6507
|
-
});
|
|
6508
|
-
}
|
|
6509
|
-
|
|
6510
|
-
// src/core/components/Controls/index.tsx
|
|
6511
|
-
import { useRef, useState as useState5 } from "react";
|
|
6512
|
-
import {
|
|
6513
|
-
Group as Group3,
|
|
6514
|
-
Paper as Paper2,
|
|
6515
|
-
Transition as Transition4
|
|
6516
|
-
} from "@mantine/core";
|
|
6517
|
-
import { IconGripHorizontal } from "@tabler/icons-react";
|
|
6518
|
-
var import_lodash10 = __toESM(require_lodash(), 1);
|
|
6519
|
-
import { jsx as jsx19, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
6520
|
-
function Controls({
|
|
6521
|
-
groupRef,
|
|
6522
|
-
mounted = true,
|
|
6523
|
-
dragContainerRef,
|
|
6524
|
-
gutter = 5,
|
|
6525
|
-
iconSize = "tiny" /* Tiny */,
|
|
6526
|
-
additionalButtons: additionalButtonsProp,
|
|
6527
|
-
componentsProps,
|
|
6528
|
-
children: childrenProp
|
|
6529
|
-
}) {
|
|
6530
|
-
const additionalButtons = additionalButtonsProp?.map((additionalButton) => asElementOrPropsOfType(ControlButton, additionalButton, "Check the 'additionalButtons' property of 'Controls'."));
|
|
6531
|
-
const children = asChildrenOfType(ControlButton, childrenProp, "Check children passed to 'Controls' component.");
|
|
6532
|
-
const theme = useRemoraidTheme();
|
|
6533
|
-
const [pos, setPos] = useState5({
|
|
6534
|
-
x: 0,
|
|
6535
|
-
y: 0
|
|
6536
|
-
});
|
|
6537
|
-
const offsetRef = useRef({ x: 0, y: 0 });
|
|
6538
|
-
const containerRef = useRef(null);
|
|
6539
|
-
const clamp = (v, min, max) => {
|
|
6540
|
-
return Math.min(Math.max(v, min), max);
|
|
6541
|
-
};
|
|
6542
|
-
const handlePointerDown = (e) => {
|
|
6543
|
-
if (e.target instanceof Element && e.target.closest("button,[data-control-button]")) {
|
|
6544
|
-
return;
|
|
6545
|
-
}
|
|
6546
|
-
if (!containerRef.current) {
|
|
6547
|
-
return;
|
|
6548
|
-
}
|
|
6549
|
-
const paperRect = containerRef.current.getBoundingClientRect();
|
|
6550
|
-
offsetRef.current = {
|
|
6551
|
-
x: e.clientX - paperRect.right,
|
|
6552
|
-
y: e.clientY - paperRect.top
|
|
6553
|
-
};
|
|
6554
|
-
e.currentTarget.setPointerCapture(e.pointerId);
|
|
6555
|
-
};
|
|
6556
|
-
const handlePointerMove = (e) => {
|
|
6557
|
-
if (!e.currentTarget.hasPointerCapture(e.pointerId)) {
|
|
6558
|
-
return;
|
|
6559
|
-
}
|
|
6560
|
-
if (!containerRef.current || !dragContainerRef.current) {
|
|
6561
|
-
return;
|
|
6562
|
-
}
|
|
6563
|
-
const boxRect = dragContainerRef.current.getBoundingClientRect();
|
|
6564
|
-
const paperRect = containerRef.current.getBoundingClientRect();
|
|
6565
|
-
const rawX = e.clientX - boxRect.right - offsetRef.current.x;
|
|
6566
|
-
const rawY = e.clientY - boxRect.top - offsetRef.current.y;
|
|
6567
|
-
const maxX = boxRect.width - paperRect.width;
|
|
6568
|
-
const maxY = boxRect.height - paperRect.height;
|
|
6569
|
-
setPos({
|
|
6570
|
-
x: clamp(-rawX, 0, maxX),
|
|
6571
|
-
y: clamp(rawY, 0, maxY)
|
|
6572
|
-
});
|
|
6573
|
-
};
|
|
6574
|
-
const handlePointerUp = (e) => {
|
|
6575
|
-
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
6576
|
-
};
|
|
6577
|
-
return /* @__PURE__ */ jsx19(Transition4, {
|
|
6578
|
-
mounted,
|
|
6579
|
-
keepMounted: true,
|
|
6580
|
-
transition: "pop",
|
|
6581
|
-
duration: theme.transitionDurations.short,
|
|
6582
|
-
timingFunction: "ease",
|
|
6583
|
-
...componentsProps?.transition,
|
|
6584
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx19(Paper2, {
|
|
6585
|
-
ref: containerRef,
|
|
6586
|
-
pos: "absolute",
|
|
6587
|
-
p: gutter,
|
|
6588
|
-
bg: theme.transparentBackground,
|
|
6589
|
-
shadow: "md",
|
|
6590
|
-
onPointerDown: handlePointerDown,
|
|
6591
|
-
onPointerMove: handlePointerMove,
|
|
6592
|
-
onPointerUp: handlePointerUp,
|
|
6593
|
-
...componentsProps?.container,
|
|
6594
|
-
style: {
|
|
6595
|
-
right: pos.x,
|
|
6596
|
-
top: pos.y,
|
|
6597
|
-
...import_lodash10.merge(transitionStyle, componentsProps?.container?.style)
|
|
6598
|
-
},
|
|
6599
|
-
className: clsx_default("remoraid-controls", componentsProps?.container?.className),
|
|
6600
|
-
children: /* @__PURE__ */ jsxs5(Group3, {
|
|
6601
|
-
gap: gutter,
|
|
6602
|
-
ref: groupRef,
|
|
6603
|
-
wrap: "nowrap",
|
|
6604
|
-
...componentsProps?.group,
|
|
6605
|
-
className: clsx_default("remoraid-controls-group", componentsProps?.group?.className),
|
|
6606
|
-
children: [
|
|
6607
|
-
/* @__PURE__ */ jsx19(IconGripHorizontal, {
|
|
6608
|
-
...import_lodash10.merge({}, theme.componentsProps.icons[iconSize], { order: -100, color: "var(--mantine-color-default-border)" }, componentsProps?.gripIcon)
|
|
6609
|
-
}),
|
|
6610
|
-
children,
|
|
6611
|
-
additionalButtons && additionalButtons.map((button, i) => {
|
|
6612
|
-
if (isValidElementOfType(ControlButton, button)) {
|
|
6613
|
-
return button;
|
|
6614
|
-
}
|
|
6615
|
-
return /* @__PURE__ */ jsx19(ControlButton, {
|
|
6616
|
-
...button
|
|
6617
|
-
}, i);
|
|
6618
|
-
})
|
|
6619
|
-
]
|
|
6620
|
-
})
|
|
6621
|
-
})
|
|
6622
|
-
});
|
|
6623
|
-
}
|
|
6624
|
-
|
|
6625
|
-
// src/core/components/Pinnable/index.tsx
|
|
6626
|
-
import { jsx as jsx20, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
6627
|
-
function Pinnable({
|
|
6628
|
-
layoutType: layoutTypeProp,
|
|
6629
|
-
section,
|
|
6630
|
-
initialValue = false,
|
|
6631
|
-
layoutId,
|
|
6632
|
-
controlsContainer,
|
|
6633
|
-
hidden = false,
|
|
6634
|
-
onPinnedValueChange,
|
|
6635
|
-
componentsProps,
|
|
6636
|
-
children
|
|
6637
|
-
}) {
|
|
6638
|
-
const layoutType = layoutTypeProp ?? "frame" /* Frame */;
|
|
6639
|
-
const { layouts } = useLayouts();
|
|
6640
|
-
const [pinned, setPinned] = useState6(initialValue);
|
|
6641
|
-
const containerRef = useRef2(null);
|
|
6642
|
-
const layout = layouts[layoutId ?? remoraidAppShellLayoutId];
|
|
6643
|
-
if (layout && layout.type !== layoutType) {
|
|
6644
|
-
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.`);
|
|
6645
|
-
}
|
|
6646
|
-
const controlButton = useMemo4(() => /* @__PURE__ */ jsx20(ControlButton, {
|
|
6647
|
-
icon: pinned ? IconPinnedOff : IconPin,
|
|
6648
|
-
tooltip: pinned ? "Unpin" : "Pin",
|
|
6649
|
-
color: "green",
|
|
6650
|
-
order: 100,
|
|
6651
|
-
...componentsProps?.button,
|
|
6652
|
-
onClick: (e) => {
|
|
6653
|
-
setPinned((prev) => !prev);
|
|
6654
|
-
componentsProps?.button?.onClick?.(e);
|
|
6655
|
-
}
|
|
6656
|
-
}), [pinned, componentsProps?.button]);
|
|
6657
|
-
const element = /* @__PURE__ */ jsxs6(Box4, {
|
|
6658
|
-
pos: "relative",
|
|
6659
|
-
ref: containerRef,
|
|
6660
|
-
"data-hidden": hidden,
|
|
6661
|
-
h: "100%",
|
|
6662
|
-
...componentsProps?.container,
|
|
6663
|
-
className: clsx_default("remoraid-pinnable", componentsProps?.container?.className),
|
|
6664
|
-
children: [
|
|
6665
|
-
controlsContainer === undefined ? /* @__PURE__ */ jsx20(Controls, {
|
|
6666
|
-
dragContainerRef: containerRef,
|
|
6667
|
-
...componentsProps?.controls,
|
|
6668
|
-
children: controlButton
|
|
6669
|
-
}) : controlsContainer !== null && /* @__PURE__ */ jsx20(Portal2, {
|
|
6670
|
-
target: controlsContainer,
|
|
6671
|
-
children: controlButton
|
|
6672
|
-
}),
|
|
6673
|
-
children
|
|
6674
|
-
]
|
|
6675
|
-
});
|
|
6676
|
-
useEffect3(() => {
|
|
6677
|
-
onPinnedValueChange?.(pinned);
|
|
6678
|
-
}, [pinned]);
|
|
6679
|
-
if (!layout) {
|
|
6680
|
-
return null;
|
|
6681
|
-
}
|
|
6682
|
-
if (pinned && layoutType === "frame" /* Frame */) {
|
|
6683
|
-
return /* @__PURE__ */ jsx20(FrameLayout_default.Element, {
|
|
6684
|
-
layoutId,
|
|
6685
|
-
section,
|
|
6686
|
-
hidden,
|
|
6687
|
-
...componentsProps?.layoutElement,
|
|
6688
|
-
children: element
|
|
6689
|
-
});
|
|
6690
|
-
}
|
|
6691
|
-
return element;
|
|
6692
|
-
}
|
|
6693
|
-
|
|
6694
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/index.tsx
|
|
6695
|
-
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
6696
|
-
function NavbarMinimal({
|
|
6697
|
-
pinnable = true,
|
|
6698
|
-
componentsProps
|
|
6699
|
-
}) {
|
|
6700
|
-
const {
|
|
6701
|
-
userExperience: {
|
|
6702
|
-
navbar: { position }
|
|
6703
|
-
}
|
|
6704
|
-
} = useAppShellUserExperience();
|
|
6705
|
-
const [hover, setHover] = useState7(false);
|
|
6706
|
-
const handleEnter = () => {
|
|
6707
|
-
setHover(true);
|
|
6708
|
-
};
|
|
6709
|
-
const handleLeave = () => {
|
|
6710
|
-
setHover(false);
|
|
6711
|
-
};
|
|
6712
|
-
if (position === "left" /* Left */ || position === "right" /* Right */) {
|
|
6713
|
-
return /* @__PURE__ */ jsx21(FrameLayout_default.Element, {
|
|
6714
|
-
section: position,
|
|
6715
|
-
includeContainer: true,
|
|
6716
|
-
...componentsProps?.layoutElement,
|
|
6717
|
-
componentsProps: import_lodash11.merge({
|
|
6718
|
-
container: {
|
|
6719
|
-
style: {
|
|
6720
|
-
order: -100
|
|
6721
|
-
}
|
|
6722
|
-
}
|
|
6723
|
-
}, componentsProps?.layoutElement?.componentsProps),
|
|
6724
|
-
children: /* @__PURE__ */ jsx21(NavbarMinimalContent, {
|
|
6725
|
-
orientation: "vertical" /* Vertical */,
|
|
6726
|
-
...componentsProps?.content
|
|
6727
|
-
})
|
|
6728
|
-
});
|
|
6729
|
-
}
|
|
6730
|
-
if (position === "top" /* Top */ || position === "bottom" /* Bottom */) {
|
|
6731
|
-
const content = /* @__PURE__ */ jsx21(NavbarMinimalContent, {
|
|
6732
|
-
orientation: "horizontal" /* Horizontal */,
|
|
6733
|
-
...componentsProps?.content
|
|
6734
|
-
});
|
|
6735
|
-
if (pinnable) {
|
|
6736
|
-
return /* @__PURE__ */ jsx21(PageContainer, {
|
|
6737
|
-
...componentsProps?.container,
|
|
6738
|
-
componentsProps: {
|
|
6739
|
-
...componentsProps?.container?.componentsProps,
|
|
6740
|
-
container: {
|
|
6741
|
-
...componentsProps?.container?.componentsProps?.container,
|
|
6742
|
-
className: clsx_default("hide-if-empty", componentsProps?.container?.componentsProps?.container?.className)
|
|
6743
|
-
}
|
|
6744
|
-
},
|
|
6745
|
-
children: /* @__PURE__ */ jsx21(Pinnable, {
|
|
6746
|
-
section: position,
|
|
6747
|
-
initialValue: true,
|
|
6748
|
-
...componentsProps?.Pinnable,
|
|
6749
|
-
componentsProps: import_lodash11.merge({
|
|
6750
|
-
container: {
|
|
6751
|
-
onMouseEnter: (e) => {
|
|
6752
|
-
handleEnter();
|
|
6753
|
-
componentsProps?.Pinnable?.componentsProps?.container?.onMouseEnter?.(e);
|
|
6754
|
-
},
|
|
6755
|
-
onMouseLeave: (e) => {
|
|
6756
|
-
handleLeave();
|
|
6757
|
-
componentsProps?.Pinnable?.componentsProps?.container?.onMouseLeave?.(e);
|
|
6758
|
-
}
|
|
6759
|
-
},
|
|
6760
|
-
button: {
|
|
6761
|
-
onClick: (e) => {
|
|
6762
|
-
handleLeave();
|
|
6763
|
-
componentsProps?.Pinnable?.componentsProps?.button?.onClick?.(e);
|
|
6764
|
-
}
|
|
6765
|
-
},
|
|
6766
|
-
layoutElement: {
|
|
6767
|
-
includeContainer: false,
|
|
6768
|
-
includePageContainer: true,
|
|
6769
|
-
componentsProps: {
|
|
6770
|
-
PageContainer: {
|
|
6771
|
-
componentsProps: {
|
|
6772
|
-
container: { style: { order: -100 } }
|
|
6773
|
-
}
|
|
6774
|
-
}
|
|
6775
|
-
}
|
|
6776
|
-
},
|
|
6777
|
-
controls: {
|
|
6778
|
-
mounted: hover
|
|
6779
|
-
}
|
|
6780
|
-
}, componentsProps?.Pinnable?.componentsProps),
|
|
6781
|
-
children: content
|
|
6782
|
-
})
|
|
6783
|
-
});
|
|
6784
|
-
}
|
|
6785
|
-
return content;
|
|
6786
|
-
}
|
|
6787
|
-
if (position === "content" /* Content */) {
|
|
6788
|
-
return /* @__PURE__ */ jsx21(PageContainer, {
|
|
6789
|
-
...componentsProps?.container,
|
|
6790
|
-
children: /* @__PURE__ */ jsx21(NavbarMinimalContent, {
|
|
6791
|
-
orientation: "horizontal" /* Horizontal */,
|
|
6792
|
-
...componentsProps?.content
|
|
6793
|
-
})
|
|
6794
|
-
});
|
|
6795
|
-
}
|
|
6796
|
-
return null;
|
|
6797
|
-
}
|
|
6798
|
-
|
|
6799
|
-
// src/core/components/AppShell/Navbar/index.tsx
|
|
6800
|
-
import { IconLogin, IconLogout, IconMoon, IconSun } from "@tabler/icons-react";
|
|
6801
|
-
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
6802
|
-
var supportedNavbarPositions = {
|
|
6803
|
-
["minimal" /* Minimal */]: [
|
|
6804
|
-
null,
|
|
6805
|
-
"top" /* Top */,
|
|
6806
|
-
"bottom" /* Bottom */,
|
|
6807
|
-
"left" /* Left */,
|
|
6808
|
-
"right" /* Right */,
|
|
6809
|
-
"content" /* Content */
|
|
6810
|
-
]
|
|
6811
|
-
};
|
|
6812
|
-
var defaultNavbarPositions = { ["minimal" /* Minimal */]: "left" /* Left */ };
|
|
6813
|
-
var getDefaultNavigationElements = ({
|
|
6814
|
-
colorScheme,
|
|
6815
|
-
setColorScheme,
|
|
6816
|
-
auth
|
|
6817
|
-
}) => [
|
|
6818
|
-
{
|
|
6819
|
-
type: "button" /* Button */,
|
|
6820
|
-
label: colorScheme === "dark" ? "Light mode" : "Dark mode",
|
|
6821
|
-
icon: colorScheme === "dark" ? IconSun : IconMoon,
|
|
6822
|
-
static: true,
|
|
6823
|
-
onClick: () => {
|
|
6824
|
-
if (!colorScheme || !setColorScheme) {
|
|
6825
|
-
return;
|
|
6826
|
-
}
|
|
6827
|
-
setColorScheme(colorScheme === "dark" ? "light" : "dark");
|
|
6828
|
-
}
|
|
6829
|
-
},
|
|
6830
|
-
{
|
|
6831
|
-
mounted: auth !== undefined && auth.user === null,
|
|
6832
|
-
type: "anchor" /* Anchor */,
|
|
6833
|
-
label: "Login",
|
|
6834
|
-
href: "/login",
|
|
6835
|
-
static: true,
|
|
6836
|
-
icon: IconLogin
|
|
6837
|
-
},
|
|
6838
|
-
{
|
|
6839
|
-
mounted: auth !== undefined && auth.user !== null,
|
|
6840
|
-
type: "button" /* Button */,
|
|
6841
|
-
label: "Logout",
|
|
6842
|
-
static: true,
|
|
6843
|
-
icon: IconLogout,
|
|
6844
|
-
onClick: () => {
|
|
6845
|
-
auth?.onLogout?.();
|
|
6846
|
-
}
|
|
6847
|
-
}
|
|
6848
|
-
];
|
|
6849
|
-
function Navbar({ componentsProps }) {
|
|
6850
|
-
const { navbarVariant } = useRemoraidApp();
|
|
6851
|
-
if (navbarVariant === "minimal" /* Minimal */) {
|
|
6852
|
-
return /* @__PURE__ */ jsx22(NavbarMinimal, {
|
|
6853
|
-
...componentsProps?.NavbarMinimal
|
|
6854
|
-
});
|
|
6855
|
-
}
|
|
6856
|
-
return null;
|
|
6857
|
-
}
|
|
6858
|
-
var Navbar_default = Object.assign(Navbar, {
|
|
6859
|
-
NavbarMinimal
|
|
6860
|
-
});
|
|
6861
|
-
|
|
6862
|
-
// src/core/components/AppShell/AppShellUserExperienceProvider/index.tsx
|
|
6863
|
-
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
6864
|
-
var defaultAppShellUserExperience = {
|
|
6865
|
-
navbar: {
|
|
6866
|
-
position: null,
|
|
6867
|
-
mobilePosition: null,
|
|
6868
|
-
mode: "responsive" /* Responsive */
|
|
6869
|
-
},
|
|
6870
|
-
footer: {
|
|
6871
|
-
position: null
|
|
6872
|
-
}
|
|
6873
|
-
};
|
|
6874
|
-
var defaultAppShellUserExperienceCookieName = "remoraid-app-shell-user-experience";
|
|
6875
|
-
var appShellUserExperienceContext = createUserExperienceContext(defaultAppShellUserExperience);
|
|
6876
|
-
var useAppShellUserExperience = () => {
|
|
6877
|
-
return useContext10(appShellUserExperienceContext);
|
|
6878
|
-
};
|
|
6879
|
-
function AppShellUserExperienceProvider({
|
|
6880
|
-
children,
|
|
6881
|
-
initialValue,
|
|
6882
|
-
cookieName
|
|
6883
|
-
}) {
|
|
6884
|
-
const { navbarVariant, footerVariant } = useRemoraidApp();
|
|
6885
|
-
const isValidUserExperience = (x) => {
|
|
6886
|
-
if (typeof x !== "object") {
|
|
6887
|
-
return false;
|
|
6888
|
-
}
|
|
6889
|
-
if (x === null) {
|
|
6890
|
-
return false;
|
|
6891
|
-
}
|
|
6892
|
-
if (!("navbar" in x)) {
|
|
6893
|
-
return false;
|
|
6894
|
-
}
|
|
6895
|
-
if (!("footer" in x)) {
|
|
6896
|
-
return false;
|
|
6897
|
-
}
|
|
6898
|
-
return true;
|
|
6899
|
-
};
|
|
6900
|
-
return /* @__PURE__ */ jsx23(UserExperienceProviderWrapper, {
|
|
6901
|
-
context: appShellUserExperienceContext,
|
|
6902
|
-
isValidUserExperience,
|
|
6903
|
-
cookieName: cookieName ?? defaultAppShellUserExperienceCookieName,
|
|
6904
|
-
defaultUserExperience: defaultAppShellUserExperience,
|
|
6905
|
-
initialValue: import_lodash12.merge({
|
|
6906
|
-
navbar: {
|
|
6907
|
-
position: navbarVariant === null ? null : defaultNavbarPositions[navbarVariant]
|
|
6908
|
-
},
|
|
6909
|
-
footer: {
|
|
6910
|
-
position: footerVariant === null ? null : defaultFooterPositions[footerVariant]
|
|
6911
|
-
}
|
|
6912
|
-
}, initialValue),
|
|
6913
|
-
children
|
|
6914
|
-
});
|
|
6915
|
-
}
|
|
6916
|
-
|
|
6917
|
-
// src/core/components/AppShell/index.tsx
|
|
6918
|
-
import { jsx as jsx24, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
6919
|
-
var remoraidAppShellLayoutId = "remoraid-app-shell";
|
|
6920
|
-
function AppShell({
|
|
6921
|
-
gutter,
|
|
6922
|
-
appContext: appContext2,
|
|
6923
|
-
initialUserExperience,
|
|
6924
|
-
componentsProps,
|
|
6925
|
-
children
|
|
6926
|
-
}) {
|
|
6927
|
-
const theme = useRemoraidTheme();
|
|
6928
|
-
const { colorScheme } = useHydratedMantineColorScheme();
|
|
6929
|
-
useEffect4(() => {
|
|
6930
|
-
let meta = document.querySelector('meta[name="theme-color"]');
|
|
6931
|
-
if (!meta) {
|
|
6932
|
-
meta = document.createElement("meta");
|
|
6933
|
-
meta.name = "theme-color";
|
|
6934
|
-
document.head.appendChild(meta);
|
|
6935
|
-
}
|
|
6936
|
-
const { backgroundColor: computedBodyColor } = getComputedStyle(document.body);
|
|
6937
|
-
if (!computedBodyColor) {
|
|
6938
|
-
return;
|
|
6939
|
-
}
|
|
6940
|
-
meta.content = computedBodyColor;
|
|
6941
|
-
}, [colorScheme]);
|
|
6942
|
-
return /* @__PURE__ */ jsx24(AppProvider, {
|
|
6943
|
-
appContext: appContext2,
|
|
6944
|
-
...componentsProps?.AppProvider,
|
|
6945
|
-
children: /* @__PURE__ */ jsx24(AppShellUserExperienceProvider, {
|
|
6946
|
-
...componentsProps?.AppShellUserExperienceProvider,
|
|
6947
|
-
initialValue: import_lodash13.merge(initialUserExperience, componentsProps?.AppShellUserExperienceProvider?.initialValue),
|
|
6948
|
-
children: /* @__PURE__ */ jsx24(Box5, {
|
|
6949
|
-
h: "100dvh",
|
|
6950
|
-
...componentsProps?.container,
|
|
6951
|
-
children: /* @__PURE__ */ jsxs7(FrameLayout_default, {
|
|
6952
|
-
layoutId: remoraidAppShellLayoutId,
|
|
6953
|
-
gutter: gutter ?? theme.primaryGutter,
|
|
6954
|
-
...componentsProps?.layout,
|
|
6955
|
-
children: [
|
|
6956
|
-
/* @__PURE__ */ jsx24(Navbar_default, {
|
|
6957
|
-
...componentsProps?.navbar
|
|
6958
|
-
}),
|
|
6959
|
-
children,
|
|
6960
|
-
/* @__PURE__ */ jsx24(Footer_default, {
|
|
6961
|
-
...componentsProps?.footer
|
|
6962
|
-
})
|
|
6963
|
-
]
|
|
6964
|
-
})
|
|
6965
|
-
})
|
|
6966
|
-
})
|
|
6967
|
-
});
|
|
6968
|
-
}
|
|
6969
|
-
var AppShell_default = Object.assign(AppShell, {
|
|
6970
|
-
Navbar: Navbar_default,
|
|
6971
|
-
Footer: Footer_default
|
|
6972
|
-
});
|
|
6973
|
-
// src/core/components/WidgetSelectionHeader/index.tsx
|
|
6974
|
-
import {
|
|
6975
|
-
Box as Box6,
|
|
6976
|
-
Chip as Chip2,
|
|
6977
|
-
Divider,
|
|
6978
|
-
Flex as Flex2,
|
|
6979
|
-
Menu as Menu2,
|
|
6980
|
-
Text,
|
|
6981
|
-
useMantineTheme as useMantineTheme3
|
|
6982
|
-
} from "@mantine/core";
|
|
6983
|
-
|
|
6984
|
-
// src/core/components/Page/index.tsx
|
|
6985
|
-
import { Stack as Stack3 } from "@mantine/core";
|
|
6986
|
-
import React8, {
|
|
6987
|
-
useContext as useContext11,
|
|
6988
|
-
useEffect as useEffect5
|
|
6989
|
-
} from "react";
|
|
6990
|
-
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
6991
|
-
var pageContext = React8.createContext(null);
|
|
6992
|
-
var usePage = () => {
|
|
6993
|
-
return useContext11(pageContext);
|
|
6994
|
-
};
|
|
6995
|
-
|
|
6996
|
-
// src/core/components/WidgetSelectionHeader/index.tsx
|
|
6997
|
-
import { IconCheck, IconFocus, IconNavigation } from "@tabler/icons-react";
|
|
6998
|
-
import { useEffect as useEffect6, useRef as useRef3, useState as useState8 } from "react";
|
|
6999
|
-
|
|
7000
|
-
// src/core/components/ScrollableChipGroup/index.tsx
|
|
7001
|
-
import {
|
|
7002
|
-
Chip,
|
|
7003
|
-
Flex,
|
|
7004
|
-
ScrollArea as ScrollArea3
|
|
7005
|
-
} from "@mantine/core";
|
|
7006
|
-
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
7007
|
-
|
|
7008
|
-
// src/core/components/WidgetSelectionHeader/index.tsx
|
|
7009
|
-
var import_lodash14 = __toESM(require_lodash(), 1);
|
|
7010
|
-
import { jsx as jsx27, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
7011
|
-
// src/core/components/BadgeGroup/index.tsx
|
|
7012
|
-
import {
|
|
7013
|
-
Badge as Badge2,
|
|
7014
|
-
Group as Group4,
|
|
7015
|
-
HoverCard,
|
|
7016
|
-
Stack as Stack4,
|
|
7017
|
-
Transition as Transition6
|
|
7018
|
-
} from "@mantine/core";
|
|
7019
|
-
import React9 from "react";
|
|
7020
|
-
|
|
7021
|
-
// src/core/components/BadgeMinimal/index.tsx
|
|
7022
|
-
import {
|
|
7023
|
-
Badge,
|
|
7024
|
-
Tooltip as Tooltip3,
|
|
7025
|
-
Transition as Transition5
|
|
7026
|
-
} from "@mantine/core";
|
|
7027
|
-
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
7028
|
-
function BadgeMinimal({
|
|
7029
|
-
label,
|
|
7030
|
-
tooltip,
|
|
7031
|
-
mounted = true,
|
|
7032
|
-
componentsProps
|
|
7033
|
-
}) {
|
|
7034
|
-
const theme = useRemoraidTheme();
|
|
7035
|
-
return /* @__PURE__ */ jsx28(Transition5, {
|
|
7036
|
-
mounted,
|
|
7037
|
-
transition: "fade",
|
|
7038
|
-
duration: theme.transitionDurations.short,
|
|
7039
|
-
timingFunction: "ease",
|
|
7040
|
-
...componentsProps?.transition,
|
|
7041
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx28(Tooltip3, {
|
|
7042
|
-
label: tooltip,
|
|
7043
|
-
disabled: !Boolean(tooltip),
|
|
7044
|
-
...componentsProps?.tooltip,
|
|
7045
|
-
children: /* @__PURE__ */ jsx28(Badge, {
|
|
7046
|
-
variant: "default",
|
|
7047
|
-
...componentsProps?.badge,
|
|
7048
|
-
style: {
|
|
7049
|
-
...transitionStyle,
|
|
7050
|
-
cursor: "pointer",
|
|
7051
|
-
...componentsProps?.badge?.style
|
|
7052
|
-
},
|
|
7053
|
-
children: label
|
|
7054
|
-
})
|
|
7055
|
-
})
|
|
7056
|
-
});
|
|
7057
|
-
}
|
|
7058
|
-
|
|
7059
|
-
// src/core/components/BadgeGroup/index.tsx
|
|
7060
|
-
var import_lodash15 = __toESM(require_lodash(), 1);
|
|
7061
|
-
import { jsx as jsx29, jsxs as jsxs9, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
7062
|
-
import { createElement } from "react";
|
|
7063
|
-
function BadgeGroup({
|
|
7064
|
-
badges: badgesProp,
|
|
7065
|
-
gap = "xs",
|
|
7066
|
-
breakpoint: breakpointProp,
|
|
7067
|
-
componentsProps
|
|
7068
|
-
}) {
|
|
7069
|
-
const badges = badgesProp.map((badge) => asElementOrPropsOfType(BadgeMinimal, badge, "Check 'badges' property passed to 'BadgeGroup'."));
|
|
7070
|
-
const theme = useRemoraidTheme();
|
|
7071
|
-
const breakpoint = breakpointProp ?? theme.breakpoints.badgeGroupCollapse;
|
|
7072
|
-
const numVisibleBadges = badges.filter((badge) => isValidElementOfType(BadgeMinimal, badge) ? badge.props.mounted : badge.mounted !== false).length;
|
|
7073
|
-
const badgesElement = badges.map((badge, i) => {
|
|
7074
|
-
if (isValidElementOfType(BadgeMinimal, badge)) {
|
|
7075
|
-
return badge;
|
|
7076
|
-
}
|
|
7077
|
-
return /* @__PURE__ */ createElement(BadgeMinimal, {
|
|
7078
|
-
...badge,
|
|
7079
|
-
key: i
|
|
7080
|
-
});
|
|
7081
|
-
});
|
|
7082
|
-
return /* @__PURE__ */ jsxs9(Fragment2, {
|
|
7083
|
-
children: [
|
|
7084
|
-
/* @__PURE__ */ jsx29(Group4, {
|
|
7085
|
-
gap,
|
|
7086
|
-
wrap: "nowrap",
|
|
7087
|
-
visibleFrom: numVisibleBadges > 1 ? breakpoint : undefined,
|
|
7088
|
-
...componentsProps?.container,
|
|
7089
|
-
className: clsx_default("hide-if-empty", componentsProps?.container?.className),
|
|
7090
|
-
children: badgesElement
|
|
7091
|
-
}),
|
|
7092
|
-
/* @__PURE__ */ jsx29(Transition6, {
|
|
7093
|
-
mounted: numVisibleBadges > 1,
|
|
7094
|
-
transition: "fade",
|
|
7095
|
-
duration: theme.transitionDurations.short,
|
|
7096
|
-
timingFunction: "ease",
|
|
7097
|
-
...componentsProps?.cumulativeBadgeTransition,
|
|
7098
|
-
children: (transitionStyle) => /* @__PURE__ */ jsxs9(HoverCard, {
|
|
7099
|
-
...componentsProps?.HoverCard,
|
|
7100
|
-
children: [
|
|
7101
|
-
/* @__PURE__ */ jsx29(HoverCard.Target, {
|
|
7102
|
-
children: /* @__PURE__ */ jsxs9(Badge2, {
|
|
7103
|
-
hiddenFrom: breakpoint,
|
|
7104
|
-
variant: "dot",
|
|
7105
|
-
...componentsProps?.cumulativeBadge,
|
|
7106
|
-
style: {
|
|
7107
|
-
cursor: "pointer",
|
|
7108
|
-
...import_lodash15.merge(transitionStyle, componentsProps?.cumulativeBadge?.style)
|
|
7109
|
-
},
|
|
7110
|
-
children: [
|
|
7111
|
-
numVisibleBadges,
|
|
7112
|
-
" badges"
|
|
7113
|
-
]
|
|
7114
|
-
})
|
|
7115
|
-
}),
|
|
7116
|
-
/* @__PURE__ */ jsx29(HoverCard.Dropdown, {
|
|
7117
|
-
p: gap,
|
|
7118
|
-
children: /* @__PURE__ */ jsx29(Stack4, {
|
|
7119
|
-
gap,
|
|
7120
|
-
...componentsProps?.hoverContainer,
|
|
7121
|
-
children: badgesElement
|
|
7122
|
-
})
|
|
7123
|
-
})
|
|
7124
|
-
]
|
|
7125
|
-
})
|
|
7126
|
-
})
|
|
7127
|
-
]
|
|
7128
|
-
});
|
|
7129
|
-
}
|
|
7130
|
-
// src/core/components/AlertMinimal/index.tsx
|
|
7131
|
-
import { Alert, Transition as Transition7 } from "@mantine/core";
|
|
7132
|
-
var import_lodash16 = __toESM(require_lodash(), 1);
|
|
7133
|
-
import { jsx as jsx30, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
7134
|
-
function AlertMinimal({
|
|
7135
|
-
category,
|
|
7136
|
-
children,
|
|
7137
|
-
...props
|
|
7138
|
-
}) {
|
|
7139
|
-
const theme = useRemoraidTheme();
|
|
7140
|
-
const {
|
|
7141
|
-
title,
|
|
7142
|
-
text,
|
|
7143
|
-
color,
|
|
7144
|
-
onClose,
|
|
7145
|
-
mounted = true,
|
|
7146
|
-
icon: Icon4,
|
|
7147
|
-
iconSize = "small" /* Small */,
|
|
7148
|
-
componentsProps
|
|
7149
|
-
} = import_lodash16.merge({}, theme.componentsProps.alerts[category], props);
|
|
7150
|
-
return /* @__PURE__ */ jsx30(Transition7, {
|
|
7151
|
-
mounted,
|
|
7152
|
-
transition: "fade",
|
|
7153
|
-
duration: theme.transitionDurations.short,
|
|
7154
|
-
timingFunction: "ease",
|
|
7155
|
-
...componentsProps?.transition,
|
|
7156
|
-
children: (transitionStyle) => /* @__PURE__ */ jsxs10(Alert, {
|
|
7157
|
-
title,
|
|
7158
|
-
color,
|
|
7159
|
-
variant: "light",
|
|
7160
|
-
onClose,
|
|
7161
|
-
withCloseButton: onClose !== undefined,
|
|
7162
|
-
icon: Icon4 ? /* @__PURE__ */ jsx30(Icon4, {
|
|
7163
|
-
...import_lodash16.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
|
|
7164
|
-
}) : undefined,
|
|
7165
|
-
...componentsProps?.alert,
|
|
7166
|
-
style: import_lodash16.merge(transitionStyle, componentsProps?.alert?.style),
|
|
7167
|
-
children: [
|
|
7168
|
-
text,
|
|
7169
|
-
children
|
|
7170
|
-
]
|
|
7171
|
-
})
|
|
7172
|
-
});
|
|
7173
|
-
}
|
|
7174
|
-
// src/core/components/Widget/WidgetWrapper/index.tsx
|
|
7175
|
-
import { Paper as Paper3, Transition as Transition8 } from "@mantine/core";
|
|
7176
|
-
import {
|
|
7177
|
-
useCallback as useCallback2,
|
|
7178
|
-
useEffect as useEffect7,
|
|
7179
|
-
useRef as useRef4,
|
|
7180
|
-
useState as useState9
|
|
7181
|
-
} from "react";
|
|
7182
|
-
import { IconX } from "@tabler/icons-react";
|
|
7183
|
-
var import_lodash17 = __toESM(require_lodash(), 1);
|
|
7184
|
-
import { jsx as jsx31, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
7185
|
-
function WidgetWrapper({
|
|
7186
|
-
config,
|
|
7187
|
-
mt = 0,
|
|
7188
|
-
withCloseButton = true,
|
|
7189
|
-
pinnableSection,
|
|
7190
|
-
componentsProps,
|
|
7191
|
-
children
|
|
7192
|
-
}) {
|
|
7193
|
-
const {
|
|
7194
|
-
widgets,
|
|
7195
|
-
hideWidget,
|
|
7196
|
-
isPageRegistered,
|
|
7197
|
-
isWidgetRegistered,
|
|
7198
|
-
registerWidget,
|
|
7199
|
-
updateActiveWidget,
|
|
7200
|
-
updateWidgetSelection,
|
|
7201
|
-
activeWidget
|
|
7202
|
-
} = useWidgets();
|
|
7203
|
-
const page = usePage();
|
|
7204
|
-
const theme = useRemoraidTheme();
|
|
7205
|
-
const [controlsContainer, setControlsContainer] = useState9(null);
|
|
7206
|
-
const widget = page ? widgets[page.pageId]?.[config.widgetId] : undefined;
|
|
7207
|
-
const pageRegistered = page ? isPageRegistered(page.pageId) : false;
|
|
7208
|
-
const containerRef = useRef4(null);
|
|
7209
|
-
const controlsContainerRef = useCallback2((n) => {
|
|
7210
|
-
setControlsContainer(n);
|
|
7211
|
-
}, [setControlsContainer]);
|
|
7212
|
-
const handleEnter = () => {
|
|
7213
|
-
updateActiveWidget(config.widgetId);
|
|
7214
|
-
};
|
|
7215
|
-
const handleLeave = (e) => {
|
|
7216
|
-
const to = e.relatedTarget;
|
|
7217
|
-
if (to && to.closest?.("[data-control-button]")) {
|
|
7218
|
-
return;
|
|
7219
|
-
}
|
|
7220
|
-
updateActiveWidget(null);
|
|
7221
|
-
};
|
|
7222
|
-
const mounted = Boolean(widget?.selected);
|
|
7223
|
-
let element = /* @__PURE__ */ jsx31(Transition8, {
|
|
7224
|
-
mounted,
|
|
7225
|
-
transition: "fade-left",
|
|
7226
|
-
duration: theme.transitionDurations.medium,
|
|
7227
|
-
timingFunction: "ease",
|
|
7228
|
-
...componentsProps?.transition,
|
|
7229
|
-
onExited: () => {
|
|
7230
|
-
if (page) {
|
|
7231
|
-
hideWidget(page.pageId, config.widgetId);
|
|
7232
|
-
}
|
|
7233
|
-
componentsProps?.transition?.onExited?.();
|
|
7234
|
-
},
|
|
7235
|
-
children: (transitionStyle) => /* @__PURE__ */ jsxs11(Paper3, {
|
|
7236
|
-
ref: containerRef,
|
|
7237
|
-
p: "md",
|
|
7238
|
-
shadow: "md",
|
|
7239
|
-
bg: theme.transparentBackground,
|
|
7240
|
-
mt,
|
|
7241
|
-
pos: "relative",
|
|
7242
|
-
h: "fit-content",
|
|
7243
|
-
mah: "100%",
|
|
7244
|
-
display: "flex",
|
|
7245
|
-
...componentsProps?.container,
|
|
7246
|
-
onMouseEnter: (e) => {
|
|
7247
|
-
handleEnter();
|
|
7248
|
-
componentsProps?.container?.onMouseEnter?.(e);
|
|
7249
|
-
},
|
|
7250
|
-
onMouseLeave: (e) => {
|
|
7251
|
-
handleLeave(e);
|
|
7252
|
-
componentsProps?.container?.onMouseLeave?.(e);
|
|
7253
|
-
},
|
|
7254
|
-
style: import_lodash17.merge(transitionStyle, { flexDirection: "column" }, componentsProps?.container?.style),
|
|
7255
|
-
className: clsx_default("remoraid-segment", componentsProps?.container?.className),
|
|
7256
|
-
id: config.widgetId,
|
|
7257
|
-
children: [
|
|
7258
|
-
/* @__PURE__ */ jsx31(Controls, {
|
|
7259
|
-
dragContainerRef: containerRef,
|
|
7260
|
-
groupRef: controlsContainerRef,
|
|
7261
|
-
mounted: activeWidget === config.widgetId,
|
|
7262
|
-
...componentsProps?.controls,
|
|
7263
|
-
children: /* @__PURE__ */ jsx31(ControlButton, {
|
|
7264
|
-
mounted: withCloseButton,
|
|
7265
|
-
icon: IconX,
|
|
7266
|
-
tooltip: "Hide widget",
|
|
7267
|
-
color: "red",
|
|
7268
|
-
order: 200,
|
|
7269
|
-
...componentsProps?.closeButton,
|
|
7270
|
-
componentsProps: {
|
|
7271
|
-
...componentsProps?.closeButton?.componentsProps,
|
|
7272
|
-
tooltip: {
|
|
7273
|
-
disabled: !mounted,
|
|
7274
|
-
...componentsProps?.closeButton?.componentsProps?.tooltip
|
|
7275
|
-
}
|
|
7276
|
-
},
|
|
7277
|
-
onClick: (e) => {
|
|
7278
|
-
if (!page) {
|
|
7279
|
-
return;
|
|
7280
|
-
}
|
|
7281
|
-
updateWidgetSelection(page.pageId, config.widgetId, false);
|
|
7282
|
-
handleLeave(e);
|
|
7283
|
-
componentsProps?.closeButton?.onClick?.(e);
|
|
7284
|
-
}
|
|
7285
|
-
})
|
|
7286
|
-
}),
|
|
7287
|
-
children
|
|
7288
|
-
]
|
|
7289
|
-
})
|
|
7290
|
-
});
|
|
7291
|
-
if (pinnableSection !== undefined) {
|
|
7292
|
-
element = /* @__PURE__ */ jsx31(Pinnable, {
|
|
7293
|
-
section: pinnableSection,
|
|
7294
|
-
controlsContainer,
|
|
7295
|
-
hidden: Boolean(widget?.hidden),
|
|
7296
|
-
...componentsProps?.Pinnable,
|
|
7297
|
-
componentsProps: {
|
|
7298
|
-
...componentsProps?.Pinnable?.componentsProps,
|
|
7299
|
-
button: {
|
|
7300
|
-
...componentsProps?.Pinnable?.componentsProps?.button,
|
|
7301
|
-
onClick: (e) => {
|
|
7302
|
-
handleLeave(e);
|
|
7303
|
-
componentsProps?.Pinnable?.componentsProps?.button?.onClick?.(e);
|
|
7304
|
-
}
|
|
7305
|
-
},
|
|
7306
|
-
layoutElement: {
|
|
7307
|
-
includeContainer: false,
|
|
7308
|
-
includePageContainer: pinnableSection === "top" /* Top */ || pinnableSection === "bottom" /* Bottom */,
|
|
7309
|
-
...componentsProps?.Pinnable?.componentsProps?.layoutElement
|
|
7310
|
-
}
|
|
7311
|
-
},
|
|
7312
|
-
children: element
|
|
7313
|
-
});
|
|
7314
|
-
}
|
|
7315
|
-
useEffect7(() => {
|
|
7316
|
-
if (!page) {
|
|
7317
|
-
return;
|
|
7318
|
-
}
|
|
7319
|
-
if (!isWidgetRegistered(page.pageId, config.widgetId)) {
|
|
7320
|
-
registerWidget(page.pageId, config);
|
|
7321
|
-
}
|
|
7322
|
-
}, [pageRegistered]);
|
|
7323
|
-
return element;
|
|
7324
|
-
}
|
|
7325
|
-
// src/core/components/Widget/index.tsx
|
|
7326
|
-
import {
|
|
7327
|
-
Center as Center2,
|
|
7328
|
-
Divider as Divider2,
|
|
7329
|
-
Group as Group5,
|
|
7330
|
-
Loader,
|
|
7331
|
-
Title,
|
|
7332
|
-
Stack as Stack5,
|
|
7333
|
-
Box as Box7,
|
|
7334
|
-
ScrollArea as ScrollArea4,
|
|
7335
|
-
Transition as Transition9,
|
|
7336
|
-
Text as Text2
|
|
7337
|
-
} from "@mantine/core";
|
|
7338
|
-
import { Children } from "react";
|
|
7339
|
-
var import_lodash18 = __toESM(require_lodash(), 1);
|
|
7340
|
-
import { jsx as jsx32, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
7341
|
-
import { createElement as createElement2 } from "react";
|
|
7342
|
-
function Widget({
|
|
7343
|
-
id,
|
|
7344
|
-
title,
|
|
7345
|
-
description,
|
|
7346
|
-
config,
|
|
7347
|
-
badges: badgesProp,
|
|
7348
|
-
buttons: buttonsProp,
|
|
7349
|
-
alerts: alertsProp,
|
|
7350
|
-
gaps,
|
|
7351
|
-
loading,
|
|
7352
|
-
mt,
|
|
7353
|
-
pinnableSection,
|
|
7354
|
-
componentsProps,
|
|
7355
|
-
children
|
|
7356
|
-
}) {
|
|
7357
|
-
const buttons = buttonsProp?.map((button) => asElementOrPropsOfType(RemoraidButton, button, "Check the 'buttons' property of this widget."));
|
|
7358
|
-
const alerts = alertsProp?.map((alert) => asElementOrPropsOfType(AlertMinimal, alert, "Check the 'alerts' property of this widget."));
|
|
7359
|
-
const badges = badgesProp?.map((badge) => asElementOrPropsOfType(BadgeMinimal, badge, "Check the 'badges' property of this widget."));
|
|
7360
|
-
const badgesGap = (typeof gaps === "object" ? gaps.badges : gaps) ?? "xs";
|
|
7361
|
-
const buttonsGap = (typeof gaps === "object" ? gaps.buttons : gaps) ?? "xs";
|
|
7362
|
-
const alertsGap = (typeof gaps === "object" ? gaps.alerts : gaps) ?? "xs";
|
|
7363
|
-
return /* @__PURE__ */ jsx32(WidgetWrapper, {
|
|
7364
|
-
config: {
|
|
7365
|
-
widgetId: id,
|
|
7366
|
-
...config,
|
|
7367
|
-
initialValues: {
|
|
7368
|
-
name: title,
|
|
7369
|
-
...config?.initialValues
|
|
7370
|
-
}
|
|
7371
|
-
},
|
|
7372
|
-
mt,
|
|
7373
|
-
...componentsProps?.wrapper,
|
|
7374
|
-
pinnableSection: pinnableSection ?? componentsProps?.wrapper?.pinnableSection,
|
|
7375
|
-
children: /* @__PURE__ */ jsxs12(Stack5, {
|
|
7376
|
-
gap: "md",
|
|
7377
|
-
mih: 0,
|
|
7378
|
-
...componentsProps?.contentContainer,
|
|
7379
|
-
children: [
|
|
7380
|
-
/* @__PURE__ */ jsxs12(Group5, {
|
|
7381
|
-
justify: "space-between",
|
|
7382
|
-
wrap: "nowrap",
|
|
7383
|
-
children: [
|
|
7384
|
-
/* @__PURE__ */ jsxs12(Stack5, {
|
|
7385
|
-
gap: 4,
|
|
7386
|
-
children: [
|
|
7387
|
-
/* @__PURE__ */ jsxs12(Group5, {
|
|
7388
|
-
gap: badgesGap,
|
|
7389
|
-
wrap: "nowrap",
|
|
7390
|
-
children: [
|
|
7391
|
-
/* @__PURE__ */ jsx32(Title, {
|
|
7392
|
-
order: 1,
|
|
7393
|
-
size: "h2",
|
|
7394
|
-
lineClamp: 1,
|
|
7395
|
-
...componentsProps?.title,
|
|
7396
|
-
children: title ?? id
|
|
7397
|
-
}),
|
|
7398
|
-
badges !== undefined && /* @__PURE__ */ jsx32(BadgeGroup, {
|
|
7399
|
-
badges,
|
|
7400
|
-
gap: badgesGap,
|
|
7401
|
-
...componentsProps?.badgeGroup
|
|
7402
|
-
})
|
|
7403
|
-
]
|
|
7404
|
-
}),
|
|
7405
|
-
/* @__PURE__ */ jsx32(Transition9, {
|
|
7406
|
-
mounted: Boolean(description),
|
|
7407
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx32(Text2, {
|
|
7408
|
-
size: "sm",
|
|
7409
|
-
c: "dimmed",
|
|
7410
|
-
...componentsProps?.description,
|
|
7411
|
-
style: import_lodash18.merge(transitionStyle, componentsProps?.description?.style),
|
|
7412
|
-
children: description
|
|
7413
|
-
})
|
|
7414
|
-
})
|
|
7415
|
-
]
|
|
7416
|
-
}),
|
|
7417
|
-
/* @__PURE__ */ jsx32(Group5, {
|
|
7418
|
-
gap: buttonsGap,
|
|
7419
|
-
wrap: "nowrap",
|
|
7420
|
-
children: buttons !== undefined && buttons.map((button, i) => {
|
|
7421
|
-
if (isValidElementOfType(RemoraidButton, button)) {
|
|
7422
|
-
return button;
|
|
7423
|
-
}
|
|
7424
|
-
return /* @__PURE__ */ createElement2(RemoraidButton, {
|
|
7425
|
-
...button,
|
|
7426
|
-
key: i
|
|
7427
|
-
});
|
|
7428
|
-
})
|
|
7429
|
-
})
|
|
7430
|
-
]
|
|
7431
|
-
}),
|
|
7432
|
-
/* @__PURE__ */ jsx32(Box7, {
|
|
7433
|
-
children: /* @__PURE__ */ jsx32(Divider2, {
|
|
7434
|
-
...componentsProps?.divider
|
|
7435
|
-
})
|
|
7436
|
-
}),
|
|
7437
|
-
/* @__PURE__ */ jsx32(Stack5, {
|
|
7438
|
-
align: "stretch",
|
|
7439
|
-
gap: alertsGap,
|
|
7440
|
-
...componentsProps?.alertsContainer,
|
|
7441
|
-
className: clsx_default("hide-if-empty", componentsProps?.alertsContainer?.className),
|
|
7442
|
-
children: alerts?.map((alert, i) => {
|
|
7443
|
-
if (isValidElementOfType(AlertMinimal, alert)) {
|
|
7444
|
-
return alert;
|
|
7445
|
-
}
|
|
7446
|
-
return /* @__PURE__ */ createElement2(AlertMinimal, {
|
|
7447
|
-
...alert,
|
|
7448
|
-
key: i
|
|
7449
|
-
});
|
|
7450
|
-
})
|
|
7451
|
-
}),
|
|
7452
|
-
(loading || Children.toArray(children).length > 0) && /* @__PURE__ */ jsx32(ScrollArea4.Autosize, {
|
|
7453
|
-
flex: 1,
|
|
7454
|
-
...componentsProps?.childrenContainer,
|
|
7455
|
-
className: clsx_default("remoraid-widget-children-container", componentsProps?.childrenContainer?.className),
|
|
7456
|
-
children: loading ? /* @__PURE__ */ jsx32(Center2, {
|
|
7457
|
-
children: /* @__PURE__ */ jsx32(Loader, {
|
|
7458
|
-
...componentsProps?.loader
|
|
7459
|
-
})
|
|
7460
|
-
}) : children
|
|
7461
|
-
})
|
|
7462
|
-
]
|
|
7463
|
-
})
|
|
7464
|
-
});
|
|
7465
|
-
}
|
|
7466
|
-
// src/core/components/NotFoundPage/index.tsx
|
|
7467
|
-
import { jsx as jsx33, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
7468
|
-
// src/core/components/EnvironmentShell/index.tsx
|
|
7469
|
-
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
7470
|
-
// src/core/components/SettingsWidget/index.tsx
|
|
7471
|
-
import { createContext as createContext8, useContext as useContext12 } from "react";
|
|
7472
|
-
import { IconRestore } from "@tabler/icons-react";
|
|
7473
|
-
|
|
7474
|
-
// src/core/components/SettingsWidget/SaveButton/index.tsx
|
|
7475
|
-
import { IconDeviceFloppy } from "@tabler/icons-react";
|
|
7476
|
-
import { Group as Group6 } from "@mantine/core";
|
|
7477
|
-
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
7478
|
-
function SaveButton({
|
|
7479
|
-
onSaveChanges,
|
|
7480
|
-
insideContainer,
|
|
7481
|
-
componentsProps
|
|
7482
|
-
}) {
|
|
7483
|
-
const settingsWidgetOptions = useSettingsWidgetContext();
|
|
7484
|
-
const button = /* @__PURE__ */ jsx35(RemoraidButton, {
|
|
7485
|
-
label: "Save Changes",
|
|
7486
|
-
icon: IconDeviceFloppy,
|
|
7487
|
-
onClick: onSaveChanges,
|
|
7488
|
-
responsive: false,
|
|
7489
|
-
...componentsProps?.button,
|
|
7490
|
-
componentsProps: {
|
|
7491
|
-
...componentsProps?.button?.componentsProps,
|
|
7492
|
-
button: {
|
|
7493
|
-
disabled: settingsWidgetOptions.unsavedChanges === false,
|
|
7494
|
-
...componentsProps?.button?.componentsProps?.button
|
|
7495
|
-
}
|
|
7496
|
-
}
|
|
7497
|
-
});
|
|
7498
|
-
if (insideContainer !== false) {
|
|
7499
|
-
return /* @__PURE__ */ jsx35(Group6, {
|
|
7500
|
-
w: "100%",
|
|
7501
|
-
justify: "flex-end",
|
|
7502
|
-
mt: "md",
|
|
7503
|
-
...componentsProps?.container,
|
|
7504
|
-
children: button
|
|
7505
|
-
});
|
|
7506
|
-
}
|
|
7507
|
-
return button;
|
|
7508
|
-
}
|
|
7509
|
-
|
|
7510
|
-
// src/core/components/SettingsWidget/index.tsx
|
|
7511
|
-
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
7512
|
-
var defaultSettingsWidgetContext = {};
|
|
7513
|
-
var settingsWidgetContext = createContext8(defaultSettingsWidgetContext);
|
|
7514
|
-
var useSettingsWidgetContext = () => {
|
|
7515
|
-
return useContext12(settingsWidgetContext);
|
|
7516
|
-
};
|
|
7517
|
-
function SettingsWidget({
|
|
7518
|
-
children,
|
|
7519
|
-
onRestoreDefaultValues,
|
|
7520
|
-
unsavedChanges,
|
|
7521
|
-
custom,
|
|
7522
|
-
widgetProps
|
|
7523
|
-
}) {
|
|
7524
|
-
return /* @__PURE__ */ jsx36(settingsWidgetContext.Provider, {
|
|
7525
|
-
value: { custom, unsavedChanges },
|
|
7526
|
-
children: /* @__PURE__ */ jsx36(Widget, {
|
|
7527
|
-
title: "Settings",
|
|
7528
|
-
id: "settings",
|
|
7529
|
-
...widgetProps,
|
|
7530
|
-
buttons: [
|
|
7531
|
-
...onRestoreDefaultValues ? [
|
|
7532
|
-
{
|
|
7533
|
-
label: "Restore Default Values",
|
|
7534
|
-
icon: IconRestore,
|
|
7535
|
-
onClick: onRestoreDefaultValues,
|
|
7536
|
-
componentsProps: { button: { disabled: custom === false } }
|
|
7537
|
-
}
|
|
7538
|
-
] : [],
|
|
7539
|
-
...widgetProps?.buttons ?? []
|
|
7540
|
-
],
|
|
7541
|
-
badges: [
|
|
7542
|
-
{
|
|
7543
|
-
label: "Custom",
|
|
7544
|
-
tooltip: "Your settings differ from the default settings",
|
|
7545
|
-
mounted: custom ?? false
|
|
7546
|
-
},
|
|
7547
|
-
{
|
|
7548
|
-
label: "Unsaved Changes",
|
|
7549
|
-
mounted: unsavedChanges ?? false
|
|
7550
|
-
},
|
|
7551
|
-
...widgetProps?.badges ?? []
|
|
7552
|
-
],
|
|
7553
|
-
children
|
|
7554
|
-
})
|
|
7555
|
-
});
|
|
7556
|
-
}
|
|
7557
|
-
var SettingsWidget_default = Object.assign(SettingsWidget, {
|
|
7558
|
-
SaveButton
|
|
7559
|
-
});
|
|
7560
|
-
// src/core/components/SettingsWidget/SettingsTable/index.tsx
|
|
7561
|
-
import { createContext as createContext9, useContext as useContext13 } from "react";
|
|
7562
|
-
import { Table as Table2 } from "@mantine/core";
|
|
7563
|
-
|
|
7564
|
-
// src/core/components/SettingsWidget/SettingsTable/Row/index.tsx
|
|
7565
|
-
import { Table, Text as Text3 } from "@mantine/core";
|
|
7566
|
-
import { jsx as jsx37, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
7567
|
-
function Row({
|
|
7568
|
-
children,
|
|
7569
|
-
label
|
|
7570
|
-
}) {
|
|
7571
|
-
const options = useSettingsTableOptions();
|
|
7572
|
-
return /* @__PURE__ */ jsxs14(Table.Tr, {
|
|
7573
|
-
children: [
|
|
7574
|
-
/* @__PURE__ */ jsx37(Table.Th, {
|
|
7575
|
-
w: options.leftColumnWidth,
|
|
7576
|
-
children: /* @__PURE__ */ jsx37(Text3, {
|
|
7577
|
-
size: "sm",
|
|
7578
|
-
children: label
|
|
7579
|
-
})
|
|
7580
|
-
}),
|
|
7581
|
-
/* @__PURE__ */ jsx37(Table.Td, {
|
|
7582
|
-
py: "xs",
|
|
7583
|
-
children
|
|
7584
|
-
})
|
|
7585
|
-
]
|
|
7586
|
-
});
|
|
7587
|
-
}
|
|
7588
|
-
|
|
7589
|
-
// src/core/components/SettingsWidget/SettingsTable/index.tsx
|
|
7590
|
-
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
7591
|
-
var defaultSettingsTableOptions = {
|
|
7592
|
-
leftColumnWidth: "38.2%"
|
|
7593
|
-
};
|
|
7594
|
-
var settingsTableOptionsContext = createContext9(defaultSettingsTableOptions);
|
|
7595
|
-
var useSettingsTableOptions = () => {
|
|
7596
|
-
return useContext13(settingsTableOptionsContext);
|
|
7597
|
-
};
|
|
7598
|
-
function SettingsTable({
|
|
7599
|
-
leftColumnWidth,
|
|
7600
|
-
children: childrenProp
|
|
7601
|
-
}) {
|
|
7602
|
-
const children = asChildrenOfType(Row, childrenProp, "Check children passed to 'SettingsTable' component.");
|
|
7603
|
-
const theme = useRemoraidTheme();
|
|
7604
|
-
return /* @__PURE__ */ jsx38(settingsTableOptionsContext.Provider, {
|
|
7605
|
-
value: {
|
|
7606
|
-
leftColumnWidth: leftColumnWidth ?? defaultSettingsTableOptions.leftColumnWidth
|
|
7607
|
-
},
|
|
7608
|
-
children: /* @__PURE__ */ jsx38(Table2, {
|
|
7609
|
-
bg: theme.transparentBackground,
|
|
7610
|
-
withTableBorder: true,
|
|
7611
|
-
variant: "vertical",
|
|
7612
|
-
layout: "fixed",
|
|
7613
|
-
children: /* @__PURE__ */ jsx38(Table2.Tbody, {
|
|
7614
|
-
children
|
|
7615
|
-
})
|
|
7616
|
-
})
|
|
7617
|
-
});
|
|
7618
|
-
}
|
|
7619
|
-
var SettingsTable_default = Object.assign(SettingsTable, {
|
|
7620
|
-
Row
|
|
7621
|
-
});
|
|
7622
|
-
// src/core/components/NavbarSettingsWidget/index.tsx
|
|
7623
|
-
var import_lodash19 = __toESM(require_lodash(), 1);
|
|
7624
|
-
import { Select } from "@mantine/core";
|
|
7625
|
-
import { jsx as jsx39, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
7626
|
-
// src/core/components/FooterSettingsWidget/index.tsx
|
|
7627
|
-
var import_lodash20 = __toESM(require_lodash(), 1);
|
|
7628
|
-
import { Select as Select2 } from "@mantine/core";
|
|
7629
|
-
import { jsx as jsx40, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
7630
|
-
// src/core/components/ContextClusterProvider/index.tsx
|
|
7631
|
-
import React10 from "react";
|
|
7632
|
-
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
7633
|
-
// src/core/components/InputWrapperScrollArea/index.tsx
|
|
7634
|
-
import {
|
|
7635
|
-
Box as Box8,
|
|
7636
|
-
Input,
|
|
7637
|
-
Paper as Paper4,
|
|
7638
|
-
ScrollArea as ScrollArea5
|
|
7639
|
-
} from "@mantine/core";
|
|
7640
|
-
import { useState as useState10 } from "react";
|
|
7641
|
-
import { useRemoraidTheme as useRemoraidTheme2 } from "remoraid/core";
|
|
7642
|
-
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
7643
|
-
function InputWrapperScrollArea({
|
|
7644
|
-
children,
|
|
7645
|
-
label,
|
|
7646
|
-
mah,
|
|
7647
|
-
description,
|
|
7648
|
-
error,
|
|
7649
|
-
required = false,
|
|
7650
|
-
componentsProps
|
|
7651
|
-
}) {
|
|
7652
|
-
const theme = useRemoraidTheme2();
|
|
7653
|
-
const [isHovering, setIsHovering] = useState10(false);
|
|
7654
|
-
return /* @__PURE__ */ jsx42(Input.Wrapper, {
|
|
7655
|
-
label,
|
|
7656
|
-
error,
|
|
7657
|
-
onMouseEnter: () => setIsHovering(true),
|
|
7658
|
-
onMouseLeave: () => setIsHovering(false),
|
|
7659
|
-
description,
|
|
7660
|
-
withAsterisk: required,
|
|
7661
|
-
...componentsProps?.container,
|
|
7662
|
-
children: /* @__PURE__ */ jsx42(Paper4, {
|
|
7663
|
-
shadow: "none",
|
|
7664
|
-
p: 0,
|
|
7665
|
-
mt: Boolean(description) ? 4 : 0,
|
|
7666
|
-
withBorder: true,
|
|
7667
|
-
display: "flex",
|
|
7668
|
-
bg: theme.transparentBackground,
|
|
7669
|
-
style: {
|
|
7670
|
-
transition: "border-color .1s",
|
|
7671
|
-
borderColor: error ? "var(--mantine-color-error)" : isHovering ? "var(--mantine-primary-color-filled)" : undefined
|
|
7672
|
-
},
|
|
7673
|
-
children: /* @__PURE__ */ jsx42(ScrollArea5, {
|
|
7674
|
-
mah,
|
|
7675
|
-
px: "md",
|
|
7676
|
-
flex: 1,
|
|
7677
|
-
...componentsProps?.ScrollArea,
|
|
7678
|
-
children: /* @__PURE__ */ jsx42(Box8, {
|
|
7679
|
-
...componentsProps?.childrenContainer,
|
|
7680
|
-
children
|
|
7681
|
-
})
|
|
7682
|
-
})
|
|
7683
|
-
})
|
|
7684
|
-
});
|
|
7685
|
-
}
|
|
7686
5436
|
// src/jsonforms/renderers/AnyControl.tsx
|
|
5437
|
+
import { InputWrapperScrollArea, useRemoraidTheme } from "remoraid/core";
|
|
7687
5438
|
import { withJsonFormsControlProps } from "@jsonforms/react";
|
|
7688
5439
|
import { JsonInput } from "@mantine/core";
|
|
7689
|
-
import { useState as
|
|
5440
|
+
import { useState as useState2 } from "react";
|
|
7690
5441
|
|
|
7691
5442
|
// src/jsonforms/components/FormOptionsProvider/index.tsx
|
|
7692
|
-
import
|
|
7693
|
-
useContext
|
|
7694
|
-
useState
|
|
5443
|
+
import React, {
|
|
5444
|
+
useContext,
|
|
5445
|
+
useState
|
|
7695
5446
|
} from "react";
|
|
7696
|
-
import { jsx
|
|
5447
|
+
import { jsx } from "react/jsx-runtime";
|
|
7697
5448
|
var defaultFormOptions = {
|
|
7698
5449
|
withDescriptions: false,
|
|
7699
5450
|
gutter: "md"
|
|
7700
5451
|
};
|
|
7701
|
-
var formOptionsContext =
|
|
5452
|
+
var formOptionsContext = React.createContext({
|
|
7702
5453
|
formOptions: defaultFormOptions,
|
|
7703
5454
|
updateFormOptions: () => {}
|
|
7704
5455
|
});
|
|
7705
|
-
var useFormOptions = () =>
|
|
5456
|
+
var useFormOptions = () => useContext(formOptionsContext);
|
|
7706
5457
|
function FormOptionsProvider({
|
|
7707
5458
|
children,
|
|
7708
5459
|
initialValue
|
|
7709
5460
|
}) {
|
|
7710
|
-
const [formOptions, setFormOptions] =
|
|
5461
|
+
const [formOptions, setFormOptions] = useState({
|
|
7711
5462
|
...defaultFormOptions,
|
|
7712
5463
|
...initialValue
|
|
7713
5464
|
});
|
|
7714
5465
|
const updateFormOptions = (newFormOptions) => {
|
|
7715
5466
|
setFormOptions((prev) => ({ ...prev, ...newFormOptions }));
|
|
7716
5467
|
};
|
|
7717
|
-
return /* @__PURE__ */
|
|
5468
|
+
return /* @__PURE__ */ jsx(formOptionsContext.Provider, {
|
|
7718
5469
|
value: { formOptions, updateFormOptions },
|
|
7719
5470
|
children
|
|
7720
5471
|
});
|
|
7721
5472
|
}
|
|
7722
5473
|
|
|
7723
5474
|
// src/jsonforms/renderers/AnyControl.tsx
|
|
7724
|
-
import { jsx as
|
|
5475
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
7725
5476
|
function PlainAnyControl({
|
|
7726
5477
|
data,
|
|
7727
5478
|
handleChange,
|
|
@@ -7734,17 +5485,17 @@ function PlainAnyControl({
|
|
|
7734
5485
|
const {
|
|
7735
5486
|
formOptions: { withDescriptions }
|
|
7736
5487
|
} = useFormOptions();
|
|
7737
|
-
const [input, setInput] =
|
|
7738
|
-
const [error, setError] =
|
|
5488
|
+
const [input, setInput] = useState2(JSON.stringify(data, null, theme.jsonStringifySpace));
|
|
5489
|
+
const [error, setError] = useState2(false);
|
|
7739
5490
|
const label = labelProp !== "remoraid-array-item" ? labelProp : null;
|
|
7740
5491
|
const description = withDescriptions ? schema.description : undefined;
|
|
7741
|
-
return /* @__PURE__ */
|
|
5492
|
+
return /* @__PURE__ */ jsx2(InputWrapperScrollArea, {
|
|
7742
5493
|
label: label ?? undefined,
|
|
7743
5494
|
error: error ? "Invalid JSON" : undefined,
|
|
7744
5495
|
description,
|
|
7745
5496
|
required,
|
|
7746
5497
|
mah: 140,
|
|
7747
|
-
children: /* @__PURE__ */
|
|
5498
|
+
children: /* @__PURE__ */ jsx2(JsonInput, {
|
|
7748
5499
|
onChange: (newValue) => {
|
|
7749
5500
|
setInput(newValue);
|
|
7750
5501
|
try {
|
|
@@ -7777,9 +5528,9 @@ import {
|
|
|
7777
5528
|
import {
|
|
7778
5529
|
Resolve
|
|
7779
5530
|
} from "@jsonforms/core";
|
|
7780
|
-
import { Input
|
|
7781
|
-
import { useMemo
|
|
7782
|
-
import { jsx as
|
|
5531
|
+
import { Input, Paper, Select } from "@mantine/core";
|
|
5532
|
+
import { useMemo, useState as useState3 } from "react";
|
|
5533
|
+
import { jsx as jsx3, jsxs, Fragment } from "react/jsx-runtime";
|
|
7783
5534
|
function PlainAnyOfControl({
|
|
7784
5535
|
data,
|
|
7785
5536
|
schema,
|
|
@@ -7810,7 +5561,7 @@ function PlainAnyOfControl({
|
|
|
7810
5561
|
}
|
|
7811
5562
|
return;
|
|
7812
5563
|
};
|
|
7813
|
-
const options =
|
|
5564
|
+
const options = useMemo(() => {
|
|
7814
5565
|
const anyOf = schema.anyOf ?? [];
|
|
7815
5566
|
return anyOf.map((opt, idx) => {
|
|
7816
5567
|
const resolved = opt.$ref ? Resolve.schema(rootSchema, opt.$ref, rootSchema) : opt;
|
|
@@ -7820,7 +5571,7 @@ function PlainAnyOfControl({
|
|
|
7820
5571
|
return { original: opt, resolved, label: label2 };
|
|
7821
5572
|
});
|
|
7822
5573
|
}, [schema.anyOf, rootSchema]);
|
|
7823
|
-
const isValidOptionIndex =
|
|
5574
|
+
const isValidOptionIndex = useMemo(() => {
|
|
7824
5575
|
return (optionIndex) => {
|
|
7825
5576
|
if (!core?.ajv || data === undefined) {
|
|
7826
5577
|
return false;
|
|
@@ -7829,7 +5580,7 @@ function PlainAnyOfControl({
|
|
|
7829
5580
|
return validate(data);
|
|
7830
5581
|
};
|
|
7831
5582
|
}, [core?.ajv, data, options]);
|
|
7832
|
-
const validOptionIndex =
|
|
5583
|
+
const validOptionIndex = useMemo(() => {
|
|
7833
5584
|
for (let i = 0;i < options.length; i++) {
|
|
7834
5585
|
if (isValidOptionIndex(i)) {
|
|
7835
5586
|
return i;
|
|
@@ -7837,7 +5588,7 @@ function PlainAnyOfControl({
|
|
|
7837
5588
|
}
|
|
7838
5589
|
return -1;
|
|
7839
5590
|
}, [options, isValidOptionIndex]);
|
|
7840
|
-
const [selectedOption, setSelectedOption] =
|
|
5591
|
+
const [selectedOption, setSelectedOption] = useState3(validOptionIndex >= 0 ? String(validOptionIndex) : null);
|
|
7841
5592
|
const schemaDefaultValue = (opt) => {
|
|
7842
5593
|
const t = opt.type ?? (opt.properties ? "object" : opt.items ? "array" : undefined);
|
|
7843
5594
|
switch (t) {
|
|
@@ -7863,19 +5614,19 @@ function PlainAnyOfControl({
|
|
|
7863
5614
|
value: String(i),
|
|
7864
5615
|
label: o.label
|
|
7865
5616
|
}));
|
|
7866
|
-
return /* @__PURE__ */
|
|
7867
|
-
children: /* @__PURE__ */
|
|
5617
|
+
return /* @__PURE__ */ jsx3(Fragment, {
|
|
5618
|
+
children: /* @__PURE__ */ jsx3(Input.Wrapper, {
|
|
7868
5619
|
label,
|
|
7869
5620
|
description: formOptions.withDescriptions ? schema.description ?? null : null,
|
|
7870
5621
|
withAsterisk: required,
|
|
7871
|
-
children: /* @__PURE__ */
|
|
5622
|
+
children: /* @__PURE__ */ jsxs(Paper, {
|
|
7872
5623
|
withBorder: true,
|
|
7873
5624
|
shadow: "0",
|
|
7874
5625
|
bg: "var(--remoraid-transparent-background)",
|
|
7875
5626
|
p: formOptions.gutter,
|
|
7876
5627
|
mt: formOptions.withDescriptions && schema.description && schema.description.length > 0 ? 4 : 0,
|
|
7877
5628
|
children: [
|
|
7878
|
-
/* @__PURE__ */
|
|
5629
|
+
/* @__PURE__ */ jsx3(Select, {
|
|
7879
5630
|
label: "Value type",
|
|
7880
5631
|
data: selectData,
|
|
7881
5632
|
value: selectedOption,
|
|
@@ -7896,7 +5647,7 @@ function PlainAnyOfControl({
|
|
|
7896
5647
|
variant: "default",
|
|
7897
5648
|
mb: selectedOption !== null && inferType(selectedSchema) !== "null" ? formOptions.gutter : undefined
|
|
7898
5649
|
}),
|
|
7899
|
-
selectedOption !== null && /* @__PURE__ */
|
|
5650
|
+
selectedOption !== null && /* @__PURE__ */ jsx3(JsonForms, {
|
|
7900
5651
|
schema: {
|
|
7901
5652
|
...selectedSchema,
|
|
7902
5653
|
$schema: undefined
|
|
@@ -7923,18 +5674,18 @@ import {
|
|
|
7923
5674
|
useJsonForms as useJsonForms2,
|
|
7924
5675
|
withJsonFormsControlProps as withJsonFormsControlProps3
|
|
7925
5676
|
} from "@jsonforms/react";
|
|
7926
|
-
import { Box
|
|
5677
|
+
import { Box, Button, Flex, Input as Input2, Paper as Paper2, Stack } from "@mantine/core";
|
|
7927
5678
|
import { IconPlus, IconTrash } from "@tabler/icons-react";
|
|
7928
|
-
var
|
|
5679
|
+
var import_lodash = __toESM(require_lodash(), 1);
|
|
7929
5680
|
import {
|
|
7930
|
-
AlertCategory
|
|
7931
|
-
AlertMinimal
|
|
7932
|
-
RemoraidButton
|
|
7933
|
-
useRemoraidTheme as
|
|
5681
|
+
AlertCategory,
|
|
5682
|
+
AlertMinimal,
|
|
5683
|
+
RemoraidButton,
|
|
5684
|
+
useRemoraidTheme as useRemoraidTheme2
|
|
7934
5685
|
} from "remoraid/core";
|
|
7935
|
-
import { jsx as
|
|
5686
|
+
import { jsx as jsx4, jsxs as jsxs2, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
7936
5687
|
function PlainArrayControl(props) {
|
|
7937
|
-
const theme =
|
|
5688
|
+
const theme = useRemoraidTheme2();
|
|
7938
5689
|
const { label, schema, data, handleChange, path, required } = props;
|
|
7939
5690
|
const { formOptions } = useFormOptions();
|
|
7940
5691
|
const { renderers, cells } = useJsonForms2();
|
|
@@ -7951,45 +5702,45 @@ function PlainArrayControl(props) {
|
|
|
7951
5702
|
required: ["item"]
|
|
7952
5703
|
};
|
|
7953
5704
|
} else {
|
|
7954
|
-
return /* @__PURE__ */
|
|
7955
|
-
category:
|
|
5705
|
+
return /* @__PURE__ */ jsx4(AlertMinimal, {
|
|
5706
|
+
category: AlertCategory.Negative,
|
|
7956
5707
|
title: "Renderer missing",
|
|
7957
5708
|
text: `Could not find applicable renderer for property '${label}'.`
|
|
7958
5709
|
});
|
|
7959
5710
|
}
|
|
7960
|
-
return /* @__PURE__ */
|
|
7961
|
-
children: /* @__PURE__ */
|
|
5711
|
+
return /* @__PURE__ */ jsx4(Fragment2, {
|
|
5712
|
+
children: /* @__PURE__ */ jsx4(Input2.Wrapper, {
|
|
7962
5713
|
label,
|
|
7963
5714
|
description: formOptions.withDescriptions ? schema.description : undefined,
|
|
7964
5715
|
withAsterisk: required,
|
|
7965
|
-
children: /* @__PURE__ */
|
|
5716
|
+
children: /* @__PURE__ */ jsx4(Paper2, {
|
|
7966
5717
|
withBorder: Array.isArray(data) && data.length > 0,
|
|
7967
5718
|
shadow: "0",
|
|
7968
5719
|
bg: "var(--remoraid-transparent-background)",
|
|
7969
5720
|
p: Array.isArray(data) && data.length > 0 ? formOptions.gutter : 0,
|
|
7970
5721
|
mt: formOptions.withDescriptions && schema.description && schema.description.length > 0 ? 4 : 0,
|
|
7971
|
-
children: /* @__PURE__ */
|
|
5722
|
+
children: /* @__PURE__ */ jsxs2(Stack, {
|
|
7972
5723
|
align: "stretch",
|
|
7973
5724
|
justify: "flex-start",
|
|
7974
5725
|
gap: formOptions.gutter,
|
|
7975
5726
|
children: [
|
|
7976
5727
|
Array.isArray(data) ? data.map((item, i) => {
|
|
7977
|
-
return /* @__PURE__ */
|
|
5728
|
+
return /* @__PURE__ */ jsxs2(Flex, {
|
|
7978
5729
|
gap: formOptions.gutter,
|
|
7979
5730
|
justify: "flex-start",
|
|
7980
5731
|
align: "center",
|
|
7981
5732
|
direction: "row",
|
|
7982
5733
|
wrap: "nowrap",
|
|
7983
5734
|
children: [
|
|
7984
|
-
/* @__PURE__ */
|
|
5735
|
+
/* @__PURE__ */ jsx4(Box, {
|
|
7985
5736
|
flex: 1,
|
|
7986
|
-
children: /* @__PURE__ */
|
|
5737
|
+
children: /* @__PURE__ */ jsx4(JsonForms2, {
|
|
7987
5738
|
schema: schemaItems,
|
|
7988
5739
|
data: { item },
|
|
7989
5740
|
renderers: renderers ?? [],
|
|
7990
5741
|
cells: cells ?? [],
|
|
7991
5742
|
onChange: ({ data: newData }) => {
|
|
7992
|
-
if (
|
|
5743
|
+
if (import_lodash.isEqual(data[i], newData.item)) {
|
|
7993
5744
|
return;
|
|
7994
5745
|
}
|
|
7995
5746
|
const dataCopy = [...data];
|
|
@@ -7999,7 +5750,7 @@ function PlainArrayControl(props) {
|
|
|
7999
5750
|
validationMode: "NoValidation"
|
|
8000
5751
|
})
|
|
8001
5752
|
}),
|
|
8002
|
-
/* @__PURE__ */
|
|
5753
|
+
/* @__PURE__ */ jsx4(RemoraidButton, {
|
|
8003
5754
|
responsive: false,
|
|
8004
5755
|
collapsed: true,
|
|
8005
5756
|
label: "Delete item",
|
|
@@ -8011,10 +5762,10 @@ function PlainArrayControl(props) {
|
|
|
8011
5762
|
})
|
|
8012
5763
|
]
|
|
8013
5764
|
}, i);
|
|
8014
|
-
}) : /* @__PURE__ */
|
|
8015
|
-
/* @__PURE__ */
|
|
5765
|
+
}) : /* @__PURE__ */ jsx4(Fragment2, {}),
|
|
5766
|
+
/* @__PURE__ */ jsx4(Button, {
|
|
8016
5767
|
variant: "default",
|
|
8017
|
-
leftSection: /* @__PURE__ */
|
|
5768
|
+
leftSection: /* @__PURE__ */ jsx4(IconPlus, {
|
|
8018
5769
|
...theme.componentsProps.icons.medium
|
|
8019
5770
|
}),
|
|
8020
5771
|
onClick: () => {
|
|
@@ -8044,7 +5795,7 @@ var ArrayControl_default = ArrayControl;
|
|
|
8044
5795
|
// src/jsonforms/renderers/CheckboxControl.tsx
|
|
8045
5796
|
import { withJsonFormsControlProps as withJsonFormsControlProps4 } from "@jsonforms/react";
|
|
8046
5797
|
import { Checkbox } from "@mantine/core";
|
|
8047
|
-
import { jsx as
|
|
5798
|
+
import { jsx as jsx5, Fragment as Fragment3 } from "react/jsx-runtime";
|
|
8048
5799
|
function PlainCheckboxControl({
|
|
8049
5800
|
data,
|
|
8050
5801
|
handleChange,
|
|
@@ -8054,8 +5805,8 @@ function PlainCheckboxControl({
|
|
|
8054
5805
|
schema
|
|
8055
5806
|
}) {
|
|
8056
5807
|
const { formOptions } = useFormOptions();
|
|
8057
|
-
return /* @__PURE__ */
|
|
8058
|
-
children: /* @__PURE__ */
|
|
5808
|
+
return /* @__PURE__ */ jsx5(Fragment3, {
|
|
5809
|
+
children: /* @__PURE__ */ jsx5(Checkbox, {
|
|
8059
5810
|
label,
|
|
8060
5811
|
py: formOptions.gutter,
|
|
8061
5812
|
labelPosition: "left",
|
|
@@ -8074,7 +5825,7 @@ var CheckboxControl_default = CheckboxControl;
|
|
|
8074
5825
|
// src/jsonforms/renderers/NumberControl.tsx
|
|
8075
5826
|
import { withJsonFormsControlProps as withJsonFormsControlProps5 } from "@jsonforms/react";
|
|
8076
5827
|
import { NumberInput } from "@mantine/core";
|
|
8077
|
-
import { jsx as
|
|
5828
|
+
import { jsx as jsx6, Fragment as Fragment4 } from "react/jsx-runtime";
|
|
8078
5829
|
function PlainNumberControl({
|
|
8079
5830
|
data,
|
|
8080
5831
|
handleChange,
|
|
@@ -8086,8 +5837,8 @@ function PlainNumberControl({
|
|
|
8086
5837
|
const {
|
|
8087
5838
|
formOptions: { withDescriptions }
|
|
8088
5839
|
} = useFormOptions();
|
|
8089
|
-
return /* @__PURE__ */
|
|
8090
|
-
children: /* @__PURE__ */
|
|
5840
|
+
return /* @__PURE__ */ jsx6(Fragment4, {
|
|
5841
|
+
children: /* @__PURE__ */ jsx6(NumberInput, {
|
|
8091
5842
|
label,
|
|
8092
5843
|
variant: "default",
|
|
8093
5844
|
value: data ?? "",
|
|
@@ -8112,20 +5863,21 @@ import {
|
|
|
8112
5863
|
withJsonFormsControlProps as withJsonFormsControlProps6
|
|
8113
5864
|
} from "@jsonforms/react";
|
|
8114
5865
|
import {
|
|
8115
|
-
Box as
|
|
8116
|
-
Flex as
|
|
8117
|
-
Group
|
|
8118
|
-
Input as
|
|
8119
|
-
Paper as
|
|
8120
|
-
Stack as
|
|
5866
|
+
Box as Box2,
|
|
5867
|
+
Flex as Flex2,
|
|
5868
|
+
Group,
|
|
5869
|
+
Input as Input3,
|
|
5870
|
+
Paper as Paper3,
|
|
5871
|
+
Stack as Stack2,
|
|
8121
5872
|
TextInput
|
|
8122
5873
|
} from "@mantine/core";
|
|
8123
5874
|
import {
|
|
8124
5875
|
composePaths
|
|
8125
5876
|
} from "@jsonforms/core";
|
|
8126
|
-
import { useState as
|
|
5877
|
+
import { useState as useState4 } from "react";
|
|
8127
5878
|
import { IconPlus as IconPlus2, IconTrash as IconTrash2 } from "@tabler/icons-react";
|
|
8128
|
-
import {
|
|
5879
|
+
import { RemoraidButton as RemoraidButton2 } from "remoraid/core";
|
|
5880
|
+
import { jsx as jsx7, jsxs as jsxs3, Fragment as Fragment5 } from "react/jsx-runtime";
|
|
8129
5881
|
function PlainObjectControl({
|
|
8130
5882
|
label: labelProp,
|
|
8131
5883
|
schema,
|
|
@@ -8136,7 +5888,7 @@ function PlainObjectControl({
|
|
|
8136
5888
|
}) {
|
|
8137
5889
|
const { formOptions } = useFormOptions();
|
|
8138
5890
|
const { renderers, cells } = useJsonForms3();
|
|
8139
|
-
const [newKey, setNewKey] =
|
|
5891
|
+
const [newKey, setNewKey] = useState4("");
|
|
8140
5892
|
const hasProperties = schema.properties && Object.keys(schema.properties).length > 0;
|
|
8141
5893
|
const hasAdditionalProperties = schema.additionalProperties === true || schema.additionalProperties !== undefined && Object.keys(schema.additionalProperties).length > 0;
|
|
8142
5894
|
const label = labelProp !== "remoraid-array-item" ? labelProp : null;
|
|
@@ -8144,22 +5896,22 @@ function PlainObjectControl({
|
|
|
8144
5896
|
const declaredKeys = new Set(Object.keys(schema.properties ?? {}));
|
|
8145
5897
|
const objectData = data && typeof data === "object" && !Array.isArray(data) ? data : {};
|
|
8146
5898
|
const additionalEntries = Object.entries(objectData).filter(([key]) => !declaredKeys.has(key));
|
|
8147
|
-
return /* @__PURE__ */
|
|
5899
|
+
return /* @__PURE__ */ jsx7(Input3.Wrapper, {
|
|
8148
5900
|
label,
|
|
8149
5901
|
description,
|
|
8150
5902
|
withAsterisk: required,
|
|
8151
|
-
children: /* @__PURE__ */
|
|
5903
|
+
children: /* @__PURE__ */ jsx7(Paper3, {
|
|
8152
5904
|
withBorder: true,
|
|
8153
5905
|
bg: "var(--remoraid-transparent-background)",
|
|
8154
5906
|
shadow: "0",
|
|
8155
5907
|
p: formOptions.gutter,
|
|
8156
5908
|
mt: Boolean(description) ? 4 : 0,
|
|
8157
|
-
children: /* @__PURE__ */
|
|
5909
|
+
children: /* @__PURE__ */ jsxs3(Stack2, {
|
|
8158
5910
|
align: "stretch",
|
|
8159
5911
|
justify: "flex-start",
|
|
8160
5912
|
gap: formOptions.gutter,
|
|
8161
5913
|
children: [
|
|
8162
|
-
hasProperties && /* @__PURE__ */
|
|
5914
|
+
hasProperties && /* @__PURE__ */ jsx7(JsonForms3, {
|
|
8163
5915
|
schema: {
|
|
8164
5916
|
...schema,
|
|
8165
5917
|
$schema: undefined
|
|
@@ -8172,22 +5924,22 @@ function PlainObjectControl({
|
|
|
8172
5924
|
},
|
|
8173
5925
|
validationMode: "NoValidation"
|
|
8174
5926
|
}),
|
|
8175
|
-
hasAdditionalProperties && /* @__PURE__ */
|
|
5927
|
+
hasAdditionalProperties && /* @__PURE__ */ jsxs3(Fragment5, {
|
|
8176
5928
|
children: [
|
|
8177
|
-
additionalEntries.length > 0 && /* @__PURE__ */
|
|
5929
|
+
additionalEntries.length > 0 && /* @__PURE__ */ jsx7(Stack2, {
|
|
8178
5930
|
align: "stretch",
|
|
8179
5931
|
justify: "flex-start",
|
|
8180
5932
|
gap: formOptions.gutter,
|
|
8181
|
-
children: additionalEntries.map(([key, data2]) => /* @__PURE__ */
|
|
5933
|
+
children: additionalEntries.map(([key, data2]) => /* @__PURE__ */ jsxs3(Flex2, {
|
|
8182
5934
|
gap: formOptions.gutter,
|
|
8183
5935
|
justify: "flex-start",
|
|
8184
5936
|
align: "center",
|
|
8185
5937
|
direction: "row",
|
|
8186
5938
|
wrap: "nowrap",
|
|
8187
5939
|
children: [
|
|
8188
|
-
/* @__PURE__ */
|
|
5940
|
+
/* @__PURE__ */ jsx7(Box2, {
|
|
8189
5941
|
flex: 1,
|
|
8190
|
-
children: /* @__PURE__ */
|
|
5942
|
+
children: /* @__PURE__ */ jsx7(JsonForms3, {
|
|
8191
5943
|
schema: {
|
|
8192
5944
|
...schema.additionalProperties === true ? {} : schema.additionalProperties,
|
|
8193
5945
|
title: key,
|
|
@@ -8206,7 +5958,7 @@ function PlainObjectControl({
|
|
|
8206
5958
|
}
|
|
8207
5959
|
})
|
|
8208
5960
|
}),
|
|
8209
|
-
/* @__PURE__ */
|
|
5961
|
+
/* @__PURE__ */ jsx7(RemoraidButton2, {
|
|
8210
5962
|
responsive: false,
|
|
8211
5963
|
collapsed: true,
|
|
8212
5964
|
label: `Delete ${key}`,
|
|
@@ -8224,12 +5976,12 @@ function PlainObjectControl({
|
|
|
8224
5976
|
]
|
|
8225
5977
|
}, key))
|
|
8226
5978
|
}),
|
|
8227
|
-
/* @__PURE__ */
|
|
5979
|
+
/* @__PURE__ */ jsxs3(Group, {
|
|
8228
5980
|
gap: formOptions.gutter,
|
|
8229
5981
|
wrap: "nowrap",
|
|
8230
5982
|
align: "flex-end",
|
|
8231
5983
|
children: [
|
|
8232
|
-
/* @__PURE__ */
|
|
5984
|
+
/* @__PURE__ */ jsx7(TextInput, {
|
|
8233
5985
|
label: "New key",
|
|
8234
5986
|
variant: "default",
|
|
8235
5987
|
value: newKey,
|
|
@@ -8240,7 +5992,7 @@ function PlainObjectControl({
|
|
|
8240
5992
|
description: formOptions.withDescriptions ? "Key for new additional property value" : null,
|
|
8241
5993
|
flex: 1
|
|
8242
5994
|
}),
|
|
8243
|
-
/* @__PURE__ */
|
|
5995
|
+
/* @__PURE__ */ jsx7(RemoraidButton2, {
|
|
8244
5996
|
responsive: false,
|
|
8245
5997
|
collapsed: true,
|
|
8246
5998
|
label: "Add key",
|
|
@@ -8279,8 +6031,8 @@ var ObjectControl_default = ObjectControl;
|
|
|
8279
6031
|
|
|
8280
6032
|
// src/jsonforms/renderers/StringSelectControl.tsx
|
|
8281
6033
|
import { withJsonFormsControlProps as withJsonFormsControlProps7 } from "@jsonforms/react";
|
|
8282
|
-
import { Select as
|
|
8283
|
-
import { jsx as
|
|
6034
|
+
import { Select as Select2 } from "@mantine/core";
|
|
6035
|
+
import { jsx as jsx8, Fragment as Fragment6 } from "react/jsx-runtime";
|
|
8284
6036
|
function PlainTimestampControl({
|
|
8285
6037
|
data,
|
|
8286
6038
|
handleChange,
|
|
@@ -8292,8 +6044,8 @@ function PlainTimestampControl({
|
|
|
8292
6044
|
const {
|
|
8293
6045
|
formOptions: { withDescriptions }
|
|
8294
6046
|
} = useFormOptions();
|
|
8295
|
-
return /* @__PURE__ */
|
|
8296
|
-
children: /* @__PURE__ */
|
|
6047
|
+
return /* @__PURE__ */ jsx8(Fragment6, {
|
|
6048
|
+
children: /* @__PURE__ */ jsx8(Select2, {
|
|
8297
6049
|
label,
|
|
8298
6050
|
data: schema.enum,
|
|
8299
6051
|
value: data,
|
|
@@ -8429,7 +6181,7 @@ var verticalLayoutTester_default = tester9;
|
|
|
8429
6181
|
// src/jsonforms/renderers/TextControl.tsx
|
|
8430
6182
|
import { withJsonFormsControlProps as withJsonFormsControlProps8 } from "@jsonforms/react";
|
|
8431
6183
|
import { TextInput as TextInput2 } from "@mantine/core";
|
|
8432
|
-
import { jsx as
|
|
6184
|
+
import { jsx as jsx9, Fragment as Fragment7 } from "react/jsx-runtime";
|
|
8433
6185
|
function PlainTextControl({
|
|
8434
6186
|
data,
|
|
8435
6187
|
handleChange,
|
|
@@ -8441,8 +6193,8 @@ function PlainTextControl({
|
|
|
8441
6193
|
const {
|
|
8442
6194
|
formOptions: { withDescriptions }
|
|
8443
6195
|
} = useFormOptions();
|
|
8444
|
-
return /* @__PURE__ */
|
|
8445
|
-
children: /* @__PURE__ */
|
|
6196
|
+
return /* @__PURE__ */ jsx9(Fragment7, {
|
|
6197
|
+
children: /* @__PURE__ */ jsx9(TextInput2, {
|
|
8446
6198
|
label,
|
|
8447
6199
|
variant: "default",
|
|
8448
6200
|
placeholder: "",
|
|
@@ -8460,8 +6212,9 @@ var TextControl_default = TextControl;
|
|
|
8460
6212
|
|
|
8461
6213
|
// src/jsonforms/renderers/TimestampControl.tsx
|
|
8462
6214
|
import { withJsonFormsControlProps as withJsonFormsControlProps9 } from "@jsonforms/react";
|
|
8463
|
-
import {
|
|
8464
|
-
import
|
|
6215
|
+
import { DateTimePicker, toDateTimeString } from "@mantine/dates";
|
|
6216
|
+
import dayjs from "dayjs";
|
|
6217
|
+
import { jsx as jsx10, Fragment as Fragment8 } from "react/jsx-runtime";
|
|
8465
6218
|
function PlainTimestampControl2({
|
|
8466
6219
|
data,
|
|
8467
6220
|
handleChange,
|
|
@@ -8473,16 +6226,15 @@ function PlainTimestampControl2({
|
|
|
8473
6226
|
const {
|
|
8474
6227
|
formOptions: { withDescriptions }
|
|
8475
6228
|
} = useFormOptions();
|
|
8476
|
-
return /* @__PURE__ */
|
|
8477
|
-
children: /* @__PURE__ */
|
|
6229
|
+
return /* @__PURE__ */ jsx10(Fragment8, {
|
|
6230
|
+
children: /* @__PURE__ */ jsx10(DateTimePicker, {
|
|
8478
6231
|
variant: "default",
|
|
8479
6232
|
label,
|
|
8480
|
-
placeholder: "Pick
|
|
8481
|
-
value: new Date(data * 1000),
|
|
6233
|
+
placeholder: "Pick date and time",
|
|
6234
|
+
value: data === null || data === undefined ? data : toDateTimeString(new Date(data * 1000)),
|
|
6235
|
+
withSeconds: true,
|
|
8482
6236
|
onChange: (newValue) => {
|
|
8483
|
-
|
|
8484
|
-
handleChange(path, newValue.getTime() / 1000);
|
|
8485
|
-
}
|
|
6237
|
+
handleChange(path, newValue === null || newValue === undefined ? newValue : dayjs(newValue).toDate().getTime() / 1000);
|
|
8486
6238
|
},
|
|
8487
6239
|
required,
|
|
8488
6240
|
description: withDescriptions ? schema.description || null : null
|
|
@@ -8493,17 +6245,17 @@ var TimestampControl2 = withJsonFormsControlProps9(PlainTimestampControl2);
|
|
|
8493
6245
|
var TimestampControl_default = TimestampControl2;
|
|
8494
6246
|
|
|
8495
6247
|
// src/jsonforms/renderers/VerticalLayout.tsx
|
|
8496
|
-
import
|
|
6248
|
+
import React2 from "react";
|
|
8497
6249
|
import { withJsonFormsLayoutProps } from "@jsonforms/react";
|
|
8498
6250
|
import { JsonFormsDispatch, useJsonForms as useJsonForms4 } from "@jsonforms/react";
|
|
8499
|
-
import { jsx as
|
|
6251
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
8500
6252
|
"use client";
|
|
8501
6253
|
var JsonFormsLayout = ({
|
|
8502
6254
|
className,
|
|
8503
6255
|
children,
|
|
8504
6256
|
visible
|
|
8505
6257
|
}) => {
|
|
8506
|
-
return /* @__PURE__ */
|
|
6258
|
+
return /* @__PURE__ */ jsx11("div", {
|
|
8507
6259
|
className,
|
|
8508
6260
|
hidden: visible === undefined || visible === null ? false : !visible,
|
|
8509
6261
|
children
|
|
@@ -8514,10 +6266,10 @@ var renderChildren = (layout, schema, className, path, enabled) => {
|
|
|
8514
6266
|
const { formOptions } = useFormOptions();
|
|
8515
6267
|
const gutter = typeof formOptions.gutter === "string" ? `var(--mantine-spacing-${formOptions.gutter})` : `${formOptions.gutter}px`;
|
|
8516
6268
|
return layout.elements.map((child, index) => {
|
|
8517
|
-
return /* @__PURE__ */
|
|
6269
|
+
return /* @__PURE__ */ jsx11("div", {
|
|
8518
6270
|
className,
|
|
8519
6271
|
style: { marginTop: index === 0 ? 0 : gutter },
|
|
8520
|
-
children: /* @__PURE__ */
|
|
6272
|
+
children: /* @__PURE__ */ jsx11(JsonFormsDispatch, {
|
|
8521
6273
|
renderers,
|
|
8522
6274
|
cells,
|
|
8523
6275
|
uischema: child,
|
|
@@ -8530,11 +6282,11 @@ var renderChildren = (layout, schema, className, path, enabled) => {
|
|
|
8530
6282
|
};
|
|
8531
6283
|
var VerticalLayoutRenderer = (props) => {
|
|
8532
6284
|
const { data: _data, ...otherProps } = props;
|
|
8533
|
-
return /* @__PURE__ */
|
|
6285
|
+
return /* @__PURE__ */ jsx11(VerticalLayoutRendererComponent, {
|
|
8534
6286
|
...otherProps
|
|
8535
6287
|
});
|
|
8536
6288
|
};
|
|
8537
|
-
var VerticalLayoutRendererComponent =
|
|
6289
|
+
var VerticalLayoutRendererComponent = React2.memo(function VerticalLayoutRendererComponent2({
|
|
8538
6290
|
schema,
|
|
8539
6291
|
uischema,
|
|
8540
6292
|
path,
|
|
@@ -8544,7 +6296,7 @@ var VerticalLayoutRendererComponent = React12.memo(function VerticalLayoutRender
|
|
|
8544
6296
|
const verticalLayout = uischema;
|
|
8545
6297
|
const layoutClassName = "";
|
|
8546
6298
|
const childClassNames = "";
|
|
8547
|
-
return /* @__PURE__ */
|
|
6299
|
+
return /* @__PURE__ */ jsx11(JsonFormsLayout, {
|
|
8548
6300
|
className: layoutClassName,
|
|
8549
6301
|
uischema,
|
|
8550
6302
|
schema,
|