@m4l/layouts 0.0.2 → 0.0.5
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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
3
|
export { u as useMasterDetail } from "./hooks/useMasterDetail/index.js";
|
|
4
4
|
export { u as useModule } from "./hooks/useModule/index.js";
|
|
5
5
|
import "@m4l/components";
|
|
@@ -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
|
}
|
package/dist/layouts/index.d.ts
CHANGED
package/dist/vendor.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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";
|
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.5",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
@@ -14,17 +14,18 @@
|
|
|
14
14
|
"format": "npm run prettier:fix && npm run lint:fix"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@m4l/
|
|
17
|
+
"@m4l/core": "^0.0.27",
|
|
18
18
|
"react": "^17.0.0 || 18.x",
|
|
19
19
|
"react-dom": "^18.0.0"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
+
"@m4l/components": "^0.0.13",
|
|
22
23
|
"react": "^17.0.0 || 18.x",
|
|
23
|
-
"react-dom": "^18.0.0"
|
|
24
|
-
"@m4l/components": "^0.0.5"
|
|
24
|
+
"react-dom": "^18.0.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@emotion/styled": "^11.9.3",
|
|
28
|
+
"@m4l/components": "^0.0.13",
|
|
28
29
|
"@testing-library/react": "^13.3.0",
|
|
29
30
|
"@testing-library/user-event": "^14.2.1",
|
|
30
31
|
"@types/node": "^17.0.40",
|
|
@@ -50,7 +51,6 @@
|
|
|
50
51
|
"vite-plugin-mkcert": "^1.6.4",
|
|
51
52
|
"vitest": "^0.17.1"
|
|
52
53
|
},
|
|
53
|
-
|
|
54
54
|
"files": [
|
|
55
55
|
"dist"
|
|
56
56
|
],
|