@m4l/layouts 0.0.3 → 0.0.6
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/index.js +4 -2
- package/dist/layouts/MasterDetailLayout/index.js +3 -10
- package/dist/layouts/ModuleLayout/types.d.ts +0 -2
- package/dist/layouts/NoAuthModuleLayout/components/ModuleWrapper/index.d.ts +3 -0
- package/dist/layouts/NoAuthModuleLayout/components/ModuleWrapper/styles.d.ts +13 -0
- package/dist/layouts/NoAuthModuleLayout/components/ModuleWrapper/types.d.ts +4 -0
- package/dist/layouts/NoAuthModuleLayout/contexts/NoAuthModuleContext/index.d.ts +5 -0
- package/dist/layouts/NoAuthModuleLayout/contexts/NoAuthModuleContext/types.d.ts +12 -0
- package/dist/layouts/NoAuthModuleLayout/dicctionary.d.ts +3 -0
- package/dist/layouts/NoAuthModuleLayout/index.d.ts +3 -0
- package/dist/layouts/NoAuthModuleLayout/index.js +241 -0
- package/dist/layouts/NoAuthModuleLayout/types.d.ts +11 -0
- package/dist/layouts/index.d.ts +4 -0
- package/dist/node_modules.js +790 -0
- package/dist/vendor.js +2 -1
- package/package.json +7 -3
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { a as ModuleLayout } from "./layouts/ModuleLayout/index.js";
|
|
2
|
-
export { a as MasterDetailLayout } from "./layouts/MasterDetailLayout/index.js";
|
|
1
|
+
export { a as ModuleLayout, d as defaultModuleLayoutDictionary, g as getModuleLayoutComponentsDictionary } from "./layouts/ModuleLayout/index.js";
|
|
2
|
+
export { a as MasterDetailLayout, d as defaultMasterDetailDictionary, g as getMasterDetailLayoutComponentsDictionary } from "./layouts/MasterDetailLayout/index.js";
|
|
3
|
+
export { N as NoAuthModuleLayout, d as defaultNoAuthModuleLayoutDictionary, g as getNoAuthModuleLayoutComponentsDictionary } from "./layouts/NoAuthModuleLayout/index.js";
|
|
3
4
|
export { u as useMasterDetail } from "./hooks/useMasterDetail/index.js";
|
|
4
5
|
export { u as useModule } from "./hooks/useModule/index.js";
|
|
5
6
|
import "@m4l/components";
|
|
@@ -10,3 +11,4 @@ import "@mui/material";
|
|
|
10
11
|
import "./vendor.js";
|
|
11
12
|
import "@mui/material/useMediaQuery";
|
|
12
13
|
import "react/jsx-runtime";
|
|
14
|
+
import "./node_modules.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createContext, useState, useRef, useCallback, useMemo } from "react";
|
|
2
2
|
import { voidFunction, useEnvironment } from "@m4l/core";
|
|
3
3
|
import { SplitLayout } from "@m4l/components";
|
|
4
|
-
import { g as getModuleLayoutComponentsDictionary,
|
|
4
|
+
import { g as getModuleLayoutComponentsDictionary, a as ModuleLayout } from "../ModuleLayout/index.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { u as useResponsiveDesktop } from "../../vendor.js";
|
|
7
7
|
import { Button } from "@mui/material";
|
|
@@ -15,8 +15,7 @@ const defaultMasterDetailDictionary = {
|
|
|
15
15
|
split_horizontal: "Split horizontally",
|
|
16
16
|
no_split: "No split",
|
|
17
17
|
view_detail: "View detail"
|
|
18
|
-
}
|
|
19
|
-
...defaultModuleLayoutDictionary
|
|
18
|
+
}
|
|
20
19
|
};
|
|
21
20
|
const initialState = {
|
|
22
21
|
masterSelection: void 0,
|
|
@@ -68,7 +67,6 @@ function MasterDetailLayout(props) {
|
|
|
68
67
|
initialModuleActions: moduleActions,
|
|
69
68
|
urlIcon,
|
|
70
69
|
masterComponent,
|
|
71
|
-
defaultDictionary,
|
|
72
70
|
componentsDictionary,
|
|
73
71
|
breadcrumbLinks
|
|
74
72
|
} = props;
|
|
@@ -143,10 +141,6 @@ function MasterDetailLayout(props) {
|
|
|
143
141
|
return actions;
|
|
144
142
|
}, [splitActions, moduleActions, isDesktop, viewDetailAction]);
|
|
145
143
|
const finalComponentsDictionary = useMemo(() => componentsDictionary.concat(getMasterDetailLayoutComponentsDictionary()), [componentsDictionary]);
|
|
146
|
-
const finalDefaultDictionary = useMemo(() => ({
|
|
147
|
-
...defaultDictionary,
|
|
148
|
-
...defaultMasterDetailDictionary
|
|
149
|
-
}), [defaultDictionary]);
|
|
150
144
|
return /* @__PURE__ */ jsx(MasterDetailProvider, {
|
|
151
145
|
masterSelection,
|
|
152
146
|
setMasterSelection,
|
|
@@ -156,7 +150,6 @@ function MasterDetailLayout(props) {
|
|
|
156
150
|
moduleNameField,
|
|
157
151
|
urlIcon,
|
|
158
152
|
initialModuleActions: finalModuleActions,
|
|
159
|
-
defaultDictionary: finalDefaultDictionary,
|
|
160
153
|
componentsDictionary: finalComponentsDictionary,
|
|
161
154
|
breadcrumbLinks,
|
|
162
155
|
children: /* @__PURE__ */ jsx(SplitLayout, {
|
|
@@ -167,4 +160,4 @@ function MasterDetailLayout(props) {
|
|
|
167
160
|
})
|
|
168
161
|
});
|
|
169
162
|
}
|
|
170
|
-
export { MasterDetailContext as M, MasterDetailLayout as a };
|
|
163
|
+
export { MasterDetailContext as M, MasterDetailLayout as a, defaultMasterDetailDictionary as d, getMasterDetailLayoutComponentsDictionary as g };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { ModuleDictionary } from '@m4l/core';
|
|
3
2
|
import type { MenuAction, TLink, ModalOpenOptions } from '@m4l/components';
|
|
4
3
|
import type { HeaderProps } from './components/Header/types';
|
|
5
4
|
import type { ModuleRef } from './components/ModuleContent/types';
|
|
@@ -22,7 +21,6 @@ export interface ModuleLayoutProps extends HeaderProps {
|
|
|
22
21
|
moduleNameField?: string;
|
|
23
22
|
breadcrumbLinks: TLink[];
|
|
24
23
|
initialModuleActions: ModuleAction[];
|
|
25
|
-
defaultDictionary: ModuleDictionary;
|
|
26
24
|
componentsDictionary: string[];
|
|
27
25
|
children: ReactNode;
|
|
28
26
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const RootStyle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
3
|
+
export declare const HeaderStyle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
4
|
+
export declare const SectionStyle: import("@emotion/styled").StyledComponent<Omit<import("@mui/material").PaperProps<"div", {}>, "classes"> & {
|
|
5
|
+
classes?: Partial<import("@mui/material").CardClasses> | undefined;
|
|
6
|
+
raised?: boolean | undefined;
|
|
7
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
8
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
9
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
10
|
+
}, "children" | "ref" | "slot" | "title" | "onClick" | keyof import("@mui/material/OverridableComponent").CommonProps | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "key" | "variant" | "elevation" | "square" | "raised"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
11
|
+
export declare const ContentStyle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
+
export declare const TitleContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
13
|
+
export declare const ModuleTitleContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NoAuthModuleLayoutContextProps, NoAuthModuleLayoutProviderProps } from './types';
|
|
3
|
+
declare const ModuleContext: import("react").Context<NoAuthModuleLayoutContextProps>;
|
|
4
|
+
declare function ModuleProvider(props: NoAuthModuleLayoutProviderProps): JSX.Element;
|
|
5
|
+
export { ModuleProvider, ModuleContext };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface DomainStyleOptions {
|
|
3
|
+
company_logo_small_url: string;
|
|
4
|
+
company_logo_normal_url: string;
|
|
5
|
+
}
|
|
6
|
+
export interface NoAuthModuleLayoutProviderProps {
|
|
7
|
+
moduleId: number;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface NoAuthModuleLayoutContextProps extends Pick<NoAuthModuleLayoutProviderProps, 'moduleId'> {
|
|
11
|
+
styleOptions: DomainStyleOptions;
|
|
12
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { CompanyLogo, LanguagePopover, Typography, Image } from "@m4l/components";
|
|
2
|
+
import { Card, Container, Stack } from "@mui/material";
|
|
3
|
+
import { styled } from "@mui/material/styles";
|
|
4
|
+
import { useModuleDictionary, useFlagsPresent, getLocalStorage, useNetwork, useEnvironment, useFlags, FlagsProvider, ModuleDictionaryProvider } from "@m4l/core";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { u as useResponsive, P as Page } from "../../node_modules.js";
|
|
7
|
+
import { createContext, useState, useEffect } from "react";
|
|
8
|
+
const RootStyle = styled("div")(({
|
|
9
|
+
theme
|
|
10
|
+
}) => ({
|
|
11
|
+
[theme.breakpoints.up("md")]: {
|
|
12
|
+
display: "flex"
|
|
13
|
+
}
|
|
14
|
+
}));
|
|
15
|
+
const HeaderStyle = styled("header")(({
|
|
16
|
+
theme
|
|
17
|
+
}) => ({
|
|
18
|
+
top: 0,
|
|
19
|
+
zIndex: 9,
|
|
20
|
+
lineHeight: 0,
|
|
21
|
+
width: "100%",
|
|
22
|
+
display: "flex",
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
position: "absolute",
|
|
25
|
+
padding: theme.spacing(2, 2, 0, 2),
|
|
26
|
+
justifyContent: "space-between",
|
|
27
|
+
[theme.breakpoints.up("md")]: {
|
|
28
|
+
alignItems: "flex-start",
|
|
29
|
+
padding: theme.spacing(7, 7, 0, 7)
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
const SectionStyle = styled(Card)(({
|
|
33
|
+
theme
|
|
34
|
+
}) => ({
|
|
35
|
+
width: "100%",
|
|
36
|
+
maxWidth: 464,
|
|
37
|
+
display: "flex",
|
|
38
|
+
flexDirection: "column",
|
|
39
|
+
justifyContent: "center",
|
|
40
|
+
margin: theme.spacing(2, 0, 2, 2),
|
|
41
|
+
"& > div:nth-of-type(2)": {
|
|
42
|
+
maxHeight: "348px"
|
|
43
|
+
}
|
|
44
|
+
}));
|
|
45
|
+
const ContentStyle = styled("div")(({
|
|
46
|
+
theme
|
|
47
|
+
}) => ({
|
|
48
|
+
maxWidth: 480,
|
|
49
|
+
margin: "auto",
|
|
50
|
+
display: "flex",
|
|
51
|
+
minHeight: "100vh",
|
|
52
|
+
flexDirection: "column",
|
|
53
|
+
justifyContent: "center",
|
|
54
|
+
padding: theme.spacing(12, 0)
|
|
55
|
+
}));
|
|
56
|
+
const TitleContainer = styled("div")(({
|
|
57
|
+
theme
|
|
58
|
+
}) => ({
|
|
59
|
+
padding: theme.spacing(0, 5)
|
|
60
|
+
}));
|
|
61
|
+
const ModuleTitleContainer = styled("div")(({
|
|
62
|
+
theme
|
|
63
|
+
}) => ({
|
|
64
|
+
width: "100%",
|
|
65
|
+
display: "grid",
|
|
66
|
+
gridTemplateColumns: "1fr",
|
|
67
|
+
gridGap: theme.spacing(1)
|
|
68
|
+
}));
|
|
69
|
+
const ModuleWrapper = (props) => {
|
|
70
|
+
const {
|
|
71
|
+
children
|
|
72
|
+
} = props;
|
|
73
|
+
const {
|
|
74
|
+
getLabel,
|
|
75
|
+
getModuleLabel
|
|
76
|
+
} = useModuleDictionary();
|
|
77
|
+
const mdUp = useResponsive("up", "md");
|
|
78
|
+
const isSkeleton = !useFlagsPresent(["dictionary_loaded", "style_loaded"]);
|
|
79
|
+
return /* @__PURE__ */ jsx(Page, {
|
|
80
|
+
title: getModuleLabel(),
|
|
81
|
+
children: /* @__PURE__ */ jsxs(RootStyle, {
|
|
82
|
+
children: [/* @__PURE__ */ jsxs(HeaderStyle, {
|
|
83
|
+
id: "HeaderStyle",
|
|
84
|
+
children: [/* @__PURE__ */ jsx(CompanyLogo, {
|
|
85
|
+
size: mdUp ? "normal" : "small",
|
|
86
|
+
isSkeleton
|
|
87
|
+
}), /* @__PURE__ */ jsx(LanguagePopover, {
|
|
88
|
+
isSkeleton
|
|
89
|
+
})]
|
|
90
|
+
}), mdUp && /* @__PURE__ */ jsxs(SectionStyle, {
|
|
91
|
+
id: "SectionStyle",
|
|
92
|
+
children: [/* @__PURE__ */ jsx(TitleContainer, {
|
|
93
|
+
id: "module_leyend",
|
|
94
|
+
children: /* @__PURE__ */ jsx(Typography, {
|
|
95
|
+
variant: "h3",
|
|
96
|
+
sx: {
|
|
97
|
+
px: 5,
|
|
98
|
+
mt: 10,
|
|
99
|
+
mb: 5
|
|
100
|
+
},
|
|
101
|
+
skeletonProps: {
|
|
102
|
+
isSkeleton,
|
|
103
|
+
width: "30%",
|
|
104
|
+
height: "18px"
|
|
105
|
+
},
|
|
106
|
+
children: getLabel("module_leyend")
|
|
107
|
+
})
|
|
108
|
+
}), /* @__PURE__ */ jsx(Image, {
|
|
109
|
+
isSekeleton: isSkeleton,
|
|
110
|
+
width: "100%",
|
|
111
|
+
height: "auto",
|
|
112
|
+
src: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/domain/host/login/assets/img/illustration_login.png",
|
|
113
|
+
alt: "illustration module",
|
|
114
|
+
effect: "opacity"
|
|
115
|
+
})]
|
|
116
|
+
}), /* @__PURE__ */ jsx(Container, {
|
|
117
|
+
maxWidth: "sm",
|
|
118
|
+
id: "formContainer",
|
|
119
|
+
children: /* @__PURE__ */ jsxs(ContentStyle, {
|
|
120
|
+
children: [/* @__PURE__ */ jsx(Stack, {
|
|
121
|
+
direction: "row",
|
|
122
|
+
alignItems: "center",
|
|
123
|
+
sx: {
|
|
124
|
+
mb: 5
|
|
125
|
+
},
|
|
126
|
+
children: /* @__PURE__ */ jsxs(ModuleTitleContainer, {
|
|
127
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
128
|
+
variant: "h4",
|
|
129
|
+
skeletonProps: {
|
|
130
|
+
isSkeleton,
|
|
131
|
+
width: "35%",
|
|
132
|
+
height: "36px"
|
|
133
|
+
},
|
|
134
|
+
children: getModuleLabel()
|
|
135
|
+
}), /* @__PURE__ */ jsx(Typography, {
|
|
136
|
+
sx: {
|
|
137
|
+
color: "text.secondary"
|
|
138
|
+
},
|
|
139
|
+
skeletonProps: {
|
|
140
|
+
isSkeleton,
|
|
141
|
+
width: "60%",
|
|
142
|
+
height: "21px"
|
|
143
|
+
},
|
|
144
|
+
children: getLabel("module_description")
|
|
145
|
+
})]
|
|
146
|
+
})
|
|
147
|
+
}), children]
|
|
148
|
+
})
|
|
149
|
+
})]
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
const initialState = {
|
|
154
|
+
moduleId: 0,
|
|
155
|
+
styleOptions: {
|
|
156
|
+
company_logo_small_url: "",
|
|
157
|
+
company_logo_normal_url: ""
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
const ModuleContext = createContext(initialState);
|
|
161
|
+
function ModuleProvider(props) {
|
|
162
|
+
const {
|
|
163
|
+
children,
|
|
164
|
+
moduleId
|
|
165
|
+
} = props;
|
|
166
|
+
const [styleOptions, setStyleOptions] = useState(getLocalStorage("styleOptions", {
|
|
167
|
+
company_logo_small_url: "",
|
|
168
|
+
company_logo_normal_url: ""
|
|
169
|
+
}));
|
|
170
|
+
const {
|
|
171
|
+
networkOperation
|
|
172
|
+
} = useNetwork();
|
|
173
|
+
const {
|
|
174
|
+
domain_token
|
|
175
|
+
} = useEnvironment();
|
|
176
|
+
const {
|
|
177
|
+
flags,
|
|
178
|
+
addFlag
|
|
179
|
+
} = useFlags();
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
let mounted = true;
|
|
182
|
+
if (flags.findIndex((f) => f === "dictionary_loaded") < 0 || flags.findIndex((f) => f === "style_loaded") > -1) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
networkOperation({
|
|
186
|
+
method: "GET",
|
|
187
|
+
endPoint: `style`,
|
|
188
|
+
parms: {
|
|
189
|
+
domain_token
|
|
190
|
+
}
|
|
191
|
+
}).then((response) => {
|
|
192
|
+
if (mounted) {
|
|
193
|
+
console.log("Result - ModuleProvider - Load Style", response);
|
|
194
|
+
setStyleOptions({
|
|
195
|
+
...response.data
|
|
196
|
+
});
|
|
197
|
+
addFlag("style_loaded");
|
|
198
|
+
}
|
|
199
|
+
}).finally(() => {
|
|
200
|
+
});
|
|
201
|
+
return function cleanUp() {
|
|
202
|
+
mounted = false;
|
|
203
|
+
};
|
|
204
|
+
}, [flags]);
|
|
205
|
+
return /* @__PURE__ */ jsx(ModuleContext.Provider, {
|
|
206
|
+
value: {
|
|
207
|
+
styleOptions,
|
|
208
|
+
moduleId
|
|
209
|
+
},
|
|
210
|
+
children
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
const NoAuthModuleLayout = (props) => {
|
|
214
|
+
const {
|
|
215
|
+
moduleId,
|
|
216
|
+
moduleName,
|
|
217
|
+
children,
|
|
218
|
+
componentsDictionary
|
|
219
|
+
} = props;
|
|
220
|
+
return /* @__PURE__ */ jsx(FlagsProvider, {
|
|
221
|
+
children: /* @__PURE__ */ jsx(ModuleDictionaryProvider, {
|
|
222
|
+
isAuth: false,
|
|
223
|
+
moduleId,
|
|
224
|
+
moduleName,
|
|
225
|
+
componentsDictionary,
|
|
226
|
+
children: /* @__PURE__ */ jsx(ModuleProvider, {
|
|
227
|
+
moduleId,
|
|
228
|
+
children: /* @__PURE__ */ jsx(ModuleWrapper, {
|
|
229
|
+
children
|
|
230
|
+
})
|
|
231
|
+
})
|
|
232
|
+
})
|
|
233
|
+
});
|
|
234
|
+
};
|
|
235
|
+
function getNoAuthModuleLayoutComponentsDictionary() {
|
|
236
|
+
return ["no_auth_module_layout"];
|
|
237
|
+
}
|
|
238
|
+
const defaultNoAuthModuleLayoutDictionary = {
|
|
239
|
+
no_auth_module_layout: {}
|
|
240
|
+
};
|
|
241
|
+
export { NoAuthModuleLayout as N, defaultNoAuthModuleLayoutDictionary as d, getNoAuthModuleLayoutComponentsDictionary as g };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ContainerProps {
|
|
3
|
+
vertical: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare type MenuActionType = 'main' | 'allways' | 'normal';
|
|
6
|
+
export interface NoAuthModuleLayoutProps {
|
|
7
|
+
moduleId: number;
|
|
8
|
+
moduleName?: string;
|
|
9
|
+
componentsDictionary: string[];
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
package/dist/layouts/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export { ModuleLayout } from './ModuleLayout';
|
|
2
2
|
export type { ModuleAction } from './ModuleLayout/types';
|
|
3
|
+
export * from './ModuleLayout/dicctionary';
|
|
3
4
|
export { MasterDetailLayout } from './MasterDetailLayout';
|
|
5
|
+
export * from './MasterDetailLayout/dicctionary';
|
|
6
|
+
export { NoAuthModuleLayout } from './NoAuthModuleLayout';
|
|
7
|
+
export * from './NoAuthModuleLayout/dicctionary';
|
|
@@ -0,0 +1,790 @@
|
|
|
1
|
+
import { useTheme } from "@mui/material/styles";
|
|
2
|
+
import { Box } from "@mui/material";
|
|
3
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
4
|
+
import React, { Component, createContext, useContext, forwardRef } from "react";
|
|
5
|
+
import "@m4l/core";
|
|
6
|
+
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
7
|
+
var propTypes = { exports: {} };
|
|
8
|
+
var ReactPropTypesSecret$1 = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
9
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
|
10
|
+
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
11
|
+
function emptyFunction() {
|
|
12
|
+
}
|
|
13
|
+
function emptyFunctionWithReset() {
|
|
14
|
+
}
|
|
15
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
16
|
+
var factoryWithThrowingShims = function() {
|
|
17
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
18
|
+
if (secret === ReactPropTypesSecret) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
var err = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");
|
|
22
|
+
err.name = "Invariant Violation";
|
|
23
|
+
throw err;
|
|
24
|
+
}
|
|
25
|
+
shim.isRequired = shim;
|
|
26
|
+
function getShim() {
|
|
27
|
+
return shim;
|
|
28
|
+
}
|
|
29
|
+
var ReactPropTypes = {
|
|
30
|
+
array: shim,
|
|
31
|
+
bigint: shim,
|
|
32
|
+
bool: shim,
|
|
33
|
+
func: shim,
|
|
34
|
+
number: shim,
|
|
35
|
+
object: shim,
|
|
36
|
+
string: shim,
|
|
37
|
+
symbol: shim,
|
|
38
|
+
any: shim,
|
|
39
|
+
arrayOf: getShim,
|
|
40
|
+
element: shim,
|
|
41
|
+
elementType: shim,
|
|
42
|
+
instanceOf: getShim,
|
|
43
|
+
node: shim,
|
|
44
|
+
objectOf: getShim,
|
|
45
|
+
oneOf: getShim,
|
|
46
|
+
oneOfType: getShim,
|
|
47
|
+
shape: getShim,
|
|
48
|
+
exact: getShim,
|
|
49
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
50
|
+
resetWarningCache: emptyFunction
|
|
51
|
+
};
|
|
52
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
53
|
+
return ReactPropTypes;
|
|
54
|
+
};
|
|
55
|
+
{
|
|
56
|
+
propTypes.exports = factoryWithThrowingShims();
|
|
57
|
+
}
|
|
58
|
+
const r = propTypes.exports;
|
|
59
|
+
var hasElementType = typeof Element !== "undefined";
|
|
60
|
+
var hasMap = typeof Map === "function";
|
|
61
|
+
var hasSet = typeof Set === "function";
|
|
62
|
+
var hasArrayBuffer = typeof ArrayBuffer === "function" && !!ArrayBuffer.isView;
|
|
63
|
+
function equal(a2, b2) {
|
|
64
|
+
if (a2 === b2)
|
|
65
|
+
return true;
|
|
66
|
+
if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") {
|
|
67
|
+
if (a2.constructor !== b2.constructor)
|
|
68
|
+
return false;
|
|
69
|
+
var length, i, keys;
|
|
70
|
+
if (Array.isArray(a2)) {
|
|
71
|
+
length = a2.length;
|
|
72
|
+
if (length != b2.length)
|
|
73
|
+
return false;
|
|
74
|
+
for (i = length; i-- !== 0; )
|
|
75
|
+
if (!equal(a2[i], b2[i]))
|
|
76
|
+
return false;
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
var it;
|
|
80
|
+
if (hasMap && a2 instanceof Map && b2 instanceof Map) {
|
|
81
|
+
if (a2.size !== b2.size)
|
|
82
|
+
return false;
|
|
83
|
+
it = a2.entries();
|
|
84
|
+
while (!(i = it.next()).done)
|
|
85
|
+
if (!b2.has(i.value[0]))
|
|
86
|
+
return false;
|
|
87
|
+
it = a2.entries();
|
|
88
|
+
while (!(i = it.next()).done)
|
|
89
|
+
if (!equal(i.value[1], b2.get(i.value[0])))
|
|
90
|
+
return false;
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
if (hasSet && a2 instanceof Set && b2 instanceof Set) {
|
|
94
|
+
if (a2.size !== b2.size)
|
|
95
|
+
return false;
|
|
96
|
+
it = a2.entries();
|
|
97
|
+
while (!(i = it.next()).done)
|
|
98
|
+
if (!b2.has(i.value[0]))
|
|
99
|
+
return false;
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
if (hasArrayBuffer && ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) {
|
|
103
|
+
length = a2.length;
|
|
104
|
+
if (length != b2.length)
|
|
105
|
+
return false;
|
|
106
|
+
for (i = length; i-- !== 0; )
|
|
107
|
+
if (a2[i] !== b2[i])
|
|
108
|
+
return false;
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
if (a2.constructor === RegExp)
|
|
112
|
+
return a2.source === b2.source && a2.flags === b2.flags;
|
|
113
|
+
if (a2.valueOf !== Object.prototype.valueOf)
|
|
114
|
+
return a2.valueOf() === b2.valueOf();
|
|
115
|
+
if (a2.toString !== Object.prototype.toString)
|
|
116
|
+
return a2.toString() === b2.toString();
|
|
117
|
+
keys = Object.keys(a2);
|
|
118
|
+
length = keys.length;
|
|
119
|
+
if (length !== Object.keys(b2).length)
|
|
120
|
+
return false;
|
|
121
|
+
for (i = length; i-- !== 0; )
|
|
122
|
+
if (!Object.prototype.hasOwnProperty.call(b2, keys[i]))
|
|
123
|
+
return false;
|
|
124
|
+
if (hasElementType && a2 instanceof Element)
|
|
125
|
+
return false;
|
|
126
|
+
for (i = length; i-- !== 0; ) {
|
|
127
|
+
if ((keys[i] === "_owner" || keys[i] === "__v" || keys[i] === "__o") && a2.$$typeof) {
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (!equal(a2[keys[i]], b2[keys[i]]))
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
return a2 !== a2 && b2 !== b2;
|
|
136
|
+
}
|
|
137
|
+
var reactFastCompare = function isEqual(a2, b2) {
|
|
138
|
+
try {
|
|
139
|
+
return equal(a2, b2);
|
|
140
|
+
} catch (error) {
|
|
141
|
+
if ((error.message || "").match(/stack|recursion/i)) {
|
|
142
|
+
console.warn("react-fast-compare cannot handle circular refs");
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
throw error;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
var invariant = function(condition, format, a2, b2, c2, d2, e, f2) {
|
|
149
|
+
if (!condition) {
|
|
150
|
+
var error;
|
|
151
|
+
if (format === void 0) {
|
|
152
|
+
error = new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");
|
|
153
|
+
} else {
|
|
154
|
+
var args = [a2, b2, c2, d2, e, f2];
|
|
155
|
+
var argIndex = 0;
|
|
156
|
+
error = new Error(format.replace(/%s/g, function() {
|
|
157
|
+
return args[argIndex++];
|
|
158
|
+
}));
|
|
159
|
+
error.name = "Invariant Violation";
|
|
160
|
+
}
|
|
161
|
+
error.framesToPop = 1;
|
|
162
|
+
throw error;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
var browser = invariant;
|
|
166
|
+
var shallowequal = function shallowEqual(objA, objB, compare, compareContext) {
|
|
167
|
+
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
|
|
168
|
+
if (ret !== void 0) {
|
|
169
|
+
return !!ret;
|
|
170
|
+
}
|
|
171
|
+
if (objA === objB) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
var keysA = Object.keys(objA);
|
|
178
|
+
var keysB = Object.keys(objB);
|
|
179
|
+
if (keysA.length !== keysB.length) {
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
|
|
183
|
+
for (var idx = 0; idx < keysA.length; idx++) {
|
|
184
|
+
var key = keysA[idx];
|
|
185
|
+
if (!bHasOwnProperty(key)) {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
var valueA = objA[key];
|
|
189
|
+
var valueB = objB[key];
|
|
190
|
+
ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
|
|
191
|
+
if (ret === false || ret === void 0 && valueA !== valueB) {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return true;
|
|
196
|
+
};
|
|
197
|
+
function a() {
|
|
198
|
+
return a = Object.assign || function(t2) {
|
|
199
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
200
|
+
var r2 = arguments[e];
|
|
201
|
+
for (var n in r2)
|
|
202
|
+
Object.prototype.hasOwnProperty.call(r2, n) && (t2[n] = r2[n]);
|
|
203
|
+
}
|
|
204
|
+
return t2;
|
|
205
|
+
}, a.apply(this, arguments);
|
|
206
|
+
}
|
|
207
|
+
function s(t2, e) {
|
|
208
|
+
t2.prototype = Object.create(e.prototype), t2.prototype.constructor = t2, c(t2, e);
|
|
209
|
+
}
|
|
210
|
+
function c(t2, e) {
|
|
211
|
+
return c = Object.setPrototypeOf || function(t3, e2) {
|
|
212
|
+
return t3.__proto__ = e2, t3;
|
|
213
|
+
}, c(t2, e);
|
|
214
|
+
}
|
|
215
|
+
function u(t2, e) {
|
|
216
|
+
if (t2 == null)
|
|
217
|
+
return {};
|
|
218
|
+
var r2, n, i = {}, o = Object.keys(t2);
|
|
219
|
+
for (n = 0; n < o.length; n++)
|
|
220
|
+
e.indexOf(r2 = o[n]) >= 0 || (i[r2] = t2[r2]);
|
|
221
|
+
return i;
|
|
222
|
+
}
|
|
223
|
+
var l = {
|
|
224
|
+
BASE: "base",
|
|
225
|
+
BODY: "body",
|
|
226
|
+
HEAD: "head",
|
|
227
|
+
HTML: "html",
|
|
228
|
+
LINK: "link",
|
|
229
|
+
META: "meta",
|
|
230
|
+
NOSCRIPT: "noscript",
|
|
231
|
+
SCRIPT: "script",
|
|
232
|
+
STYLE: "style",
|
|
233
|
+
TITLE: "title",
|
|
234
|
+
FRAGMENT: "Symbol(react.fragment)"
|
|
235
|
+
}, p = {
|
|
236
|
+
rel: ["amphtml", "canonical", "alternate"]
|
|
237
|
+
}, f = {
|
|
238
|
+
type: ["application/ld+json"]
|
|
239
|
+
}, d = {
|
|
240
|
+
charset: "",
|
|
241
|
+
name: ["robots", "description"],
|
|
242
|
+
property: ["og:type", "og:title", "og:url", "og:image", "og:image:alt", "og:description", "twitter:url", "twitter:title", "twitter:description", "twitter:image", "twitter:image:alt", "twitter:card", "twitter:site"]
|
|
243
|
+
}, h = Object.keys(l).map(function(t2) {
|
|
244
|
+
return l[t2];
|
|
245
|
+
}), m = {
|
|
246
|
+
accesskey: "accessKey",
|
|
247
|
+
charset: "charSet",
|
|
248
|
+
class: "className",
|
|
249
|
+
contenteditable: "contentEditable",
|
|
250
|
+
contextmenu: "contextMenu",
|
|
251
|
+
"http-equiv": "httpEquiv",
|
|
252
|
+
itemprop: "itemProp",
|
|
253
|
+
tabindex: "tabIndex"
|
|
254
|
+
}, y = Object.keys(m).reduce(function(t2, e) {
|
|
255
|
+
return t2[m[e]] = e, t2;
|
|
256
|
+
}, {}), T = function(t2, e) {
|
|
257
|
+
for (var r2 = t2.length - 1; r2 >= 0; r2 -= 1) {
|
|
258
|
+
var n = t2[r2];
|
|
259
|
+
if (Object.prototype.hasOwnProperty.call(n, e))
|
|
260
|
+
return n[e];
|
|
261
|
+
}
|
|
262
|
+
return null;
|
|
263
|
+
}, g = function(t2) {
|
|
264
|
+
var e = T(t2, l.TITLE), r2 = T(t2, "titleTemplate");
|
|
265
|
+
if (Array.isArray(e) && (e = e.join("")), r2 && e)
|
|
266
|
+
return r2.replace(/%s/g, function() {
|
|
267
|
+
return e;
|
|
268
|
+
});
|
|
269
|
+
var n = T(t2, "defaultTitle");
|
|
270
|
+
return e || n || void 0;
|
|
271
|
+
}, b = function(t2) {
|
|
272
|
+
return T(t2, "onChangeClientState") || function() {
|
|
273
|
+
};
|
|
274
|
+
}, v = function(t2, e) {
|
|
275
|
+
return e.filter(function(e2) {
|
|
276
|
+
return e2[t2] !== void 0;
|
|
277
|
+
}).map(function(e2) {
|
|
278
|
+
return e2[t2];
|
|
279
|
+
}).reduce(function(t3, e2) {
|
|
280
|
+
return a({}, t3, e2);
|
|
281
|
+
}, {});
|
|
282
|
+
}, A = function(t2, e) {
|
|
283
|
+
return e.filter(function(t3) {
|
|
284
|
+
return t3[l.BASE] !== void 0;
|
|
285
|
+
}).map(function(t3) {
|
|
286
|
+
return t3[l.BASE];
|
|
287
|
+
}).reverse().reduce(function(e2, r2) {
|
|
288
|
+
if (!e2.length)
|
|
289
|
+
for (var n = Object.keys(r2), i = 0; i < n.length; i += 1) {
|
|
290
|
+
var o = n[i].toLowerCase();
|
|
291
|
+
if (t2.indexOf(o) !== -1 && r2[o])
|
|
292
|
+
return e2.concat(r2);
|
|
293
|
+
}
|
|
294
|
+
return e2;
|
|
295
|
+
}, []);
|
|
296
|
+
}, C = function(t2, e, r2) {
|
|
297
|
+
var n = {};
|
|
298
|
+
return r2.filter(function(e2) {
|
|
299
|
+
return !!Array.isArray(e2[t2]) || (e2[t2] !== void 0 && console && typeof console.warn == "function" && console.warn("Helmet: " + t2 + ' should be of type "Array". Instead found type "' + typeof e2[t2] + '"'), false);
|
|
300
|
+
}).map(function(e2) {
|
|
301
|
+
return e2[t2];
|
|
302
|
+
}).reverse().reduce(function(t3, r3) {
|
|
303
|
+
var i = {};
|
|
304
|
+
r3.filter(function(t4) {
|
|
305
|
+
for (var r4, o2 = Object.keys(t4), a2 = 0; a2 < o2.length; a2 += 1) {
|
|
306
|
+
var s3 = o2[a2], c3 = s3.toLowerCase();
|
|
307
|
+
e.indexOf(c3) === -1 || r4 === "rel" && t4[r4].toLowerCase() === "canonical" || c3 === "rel" && t4[c3].toLowerCase() === "stylesheet" || (r4 = c3), e.indexOf(s3) === -1 || s3 !== "innerHTML" && s3 !== "cssText" && s3 !== "itemprop" || (r4 = s3);
|
|
308
|
+
}
|
|
309
|
+
if (!r4 || !t4[r4])
|
|
310
|
+
return false;
|
|
311
|
+
var u3 = t4[r4].toLowerCase();
|
|
312
|
+
return n[r4] || (n[r4] = {}), i[r4] || (i[r4] = {}), !n[r4][u3] && (i[r4][u3] = true, true);
|
|
313
|
+
}).reverse().forEach(function(e2) {
|
|
314
|
+
return t3.push(e2);
|
|
315
|
+
});
|
|
316
|
+
for (var o = Object.keys(i), s2 = 0; s2 < o.length; s2 += 1) {
|
|
317
|
+
var c2 = o[s2], u2 = a({}, n[c2], i[c2]);
|
|
318
|
+
n[c2] = u2;
|
|
319
|
+
}
|
|
320
|
+
return t3;
|
|
321
|
+
}, []).reverse();
|
|
322
|
+
}, O = function(t2, e) {
|
|
323
|
+
if (Array.isArray(t2) && t2.length) {
|
|
324
|
+
for (var r2 = 0; r2 < t2.length; r2 += 1)
|
|
325
|
+
if (t2[r2][e])
|
|
326
|
+
return true;
|
|
327
|
+
}
|
|
328
|
+
return false;
|
|
329
|
+
}, S = function(t2) {
|
|
330
|
+
return Array.isArray(t2) ? t2.join("") : t2;
|
|
331
|
+
}, E = function(t2, e) {
|
|
332
|
+
return Array.isArray(t2) ? t2.reduce(function(t3, r2) {
|
|
333
|
+
return function(t4, e2) {
|
|
334
|
+
for (var r3 = Object.keys(t4), n = 0; n < r3.length; n += 1)
|
|
335
|
+
if (e2[r3[n]] && e2[r3[n]].includes(t4[r3[n]]))
|
|
336
|
+
return true;
|
|
337
|
+
return false;
|
|
338
|
+
}(r2, e) ? t3.priority.push(r2) : t3.default.push(r2), t3;
|
|
339
|
+
}, {
|
|
340
|
+
priority: [],
|
|
341
|
+
default: []
|
|
342
|
+
}) : {
|
|
343
|
+
default: t2
|
|
344
|
+
};
|
|
345
|
+
}, I = function(t2, e) {
|
|
346
|
+
var r2;
|
|
347
|
+
return a({}, t2, ((r2 = {})[e] = void 0, r2));
|
|
348
|
+
}, P = [l.NOSCRIPT, l.SCRIPT, l.STYLE], w = function(t2, e) {
|
|
349
|
+
return e === void 0 && (e = true), e === false ? String(t2) : String(t2).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
350
|
+
}, x = function(t2) {
|
|
351
|
+
return Object.keys(t2).reduce(function(e, r2) {
|
|
352
|
+
var n = t2[r2] !== void 0 ? r2 + '="' + t2[r2] + '"' : "" + r2;
|
|
353
|
+
return e ? e + " " + n : n;
|
|
354
|
+
}, "");
|
|
355
|
+
}, L = function(t2, e) {
|
|
356
|
+
return e === void 0 && (e = {}), Object.keys(t2).reduce(function(e2, r2) {
|
|
357
|
+
return e2[m[r2] || r2] = t2[r2], e2;
|
|
358
|
+
}, e);
|
|
359
|
+
}, j = function(e, r2) {
|
|
360
|
+
return r2.map(function(r3, n) {
|
|
361
|
+
var i, o = ((i = {
|
|
362
|
+
key: n
|
|
363
|
+
})["data-rh"] = true, i);
|
|
364
|
+
return Object.keys(r3).forEach(function(t2) {
|
|
365
|
+
var e2 = m[t2] || t2;
|
|
366
|
+
e2 === "innerHTML" || e2 === "cssText" ? o.dangerouslySetInnerHTML = {
|
|
367
|
+
__html: r3.innerHTML || r3.cssText
|
|
368
|
+
} : o[e2] = r3[t2];
|
|
369
|
+
}), React.createElement(e, o);
|
|
370
|
+
});
|
|
371
|
+
}, M = function(e, r2, n) {
|
|
372
|
+
switch (e) {
|
|
373
|
+
case l.TITLE:
|
|
374
|
+
return {
|
|
375
|
+
toComponent: function() {
|
|
376
|
+
return n2 = r2.titleAttributes, (i = {
|
|
377
|
+
key: e2 = r2.title
|
|
378
|
+
})["data-rh"] = true, o = L(n2, i), [React.createElement(l.TITLE, o, e2)];
|
|
379
|
+
var e2, n2, i, o;
|
|
380
|
+
},
|
|
381
|
+
toString: function() {
|
|
382
|
+
return function(t2, e2, r3, n2) {
|
|
383
|
+
var i = x(r3), o = S(e2);
|
|
384
|
+
return i ? "<" + t2 + ' data-rh="true" ' + i + ">" + w(o, n2) + "</" + t2 + ">" : "<" + t2 + ' data-rh="true">' + w(o, n2) + "</" + t2 + ">";
|
|
385
|
+
}(e, r2.title, r2.titleAttributes, n);
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
case "bodyAttributes":
|
|
389
|
+
case "htmlAttributes":
|
|
390
|
+
return {
|
|
391
|
+
toComponent: function() {
|
|
392
|
+
return L(r2);
|
|
393
|
+
},
|
|
394
|
+
toString: function() {
|
|
395
|
+
return x(r2);
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
default:
|
|
399
|
+
return {
|
|
400
|
+
toComponent: function() {
|
|
401
|
+
return j(e, r2);
|
|
402
|
+
},
|
|
403
|
+
toString: function() {
|
|
404
|
+
return function(t2, e2, r3) {
|
|
405
|
+
return e2.reduce(function(e3, n2) {
|
|
406
|
+
var i = Object.keys(n2).filter(function(t3) {
|
|
407
|
+
return !(t3 === "innerHTML" || t3 === "cssText");
|
|
408
|
+
}).reduce(function(t3, e4) {
|
|
409
|
+
var i2 = n2[e4] === void 0 ? e4 : e4 + '="' + w(n2[e4], r3) + '"';
|
|
410
|
+
return t3 ? t3 + " " + i2 : i2;
|
|
411
|
+
}, ""), o = n2.innerHTML || n2.cssText || "", a2 = P.indexOf(t2) === -1;
|
|
412
|
+
return e3 + "<" + t2 + ' data-rh="true" ' + i + (a2 ? "/>" : ">" + o + "</" + t2 + ">");
|
|
413
|
+
}, "");
|
|
414
|
+
}(e, r2, n);
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
}, k = function(t2) {
|
|
419
|
+
var e = t2.baseTag, r2 = t2.bodyAttributes, n = t2.encode, i = t2.htmlAttributes, o = t2.noscriptTags, a2 = t2.styleTags, s2 = t2.title, c2 = s2 === void 0 ? "" : s2, u2 = t2.titleAttributes, h2 = t2.linkTags, m2 = t2.metaTags, y2 = t2.scriptTags, T2 = {
|
|
420
|
+
toComponent: function() {
|
|
421
|
+
},
|
|
422
|
+
toString: function() {
|
|
423
|
+
return "";
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
if (t2.prioritizeSeoTags) {
|
|
427
|
+
var g2 = function(t3) {
|
|
428
|
+
var e2 = t3.linkTags, r3 = t3.scriptTags, n2 = t3.encode, i2 = E(t3.metaTags, d), o2 = E(e2, p), a3 = E(r3, f);
|
|
429
|
+
return {
|
|
430
|
+
priorityMethods: {
|
|
431
|
+
toComponent: function() {
|
|
432
|
+
return [].concat(j(l.META, i2.priority), j(l.LINK, o2.priority), j(l.SCRIPT, a3.priority));
|
|
433
|
+
},
|
|
434
|
+
toString: function() {
|
|
435
|
+
return M(l.META, i2.priority, n2) + " " + M(l.LINK, o2.priority, n2) + " " + M(l.SCRIPT, a3.priority, n2);
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
metaTags: i2.default,
|
|
439
|
+
linkTags: o2.default,
|
|
440
|
+
scriptTags: a3.default
|
|
441
|
+
};
|
|
442
|
+
}(t2);
|
|
443
|
+
T2 = g2.priorityMethods, h2 = g2.linkTags, m2 = g2.metaTags, y2 = g2.scriptTags;
|
|
444
|
+
}
|
|
445
|
+
return {
|
|
446
|
+
priority: T2,
|
|
447
|
+
base: M(l.BASE, e, n),
|
|
448
|
+
bodyAttributes: M("bodyAttributes", r2, n),
|
|
449
|
+
htmlAttributes: M("htmlAttributes", i, n),
|
|
450
|
+
link: M(l.LINK, h2, n),
|
|
451
|
+
meta: M(l.META, m2, n),
|
|
452
|
+
noscript: M(l.NOSCRIPT, o, n),
|
|
453
|
+
script: M(l.SCRIPT, y2, n),
|
|
454
|
+
style: M(l.STYLE, a2, n),
|
|
455
|
+
title: M(l.TITLE, {
|
|
456
|
+
title: c2,
|
|
457
|
+
titleAttributes: u2
|
|
458
|
+
}, n)
|
|
459
|
+
};
|
|
460
|
+
}, H = [], N = function(t2, e) {
|
|
461
|
+
var r2 = this;
|
|
462
|
+
e === void 0 && (e = typeof document != "undefined"), this.instances = [], this.value = {
|
|
463
|
+
setHelmet: function(t3) {
|
|
464
|
+
r2.context.helmet = t3;
|
|
465
|
+
},
|
|
466
|
+
helmetInstances: {
|
|
467
|
+
get: function() {
|
|
468
|
+
return r2.canUseDOM ? H : r2.instances;
|
|
469
|
+
},
|
|
470
|
+
add: function(t3) {
|
|
471
|
+
(r2.canUseDOM ? H : r2.instances).push(t3);
|
|
472
|
+
},
|
|
473
|
+
remove: function(t3) {
|
|
474
|
+
var e2 = (r2.canUseDOM ? H : r2.instances).indexOf(t3);
|
|
475
|
+
(r2.canUseDOM ? H : r2.instances).splice(e2, 1);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}, this.context = t2, this.canUseDOM = e, e || (t2.helmet = k({
|
|
479
|
+
baseTag: [],
|
|
480
|
+
bodyAttributes: {},
|
|
481
|
+
encodeSpecialCharacters: true,
|
|
482
|
+
htmlAttributes: {},
|
|
483
|
+
linkTags: [],
|
|
484
|
+
metaTags: [],
|
|
485
|
+
noscriptTags: [],
|
|
486
|
+
scriptTags: [],
|
|
487
|
+
styleTags: [],
|
|
488
|
+
title: "",
|
|
489
|
+
titleAttributes: {}
|
|
490
|
+
}));
|
|
491
|
+
}, R = React.createContext({}), D = r.shape({
|
|
492
|
+
setHelmet: r.func,
|
|
493
|
+
helmetInstances: r.shape({
|
|
494
|
+
get: r.func,
|
|
495
|
+
add: r.func,
|
|
496
|
+
remove: r.func
|
|
497
|
+
})
|
|
498
|
+
}), U = typeof document != "undefined", q = /* @__PURE__ */ function(e) {
|
|
499
|
+
function r2(t2) {
|
|
500
|
+
var n;
|
|
501
|
+
return (n = e.call(this, t2) || this).helmetData = new N(n.props.context, r2.canUseDOM), n;
|
|
502
|
+
}
|
|
503
|
+
return s(r2, e), r2.prototype.render = function() {
|
|
504
|
+
return /* @__PURE__ */ jsx(R.Provider, {
|
|
505
|
+
value: this.helmetData.value,
|
|
506
|
+
children: this.props.children
|
|
507
|
+
});
|
|
508
|
+
}, r2;
|
|
509
|
+
}(Component);
|
|
510
|
+
q.canUseDOM = U, q.propTypes = {
|
|
511
|
+
context: r.shape({
|
|
512
|
+
helmet: r.shape()
|
|
513
|
+
}),
|
|
514
|
+
children: r.node.isRequired
|
|
515
|
+
}, q.defaultProps = {
|
|
516
|
+
context: {}
|
|
517
|
+
}, q.displayName = "HelmetProvider";
|
|
518
|
+
var Y = function(t2, e) {
|
|
519
|
+
var r2, n = document.head || document.querySelector(l.HEAD), i = n.querySelectorAll(t2 + "[data-rh]"), o = [].slice.call(i), a2 = [];
|
|
520
|
+
return e && e.length && e.forEach(function(e2) {
|
|
521
|
+
var n2 = document.createElement(t2);
|
|
522
|
+
for (var i2 in e2)
|
|
523
|
+
Object.prototype.hasOwnProperty.call(e2, i2) && (i2 === "innerHTML" ? n2.innerHTML = e2.innerHTML : i2 === "cssText" ? n2.styleSheet ? n2.styleSheet.cssText = e2.cssText : n2.appendChild(document.createTextNode(e2.cssText)) : n2.setAttribute(i2, e2[i2] === void 0 ? "" : e2[i2]));
|
|
524
|
+
n2.setAttribute("data-rh", "true"), o.some(function(t3, e3) {
|
|
525
|
+
return r2 = e3, n2.isEqualNode(t3);
|
|
526
|
+
}) ? o.splice(r2, 1) : a2.push(n2);
|
|
527
|
+
}), o.forEach(function(t3) {
|
|
528
|
+
return t3.parentNode.removeChild(t3);
|
|
529
|
+
}), a2.forEach(function(t3) {
|
|
530
|
+
return n.appendChild(t3);
|
|
531
|
+
}), {
|
|
532
|
+
oldTags: o,
|
|
533
|
+
newTags: a2
|
|
534
|
+
};
|
|
535
|
+
}, B = function(t2, e) {
|
|
536
|
+
var r2 = document.getElementsByTagName(t2)[0];
|
|
537
|
+
if (r2) {
|
|
538
|
+
for (var n = r2.getAttribute("data-rh"), i = n ? n.split(",") : [], o = [].concat(i), a2 = Object.keys(e), s2 = 0; s2 < a2.length; s2 += 1) {
|
|
539
|
+
var c2 = a2[s2], u2 = e[c2] || "";
|
|
540
|
+
r2.getAttribute(c2) !== u2 && r2.setAttribute(c2, u2), i.indexOf(c2) === -1 && i.push(c2);
|
|
541
|
+
var l2 = o.indexOf(c2);
|
|
542
|
+
l2 !== -1 && o.splice(l2, 1);
|
|
543
|
+
}
|
|
544
|
+
for (var p2 = o.length - 1; p2 >= 0; p2 -= 1)
|
|
545
|
+
r2.removeAttribute(o[p2]);
|
|
546
|
+
i.length === o.length ? r2.removeAttribute("data-rh") : r2.getAttribute("data-rh") !== a2.join(",") && r2.setAttribute("data-rh", a2.join(","));
|
|
547
|
+
}
|
|
548
|
+
}, K = function(t2, e) {
|
|
549
|
+
var r2 = t2.baseTag, n = t2.htmlAttributes, i = t2.linkTags, o = t2.metaTags, a2 = t2.noscriptTags, s2 = t2.onChangeClientState, c2 = t2.scriptTags, u2 = t2.styleTags, p2 = t2.title, f2 = t2.titleAttributes;
|
|
550
|
+
B(l.BODY, t2.bodyAttributes), B(l.HTML, n), function(t3, e2) {
|
|
551
|
+
t3 !== void 0 && document.title !== t3 && (document.title = S(t3)), B(l.TITLE, e2);
|
|
552
|
+
}(p2, f2);
|
|
553
|
+
var d2 = {
|
|
554
|
+
baseTag: Y(l.BASE, r2),
|
|
555
|
+
linkTags: Y(l.LINK, i),
|
|
556
|
+
metaTags: Y(l.META, o),
|
|
557
|
+
noscriptTags: Y(l.NOSCRIPT, a2),
|
|
558
|
+
scriptTags: Y(l.SCRIPT, c2),
|
|
559
|
+
styleTags: Y(l.STYLE, u2)
|
|
560
|
+
}, h2 = {}, m2 = {};
|
|
561
|
+
Object.keys(d2).forEach(function(t3) {
|
|
562
|
+
var e2 = d2[t3], r3 = e2.newTags, n2 = e2.oldTags;
|
|
563
|
+
r3.length && (h2[t3] = r3), n2.length && (m2[t3] = d2[t3].oldTags);
|
|
564
|
+
}), e && e(), s2(t2, h2, m2);
|
|
565
|
+
}, _ = null, z = /* @__PURE__ */ function(t2) {
|
|
566
|
+
function e() {
|
|
567
|
+
for (var e2, r3 = arguments.length, n = new Array(r3), i = 0; i < r3; i++)
|
|
568
|
+
n[i] = arguments[i];
|
|
569
|
+
return (e2 = t2.call.apply(t2, [this].concat(n)) || this).rendered = false, e2;
|
|
570
|
+
}
|
|
571
|
+
s(e, t2);
|
|
572
|
+
var r2 = e.prototype;
|
|
573
|
+
return r2.shouldComponentUpdate = function(t3) {
|
|
574
|
+
return !shallowequal(t3, this.props);
|
|
575
|
+
}, r2.componentDidUpdate = function() {
|
|
576
|
+
this.emitChange();
|
|
577
|
+
}, r2.componentWillUnmount = function() {
|
|
578
|
+
this.props.context.helmetInstances.remove(this), this.emitChange();
|
|
579
|
+
}, r2.emitChange = function() {
|
|
580
|
+
var t3, e2, r3 = this.props.context, n = r3.setHelmet, i = null, o = (t3 = r3.helmetInstances.get().map(function(t4) {
|
|
581
|
+
var e3 = a({}, t4.props);
|
|
582
|
+
return delete e3.context, e3;
|
|
583
|
+
}), {
|
|
584
|
+
baseTag: A(["href"], t3),
|
|
585
|
+
bodyAttributes: v("bodyAttributes", t3),
|
|
586
|
+
defer: T(t3, "defer"),
|
|
587
|
+
encode: T(t3, "encodeSpecialCharacters"),
|
|
588
|
+
htmlAttributes: v("htmlAttributes", t3),
|
|
589
|
+
linkTags: C(l.LINK, ["rel", "href"], t3),
|
|
590
|
+
metaTags: C(l.META, ["name", "charset", "http-equiv", "property", "itemprop"], t3),
|
|
591
|
+
noscriptTags: C(l.NOSCRIPT, ["innerHTML"], t3),
|
|
592
|
+
onChangeClientState: b(t3),
|
|
593
|
+
scriptTags: C(l.SCRIPT, ["src", "innerHTML"], t3),
|
|
594
|
+
styleTags: C(l.STYLE, ["cssText"], t3),
|
|
595
|
+
title: g(t3),
|
|
596
|
+
titleAttributes: v("titleAttributes", t3),
|
|
597
|
+
prioritizeSeoTags: O(t3, "prioritizeSeoTags")
|
|
598
|
+
});
|
|
599
|
+
q.canUseDOM ? (e2 = o, _ && cancelAnimationFrame(_), e2.defer ? _ = requestAnimationFrame(function() {
|
|
600
|
+
K(e2, function() {
|
|
601
|
+
_ = null;
|
|
602
|
+
});
|
|
603
|
+
}) : (K(e2), _ = null)) : k && (i = k(o)), n(i);
|
|
604
|
+
}, r2.init = function() {
|
|
605
|
+
this.rendered || (this.rendered = true, this.props.context.helmetInstances.add(this), this.emitChange());
|
|
606
|
+
}, r2.render = function() {
|
|
607
|
+
return this.init(), null;
|
|
608
|
+
}, e;
|
|
609
|
+
}(Component);
|
|
610
|
+
z.propTypes = {
|
|
611
|
+
context: D.isRequired
|
|
612
|
+
}, z.displayName = "HelmetDispatcher";
|
|
613
|
+
var F = ["children"], G = ["children"], W = /* @__PURE__ */ function(e) {
|
|
614
|
+
function r2() {
|
|
615
|
+
return e.apply(this, arguments) || this;
|
|
616
|
+
}
|
|
617
|
+
s(r2, e);
|
|
618
|
+
var o = r2.prototype;
|
|
619
|
+
return o.shouldComponentUpdate = function(t2) {
|
|
620
|
+
return !reactFastCompare(I(this.props, "helmetData"), I(t2, "helmetData"));
|
|
621
|
+
}, o.mapNestedChildrenToProps = function(t2, e2) {
|
|
622
|
+
if (!e2)
|
|
623
|
+
return null;
|
|
624
|
+
switch (t2.type) {
|
|
625
|
+
case l.SCRIPT:
|
|
626
|
+
case l.NOSCRIPT:
|
|
627
|
+
return {
|
|
628
|
+
innerHTML: e2
|
|
629
|
+
};
|
|
630
|
+
case l.STYLE:
|
|
631
|
+
return {
|
|
632
|
+
cssText: e2
|
|
633
|
+
};
|
|
634
|
+
default:
|
|
635
|
+
throw new Error("<" + t2.type + " /> elements are self-closing and can not contain children. Refer to our API for more information.");
|
|
636
|
+
}
|
|
637
|
+
}, o.flattenArrayTypeChildren = function(t2) {
|
|
638
|
+
var e2, r3 = t2.child, n = t2.arrayTypeChildren;
|
|
639
|
+
return a({}, n, ((e2 = {})[r3.type] = [].concat(n[r3.type] || [], [a({}, t2.newChildProps, this.mapNestedChildrenToProps(r3, t2.nestedChildren))]), e2));
|
|
640
|
+
}, o.mapObjectTypeChildren = function(t2) {
|
|
641
|
+
var e2, r3, n = t2.child, i = t2.newProps, o2 = t2.newChildProps, s2 = t2.nestedChildren;
|
|
642
|
+
switch (n.type) {
|
|
643
|
+
case l.TITLE:
|
|
644
|
+
return a({}, i, ((e2 = {})[n.type] = s2, e2.titleAttributes = a({}, o2), e2));
|
|
645
|
+
case l.BODY:
|
|
646
|
+
return a({}, i, {
|
|
647
|
+
bodyAttributes: a({}, o2)
|
|
648
|
+
});
|
|
649
|
+
case l.HTML:
|
|
650
|
+
return a({}, i, {
|
|
651
|
+
htmlAttributes: a({}, o2)
|
|
652
|
+
});
|
|
653
|
+
default:
|
|
654
|
+
return a({}, i, ((r3 = {})[n.type] = a({}, o2), r3));
|
|
655
|
+
}
|
|
656
|
+
}, o.mapArrayTypeChildrenToProps = function(t2, e2) {
|
|
657
|
+
var r3 = a({}, e2);
|
|
658
|
+
return Object.keys(t2).forEach(function(e3) {
|
|
659
|
+
var n;
|
|
660
|
+
r3 = a({}, r3, ((n = {})[e3] = t2[e3], n));
|
|
661
|
+
}), r3;
|
|
662
|
+
}, o.warnOnInvalidChildren = function(t2, e2) {
|
|
663
|
+
return browser(h.some(function(e3) {
|
|
664
|
+
return t2.type === e3;
|
|
665
|
+
}), typeof t2.type == "function" ? "You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information." : "Only elements types " + h.join(", ") + " are allowed. Helmet does not support rendering <" + t2.type + "> elements. Refer to our API for more information."), browser(!e2 || typeof e2 == "string" || Array.isArray(e2) && !e2.some(function(t3) {
|
|
666
|
+
return typeof t3 != "string";
|
|
667
|
+
}), "Helmet expects a string as a child of <" + t2.type + ">. Did you forget to wrap your children in braces? ( <" + t2.type + ">{``}</" + t2.type + "> ) Refer to our API for more information."), true;
|
|
668
|
+
}, o.mapChildrenToProps = function(e2, r3) {
|
|
669
|
+
var n = this, i = {};
|
|
670
|
+
return React.Children.forEach(e2, function(t2) {
|
|
671
|
+
if (t2 && t2.props) {
|
|
672
|
+
var e3 = t2.props, o2 = e3.children, a2 = u(e3, F), s2 = Object.keys(a2).reduce(function(t3, e4) {
|
|
673
|
+
return t3[y[e4] || e4] = a2[e4], t3;
|
|
674
|
+
}, {}), c2 = t2.type;
|
|
675
|
+
switch (typeof c2 == "symbol" ? c2 = c2.toString() : n.warnOnInvalidChildren(t2, o2), c2) {
|
|
676
|
+
case l.FRAGMENT:
|
|
677
|
+
r3 = n.mapChildrenToProps(o2, r3);
|
|
678
|
+
break;
|
|
679
|
+
case l.LINK:
|
|
680
|
+
case l.META:
|
|
681
|
+
case l.NOSCRIPT:
|
|
682
|
+
case l.SCRIPT:
|
|
683
|
+
case l.STYLE:
|
|
684
|
+
i = n.flattenArrayTypeChildren({
|
|
685
|
+
child: t2,
|
|
686
|
+
arrayTypeChildren: i,
|
|
687
|
+
newChildProps: s2,
|
|
688
|
+
nestedChildren: o2
|
|
689
|
+
});
|
|
690
|
+
break;
|
|
691
|
+
default:
|
|
692
|
+
r3 = n.mapObjectTypeChildren({
|
|
693
|
+
child: t2,
|
|
694
|
+
newProps: r3,
|
|
695
|
+
newChildProps: s2,
|
|
696
|
+
nestedChildren: o2
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}), this.mapArrayTypeChildrenToProps(i, r3);
|
|
701
|
+
}, o.render = function() {
|
|
702
|
+
var e2 = this.props, r3 = e2.children, n = u(e2, G), i = a({}, n), o2 = n.helmetData;
|
|
703
|
+
return r3 && (i = this.mapChildrenToProps(r3, i)), !o2 || o2 instanceof N || (o2 = new N(o2.context, o2.instances)), o2 ? /* @__PURE__ */ React.createElement(z, a({}, i, {
|
|
704
|
+
context: o2.value,
|
|
705
|
+
helmetData: void 0
|
|
706
|
+
})) : /* @__PURE__ */ jsx(R.Consumer, {
|
|
707
|
+
children: function(e3) {
|
|
708
|
+
return React.createElement(z, a({}, i, {
|
|
709
|
+
context: e3
|
|
710
|
+
}));
|
|
711
|
+
}
|
|
712
|
+
});
|
|
713
|
+
}, r2;
|
|
714
|
+
}(Component);
|
|
715
|
+
W.propTypes = {
|
|
716
|
+
base: r.object,
|
|
717
|
+
bodyAttributes: r.object,
|
|
718
|
+
children: r.oneOfType([r.arrayOf(r.node), r.node]),
|
|
719
|
+
defaultTitle: r.string,
|
|
720
|
+
defer: r.bool,
|
|
721
|
+
encodeSpecialCharacters: r.bool,
|
|
722
|
+
htmlAttributes: r.object,
|
|
723
|
+
link: r.arrayOf(r.object),
|
|
724
|
+
meta: r.arrayOf(r.object),
|
|
725
|
+
noscript: r.arrayOf(r.object),
|
|
726
|
+
onChangeClientState: r.func,
|
|
727
|
+
script: r.arrayOf(r.object),
|
|
728
|
+
style: r.arrayOf(r.object),
|
|
729
|
+
title: r.string,
|
|
730
|
+
titleAttributes: r.object,
|
|
731
|
+
titleTemplate: r.string,
|
|
732
|
+
prioritizeSeoTags: r.bool,
|
|
733
|
+
helmetData: r.object
|
|
734
|
+
}, W.defaultProps = {
|
|
735
|
+
defer: true,
|
|
736
|
+
encodeSpecialCharacters: true,
|
|
737
|
+
prioritizeSeoTags: false
|
|
738
|
+
}, W.displayName = "Helmet";
|
|
739
|
+
const LocalesContext = createContext(null);
|
|
740
|
+
const useLocales = () => {
|
|
741
|
+
const context = useContext(LocalesContext);
|
|
742
|
+
if (!context)
|
|
743
|
+
throw new Error("useLocales context must be use inside LocalesProvider");
|
|
744
|
+
return context;
|
|
745
|
+
};
|
|
746
|
+
const Page = forwardRef((props, ref) => {
|
|
747
|
+
const {
|
|
748
|
+
children,
|
|
749
|
+
title = "",
|
|
750
|
+
meta,
|
|
751
|
+
...other
|
|
752
|
+
} = props;
|
|
753
|
+
const {
|
|
754
|
+
currentLang
|
|
755
|
+
} = useLocales();
|
|
756
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
757
|
+
children: [/* @__PURE__ */ jsxs(W, {
|
|
758
|
+
children: [/* @__PURE__ */ jsx("title", {
|
|
759
|
+
children: `${title} | Made4Labs`
|
|
760
|
+
}), /* @__PURE__ */ jsx("html", {
|
|
761
|
+
lang: currentLang.value
|
|
762
|
+
}), meta]
|
|
763
|
+
}), /* @__PURE__ */ jsx(Box, {
|
|
764
|
+
ref,
|
|
765
|
+
...other,
|
|
766
|
+
children
|
|
767
|
+
})]
|
|
768
|
+
});
|
|
769
|
+
});
|
|
770
|
+
Page.displayName = "Page";
|
|
771
|
+
function useResponsive(query, key, start, end) {
|
|
772
|
+
const theme = useTheme();
|
|
773
|
+
const mediaUp = useMediaQuery(theme.breakpoints.up(key));
|
|
774
|
+
const mediaDown = useMediaQuery(theme.breakpoints.down(key));
|
|
775
|
+
const mediaBetween = useMediaQuery(theme.breakpoints.between(start, end));
|
|
776
|
+
const mediaOnly = useMediaQuery(theme.breakpoints.only(key));
|
|
777
|
+
if (query === "up") {
|
|
778
|
+
return mediaUp;
|
|
779
|
+
}
|
|
780
|
+
if (query === "down") {
|
|
781
|
+
return mediaDown;
|
|
782
|
+
}
|
|
783
|
+
if (query === "between") {
|
|
784
|
+
return mediaBetween;
|
|
785
|
+
}
|
|
786
|
+
if (query === "only") {
|
|
787
|
+
return mediaOnly;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
export { Page as P, useResponsive as u };
|
package/dist/vendor.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { useTheme } from "@mui/material/styles";
|
|
2
2
|
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
3
3
|
import "./layouts/ModuleLayout/index.js";
|
|
4
|
+
import "@m4l/components";
|
|
4
5
|
import "react";
|
|
5
6
|
import "@m4l/core";
|
|
6
|
-
import "@m4l/components";
|
|
7
7
|
import "./layouts/MasterDetailLayout/index.js";
|
|
8
8
|
import "@mui/material";
|
|
9
9
|
import "react/jsx-runtime";
|
|
10
|
+
import "./layouts/NoAuthModuleLayout/index.js";
|
|
10
11
|
import "./hooks/useMasterDetail/index.js";
|
|
11
12
|
import "./hooks/useModule/index.js";
|
|
12
13
|
function useResponsive(query, key, start, end) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/layouts",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.6",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
@@ -14,17 +14,21 @@
|
|
|
14
14
|
"format": "npm run prettier:fix && npm run lint:fix"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
+
"@m4l/core": "^0.0.27",
|
|
18
|
+
"@m4l/graphics": "^0.0.18",
|
|
17
19
|
"react": "^17.0.0 || 18.x",
|
|
18
20
|
"react-dom": "^18.0.0"
|
|
19
21
|
},
|
|
20
22
|
"peerDependencies": {
|
|
21
|
-
"@m4l/components": "^0.0.
|
|
23
|
+
"@m4l/components": "^0.0.17",
|
|
24
|
+
"@m4l/core": "^0.0.27",
|
|
25
|
+
"@m4l/graphics": "^0.0.18",
|
|
22
26
|
"react": "^17.0.0 || 18.x",
|
|
23
27
|
"react-dom": "^18.0.0"
|
|
24
28
|
},
|
|
25
29
|
"devDependencies": {
|
|
26
30
|
"@emotion/styled": "^11.9.3",
|
|
27
|
-
"@m4l/components": "^0.0.
|
|
31
|
+
"@m4l/components": "^0.0.17",
|
|
28
32
|
"@testing-library/react": "^13.3.0",
|
|
29
33
|
"@testing-library/user-event": "^14.2.1",
|
|
30
34
|
"@types/node": "^17.0.40",
|