@m4l/layouts 0.0.30 → 0.0.33

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.
@@ -66,7 +66,8 @@ function MasterDetailLayout(props) {
66
66
  masterComponent,
67
67
  componentsDictionary,
68
68
  breadcrumbLinks,
69
- privileges
69
+ privileges,
70
+ skeletonFlags
70
71
  } = props;
71
72
  const {
72
73
  host_static_assets,
@@ -117,7 +118,7 @@ function MasterDetailLayout(props) {
117
118
  initialWidth: 500,
118
119
  initialHeigth: 680,
119
120
  contentComponent: detailComponent,
120
- actionComponents: void 0
121
+ actions: void 0
121
122
  });
122
123
  }, [detailComponent]);
123
124
  const viewDetailAction = useMemo(() => {
@@ -139,16 +140,17 @@ function MasterDetailLayout(props) {
139
140
  }, [splitActions, moduleActions, isDesktop, viewDetailAction]);
140
141
  const finalComponentsDictionary = useMemo(() => componentsDictionary.concat(getMasterDetailLayoutComponentsDictionary()), [componentsDictionary]);
141
142
  console.log("MasterDetailLayout Render");
142
- return /* @__PURE__ */ jsx(ModuleLayout, {
143
- ref: moduleLayoutRef,
144
- moduleId,
145
- moduleNameField,
146
- urlIcon,
147
- moduleActions: finalModuleActions,
148
- privileges,
149
- componentsDictionary: finalComponentsDictionary,
150
- breadcrumbLinks,
151
- children: /* @__PURE__ */ jsx(MasterDetailProvider, {
143
+ return /* @__PURE__ */ jsx(MasterDetailProvider, {
144
+ children: /* @__PURE__ */ jsx(ModuleLayout, {
145
+ ref: moduleLayoutRef,
146
+ moduleId,
147
+ moduleNameField,
148
+ urlIcon,
149
+ moduleActions: finalModuleActions,
150
+ privileges,
151
+ skeletonFlags,
152
+ componentsDictionary: finalComponentsDictionary,
153
+ breadcrumbLinks,
152
154
  children: /* @__PURE__ */ jsx(SplitLayout, {
153
155
  splitPosition: isDesktop ? splitPosition : "none",
154
156
  firstPart: masterComponent,
@@ -1,7 +1,7 @@
1
1
  import { BoxIcon, Breadcrumbs as Breadcrumbs$1, MenuActions, useModal, ModalProvider, getModalDialogComponentsDictionary } from "@m4l/components";
2
2
  import { createContext, useState, useMemo, forwardRef, useRef, useImperativeHandle } from "react";
3
3
  import { styled, useTheme } from "@mui/material/styles";
4
- import { voidFunction, useModuleDictionary, useFlagsPresent, FlagsProvider, ModuleDictionaryProvider, ModulePrivilegesProvider } from "@m4l/core";
4
+ import { voidFunction, useModuleDictionary, useFlagsPresent, FlagsProvider, ModuleDictionaryProvider, ModuleSkeletonProvider, ModulePrivilegesProvider } from "@m4l/core";
5
5
  import { Skeleton, Typography, IconButton } from "@mui/material";
6
6
  import { u as useResponsiveDesktop } from "../../vendor.js";
7
7
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
@@ -341,7 +341,8 @@ const ModuleLayout = forwardRef((props, ref) => {
341
341
  children,
342
342
  componentsDictionary,
343
343
  breadcrumbLinks,
344
- privileges
344
+ privileges,
345
+ skeletonFlags
345
346
  } = props;
346
347
  const moduleRef = useRef(null);
347
348
  const openModal = (modalOpenProps) => {
@@ -355,18 +356,21 @@ const ModuleLayout = forwardRef((props, ref) => {
355
356
  children: /* @__PURE__ */ jsx(ModuleDictionaryProvider, {
356
357
  moduleId,
357
358
  componentsDictionary,
358
- children: /* @__PURE__ */ jsx(ModulePrivilegesProvider, {
359
- queryPrivileges: privileges,
360
- children: /* @__PURE__ */ jsx(ModuleProvider, {
361
- moduleId,
362
- urlIcon,
363
- moduleNameField,
364
- initialModuleActions,
365
- breadcrumbLinks,
366
- children: /* @__PURE__ */ jsx(ModalProvider, {
367
- children: /* @__PURE__ */ jsx(Module, {
368
- ref: moduleRef,
369
- children
359
+ children: /* @__PURE__ */ jsx(ModuleSkeletonProvider, {
360
+ flags: skeletonFlags,
361
+ children: /* @__PURE__ */ jsx(ModulePrivilegesProvider, {
362
+ queryPrivileges: privileges,
363
+ children: /* @__PURE__ */ jsx(ModuleProvider, {
364
+ moduleId,
365
+ urlIcon,
366
+ moduleNameField,
367
+ initialModuleActions,
368
+ breadcrumbLinks,
369
+ children: /* @__PURE__ */ jsx(ModalProvider, {
370
+ children: /* @__PURE__ */ jsx(Module, {
371
+ ref: moduleRef,
372
+ children
373
+ })
370
374
  })
371
375
  })
372
376
  })
@@ -18,6 +18,7 @@ export interface ModuleAction extends MenuAction {
18
18
  export interface ModuleLayoutProps extends HeaderProps {
19
19
  moduleId: string;
20
20
  urlIcon: string;
21
+ skeletonFlags: string[];
21
22
  moduleNameField?: string;
22
23
  privileges: string[];
23
24
  breadcrumbLinks: TLink[];
@@ -1,7 +1,7 @@
1
1
  import { CompanyLogo, LanguagePopover, Typography, Image } from "@m4l/components";
2
2
  import { Card, Container, Stack } from "@mui/material";
3
3
  import { styled } from "@mui/material/styles";
4
- import { useModuleDictionary, useFlagsPresent, getLocalStorage, useNetwork, useEnvironment, useFlags, FlagsProvider, ModuleDictionaryProvider } from "@m4l/core";
4
+ import { useModuleDictionary, useFlagsPresent, getLocalStorage, useNetwork, useEnvironment, useFlags, FlagsProvider, ModuleDictionaryProvider, ModuleSkeletonProvider } from "@m4l/core";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { u as useResponsive, P as Page } from "../../node_modules.js";
7
7
  import { createContext, useState, useEffect } from "react";
@@ -215,7 +215,8 @@ const NoAuthModuleLayout = (props) => {
215
215
  moduleId,
216
216
  moduleName,
217
217
  children,
218
- componentsDictionary
218
+ componentsDictionary,
219
+ skeletonFlags
219
220
  } = props;
220
221
  return /* @__PURE__ */ jsx(FlagsProvider, {
221
222
  children: /* @__PURE__ */ jsx(ModuleDictionaryProvider, {
@@ -223,10 +224,13 @@ const NoAuthModuleLayout = (props) => {
223
224
  moduleId,
224
225
  moduleName,
225
226
  componentsDictionary,
226
- children: /* @__PURE__ */ jsx(ModuleProvider, {
227
- moduleId,
228
- children: /* @__PURE__ */ jsx(ModuleWrapper, {
229
- children
227
+ children: /* @__PURE__ */ jsx(ModuleSkeletonProvider, {
228
+ flags: skeletonFlags,
229
+ children: /* @__PURE__ */ jsx(ModuleProvider, {
230
+ moduleId,
231
+ children: /* @__PURE__ */ jsx(ModuleWrapper, {
232
+ children
233
+ })
230
234
  })
231
235
  })
232
236
  })
@@ -7,5 +7,6 @@ export interface NoAuthModuleLayoutProps {
7
7
  moduleId: string;
8
8
  moduleName?: string;
9
9
  componentsDictionary: string[];
10
+ skeletonFlags: string[];
10
11
  children: ReactNode;
11
12
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
3
  "private": false,
4
- "version": "0.0.30",
4
+ "version": "0.0.33",
5
5
  "license": "UNLICENSED",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -14,7 +14,7 @@
14
14
  "format": "npm run prettier:fix && npm run lint:fix"
15
15
  },
16
16
  "dependencies": {
17
- "@m4l/components": "^0.0.47",
17
+ "@m4l/components": "^0.0.49",
18
18
  "react": "^17.0.0 || 18.x",
19
19
  "react-dom": "^18.0.0"
20
20
  },