remoraid 2.0.0 → 2.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/index.cjs +100 -74
- package/dist/core/index.d.ts +22 -8
- package/dist/core/index.js +100 -74
- package/dist/jsonforms/index.cjs +1 -0
- package/dist/jsonforms/index.d.ts +1 -1
- package/dist/jsonforms/index.js +1 -0
- package/dist/modals/index.cjs +288 -0
- package/dist/modals/index.d.ts +15 -0
- package/dist/modals/index.js +319 -0
- package/dist/server/index.cjs +31 -31
- package/dist/server/index.d.ts +8 -4
- package/dist/server/index.js +31 -31
- package/package.json +7 -1
package/dist/core/index.cjs
CHANGED
@@ -55,6 +55,7 @@ __export(exports_core, {
|
|
55
55
|
Widget: () => Widget,
|
56
56
|
ResponsiveButton: () => ResponsiveButton,
|
57
57
|
RemoraidProvider: () => RemoraidProvider,
|
58
|
+
PageContainer: () => PageContainer,
|
58
59
|
Page: () => Page,
|
59
60
|
NotFoundPage: () => NotFoundPage,
|
60
61
|
EnvironmentShell: () => EnvironmentShell,
|
@@ -154,6 +155,7 @@ var createRemoraidTheme = (customTheme, mantineTheme, colorScheme) => {
|
|
154
155
|
medium: defaultMediumIconProps,
|
155
156
|
tiny: { size: 14, stroke: 3 }
|
156
157
|
},
|
158
|
+
jsonStringifySpace: 2,
|
157
159
|
transparentBackground,
|
158
160
|
primaryColor,
|
159
161
|
spacingPx,
|
@@ -693,10 +695,28 @@ function AppShell({
|
|
693
695
|
var import_core6 = require("@mantine/core");
|
694
696
|
|
695
697
|
// src/core/components/Page/index.tsx
|
696
|
-
var import_core5 = require("@mantine/core");
|
697
698
|
var import_react5 = __toESM(require("react"));
|
698
699
|
var import_navigation2 = require("next/navigation");
|
700
|
+
|
701
|
+
// src/core/components/Page/PageContainer/index.tsx
|
702
|
+
var import_core5 = require("@mantine/core");
|
699
703
|
var jsx_dev_runtime8 = require("react/jsx-dev-runtime");
|
704
|
+
function PageContainer({
|
705
|
+
children,
|
706
|
+
pt,
|
707
|
+
componentsProps
|
708
|
+
}) {
|
709
|
+
const theme = useRemoraidTheme();
|
710
|
+
return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(import_core5.Container, {
|
711
|
+
size: theme.containerSize,
|
712
|
+
pt: pt ?? "md",
|
713
|
+
...componentsProps?.container,
|
714
|
+
children
|
715
|
+
}, undefined, false, undefined, this);
|
716
|
+
}
|
717
|
+
|
718
|
+
// src/core/components/Page/index.tsx
|
719
|
+
var jsx_dev_runtime9 = require("react/jsx-dev-runtime");
|
700
720
|
var pageContext = import_react5.default.createContext(null);
|
701
721
|
var usePage = () => {
|
702
722
|
return import_react5.useContext(pageContext);
|
@@ -710,7 +730,6 @@ function Page({
|
|
710
730
|
}) {
|
711
731
|
const pathname = import_navigation2.usePathname();
|
712
732
|
const { isPageRegistered, registerPage } = useWidgets();
|
713
|
-
const theme = useRemoraidTheme();
|
714
733
|
const pageId = config?.pageId ?? pathname;
|
715
734
|
import_react5.useEffect(() => {
|
716
735
|
if (!isPageRegistered(pageId)) {
|
@@ -719,12 +738,11 @@ function Page({
|
|
719
738
|
}
|
720
739
|
}
|
721
740
|
}, []);
|
722
|
-
return /* @__PURE__ */
|
741
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(pageContext.Provider, {
|
723
742
|
value: { name: name ?? pathname, pageId, ...config },
|
724
|
-
children: /* @__PURE__ */
|
725
|
-
|
726
|
-
|
727
|
-
...componentsProps?.container,
|
743
|
+
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(PageContainer, {
|
744
|
+
pt,
|
745
|
+
componentsProps: { container: componentsProps?.container },
|
728
746
|
children
|
729
747
|
}, undefined, false, undefined, this)
|
730
748
|
}, undefined, false, undefined, this);
|
@@ -732,7 +750,7 @@ function Page({
|
|
732
750
|
|
733
751
|
// src/core/components/WidgetSelectionHeader/index.tsx
|
734
752
|
var import_icons_react4 = require("@tabler/icons-react");
|
735
|
-
var
|
753
|
+
var jsx_dev_runtime10 = require("react/jsx-dev-runtime");
|
736
754
|
function WidgetSelectionHeader({
|
737
755
|
title,
|
738
756
|
disabledWidgets,
|
@@ -745,39 +763,39 @@ function WidgetSelectionHeader({
|
|
745
763
|
console.error("'WidgetSelectionHeader' must be rendered inside of a 'Page' component.");
|
746
764
|
return null;
|
747
765
|
}
|
748
|
-
return /* @__PURE__ */
|
766
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_core6.Flex, {
|
749
767
|
justify: "flex-start",
|
750
768
|
align: "center",
|
751
769
|
gap: "xs",
|
752
770
|
mt,
|
753
771
|
children: [
|
754
|
-
/* @__PURE__ */
|
772
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_core6.Text, {
|
755
773
|
size: "lg",
|
756
774
|
fw: 400,
|
757
775
|
children: title ?? page.name
|
758
776
|
}, undefined, false, undefined, this),
|
759
|
-
/* @__PURE__ */
|
777
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_core6.Divider, {
|
760
778
|
orientation: "vertical"
|
761
779
|
}, undefined, false, undefined, this),
|
762
|
-
isPageRegistered(page.pageId) && /* @__PURE__ */
|
780
|
+
isPageRegistered(page.pageId) && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_core6.ScrollArea, {
|
763
781
|
flex: 1,
|
764
782
|
...theme.scrollAreaProps,
|
765
|
-
children: /* @__PURE__ */
|
783
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_core6.Chip.Group, {
|
766
784
|
multiple: true,
|
767
785
|
value: Object.keys(widgets[page.pageId]).filter((widgetId) => widgets[page.pageId][widgetId].selected),
|
768
786
|
onChange: (value) => {
|
769
787
|
updateWidgetSelectionBulk(page.pageId, value);
|
770
788
|
},
|
771
|
-
children: /* @__PURE__ */
|
789
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_core6.Flex, {
|
772
790
|
justify: "flex-start",
|
773
791
|
align: "center",
|
774
792
|
gap: "xs",
|
775
793
|
h: "auto",
|
776
|
-
children: Object.keys(widgets[page.pageId]).map((widgetId) => /* @__PURE__ */
|
794
|
+
children: Object.keys(widgets[page.pageId]).map((widgetId) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_core6.Chip, {
|
777
795
|
value: widgetId,
|
778
796
|
size: "sm",
|
779
797
|
disabled: disabledWidgets && disabledWidgets.includes(widgetId),
|
780
|
-
icon: /* @__PURE__ */
|
798
|
+
icon: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_icons_react4.IconCheck, {
|
781
799
|
...theme.iconProps.tiny
|
782
800
|
}, undefined, false, undefined, this),
|
783
801
|
children: widgets[page.pageId][widgetId].name
|
@@ -791,17 +809,17 @@ function WidgetSelectionHeader({
|
|
791
809
|
// src/core/components/CloseButton/index.tsx
|
792
810
|
var import_core7 = require("@mantine/core");
|
793
811
|
var import_icons_react5 = require("@tabler/icons-react");
|
794
|
-
var
|
812
|
+
var jsx_dev_runtime11 = require("react/jsx-dev-runtime");
|
795
813
|
function CloseButton({ widgetId }) {
|
796
814
|
const theme = useRemoraidTheme();
|
797
815
|
const { activeWidget, updateWidgetSelection } = useWidgets();
|
798
816
|
const page = usePage();
|
799
|
-
return /* @__PURE__ */
|
817
|
+
return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(import_core7.Transition, {
|
800
818
|
mounted: activeWidget === widgetId,
|
801
819
|
transition: "pop-top-right",
|
802
820
|
duration: theme.transitionDurations.short,
|
803
821
|
timingFunction: "ease",
|
804
|
-
children: (transitionStyle) => /* @__PURE__ */
|
822
|
+
children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(import_core7.ActionIcon, {
|
805
823
|
pos: "absolute",
|
806
824
|
size: "xs",
|
807
825
|
className: "remoraid-close-button",
|
@@ -814,7 +832,7 @@ function CloseButton({ widgetId }) {
|
|
814
832
|
updateWidgetSelection(page.pageId, widgetId, false);
|
815
833
|
},
|
816
834
|
style: transitionStyle,
|
817
|
-
children: /* @__PURE__ */
|
835
|
+
children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(import_icons_react5.IconX, {
|
818
836
|
...theme.iconProps.tiny
|
819
837
|
}, undefined, false, undefined, this)
|
820
838
|
}, undefined, false, undefined, this)
|
@@ -826,7 +844,7 @@ var import_react6 = __toESM(require("react"));
|
|
826
844
|
|
827
845
|
// src/core/components/BadgeMinimal/index.tsx
|
828
846
|
var import_core8 = require("@mantine/core");
|
829
|
-
var
|
847
|
+
var jsx_dev_runtime12 = require("react/jsx-dev-runtime");
|
830
848
|
var isBadgeMinimalProps = (e) => {
|
831
849
|
if (typeof e !== "object") {
|
832
850
|
return false;
|
@@ -839,17 +857,17 @@ var isBadgeMinimalProps = (e) => {
|
|
839
857
|
function BadgeMinimal(props) {
|
840
858
|
const { label, tooltip, mounted, componentsProps } = props;
|
841
859
|
const theme = useRemoraidTheme();
|
842
|
-
return /* @__PURE__ */
|
860
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core8.Transition, {
|
843
861
|
mounted: mounted !== false,
|
844
862
|
transition: "fade",
|
845
863
|
duration: theme.transitionDurations.short,
|
846
864
|
timingFunction: "ease",
|
847
865
|
...componentsProps?.transition,
|
848
|
-
children: (transitionStyle) => /* @__PURE__ */
|
866
|
+
children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core8.Tooltip, {
|
849
867
|
disabled: !tooltip,
|
850
868
|
label: tooltip,
|
851
869
|
...componentsProps?.tooltip,
|
852
|
-
children: /* @__PURE__ */
|
870
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_core8.Badge, {
|
853
871
|
variant: "default",
|
854
872
|
...componentsProps?.badge,
|
855
873
|
style: {
|
@@ -864,7 +882,7 @@ function BadgeMinimal(props) {
|
|
864
882
|
}
|
865
883
|
|
866
884
|
// src/core/components/BadgeGroup/index.tsx
|
867
|
-
var
|
885
|
+
var jsx_dev_runtime13 = require("react/jsx-dev-runtime");
|
868
886
|
var react = require("react");
|
869
887
|
function BadgeGroup({
|
870
888
|
badges,
|
@@ -874,9 +892,9 @@ function BadgeGroup({
|
|
874
892
|
}) {
|
875
893
|
const theme = useRemoraidTheme();
|
876
894
|
const numVisibleBadges = badges.filter((e) => isBadgeMinimalProps(e) ? e.mounted !== false : true).length;
|
877
|
-
return /* @__PURE__ */
|
895
|
+
return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(jsx_dev_runtime13.Fragment, {
|
878
896
|
children: [
|
879
|
-
/* @__PURE__ */
|
897
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_core9.Group, {
|
880
898
|
gap: gap ?? "xs",
|
881
899
|
wrap: "nowrap",
|
882
900
|
visibleFrom: breakpoint ?? theme.breakpoints.badgeGroupCollapse,
|
@@ -890,10 +908,10 @@ function BadgeGroup({
|
|
890
908
|
return e;
|
891
909
|
})
|
892
910
|
}, undefined, false, undefined, this),
|
893
|
-
/* @__PURE__ */
|
911
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_core9.Tooltip, {
|
894
912
|
label: `${numVisibleBadges} badge${numVisibleBadges === 1 ? "" : "s"}`,
|
895
913
|
...componentsProps?.tooltip,
|
896
|
-
children: /* @__PURE__ */
|
914
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(import_core9.Badge, {
|
897
915
|
hiddenFrom: breakpoint ?? theme.breakpoints.badgeGroupCollapse,
|
898
916
|
hidden: numVisibleBadges === 0,
|
899
917
|
variant: "light",
|
@@ -908,7 +926,7 @@ function BadgeGroup({
|
|
908
926
|
}
|
909
927
|
// src/core/components/AlertMinimal/index.tsx
|
910
928
|
var import_core10 = require("@mantine/core");
|
911
|
-
var
|
929
|
+
var jsx_dev_runtime14 = require("react/jsx-dev-runtime");
|
912
930
|
var isAlertMinimalProps = (e) => {
|
913
931
|
if (typeof e !== "object") {
|
914
932
|
return false;
|
@@ -930,13 +948,13 @@ function AlertMinimal({
|
|
930
948
|
componentsProps
|
931
949
|
}) {
|
932
950
|
const theme = useRemoraidTheme();
|
933
|
-
return /* @__PURE__ */
|
951
|
+
return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(import_core10.Transition, {
|
934
952
|
mounted: mounted !== false,
|
935
953
|
transition: "fade",
|
936
954
|
duration: theme.transitionDurations.short,
|
937
955
|
timingFunction: "ease",
|
938
956
|
...componentsProps?.transition,
|
939
|
-
children: (transitionStyle) => /* @__PURE__ */
|
957
|
+
children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(import_core10.Alert, {
|
940
958
|
...theme.alertProps[category],
|
941
959
|
title: title ?? theme.alertProps[category].title,
|
942
960
|
withCloseButton: onClose !== undefined,
|
@@ -958,7 +976,7 @@ function AlertMinimal({
|
|
958
976
|
// src/core/components/ResponsiveButton/index.tsx
|
959
977
|
var import_core11 = require("@mantine/core");
|
960
978
|
var import_icons_react6 = require("@tabler/icons-react");
|
961
|
-
var
|
979
|
+
var jsx_dev_runtime15 = require("react/jsx-dev-runtime");
|
962
980
|
var isResponsiveButtonProps = (e) => {
|
963
981
|
if (typeof e !== "object") {
|
964
982
|
return false;
|
@@ -971,17 +989,17 @@ var isResponsiveButtonProps = (e) => {
|
|
971
989
|
function ResponsiveButton(props) {
|
972
990
|
const { onClick, label, loading, variant, componentsProps, breakpoint } = props;
|
973
991
|
const theme = useRemoraidTheme();
|
974
|
-
const icon = props.icon ? /* @__PURE__ */
|
992
|
+
const icon = props.icon ? /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(props.icon, {
|
975
993
|
...theme.iconProps.medium
|
976
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
994
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(import_icons_react6.IconClick, {
|
977
995
|
...theme.iconProps.medium
|
978
996
|
}, undefined, false, undefined, this);
|
979
|
-
return /* @__PURE__ */
|
997
|
+
return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(jsx_dev_runtime15.Fragment, {
|
980
998
|
children: [
|
981
|
-
/* @__PURE__ */
|
999
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(import_core11.Tooltip, {
|
982
1000
|
label,
|
983
1001
|
...componentsProps?.tooltip,
|
984
|
-
children: /* @__PURE__ */
|
1002
|
+
children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(import_core11.ActionIcon, {
|
985
1003
|
variant: variant || "default",
|
986
1004
|
onClick,
|
987
1005
|
loading,
|
@@ -991,7 +1009,7 @@ function ResponsiveButton(props) {
|
|
991
1009
|
children: icon
|
992
1010
|
}, undefined, false, undefined, this)
|
993
1011
|
}, undefined, false, undefined, this),
|
994
|
-
/* @__PURE__ */
|
1012
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(import_core11.Button, {
|
995
1013
|
onClick,
|
996
1014
|
loading,
|
997
1015
|
variant: variant || "default",
|
@@ -1005,7 +1023,7 @@ function ResponsiveButton(props) {
|
|
1005
1023
|
// src/core/components/Widget/WidgetWrapper/index.tsx
|
1006
1024
|
var import_core12 = require("@mantine/core");
|
1007
1025
|
var import_react7 = require("react");
|
1008
|
-
var
|
1026
|
+
var jsx_dev_runtime16 = require("react/jsx-dev-runtime");
|
1009
1027
|
function WidgetWrapper({
|
1010
1028
|
children,
|
1011
1029
|
config,
|
@@ -1031,12 +1049,12 @@ function WidgetWrapper({
|
|
1031
1049
|
registerWidget(page.pageId, config);
|
1032
1050
|
}
|
1033
1051
|
}, [pageRegistered]);
|
1034
|
-
return /* @__PURE__ */
|
1052
|
+
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(import_core12.Transition, {
|
1035
1053
|
mounted: page !== null && isWidgetSelected(page.pageId, config.widgetId),
|
1036
1054
|
transition: "fade-left",
|
1037
1055
|
duration: theme.transitionDurations.medium,
|
1038
1056
|
timingFunction: "ease",
|
1039
|
-
children: (transitionStyle) => /* @__PURE__ */
|
1057
|
+
children: (transitionStyle) => /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(import_core12.Paper, {
|
1040
1058
|
p: "md",
|
1041
1059
|
shadow: "md",
|
1042
1060
|
bg: theme.transparentBackground,
|
@@ -1052,7 +1070,7 @@ function WidgetWrapper({
|
|
1052
1070
|
updateActiveWidget(null);
|
1053
1071
|
},
|
1054
1072
|
children: [
|
1055
|
-
withCloseButton !== false && /* @__PURE__ */
|
1073
|
+
withCloseButton !== false && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(CloseButton, {
|
1056
1074
|
widgetId: config.widgetId
|
1057
1075
|
}, undefined, false, undefined, this),
|
1058
1076
|
children
|
@@ -1062,7 +1080,7 @@ function WidgetWrapper({
|
|
1062
1080
|
}
|
1063
1081
|
// src/core/components/Widget/index.tsx
|
1064
1082
|
var import_core13 = require("@mantine/core");
|
1065
|
-
var
|
1083
|
+
var jsx_dev_runtime17 = require("react/jsx-dev-runtime");
|
1066
1084
|
var react2 = require("react");
|
1067
1085
|
function Widget({
|
1068
1086
|
children,
|
@@ -1080,7 +1098,7 @@ function Widget({
|
|
1080
1098
|
const badgesGap = (typeof gaps === "object" ? gaps.badges : gaps) ?? "xs";
|
1081
1099
|
const buttonsGap = (typeof gaps === "object" ? gaps.buttons : gaps) ?? "xs";
|
1082
1100
|
const alertsGap = (typeof gaps === "object" ? gaps.alerts : gaps) ?? "xs";
|
1083
|
-
return /* @__PURE__ */
|
1101
|
+
return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(WidgetWrapper, {
|
1084
1102
|
config: {
|
1085
1103
|
widgetId: id,
|
1086
1104
|
name: title,
|
@@ -1093,28 +1111,28 @@ function Widget({
|
|
1093
1111
|
},
|
1094
1112
|
...componentsProps?.wrapper,
|
1095
1113
|
children: [
|
1096
|
-
/* @__PURE__ */
|
1114
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core13.Group, {
|
1097
1115
|
justify: "space-between",
|
1098
1116
|
wrap: "nowrap",
|
1099
1117
|
children: [
|
1100
|
-
/* @__PURE__ */
|
1118
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core13.Group, {
|
1101
1119
|
gap: badgesGap,
|
1102
1120
|
wrap: "nowrap",
|
1103
1121
|
children: [
|
1104
|
-
/* @__PURE__ */
|
1122
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core13.Title, {
|
1105
1123
|
order: 1,
|
1106
1124
|
size: "h3",
|
1107
1125
|
lineClamp: 1,
|
1108
1126
|
children: title
|
1109
1127
|
}, undefined, false, undefined, this),
|
1110
|
-
badges !== undefined && /* @__PURE__ */
|
1128
|
+
badges !== undefined && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(BadgeGroup, {
|
1111
1129
|
badges,
|
1112
1130
|
gap: badgesGap,
|
1113
1131
|
...componentsProps?.badgeGroup
|
1114
1132
|
}, undefined, false, undefined, this)
|
1115
1133
|
]
|
1116
1134
|
}, undefined, true, undefined, this),
|
1117
|
-
/* @__PURE__ */
|
1135
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core13.Group, {
|
1118
1136
|
gap: buttonsGap,
|
1119
1137
|
wrap: "nowrap",
|
1120
1138
|
children: buttons !== undefined && buttons.map((e, i) => {
|
@@ -1129,7 +1147,7 @@ function Widget({
|
|
1129
1147
|
}, undefined, false, undefined, this)
|
1130
1148
|
]
|
1131
1149
|
}, undefined, true, undefined, this),
|
1132
|
-
/* @__PURE__ */
|
1150
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core13.Divider, {
|
1133
1151
|
my: "md"
|
1134
1152
|
}, undefined, false, undefined, this),
|
1135
1153
|
alerts !== undefined && alerts.map((a, i) => {
|
@@ -1142,11 +1160,11 @@ function Widget({
|
|
1142
1160
|
}
|
1143
1161
|
return a;
|
1144
1162
|
}),
|
1145
|
-
loading ? /* @__PURE__ */
|
1146
|
-
children: /* @__PURE__ */
|
1163
|
+
loading ? /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core13.Center, {
|
1164
|
+
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(import_core13.Loader, {
|
1147
1165
|
...componentsProps?.loader
|
1148
1166
|
}, undefined, false, undefined, this)
|
1149
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
1167
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
|
1150
1168
|
children
|
1151
1169
|
}, undefined, false, undefined, this)
|
1152
1170
|
]
|
@@ -1155,7 +1173,7 @@ function Widget({
|
|
1155
1173
|
// src/core/components/Page/NotFoundPage/index.tsx
|
1156
1174
|
var import_core14 = require("@mantine/core");
|
1157
1175
|
var import_navigation3 = require("next/navigation");
|
1158
|
-
var
|
1176
|
+
var jsx_dev_runtime18 = require("react/jsx-dev-runtime");
|
1159
1177
|
function NotFoundPage({
|
1160
1178
|
children,
|
1161
1179
|
message,
|
@@ -1163,11 +1181,11 @@ function NotFoundPage({
|
|
1163
1181
|
}) {
|
1164
1182
|
const pathname = import_navigation3.usePathname();
|
1165
1183
|
const theme = useRemoraidTheme();
|
1166
|
-
return /* @__PURE__ */
|
1184
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Page, {
|
1167
1185
|
name: "Not Found",
|
1168
1186
|
...componentsProps?.page,
|
1169
1187
|
children: [
|
1170
|
-
/* @__PURE__ */
|
1188
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(import_core14.Alert, {
|
1171
1189
|
...theme.alertProps.negative,
|
1172
1190
|
title: "404 - Page Not Found",
|
1173
1191
|
children: message ?? `Could not find page ${pathname}.`
|
@@ -1178,29 +1196,37 @@ function NotFoundPage({
|
|
1178
1196
|
}
|
1179
1197
|
// src/core/components/EnvironmentShell/index.tsx
|
1180
1198
|
var import_core15 = require("@mantine/core");
|
1181
|
-
var
|
1199
|
+
var jsx_dev_runtime19 = require("react/jsx-dev-runtime");
|
1182
1200
|
function EnvironmentShell({
|
1183
1201
|
children,
|
1184
|
-
|
1202
|
+
environment,
|
1185
1203
|
message,
|
1186
1204
|
m,
|
1187
|
-
mt
|
1205
|
+
mt,
|
1206
|
+
withContainer,
|
1207
|
+
componentsProps
|
1188
1208
|
}) {
|
1189
1209
|
const theme = useRemoraidTheme();
|
1190
|
-
const
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1210
|
+
const undefinedKeys = Object.keys(environment).filter((key) => environment[key] === undefined);
|
1211
|
+
const alertTitle = `Please Specify Environment Variable${undefinedKeys.length > 1 ? "s" : ""}`;
|
1212
|
+
const alertMessage = `Components could not be rendered because the following environment variables are not specified: ${undefinedKeys.join(", ")}.`;
|
1213
|
+
const alert = /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(import_core15.Alert, {
|
1214
|
+
...theme.alertProps.neutral,
|
1215
|
+
title: alertTitle,
|
1216
|
+
m,
|
1217
|
+
mt,
|
1218
|
+
children: message ?? alertMessage
|
1219
|
+
}, undefined, false, undefined, this);
|
1220
|
+
if (undefinedKeys.length === 0) {
|
1221
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(jsx_dev_runtime19.Fragment, {
|
1222
|
+
children
|
1201
1223
|
}, undefined, false, undefined, this);
|
1202
1224
|
}
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1225
|
+
if (withContainer) {
|
1226
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(PageContainer, {
|
1227
|
+
componentsProps: { container: componentsProps?.container },
|
1228
|
+
children: alert
|
1229
|
+
}, undefined, false, undefined, this);
|
1230
|
+
}
|
1231
|
+
return alert;
|
1206
1232
|
}
|
package/dist/core/index.d.ts
CHANGED
@@ -35,6 +35,7 @@ interface RemoraidTheme {
|
|
35
35
|
tiny: IconProps
|
36
36
|
medium: IconProps
|
37
37
|
};
|
38
|
+
jsonStringifySpace: string | number;
|
38
39
|
transparentBackground?: string;
|
39
40
|
primaryColor?: string;
|
40
41
|
spacingPx?: { [S in MantineSize] : number };
|
@@ -243,7 +244,16 @@ interface PageProps {
|
|
243
244
|
};
|
244
245
|
}
|
245
246
|
declare function Page({ children, name, config, pt, componentsProps }: PropsWithChildren9<PageProps>): ReactNode15;
|
247
|
+
import { ContainerProps as ContainerProps2, MantineSize as MantineSize8 } from "@mantine/core";
|
246
248
|
import { PropsWithChildren as PropsWithChildren10, ReactNode as ReactNode16 } from "react";
|
249
|
+
interface PageContainerProps {
|
250
|
+
pt?: MantineSize8 | number;
|
251
|
+
componentsProps?: {
|
252
|
+
container?: ContainerProps2
|
253
|
+
};
|
254
|
+
}
|
255
|
+
declare function PageContainer({ children, pt, componentsProps }: PropsWithChildren10<PageContainerProps>): ReactNode16;
|
256
|
+
import { PropsWithChildren as PropsWithChildren11, ReactNode as ReactNode17 } from "react";
|
247
257
|
import { PageProps as PageProps2 } from "..";
|
248
258
|
interface NotFoundPageProps {
|
249
259
|
message?: string;
|
@@ -251,14 +261,18 @@ interface NotFoundPageProps {
|
|
251
261
|
page?: PageProps2
|
252
262
|
};
|
253
263
|
}
|
254
|
-
declare function NotFoundPage({ children, message, componentsProps }:
|
255
|
-
import { MantineSize as
|
256
|
-
import { PropsWithChildren as
|
264
|
+
declare function NotFoundPage({ children, message, componentsProps }: PropsWithChildren11<NotFoundPageProps>): ReactNode17;
|
265
|
+
import { ContainerProps as ContainerProps3, MantineSize as MantineSize9 } from "@mantine/core";
|
266
|
+
import { PropsWithChildren as PropsWithChildren12, ReactNode as ReactNode18 } from "react";
|
257
267
|
interface EnvironmentShellProps {
|
258
|
-
|
268
|
+
environment: Record<string, string | undefined>;
|
259
269
|
message?: string;
|
260
|
-
m?:
|
261
|
-
mt?:
|
270
|
+
m?: MantineSize9 | number;
|
271
|
+
mt?: MantineSize9 | number;
|
272
|
+
withContainer?: boolean;
|
273
|
+
componentsProps?: {
|
274
|
+
container?: ContainerProps3
|
275
|
+
};
|
262
276
|
}
|
263
|
-
declare function EnvironmentShell({ children,
|
264
|
-
export { userExperienceCookieName, useWidgets, useRemoraidUserExperience, useRemoraidTheme, defaultUserExperience, defaultNavbarSettings, createRemoraidTheme, WidgetWrapper, WidgetSelectionHeader, Widget, ResponsiveButton, RemoraidProvider, Page, NotFoundPage, EnvironmentShell, CloseButton, BadgeMinimal, BadgeGroup, AppShell, AlertMinimal };
|
277
|
+
declare function EnvironmentShell({ children, environment, message, m, mt, withContainer, componentsProps }: PropsWithChildren12<EnvironmentShellProps>): ReactNode18;
|
278
|
+
export { userExperienceCookieName, useWidgets, useRemoraidUserExperience, useRemoraidTheme, defaultUserExperience, defaultNavbarSettings, createRemoraidTheme, WidgetsProviderProps, WidgetWrapperProps, WidgetWrapper, WidgetSelectionHeaderProps, WidgetSelectionHeader, WidgetProps, WidgetConfiguration, Widget, UserExperienceProviderProps, UserExperience, ThemeProviderProps, ResponsiveButtonProps, ResponsiveButton, RemoraidThemeCallback, RemoraidTheme, RemoraidProviderProps, RemoraidProvider, PartialRemoraidTheme, PageProps, PageContainerProps, PageContainer, PageConfiguration, Page, NotFoundPageProps, NotFoundPage, NavbarVariant, NavbarSettings, NavbarProps, NavbarLink, EnvironmentShellProps, EnvironmentShell, CloseButtonProps, CloseButton, BadgeMinimalProps, BadgeMinimal, BadgeGroupProps, BadgeGroup, AppShellProps, AppShellLogo, AppShell, AlertMinimalProps, AlertMinimal, AlertCategory };
|