remoraid 2.45.0 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -3
- package/dist/core/index.cjs +113 -67
- package/dist/core/index.d.ts +19 -17
- package/dist/core/index.js +127 -79
- package/dist/core/styles.css +73 -16
- package/dist/data-visualization/index.cjs +6546 -0
- package/dist/data-visualization/index.d.ts +529 -0
- package/dist/data-visualization/index.js +6584 -0
- package/dist/jsonforms/index.cjs +155 -2287
- package/dist/jsonforms/index.js +104 -2352
- package/package.json +54 -24
package/dist/jsonforms/index.cjs
CHANGED
|
@@ -4094,7 +4094,7 @@ var require_lodash = __commonJS((exports2, module2) => {
|
|
|
4094
4094
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
4095
4095
|
return baseIsMatch(object, source, getMatchData(source), customizer);
|
|
4096
4096
|
}
|
|
4097
|
-
function
|
|
4097
|
+
function isNaN(value) {
|
|
4098
4098
|
return isNumber(value) && value != +value;
|
|
4099
4099
|
}
|
|
4100
4100
|
function isNative(value) {
|
|
@@ -5184,7 +5184,7 @@ __p += '`;
|
|
|
5184
5184
|
lodash.isMap = isMap;
|
|
5185
5185
|
lodash.isMatch = isMatch;
|
|
5186
5186
|
lodash.isMatchWith = isMatchWith;
|
|
5187
|
-
lodash.isNaN =
|
|
5187
|
+
lodash.isNaN = isNaN;
|
|
5188
5188
|
lodash.isNative = isNative;
|
|
5189
5189
|
lodash.isNil = isNil;
|
|
5190
5190
|
lodash.isNull = isNull;
|
|
@@ -5471,2176 +5471,43 @@ __export(exports_jsonforms, {
|
|
|
5471
5471
|
});
|
|
5472
5472
|
module.exports = __toCommonJS(exports_jsonforms);
|
|
5473
5473
|
|
|
5474
|
-
// src/
|
|
5475
|
-
var
|
|
5476
|
-
var
|
|
5477
|
-
var jsx_runtime = require("react/jsx-runtime");
|
|
5478
|
-
var widgetsContext = import_react.default.createContext({
|
|
5479
|
-
widgets: {},
|
|
5480
|
-
activeWidget: null,
|
|
5481
|
-
updateActiveWidget: () => {},
|
|
5482
|
-
registerWidget: () => {},
|
|
5483
|
-
registerPage: () => {},
|
|
5484
|
-
isWidgetRegistered: () => false,
|
|
5485
|
-
isPageRegistered: () => false,
|
|
5486
|
-
updateWidgetSelection: () => {},
|
|
5487
|
-
updateWidgetSelectionBulk: () => {},
|
|
5488
|
-
isWidgetSelected: () => false,
|
|
5489
|
-
hideWidget: () => {}
|
|
5490
|
-
});
|
|
5491
|
-
var useWidgets = () => {
|
|
5492
|
-
return import_react.useContext(widgetsContext);
|
|
5493
|
-
};
|
|
5494
|
-
|
|
5495
|
-
// src/core/lib/utils.ts
|
|
5496
|
-
var import_react2 = require("react");
|
|
5497
|
-
var co = (condition, value, fallback) => condition(value) ? value : fallback;
|
|
5498
|
-
var isValidElementOfType = (type, value) => {
|
|
5499
|
-
return import_react2.isValidElement(value) && value.type === type;
|
|
5500
|
-
};
|
|
5501
|
-
var getElementTypeName = (type) => {
|
|
5502
|
-
if (typeof type === "string") {
|
|
5503
|
-
return type;
|
|
5504
|
-
}
|
|
5505
|
-
if (typeof type === "function") {
|
|
5506
|
-
return type.displayName ?? type.name ?? "anonymous component";
|
|
5507
|
-
}
|
|
5508
|
-
return "unknown";
|
|
5509
|
-
};
|
|
5510
|
-
var asElementOfType = (type, element, additionalErrorMessage) => {
|
|
5511
|
-
if (isValidElementOfType(type, element)) {
|
|
5512
|
-
return element;
|
|
5513
|
-
}
|
|
5514
|
-
throw new TypeError(`Expected React element of type ${getElementTypeName(type)}, but received type: ${getElementTypeName(element.type)}.${additionalErrorMessage !== undefined && additionalErrorMessage.length > 0 ? ` ${additionalErrorMessage}` : ""}`);
|
|
5515
|
-
};
|
|
5516
|
-
var asChildrenOfType = (type, children, additionalErrorMessage) => {
|
|
5517
|
-
if (children === undefined || children === null) {
|
|
5518
|
-
return children;
|
|
5519
|
-
}
|
|
5520
|
-
if (Array.isArray(children)) {
|
|
5521
|
-
return children.map((child) => asChildrenOfType(type, child, additionalErrorMessage));
|
|
5522
|
-
}
|
|
5523
|
-
return asElementOfType(type, children, additionalErrorMessage);
|
|
5524
|
-
};
|
|
5525
|
-
var asElementOrPropsOfType = (type, elementOrProps, additionalErrorMessage) => {
|
|
5526
|
-
if (import_react2.isValidElement(elementOrProps)) {
|
|
5527
|
-
return asElementOfType(type, elementOrProps, additionalErrorMessage);
|
|
5528
|
-
}
|
|
5529
|
-
return elementOrProps;
|
|
5530
|
-
};
|
|
5531
|
-
var getDefaultButtonIconSize = (buttonSize) => {
|
|
5532
|
-
if (buttonSize === "xs") {
|
|
5533
|
-
return "extraSmall" /* ExtraSmall */;
|
|
5534
|
-
}
|
|
5535
|
-
if (buttonSize === "sm") {
|
|
5536
|
-
return "small" /* Small */;
|
|
5537
|
-
}
|
|
5538
|
-
if (buttonSize === "md") {
|
|
5539
|
-
return "medium" /* Medium */;
|
|
5540
|
-
}
|
|
5541
|
-
if (buttonSize === "lg") {
|
|
5542
|
-
return "large" /* Large */;
|
|
5543
|
-
}
|
|
5544
|
-
return "large" /* Large */;
|
|
5545
|
-
};
|
|
5546
|
-
|
|
5547
|
-
// src/core/components/RemoraidProvider/ThemeProvider/index.tsx
|
|
5474
|
+
// src/jsonforms/renderers/AnyControl.tsx
|
|
5475
|
+
var import_core = require("remoraid/core");
|
|
5476
|
+
var import_react2 = require("@jsonforms/react");
|
|
5548
5477
|
var import_core2 = require("@mantine/core");
|
|
5549
|
-
var import_icons_react = require("@tabler/icons-react");
|
|
5550
|
-
var import_react4 = __toESM(require("react"));
|
|
5551
|
-
|
|
5552
|
-
// src/core/components/RemoraidProvider/HydrationStatusProvider/index.tsx
|
|
5553
|
-
var import_core = require("@mantine/core");
|
|
5554
5478
|
var import_react3 = require("react");
|
|
5555
|
-
var jsx_runtime2 = require("react/jsx-runtime");
|
|
5556
|
-
var defaultHydrationStatus = {
|
|
5557
|
-
hasHydrated: false,
|
|
5558
|
-
ensureHydration: () => {
|
|
5559
|
-
return;
|
|
5560
|
-
}
|
|
5561
|
-
};
|
|
5562
|
-
var hydrationStatusContext = import_react3.createContext(defaultHydrationStatus);
|
|
5563
|
-
var useHydrationStatus = () => {
|
|
5564
|
-
return import_react3.useContext(hydrationStatusContext);
|
|
5565
|
-
};
|
|
5566
|
-
var useHydratedMantineColorScheme = () => {
|
|
5567
|
-
const { ensureHydration } = useHydrationStatus();
|
|
5568
|
-
return ensureHydration(import_core.useMantineColorScheme()) ?? {};
|
|
5569
|
-
};
|
|
5570
|
-
|
|
5571
|
-
// src/core/components/RemoraidProvider/ThemeProvider/index.tsx
|
|
5572
|
-
var import_lodash2 = __toESM(require_lodash());
|
|
5573
|
-
var jsx_runtime3 = require("react/jsx-runtime");
|
|
5574
|
-
var defaultTransitionDurations = {
|
|
5575
|
-
["short" /* Short */]: 200,
|
|
5576
|
-
["medium" /* Medium */]: 350,
|
|
5577
|
-
["long" /* Long */]: 500
|
|
5578
|
-
};
|
|
5579
|
-
var createRemoraidTheme = (customTheme, dependencies) => {
|
|
5580
|
-
const { mantineTheme, colorScheme } = dependencies ?? {};
|
|
5581
|
-
const transitionDurations = import_lodash2.merge(defaultTransitionDurations, customTheme?.transitionDurations);
|
|
5582
|
-
const transparentBackground = customTheme?.transparentBackground ?? (mantineTheme && colorScheme ? colorScheme === "dark" ? import_core2.rgba(mantineTheme.colors.dark[8], 0.8) : import_core2.rgba(mantineTheme.white, 0.8) : undefined);
|
|
5583
|
-
let spacingPx;
|
|
5584
|
-
if (mantineTheme && colorScheme) {
|
|
5585
|
-
spacingPx = {
|
|
5586
|
-
xs: Number(co((v) => !Number.isNaN(v), Number(import_core2.px(mantineTheme.spacing.xs)), 0)),
|
|
5587
|
-
sm: Number(co((v) => !Number.isNaN(v), Number(import_core2.px(mantineTheme.spacing.sm)), 0)),
|
|
5588
|
-
md: Number(co((v) => !Number.isNaN(v), Number(import_core2.px(mantineTheme.spacing.md)), 0)),
|
|
5589
|
-
lg: Number(co((v) => !Number.isNaN(v), Number(import_core2.px(mantineTheme.spacing.lg)), 0)),
|
|
5590
|
-
xl: Number(co((v) => !Number.isNaN(v), Number(import_core2.px(mantineTheme.spacing.xl)), 0))
|
|
5591
|
-
};
|
|
5592
|
-
}
|
|
5593
|
-
const defaultTheme = {
|
|
5594
|
-
bodyColor: "light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-9))",
|
|
5595
|
-
containerSize: 1300,
|
|
5596
|
-
jsonStringifySpace: 2,
|
|
5597
|
-
transparentBackground,
|
|
5598
|
-
spacingPx,
|
|
5599
|
-
transitionDurations,
|
|
5600
|
-
breakpoints: {
|
|
5601
|
-
["buttonCollapse" /* ButtonCollapse */]: "md",
|
|
5602
|
-
["badgeGroupCollapse" /* BadgeGroupCollapse */]: "md",
|
|
5603
|
-
["navbarStaticElementsCollapse" /* NavbarStaticElementsCollapse */]: "xs"
|
|
5604
|
-
},
|
|
5605
|
-
primaryGutter: "md",
|
|
5606
|
-
componentsProps: {
|
|
5607
|
-
alerts: {
|
|
5608
|
-
["negative" /* Negative */]: {
|
|
5609
|
-
icon: import_icons_react.IconAlertCircle,
|
|
5610
|
-
color: "red",
|
|
5611
|
-
title: "Attention!"
|
|
5612
|
-
},
|
|
5613
|
-
["neutral" /* Neutral */]: {
|
|
5614
|
-
icon: import_icons_react.IconInfoCircle,
|
|
5615
|
-
color: mantineTheme?.primaryColor,
|
|
5616
|
-
title: "Information"
|
|
5617
|
-
},
|
|
5618
|
-
["positive" /* Positive */]: {
|
|
5619
|
-
icon: import_icons_react.IconCircleCheck,
|
|
5620
|
-
color: "green",
|
|
5621
|
-
title: "Success"
|
|
5622
|
-
}
|
|
5623
|
-
},
|
|
5624
|
-
icons: {
|
|
5625
|
-
["tiny" /* Tiny */]: { size: 12, stroke: 2.6 },
|
|
5626
|
-
["extraSmall" /* ExtraSmall */]: { size: 16, stroke: 2.3 },
|
|
5627
|
-
["small" /* Small */]: { size: 20, stroke: 2 },
|
|
5628
|
-
["medium" /* Medium */]: { size: 24, stroke: 1.7 },
|
|
5629
|
-
["large" /* Large */]: { size: 28, stroke: 1.7 },
|
|
5630
|
-
["huge" /* Huge */]: { size: 44, stroke: 1.7 }
|
|
5631
|
-
}
|
|
5632
|
-
}
|
|
5633
|
-
};
|
|
5634
|
-
return import_lodash2.merge(defaultTheme, customTheme);
|
|
5635
|
-
};
|
|
5636
|
-
var themeContext = import_react4.default.createContext(createRemoraidTheme());
|
|
5637
|
-
var useRemoraidTheme = () => {
|
|
5638
|
-
return import_react4.useContext(themeContext);
|
|
5639
|
-
};
|
|
5640
|
-
|
|
5641
|
-
// src/core/components/RemoraidProvider/index.tsx
|
|
5642
|
-
var import_react_cookie2 = require("react-cookie");
|
|
5643
|
-
|
|
5644
|
-
// src/core/components/RemoraidProvider/CoreUserExperienceProvider/index.tsx
|
|
5645
|
-
var import_react6 = require("react");
|
|
5646
|
-
|
|
5647
|
-
// src/core/components/UserExperienceProviderWrapper/index.tsx
|
|
5648
|
-
var import_lodash3 = __toESM(require_lodash());
|
|
5649
|
-
var import_react5 = require("react");
|
|
5650
|
-
var import_react_cookie = require("react-cookie");
|
|
5651
|
-
var jsx_runtime4 = require("react/jsx-runtime");
|
|
5652
|
-
var createUserExperienceContext = (defaultUserExperience) => import_react5.createContext({
|
|
5653
|
-
userExperience: defaultUserExperience,
|
|
5654
|
-
updateUserExperience: () => {},
|
|
5655
|
-
processedCookie: false,
|
|
5656
|
-
initialUserExperience: defaultUserExperience
|
|
5657
|
-
});
|
|
5658
|
-
function UserExperienceProviderWrapper({
|
|
5659
|
-
children,
|
|
5660
|
-
context,
|
|
5661
|
-
cookieName,
|
|
5662
|
-
defaultUserExperience,
|
|
5663
|
-
isValidUserExperience,
|
|
5664
|
-
initialValue
|
|
5665
|
-
}) {
|
|
5666
|
-
const [cookies, setCookie] = import_react_cookie.useCookies();
|
|
5667
|
-
const initialUserExperience = import_lodash3.mergeWith({}, defaultUserExperience, initialValue, (_objValue, srcValue) => {
|
|
5668
|
-
if (Array.isArray(srcValue)) {
|
|
5669
|
-
return [...srcValue];
|
|
5670
|
-
}
|
|
5671
|
-
return;
|
|
5672
|
-
});
|
|
5673
|
-
const [userExperience, setUserExperience] = import_react5.useState(initialUserExperience);
|
|
5674
|
-
const [processedCookie, setProcessedCookie] = import_react5.useState(false);
|
|
5675
|
-
const updateUserExperience = (p) => {
|
|
5676
|
-
const updatedUserExperience = typeof p === "function" ? p(userExperience) : p;
|
|
5677
|
-
setCookie(cookieName, updatedUserExperience, { path: "/" });
|
|
5678
|
-
setUserExperience(updatedUserExperience);
|
|
5679
|
-
};
|
|
5680
|
-
import_react5.useEffect(() => {
|
|
5681
|
-
const userExperienceCookie = cookies[cookieName];
|
|
5682
|
-
if (userExperienceCookie && isValidUserExperience(userExperienceCookie)) {
|
|
5683
|
-
setUserExperience(userExperienceCookie);
|
|
5684
|
-
}
|
|
5685
|
-
if (cookies && !processedCookie) {
|
|
5686
|
-
setProcessedCookie(true);
|
|
5687
|
-
}
|
|
5688
|
-
}, [cookies]);
|
|
5689
|
-
return /* @__PURE__ */ jsx_runtime4.jsx(context.Provider, {
|
|
5690
|
-
value: {
|
|
5691
|
-
userExperience,
|
|
5692
|
-
updateUserExperience,
|
|
5693
|
-
processedCookie,
|
|
5694
|
-
initialUserExperience
|
|
5695
|
-
},
|
|
5696
|
-
children
|
|
5697
|
-
});
|
|
5698
|
-
}
|
|
5699
|
-
|
|
5700
|
-
// src/core/components/RemoraidProvider/CoreUserExperienceProvider/index.tsx
|
|
5701
|
-
var jsx_runtime5 = require("react/jsx-runtime");
|
|
5702
|
-
var defaultUserExperience = {
|
|
5703
|
-
showWelcomeMessage: true,
|
|
5704
|
-
navbar: { hiddenPages: [], mode: "responsive" /* Responsive */ }
|
|
5705
|
-
};
|
|
5706
|
-
var coreUserExperienceContext = createUserExperienceContext(defaultUserExperience);
|
|
5707
|
-
|
|
5708
|
-
// src/core/components/RemoraidProvider/LayoutsProvider/index.tsx
|
|
5709
|
-
var import_react7 = require("react");
|
|
5710
|
-
var jsx_runtime6 = require("react/jsx-runtime");
|
|
5711
|
-
var defaultLayoutsContext = {
|
|
5712
|
-
layouts: {},
|
|
5713
|
-
setLayouts: () => {}
|
|
5714
|
-
};
|
|
5715
|
-
var layoutsContext = import_react7.createContext(defaultLayoutsContext);
|
|
5716
|
-
var useLayouts = () => {
|
|
5717
|
-
return import_react7.useContext(layoutsContext);
|
|
5718
|
-
};
|
|
5719
|
-
|
|
5720
|
-
// src/core/components/RemoraidProvider/RouterProvider/index.tsx
|
|
5721
|
-
var import_react8 = require("react");
|
|
5722
|
-
var jsx_runtime7 = require("react/jsx-runtime");
|
|
5723
|
-
var defaultRouter = {
|
|
5724
|
-
pathname: "/",
|
|
5725
|
-
push: () => {}
|
|
5726
|
-
};
|
|
5727
|
-
var routerContext = import_react8.createContext(defaultRouter);
|
|
5728
|
-
var useRemoraidRouter = () => {
|
|
5729
|
-
return import_react8.useContext(routerContext);
|
|
5730
|
-
};
|
|
5731
|
-
|
|
5732
|
-
// src/core/components/RemoraidProvider/index.tsx
|
|
5733
|
-
var jsx_runtime8 = require("react/jsx-runtime");
|
|
5734
|
-
// src/core/components/AppShell/index.tsx
|
|
5735
|
-
var import_core13 = require("@mantine/core");
|
|
5736
|
-
var import_react18 = require("react");
|
|
5737
|
-
|
|
5738
|
-
// src/core/components/AppShell/AppProvider/index.tsx
|
|
5739
|
-
var import_react9 = require("react");
|
|
5740
|
-
var import_lodash4 = __toESM(require_lodash());
|
|
5741
|
-
var jsx_runtime9 = require("react/jsx-runtime");
|
|
5742
|
-
var defaultAppContext = {
|
|
5743
|
-
name: "Hello, World!",
|
|
5744
|
-
nav: [],
|
|
5745
|
-
navbarVariant: "minimal" /* Minimal */,
|
|
5746
|
-
footerVariant: "minimal" /* Minimal */,
|
|
5747
|
-
navbarMobileVariant: null
|
|
5748
|
-
};
|
|
5749
|
-
var appContext = import_react9.createContext(defaultAppContext);
|
|
5750
|
-
var useRemoraidApp = () => {
|
|
5751
|
-
return import_react9.useContext(appContext);
|
|
5752
|
-
};
|
|
5753
|
-
function AppProvider({
|
|
5754
|
-
appContext: appContextProp,
|
|
5755
|
-
children
|
|
5756
|
-
}) {
|
|
5757
|
-
const { logo, ...appContextPropWithoutLogo } = appContextProp;
|
|
5758
|
-
return /* @__PURE__ */ jsx_runtime9.jsx(appContext.Provider, {
|
|
5759
|
-
value: { ...import_lodash4.merge(defaultAppContext, appContextPropWithoutLogo), logo },
|
|
5760
|
-
children
|
|
5761
|
-
});
|
|
5762
|
-
}
|
|
5763
|
-
|
|
5764
|
-
// src/core/components/AppShell/index.tsx
|
|
5765
|
-
var import_lodash13 = __toESM(require_lodash());
|
|
5766
|
-
|
|
5767
|
-
// src/core/components/AppShell/AppShellUserExperienceProvider/index.tsx
|
|
5768
|
-
var import_react17 = require("react");
|
|
5769
|
-
var import_lodash12 = __toESM(require_lodash());
|
|
5770
|
-
|
|
5771
|
-
// src/core/components/AppShell/Footer/FooterMinimal/index.tsx
|
|
5772
|
-
var import_core6 = require("@mantine/core");
|
|
5773
|
-
var import_icons_react2 = require("@tabler/icons-react");
|
|
5774
|
-
var import_lodash6 = __toESM(require_lodash());
|
|
5775
|
-
|
|
5776
|
-
// src/core/components/Page/PageContainer/index.tsx
|
|
5777
|
-
var import_core3 = require("@mantine/core");
|
|
5778
|
-
|
|
5779
|
-
// node_modules/clsx/dist/clsx.mjs
|
|
5780
|
-
function r(e) {
|
|
5781
|
-
var t, f, n = "";
|
|
5782
|
-
if (typeof e == "string" || typeof e == "number")
|
|
5783
|
-
n += e;
|
|
5784
|
-
else if (typeof e == "object")
|
|
5785
|
-
if (Array.isArray(e)) {
|
|
5786
|
-
var o = e.length;
|
|
5787
|
-
for (t = 0;t < o; t++)
|
|
5788
|
-
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
5789
|
-
} else
|
|
5790
|
-
for (f in e)
|
|
5791
|
-
e[f] && (n && (n += " "), n += f);
|
|
5792
|
-
return n;
|
|
5793
|
-
}
|
|
5794
|
-
function clsx() {
|
|
5795
|
-
for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
|
|
5796
|
-
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
5797
|
-
return n;
|
|
5798
|
-
}
|
|
5799
|
-
var clsx_default = clsx;
|
|
5800
|
-
|
|
5801
|
-
// src/core/components/Page/PageContainer/index.tsx
|
|
5802
|
-
var jsx_runtime10 = require("react/jsx-runtime");
|
|
5803
|
-
function PageContainer({
|
|
5804
|
-
children,
|
|
5805
|
-
p = 0,
|
|
5806
|
-
hidden = false,
|
|
5807
|
-
componentsProps
|
|
5808
|
-
}) {
|
|
5809
|
-
const theme = useRemoraidTheme();
|
|
5810
|
-
return /* @__PURE__ */ jsx_runtime10.jsx(import_core3.Container, {
|
|
5811
|
-
size: theme.containerSize,
|
|
5812
|
-
p,
|
|
5813
|
-
w: "100%",
|
|
5814
|
-
"data-hidden": hidden,
|
|
5815
|
-
...componentsProps?.container,
|
|
5816
|
-
className: clsx_default("remoraid-page-container", componentsProps?.container?.className),
|
|
5817
|
-
children
|
|
5818
|
-
});
|
|
5819
|
-
}
|
|
5820
|
-
|
|
5821
|
-
// src/core/components/FrameLayout/index.tsx
|
|
5822
|
-
var import_core5 = require("@mantine/core");
|
|
5823
|
-
var import_react11 = require("react");
|
|
5824
|
-
|
|
5825
|
-
// src/core/components/FrameLayout/Element/index.tsx
|
|
5826
|
-
var import_react10 = require("react");
|
|
5827
|
-
var import_core4 = require("@mantine/core");
|
|
5828
|
-
|
|
5829
|
-
// src/core/lib/errors.ts
|
|
5830
|
-
class InvalidComponentUsageError extends Error {
|
|
5831
|
-
constructor(component, rule) {
|
|
5832
|
-
super(`Invalid usage of '${component}': ${rule}`);
|
|
5833
|
-
this.name = "InvalidComponentUsageError";
|
|
5834
|
-
}
|
|
5835
|
-
}
|
|
5836
|
-
|
|
5837
|
-
// src/core/components/FrameLayout/Element/index.tsx
|
|
5838
|
-
var import_lodash5 = __toESM(require_lodash());
|
|
5839
|
-
var jsx_runtime11 = require("react/jsx-runtime");
|
|
5840
|
-
var layoutElementContext = import_react10.createContext(null);
|
|
5841
|
-
var useFrameLayoutElement = () => {
|
|
5842
|
-
return import_react10.useContext(layoutElementContext);
|
|
5843
|
-
};
|
|
5844
|
-
function Element2({
|
|
5845
|
-
section,
|
|
5846
|
-
includeContainer = true,
|
|
5847
|
-
includePageContainer = false,
|
|
5848
|
-
layoutId,
|
|
5849
|
-
hidden = false,
|
|
5850
|
-
componentsProps,
|
|
5851
|
-
children
|
|
5852
|
-
}) {
|
|
5853
|
-
const { layouts } = useLayouts();
|
|
5854
|
-
const closestLayout = useFrameLayout();
|
|
5855
|
-
if (!closestLayout) {
|
|
5856
|
-
throw new InvalidComponentUsageError("FrameLayout.Element", "must be used as child of 'FrameLayout'.");
|
|
5857
|
-
}
|
|
5858
|
-
const layout = layouts[layoutId ?? closestLayout.layoutId];
|
|
5859
|
-
if (!layout) {
|
|
5860
|
-
return null;
|
|
5861
|
-
}
|
|
5862
|
-
if (layout.type !== "frame" /* Frame */) {
|
|
5863
|
-
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.");
|
|
5864
|
-
}
|
|
5865
|
-
if (!layout.sections[section]) {
|
|
5866
|
-
return null;
|
|
5867
|
-
}
|
|
5868
|
-
let containerProps = {};
|
|
5869
|
-
if (section === "left" /* Left */ || section === "right" /* Right */) {
|
|
5870
|
-
containerProps.h = "100%";
|
|
5871
|
-
}
|
|
5872
|
-
const element = includePageContainer ? /* @__PURE__ */ jsx_runtime11.jsx(PageContainer, {
|
|
5873
|
-
p: 0,
|
|
5874
|
-
hidden,
|
|
5875
|
-
...componentsProps?.PageContainer,
|
|
5876
|
-
children
|
|
5877
|
-
}) : children;
|
|
5878
|
-
return /* @__PURE__ */ jsx_runtime11.jsx(import_core4.Portal, {
|
|
5879
|
-
target: layout.sections[section],
|
|
5880
|
-
children: /* @__PURE__ */ jsx_runtime11.jsx(layoutElementContext.Provider, {
|
|
5881
|
-
value: { layoutType: "frame" /* Frame */, section },
|
|
5882
|
-
children: includeContainer ? /* @__PURE__ */ jsx_runtime11.jsx(import_core4.Box, {
|
|
5883
|
-
"data-hidden": hidden,
|
|
5884
|
-
...import_lodash5.merge(containerProps, componentsProps?.container),
|
|
5885
|
-
className: clsx_default("remoraid-frame-layout-element", containerProps?.className, componentsProps?.container?.className),
|
|
5886
|
-
children: element
|
|
5887
|
-
}) : element
|
|
5888
|
-
})
|
|
5889
|
-
});
|
|
5890
|
-
}
|
|
5891
|
-
|
|
5892
|
-
// src/core/components/FrameLayout/index.tsx
|
|
5893
|
-
var jsx_runtime12 = require("react/jsx-runtime");
|
|
5894
|
-
var layoutContext = import_react11.createContext(null);
|
|
5895
|
-
var useFrameLayout = () => {
|
|
5896
|
-
return import_react11.useContext(layoutContext);
|
|
5897
|
-
};
|
|
5898
|
-
function FrameLayout({
|
|
5899
|
-
layoutId,
|
|
5900
|
-
includeScrollArea = true,
|
|
5901
|
-
gutter = 0,
|
|
5902
|
-
componentsProps,
|
|
5903
|
-
children
|
|
5904
|
-
}) {
|
|
5905
|
-
const { layouts, setLayouts } = useLayouts();
|
|
5906
|
-
const layout = layouts[layoutId];
|
|
5907
|
-
const defaultSections = import_react11.useMemo(() => ({
|
|
5908
|
-
["bottom" /* Bottom */]: null,
|
|
5909
|
-
["right" /* Right */]: null,
|
|
5910
|
-
["top" /* Top */]: null,
|
|
5911
|
-
["left" /* Left */]: null,
|
|
5912
|
-
["content" /* Content */]: null
|
|
5913
|
-
}), []);
|
|
5914
|
-
const setSections = import_react11.useCallback((value) => {
|
|
5915
|
-
setLayouts((prev) => ({
|
|
5916
|
-
...prev,
|
|
5917
|
-
[layoutId]: {
|
|
5918
|
-
type: "frame" /* Frame */,
|
|
5919
|
-
sections: typeof value === "function" ? value(prev[layoutId]?.sections ?? defaultSections) : value
|
|
5920
|
-
}
|
|
5921
|
-
}));
|
|
5922
|
-
}, [layoutId, setLayouts, defaultSections]);
|
|
5923
|
-
const topSectionRef = import_react11.useCallback((n) => {
|
|
5924
|
-
setSections((prev) => ({
|
|
5925
|
-
...prev,
|
|
5926
|
-
["top" /* Top */]: n
|
|
5927
|
-
}));
|
|
5928
|
-
}, [setSections]);
|
|
5929
|
-
const bottomSectionRef = import_react11.useCallback((n) => {
|
|
5930
|
-
setSections((prev) => ({
|
|
5931
|
-
...prev,
|
|
5932
|
-
["bottom" /* Bottom */]: n
|
|
5933
|
-
}));
|
|
5934
|
-
}, [setSections]);
|
|
5935
|
-
const leftSectionRef = import_react11.useCallback((n) => {
|
|
5936
|
-
setSections((prev) => ({
|
|
5937
|
-
...prev,
|
|
5938
|
-
["left" /* Left */]: n
|
|
5939
|
-
}));
|
|
5940
|
-
}, [setSections]);
|
|
5941
|
-
const rightSectionRef = import_react11.useCallback((n) => {
|
|
5942
|
-
setSections((prev) => ({
|
|
5943
|
-
...prev,
|
|
5944
|
-
["right" /* Right */]: n
|
|
5945
|
-
}));
|
|
5946
|
-
}, [setSections]);
|
|
5947
|
-
const contentSectionRef = import_react11.useCallback((n) => {
|
|
5948
|
-
setSections((prev) => ({
|
|
5949
|
-
...prev,
|
|
5950
|
-
["content" /* Content */]: n
|
|
5951
|
-
}));
|
|
5952
|
-
}, [setSections]);
|
|
5953
|
-
const contentSection = /* @__PURE__ */ jsx_runtime12.jsx(import_core5.Stack, {
|
|
5954
|
-
ref: contentSectionRef,
|
|
5955
|
-
h: "100%",
|
|
5956
|
-
gap: gutter,
|
|
5957
|
-
flex: 1,
|
|
5958
|
-
...componentsProps?.sectionContainers?.["content" /* Content */],
|
|
5959
|
-
className: clsx_default("remoraid-frame-layout-section", "remoraid-frame-layout-content-section", componentsProps?.sectionContainers?.["content" /* Content */]?.className),
|
|
5960
|
-
children
|
|
5961
|
-
});
|
|
5962
|
-
const layoutContextValue = import_react11.useMemo(() => ({
|
|
5963
|
-
type: "frame" /* Frame */,
|
|
5964
|
-
sections: defaultSections,
|
|
5965
|
-
...layout,
|
|
5966
|
-
layoutId
|
|
5967
|
-
}), [layout?.sections, defaultSections, layoutId]);
|
|
5968
|
-
return /* @__PURE__ */ jsx_runtime12.jsx(layoutContext.Provider, {
|
|
5969
|
-
value: layoutContextValue,
|
|
5970
|
-
children: /* @__PURE__ */ jsx_runtime12.jsxs(import_core5.Group, {
|
|
5971
|
-
gap: 0,
|
|
5972
|
-
h: "100%",
|
|
5973
|
-
w: "100%",
|
|
5974
|
-
wrap: "nowrap",
|
|
5975
|
-
...componentsProps?.horizontalContainer,
|
|
5976
|
-
style: {
|
|
5977
|
-
"--remoraid-frame-layout-gutter": typeof gutter === "string" ? `var(--mantine-spacing-${gutter})` : `${gutter}px`
|
|
5978
|
-
},
|
|
5979
|
-
className: clsx_default("remoraid-frame-layout", componentsProps?.horizontalContainer?.className),
|
|
5980
|
-
children: [
|
|
5981
|
-
/* @__PURE__ */ jsx_runtime12.jsx(import_core5.Group, {
|
|
5982
|
-
ref: leftSectionRef,
|
|
5983
|
-
h: "100%",
|
|
5984
|
-
wrap: "nowrap",
|
|
5985
|
-
gap: gutter,
|
|
5986
|
-
pr: 0,
|
|
5987
|
-
...componentsProps?.sectionContainers?.["left" /* Left */],
|
|
5988
|
-
className: clsx_default("remoraid-frame-layout-section", "remoraid-frame-layout-left-section", componentsProps?.sectionContainers?.["left" /* Left */]?.className)
|
|
5989
|
-
}),
|
|
5990
|
-
/* @__PURE__ */ jsx_runtime12.jsxs(import_core5.Stack, {
|
|
5991
|
-
h: "100%",
|
|
5992
|
-
flex: 1,
|
|
5993
|
-
gap: 0,
|
|
5994
|
-
...componentsProps?.verticalContainer,
|
|
5995
|
-
className: clsx_default("remoraid-frame-layout-vertical-container", componentsProps?.verticalContainer?.className),
|
|
5996
|
-
children: [
|
|
5997
|
-
/* @__PURE__ */ jsx_runtime12.jsx(import_core5.Stack, {
|
|
5998
|
-
ref: topSectionRef,
|
|
5999
|
-
gap: gutter,
|
|
6000
|
-
flex: 0,
|
|
6001
|
-
...componentsProps?.sectionContainers?.["top" /* Top */],
|
|
6002
|
-
className: clsx_default("remoraid-frame-layout-section", "remoraid-frame-layout-top-section", componentsProps?.sectionContainers?.["top" /* Top */]?.className)
|
|
6003
|
-
}),
|
|
6004
|
-
includeScrollArea ? /* @__PURE__ */ jsx_runtime12.jsx(import_core5.ScrollArea, {
|
|
6005
|
-
flex: 1,
|
|
6006
|
-
...componentsProps?.ScrollArea,
|
|
6007
|
-
children: contentSection
|
|
6008
|
-
}) : contentSection,
|
|
6009
|
-
/* @__PURE__ */ jsx_runtime12.jsx(import_core5.Stack, {
|
|
6010
|
-
ref: bottomSectionRef,
|
|
6011
|
-
gap: gutter,
|
|
6012
|
-
flex: 0,
|
|
6013
|
-
...componentsProps?.sectionContainers?.["bottom" /* Bottom */],
|
|
6014
|
-
className: clsx_default("remoraid-frame-layout-section", "remoraid-frame-layout-bottom-section", componentsProps?.sectionContainers?.["bottom" /* Bottom */]?.className)
|
|
6015
|
-
})
|
|
6016
|
-
]
|
|
6017
|
-
}),
|
|
6018
|
-
/* @__PURE__ */ jsx_runtime12.jsx(import_core5.Group, {
|
|
6019
|
-
ref: rightSectionRef,
|
|
6020
|
-
h: "100%",
|
|
6021
|
-
gap: gutter,
|
|
6022
|
-
pl: 0,
|
|
6023
|
-
wrap: "nowrap",
|
|
6024
|
-
...componentsProps?.sectionContainers?.["right" /* Right */],
|
|
6025
|
-
className: clsx_default("remoraid-frame-layout-section", "remoraid-frame-layout-right-section", componentsProps?.sectionContainers?.["right" /* Right */]?.className)
|
|
6026
|
-
})
|
|
6027
|
-
]
|
|
6028
|
-
})
|
|
6029
|
-
});
|
|
6030
|
-
}
|
|
6031
|
-
var FrameLayout_default = Object.assign(FrameLayout, {
|
|
6032
|
-
Element: Element2
|
|
6033
|
-
});
|
|
6034
|
-
|
|
6035
|
-
// src/core/components/AppShell/Footer/FooterMinimal/index.tsx
|
|
6036
|
-
var jsx_runtime13 = require("react/jsx-runtime");
|
|
6037
|
-
function FooterMinimal({
|
|
6038
|
-
icon: Icon2 = import_icons_react2.IconPennant,
|
|
6039
|
-
componentsProps
|
|
6040
|
-
}) {
|
|
6041
|
-
const theme = useRemoraidTheme();
|
|
6042
|
-
const {
|
|
6043
|
-
userExperience: {
|
|
6044
|
-
footer: { position }
|
|
6045
|
-
}
|
|
6046
|
-
} = useAppShellUserExperience();
|
|
6047
|
-
const content = /* @__PURE__ */ jsx_runtime13.jsx(PageContainer, {
|
|
6048
|
-
...componentsProps?.container,
|
|
6049
|
-
children: /* @__PURE__ */ jsx_runtime13.jsx(import_core6.Center, {
|
|
6050
|
-
children: /* @__PURE__ */ jsx_runtime13.jsx(Icon2, {
|
|
6051
|
-
color: "var(--mantine-color-default-border)",
|
|
6052
|
-
...theme.componentsProps.icons.huge,
|
|
6053
|
-
...componentsProps?.icon
|
|
6054
|
-
})
|
|
6055
|
-
})
|
|
6056
|
-
});
|
|
6057
|
-
if (position === "bottom" /* Bottom */) {
|
|
6058
|
-
return /* @__PURE__ */ jsx_runtime13.jsx(FrameLayout_default.Element, {
|
|
6059
|
-
section: position,
|
|
6060
|
-
includeContainer: true,
|
|
6061
|
-
...componentsProps?.layoutElement,
|
|
6062
|
-
componentsProps: import_lodash6.merge({ container: { style: { order: -50 } } }, componentsProps?.layoutElement?.componentsProps),
|
|
6063
|
-
children: content
|
|
6064
|
-
});
|
|
6065
|
-
}
|
|
6066
|
-
if (position === "content" /* Content */) {
|
|
6067
|
-
return content;
|
|
6068
|
-
}
|
|
6069
|
-
return null;
|
|
6070
|
-
}
|
|
6071
|
-
|
|
6072
|
-
// src/core/components/AppShell/Footer/index.tsx
|
|
6073
|
-
var jsx_runtime14 = require("react/jsx-runtime");
|
|
6074
|
-
var supportedFooterPositions = {
|
|
6075
|
-
["minimal" /* Minimal */]: [
|
|
6076
|
-
null,
|
|
6077
|
-
"bottom" /* Bottom */,
|
|
6078
|
-
"content" /* Content */
|
|
6079
|
-
]
|
|
6080
|
-
};
|
|
6081
|
-
var defaultFooterPositions = {
|
|
6082
|
-
["minimal" /* Minimal */]: "content" /* Content */
|
|
6083
|
-
};
|
|
6084
|
-
function Footer({ componentsProps }) {
|
|
6085
|
-
const { footerVariant } = useRemoraidApp();
|
|
6086
|
-
if (footerVariant === "minimal" /* Minimal */) {
|
|
6087
|
-
return /* @__PURE__ */ jsx_runtime14.jsx(FooterMinimal, {
|
|
6088
|
-
...componentsProps?.FooterMinimal
|
|
6089
|
-
});
|
|
6090
|
-
}
|
|
6091
|
-
return null;
|
|
6092
|
-
}
|
|
6093
|
-
var Footer_default = Object.assign(Footer, {
|
|
6094
|
-
FooterMinimal
|
|
6095
|
-
});
|
|
6096
|
-
|
|
6097
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/index.tsx
|
|
6098
|
-
var import_react16 = require("react");
|
|
6099
|
-
|
|
6100
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6101
|
-
var import_core9 = require("@mantine/core");
|
|
6102
|
-
var import_lodash8 = __toESM(require_lodash());
|
|
6103
|
-
|
|
6104
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/NavigationMenu/index.tsx
|
|
6105
|
-
var import_core7 = require("@mantine/core");
|
|
6106
|
-
var import_react12 = require("react");
|
|
6107
|
-
var jsx_runtime15 = require("react/jsx-runtime");
|
|
6108
|
-
function NavigationMenu({
|
|
6109
|
-
target,
|
|
6110
|
-
elements,
|
|
6111
|
-
label,
|
|
6112
|
-
componentsProps
|
|
6113
|
-
}) {
|
|
6114
|
-
const theme = useRemoraidTheme();
|
|
6115
|
-
const mantineTheme = import_core7.useMantineTheme();
|
|
6116
|
-
const router = useRemoraidRouter();
|
|
6117
|
-
const { pathname } = router;
|
|
6118
|
-
const item = (element) => /* @__PURE__ */ jsx_runtime15.jsx(import_core7.Transition, {
|
|
6119
|
-
mounted: element.mounted ?? true,
|
|
6120
|
-
...componentsProps?.transition,
|
|
6121
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime15.jsx(import_core7.Menu.Item, {
|
|
6122
|
-
leftSection: element.icon ? /* @__PURE__ */ jsx_runtime15.jsx(element.icon, {
|
|
6123
|
-
...theme.componentsProps.icons.small
|
|
6124
|
-
}) : undefined,
|
|
6125
|
-
c: element.type === "anchor" /* Anchor */ && element.href === pathname ? mantineTheme.primaryColor : undefined,
|
|
6126
|
-
onClick: (e) => {
|
|
6127
|
-
if (element.type === "anchor" /* Anchor */) {
|
|
6128
|
-
router.push(element.href);
|
|
6129
|
-
}
|
|
6130
|
-
if (element.type === "button" /* Button */) {
|
|
6131
|
-
element.onClick(e);
|
|
6132
|
-
}
|
|
6133
|
-
},
|
|
6134
|
-
style: transitionStyle,
|
|
6135
|
-
children: element.label
|
|
6136
|
-
})
|
|
6137
|
-
});
|
|
6138
|
-
const targetElement = import_react12.isValidElement(target) ? target : item(target);
|
|
6139
|
-
if (elements === undefined || elements.length === 0) {
|
|
6140
|
-
return targetElement;
|
|
6141
|
-
}
|
|
6142
|
-
return /* @__PURE__ */ jsx_runtime15.jsxs(import_core7.Menu, {
|
|
6143
|
-
trigger: "click-hover",
|
|
6144
|
-
...componentsProps?.Menu,
|
|
6145
|
-
children: [
|
|
6146
|
-
/* @__PURE__ */ jsx_runtime15.jsx(import_core7.Menu.Target, {
|
|
6147
|
-
children: /* @__PURE__ */ jsx_runtime15.jsx(import_core7.Box, {
|
|
6148
|
-
children: targetElement
|
|
6149
|
-
})
|
|
6150
|
-
}),
|
|
6151
|
-
/* @__PURE__ */ jsx_runtime15.jsxs(import_core7.Menu.Dropdown, {
|
|
6152
|
-
children: [
|
|
6153
|
-
label !== undefined && /* @__PURE__ */ jsx_runtime15.jsx(import_core7.Menu.Label, {
|
|
6154
|
-
children: label
|
|
6155
|
-
}),
|
|
6156
|
-
elements.map((element, i) => /* @__PURE__ */ jsx_runtime15.jsx(NavigationMenu, {
|
|
6157
|
-
target: item(element),
|
|
6158
|
-
elements: element.children,
|
|
6159
|
-
componentsProps
|
|
6160
|
-
}, `navigation-menu-${i}`))
|
|
6161
|
-
]
|
|
6162
|
-
})
|
|
6163
|
-
]
|
|
6164
|
-
});
|
|
6165
|
-
}
|
|
6166
|
-
|
|
6167
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6168
|
-
var import_icons_react4 = require("@tabler/icons-react");
|
|
6169
|
-
|
|
6170
|
-
// src/core/components/RemoraidButton/index.tsx
|
|
6171
|
-
var import_core8 = require("@mantine/core");
|
|
6172
|
-
var import_icons_react3 = require("@tabler/icons-react");
|
|
6173
|
-
var import_react13 = require("react");
|
|
6174
|
-
var import_lodash7 = __toESM(require_lodash());
|
|
6175
|
-
var jsx_runtime16 = require("react/jsx-runtime");
|
|
6176
|
-
var defaultRemoraidButtonSize = "sm";
|
|
6177
|
-
function RemoraidButton({
|
|
6178
|
-
label,
|
|
6179
|
-
responsive: responsiveProp,
|
|
6180
|
-
breakpoint: breakpointProp,
|
|
6181
|
-
collapsed: collapsedProp,
|
|
6182
|
-
size = defaultRemoraidButtonSize,
|
|
6183
|
-
color,
|
|
6184
|
-
onClick,
|
|
6185
|
-
loading,
|
|
6186
|
-
variant = "default",
|
|
6187
|
-
mounted = true,
|
|
6188
|
-
icon: iconProp,
|
|
6189
|
-
iconSize: iconSizeProp,
|
|
6190
|
-
clickTransformation = "default" /* Default */,
|
|
6191
|
-
componentsProps
|
|
6192
|
-
}) {
|
|
6193
|
-
const theme = useRemoraidTheme();
|
|
6194
|
-
const responsive = responsiveProp ?? true;
|
|
6195
|
-
const breakpoint = breakpointProp ?? theme.breakpoints.buttonCollapse;
|
|
6196
|
-
const collapsed = collapsedProp ?? false;
|
|
6197
|
-
const iconSize = iconSizeProp ?? getDefaultButtonIconSize(size);
|
|
6198
|
-
const Icon3 = iconProp ?? import_icons_react3.IconClick;
|
|
6199
|
-
const iconElement = import_react13.isValidElement(Icon3) ? Icon3 : /* @__PURE__ */ jsx_runtime16.jsx(Icon3, {
|
|
6200
|
-
...import_lodash7.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
|
|
6201
|
-
});
|
|
6202
|
-
const clickTransformationClassNames = {
|
|
6203
|
-
["default" /* Default */]: null,
|
|
6204
|
-
["none" /* None */]: "remoraid-button-none",
|
|
6205
|
-
["scale" /* Scale */]: "remoraid-button-scale",
|
|
6206
|
-
["tiltDown" /* TiltDown */]: "remoraid-button-tilt-down",
|
|
6207
|
-
["tiltUp" /* TiltUp */]: "remoraid-button-tilt-up",
|
|
6208
|
-
["tiltLeft" /* TiltLeft */]: "remoraid-button-tilt-left",
|
|
6209
|
-
["tiltRight" /* TiltRight */]: "remoraid-button-tilt-right"
|
|
6210
|
-
};
|
|
6211
|
-
const clickTransformationClass = clickTransformationClassNames[clickTransformation];
|
|
6212
|
-
return /* @__PURE__ */ jsx_runtime16.jsx(import_core8.Transition, {
|
|
6213
|
-
mounted,
|
|
6214
|
-
transition: "fade",
|
|
6215
|
-
duration: theme.transitionDurations.short,
|
|
6216
|
-
timingFunction: "ease",
|
|
6217
|
-
...componentsProps?.transition,
|
|
6218
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime16.jsxs(jsx_runtime16.Fragment, {
|
|
6219
|
-
children: [
|
|
6220
|
-
/* @__PURE__ */ jsx_runtime16.jsx(import_core8.Tooltip, {
|
|
6221
|
-
label,
|
|
6222
|
-
...componentsProps?.tooltip,
|
|
6223
|
-
children: /* @__PURE__ */ jsx_runtime16.jsx(import_core8.ActionIcon, {
|
|
6224
|
-
"aria-label": label,
|
|
6225
|
-
variant,
|
|
6226
|
-
onClick,
|
|
6227
|
-
loading,
|
|
6228
|
-
size: size ? `input-${size}` : "input-sm",
|
|
6229
|
-
color,
|
|
6230
|
-
...componentsProps?.button,
|
|
6231
|
-
...componentsProps?.ActionIcon,
|
|
6232
|
-
hiddenFrom: !responsive ? undefined : breakpoint,
|
|
6233
|
-
display: !responsive && !collapsed ? "none" : componentsProps?.ActionIcon?.display ?? componentsProps?.button?.display,
|
|
6234
|
-
style: import_lodash7.merge(transitionStyle, componentsProps?.button?.style, componentsProps?.ActionIcon?.style),
|
|
6235
|
-
className: clsx_default(clickTransformationClass, componentsProps?.ActionIcon?.className, componentsProps?.button?.className),
|
|
6236
|
-
children: iconElement
|
|
6237
|
-
})
|
|
6238
|
-
}),
|
|
6239
|
-
/* @__PURE__ */ jsx_runtime16.jsx(import_core8.Button, {
|
|
6240
|
-
onClick,
|
|
6241
|
-
loading,
|
|
6242
|
-
variant,
|
|
6243
|
-
size,
|
|
6244
|
-
color,
|
|
6245
|
-
leftSection: iconProp !== undefined ? iconElement : undefined,
|
|
6246
|
-
...componentsProps?.button,
|
|
6247
|
-
...componentsProps?.Button,
|
|
6248
|
-
visibleFrom: !responsive ? undefined : breakpoint,
|
|
6249
|
-
display: !responsive && collapsed ? "none" : componentsProps?.Button?.display ?? componentsProps?.button?.display,
|
|
6250
|
-
style: import_lodash7.merge(transitionStyle, componentsProps?.button?.style, componentsProps?.Button?.style),
|
|
6251
|
-
className: clsx_default(clickTransformationClass, componentsProps?.Button?.className, componentsProps?.button?.className),
|
|
6252
|
-
children: label
|
|
6253
|
-
})
|
|
6254
|
-
]
|
|
6255
|
-
})
|
|
6256
|
-
});
|
|
6257
|
-
}
|
|
6258
|
-
|
|
6259
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6260
|
-
var jsx_runtime17 = require("react/jsx-runtime");
|
|
6261
|
-
function NavbarMinimalContent({
|
|
6262
|
-
orientation,
|
|
6263
|
-
maxElements,
|
|
6264
|
-
collapseStaticElementsBreakpoint: collapseStaticElementsBreakpointProp,
|
|
6265
|
-
componentsProps
|
|
6266
|
-
}) {
|
|
6267
|
-
const theme = useRemoraidTheme();
|
|
6268
|
-
const { userExperience: appShellUserExperience } = useAppShellUserExperience();
|
|
6269
|
-
const app = useRemoraidApp();
|
|
6270
|
-
const router = useRemoraidRouter();
|
|
6271
|
-
const { pathname } = router;
|
|
6272
|
-
const layoutElement = useFrameLayoutElement();
|
|
6273
|
-
const { colorScheme, setColorScheme } = useHydratedMantineColorScheme();
|
|
6274
|
-
const collapseStaticElementsBreakpoint = collapseStaticElementsBreakpointProp ?? theme.breakpoints.navbarStaticElementsCollapse;
|
|
6275
|
-
const mode = appShellUserExperience.navbar.mode;
|
|
6276
|
-
const floatingPositions = {
|
|
6277
|
-
["bottom" /* Bottom */]: "top",
|
|
6278
|
-
["left" /* Left */]: "right",
|
|
6279
|
-
["top" /* Top */]: "bottom",
|
|
6280
|
-
["right" /* Right */]: "left",
|
|
6281
|
-
["content" /* Content */]: undefined
|
|
6282
|
-
};
|
|
6283
|
-
const floatingPosition = layoutElement?.section ? floatingPositions[layoutElement.section] : undefined;
|
|
6284
|
-
const buttonResponsive = mode === "responsive" /* Responsive */;
|
|
6285
|
-
let buttonCollapsed = undefined;
|
|
6286
|
-
if (mode === "collapsed" /* Collapsed */) {
|
|
6287
|
-
buttonCollapsed = true;
|
|
6288
|
-
} else if (mode === "expanded" /* Expanded */) {
|
|
6289
|
-
buttonCollapsed = false;
|
|
6290
|
-
}
|
|
6291
|
-
const buttonClickTransformation = orientation === "horizontal" /* Horizontal */ ? "tiltRight" /* TiltRight */ : "default" /* Default */;
|
|
6292
|
-
const logoButton = app.logo ? /* @__PURE__ */ jsx_runtime17.jsx(RemoraidButton, {
|
|
6293
|
-
label: app.name,
|
|
6294
|
-
variant: "subtle",
|
|
6295
|
-
icon: app.logo,
|
|
6296
|
-
responsive: buttonResponsive,
|
|
6297
|
-
collapsed: buttonCollapsed,
|
|
6298
|
-
clickTransformation: buttonClickTransformation,
|
|
6299
|
-
...componentsProps?.button,
|
|
6300
|
-
...componentsProps?.logoButton,
|
|
6301
|
-
componentsProps: import_lodash8.merge({
|
|
6302
|
-
button: {
|
|
6303
|
-
c: "var(--mantine-color-text)"
|
|
6304
|
-
},
|
|
6305
|
-
Button: { justify: "flex-start" },
|
|
6306
|
-
tooltip: { position: floatingPosition }
|
|
6307
|
-
}, componentsProps?.button?.componentsProps, componentsProps?.logoButton?.componentsProps),
|
|
6308
|
-
onClick: (e) => {
|
|
6309
|
-
componentsProps?.button?.onClick?.(e);
|
|
6310
|
-
componentsProps?.logoButton?.onClick?.(e);
|
|
6311
|
-
}
|
|
6312
|
-
}) : undefined;
|
|
6313
|
-
const button = (element, key) => /* @__PURE__ */ jsx_runtime17.jsx(NavigationMenu, {
|
|
6314
|
-
label: element.label,
|
|
6315
|
-
target: /* @__PURE__ */ jsx_runtime17.jsx(RemoraidButton, {
|
|
6316
|
-
mounted: element.mounted,
|
|
6317
|
-
label: element.label,
|
|
6318
|
-
icon: element.icon,
|
|
6319
|
-
variant: element.type === "anchor" /* Anchor */ && element.href === pathname ? "light" : "default",
|
|
6320
|
-
responsive: buttonResponsive,
|
|
6321
|
-
collapsed: buttonCollapsed,
|
|
6322
|
-
clickTransformation: buttonClickTransformation,
|
|
6323
|
-
...componentsProps?.button,
|
|
6324
|
-
componentsProps: import_lodash8.merge({
|
|
6325
|
-
tooltip: {
|
|
6326
|
-
position: floatingPosition,
|
|
6327
|
-
disabled: element.children !== undefined && element.children.length > 0
|
|
6328
|
-
},
|
|
6329
|
-
Button: { justify: "flex-start" },
|
|
6330
|
-
button: {
|
|
6331
|
-
w: orientation === "vertical" /* Vertical */ ? "100%" : undefined
|
|
6332
|
-
}
|
|
6333
|
-
}, componentsProps?.button?.componentsProps),
|
|
6334
|
-
onClick: (e) => {
|
|
6335
|
-
if (element.type === "anchor" /* Anchor */) {
|
|
6336
|
-
router.push(element.href);
|
|
6337
|
-
}
|
|
6338
|
-
if (element.type === "button" /* Button */) {
|
|
6339
|
-
element.onClick(e);
|
|
6340
|
-
}
|
|
6341
|
-
componentsProps?.button?.onClick?.(e);
|
|
6342
|
-
}
|
|
6343
|
-
}),
|
|
6344
|
-
elements: element.children,
|
|
6345
|
-
...componentsProps?.NavigationMenu,
|
|
6346
|
-
componentsProps: import_lodash8.merge({
|
|
6347
|
-
Menu: { position: floatingPosition }
|
|
6348
|
-
}, componentsProps?.NavigationMenu?.componentsProps)
|
|
6349
|
-
}, key);
|
|
6350
|
-
const elements = [
|
|
6351
|
-
...app.nav,
|
|
6352
|
-
...getDefaultNavigationElements({ colorScheme, setColorScheme })
|
|
6353
|
-
];
|
|
6354
|
-
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}`));
|
|
6355
|
-
const staticElements = elements.filter((element) => element.static);
|
|
6356
|
-
const staticButtons = staticElements.sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0)).map((element, i) => button(element, `static-nav-element-${i}`));
|
|
6357
|
-
const collapseStaticElements = staticElements.filter((element) => element.mounted ?? true).length > 1;
|
|
6358
|
-
const staticMenuButton = collapseStaticElements ? /* @__PURE__ */ jsx_runtime17.jsx(import_core9.Box, {
|
|
6359
|
-
hiddenFrom: collapseStaticElementsBreakpoint,
|
|
6360
|
-
children: /* @__PURE__ */ jsx_runtime17.jsx(NavigationMenu, {
|
|
6361
|
-
elements: staticElements,
|
|
6362
|
-
target: /* @__PURE__ */ jsx_runtime17.jsx(RemoraidButton, {
|
|
6363
|
-
label: "Static elements",
|
|
6364
|
-
icon: import_icons_react4.IconDots,
|
|
6365
|
-
responsive: orientation === "vertical" /* Vertical */ ? buttonResponsive : false,
|
|
6366
|
-
collapsed: orientation === "vertical" /* Vertical */ ? buttonCollapsed : true,
|
|
6367
|
-
clickTransformation: buttonClickTransformation,
|
|
6368
|
-
...componentsProps?.button,
|
|
6369
|
-
componentsProps: import_lodash8.merge({
|
|
6370
|
-
tooltip: { disabled: true },
|
|
6371
|
-
Button: { justify: "flex-start" },
|
|
6372
|
-
button: {
|
|
6373
|
-
w: orientation === "vertical" /* Vertical */ ? "100%" : undefined
|
|
6374
|
-
}
|
|
6375
|
-
}, componentsProps?.button?.componentsProps)
|
|
6376
|
-
}),
|
|
6377
|
-
...componentsProps?.NavigationMenu,
|
|
6378
|
-
componentsProps: import_lodash8.merge({
|
|
6379
|
-
Menu: { position: floatingPosition }
|
|
6380
|
-
}, componentsProps?.NavigationMenu?.componentsProps)
|
|
6381
|
-
})
|
|
6382
|
-
}) : null;
|
|
6383
|
-
return /* @__PURE__ */ jsx_runtime17.jsx(import_core9.Paper, {
|
|
6384
|
-
bg: theme.transparentBackground,
|
|
6385
|
-
h: "100%",
|
|
6386
|
-
p: "md",
|
|
6387
|
-
shadow: "md",
|
|
6388
|
-
...componentsProps?.container,
|
|
6389
|
-
children: orientation === "vertical" /* Vertical */ ? /* @__PURE__ */ jsx_runtime17.jsxs(import_core9.Stack, {
|
|
6390
|
-
h: "100%",
|
|
6391
|
-
children: [
|
|
6392
|
-
logoButton,
|
|
6393
|
-
/* @__PURE__ */ jsx_runtime17.jsx(import_core9.ScrollArea, {
|
|
6394
|
-
flex: 1,
|
|
6395
|
-
children: /* @__PURE__ */ jsx_runtime17.jsx(import_core9.Stack, {
|
|
6396
|
-
children: buttons
|
|
6397
|
-
})
|
|
6398
|
-
}),
|
|
6399
|
-
/* @__PURE__ */ jsx_runtime17.jsx(import_core9.Stack, {
|
|
6400
|
-
visibleFrom: collapseStaticElements ? collapseStaticElementsBreakpoint : undefined,
|
|
6401
|
-
children: staticButtons
|
|
6402
|
-
}),
|
|
6403
|
-
staticMenuButton
|
|
6404
|
-
]
|
|
6405
|
-
}) : /* @__PURE__ */ jsx_runtime17.jsxs(import_core9.Group, {
|
|
6406
|
-
wrap: "nowrap",
|
|
6407
|
-
children: [
|
|
6408
|
-
logoButton,
|
|
6409
|
-
/* @__PURE__ */ jsx_runtime17.jsx(import_core9.ScrollArea, {
|
|
6410
|
-
flex: 1,
|
|
6411
|
-
style: { contain: "inline-size" },
|
|
6412
|
-
children: /* @__PURE__ */ jsx_runtime17.jsx(import_core9.Group, {
|
|
6413
|
-
wrap: "nowrap",
|
|
6414
|
-
children: buttons
|
|
6415
|
-
})
|
|
6416
|
-
}),
|
|
6417
|
-
/* @__PURE__ */ jsx_runtime17.jsx(import_core9.Group, {
|
|
6418
|
-
wrap: "nowrap",
|
|
6419
|
-
visibleFrom: collapseStaticElements ? collapseStaticElementsBreakpoint : undefined,
|
|
6420
|
-
children: staticButtons
|
|
6421
|
-
}),
|
|
6422
|
-
staticMenuButton
|
|
6423
|
-
]
|
|
6424
|
-
})
|
|
6425
|
-
});
|
|
6426
|
-
}
|
|
6427
|
-
|
|
6428
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/index.tsx
|
|
6429
|
-
var import_lodash11 = __toESM(require_lodash());
|
|
6430
|
-
|
|
6431
|
-
// src/core/components/Pinnable/index.tsx
|
|
6432
|
-
var import_react15 = require("react");
|
|
6433
|
-
var import_icons_react7 = require("@tabler/icons-react");
|
|
6434
|
-
var import_core12 = require("@mantine/core");
|
|
6435
|
-
|
|
6436
|
-
// src/core/components/Controls/ControlButton/index.tsx
|
|
6437
|
-
var import_core10 = require("@mantine/core");
|
|
6438
|
-
var import_icons_react5 = require("@tabler/icons-react");
|
|
6439
|
-
var import_lodash9 = __toESM(require_lodash());
|
|
6440
|
-
var jsx_runtime18 = require("react/jsx-runtime");
|
|
6441
|
-
function ControlButton({
|
|
6442
|
-
icon: Icon4 = import_icons_react5.IconClick,
|
|
6443
|
-
mounted = true,
|
|
6444
|
-
size = "xs",
|
|
6445
|
-
iconSize = "tiny" /* Tiny */,
|
|
6446
|
-
onClick,
|
|
6447
|
-
order,
|
|
6448
|
-
color,
|
|
6449
|
-
tooltip,
|
|
6450
|
-
componentsProps
|
|
6451
|
-
}) {
|
|
6452
|
-
const theme = useRemoraidTheme();
|
|
6453
|
-
return /* @__PURE__ */ jsx_runtime18.jsx(import_core10.Transition, {
|
|
6454
|
-
mounted,
|
|
6455
|
-
transition: "fade",
|
|
6456
|
-
duration: theme.transitionDurations.short,
|
|
6457
|
-
timingFunction: "ease",
|
|
6458
|
-
...componentsProps?.transition,
|
|
6459
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime18.jsx(import_core10.Tooltip, {
|
|
6460
|
-
label: tooltip,
|
|
6461
|
-
disabled: !Boolean(tooltip),
|
|
6462
|
-
...componentsProps?.tooltip,
|
|
6463
|
-
children: /* @__PURE__ */ jsx_runtime18.jsx(import_core10.ActionIcon, {
|
|
6464
|
-
"data-control-button": true,
|
|
6465
|
-
size,
|
|
6466
|
-
color,
|
|
6467
|
-
onClick,
|
|
6468
|
-
radius: "xl",
|
|
6469
|
-
...componentsProps?.button,
|
|
6470
|
-
style: {
|
|
6471
|
-
order,
|
|
6472
|
-
...import_lodash9.merge(transitionStyle, componentsProps?.button?.style)
|
|
6473
|
-
},
|
|
6474
|
-
children: /* @__PURE__ */ jsx_runtime18.jsx(Icon4, {
|
|
6475
|
-
...import_lodash9.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
|
|
6476
|
-
})
|
|
6477
|
-
})
|
|
6478
|
-
})
|
|
6479
|
-
});
|
|
6480
|
-
}
|
|
6481
|
-
|
|
6482
|
-
// src/core/components/Controls/index.tsx
|
|
6483
|
-
var import_react14 = require("react");
|
|
6484
|
-
var import_core11 = require("@mantine/core");
|
|
6485
|
-
var import_icons_react6 = require("@tabler/icons-react");
|
|
6486
|
-
var import_lodash10 = __toESM(require_lodash());
|
|
6487
|
-
var jsx_runtime19 = require("react/jsx-runtime");
|
|
6488
|
-
function Controls({
|
|
6489
|
-
groupRef,
|
|
6490
|
-
mounted = true,
|
|
6491
|
-
dragContainerRef,
|
|
6492
|
-
gutter = 5,
|
|
6493
|
-
iconSize = "tiny" /* Tiny */,
|
|
6494
|
-
additionalButtons: additionalButtonsProp,
|
|
6495
|
-
componentsProps,
|
|
6496
|
-
children: childrenProp
|
|
6497
|
-
}) {
|
|
6498
|
-
const additionalButtons = additionalButtonsProp?.map((additionalButton) => asElementOrPropsOfType(ControlButton, additionalButton, "Check the 'additionalButtons' property of 'Controls'."));
|
|
6499
|
-
const children = asChildrenOfType(ControlButton, childrenProp, "Check children passed to 'Controls' component.");
|
|
6500
|
-
const theme = useRemoraidTheme();
|
|
6501
|
-
const [pos, setPos] = import_react14.useState({
|
|
6502
|
-
x: 0,
|
|
6503
|
-
y: 0
|
|
6504
|
-
});
|
|
6505
|
-
const offsetRef = import_react14.useRef({ x: 0, y: 0 });
|
|
6506
|
-
const containerRef = import_react14.useRef(null);
|
|
6507
|
-
const clamp = (v, min, max) => {
|
|
6508
|
-
return Math.min(Math.max(v, min), max);
|
|
6509
|
-
};
|
|
6510
|
-
const handlePointerDown = (e) => {
|
|
6511
|
-
if (e.target instanceof Element && e.target.closest("button,[data-control-button]")) {
|
|
6512
|
-
return;
|
|
6513
|
-
}
|
|
6514
|
-
if (!containerRef.current) {
|
|
6515
|
-
return;
|
|
6516
|
-
}
|
|
6517
|
-
const paperRect = containerRef.current.getBoundingClientRect();
|
|
6518
|
-
offsetRef.current = {
|
|
6519
|
-
x: e.clientX - paperRect.right,
|
|
6520
|
-
y: e.clientY - paperRect.top
|
|
6521
|
-
};
|
|
6522
|
-
e.currentTarget.setPointerCapture(e.pointerId);
|
|
6523
|
-
};
|
|
6524
|
-
const handlePointerMove = (e) => {
|
|
6525
|
-
if (!e.currentTarget.hasPointerCapture(e.pointerId)) {
|
|
6526
|
-
return;
|
|
6527
|
-
}
|
|
6528
|
-
if (!containerRef.current || !dragContainerRef.current) {
|
|
6529
|
-
return;
|
|
6530
|
-
}
|
|
6531
|
-
const boxRect = dragContainerRef.current.getBoundingClientRect();
|
|
6532
|
-
const paperRect = containerRef.current.getBoundingClientRect();
|
|
6533
|
-
const rawX = e.clientX - boxRect.right - offsetRef.current.x;
|
|
6534
|
-
const rawY = e.clientY - boxRect.top - offsetRef.current.y;
|
|
6535
|
-
const maxX = boxRect.width - paperRect.width;
|
|
6536
|
-
const maxY = boxRect.height - paperRect.height;
|
|
6537
|
-
setPos({
|
|
6538
|
-
x: clamp(-rawX, 0, maxX),
|
|
6539
|
-
y: clamp(rawY, 0, maxY)
|
|
6540
|
-
});
|
|
6541
|
-
};
|
|
6542
|
-
const handlePointerUp = (e) => {
|
|
6543
|
-
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
6544
|
-
};
|
|
6545
|
-
return /* @__PURE__ */ jsx_runtime19.jsx(import_core11.Transition, {
|
|
6546
|
-
mounted,
|
|
6547
|
-
keepMounted: true,
|
|
6548
|
-
transition: "pop",
|
|
6549
|
-
duration: theme.transitionDurations.short,
|
|
6550
|
-
timingFunction: "ease",
|
|
6551
|
-
...componentsProps?.transition,
|
|
6552
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime19.jsx(import_core11.Paper, {
|
|
6553
|
-
ref: containerRef,
|
|
6554
|
-
pos: "absolute",
|
|
6555
|
-
p: gutter,
|
|
6556
|
-
bg: theme.transparentBackground,
|
|
6557
|
-
shadow: "md",
|
|
6558
|
-
onPointerDown: handlePointerDown,
|
|
6559
|
-
onPointerMove: handlePointerMove,
|
|
6560
|
-
onPointerUp: handlePointerUp,
|
|
6561
|
-
...componentsProps?.container,
|
|
6562
|
-
style: {
|
|
6563
|
-
right: pos.x,
|
|
6564
|
-
top: pos.y,
|
|
6565
|
-
...import_lodash10.merge(transitionStyle, componentsProps?.container?.style)
|
|
6566
|
-
},
|
|
6567
|
-
className: clsx_default("remoraid-controls", componentsProps?.container?.className),
|
|
6568
|
-
children: /* @__PURE__ */ jsx_runtime19.jsxs(import_core11.Group, {
|
|
6569
|
-
gap: gutter,
|
|
6570
|
-
ref: groupRef,
|
|
6571
|
-
wrap: "nowrap",
|
|
6572
|
-
...componentsProps?.group,
|
|
6573
|
-
className: clsx_default("remoraid-controls-group", componentsProps?.group?.className),
|
|
6574
|
-
children: [
|
|
6575
|
-
/* @__PURE__ */ jsx_runtime19.jsx(import_icons_react6.IconGripHorizontal, {
|
|
6576
|
-
...import_lodash10.merge({}, theme.componentsProps.icons[iconSize], { order: -100, color: "var(--mantine-color-default-border)" }, componentsProps?.gripIcon)
|
|
6577
|
-
}),
|
|
6578
|
-
children,
|
|
6579
|
-
additionalButtons && additionalButtons.map((button, i) => {
|
|
6580
|
-
if (isValidElementOfType(ControlButton, button)) {
|
|
6581
|
-
return button;
|
|
6582
|
-
}
|
|
6583
|
-
return /* @__PURE__ */ jsx_runtime19.jsx(ControlButton, {
|
|
6584
|
-
...button
|
|
6585
|
-
}, i);
|
|
6586
|
-
})
|
|
6587
|
-
]
|
|
6588
|
-
})
|
|
6589
|
-
})
|
|
6590
|
-
});
|
|
6591
|
-
}
|
|
6592
|
-
|
|
6593
|
-
// src/core/components/Pinnable/index.tsx
|
|
6594
|
-
var jsx_runtime20 = require("react/jsx-runtime");
|
|
6595
|
-
function Pinnable({
|
|
6596
|
-
layoutType: layoutTypeProp,
|
|
6597
|
-
section,
|
|
6598
|
-
initialValue = false,
|
|
6599
|
-
layoutId,
|
|
6600
|
-
controlsContainer,
|
|
6601
|
-
hidden = false,
|
|
6602
|
-
onPinnedValueChange,
|
|
6603
|
-
componentsProps,
|
|
6604
|
-
children
|
|
6605
|
-
}) {
|
|
6606
|
-
const layoutType = layoutTypeProp ?? "frame" /* Frame */;
|
|
6607
|
-
const { layouts } = useLayouts();
|
|
6608
|
-
const [pinned, setPinned] = import_react15.useState(initialValue);
|
|
6609
|
-
const containerRef = import_react15.useRef(null);
|
|
6610
|
-
const layout = layouts[layoutId ?? remoraidAppShellLayoutId];
|
|
6611
|
-
if (layout && layout.type !== layoutType) {
|
|
6612
|
-
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.`);
|
|
6613
|
-
}
|
|
6614
|
-
const controlButton = import_react15.useMemo(() => /* @__PURE__ */ jsx_runtime20.jsx(ControlButton, {
|
|
6615
|
-
icon: pinned ? import_icons_react7.IconPinnedOff : import_icons_react7.IconPin,
|
|
6616
|
-
tooltip: pinned ? "Unpin" : "Pin",
|
|
6617
|
-
color: "green",
|
|
6618
|
-
order: 100,
|
|
6619
|
-
...componentsProps?.button,
|
|
6620
|
-
onClick: (e) => {
|
|
6621
|
-
setPinned((prev) => !prev);
|
|
6622
|
-
componentsProps?.button?.onClick?.(e);
|
|
6623
|
-
}
|
|
6624
|
-
}), [pinned, componentsProps?.button]);
|
|
6625
|
-
const element = /* @__PURE__ */ jsx_runtime20.jsxs(import_core12.Box, {
|
|
6626
|
-
pos: "relative",
|
|
6627
|
-
ref: containerRef,
|
|
6628
|
-
"data-hidden": hidden,
|
|
6629
|
-
h: "100%",
|
|
6630
|
-
...componentsProps?.container,
|
|
6631
|
-
className: clsx_default("remoraid-pinnable", componentsProps?.container?.className),
|
|
6632
|
-
children: [
|
|
6633
|
-
controlsContainer === undefined ? /* @__PURE__ */ jsx_runtime20.jsx(Controls, {
|
|
6634
|
-
dragContainerRef: containerRef,
|
|
6635
|
-
...componentsProps?.controls,
|
|
6636
|
-
children: controlButton
|
|
6637
|
-
}) : controlsContainer !== null && /* @__PURE__ */ jsx_runtime20.jsx(import_core12.Portal, {
|
|
6638
|
-
target: controlsContainer,
|
|
6639
|
-
children: controlButton
|
|
6640
|
-
}),
|
|
6641
|
-
children
|
|
6642
|
-
]
|
|
6643
|
-
});
|
|
6644
|
-
import_react15.useEffect(() => {
|
|
6645
|
-
onPinnedValueChange?.(pinned);
|
|
6646
|
-
}, [pinned]);
|
|
6647
|
-
if (!layout) {
|
|
6648
|
-
return null;
|
|
6649
|
-
}
|
|
6650
|
-
if (pinned && layoutType === "frame" /* Frame */) {
|
|
6651
|
-
return /* @__PURE__ */ jsx_runtime20.jsx(FrameLayout_default.Element, {
|
|
6652
|
-
layoutId,
|
|
6653
|
-
section,
|
|
6654
|
-
hidden,
|
|
6655
|
-
...componentsProps?.layoutElement,
|
|
6656
|
-
children: element
|
|
6657
|
-
});
|
|
6658
|
-
}
|
|
6659
|
-
return element;
|
|
6660
|
-
}
|
|
6661
|
-
|
|
6662
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/index.tsx
|
|
6663
|
-
var jsx_runtime21 = require("react/jsx-runtime");
|
|
6664
|
-
function NavbarMinimal({
|
|
6665
|
-
pinnable = true,
|
|
6666
|
-
componentsProps
|
|
6667
|
-
}) {
|
|
6668
|
-
const {
|
|
6669
|
-
userExperience: {
|
|
6670
|
-
navbar: { position }
|
|
6671
|
-
}
|
|
6672
|
-
} = useAppShellUserExperience();
|
|
6673
|
-
const [hover, setHover] = import_react16.useState(false);
|
|
6674
|
-
const handleEnter = () => {
|
|
6675
|
-
setHover(true);
|
|
6676
|
-
};
|
|
6677
|
-
const handleLeave = () => {
|
|
6678
|
-
setHover(false);
|
|
6679
|
-
};
|
|
6680
|
-
if (position === "left" /* Left */ || position === "right" /* Right */) {
|
|
6681
|
-
return /* @__PURE__ */ jsx_runtime21.jsx(FrameLayout_default.Element, {
|
|
6682
|
-
section: position,
|
|
6683
|
-
includeContainer: true,
|
|
6684
|
-
...componentsProps?.layoutElement,
|
|
6685
|
-
componentsProps: import_lodash11.merge({
|
|
6686
|
-
container: {
|
|
6687
|
-
style: {
|
|
6688
|
-
order: -100
|
|
6689
|
-
}
|
|
6690
|
-
}
|
|
6691
|
-
}, componentsProps?.layoutElement?.componentsProps),
|
|
6692
|
-
children: /* @__PURE__ */ jsx_runtime21.jsx(NavbarMinimalContent, {
|
|
6693
|
-
orientation: "vertical" /* Vertical */,
|
|
6694
|
-
...componentsProps?.content
|
|
6695
|
-
})
|
|
6696
|
-
});
|
|
6697
|
-
}
|
|
6698
|
-
if (position === "top" /* Top */ || position === "bottom" /* Bottom */) {
|
|
6699
|
-
const content = /* @__PURE__ */ jsx_runtime21.jsx(NavbarMinimalContent, {
|
|
6700
|
-
orientation: "horizontal" /* Horizontal */,
|
|
6701
|
-
...componentsProps?.content
|
|
6702
|
-
});
|
|
6703
|
-
if (pinnable) {
|
|
6704
|
-
return /* @__PURE__ */ jsx_runtime21.jsx(PageContainer, {
|
|
6705
|
-
...componentsProps?.container,
|
|
6706
|
-
componentsProps: {
|
|
6707
|
-
...componentsProps?.container?.componentsProps,
|
|
6708
|
-
container: {
|
|
6709
|
-
...componentsProps?.container?.componentsProps?.container,
|
|
6710
|
-
className: clsx_default("hide-if-empty", componentsProps?.container?.componentsProps?.container?.className)
|
|
6711
|
-
}
|
|
6712
|
-
},
|
|
6713
|
-
children: /* @__PURE__ */ jsx_runtime21.jsx(Pinnable, {
|
|
6714
|
-
section: position,
|
|
6715
|
-
initialValue: true,
|
|
6716
|
-
...componentsProps?.Pinnable,
|
|
6717
|
-
componentsProps: import_lodash11.merge({
|
|
6718
|
-
container: {
|
|
6719
|
-
onMouseEnter: (e) => {
|
|
6720
|
-
handleEnter();
|
|
6721
|
-
componentsProps?.Pinnable?.componentsProps?.container?.onMouseEnter?.(e);
|
|
6722
|
-
},
|
|
6723
|
-
onMouseLeave: (e) => {
|
|
6724
|
-
handleLeave();
|
|
6725
|
-
componentsProps?.Pinnable?.componentsProps?.container?.onMouseLeave?.(e);
|
|
6726
|
-
}
|
|
6727
|
-
},
|
|
6728
|
-
button: {
|
|
6729
|
-
onClick: (e) => {
|
|
6730
|
-
handleLeave();
|
|
6731
|
-
componentsProps?.Pinnable?.componentsProps?.button?.onClick?.(e);
|
|
6732
|
-
}
|
|
6733
|
-
},
|
|
6734
|
-
layoutElement: {
|
|
6735
|
-
includeContainer: false,
|
|
6736
|
-
includePageContainer: true,
|
|
6737
|
-
componentsProps: {
|
|
6738
|
-
PageContainer: {
|
|
6739
|
-
componentsProps: {
|
|
6740
|
-
container: { style: { order: -100 } }
|
|
6741
|
-
}
|
|
6742
|
-
}
|
|
6743
|
-
}
|
|
6744
|
-
},
|
|
6745
|
-
controls: {
|
|
6746
|
-
mounted: hover
|
|
6747
|
-
}
|
|
6748
|
-
}, componentsProps?.Pinnable?.componentsProps),
|
|
6749
|
-
children: content
|
|
6750
|
-
})
|
|
6751
|
-
});
|
|
6752
|
-
}
|
|
6753
|
-
return content;
|
|
6754
|
-
}
|
|
6755
|
-
if (position === "content" /* Content */) {
|
|
6756
|
-
return /* @__PURE__ */ jsx_runtime21.jsx(PageContainer, {
|
|
6757
|
-
...componentsProps?.container,
|
|
6758
|
-
children: /* @__PURE__ */ jsx_runtime21.jsx(NavbarMinimalContent, {
|
|
6759
|
-
orientation: "horizontal" /* Horizontal */,
|
|
6760
|
-
...componentsProps?.content
|
|
6761
|
-
})
|
|
6762
|
-
});
|
|
6763
|
-
}
|
|
6764
|
-
return null;
|
|
6765
|
-
}
|
|
6766
|
-
|
|
6767
|
-
// src/core/components/AppShell/Navbar/index.tsx
|
|
6768
|
-
var import_icons_react8 = require("@tabler/icons-react");
|
|
6769
|
-
var jsx_runtime22 = require("react/jsx-runtime");
|
|
6770
|
-
var supportedNavbarPositions = {
|
|
6771
|
-
["minimal" /* Minimal */]: [
|
|
6772
|
-
null,
|
|
6773
|
-
"top" /* Top */,
|
|
6774
|
-
"bottom" /* Bottom */,
|
|
6775
|
-
"left" /* Left */,
|
|
6776
|
-
"right" /* Right */,
|
|
6777
|
-
"content" /* Content */
|
|
6778
|
-
]
|
|
6779
|
-
};
|
|
6780
|
-
var defaultNavbarPositions = { ["minimal" /* Minimal */]: "left" /* Left */ };
|
|
6781
|
-
var getDefaultNavigationElements = ({
|
|
6782
|
-
colorScheme,
|
|
6783
|
-
setColorScheme,
|
|
6784
|
-
auth
|
|
6785
|
-
}) => [
|
|
6786
|
-
{
|
|
6787
|
-
type: "button" /* Button */,
|
|
6788
|
-
label: colorScheme === "dark" ? "Light mode" : "Dark mode",
|
|
6789
|
-
icon: colorScheme === "dark" ? import_icons_react8.IconSun : import_icons_react8.IconMoon,
|
|
6790
|
-
static: true,
|
|
6791
|
-
onClick: () => {
|
|
6792
|
-
if (!colorScheme || !setColorScheme) {
|
|
6793
|
-
return;
|
|
6794
|
-
}
|
|
6795
|
-
setColorScheme(colorScheme === "dark" ? "light" : "dark");
|
|
6796
|
-
}
|
|
6797
|
-
},
|
|
6798
|
-
{
|
|
6799
|
-
mounted: auth !== undefined && auth.user === null,
|
|
6800
|
-
type: "anchor" /* Anchor */,
|
|
6801
|
-
label: "Login",
|
|
6802
|
-
href: "/login",
|
|
6803
|
-
static: true,
|
|
6804
|
-
icon: import_icons_react8.IconLogin
|
|
6805
|
-
},
|
|
6806
|
-
{
|
|
6807
|
-
mounted: auth !== undefined && auth.user !== null,
|
|
6808
|
-
type: "button" /* Button */,
|
|
6809
|
-
label: "Logout",
|
|
6810
|
-
static: true,
|
|
6811
|
-
icon: import_icons_react8.IconLogout,
|
|
6812
|
-
onClick: () => {
|
|
6813
|
-
auth?.onLogout?.();
|
|
6814
|
-
}
|
|
6815
|
-
}
|
|
6816
|
-
];
|
|
6817
|
-
function Navbar({ componentsProps }) {
|
|
6818
|
-
const { navbarVariant } = useRemoraidApp();
|
|
6819
|
-
if (navbarVariant === "minimal" /* Minimal */) {
|
|
6820
|
-
return /* @__PURE__ */ jsx_runtime22.jsx(NavbarMinimal, {
|
|
6821
|
-
...componentsProps?.NavbarMinimal
|
|
6822
|
-
});
|
|
6823
|
-
}
|
|
6824
|
-
return null;
|
|
6825
|
-
}
|
|
6826
|
-
var Navbar_default = Object.assign(Navbar, {
|
|
6827
|
-
NavbarMinimal
|
|
6828
|
-
});
|
|
6829
|
-
|
|
6830
|
-
// src/core/components/AppShell/AppShellUserExperienceProvider/index.tsx
|
|
6831
|
-
var jsx_runtime23 = require("react/jsx-runtime");
|
|
6832
|
-
var defaultAppShellUserExperience = {
|
|
6833
|
-
navbar: {
|
|
6834
|
-
position: null,
|
|
6835
|
-
mobilePosition: null,
|
|
6836
|
-
mode: "responsive" /* Responsive */
|
|
6837
|
-
},
|
|
6838
|
-
footer: {
|
|
6839
|
-
position: null
|
|
6840
|
-
}
|
|
6841
|
-
};
|
|
6842
|
-
var defaultAppShellUserExperienceCookieName = "remoraid-app-shell-user-experience";
|
|
6843
|
-
var appShellUserExperienceContext = createUserExperienceContext(defaultAppShellUserExperience);
|
|
6844
|
-
var useAppShellUserExperience = () => {
|
|
6845
|
-
return import_react17.useContext(appShellUserExperienceContext);
|
|
6846
|
-
};
|
|
6847
|
-
function AppShellUserExperienceProvider({
|
|
6848
|
-
children,
|
|
6849
|
-
initialValue,
|
|
6850
|
-
cookieName
|
|
6851
|
-
}) {
|
|
6852
|
-
const { navbarVariant, footerVariant } = useRemoraidApp();
|
|
6853
|
-
const isValidUserExperience = (x) => {
|
|
6854
|
-
if (typeof x !== "object") {
|
|
6855
|
-
return false;
|
|
6856
|
-
}
|
|
6857
|
-
if (x === null) {
|
|
6858
|
-
return false;
|
|
6859
|
-
}
|
|
6860
|
-
if (!("navbar" in x)) {
|
|
6861
|
-
return false;
|
|
6862
|
-
}
|
|
6863
|
-
if (!("footer" in x)) {
|
|
6864
|
-
return false;
|
|
6865
|
-
}
|
|
6866
|
-
return true;
|
|
6867
|
-
};
|
|
6868
|
-
return /* @__PURE__ */ jsx_runtime23.jsx(UserExperienceProviderWrapper, {
|
|
6869
|
-
context: appShellUserExperienceContext,
|
|
6870
|
-
isValidUserExperience,
|
|
6871
|
-
cookieName: cookieName ?? defaultAppShellUserExperienceCookieName,
|
|
6872
|
-
defaultUserExperience: defaultAppShellUserExperience,
|
|
6873
|
-
initialValue: import_lodash12.merge({
|
|
6874
|
-
navbar: {
|
|
6875
|
-
position: navbarVariant === null ? null : defaultNavbarPositions[navbarVariant]
|
|
6876
|
-
},
|
|
6877
|
-
footer: {
|
|
6878
|
-
position: footerVariant === null ? null : defaultFooterPositions[footerVariant]
|
|
6879
|
-
}
|
|
6880
|
-
}, initialValue),
|
|
6881
|
-
children
|
|
6882
|
-
});
|
|
6883
|
-
}
|
|
6884
|
-
|
|
6885
|
-
// src/core/components/AppShell/index.tsx
|
|
6886
|
-
var jsx_runtime24 = require("react/jsx-runtime");
|
|
6887
|
-
var remoraidAppShellLayoutId = "remoraid-app-shell";
|
|
6888
|
-
function AppShell({
|
|
6889
|
-
gutter,
|
|
6890
|
-
appContext: appContext2,
|
|
6891
|
-
initialUserExperience,
|
|
6892
|
-
componentsProps,
|
|
6893
|
-
children
|
|
6894
|
-
}) {
|
|
6895
|
-
const theme = useRemoraidTheme();
|
|
6896
|
-
const { colorScheme } = useHydratedMantineColorScheme();
|
|
6897
|
-
import_react18.useEffect(() => {
|
|
6898
|
-
let meta = document.querySelector('meta[name="theme-color"]');
|
|
6899
|
-
if (!meta) {
|
|
6900
|
-
meta = document.createElement("meta");
|
|
6901
|
-
meta.name = "theme-color";
|
|
6902
|
-
document.head.appendChild(meta);
|
|
6903
|
-
}
|
|
6904
|
-
const { backgroundColor: computedBodyColor } = getComputedStyle(document.body);
|
|
6905
|
-
if (!computedBodyColor) {
|
|
6906
|
-
return;
|
|
6907
|
-
}
|
|
6908
|
-
meta.content = computedBodyColor;
|
|
6909
|
-
}, [colorScheme]);
|
|
6910
|
-
return /* @__PURE__ */ jsx_runtime24.jsx(AppProvider, {
|
|
6911
|
-
appContext: appContext2,
|
|
6912
|
-
...componentsProps?.AppProvider,
|
|
6913
|
-
children: /* @__PURE__ */ jsx_runtime24.jsx(AppShellUserExperienceProvider, {
|
|
6914
|
-
...componentsProps?.AppShellUserExperienceProvider,
|
|
6915
|
-
initialValue: import_lodash13.merge(initialUserExperience, componentsProps?.AppShellUserExperienceProvider?.initialValue),
|
|
6916
|
-
children: /* @__PURE__ */ jsx_runtime24.jsx(import_core13.Box, {
|
|
6917
|
-
h: "100dvh",
|
|
6918
|
-
...componentsProps?.container,
|
|
6919
|
-
children: /* @__PURE__ */ jsx_runtime24.jsxs(FrameLayout_default, {
|
|
6920
|
-
layoutId: remoraidAppShellLayoutId,
|
|
6921
|
-
gutter: gutter ?? theme.primaryGutter,
|
|
6922
|
-
...componentsProps?.layout,
|
|
6923
|
-
children: [
|
|
6924
|
-
/* @__PURE__ */ jsx_runtime24.jsx(Navbar_default, {
|
|
6925
|
-
...componentsProps?.navbar
|
|
6926
|
-
}),
|
|
6927
|
-
children,
|
|
6928
|
-
/* @__PURE__ */ jsx_runtime24.jsx(Footer_default, {
|
|
6929
|
-
...componentsProps?.footer
|
|
6930
|
-
})
|
|
6931
|
-
]
|
|
6932
|
-
})
|
|
6933
|
-
})
|
|
6934
|
-
})
|
|
6935
|
-
});
|
|
6936
|
-
}
|
|
6937
|
-
var AppShell_default = Object.assign(AppShell, {
|
|
6938
|
-
Navbar: Navbar_default,
|
|
6939
|
-
Footer: Footer_default
|
|
6940
|
-
});
|
|
6941
|
-
// src/core/components/WidgetSelectionHeader/index.tsx
|
|
6942
|
-
var import_core16 = require("@mantine/core");
|
|
6943
|
-
|
|
6944
|
-
// src/core/components/Page/index.tsx
|
|
6945
|
-
var import_core14 = require("@mantine/core");
|
|
6946
|
-
var import_react19 = __toESM(require("react"));
|
|
6947
|
-
var jsx_runtime25 = require("react/jsx-runtime");
|
|
6948
|
-
var pageContext = import_react19.default.createContext(null);
|
|
6949
|
-
var usePage = () => {
|
|
6950
|
-
return import_react19.useContext(pageContext);
|
|
6951
|
-
};
|
|
6952
|
-
|
|
6953
|
-
// src/core/components/WidgetSelectionHeader/index.tsx
|
|
6954
|
-
var import_icons_react9 = require("@tabler/icons-react");
|
|
6955
|
-
var import_react20 = require("react");
|
|
6956
|
-
|
|
6957
|
-
// src/core/components/ScrollableChipGroup/index.tsx
|
|
6958
|
-
var import_core15 = require("@mantine/core");
|
|
6959
|
-
var jsx_runtime26 = require("react/jsx-runtime");
|
|
6960
|
-
|
|
6961
|
-
// src/core/components/WidgetSelectionHeader/index.tsx
|
|
6962
|
-
var import_lodash14 = __toESM(require_lodash());
|
|
6963
|
-
var jsx_runtime27 = require("react/jsx-runtime");
|
|
6964
|
-
// src/core/components/BadgeGroup/index.tsx
|
|
6965
|
-
var import_core18 = require("@mantine/core");
|
|
6966
|
-
var import_react21 = __toESM(require("react"));
|
|
6967
|
-
|
|
6968
|
-
// src/core/components/BadgeMinimal/index.tsx
|
|
6969
|
-
var import_core17 = require("@mantine/core");
|
|
6970
|
-
var jsx_runtime28 = require("react/jsx-runtime");
|
|
6971
|
-
function BadgeMinimal({
|
|
6972
|
-
label,
|
|
6973
|
-
tooltip,
|
|
6974
|
-
mounted = true,
|
|
6975
|
-
componentsProps
|
|
6976
|
-
}) {
|
|
6977
|
-
const theme = useRemoraidTheme();
|
|
6978
|
-
return /* @__PURE__ */ jsx_runtime28.jsx(import_core17.Transition, {
|
|
6979
|
-
mounted,
|
|
6980
|
-
transition: "fade",
|
|
6981
|
-
duration: theme.transitionDurations.short,
|
|
6982
|
-
timingFunction: "ease",
|
|
6983
|
-
...componentsProps?.transition,
|
|
6984
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime28.jsx(import_core17.Tooltip, {
|
|
6985
|
-
label: tooltip,
|
|
6986
|
-
disabled: !Boolean(tooltip),
|
|
6987
|
-
...componentsProps?.tooltip,
|
|
6988
|
-
children: /* @__PURE__ */ jsx_runtime28.jsx(import_core17.Badge, {
|
|
6989
|
-
variant: "default",
|
|
6990
|
-
...componentsProps?.badge,
|
|
6991
|
-
style: {
|
|
6992
|
-
...transitionStyle,
|
|
6993
|
-
cursor: "pointer",
|
|
6994
|
-
...componentsProps?.badge?.style
|
|
6995
|
-
},
|
|
6996
|
-
children: label
|
|
6997
|
-
})
|
|
6998
|
-
})
|
|
6999
|
-
});
|
|
7000
|
-
}
|
|
7001
|
-
|
|
7002
|
-
// src/core/components/BadgeGroup/index.tsx
|
|
7003
|
-
var import_lodash15 = __toESM(require_lodash());
|
|
7004
|
-
var jsx_runtime29 = require("react/jsx-runtime");
|
|
7005
|
-
var react = require("react");
|
|
7006
|
-
function BadgeGroup({
|
|
7007
|
-
badges: badgesProp,
|
|
7008
|
-
gap = "xs",
|
|
7009
|
-
breakpoint: breakpointProp,
|
|
7010
|
-
componentsProps
|
|
7011
|
-
}) {
|
|
7012
|
-
const badges = badgesProp.map((badge) => asElementOrPropsOfType(BadgeMinimal, badge, "Check 'badges' property passed to 'BadgeGroup'."));
|
|
7013
|
-
const theme = useRemoraidTheme();
|
|
7014
|
-
const breakpoint = breakpointProp ?? theme.breakpoints.badgeGroupCollapse;
|
|
7015
|
-
const numVisibleBadges = badges.filter((badge) => isValidElementOfType(BadgeMinimal, badge) ? badge.props.mounted : badge.mounted !== false).length;
|
|
7016
|
-
const badgesElement = badges.map((badge, i) => {
|
|
7017
|
-
if (isValidElementOfType(BadgeMinimal, badge)) {
|
|
7018
|
-
return badge;
|
|
7019
|
-
}
|
|
7020
|
-
return /* @__PURE__ */ react.createElement(BadgeMinimal, {
|
|
7021
|
-
...badge,
|
|
7022
|
-
key: i
|
|
7023
|
-
});
|
|
7024
|
-
});
|
|
7025
|
-
return /* @__PURE__ */ jsx_runtime29.jsxs(jsx_runtime29.Fragment, {
|
|
7026
|
-
children: [
|
|
7027
|
-
/* @__PURE__ */ jsx_runtime29.jsx(import_core18.Group, {
|
|
7028
|
-
gap,
|
|
7029
|
-
wrap: "nowrap",
|
|
7030
|
-
visibleFrom: numVisibleBadges > 1 ? breakpoint : undefined,
|
|
7031
|
-
...componentsProps?.container,
|
|
7032
|
-
className: clsx_default("hide-if-empty", componentsProps?.container?.className),
|
|
7033
|
-
children: badgesElement
|
|
7034
|
-
}),
|
|
7035
|
-
/* @__PURE__ */ jsx_runtime29.jsx(import_core18.Transition, {
|
|
7036
|
-
mounted: numVisibleBadges > 1,
|
|
7037
|
-
transition: "fade",
|
|
7038
|
-
duration: theme.transitionDurations.short,
|
|
7039
|
-
timingFunction: "ease",
|
|
7040
|
-
...componentsProps?.cumulativeBadgeTransition,
|
|
7041
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime29.jsxs(import_core18.HoverCard, {
|
|
7042
|
-
...componentsProps?.HoverCard,
|
|
7043
|
-
children: [
|
|
7044
|
-
/* @__PURE__ */ jsx_runtime29.jsx(import_core18.HoverCard.Target, {
|
|
7045
|
-
children: /* @__PURE__ */ jsx_runtime29.jsxs(import_core18.Badge, {
|
|
7046
|
-
hiddenFrom: breakpoint,
|
|
7047
|
-
variant: "dot",
|
|
7048
|
-
...componentsProps?.cumulativeBadge,
|
|
7049
|
-
style: {
|
|
7050
|
-
cursor: "pointer",
|
|
7051
|
-
...import_lodash15.merge(transitionStyle, componentsProps?.cumulativeBadge?.style)
|
|
7052
|
-
},
|
|
7053
|
-
children: [
|
|
7054
|
-
numVisibleBadges,
|
|
7055
|
-
" badges"
|
|
7056
|
-
]
|
|
7057
|
-
})
|
|
7058
|
-
}),
|
|
7059
|
-
/* @__PURE__ */ jsx_runtime29.jsx(import_core18.HoverCard.Dropdown, {
|
|
7060
|
-
p: gap,
|
|
7061
|
-
children: /* @__PURE__ */ jsx_runtime29.jsx(import_core18.Stack, {
|
|
7062
|
-
gap,
|
|
7063
|
-
...componentsProps?.hoverContainer,
|
|
7064
|
-
children: badgesElement
|
|
7065
|
-
})
|
|
7066
|
-
})
|
|
7067
|
-
]
|
|
7068
|
-
})
|
|
7069
|
-
})
|
|
7070
|
-
]
|
|
7071
|
-
});
|
|
7072
|
-
}
|
|
7073
|
-
// src/core/components/AlertMinimal/index.tsx
|
|
7074
|
-
var import_core19 = require("@mantine/core");
|
|
7075
|
-
var import_lodash16 = __toESM(require_lodash());
|
|
7076
|
-
var jsx_runtime30 = require("react/jsx-runtime");
|
|
7077
|
-
function AlertMinimal({
|
|
7078
|
-
category,
|
|
7079
|
-
children,
|
|
7080
|
-
...props
|
|
7081
|
-
}) {
|
|
7082
|
-
const theme = useRemoraidTheme();
|
|
7083
|
-
const {
|
|
7084
|
-
title,
|
|
7085
|
-
text,
|
|
7086
|
-
color,
|
|
7087
|
-
onClose,
|
|
7088
|
-
mounted = true,
|
|
7089
|
-
icon: Icon4,
|
|
7090
|
-
iconSize = "small" /* Small */,
|
|
7091
|
-
componentsProps
|
|
7092
|
-
} = import_lodash16.merge({}, theme.componentsProps.alerts[category], props);
|
|
7093
|
-
return /* @__PURE__ */ jsx_runtime30.jsx(import_core19.Transition, {
|
|
7094
|
-
mounted,
|
|
7095
|
-
transition: "fade",
|
|
7096
|
-
duration: theme.transitionDurations.short,
|
|
7097
|
-
timingFunction: "ease",
|
|
7098
|
-
...componentsProps?.transition,
|
|
7099
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime30.jsxs(import_core19.Alert, {
|
|
7100
|
-
title,
|
|
7101
|
-
color,
|
|
7102
|
-
variant: "light",
|
|
7103
|
-
onClose,
|
|
7104
|
-
withCloseButton: onClose !== undefined,
|
|
7105
|
-
icon: Icon4 ? /* @__PURE__ */ jsx_runtime30.jsx(Icon4, {
|
|
7106
|
-
...import_lodash16.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
|
|
7107
|
-
}) : undefined,
|
|
7108
|
-
...componentsProps?.alert,
|
|
7109
|
-
style: import_lodash16.merge(transitionStyle, componentsProps?.alert?.style),
|
|
7110
|
-
children: [
|
|
7111
|
-
text,
|
|
7112
|
-
children
|
|
7113
|
-
]
|
|
7114
|
-
})
|
|
7115
|
-
});
|
|
7116
|
-
}
|
|
7117
|
-
// src/core/components/Widget/WidgetWrapper/index.tsx
|
|
7118
|
-
var import_core20 = require("@mantine/core");
|
|
7119
|
-
var import_react22 = require("react");
|
|
7120
|
-
var import_icons_react10 = require("@tabler/icons-react");
|
|
7121
|
-
var import_lodash17 = __toESM(require_lodash());
|
|
7122
|
-
var jsx_runtime31 = require("react/jsx-runtime");
|
|
7123
|
-
function WidgetWrapper({
|
|
7124
|
-
config,
|
|
7125
|
-
mt = 0,
|
|
7126
|
-
withCloseButton = true,
|
|
7127
|
-
pinnableSection,
|
|
7128
|
-
componentsProps,
|
|
7129
|
-
children
|
|
7130
|
-
}) {
|
|
7131
|
-
const {
|
|
7132
|
-
widgets,
|
|
7133
|
-
hideWidget,
|
|
7134
|
-
isPageRegistered,
|
|
7135
|
-
isWidgetRegistered,
|
|
7136
|
-
registerWidget,
|
|
7137
|
-
updateActiveWidget,
|
|
7138
|
-
updateWidgetSelection,
|
|
7139
|
-
activeWidget
|
|
7140
|
-
} = useWidgets();
|
|
7141
|
-
const page = usePage();
|
|
7142
|
-
const theme = useRemoraidTheme();
|
|
7143
|
-
const [controlsContainer, setControlsContainer] = import_react22.useState(null);
|
|
7144
|
-
const widget = page ? widgets[page.pageId]?.[config.widgetId] : undefined;
|
|
7145
|
-
const pageRegistered = page ? isPageRegistered(page.pageId) : false;
|
|
7146
|
-
const containerRef = import_react22.useRef(null);
|
|
7147
|
-
const controlsContainerRef = import_react22.useCallback((n) => {
|
|
7148
|
-
setControlsContainer(n);
|
|
7149
|
-
}, [setControlsContainer]);
|
|
7150
|
-
const handleEnter = () => {
|
|
7151
|
-
updateActiveWidget(config.widgetId);
|
|
7152
|
-
};
|
|
7153
|
-
const handleLeave = (e) => {
|
|
7154
|
-
const to = e.relatedTarget;
|
|
7155
|
-
if (to && to.closest?.("[data-control-button]")) {
|
|
7156
|
-
return;
|
|
7157
|
-
}
|
|
7158
|
-
updateActiveWidget(null);
|
|
7159
|
-
};
|
|
7160
|
-
const mounted = Boolean(widget?.selected);
|
|
7161
|
-
let element = /* @__PURE__ */ jsx_runtime31.jsx(import_core20.Transition, {
|
|
7162
|
-
mounted,
|
|
7163
|
-
transition: "fade-left",
|
|
7164
|
-
duration: theme.transitionDurations.medium,
|
|
7165
|
-
timingFunction: "ease",
|
|
7166
|
-
...componentsProps?.transition,
|
|
7167
|
-
onExited: () => {
|
|
7168
|
-
if (page) {
|
|
7169
|
-
hideWidget(page.pageId, config.widgetId);
|
|
7170
|
-
}
|
|
7171
|
-
componentsProps?.transition?.onExited?.();
|
|
7172
|
-
},
|
|
7173
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime31.jsxs(import_core20.Paper, {
|
|
7174
|
-
ref: containerRef,
|
|
7175
|
-
p: "md",
|
|
7176
|
-
shadow: "md",
|
|
7177
|
-
bg: theme.transparentBackground,
|
|
7178
|
-
mt,
|
|
7179
|
-
pos: "relative",
|
|
7180
|
-
h: "fit-content",
|
|
7181
|
-
mah: "100%",
|
|
7182
|
-
display: "flex",
|
|
7183
|
-
...componentsProps?.container,
|
|
7184
|
-
onMouseEnter: (e) => {
|
|
7185
|
-
handleEnter();
|
|
7186
|
-
componentsProps?.container?.onMouseEnter?.(e);
|
|
7187
|
-
},
|
|
7188
|
-
onMouseLeave: (e) => {
|
|
7189
|
-
handleLeave(e);
|
|
7190
|
-
componentsProps?.container?.onMouseLeave?.(e);
|
|
7191
|
-
},
|
|
7192
|
-
style: import_lodash17.merge(transitionStyle, { flexDirection: "column" }, componentsProps?.container?.style),
|
|
7193
|
-
className: clsx_default("remoraid-segment", componentsProps?.container?.className),
|
|
7194
|
-
id: config.widgetId,
|
|
7195
|
-
children: [
|
|
7196
|
-
/* @__PURE__ */ jsx_runtime31.jsx(Controls, {
|
|
7197
|
-
dragContainerRef: containerRef,
|
|
7198
|
-
groupRef: controlsContainerRef,
|
|
7199
|
-
mounted: activeWidget === config.widgetId,
|
|
7200
|
-
...componentsProps?.controls,
|
|
7201
|
-
children: /* @__PURE__ */ jsx_runtime31.jsx(ControlButton, {
|
|
7202
|
-
mounted: withCloseButton,
|
|
7203
|
-
icon: import_icons_react10.IconX,
|
|
7204
|
-
tooltip: "Hide widget",
|
|
7205
|
-
color: "red",
|
|
7206
|
-
order: 200,
|
|
7207
|
-
...componentsProps?.closeButton,
|
|
7208
|
-
componentsProps: {
|
|
7209
|
-
...componentsProps?.closeButton?.componentsProps,
|
|
7210
|
-
tooltip: {
|
|
7211
|
-
disabled: !mounted,
|
|
7212
|
-
...componentsProps?.closeButton?.componentsProps?.tooltip
|
|
7213
|
-
}
|
|
7214
|
-
},
|
|
7215
|
-
onClick: (e) => {
|
|
7216
|
-
if (!page) {
|
|
7217
|
-
return;
|
|
7218
|
-
}
|
|
7219
|
-
updateWidgetSelection(page.pageId, config.widgetId, false);
|
|
7220
|
-
handleLeave(e);
|
|
7221
|
-
componentsProps?.closeButton?.onClick?.(e);
|
|
7222
|
-
}
|
|
7223
|
-
})
|
|
7224
|
-
}),
|
|
7225
|
-
children
|
|
7226
|
-
]
|
|
7227
|
-
})
|
|
7228
|
-
});
|
|
7229
|
-
if (pinnableSection !== undefined) {
|
|
7230
|
-
element = /* @__PURE__ */ jsx_runtime31.jsx(Pinnable, {
|
|
7231
|
-
section: pinnableSection,
|
|
7232
|
-
controlsContainer,
|
|
7233
|
-
hidden: Boolean(widget?.hidden),
|
|
7234
|
-
...componentsProps?.Pinnable,
|
|
7235
|
-
componentsProps: {
|
|
7236
|
-
...componentsProps?.Pinnable?.componentsProps,
|
|
7237
|
-
button: {
|
|
7238
|
-
...componentsProps?.Pinnable?.componentsProps?.button,
|
|
7239
|
-
onClick: (e) => {
|
|
7240
|
-
handleLeave(e);
|
|
7241
|
-
componentsProps?.Pinnable?.componentsProps?.button?.onClick?.(e);
|
|
7242
|
-
}
|
|
7243
|
-
},
|
|
7244
|
-
layoutElement: {
|
|
7245
|
-
includeContainer: false,
|
|
7246
|
-
includePageContainer: pinnableSection === "top" /* Top */ || pinnableSection === "bottom" /* Bottom */,
|
|
7247
|
-
...componentsProps?.Pinnable?.componentsProps?.layoutElement
|
|
7248
|
-
}
|
|
7249
|
-
},
|
|
7250
|
-
children: element
|
|
7251
|
-
});
|
|
7252
|
-
}
|
|
7253
|
-
import_react22.useEffect(() => {
|
|
7254
|
-
if (!page) {
|
|
7255
|
-
return;
|
|
7256
|
-
}
|
|
7257
|
-
if (!isWidgetRegistered(page.pageId, config.widgetId)) {
|
|
7258
|
-
registerWidget(page.pageId, config);
|
|
7259
|
-
}
|
|
7260
|
-
}, [pageRegistered]);
|
|
7261
|
-
return element;
|
|
7262
|
-
}
|
|
7263
|
-
// src/core/components/Widget/index.tsx
|
|
7264
|
-
var import_core21 = require("@mantine/core");
|
|
7265
|
-
var import_react23 = require("react");
|
|
7266
|
-
var import_lodash18 = __toESM(require_lodash());
|
|
7267
|
-
var jsx_runtime32 = require("react/jsx-runtime");
|
|
7268
|
-
var react2 = require("react");
|
|
7269
|
-
function Widget({
|
|
7270
|
-
id,
|
|
7271
|
-
title,
|
|
7272
|
-
description,
|
|
7273
|
-
config,
|
|
7274
|
-
badges: badgesProp,
|
|
7275
|
-
buttons: buttonsProp,
|
|
7276
|
-
alerts: alertsProp,
|
|
7277
|
-
gaps,
|
|
7278
|
-
loading,
|
|
7279
|
-
mt,
|
|
7280
|
-
pinnableSection,
|
|
7281
|
-
componentsProps,
|
|
7282
|
-
children
|
|
7283
|
-
}) {
|
|
7284
|
-
const buttons = buttonsProp?.map((button) => asElementOrPropsOfType(RemoraidButton, button, "Check the 'buttons' property of this widget."));
|
|
7285
|
-
const alerts = alertsProp?.map((alert) => asElementOrPropsOfType(AlertMinimal, alert, "Check the 'alerts' property of this widget."));
|
|
7286
|
-
const badges = badgesProp?.map((badge) => asElementOrPropsOfType(BadgeMinimal, badge, "Check the 'badges' property of this widget."));
|
|
7287
|
-
const badgesGap = (typeof gaps === "object" ? gaps.badges : gaps) ?? "xs";
|
|
7288
|
-
const buttonsGap = (typeof gaps === "object" ? gaps.buttons : gaps) ?? "xs";
|
|
7289
|
-
const alertsGap = (typeof gaps === "object" ? gaps.alerts : gaps) ?? "xs";
|
|
7290
|
-
return /* @__PURE__ */ jsx_runtime32.jsx(WidgetWrapper, {
|
|
7291
|
-
config: {
|
|
7292
|
-
widgetId: id,
|
|
7293
|
-
...config,
|
|
7294
|
-
initialValues: {
|
|
7295
|
-
name: title,
|
|
7296
|
-
...config?.initialValues
|
|
7297
|
-
}
|
|
7298
|
-
},
|
|
7299
|
-
mt,
|
|
7300
|
-
...componentsProps?.wrapper,
|
|
7301
|
-
pinnableSection: pinnableSection ?? componentsProps?.wrapper?.pinnableSection,
|
|
7302
|
-
children: /* @__PURE__ */ jsx_runtime32.jsxs(import_core21.Stack, {
|
|
7303
|
-
gap: "md",
|
|
7304
|
-
mih: 0,
|
|
7305
|
-
...componentsProps?.contentContainer,
|
|
7306
|
-
children: [
|
|
7307
|
-
/* @__PURE__ */ jsx_runtime32.jsxs(import_core21.Group, {
|
|
7308
|
-
justify: "space-between",
|
|
7309
|
-
wrap: "nowrap",
|
|
7310
|
-
children: [
|
|
7311
|
-
/* @__PURE__ */ jsx_runtime32.jsxs(import_core21.Stack, {
|
|
7312
|
-
gap: 4,
|
|
7313
|
-
children: [
|
|
7314
|
-
/* @__PURE__ */ jsx_runtime32.jsxs(import_core21.Group, {
|
|
7315
|
-
gap: badgesGap,
|
|
7316
|
-
wrap: "nowrap",
|
|
7317
|
-
children: [
|
|
7318
|
-
/* @__PURE__ */ jsx_runtime32.jsx(import_core21.Title, {
|
|
7319
|
-
order: 1,
|
|
7320
|
-
size: "h2",
|
|
7321
|
-
lineClamp: 1,
|
|
7322
|
-
...componentsProps?.title,
|
|
7323
|
-
children: title ?? id
|
|
7324
|
-
}),
|
|
7325
|
-
badges !== undefined && /* @__PURE__ */ jsx_runtime32.jsx(BadgeGroup, {
|
|
7326
|
-
badges,
|
|
7327
|
-
gap: badgesGap,
|
|
7328
|
-
...componentsProps?.badgeGroup
|
|
7329
|
-
})
|
|
7330
|
-
]
|
|
7331
|
-
}),
|
|
7332
|
-
/* @__PURE__ */ jsx_runtime32.jsx(import_core21.Transition, {
|
|
7333
|
-
mounted: Boolean(description),
|
|
7334
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime32.jsx(import_core21.Text, {
|
|
7335
|
-
size: "sm",
|
|
7336
|
-
c: "dimmed",
|
|
7337
|
-
...componentsProps?.description,
|
|
7338
|
-
style: import_lodash18.merge(transitionStyle, componentsProps?.description?.style),
|
|
7339
|
-
children: description
|
|
7340
|
-
})
|
|
7341
|
-
})
|
|
7342
|
-
]
|
|
7343
|
-
}),
|
|
7344
|
-
/* @__PURE__ */ jsx_runtime32.jsx(import_core21.Group, {
|
|
7345
|
-
gap: buttonsGap,
|
|
7346
|
-
wrap: "nowrap",
|
|
7347
|
-
children: buttons !== undefined && buttons.map((button, i) => {
|
|
7348
|
-
if (isValidElementOfType(RemoraidButton, button)) {
|
|
7349
|
-
return button;
|
|
7350
|
-
}
|
|
7351
|
-
return /* @__PURE__ */ react2.createElement(RemoraidButton, {
|
|
7352
|
-
...button,
|
|
7353
|
-
key: i
|
|
7354
|
-
});
|
|
7355
|
-
})
|
|
7356
|
-
})
|
|
7357
|
-
]
|
|
7358
|
-
}),
|
|
7359
|
-
/* @__PURE__ */ jsx_runtime32.jsx(import_core21.Box, {
|
|
7360
|
-
children: /* @__PURE__ */ jsx_runtime32.jsx(import_core21.Divider, {
|
|
7361
|
-
...componentsProps?.divider
|
|
7362
|
-
})
|
|
7363
|
-
}),
|
|
7364
|
-
/* @__PURE__ */ jsx_runtime32.jsx(import_core21.Stack, {
|
|
7365
|
-
align: "stretch",
|
|
7366
|
-
gap: alertsGap,
|
|
7367
|
-
...componentsProps?.alertsContainer,
|
|
7368
|
-
className: clsx_default("hide-if-empty", componentsProps?.alertsContainer?.className),
|
|
7369
|
-
children: alerts?.map((alert, i) => {
|
|
7370
|
-
if (isValidElementOfType(AlertMinimal, alert)) {
|
|
7371
|
-
return alert;
|
|
7372
|
-
}
|
|
7373
|
-
return /* @__PURE__ */ react2.createElement(AlertMinimal, {
|
|
7374
|
-
...alert,
|
|
7375
|
-
key: i
|
|
7376
|
-
});
|
|
7377
|
-
})
|
|
7378
|
-
}),
|
|
7379
|
-
(loading || import_react23.Children.toArray(children).length > 0) && /* @__PURE__ */ jsx_runtime32.jsx(import_core21.ScrollArea.Autosize, {
|
|
7380
|
-
flex: 1,
|
|
7381
|
-
...componentsProps?.childrenContainer,
|
|
7382
|
-
className: clsx_default("remoraid-widget-children-container", componentsProps?.childrenContainer?.className),
|
|
7383
|
-
children: loading ? /* @__PURE__ */ jsx_runtime32.jsx(import_core21.Center, {
|
|
7384
|
-
children: /* @__PURE__ */ jsx_runtime32.jsx(import_core21.Loader, {
|
|
7385
|
-
...componentsProps?.loader
|
|
7386
|
-
})
|
|
7387
|
-
}) : children
|
|
7388
|
-
})
|
|
7389
|
-
]
|
|
7390
|
-
})
|
|
7391
|
-
});
|
|
7392
|
-
}
|
|
7393
|
-
// src/core/components/NotFoundPage/index.tsx
|
|
7394
|
-
var jsx_runtime33 = require("react/jsx-runtime");
|
|
7395
|
-
// src/core/components/EnvironmentShell/index.tsx
|
|
7396
|
-
var jsx_runtime34 = require("react/jsx-runtime");
|
|
7397
|
-
// src/core/components/SettingsWidget/index.tsx
|
|
7398
|
-
var import_react24 = require("react");
|
|
7399
|
-
var import_icons_react12 = require("@tabler/icons-react");
|
|
7400
|
-
|
|
7401
|
-
// src/core/components/SettingsWidget/SaveButton/index.tsx
|
|
7402
|
-
var import_icons_react11 = require("@tabler/icons-react");
|
|
7403
|
-
var import_core22 = require("@mantine/core");
|
|
7404
|
-
var jsx_runtime35 = require("react/jsx-runtime");
|
|
7405
|
-
function SaveButton({
|
|
7406
|
-
onSaveChanges,
|
|
7407
|
-
insideContainer,
|
|
7408
|
-
componentsProps
|
|
7409
|
-
}) {
|
|
7410
|
-
const settingsWidgetOptions = useSettingsWidgetContext();
|
|
7411
|
-
const button = /* @__PURE__ */ jsx_runtime35.jsx(RemoraidButton, {
|
|
7412
|
-
label: "Save Changes",
|
|
7413
|
-
icon: import_icons_react11.IconDeviceFloppy,
|
|
7414
|
-
onClick: onSaveChanges,
|
|
7415
|
-
responsive: false,
|
|
7416
|
-
...componentsProps?.button,
|
|
7417
|
-
componentsProps: {
|
|
7418
|
-
...componentsProps?.button?.componentsProps,
|
|
7419
|
-
button: {
|
|
7420
|
-
disabled: settingsWidgetOptions.unsavedChanges === false,
|
|
7421
|
-
...componentsProps?.button?.componentsProps?.button
|
|
7422
|
-
}
|
|
7423
|
-
}
|
|
7424
|
-
});
|
|
7425
|
-
if (insideContainer !== false) {
|
|
7426
|
-
return /* @__PURE__ */ jsx_runtime35.jsx(import_core22.Group, {
|
|
7427
|
-
w: "100%",
|
|
7428
|
-
justify: "flex-end",
|
|
7429
|
-
mt: "md",
|
|
7430
|
-
...componentsProps?.container,
|
|
7431
|
-
children: button
|
|
7432
|
-
});
|
|
7433
|
-
}
|
|
7434
|
-
return button;
|
|
7435
|
-
}
|
|
7436
|
-
|
|
7437
|
-
// src/core/components/SettingsWidget/index.tsx
|
|
7438
|
-
var jsx_runtime36 = require("react/jsx-runtime");
|
|
7439
|
-
var defaultSettingsWidgetContext = {};
|
|
7440
|
-
var settingsWidgetContext = import_react24.createContext(defaultSettingsWidgetContext);
|
|
7441
|
-
var useSettingsWidgetContext = () => {
|
|
7442
|
-
return import_react24.useContext(settingsWidgetContext);
|
|
7443
|
-
};
|
|
7444
|
-
function SettingsWidget({
|
|
7445
|
-
children,
|
|
7446
|
-
onRestoreDefaultValues,
|
|
7447
|
-
unsavedChanges,
|
|
7448
|
-
custom,
|
|
7449
|
-
widgetProps
|
|
7450
|
-
}) {
|
|
7451
|
-
return /* @__PURE__ */ jsx_runtime36.jsx(settingsWidgetContext.Provider, {
|
|
7452
|
-
value: { custom, unsavedChanges },
|
|
7453
|
-
children: /* @__PURE__ */ jsx_runtime36.jsx(Widget, {
|
|
7454
|
-
title: "Settings",
|
|
7455
|
-
id: "settings",
|
|
7456
|
-
...widgetProps,
|
|
7457
|
-
buttons: [
|
|
7458
|
-
...onRestoreDefaultValues ? [
|
|
7459
|
-
{
|
|
7460
|
-
label: "Restore Default Values",
|
|
7461
|
-
icon: import_icons_react12.IconRestore,
|
|
7462
|
-
onClick: onRestoreDefaultValues,
|
|
7463
|
-
componentsProps: { button: { disabled: custom === false } }
|
|
7464
|
-
}
|
|
7465
|
-
] : [],
|
|
7466
|
-
...widgetProps?.buttons ?? []
|
|
7467
|
-
],
|
|
7468
|
-
badges: [
|
|
7469
|
-
{
|
|
7470
|
-
label: "Custom",
|
|
7471
|
-
tooltip: "Your settings differ from the default settings",
|
|
7472
|
-
mounted: custom ?? false
|
|
7473
|
-
},
|
|
7474
|
-
{
|
|
7475
|
-
label: "Unsaved Changes",
|
|
7476
|
-
mounted: unsavedChanges ?? false
|
|
7477
|
-
},
|
|
7478
|
-
...widgetProps?.badges ?? []
|
|
7479
|
-
],
|
|
7480
|
-
children
|
|
7481
|
-
})
|
|
7482
|
-
});
|
|
7483
|
-
}
|
|
7484
|
-
var SettingsWidget_default = Object.assign(SettingsWidget, {
|
|
7485
|
-
SaveButton
|
|
7486
|
-
});
|
|
7487
|
-
// src/core/components/SettingsWidget/SettingsTable/index.tsx
|
|
7488
|
-
var import_react25 = require("react");
|
|
7489
|
-
var import_core24 = require("@mantine/core");
|
|
7490
|
-
|
|
7491
|
-
// src/core/components/SettingsWidget/SettingsTable/Row/index.tsx
|
|
7492
|
-
var import_core23 = require("@mantine/core");
|
|
7493
|
-
var jsx_runtime37 = require("react/jsx-runtime");
|
|
7494
|
-
function Row({
|
|
7495
|
-
children,
|
|
7496
|
-
label
|
|
7497
|
-
}) {
|
|
7498
|
-
const options = useSettingsTableOptions();
|
|
7499
|
-
return /* @__PURE__ */ jsx_runtime37.jsxs(import_core23.Table.Tr, {
|
|
7500
|
-
children: [
|
|
7501
|
-
/* @__PURE__ */ jsx_runtime37.jsx(import_core23.Table.Th, {
|
|
7502
|
-
w: options.leftColumnWidth,
|
|
7503
|
-
children: /* @__PURE__ */ jsx_runtime37.jsx(import_core23.Text, {
|
|
7504
|
-
size: "sm",
|
|
7505
|
-
children: label
|
|
7506
|
-
})
|
|
7507
|
-
}),
|
|
7508
|
-
/* @__PURE__ */ jsx_runtime37.jsx(import_core23.Table.Td, {
|
|
7509
|
-
py: "xs",
|
|
7510
|
-
children
|
|
7511
|
-
})
|
|
7512
|
-
]
|
|
7513
|
-
});
|
|
7514
|
-
}
|
|
7515
|
-
|
|
7516
|
-
// src/core/components/SettingsWidget/SettingsTable/index.tsx
|
|
7517
|
-
var jsx_runtime38 = require("react/jsx-runtime");
|
|
7518
|
-
var defaultSettingsTableOptions = {
|
|
7519
|
-
leftColumnWidth: "38.2%"
|
|
7520
|
-
};
|
|
7521
|
-
var settingsTableOptionsContext = import_react25.createContext(defaultSettingsTableOptions);
|
|
7522
|
-
var useSettingsTableOptions = () => {
|
|
7523
|
-
return import_react25.useContext(settingsTableOptionsContext);
|
|
7524
|
-
};
|
|
7525
|
-
function SettingsTable({
|
|
7526
|
-
leftColumnWidth,
|
|
7527
|
-
children: childrenProp
|
|
7528
|
-
}) {
|
|
7529
|
-
const children = asChildrenOfType(Row, childrenProp, "Check children passed to 'SettingsTable' component.");
|
|
7530
|
-
const theme = useRemoraidTheme();
|
|
7531
|
-
return /* @__PURE__ */ jsx_runtime38.jsx(settingsTableOptionsContext.Provider, {
|
|
7532
|
-
value: {
|
|
7533
|
-
leftColumnWidth: leftColumnWidth ?? defaultSettingsTableOptions.leftColumnWidth
|
|
7534
|
-
},
|
|
7535
|
-
children: /* @__PURE__ */ jsx_runtime38.jsx(import_core24.Table, {
|
|
7536
|
-
bg: theme.transparentBackground,
|
|
7537
|
-
withTableBorder: true,
|
|
7538
|
-
variant: "vertical",
|
|
7539
|
-
layout: "fixed",
|
|
7540
|
-
children: /* @__PURE__ */ jsx_runtime38.jsx(import_core24.Table.Tbody, {
|
|
7541
|
-
children
|
|
7542
|
-
})
|
|
7543
|
-
})
|
|
7544
|
-
});
|
|
7545
|
-
}
|
|
7546
|
-
var SettingsTable_default = Object.assign(SettingsTable, {
|
|
7547
|
-
Row
|
|
7548
|
-
});
|
|
7549
|
-
// src/core/components/NavbarSettingsWidget/index.tsx
|
|
7550
|
-
var import_lodash19 = __toESM(require_lodash());
|
|
7551
|
-
var import_core25 = require("@mantine/core");
|
|
7552
|
-
var jsx_runtime39 = require("react/jsx-runtime");
|
|
7553
|
-
// src/core/components/FooterSettingsWidget/index.tsx
|
|
7554
|
-
var import_lodash20 = __toESM(require_lodash());
|
|
7555
|
-
var import_core26 = require("@mantine/core");
|
|
7556
|
-
var jsx_runtime40 = require("react/jsx-runtime");
|
|
7557
|
-
// src/core/components/ContextClusterProvider/index.tsx
|
|
7558
|
-
var import_react26 = __toESM(require("react"));
|
|
7559
|
-
var jsx_runtime41 = require("react/jsx-runtime");
|
|
7560
|
-
// src/core/components/InputWrapperScrollArea/index.tsx
|
|
7561
|
-
var import_core27 = require("@mantine/core");
|
|
7562
|
-
var import_react27 = require("react");
|
|
7563
|
-
var import_core28 = require("remoraid/core");
|
|
7564
|
-
var jsx_runtime42 = require("react/jsx-runtime");
|
|
7565
|
-
function InputWrapperScrollArea({
|
|
7566
|
-
children,
|
|
7567
|
-
label,
|
|
7568
|
-
mah,
|
|
7569
|
-
description,
|
|
7570
|
-
error,
|
|
7571
|
-
required = false,
|
|
7572
|
-
componentsProps
|
|
7573
|
-
}) {
|
|
7574
|
-
const theme = import_core28.useRemoraidTheme();
|
|
7575
|
-
const [isHovering, setIsHovering] = import_react27.useState(false);
|
|
7576
|
-
return /* @__PURE__ */ jsx_runtime42.jsx(import_core27.Input.Wrapper, {
|
|
7577
|
-
label,
|
|
7578
|
-
error,
|
|
7579
|
-
onMouseEnter: () => setIsHovering(true),
|
|
7580
|
-
onMouseLeave: () => setIsHovering(false),
|
|
7581
|
-
description,
|
|
7582
|
-
withAsterisk: required,
|
|
7583
|
-
...componentsProps?.container,
|
|
7584
|
-
children: /* @__PURE__ */ jsx_runtime42.jsx(import_core27.Paper, {
|
|
7585
|
-
shadow: "none",
|
|
7586
|
-
p: 0,
|
|
7587
|
-
mt: Boolean(description) ? 4 : 0,
|
|
7588
|
-
withBorder: true,
|
|
7589
|
-
display: "flex",
|
|
7590
|
-
bg: theme.transparentBackground,
|
|
7591
|
-
style: {
|
|
7592
|
-
transition: "border-color .1s",
|
|
7593
|
-
borderColor: error ? "var(--mantine-color-error)" : isHovering ? "var(--mantine-primary-color-filled)" : undefined
|
|
7594
|
-
},
|
|
7595
|
-
children: /* @__PURE__ */ jsx_runtime42.jsx(import_core27.ScrollArea, {
|
|
7596
|
-
mah,
|
|
7597
|
-
px: "md",
|
|
7598
|
-
flex: 1,
|
|
7599
|
-
...componentsProps?.ScrollArea,
|
|
7600
|
-
children: /* @__PURE__ */ jsx_runtime42.jsx(import_core27.Box, {
|
|
7601
|
-
...componentsProps?.childrenContainer,
|
|
7602
|
-
children
|
|
7603
|
-
})
|
|
7604
|
-
})
|
|
7605
|
-
})
|
|
7606
|
-
});
|
|
7607
|
-
}
|
|
7608
|
-
// src/jsonforms/renderers/AnyControl.tsx
|
|
7609
|
-
var import_react29 = require("@jsonforms/react");
|
|
7610
|
-
var import_core30 = require("@mantine/core");
|
|
7611
|
-
var import_react30 = require("react");
|
|
7612
5479
|
|
|
7613
5480
|
// src/jsonforms/components/FormOptionsProvider/index.tsx
|
|
7614
|
-
var
|
|
7615
|
-
var
|
|
5481
|
+
var import_react = __toESM(require("react"));
|
|
5482
|
+
var jsx_runtime = require("react/jsx-runtime");
|
|
7616
5483
|
var defaultFormOptions = {
|
|
7617
5484
|
withDescriptions: false,
|
|
7618
5485
|
gutter: "md"
|
|
7619
5486
|
};
|
|
7620
|
-
var formOptionsContext =
|
|
5487
|
+
var formOptionsContext = import_react.default.createContext({
|
|
7621
5488
|
formOptions: defaultFormOptions,
|
|
7622
5489
|
updateFormOptions: () => {}
|
|
7623
5490
|
});
|
|
7624
|
-
var useFormOptions = () =>
|
|
5491
|
+
var useFormOptions = () => import_react.useContext(formOptionsContext);
|
|
7625
5492
|
function FormOptionsProvider({
|
|
7626
5493
|
children,
|
|
7627
5494
|
initialValue
|
|
7628
5495
|
}) {
|
|
7629
|
-
const [formOptions, setFormOptions] =
|
|
5496
|
+
const [formOptions, setFormOptions] = import_react.useState({
|
|
7630
5497
|
...defaultFormOptions,
|
|
7631
5498
|
...initialValue
|
|
7632
5499
|
});
|
|
7633
5500
|
const updateFormOptions = (newFormOptions) => {
|
|
7634
5501
|
setFormOptions((prev) => ({ ...prev, ...newFormOptions }));
|
|
7635
5502
|
};
|
|
7636
|
-
return /* @__PURE__ */
|
|
5503
|
+
return /* @__PURE__ */ jsx_runtime.jsx(formOptionsContext.Provider, {
|
|
7637
5504
|
value: { formOptions, updateFormOptions },
|
|
7638
5505
|
children
|
|
7639
5506
|
});
|
|
7640
5507
|
}
|
|
7641
5508
|
|
|
7642
5509
|
// src/jsonforms/renderers/AnyControl.tsx
|
|
7643
|
-
var
|
|
5510
|
+
var jsx_runtime2 = require("react/jsx-runtime");
|
|
7644
5511
|
function PlainAnyControl({
|
|
7645
5512
|
data,
|
|
7646
5513
|
handleChange,
|
|
@@ -7649,21 +5516,21 @@ function PlainAnyControl({
|
|
|
7649
5516
|
required,
|
|
7650
5517
|
schema
|
|
7651
5518
|
}) {
|
|
7652
|
-
const theme = useRemoraidTheme();
|
|
5519
|
+
const theme = import_core.useRemoraidTheme();
|
|
7653
5520
|
const {
|
|
7654
5521
|
formOptions: { withDescriptions }
|
|
7655
5522
|
} = useFormOptions();
|
|
7656
|
-
const [input, setInput] =
|
|
7657
|
-
const [error, setError] =
|
|
5523
|
+
const [input, setInput] = import_react3.useState(JSON.stringify(data, null, theme.jsonStringifySpace));
|
|
5524
|
+
const [error, setError] = import_react3.useState(false);
|
|
7658
5525
|
const label = labelProp !== "remoraid-array-item" ? labelProp : null;
|
|
7659
5526
|
const description = withDescriptions ? schema.description : undefined;
|
|
7660
|
-
return /* @__PURE__ */
|
|
5527
|
+
return /* @__PURE__ */ jsx_runtime2.jsx(import_core.InputWrapperScrollArea, {
|
|
7661
5528
|
label: label ?? undefined,
|
|
7662
5529
|
error: error ? "Invalid JSON" : undefined,
|
|
7663
5530
|
description,
|
|
7664
5531
|
required,
|
|
7665
5532
|
mah: 140,
|
|
7666
|
-
children: /* @__PURE__ */
|
|
5533
|
+
children: /* @__PURE__ */ jsx_runtime2.jsx(import_core2.JsonInput, {
|
|
7667
5534
|
onChange: (newValue) => {
|
|
7668
5535
|
setInput(newValue);
|
|
7669
5536
|
try {
|
|
@@ -7684,15 +5551,15 @@ function PlainAnyControl({
|
|
|
7684
5551
|
})
|
|
7685
5552
|
});
|
|
7686
5553
|
}
|
|
7687
|
-
var AnyControl =
|
|
5554
|
+
var AnyControl = import_react2.withJsonFormsControlProps(PlainAnyControl);
|
|
7688
5555
|
var AnyControl_default = AnyControl;
|
|
7689
5556
|
|
|
7690
5557
|
// src/jsonforms/renderers/AnyOfControl.tsx
|
|
7691
|
-
var
|
|
7692
|
-
var
|
|
7693
|
-
var
|
|
7694
|
-
var
|
|
7695
|
-
var
|
|
5558
|
+
var import_react4 = require("@jsonforms/react");
|
|
5559
|
+
var import_core3 = require("@jsonforms/core");
|
|
5560
|
+
var import_core4 = require("@mantine/core");
|
|
5561
|
+
var import_react5 = require("react");
|
|
5562
|
+
var jsx_runtime3 = require("react/jsx-runtime");
|
|
7696
5563
|
function PlainAnyOfControl({
|
|
7697
5564
|
data,
|
|
7698
5565
|
schema,
|
|
@@ -7703,7 +5570,7 @@ function PlainAnyOfControl({
|
|
|
7703
5570
|
rootSchema
|
|
7704
5571
|
}) {
|
|
7705
5572
|
const { formOptions } = useFormOptions();
|
|
7706
|
-
const { core, renderers, cells } =
|
|
5573
|
+
const { core, renderers, cells } = import_react4.useJsonForms();
|
|
7707
5574
|
const inferType = (schema2) => {
|
|
7708
5575
|
if (!schema2) {
|
|
7709
5576
|
return;
|
|
@@ -7723,17 +5590,17 @@ function PlainAnyOfControl({
|
|
|
7723
5590
|
}
|
|
7724
5591
|
return;
|
|
7725
5592
|
};
|
|
7726
|
-
const options =
|
|
5593
|
+
const options = import_react5.useMemo(() => {
|
|
7727
5594
|
const anyOf = schema.anyOf ?? [];
|
|
7728
5595
|
return anyOf.map((opt, idx) => {
|
|
7729
|
-
const resolved = opt.$ref ?
|
|
5596
|
+
const resolved = opt.$ref ? import_core3.Resolve.schema(rootSchema, opt.$ref, rootSchema) : opt;
|
|
7730
5597
|
const refLabel = typeof opt.$ref === "string" ? opt.$ref.split("/").slice(-1)[0] : undefined;
|
|
7731
5598
|
const typeLabel = inferType(resolved) ?? inferType(opt);
|
|
7732
5599
|
const label2 = resolved?.title ?? refLabel ?? typeLabel ?? `Option ${idx + 1}`;
|
|
7733
5600
|
return { original: opt, resolved, label: label2 };
|
|
7734
5601
|
});
|
|
7735
5602
|
}, [schema.anyOf, rootSchema]);
|
|
7736
|
-
const isValidOptionIndex =
|
|
5603
|
+
const isValidOptionIndex = import_react5.useMemo(() => {
|
|
7737
5604
|
return (optionIndex) => {
|
|
7738
5605
|
if (!core?.ajv || data === undefined) {
|
|
7739
5606
|
return false;
|
|
@@ -7742,7 +5609,7 @@ function PlainAnyOfControl({
|
|
|
7742
5609
|
return validate(data);
|
|
7743
5610
|
};
|
|
7744
5611
|
}, [core?.ajv, data, options]);
|
|
7745
|
-
const validOptionIndex =
|
|
5612
|
+
const validOptionIndex = import_react5.useMemo(() => {
|
|
7746
5613
|
for (let i = 0;i < options.length; i++) {
|
|
7747
5614
|
if (isValidOptionIndex(i)) {
|
|
7748
5615
|
return i;
|
|
@@ -7750,7 +5617,7 @@ function PlainAnyOfControl({
|
|
|
7750
5617
|
}
|
|
7751
5618
|
return -1;
|
|
7752
5619
|
}, [options, isValidOptionIndex]);
|
|
7753
|
-
const [selectedOption, setSelectedOption] =
|
|
5620
|
+
const [selectedOption, setSelectedOption] = import_react5.useState(validOptionIndex >= 0 ? String(validOptionIndex) : null);
|
|
7754
5621
|
const schemaDefaultValue = (opt) => {
|
|
7755
5622
|
const t = opt.type ?? (opt.properties ? "object" : opt.items ? "array" : undefined);
|
|
7756
5623
|
switch (t) {
|
|
@@ -7776,19 +5643,19 @@ function PlainAnyOfControl({
|
|
|
7776
5643
|
value: String(i),
|
|
7777
5644
|
label: o.label
|
|
7778
5645
|
}));
|
|
7779
|
-
return /* @__PURE__ */
|
|
7780
|
-
children: /* @__PURE__ */
|
|
5646
|
+
return /* @__PURE__ */ jsx_runtime3.jsx(jsx_runtime3.Fragment, {
|
|
5647
|
+
children: /* @__PURE__ */ jsx_runtime3.jsx(import_core4.Input.Wrapper, {
|
|
7781
5648
|
label,
|
|
7782
5649
|
description: formOptions.withDescriptions ? schema.description ?? null : null,
|
|
7783
5650
|
withAsterisk: required,
|
|
7784
|
-
children: /* @__PURE__ */
|
|
5651
|
+
children: /* @__PURE__ */ jsx_runtime3.jsxs(import_core4.Paper, {
|
|
7785
5652
|
withBorder: true,
|
|
7786
5653
|
shadow: "0",
|
|
7787
5654
|
bg: "var(--remoraid-transparent-background)",
|
|
7788
5655
|
p: formOptions.gutter,
|
|
7789
5656
|
mt: formOptions.withDescriptions && schema.description && schema.description.length > 0 ? 4 : 0,
|
|
7790
5657
|
children: [
|
|
7791
|
-
/* @__PURE__ */
|
|
5658
|
+
/* @__PURE__ */ jsx_runtime3.jsx(import_core4.Select, {
|
|
7792
5659
|
label: "Value type",
|
|
7793
5660
|
data: selectData,
|
|
7794
5661
|
value: selectedOption,
|
|
@@ -7809,7 +5676,7 @@ function PlainAnyOfControl({
|
|
|
7809
5676
|
variant: "default",
|
|
7810
5677
|
mb: selectedOption !== null && inferType(selectedSchema) !== "null" ? formOptions.gutter : undefined
|
|
7811
5678
|
}),
|
|
7812
|
-
selectedOption !== null && /* @__PURE__ */
|
|
5679
|
+
selectedOption !== null && /* @__PURE__ */ jsx_runtime3.jsx(import_react4.JsonForms, {
|
|
7813
5680
|
schema: {
|
|
7814
5681
|
...selectedSchema,
|
|
7815
5682
|
$schema: undefined
|
|
@@ -7827,21 +5694,21 @@ function PlainAnyOfControl({
|
|
|
7827
5694
|
})
|
|
7828
5695
|
});
|
|
7829
5696
|
}
|
|
7830
|
-
var AnyOfControl =
|
|
5697
|
+
var AnyOfControl = import_react4.withJsonFormsControlProps(PlainAnyOfControl);
|
|
7831
5698
|
var AnyOfControl_default = AnyOfControl;
|
|
7832
5699
|
|
|
7833
5700
|
// src/jsonforms/renderers/ArrayControl.tsx
|
|
7834
|
-
var
|
|
7835
|
-
var
|
|
7836
|
-
var
|
|
7837
|
-
var
|
|
7838
|
-
var
|
|
7839
|
-
var
|
|
5701
|
+
var import_react6 = require("@jsonforms/react");
|
|
5702
|
+
var import_core5 = require("@mantine/core");
|
|
5703
|
+
var import_icons_react = require("@tabler/icons-react");
|
|
5704
|
+
var import_core6 = require("remoraid/core");
|
|
5705
|
+
var import_lodash = __toESM(require_lodash());
|
|
5706
|
+
var jsx_runtime4 = require("react/jsx-runtime");
|
|
7840
5707
|
function PlainArrayControl(props) {
|
|
7841
|
-
const theme =
|
|
5708
|
+
const theme = import_core6.useRemoraidTheme();
|
|
7842
5709
|
const { label, schema, data, handleChange, path, required } = props;
|
|
7843
5710
|
const { formOptions } = useFormOptions();
|
|
7844
|
-
const { renderers, cells } =
|
|
5711
|
+
const { renderers, cells } = import_react6.useJsonForms();
|
|
7845
5712
|
let schemaItems;
|
|
7846
5713
|
if (schema.items && !Array.isArray(schema.items)) {
|
|
7847
5714
|
schemaItems = {
|
|
@@ -7855,45 +5722,45 @@ function PlainArrayControl(props) {
|
|
|
7855
5722
|
required: ["item"]
|
|
7856
5723
|
};
|
|
7857
5724
|
} else {
|
|
7858
|
-
return /* @__PURE__ */
|
|
7859
|
-
category:
|
|
5725
|
+
return /* @__PURE__ */ jsx_runtime4.jsx(import_core6.AlertMinimal, {
|
|
5726
|
+
category: import_core6.AlertCategory.Negative,
|
|
7860
5727
|
title: "Renderer missing",
|
|
7861
5728
|
text: `Could not find applicable renderer for property '${label}'.`
|
|
7862
5729
|
});
|
|
7863
5730
|
}
|
|
7864
|
-
return /* @__PURE__ */
|
|
7865
|
-
children: /* @__PURE__ */
|
|
5731
|
+
return /* @__PURE__ */ jsx_runtime4.jsx(jsx_runtime4.Fragment, {
|
|
5732
|
+
children: /* @__PURE__ */ jsx_runtime4.jsx(import_core5.Input.Wrapper, {
|
|
7866
5733
|
label,
|
|
7867
5734
|
description: formOptions.withDescriptions ? schema.description : undefined,
|
|
7868
5735
|
withAsterisk: required,
|
|
7869
|
-
children: /* @__PURE__ */
|
|
5736
|
+
children: /* @__PURE__ */ jsx_runtime4.jsx(import_core5.Paper, {
|
|
7870
5737
|
withBorder: Array.isArray(data) && data.length > 0,
|
|
7871
5738
|
shadow: "0",
|
|
7872
5739
|
bg: "var(--remoraid-transparent-background)",
|
|
7873
5740
|
p: Array.isArray(data) && data.length > 0 ? formOptions.gutter : 0,
|
|
7874
5741
|
mt: formOptions.withDescriptions && schema.description && schema.description.length > 0 ? 4 : 0,
|
|
7875
|
-
children: /* @__PURE__ */
|
|
5742
|
+
children: /* @__PURE__ */ jsx_runtime4.jsxs(import_core5.Stack, {
|
|
7876
5743
|
align: "stretch",
|
|
7877
5744
|
justify: "flex-start",
|
|
7878
5745
|
gap: formOptions.gutter,
|
|
7879
5746
|
children: [
|
|
7880
5747
|
Array.isArray(data) ? data.map((item, i) => {
|
|
7881
|
-
return /* @__PURE__ */
|
|
5748
|
+
return /* @__PURE__ */ jsx_runtime4.jsxs(import_core5.Flex, {
|
|
7882
5749
|
gap: formOptions.gutter,
|
|
7883
5750
|
justify: "flex-start",
|
|
7884
5751
|
align: "center",
|
|
7885
5752
|
direction: "row",
|
|
7886
5753
|
wrap: "nowrap",
|
|
7887
5754
|
children: [
|
|
7888
|
-
/* @__PURE__ */
|
|
5755
|
+
/* @__PURE__ */ jsx_runtime4.jsx(import_core5.Box, {
|
|
7889
5756
|
flex: 1,
|
|
7890
|
-
children: /* @__PURE__ */
|
|
5757
|
+
children: /* @__PURE__ */ jsx_runtime4.jsx(import_react6.JsonForms, {
|
|
7891
5758
|
schema: schemaItems,
|
|
7892
5759
|
data: { item },
|
|
7893
5760
|
renderers: renderers ?? [],
|
|
7894
5761
|
cells: cells ?? [],
|
|
7895
5762
|
onChange: ({ data: newData }) => {
|
|
7896
|
-
if (
|
|
5763
|
+
if (import_lodash.isEqual(data[i], newData.item)) {
|
|
7897
5764
|
return;
|
|
7898
5765
|
}
|
|
7899
5766
|
const dataCopy = [...data];
|
|
@@ -7903,11 +5770,11 @@ function PlainArrayControl(props) {
|
|
|
7903
5770
|
validationMode: "NoValidation"
|
|
7904
5771
|
})
|
|
7905
5772
|
}),
|
|
7906
|
-
/* @__PURE__ */
|
|
5773
|
+
/* @__PURE__ */ jsx_runtime4.jsx(import_core6.RemoraidButton, {
|
|
7907
5774
|
responsive: false,
|
|
7908
5775
|
collapsed: true,
|
|
7909
5776
|
label: "Delete item",
|
|
7910
|
-
icon:
|
|
5777
|
+
icon: import_icons_react.IconTrash,
|
|
7911
5778
|
onClick: () => {
|
|
7912
5779
|
handleChange(path, data.filter((_, index) => index !== i));
|
|
7913
5780
|
},
|
|
@@ -7915,10 +5782,10 @@ function PlainArrayControl(props) {
|
|
|
7915
5782
|
})
|
|
7916
5783
|
]
|
|
7917
5784
|
}, i);
|
|
7918
|
-
}) : /* @__PURE__ */
|
|
7919
|
-
/* @__PURE__ */
|
|
5785
|
+
}) : /* @__PURE__ */ jsx_runtime4.jsx(jsx_runtime4.Fragment, {}),
|
|
5786
|
+
/* @__PURE__ */ jsx_runtime4.jsx(import_core5.Button, {
|
|
7920
5787
|
variant: "default",
|
|
7921
|
-
leftSection: /* @__PURE__ */
|
|
5788
|
+
leftSection: /* @__PURE__ */ jsx_runtime4.jsx(import_icons_react.IconPlus, {
|
|
7922
5789
|
...theme.componentsProps.icons.medium
|
|
7923
5790
|
}),
|
|
7924
5791
|
onClick: () => {
|
|
@@ -7942,13 +5809,13 @@ function PlainArrayControl(props) {
|
|
|
7942
5809
|
})
|
|
7943
5810
|
});
|
|
7944
5811
|
}
|
|
7945
|
-
var ArrayControl =
|
|
5812
|
+
var ArrayControl = import_react6.withJsonFormsControlProps(PlainArrayControl);
|
|
7946
5813
|
var ArrayControl_default = ArrayControl;
|
|
7947
5814
|
|
|
7948
5815
|
// src/jsonforms/renderers/CheckboxControl.tsx
|
|
7949
|
-
var
|
|
7950
|
-
var
|
|
7951
|
-
var
|
|
5816
|
+
var import_react7 = require("@jsonforms/react");
|
|
5817
|
+
var import_core7 = require("@mantine/core");
|
|
5818
|
+
var jsx_runtime5 = require("react/jsx-runtime");
|
|
7952
5819
|
function PlainCheckboxControl({
|
|
7953
5820
|
data,
|
|
7954
5821
|
handleChange,
|
|
@@ -7958,8 +5825,8 @@ function PlainCheckboxControl({
|
|
|
7958
5825
|
schema
|
|
7959
5826
|
}) {
|
|
7960
5827
|
const { formOptions } = useFormOptions();
|
|
7961
|
-
return /* @__PURE__ */
|
|
7962
|
-
children: /* @__PURE__ */
|
|
5828
|
+
return /* @__PURE__ */ jsx_runtime5.jsx(jsx_runtime5.Fragment, {
|
|
5829
|
+
children: /* @__PURE__ */ jsx_runtime5.jsx(import_core7.Checkbox, {
|
|
7963
5830
|
label,
|
|
7964
5831
|
py: formOptions.gutter,
|
|
7965
5832
|
labelPosition: "left",
|
|
@@ -7972,13 +5839,13 @@ function PlainCheckboxControl({
|
|
|
7972
5839
|
})
|
|
7973
5840
|
});
|
|
7974
5841
|
}
|
|
7975
|
-
var CheckboxControl =
|
|
5842
|
+
var CheckboxControl = import_react7.withJsonFormsControlProps(PlainCheckboxControl);
|
|
7976
5843
|
var CheckboxControl_default = CheckboxControl;
|
|
7977
5844
|
|
|
7978
5845
|
// src/jsonforms/renderers/NumberControl.tsx
|
|
7979
|
-
var
|
|
7980
|
-
var
|
|
7981
|
-
var
|
|
5846
|
+
var import_react8 = require("@jsonforms/react");
|
|
5847
|
+
var import_core8 = require("@mantine/core");
|
|
5848
|
+
var jsx_runtime6 = require("react/jsx-runtime");
|
|
7982
5849
|
function PlainNumberControl({
|
|
7983
5850
|
data,
|
|
7984
5851
|
handleChange,
|
|
@@ -7990,8 +5857,8 @@ function PlainNumberControl({
|
|
|
7990
5857
|
const {
|
|
7991
5858
|
formOptions: { withDescriptions }
|
|
7992
5859
|
} = useFormOptions();
|
|
7993
|
-
return /* @__PURE__ */
|
|
7994
|
-
children: /* @__PURE__ */
|
|
5860
|
+
return /* @__PURE__ */ jsx_runtime6.jsx(jsx_runtime6.Fragment, {
|
|
5861
|
+
children: /* @__PURE__ */ jsx_runtime6.jsx(import_core8.NumberInput, {
|
|
7995
5862
|
label,
|
|
7996
5863
|
variant: "default",
|
|
7997
5864
|
value: data ?? "",
|
|
@@ -8006,16 +5873,17 @@ function PlainNumberControl({
|
|
|
8006
5873
|
})
|
|
8007
5874
|
});
|
|
8008
5875
|
}
|
|
8009
|
-
var NumberControl =
|
|
5876
|
+
var NumberControl = import_react8.withJsonFormsControlProps(PlainNumberControl);
|
|
8010
5877
|
var NumberControl_default = NumberControl;
|
|
8011
5878
|
|
|
8012
5879
|
// src/jsonforms/renderers/ObjectControl.tsx
|
|
8013
|
-
var
|
|
8014
|
-
var
|
|
8015
|
-
var
|
|
8016
|
-
var
|
|
8017
|
-
var
|
|
8018
|
-
var
|
|
5880
|
+
var import_react9 = require("@jsonforms/react");
|
|
5881
|
+
var import_core9 = require("@mantine/core");
|
|
5882
|
+
var import_core10 = require("@jsonforms/core");
|
|
5883
|
+
var import_react10 = require("react");
|
|
5884
|
+
var import_icons_react2 = require("@tabler/icons-react");
|
|
5885
|
+
var import_core11 = require("remoraid/core");
|
|
5886
|
+
var jsx_runtime7 = require("react/jsx-runtime");
|
|
8019
5887
|
function PlainObjectControl({
|
|
8020
5888
|
label: labelProp,
|
|
8021
5889
|
schema,
|
|
@@ -8025,8 +5893,8 @@ function PlainObjectControl({
|
|
|
8025
5893
|
required
|
|
8026
5894
|
}) {
|
|
8027
5895
|
const { formOptions } = useFormOptions();
|
|
8028
|
-
const { renderers, cells } =
|
|
8029
|
-
const [newKey, setNewKey] =
|
|
5896
|
+
const { renderers, cells } = import_react9.useJsonForms();
|
|
5897
|
+
const [newKey, setNewKey] = import_react10.useState("");
|
|
8030
5898
|
const hasProperties = schema.properties && Object.keys(schema.properties).length > 0;
|
|
8031
5899
|
const hasAdditionalProperties = schema.additionalProperties === true || schema.additionalProperties !== undefined && Object.keys(schema.additionalProperties).length > 0;
|
|
8032
5900
|
const label = labelProp !== "remoraid-array-item" ? labelProp : null;
|
|
@@ -8034,22 +5902,22 @@ function PlainObjectControl({
|
|
|
8034
5902
|
const declaredKeys = new Set(Object.keys(schema.properties ?? {}));
|
|
8035
5903
|
const objectData = data && typeof data === "object" && !Array.isArray(data) ? data : {};
|
|
8036
5904
|
const additionalEntries = Object.entries(objectData).filter(([key]) => !declaredKeys.has(key));
|
|
8037
|
-
return /* @__PURE__ */
|
|
5905
|
+
return /* @__PURE__ */ jsx_runtime7.jsx(import_core9.Input.Wrapper, {
|
|
8038
5906
|
label,
|
|
8039
5907
|
description,
|
|
8040
5908
|
withAsterisk: required,
|
|
8041
|
-
children: /* @__PURE__ */
|
|
5909
|
+
children: /* @__PURE__ */ jsx_runtime7.jsx(import_core9.Paper, {
|
|
8042
5910
|
withBorder: true,
|
|
8043
5911
|
bg: "var(--remoraid-transparent-background)",
|
|
8044
5912
|
shadow: "0",
|
|
8045
5913
|
p: formOptions.gutter,
|
|
8046
5914
|
mt: Boolean(description) ? 4 : 0,
|
|
8047
|
-
children: /* @__PURE__ */
|
|
5915
|
+
children: /* @__PURE__ */ jsx_runtime7.jsxs(import_core9.Stack, {
|
|
8048
5916
|
align: "stretch",
|
|
8049
5917
|
justify: "flex-start",
|
|
8050
5918
|
gap: formOptions.gutter,
|
|
8051
5919
|
children: [
|
|
8052
|
-
hasProperties && /* @__PURE__ */
|
|
5920
|
+
hasProperties && /* @__PURE__ */ jsx_runtime7.jsx(import_react9.JsonForms, {
|
|
8053
5921
|
schema: {
|
|
8054
5922
|
...schema,
|
|
8055
5923
|
$schema: undefined
|
|
@@ -8062,22 +5930,22 @@ function PlainObjectControl({
|
|
|
8062
5930
|
},
|
|
8063
5931
|
validationMode: "NoValidation"
|
|
8064
5932
|
}),
|
|
8065
|
-
hasAdditionalProperties && /* @__PURE__ */
|
|
5933
|
+
hasAdditionalProperties && /* @__PURE__ */ jsx_runtime7.jsxs(jsx_runtime7.Fragment, {
|
|
8066
5934
|
children: [
|
|
8067
|
-
additionalEntries.length > 0 && /* @__PURE__ */
|
|
5935
|
+
additionalEntries.length > 0 && /* @__PURE__ */ jsx_runtime7.jsx(import_core9.Stack, {
|
|
8068
5936
|
align: "stretch",
|
|
8069
5937
|
justify: "flex-start",
|
|
8070
5938
|
gap: formOptions.gutter,
|
|
8071
|
-
children: additionalEntries.map(([key, data2]) => /* @__PURE__ */
|
|
5939
|
+
children: additionalEntries.map(([key, data2]) => /* @__PURE__ */ jsx_runtime7.jsxs(import_core9.Flex, {
|
|
8072
5940
|
gap: formOptions.gutter,
|
|
8073
5941
|
justify: "flex-start",
|
|
8074
5942
|
align: "center",
|
|
8075
5943
|
direction: "row",
|
|
8076
5944
|
wrap: "nowrap",
|
|
8077
5945
|
children: [
|
|
8078
|
-
/* @__PURE__ */
|
|
5946
|
+
/* @__PURE__ */ jsx_runtime7.jsx(import_core9.Box, {
|
|
8079
5947
|
flex: 1,
|
|
8080
|
-
children: /* @__PURE__ */
|
|
5948
|
+
children: /* @__PURE__ */ jsx_runtime7.jsx(import_react9.JsonForms, {
|
|
8081
5949
|
schema: {
|
|
8082
5950
|
...schema.additionalProperties === true ? {} : schema.additionalProperties,
|
|
8083
5951
|
title: key,
|
|
@@ -8092,15 +5960,15 @@ function PlainObjectControl({
|
|
|
8092
5960
|
cells: cells ?? [],
|
|
8093
5961
|
validationMode: "ValidateAndHide",
|
|
8094
5962
|
onChange: ({ data: newVal }) => {
|
|
8095
|
-
handleChange(
|
|
5963
|
+
handleChange(import_core10.composePaths(path, key), newVal);
|
|
8096
5964
|
}
|
|
8097
5965
|
})
|
|
8098
5966
|
}),
|
|
8099
|
-
/* @__PURE__ */
|
|
5967
|
+
/* @__PURE__ */ jsx_runtime7.jsx(import_core11.RemoraidButton, {
|
|
8100
5968
|
responsive: false,
|
|
8101
5969
|
collapsed: true,
|
|
8102
5970
|
label: `Delete ${key}`,
|
|
8103
|
-
icon:
|
|
5971
|
+
icon: import_icons_react2.IconTrash,
|
|
8104
5972
|
onClick: () => {
|
|
8105
5973
|
if (declaredKeys.has(key)) {
|
|
8106
5974
|
return;
|
|
@@ -8114,12 +5982,12 @@ function PlainObjectControl({
|
|
|
8114
5982
|
]
|
|
8115
5983
|
}, key))
|
|
8116
5984
|
}),
|
|
8117
|
-
/* @__PURE__ */
|
|
5985
|
+
/* @__PURE__ */ jsx_runtime7.jsxs(import_core9.Group, {
|
|
8118
5986
|
gap: formOptions.gutter,
|
|
8119
5987
|
wrap: "nowrap",
|
|
8120
5988
|
align: "flex-end",
|
|
8121
5989
|
children: [
|
|
8122
|
-
/* @__PURE__ */
|
|
5990
|
+
/* @__PURE__ */ jsx_runtime7.jsx(import_core9.TextInput, {
|
|
8123
5991
|
label: "New key",
|
|
8124
5992
|
variant: "default",
|
|
8125
5993
|
value: newKey,
|
|
@@ -8130,11 +5998,11 @@ function PlainObjectControl({
|
|
|
8130
5998
|
description: formOptions.withDescriptions ? "Key for new additional property value" : null,
|
|
8131
5999
|
flex: 1
|
|
8132
6000
|
}),
|
|
8133
|
-
/* @__PURE__ */
|
|
6001
|
+
/* @__PURE__ */ jsx_runtime7.jsx(import_core11.RemoraidButton, {
|
|
8134
6002
|
responsive: false,
|
|
8135
6003
|
collapsed: true,
|
|
8136
6004
|
label: "Add key",
|
|
8137
|
-
icon:
|
|
6005
|
+
icon: import_icons_react2.IconPlus,
|
|
8138
6006
|
onClick: () => {
|
|
8139
6007
|
const key = newKey.trim();
|
|
8140
6008
|
if (!key) {
|
|
@@ -8164,13 +6032,13 @@ function PlainObjectControl({
|
|
|
8164
6032
|
})
|
|
8165
6033
|
});
|
|
8166
6034
|
}
|
|
8167
|
-
var ObjectControl =
|
|
6035
|
+
var ObjectControl = import_react9.withJsonFormsControlProps(PlainObjectControl);
|
|
8168
6036
|
var ObjectControl_default = ObjectControl;
|
|
8169
6037
|
|
|
8170
6038
|
// src/jsonforms/renderers/StringSelectControl.tsx
|
|
8171
|
-
var
|
|
8172
|
-
var
|
|
8173
|
-
var
|
|
6039
|
+
var import_react11 = require("@jsonforms/react");
|
|
6040
|
+
var import_core12 = require("@mantine/core");
|
|
6041
|
+
var jsx_runtime8 = require("react/jsx-runtime");
|
|
8174
6042
|
function PlainTimestampControl({
|
|
8175
6043
|
data,
|
|
8176
6044
|
handleChange,
|
|
@@ -8182,8 +6050,8 @@ function PlainTimestampControl({
|
|
|
8182
6050
|
const {
|
|
8183
6051
|
formOptions: { withDescriptions }
|
|
8184
6052
|
} = useFormOptions();
|
|
8185
|
-
return /* @__PURE__ */
|
|
8186
|
-
children: /* @__PURE__ */
|
|
6053
|
+
return /* @__PURE__ */ jsx_runtime8.jsx(jsx_runtime8.Fragment, {
|
|
6054
|
+
children: /* @__PURE__ */ jsx_runtime8.jsx(import_core12.Select, {
|
|
8187
6055
|
label,
|
|
8188
6056
|
data: schema.enum,
|
|
8189
6057
|
value: data,
|
|
@@ -8197,18 +6065,18 @@ function PlainTimestampControl({
|
|
|
8197
6065
|
})
|
|
8198
6066
|
});
|
|
8199
6067
|
}
|
|
8200
|
-
var TimestampControl =
|
|
6068
|
+
var TimestampControl = import_react11.withJsonFormsControlProps(PlainTimestampControl);
|
|
8201
6069
|
var StringSelectControl_default = TimestampControl;
|
|
8202
6070
|
|
|
8203
6071
|
// src/jsonforms/renderers/testers/anyControlTesters.ts
|
|
8204
|
-
var
|
|
6072
|
+
var import_core13 = require("@jsonforms/core");
|
|
8205
6073
|
var testers = [
|
|
8206
|
-
|
|
8207
|
-
|
|
8208
|
-
if (!
|
|
6074
|
+
import_core13.rankWith(5, import_core13.isControl),
|
|
6075
|
+
import_core13.rankWith(15, import_core13.and(import_core13.and(import_core13.uiTypeIs("Control"), import_core13.schemaTypeIs("object")), (uischema, schema, ctx) => {
|
|
6076
|
+
if (!import_core13.isControl(uischema)) {
|
|
8209
6077
|
return false;
|
|
8210
6078
|
}
|
|
8211
|
-
const resolvedSchema =
|
|
6079
|
+
const resolvedSchema = import_core13.Resolve.schema(schema, uischema.scope, ctx.rootSchema);
|
|
8212
6080
|
const hasProperties = resolvedSchema.properties && Object.keys(resolvedSchema.properties).length > 0;
|
|
8213
6081
|
const hasAdditionalProperties = resolvedSchema.additionalProperties === true || resolvedSchema.additionalProperties !== undefined && Object.keys(resolvedSchema.additionalProperties).length > 0;
|
|
8214
6082
|
return !hasProperties && !hasAdditionalProperties;
|
|
@@ -8217,59 +6085,59 @@ var testers = [
|
|
|
8217
6085
|
var anyControlTesters_default = testers;
|
|
8218
6086
|
|
|
8219
6087
|
// src/jsonforms/renderers/testers/anyOfControlTester.ts
|
|
8220
|
-
var
|
|
8221
|
-
var tester =
|
|
6088
|
+
var import_core14 = require("@jsonforms/core");
|
|
6089
|
+
var tester = import_core14.rankWith(10, import_core14.and(import_core14.uiTypeIs("Control"), import_core14.isAnyOfControl));
|
|
8222
6090
|
var anyOfControlTester_default = tester;
|
|
8223
6091
|
|
|
8224
6092
|
// src/jsonforms/renderers/testers/arrayControlTester.ts
|
|
8225
|
-
var
|
|
8226
|
-
var tester2 =
|
|
6093
|
+
var import_core15 = require("@jsonforms/core");
|
|
6094
|
+
var tester2 = import_core15.rankWith(10, import_core15.and(import_core15.uiTypeIs("Control"), import_core15.schemaTypeIs("array")));
|
|
8227
6095
|
var arrayControlTester_default = tester2;
|
|
8228
6096
|
|
|
8229
6097
|
// src/jsonforms/renderers/testers/checkboxControlTester.ts
|
|
8230
|
-
var
|
|
8231
|
-
var tester3 =
|
|
6098
|
+
var import_core16 = require("@jsonforms/core");
|
|
6099
|
+
var tester3 = import_core16.rankWith(10, import_core16.and(import_core16.uiTypeIs("Control"), import_core16.schemaTypeIs("boolean")));
|
|
8232
6100
|
var checkboxControlTester_default = tester3;
|
|
8233
6101
|
|
|
8234
6102
|
// src/jsonforms/renderers/testers/numberControlTester.ts
|
|
8235
|
-
var
|
|
8236
|
-
var tester4 =
|
|
6103
|
+
var import_core17 = require("@jsonforms/core");
|
|
6104
|
+
var tester4 = import_core17.rankWith(8, (a, b, c) => {
|
|
8237
6105
|
if (b.type === "integer") {
|
|
8238
6106
|
return true;
|
|
8239
6107
|
}
|
|
8240
|
-
return
|
|
6108
|
+
return import_core17.and(import_core17.uiTypeIs("Control"), import_core17.or(import_core17.schemaTypeIs("number"), import_core17.schemaTypeIs("integer")))(a, b, c);
|
|
8241
6109
|
});
|
|
8242
6110
|
var numberControlTester_default = tester4;
|
|
8243
6111
|
|
|
8244
6112
|
// src/jsonforms/renderers/testers/objectControlTester.ts
|
|
8245
|
-
var
|
|
8246
|
-
var tester5 =
|
|
6113
|
+
var import_core18 = require("@jsonforms/core");
|
|
6114
|
+
var tester5 = import_core18.rankWith(10, import_core18.and(import_core18.uiTypeIs("Control"), import_core18.schemaTypeIs("object")));
|
|
8247
6115
|
var objectControlTester_default = tester5;
|
|
8248
6116
|
|
|
8249
6117
|
// src/jsonforms/renderers/testers/stringSelectControlTester.ts
|
|
8250
|
-
var
|
|
8251
|
-
var tester6 =
|
|
6118
|
+
var import_core19 = require("@jsonforms/core");
|
|
6119
|
+
var tester6 = import_core19.rankWith(11, import_core19.and(import_core19.uiTypeIs("Control"), import_core19.schemaTypeIs("string"), import_core19.isEnumControl));
|
|
8252
6120
|
var stringSelectControlTester_default = tester6;
|
|
8253
6121
|
|
|
8254
6122
|
// src/jsonforms/renderers/testers/textControlTester.ts
|
|
8255
|
-
var
|
|
8256
|
-
var tester7 =
|
|
6123
|
+
var import_core20 = require("@jsonforms/core");
|
|
6124
|
+
var tester7 = import_core20.rankWith(10, import_core20.and(import_core20.uiTypeIs("Control"), import_core20.schemaTypeIs("string")));
|
|
8257
6125
|
var textControlTester_default = tester7;
|
|
8258
6126
|
|
|
8259
6127
|
// src/jsonforms/renderers/testers/timestampControlTester.ts
|
|
8260
|
-
var
|
|
8261
|
-
var tester8 =
|
|
6128
|
+
var import_core21 = require("@jsonforms/core");
|
|
6129
|
+
var tester8 = import_core21.rankWith(11, import_core21.and(import_core21.uiTypeIs("Control"), import_core21.schemaTypeIs("integer"), import_core21.scopeEndsWith("startTime")));
|
|
8262
6130
|
var timestampControlTester_default = tester8;
|
|
8263
6131
|
|
|
8264
6132
|
// src/jsonforms/renderers/testers/verticalLayoutTester.ts
|
|
8265
|
-
var
|
|
8266
|
-
var tester9 =
|
|
6133
|
+
var import_core22 = require("@jsonforms/core");
|
|
6134
|
+
var tester9 = import_core22.rankWith(2, import_core22.uiTypeIs("VerticalLayout"));
|
|
8267
6135
|
var verticalLayoutTester_default = tester9;
|
|
8268
6136
|
|
|
8269
6137
|
// src/jsonforms/renderers/TextControl.tsx
|
|
8270
|
-
var
|
|
8271
|
-
var
|
|
8272
|
-
var
|
|
6138
|
+
var import_react12 = require("@jsonforms/react");
|
|
6139
|
+
var import_core23 = require("@mantine/core");
|
|
6140
|
+
var jsx_runtime9 = require("react/jsx-runtime");
|
|
8273
6141
|
function PlainTextControl({
|
|
8274
6142
|
data,
|
|
8275
6143
|
handleChange,
|
|
@@ -8281,8 +6149,8 @@ function PlainTextControl({
|
|
|
8281
6149
|
const {
|
|
8282
6150
|
formOptions: { withDescriptions }
|
|
8283
6151
|
} = useFormOptions();
|
|
8284
|
-
return /* @__PURE__ */
|
|
8285
|
-
children: /* @__PURE__ */
|
|
6152
|
+
return /* @__PURE__ */ jsx_runtime9.jsx(jsx_runtime9.Fragment, {
|
|
6153
|
+
children: /* @__PURE__ */ jsx_runtime9.jsx(import_core23.TextInput, {
|
|
8286
6154
|
label,
|
|
8287
6155
|
variant: "default",
|
|
8288
6156
|
placeholder: "",
|
|
@@ -8295,13 +6163,14 @@ function PlainTextControl({
|
|
|
8295
6163
|
})
|
|
8296
6164
|
});
|
|
8297
6165
|
}
|
|
8298
|
-
var TextControl =
|
|
6166
|
+
var TextControl = import_react12.withJsonFormsControlProps(PlainTextControl);
|
|
8299
6167
|
var TextControl_default = TextControl;
|
|
8300
6168
|
|
|
8301
6169
|
// src/jsonforms/renderers/TimestampControl.tsx
|
|
8302
|
-
var
|
|
6170
|
+
var import_react13 = require("@jsonforms/react");
|
|
8303
6171
|
var import_dates = require("@mantine/dates");
|
|
8304
|
-
var
|
|
6172
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
6173
|
+
var jsx_runtime10 = require("react/jsx-runtime");
|
|
8305
6174
|
function PlainTimestampControl2({
|
|
8306
6175
|
data,
|
|
8307
6176
|
handleChange,
|
|
@@ -8313,51 +6182,50 @@ function PlainTimestampControl2({
|
|
|
8313
6182
|
const {
|
|
8314
6183
|
formOptions: { withDescriptions }
|
|
8315
6184
|
} = useFormOptions();
|
|
8316
|
-
return /* @__PURE__ */
|
|
8317
|
-
children: /* @__PURE__ */
|
|
6185
|
+
return /* @__PURE__ */ jsx_runtime10.jsx(jsx_runtime10.Fragment, {
|
|
6186
|
+
children: /* @__PURE__ */ jsx_runtime10.jsx(import_dates.DateTimePicker, {
|
|
8318
6187
|
variant: "default",
|
|
8319
6188
|
label,
|
|
8320
|
-
placeholder: "Pick
|
|
8321
|
-
value: new Date(data * 1000),
|
|
6189
|
+
placeholder: "Pick date and time",
|
|
6190
|
+
value: data === null || data === undefined ? data : import_dates.toDateTimeString(new Date(data * 1000)),
|
|
6191
|
+
withSeconds: true,
|
|
8322
6192
|
onChange: (newValue) => {
|
|
8323
|
-
|
|
8324
|
-
handleChange(path, newValue.getTime() / 1000);
|
|
8325
|
-
}
|
|
6193
|
+
handleChange(path, newValue === null || newValue === undefined ? newValue : import_dayjs.default(newValue).toDate().getTime() / 1000);
|
|
8326
6194
|
},
|
|
8327
6195
|
required,
|
|
8328
6196
|
description: withDescriptions ? schema.description || null : null
|
|
8329
6197
|
})
|
|
8330
6198
|
});
|
|
8331
6199
|
}
|
|
8332
|
-
var TimestampControl2 =
|
|
6200
|
+
var TimestampControl2 = import_react13.withJsonFormsControlProps(PlainTimestampControl2);
|
|
8333
6201
|
var TimestampControl_default = TimestampControl2;
|
|
8334
6202
|
|
|
8335
6203
|
// src/jsonforms/renderers/VerticalLayout.tsx
|
|
8336
|
-
var
|
|
8337
|
-
var
|
|
8338
|
-
var
|
|
8339
|
-
var
|
|
6204
|
+
var import_react14 = __toESM(require("react"));
|
|
6205
|
+
var import_react15 = require("@jsonforms/react");
|
|
6206
|
+
var import_react16 = require("@jsonforms/react");
|
|
6207
|
+
var jsx_runtime11 = require("react/jsx-runtime");
|
|
8340
6208
|
"use client";
|
|
8341
6209
|
var JsonFormsLayout = ({
|
|
8342
6210
|
className,
|
|
8343
6211
|
children,
|
|
8344
6212
|
visible
|
|
8345
6213
|
}) => {
|
|
8346
|
-
return /* @__PURE__ */
|
|
6214
|
+
return /* @__PURE__ */ jsx_runtime11.jsx("div", {
|
|
8347
6215
|
className,
|
|
8348
6216
|
hidden: visible === undefined || visible === null ? false : !visible,
|
|
8349
6217
|
children
|
|
8350
6218
|
});
|
|
8351
6219
|
};
|
|
8352
6220
|
var renderChildren = (layout, schema, className, path, enabled) => {
|
|
8353
|
-
const { renderers, cells } =
|
|
6221
|
+
const { renderers, cells } = import_react16.useJsonForms();
|
|
8354
6222
|
const { formOptions } = useFormOptions();
|
|
8355
6223
|
const gutter = typeof formOptions.gutter === "string" ? `var(--mantine-spacing-${formOptions.gutter})` : `${formOptions.gutter}px`;
|
|
8356
6224
|
return layout.elements.map((child, index) => {
|
|
8357
|
-
return /* @__PURE__ */
|
|
6225
|
+
return /* @__PURE__ */ jsx_runtime11.jsx("div", {
|
|
8358
6226
|
className,
|
|
8359
6227
|
style: { marginTop: index === 0 ? 0 : gutter },
|
|
8360
|
-
children: /* @__PURE__ */
|
|
6228
|
+
children: /* @__PURE__ */ jsx_runtime11.jsx(import_react16.JsonFormsDispatch, {
|
|
8361
6229
|
renderers,
|
|
8362
6230
|
cells,
|
|
8363
6231
|
uischema: child,
|
|
@@ -8370,11 +6238,11 @@ var renderChildren = (layout, schema, className, path, enabled) => {
|
|
|
8370
6238
|
};
|
|
8371
6239
|
var VerticalLayoutRenderer = (props) => {
|
|
8372
6240
|
const { data: _data, ...otherProps } = props;
|
|
8373
|
-
return /* @__PURE__ */
|
|
6241
|
+
return /* @__PURE__ */ jsx_runtime11.jsx(VerticalLayoutRendererComponent, {
|
|
8374
6242
|
...otherProps
|
|
8375
6243
|
});
|
|
8376
6244
|
};
|
|
8377
|
-
var VerticalLayoutRendererComponent =
|
|
6245
|
+
var VerticalLayoutRendererComponent = import_react14.default.memo(function VerticalLayoutRendererComponent2({
|
|
8378
6246
|
schema,
|
|
8379
6247
|
uischema,
|
|
8380
6248
|
path,
|
|
@@ -8384,7 +6252,7 @@ var VerticalLayoutRendererComponent = import_react41.default.memo(function Verti
|
|
|
8384
6252
|
const verticalLayout = uischema;
|
|
8385
6253
|
const layoutClassName = "";
|
|
8386
6254
|
const childClassNames = "";
|
|
8387
|
-
return /* @__PURE__ */
|
|
6255
|
+
return /* @__PURE__ */ jsx_runtime11.jsx(JsonFormsLayout, {
|
|
8388
6256
|
className: layoutClassName,
|
|
8389
6257
|
uischema,
|
|
8390
6258
|
schema,
|
|
@@ -8394,7 +6262,7 @@ var VerticalLayoutRendererComponent = import_react41.default.memo(function Verti
|
|
|
8394
6262
|
children: renderChildren(verticalLayout, schema, childClassNames, path, enabled)
|
|
8395
6263
|
});
|
|
8396
6264
|
});
|
|
8397
|
-
var VerticalLayout =
|
|
6265
|
+
var VerticalLayout = import_react15.withJsonFormsLayoutProps(VerticalLayoutRenderer, false);
|
|
8398
6266
|
var VerticalLayout_default = VerticalLayout;
|
|
8399
6267
|
|
|
8400
6268
|
// src/jsonforms/renderers/index.ts
|