remoraid 3.1.1 → 3.5.0
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 +5 -1
- package/dist/core/index.cjs +622 -538
- package/dist/core/index.d.ts +59 -26
- package/dist/core/index.js +589 -503
- 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 +150 -2294
- package/dist/jsonforms/index.js +98 -2358
- package/package.json +29 -10
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,2307 +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-disabled)",
|
|
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 as MantineMenu,
|
|
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, style) => {
|
|
6131
|
-
const isLeaf2 = element.children === undefined || element.children.length === 0;
|
|
6132
|
-
const Menu2 = isLeaf2 ? MantineMenu : MantineMenu.Sub;
|
|
6133
|
-
return /* @__PURE__ */ jsx15(Menu2.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,
|
|
6147
|
-
children: element.label
|
|
6148
|
-
});
|
|
6149
|
-
};
|
|
6150
|
-
const isRoot = isValidElement2(target);
|
|
6151
|
-
const isLeaf = elements === undefined || elements.length === 0;
|
|
6152
|
-
const Menu = isRoot ? MantineMenu : MantineMenu.Sub;
|
|
6153
|
-
const menuProps = isRoot ? { trigger: "click-hover", ...componentsProps?.Menu } : { ...componentsProps?.MenuSub };
|
|
6154
|
-
return /* @__PURE__ */ jsx15(Transition, {
|
|
6155
|
-
mounted: isRoot ? true : target.mounted ?? true,
|
|
6156
|
-
...componentsProps?.transition,
|
|
6157
|
-
children: (transitionStyle) => {
|
|
6158
|
-
if (isLeaf) {
|
|
6159
|
-
if (isRoot) {
|
|
6160
|
-
return target;
|
|
6161
|
-
}
|
|
6162
|
-
return item(target, transitionStyle);
|
|
6163
|
-
}
|
|
6164
|
-
return /* @__PURE__ */ jsxs2(Menu, {
|
|
6165
|
-
...menuProps,
|
|
6166
|
-
children: [
|
|
6167
|
-
/* @__PURE__ */ jsx15(Menu.Target, {
|
|
6168
|
-
children: isRoot ? /* @__PURE__ */ jsx15(Box2, {
|
|
6169
|
-
...componentsProps?.rootTargetContainer,
|
|
6170
|
-
children: target
|
|
6171
|
-
}) : item(target, transitionStyle)
|
|
6172
|
-
}),
|
|
6173
|
-
/* @__PURE__ */ jsxs2(Menu.Dropdown, {
|
|
6174
|
-
children: [
|
|
6175
|
-
label !== undefined && /* @__PURE__ */ jsx15(MantineMenu.Label, {
|
|
6176
|
-
children: label
|
|
6177
|
-
}),
|
|
6178
|
-
elements.map((element, i) => /* @__PURE__ */ jsx15(NavigationMenu, {
|
|
6179
|
-
target: element,
|
|
6180
|
-
elements: element.children,
|
|
6181
|
-
componentsProps
|
|
6182
|
-
}, `navigation-menu-${i}`))
|
|
6183
|
-
]
|
|
6184
|
-
})
|
|
6185
|
-
]
|
|
6186
|
-
});
|
|
6187
|
-
}
|
|
6188
|
-
});
|
|
6189
|
-
}
|
|
6190
|
-
|
|
6191
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6192
|
-
import { IconDots } from "@tabler/icons-react";
|
|
6193
|
-
|
|
6194
|
-
// src/core/components/RemoraidButton/index.tsx
|
|
6195
|
-
var import_lodash7 = __toESM(require_lodash(), 1);
|
|
6196
|
-
import {
|
|
6197
|
-
ActionIcon,
|
|
6198
|
-
Button,
|
|
6199
|
-
Tooltip,
|
|
6200
|
-
Transition as Transition2
|
|
6201
|
-
} from "@mantine/core";
|
|
6202
|
-
import { IconClick } from "@tabler/icons-react";
|
|
6203
|
-
import {
|
|
6204
|
-
isValidElement as isValidElement3
|
|
6205
|
-
} from "react";
|
|
6206
|
-
import { jsx as jsx16, jsxs as jsxs3, Fragment } from "react/jsx-runtime";
|
|
6207
|
-
var defaultRemoraidButtonSize = "sm";
|
|
6208
|
-
function RemoraidButton({
|
|
6209
|
-
label,
|
|
6210
|
-
responsive: responsiveProp,
|
|
6211
|
-
breakpoint: breakpointProp,
|
|
6212
|
-
collapsed: collapsedProp,
|
|
6213
|
-
size = defaultRemoraidButtonSize,
|
|
6214
|
-
color,
|
|
6215
|
-
onClick,
|
|
6216
|
-
loading,
|
|
6217
|
-
variant = "default",
|
|
6218
|
-
mounted = true,
|
|
6219
|
-
icon: iconProp,
|
|
6220
|
-
iconSize: iconSizeProp,
|
|
6221
|
-
clickTransformation = "default" /* Default */,
|
|
6222
|
-
componentsProps
|
|
6223
|
-
}) {
|
|
6224
|
-
const theme = useRemoraidTheme();
|
|
6225
|
-
const responsive = responsiveProp ?? true;
|
|
6226
|
-
const breakpoint = breakpointProp ?? theme.breakpoints.buttonCollapse;
|
|
6227
|
-
const collapsed = collapsedProp ?? false;
|
|
6228
|
-
const iconSize = iconSizeProp ?? getDefaultButtonIconSize(size);
|
|
6229
|
-
const Icon3 = iconProp ?? IconClick;
|
|
6230
|
-
const iconElement = isValidElement3(Icon3) ? Icon3 : /* @__PURE__ */ jsx16(Icon3, {
|
|
6231
|
-
...import_lodash7.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
|
|
6232
|
-
});
|
|
6233
|
-
const clickTransformationClassNames = {
|
|
6234
|
-
["default" /* Default */]: null,
|
|
6235
|
-
["none" /* None */]: "remoraid-button-none",
|
|
6236
|
-
["scale" /* Scale */]: "remoraid-button-scale",
|
|
6237
|
-
["tiltDown" /* TiltDown */]: "remoraid-button-tilt-down",
|
|
6238
|
-
["tiltUp" /* TiltUp */]: "remoraid-button-tilt-up",
|
|
6239
|
-
["tiltLeft" /* TiltLeft */]: "remoraid-button-tilt-left",
|
|
6240
|
-
["tiltRight" /* TiltRight */]: "remoraid-button-tilt-right"
|
|
6241
|
-
};
|
|
6242
|
-
const clickTransformationClass = clickTransformationClassNames[clickTransformation];
|
|
6243
|
-
return /* @__PURE__ */ jsx16(Transition2, {
|
|
6244
|
-
mounted,
|
|
6245
|
-
transition: "fade",
|
|
6246
|
-
duration: theme.transitionDurations.short,
|
|
6247
|
-
timingFunction: "ease",
|
|
6248
|
-
...componentsProps?.transition,
|
|
6249
|
-
children: (transitionStyle) => /* @__PURE__ */ jsxs3(Fragment, {
|
|
6250
|
-
children: [
|
|
6251
|
-
/* @__PURE__ */ jsx16(Tooltip, {
|
|
6252
|
-
label,
|
|
6253
|
-
...componentsProps?.tooltip,
|
|
6254
|
-
children: /* @__PURE__ */ jsx16(ActionIcon, {
|
|
6255
|
-
"aria-label": label,
|
|
6256
|
-
variant,
|
|
6257
|
-
onClick,
|
|
6258
|
-
loading,
|
|
6259
|
-
size: size ? `input-${size}` : "input-sm",
|
|
6260
|
-
color,
|
|
6261
|
-
...componentsProps?.button,
|
|
6262
|
-
...componentsProps?.ActionIcon,
|
|
6263
|
-
hiddenFrom: !responsive ? undefined : breakpoint,
|
|
6264
|
-
display: !responsive && !collapsed ? "none" : componentsProps?.ActionIcon?.display ?? componentsProps?.button?.display,
|
|
6265
|
-
style: import_lodash7.merge(transitionStyle, componentsProps?.button?.style, componentsProps?.ActionIcon?.style),
|
|
6266
|
-
className: clsx_default(clickTransformationClass, componentsProps?.ActionIcon?.className, componentsProps?.button?.className),
|
|
6267
|
-
children: iconElement
|
|
6268
|
-
})
|
|
6269
|
-
}),
|
|
6270
|
-
/* @__PURE__ */ jsx16(Button, {
|
|
6271
|
-
onClick,
|
|
6272
|
-
loading,
|
|
6273
|
-
variant,
|
|
6274
|
-
size,
|
|
6275
|
-
color,
|
|
6276
|
-
leftSection: iconProp !== undefined ? iconElement : undefined,
|
|
6277
|
-
...componentsProps?.button,
|
|
6278
|
-
...componentsProps?.Button,
|
|
6279
|
-
visibleFrom: !responsive ? undefined : breakpoint,
|
|
6280
|
-
display: !responsive && collapsed ? "none" : componentsProps?.Button?.display ?? componentsProps?.button?.display,
|
|
6281
|
-
style: import_lodash7.merge(transitionStyle, componentsProps?.button?.style, componentsProps?.Button?.style),
|
|
6282
|
-
className: clsx_default(clickTransformationClass, componentsProps?.Button?.className, componentsProps?.button?.className),
|
|
6283
|
-
children: label
|
|
6284
|
-
})
|
|
6285
|
-
]
|
|
6286
|
-
})
|
|
6287
|
-
});
|
|
6288
|
-
}
|
|
6289
|
-
|
|
6290
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6291
|
-
import { jsx as jsx17, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
6292
|
-
function NavbarMinimalContent({
|
|
6293
|
-
orientation,
|
|
6294
|
-
maxElements,
|
|
6295
|
-
collapseStaticElementsBreakpoint: collapseStaticElementsBreakpointProp,
|
|
6296
|
-
componentsProps
|
|
6297
|
-
}) {
|
|
6298
|
-
const theme = useRemoraidTheme();
|
|
6299
|
-
const { userExperience: appShellUserExperience } = useAppShellUserExperience();
|
|
6300
|
-
const app = useRemoraidApp();
|
|
6301
|
-
const router = useRemoraidRouter();
|
|
6302
|
-
const { pathname } = router;
|
|
6303
|
-
const layoutElement = useFrameLayoutElement();
|
|
6304
|
-
const { colorScheme, setColorScheme } = useHydratedMantineColorScheme();
|
|
6305
|
-
const collapseStaticElementsBreakpoint = collapseStaticElementsBreakpointProp ?? theme.breakpoints.navbarStaticElementsCollapse;
|
|
6306
|
-
const mode = appShellUserExperience.navbar.mode;
|
|
6307
|
-
const floatingPositions = {
|
|
6308
|
-
["bottom" /* Bottom */]: "top",
|
|
6309
|
-
["left" /* Left */]: "right",
|
|
6310
|
-
["top" /* Top */]: "bottom",
|
|
6311
|
-
["right" /* Right */]: "left",
|
|
6312
|
-
["content" /* Content */]: undefined
|
|
6313
|
-
};
|
|
6314
|
-
const floatingPosition = layoutElement?.section ? floatingPositions[layoutElement.section] : undefined;
|
|
6315
|
-
const buttonResponsive = mode === "responsive" /* Responsive */;
|
|
6316
|
-
let buttonCollapsed = undefined;
|
|
6317
|
-
if (mode === "collapsed" /* Collapsed */) {
|
|
6318
|
-
buttonCollapsed = true;
|
|
6319
|
-
} else if (mode === "expanded" /* Expanded */) {
|
|
6320
|
-
buttonCollapsed = false;
|
|
6321
|
-
}
|
|
6322
|
-
const buttonClickTransformation = orientation === "horizontal" /* Horizontal */ ? "tiltRight" /* TiltRight */ : "default" /* Default */;
|
|
6323
|
-
const logoButton = app.logo ? /* @__PURE__ */ jsx17(RemoraidButton, {
|
|
6324
|
-
label: app.name,
|
|
6325
|
-
variant: "subtle",
|
|
6326
|
-
icon: app.logo,
|
|
6327
|
-
responsive: buttonResponsive,
|
|
6328
|
-
collapsed: buttonCollapsed,
|
|
6329
|
-
clickTransformation: buttonClickTransformation,
|
|
6330
|
-
...componentsProps?.button,
|
|
6331
|
-
...componentsProps?.logoButton,
|
|
6332
|
-
componentsProps: import_lodash8.merge({
|
|
6333
|
-
button: {
|
|
6334
|
-
c: "var(--mantine-color-text)"
|
|
6335
|
-
},
|
|
6336
|
-
Button: { justify: "flex-start" },
|
|
6337
|
-
tooltip: { position: floatingPosition }
|
|
6338
|
-
}, componentsProps?.button?.componentsProps, componentsProps?.logoButton?.componentsProps),
|
|
6339
|
-
onClick: (e) => {
|
|
6340
|
-
componentsProps?.button?.onClick?.(e);
|
|
6341
|
-
componentsProps?.logoButton?.onClick?.(e);
|
|
6342
|
-
}
|
|
6343
|
-
}) : undefined;
|
|
6344
|
-
const button = (element, key) => /* @__PURE__ */ jsx17(NavigationMenu, {
|
|
6345
|
-
label: element.label,
|
|
6346
|
-
target: /* @__PURE__ */ jsx17(RemoraidButton, {
|
|
6347
|
-
mounted: element.mounted,
|
|
6348
|
-
label: element.label,
|
|
6349
|
-
icon: element.icon,
|
|
6350
|
-
variant: element.type === "anchor" /* Anchor */ && element.href === pathname ? "light" : "default",
|
|
6351
|
-
responsive: buttonResponsive,
|
|
6352
|
-
collapsed: buttonCollapsed,
|
|
6353
|
-
clickTransformation: buttonClickTransformation,
|
|
6354
|
-
...componentsProps?.button,
|
|
6355
|
-
componentsProps: import_lodash8.merge({
|
|
6356
|
-
tooltip: {
|
|
6357
|
-
position: floatingPosition,
|
|
6358
|
-
disabled: element.children !== undefined && element.children.length > 0
|
|
6359
|
-
},
|
|
6360
|
-
Button: { justify: "flex-start" },
|
|
6361
|
-
button: {
|
|
6362
|
-
w: orientation === "vertical" /* Vertical */ ? "100%" : undefined
|
|
6363
|
-
}
|
|
6364
|
-
}, componentsProps?.button?.componentsProps),
|
|
6365
|
-
onClick: (e) => {
|
|
6366
|
-
if (element.type === "anchor" /* Anchor */) {
|
|
6367
|
-
router.push(element.href);
|
|
6368
|
-
}
|
|
6369
|
-
if (element.type === "button" /* Button */) {
|
|
6370
|
-
element.onClick(e);
|
|
6371
|
-
}
|
|
6372
|
-
componentsProps?.button?.onClick?.(e);
|
|
6373
|
-
}
|
|
6374
|
-
}),
|
|
6375
|
-
elements: element.children,
|
|
6376
|
-
...componentsProps?.NavigationMenu,
|
|
6377
|
-
componentsProps: import_lodash8.merge({
|
|
6378
|
-
Menu: { position: floatingPosition }
|
|
6379
|
-
}, componentsProps?.NavigationMenu?.componentsProps)
|
|
6380
|
-
}, key);
|
|
6381
|
-
const elements = [
|
|
6382
|
-
...app.nav,
|
|
6383
|
-
...getDefaultNavigationElements({ colorScheme, setColorScheme })
|
|
6384
|
-
];
|
|
6385
|
-
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}`));
|
|
6386
|
-
const staticElements = elements.filter((element) => element.static);
|
|
6387
|
-
const staticButtons = staticElements.sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0)).map((element, i) => button(element, `static-nav-element-${i}`));
|
|
6388
|
-
const collapseStaticElements = staticElements.filter((element) => element.mounted ?? true).length > 1;
|
|
6389
|
-
const staticMenuButton = collapseStaticElements ? /* @__PURE__ */ jsx17(Box3, {
|
|
6390
|
-
hiddenFrom: collapseStaticElementsBreakpoint,
|
|
6391
|
-
children: /* @__PURE__ */ jsx17(NavigationMenu, {
|
|
6392
|
-
elements: staticElements,
|
|
6393
|
-
target: /* @__PURE__ */ jsx17(RemoraidButton, {
|
|
6394
|
-
label: "Static elements",
|
|
6395
|
-
icon: IconDots,
|
|
6396
|
-
responsive: orientation === "vertical" /* Vertical */ ? buttonResponsive : false,
|
|
6397
|
-
collapsed: orientation === "vertical" /* Vertical */ ? buttonCollapsed : true,
|
|
6398
|
-
clickTransformation: buttonClickTransformation,
|
|
6399
|
-
...componentsProps?.button,
|
|
6400
|
-
componentsProps: import_lodash8.merge({
|
|
6401
|
-
tooltip: { disabled: true },
|
|
6402
|
-
Button: { justify: "flex-start" },
|
|
6403
|
-
button: {
|
|
6404
|
-
w: orientation === "vertical" /* Vertical */ ? "100%" : undefined
|
|
6405
|
-
}
|
|
6406
|
-
}, componentsProps?.button?.componentsProps)
|
|
6407
|
-
}),
|
|
6408
|
-
...componentsProps?.NavigationMenu,
|
|
6409
|
-
componentsProps: import_lodash8.merge({
|
|
6410
|
-
Menu: { position: floatingPosition }
|
|
6411
|
-
}, componentsProps?.NavigationMenu?.componentsProps)
|
|
6412
|
-
})
|
|
6413
|
-
}) : null;
|
|
6414
|
-
return /* @__PURE__ */ jsx17(Paper, {
|
|
6415
|
-
bg: theme.transparentBackground,
|
|
6416
|
-
h: "100%",
|
|
6417
|
-
p: "md",
|
|
6418
|
-
shadow: "md",
|
|
6419
|
-
...componentsProps?.container,
|
|
6420
|
-
children: orientation === "vertical" /* Vertical */ ? /* @__PURE__ */ jsxs4(Stack2, {
|
|
6421
|
-
h: "100%",
|
|
6422
|
-
children: [
|
|
6423
|
-
logoButton,
|
|
6424
|
-
/* @__PURE__ */ jsx17(ScrollArea2, {
|
|
6425
|
-
flex: 1,
|
|
6426
|
-
children: /* @__PURE__ */ jsx17(Stack2, {
|
|
6427
|
-
children: buttons
|
|
6428
|
-
})
|
|
6429
|
-
}),
|
|
6430
|
-
/* @__PURE__ */ jsx17(Stack2, {
|
|
6431
|
-
visibleFrom: collapseStaticElements ? collapseStaticElementsBreakpoint : undefined,
|
|
6432
|
-
children: staticButtons
|
|
6433
|
-
}),
|
|
6434
|
-
staticMenuButton
|
|
6435
|
-
]
|
|
6436
|
-
}) : /* @__PURE__ */ jsxs4(Group2, {
|
|
6437
|
-
wrap: "nowrap",
|
|
6438
|
-
children: [
|
|
6439
|
-
logoButton,
|
|
6440
|
-
/* @__PURE__ */ jsx17(ScrollArea2, {
|
|
6441
|
-
flex: 1,
|
|
6442
|
-
style: { contain: "inline-size" },
|
|
6443
|
-
children: /* @__PURE__ */ jsx17(Group2, {
|
|
6444
|
-
wrap: "nowrap",
|
|
6445
|
-
children: buttons
|
|
6446
|
-
})
|
|
6447
|
-
}),
|
|
6448
|
-
/* @__PURE__ */ jsx17(Group2, {
|
|
6449
|
-
wrap: "nowrap",
|
|
6450
|
-
visibleFrom: collapseStaticElements ? collapseStaticElementsBreakpoint : undefined,
|
|
6451
|
-
children: staticButtons
|
|
6452
|
-
}),
|
|
6453
|
-
staticMenuButton
|
|
6454
|
-
]
|
|
6455
|
-
})
|
|
6456
|
-
});
|
|
6457
|
-
}
|
|
6458
|
-
|
|
6459
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/index.tsx
|
|
6460
|
-
var import_lodash11 = __toESM(require_lodash(), 1);
|
|
6461
|
-
|
|
6462
|
-
// src/core/components/Pinnable/index.tsx
|
|
6463
|
-
import {
|
|
6464
|
-
useEffect as useEffect3,
|
|
6465
|
-
useMemo as useMemo4,
|
|
6466
|
-
useRef as useRef2,
|
|
6467
|
-
useState as useState6
|
|
6468
|
-
} from "react";
|
|
6469
|
-
import { IconPin, IconPinnedOff } from "@tabler/icons-react";
|
|
6470
|
-
import { Box as Box4, Portal as Portal2 } from "@mantine/core";
|
|
6471
|
-
|
|
6472
|
-
// src/core/components/Controls/ControlButton/index.tsx
|
|
6473
|
-
import {
|
|
6474
|
-
ActionIcon as ActionIcon2,
|
|
6475
|
-
Tooltip as Tooltip2,
|
|
6476
|
-
Transition as Transition3
|
|
6477
|
-
} from "@mantine/core";
|
|
6478
|
-
import { IconClick as IconClick2 } from "@tabler/icons-react";
|
|
6479
|
-
var import_lodash9 = __toESM(require_lodash(), 1);
|
|
6480
|
-
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
6481
|
-
function ControlButton({
|
|
6482
|
-
icon: Icon4 = IconClick2,
|
|
6483
|
-
mounted = true,
|
|
6484
|
-
size = "xs",
|
|
6485
|
-
iconSize = "tiny" /* Tiny */,
|
|
6486
|
-
onClick,
|
|
6487
|
-
order,
|
|
6488
|
-
color,
|
|
6489
|
-
tooltip,
|
|
6490
|
-
componentsProps
|
|
6491
|
-
}) {
|
|
6492
|
-
const theme = useRemoraidTheme();
|
|
6493
|
-
return /* @__PURE__ */ jsx18(Transition3, {
|
|
6494
|
-
mounted,
|
|
6495
|
-
transition: "fade",
|
|
6496
|
-
duration: theme.transitionDurations.short,
|
|
6497
|
-
timingFunction: "ease",
|
|
6498
|
-
...componentsProps?.transition,
|
|
6499
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx18(Tooltip2, {
|
|
6500
|
-
label: tooltip,
|
|
6501
|
-
disabled: !Boolean(tooltip),
|
|
6502
|
-
...componentsProps?.tooltip,
|
|
6503
|
-
children: /* @__PURE__ */ jsx18(ActionIcon2, {
|
|
6504
|
-
"data-control-button": true,
|
|
6505
|
-
size,
|
|
6506
|
-
color,
|
|
6507
|
-
onClick,
|
|
6508
|
-
radius: "xl",
|
|
6509
|
-
...componentsProps?.button,
|
|
6510
|
-
style: {
|
|
6511
|
-
order,
|
|
6512
|
-
...import_lodash9.merge(transitionStyle, componentsProps?.button?.style)
|
|
6513
|
-
},
|
|
6514
|
-
children: /* @__PURE__ */ jsx18(Icon4, {
|
|
6515
|
-
...import_lodash9.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
|
|
6516
|
-
})
|
|
6517
|
-
})
|
|
6518
|
-
})
|
|
6519
|
-
});
|
|
6520
|
-
}
|
|
6521
|
-
|
|
6522
|
-
// src/core/components/Controls/index.tsx
|
|
6523
|
-
import { useRef, useState as useState5 } from "react";
|
|
6524
|
-
import {
|
|
6525
|
-
Group as Group3,
|
|
6526
|
-
Paper as Paper2,
|
|
6527
|
-
Transition as Transition4
|
|
6528
|
-
} from "@mantine/core";
|
|
6529
|
-
import { IconGripHorizontal } from "@tabler/icons-react";
|
|
6530
|
-
var import_lodash10 = __toESM(require_lodash(), 1);
|
|
6531
|
-
import { jsx as jsx19, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
6532
|
-
function Controls({
|
|
6533
|
-
groupRef,
|
|
6534
|
-
mounted = true,
|
|
6535
|
-
dragContainerRef,
|
|
6536
|
-
gutter = 5,
|
|
6537
|
-
iconSize = "tiny" /* Tiny */,
|
|
6538
|
-
additionalButtons: additionalButtonsProp,
|
|
6539
|
-
componentsProps,
|
|
6540
|
-
children: childrenProp
|
|
6541
|
-
}) {
|
|
6542
|
-
const additionalButtons = additionalButtonsProp?.map((additionalButton) => asElementOrPropsOfType(ControlButton, additionalButton, "Check the 'additionalButtons' property of 'Controls'."));
|
|
6543
|
-
const children = asChildrenOfType(ControlButton, childrenProp, "Check children passed to 'Controls' component.");
|
|
6544
|
-
const theme = useRemoraidTheme();
|
|
6545
|
-
const [pos, setPos] = useState5({
|
|
6546
|
-
x: 0,
|
|
6547
|
-
y: 0
|
|
6548
|
-
});
|
|
6549
|
-
const offsetRef = useRef({ x: 0, y: 0 });
|
|
6550
|
-
const containerRef = useRef(null);
|
|
6551
|
-
const clamp = (v, min, max) => {
|
|
6552
|
-
return Math.min(Math.max(v, min), max);
|
|
6553
|
-
};
|
|
6554
|
-
const handlePointerDown = (e) => {
|
|
6555
|
-
if (e.target instanceof Element && e.target.closest("button,[data-control-button]")) {
|
|
6556
|
-
return;
|
|
6557
|
-
}
|
|
6558
|
-
if (!containerRef.current) {
|
|
6559
|
-
return;
|
|
6560
|
-
}
|
|
6561
|
-
const paperRect = containerRef.current.getBoundingClientRect();
|
|
6562
|
-
offsetRef.current = {
|
|
6563
|
-
x: e.clientX - paperRect.right,
|
|
6564
|
-
y: e.clientY - paperRect.top
|
|
6565
|
-
};
|
|
6566
|
-
e.currentTarget.setPointerCapture(e.pointerId);
|
|
6567
|
-
};
|
|
6568
|
-
const handlePointerMove = (e) => {
|
|
6569
|
-
if (!e.currentTarget.hasPointerCapture(e.pointerId)) {
|
|
6570
|
-
return;
|
|
6571
|
-
}
|
|
6572
|
-
if (!containerRef.current || !dragContainerRef.current) {
|
|
6573
|
-
return;
|
|
6574
|
-
}
|
|
6575
|
-
const boxRect = dragContainerRef.current.getBoundingClientRect();
|
|
6576
|
-
const paperRect = containerRef.current.getBoundingClientRect();
|
|
6577
|
-
const rawX = e.clientX - boxRect.right - offsetRef.current.x;
|
|
6578
|
-
const rawY = e.clientY - boxRect.top - offsetRef.current.y;
|
|
6579
|
-
const maxX = boxRect.width - paperRect.width;
|
|
6580
|
-
const maxY = boxRect.height - paperRect.height;
|
|
6581
|
-
setPos({
|
|
6582
|
-
x: clamp(-rawX, 0, maxX),
|
|
6583
|
-
y: clamp(rawY, 0, maxY)
|
|
6584
|
-
});
|
|
6585
|
-
};
|
|
6586
|
-
const handlePointerUp = (e) => {
|
|
6587
|
-
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
6588
|
-
};
|
|
6589
|
-
return /* @__PURE__ */ jsx19(Transition4, {
|
|
6590
|
-
mounted,
|
|
6591
|
-
keepMounted: true,
|
|
6592
|
-
transition: "pop",
|
|
6593
|
-
duration: theme.transitionDurations.short,
|
|
6594
|
-
timingFunction: "ease",
|
|
6595
|
-
...componentsProps?.transition,
|
|
6596
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx19(Paper2, {
|
|
6597
|
-
ref: containerRef,
|
|
6598
|
-
pos: "absolute",
|
|
6599
|
-
p: gutter,
|
|
6600
|
-
bg: theme.transparentBackground,
|
|
6601
|
-
shadow: "md",
|
|
6602
|
-
onPointerDown: handlePointerDown,
|
|
6603
|
-
onPointerMove: handlePointerMove,
|
|
6604
|
-
onPointerUp: handlePointerUp,
|
|
6605
|
-
...componentsProps?.container,
|
|
6606
|
-
style: {
|
|
6607
|
-
right: pos.x,
|
|
6608
|
-
top: pos.y,
|
|
6609
|
-
...import_lodash10.merge(transitionStyle, componentsProps?.container?.style)
|
|
6610
|
-
},
|
|
6611
|
-
className: clsx_default("remoraid-controls", componentsProps?.container?.className),
|
|
6612
|
-
children: /* @__PURE__ */ jsxs5(Group3, {
|
|
6613
|
-
gap: gutter,
|
|
6614
|
-
ref: groupRef,
|
|
6615
|
-
wrap: "nowrap",
|
|
6616
|
-
...componentsProps?.group,
|
|
6617
|
-
className: clsx_default("remoraid-controls-group", componentsProps?.group?.className),
|
|
6618
|
-
children: [
|
|
6619
|
-
/* @__PURE__ */ jsx19(IconGripHorizontal, {
|
|
6620
|
-
...import_lodash10.merge({}, theme.componentsProps.icons[iconSize], { order: -100, color: "var(--mantine-color-default-border)" }, componentsProps?.gripIcon)
|
|
6621
|
-
}),
|
|
6622
|
-
children,
|
|
6623
|
-
additionalButtons && additionalButtons.map((button, i) => {
|
|
6624
|
-
if (isValidElementOfType(ControlButton, button)) {
|
|
6625
|
-
return button;
|
|
6626
|
-
}
|
|
6627
|
-
return /* @__PURE__ */ jsx19(ControlButton, {
|
|
6628
|
-
...button
|
|
6629
|
-
}, i);
|
|
6630
|
-
})
|
|
6631
|
-
]
|
|
6632
|
-
})
|
|
6633
|
-
})
|
|
6634
|
-
});
|
|
6635
|
-
}
|
|
6636
|
-
|
|
6637
|
-
// src/core/components/Pinnable/index.tsx
|
|
6638
|
-
import { jsx as jsx20, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
6639
|
-
function Pinnable({
|
|
6640
|
-
layoutType: layoutTypeProp,
|
|
6641
|
-
section,
|
|
6642
|
-
initialValue = false,
|
|
6643
|
-
layoutId,
|
|
6644
|
-
controlsContainer,
|
|
6645
|
-
hidden = false,
|
|
6646
|
-
onPinnedValueChange,
|
|
6647
|
-
componentsProps,
|
|
6648
|
-
children
|
|
6649
|
-
}) {
|
|
6650
|
-
const layoutType = layoutTypeProp ?? "frame" /* Frame */;
|
|
6651
|
-
const { layouts } = useLayouts();
|
|
6652
|
-
const [pinned, setPinned] = useState6(initialValue);
|
|
6653
|
-
const containerRef = useRef2(null);
|
|
6654
|
-
const layout = layouts[layoutId ?? remoraidAppShellLayoutId];
|
|
6655
|
-
if (layout && layout.type !== layoutType) {
|
|
6656
|
-
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.`);
|
|
6657
|
-
}
|
|
6658
|
-
const controlButton = useMemo4(() => /* @__PURE__ */ jsx20(ControlButton, {
|
|
6659
|
-
icon: pinned ? IconPinnedOff : IconPin,
|
|
6660
|
-
tooltip: pinned ? "Unpin" : "Pin",
|
|
6661
|
-
color: "green",
|
|
6662
|
-
order: 100,
|
|
6663
|
-
...componentsProps?.button,
|
|
6664
|
-
onClick: (e) => {
|
|
6665
|
-
setPinned((prev) => !prev);
|
|
6666
|
-
componentsProps?.button?.onClick?.(e);
|
|
6667
|
-
}
|
|
6668
|
-
}), [pinned, componentsProps?.button]);
|
|
6669
|
-
const element = /* @__PURE__ */ jsxs6(Box4, {
|
|
6670
|
-
pos: "relative",
|
|
6671
|
-
ref: containerRef,
|
|
6672
|
-
"data-hidden": hidden,
|
|
6673
|
-
h: "100%",
|
|
6674
|
-
...componentsProps?.container,
|
|
6675
|
-
className: clsx_default("remoraid-pinnable", componentsProps?.container?.className),
|
|
6676
|
-
children: [
|
|
6677
|
-
controlsContainer === undefined ? /* @__PURE__ */ jsx20(Controls, {
|
|
6678
|
-
dragContainerRef: containerRef,
|
|
6679
|
-
...componentsProps?.controls,
|
|
6680
|
-
children: controlButton
|
|
6681
|
-
}) : controlsContainer !== null && /* @__PURE__ */ jsx20(Portal2, {
|
|
6682
|
-
target: controlsContainer,
|
|
6683
|
-
children: controlButton
|
|
6684
|
-
}),
|
|
6685
|
-
children
|
|
6686
|
-
]
|
|
6687
|
-
});
|
|
6688
|
-
useEffect3(() => {
|
|
6689
|
-
onPinnedValueChange?.(pinned);
|
|
6690
|
-
}, [pinned]);
|
|
6691
|
-
if (!layout) {
|
|
6692
|
-
return null;
|
|
6693
|
-
}
|
|
6694
|
-
if (pinned && layoutType === "frame" /* Frame */) {
|
|
6695
|
-
return /* @__PURE__ */ jsx20(FrameLayout_default.Element, {
|
|
6696
|
-
layoutId,
|
|
6697
|
-
section,
|
|
6698
|
-
hidden,
|
|
6699
|
-
...componentsProps?.layoutElement,
|
|
6700
|
-
children: element
|
|
6701
|
-
});
|
|
6702
|
-
}
|
|
6703
|
-
return element;
|
|
6704
|
-
}
|
|
6705
|
-
|
|
6706
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/index.tsx
|
|
6707
|
-
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
6708
|
-
function NavbarMinimal({
|
|
6709
|
-
pinnable = true,
|
|
6710
|
-
componentsProps
|
|
6711
|
-
}) {
|
|
6712
|
-
const {
|
|
6713
|
-
userExperience: {
|
|
6714
|
-
navbar: { position }
|
|
6715
|
-
}
|
|
6716
|
-
} = useAppShellUserExperience();
|
|
6717
|
-
const [hover, setHover] = useState7(false);
|
|
6718
|
-
const handleEnter = () => {
|
|
6719
|
-
setHover(true);
|
|
6720
|
-
};
|
|
6721
|
-
const handleLeave = () => {
|
|
6722
|
-
setHover(false);
|
|
6723
|
-
};
|
|
6724
|
-
if (position === "left" /* Left */ || position === "right" /* Right */) {
|
|
6725
|
-
return /* @__PURE__ */ jsx21(FrameLayout_default.Element, {
|
|
6726
|
-
section: position,
|
|
6727
|
-
includeContainer: true,
|
|
6728
|
-
...componentsProps?.layoutElement,
|
|
6729
|
-
componentsProps: import_lodash11.merge({
|
|
6730
|
-
container: {
|
|
6731
|
-
style: {
|
|
6732
|
-
order: -100
|
|
6733
|
-
}
|
|
6734
|
-
}
|
|
6735
|
-
}, componentsProps?.layoutElement?.componentsProps),
|
|
6736
|
-
children: /* @__PURE__ */ jsx21(NavbarMinimalContent, {
|
|
6737
|
-
orientation: "vertical" /* Vertical */,
|
|
6738
|
-
...componentsProps?.content
|
|
6739
|
-
})
|
|
6740
|
-
});
|
|
6741
|
-
}
|
|
6742
|
-
if (position === "top" /* Top */ || position === "bottom" /* Bottom */) {
|
|
6743
|
-
const content = /* @__PURE__ */ jsx21(NavbarMinimalContent, {
|
|
6744
|
-
orientation: "horizontal" /* Horizontal */,
|
|
6745
|
-
...componentsProps?.content
|
|
6746
|
-
});
|
|
6747
|
-
if (pinnable) {
|
|
6748
|
-
return /* @__PURE__ */ jsx21(PageContainer, {
|
|
6749
|
-
...componentsProps?.container,
|
|
6750
|
-
componentsProps: {
|
|
6751
|
-
...componentsProps?.container?.componentsProps,
|
|
6752
|
-
container: {
|
|
6753
|
-
...componentsProps?.container?.componentsProps?.container,
|
|
6754
|
-
className: clsx_default("hide-if-empty", componentsProps?.container?.componentsProps?.container?.className)
|
|
6755
|
-
}
|
|
6756
|
-
},
|
|
6757
|
-
children: /* @__PURE__ */ jsx21(Pinnable, {
|
|
6758
|
-
section: position,
|
|
6759
|
-
initialValue: true,
|
|
6760
|
-
...componentsProps?.Pinnable,
|
|
6761
|
-
componentsProps: import_lodash11.merge({
|
|
6762
|
-
container: {
|
|
6763
|
-
onMouseEnter: (e) => {
|
|
6764
|
-
handleEnter();
|
|
6765
|
-
componentsProps?.Pinnable?.componentsProps?.container?.onMouseEnter?.(e);
|
|
6766
|
-
},
|
|
6767
|
-
onMouseLeave: (e) => {
|
|
6768
|
-
handleLeave();
|
|
6769
|
-
componentsProps?.Pinnable?.componentsProps?.container?.onMouseLeave?.(e);
|
|
6770
|
-
}
|
|
6771
|
-
},
|
|
6772
|
-
button: {
|
|
6773
|
-
onClick: (e) => {
|
|
6774
|
-
handleLeave();
|
|
6775
|
-
componentsProps?.Pinnable?.componentsProps?.button?.onClick?.(e);
|
|
6776
|
-
}
|
|
6777
|
-
},
|
|
6778
|
-
layoutElement: {
|
|
6779
|
-
includeContainer: false,
|
|
6780
|
-
includePageContainer: true,
|
|
6781
|
-
componentsProps: {
|
|
6782
|
-
PageContainer: {
|
|
6783
|
-
componentsProps: {
|
|
6784
|
-
container: { style: { order: -100 } }
|
|
6785
|
-
}
|
|
6786
|
-
}
|
|
6787
|
-
}
|
|
6788
|
-
},
|
|
6789
|
-
controls: {
|
|
6790
|
-
mounted: hover
|
|
6791
|
-
}
|
|
6792
|
-
}, componentsProps?.Pinnable?.componentsProps),
|
|
6793
|
-
children: content
|
|
6794
|
-
})
|
|
6795
|
-
});
|
|
6796
|
-
}
|
|
6797
|
-
return content;
|
|
6798
|
-
}
|
|
6799
|
-
if (position === "content" /* Content */) {
|
|
6800
|
-
return /* @__PURE__ */ jsx21(PageContainer, {
|
|
6801
|
-
...componentsProps?.container,
|
|
6802
|
-
children: /* @__PURE__ */ jsx21(NavbarMinimalContent, {
|
|
6803
|
-
orientation: "horizontal" /* Horizontal */,
|
|
6804
|
-
...componentsProps?.content
|
|
6805
|
-
})
|
|
6806
|
-
});
|
|
6807
|
-
}
|
|
6808
|
-
return null;
|
|
6809
|
-
}
|
|
6810
|
-
|
|
6811
|
-
// src/core/components/AppShell/Navbar/index.tsx
|
|
6812
|
-
import { IconLogin, IconLogout, IconMoon, IconSun } from "@tabler/icons-react";
|
|
6813
|
-
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
6814
|
-
var supportedNavbarPositions = {
|
|
6815
|
-
["minimal" /* Minimal */]: [
|
|
6816
|
-
null,
|
|
6817
|
-
"top" /* Top */,
|
|
6818
|
-
"bottom" /* Bottom */,
|
|
6819
|
-
"left" /* Left */,
|
|
6820
|
-
"right" /* Right */,
|
|
6821
|
-
"content" /* Content */
|
|
6822
|
-
]
|
|
6823
|
-
};
|
|
6824
|
-
var defaultNavbarPositions = { ["minimal" /* Minimal */]: "left" /* Left */ };
|
|
6825
|
-
var getDefaultNavigationElements = ({
|
|
6826
|
-
colorScheme,
|
|
6827
|
-
setColorScheme,
|
|
6828
|
-
auth
|
|
6829
|
-
}) => [
|
|
6830
|
-
{
|
|
6831
|
-
type: "button" /* Button */,
|
|
6832
|
-
label: colorScheme === "dark" ? "Light mode" : "Dark mode",
|
|
6833
|
-
icon: colorScheme === "dark" ? IconSun : IconMoon,
|
|
6834
|
-
static: true,
|
|
6835
|
-
onClick: () => {
|
|
6836
|
-
if (!colorScheme || !setColorScheme) {
|
|
6837
|
-
return;
|
|
6838
|
-
}
|
|
6839
|
-
setColorScheme(colorScheme === "dark" ? "light" : "dark");
|
|
6840
|
-
}
|
|
6841
|
-
},
|
|
6842
|
-
{
|
|
6843
|
-
mounted: auth !== undefined && auth.user === null,
|
|
6844
|
-
type: "anchor" /* Anchor */,
|
|
6845
|
-
label: "Login",
|
|
6846
|
-
href: "/login",
|
|
6847
|
-
static: true,
|
|
6848
|
-
icon: IconLogin
|
|
6849
|
-
},
|
|
6850
|
-
{
|
|
6851
|
-
mounted: auth !== undefined && auth.user !== null,
|
|
6852
|
-
type: "button" /* Button */,
|
|
6853
|
-
label: "Logout",
|
|
6854
|
-
static: true,
|
|
6855
|
-
icon: IconLogout,
|
|
6856
|
-
onClick: () => {
|
|
6857
|
-
auth?.onLogout?.();
|
|
6858
|
-
}
|
|
6859
|
-
}
|
|
6860
|
-
];
|
|
6861
|
-
function Navbar({ componentsProps }) {
|
|
6862
|
-
const { navbarVariant } = useRemoraidApp();
|
|
6863
|
-
if (navbarVariant === "minimal" /* Minimal */) {
|
|
6864
|
-
return /* @__PURE__ */ jsx22(NavbarMinimal, {
|
|
6865
|
-
...componentsProps?.NavbarMinimal
|
|
6866
|
-
});
|
|
6867
|
-
}
|
|
6868
|
-
return null;
|
|
6869
|
-
}
|
|
6870
|
-
var Navbar_default = Object.assign(Navbar, {
|
|
6871
|
-
NavbarMinimal
|
|
6872
|
-
});
|
|
6873
|
-
|
|
6874
|
-
// src/core/components/AppShell/AppShellUserExperienceProvider/index.tsx
|
|
6875
|
-
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
6876
|
-
var defaultAppShellUserExperience = {
|
|
6877
|
-
navbar: {
|
|
6878
|
-
position: null,
|
|
6879
|
-
mobilePosition: null,
|
|
6880
|
-
mode: "responsive" /* Responsive */
|
|
6881
|
-
},
|
|
6882
|
-
footer: {
|
|
6883
|
-
position: null
|
|
6884
|
-
}
|
|
6885
|
-
};
|
|
6886
|
-
var defaultAppShellUserExperienceCookieName = "remoraid-app-shell-user-experience";
|
|
6887
|
-
var appShellUserExperienceContext = createUserExperienceContext(defaultAppShellUserExperience);
|
|
6888
|
-
var useAppShellUserExperience = () => {
|
|
6889
|
-
return useContext10(appShellUserExperienceContext);
|
|
6890
|
-
};
|
|
6891
|
-
function AppShellUserExperienceProvider({
|
|
6892
|
-
children,
|
|
6893
|
-
initialValue,
|
|
6894
|
-
cookieName
|
|
6895
|
-
}) {
|
|
6896
|
-
const { navbarVariant, footerVariant } = useRemoraidApp();
|
|
6897
|
-
const isValidUserExperience = (x) => {
|
|
6898
|
-
if (typeof x !== "object") {
|
|
6899
|
-
return false;
|
|
6900
|
-
}
|
|
6901
|
-
if (x === null) {
|
|
6902
|
-
return false;
|
|
6903
|
-
}
|
|
6904
|
-
if (!("navbar" in x)) {
|
|
6905
|
-
return false;
|
|
6906
|
-
}
|
|
6907
|
-
if (!("footer" in x)) {
|
|
6908
|
-
return false;
|
|
6909
|
-
}
|
|
6910
|
-
return true;
|
|
6911
|
-
};
|
|
6912
|
-
return /* @__PURE__ */ jsx23(UserExperienceProviderWrapper, {
|
|
6913
|
-
context: appShellUserExperienceContext,
|
|
6914
|
-
isValidUserExperience,
|
|
6915
|
-
cookieName: cookieName ?? defaultAppShellUserExperienceCookieName,
|
|
6916
|
-
defaultUserExperience: defaultAppShellUserExperience,
|
|
6917
|
-
initialValue: import_lodash12.merge({
|
|
6918
|
-
navbar: {
|
|
6919
|
-
position: navbarVariant === null ? null : defaultNavbarPositions[navbarVariant]
|
|
6920
|
-
},
|
|
6921
|
-
footer: {
|
|
6922
|
-
position: footerVariant === null ? null : defaultFooterPositions[footerVariant]
|
|
6923
|
-
}
|
|
6924
|
-
}, initialValue),
|
|
6925
|
-
children
|
|
6926
|
-
});
|
|
6927
|
-
}
|
|
6928
|
-
|
|
6929
|
-
// src/core/components/AppShell/index.tsx
|
|
6930
|
-
import { jsx as jsx24, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
6931
|
-
var remoraidAppShellLayoutId = "remoraid-app-shell";
|
|
6932
|
-
function AppShell({
|
|
6933
|
-
gutter,
|
|
6934
|
-
appContext: appContext2,
|
|
6935
|
-
initialUserExperience,
|
|
6936
|
-
componentsProps,
|
|
6937
|
-
children
|
|
6938
|
-
}) {
|
|
6939
|
-
const theme = useRemoraidTheme();
|
|
6940
|
-
const { colorScheme } = useHydratedMantineColorScheme();
|
|
6941
|
-
useEffect4(() => {
|
|
6942
|
-
let meta = document.querySelector('meta[name="theme-color"]');
|
|
6943
|
-
if (!meta) {
|
|
6944
|
-
meta = document.createElement("meta");
|
|
6945
|
-
meta.name = "theme-color";
|
|
6946
|
-
document.head.appendChild(meta);
|
|
6947
|
-
}
|
|
6948
|
-
const { backgroundColor: computedBodyColor } = getComputedStyle(document.body);
|
|
6949
|
-
if (!computedBodyColor) {
|
|
6950
|
-
return;
|
|
6951
|
-
}
|
|
6952
|
-
meta.content = computedBodyColor;
|
|
6953
|
-
}, [colorScheme]);
|
|
6954
|
-
return /* @__PURE__ */ jsx24(AppProvider, {
|
|
6955
|
-
appContext: appContext2,
|
|
6956
|
-
...componentsProps?.AppProvider,
|
|
6957
|
-
children: /* @__PURE__ */ jsx24(AppShellUserExperienceProvider, {
|
|
6958
|
-
...componentsProps?.AppShellUserExperienceProvider,
|
|
6959
|
-
initialValue: import_lodash13.merge(initialUserExperience, componentsProps?.AppShellUserExperienceProvider?.initialValue),
|
|
6960
|
-
children: /* @__PURE__ */ jsx24(Box5, {
|
|
6961
|
-
h: "100dvh",
|
|
6962
|
-
...componentsProps?.container,
|
|
6963
|
-
children: /* @__PURE__ */ jsxs7(FrameLayout_default, {
|
|
6964
|
-
layoutId: remoraidAppShellLayoutId,
|
|
6965
|
-
gutter: gutter ?? theme.primaryGutter,
|
|
6966
|
-
...componentsProps?.layout,
|
|
6967
|
-
children: [
|
|
6968
|
-
/* @__PURE__ */ jsx24(Navbar_default, {
|
|
6969
|
-
...componentsProps?.navbar
|
|
6970
|
-
}),
|
|
6971
|
-
children,
|
|
6972
|
-
/* @__PURE__ */ jsx24(Footer_default, {
|
|
6973
|
-
...componentsProps?.footer
|
|
6974
|
-
})
|
|
6975
|
-
]
|
|
6976
|
-
})
|
|
6977
|
-
})
|
|
6978
|
-
})
|
|
6979
|
-
});
|
|
6980
|
-
}
|
|
6981
|
-
var AppShell_default = Object.assign(AppShell, {
|
|
6982
|
-
Navbar: Navbar_default,
|
|
6983
|
-
Footer: Footer_default
|
|
6984
|
-
});
|
|
6985
|
-
// src/core/components/WidgetSelectionHeader/index.tsx
|
|
6986
|
-
import {
|
|
6987
|
-
Box as Box6,
|
|
6988
|
-
Chip as Chip2,
|
|
6989
|
-
Divider,
|
|
6990
|
-
Flex as Flex2,
|
|
6991
|
-
Menu,
|
|
6992
|
-
Text,
|
|
6993
|
-
useMantineTheme as useMantineTheme3
|
|
6994
|
-
} from "@mantine/core";
|
|
6995
|
-
|
|
6996
|
-
// src/core/components/Page/index.tsx
|
|
6997
|
-
import { Stack as Stack3 } from "@mantine/core";
|
|
6998
|
-
import React8, {
|
|
6999
|
-
useContext as useContext11,
|
|
7000
|
-
useEffect as useEffect5
|
|
7001
|
-
} from "react";
|
|
7002
|
-
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
7003
|
-
var pageContext = React8.createContext(null);
|
|
7004
|
-
var usePage = () => {
|
|
7005
|
-
return useContext11(pageContext);
|
|
7006
|
-
};
|
|
7007
|
-
|
|
7008
|
-
// src/core/components/WidgetSelectionHeader/index.tsx
|
|
7009
|
-
import { IconCheck, IconFocus, IconNavigation } from "@tabler/icons-react";
|
|
7010
|
-
import { useEffect as useEffect6, useRef as useRef3, useState as useState8 } from "react";
|
|
7011
|
-
|
|
7012
|
-
// src/core/components/ScrollableChipGroup/index.tsx
|
|
7013
|
-
import {
|
|
7014
|
-
Chip,
|
|
7015
|
-
Flex,
|
|
7016
|
-
ScrollArea as ScrollArea3
|
|
7017
|
-
} from "@mantine/core";
|
|
7018
|
-
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
7019
|
-
|
|
7020
|
-
// src/core/components/WidgetSelectionHeader/index.tsx
|
|
7021
|
-
var import_lodash14 = __toESM(require_lodash(), 1);
|
|
7022
|
-
import { jsx as jsx27, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
7023
|
-
// src/core/components/BadgeGroup/index.tsx
|
|
7024
|
-
import {
|
|
7025
|
-
Badge as Badge2,
|
|
7026
|
-
Group as Group4,
|
|
7027
|
-
HoverCard,
|
|
7028
|
-
Stack as Stack4,
|
|
7029
|
-
Transition as Transition6
|
|
7030
|
-
} from "@mantine/core";
|
|
7031
|
-
import React9 from "react";
|
|
7032
|
-
|
|
7033
|
-
// src/core/components/BadgeMinimal/index.tsx
|
|
7034
|
-
import {
|
|
7035
|
-
Badge,
|
|
7036
|
-
Tooltip as Tooltip3,
|
|
7037
|
-
Transition as Transition5
|
|
7038
|
-
} from "@mantine/core";
|
|
7039
|
-
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
7040
|
-
function BadgeMinimal({
|
|
7041
|
-
label,
|
|
7042
|
-
tooltip,
|
|
7043
|
-
mounted = true,
|
|
7044
|
-
componentsProps
|
|
7045
|
-
}) {
|
|
7046
|
-
const theme = useRemoraidTheme();
|
|
7047
|
-
return /* @__PURE__ */ jsx28(Transition5, {
|
|
7048
|
-
mounted,
|
|
7049
|
-
transition: "fade",
|
|
7050
|
-
duration: theme.transitionDurations.short,
|
|
7051
|
-
timingFunction: "ease",
|
|
7052
|
-
...componentsProps?.transition,
|
|
7053
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx28(Tooltip3, {
|
|
7054
|
-
label: tooltip,
|
|
7055
|
-
disabled: !Boolean(tooltip),
|
|
7056
|
-
...componentsProps?.tooltip,
|
|
7057
|
-
children: /* @__PURE__ */ jsx28(Badge, {
|
|
7058
|
-
variant: "default",
|
|
7059
|
-
...componentsProps?.badge,
|
|
7060
|
-
style: {
|
|
7061
|
-
...transitionStyle,
|
|
7062
|
-
cursor: "pointer",
|
|
7063
|
-
...componentsProps?.badge?.style
|
|
7064
|
-
},
|
|
7065
|
-
children: label
|
|
7066
|
-
})
|
|
7067
|
-
})
|
|
7068
|
-
});
|
|
7069
|
-
}
|
|
7070
|
-
|
|
7071
|
-
// src/core/components/BadgeGroup/index.tsx
|
|
7072
|
-
var import_lodash15 = __toESM(require_lodash(), 1);
|
|
7073
|
-
import { jsx as jsx29, jsxs as jsxs9, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
7074
|
-
import { createElement } from "react";
|
|
7075
|
-
function BadgeGroup({
|
|
7076
|
-
badges: badgesProp,
|
|
7077
|
-
gap = "xs",
|
|
7078
|
-
breakpoint: breakpointProp,
|
|
7079
|
-
componentsProps
|
|
7080
|
-
}) {
|
|
7081
|
-
const badges = badgesProp.map((badge) => asElementOrPropsOfType(BadgeMinimal, badge, "Check 'badges' property passed to 'BadgeGroup'."));
|
|
7082
|
-
const theme = useRemoraidTheme();
|
|
7083
|
-
const breakpoint = breakpointProp ?? theme.breakpoints.badgeGroupCollapse;
|
|
7084
|
-
const numVisibleBadges = badges.filter((badge) => isValidElementOfType(BadgeMinimal, badge) ? badge.props.mounted : badge.mounted !== false).length;
|
|
7085
|
-
const badgesElement = badges.map((badge, i) => {
|
|
7086
|
-
if (isValidElementOfType(BadgeMinimal, badge)) {
|
|
7087
|
-
return badge;
|
|
7088
|
-
}
|
|
7089
|
-
return /* @__PURE__ */ createElement(BadgeMinimal, {
|
|
7090
|
-
...badge,
|
|
7091
|
-
key: i
|
|
7092
|
-
});
|
|
7093
|
-
});
|
|
7094
|
-
return /* @__PURE__ */ jsxs9(Fragment2, {
|
|
7095
|
-
children: [
|
|
7096
|
-
/* @__PURE__ */ jsx29(Group4, {
|
|
7097
|
-
gap,
|
|
7098
|
-
wrap: "nowrap",
|
|
7099
|
-
visibleFrom: numVisibleBadges > 1 ? breakpoint : undefined,
|
|
7100
|
-
...componentsProps?.container,
|
|
7101
|
-
className: clsx_default("hide-if-empty", componentsProps?.container?.className),
|
|
7102
|
-
children: badgesElement
|
|
7103
|
-
}),
|
|
7104
|
-
/* @__PURE__ */ jsx29(Transition6, {
|
|
7105
|
-
mounted: numVisibleBadges > 1,
|
|
7106
|
-
transition: "fade",
|
|
7107
|
-
duration: theme.transitionDurations.short,
|
|
7108
|
-
timingFunction: "ease",
|
|
7109
|
-
...componentsProps?.cumulativeBadgeTransition,
|
|
7110
|
-
children: (transitionStyle) => /* @__PURE__ */ jsxs9(HoverCard, {
|
|
7111
|
-
...componentsProps?.HoverCard,
|
|
7112
|
-
children: [
|
|
7113
|
-
/* @__PURE__ */ jsx29(HoverCard.Target, {
|
|
7114
|
-
children: /* @__PURE__ */ jsxs9(Badge2, {
|
|
7115
|
-
hiddenFrom: breakpoint,
|
|
7116
|
-
variant: "dot",
|
|
7117
|
-
...componentsProps?.cumulativeBadge,
|
|
7118
|
-
style: {
|
|
7119
|
-
cursor: "pointer",
|
|
7120
|
-
...import_lodash15.merge(transitionStyle, componentsProps?.cumulativeBadge?.style)
|
|
7121
|
-
},
|
|
7122
|
-
children: [
|
|
7123
|
-
numVisibleBadges,
|
|
7124
|
-
" badges"
|
|
7125
|
-
]
|
|
7126
|
-
})
|
|
7127
|
-
}),
|
|
7128
|
-
/* @__PURE__ */ jsx29(HoverCard.Dropdown, {
|
|
7129
|
-
p: gap,
|
|
7130
|
-
children: /* @__PURE__ */ jsx29(Stack4, {
|
|
7131
|
-
gap,
|
|
7132
|
-
...componentsProps?.hoverContainer,
|
|
7133
|
-
children: badgesElement
|
|
7134
|
-
})
|
|
7135
|
-
})
|
|
7136
|
-
]
|
|
7137
|
-
})
|
|
7138
|
-
})
|
|
7139
|
-
]
|
|
7140
|
-
});
|
|
7141
|
-
}
|
|
7142
|
-
// src/core/components/AlertMinimal/index.tsx
|
|
7143
|
-
import { Alert, Transition as Transition7 } from "@mantine/core";
|
|
7144
|
-
var import_lodash16 = __toESM(require_lodash(), 1);
|
|
7145
|
-
import { jsx as jsx30, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
7146
|
-
function AlertMinimal({
|
|
7147
|
-
category,
|
|
7148
|
-
children,
|
|
7149
|
-
...props
|
|
7150
|
-
}) {
|
|
7151
|
-
const theme = useRemoraidTheme();
|
|
7152
|
-
const {
|
|
7153
|
-
title,
|
|
7154
|
-
text,
|
|
7155
|
-
color,
|
|
7156
|
-
onClose,
|
|
7157
|
-
mounted = true,
|
|
7158
|
-
icon: Icon4,
|
|
7159
|
-
iconSize = "small" /* Small */,
|
|
7160
|
-
componentsProps
|
|
7161
|
-
} = import_lodash16.merge({}, theme.componentsProps.alerts[category], props);
|
|
7162
|
-
return /* @__PURE__ */ jsx30(Transition7, {
|
|
7163
|
-
mounted,
|
|
7164
|
-
transition: "fade",
|
|
7165
|
-
duration: theme.transitionDurations.short,
|
|
7166
|
-
timingFunction: "ease",
|
|
7167
|
-
...componentsProps?.transition,
|
|
7168
|
-
children: (transitionStyle) => /* @__PURE__ */ jsxs10(Alert, {
|
|
7169
|
-
title,
|
|
7170
|
-
color,
|
|
7171
|
-
variant: "light",
|
|
7172
|
-
onClose,
|
|
7173
|
-
withCloseButton: onClose !== undefined,
|
|
7174
|
-
icon: Icon4 ? /* @__PURE__ */ jsx30(Icon4, {
|
|
7175
|
-
...import_lodash16.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
|
|
7176
|
-
}) : undefined,
|
|
7177
|
-
...componentsProps?.alert,
|
|
7178
|
-
style: import_lodash16.merge(transitionStyle, componentsProps?.alert?.style),
|
|
7179
|
-
children: [
|
|
7180
|
-
text,
|
|
7181
|
-
children
|
|
7182
|
-
]
|
|
7183
|
-
})
|
|
7184
|
-
});
|
|
7185
|
-
}
|
|
7186
|
-
// src/core/components/Widget/WidgetWrapper/index.tsx
|
|
7187
|
-
import { Paper as Paper3, Transition as Transition8 } from "@mantine/core";
|
|
7188
|
-
import {
|
|
7189
|
-
useCallback as useCallback2,
|
|
7190
|
-
useEffect as useEffect7,
|
|
7191
|
-
useRef as useRef4,
|
|
7192
|
-
useState as useState9
|
|
7193
|
-
} from "react";
|
|
7194
|
-
import { IconX } from "@tabler/icons-react";
|
|
7195
|
-
var import_lodash17 = __toESM(require_lodash(), 1);
|
|
7196
|
-
import { jsx as jsx31, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
7197
|
-
function WidgetWrapper({
|
|
7198
|
-
config,
|
|
7199
|
-
mt = 0,
|
|
7200
|
-
withCloseButton = true,
|
|
7201
|
-
pinnableSection,
|
|
7202
|
-
componentsProps,
|
|
7203
|
-
children
|
|
7204
|
-
}) {
|
|
7205
|
-
const {
|
|
7206
|
-
widgets,
|
|
7207
|
-
hideWidget,
|
|
7208
|
-
isPageRegistered,
|
|
7209
|
-
isWidgetRegistered,
|
|
7210
|
-
registerWidget,
|
|
7211
|
-
updateActiveWidget,
|
|
7212
|
-
updateWidgetSelection,
|
|
7213
|
-
activeWidget
|
|
7214
|
-
} = useWidgets();
|
|
7215
|
-
const page = usePage();
|
|
7216
|
-
const theme = useRemoraidTheme();
|
|
7217
|
-
const [controlsContainer, setControlsContainer] = useState9(null);
|
|
7218
|
-
const widget = page ? widgets[page.pageId]?.[config.widgetId] : undefined;
|
|
7219
|
-
const pageRegistered = page ? isPageRegistered(page.pageId) : false;
|
|
7220
|
-
const containerRef = useRef4(null);
|
|
7221
|
-
const controlsContainerRef = useCallback2((n) => {
|
|
7222
|
-
setControlsContainer(n);
|
|
7223
|
-
}, [setControlsContainer]);
|
|
7224
|
-
const handleEnter = () => {
|
|
7225
|
-
updateActiveWidget(config.widgetId);
|
|
7226
|
-
};
|
|
7227
|
-
const handleLeave = (e) => {
|
|
7228
|
-
const to = e.relatedTarget;
|
|
7229
|
-
if (to && to.closest?.("[data-control-button]")) {
|
|
7230
|
-
return;
|
|
7231
|
-
}
|
|
7232
|
-
updateActiveWidget(null);
|
|
7233
|
-
};
|
|
7234
|
-
const mounted = Boolean(widget?.selected);
|
|
7235
|
-
let element = /* @__PURE__ */ jsx31(Transition8, {
|
|
7236
|
-
mounted,
|
|
7237
|
-
transition: "fade-left",
|
|
7238
|
-
duration: theme.transitionDurations.medium,
|
|
7239
|
-
timingFunction: "ease",
|
|
7240
|
-
...componentsProps?.transition,
|
|
7241
|
-
onExited: () => {
|
|
7242
|
-
if (page) {
|
|
7243
|
-
hideWidget(page.pageId, config.widgetId);
|
|
7244
|
-
}
|
|
7245
|
-
componentsProps?.transition?.onExited?.();
|
|
7246
|
-
},
|
|
7247
|
-
children: (transitionStyle) => /* @__PURE__ */ jsxs11(Paper3, {
|
|
7248
|
-
ref: containerRef,
|
|
7249
|
-
p: "md",
|
|
7250
|
-
shadow: "md",
|
|
7251
|
-
bg: theme.transparentBackground,
|
|
7252
|
-
mt,
|
|
7253
|
-
pos: "relative",
|
|
7254
|
-
h: "fit-content",
|
|
7255
|
-
mah: "100%",
|
|
7256
|
-
display: "flex",
|
|
7257
|
-
...componentsProps?.container,
|
|
7258
|
-
onMouseEnter: (e) => {
|
|
7259
|
-
handleEnter();
|
|
7260
|
-
componentsProps?.container?.onMouseEnter?.(e);
|
|
7261
|
-
},
|
|
7262
|
-
onMouseLeave: (e) => {
|
|
7263
|
-
handleLeave(e);
|
|
7264
|
-
componentsProps?.container?.onMouseLeave?.(e);
|
|
7265
|
-
},
|
|
7266
|
-
style: import_lodash17.merge(transitionStyle, { flexDirection: "column" }, componentsProps?.container?.style),
|
|
7267
|
-
className: clsx_default("remoraid-segment", componentsProps?.container?.className),
|
|
7268
|
-
id: config.widgetId,
|
|
7269
|
-
children: [
|
|
7270
|
-
/* @__PURE__ */ jsx31(Controls, {
|
|
7271
|
-
dragContainerRef: containerRef,
|
|
7272
|
-
groupRef: controlsContainerRef,
|
|
7273
|
-
mounted: activeWidget === config.widgetId,
|
|
7274
|
-
...componentsProps?.controls,
|
|
7275
|
-
children: /* @__PURE__ */ jsx31(ControlButton, {
|
|
7276
|
-
mounted: withCloseButton,
|
|
7277
|
-
icon: IconX,
|
|
7278
|
-
tooltip: "Hide widget",
|
|
7279
|
-
color: "red",
|
|
7280
|
-
order: 200,
|
|
7281
|
-
...componentsProps?.closeButton,
|
|
7282
|
-
componentsProps: {
|
|
7283
|
-
...componentsProps?.closeButton?.componentsProps,
|
|
7284
|
-
tooltip: {
|
|
7285
|
-
disabled: !mounted,
|
|
7286
|
-
...componentsProps?.closeButton?.componentsProps?.tooltip
|
|
7287
|
-
}
|
|
7288
|
-
},
|
|
7289
|
-
onClick: (e) => {
|
|
7290
|
-
if (!page) {
|
|
7291
|
-
return;
|
|
7292
|
-
}
|
|
7293
|
-
updateWidgetSelection(page.pageId, config.widgetId, false);
|
|
7294
|
-
handleLeave(e);
|
|
7295
|
-
componentsProps?.closeButton?.onClick?.(e);
|
|
7296
|
-
}
|
|
7297
|
-
})
|
|
7298
|
-
}),
|
|
7299
|
-
children
|
|
7300
|
-
]
|
|
7301
|
-
})
|
|
7302
|
-
});
|
|
7303
|
-
if (pinnableSection !== undefined) {
|
|
7304
|
-
element = /* @__PURE__ */ jsx31(Pinnable, {
|
|
7305
|
-
section: pinnableSection,
|
|
7306
|
-
controlsContainer,
|
|
7307
|
-
hidden: Boolean(widget?.hidden),
|
|
7308
|
-
...componentsProps?.Pinnable,
|
|
7309
|
-
componentsProps: {
|
|
7310
|
-
...componentsProps?.Pinnable?.componentsProps,
|
|
7311
|
-
button: {
|
|
7312
|
-
...componentsProps?.Pinnable?.componentsProps?.button,
|
|
7313
|
-
onClick: (e) => {
|
|
7314
|
-
handleLeave(e);
|
|
7315
|
-
componentsProps?.Pinnable?.componentsProps?.button?.onClick?.(e);
|
|
7316
|
-
}
|
|
7317
|
-
},
|
|
7318
|
-
layoutElement: {
|
|
7319
|
-
includeContainer: false,
|
|
7320
|
-
includePageContainer: pinnableSection === "top" /* Top */ || pinnableSection === "bottom" /* Bottom */,
|
|
7321
|
-
...componentsProps?.Pinnable?.componentsProps?.layoutElement
|
|
7322
|
-
}
|
|
7323
|
-
},
|
|
7324
|
-
children: element
|
|
7325
|
-
});
|
|
7326
|
-
}
|
|
7327
|
-
useEffect7(() => {
|
|
7328
|
-
if (!page) {
|
|
7329
|
-
return;
|
|
7330
|
-
}
|
|
7331
|
-
if (!isWidgetRegistered(page.pageId, config.widgetId)) {
|
|
7332
|
-
registerWidget(page.pageId, config);
|
|
7333
|
-
}
|
|
7334
|
-
}, [pageRegistered]);
|
|
7335
|
-
return element;
|
|
7336
|
-
}
|
|
7337
|
-
// src/core/components/Widget/index.tsx
|
|
7338
|
-
import {
|
|
7339
|
-
Center as Center2,
|
|
7340
|
-
Divider as Divider2,
|
|
7341
|
-
Group as Group5,
|
|
7342
|
-
Loader,
|
|
7343
|
-
Title,
|
|
7344
|
-
Stack as Stack5,
|
|
7345
|
-
Box as Box7,
|
|
7346
|
-
ScrollArea as ScrollArea4,
|
|
7347
|
-
Transition as Transition9,
|
|
7348
|
-
Text as Text2
|
|
7349
|
-
} from "@mantine/core";
|
|
7350
|
-
import { Children } from "react";
|
|
7351
|
-
var import_lodash18 = __toESM(require_lodash(), 1);
|
|
7352
|
-
import { jsx as jsx32, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
7353
|
-
import { createElement as createElement2 } from "react";
|
|
7354
|
-
function Widget({
|
|
7355
|
-
id,
|
|
7356
|
-
title,
|
|
7357
|
-
description,
|
|
7358
|
-
config,
|
|
7359
|
-
badges: badgesProp,
|
|
7360
|
-
buttons: buttonsProp,
|
|
7361
|
-
alerts: alertsProp,
|
|
7362
|
-
gaps,
|
|
7363
|
-
loading,
|
|
7364
|
-
mt,
|
|
7365
|
-
pinnableSection,
|
|
7366
|
-
componentsProps,
|
|
7367
|
-
children
|
|
7368
|
-
}) {
|
|
7369
|
-
const buttons = buttonsProp?.map((button) => asElementOrPropsOfType(RemoraidButton, button, "Check the 'buttons' property of this widget."));
|
|
7370
|
-
const alerts = alertsProp?.map((alert) => asElementOrPropsOfType(AlertMinimal, alert, "Check the 'alerts' property of this widget."));
|
|
7371
|
-
const badges = badgesProp?.map((badge) => asElementOrPropsOfType(BadgeMinimal, badge, "Check the 'badges' property of this widget."));
|
|
7372
|
-
const badgesGap = (typeof gaps === "object" ? gaps.badges : gaps) ?? "xs";
|
|
7373
|
-
const buttonsGap = (typeof gaps === "object" ? gaps.buttons : gaps) ?? "xs";
|
|
7374
|
-
const alertsGap = (typeof gaps === "object" ? gaps.alerts : gaps) ?? "xs";
|
|
7375
|
-
return /* @__PURE__ */ jsx32(WidgetWrapper, {
|
|
7376
|
-
config: {
|
|
7377
|
-
widgetId: id,
|
|
7378
|
-
...config,
|
|
7379
|
-
initialValues: {
|
|
7380
|
-
name: title,
|
|
7381
|
-
...config?.initialValues
|
|
7382
|
-
}
|
|
7383
|
-
},
|
|
7384
|
-
mt,
|
|
7385
|
-
...componentsProps?.wrapper,
|
|
7386
|
-
pinnableSection: pinnableSection ?? componentsProps?.wrapper?.pinnableSection,
|
|
7387
|
-
children: /* @__PURE__ */ jsxs12(Stack5, {
|
|
7388
|
-
gap: "md",
|
|
7389
|
-
mih: 0,
|
|
7390
|
-
...componentsProps?.contentContainer,
|
|
7391
|
-
children: [
|
|
7392
|
-
/* @__PURE__ */ jsxs12(Group5, {
|
|
7393
|
-
justify: "space-between",
|
|
7394
|
-
wrap: "nowrap",
|
|
7395
|
-
children: [
|
|
7396
|
-
/* @__PURE__ */ jsxs12(Stack5, {
|
|
7397
|
-
gap: 4,
|
|
7398
|
-
children: [
|
|
7399
|
-
/* @__PURE__ */ jsxs12(Group5, {
|
|
7400
|
-
gap: badgesGap,
|
|
7401
|
-
wrap: "nowrap",
|
|
7402
|
-
children: [
|
|
7403
|
-
/* @__PURE__ */ jsx32(Title, {
|
|
7404
|
-
order: 1,
|
|
7405
|
-
size: "h2",
|
|
7406
|
-
lineClamp: 1,
|
|
7407
|
-
...componentsProps?.title,
|
|
7408
|
-
children: title ?? id
|
|
7409
|
-
}),
|
|
7410
|
-
badges !== undefined && /* @__PURE__ */ jsx32(BadgeGroup, {
|
|
7411
|
-
badges,
|
|
7412
|
-
gap: badgesGap,
|
|
7413
|
-
...componentsProps?.badgeGroup
|
|
7414
|
-
})
|
|
7415
|
-
]
|
|
7416
|
-
}),
|
|
7417
|
-
/* @__PURE__ */ jsx32(Transition9, {
|
|
7418
|
-
mounted: Boolean(description),
|
|
7419
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx32(Text2, {
|
|
7420
|
-
size: "sm",
|
|
7421
|
-
c: "dimmed",
|
|
7422
|
-
...componentsProps?.description,
|
|
7423
|
-
style: import_lodash18.merge(transitionStyle, componentsProps?.description?.style),
|
|
7424
|
-
children: description
|
|
7425
|
-
})
|
|
7426
|
-
})
|
|
7427
|
-
]
|
|
7428
|
-
}),
|
|
7429
|
-
/* @__PURE__ */ jsx32(Group5, {
|
|
7430
|
-
gap: buttonsGap,
|
|
7431
|
-
wrap: "nowrap",
|
|
7432
|
-
children: buttons !== undefined && buttons.map((button, i) => {
|
|
7433
|
-
if (isValidElementOfType(RemoraidButton, button)) {
|
|
7434
|
-
return button;
|
|
7435
|
-
}
|
|
7436
|
-
return /* @__PURE__ */ createElement2(RemoraidButton, {
|
|
7437
|
-
...button,
|
|
7438
|
-
key: i
|
|
7439
|
-
});
|
|
7440
|
-
})
|
|
7441
|
-
})
|
|
7442
|
-
]
|
|
7443
|
-
}),
|
|
7444
|
-
/* @__PURE__ */ jsx32(Box7, {
|
|
7445
|
-
children: /* @__PURE__ */ jsx32(Divider2, {
|
|
7446
|
-
...componentsProps?.divider
|
|
7447
|
-
})
|
|
7448
|
-
}),
|
|
7449
|
-
/* @__PURE__ */ jsx32(Stack5, {
|
|
7450
|
-
align: "stretch",
|
|
7451
|
-
gap: alertsGap,
|
|
7452
|
-
...componentsProps?.alertsContainer,
|
|
7453
|
-
className: clsx_default("hide-if-empty", componentsProps?.alertsContainer?.className),
|
|
7454
|
-
children: alerts?.map((alert, i) => {
|
|
7455
|
-
if (isValidElementOfType(AlertMinimal, alert)) {
|
|
7456
|
-
return alert;
|
|
7457
|
-
}
|
|
7458
|
-
return /* @__PURE__ */ createElement2(AlertMinimal, {
|
|
7459
|
-
...alert,
|
|
7460
|
-
key: i
|
|
7461
|
-
});
|
|
7462
|
-
})
|
|
7463
|
-
}),
|
|
7464
|
-
(loading || Children.toArray(children).length > 0) && /* @__PURE__ */ jsx32(ScrollArea4.Autosize, {
|
|
7465
|
-
flex: 1,
|
|
7466
|
-
...componentsProps?.childrenContainer,
|
|
7467
|
-
className: clsx_default("remoraid-widget-children-container", componentsProps?.childrenContainer?.className),
|
|
7468
|
-
children: loading ? /* @__PURE__ */ jsx32(Center2, {
|
|
7469
|
-
children: /* @__PURE__ */ jsx32(Loader, {
|
|
7470
|
-
...componentsProps?.loader
|
|
7471
|
-
})
|
|
7472
|
-
}) : children
|
|
7473
|
-
})
|
|
7474
|
-
]
|
|
7475
|
-
})
|
|
7476
|
-
});
|
|
7477
|
-
}
|
|
7478
|
-
// src/core/components/NotFoundPage/index.tsx
|
|
7479
|
-
import { jsx as jsx33, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
7480
|
-
// src/core/components/EnvironmentShell/index.tsx
|
|
7481
|
-
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
7482
|
-
// src/core/components/SettingsWidget/index.tsx
|
|
7483
|
-
import { createContext as createContext8, useContext as useContext12 } from "react";
|
|
7484
|
-
import { IconRestore } from "@tabler/icons-react";
|
|
7485
|
-
|
|
7486
|
-
// src/core/components/SettingsWidget/SaveButton/index.tsx
|
|
7487
|
-
import { IconDeviceFloppy } from "@tabler/icons-react";
|
|
7488
|
-
import { Group as Group6 } from "@mantine/core";
|
|
7489
|
-
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
7490
|
-
function SaveButton({
|
|
7491
|
-
onSaveChanges,
|
|
7492
|
-
insideContainer,
|
|
7493
|
-
componentsProps
|
|
7494
|
-
}) {
|
|
7495
|
-
const settingsWidgetOptions = useSettingsWidgetContext();
|
|
7496
|
-
const button = /* @__PURE__ */ jsx35(RemoraidButton, {
|
|
7497
|
-
label: "Save Changes",
|
|
7498
|
-
icon: IconDeviceFloppy,
|
|
7499
|
-
onClick: onSaveChanges,
|
|
7500
|
-
responsive: false,
|
|
7501
|
-
...componentsProps?.button,
|
|
7502
|
-
componentsProps: {
|
|
7503
|
-
...componentsProps?.button?.componentsProps,
|
|
7504
|
-
button: {
|
|
7505
|
-
disabled: settingsWidgetOptions.unsavedChanges === false,
|
|
7506
|
-
...componentsProps?.button?.componentsProps?.button
|
|
7507
|
-
}
|
|
7508
|
-
}
|
|
7509
|
-
});
|
|
7510
|
-
if (insideContainer !== false) {
|
|
7511
|
-
return /* @__PURE__ */ jsx35(Group6, {
|
|
7512
|
-
w: "100%",
|
|
7513
|
-
justify: "flex-end",
|
|
7514
|
-
mt: "md",
|
|
7515
|
-
...componentsProps?.container,
|
|
7516
|
-
children: button
|
|
7517
|
-
});
|
|
7518
|
-
}
|
|
7519
|
-
return button;
|
|
7520
|
-
}
|
|
7521
|
-
|
|
7522
|
-
// src/core/components/SettingsWidget/index.tsx
|
|
7523
|
-
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
7524
|
-
var defaultSettingsWidgetContext = {};
|
|
7525
|
-
var settingsWidgetContext = createContext8(defaultSettingsWidgetContext);
|
|
7526
|
-
var useSettingsWidgetContext = () => {
|
|
7527
|
-
return useContext12(settingsWidgetContext);
|
|
7528
|
-
};
|
|
7529
|
-
function SettingsWidget({
|
|
7530
|
-
children,
|
|
7531
|
-
onRestoreDefaultValues,
|
|
7532
|
-
unsavedChanges,
|
|
7533
|
-
custom,
|
|
7534
|
-
widgetProps
|
|
7535
|
-
}) {
|
|
7536
|
-
return /* @__PURE__ */ jsx36(settingsWidgetContext.Provider, {
|
|
7537
|
-
value: { custom, unsavedChanges },
|
|
7538
|
-
children: /* @__PURE__ */ jsx36(Widget, {
|
|
7539
|
-
title: "Settings",
|
|
7540
|
-
id: "settings",
|
|
7541
|
-
...widgetProps,
|
|
7542
|
-
buttons: [
|
|
7543
|
-
...onRestoreDefaultValues ? [
|
|
7544
|
-
{
|
|
7545
|
-
label: "Restore Default Values",
|
|
7546
|
-
icon: IconRestore,
|
|
7547
|
-
onClick: onRestoreDefaultValues,
|
|
7548
|
-
componentsProps: { button: { disabled: custom === false } }
|
|
7549
|
-
}
|
|
7550
|
-
] : [],
|
|
7551
|
-
...widgetProps?.buttons ?? []
|
|
7552
|
-
],
|
|
7553
|
-
badges: [
|
|
7554
|
-
{
|
|
7555
|
-
label: "Custom",
|
|
7556
|
-
tooltip: "Your settings differ from the default settings",
|
|
7557
|
-
mounted: custom ?? false
|
|
7558
|
-
},
|
|
7559
|
-
{
|
|
7560
|
-
label: "Unsaved Changes",
|
|
7561
|
-
mounted: unsavedChanges ?? false
|
|
7562
|
-
},
|
|
7563
|
-
...widgetProps?.badges ?? []
|
|
7564
|
-
],
|
|
7565
|
-
children
|
|
7566
|
-
})
|
|
7567
|
-
});
|
|
7568
|
-
}
|
|
7569
|
-
var SettingsWidget_default = Object.assign(SettingsWidget, {
|
|
7570
|
-
SaveButton
|
|
7571
|
-
});
|
|
7572
|
-
// src/core/components/SettingsWidget/SettingsTable/index.tsx
|
|
7573
|
-
import { createContext as createContext9, useContext as useContext13 } from "react";
|
|
7574
|
-
import { Table as Table2 } from "@mantine/core";
|
|
7575
|
-
|
|
7576
|
-
// src/core/components/SettingsWidget/SettingsTable/Row/index.tsx
|
|
7577
|
-
import { Table, Text as Text3 } from "@mantine/core";
|
|
7578
|
-
import { jsx as jsx37, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
7579
|
-
function Row({
|
|
7580
|
-
children,
|
|
7581
|
-
label
|
|
7582
|
-
}) {
|
|
7583
|
-
const options = useSettingsTableOptions();
|
|
7584
|
-
return /* @__PURE__ */ jsxs14(Table.Tr, {
|
|
7585
|
-
children: [
|
|
7586
|
-
/* @__PURE__ */ jsx37(Table.Th, {
|
|
7587
|
-
w: options.leftColumnWidth,
|
|
7588
|
-
children: /* @__PURE__ */ jsx37(Text3, {
|
|
7589
|
-
size: "sm",
|
|
7590
|
-
children: label
|
|
7591
|
-
})
|
|
7592
|
-
}),
|
|
7593
|
-
/* @__PURE__ */ jsx37(Table.Td, {
|
|
7594
|
-
py: "xs",
|
|
7595
|
-
children
|
|
7596
|
-
})
|
|
7597
|
-
]
|
|
7598
|
-
});
|
|
7599
|
-
}
|
|
7600
|
-
|
|
7601
|
-
// src/core/components/SettingsWidget/SettingsTable/index.tsx
|
|
7602
|
-
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
7603
|
-
var defaultSettingsTableOptions = {
|
|
7604
|
-
leftColumnWidth: "38.2%"
|
|
7605
|
-
};
|
|
7606
|
-
var settingsTableOptionsContext = createContext9(defaultSettingsTableOptions);
|
|
7607
|
-
var useSettingsTableOptions = () => {
|
|
7608
|
-
return useContext13(settingsTableOptionsContext);
|
|
7609
|
-
};
|
|
7610
|
-
function SettingsTable({
|
|
7611
|
-
leftColumnWidth,
|
|
7612
|
-
children: childrenProp
|
|
7613
|
-
}) {
|
|
7614
|
-
const children = asChildrenOfType(Row, childrenProp, "Check children passed to 'SettingsTable' component.");
|
|
7615
|
-
const theme = useRemoraidTheme();
|
|
7616
|
-
return /* @__PURE__ */ jsx38(settingsTableOptionsContext.Provider, {
|
|
7617
|
-
value: {
|
|
7618
|
-
leftColumnWidth: leftColumnWidth ?? defaultSettingsTableOptions.leftColumnWidth
|
|
7619
|
-
},
|
|
7620
|
-
children: /* @__PURE__ */ jsx38(Table2, {
|
|
7621
|
-
bg: theme.transparentBackground,
|
|
7622
|
-
withTableBorder: true,
|
|
7623
|
-
variant: "vertical",
|
|
7624
|
-
layout: "fixed",
|
|
7625
|
-
children: /* @__PURE__ */ jsx38(Table2.Tbody, {
|
|
7626
|
-
children
|
|
7627
|
-
})
|
|
7628
|
-
})
|
|
7629
|
-
});
|
|
7630
|
-
}
|
|
7631
|
-
var SettingsTable_default = Object.assign(SettingsTable, {
|
|
7632
|
-
Row
|
|
7633
|
-
});
|
|
7634
|
-
// src/core/components/NavbarSettingsWidget/index.tsx
|
|
7635
|
-
var import_lodash19 = __toESM(require_lodash(), 1);
|
|
7636
|
-
import { Select } from "@mantine/core";
|
|
7637
|
-
import { jsx as jsx39, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
7638
|
-
// src/core/components/FooterSettingsWidget/index.tsx
|
|
7639
|
-
var import_lodash20 = __toESM(require_lodash(), 1);
|
|
7640
|
-
import { Select as Select2 } from "@mantine/core";
|
|
7641
|
-
import { jsx as jsx40, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
7642
|
-
// src/core/components/ContextClusterProvider/index.tsx
|
|
7643
|
-
import React10 from "react";
|
|
7644
|
-
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
7645
|
-
// src/core/components/InputWrapperScrollArea/index.tsx
|
|
7646
|
-
import {
|
|
7647
|
-
Box as Box8,
|
|
7648
|
-
Input,
|
|
7649
|
-
Paper as Paper4,
|
|
7650
|
-
ScrollArea as ScrollArea5
|
|
7651
|
-
} from "@mantine/core";
|
|
7652
|
-
import { useState as useState10 } from "react";
|
|
7653
|
-
import { useRemoraidTheme as useRemoraidTheme2 } from "remoraid/core";
|
|
7654
|
-
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
7655
|
-
function InputWrapperScrollArea({
|
|
7656
|
-
children,
|
|
7657
|
-
label,
|
|
7658
|
-
mah,
|
|
7659
|
-
description,
|
|
7660
|
-
error,
|
|
7661
|
-
required = false,
|
|
7662
|
-
componentsProps
|
|
7663
|
-
}) {
|
|
7664
|
-
const theme = useRemoraidTheme2();
|
|
7665
|
-
const [isHovering, setIsHovering] = useState10(false);
|
|
7666
|
-
return /* @__PURE__ */ jsx42(Input.Wrapper, {
|
|
7667
|
-
label,
|
|
7668
|
-
error,
|
|
7669
|
-
onMouseEnter: () => setIsHovering(true),
|
|
7670
|
-
onMouseLeave: () => setIsHovering(false),
|
|
7671
|
-
description,
|
|
7672
|
-
withAsterisk: required,
|
|
7673
|
-
...componentsProps?.container,
|
|
7674
|
-
children: /* @__PURE__ */ jsx42(Paper4, {
|
|
7675
|
-
shadow: "none",
|
|
7676
|
-
p: 0,
|
|
7677
|
-
mt: Boolean(description) ? 4 : 0,
|
|
7678
|
-
withBorder: true,
|
|
7679
|
-
display: "flex",
|
|
7680
|
-
bg: theme.transparentBackground,
|
|
7681
|
-
style: {
|
|
7682
|
-
transition: "border-color .1s",
|
|
7683
|
-
borderColor: error ? "var(--mantine-color-error)" : isHovering ? "var(--mantine-primary-color-filled)" : undefined
|
|
7684
|
-
},
|
|
7685
|
-
children: /* @__PURE__ */ jsx42(ScrollArea5, {
|
|
7686
|
-
mah,
|
|
7687
|
-
px: "md",
|
|
7688
|
-
flex: 1,
|
|
7689
|
-
...componentsProps?.ScrollArea,
|
|
7690
|
-
children: /* @__PURE__ */ jsx42(Box8, {
|
|
7691
|
-
...componentsProps?.childrenContainer,
|
|
7692
|
-
children
|
|
7693
|
-
})
|
|
7694
|
-
})
|
|
7695
|
-
})
|
|
7696
|
-
});
|
|
7697
|
-
}
|
|
7698
5436
|
// src/jsonforms/renderers/AnyControl.tsx
|
|
5437
|
+
import { InputWrapperScrollArea, useRemoraidTheme } from "remoraid/core";
|
|
7699
5438
|
import { withJsonFormsControlProps } from "@jsonforms/react";
|
|
7700
5439
|
import { JsonInput } from "@mantine/core";
|
|
7701
|
-
import { useState as
|
|
5440
|
+
import { useState as useState2 } from "react";
|
|
7702
5441
|
|
|
7703
5442
|
// src/jsonforms/components/FormOptionsProvider/index.tsx
|
|
7704
|
-
import
|
|
7705
|
-
useContext
|
|
7706
|
-
useState
|
|
5443
|
+
import React, {
|
|
5444
|
+
useContext,
|
|
5445
|
+
useState
|
|
7707
5446
|
} from "react";
|
|
7708
|
-
import { jsx
|
|
5447
|
+
import { jsx } from "react/jsx-runtime";
|
|
7709
5448
|
var defaultFormOptions = {
|
|
7710
5449
|
withDescriptions: false,
|
|
7711
5450
|
gutter: "md"
|
|
7712
5451
|
};
|
|
7713
|
-
var formOptionsContext =
|
|
5452
|
+
var formOptionsContext = React.createContext({
|
|
7714
5453
|
formOptions: defaultFormOptions,
|
|
7715
5454
|
updateFormOptions: () => {}
|
|
7716
5455
|
});
|
|
7717
|
-
var useFormOptions = () =>
|
|
5456
|
+
var useFormOptions = () => useContext(formOptionsContext);
|
|
7718
5457
|
function FormOptionsProvider({
|
|
7719
5458
|
children,
|
|
7720
5459
|
initialValue
|
|
7721
5460
|
}) {
|
|
7722
|
-
const [formOptions, setFormOptions] =
|
|
5461
|
+
const [formOptions, setFormOptions] = useState({
|
|
7723
5462
|
...defaultFormOptions,
|
|
7724
5463
|
...initialValue
|
|
7725
5464
|
});
|
|
7726
5465
|
const updateFormOptions = (newFormOptions) => {
|
|
7727
5466
|
setFormOptions((prev) => ({ ...prev, ...newFormOptions }));
|
|
7728
5467
|
};
|
|
7729
|
-
return /* @__PURE__ */
|
|
5468
|
+
return /* @__PURE__ */ jsx(formOptionsContext.Provider, {
|
|
7730
5469
|
value: { formOptions, updateFormOptions },
|
|
7731
5470
|
children
|
|
7732
5471
|
});
|
|
7733
5472
|
}
|
|
7734
5473
|
|
|
7735
5474
|
// src/jsonforms/renderers/AnyControl.tsx
|
|
7736
|
-
import { jsx as
|
|
5475
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
7737
5476
|
function PlainAnyControl({
|
|
7738
5477
|
data,
|
|
7739
5478
|
handleChange,
|
|
@@ -7746,17 +5485,17 @@ function PlainAnyControl({
|
|
|
7746
5485
|
const {
|
|
7747
5486
|
formOptions: { withDescriptions }
|
|
7748
5487
|
} = useFormOptions();
|
|
7749
|
-
const [input, setInput] =
|
|
7750
|
-
const [error, setError] =
|
|
5488
|
+
const [input, setInput] = useState2(JSON.stringify(data, null, theme.jsonStringifySpace));
|
|
5489
|
+
const [error, setError] = useState2(false);
|
|
7751
5490
|
const label = labelProp !== "remoraid-array-item" ? labelProp : null;
|
|
7752
5491
|
const description = withDescriptions ? schema.description : undefined;
|
|
7753
|
-
return /* @__PURE__ */
|
|
5492
|
+
return /* @__PURE__ */ jsx2(InputWrapperScrollArea, {
|
|
7754
5493
|
label: label ?? undefined,
|
|
7755
5494
|
error: error ? "Invalid JSON" : undefined,
|
|
7756
5495
|
description,
|
|
7757
5496
|
required,
|
|
7758
5497
|
mah: 140,
|
|
7759
|
-
children: /* @__PURE__ */
|
|
5498
|
+
children: /* @__PURE__ */ jsx2(JsonInput, {
|
|
7760
5499
|
onChange: (newValue) => {
|
|
7761
5500
|
setInput(newValue);
|
|
7762
5501
|
try {
|
|
@@ -7789,9 +5528,9 @@ import {
|
|
|
7789
5528
|
import {
|
|
7790
5529
|
Resolve
|
|
7791
5530
|
} from "@jsonforms/core";
|
|
7792
|
-
import { Input
|
|
7793
|
-
import { useMemo
|
|
7794
|
-
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";
|
|
7795
5534
|
function PlainAnyOfControl({
|
|
7796
5535
|
data,
|
|
7797
5536
|
schema,
|
|
@@ -7822,7 +5561,7 @@ function PlainAnyOfControl({
|
|
|
7822
5561
|
}
|
|
7823
5562
|
return;
|
|
7824
5563
|
};
|
|
7825
|
-
const options =
|
|
5564
|
+
const options = useMemo(() => {
|
|
7826
5565
|
const anyOf = schema.anyOf ?? [];
|
|
7827
5566
|
return anyOf.map((opt, idx) => {
|
|
7828
5567
|
const resolved = opt.$ref ? Resolve.schema(rootSchema, opt.$ref, rootSchema) : opt;
|
|
@@ -7832,7 +5571,7 @@ function PlainAnyOfControl({
|
|
|
7832
5571
|
return { original: opt, resolved, label: label2 };
|
|
7833
5572
|
});
|
|
7834
5573
|
}, [schema.anyOf, rootSchema]);
|
|
7835
|
-
const isValidOptionIndex =
|
|
5574
|
+
const isValidOptionIndex = useMemo(() => {
|
|
7836
5575
|
return (optionIndex) => {
|
|
7837
5576
|
if (!core?.ajv || data === undefined) {
|
|
7838
5577
|
return false;
|
|
@@ -7841,7 +5580,7 @@ function PlainAnyOfControl({
|
|
|
7841
5580
|
return validate(data);
|
|
7842
5581
|
};
|
|
7843
5582
|
}, [core?.ajv, data, options]);
|
|
7844
|
-
const validOptionIndex =
|
|
5583
|
+
const validOptionIndex = useMemo(() => {
|
|
7845
5584
|
for (let i = 0;i < options.length; i++) {
|
|
7846
5585
|
if (isValidOptionIndex(i)) {
|
|
7847
5586
|
return i;
|
|
@@ -7849,7 +5588,7 @@ function PlainAnyOfControl({
|
|
|
7849
5588
|
}
|
|
7850
5589
|
return -1;
|
|
7851
5590
|
}, [options, isValidOptionIndex]);
|
|
7852
|
-
const [selectedOption, setSelectedOption] =
|
|
5591
|
+
const [selectedOption, setSelectedOption] = useState3(validOptionIndex >= 0 ? String(validOptionIndex) : null);
|
|
7853
5592
|
const schemaDefaultValue = (opt) => {
|
|
7854
5593
|
const t = opt.type ?? (opt.properties ? "object" : opt.items ? "array" : undefined);
|
|
7855
5594
|
switch (t) {
|
|
@@ -7875,19 +5614,19 @@ function PlainAnyOfControl({
|
|
|
7875
5614
|
value: String(i),
|
|
7876
5615
|
label: o.label
|
|
7877
5616
|
}));
|
|
7878
|
-
return /* @__PURE__ */
|
|
7879
|
-
children: /* @__PURE__ */
|
|
5617
|
+
return /* @__PURE__ */ jsx3(Fragment, {
|
|
5618
|
+
children: /* @__PURE__ */ jsx3(Input.Wrapper, {
|
|
7880
5619
|
label,
|
|
7881
5620
|
description: formOptions.withDescriptions ? schema.description ?? null : null,
|
|
7882
5621
|
withAsterisk: required,
|
|
7883
|
-
children: /* @__PURE__ */
|
|
5622
|
+
children: /* @__PURE__ */ jsxs(Paper, {
|
|
7884
5623
|
withBorder: true,
|
|
7885
5624
|
shadow: "0",
|
|
7886
5625
|
bg: "var(--remoraid-transparent-background)",
|
|
7887
5626
|
p: formOptions.gutter,
|
|
7888
5627
|
mt: formOptions.withDescriptions && schema.description && schema.description.length > 0 ? 4 : 0,
|
|
7889
5628
|
children: [
|
|
7890
|
-
/* @__PURE__ */
|
|
5629
|
+
/* @__PURE__ */ jsx3(Select, {
|
|
7891
5630
|
label: "Value type",
|
|
7892
5631
|
data: selectData,
|
|
7893
5632
|
value: selectedOption,
|
|
@@ -7908,7 +5647,7 @@ function PlainAnyOfControl({
|
|
|
7908
5647
|
variant: "default",
|
|
7909
5648
|
mb: selectedOption !== null && inferType(selectedSchema) !== "null" ? formOptions.gutter : undefined
|
|
7910
5649
|
}),
|
|
7911
|
-
selectedOption !== null && /* @__PURE__ */
|
|
5650
|
+
selectedOption !== null && /* @__PURE__ */ jsx3(JsonForms, {
|
|
7912
5651
|
schema: {
|
|
7913
5652
|
...selectedSchema,
|
|
7914
5653
|
$schema: undefined
|
|
@@ -7935,18 +5674,18 @@ import {
|
|
|
7935
5674
|
useJsonForms as useJsonForms2,
|
|
7936
5675
|
withJsonFormsControlProps as withJsonFormsControlProps3
|
|
7937
5676
|
} from "@jsonforms/react";
|
|
7938
|
-
import { Box
|
|
5677
|
+
import { Box, Button, Flex, Input as Input2, Paper as Paper2, Stack } from "@mantine/core";
|
|
7939
5678
|
import { IconPlus, IconTrash } from "@tabler/icons-react";
|
|
7940
|
-
var
|
|
5679
|
+
var import_lodash = __toESM(require_lodash(), 1);
|
|
7941
5680
|
import {
|
|
7942
|
-
AlertCategory
|
|
7943
|
-
AlertMinimal
|
|
7944
|
-
RemoraidButton
|
|
7945
|
-
useRemoraidTheme as
|
|
5681
|
+
AlertCategory,
|
|
5682
|
+
AlertMinimal,
|
|
5683
|
+
RemoraidButton,
|
|
5684
|
+
useRemoraidTheme as useRemoraidTheme2
|
|
7946
5685
|
} from "remoraid/core";
|
|
7947
|
-
import { jsx as
|
|
5686
|
+
import { jsx as jsx4, jsxs as jsxs2, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
7948
5687
|
function PlainArrayControl(props) {
|
|
7949
|
-
const theme =
|
|
5688
|
+
const theme = useRemoraidTheme2();
|
|
7950
5689
|
const { label, schema, data, handleChange, path, required } = props;
|
|
7951
5690
|
const { formOptions } = useFormOptions();
|
|
7952
5691
|
const { renderers, cells } = useJsonForms2();
|
|
@@ -7963,45 +5702,45 @@ function PlainArrayControl(props) {
|
|
|
7963
5702
|
required: ["item"]
|
|
7964
5703
|
};
|
|
7965
5704
|
} else {
|
|
7966
|
-
return /* @__PURE__ */
|
|
7967
|
-
category:
|
|
5705
|
+
return /* @__PURE__ */ jsx4(AlertMinimal, {
|
|
5706
|
+
category: AlertCategory.Negative,
|
|
7968
5707
|
title: "Renderer missing",
|
|
7969
5708
|
text: `Could not find applicable renderer for property '${label}'.`
|
|
7970
5709
|
});
|
|
7971
5710
|
}
|
|
7972
|
-
return /* @__PURE__ */
|
|
7973
|
-
children: /* @__PURE__ */
|
|
5711
|
+
return /* @__PURE__ */ jsx4(Fragment2, {
|
|
5712
|
+
children: /* @__PURE__ */ jsx4(Input2.Wrapper, {
|
|
7974
5713
|
label,
|
|
7975
5714
|
description: formOptions.withDescriptions ? schema.description : undefined,
|
|
7976
5715
|
withAsterisk: required,
|
|
7977
|
-
children: /* @__PURE__ */
|
|
5716
|
+
children: /* @__PURE__ */ jsx4(Paper2, {
|
|
7978
5717
|
withBorder: Array.isArray(data) && data.length > 0,
|
|
7979
5718
|
shadow: "0",
|
|
7980
5719
|
bg: "var(--remoraid-transparent-background)",
|
|
7981
5720
|
p: Array.isArray(data) && data.length > 0 ? formOptions.gutter : 0,
|
|
7982
5721
|
mt: formOptions.withDescriptions && schema.description && schema.description.length > 0 ? 4 : 0,
|
|
7983
|
-
children: /* @__PURE__ */
|
|
5722
|
+
children: /* @__PURE__ */ jsxs2(Stack, {
|
|
7984
5723
|
align: "stretch",
|
|
7985
5724
|
justify: "flex-start",
|
|
7986
5725
|
gap: formOptions.gutter,
|
|
7987
5726
|
children: [
|
|
7988
5727
|
Array.isArray(data) ? data.map((item, i) => {
|
|
7989
|
-
return /* @__PURE__ */
|
|
5728
|
+
return /* @__PURE__ */ jsxs2(Flex, {
|
|
7990
5729
|
gap: formOptions.gutter,
|
|
7991
5730
|
justify: "flex-start",
|
|
7992
5731
|
align: "center",
|
|
7993
5732
|
direction: "row",
|
|
7994
5733
|
wrap: "nowrap",
|
|
7995
5734
|
children: [
|
|
7996
|
-
/* @__PURE__ */
|
|
5735
|
+
/* @__PURE__ */ jsx4(Box, {
|
|
7997
5736
|
flex: 1,
|
|
7998
|
-
children: /* @__PURE__ */
|
|
5737
|
+
children: /* @__PURE__ */ jsx4(JsonForms2, {
|
|
7999
5738
|
schema: schemaItems,
|
|
8000
5739
|
data: { item },
|
|
8001
5740
|
renderers: renderers ?? [],
|
|
8002
5741
|
cells: cells ?? [],
|
|
8003
5742
|
onChange: ({ data: newData }) => {
|
|
8004
|
-
if (
|
|
5743
|
+
if (import_lodash.isEqual(data[i], newData.item)) {
|
|
8005
5744
|
return;
|
|
8006
5745
|
}
|
|
8007
5746
|
const dataCopy = [...data];
|
|
@@ -8011,7 +5750,7 @@ function PlainArrayControl(props) {
|
|
|
8011
5750
|
validationMode: "NoValidation"
|
|
8012
5751
|
})
|
|
8013
5752
|
}),
|
|
8014
|
-
/* @__PURE__ */
|
|
5753
|
+
/* @__PURE__ */ jsx4(RemoraidButton, {
|
|
8015
5754
|
responsive: false,
|
|
8016
5755
|
collapsed: true,
|
|
8017
5756
|
label: "Delete item",
|
|
@@ -8023,10 +5762,10 @@ function PlainArrayControl(props) {
|
|
|
8023
5762
|
})
|
|
8024
5763
|
]
|
|
8025
5764
|
}, i);
|
|
8026
|
-
}) : /* @__PURE__ */
|
|
8027
|
-
/* @__PURE__ */
|
|
5765
|
+
}) : /* @__PURE__ */ jsx4(Fragment2, {}),
|
|
5766
|
+
/* @__PURE__ */ jsx4(Button, {
|
|
8028
5767
|
variant: "default",
|
|
8029
|
-
leftSection: /* @__PURE__ */
|
|
5768
|
+
leftSection: /* @__PURE__ */ jsx4(IconPlus, {
|
|
8030
5769
|
...theme.componentsProps.icons.medium
|
|
8031
5770
|
}),
|
|
8032
5771
|
onClick: () => {
|
|
@@ -8056,7 +5795,7 @@ var ArrayControl_default = ArrayControl;
|
|
|
8056
5795
|
// src/jsonforms/renderers/CheckboxControl.tsx
|
|
8057
5796
|
import { withJsonFormsControlProps as withJsonFormsControlProps4 } from "@jsonforms/react";
|
|
8058
5797
|
import { Checkbox } from "@mantine/core";
|
|
8059
|
-
import { jsx as
|
|
5798
|
+
import { jsx as jsx5, Fragment as Fragment3 } from "react/jsx-runtime";
|
|
8060
5799
|
function PlainCheckboxControl({
|
|
8061
5800
|
data,
|
|
8062
5801
|
handleChange,
|
|
@@ -8066,8 +5805,8 @@ function PlainCheckboxControl({
|
|
|
8066
5805
|
schema
|
|
8067
5806
|
}) {
|
|
8068
5807
|
const { formOptions } = useFormOptions();
|
|
8069
|
-
return /* @__PURE__ */
|
|
8070
|
-
children: /* @__PURE__ */
|
|
5808
|
+
return /* @__PURE__ */ jsx5(Fragment3, {
|
|
5809
|
+
children: /* @__PURE__ */ jsx5(Checkbox, {
|
|
8071
5810
|
label,
|
|
8072
5811
|
py: formOptions.gutter,
|
|
8073
5812
|
labelPosition: "left",
|
|
@@ -8086,7 +5825,7 @@ var CheckboxControl_default = CheckboxControl;
|
|
|
8086
5825
|
// src/jsonforms/renderers/NumberControl.tsx
|
|
8087
5826
|
import { withJsonFormsControlProps as withJsonFormsControlProps5 } from "@jsonforms/react";
|
|
8088
5827
|
import { NumberInput } from "@mantine/core";
|
|
8089
|
-
import { jsx as
|
|
5828
|
+
import { jsx as jsx6, Fragment as Fragment4 } from "react/jsx-runtime";
|
|
8090
5829
|
function PlainNumberControl({
|
|
8091
5830
|
data,
|
|
8092
5831
|
handleChange,
|
|
@@ -8098,8 +5837,8 @@ function PlainNumberControl({
|
|
|
8098
5837
|
const {
|
|
8099
5838
|
formOptions: { withDescriptions }
|
|
8100
5839
|
} = useFormOptions();
|
|
8101
|
-
return /* @__PURE__ */
|
|
8102
|
-
children: /* @__PURE__ */
|
|
5840
|
+
return /* @__PURE__ */ jsx6(Fragment4, {
|
|
5841
|
+
children: /* @__PURE__ */ jsx6(NumberInput, {
|
|
8103
5842
|
label,
|
|
8104
5843
|
variant: "default",
|
|
8105
5844
|
value: data ?? "",
|
|
@@ -8124,20 +5863,21 @@ import {
|
|
|
8124
5863
|
withJsonFormsControlProps as withJsonFormsControlProps6
|
|
8125
5864
|
} from "@jsonforms/react";
|
|
8126
5865
|
import {
|
|
8127
|
-
Box as
|
|
8128
|
-
Flex as
|
|
8129
|
-
Group
|
|
8130
|
-
Input as
|
|
8131
|
-
Paper as
|
|
8132
|
-
Stack as
|
|
5866
|
+
Box as Box2,
|
|
5867
|
+
Flex as Flex2,
|
|
5868
|
+
Group,
|
|
5869
|
+
Input as Input3,
|
|
5870
|
+
Paper as Paper3,
|
|
5871
|
+
Stack as Stack2,
|
|
8133
5872
|
TextInput
|
|
8134
5873
|
} from "@mantine/core";
|
|
8135
5874
|
import {
|
|
8136
5875
|
composePaths
|
|
8137
5876
|
} from "@jsonforms/core";
|
|
8138
|
-
import { useState as
|
|
5877
|
+
import { useState as useState4 } from "react";
|
|
8139
5878
|
import { IconPlus as IconPlus2, IconTrash as IconTrash2 } from "@tabler/icons-react";
|
|
8140
|
-
import {
|
|
5879
|
+
import { RemoraidButton as RemoraidButton2 } from "remoraid/core";
|
|
5880
|
+
import { jsx as jsx7, jsxs as jsxs3, Fragment as Fragment5 } from "react/jsx-runtime";
|
|
8141
5881
|
function PlainObjectControl({
|
|
8142
5882
|
label: labelProp,
|
|
8143
5883
|
schema,
|
|
@@ -8148,7 +5888,7 @@ function PlainObjectControl({
|
|
|
8148
5888
|
}) {
|
|
8149
5889
|
const { formOptions } = useFormOptions();
|
|
8150
5890
|
const { renderers, cells } = useJsonForms3();
|
|
8151
|
-
const [newKey, setNewKey] =
|
|
5891
|
+
const [newKey, setNewKey] = useState4("");
|
|
8152
5892
|
const hasProperties = schema.properties && Object.keys(schema.properties).length > 0;
|
|
8153
5893
|
const hasAdditionalProperties = schema.additionalProperties === true || schema.additionalProperties !== undefined && Object.keys(schema.additionalProperties).length > 0;
|
|
8154
5894
|
const label = labelProp !== "remoraid-array-item" ? labelProp : null;
|
|
@@ -8156,22 +5896,22 @@ function PlainObjectControl({
|
|
|
8156
5896
|
const declaredKeys = new Set(Object.keys(schema.properties ?? {}));
|
|
8157
5897
|
const objectData = data && typeof data === "object" && !Array.isArray(data) ? data : {};
|
|
8158
5898
|
const additionalEntries = Object.entries(objectData).filter(([key]) => !declaredKeys.has(key));
|
|
8159
|
-
return /* @__PURE__ */
|
|
5899
|
+
return /* @__PURE__ */ jsx7(Input3.Wrapper, {
|
|
8160
5900
|
label,
|
|
8161
5901
|
description,
|
|
8162
5902
|
withAsterisk: required,
|
|
8163
|
-
children: /* @__PURE__ */
|
|
5903
|
+
children: /* @__PURE__ */ jsx7(Paper3, {
|
|
8164
5904
|
withBorder: true,
|
|
8165
5905
|
bg: "var(--remoraid-transparent-background)",
|
|
8166
5906
|
shadow: "0",
|
|
8167
5907
|
p: formOptions.gutter,
|
|
8168
5908
|
mt: Boolean(description) ? 4 : 0,
|
|
8169
|
-
children: /* @__PURE__ */
|
|
5909
|
+
children: /* @__PURE__ */ jsxs3(Stack2, {
|
|
8170
5910
|
align: "stretch",
|
|
8171
5911
|
justify: "flex-start",
|
|
8172
5912
|
gap: formOptions.gutter,
|
|
8173
5913
|
children: [
|
|
8174
|
-
hasProperties && /* @__PURE__ */
|
|
5914
|
+
hasProperties && /* @__PURE__ */ jsx7(JsonForms3, {
|
|
8175
5915
|
schema: {
|
|
8176
5916
|
...schema,
|
|
8177
5917
|
$schema: undefined
|
|
@@ -8184,22 +5924,22 @@ function PlainObjectControl({
|
|
|
8184
5924
|
},
|
|
8185
5925
|
validationMode: "NoValidation"
|
|
8186
5926
|
}),
|
|
8187
|
-
hasAdditionalProperties && /* @__PURE__ */
|
|
5927
|
+
hasAdditionalProperties && /* @__PURE__ */ jsxs3(Fragment5, {
|
|
8188
5928
|
children: [
|
|
8189
|
-
additionalEntries.length > 0 && /* @__PURE__ */
|
|
5929
|
+
additionalEntries.length > 0 && /* @__PURE__ */ jsx7(Stack2, {
|
|
8190
5930
|
align: "stretch",
|
|
8191
5931
|
justify: "flex-start",
|
|
8192
5932
|
gap: formOptions.gutter,
|
|
8193
|
-
children: additionalEntries.map(([key, data2]) => /* @__PURE__ */
|
|
5933
|
+
children: additionalEntries.map(([key, data2]) => /* @__PURE__ */ jsxs3(Flex2, {
|
|
8194
5934
|
gap: formOptions.gutter,
|
|
8195
5935
|
justify: "flex-start",
|
|
8196
5936
|
align: "center",
|
|
8197
5937
|
direction: "row",
|
|
8198
5938
|
wrap: "nowrap",
|
|
8199
5939
|
children: [
|
|
8200
|
-
/* @__PURE__ */
|
|
5940
|
+
/* @__PURE__ */ jsx7(Box2, {
|
|
8201
5941
|
flex: 1,
|
|
8202
|
-
children: /* @__PURE__ */
|
|
5942
|
+
children: /* @__PURE__ */ jsx7(JsonForms3, {
|
|
8203
5943
|
schema: {
|
|
8204
5944
|
...schema.additionalProperties === true ? {} : schema.additionalProperties,
|
|
8205
5945
|
title: key,
|
|
@@ -8218,7 +5958,7 @@ function PlainObjectControl({
|
|
|
8218
5958
|
}
|
|
8219
5959
|
})
|
|
8220
5960
|
}),
|
|
8221
|
-
/* @__PURE__ */
|
|
5961
|
+
/* @__PURE__ */ jsx7(RemoraidButton2, {
|
|
8222
5962
|
responsive: false,
|
|
8223
5963
|
collapsed: true,
|
|
8224
5964
|
label: `Delete ${key}`,
|
|
@@ -8236,12 +5976,12 @@ function PlainObjectControl({
|
|
|
8236
5976
|
]
|
|
8237
5977
|
}, key))
|
|
8238
5978
|
}),
|
|
8239
|
-
/* @__PURE__ */
|
|
5979
|
+
/* @__PURE__ */ jsxs3(Group, {
|
|
8240
5980
|
gap: formOptions.gutter,
|
|
8241
5981
|
wrap: "nowrap",
|
|
8242
5982
|
align: "flex-end",
|
|
8243
5983
|
children: [
|
|
8244
|
-
/* @__PURE__ */
|
|
5984
|
+
/* @__PURE__ */ jsx7(TextInput, {
|
|
8245
5985
|
label: "New key",
|
|
8246
5986
|
variant: "default",
|
|
8247
5987
|
value: newKey,
|
|
@@ -8252,7 +5992,7 @@ function PlainObjectControl({
|
|
|
8252
5992
|
description: formOptions.withDescriptions ? "Key for new additional property value" : null,
|
|
8253
5993
|
flex: 1
|
|
8254
5994
|
}),
|
|
8255
|
-
/* @__PURE__ */
|
|
5995
|
+
/* @__PURE__ */ jsx7(RemoraidButton2, {
|
|
8256
5996
|
responsive: false,
|
|
8257
5997
|
collapsed: true,
|
|
8258
5998
|
label: "Add key",
|
|
@@ -8291,8 +6031,8 @@ var ObjectControl_default = ObjectControl;
|
|
|
8291
6031
|
|
|
8292
6032
|
// src/jsonforms/renderers/StringSelectControl.tsx
|
|
8293
6033
|
import { withJsonFormsControlProps as withJsonFormsControlProps7 } from "@jsonforms/react";
|
|
8294
|
-
import { Select as
|
|
8295
|
-
import { jsx as
|
|
6034
|
+
import { Select as Select2 } from "@mantine/core";
|
|
6035
|
+
import { jsx as jsx8, Fragment as Fragment6 } from "react/jsx-runtime";
|
|
8296
6036
|
function PlainTimestampControl({
|
|
8297
6037
|
data,
|
|
8298
6038
|
handleChange,
|
|
@@ -8304,8 +6044,8 @@ function PlainTimestampControl({
|
|
|
8304
6044
|
const {
|
|
8305
6045
|
formOptions: { withDescriptions }
|
|
8306
6046
|
} = useFormOptions();
|
|
8307
|
-
return /* @__PURE__ */
|
|
8308
|
-
children: /* @__PURE__ */
|
|
6047
|
+
return /* @__PURE__ */ jsx8(Fragment6, {
|
|
6048
|
+
children: /* @__PURE__ */ jsx8(Select2, {
|
|
8309
6049
|
label,
|
|
8310
6050
|
data: schema.enum,
|
|
8311
6051
|
value: data,
|
|
@@ -8441,7 +6181,7 @@ var verticalLayoutTester_default = tester9;
|
|
|
8441
6181
|
// src/jsonforms/renderers/TextControl.tsx
|
|
8442
6182
|
import { withJsonFormsControlProps as withJsonFormsControlProps8 } from "@jsonforms/react";
|
|
8443
6183
|
import { TextInput as TextInput2 } from "@mantine/core";
|
|
8444
|
-
import { jsx as
|
|
6184
|
+
import { jsx as jsx9, Fragment as Fragment7 } from "react/jsx-runtime";
|
|
8445
6185
|
function PlainTextControl({
|
|
8446
6186
|
data,
|
|
8447
6187
|
handleChange,
|
|
@@ -8453,8 +6193,8 @@ function PlainTextControl({
|
|
|
8453
6193
|
const {
|
|
8454
6194
|
formOptions: { withDescriptions }
|
|
8455
6195
|
} = useFormOptions();
|
|
8456
|
-
return /* @__PURE__ */
|
|
8457
|
-
children: /* @__PURE__ */
|
|
6196
|
+
return /* @__PURE__ */ jsx9(Fragment7, {
|
|
6197
|
+
children: /* @__PURE__ */ jsx9(TextInput2, {
|
|
8458
6198
|
label,
|
|
8459
6199
|
variant: "default",
|
|
8460
6200
|
placeholder: "",
|
|
@@ -8474,7 +6214,7 @@ var TextControl_default = TextControl;
|
|
|
8474
6214
|
import { withJsonFormsControlProps as withJsonFormsControlProps9 } from "@jsonforms/react";
|
|
8475
6215
|
import { DateTimePicker, toDateTimeString } from "@mantine/dates";
|
|
8476
6216
|
import dayjs from "dayjs";
|
|
8477
|
-
import { jsx as
|
|
6217
|
+
import { jsx as jsx10, Fragment as Fragment8 } from "react/jsx-runtime";
|
|
8478
6218
|
function PlainTimestampControl2({
|
|
8479
6219
|
data,
|
|
8480
6220
|
handleChange,
|
|
@@ -8486,8 +6226,8 @@ function PlainTimestampControl2({
|
|
|
8486
6226
|
const {
|
|
8487
6227
|
formOptions: { withDescriptions }
|
|
8488
6228
|
} = useFormOptions();
|
|
8489
|
-
return /* @__PURE__ */
|
|
8490
|
-
children: /* @__PURE__ */
|
|
6229
|
+
return /* @__PURE__ */ jsx10(Fragment8, {
|
|
6230
|
+
children: /* @__PURE__ */ jsx10(DateTimePicker, {
|
|
8491
6231
|
variant: "default",
|
|
8492
6232
|
label,
|
|
8493
6233
|
placeholder: "Pick date and time",
|
|
@@ -8505,17 +6245,17 @@ var TimestampControl2 = withJsonFormsControlProps9(PlainTimestampControl2);
|
|
|
8505
6245
|
var TimestampControl_default = TimestampControl2;
|
|
8506
6246
|
|
|
8507
6247
|
// src/jsonforms/renderers/VerticalLayout.tsx
|
|
8508
|
-
import
|
|
6248
|
+
import React2 from "react";
|
|
8509
6249
|
import { withJsonFormsLayoutProps } from "@jsonforms/react";
|
|
8510
6250
|
import { JsonFormsDispatch, useJsonForms as useJsonForms4 } from "@jsonforms/react";
|
|
8511
|
-
import { jsx as
|
|
6251
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
8512
6252
|
"use client";
|
|
8513
6253
|
var JsonFormsLayout = ({
|
|
8514
6254
|
className,
|
|
8515
6255
|
children,
|
|
8516
6256
|
visible
|
|
8517
6257
|
}) => {
|
|
8518
|
-
return /* @__PURE__ */
|
|
6258
|
+
return /* @__PURE__ */ jsx11("div", {
|
|
8519
6259
|
className,
|
|
8520
6260
|
hidden: visible === undefined || visible === null ? false : !visible,
|
|
8521
6261
|
children
|
|
@@ -8526,10 +6266,10 @@ var renderChildren = (layout, schema, className, path, enabled) => {
|
|
|
8526
6266
|
const { formOptions } = useFormOptions();
|
|
8527
6267
|
const gutter = typeof formOptions.gutter === "string" ? `var(--mantine-spacing-${formOptions.gutter})` : `${formOptions.gutter}px`;
|
|
8528
6268
|
return layout.elements.map((child, index) => {
|
|
8529
|
-
return /* @__PURE__ */
|
|
6269
|
+
return /* @__PURE__ */ jsx11("div", {
|
|
8530
6270
|
className,
|
|
8531
6271
|
style: { marginTop: index === 0 ? 0 : gutter },
|
|
8532
|
-
children: /* @__PURE__ */
|
|
6272
|
+
children: /* @__PURE__ */ jsx11(JsonFormsDispatch, {
|
|
8533
6273
|
renderers,
|
|
8534
6274
|
cells,
|
|
8535
6275
|
uischema: child,
|
|
@@ -8542,11 +6282,11 @@ var renderChildren = (layout, schema, className, path, enabled) => {
|
|
|
8542
6282
|
};
|
|
8543
6283
|
var VerticalLayoutRenderer = (props) => {
|
|
8544
6284
|
const { data: _data, ...otherProps } = props;
|
|
8545
|
-
return /* @__PURE__ */
|
|
6285
|
+
return /* @__PURE__ */ jsx11(VerticalLayoutRendererComponent, {
|
|
8546
6286
|
...otherProps
|
|
8547
6287
|
});
|
|
8548
6288
|
};
|
|
8549
|
-
var VerticalLayoutRendererComponent =
|
|
6289
|
+
var VerticalLayoutRendererComponent = React2.memo(function VerticalLayoutRendererComponent2({
|
|
8550
6290
|
schema,
|
|
8551
6291
|
uischema,
|
|
8552
6292
|
path,
|
|
@@ -8556,7 +6296,7 @@ var VerticalLayoutRendererComponent = React12.memo(function VerticalLayoutRender
|
|
|
8556
6296
|
const verticalLayout = uischema;
|
|
8557
6297
|
const layoutClassName = "";
|
|
8558
6298
|
const childClassNames = "";
|
|
8559
|
-
return /* @__PURE__ */
|
|
6299
|
+
return /* @__PURE__ */ jsx11(JsonFormsLayout, {
|
|
8560
6300
|
className: layoutClassName,
|
|
8561
6301
|
uischema,
|
|
8562
6302
|
schema,
|