remoraid 3.1.1 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/core/index.cjs +622 -538
- package/dist/core/index.d.ts +59 -26
- package/dist/core/index.js +589 -503
- package/dist/core/styles.css +73 -16
- package/dist/data-visualization/index.cjs +6546 -0
- package/dist/data-visualization/index.d.ts +529 -0
- package/dist/data-visualization/index.js +6584 -0
- package/dist/jsonforms/index.cjs +150 -2294
- package/dist/jsonforms/index.js +98 -2358
- package/package.json +29 -10
package/dist/jsonforms/index.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,2188 +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-disabled)",
|
|
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, style) => {
|
|
6119
|
-
const isLeaf2 = element.children === undefined || element.children.length === 0;
|
|
6120
|
-
const Menu2 = isLeaf2 ? import_core7.Menu : import_core7.Menu.Sub;
|
|
6121
|
-
return /* @__PURE__ */ jsx_runtime15.jsx(Menu2.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,
|
|
6135
|
-
children: element.label
|
|
6136
|
-
});
|
|
6137
|
-
};
|
|
6138
|
-
const isRoot = import_react12.isValidElement(target);
|
|
6139
|
-
const isLeaf = elements === undefined || elements.length === 0;
|
|
6140
|
-
const Menu = isRoot ? import_core7.Menu : import_core7.Menu.Sub;
|
|
6141
|
-
const menuProps = isRoot ? { trigger: "click-hover", ...componentsProps?.Menu } : { ...componentsProps?.MenuSub };
|
|
6142
|
-
return /* @__PURE__ */ jsx_runtime15.jsx(import_core7.Transition, {
|
|
6143
|
-
mounted: isRoot ? true : target.mounted ?? true,
|
|
6144
|
-
...componentsProps?.transition,
|
|
6145
|
-
children: (transitionStyle) => {
|
|
6146
|
-
if (isLeaf) {
|
|
6147
|
-
if (isRoot) {
|
|
6148
|
-
return target;
|
|
6149
|
-
}
|
|
6150
|
-
return item(target, transitionStyle);
|
|
6151
|
-
}
|
|
6152
|
-
return /* @__PURE__ */ jsx_runtime15.jsxs(Menu, {
|
|
6153
|
-
...menuProps,
|
|
6154
|
-
children: [
|
|
6155
|
-
/* @__PURE__ */ jsx_runtime15.jsx(Menu.Target, {
|
|
6156
|
-
children: isRoot ? /* @__PURE__ */ jsx_runtime15.jsx(import_core7.Box, {
|
|
6157
|
-
...componentsProps?.rootTargetContainer,
|
|
6158
|
-
children: target
|
|
6159
|
-
}) : item(target, transitionStyle)
|
|
6160
|
-
}),
|
|
6161
|
-
/* @__PURE__ */ jsx_runtime15.jsxs(Menu.Dropdown, {
|
|
6162
|
-
children: [
|
|
6163
|
-
label !== undefined && /* @__PURE__ */ jsx_runtime15.jsx(import_core7.Menu.Label, {
|
|
6164
|
-
children: label
|
|
6165
|
-
}),
|
|
6166
|
-
elements.map((element, i) => /* @__PURE__ */ jsx_runtime15.jsx(NavigationMenu, {
|
|
6167
|
-
target: element,
|
|
6168
|
-
elements: element.children,
|
|
6169
|
-
componentsProps
|
|
6170
|
-
}, `navigation-menu-${i}`))
|
|
6171
|
-
]
|
|
6172
|
-
})
|
|
6173
|
-
]
|
|
6174
|
-
});
|
|
6175
|
-
}
|
|
6176
|
-
});
|
|
6177
|
-
}
|
|
6178
|
-
|
|
6179
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6180
|
-
var import_icons_react4 = require("@tabler/icons-react");
|
|
6181
|
-
|
|
6182
|
-
// src/core/components/RemoraidButton/index.tsx
|
|
6183
|
-
var import_core8 = require("@mantine/core");
|
|
6184
|
-
var import_icons_react3 = require("@tabler/icons-react");
|
|
6185
|
-
var import_react13 = require("react");
|
|
6186
|
-
var import_lodash7 = __toESM(require_lodash());
|
|
6187
|
-
var jsx_runtime16 = require("react/jsx-runtime");
|
|
6188
|
-
var defaultRemoraidButtonSize = "sm";
|
|
6189
|
-
function RemoraidButton({
|
|
6190
|
-
label,
|
|
6191
|
-
responsive: responsiveProp,
|
|
6192
|
-
breakpoint: breakpointProp,
|
|
6193
|
-
collapsed: collapsedProp,
|
|
6194
|
-
size = defaultRemoraidButtonSize,
|
|
6195
|
-
color,
|
|
6196
|
-
onClick,
|
|
6197
|
-
loading,
|
|
6198
|
-
variant = "default",
|
|
6199
|
-
mounted = true,
|
|
6200
|
-
icon: iconProp,
|
|
6201
|
-
iconSize: iconSizeProp,
|
|
6202
|
-
clickTransformation = "default" /* Default */,
|
|
6203
|
-
componentsProps
|
|
6204
|
-
}) {
|
|
6205
|
-
const theme = useRemoraidTheme();
|
|
6206
|
-
const responsive = responsiveProp ?? true;
|
|
6207
|
-
const breakpoint = breakpointProp ?? theme.breakpoints.buttonCollapse;
|
|
6208
|
-
const collapsed = collapsedProp ?? false;
|
|
6209
|
-
const iconSize = iconSizeProp ?? getDefaultButtonIconSize(size);
|
|
6210
|
-
const Icon3 = iconProp ?? import_icons_react3.IconClick;
|
|
6211
|
-
const iconElement = import_react13.isValidElement(Icon3) ? Icon3 : /* @__PURE__ */ jsx_runtime16.jsx(Icon3, {
|
|
6212
|
-
...import_lodash7.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
|
|
6213
|
-
});
|
|
6214
|
-
const clickTransformationClassNames = {
|
|
6215
|
-
["default" /* Default */]: null,
|
|
6216
|
-
["none" /* None */]: "remoraid-button-none",
|
|
6217
|
-
["scale" /* Scale */]: "remoraid-button-scale",
|
|
6218
|
-
["tiltDown" /* TiltDown */]: "remoraid-button-tilt-down",
|
|
6219
|
-
["tiltUp" /* TiltUp */]: "remoraid-button-tilt-up",
|
|
6220
|
-
["tiltLeft" /* TiltLeft */]: "remoraid-button-tilt-left",
|
|
6221
|
-
["tiltRight" /* TiltRight */]: "remoraid-button-tilt-right"
|
|
6222
|
-
};
|
|
6223
|
-
const clickTransformationClass = clickTransformationClassNames[clickTransformation];
|
|
6224
|
-
return /* @__PURE__ */ jsx_runtime16.jsx(import_core8.Transition, {
|
|
6225
|
-
mounted,
|
|
6226
|
-
transition: "fade",
|
|
6227
|
-
duration: theme.transitionDurations.short,
|
|
6228
|
-
timingFunction: "ease",
|
|
6229
|
-
...componentsProps?.transition,
|
|
6230
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime16.jsxs(jsx_runtime16.Fragment, {
|
|
6231
|
-
children: [
|
|
6232
|
-
/* @__PURE__ */ jsx_runtime16.jsx(import_core8.Tooltip, {
|
|
6233
|
-
label,
|
|
6234
|
-
...componentsProps?.tooltip,
|
|
6235
|
-
children: /* @__PURE__ */ jsx_runtime16.jsx(import_core8.ActionIcon, {
|
|
6236
|
-
"aria-label": label,
|
|
6237
|
-
variant,
|
|
6238
|
-
onClick,
|
|
6239
|
-
loading,
|
|
6240
|
-
size: size ? `input-${size}` : "input-sm",
|
|
6241
|
-
color,
|
|
6242
|
-
...componentsProps?.button,
|
|
6243
|
-
...componentsProps?.ActionIcon,
|
|
6244
|
-
hiddenFrom: !responsive ? undefined : breakpoint,
|
|
6245
|
-
display: !responsive && !collapsed ? "none" : componentsProps?.ActionIcon?.display ?? componentsProps?.button?.display,
|
|
6246
|
-
style: import_lodash7.merge(transitionStyle, componentsProps?.button?.style, componentsProps?.ActionIcon?.style),
|
|
6247
|
-
className: clsx_default(clickTransformationClass, componentsProps?.ActionIcon?.className, componentsProps?.button?.className),
|
|
6248
|
-
children: iconElement
|
|
6249
|
-
})
|
|
6250
|
-
}),
|
|
6251
|
-
/* @__PURE__ */ jsx_runtime16.jsx(import_core8.Button, {
|
|
6252
|
-
onClick,
|
|
6253
|
-
loading,
|
|
6254
|
-
variant,
|
|
6255
|
-
size,
|
|
6256
|
-
color,
|
|
6257
|
-
leftSection: iconProp !== undefined ? iconElement : undefined,
|
|
6258
|
-
...componentsProps?.button,
|
|
6259
|
-
...componentsProps?.Button,
|
|
6260
|
-
visibleFrom: !responsive ? undefined : breakpoint,
|
|
6261
|
-
display: !responsive && collapsed ? "none" : componentsProps?.Button?.display ?? componentsProps?.button?.display,
|
|
6262
|
-
style: import_lodash7.merge(transitionStyle, componentsProps?.button?.style, componentsProps?.Button?.style),
|
|
6263
|
-
className: clsx_default(clickTransformationClass, componentsProps?.Button?.className, componentsProps?.button?.className),
|
|
6264
|
-
children: label
|
|
6265
|
-
})
|
|
6266
|
-
]
|
|
6267
|
-
})
|
|
6268
|
-
});
|
|
6269
|
-
}
|
|
6270
|
-
|
|
6271
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/NavbarMinimalContent/index.tsx
|
|
6272
|
-
var jsx_runtime17 = require("react/jsx-runtime");
|
|
6273
|
-
function NavbarMinimalContent({
|
|
6274
|
-
orientation,
|
|
6275
|
-
maxElements,
|
|
6276
|
-
collapseStaticElementsBreakpoint: collapseStaticElementsBreakpointProp,
|
|
6277
|
-
componentsProps
|
|
6278
|
-
}) {
|
|
6279
|
-
const theme = useRemoraidTheme();
|
|
6280
|
-
const { userExperience: appShellUserExperience } = useAppShellUserExperience();
|
|
6281
|
-
const app = useRemoraidApp();
|
|
6282
|
-
const router = useRemoraidRouter();
|
|
6283
|
-
const { pathname } = router;
|
|
6284
|
-
const layoutElement = useFrameLayoutElement();
|
|
6285
|
-
const { colorScheme, setColorScheme } = useHydratedMantineColorScheme();
|
|
6286
|
-
const collapseStaticElementsBreakpoint = collapseStaticElementsBreakpointProp ?? theme.breakpoints.navbarStaticElementsCollapse;
|
|
6287
|
-
const mode = appShellUserExperience.navbar.mode;
|
|
6288
|
-
const floatingPositions = {
|
|
6289
|
-
["bottom" /* Bottom */]: "top",
|
|
6290
|
-
["left" /* Left */]: "right",
|
|
6291
|
-
["top" /* Top */]: "bottom",
|
|
6292
|
-
["right" /* Right */]: "left",
|
|
6293
|
-
["content" /* Content */]: undefined
|
|
6294
|
-
};
|
|
6295
|
-
const floatingPosition = layoutElement?.section ? floatingPositions[layoutElement.section] : undefined;
|
|
6296
|
-
const buttonResponsive = mode === "responsive" /* Responsive */;
|
|
6297
|
-
let buttonCollapsed = undefined;
|
|
6298
|
-
if (mode === "collapsed" /* Collapsed */) {
|
|
6299
|
-
buttonCollapsed = true;
|
|
6300
|
-
} else if (mode === "expanded" /* Expanded */) {
|
|
6301
|
-
buttonCollapsed = false;
|
|
6302
|
-
}
|
|
6303
|
-
const buttonClickTransformation = orientation === "horizontal" /* Horizontal */ ? "tiltRight" /* TiltRight */ : "default" /* Default */;
|
|
6304
|
-
const logoButton = app.logo ? /* @__PURE__ */ jsx_runtime17.jsx(RemoraidButton, {
|
|
6305
|
-
label: app.name,
|
|
6306
|
-
variant: "subtle",
|
|
6307
|
-
icon: app.logo,
|
|
6308
|
-
responsive: buttonResponsive,
|
|
6309
|
-
collapsed: buttonCollapsed,
|
|
6310
|
-
clickTransformation: buttonClickTransformation,
|
|
6311
|
-
...componentsProps?.button,
|
|
6312
|
-
...componentsProps?.logoButton,
|
|
6313
|
-
componentsProps: import_lodash8.merge({
|
|
6314
|
-
button: {
|
|
6315
|
-
c: "var(--mantine-color-text)"
|
|
6316
|
-
},
|
|
6317
|
-
Button: { justify: "flex-start" },
|
|
6318
|
-
tooltip: { position: floatingPosition }
|
|
6319
|
-
}, componentsProps?.button?.componentsProps, componentsProps?.logoButton?.componentsProps),
|
|
6320
|
-
onClick: (e) => {
|
|
6321
|
-
componentsProps?.button?.onClick?.(e);
|
|
6322
|
-
componentsProps?.logoButton?.onClick?.(e);
|
|
6323
|
-
}
|
|
6324
|
-
}) : undefined;
|
|
6325
|
-
const button = (element, key) => /* @__PURE__ */ jsx_runtime17.jsx(NavigationMenu, {
|
|
6326
|
-
label: element.label,
|
|
6327
|
-
target: /* @__PURE__ */ jsx_runtime17.jsx(RemoraidButton, {
|
|
6328
|
-
mounted: element.mounted,
|
|
6329
|
-
label: element.label,
|
|
6330
|
-
icon: element.icon,
|
|
6331
|
-
variant: element.type === "anchor" /* Anchor */ && element.href === pathname ? "light" : "default",
|
|
6332
|
-
responsive: buttonResponsive,
|
|
6333
|
-
collapsed: buttonCollapsed,
|
|
6334
|
-
clickTransformation: buttonClickTransformation,
|
|
6335
|
-
...componentsProps?.button,
|
|
6336
|
-
componentsProps: import_lodash8.merge({
|
|
6337
|
-
tooltip: {
|
|
6338
|
-
position: floatingPosition,
|
|
6339
|
-
disabled: element.children !== undefined && element.children.length > 0
|
|
6340
|
-
},
|
|
6341
|
-
Button: { justify: "flex-start" },
|
|
6342
|
-
button: {
|
|
6343
|
-
w: orientation === "vertical" /* Vertical */ ? "100%" : undefined
|
|
6344
|
-
}
|
|
6345
|
-
}, componentsProps?.button?.componentsProps),
|
|
6346
|
-
onClick: (e) => {
|
|
6347
|
-
if (element.type === "anchor" /* Anchor */) {
|
|
6348
|
-
router.push(element.href);
|
|
6349
|
-
}
|
|
6350
|
-
if (element.type === "button" /* Button */) {
|
|
6351
|
-
element.onClick(e);
|
|
6352
|
-
}
|
|
6353
|
-
componentsProps?.button?.onClick?.(e);
|
|
6354
|
-
}
|
|
6355
|
-
}),
|
|
6356
|
-
elements: element.children,
|
|
6357
|
-
...componentsProps?.NavigationMenu,
|
|
6358
|
-
componentsProps: import_lodash8.merge({
|
|
6359
|
-
Menu: { position: floatingPosition }
|
|
6360
|
-
}, componentsProps?.NavigationMenu?.componentsProps)
|
|
6361
|
-
}, key);
|
|
6362
|
-
const elements = [
|
|
6363
|
-
...app.nav,
|
|
6364
|
-
...getDefaultNavigationElements({ colorScheme, setColorScheme })
|
|
6365
|
-
];
|
|
6366
|
-
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}`));
|
|
6367
|
-
const staticElements = elements.filter((element) => element.static);
|
|
6368
|
-
const staticButtons = staticElements.sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0)).map((element, i) => button(element, `static-nav-element-${i}`));
|
|
6369
|
-
const collapseStaticElements = staticElements.filter((element) => element.mounted ?? true).length > 1;
|
|
6370
|
-
const staticMenuButton = collapseStaticElements ? /* @__PURE__ */ jsx_runtime17.jsx(import_core9.Box, {
|
|
6371
|
-
hiddenFrom: collapseStaticElementsBreakpoint,
|
|
6372
|
-
children: /* @__PURE__ */ jsx_runtime17.jsx(NavigationMenu, {
|
|
6373
|
-
elements: staticElements,
|
|
6374
|
-
target: /* @__PURE__ */ jsx_runtime17.jsx(RemoraidButton, {
|
|
6375
|
-
label: "Static elements",
|
|
6376
|
-
icon: import_icons_react4.IconDots,
|
|
6377
|
-
responsive: orientation === "vertical" /* Vertical */ ? buttonResponsive : false,
|
|
6378
|
-
collapsed: orientation === "vertical" /* Vertical */ ? buttonCollapsed : true,
|
|
6379
|
-
clickTransformation: buttonClickTransformation,
|
|
6380
|
-
...componentsProps?.button,
|
|
6381
|
-
componentsProps: import_lodash8.merge({
|
|
6382
|
-
tooltip: { disabled: true },
|
|
6383
|
-
Button: { justify: "flex-start" },
|
|
6384
|
-
button: {
|
|
6385
|
-
w: orientation === "vertical" /* Vertical */ ? "100%" : undefined
|
|
6386
|
-
}
|
|
6387
|
-
}, componentsProps?.button?.componentsProps)
|
|
6388
|
-
}),
|
|
6389
|
-
...componentsProps?.NavigationMenu,
|
|
6390
|
-
componentsProps: import_lodash8.merge({
|
|
6391
|
-
Menu: { position: floatingPosition }
|
|
6392
|
-
}, componentsProps?.NavigationMenu?.componentsProps)
|
|
6393
|
-
})
|
|
6394
|
-
}) : null;
|
|
6395
|
-
return /* @__PURE__ */ jsx_runtime17.jsx(import_core9.Paper, {
|
|
6396
|
-
bg: theme.transparentBackground,
|
|
6397
|
-
h: "100%",
|
|
6398
|
-
p: "md",
|
|
6399
|
-
shadow: "md",
|
|
6400
|
-
...componentsProps?.container,
|
|
6401
|
-
children: orientation === "vertical" /* Vertical */ ? /* @__PURE__ */ jsx_runtime17.jsxs(import_core9.Stack, {
|
|
6402
|
-
h: "100%",
|
|
6403
|
-
children: [
|
|
6404
|
-
logoButton,
|
|
6405
|
-
/* @__PURE__ */ jsx_runtime17.jsx(import_core9.ScrollArea, {
|
|
6406
|
-
flex: 1,
|
|
6407
|
-
children: /* @__PURE__ */ jsx_runtime17.jsx(import_core9.Stack, {
|
|
6408
|
-
children: buttons
|
|
6409
|
-
})
|
|
6410
|
-
}),
|
|
6411
|
-
/* @__PURE__ */ jsx_runtime17.jsx(import_core9.Stack, {
|
|
6412
|
-
visibleFrom: collapseStaticElements ? collapseStaticElementsBreakpoint : undefined,
|
|
6413
|
-
children: staticButtons
|
|
6414
|
-
}),
|
|
6415
|
-
staticMenuButton
|
|
6416
|
-
]
|
|
6417
|
-
}) : /* @__PURE__ */ jsx_runtime17.jsxs(import_core9.Group, {
|
|
6418
|
-
wrap: "nowrap",
|
|
6419
|
-
children: [
|
|
6420
|
-
logoButton,
|
|
6421
|
-
/* @__PURE__ */ jsx_runtime17.jsx(import_core9.ScrollArea, {
|
|
6422
|
-
flex: 1,
|
|
6423
|
-
style: { contain: "inline-size" },
|
|
6424
|
-
children: /* @__PURE__ */ jsx_runtime17.jsx(import_core9.Group, {
|
|
6425
|
-
wrap: "nowrap",
|
|
6426
|
-
children: buttons
|
|
6427
|
-
})
|
|
6428
|
-
}),
|
|
6429
|
-
/* @__PURE__ */ jsx_runtime17.jsx(import_core9.Group, {
|
|
6430
|
-
wrap: "nowrap",
|
|
6431
|
-
visibleFrom: collapseStaticElements ? collapseStaticElementsBreakpoint : undefined,
|
|
6432
|
-
children: staticButtons
|
|
6433
|
-
}),
|
|
6434
|
-
staticMenuButton
|
|
6435
|
-
]
|
|
6436
|
-
})
|
|
6437
|
-
});
|
|
6438
|
-
}
|
|
6439
|
-
|
|
6440
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/index.tsx
|
|
6441
|
-
var import_lodash11 = __toESM(require_lodash());
|
|
6442
|
-
|
|
6443
|
-
// src/core/components/Pinnable/index.tsx
|
|
6444
|
-
var import_react15 = require("react");
|
|
6445
|
-
var import_icons_react7 = require("@tabler/icons-react");
|
|
6446
|
-
var import_core12 = require("@mantine/core");
|
|
6447
|
-
|
|
6448
|
-
// src/core/components/Controls/ControlButton/index.tsx
|
|
6449
|
-
var import_core10 = require("@mantine/core");
|
|
6450
|
-
var import_icons_react5 = require("@tabler/icons-react");
|
|
6451
|
-
var import_lodash9 = __toESM(require_lodash());
|
|
6452
|
-
var jsx_runtime18 = require("react/jsx-runtime");
|
|
6453
|
-
function ControlButton({
|
|
6454
|
-
icon: Icon4 = import_icons_react5.IconClick,
|
|
6455
|
-
mounted = true,
|
|
6456
|
-
size = "xs",
|
|
6457
|
-
iconSize = "tiny" /* Tiny */,
|
|
6458
|
-
onClick,
|
|
6459
|
-
order,
|
|
6460
|
-
color,
|
|
6461
|
-
tooltip,
|
|
6462
|
-
componentsProps
|
|
6463
|
-
}) {
|
|
6464
|
-
const theme = useRemoraidTheme();
|
|
6465
|
-
return /* @__PURE__ */ jsx_runtime18.jsx(import_core10.Transition, {
|
|
6466
|
-
mounted,
|
|
6467
|
-
transition: "fade",
|
|
6468
|
-
duration: theme.transitionDurations.short,
|
|
6469
|
-
timingFunction: "ease",
|
|
6470
|
-
...componentsProps?.transition,
|
|
6471
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime18.jsx(import_core10.Tooltip, {
|
|
6472
|
-
label: tooltip,
|
|
6473
|
-
disabled: !Boolean(tooltip),
|
|
6474
|
-
...componentsProps?.tooltip,
|
|
6475
|
-
children: /* @__PURE__ */ jsx_runtime18.jsx(import_core10.ActionIcon, {
|
|
6476
|
-
"data-control-button": true,
|
|
6477
|
-
size,
|
|
6478
|
-
color,
|
|
6479
|
-
onClick,
|
|
6480
|
-
radius: "xl",
|
|
6481
|
-
...componentsProps?.button,
|
|
6482
|
-
style: {
|
|
6483
|
-
order,
|
|
6484
|
-
...import_lodash9.merge(transitionStyle, componentsProps?.button?.style)
|
|
6485
|
-
},
|
|
6486
|
-
children: /* @__PURE__ */ jsx_runtime18.jsx(Icon4, {
|
|
6487
|
-
...import_lodash9.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
|
|
6488
|
-
})
|
|
6489
|
-
})
|
|
6490
|
-
})
|
|
6491
|
-
});
|
|
6492
|
-
}
|
|
6493
|
-
|
|
6494
|
-
// src/core/components/Controls/index.tsx
|
|
6495
|
-
var import_react14 = require("react");
|
|
6496
|
-
var import_core11 = require("@mantine/core");
|
|
6497
|
-
var import_icons_react6 = require("@tabler/icons-react");
|
|
6498
|
-
var import_lodash10 = __toESM(require_lodash());
|
|
6499
|
-
var jsx_runtime19 = require("react/jsx-runtime");
|
|
6500
|
-
function Controls({
|
|
6501
|
-
groupRef,
|
|
6502
|
-
mounted = true,
|
|
6503
|
-
dragContainerRef,
|
|
6504
|
-
gutter = 5,
|
|
6505
|
-
iconSize = "tiny" /* Tiny */,
|
|
6506
|
-
additionalButtons: additionalButtonsProp,
|
|
6507
|
-
componentsProps,
|
|
6508
|
-
children: childrenProp
|
|
6509
|
-
}) {
|
|
6510
|
-
const additionalButtons = additionalButtonsProp?.map((additionalButton) => asElementOrPropsOfType(ControlButton, additionalButton, "Check the 'additionalButtons' property of 'Controls'."));
|
|
6511
|
-
const children = asChildrenOfType(ControlButton, childrenProp, "Check children passed to 'Controls' component.");
|
|
6512
|
-
const theme = useRemoraidTheme();
|
|
6513
|
-
const [pos, setPos] = import_react14.useState({
|
|
6514
|
-
x: 0,
|
|
6515
|
-
y: 0
|
|
6516
|
-
});
|
|
6517
|
-
const offsetRef = import_react14.useRef({ x: 0, y: 0 });
|
|
6518
|
-
const containerRef = import_react14.useRef(null);
|
|
6519
|
-
const clamp = (v, min, max) => {
|
|
6520
|
-
return Math.min(Math.max(v, min), max);
|
|
6521
|
-
};
|
|
6522
|
-
const handlePointerDown = (e) => {
|
|
6523
|
-
if (e.target instanceof Element && e.target.closest("button,[data-control-button]")) {
|
|
6524
|
-
return;
|
|
6525
|
-
}
|
|
6526
|
-
if (!containerRef.current) {
|
|
6527
|
-
return;
|
|
6528
|
-
}
|
|
6529
|
-
const paperRect = containerRef.current.getBoundingClientRect();
|
|
6530
|
-
offsetRef.current = {
|
|
6531
|
-
x: e.clientX - paperRect.right,
|
|
6532
|
-
y: e.clientY - paperRect.top
|
|
6533
|
-
};
|
|
6534
|
-
e.currentTarget.setPointerCapture(e.pointerId);
|
|
6535
|
-
};
|
|
6536
|
-
const handlePointerMove = (e) => {
|
|
6537
|
-
if (!e.currentTarget.hasPointerCapture(e.pointerId)) {
|
|
6538
|
-
return;
|
|
6539
|
-
}
|
|
6540
|
-
if (!containerRef.current || !dragContainerRef.current) {
|
|
6541
|
-
return;
|
|
6542
|
-
}
|
|
6543
|
-
const boxRect = dragContainerRef.current.getBoundingClientRect();
|
|
6544
|
-
const paperRect = containerRef.current.getBoundingClientRect();
|
|
6545
|
-
const rawX = e.clientX - boxRect.right - offsetRef.current.x;
|
|
6546
|
-
const rawY = e.clientY - boxRect.top - offsetRef.current.y;
|
|
6547
|
-
const maxX = boxRect.width - paperRect.width;
|
|
6548
|
-
const maxY = boxRect.height - paperRect.height;
|
|
6549
|
-
setPos({
|
|
6550
|
-
x: clamp(-rawX, 0, maxX),
|
|
6551
|
-
y: clamp(rawY, 0, maxY)
|
|
6552
|
-
});
|
|
6553
|
-
};
|
|
6554
|
-
const handlePointerUp = (e) => {
|
|
6555
|
-
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
6556
|
-
};
|
|
6557
|
-
return /* @__PURE__ */ jsx_runtime19.jsx(import_core11.Transition, {
|
|
6558
|
-
mounted,
|
|
6559
|
-
keepMounted: true,
|
|
6560
|
-
transition: "pop",
|
|
6561
|
-
duration: theme.transitionDurations.short,
|
|
6562
|
-
timingFunction: "ease",
|
|
6563
|
-
...componentsProps?.transition,
|
|
6564
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime19.jsx(import_core11.Paper, {
|
|
6565
|
-
ref: containerRef,
|
|
6566
|
-
pos: "absolute",
|
|
6567
|
-
p: gutter,
|
|
6568
|
-
bg: theme.transparentBackground,
|
|
6569
|
-
shadow: "md",
|
|
6570
|
-
onPointerDown: handlePointerDown,
|
|
6571
|
-
onPointerMove: handlePointerMove,
|
|
6572
|
-
onPointerUp: handlePointerUp,
|
|
6573
|
-
...componentsProps?.container,
|
|
6574
|
-
style: {
|
|
6575
|
-
right: pos.x,
|
|
6576
|
-
top: pos.y,
|
|
6577
|
-
...import_lodash10.merge(transitionStyle, componentsProps?.container?.style)
|
|
6578
|
-
},
|
|
6579
|
-
className: clsx_default("remoraid-controls", componentsProps?.container?.className),
|
|
6580
|
-
children: /* @__PURE__ */ jsx_runtime19.jsxs(import_core11.Group, {
|
|
6581
|
-
gap: gutter,
|
|
6582
|
-
ref: groupRef,
|
|
6583
|
-
wrap: "nowrap",
|
|
6584
|
-
...componentsProps?.group,
|
|
6585
|
-
className: clsx_default("remoraid-controls-group", componentsProps?.group?.className),
|
|
6586
|
-
children: [
|
|
6587
|
-
/* @__PURE__ */ jsx_runtime19.jsx(import_icons_react6.IconGripHorizontal, {
|
|
6588
|
-
...import_lodash10.merge({}, theme.componentsProps.icons[iconSize], { order: -100, color: "var(--mantine-color-default-border)" }, componentsProps?.gripIcon)
|
|
6589
|
-
}),
|
|
6590
|
-
children,
|
|
6591
|
-
additionalButtons && additionalButtons.map((button, i) => {
|
|
6592
|
-
if (isValidElementOfType(ControlButton, button)) {
|
|
6593
|
-
return button;
|
|
6594
|
-
}
|
|
6595
|
-
return /* @__PURE__ */ jsx_runtime19.jsx(ControlButton, {
|
|
6596
|
-
...button
|
|
6597
|
-
}, i);
|
|
6598
|
-
})
|
|
6599
|
-
]
|
|
6600
|
-
})
|
|
6601
|
-
})
|
|
6602
|
-
});
|
|
6603
|
-
}
|
|
6604
|
-
|
|
6605
|
-
// src/core/components/Pinnable/index.tsx
|
|
6606
|
-
var jsx_runtime20 = require("react/jsx-runtime");
|
|
6607
|
-
function Pinnable({
|
|
6608
|
-
layoutType: layoutTypeProp,
|
|
6609
|
-
section,
|
|
6610
|
-
initialValue = false,
|
|
6611
|
-
layoutId,
|
|
6612
|
-
controlsContainer,
|
|
6613
|
-
hidden = false,
|
|
6614
|
-
onPinnedValueChange,
|
|
6615
|
-
componentsProps,
|
|
6616
|
-
children
|
|
6617
|
-
}) {
|
|
6618
|
-
const layoutType = layoutTypeProp ?? "frame" /* Frame */;
|
|
6619
|
-
const { layouts } = useLayouts();
|
|
6620
|
-
const [pinned, setPinned] = import_react15.useState(initialValue);
|
|
6621
|
-
const containerRef = import_react15.useRef(null);
|
|
6622
|
-
const layout = layouts[layoutId ?? remoraidAppShellLayoutId];
|
|
6623
|
-
if (layout && layout.type !== layoutType) {
|
|
6624
|
-
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.`);
|
|
6625
|
-
}
|
|
6626
|
-
const controlButton = import_react15.useMemo(() => /* @__PURE__ */ jsx_runtime20.jsx(ControlButton, {
|
|
6627
|
-
icon: pinned ? import_icons_react7.IconPinnedOff : import_icons_react7.IconPin,
|
|
6628
|
-
tooltip: pinned ? "Unpin" : "Pin",
|
|
6629
|
-
color: "green",
|
|
6630
|
-
order: 100,
|
|
6631
|
-
...componentsProps?.button,
|
|
6632
|
-
onClick: (e) => {
|
|
6633
|
-
setPinned((prev) => !prev);
|
|
6634
|
-
componentsProps?.button?.onClick?.(e);
|
|
6635
|
-
}
|
|
6636
|
-
}), [pinned, componentsProps?.button]);
|
|
6637
|
-
const element = /* @__PURE__ */ jsx_runtime20.jsxs(import_core12.Box, {
|
|
6638
|
-
pos: "relative",
|
|
6639
|
-
ref: containerRef,
|
|
6640
|
-
"data-hidden": hidden,
|
|
6641
|
-
h: "100%",
|
|
6642
|
-
...componentsProps?.container,
|
|
6643
|
-
className: clsx_default("remoraid-pinnable", componentsProps?.container?.className),
|
|
6644
|
-
children: [
|
|
6645
|
-
controlsContainer === undefined ? /* @__PURE__ */ jsx_runtime20.jsx(Controls, {
|
|
6646
|
-
dragContainerRef: containerRef,
|
|
6647
|
-
...componentsProps?.controls,
|
|
6648
|
-
children: controlButton
|
|
6649
|
-
}) : controlsContainer !== null && /* @__PURE__ */ jsx_runtime20.jsx(import_core12.Portal, {
|
|
6650
|
-
target: controlsContainer,
|
|
6651
|
-
children: controlButton
|
|
6652
|
-
}),
|
|
6653
|
-
children
|
|
6654
|
-
]
|
|
6655
|
-
});
|
|
6656
|
-
import_react15.useEffect(() => {
|
|
6657
|
-
onPinnedValueChange?.(pinned);
|
|
6658
|
-
}, [pinned]);
|
|
6659
|
-
if (!layout) {
|
|
6660
|
-
return null;
|
|
6661
|
-
}
|
|
6662
|
-
if (pinned && layoutType === "frame" /* Frame */) {
|
|
6663
|
-
return /* @__PURE__ */ jsx_runtime20.jsx(FrameLayout_default.Element, {
|
|
6664
|
-
layoutId,
|
|
6665
|
-
section,
|
|
6666
|
-
hidden,
|
|
6667
|
-
...componentsProps?.layoutElement,
|
|
6668
|
-
children: element
|
|
6669
|
-
});
|
|
6670
|
-
}
|
|
6671
|
-
return element;
|
|
6672
|
-
}
|
|
6673
|
-
|
|
6674
|
-
// src/core/components/AppShell/Navbar/NavbarMinimal/index.tsx
|
|
6675
|
-
var jsx_runtime21 = require("react/jsx-runtime");
|
|
6676
|
-
function NavbarMinimal({
|
|
6677
|
-
pinnable = true,
|
|
6678
|
-
componentsProps
|
|
6679
|
-
}) {
|
|
6680
|
-
const {
|
|
6681
|
-
userExperience: {
|
|
6682
|
-
navbar: { position }
|
|
6683
|
-
}
|
|
6684
|
-
} = useAppShellUserExperience();
|
|
6685
|
-
const [hover, setHover] = import_react16.useState(false);
|
|
6686
|
-
const handleEnter = () => {
|
|
6687
|
-
setHover(true);
|
|
6688
|
-
};
|
|
6689
|
-
const handleLeave = () => {
|
|
6690
|
-
setHover(false);
|
|
6691
|
-
};
|
|
6692
|
-
if (position === "left" /* Left */ || position === "right" /* Right */) {
|
|
6693
|
-
return /* @__PURE__ */ jsx_runtime21.jsx(FrameLayout_default.Element, {
|
|
6694
|
-
section: position,
|
|
6695
|
-
includeContainer: true,
|
|
6696
|
-
...componentsProps?.layoutElement,
|
|
6697
|
-
componentsProps: import_lodash11.merge({
|
|
6698
|
-
container: {
|
|
6699
|
-
style: {
|
|
6700
|
-
order: -100
|
|
6701
|
-
}
|
|
6702
|
-
}
|
|
6703
|
-
}, componentsProps?.layoutElement?.componentsProps),
|
|
6704
|
-
children: /* @__PURE__ */ jsx_runtime21.jsx(NavbarMinimalContent, {
|
|
6705
|
-
orientation: "vertical" /* Vertical */,
|
|
6706
|
-
...componentsProps?.content
|
|
6707
|
-
})
|
|
6708
|
-
});
|
|
6709
|
-
}
|
|
6710
|
-
if (position === "top" /* Top */ || position === "bottom" /* Bottom */) {
|
|
6711
|
-
const content = /* @__PURE__ */ jsx_runtime21.jsx(NavbarMinimalContent, {
|
|
6712
|
-
orientation: "horizontal" /* Horizontal */,
|
|
6713
|
-
...componentsProps?.content
|
|
6714
|
-
});
|
|
6715
|
-
if (pinnable) {
|
|
6716
|
-
return /* @__PURE__ */ jsx_runtime21.jsx(PageContainer, {
|
|
6717
|
-
...componentsProps?.container,
|
|
6718
|
-
componentsProps: {
|
|
6719
|
-
...componentsProps?.container?.componentsProps,
|
|
6720
|
-
container: {
|
|
6721
|
-
...componentsProps?.container?.componentsProps?.container,
|
|
6722
|
-
className: clsx_default("hide-if-empty", componentsProps?.container?.componentsProps?.container?.className)
|
|
6723
|
-
}
|
|
6724
|
-
},
|
|
6725
|
-
children: /* @__PURE__ */ jsx_runtime21.jsx(Pinnable, {
|
|
6726
|
-
section: position,
|
|
6727
|
-
initialValue: true,
|
|
6728
|
-
...componentsProps?.Pinnable,
|
|
6729
|
-
componentsProps: import_lodash11.merge({
|
|
6730
|
-
container: {
|
|
6731
|
-
onMouseEnter: (e) => {
|
|
6732
|
-
handleEnter();
|
|
6733
|
-
componentsProps?.Pinnable?.componentsProps?.container?.onMouseEnter?.(e);
|
|
6734
|
-
},
|
|
6735
|
-
onMouseLeave: (e) => {
|
|
6736
|
-
handleLeave();
|
|
6737
|
-
componentsProps?.Pinnable?.componentsProps?.container?.onMouseLeave?.(e);
|
|
6738
|
-
}
|
|
6739
|
-
},
|
|
6740
|
-
button: {
|
|
6741
|
-
onClick: (e) => {
|
|
6742
|
-
handleLeave();
|
|
6743
|
-
componentsProps?.Pinnable?.componentsProps?.button?.onClick?.(e);
|
|
6744
|
-
}
|
|
6745
|
-
},
|
|
6746
|
-
layoutElement: {
|
|
6747
|
-
includeContainer: false,
|
|
6748
|
-
includePageContainer: true,
|
|
6749
|
-
componentsProps: {
|
|
6750
|
-
PageContainer: {
|
|
6751
|
-
componentsProps: {
|
|
6752
|
-
container: { style: { order: -100 } }
|
|
6753
|
-
}
|
|
6754
|
-
}
|
|
6755
|
-
}
|
|
6756
|
-
},
|
|
6757
|
-
controls: {
|
|
6758
|
-
mounted: hover
|
|
6759
|
-
}
|
|
6760
|
-
}, componentsProps?.Pinnable?.componentsProps),
|
|
6761
|
-
children: content
|
|
6762
|
-
})
|
|
6763
|
-
});
|
|
6764
|
-
}
|
|
6765
|
-
return content;
|
|
6766
|
-
}
|
|
6767
|
-
if (position === "content" /* Content */) {
|
|
6768
|
-
return /* @__PURE__ */ jsx_runtime21.jsx(PageContainer, {
|
|
6769
|
-
...componentsProps?.container,
|
|
6770
|
-
children: /* @__PURE__ */ jsx_runtime21.jsx(NavbarMinimalContent, {
|
|
6771
|
-
orientation: "horizontal" /* Horizontal */,
|
|
6772
|
-
...componentsProps?.content
|
|
6773
|
-
})
|
|
6774
|
-
});
|
|
6775
|
-
}
|
|
6776
|
-
return null;
|
|
6777
|
-
}
|
|
6778
|
-
|
|
6779
|
-
// src/core/components/AppShell/Navbar/index.tsx
|
|
6780
|
-
var import_icons_react8 = require("@tabler/icons-react");
|
|
6781
|
-
var jsx_runtime22 = require("react/jsx-runtime");
|
|
6782
|
-
var supportedNavbarPositions = {
|
|
6783
|
-
["minimal" /* Minimal */]: [
|
|
6784
|
-
null,
|
|
6785
|
-
"top" /* Top */,
|
|
6786
|
-
"bottom" /* Bottom */,
|
|
6787
|
-
"left" /* Left */,
|
|
6788
|
-
"right" /* Right */,
|
|
6789
|
-
"content" /* Content */
|
|
6790
|
-
]
|
|
6791
|
-
};
|
|
6792
|
-
var defaultNavbarPositions = { ["minimal" /* Minimal */]: "left" /* Left */ };
|
|
6793
|
-
var getDefaultNavigationElements = ({
|
|
6794
|
-
colorScheme,
|
|
6795
|
-
setColorScheme,
|
|
6796
|
-
auth
|
|
6797
|
-
}) => [
|
|
6798
|
-
{
|
|
6799
|
-
type: "button" /* Button */,
|
|
6800
|
-
label: colorScheme === "dark" ? "Light mode" : "Dark mode",
|
|
6801
|
-
icon: colorScheme === "dark" ? import_icons_react8.IconSun : import_icons_react8.IconMoon,
|
|
6802
|
-
static: true,
|
|
6803
|
-
onClick: () => {
|
|
6804
|
-
if (!colorScheme || !setColorScheme) {
|
|
6805
|
-
return;
|
|
6806
|
-
}
|
|
6807
|
-
setColorScheme(colorScheme === "dark" ? "light" : "dark");
|
|
6808
|
-
}
|
|
6809
|
-
},
|
|
6810
|
-
{
|
|
6811
|
-
mounted: auth !== undefined && auth.user === null,
|
|
6812
|
-
type: "anchor" /* Anchor */,
|
|
6813
|
-
label: "Login",
|
|
6814
|
-
href: "/login",
|
|
6815
|
-
static: true,
|
|
6816
|
-
icon: import_icons_react8.IconLogin
|
|
6817
|
-
},
|
|
6818
|
-
{
|
|
6819
|
-
mounted: auth !== undefined && auth.user !== null,
|
|
6820
|
-
type: "button" /* Button */,
|
|
6821
|
-
label: "Logout",
|
|
6822
|
-
static: true,
|
|
6823
|
-
icon: import_icons_react8.IconLogout,
|
|
6824
|
-
onClick: () => {
|
|
6825
|
-
auth?.onLogout?.();
|
|
6826
|
-
}
|
|
6827
|
-
}
|
|
6828
|
-
];
|
|
6829
|
-
function Navbar({ componentsProps }) {
|
|
6830
|
-
const { navbarVariant } = useRemoraidApp();
|
|
6831
|
-
if (navbarVariant === "minimal" /* Minimal */) {
|
|
6832
|
-
return /* @__PURE__ */ jsx_runtime22.jsx(NavbarMinimal, {
|
|
6833
|
-
...componentsProps?.NavbarMinimal
|
|
6834
|
-
});
|
|
6835
|
-
}
|
|
6836
|
-
return null;
|
|
6837
|
-
}
|
|
6838
|
-
var Navbar_default = Object.assign(Navbar, {
|
|
6839
|
-
NavbarMinimal
|
|
6840
|
-
});
|
|
6841
|
-
|
|
6842
|
-
// src/core/components/AppShell/AppShellUserExperienceProvider/index.tsx
|
|
6843
|
-
var jsx_runtime23 = require("react/jsx-runtime");
|
|
6844
|
-
var defaultAppShellUserExperience = {
|
|
6845
|
-
navbar: {
|
|
6846
|
-
position: null,
|
|
6847
|
-
mobilePosition: null,
|
|
6848
|
-
mode: "responsive" /* Responsive */
|
|
6849
|
-
},
|
|
6850
|
-
footer: {
|
|
6851
|
-
position: null
|
|
6852
|
-
}
|
|
6853
|
-
};
|
|
6854
|
-
var defaultAppShellUserExperienceCookieName = "remoraid-app-shell-user-experience";
|
|
6855
|
-
var appShellUserExperienceContext = createUserExperienceContext(defaultAppShellUserExperience);
|
|
6856
|
-
var useAppShellUserExperience = () => {
|
|
6857
|
-
return import_react17.useContext(appShellUserExperienceContext);
|
|
6858
|
-
};
|
|
6859
|
-
function AppShellUserExperienceProvider({
|
|
6860
|
-
children,
|
|
6861
|
-
initialValue,
|
|
6862
|
-
cookieName
|
|
6863
|
-
}) {
|
|
6864
|
-
const { navbarVariant, footerVariant } = useRemoraidApp();
|
|
6865
|
-
const isValidUserExperience = (x) => {
|
|
6866
|
-
if (typeof x !== "object") {
|
|
6867
|
-
return false;
|
|
6868
|
-
}
|
|
6869
|
-
if (x === null) {
|
|
6870
|
-
return false;
|
|
6871
|
-
}
|
|
6872
|
-
if (!("navbar" in x)) {
|
|
6873
|
-
return false;
|
|
6874
|
-
}
|
|
6875
|
-
if (!("footer" in x)) {
|
|
6876
|
-
return false;
|
|
6877
|
-
}
|
|
6878
|
-
return true;
|
|
6879
|
-
};
|
|
6880
|
-
return /* @__PURE__ */ jsx_runtime23.jsx(UserExperienceProviderWrapper, {
|
|
6881
|
-
context: appShellUserExperienceContext,
|
|
6882
|
-
isValidUserExperience,
|
|
6883
|
-
cookieName: cookieName ?? defaultAppShellUserExperienceCookieName,
|
|
6884
|
-
defaultUserExperience: defaultAppShellUserExperience,
|
|
6885
|
-
initialValue: import_lodash12.merge({
|
|
6886
|
-
navbar: {
|
|
6887
|
-
position: navbarVariant === null ? null : defaultNavbarPositions[navbarVariant]
|
|
6888
|
-
},
|
|
6889
|
-
footer: {
|
|
6890
|
-
position: footerVariant === null ? null : defaultFooterPositions[footerVariant]
|
|
6891
|
-
}
|
|
6892
|
-
}, initialValue),
|
|
6893
|
-
children
|
|
6894
|
-
});
|
|
6895
|
-
}
|
|
6896
|
-
|
|
6897
|
-
// src/core/components/AppShell/index.tsx
|
|
6898
|
-
var jsx_runtime24 = require("react/jsx-runtime");
|
|
6899
|
-
var remoraidAppShellLayoutId = "remoraid-app-shell";
|
|
6900
|
-
function AppShell({
|
|
6901
|
-
gutter,
|
|
6902
|
-
appContext: appContext2,
|
|
6903
|
-
initialUserExperience,
|
|
6904
|
-
componentsProps,
|
|
6905
|
-
children
|
|
6906
|
-
}) {
|
|
6907
|
-
const theme = useRemoraidTheme();
|
|
6908
|
-
const { colorScheme } = useHydratedMantineColorScheme();
|
|
6909
|
-
import_react18.useEffect(() => {
|
|
6910
|
-
let meta = document.querySelector('meta[name="theme-color"]');
|
|
6911
|
-
if (!meta) {
|
|
6912
|
-
meta = document.createElement("meta");
|
|
6913
|
-
meta.name = "theme-color";
|
|
6914
|
-
document.head.appendChild(meta);
|
|
6915
|
-
}
|
|
6916
|
-
const { backgroundColor: computedBodyColor } = getComputedStyle(document.body);
|
|
6917
|
-
if (!computedBodyColor) {
|
|
6918
|
-
return;
|
|
6919
|
-
}
|
|
6920
|
-
meta.content = computedBodyColor;
|
|
6921
|
-
}, [colorScheme]);
|
|
6922
|
-
return /* @__PURE__ */ jsx_runtime24.jsx(AppProvider, {
|
|
6923
|
-
appContext: appContext2,
|
|
6924
|
-
...componentsProps?.AppProvider,
|
|
6925
|
-
children: /* @__PURE__ */ jsx_runtime24.jsx(AppShellUserExperienceProvider, {
|
|
6926
|
-
...componentsProps?.AppShellUserExperienceProvider,
|
|
6927
|
-
initialValue: import_lodash13.merge(initialUserExperience, componentsProps?.AppShellUserExperienceProvider?.initialValue),
|
|
6928
|
-
children: /* @__PURE__ */ jsx_runtime24.jsx(import_core13.Box, {
|
|
6929
|
-
h: "100dvh",
|
|
6930
|
-
...componentsProps?.container,
|
|
6931
|
-
children: /* @__PURE__ */ jsx_runtime24.jsxs(FrameLayout_default, {
|
|
6932
|
-
layoutId: remoraidAppShellLayoutId,
|
|
6933
|
-
gutter: gutter ?? theme.primaryGutter,
|
|
6934
|
-
...componentsProps?.layout,
|
|
6935
|
-
children: [
|
|
6936
|
-
/* @__PURE__ */ jsx_runtime24.jsx(Navbar_default, {
|
|
6937
|
-
...componentsProps?.navbar
|
|
6938
|
-
}),
|
|
6939
|
-
children,
|
|
6940
|
-
/* @__PURE__ */ jsx_runtime24.jsx(Footer_default, {
|
|
6941
|
-
...componentsProps?.footer
|
|
6942
|
-
})
|
|
6943
|
-
]
|
|
6944
|
-
})
|
|
6945
|
-
})
|
|
6946
|
-
})
|
|
6947
|
-
});
|
|
6948
|
-
}
|
|
6949
|
-
var AppShell_default = Object.assign(AppShell, {
|
|
6950
|
-
Navbar: Navbar_default,
|
|
6951
|
-
Footer: Footer_default
|
|
6952
|
-
});
|
|
6953
|
-
// src/core/components/WidgetSelectionHeader/index.tsx
|
|
6954
|
-
var import_core16 = require("@mantine/core");
|
|
6955
|
-
|
|
6956
|
-
// src/core/components/Page/index.tsx
|
|
6957
|
-
var import_core14 = require("@mantine/core");
|
|
6958
|
-
var import_react19 = __toESM(require("react"));
|
|
6959
|
-
var jsx_runtime25 = require("react/jsx-runtime");
|
|
6960
|
-
var pageContext = import_react19.default.createContext(null);
|
|
6961
|
-
var usePage = () => {
|
|
6962
|
-
return import_react19.useContext(pageContext);
|
|
6963
|
-
};
|
|
6964
|
-
|
|
6965
|
-
// src/core/components/WidgetSelectionHeader/index.tsx
|
|
6966
|
-
var import_icons_react9 = require("@tabler/icons-react");
|
|
6967
|
-
var import_react20 = require("react");
|
|
6968
|
-
|
|
6969
|
-
// src/core/components/ScrollableChipGroup/index.tsx
|
|
6970
|
-
var import_core15 = require("@mantine/core");
|
|
6971
|
-
var jsx_runtime26 = require("react/jsx-runtime");
|
|
6972
|
-
|
|
6973
|
-
// src/core/components/WidgetSelectionHeader/index.tsx
|
|
6974
|
-
var import_lodash14 = __toESM(require_lodash());
|
|
6975
|
-
var jsx_runtime27 = require("react/jsx-runtime");
|
|
6976
|
-
// src/core/components/BadgeGroup/index.tsx
|
|
6977
|
-
var import_core18 = require("@mantine/core");
|
|
6978
|
-
var import_react21 = __toESM(require("react"));
|
|
6979
|
-
|
|
6980
|
-
// src/core/components/BadgeMinimal/index.tsx
|
|
6981
|
-
var import_core17 = require("@mantine/core");
|
|
6982
|
-
var jsx_runtime28 = require("react/jsx-runtime");
|
|
6983
|
-
function BadgeMinimal({
|
|
6984
|
-
label,
|
|
6985
|
-
tooltip,
|
|
6986
|
-
mounted = true,
|
|
6987
|
-
componentsProps
|
|
6988
|
-
}) {
|
|
6989
|
-
const theme = useRemoraidTheme();
|
|
6990
|
-
return /* @__PURE__ */ jsx_runtime28.jsx(import_core17.Transition, {
|
|
6991
|
-
mounted,
|
|
6992
|
-
transition: "fade",
|
|
6993
|
-
duration: theme.transitionDurations.short,
|
|
6994
|
-
timingFunction: "ease",
|
|
6995
|
-
...componentsProps?.transition,
|
|
6996
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime28.jsx(import_core17.Tooltip, {
|
|
6997
|
-
label: tooltip,
|
|
6998
|
-
disabled: !Boolean(tooltip),
|
|
6999
|
-
...componentsProps?.tooltip,
|
|
7000
|
-
children: /* @__PURE__ */ jsx_runtime28.jsx(import_core17.Badge, {
|
|
7001
|
-
variant: "default",
|
|
7002
|
-
...componentsProps?.badge,
|
|
7003
|
-
style: {
|
|
7004
|
-
...transitionStyle,
|
|
7005
|
-
cursor: "pointer",
|
|
7006
|
-
...componentsProps?.badge?.style
|
|
7007
|
-
},
|
|
7008
|
-
children: label
|
|
7009
|
-
})
|
|
7010
|
-
})
|
|
7011
|
-
});
|
|
7012
|
-
}
|
|
7013
|
-
|
|
7014
|
-
// src/core/components/BadgeGroup/index.tsx
|
|
7015
|
-
var import_lodash15 = __toESM(require_lodash());
|
|
7016
|
-
var jsx_runtime29 = require("react/jsx-runtime");
|
|
7017
|
-
var react = require("react");
|
|
7018
|
-
function BadgeGroup({
|
|
7019
|
-
badges: badgesProp,
|
|
7020
|
-
gap = "xs",
|
|
7021
|
-
breakpoint: breakpointProp,
|
|
7022
|
-
componentsProps
|
|
7023
|
-
}) {
|
|
7024
|
-
const badges = badgesProp.map((badge) => asElementOrPropsOfType(BadgeMinimal, badge, "Check 'badges' property passed to 'BadgeGroup'."));
|
|
7025
|
-
const theme = useRemoraidTheme();
|
|
7026
|
-
const breakpoint = breakpointProp ?? theme.breakpoints.badgeGroupCollapse;
|
|
7027
|
-
const numVisibleBadges = badges.filter((badge) => isValidElementOfType(BadgeMinimal, badge) ? badge.props.mounted : badge.mounted !== false).length;
|
|
7028
|
-
const badgesElement = badges.map((badge, i) => {
|
|
7029
|
-
if (isValidElementOfType(BadgeMinimal, badge)) {
|
|
7030
|
-
return badge;
|
|
7031
|
-
}
|
|
7032
|
-
return /* @__PURE__ */ react.createElement(BadgeMinimal, {
|
|
7033
|
-
...badge,
|
|
7034
|
-
key: i
|
|
7035
|
-
});
|
|
7036
|
-
});
|
|
7037
|
-
return /* @__PURE__ */ jsx_runtime29.jsxs(jsx_runtime29.Fragment, {
|
|
7038
|
-
children: [
|
|
7039
|
-
/* @__PURE__ */ jsx_runtime29.jsx(import_core18.Group, {
|
|
7040
|
-
gap,
|
|
7041
|
-
wrap: "nowrap",
|
|
7042
|
-
visibleFrom: numVisibleBadges > 1 ? breakpoint : undefined,
|
|
7043
|
-
...componentsProps?.container,
|
|
7044
|
-
className: clsx_default("hide-if-empty", componentsProps?.container?.className),
|
|
7045
|
-
children: badgesElement
|
|
7046
|
-
}),
|
|
7047
|
-
/* @__PURE__ */ jsx_runtime29.jsx(import_core18.Transition, {
|
|
7048
|
-
mounted: numVisibleBadges > 1,
|
|
7049
|
-
transition: "fade",
|
|
7050
|
-
duration: theme.transitionDurations.short,
|
|
7051
|
-
timingFunction: "ease",
|
|
7052
|
-
...componentsProps?.cumulativeBadgeTransition,
|
|
7053
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime29.jsxs(import_core18.HoverCard, {
|
|
7054
|
-
...componentsProps?.HoverCard,
|
|
7055
|
-
children: [
|
|
7056
|
-
/* @__PURE__ */ jsx_runtime29.jsx(import_core18.HoverCard.Target, {
|
|
7057
|
-
children: /* @__PURE__ */ jsx_runtime29.jsxs(import_core18.Badge, {
|
|
7058
|
-
hiddenFrom: breakpoint,
|
|
7059
|
-
variant: "dot",
|
|
7060
|
-
...componentsProps?.cumulativeBadge,
|
|
7061
|
-
style: {
|
|
7062
|
-
cursor: "pointer",
|
|
7063
|
-
...import_lodash15.merge(transitionStyle, componentsProps?.cumulativeBadge?.style)
|
|
7064
|
-
},
|
|
7065
|
-
children: [
|
|
7066
|
-
numVisibleBadges,
|
|
7067
|
-
" badges"
|
|
7068
|
-
]
|
|
7069
|
-
})
|
|
7070
|
-
}),
|
|
7071
|
-
/* @__PURE__ */ jsx_runtime29.jsx(import_core18.HoverCard.Dropdown, {
|
|
7072
|
-
p: gap,
|
|
7073
|
-
children: /* @__PURE__ */ jsx_runtime29.jsx(import_core18.Stack, {
|
|
7074
|
-
gap,
|
|
7075
|
-
...componentsProps?.hoverContainer,
|
|
7076
|
-
children: badgesElement
|
|
7077
|
-
})
|
|
7078
|
-
})
|
|
7079
|
-
]
|
|
7080
|
-
})
|
|
7081
|
-
})
|
|
7082
|
-
]
|
|
7083
|
-
});
|
|
7084
|
-
}
|
|
7085
|
-
// src/core/components/AlertMinimal/index.tsx
|
|
7086
|
-
var import_core19 = require("@mantine/core");
|
|
7087
|
-
var import_lodash16 = __toESM(require_lodash());
|
|
7088
|
-
var jsx_runtime30 = require("react/jsx-runtime");
|
|
7089
|
-
function AlertMinimal({
|
|
7090
|
-
category,
|
|
7091
|
-
children,
|
|
7092
|
-
...props
|
|
7093
|
-
}) {
|
|
7094
|
-
const theme = useRemoraidTheme();
|
|
7095
|
-
const {
|
|
7096
|
-
title,
|
|
7097
|
-
text,
|
|
7098
|
-
color,
|
|
7099
|
-
onClose,
|
|
7100
|
-
mounted = true,
|
|
7101
|
-
icon: Icon4,
|
|
7102
|
-
iconSize = "small" /* Small */,
|
|
7103
|
-
componentsProps
|
|
7104
|
-
} = import_lodash16.merge({}, theme.componentsProps.alerts[category], props);
|
|
7105
|
-
return /* @__PURE__ */ jsx_runtime30.jsx(import_core19.Transition, {
|
|
7106
|
-
mounted,
|
|
7107
|
-
transition: "fade",
|
|
7108
|
-
duration: theme.transitionDurations.short,
|
|
7109
|
-
timingFunction: "ease",
|
|
7110
|
-
...componentsProps?.transition,
|
|
7111
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime30.jsxs(import_core19.Alert, {
|
|
7112
|
-
title,
|
|
7113
|
-
color,
|
|
7114
|
-
variant: "light",
|
|
7115
|
-
onClose,
|
|
7116
|
-
withCloseButton: onClose !== undefined,
|
|
7117
|
-
icon: Icon4 ? /* @__PURE__ */ jsx_runtime30.jsx(Icon4, {
|
|
7118
|
-
...import_lodash16.merge({}, theme.componentsProps.icons[iconSize], componentsProps?.icon)
|
|
7119
|
-
}) : undefined,
|
|
7120
|
-
...componentsProps?.alert,
|
|
7121
|
-
style: import_lodash16.merge(transitionStyle, componentsProps?.alert?.style),
|
|
7122
|
-
children: [
|
|
7123
|
-
text,
|
|
7124
|
-
children
|
|
7125
|
-
]
|
|
7126
|
-
})
|
|
7127
|
-
});
|
|
7128
|
-
}
|
|
7129
|
-
// src/core/components/Widget/WidgetWrapper/index.tsx
|
|
7130
|
-
var import_core20 = require("@mantine/core");
|
|
7131
|
-
var import_react22 = require("react");
|
|
7132
|
-
var import_icons_react10 = require("@tabler/icons-react");
|
|
7133
|
-
var import_lodash17 = __toESM(require_lodash());
|
|
7134
|
-
var jsx_runtime31 = require("react/jsx-runtime");
|
|
7135
|
-
function WidgetWrapper({
|
|
7136
|
-
config,
|
|
7137
|
-
mt = 0,
|
|
7138
|
-
withCloseButton = true,
|
|
7139
|
-
pinnableSection,
|
|
7140
|
-
componentsProps,
|
|
7141
|
-
children
|
|
7142
|
-
}) {
|
|
7143
|
-
const {
|
|
7144
|
-
widgets,
|
|
7145
|
-
hideWidget,
|
|
7146
|
-
isPageRegistered,
|
|
7147
|
-
isWidgetRegistered,
|
|
7148
|
-
registerWidget,
|
|
7149
|
-
updateActiveWidget,
|
|
7150
|
-
updateWidgetSelection,
|
|
7151
|
-
activeWidget
|
|
7152
|
-
} = useWidgets();
|
|
7153
|
-
const page = usePage();
|
|
7154
|
-
const theme = useRemoraidTheme();
|
|
7155
|
-
const [controlsContainer, setControlsContainer] = import_react22.useState(null);
|
|
7156
|
-
const widget = page ? widgets[page.pageId]?.[config.widgetId] : undefined;
|
|
7157
|
-
const pageRegistered = page ? isPageRegistered(page.pageId) : false;
|
|
7158
|
-
const containerRef = import_react22.useRef(null);
|
|
7159
|
-
const controlsContainerRef = import_react22.useCallback((n) => {
|
|
7160
|
-
setControlsContainer(n);
|
|
7161
|
-
}, [setControlsContainer]);
|
|
7162
|
-
const handleEnter = () => {
|
|
7163
|
-
updateActiveWidget(config.widgetId);
|
|
7164
|
-
};
|
|
7165
|
-
const handleLeave = (e) => {
|
|
7166
|
-
const to = e.relatedTarget;
|
|
7167
|
-
if (to && to.closest?.("[data-control-button]")) {
|
|
7168
|
-
return;
|
|
7169
|
-
}
|
|
7170
|
-
updateActiveWidget(null);
|
|
7171
|
-
};
|
|
7172
|
-
const mounted = Boolean(widget?.selected);
|
|
7173
|
-
let element = /* @__PURE__ */ jsx_runtime31.jsx(import_core20.Transition, {
|
|
7174
|
-
mounted,
|
|
7175
|
-
transition: "fade-left",
|
|
7176
|
-
duration: theme.transitionDurations.medium,
|
|
7177
|
-
timingFunction: "ease",
|
|
7178
|
-
...componentsProps?.transition,
|
|
7179
|
-
onExited: () => {
|
|
7180
|
-
if (page) {
|
|
7181
|
-
hideWidget(page.pageId, config.widgetId);
|
|
7182
|
-
}
|
|
7183
|
-
componentsProps?.transition?.onExited?.();
|
|
7184
|
-
},
|
|
7185
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime31.jsxs(import_core20.Paper, {
|
|
7186
|
-
ref: containerRef,
|
|
7187
|
-
p: "md",
|
|
7188
|
-
shadow: "md",
|
|
7189
|
-
bg: theme.transparentBackground,
|
|
7190
|
-
mt,
|
|
7191
|
-
pos: "relative",
|
|
7192
|
-
h: "fit-content",
|
|
7193
|
-
mah: "100%",
|
|
7194
|
-
display: "flex",
|
|
7195
|
-
...componentsProps?.container,
|
|
7196
|
-
onMouseEnter: (e) => {
|
|
7197
|
-
handleEnter();
|
|
7198
|
-
componentsProps?.container?.onMouseEnter?.(e);
|
|
7199
|
-
},
|
|
7200
|
-
onMouseLeave: (e) => {
|
|
7201
|
-
handleLeave(e);
|
|
7202
|
-
componentsProps?.container?.onMouseLeave?.(e);
|
|
7203
|
-
},
|
|
7204
|
-
style: import_lodash17.merge(transitionStyle, { flexDirection: "column" }, componentsProps?.container?.style),
|
|
7205
|
-
className: clsx_default("remoraid-segment", componentsProps?.container?.className),
|
|
7206
|
-
id: config.widgetId,
|
|
7207
|
-
children: [
|
|
7208
|
-
/* @__PURE__ */ jsx_runtime31.jsx(Controls, {
|
|
7209
|
-
dragContainerRef: containerRef,
|
|
7210
|
-
groupRef: controlsContainerRef,
|
|
7211
|
-
mounted: activeWidget === config.widgetId,
|
|
7212
|
-
...componentsProps?.controls,
|
|
7213
|
-
children: /* @__PURE__ */ jsx_runtime31.jsx(ControlButton, {
|
|
7214
|
-
mounted: withCloseButton,
|
|
7215
|
-
icon: import_icons_react10.IconX,
|
|
7216
|
-
tooltip: "Hide widget",
|
|
7217
|
-
color: "red",
|
|
7218
|
-
order: 200,
|
|
7219
|
-
...componentsProps?.closeButton,
|
|
7220
|
-
componentsProps: {
|
|
7221
|
-
...componentsProps?.closeButton?.componentsProps,
|
|
7222
|
-
tooltip: {
|
|
7223
|
-
disabled: !mounted,
|
|
7224
|
-
...componentsProps?.closeButton?.componentsProps?.tooltip
|
|
7225
|
-
}
|
|
7226
|
-
},
|
|
7227
|
-
onClick: (e) => {
|
|
7228
|
-
if (!page) {
|
|
7229
|
-
return;
|
|
7230
|
-
}
|
|
7231
|
-
updateWidgetSelection(page.pageId, config.widgetId, false);
|
|
7232
|
-
handleLeave(e);
|
|
7233
|
-
componentsProps?.closeButton?.onClick?.(e);
|
|
7234
|
-
}
|
|
7235
|
-
})
|
|
7236
|
-
}),
|
|
7237
|
-
children
|
|
7238
|
-
]
|
|
7239
|
-
})
|
|
7240
|
-
});
|
|
7241
|
-
if (pinnableSection !== undefined) {
|
|
7242
|
-
element = /* @__PURE__ */ jsx_runtime31.jsx(Pinnable, {
|
|
7243
|
-
section: pinnableSection,
|
|
7244
|
-
controlsContainer,
|
|
7245
|
-
hidden: Boolean(widget?.hidden),
|
|
7246
|
-
...componentsProps?.Pinnable,
|
|
7247
|
-
componentsProps: {
|
|
7248
|
-
...componentsProps?.Pinnable?.componentsProps,
|
|
7249
|
-
button: {
|
|
7250
|
-
...componentsProps?.Pinnable?.componentsProps?.button,
|
|
7251
|
-
onClick: (e) => {
|
|
7252
|
-
handleLeave(e);
|
|
7253
|
-
componentsProps?.Pinnable?.componentsProps?.button?.onClick?.(e);
|
|
7254
|
-
}
|
|
7255
|
-
},
|
|
7256
|
-
layoutElement: {
|
|
7257
|
-
includeContainer: false,
|
|
7258
|
-
includePageContainer: pinnableSection === "top" /* Top */ || pinnableSection === "bottom" /* Bottom */,
|
|
7259
|
-
...componentsProps?.Pinnable?.componentsProps?.layoutElement
|
|
7260
|
-
}
|
|
7261
|
-
},
|
|
7262
|
-
children: element
|
|
7263
|
-
});
|
|
7264
|
-
}
|
|
7265
|
-
import_react22.useEffect(() => {
|
|
7266
|
-
if (!page) {
|
|
7267
|
-
return;
|
|
7268
|
-
}
|
|
7269
|
-
if (!isWidgetRegistered(page.pageId, config.widgetId)) {
|
|
7270
|
-
registerWidget(page.pageId, config);
|
|
7271
|
-
}
|
|
7272
|
-
}, [pageRegistered]);
|
|
7273
|
-
return element;
|
|
7274
|
-
}
|
|
7275
|
-
// src/core/components/Widget/index.tsx
|
|
7276
|
-
var import_core21 = require("@mantine/core");
|
|
7277
|
-
var import_react23 = require("react");
|
|
7278
|
-
var import_lodash18 = __toESM(require_lodash());
|
|
7279
|
-
var jsx_runtime32 = require("react/jsx-runtime");
|
|
7280
|
-
var react2 = require("react");
|
|
7281
|
-
function Widget({
|
|
7282
|
-
id,
|
|
7283
|
-
title,
|
|
7284
|
-
description,
|
|
7285
|
-
config,
|
|
7286
|
-
badges: badgesProp,
|
|
7287
|
-
buttons: buttonsProp,
|
|
7288
|
-
alerts: alertsProp,
|
|
7289
|
-
gaps,
|
|
7290
|
-
loading,
|
|
7291
|
-
mt,
|
|
7292
|
-
pinnableSection,
|
|
7293
|
-
componentsProps,
|
|
7294
|
-
children
|
|
7295
|
-
}) {
|
|
7296
|
-
const buttons = buttonsProp?.map((button) => asElementOrPropsOfType(RemoraidButton, button, "Check the 'buttons' property of this widget."));
|
|
7297
|
-
const alerts = alertsProp?.map((alert) => asElementOrPropsOfType(AlertMinimal, alert, "Check the 'alerts' property of this widget."));
|
|
7298
|
-
const badges = badgesProp?.map((badge) => asElementOrPropsOfType(BadgeMinimal, badge, "Check the 'badges' property of this widget."));
|
|
7299
|
-
const badgesGap = (typeof gaps === "object" ? gaps.badges : gaps) ?? "xs";
|
|
7300
|
-
const buttonsGap = (typeof gaps === "object" ? gaps.buttons : gaps) ?? "xs";
|
|
7301
|
-
const alertsGap = (typeof gaps === "object" ? gaps.alerts : gaps) ?? "xs";
|
|
7302
|
-
return /* @__PURE__ */ jsx_runtime32.jsx(WidgetWrapper, {
|
|
7303
|
-
config: {
|
|
7304
|
-
widgetId: id,
|
|
7305
|
-
...config,
|
|
7306
|
-
initialValues: {
|
|
7307
|
-
name: title,
|
|
7308
|
-
...config?.initialValues
|
|
7309
|
-
}
|
|
7310
|
-
},
|
|
7311
|
-
mt,
|
|
7312
|
-
...componentsProps?.wrapper,
|
|
7313
|
-
pinnableSection: pinnableSection ?? componentsProps?.wrapper?.pinnableSection,
|
|
7314
|
-
children: /* @__PURE__ */ jsx_runtime32.jsxs(import_core21.Stack, {
|
|
7315
|
-
gap: "md",
|
|
7316
|
-
mih: 0,
|
|
7317
|
-
...componentsProps?.contentContainer,
|
|
7318
|
-
children: [
|
|
7319
|
-
/* @__PURE__ */ jsx_runtime32.jsxs(import_core21.Group, {
|
|
7320
|
-
justify: "space-between",
|
|
7321
|
-
wrap: "nowrap",
|
|
7322
|
-
children: [
|
|
7323
|
-
/* @__PURE__ */ jsx_runtime32.jsxs(import_core21.Stack, {
|
|
7324
|
-
gap: 4,
|
|
7325
|
-
children: [
|
|
7326
|
-
/* @__PURE__ */ jsx_runtime32.jsxs(import_core21.Group, {
|
|
7327
|
-
gap: badgesGap,
|
|
7328
|
-
wrap: "nowrap",
|
|
7329
|
-
children: [
|
|
7330
|
-
/* @__PURE__ */ jsx_runtime32.jsx(import_core21.Title, {
|
|
7331
|
-
order: 1,
|
|
7332
|
-
size: "h2",
|
|
7333
|
-
lineClamp: 1,
|
|
7334
|
-
...componentsProps?.title,
|
|
7335
|
-
children: title ?? id
|
|
7336
|
-
}),
|
|
7337
|
-
badges !== undefined && /* @__PURE__ */ jsx_runtime32.jsx(BadgeGroup, {
|
|
7338
|
-
badges,
|
|
7339
|
-
gap: badgesGap,
|
|
7340
|
-
...componentsProps?.badgeGroup
|
|
7341
|
-
})
|
|
7342
|
-
]
|
|
7343
|
-
}),
|
|
7344
|
-
/* @__PURE__ */ jsx_runtime32.jsx(import_core21.Transition, {
|
|
7345
|
-
mounted: Boolean(description),
|
|
7346
|
-
children: (transitionStyle) => /* @__PURE__ */ jsx_runtime32.jsx(import_core21.Text, {
|
|
7347
|
-
size: "sm",
|
|
7348
|
-
c: "dimmed",
|
|
7349
|
-
...componentsProps?.description,
|
|
7350
|
-
style: import_lodash18.merge(transitionStyle, componentsProps?.description?.style),
|
|
7351
|
-
children: description
|
|
7352
|
-
})
|
|
7353
|
-
})
|
|
7354
|
-
]
|
|
7355
|
-
}),
|
|
7356
|
-
/* @__PURE__ */ jsx_runtime32.jsx(import_core21.Group, {
|
|
7357
|
-
gap: buttonsGap,
|
|
7358
|
-
wrap: "nowrap",
|
|
7359
|
-
children: buttons !== undefined && buttons.map((button, i) => {
|
|
7360
|
-
if (isValidElementOfType(RemoraidButton, button)) {
|
|
7361
|
-
return button;
|
|
7362
|
-
}
|
|
7363
|
-
return /* @__PURE__ */ react2.createElement(RemoraidButton, {
|
|
7364
|
-
...button,
|
|
7365
|
-
key: i
|
|
7366
|
-
});
|
|
7367
|
-
})
|
|
7368
|
-
})
|
|
7369
|
-
]
|
|
7370
|
-
}),
|
|
7371
|
-
/* @__PURE__ */ jsx_runtime32.jsx(import_core21.Box, {
|
|
7372
|
-
children: /* @__PURE__ */ jsx_runtime32.jsx(import_core21.Divider, {
|
|
7373
|
-
...componentsProps?.divider
|
|
7374
|
-
})
|
|
7375
|
-
}),
|
|
7376
|
-
/* @__PURE__ */ jsx_runtime32.jsx(import_core21.Stack, {
|
|
7377
|
-
align: "stretch",
|
|
7378
|
-
gap: alertsGap,
|
|
7379
|
-
...componentsProps?.alertsContainer,
|
|
7380
|
-
className: clsx_default("hide-if-empty", componentsProps?.alertsContainer?.className),
|
|
7381
|
-
children: alerts?.map((alert, i) => {
|
|
7382
|
-
if (isValidElementOfType(AlertMinimal, alert)) {
|
|
7383
|
-
return alert;
|
|
7384
|
-
}
|
|
7385
|
-
return /* @__PURE__ */ react2.createElement(AlertMinimal, {
|
|
7386
|
-
...alert,
|
|
7387
|
-
key: i
|
|
7388
|
-
});
|
|
7389
|
-
})
|
|
7390
|
-
}),
|
|
7391
|
-
(loading || import_react23.Children.toArray(children).length > 0) && /* @__PURE__ */ jsx_runtime32.jsx(import_core21.ScrollArea.Autosize, {
|
|
7392
|
-
flex: 1,
|
|
7393
|
-
...componentsProps?.childrenContainer,
|
|
7394
|
-
className: clsx_default("remoraid-widget-children-container", componentsProps?.childrenContainer?.className),
|
|
7395
|
-
children: loading ? /* @__PURE__ */ jsx_runtime32.jsx(import_core21.Center, {
|
|
7396
|
-
children: /* @__PURE__ */ jsx_runtime32.jsx(import_core21.Loader, {
|
|
7397
|
-
...componentsProps?.loader
|
|
7398
|
-
})
|
|
7399
|
-
}) : children
|
|
7400
|
-
})
|
|
7401
|
-
]
|
|
7402
|
-
})
|
|
7403
|
-
});
|
|
7404
|
-
}
|
|
7405
|
-
// src/core/components/NotFoundPage/index.tsx
|
|
7406
|
-
var jsx_runtime33 = require("react/jsx-runtime");
|
|
7407
|
-
// src/core/components/EnvironmentShell/index.tsx
|
|
7408
|
-
var jsx_runtime34 = require("react/jsx-runtime");
|
|
7409
|
-
// src/core/components/SettingsWidget/index.tsx
|
|
7410
|
-
var import_react24 = require("react");
|
|
7411
|
-
var import_icons_react12 = require("@tabler/icons-react");
|
|
7412
|
-
|
|
7413
|
-
// src/core/components/SettingsWidget/SaveButton/index.tsx
|
|
7414
|
-
var import_icons_react11 = require("@tabler/icons-react");
|
|
7415
|
-
var import_core22 = require("@mantine/core");
|
|
7416
|
-
var jsx_runtime35 = require("react/jsx-runtime");
|
|
7417
|
-
function SaveButton({
|
|
7418
|
-
onSaveChanges,
|
|
7419
|
-
insideContainer,
|
|
7420
|
-
componentsProps
|
|
7421
|
-
}) {
|
|
7422
|
-
const settingsWidgetOptions = useSettingsWidgetContext();
|
|
7423
|
-
const button = /* @__PURE__ */ jsx_runtime35.jsx(RemoraidButton, {
|
|
7424
|
-
label: "Save Changes",
|
|
7425
|
-
icon: import_icons_react11.IconDeviceFloppy,
|
|
7426
|
-
onClick: onSaveChanges,
|
|
7427
|
-
responsive: false,
|
|
7428
|
-
...componentsProps?.button,
|
|
7429
|
-
componentsProps: {
|
|
7430
|
-
...componentsProps?.button?.componentsProps,
|
|
7431
|
-
button: {
|
|
7432
|
-
disabled: settingsWidgetOptions.unsavedChanges === false,
|
|
7433
|
-
...componentsProps?.button?.componentsProps?.button
|
|
7434
|
-
}
|
|
7435
|
-
}
|
|
7436
|
-
});
|
|
7437
|
-
if (insideContainer !== false) {
|
|
7438
|
-
return /* @__PURE__ */ jsx_runtime35.jsx(import_core22.Group, {
|
|
7439
|
-
w: "100%",
|
|
7440
|
-
justify: "flex-end",
|
|
7441
|
-
mt: "md",
|
|
7442
|
-
...componentsProps?.container,
|
|
7443
|
-
children: button
|
|
7444
|
-
});
|
|
7445
|
-
}
|
|
7446
|
-
return button;
|
|
7447
|
-
}
|
|
7448
|
-
|
|
7449
|
-
// src/core/components/SettingsWidget/index.tsx
|
|
7450
|
-
var jsx_runtime36 = require("react/jsx-runtime");
|
|
7451
|
-
var defaultSettingsWidgetContext = {};
|
|
7452
|
-
var settingsWidgetContext = import_react24.createContext(defaultSettingsWidgetContext);
|
|
7453
|
-
var useSettingsWidgetContext = () => {
|
|
7454
|
-
return import_react24.useContext(settingsWidgetContext);
|
|
7455
|
-
};
|
|
7456
|
-
function SettingsWidget({
|
|
7457
|
-
children,
|
|
7458
|
-
onRestoreDefaultValues,
|
|
7459
|
-
unsavedChanges,
|
|
7460
|
-
custom,
|
|
7461
|
-
widgetProps
|
|
7462
|
-
}) {
|
|
7463
|
-
return /* @__PURE__ */ jsx_runtime36.jsx(settingsWidgetContext.Provider, {
|
|
7464
|
-
value: { custom, unsavedChanges },
|
|
7465
|
-
children: /* @__PURE__ */ jsx_runtime36.jsx(Widget, {
|
|
7466
|
-
title: "Settings",
|
|
7467
|
-
id: "settings",
|
|
7468
|
-
...widgetProps,
|
|
7469
|
-
buttons: [
|
|
7470
|
-
...onRestoreDefaultValues ? [
|
|
7471
|
-
{
|
|
7472
|
-
label: "Restore Default Values",
|
|
7473
|
-
icon: import_icons_react12.IconRestore,
|
|
7474
|
-
onClick: onRestoreDefaultValues,
|
|
7475
|
-
componentsProps: { button: { disabled: custom === false } }
|
|
7476
|
-
}
|
|
7477
|
-
] : [],
|
|
7478
|
-
...widgetProps?.buttons ?? []
|
|
7479
|
-
],
|
|
7480
|
-
badges: [
|
|
7481
|
-
{
|
|
7482
|
-
label: "Custom",
|
|
7483
|
-
tooltip: "Your settings differ from the default settings",
|
|
7484
|
-
mounted: custom ?? false
|
|
7485
|
-
},
|
|
7486
|
-
{
|
|
7487
|
-
label: "Unsaved Changes",
|
|
7488
|
-
mounted: unsavedChanges ?? false
|
|
7489
|
-
},
|
|
7490
|
-
...widgetProps?.badges ?? []
|
|
7491
|
-
],
|
|
7492
|
-
children
|
|
7493
|
-
})
|
|
7494
|
-
});
|
|
7495
|
-
}
|
|
7496
|
-
var SettingsWidget_default = Object.assign(SettingsWidget, {
|
|
7497
|
-
SaveButton
|
|
7498
|
-
});
|
|
7499
|
-
// src/core/components/SettingsWidget/SettingsTable/index.tsx
|
|
7500
|
-
var import_react25 = require("react");
|
|
7501
|
-
var import_core24 = require("@mantine/core");
|
|
7502
|
-
|
|
7503
|
-
// src/core/components/SettingsWidget/SettingsTable/Row/index.tsx
|
|
7504
|
-
var import_core23 = require("@mantine/core");
|
|
7505
|
-
var jsx_runtime37 = require("react/jsx-runtime");
|
|
7506
|
-
function Row({
|
|
7507
|
-
children,
|
|
7508
|
-
label
|
|
7509
|
-
}) {
|
|
7510
|
-
const options = useSettingsTableOptions();
|
|
7511
|
-
return /* @__PURE__ */ jsx_runtime37.jsxs(import_core23.Table.Tr, {
|
|
7512
|
-
children: [
|
|
7513
|
-
/* @__PURE__ */ jsx_runtime37.jsx(import_core23.Table.Th, {
|
|
7514
|
-
w: options.leftColumnWidth,
|
|
7515
|
-
children: /* @__PURE__ */ jsx_runtime37.jsx(import_core23.Text, {
|
|
7516
|
-
size: "sm",
|
|
7517
|
-
children: label
|
|
7518
|
-
})
|
|
7519
|
-
}),
|
|
7520
|
-
/* @__PURE__ */ jsx_runtime37.jsx(import_core23.Table.Td, {
|
|
7521
|
-
py: "xs",
|
|
7522
|
-
children
|
|
7523
|
-
})
|
|
7524
|
-
]
|
|
7525
|
-
});
|
|
7526
|
-
}
|
|
7527
|
-
|
|
7528
|
-
// src/core/components/SettingsWidget/SettingsTable/index.tsx
|
|
7529
|
-
var jsx_runtime38 = require("react/jsx-runtime");
|
|
7530
|
-
var defaultSettingsTableOptions = {
|
|
7531
|
-
leftColumnWidth: "38.2%"
|
|
7532
|
-
};
|
|
7533
|
-
var settingsTableOptionsContext = import_react25.createContext(defaultSettingsTableOptions);
|
|
7534
|
-
var useSettingsTableOptions = () => {
|
|
7535
|
-
return import_react25.useContext(settingsTableOptionsContext);
|
|
7536
|
-
};
|
|
7537
|
-
function SettingsTable({
|
|
7538
|
-
leftColumnWidth,
|
|
7539
|
-
children: childrenProp
|
|
7540
|
-
}) {
|
|
7541
|
-
const children = asChildrenOfType(Row, childrenProp, "Check children passed to 'SettingsTable' component.");
|
|
7542
|
-
const theme = useRemoraidTheme();
|
|
7543
|
-
return /* @__PURE__ */ jsx_runtime38.jsx(settingsTableOptionsContext.Provider, {
|
|
7544
|
-
value: {
|
|
7545
|
-
leftColumnWidth: leftColumnWidth ?? defaultSettingsTableOptions.leftColumnWidth
|
|
7546
|
-
},
|
|
7547
|
-
children: /* @__PURE__ */ jsx_runtime38.jsx(import_core24.Table, {
|
|
7548
|
-
bg: theme.transparentBackground,
|
|
7549
|
-
withTableBorder: true,
|
|
7550
|
-
variant: "vertical",
|
|
7551
|
-
layout: "fixed",
|
|
7552
|
-
children: /* @__PURE__ */ jsx_runtime38.jsx(import_core24.Table.Tbody, {
|
|
7553
|
-
children
|
|
7554
|
-
})
|
|
7555
|
-
})
|
|
7556
|
-
});
|
|
7557
|
-
}
|
|
7558
|
-
var SettingsTable_default = Object.assign(SettingsTable, {
|
|
7559
|
-
Row
|
|
7560
|
-
});
|
|
7561
|
-
// src/core/components/NavbarSettingsWidget/index.tsx
|
|
7562
|
-
var import_lodash19 = __toESM(require_lodash());
|
|
7563
|
-
var import_core25 = require("@mantine/core");
|
|
7564
|
-
var jsx_runtime39 = require("react/jsx-runtime");
|
|
7565
|
-
// src/core/components/FooterSettingsWidget/index.tsx
|
|
7566
|
-
var import_lodash20 = __toESM(require_lodash());
|
|
7567
|
-
var import_core26 = require("@mantine/core");
|
|
7568
|
-
var jsx_runtime40 = require("react/jsx-runtime");
|
|
7569
|
-
// src/core/components/ContextClusterProvider/index.tsx
|
|
7570
|
-
var import_react26 = __toESM(require("react"));
|
|
7571
|
-
var jsx_runtime41 = require("react/jsx-runtime");
|
|
7572
|
-
// src/core/components/InputWrapperScrollArea/index.tsx
|
|
7573
|
-
var import_core27 = require("@mantine/core");
|
|
7574
|
-
var import_react27 = require("react");
|
|
7575
|
-
var import_core28 = require("remoraid/core");
|
|
7576
|
-
var jsx_runtime42 = require("react/jsx-runtime");
|
|
7577
|
-
function InputWrapperScrollArea({
|
|
7578
|
-
children,
|
|
7579
|
-
label,
|
|
7580
|
-
mah,
|
|
7581
|
-
description,
|
|
7582
|
-
error,
|
|
7583
|
-
required = false,
|
|
7584
|
-
componentsProps
|
|
7585
|
-
}) {
|
|
7586
|
-
const theme = import_core28.useRemoraidTheme();
|
|
7587
|
-
const [isHovering, setIsHovering] = import_react27.useState(false);
|
|
7588
|
-
return /* @__PURE__ */ jsx_runtime42.jsx(import_core27.Input.Wrapper, {
|
|
7589
|
-
label,
|
|
7590
|
-
error,
|
|
7591
|
-
onMouseEnter: () => setIsHovering(true),
|
|
7592
|
-
onMouseLeave: () => setIsHovering(false),
|
|
7593
|
-
description,
|
|
7594
|
-
withAsterisk: required,
|
|
7595
|
-
...componentsProps?.container,
|
|
7596
|
-
children: /* @__PURE__ */ jsx_runtime42.jsx(import_core27.Paper, {
|
|
7597
|
-
shadow: "none",
|
|
7598
|
-
p: 0,
|
|
7599
|
-
mt: Boolean(description) ? 4 : 0,
|
|
7600
|
-
withBorder: true,
|
|
7601
|
-
display: "flex",
|
|
7602
|
-
bg: theme.transparentBackground,
|
|
7603
|
-
style: {
|
|
7604
|
-
transition: "border-color .1s",
|
|
7605
|
-
borderColor: error ? "var(--mantine-color-error)" : isHovering ? "var(--mantine-primary-color-filled)" : undefined
|
|
7606
|
-
},
|
|
7607
|
-
children: /* @__PURE__ */ jsx_runtime42.jsx(import_core27.ScrollArea, {
|
|
7608
|
-
mah,
|
|
7609
|
-
px: "md",
|
|
7610
|
-
flex: 1,
|
|
7611
|
-
...componentsProps?.ScrollArea,
|
|
7612
|
-
children: /* @__PURE__ */ jsx_runtime42.jsx(import_core27.Box, {
|
|
7613
|
-
...componentsProps?.childrenContainer,
|
|
7614
|
-
children
|
|
7615
|
-
})
|
|
7616
|
-
})
|
|
7617
|
-
})
|
|
7618
|
-
});
|
|
7619
|
-
}
|
|
7620
|
-
// src/jsonforms/renderers/AnyControl.tsx
|
|
7621
|
-
var import_react29 = require("@jsonforms/react");
|
|
7622
|
-
var import_core30 = require("@mantine/core");
|
|
7623
|
-
var import_react30 = require("react");
|
|
7624
5479
|
|
|
7625
5480
|
// src/jsonforms/components/FormOptionsProvider/index.tsx
|
|
7626
|
-
var
|
|
7627
|
-
var
|
|
5481
|
+
var import_react = __toESM(require("react"));
|
|
5482
|
+
var jsx_runtime = require("react/jsx-runtime");
|
|
7628
5483
|
var defaultFormOptions = {
|
|
7629
5484
|
withDescriptions: false,
|
|
7630
5485
|
gutter: "md"
|
|
7631
5486
|
};
|
|
7632
|
-
var formOptionsContext =
|
|
5487
|
+
var formOptionsContext = import_react.default.createContext({
|
|
7633
5488
|
formOptions: defaultFormOptions,
|
|
7634
5489
|
updateFormOptions: () => {}
|
|
7635
5490
|
});
|
|
7636
|
-
var useFormOptions = () =>
|
|
5491
|
+
var useFormOptions = () => import_react.useContext(formOptionsContext);
|
|
7637
5492
|
function FormOptionsProvider({
|
|
7638
5493
|
children,
|
|
7639
5494
|
initialValue
|
|
7640
5495
|
}) {
|
|
7641
|
-
const [formOptions, setFormOptions] =
|
|
5496
|
+
const [formOptions, setFormOptions] = import_react.useState({
|
|
7642
5497
|
...defaultFormOptions,
|
|
7643
5498
|
...initialValue
|
|
7644
5499
|
});
|
|
7645
5500
|
const updateFormOptions = (newFormOptions) => {
|
|
7646
5501
|
setFormOptions((prev) => ({ ...prev, ...newFormOptions }));
|
|
7647
5502
|
};
|
|
7648
|
-
return /* @__PURE__ */
|
|
5503
|
+
return /* @__PURE__ */ jsx_runtime.jsx(formOptionsContext.Provider, {
|
|
7649
5504
|
value: { formOptions, updateFormOptions },
|
|
7650
5505
|
children
|
|
7651
5506
|
});
|
|
7652
5507
|
}
|
|
7653
5508
|
|
|
7654
5509
|
// src/jsonforms/renderers/AnyControl.tsx
|
|
7655
|
-
var
|
|
5510
|
+
var jsx_runtime2 = require("react/jsx-runtime");
|
|
7656
5511
|
function PlainAnyControl({
|
|
7657
5512
|
data,
|
|
7658
5513
|
handleChange,
|
|
@@ -7661,21 +5516,21 @@ function PlainAnyControl({
|
|
|
7661
5516
|
required,
|
|
7662
5517
|
schema
|
|
7663
5518
|
}) {
|
|
7664
|
-
const theme = useRemoraidTheme();
|
|
5519
|
+
const theme = import_core.useRemoraidTheme();
|
|
7665
5520
|
const {
|
|
7666
5521
|
formOptions: { withDescriptions }
|
|
7667
5522
|
} = useFormOptions();
|
|
7668
|
-
const [input, setInput] =
|
|
7669
|
-
const [error, setError] =
|
|
5523
|
+
const [input, setInput] = import_react3.useState(JSON.stringify(data, null, theme.jsonStringifySpace));
|
|
5524
|
+
const [error, setError] = import_react3.useState(false);
|
|
7670
5525
|
const label = labelProp !== "remoraid-array-item" ? labelProp : null;
|
|
7671
5526
|
const description = withDescriptions ? schema.description : undefined;
|
|
7672
|
-
return /* @__PURE__ */
|
|
5527
|
+
return /* @__PURE__ */ jsx_runtime2.jsx(import_core.InputWrapperScrollArea, {
|
|
7673
5528
|
label: label ?? undefined,
|
|
7674
5529
|
error: error ? "Invalid JSON" : undefined,
|
|
7675
5530
|
description,
|
|
7676
5531
|
required,
|
|
7677
5532
|
mah: 140,
|
|
7678
|
-
children: /* @__PURE__ */
|
|
5533
|
+
children: /* @__PURE__ */ jsx_runtime2.jsx(import_core2.JsonInput, {
|
|
7679
5534
|
onChange: (newValue) => {
|
|
7680
5535
|
setInput(newValue);
|
|
7681
5536
|
try {
|
|
@@ -7696,15 +5551,15 @@ function PlainAnyControl({
|
|
|
7696
5551
|
})
|
|
7697
5552
|
});
|
|
7698
5553
|
}
|
|
7699
|
-
var AnyControl =
|
|
5554
|
+
var AnyControl = import_react2.withJsonFormsControlProps(PlainAnyControl);
|
|
7700
5555
|
var AnyControl_default = AnyControl;
|
|
7701
5556
|
|
|
7702
5557
|
// src/jsonforms/renderers/AnyOfControl.tsx
|
|
7703
|
-
var
|
|
7704
|
-
var
|
|
7705
|
-
var
|
|
7706
|
-
var
|
|
7707
|
-
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");
|
|
7708
5563
|
function PlainAnyOfControl({
|
|
7709
5564
|
data,
|
|
7710
5565
|
schema,
|
|
@@ -7715,7 +5570,7 @@ function PlainAnyOfControl({
|
|
|
7715
5570
|
rootSchema
|
|
7716
5571
|
}) {
|
|
7717
5572
|
const { formOptions } = useFormOptions();
|
|
7718
|
-
const { core, renderers, cells } =
|
|
5573
|
+
const { core, renderers, cells } = import_react4.useJsonForms();
|
|
7719
5574
|
const inferType = (schema2) => {
|
|
7720
5575
|
if (!schema2) {
|
|
7721
5576
|
return;
|
|
@@ -7735,17 +5590,17 @@ function PlainAnyOfControl({
|
|
|
7735
5590
|
}
|
|
7736
5591
|
return;
|
|
7737
5592
|
};
|
|
7738
|
-
const options =
|
|
5593
|
+
const options = import_react5.useMemo(() => {
|
|
7739
5594
|
const anyOf = schema.anyOf ?? [];
|
|
7740
5595
|
return anyOf.map((opt, idx) => {
|
|
7741
|
-
const resolved = opt.$ref ?
|
|
5596
|
+
const resolved = opt.$ref ? import_core3.Resolve.schema(rootSchema, opt.$ref, rootSchema) : opt;
|
|
7742
5597
|
const refLabel = typeof opt.$ref === "string" ? opt.$ref.split("/").slice(-1)[0] : undefined;
|
|
7743
5598
|
const typeLabel = inferType(resolved) ?? inferType(opt);
|
|
7744
5599
|
const label2 = resolved?.title ?? refLabel ?? typeLabel ?? `Option ${idx + 1}`;
|
|
7745
5600
|
return { original: opt, resolved, label: label2 };
|
|
7746
5601
|
});
|
|
7747
5602
|
}, [schema.anyOf, rootSchema]);
|
|
7748
|
-
const isValidOptionIndex =
|
|
5603
|
+
const isValidOptionIndex = import_react5.useMemo(() => {
|
|
7749
5604
|
return (optionIndex) => {
|
|
7750
5605
|
if (!core?.ajv || data === undefined) {
|
|
7751
5606
|
return false;
|
|
@@ -7754,7 +5609,7 @@ function PlainAnyOfControl({
|
|
|
7754
5609
|
return validate(data);
|
|
7755
5610
|
};
|
|
7756
5611
|
}, [core?.ajv, data, options]);
|
|
7757
|
-
const validOptionIndex =
|
|
5612
|
+
const validOptionIndex = import_react5.useMemo(() => {
|
|
7758
5613
|
for (let i = 0;i < options.length; i++) {
|
|
7759
5614
|
if (isValidOptionIndex(i)) {
|
|
7760
5615
|
return i;
|
|
@@ -7762,7 +5617,7 @@ function PlainAnyOfControl({
|
|
|
7762
5617
|
}
|
|
7763
5618
|
return -1;
|
|
7764
5619
|
}, [options, isValidOptionIndex]);
|
|
7765
|
-
const [selectedOption, setSelectedOption] =
|
|
5620
|
+
const [selectedOption, setSelectedOption] = import_react5.useState(validOptionIndex >= 0 ? String(validOptionIndex) : null);
|
|
7766
5621
|
const schemaDefaultValue = (opt) => {
|
|
7767
5622
|
const t = opt.type ?? (opt.properties ? "object" : opt.items ? "array" : undefined);
|
|
7768
5623
|
switch (t) {
|
|
@@ -7788,19 +5643,19 @@ function PlainAnyOfControl({
|
|
|
7788
5643
|
value: String(i),
|
|
7789
5644
|
label: o.label
|
|
7790
5645
|
}));
|
|
7791
|
-
return /* @__PURE__ */
|
|
7792
|
-
children: /* @__PURE__ */
|
|
5646
|
+
return /* @__PURE__ */ jsx_runtime3.jsx(jsx_runtime3.Fragment, {
|
|
5647
|
+
children: /* @__PURE__ */ jsx_runtime3.jsx(import_core4.Input.Wrapper, {
|
|
7793
5648
|
label,
|
|
7794
5649
|
description: formOptions.withDescriptions ? schema.description ?? null : null,
|
|
7795
5650
|
withAsterisk: required,
|
|
7796
|
-
children: /* @__PURE__ */
|
|
5651
|
+
children: /* @__PURE__ */ jsx_runtime3.jsxs(import_core4.Paper, {
|
|
7797
5652
|
withBorder: true,
|
|
7798
5653
|
shadow: "0",
|
|
7799
5654
|
bg: "var(--remoraid-transparent-background)",
|
|
7800
5655
|
p: formOptions.gutter,
|
|
7801
5656
|
mt: formOptions.withDescriptions && schema.description && schema.description.length > 0 ? 4 : 0,
|
|
7802
5657
|
children: [
|
|
7803
|
-
/* @__PURE__ */
|
|
5658
|
+
/* @__PURE__ */ jsx_runtime3.jsx(import_core4.Select, {
|
|
7804
5659
|
label: "Value type",
|
|
7805
5660
|
data: selectData,
|
|
7806
5661
|
value: selectedOption,
|
|
@@ -7821,7 +5676,7 @@ function PlainAnyOfControl({
|
|
|
7821
5676
|
variant: "default",
|
|
7822
5677
|
mb: selectedOption !== null && inferType(selectedSchema) !== "null" ? formOptions.gutter : undefined
|
|
7823
5678
|
}),
|
|
7824
|
-
selectedOption !== null && /* @__PURE__ */
|
|
5679
|
+
selectedOption !== null && /* @__PURE__ */ jsx_runtime3.jsx(import_react4.JsonForms, {
|
|
7825
5680
|
schema: {
|
|
7826
5681
|
...selectedSchema,
|
|
7827
5682
|
$schema: undefined
|
|
@@ -7839,21 +5694,21 @@ function PlainAnyOfControl({
|
|
|
7839
5694
|
})
|
|
7840
5695
|
});
|
|
7841
5696
|
}
|
|
7842
|
-
var AnyOfControl =
|
|
5697
|
+
var AnyOfControl = import_react4.withJsonFormsControlProps(PlainAnyOfControl);
|
|
7843
5698
|
var AnyOfControl_default = AnyOfControl;
|
|
7844
5699
|
|
|
7845
5700
|
// src/jsonforms/renderers/ArrayControl.tsx
|
|
7846
|
-
var
|
|
7847
|
-
var
|
|
7848
|
-
var
|
|
7849
|
-
var
|
|
7850
|
-
var
|
|
7851
|
-
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");
|
|
7852
5707
|
function PlainArrayControl(props) {
|
|
7853
|
-
const theme =
|
|
5708
|
+
const theme = import_core6.useRemoraidTheme();
|
|
7854
5709
|
const { label, schema, data, handleChange, path, required } = props;
|
|
7855
5710
|
const { formOptions } = useFormOptions();
|
|
7856
|
-
const { renderers, cells } =
|
|
5711
|
+
const { renderers, cells } = import_react6.useJsonForms();
|
|
7857
5712
|
let schemaItems;
|
|
7858
5713
|
if (schema.items && !Array.isArray(schema.items)) {
|
|
7859
5714
|
schemaItems = {
|
|
@@ -7867,45 +5722,45 @@ function PlainArrayControl(props) {
|
|
|
7867
5722
|
required: ["item"]
|
|
7868
5723
|
};
|
|
7869
5724
|
} else {
|
|
7870
|
-
return /* @__PURE__ */
|
|
7871
|
-
category:
|
|
5725
|
+
return /* @__PURE__ */ jsx_runtime4.jsx(import_core6.AlertMinimal, {
|
|
5726
|
+
category: import_core6.AlertCategory.Negative,
|
|
7872
5727
|
title: "Renderer missing",
|
|
7873
5728
|
text: `Could not find applicable renderer for property '${label}'.`
|
|
7874
5729
|
});
|
|
7875
5730
|
}
|
|
7876
|
-
return /* @__PURE__ */
|
|
7877
|
-
children: /* @__PURE__ */
|
|
5731
|
+
return /* @__PURE__ */ jsx_runtime4.jsx(jsx_runtime4.Fragment, {
|
|
5732
|
+
children: /* @__PURE__ */ jsx_runtime4.jsx(import_core5.Input.Wrapper, {
|
|
7878
5733
|
label,
|
|
7879
5734
|
description: formOptions.withDescriptions ? schema.description : undefined,
|
|
7880
5735
|
withAsterisk: required,
|
|
7881
|
-
children: /* @__PURE__ */
|
|
5736
|
+
children: /* @__PURE__ */ jsx_runtime4.jsx(import_core5.Paper, {
|
|
7882
5737
|
withBorder: Array.isArray(data) && data.length > 0,
|
|
7883
5738
|
shadow: "0",
|
|
7884
5739
|
bg: "var(--remoraid-transparent-background)",
|
|
7885
5740
|
p: Array.isArray(data) && data.length > 0 ? formOptions.gutter : 0,
|
|
7886
5741
|
mt: formOptions.withDescriptions && schema.description && schema.description.length > 0 ? 4 : 0,
|
|
7887
|
-
children: /* @__PURE__ */
|
|
5742
|
+
children: /* @__PURE__ */ jsx_runtime4.jsxs(import_core5.Stack, {
|
|
7888
5743
|
align: "stretch",
|
|
7889
5744
|
justify: "flex-start",
|
|
7890
5745
|
gap: formOptions.gutter,
|
|
7891
5746
|
children: [
|
|
7892
5747
|
Array.isArray(data) ? data.map((item, i) => {
|
|
7893
|
-
return /* @__PURE__ */
|
|
5748
|
+
return /* @__PURE__ */ jsx_runtime4.jsxs(import_core5.Flex, {
|
|
7894
5749
|
gap: formOptions.gutter,
|
|
7895
5750
|
justify: "flex-start",
|
|
7896
5751
|
align: "center",
|
|
7897
5752
|
direction: "row",
|
|
7898
5753
|
wrap: "nowrap",
|
|
7899
5754
|
children: [
|
|
7900
|
-
/* @__PURE__ */
|
|
5755
|
+
/* @__PURE__ */ jsx_runtime4.jsx(import_core5.Box, {
|
|
7901
5756
|
flex: 1,
|
|
7902
|
-
children: /* @__PURE__ */
|
|
5757
|
+
children: /* @__PURE__ */ jsx_runtime4.jsx(import_react6.JsonForms, {
|
|
7903
5758
|
schema: schemaItems,
|
|
7904
5759
|
data: { item },
|
|
7905
5760
|
renderers: renderers ?? [],
|
|
7906
5761
|
cells: cells ?? [],
|
|
7907
5762
|
onChange: ({ data: newData }) => {
|
|
7908
|
-
if (
|
|
5763
|
+
if (import_lodash.isEqual(data[i], newData.item)) {
|
|
7909
5764
|
return;
|
|
7910
5765
|
}
|
|
7911
5766
|
const dataCopy = [...data];
|
|
@@ -7915,11 +5770,11 @@ function PlainArrayControl(props) {
|
|
|
7915
5770
|
validationMode: "NoValidation"
|
|
7916
5771
|
})
|
|
7917
5772
|
}),
|
|
7918
|
-
/* @__PURE__ */
|
|
5773
|
+
/* @__PURE__ */ jsx_runtime4.jsx(import_core6.RemoraidButton, {
|
|
7919
5774
|
responsive: false,
|
|
7920
5775
|
collapsed: true,
|
|
7921
5776
|
label: "Delete item",
|
|
7922
|
-
icon:
|
|
5777
|
+
icon: import_icons_react.IconTrash,
|
|
7923
5778
|
onClick: () => {
|
|
7924
5779
|
handleChange(path, data.filter((_, index) => index !== i));
|
|
7925
5780
|
},
|
|
@@ -7927,10 +5782,10 @@ function PlainArrayControl(props) {
|
|
|
7927
5782
|
})
|
|
7928
5783
|
]
|
|
7929
5784
|
}, i);
|
|
7930
|
-
}) : /* @__PURE__ */
|
|
7931
|
-
/* @__PURE__ */
|
|
5785
|
+
}) : /* @__PURE__ */ jsx_runtime4.jsx(jsx_runtime4.Fragment, {}),
|
|
5786
|
+
/* @__PURE__ */ jsx_runtime4.jsx(import_core5.Button, {
|
|
7932
5787
|
variant: "default",
|
|
7933
|
-
leftSection: /* @__PURE__ */
|
|
5788
|
+
leftSection: /* @__PURE__ */ jsx_runtime4.jsx(import_icons_react.IconPlus, {
|
|
7934
5789
|
...theme.componentsProps.icons.medium
|
|
7935
5790
|
}),
|
|
7936
5791
|
onClick: () => {
|
|
@@ -7954,13 +5809,13 @@ function PlainArrayControl(props) {
|
|
|
7954
5809
|
})
|
|
7955
5810
|
});
|
|
7956
5811
|
}
|
|
7957
|
-
var ArrayControl =
|
|
5812
|
+
var ArrayControl = import_react6.withJsonFormsControlProps(PlainArrayControl);
|
|
7958
5813
|
var ArrayControl_default = ArrayControl;
|
|
7959
5814
|
|
|
7960
5815
|
// src/jsonforms/renderers/CheckboxControl.tsx
|
|
7961
|
-
var
|
|
7962
|
-
var
|
|
7963
|
-
var
|
|
5816
|
+
var import_react7 = require("@jsonforms/react");
|
|
5817
|
+
var import_core7 = require("@mantine/core");
|
|
5818
|
+
var jsx_runtime5 = require("react/jsx-runtime");
|
|
7964
5819
|
function PlainCheckboxControl({
|
|
7965
5820
|
data,
|
|
7966
5821
|
handleChange,
|
|
@@ -7970,8 +5825,8 @@ function PlainCheckboxControl({
|
|
|
7970
5825
|
schema
|
|
7971
5826
|
}) {
|
|
7972
5827
|
const { formOptions } = useFormOptions();
|
|
7973
|
-
return /* @__PURE__ */
|
|
7974
|
-
children: /* @__PURE__ */
|
|
5828
|
+
return /* @__PURE__ */ jsx_runtime5.jsx(jsx_runtime5.Fragment, {
|
|
5829
|
+
children: /* @__PURE__ */ jsx_runtime5.jsx(import_core7.Checkbox, {
|
|
7975
5830
|
label,
|
|
7976
5831
|
py: formOptions.gutter,
|
|
7977
5832
|
labelPosition: "left",
|
|
@@ -7984,13 +5839,13 @@ function PlainCheckboxControl({
|
|
|
7984
5839
|
})
|
|
7985
5840
|
});
|
|
7986
5841
|
}
|
|
7987
|
-
var CheckboxControl =
|
|
5842
|
+
var CheckboxControl = import_react7.withJsonFormsControlProps(PlainCheckboxControl);
|
|
7988
5843
|
var CheckboxControl_default = CheckboxControl;
|
|
7989
5844
|
|
|
7990
5845
|
// src/jsonforms/renderers/NumberControl.tsx
|
|
7991
|
-
var
|
|
7992
|
-
var
|
|
7993
|
-
var
|
|
5846
|
+
var import_react8 = require("@jsonforms/react");
|
|
5847
|
+
var import_core8 = require("@mantine/core");
|
|
5848
|
+
var jsx_runtime6 = require("react/jsx-runtime");
|
|
7994
5849
|
function PlainNumberControl({
|
|
7995
5850
|
data,
|
|
7996
5851
|
handleChange,
|
|
@@ -8002,8 +5857,8 @@ function PlainNumberControl({
|
|
|
8002
5857
|
const {
|
|
8003
5858
|
formOptions: { withDescriptions }
|
|
8004
5859
|
} = useFormOptions();
|
|
8005
|
-
return /* @__PURE__ */
|
|
8006
|
-
children: /* @__PURE__ */
|
|
5860
|
+
return /* @__PURE__ */ jsx_runtime6.jsx(jsx_runtime6.Fragment, {
|
|
5861
|
+
children: /* @__PURE__ */ jsx_runtime6.jsx(import_core8.NumberInput, {
|
|
8007
5862
|
label,
|
|
8008
5863
|
variant: "default",
|
|
8009
5864
|
value: data ?? "",
|
|
@@ -8018,16 +5873,17 @@ function PlainNumberControl({
|
|
|
8018
5873
|
})
|
|
8019
5874
|
});
|
|
8020
5875
|
}
|
|
8021
|
-
var NumberControl =
|
|
5876
|
+
var NumberControl = import_react8.withJsonFormsControlProps(PlainNumberControl);
|
|
8022
5877
|
var NumberControl_default = NumberControl;
|
|
8023
5878
|
|
|
8024
5879
|
// src/jsonforms/renderers/ObjectControl.tsx
|
|
8025
|
-
var
|
|
8026
|
-
var
|
|
8027
|
-
var
|
|
8028
|
-
var
|
|
8029
|
-
var
|
|
8030
|
-
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");
|
|
8031
5887
|
function PlainObjectControl({
|
|
8032
5888
|
label: labelProp,
|
|
8033
5889
|
schema,
|
|
@@ -8037,8 +5893,8 @@ function PlainObjectControl({
|
|
|
8037
5893
|
required
|
|
8038
5894
|
}) {
|
|
8039
5895
|
const { formOptions } = useFormOptions();
|
|
8040
|
-
const { renderers, cells } =
|
|
8041
|
-
const [newKey, setNewKey] =
|
|
5896
|
+
const { renderers, cells } = import_react9.useJsonForms();
|
|
5897
|
+
const [newKey, setNewKey] = import_react10.useState("");
|
|
8042
5898
|
const hasProperties = schema.properties && Object.keys(schema.properties).length > 0;
|
|
8043
5899
|
const hasAdditionalProperties = schema.additionalProperties === true || schema.additionalProperties !== undefined && Object.keys(schema.additionalProperties).length > 0;
|
|
8044
5900
|
const label = labelProp !== "remoraid-array-item" ? labelProp : null;
|
|
@@ -8046,22 +5902,22 @@ function PlainObjectControl({
|
|
|
8046
5902
|
const declaredKeys = new Set(Object.keys(schema.properties ?? {}));
|
|
8047
5903
|
const objectData = data && typeof data === "object" && !Array.isArray(data) ? data : {};
|
|
8048
5904
|
const additionalEntries = Object.entries(objectData).filter(([key]) => !declaredKeys.has(key));
|
|
8049
|
-
return /* @__PURE__ */
|
|
5905
|
+
return /* @__PURE__ */ jsx_runtime7.jsx(import_core9.Input.Wrapper, {
|
|
8050
5906
|
label,
|
|
8051
5907
|
description,
|
|
8052
5908
|
withAsterisk: required,
|
|
8053
|
-
children: /* @__PURE__ */
|
|
5909
|
+
children: /* @__PURE__ */ jsx_runtime7.jsx(import_core9.Paper, {
|
|
8054
5910
|
withBorder: true,
|
|
8055
5911
|
bg: "var(--remoraid-transparent-background)",
|
|
8056
5912
|
shadow: "0",
|
|
8057
5913
|
p: formOptions.gutter,
|
|
8058
5914
|
mt: Boolean(description) ? 4 : 0,
|
|
8059
|
-
children: /* @__PURE__ */
|
|
5915
|
+
children: /* @__PURE__ */ jsx_runtime7.jsxs(import_core9.Stack, {
|
|
8060
5916
|
align: "stretch",
|
|
8061
5917
|
justify: "flex-start",
|
|
8062
5918
|
gap: formOptions.gutter,
|
|
8063
5919
|
children: [
|
|
8064
|
-
hasProperties && /* @__PURE__ */
|
|
5920
|
+
hasProperties && /* @__PURE__ */ jsx_runtime7.jsx(import_react9.JsonForms, {
|
|
8065
5921
|
schema: {
|
|
8066
5922
|
...schema,
|
|
8067
5923
|
$schema: undefined
|
|
@@ -8074,22 +5930,22 @@ function PlainObjectControl({
|
|
|
8074
5930
|
},
|
|
8075
5931
|
validationMode: "NoValidation"
|
|
8076
5932
|
}),
|
|
8077
|
-
hasAdditionalProperties && /* @__PURE__ */
|
|
5933
|
+
hasAdditionalProperties && /* @__PURE__ */ jsx_runtime7.jsxs(jsx_runtime7.Fragment, {
|
|
8078
5934
|
children: [
|
|
8079
|
-
additionalEntries.length > 0 && /* @__PURE__ */
|
|
5935
|
+
additionalEntries.length > 0 && /* @__PURE__ */ jsx_runtime7.jsx(import_core9.Stack, {
|
|
8080
5936
|
align: "stretch",
|
|
8081
5937
|
justify: "flex-start",
|
|
8082
5938
|
gap: formOptions.gutter,
|
|
8083
|
-
children: additionalEntries.map(([key, data2]) => /* @__PURE__ */
|
|
5939
|
+
children: additionalEntries.map(([key, data2]) => /* @__PURE__ */ jsx_runtime7.jsxs(import_core9.Flex, {
|
|
8084
5940
|
gap: formOptions.gutter,
|
|
8085
5941
|
justify: "flex-start",
|
|
8086
5942
|
align: "center",
|
|
8087
5943
|
direction: "row",
|
|
8088
5944
|
wrap: "nowrap",
|
|
8089
5945
|
children: [
|
|
8090
|
-
/* @__PURE__ */
|
|
5946
|
+
/* @__PURE__ */ jsx_runtime7.jsx(import_core9.Box, {
|
|
8091
5947
|
flex: 1,
|
|
8092
|
-
children: /* @__PURE__ */
|
|
5948
|
+
children: /* @__PURE__ */ jsx_runtime7.jsx(import_react9.JsonForms, {
|
|
8093
5949
|
schema: {
|
|
8094
5950
|
...schema.additionalProperties === true ? {} : schema.additionalProperties,
|
|
8095
5951
|
title: key,
|
|
@@ -8104,15 +5960,15 @@ function PlainObjectControl({
|
|
|
8104
5960
|
cells: cells ?? [],
|
|
8105
5961
|
validationMode: "ValidateAndHide",
|
|
8106
5962
|
onChange: ({ data: newVal }) => {
|
|
8107
|
-
handleChange(
|
|
5963
|
+
handleChange(import_core10.composePaths(path, key), newVal);
|
|
8108
5964
|
}
|
|
8109
5965
|
})
|
|
8110
5966
|
}),
|
|
8111
|
-
/* @__PURE__ */
|
|
5967
|
+
/* @__PURE__ */ jsx_runtime7.jsx(import_core11.RemoraidButton, {
|
|
8112
5968
|
responsive: false,
|
|
8113
5969
|
collapsed: true,
|
|
8114
5970
|
label: `Delete ${key}`,
|
|
8115
|
-
icon:
|
|
5971
|
+
icon: import_icons_react2.IconTrash,
|
|
8116
5972
|
onClick: () => {
|
|
8117
5973
|
if (declaredKeys.has(key)) {
|
|
8118
5974
|
return;
|
|
@@ -8126,12 +5982,12 @@ function PlainObjectControl({
|
|
|
8126
5982
|
]
|
|
8127
5983
|
}, key))
|
|
8128
5984
|
}),
|
|
8129
|
-
/* @__PURE__ */
|
|
5985
|
+
/* @__PURE__ */ jsx_runtime7.jsxs(import_core9.Group, {
|
|
8130
5986
|
gap: formOptions.gutter,
|
|
8131
5987
|
wrap: "nowrap",
|
|
8132
5988
|
align: "flex-end",
|
|
8133
5989
|
children: [
|
|
8134
|
-
/* @__PURE__ */
|
|
5990
|
+
/* @__PURE__ */ jsx_runtime7.jsx(import_core9.TextInput, {
|
|
8135
5991
|
label: "New key",
|
|
8136
5992
|
variant: "default",
|
|
8137
5993
|
value: newKey,
|
|
@@ -8142,11 +5998,11 @@ function PlainObjectControl({
|
|
|
8142
5998
|
description: formOptions.withDescriptions ? "Key for new additional property value" : null,
|
|
8143
5999
|
flex: 1
|
|
8144
6000
|
}),
|
|
8145
|
-
/* @__PURE__ */
|
|
6001
|
+
/* @__PURE__ */ jsx_runtime7.jsx(import_core11.RemoraidButton, {
|
|
8146
6002
|
responsive: false,
|
|
8147
6003
|
collapsed: true,
|
|
8148
6004
|
label: "Add key",
|
|
8149
|
-
icon:
|
|
6005
|
+
icon: import_icons_react2.IconPlus,
|
|
8150
6006
|
onClick: () => {
|
|
8151
6007
|
const key = newKey.trim();
|
|
8152
6008
|
if (!key) {
|
|
@@ -8176,13 +6032,13 @@ function PlainObjectControl({
|
|
|
8176
6032
|
})
|
|
8177
6033
|
});
|
|
8178
6034
|
}
|
|
8179
|
-
var ObjectControl =
|
|
6035
|
+
var ObjectControl = import_react9.withJsonFormsControlProps(PlainObjectControl);
|
|
8180
6036
|
var ObjectControl_default = ObjectControl;
|
|
8181
6037
|
|
|
8182
6038
|
// src/jsonforms/renderers/StringSelectControl.tsx
|
|
8183
|
-
var
|
|
8184
|
-
var
|
|
8185
|
-
var
|
|
6039
|
+
var import_react11 = require("@jsonforms/react");
|
|
6040
|
+
var import_core12 = require("@mantine/core");
|
|
6041
|
+
var jsx_runtime8 = require("react/jsx-runtime");
|
|
8186
6042
|
function PlainTimestampControl({
|
|
8187
6043
|
data,
|
|
8188
6044
|
handleChange,
|
|
@@ -8194,8 +6050,8 @@ function PlainTimestampControl({
|
|
|
8194
6050
|
const {
|
|
8195
6051
|
formOptions: { withDescriptions }
|
|
8196
6052
|
} = useFormOptions();
|
|
8197
|
-
return /* @__PURE__ */
|
|
8198
|
-
children: /* @__PURE__ */
|
|
6053
|
+
return /* @__PURE__ */ jsx_runtime8.jsx(jsx_runtime8.Fragment, {
|
|
6054
|
+
children: /* @__PURE__ */ jsx_runtime8.jsx(import_core12.Select, {
|
|
8199
6055
|
label,
|
|
8200
6056
|
data: schema.enum,
|
|
8201
6057
|
value: data,
|
|
@@ -8209,18 +6065,18 @@ function PlainTimestampControl({
|
|
|
8209
6065
|
})
|
|
8210
6066
|
});
|
|
8211
6067
|
}
|
|
8212
|
-
var TimestampControl =
|
|
6068
|
+
var TimestampControl = import_react11.withJsonFormsControlProps(PlainTimestampControl);
|
|
8213
6069
|
var StringSelectControl_default = TimestampControl;
|
|
8214
6070
|
|
|
8215
6071
|
// src/jsonforms/renderers/testers/anyControlTesters.ts
|
|
8216
|
-
var
|
|
6072
|
+
var import_core13 = require("@jsonforms/core");
|
|
8217
6073
|
var testers = [
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
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)) {
|
|
8221
6077
|
return false;
|
|
8222
6078
|
}
|
|
8223
|
-
const resolvedSchema =
|
|
6079
|
+
const resolvedSchema = import_core13.Resolve.schema(schema, uischema.scope, ctx.rootSchema);
|
|
8224
6080
|
const hasProperties = resolvedSchema.properties && Object.keys(resolvedSchema.properties).length > 0;
|
|
8225
6081
|
const hasAdditionalProperties = resolvedSchema.additionalProperties === true || resolvedSchema.additionalProperties !== undefined && Object.keys(resolvedSchema.additionalProperties).length > 0;
|
|
8226
6082
|
return !hasProperties && !hasAdditionalProperties;
|
|
@@ -8229,59 +6085,59 @@ var testers = [
|
|
|
8229
6085
|
var anyControlTesters_default = testers;
|
|
8230
6086
|
|
|
8231
6087
|
// src/jsonforms/renderers/testers/anyOfControlTester.ts
|
|
8232
|
-
var
|
|
8233
|
-
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));
|
|
8234
6090
|
var anyOfControlTester_default = tester;
|
|
8235
6091
|
|
|
8236
6092
|
// src/jsonforms/renderers/testers/arrayControlTester.ts
|
|
8237
|
-
var
|
|
8238
|
-
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")));
|
|
8239
6095
|
var arrayControlTester_default = tester2;
|
|
8240
6096
|
|
|
8241
6097
|
// src/jsonforms/renderers/testers/checkboxControlTester.ts
|
|
8242
|
-
var
|
|
8243
|
-
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")));
|
|
8244
6100
|
var checkboxControlTester_default = tester3;
|
|
8245
6101
|
|
|
8246
6102
|
// src/jsonforms/renderers/testers/numberControlTester.ts
|
|
8247
|
-
var
|
|
8248
|
-
var tester4 =
|
|
6103
|
+
var import_core17 = require("@jsonforms/core");
|
|
6104
|
+
var tester4 = import_core17.rankWith(8, (a, b, c) => {
|
|
8249
6105
|
if (b.type === "integer") {
|
|
8250
6106
|
return true;
|
|
8251
6107
|
}
|
|
8252
|
-
return
|
|
6108
|
+
return import_core17.and(import_core17.uiTypeIs("Control"), import_core17.or(import_core17.schemaTypeIs("number"), import_core17.schemaTypeIs("integer")))(a, b, c);
|
|
8253
6109
|
});
|
|
8254
6110
|
var numberControlTester_default = tester4;
|
|
8255
6111
|
|
|
8256
6112
|
// src/jsonforms/renderers/testers/objectControlTester.ts
|
|
8257
|
-
var
|
|
8258
|
-
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")));
|
|
8259
6115
|
var objectControlTester_default = tester5;
|
|
8260
6116
|
|
|
8261
6117
|
// src/jsonforms/renderers/testers/stringSelectControlTester.ts
|
|
8262
|
-
var
|
|
8263
|
-
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));
|
|
8264
6120
|
var stringSelectControlTester_default = tester6;
|
|
8265
6121
|
|
|
8266
6122
|
// src/jsonforms/renderers/testers/textControlTester.ts
|
|
8267
|
-
var
|
|
8268
|
-
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")));
|
|
8269
6125
|
var textControlTester_default = tester7;
|
|
8270
6126
|
|
|
8271
6127
|
// src/jsonforms/renderers/testers/timestampControlTester.ts
|
|
8272
|
-
var
|
|
8273
|
-
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")));
|
|
8274
6130
|
var timestampControlTester_default = tester8;
|
|
8275
6131
|
|
|
8276
6132
|
// src/jsonforms/renderers/testers/verticalLayoutTester.ts
|
|
8277
|
-
var
|
|
8278
|
-
var tester9 =
|
|
6133
|
+
var import_core22 = require("@jsonforms/core");
|
|
6134
|
+
var tester9 = import_core22.rankWith(2, import_core22.uiTypeIs("VerticalLayout"));
|
|
8279
6135
|
var verticalLayoutTester_default = tester9;
|
|
8280
6136
|
|
|
8281
6137
|
// src/jsonforms/renderers/TextControl.tsx
|
|
8282
|
-
var
|
|
8283
|
-
var
|
|
8284
|
-
var
|
|
6138
|
+
var import_react12 = require("@jsonforms/react");
|
|
6139
|
+
var import_core23 = require("@mantine/core");
|
|
6140
|
+
var jsx_runtime9 = require("react/jsx-runtime");
|
|
8285
6141
|
function PlainTextControl({
|
|
8286
6142
|
data,
|
|
8287
6143
|
handleChange,
|
|
@@ -8293,8 +6149,8 @@ function PlainTextControl({
|
|
|
8293
6149
|
const {
|
|
8294
6150
|
formOptions: { withDescriptions }
|
|
8295
6151
|
} = useFormOptions();
|
|
8296
|
-
return /* @__PURE__ */
|
|
8297
|
-
children: /* @__PURE__ */
|
|
6152
|
+
return /* @__PURE__ */ jsx_runtime9.jsx(jsx_runtime9.Fragment, {
|
|
6153
|
+
children: /* @__PURE__ */ jsx_runtime9.jsx(import_core23.TextInput, {
|
|
8298
6154
|
label,
|
|
8299
6155
|
variant: "default",
|
|
8300
6156
|
placeholder: "",
|
|
@@ -8307,14 +6163,14 @@ function PlainTextControl({
|
|
|
8307
6163
|
})
|
|
8308
6164
|
});
|
|
8309
6165
|
}
|
|
8310
|
-
var TextControl =
|
|
6166
|
+
var TextControl = import_react12.withJsonFormsControlProps(PlainTextControl);
|
|
8311
6167
|
var TextControl_default = TextControl;
|
|
8312
6168
|
|
|
8313
6169
|
// src/jsonforms/renderers/TimestampControl.tsx
|
|
8314
|
-
var
|
|
6170
|
+
var import_react13 = require("@jsonforms/react");
|
|
8315
6171
|
var import_dates = require("@mantine/dates");
|
|
8316
6172
|
var import_dayjs = __toESM(require("dayjs"));
|
|
8317
|
-
var
|
|
6173
|
+
var jsx_runtime10 = require("react/jsx-runtime");
|
|
8318
6174
|
function PlainTimestampControl2({
|
|
8319
6175
|
data,
|
|
8320
6176
|
handleChange,
|
|
@@ -8326,8 +6182,8 @@ function PlainTimestampControl2({
|
|
|
8326
6182
|
const {
|
|
8327
6183
|
formOptions: { withDescriptions }
|
|
8328
6184
|
} = useFormOptions();
|
|
8329
|
-
return /* @__PURE__ */
|
|
8330
|
-
children: /* @__PURE__ */
|
|
6185
|
+
return /* @__PURE__ */ jsx_runtime10.jsx(jsx_runtime10.Fragment, {
|
|
6186
|
+
children: /* @__PURE__ */ jsx_runtime10.jsx(import_dates.DateTimePicker, {
|
|
8331
6187
|
variant: "default",
|
|
8332
6188
|
label,
|
|
8333
6189
|
placeholder: "Pick date and time",
|
|
@@ -8341,35 +6197,35 @@ function PlainTimestampControl2({
|
|
|
8341
6197
|
})
|
|
8342
6198
|
});
|
|
8343
6199
|
}
|
|
8344
|
-
var TimestampControl2 =
|
|
6200
|
+
var TimestampControl2 = import_react13.withJsonFormsControlProps(PlainTimestampControl2);
|
|
8345
6201
|
var TimestampControl_default = TimestampControl2;
|
|
8346
6202
|
|
|
8347
6203
|
// src/jsonforms/renderers/VerticalLayout.tsx
|
|
8348
|
-
var
|
|
8349
|
-
var
|
|
8350
|
-
var
|
|
8351
|
-
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");
|
|
8352
6208
|
"use client";
|
|
8353
6209
|
var JsonFormsLayout = ({
|
|
8354
6210
|
className,
|
|
8355
6211
|
children,
|
|
8356
6212
|
visible
|
|
8357
6213
|
}) => {
|
|
8358
|
-
return /* @__PURE__ */
|
|
6214
|
+
return /* @__PURE__ */ jsx_runtime11.jsx("div", {
|
|
8359
6215
|
className,
|
|
8360
6216
|
hidden: visible === undefined || visible === null ? false : !visible,
|
|
8361
6217
|
children
|
|
8362
6218
|
});
|
|
8363
6219
|
};
|
|
8364
6220
|
var renderChildren = (layout, schema, className, path, enabled) => {
|
|
8365
|
-
const { renderers, cells } =
|
|
6221
|
+
const { renderers, cells } = import_react16.useJsonForms();
|
|
8366
6222
|
const { formOptions } = useFormOptions();
|
|
8367
6223
|
const gutter = typeof formOptions.gutter === "string" ? `var(--mantine-spacing-${formOptions.gutter})` : `${formOptions.gutter}px`;
|
|
8368
6224
|
return layout.elements.map((child, index) => {
|
|
8369
|
-
return /* @__PURE__ */
|
|
6225
|
+
return /* @__PURE__ */ jsx_runtime11.jsx("div", {
|
|
8370
6226
|
className,
|
|
8371
6227
|
style: { marginTop: index === 0 ? 0 : gutter },
|
|
8372
|
-
children: /* @__PURE__ */
|
|
6228
|
+
children: /* @__PURE__ */ jsx_runtime11.jsx(import_react16.JsonFormsDispatch, {
|
|
8373
6229
|
renderers,
|
|
8374
6230
|
cells,
|
|
8375
6231
|
uischema: child,
|
|
@@ -8382,11 +6238,11 @@ var renderChildren = (layout, schema, className, path, enabled) => {
|
|
|
8382
6238
|
};
|
|
8383
6239
|
var VerticalLayoutRenderer = (props) => {
|
|
8384
6240
|
const { data: _data, ...otherProps } = props;
|
|
8385
|
-
return /* @__PURE__ */
|
|
6241
|
+
return /* @__PURE__ */ jsx_runtime11.jsx(VerticalLayoutRendererComponent, {
|
|
8386
6242
|
...otherProps
|
|
8387
6243
|
});
|
|
8388
6244
|
};
|
|
8389
|
-
var VerticalLayoutRendererComponent =
|
|
6245
|
+
var VerticalLayoutRendererComponent = import_react14.default.memo(function VerticalLayoutRendererComponent2({
|
|
8390
6246
|
schema,
|
|
8391
6247
|
uischema,
|
|
8392
6248
|
path,
|
|
@@ -8396,7 +6252,7 @@ var VerticalLayoutRendererComponent = import_react41.default.memo(function Verti
|
|
|
8396
6252
|
const verticalLayout = uischema;
|
|
8397
6253
|
const layoutClassName = "";
|
|
8398
6254
|
const childClassNames = "";
|
|
8399
|
-
return /* @__PURE__ */
|
|
6255
|
+
return /* @__PURE__ */ jsx_runtime11.jsx(JsonFormsLayout, {
|
|
8400
6256
|
className: layoutClassName,
|
|
8401
6257
|
uischema,
|
|
8402
6258
|
schema,
|
|
@@ -8406,7 +6262,7 @@ var VerticalLayoutRendererComponent = import_react41.default.memo(function Verti
|
|
|
8406
6262
|
children: renderChildren(verticalLayout, schema, childClassNames, path, enabled)
|
|
8407
6263
|
});
|
|
8408
6264
|
});
|
|
8409
|
-
var VerticalLayout =
|
|
6265
|
+
var VerticalLayout = import_react15.withJsonFormsLayoutProps(VerticalLayoutRenderer, false);
|
|
8410
6266
|
var VerticalLayout_default = VerticalLayout;
|
|
8411
6267
|
|
|
8412
6268
|
// src/jsonforms/renderers/index.ts
|