@imperium/layout 14.5.0 → 14.5.2

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.
Files changed (46) hide show
  1. package/dist/esm/content/components/ContentComponent.js +1 -1
  2. package/dist/esm/content/components/ContentComponent.js.map +1 -1
  3. package/dist/esm/content/components/SidebarItemWrapper.js +1 -1
  4. package/dist/esm/content/components/SidebarItemWrapper.js.map +1 -1
  5. package/dist/esm/content/createPages.js +15 -48
  6. package/dist/esm/content/createPages.js.map +1 -1
  7. package/dist/esm/content/types.js.map +1 -1
  8. package/dist/esm/datahooks/Permissions.js +1 -1
  9. package/dist/esm/datahooks/Permissions.js.map +1 -1
  10. package/dist/esm/layout/components/LayoutItemWrapper.js +1 -1
  11. package/dist/esm/layout/components/LayoutItemWrapper.js.map +1 -1
  12. package/dist/esm/layout/moveItems.js +2 -2
  13. package/dist/esm/layout/moveItems.js.map +1 -1
  14. package/dist/esm/layout/withLayout.js +7 -7
  15. package/dist/esm/layout/withLayout.js.map +1 -1
  16. package/dist/esm/types.js.map +1 -1
  17. package/dist/stats.html +1 -1
  18. package/dist/stats.txt +47 -73
  19. package/dist/types/content/types.d.ts +1 -3
  20. package/package.json +6 -6
  21. package/dist/esm/_virtual/index.js +0 -4
  22. package/dist/esm/_virtual/index.js.map +0 -1
  23. package/dist/esm/_virtual/react-is.development.js +0 -4
  24. package/dist/esm/_virtual/react-is.development.js.map +0 -1
  25. package/dist/esm/_virtual/react-is.production.min.js +0 -4
  26. package/dist/esm/_virtual/react-is.production.min.js.map +0 -1
  27. package/dist/esm/external/@babel/runtime/helpers/esm/assertThisInitialized.js +0 -9
  28. package/dist/esm/external/@babel/runtime/helpers/esm/assertThisInitialized.js.map +0 -1
  29. package/dist/esm/external/@babel/runtime/helpers/esm/extends.js +0 -17
  30. package/dist/esm/external/@babel/runtime/helpers/esm/extends.js.map +0 -1
  31. package/dist/esm/external/@babel/runtime/helpers/esm/inheritsLoose.js +0 -10
  32. package/dist/esm/external/@babel/runtime/helpers/esm/inheritsLoose.js.map +0 -1
  33. package/dist/esm/external/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -15
  34. package/dist/esm/external/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +0 -1
  35. package/dist/esm/external/@babel/runtime/helpers/esm/setPrototypeOf.js +0 -10
  36. package/dist/esm/external/@babel/runtime/helpers/esm/setPrototypeOf.js.map +0 -1
  37. package/dist/esm/external/@loadable/component/dist/loadable.esm.js +0 -470
  38. package/dist/esm/external/@loadable/component/dist/loadable.esm.js.map +0 -1
  39. package/dist/esm/external/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +0 -107
  40. package/dist/esm/external/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js.map +0 -1
  41. package/dist/esm/external/react-is/cjs/react-is.development.js +0 -182
  42. package/dist/esm/external/react-is/cjs/react-is.development.js.map +0 -1
  43. package/dist/esm/external/react-is/cjs/react-is.production.min.js +0 -18
  44. package/dist/esm/external/react-is/cjs/react-is.production.min.js.map +0 -1
  45. package/dist/esm/external/react-is/index.js +0 -12
  46. package/dist/esm/external/react-is/index.js.map +0 -1
@@ -15,7 +15,7 @@ import styles from './styles.module.css.js';
15
15
  debug("imperium.layout.content.components.ContentComponent");
16
16
  function useDeepCompareMemoize(value) {
17
17
  const ref = useRef();
18
- if (!value && !ref.current)
18
+ if (!value)
19
19
  return ref.current;
20
20
  if (!isEqual(value, ref.current)) {
21
21
  ref.current = value;
@@ -1 +1 @@
1
- {"version":3,"file":"ContentComponent.js","sources":["../../../../src/content/components/ContentComponent.tsx"],"sourcesContent":["import type {DefineRouteOptions} from '@imperium/router';\nimport debug from 'debug';\nimport {isEqual} from 'lodash-es';\nimport {type DependencyList, type EffectCallback, useEffect, useRef, useState} from 'react';\nimport {useDispatch} from 'react-redux';\nimport {Button} from 'semantic-ui-react';\nimport {useMediaQuery} from 'react-responsive';\nimport {DataHooks} from '../../datahooks/DataHooks';\nimport {actions} from '../../state';\nimport {sortWeightedItems} from '../../utils';\nimport {useBuildContentData} from '../hooks/useBuildContentData';\nimport type {Page, RouteParameters, SidebarItem} from '../types';\nimport {Header} from './Header';\nimport {SidebarItemWrapper} from './SidebarItemWrapper';\nimport styles from './styles.module.css';\n\nconst d = debug('imperium.layout.content.components.ContentComponent');\n\ninterface ContentComponentProps<T extends DefineRouteOptions, K extends keyof T> {\n\tpage: Page<T, K>;\n\tparams: RouteParameters<T[K]['params']>;\n}\n\nfunction useDeepCompareMemoize(value: any) {\n\tconst ref = useRef();\n\tif (!value && !ref.current) return ref.current;\n\tif (!isEqual(value, ref.current)) {\n\t\tref.current = value;\n\t}\n\treturn ref.current;\n}\n\nfunction useDeepCompareEffect(callback: EffectCallback, deps: DependencyList) {\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tuseEffect(callback, deps.map(useDeepCompareMemoize));\n}\n\nexport function ContentComponent<T extends DefineRouteOptions, K extends keyof T>({page, params}: ContentComponentProps<T, K>) {\n\tconst dispatch = useDispatch();\n\tconst data = useBuildContentData({stateSelectorHook: page.stateSelectorHook, permissionSelectorHook: page.permissionSelectorHook, params});\n\tconst [visible, setVisible] = useState(true);\n\tconst isMobile = useMediaQuery({query: '(max-width: 900px)'});\n\n\tuseDeepCompareEffect(() => {\n\t\tdispatch(actions.setParams(params));\n\t}, [dispatch, params]);\n\n\tuseEffect(() => {\n\t\tif (typeof page.header === 'string') {\n\t\t\tdispatch(actions.setPageHeader(page.header));\n\t\t} else {\n\t\t\tdispatch(actions.setPageHeader(''));\n\t\t}\n\t}, [dispatch, page.header]);\n\n\tconst content = page.content(data);\n\tconst sidebarItems = sortWeightedItems(page.sidebar || []);\n\n\tconst sidebar =\n\t\tsidebarItems.length > 0 ? (\n\t\t\t<div className={`${styles.sidebar} imperiumContentSidebar`}>\n\t\t\t\t<div className={styles.sidebarButton}>\n\t\t\t\t\t<Button icon=\"angle right\" size=\"big\" onClick={() => setVisible(false)} fluid style={{paddingLeft: 0}} />\n\t\t\t\t</div>\n\t\t\t\t<div className={styles.sidebarContent}>\n\t\t\t\t\t<div className={`${styles.actionsHeader} imperiumContentSidebarHeader`}>\n\t\t\t\t\t\t<h3>Actions</h3>\n\t\t\t\t\t</div>\n\t\t\t\t\t{sidebarItems.map((sb, index) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t// eslint-disable-next-line react/no-array-index-key\n\t\t\t\t\t\t\t<div className={styles.sidebarItem} key={index}>\n\t\t\t\t\t\t\t\t<SidebarItemWrapper item={sb as SidebarItem<T, K>} params={params} data={data} />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t) : null;\n\n\tconst mobileSidebar =\n\t\tsidebarItems.length > 0 ? (\n\t\t\t<div className={`${styles.sidebarMobile} imperiumContentSidebar`}>\n\t\t\t\t<div className={`${styles.actionsHeader} imperiumContentSidebarHeader`}>\n\t\t\t\t\t<h3>Actions</h3>\n\t\t\t\t</div>\n\t\t\t\t{sidebarItems.map((sb, index) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t// eslint-disable-next-line react/no-array-index-key\n\t\t\t\t\t\t<div className={styles.sidebarItem} key={index}>\n\t\t\t\t\t\t\t<SidebarItemWrapper item={sb as SidebarItem<T, K>} params={params} data={data} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t) : null;\n\n\treturn (\n\t\t<div className={`${styles.parent} imperiumContentWrapperParent`}>\n\t\t\t<div className={`${styles.wrapper} imperiumContentWrapper`}>\n\t\t\t\t<Header header={page.header} data={data} />\n\t\t\t\t<div className={`${styles.content} imperiumContent ${page.full && styles.contentFull}`}>{content}</div>\n\t\t\t</div>\n\t\t\t{isMobile && mobileSidebar}\n\t\t\t{!isMobile && (\n\t\t\t\t<>\n\t\t\t\t\t{visible && sidebar}\n\t\t\t\t\t{!visible && (\n\t\t\t\t\t\t<Button icon=\"angle left\" size=\"big\" onClick={() => setVisible(true)} className={styles.sidebarButton} style={{paddingLeft: 0}} />\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t<DataHooks dataHooks={page.dataHooks || []} />\n\t\t</div>\n\t);\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAgBU,MAAM,qDAAqD,EAAA;AAOrE,SAAA,qBAAA,CAA+B,KAAY,EAAA;AAC1C,EAAA,MAAM,MAAM,MAAO,EAAA,CAAA;AACnB,EAAI,IAAA,CAAC,KAAS,IAAA,CAAC,GAAI,CAAA,OAAA;AAAS,IAAA,OAAO,GAAI,CAAA,OAAA,CAAA;AACvC,EAAA,IAAI,CAAC,OAAA,CAAQ,KAAO,EAAA,GAAA,CAAI,OAAO,CAAG,EAAA;AACjC,IAAA,GAAA,CAAI,OAAU,GAAA,KAAA,CAAA;AAAA,GACf;AACA,EAAA,OAAO,GAAI,CAAA,OAAA,CAAA;AACZ,CAAA;AAEA,SAAA,oBAAA,CAA8B,UAA0B,IAAsB,EAAA;AAE7E,EAAA,SAAA,CAAU,QAAU,EAAA,IAAA,CAAK,GAAI,CAAA,qBAAqB,CAAC,CAAA,CAAA;AACpD,CAAA;AAEkF,SAAA,gBAAA,CAAA,EAAC,MAAM,MAAsC,EAAA,EAAA;AAC9H,EAAA,MAAM,WAAW,WAAY,EAAA,CAAA;AAC7B,EAAM,MAAA,IAAA,GAAO,mBAAoB,CAAA,EAAC,iBAAmB,EAAA,IAAA,CAAK,mBAAmB,sBAAwB,EAAA,IAAA,CAAK,sBAAwB,EAAA,MAAA,EAAO,CAAA,CAAA;AACzI,EAAA,MAAM,CAAC,OAAA,EAAS,UAAc,CAAA,GAAA,QAAA,CAAS,IAAI,CAAA,CAAA;AAC3C,EAAA,MAAM,QAAW,GAAA,aAAA,CAAc,EAAC,KAAA,EAAO,sBAAqB,CAAA,CAAA;AAE5D,EAAA,oBAAA,CAAqB,MAAM;AAC1B,IAAS,Q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ContentComponent.tsx"],"sourcesContent":["import type {DefineRouteOptions} from '@imperium/router';\nimport debug from 'debug';\nimport {isEqual} from 'lodash-es';\nimport {type DependencyList, type EffectCallback, useEffect, useRef, useState} from 'react';\nimport {useDispatch} from 'react-redux';\nimport {Button} from 'semantic-ui-react';\nimport {useMediaQuery} from 'react-responsive';\nimport {DataHooks} from '../../datahooks/DataHooks';\nimport {actions} from '../../state';\nimport {sortWeightedItems} from '../../utils';\nimport {useBuildContentData} from '../hooks/useBuildContentData';\nimport type {Page, RouteParameters, SidebarItem} from '../types';\nimport {Header} from './Header';\nimport {SidebarItemWrapper} from './SidebarItemWrapper';\nimport styles from './styles.module.css';\n\nconst d = debug('imperium.layout.content.components.ContentComponent');\n\ninterface ContentComponentProps<T extends DefineRouteOptions, K extends keyof T> {\n\tpage: Page<T, K>;\n\tparams: RouteParameters<T[K]['params']>;\n}\n\nfunction useDeepCompareMemoize(value: any) {\n\tconst ref = useRef();\n\tif (!value) return ref.current;\n\tif (!isEqual(value, ref.current)) {\n\t\tref.current = value;\n\t}\n\treturn ref.current;\n}\n\nfunction useDeepCompareEffect(callback: EffectCallback, deps: DependencyList) {\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tuseEffect(callback, deps.map(useDeepCompareMemoize));\n}\n\nexport function ContentComponent<T extends DefineRouteOptions, K extends keyof T>({page, params}: ContentComponentProps<T, K>) {\n\tconst dispatch = useDispatch();\n\tconst data = useBuildContentData({stateSelectorHook: page.stateSelectorHook, permissionSelectorHook: page.permissionSelectorHook, params});\n\tconst [visible, setVisible] = useState(true);\n\tconst isMobile = useMediaQuery({query: '(max-width: 900px)'});\n\n\tuseDeepCompareEffect(() => {\n\t\tdispatch(actions.setParams(params));\n\t}, [dispatch, params]);\n\n\tuseEffect(() => {\n\t\tif (typeof page.header === 'string') {\n\t\t\tdispatch(actions.setPageHeader(page.header));\n\t\t} else {\n\t\t\tdispatch(actions.setPageHeader(''));\n\t\t}\n\t}, [dispatch, page.header]);\n\n\tconst content = page.content(data);\n\tconst sidebarItems = sortWeightedItems(page.sidebar || []);\n\n\tconst sidebar =\n\t\tsidebarItems.length > 0 ? (\n\t\t\t<div className={`${styles.sidebar} imperiumContentSidebar`}>\n\t\t\t\t<div className={styles.sidebarButton}>\n\t\t\t\t\t<Button icon=\"angle right\" size=\"big\" onClick={() => setVisible(false)} fluid style={{paddingLeft: 0}} />\n\t\t\t\t</div>\n\t\t\t\t<div className={styles.sidebarContent}>\n\t\t\t\t\t<div className={`${styles.actionsHeader} imperiumContentSidebarHeader`}>\n\t\t\t\t\t\t<h3>Actions</h3>\n\t\t\t\t\t</div>\n\t\t\t\t\t{sidebarItems.map((sb, index) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t// eslint-disable-next-line react/no-array-index-key\n\t\t\t\t\t\t\t<div className={styles.sidebarItem} key={index}>\n\t\t\t\t\t\t\t\t<SidebarItemWrapper item={sb as SidebarItem<T, K>} params={params} data={data} />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t) : null;\n\n\tconst mobileSidebar =\n\t\tsidebarItems.length > 0 ? (\n\t\t\t<div className={`${styles.sidebarMobile} imperiumContentSidebar`}>\n\t\t\t\t<div className={`${styles.actionsHeader} imperiumContentSidebarHeader`}>\n\t\t\t\t\t<h3>Actions</h3>\n\t\t\t\t</div>\n\t\t\t\t{sidebarItems.map((sb, index) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t// eslint-disable-next-line react/no-array-index-key\n\t\t\t\t\t\t<div className={styles.sidebarItem} key={index}>\n\t\t\t\t\t\t\t<SidebarItemWrapper item={sb as SidebarItem<T, K>} params={params} data={data} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t) : null;\n\n\treturn (\n\t\t<div className={`${styles.parent} imperiumContentWrapperParent`}>\n\t\t\t<div className={`${styles.wrapper} imperiumContentWrapper`}>\n\t\t\t\t<Header header={page.header} data={data} />\n\t\t\t\t<div className={`${styles.content} imperiumContent ${page.full && styles.contentFull}`}>{content}</div>\n\t\t\t</div>\n\t\t\t{isMobile && mobileSidebar}\n\t\t\t{!isMobile && (\n\t\t\t\t<>\n\t\t\t\t\t{visible && sidebar}\n\t\t\t\t\t{!visible && (\n\t\t\t\t\t\t<Button icon=\"angle left\" size=\"big\" onClick={() => setVisible(true)} className={styles.sidebarButton} style={{paddingLeft: 0}} />\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t<DataHooks dataHooks={page.dataHooks || []} />\n\t\t</div>\n\t);\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAgBU,MAAM,qDAAqD,EAAA;AAOrE,SAAA,qBAAA,CAA+B,KAAY,EAAA;AAC1C,EAAA,MAAM,MAAM,MAAO,EAAA,CAAA;AACnB,EAAA,IAAI,CAAC,KAAA;AAAO,IAAA,OAAO,GAAI,CAAA,OAAA,CAAA;AACvB,EAAA,IAAI,CAAC,OAAA,CAAQ,KAAO,EAAA,GAAA,CAAI,OAAO,CAAG,EAAA;AACjC,IAAA,GAAA,CAAI,OAAU,GAAA,KAAA,CAAA;AAAA,GACf;AACA,EAAA,OAAO,GAAI,CAAA,OAAA,CAAA;AACZ,CAAA;AAEA,SAAA,oBAAA,CAA8B,UAA0B,IAAsB,EAAA;AAE7E,EAAA,SAAA,CAAU,QAAU,EAAA,IAAA,CAAK,GAAI,CAAA,qBAAqB,CAAC,CAAA,CAAA;AACpD,CAAA;AAEkF,SAAA,gBAAA,CAAA,EAAC,MAAM,MAAsC,EAAA,EAAA;AAC9H,EAAA,MAAM,WAAW,WAAY,EAAA,CAAA;AAC7B,EAAM,MAAA,IAAA,GAAO,mBAAoB,CAAA,EAAC,iBAAmB,EAAA,IAAA,CAAK,mBAAmB,sBAAwB,EAAA,IAAA,CAAK,sBAAwB,EAAA,MAAA,EAAO,CAAA,CAAA;AACzI,EAAA,MA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GAAG,CAElI,mBAEA,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA;AAAA,IAAU,SAAA,EAAW,IAAK,CAAA,SAAA,IAAa,EAAC;AAAA,GAAG,CAC7C,CAAA,CAAA;AAEF;;;;"}
@@ -22,7 +22,7 @@ function SidebarItemWrapper({ item, data: parentData, params }) {
22
22
  if (!item.visible(data))
23
23
  return null;
24
24
  } else {
25
- const q = new Query(item.visible || {});
25
+ const q = new Query(item.visible);
26
26
  if (!q.test(data))
27
27
  return null;
28
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarItemWrapper.js","sources":["../../../../src/content/components/SidebarItemWrapper.tsx"],"sourcesContent":["import type {DefineRouteOptions} from '@imperium/router';\nimport debug from 'debug';\nimport {Query} from 'mingo';\nimport {Divider} from 'semantic-ui-react';\nimport {useBuildContentData} from '../hooks/useBuildContentData';\nimport type {ContentData, RouteParameters, SidebarItem} from '../types';\nimport {isActionFormSidebarItem, isActionSidebarItem, isCustomSidebarItem, isDividerSidebarItem} from '../types';\nimport {ActionFormSidebarItemComponent} from './ActionFormSidebarItemComponent';\nimport {ActionSidebarItemComponent} from './ActionSidebarItemComponent';\nimport {CustomSidebarItemComponent} from './CustomSidebarItemComponent';\nimport {PlainSidebarItem} from './PlainSidebarItem';\n\nconst d = debug('imperium.layout.content.components.SidebarItemWrapper');\n\ninterface SidebarItemWrapperProps<T extends DefineRouteOptions, K extends keyof T> {\n\titem: SidebarItem<T, K>;\n\tdata?: ContentData<T, K>;\n\tparams: RouteParameters<T[K]['params']>;\n}\n\nexport function SidebarItemWrapper<T extends DefineRouteOptions, K extends keyof T>({item, data: parentData, params}: SidebarItemWrapperProps<T, K>) {\n\tconst data = useBuildContentData({\n\t\tdata: parentData,\n\t\tstateSelectorHook: item.stateSelectorHook,\n\t\tpermissionSelectorHook: item.permissionSelectorHook,\n\t\tparams,\n\t});\n\n\t// Check if visible\n\tif (item.visible) {\n\t\tif (typeof item.visible === 'function') {\n\t\t\tif (!item.visible(data)) return null;\n\t\t} else {\n\t\t\tconst q = new Query(item.visible || {});\n\t\t\tif (!q.test(data)) return null;\n\t\t}\n\t}\n\n\tif (isCustomSidebarItem(item)) {\n\t\treturn <CustomSidebarItemComponent item={item} data={data} />;\n\t}\n\n\tif (isActionSidebarItem(item)) {\n\t\t// @ts-ignore I'm not sure why this error is occurring -mk\n\t\treturn <ActionSidebarItemComponent item={item} data={data} />;\n\t}\n\n\tif (isActionFormSidebarItem(item)) {\n\t\t// @ts-ignore I'm not sure why this error is occurring -mk\n\t\treturn <ActionFormSidebarItemComponent item={item} data={data} />;\n\t}\n\n\tif (isDividerSidebarItem(item)) {\n\t\treturn <Divider />;\n\t}\n\n\t// @ts-ignore These types should work, not sure why it's not. Runtime code is fine.\n\treturn <PlainSidebarItem item={item} data={data} />;\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAYU,MAAM,uDAAuD,EAAA;AAQhE,SAAA,kBAAA,CAA6E,EAAC,IAAA,EAAM,IAAM,EAAA,UAAA,EAAY,MAAwC,EAAA,EAAA;AACpJ,EAAA,MAAM,OAAO,mBAAoB,CAAA;AAAA,IAChC,IAAM,EAAA,UAAA;AAAA,IACN,mBAAmB,IAAK,CAAA,iBAAA;AAAA,IACxB,wBAAwB,IAAK,CAAA,sBAAA;AAAA,IAC7B,MAAA;AAAA,GACA,CAAA,CAAA;AAGD,EAAA,IAAI,KAAK,OAAS,EAAA;AACjB,IAAI,IAAA,OAAO,IAAK,CAAA,OAAA,KAAY,UAAY,EAAA;AACvC,MAAI,IAAA,CAAC,IAAK,CAAA,OAAA,CAAQ,IAAI,CAAA;AAAG,QAAO,OAAA,IAAA,CAAA;AAAA,KAC1B,MAAA;AACN,MAAA,MAAM,IAAI,IAAI,KAAA,CAAM,IAAK,CAAA,OAAA,IAAW,EAAE,CAAA,CAAA;AACtC,MAAI,IAAA,CAAC,CAAE,CAAA,IAAA,CAAK,IAAI,CAAA;AAAG,QAAO,OAAA,IAAA,CAAA;AAAA,KAC3B;AAAA,GACD;AAEA,EAAI,IAAA,mBAAA,CAAoB,IAAI,CAAG,EAAA;AAC9B,IAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,0BAAA,EAAA;AAAA,MAA2B,IAAA;AAAA,MAAY,IAAA;AAAA,KAAY,CAAA,CAAA;AAAA,GAC5D;AAEA,EAAI,IAAA,mBAAA,CAAoB,IAAI,CAAG,EAAA;AAE9B,IAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,0BAAA,EAAA;AAAA,MAA2B,IAAA;AAAA,MAAY,IAAA;AAAA,KAAY,CAAA,CAAA;AAAA,GAC5D;AAEA,EAAI,IAAA,uBAAA,CAAwB,IAAI,CAAG,EAAA;AAElC,IAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,8BAAA,EAAA;AAAA,MAA+B,IAAA;AAAA,MAAY,IAAA;AAAA,KAAY,CAAA,CAAA;AAAA,GAChE;AAEA,EAAI,IAAA,oBAAA,CAAqB,IAAI,CAAG,EAAA;AAC/B,IAAA,2CAAQ,OAAQ,EAAA,IAAA,CAAA,CAAA;AAAA,GACjB;AAGA,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,gBAAA,EAAA;AAAA,IAAiB,IAAA;AAAA,IAAY,IAAA;AAAA,GAAY,CAAA,CAAA;AAClD;;;;"}
1
+ {"version":3,"file":"SidebarItemWrapper.js","sources":["../../../../src/content/components/SidebarItemWrapper.tsx"],"sourcesContent":["import type {DefineRouteOptions} from '@imperium/router';\nimport debug from 'debug';\nimport {Query} from 'mingo';\nimport {Divider} from 'semantic-ui-react';\nimport {useBuildContentData} from '../hooks/useBuildContentData';\nimport type {ContentData, RouteParameters, SidebarItem} from '../types';\nimport {isActionFormSidebarItem, isActionSidebarItem, isCustomSidebarItem, isDividerSidebarItem} from '../types';\nimport {ActionFormSidebarItemComponent} from './ActionFormSidebarItemComponent';\nimport {ActionSidebarItemComponent} from './ActionSidebarItemComponent';\nimport {CustomSidebarItemComponent} from './CustomSidebarItemComponent';\nimport {PlainSidebarItem} from './PlainSidebarItem';\n\nconst d = debug('imperium.layout.content.components.SidebarItemWrapper');\n\ninterface SidebarItemWrapperProps<T extends DefineRouteOptions, K extends keyof T> {\n\titem: SidebarItem<T, K>;\n\tdata?: ContentData<T, K>;\n\tparams: RouteParameters<T[K]['params']>;\n}\n\nexport function SidebarItemWrapper<T extends DefineRouteOptions, K extends keyof T>({item, data: parentData, params}: SidebarItemWrapperProps<T, K>) {\n\tconst data = useBuildContentData({\n\t\tdata: parentData,\n\t\tstateSelectorHook: item.stateSelectorHook,\n\t\tpermissionSelectorHook: item.permissionSelectorHook,\n\t\tparams,\n\t});\n\n\t// Check if visible\n\tif (item.visible) {\n\t\tif (typeof item.visible === 'function') {\n\t\t\tif (!item.visible(data)) return null;\n\t\t} else {\n\t\t\tconst q = new Query(item.visible);\n\t\t\tif (!q.test(data)) return null;\n\t\t}\n\t}\n\n\tif (isCustomSidebarItem(item)) {\n\t\treturn <CustomSidebarItemComponent item={item} data={data} />;\n\t}\n\n\tif (isActionSidebarItem(item)) {\n\t\t// @ts-ignore I'm not sure why this error is occurring -mk\n\t\treturn <ActionSidebarItemComponent item={item} data={data} />;\n\t}\n\n\tif (isActionFormSidebarItem(item)) {\n\t\t// @ts-ignore I'm not sure why this error is occurring -mk\n\t\treturn <ActionFormSidebarItemComponent item={item} data={data} />;\n\t}\n\n\tif (isDividerSidebarItem(item)) {\n\t\treturn <Divider />;\n\t}\n\n\t// @ts-ignore These types should work, not sure why it's not. Runtime code is fine.\n\treturn <PlainSidebarItem item={item} data={data} />;\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAYU,MAAM,uDAAuD,EAAA;AAQhE,SAAA,kBAAA,CAA6E,EAAC,IAAA,EAAM,IAAM,EAAA,UAAA,EAAY,MAAwC,EAAA,EAAA;AACpJ,EAAA,MAAM,OAAO,mBAAoB,CAAA;AAAA,IAChC,IAAM,EAAA,UAAA;AAAA,IACN,mBAAmB,IAAK,CAAA,iBAAA;AAAA,I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;AAAA,GAAY,CAAA,CAAA;AAClD;;;;"}
@@ -1,61 +1,28 @@
1
1
  import React from 'react';
2
- import loadable$2 from './../external/@loadable/component/dist/loadable.esm.js';
2
+ import debug from 'debug';
3
3
  import { ContentComponent } from './components/ContentComponent.js';
4
4
  import { isPage } from './types.js';
5
5
 
6
- const loadableCache = /* @__PURE__ */ new Map();
7
- function getOrCreateLoadable(loader) {
8
- if (typeof loader === "function" && !loader.prototype?.isReactComponent && loader.length === 0) {
9
- if (!loadableCache.has(loader)) {
10
- loadableCache.set(loader, loadable$2(loader));
11
- }
12
- return loadableCache.get(loader);
13
- }
14
- return loader;
15
- }
16
- function wrapLazy(loader, params) {
17
- const StableComponent = getOrCreateLoadable(loader);
18
- if (StableComponent !== loader) {
19
- return function LazyThunk(props) {
20
- return /* @__PURE__ */ React.createElement(StableComponent, {
21
- ...params,
22
- ...props
23
- });
24
- };
25
- }
26
- return function ComponentThunk(props) {
27
- const Comp = loader;
28
- return /* @__PURE__ */ React.createElement(Comp, {
29
- ...params,
30
- ...props
31
- });
32
- };
33
- }
6
+ debug("imperium.layout.content.createPages");
34
7
  function createPages(routes, pages) {
35
8
  const renderRoutePropsObj = Object.keys(routes.types).reduce((memo, key) => {
36
- function routeRenderFn(params) {
37
- const pg = pages[key];
38
- if (isPage(pg)) {
39
- const processedPage = {
40
- ...pg,
41
- content: wrapLazy(pg.content, params),
42
- sidebar: pg.sidebar?.map((s) => s.render ? { ...s, render: wrapLazy(s.render, params) } : s)
43
- };
9
+ return {
10
+ ...memo,
11
+ [key]: (params) => {
12
+ const pg = pages[key];
13
+ if (isPage(pg)) {
14
+ return /* @__PURE__ */ React.createElement(ContentComponent, {
15
+ page: pg,
16
+ params
17
+ });
18
+ }
44
19
  return /* @__PURE__ */ React.createElement(ContentComponent, {
45
- page: processedPage,
20
+ page: {
21
+ content: pg
22
+ },
46
23
  params
47
24
  });
48
25
  }
49
- return /* @__PURE__ */ React.createElement(ContentComponent, {
50
- page: {
51
- content: wrapLazy(pg, params)
52
- },
53
- params
54
- });
55
- }
56
- return {
57
- ...memo,
58
- [key]: routeRenderFn
59
26
  };
60
27
  }, {});
61
28
  return routes.renderRouteProps(renderRoutePropsObj);
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,uBAAuB,wDAA0D;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":"createPages.js","sources":["../../../src/content/createPages.tsx"],"sourcesContent":["import type {Routes, DefineRouteOptions, KeyedRouteRenderFns} from '@imperium/router';\nimport debug from 'debug';\nimport {ContentComponent} from './components/ContentComponent';\nimport type {Pages, RouteParameters} from './types';\nimport {isPage} from './types';\n\nconst d = debug('imperium.layout.content.createPages');\n\nexport function createPages<T extends DefineRouteOptions>(routes: Routes<T>, pages: Pages<T>) {\n\tconst renderRoutePropsObj = Object.keys(routes.types).reduce((memo, key) => {\n\t\treturn {\n\t\t\t...memo,\n\t\t\t[key]: (params: RouteParameters<T[typeof key]['params']>) => {\n\t\t\t\tconst pg = pages[key];\n\t\t\t\tif (isPage(pg)) {\n\t\t\t\t\treturn <ContentComponent page={pg} params={params} />;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<ContentComponent\n\t\t\t\t\t\tpage={{\n\t\t\t\t\t\t\tcontent: pg,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tparams={params}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t}, {} as KeyedRouteRenderFns<T>);\n\n\treturn routes.renderRouteProps(renderRoutePropsObj);\n}\n"],"names":[],"mappings":";;;;;AAMU,MAAM,qCAAqC,EAAA;AAE9C,SAAA,WAAA,CAAmD,QAAmB,KAAiB,EAAA;AAC7F,EAAM,MAAA,mBAAA,GAAsB,OAAO,IAAK,CAAA,MAAA,CAAO,KAAK,CAAE,CAAA,MAAA,CAAO,CAAC,IAAA,EAAM,GAAQ,KAAA;AAC3E,IAAO,OAAA;AAAA,MACH,GAAA,IAAA;AAAA,MACF,CAAA,GAAA,GAAM,CAAC,MAAqD,KAAA;AAC5D,QAAA,MAAM,KAAK,KAAM,CAAA,GAAA,CAAA,CAAA;AACjB,QAAI,IAAA,MAAA,CAAO,EAAE,CAAG,EAAA;AACf,UAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,gBAAA,EAAA;AAAA,YAAiB,IAAM,EAAA,EAAA;AAAA,YAAI,MAAA;AAAA,WAAgB,CAAA,CAAA;AAAA,SACpD;AACA,QAAA,uBACE,KAAA,CAAA,aAAA,CAAA,gBAAA,EAAA;AAAA,UACA,IAAM,EAAA;AAAA,YACL,OAAS,EAAA,EAAA;AAAA,WACV;AAAA,UACA,MAAA;AAAA,SACD,CAAA,CAAA;AAAA,OAEF;AAAA,KACD,CAAA;AAAA,GACD,EAAG,EAA4B,CAAA,CAAA;AAE/B,EAAO,OAAA,MAAA,CAAO,iBAAiB,mBAAmB,CAAA,CAAA;AACnD;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../src/content/types.ts"],"sourcesContent":["import type {DefineRouteOptions, ParametersFromAssertion} from '@imperium/router';\nimport type React from 'react';\nimport type {SemanticCOLORS, SemanticICONS} from 'semantic-ui-react';\nimport type {RouteItem, VisibilityItem, WeightedItem} from '../commonItems';\nimport type {DataHookItem} from '../datahooks/types';\nimport type {Data, PermissionSelectorHook, StateSelectorHook} from '../types';\n\nexport type RouteParameters<T extends readonly string[] | undefined> = T extends readonly string[] ? ParametersFromAssertion<T> : never;\n\nexport interface ContentData<T extends DefineRouteOptions, K extends keyof T> extends Data {\n\tparams: RouteParameters<T[K]['params']>;\n}\n\nexport type Content<T extends DefineRouteOptions, K extends keyof T> = (\n\tdata: ContentData<T, K>,\n) => Promise<{default: React.ComponentType<any>}>;\n\nexport interface BaseSidebarItem<T extends DefineRouteOptions, K extends keyof T> extends WeightedItem, VisibilityItem {\n\ttext: string | ((data: ContentData<T, K>) => string);\n\ticon?: SemanticICONS | ((data: ContentData<T, K>) => SemanticICONS);\n\tcolor?: SemanticCOLORS | ((data: ContentData<T, K>) => SemanticCOLORS);\n}\n\nexport interface DividerSidebarItem<T extends DefineRouteOptions, K extends keyof T> extends BaseSidebarItem<T, K> {\n\tdivider: boolean;\n}\n\nexport interface ActionSidebarItem<T extends DefineRouteOptions, K extends keyof T> extends BaseSidebarItem<T, K> {\n\tonClick: (data: ContentData<T, K>) => void;\n}\n\ninterface ActionFormSidebarItemFormParams<T extends DefineRouteOptions, K extends keyof T> {\n\tvalues: Record<string, any>;\n\thandleChange: (e: React.ChangeEvent<any>) => void;\n\tfieldError: (fieldName: string | number) => boolean;\n\tdata: ContentData<T, K>;\n}\nexport interface ActionFormSidebarItem<T extends DefineRouteOptions, K extends keyof T> extends BaseSidebarItem<T, K> {\n\tform: (params: ActionFormSidebarItemFormParams<T, K>) => JSX.Element | null;\n\tinitialValues?: Record<string, any> | ((data: ContentData<T, K>) => Record<string, any>);\n\tonSubmit?: (values: Record<string, any>, data: ContentData<T, K>) => void;\n\tvalidationSchema?: any;\n}\n\nexport interface CustomSidebarItem<T extends DefineRouteOptions, K extends keyof T> extends WeightedItem, VisibilityItem {\n\trender: (data: ContentData<T, K>) => JSX.Element | null;\n}\n\nexport type SidebarItem<T extends DefineRouteOptions, K extends keyof T> =\n\t| (BaseSidebarItem<T, K> & RouteItem<ContentData<T, K>>)\n\t| ActionSidebarItem<T, K>\n\t| CustomSidebarItem<T, K>\n\t| ActionFormSidebarItem<T, K>\n\t| DividerSidebarItem<T, K>;\n\nexport interface ContentHeaderObject {\n\ttitle: string;\n\ticon?: string;\n\tsize?: 'tiny' | 'small' | 'medium' | 'large' | 'huge';\n}\n\nexport function isContentHeaderObject(value: any): value is ContentHeaderObject {\n\treturn value && value.title;\n}\n\nexport type ContentHeader<T extends DefineRouteOptions, K extends keyof T> =\n\t| string\n\t| ContentHeaderObject\n\t| ((data: ContentData<T, K>) => ContentHeaderObject)\n\t| JSX.Element\n\t| ((data: ContentData<T, K>) => JSX.Element)\n\t| undefined;\n\nexport interface Page<T extends DefineRouteOptions, K extends keyof T> {\n\tdataHooks?: DataHookItem[];\n\tstateSelectorHook?: StateSelectorHook | StateSelectorHook[];\n\tpermissionSelectorHook?: PermissionSelectorHook | PermissionSelectorHook[];\n\tcontent: Content<T, K>;\n\theader?: ContentHeader<T, K>;\n\tsidebar?: SidebarItem<T, K>[];\n\tfull?: boolean;\n}\n\nexport type Pages<T extends DefineRouteOptions> = {\n\t[key in keyof T]: Page<T, key> | Content<T, key>;\n};\n\nexport function isPage<T extends DefineRouteOptions, K extends keyof T>(value: any): value is Page<T, K> {\n\treturn !!(value as Page<T, K>).content;\n}\n\nexport function isActionSidebarItem<T extends DefineRouteOptions, K extends keyof T>(value: any): value is ActionSidebarItem<T, K> {\n\treturn !!(value as ActionSidebarItem<T, K>).onClick;\n}\n\nexport function isActionFormSidebarItem<T extends DefineRouteOptions, K extends keyof T>(value: any): value is ActionFormSidebarItem<T, K> {\n\treturn !!(value as ActionFormSidebarItem<T, K>).form;\n}\n\nexport function isCustomSidebarItem<T extends DefineRouteOptions, K extends keyof T>(value: any): value is CustomSidebarItem<T, K> {\n\treturn !!(value as CustomSidebarItem<T, K>).render;\n}\n\nexport function isDividerSidebarItem<T extends DefineRouteOptions, K extends keyof T>(value: any): value is DividerSidebarItem<T, K> {\n\treturn (value as DividerSidebarItem<T, K>).divider;\n}\n"],"names":[],"mappings":"AA6DO,SAAA,qBAAA,CAA+B,KAA0C,EAAA;AAC/E,EAAA,OAAO,SAAS,KAAM,CAAA,KAAA,CAAA;AACvB,CAAA;AAwBO,SAAA,MAAA,CAAiE,KAAiC,EAAA;AACxG,EAAO,OAAA,CAAC,CAAE,KAAqB,CAAA,OAAA,CAAA;AAChC,CAAA;AAEO,SAAA,mBAAA,CAA8E,KAA8C,EAAA;AAClI,EAAO,OAAA,CAAC,CAAE,KAAkC,CAAA,OAAA,CAAA;AAC7C,CAAA;AAEO,SAAA,uBAAA,CAAkF,KAAkD,EAAA;AAC1I,EAAO,OAAA,CAAC,CAAE,KAAsC,CAAA,IAAA,CAAA;AACjD,CAAA;AAEO,SAAA,mBAAA,CAA8E,KAA8C,EAAA;AAClI,EAAO,OAAA,CAAC,CAAE,KAAkC,CAAA,MAAA,CAAA;AAC7C,CAAA;AAEO,SAAA,oBAAA,CAA+E,KAA+C,EAAA;AACpI,EAAA,OAAQ,KAAmC,CAAA,OAAA,CAAA;AAC5C;;;;"}
1
+ {"version":3,"file":"types.js","sources":["../../../src/content/types.ts"],"sourcesContent":["import type {DefineRouteOptions, ParametersFromAssertion} from '@imperium/router';\nimport type React from 'react';\nimport type {SemanticCOLORS, SemanticICONS} from 'semantic-ui-react';\nimport type {RouteItem, VisibilityItem, WeightedItem} from '../commonItems';\nimport type {DataHookItem} from '../datahooks/types';\nimport type {Data, PermissionSelectorHook, StateSelectorHook} from '../types';\n\nexport type RouteParameters<T extends readonly string[] | undefined> = T extends readonly string[] ? ParametersFromAssertion<T> : never;\n\nexport interface ContentData<T extends DefineRouteOptions, K extends keyof T> extends Data {\n\tparams: RouteParameters<T[K]['params']>;\n}\n\nexport type Content<T extends DefineRouteOptions, K extends keyof T> = (data: ContentData<T, K>) => JSX.Element;\n\nexport interface BaseSidebarItem<T extends DefineRouteOptions, K extends keyof T> extends WeightedItem, VisibilityItem {\n\ttext: string | ((data: ContentData<T, K>) => string);\n\ticon?: SemanticICONS | ((data: ContentData<T, K>) => SemanticICONS);\n\tcolor?: SemanticCOLORS | ((data: ContentData<T, K>) => SemanticCOLORS);\n}\n\nexport interface DividerSidebarItem<T extends DefineRouteOptions, K extends keyof T> extends BaseSidebarItem<T, K> {\n\tdivider: boolean;\n}\n\nexport interface ActionSidebarItem<T extends DefineRouteOptions, K extends keyof T> extends BaseSidebarItem<T, K> {\n\tonClick: (data: ContentData<T, K>) => void;\n}\n\ninterface ActionFormSidebarItemFormParams<T extends DefineRouteOptions, K extends keyof T> {\n\tvalues: Record<string, any>;\n\thandleChange: (e: React.ChangeEvent<any>) => void;\n\tfieldError: (fieldName: string | number) => boolean;\n\tdata: ContentData<T, K>;\n}\nexport interface ActionFormSidebarItem<T extends DefineRouteOptions, K extends keyof T> extends BaseSidebarItem<T, K> {\n\tform: (params: ActionFormSidebarItemFormParams<T, K>) => JSX.Element | null;\n\tinitialValues?: Record<string, any> | ((data: ContentData<T, K>) => Record<string, any>);\n\tonSubmit?: (values: Record<string, any>, data: ContentData<T, K>) => void;\n\tvalidationSchema?: any;\n}\n\nexport interface CustomSidebarItem<T extends DefineRouteOptions, K extends keyof T> extends WeightedItem, VisibilityItem {\n\trender: (data: ContentData<T, K>) => JSX.Element | null;\n}\n\nexport type SidebarItem<T extends DefineRouteOptions, K extends keyof T> =\n\t| (BaseSidebarItem<T, K> & RouteItem<ContentData<T, K>>)\n\t| ActionSidebarItem<T, K>\n\t| CustomSidebarItem<T, K>\n\t| ActionFormSidebarItem<T, K>\n\t| DividerSidebarItem<T, K>;\n\nexport interface ContentHeaderObject {\n\ttitle: string;\n\ticon?: string;\n\tsize?: 'tiny' | 'small' | 'medium' | 'large' | 'huge';\n}\n\nexport function isContentHeaderObject(value: any): value is ContentHeaderObject {\n\treturn value && value.title;\n}\n\nexport type ContentHeader<T extends DefineRouteOptions, K extends keyof T> =\n\t| string\n\t| ContentHeaderObject\n\t| ((data: ContentData<T, K>) => ContentHeaderObject)\n\t| JSX.Element\n\t| ((data: ContentData<T, K>) => JSX.Element)\n\t| undefined;\n\nexport interface Page<T extends DefineRouteOptions, K extends keyof T> {\n\tdataHooks?: DataHookItem[];\n\tstateSelectorHook?: StateSelectorHook | StateSelectorHook[];\n\tpermissionSelectorHook?: PermissionSelectorHook | PermissionSelectorHook[];\n\tcontent: Content<T, K>;\n\theader?: ContentHeader<T, K>;\n\tsidebar?: SidebarItem<T, K>[];\n\tfull?: boolean;\n}\n\nexport type Pages<T extends DefineRouteOptions> = {\n\t[key in keyof T]: Page<T, key> | Content<T, key>;\n};\n\nexport function isPage<T extends DefineRouteOptions, K extends keyof T>(value: any): value is Page<T, K> {\n\treturn !!(value as Page<T, K>).content;\n}\n\nexport function isActionSidebarItem<T extends DefineRouteOptions, K extends keyof T>(value: any): value is ActionSidebarItem<T, K> {\n\treturn !!(value as ActionSidebarItem<T, K>).onClick;\n}\n\nexport function isActionFormSidebarItem<T extends DefineRouteOptions, K extends keyof T>(value: any): value is ActionFormSidebarItem<T, K> {\n\treturn !!(value as ActionFormSidebarItem<T, K>).form;\n}\n\nexport function isCustomSidebarItem<T extends DefineRouteOptions, K extends keyof T>(value: any): value is CustomSidebarItem<T, K> {\n\treturn !!(value as CustomSidebarItem<T, K>).render;\n}\n\nexport function isDividerSidebarItem<T extends DefineRouteOptions, K extends keyof T>(value: any): value is DividerSidebarItem<T, K> {\n\treturn (value as DividerSidebarItem<T, K>).divider;\n}\n"],"names":[],"mappings":"AA2DO,SAAA,qBAAA,CAA+B,KAA0C,EAAA;AAC/E,EAAA,OAAO,SAAS,KAAM,CAAA,KAAA,CAAA;AACvB,CAAA;AAwBO,SAAA,MAAA,CAAiE,KAAiC,EAAA;AACxG,EAAO,OAAA,CAAC,CAAE,KAAqB,CAAA,OAAA,CAAA;AAChC,CAAA;AAEO,SAAA,mBAAA,CAA8E,KAA8C,EAAA;AAClI,EAAO,OAAA,CAAC,CAAE,KAAkC,CAAA,OAAA,CAAA;AAC7C,CAAA;AAEO,SAAA,uBAAA,CAAkF,KAAkD,EAAA;AAC1I,EAAO,OAAA,CAAC,CAAE,KAAsC,CAAA,IAAA,CAAA;AACjD,CAAA;AAEO,SAAA,mBAAA,CAA8E,KAA8C,EAAA;AAClI,EAAO,OAAA,CAAC,CAAE,KAAkC,CAAA,MAAA,CAAA;AAC7C,CAAA;AAEO,SAAA,oBAAA,CAA+E,KAA+C,EAAA;AACpI,EAAA,OAAQ,KAAmC,CAAA,OAAA,CAAA;AAC5C;;;;"}
@@ -12,7 +12,7 @@ function Permissions({ permissions }) {
12
12
  useEffect(() => {
13
13
  (async function iife() {
14
14
  const permissionsWithData = permissions.map((permission) => {
15
- const data = layoutState.params && Object.keys(layoutState.params).length > 0 ? layoutState.params : void 0;
15
+ const data = Object.keys(layoutState.params).length > 0 ? layoutState.params : void 0;
16
16
  return {
17
17
  permission,
18
18
  data
@@ -1 +1 @@
1
- {"version":3,"file":"Permissions.js","sources":["../../../src/datahooks/Permissions.tsx"],"sourcesContent":["import {useAuthorization} from '@imperium/auth-client';\nimport debug from 'debug';\nimport {useEffect} from 'react';\nimport {useDispatch} from 'react-redux';\nimport {actions, useLayoutState} from '../state';\nimport type {PermissionSelector} from '../types';\n\nconst d = debug('imperium.layout.datahooks.Permissions');\n\ninterface PermissionsProps {\n\tpermissions: PermissionSelector;\n}\n\nexport function Permissions({permissions}: PermissionsProps) {\n\tconst authorization = useAuthorization();\n\tconst layoutState = useLayoutState();\n\tconst dispatch = useDispatch();\n\n\tuseEffect(() => {\n\t\t(async function iife() {\n\t\t\tconst permissionsWithData = permissions.map(permission => {\n\t\t\t\tconst data = layoutState.params && Object.keys(layoutState.params).length > 0 ? layoutState.params : undefined;\n\t\t\t\treturn {\n\t\t\t\t\tpermission,\n\t\t\t\t\tdata,\n\t\t\t\t};\n\t\t\t});\n\t\t\tpermissionsWithData.forEach(permission => {\n\t\t\t\tauthorization\n\t\t\t\t\t.can(permission)\n\t\t\t\t\t.then(result => {\n\t\t\t\t\t\tdispatch(actions.setPermission({...permission, result}));\n\t\t\t\t\t})\n\t\t\t\t\t.catch(err => d(err));\n\t\t\t});\n\t\t})().catch(err => d(err));\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AAO,OAAA,IAAA,CAAA;AACR;;;;"}
1
+ {"version":3,"file":"Permissions.js","sources":["../../../src/datahooks/Permissions.tsx"],"sourcesContent":["import {useAuthorization} from '@imperium/auth-client';\nimport debug from 'debug';\nimport {useEffect} from 'react';\nimport {useDispatch} from 'react-redux';\nimport {actions, useLayoutState} from '../state';\nimport type {PermissionSelector} from '../types';\n\nconst d = debug('imperium.layout.datahooks.Permissions');\n\ninterface PermissionsProps {\n\tpermissions: PermissionSelector;\n}\n\nexport function Permissions({permissions}: PermissionsProps) {\n\tconst authorization = useAuthorization();\n\tconst layoutState = useLayoutState();\n\tconst dispatch = useDispatch();\n\n\tuseEffect(() => {\n\t\t(async function iife() {\n\t\t\tconst permissionsWithData = permissions.map(permission => {\n\t\t\t\tconst data = Object.keys(layoutState.params).length > 0 ? layoutState.params : undefined;\n\t\t\t\treturn {\n\t\t\t\t\tpermission,\n\t\t\t\t\tdata,\n\t\t\t\t};\n\t\t\t});\n\t\t\tpermissionsWithData.forEach(permission => {\n\t\t\t\tauthorization\n\t\t\t\t\t.can(permission)\n\t\t\t\t\t.then(result => {\n\t\t\t\t\t\tdispatch(actions.setPermission({...permission, result}));\n\t\t\t\t\t})\n\t\t\t\t\t.catch(err => d(err));\n\t\t\t});\n\t\t})().catch(err => d(err));\n\t}, [dispatch, permissions, authorization, layoutState.params]);\n\n\treturn null;\n}\n"],"names":[],"mappings":";;;;;;AAOA,MAAM,CAAA,GAAI,MAAM,uCAAuC,CAAA,CAAA;AAMhD,SAAA,WAAA,CAAqB,EAAC,WAAgC,EAAA,EAAA;AAC5D,EAAA,MAAM,gBAAgB,gBAAiB,EAAA,CAAA;AACvC,EAAA,MAAM,cAAc,cAAe,EAAA,CAAA;AACnC,EAAA,MAAM,WAAW,WAAY,EAAA,CAAA;AAE7B,EAAA,SAAA,CAAU,MAAM;AACf,IAAC,CAAsB,eAAA,IAAA,GAAA;AACtB,MAAM,MAAA,mBAAA,GAAsB,WAAY,CAAA,GAAA,CAAI,CAAc,UAAA,KAAA;AACzD,QAAM,MAAA,IAAA,GAAO,OAAO,IAAK,CAAA,WAAA,CAAY,MAAM,CAAE,CAAA,MAAA,GAAS,CAAI,GAAA,WAAA,CAAY,MAAS,GAAA,KAAA,CAAA,CAAA;AAC/E,QAAO,OAAA;AAAA,UACN,UAAA;AAAA,UACA,IAAA;AAAA,SACD,CAAA;AAAA,OACA,CAAA,CAAA;AACD,MAAA,mBAAA,CAAoB,QAAQ,CAAc,UAAA,KAAA;AACzC,QAAA,aAAA,CACE,GAAI,CAAA,UAAU,CACd,CAAA,IAAA,CAAK,CAAU,MAAA,KAAA;AACf,UAAA,QAAA,CAAS,QAAQ,aAAc,CAAA,EAAA,GAAI,UAAY,EAAA,MAAA,EAAO,CAAC,CAAA,CAAA;AAAA,SACvD,CACA,CAAA,KAAA,CAAM,CAAO,GAAA,KAAA,CAAA,CAAE,GAAG,CAAC,CAAA,CAAA;AAAA,OACrB,CAAA,CAAA;AAAA,QACG,CAAA,KAAA,CAAM,CAAO,GAAA,KAAA,CAAA,CAAE,GAAG,CAAC,CAAA,CAAA;AAAA,KACtB,CAAC,QAAA,EAAU,aAAa,aAAe,EAAA,WAAA,CAAY,MAAM,CAAC,CAAA,CAAA;AAE7D,EAAO,OAAA,IAAA,CAAA;AACR;;;;"}
@@ -23,7 +23,7 @@ function LayoutItemWrapper({ item, as, vertical, data: parentData }) {
23
23
  if (!item.visible(data))
24
24
  return null;
25
25
  } else {
26
- const q = new Query(item.visible || {});
26
+ const q = new Query(item.visible);
27
27
  if (!q.test(data))
28
28
  return null;
29
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"LayoutItemWrapper.js","sources":["../../../../src/layout/components/LayoutItemWrapper.tsx"],"sourcesContent":["import debug from 'debug';\nimport {Query} from 'mingo';\nimport type {ComponentClass} from 'react';\nimport {Dropdown} from 'semantic-ui-react';\nimport {useBuildData} from '../../hooks/useBuildData';\nimport type {Data} from '../../types';\nimport {sortWeightedItems} from '../../utils';\nimport type {LayoutItem} from '../types';\nimport {isCustomLayoutItem, isDropdownLayoutItem, isMenuLayoutItem} from '../types';\nimport {CustomLayoutItemComponent} from './CustomLayoutItemComponent';\nimport {DropdownItem} from './DropdownItem';\nimport {MenuItem} from './MenuItem';\nimport {PlainItem} from './PlainItem';\n\nconst d = debug('imperium.layout.components.LayoutItemWrapper');\n\ninterface ItemWrapperProps {\n\titem: LayoutItem;\n\tas?: ComponentClass;\n\tvertical?: boolean;\n\tdata?: Data;\n}\n\n/**\n * Renders any type of Item. Gathers state, route and other data and checks for visibility.\n * @param item\n * @param as\n * @param vertical\n * @param parentData\n * @constructor\n */\nexport function LayoutItemWrapper({item, as, vertical, data: parentData}: ItemWrapperProps) {\n\tconst data = useBuildData({\n\t\tstateSelectorHook: item.stateSelectorHook,\n\t\tpermissionSelectorHook: item.permissionSelectorHook,\n\t\trouteItem: item,\n\t\tdata: parentData,\n\t});\n\n\t// Check if visible\n\tif (item.visible) {\n\t\tif (typeof item.visible === 'function') {\n\t\t\tif (!item.visible(data)) return null;\n\t\t} else {\n\t\t\tconst q = new Query(item.visible || {});\n\t\t\tif (!q.test(data)) return null;\n\t\t}\n\t}\n\n\tif (isCustomLayoutItem(item)) {\n\t\treturn <CustomLayoutItemComponent item={item} data={data} />;\n\t}\n\tif (isDropdownLayoutItem(item)) {\n\t\tconst children = sortWeightedItems(item.dropdown).map((v, index) => (\n\t\t\t// eslint-disable-next-line react/no-array-index-key\n\t\t\t<LayoutItemWrapper key={index} item={v as LayoutItem} as={Dropdown.Item} data={data} />\n\t\t));\n\t\treturn <DropdownItem item={item} children={children} vertical={vertical} data={data} />;\n\t}\n\tif (isMenuLayoutItem(item)) {\n\t\tconst children = sortWeightedItems(item.menu).map((v, index) => (\n\t\t\t// eslint-disable-next-line react/no-array-index-key\n\t\t\t<LayoutItemWrapper key={index} item={v as LayoutItem} as={Dropdown.Item} vertical={vertical} data={data} />\n\t\t));\n\t\treturn <MenuItem item={item} children={children} />;\n\t}\n\treturn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MAAiB,IAAI,QAAS,CAAA,IAAA;AAAA,MAAM,IAAA;AAAA,KAAY,CACrF,CAAA,CAAA;AACD,IAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA;AAAA,MAAa,IAAA;AAAA,MAAY,QAAA;AAAA,MAAoB,QAAA;AAAA,MAAoB,IAAA;AAAA,KAAY,CAAA,CAAA;AAAA,GACtF;AACA,EAAI,IAAA,gBAAA,CAAiB,IAAI,CAAG,EAAA;AAC3B,IAAM,MAAA,QAAA,GAAW,kBAAkB,IAAK,CAAA,IAAI,EAAE,GAAI,CAAA,CAAC,CAAG,EAAA,KAAA,qBAEpD,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA;AAAA,MAAkB,GAAK,EAAA,KAAA;AAAA,MAAO,IAAM,EAAA,CAAA;AAAA,MAAiB,IAAI,QAAS,CAAA,IAAA;AAAA,MAAM,QAAA;AAAA,MAAoB,IAAA;AAAA,KAAY,CACzG,CAAA,CAAA;AACD,IAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA;AAAA,MAAS,IAAA;AAAA,MAAY,QAAA;AAAA,KAAoB,CAAA,CAAA;AAAA,GAClD;AACA,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA;AAAA,IAAU,IAAA;AAAA,IAAY,IAAA;AAAA,IAAY,EAAA;AAAA,GAAQ,CAAA,CAAA;AACnD;;;;"}
1
+ {"version":3,"file":"LayoutItemWrapper.js","sources":["../../../../src/layout/components/LayoutItemWrapper.tsx"],"sourcesContent":["import debug from 'debug';\nimport {Query} from 'mingo';\nimport type {ComponentClass} from 'react';\nimport {Dropdown} from 'semantic-ui-react';\nimport {useBuildData} from '../../hooks/useBuildData';\nimport type {Data} from '../../types';\nimport {sortWeightedItems} from '../../utils';\nimport type {LayoutItem} from '../types';\nimport {isCustomLayoutItem, isDropdownLayoutItem, isMenuLayoutItem} from '../types';\nimport {CustomLayoutItemComponent} from './CustomLayoutItemComponent';\nimport {DropdownItem} from './DropdownItem';\nimport {MenuItem} from './MenuItem';\nimport {PlainItem} from './PlainItem';\n\nconst d = debug('imperium.layout.components.LayoutItemWrapper');\n\ninterface ItemWrapperProps {\n\titem: LayoutItem;\n\tas?: ComponentClass;\n\tvertical?: boolean;\n\tdata?: Data;\n}\n\n/**\n * Renders any type of Item. Gathers state, route and other data and checks for visibility.\n * @param item\n * @param as\n * @param vertical\n * @param parentData\n * @constructor\n */\nexport function LayoutItemWrapper({item, as, vertical, data: parentData}: ItemWrapperProps) {\n\tconst data = useBuildData({\n\t\tstateSelectorHook: item.stateSelectorHook,\n\t\tpermissionSelectorHook: item.permissionSelectorHook,\n\t\trouteItem: item,\n\t\tdata: parentData,\n\t});\n\n\t// Check if visible\n\tif (item.visible) {\n\t\tif (typeof item.visible === 'function') {\n\t\t\tif (!item.visible(data)) return null;\n\t\t} else {\n\t\t\tconst q = new Query(item.visible);\n\t\t\tif (!q.test(data)) return null;\n\t\t}\n\t}\n\n\tif (isCustomLayoutItem(item)) {\n\t\treturn <CustomLayoutItemComponent item={item} data={data} />;\n\t}\n\tif (isDropdownLayoutItem(item)) {\n\t\tconst children = sortWeightedItems(item.dropdown).map((v, index) => (\n\t\t\t// eslint-disable-next-line react/no-array-index-key\n\t\t\t<LayoutItemWrapper key={index} item={v as LayoutItem} as={Dropdown.Item} data={data} />\n\t\t));\n\t\treturn <DropdownItem item={item} children={children} vertical={vertical} data={data} />;\n\t}\n\tif (isMenuLayoutItem(item)) {\n\t\tconst children = sortWeightedItems(item.menu).map((v, index) => (\n\t\t\t// eslint-disable-next-line react/no-array-index-key\n\t\t\t<LayoutItemWrapper key={index} item={v as LayoutItem} as={Dropdown.Item} vertical={vertical} data={data} />\n\t\t));\n\t\treturn <MenuItem item={item} children={children} />;\n\t}\n\treturn <PlainItem item={item} data={data} as={as} />;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAcU,MAAM,8CAA8C,EAAA;AAiBvD,SAAA,iBAAA,CAA2B,E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,YAAA,EAAA;AAAA,MAAa,IAAA;AAAA,MAAY,QAAA;AAAA,MAAoB,QAAA;AAAA,MAAoB,IAAA;AAAA,KAAY,CAAA,CAAA;AAAA,GACtF;AACA,EAAI,IAAA,gBAAA,CAAiB,IAAI,CAAG,EAAA;AAC3B,IAAM,MAAA,QAAA,GAAW,kBAAkB,IAAK,CAAA,IAAI,EAAE,GAAI,CAAA,CAAC,CAAG,EAAA,KAAA,qBAEpD,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA;AAAA,MAAkB,GAAK,EAAA,KAAA;AAAA,MAAO,IAAM,EAAA,CAAA;AAAA,MAAiB,IAAI,QAAS,CAAA,IAAA;AAAA,MAAM,QAAA;AAAA,MAAoB,IAAA;AAAA,KAAY,CACzG,CAAA,CAAA;AACD,IAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA;AAAA,MAAS,IAAA;AAAA,MAAY,QAAA;AAAA,KAAoB,CAAA,CAAA;AAAA,GAClD;AACA,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA;AAAA,IAAU,IAAA;AAAA,IAAY,IAAA;AAAA,IAAY,EAAA;AAAA,GAAQ,CAAA,CAAA;AACnD;;;;"}
@@ -38,7 +38,7 @@ function addItems(items, pulled) {
38
38
  ...memo,
39
39
  {
40
40
  ...item,
41
- dropdown: [...addItems(item.dropdown, pulled), ...newItems]
41
+ dropdown: [...addItems(item.dropdown, pulled), ...newItems || []]
42
42
  }
43
43
  ];
44
44
  }
@@ -48,7 +48,7 @@ function addItems(items, pulled) {
48
48
  ...memo,
49
49
  {
50
50
  ...item,
51
- menu: [...addItems(item.menu, pulled), ...newItems]
51
+ menu: [...addItems(item.menu, pulled), ...newItems || []]
52
52
  }
53
53
  ];
54
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"moveItems.js","sources":["../../../src/layout/moveItems.ts"],"sourcesContent":["import debug from 'debug';\nimport {groupBy} from 'lodash-es';\nimport type {LayoutItem} from './types';\nimport {isDropdownLayoutItem, isMenuLayoutItem} from './types';\n\nconst d = debug('imperium.layout.moveItems');\n\nfunction pullItems(items: LayoutItem[], pulled: LayoutItem[] = []): LayoutItem[] {\n\treturn items.reduce((memo, item) => {\n\t\tif (isDropdownLayoutItem(item)) {\n\t\t\treturn [\n\t\t\t\t...memo,\n\t\t\t\t{\n\t\t\t\t\t...item,\n\t\t\t\t\tdropdown: pullItems(item.dropdown, pulled),\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\tif (isMenuLayoutItem(item)) {\n\t\t\treturn [\n\t\t\t\t...memo,\n\t\t\t\t{\n\t\t\t\t\t...item,\n\t\t\t\t\tmenu: pullItems(item.menu, pulled),\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\tif (!item.moveToKey) {\n\t\t\treturn [...memo, item];\n\t\t}\n\n\t\tpulled.push(item);\n\t\treturn memo;\n\t}, [] as LayoutItem[]);\n}\n\nfunction addItems(items: LayoutItem[], pulled: Record<string, LayoutItem[]>): LayoutItem[] {\n\treturn items.reduce((memo, item) => {\n\t\tif (isDropdownLayoutItem(item)) {\n\t\t\tconst newItems = item.key && pulled[item.key] ? pulled[item.key] : [];\n\t\t\treturn [\n\t\t\t\t...memo,\n\t\t\t\t{\n\t\t\t\t\t...item,\n\t\t\t\t\tdropdown: [...addItems(item.dropdown, pulled), ...newItems],\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\tif (isMenuLayoutItem(item) && item.key) {\n\t\t\tconst newItems = item.key && pulled[item.key] ? pulled[item.key] : [];\n\t\t\treturn [\n\t\t\t\t...memo,\n\t\t\t\t{\n\t\t\t\t\t...item,\n\t\t\t\t\tmenu: [...addItems(item.menu, pulled), ...newItems],\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\t\treturn [...memo, item];\n\t}, [] as LayoutItem[]);\n}\n\nexport function moveItems(items: LayoutItem[]) {\n\tconst pulled: LayoutItem[] = [];\n\tconst itemsMinusPulled = pullItems(items, pulled);\n\tre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CAAA,GAAO,EAAC,CAAA;AACpE,MAAO,OAAA;AAAA,QACN,GAAG,IAAA;AAAA,QACH;AAAA,UACI,GAAA,IAAA;AAAA,UACH,QAAA,EAAU,CAAC,GAAG,QAAA,CAAS,KAAK,QAAU,EAAA,MAAM,CAAG,EAAA,GAAG,QAAQ,CAAA;AAAA,SAC3D;AAAA,OACD,CAAA;AAAA,KACD;AAEA,IAAA,IAAI,gBAAiB,CAAA,IAAI,CAAK,IAAA,IAAA,CAAK,GAAK,EAAA;AACvC,MAAM,MAAA,QAAA,GAAW,KAAK,GAAO,IAAA,MAAA,CAAO,KAAK,GAAO,CAAA,GAAA,MAAA,CAAO,IAAK,CAAA,GAAA,CAAA,GAAO,EAAC,CAAA;AACpE,MAAO,OAAA;AAAA,QACN,GAAG,IAAA;AAAA,QACH;AAAA,UACI,GAAA,IAAA;AAAA,UACH,IAAA,EAAM,CAAC,GAAG,QAAA,CAAS,KAAK,IAAM,EAAA,MAAM,CAAG,EAAA,GAAG,QAAQ,CAAA;AAAA,SACnD;AAAA,OACD,CAAA;AAAA,KACD;AACA,IAAO,OAAA,CAAC,GAAG,IAAA,EAAM,IAAI,CAAA,CAAA;AAAA,GACtB,EAAG,EAAkB,CAAA,CAAA;AACtB,CAAA;AAEO,SAAA,SAAA,CAAmB,KAAqB,EAAA;AAC9C,EAAA,MAAM,SAAuB,EAAC,CAAA;AAC9B,EAAM,MAAA,gBAAA,GAAmB,SAAU,CAAA,KAAA,EAAO,MAAM,CAAA,CAAA;AAChD,EAAA,OAAO,QAAS,CAAA,gBAAA,EAAkB,OAAQ,CAAA,MAAA,EAAQ,WAAW,CAAC,CAAA,CAAA;AAC/D;;;;"}
1
+ {"version":3,"file":"moveItems.js","sources":["../../../src/layout/moveItems.ts"],"sourcesContent":["import debug from 'debug';\nimport {groupBy} from 'lodash-es';\nimport type {LayoutItem} from './types';\nimport {isDropdownLayoutItem, isMenuLayoutItem} from './types';\n\nconst d = debug('imperium.layout.moveItems');\n\nfunction pullItems(items: LayoutItem[], pulled: LayoutItem[] = []): LayoutItem[] {\n\treturn items.reduce((memo, item) => {\n\t\tif (isDropdownLayoutItem(item)) {\n\t\t\treturn [\n\t\t\t\t...memo,\n\t\t\t\t{\n\t\t\t\t\t...item,\n\t\t\t\t\tdropdown: pullItems(item.dropdown, pulled),\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\tif (isMenuLayoutItem(item)) {\n\t\t\treturn [\n\t\t\t\t...memo,\n\t\t\t\t{\n\t\t\t\t\t...item,\n\t\t\t\t\tmenu: pullItems(item.menu, pulled),\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\tif (!item.moveToKey) {\n\t\t\treturn [...memo, item];\n\t\t}\n\n\t\tpulled.push(item);\n\t\treturn memo;\n\t}, [] as LayoutItem[]);\n}\n\nfunction addItems(items: LayoutItem[], pulled: Record<string, LayoutItem[] | undefined>): LayoutItem[] {\n\treturn items.reduce((memo, item) => {\n\t\tif (isDropdownLayoutItem(item)) {\n\t\t\tconst newItems = item.key && pulled[item.key] ? pulled[item.key] : [];\n\t\t\treturn [\n\t\t\t\t...memo,\n\t\t\t\t{\n\t\t\t\t\t...item,\n\t\t\t\t\tdropdown: [...addItems(item.dropdown, pulled), ...(newItems || [])],\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\tif (isMenuLayoutItem(item) && item.key) {\n\t\t\tconst newItems = item.key && pulled[item.key] ? pulled[item.key] : [];\n\t\t\treturn [\n\t\t\t\t...memo,\n\t\t\t\t{\n\t\t\t\t\t...item,\n\t\t\t\t\tmenu: [...addItems(item.menu, pulled), ...(newItems || [])],\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\t\treturn [...memo, item];\n\t}, [] as LayoutItem[]);\n}\n\nexport function moveItems(items: LayoutItem[]) {\n\tconst pulled: LayoutItem[] = [];\n\tconst itemsMinusPulled = pullItems(items, pulled);\n\treturn addItems(itemsMinusPulled, groupBy(pulled, 'moveToKey'));\n}\n"],"names":[],"mappings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AA;AAAA,QACH;AAAA,UACI,GAAA,IAAA;AAAA,UACH,QAAA,EAAU,CAAC,GAAG,QAAS,CAAA,IAAA,CAAK,QAAU,EAAA,MAAM,CAAG,EAAA,GAAI,QAAY,IAAA,EAAG,CAAA;AAAA,SACnE;AAAA,OACD,CAAA;AAAA,KACD;AAEA,IAAA,IAAI,gBAAiB,CAAA,IAAI,CAAK,IAAA,IAAA,CAAK,GAAK,EAAA;AACvC,MAAM,MAAA,QAAA,GAAW,KAAK,GAAO,IAAA,MAAA,CAAO,KAAK,GAAO,CAAA,GAAA,MAAA,CAAO,IAAK,CAAA,GAAA,CAAA,GAAO,EAAC,CAAA;AACpE,MAAO,OAAA;AAAA,QACN,GAAG,IAAA;AAAA,QACH;AAAA,UACI,GAAA,IAAA;AAAA,UACH,IAAA,EAAM,CAAC,GAAG,QAAS,CAAA,IAAA,CAAK,IAAM,EAAA,MAAM,CAAG,EAAA,GAAI,QAAY,IAAA,EAAG,CAAA;AAAA,SAC3D;AAAA,OACD,CAAA;AAAA,KACD;AACA,IAAO,OAAA,CAAC,GAAG,IAAA,EAAM,IAAI,CAAA,CAAA;AAAA,GACtB,EAAG,EAAkB,CAAA,CAAA;AACtB,CAAA;AAEO,SAAA,SAAA,CAAmB,KAAqB,EAAA;AAC9C,EAAA,MAAM,SAAuB,EAAC,CAAA;AAC9B,EAAM,MAAA,gBAAA,GAAmB,SAAU,CAAA,KAAA,EAAO,MAAM,CAAA,CAAA;AAChD,EAAA,OAAO,QAAS,CAAA,gBAAA,EAAkB,OAAQ,CAAA,MAAA,EAAQ,WAAW,CAAC,CAAA,CAAA;AAC/D;;;;"}
@@ -20,13 +20,13 @@ function withLayout(client) {
20
20
  const layoutModuleData = client.modules.reduce((memo, module) => {
21
21
  if (isImperiumLayoutClientModule(module)) {
22
22
  return {
23
- dataHooks: [...memo.dataHooks || [], ...module.layout.dataHooks || []],
24
- permissionSelectorHooks: [...memo.permissionSelectorHooks || [], ...module.layout.permissionSelectorHooks || []],
25
- permissions: [...memo.permissions || [], ...module.layout.permissions || []],
26
- primaryMenu: [...memo.primaryMenu || [], ...module.layout.primaryMenu || []],
27
- statusbar: [...memo.statusbar || [], ...module.layout.statusbar || []],
28
- secondaryMenu: [...memo.secondaryMenu || [], ...module.layout.secondaryMenu || []],
29
- footer: [...memo.footer || [], ...module.layout.footer || []]
23
+ dataHooks: [...memo.dataHooks, ...module.layout.dataHooks || []],
24
+ permissionSelectorHooks: [...memo.permissionSelectorHooks, ...module.layout.permissionSelectorHooks || []],
25
+ permissions: [...memo.permissions, ...module.layout.permissions || []],
26
+ primaryMenu: [...memo.primaryMenu, ...module.layout.primaryMenu || []],
27
+ statusbar: [...memo.statusbar, ...module.layout.statusbar || []],
28
+ secondaryMenu: [...memo.secondaryMenu, ...module.layout.secondaryMenu || []],
29
+ footer: [...memo.footer, ...module.layout.footer || []]
30
30
  };
31
31
  }
32
32
  return memo;
@@ -1 +1 @@
1
- {"version":3,"file":"withLayout.js","sources":["../../../src/layout/withLayout.tsx"],"sourcesContent":["import type {Hoc, ImperiumClient} from '@imperium/client';\nimport debug from 'debug';\nimport type {ComponentType} from 'react';\nimport {DataHooks} from '../datahooks/DataHooks';\nimport {PermissionHooks} from '../datahooks/PermissionHooks';\nimport {Permissions} from '../datahooks/Permissions';\nimport {isImperiumLayoutClientModule} from '../types';\nimport {Layout} from './components/Layout';\nimport type {LayoutData} from './types';\n\nconst d = debug('imperium.layout.withLayout');\n\nconst initialLayoutModuleData: Required<LayoutData> = {\n\tdataHooks: [],\n\tpermissionSelectorHooks: [],\n\tpermissions: [],\n\tprimaryMenu: [],\n\tstatusbar: [],\n\tsecondaryMenu: [],\n\tfooter: [],\n};\n\nexport function withLayout(client: ImperiumClient): Hoc {\n\tconst layoutModuleData = client.modules.reduce((memo, module) => {\n\t\tif (isImperiumLayoutClientModule(module)) {\n\t\t\treturn {\n\t\t\t\tdataHooks: [...(memo.dataHooks || []), ...(module.layout.dataHooks || [])],\n\t\t\t\tpermissionSelectorHooks: [...(memo.permissionSelectorHooks || []), ...(module.layout.permissionSelectorHooks || [])],\n\t\t\t\tpermissions: [...(memo.permissions || []), ...(module.layout.permissions || [])],\n\t\t\t\tprimaryMenu: [...(memo.primaryMenu || []), ...(module.layout.primaryMenu || [])],\n\t\t\t\tstatusbar: [...(memo.statusbar || []), ...(module.layout.statusbar || [])],\n\t\t\t\tsecondaryMenu: [...(memo.secondaryMenu || []), ...(module.layout.secondaryMenu || [])],\n\t\t\t\tfooter: [...(memo.footer || []), ...(module.layout.footer || [])],\n\t\t\t} as Required<LayoutData>;\n\t\t}\n\t\treturn memo;\n\t}, initialLayoutModuleData);\n\td('Layout items processed', layoutModuleData);\n\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\treturn function layoutHoc(Wrapped: ComponentType<any>) {\n\t\tconst displayName = Wrapped.displayName || Wrapped.name || '';\n\n\t\tfunction WithLayout(props: Record<string, unknown>) {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<Layout {...layoutModuleData}>\n\t\t\t\t\t\t<Wrapped {...props} layout={layoutModuleData} />\n\t\t\t\t\t</Layout>\n\t\t\t\t\t<DataHooks dataHooks={layoutModuleData.dataHooks} />\n\t\t\t\t\t<Permissions permissions={layoutModuleData.permissions} />\n\t\t\t\t\t<PermissionHooks permissionHooks={layoutModuleData.permissionSelectorHooks} />\n\t\t\t\t</>\n\t\t\t);\n\t\t}\n\n\t\tWithLayout.displayName = `withLayout(${displayName})`;\n\n\t\treturn WithLayout;\n\t};\n}\n"],"names":[],"mappings":";;;;;;;;AAUA,MAAM,CAAA,GAAI,MAAM,4BAA4B,CAAA,CAAA;AAE5C,MAAM,uBAAgD,GAAA;AAAA,EACrD,WAAW,EAAC;AAAA,EACZ,yBAAyB,EAAC;AAAA,EAC1B,aAAa,EAAC;AAAA,EACd,aAAa,EAAC;AAAA,EACd,WAAW,EAAC;AAAA,EACZ,eAAe,EAAC;AAAA,EAChB,QAAQ,EAAC;AACV,CAAA,C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,CAAA;AAG5C,EAAA,OAAO,mBAAmB,OAA6B,EAAA;AACtD,IAAA,MAAM,WAAc,GAAA,OAAA,CAAQ,WAAe,IAAA,OAAA,CAAQ,IAAQ,IAAA,EAAA,CAAA;AAE3D,IAAA,SAAA,UAAA,CAAoB,KAAgC,EAAA;AACnD,MAAA,iFAEG,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AAAA,QAAW,GAAA,gBAAA;AAAA,OAAA,kBACV,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA;AAAA,QAAY,GAAA,KAAA;AAAA,QAAO,MAAQ,EAAA,gBAAA;AAAA,OAAkB,CAC/C,mBACC,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA;AAAA,QAAU,WAAW,gBAAiB,CAAA,SAAA;AAAA,OAAW,mBACjD,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA;AAAA,QAAY,aAAa,gBAAiB,CAAA,WAAA;AAAA,OAAa,mBACvD,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA;AAAA,QAAgB,iBAAiB,gBAAiB,CAAA,uBAAA;AAAA,OAAyB,CAC7E,CAAA,CAAA;AAAA,KAEF;AAEA,IAAA,UAAA,CAAW,cAAc,CAAc,WAAA,EAAA,WAAA,CAAA,CAAA,CAAA,CAAA;AAEvC,IAAO,OAAA,UAAA,CAAA;AAAA,GACR,CAAA;AACD;;;;"}
1
+ {"version":3,"file":"withLayout.js","sources":["../../../src/layout/withLayout.tsx"],"sourcesContent":["import type {Hoc, ImperiumClient} from '@imperium/client';\nimport debug from 'debug';\nimport type {ComponentType} from 'react';\nimport {DataHooks} from '../datahooks/DataHooks';\nimport {PermissionHooks} from '../datahooks/PermissionHooks';\nimport {Permissions} from '../datahooks/Permissions';\nimport {isImperiumLayoutClientModule} from '../types';\nimport {Layout} from './components/Layout';\nimport type {LayoutData} from './types';\n\nconst d = debug('imperium.layout.withLayout');\n\nconst initialLayoutModuleData: Required<LayoutData> = {\n\tdataHooks: [],\n\tpermissionSelectorHooks: [],\n\tpermissions: [],\n\tprimaryMenu: [],\n\tstatusbar: [],\n\tsecondaryMenu: [],\n\tfooter: [],\n};\n\nexport function withLayout(client: ImperiumClient): Hoc {\n\tconst layoutModuleData = client.modules.reduce((memo, module) => {\n\t\tif (isImperiumLayoutClientModule(module)) {\n\t\t\treturn {\n\t\t\t\tdataHooks: [...memo.dataHooks, ...(module.layout.dataHooks || [])],\n\t\t\t\tpermissionSelectorHooks: [...memo.permissionSelectorHooks, ...(module.layout.permissionSelectorHooks || [])],\n\t\t\t\tpermissions: [...memo.permissions, ...(module.layout.permissions || [])],\n\t\t\t\tprimaryMenu: [...memo.primaryMenu, ...(module.layout.primaryMenu || [])],\n\t\t\t\tstatusbar: [...memo.statusbar, ...(module.layout.statusbar || [])],\n\t\t\t\tsecondaryMenu: [...memo.secondaryMenu, ...(module.layout.secondaryMenu || [])],\n\t\t\t\tfooter: [...memo.footer, ...(module.layout.footer || [])],\n\t\t\t} as Required<LayoutData>;\n\t\t}\n\t\treturn memo;\n\t}, initialLayoutModuleData);\n\td('Layout items processed', layoutModuleData);\n\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\treturn function layoutHoc(Wrapped: ComponentType<any>) {\n\t\tconst displayName = Wrapped.displayName || Wrapped.name || '';\n\n\t\tfunction WithLayout(props: Record<string, unknown>) {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<Layout {...layoutModuleData}>\n\t\t\t\t\t\t<Wrapped {...props} layout={layoutModuleData} />\n\t\t\t\t\t</Layout>\n\t\t\t\t\t<DataHooks dataHooks={layoutModuleData.dataHooks} />\n\t\t\t\t\t<Permissions permissions={layoutModuleData.permissions} />\n\t\t\t\t\t<PermissionHooks permissionHooks={layoutModuleData.permissionSelectorHooks} />\n\t\t\t\t</>\n\t\t\t);\n\t\t}\n\n\t\tWithLayout.displayName = `withLayout(${displayName})`;\n\n\t\treturn WithLayout;\n\t};\n}\n"],"names":[],"mappings":";;;;;;;;AAUA,MAAM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CAAO,MAAU,IAAA,EAAG,CAAA;AAAA,OACzD,CAAA;AAAA,KACD;AACA,IAAO,OAAA,IAAA,CAAA;AAAA,KACL,uBAAuB,CAAA,CAAA;AAC1B,EAAA,CAAA,CAAE,0BAA0B,gBAAgB,CAAA,CAAA;AAG5C,EAAA,OAAO,mBAAmB,OAA6B,EAAA;AACtD,IAAA,MAAM,WAAc,GAAA,OAAA,CAAQ,WAAe,IAAA,OAAA,CAAQ,IAAQ,IAAA,EAAA,CAAA;AAE3D,IAAA,SAAA,UAAA,CAAoB,KAAgC,EAAA;AACnD,MAAA,iFAEG,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AAAA,QAAW,GAAA,gBAAA;AAAA,OAAA,kBACV,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA;AAAA,QAAY,GAAA,KAAA;AAAA,QAAO,MAAQ,EAAA,gBAAA;AAAA,OAAkB,CAC/C,mBACC,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA;AAAA,QAAU,WAAW,gBAAiB,CAAA,SAAA;AAAA,OAAW,mBACjD,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA;AAAA,QAAY,aAAa,gBAAiB,CAAA,WAAA;AAAA,OAAa,mBACvD,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA;AAAA,QAAgB,iBAAiB,gBAAiB,CAAA,uBAAA;AAAA,OAAyB,CAC7E,CAAA,CAAA;AAAA,KAEF;AAEA,IAAA,UAAA,CAAW,cAAc,CAAc,WAAA,EAAA,WAAA,CAAA,CAAA,CAAA,CAAA;AAEvC,IAAO,OAAA,UAAA,CAAA;AAAA,GACR,CAAA;AACD;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../src/types.ts"],"sourcesContent":["import type {ImperiumClientModule} from '@imperium/client';\nimport type {Location} from 'history';\nimport type {LayoutData} from './layout/types';\n\nexport type State = Record<string, any>;\n/**\n * A hook that selects from redux state.\n */\nexport type StateSelectorHook = () => State;\n\nexport type PermissionResults = Record<string, boolean>;\n\nexport type PermissionSelectorHook = (data: Data) => PermissionResults;\nexport type PermissionSelector = string[];\n\n/**\n * The visibility query can either be a mingo query or a function that returns a boolean. The data is an object with the router path merged with any state selector hook data.\n */\nexport type VisibilityQueryFn = (data: Data) => boolean;\n\nexport interface Data extends Record<string, unknown> {\n\tloc: Location;\n\troute: {\n\t\tpath: string[];\n\t\thash: string;\n\t\tsearch: Record<string, any>;\n\t};\n\tstate: State;\n\tactive: boolean;\n\tpermissions: PermissionResults;\n\tid?: string;\n}\n\nexport interface ImperiumLayoutClientModule extends ImperiumClientModule {\n\tlayout: LayoutData;\n}\n\nexport function isImperiumLayoutClientModule(module: ImperiumClientModule): module is ImperiumLayoutClientModule {\n\tconst layoutModule = module as ImperiumLayoutClientModule;\n\treturn layoutModule.layout !== undefined;\n}\n"],"names":[],"mappings":"AAqCO,SAAA,4BAAA,CAAsC,MAAoE,EAAA;AAChH,EAAA,MAAM,YAAe,GAAA,MAAA,CAAA;AACrB,EAAA,OAAO,aAAa,MAAW,KAAA,KAAA,CAAA,CAAA;AAChC;;;;"}
1
+ {"version":3,"file":"types.js","sources":["../../src/types.ts"],"sourcesContent":["import type {ImperiumClientModule} from '@imperium/client';\nimport type {Location} from 'history';\nimport type {LayoutData} from './layout/types';\n\nexport type State = Record<string, any>;\n/**\n * A hook that selects from redux state.\n */\nexport type StateSelectorHook = () => State;\n\nexport type PermissionResults = Record<string, boolean>;\n\nexport type PermissionSelectorHook = (data: Data) => PermissionResults;\nexport type PermissionSelector = string[];\n\n/**\n * The visibility query can either be a mingo query or a function that returns a boolean. The data is an object with the router path merged with any state selector hook data.\n */\nexport type VisibilityQueryFn = (data: Data) => boolean;\n\nexport interface Data extends Record<string, unknown> {\n\tloc: Location;\n\troute: {\n\t\tpath: string[];\n\t\thash: string;\n\t\tsearch: Record<string, any>;\n\t};\n\tstate: State;\n\tactive: boolean;\n\tpermissions: PermissionResults;\n\tid?: string;\n}\n\nexport interface ImperiumLayoutClientModule extends ImperiumClientModule {\n\tlayout: LayoutData;\n}\n\nexport function isImperiumLayoutClientModule(module: ImperiumClientModule): module is ImperiumLayoutClientModule {\n\tconst layoutModule = module as Partial<ImperiumLayoutClientModule>;\n\treturn layoutModule.layout !== undefined;\n}\n"],"names":[],"mappings":"AAqCO,SAAA,4BAAA,CAAsC,MAAoE,EAAA;AAChH,EAAA,MAAM,YAAe,GAAA,MAAA,CAAA;AACrB,EAAA,OAAO,aAAa,MAAW,KAAA,KAAA,CAAA,CAAA;AAChC;;;;"}
package/dist/stats.html CHANGED
@@ -2669,7 +2669,7 @@ var drawChart = (function (exports) {
2669
2669
  </script>
2670
2670
  <script>
2671
2671
  /*<!--*/
2672
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src/index.ts","uid":"82cf-1"}]},{"name":"state.js","children":[{"name":"src/state.ts","uid":"82cf-3"}]},{"name":"content/dividerSidebarItem.js","children":[{"name":"src/content/dividerSidebarItem.ts","uid":"82cf-5"}]},{"name":"layout/withLayout.js","children":[{"name":"src/layout/withLayout.tsx","uid":"82cf-7"}]},{"name":"content/createPages.js","children":[{"name":"src/content/createPages.tsx","uid":"82cf-9"}]},{"name":"types.js","children":[{"name":"src/types.ts","uid":"82cf-11"}]},{"name":"content/types.js","children":[{"name":"src/content/types.ts","uid":"82cf-13"}]},{"name":"datahooks/DataHooks.js","children":[{"name":"src/datahooks/DataHooks.tsx","uid":"82cf-15"}]},{"name":"datahooks/Permissions.js","children":[{"name":"src/datahooks/Permissions.tsx","uid":"82cf-17"}]},{"name":"datahooks/PermissionHooks.js","children":[{"name":"src/datahooks/PermissionHooks.tsx","uid":"82cf-19"}]},{"name":"layout/components/Layout.js","children":[{"name":"src/layout/components/Layout.tsx","uid":"82cf-21"}]},{"name":"content/components/ContentComponent.js","children":[{"name":"src/content/components/ContentComponent.tsx","uid":"82cf-23"}]},{"name":"datahooks/ExecutePermissionHook.js","children":[{"name":"src/datahooks/ExecutePermissionHook.tsx","uid":"82cf-25"}]},{"name":"datahooks/ExecuteDataHook.js","children":[{"name":"src/datahooks/ExecuteDataHook.tsx","uid":"82cf-27"}]},{"name":"utils.js","children":[{"name":"src/utils.ts","uid":"82cf-29"}]},{"name":"layout/moveItems.js","children":[{"name":"src/layout/moveItems.ts","uid":"82cf-31"}]},{"name":"layout/components/styles.module.css.js","children":[{"name":"src/layout/components/styles.module.css","uid":"82cf-33"}]},{"name":"content/components/styles.module.css.js","children":[{"name":"src/content/components/styles.module.css","uid":"82cf-35"}]},{"name":"content/hooks/useBuildContentData.js","children":[{"name":"src/content/hooks/useBuildContentData.ts","uid":"82cf-37"}]},{"name":"content/components/Header.js","children":[{"name":"src/content/components/Header.tsx","uid":"82cf-39"}]},{"name":"content/components/SidebarItemWrapper.js","children":[{"name":"src/content/components/SidebarItemWrapper.tsx","uid":"82cf-41"}]},{"name":"layout/components/LayoutItemBar.js","children":[{"name":"src/layout/components/LayoutItemBar.tsx","uid":"82cf-43"}]},{"name":"layout/components/SecondaryMenuToggleItem.js","children":[{"name":"src/layout/components/SecondaryMenuToggleItem.tsx","uid":"82cf-45"}]},{"name":"_virtual/index.js","children":[{"name":"\u0000/home/artemis/Github/imperium/node_modules/react-is/index.js?commonjs-module","uid":"82cf-47"}]},{"name":"layout/types.js","children":[{"name":"src/layout/types.ts","uid":"82cf-49"}]},{"name":"hooks/useBuildData.js","children":[{"name":"src/hooks/useBuildData.ts","uid":"82cf-51"}]},{"name":"layout/utils.js","children":[{"name":"src/layout/utils.tsx","uid":"82cf-53"}]},{"name":"content/components/ActionSidebarItemComponent.js","children":[{"name":"src/content/components/ActionSidebarItemComponent.tsx","uid":"82cf-55"}]},{"name":"content/components/CustomSidebarItemComponent.js","children":[{"name":"src/content/components/CustomSidebarItemComponent.tsx","uid":"82cf-57"}]},{"name":"content/components/ActionFormSidebarItemComponent.js","children":[{"name":"src/content/components/ActionFormSidebarItemComponent.tsx","uid":"82cf-59"}]},{"name":"content/components/PlainSidebarItem.js","children":[{"name":"src/content/components/PlainSidebarItem.tsx","uid":"82cf-61"}]},{"name":"layout/components/LayoutItemWrapper.js","children":[{"name":"src/layout/components/LayoutItemWrapper.tsx","uid":"82cf-63"}]},{"name":"_virtual/react-is.production.min.js","children":[{"name":"\u0000/home/artemis/Github/imperium/node_modules/react-is/cjs/react-is.production.min.js?commonjs-exports","uid":"82cf-65"}]},{"name":"_virtual/react-is.development.js","children":[{"name":"\u0000/home/artemis/Github/imperium/node_modules/react-is/cjs/react-is.development.js?commonjs-exports","uid":"82cf-67"}]},{"name":"commonItems.js","children":[{"name":"src/commonItems.ts","uid":"82cf-69"}]},{"name":"hooks/useIsActiveRoute.js","children":[{"name":"src/hooks/useIsActiveRoute.ts","uid":"82cf-71"}]},{"name":"hooks/useSelectPermission.js","children":[{"name":"src/hooks/useSelectPermission.ts","uid":"82cf-73"}]},{"name":"hooks/useSelectState.js","children":[{"name":"src/hooks/useSelectState.ts","uid":"82cf-75"}]},{"name":"content/utils.js","children":[{"name":"src/content/utils.tsx","uid":"82cf-77"}]},{"name":"content/components/ActionForm.js","children":[{"name":"src/content/components/ActionForm.tsx","uid":"82cf-79"}]},{"name":"layout/components/CustomLayoutItemComponent.js","children":[{"name":"src/layout/components/CustomLayoutItemComponent.tsx","uid":"82cf-81"}]},{"name":"layout/components/DropdownItem.js","children":[{"name":"src/layout/components/DropdownItem.tsx","uid":"82cf-83"}]},{"name":"layout/components/MenuItem.js","children":[{"name":"src/layout/components/MenuItem.tsx","uid":"82cf-85"}]},{"name":"layout/components/PlainItem.js","children":[{"name":"src/layout/components/PlainItem.tsx","uid":"82cf-87"}]},{"name":"external/@loadable/component/dist/loadable.esm.js","children":[{"name":"home/artemis/Github/imperium/node_modules/@loadable/component/dist/loadable.esm.js","uid":"82cf-89"}]},{"name":"external/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","children":[{"name":"home/artemis/Github/imperium/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","uid":"82cf-91"}]},{"name":"external/@babel/runtime/helpers/esm/assertThisInitialized.js","children":[{"name":"home/artemis/Github/imperium/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","uid":"82cf-93"}]},{"name":"external/@babel/runtime/helpers/esm/extends.js","children":[{"name":"home/artemis/Github/imperium/node_modules/@babel/runtime/helpers/esm/extends.js","uid":"82cf-95"}]},{"name":"external/@babel/runtime/helpers/esm/inheritsLoose.js","children":[{"name":"home/artemis/Github/imperium/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","uid":"82cf-97"}]},{"name":"external/react-is/index.js","children":[{"name":"home/artemis/Github/imperium/node_modules/react-is/index.js","uid":"82cf-99"}]},{"name":"external/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","children":[{"name":"home/artemis/Github/imperium/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","uid":"82cf-101"}]},{"name":"external/@babel/runtime/helpers/esm/setPrototypeOf.js","children":[{"name":"home/artemis/Github/imperium/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","uid":"82cf-103"}]},{"name":"external/react-is/cjs/react-is.production.min.js","children":[{"name":"home/artemis/Github/imperium/node_modules/react-is/cjs/react-is.production.min.js","uid":"82cf-105"}]},{"name":"external/react-is/cjs/react-is.development.js","children":[{"name":"home/artemis/Github/imperium/node_modules/react-is/cjs/react-is.development.js","uid":"82cf-107"}]},{"name":"external/style-inject/dist/style-inject.es.js","children":[{"name":"home/artemis/Github/imperium/node_modules/style-inject/dist/style-inject.es.js","uid":"82cf-109"}]}],"isRoot":true},"nodeParts":{"82cf-1":{"renderedLength":144,"gzipLength":131,"brotliLength":106,"mainUid":"82cf-0"},"82cf-3":{"renderedLength":591,"gzipLength":268,"brotliLength":243,"mainUid":"82cf-2"},"82cf-5":{"renderedLength":59,"gzipLength":73,"brotliLength":63,"mainUid":"82cf-4"},"82cf-7":{"renderedLength":1955,"gzipLength":562,"brotliLength":488,"mainUid":"82cf-6"},"82cf-9":{"renderedLength":1660,"gzipLength":586,"brotliLength":508,"mainUid":"82cf-8"},"82cf-11":{"renderedLength":121,"gzipLength":111,"brotliLength":90,"mainUid":"82cf-10"},"82cf-13":{"renderedLength":388,"gzipLength":167,"brotliLength":111,"mainUid":"82cf-12"},"82cf-15":{"renderedLength":1058,"gzipLength":390,"brotliLength":330,"mainUid":"82cf-14"},"82cf-17":{"renderedLength":864,"gzipLength":366,"brotliLength":318,"mainUid":"82cf-16"},"82cf-19":{"renderedLength":339,"gzipLength":202,"brotliLength":164,"mainUid":"82cf-18"},"82cf-21":{"renderedLength":2512,"gzipLength":751,"brotliLength":636,"mainUid":"82cf-20"},"82cf-23":{"renderedLength":3584,"gzipLength":934,"brotliLength":811,"mainUid":"82cf-22"},"82cf-25":{"renderedLength":345,"gzipLength":207,"brotliLength":172,"mainUid":"82cf-24"},"82cf-27":{"renderedLength":123,"gzipLength":111,"brotliLength":93,"mainUid":"82cf-26"},"82cf-29":{"renderedLength":145,"gzipLength":117,"brotliLength":116,"mainUid":"82cf-28"},"82cf-31":{"renderedLength":1401,"gzipLength":376,"brotliLength":347,"mainUid":"82cf-30"},"82cf-33":{"renderedLength":3176,"gzipLength":928,"brotliLength":762,"mainUid":"82cf-32"},"82cf-35":{"renderedLength":2119,"gzipLength":680,"brotliLength":565,"mainUid":"82cf-34"},"82cf-37":{"renderedLength":257,"gzipLength":158,"brotliLength":122,"mainUid":"82cf-36"},"82cf-39":{"renderedLength":1042,"gzipLength":377,"brotliLength":323,"mainUid":"82cf-38"},"82cf-41":{"renderedLength":1189,"gzipLength":399,"brotliLength":314,"mainUid":"82cf-40"},"82cf-43":{"renderedLength":726,"gzipLength":294,"brotliLength":252,"mainUid":"82cf-42"},"82cf-45":{"renderedLength":356,"gzipLength":233,"brotliLength":176,"mainUid":"82cf-44"},"82cf-47":{"renderedLength":28,"gzipLength":48,"brotliLength":32,"mainUid":"82cf-46"},"82cf-49":{"renderedLength":191,"gzipLength":113,"brotliLength":89,"mainUid":"82cf-48"},"82cf-51":{"renderedLength":799,"gzipLength":370,"brotliLength":330,"mainUid":"82cf-50"},"82cf-53":{"renderedLength":915,"gzipLength":393,"brotliLength":328,"mainUid":"82cf-52"},"82cf-55":{"renderedLength":343,"gzipLength":239,"brotliLength":181,"mainUid":"82cf-54"},"82cf-57":{"renderedLength":83,"gzipLength":97,"brotliLength":66,"mainUid":"82cf-56"},"82cf-59":{"renderedLength":644,"gzipLength":341,"brotliLength":295,"mainUid":"82cf-58"},"82cf-61":{"renderedLength":325,"gzipLength":230,"brotliLength":183,"mainUid":"82cf-60"},"82cf-63":{"renderedLength":1503,"gzipLength":487,"brotliLength":399,"mainUid":"82cf-62"},"82cf-65":{"renderedLength":32,"gzipLength":52,"brotliLength":32,"mainUid":"82cf-64"},"82cf-67":{"renderedLength":29,"gzipLength":49,"brotliLength":33,"mainUid":"82cf-66"},"82cf-69":{"renderedLength":203,"gzipLength":136,"brotliLength":97,"mainUid":"82cf-68"},"82cf-71":{"renderedLength":514,"gzipLength":227,"brotliLength":187,"mainUid":"82cf-70"},"82cf-73":{"renderedLength":294,"gzipLength":155,"brotliLength":114,"mainUid":"82cf-72"},"82cf-75":{"renderedLength":326,"gzipLength":176,"brotliLength":141,"mainUid":"82cf-74"},"82cf-77":{"renderedLength":628,"gzipLength":259,"brotliLength":219,"mainUid":"82cf-76"},"82cf-79":{"renderedLength":1667,"gzipLength":624,"brotliLength":519,"mainUid":"82cf-78"},"82cf-81":{"renderedLength":82,"gzipLength":96,"brotliLength":66,"mainUid":"82cf-80"},"82cf-83":{"renderedLength":1179,"gzipLength":450,"brotliLength":362,"mainUid":"82cf-82"},"82cf-85":{"renderedLength":252,"gzipLength":157,"brotliLength":116,"mainUid":"82cf-84"},"82cf-87":{"renderedLength":379,"gzipLength":264,"brotliLength":224,"mainUid":"82cf-86"},"82cf-89":{"renderedLength":13044,"gzipLength":3512,"brotliLength":3054,"mainUid":"82cf-88"},"82cf-91":{"renderedLength":333,"gzipLength":220,"brotliLength":167,"mainUid":"82cf-90"},"82cf-93":{"renderedLength":176,"gzipLength":151,"brotliLength":124,"mainUid":"82cf-92"},"82cf-95":{"renderedLength":401,"gzipLength":235,"brotliLength":184,"mainUid":"82cf-94"},"82cf-97":{"renderedLength":195,"gzipLength":135,"brotliLength":104,"mainUid":"82cf-96"},"82cf-99":{"renderedLength":140,"gzipLength":117,"brotliLength":93,"mainUid":"82cf-98"},"82cf-101":{"renderedLength":2739,"gzipLength":918,"brotliLength":760,"mainUid":"82cf-100"},"82cf-103":{"renderedLength":214,"gzipLength":122,"brotliLength":108,"mainUid":"82cf-102"},"82cf-105":{"renderedLength":2961,"gzipLength":875,"brotliLength":711,"mainUid":"82cf-104"},"82cf-107":{"renderedLength":7286,"gzipLength":1831,"brotliLength":1528,"mainUid":"82cf-106"},"82cf-109":{"renderedLength":636,"gzipLength":318,"brotliLength":242,"mainUid":"82cf-108"}},"nodeMetas":{"82cf-0":{"id":"/src/index.ts","moduleParts":{"index.js":"82cf-1"},"imported":[{"uid":"82cf-6"},{"uid":"82cf-2"},{"uid":"82cf-8"},{"uid":"82cf-4"}],"importedBy":[],"isEntry":true},"82cf-2":{"id":"/src/state.ts","moduleParts":{"state.js":"82cf-3"},"imported":[{"uid":"82cf-112"},{"uid":"82cf-113"}],"importedBy":[{"uid":"82cf-0"},{"uid":"82cf-16"},{"uid":"82cf-22"},{"uid":"82cf-24"},{"uid":"82cf-50"}]},"82cf-4":{"id":"/src/content/dividerSidebarItem.ts","moduleParts":{"content/dividerSidebarItem.js":"82cf-5"},"imported":[],"importedBy":[{"uid":"82cf-0"}]},"82cf-6":{"id":"/src/layout/withLayout.tsx","moduleParts":{"layout/withLayout.js":"82cf-7"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-111"},{"uid":"82cf-14"},{"uid":"82cf-18"},{"uid":"82cf-16"},{"uid":"82cf-10"},{"uid":"82cf-20"}],"importedBy":[{"uid":"82cf-0"}]},"82cf-8":{"id":"/src/content/createPages.tsx","moduleParts":{"content/createPages.js":"82cf-9"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-88"},{"uid":"82cf-22"},{"uid":"82cf-12"}],"importedBy":[{"uid":"82cf-0"}]},"82cf-10":{"id":"/src/types.ts","moduleParts":{"types.js":"82cf-11"},"imported":[],"importedBy":[{"uid":"82cf-6"}]},"82cf-12":{"id":"/src/content/types.ts","moduleParts":{"content/types.js":"82cf-13"},"imported":[],"importedBy":[{"uid":"82cf-8"},{"uid":"82cf-38"},{"uid":"82cf-40"}]},"82cf-14":{"id":"/src/datahooks/DataHooks.tsx","moduleParts":{"datahooks/DataHooks.js":"82cf-15"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-111"},{"uid":"82cf-114"},{"uid":"82cf-26"}],"importedBy":[{"uid":"82cf-6"},{"uid":"82cf-22"}]},"82cf-16":{"id":"/src/datahooks/Permissions.tsx","moduleParts":{"datahooks/Permissions.js":"82cf-17"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-115"},{"uid":"82cf-111"},{"uid":"82cf-116"},{"uid":"82cf-2"}],"importedBy":[{"uid":"82cf-6"}]},"82cf-18":{"id":"/src/datahooks/PermissionHooks.tsx","moduleParts":{"datahooks/PermissionHooks.js":"82cf-19"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-111"},{"uid":"82cf-24"}],"importedBy":[{"uid":"82cf-6"}]},"82cf-20":{"id":"/src/layout/components/Layout.tsx","moduleParts":{"layout/components/Layout.js":"82cf-21"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-111"},{"uid":"82cf-117"},{"uid":"82cf-118"},{"uid":"82cf-30"},{"uid":"82cf-42"},{"uid":"82cf-44"},{"uid":"82cf-32"}],"importedBy":[{"uid":"82cf-6"}]},"82cf-22":{"id":"/src/content/components/ContentComponent.tsx","moduleParts":{"content/components/ContentComponent.js":"82cf-23"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-111"},{"uid":"82cf-119"},{"uid":"82cf-116"},{"uid":"82cf-118"},{"uid":"82cf-117"},{"uid":"82cf-14"},{"uid":"82cf-2"},{"uid":"82cf-28"},{"uid":"82cf-36"},{"uid":"82cf-38"},{"uid":"82cf-40"},{"uid":"82cf-34"}],"importedBy":[{"uid":"82cf-8"}]},"82cf-24":{"id":"/src/datahooks/ExecutePermissionHook.tsx","moduleParts":{"datahooks/ExecutePermissionHook.js":"82cf-25"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-116"},{"uid":"82cf-2"}],"importedBy":[{"uid":"82cf-18"}]},"82cf-26":{"id":"/src/datahooks/ExecuteDataHook.tsx","moduleParts":{"datahooks/ExecuteDataHook.js":"82cf-27"},"imported":[{"uid":"82cf-110"}],"importedBy":[{"uid":"82cf-14"}]},"82cf-28":{"id":"/src/utils.ts","moduleParts":{"utils.js":"82cf-29"},"imported":[{"uid":"82cf-119"}],"importedBy":[{"uid":"82cf-22"},{"uid":"82cf-42"},{"uid":"82cf-62"}]},"82cf-30":{"id":"/src/layout/moveItems.ts","moduleParts":{"layout/moveItems.js":"82cf-31"},"imported":[{"uid":"82cf-111"},{"uid":"82cf-119"},{"uid":"82cf-48"}],"importedBy":[{"uid":"82cf-20"}]},"82cf-32":{"id":"/src/layout/components/styles.module.css","moduleParts":{"layout/components/styles.module.css.js":"82cf-33"},"imported":[{"uid":"82cf-108"}],"importedBy":[{"uid":"82cf-20"},{"uid":"82cf-44"},{"uid":"82cf-82"}]},"82cf-34":{"id":"/src/content/components/styles.module.css","moduleParts":{"content/components/styles.module.css.js":"82cf-35"},"imported":[{"uid":"82cf-108"}],"importedBy":[{"uid":"82cf-22"},{"uid":"82cf-38"}]},"82cf-36":{"id":"/src/content/hooks/useBuildContentData.ts","moduleParts":{"content/hooks/useBuildContentData.js":"82cf-37"},"imported":[{"uid":"82cf-50"}],"importedBy":[{"uid":"82cf-22"},{"uid":"82cf-40"}]},"82cf-38":{"id":"/src/content/components/Header.tsx","moduleParts":{"content/components/Header.js":"82cf-39"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-111"},{"uid":"82cf-118"},{"uid":"82cf-12"},{"uid":"82cf-34"}],"importedBy":[{"uid":"82cf-22"}]},"82cf-40":{"id":"/src/content/components/SidebarItemWrapper.tsx","moduleParts":{"content/components/SidebarItemWrapper.js":"82cf-41"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-111"},{"uid":"82cf-124"},{"uid":"82cf-118"},{"uid":"82cf-36"},{"uid":"82cf-12"},{"uid":"82cf-58"},{"uid":"82cf-54"},{"uid":"82cf-56"},{"uid":"82cf-60"}],"importedBy":[{"uid":"82cf-22"}]},"82cf-42":{"id":"/src/layout/components/LayoutItemBar.tsx","moduleParts":{"layout/components/LayoutItemBar.js":"82cf-43"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-111"},{"uid":"82cf-118"},{"uid":"82cf-28"},{"uid":"82cf-52"},{"uid":"82cf-62"}],"importedBy":[{"uid":"82cf-20"}]},"82cf-44":{"id":"/src/layout/components/SecondaryMenuToggleItem.tsx","moduleParts":{"layout/components/SecondaryMenuToggleItem.js":"82cf-45"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-118"},{"uid":"82cf-32"}],"importedBy":[{"uid":"82cf-20"}]},"82cf-46":{"id":"\u0000/home/artemis/Github/imperium/node_modules/react-is/index.js?commonjs-module","moduleParts":{"_virtual/index.js":"82cf-47"},"imported":[],"importedBy":[{"uid":"82cf-98"}]},"82cf-48":{"id":"/src/layout/types.ts","moduleParts":{"layout/types.js":"82cf-49"},"imported":[],"importedBy":[{"uid":"82cf-30"},{"uid":"82cf-62"}]},"82cf-50":{"id":"/src/hooks/useBuildData.ts","moduleParts":{"hooks/useBuildData.js":"82cf-51"},"imported":[{"uid":"82cf-115"},{"uid":"82cf-111"},{"uid":"82cf-119"},{"uid":"82cf-114"},{"uid":"82cf-2"},{"uid":"82cf-70"},{"uid":"82cf-72"},{"uid":"82cf-74"}],"importedBy":[{"uid":"82cf-36"},{"uid":"82cf-62"}]},"82cf-52":{"id":"/src/layout/utils.tsx","moduleParts":{"layout/utils.js":"82cf-53"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-114"},{"uid":"82cf-118"},{"uid":"82cf-68"}],"importedBy":[{"uid":"82cf-42"},{"uid":"82cf-82"},{"uid":"82cf-86"}]},"82cf-54":{"id":"/src/content/components/ActionSidebarItemComponent.tsx","moduleParts":{"content/components/ActionSidebarItemComponent.js":"82cf-55"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-118"},{"uid":"82cf-76"}],"importedBy":[{"uid":"82cf-40"}]},"82cf-56":{"id":"/src/content/components/CustomSidebarItemComponent.tsx","moduleParts":{"content/components/CustomSidebarItemComponent.js":"82cf-57"},"imported":[{"uid":"82cf-110"}],"importedBy":[{"uid":"82cf-40"}]},"82cf-58":{"id":"/src/content/components/ActionFormSidebarItemComponent.tsx","moduleParts":{"content/components/ActionFormSidebarItemComponent.js":"82cf-59"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-111"},{"uid":"82cf-118"},{"uid":"82cf-76"},{"uid":"82cf-78"}],"importedBy":[{"uid":"82cf-40"}]},"82cf-60":{"id":"/src/content/components/PlainSidebarItem.tsx","moduleParts":{"content/components/PlainSidebarItem.js":"82cf-61"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-114"},{"uid":"82cf-118"},{"uid":"82cf-76"}],"importedBy":[{"uid":"82cf-40"}]},"82cf-62":{"id":"/src/layout/components/LayoutItemWrapper.tsx","moduleParts":{"layout/components/LayoutItemWrapper.js":"82cf-63"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-111"},{"uid":"82cf-124"},{"uid":"82cf-118"},{"uid":"82cf-50"},{"uid":"82cf-28"},{"uid":"82cf-48"},{"uid":"82cf-80"},{"uid":"82cf-82"},{"uid":"82cf-84"},{"uid":"82cf-86"}],"importedBy":[{"uid":"82cf-42"}]},"82cf-64":{"id":"\u0000/home/artemis/Github/imperium/node_modules/react-is/cjs/react-is.production.min.js?commonjs-exports","moduleParts":{"_virtual/react-is.production.min.js":"82cf-65"},"imported":[],"importedBy":[{"uid":"82cf-104"}]},"82cf-66":{"id":"\u0000/home/artemis/Github/imperium/node_modules/react-is/cjs/react-is.development.js?commonjs-exports","moduleParts":{"_virtual/react-is.development.js":"82cf-67"},"imported":[],"importedBy":[{"uid":"82cf-106"}]},"82cf-68":{"id":"/src/commonItems.ts","moduleParts":{"commonItems.js":"82cf-69"},"imported":[],"importedBy":[{"uid":"82cf-52"},{"uid":"82cf-70"}]},"82cf-70":{"id":"/src/hooks/useIsActiveRoute.ts","moduleParts":{"hooks/useIsActiveRoute.js":"82cf-71"},"imported":[{"uid":"82cf-125"},{"uid":"82cf-68"}],"importedBy":[{"uid":"82cf-50"}]},"82cf-72":{"id":"/src/hooks/useSelectPermission.ts","moduleParts":{"hooks/useSelectPermission.js":"82cf-73"},"imported":[{"uid":"82cf-119"}],"importedBy":[{"uid":"82cf-50"}]},"82cf-74":{"id":"/src/hooks/useSelectState.ts","moduleParts":{"hooks/useSelectState.js":"82cf-75"},"imported":[{"uid":"82cf-119"}],"importedBy":[{"uid":"82cf-50"}]},"82cf-76":{"id":"/src/content/utils.tsx","moduleParts":{"content/utils.js":"82cf-77"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-118"}],"importedBy":[{"uid":"82cf-58"},{"uid":"82cf-54"},{"uid":"82cf-60"}]},"82cf-78":{"id":"/src/content/components/ActionForm.tsx","moduleParts":{"content/components/ActionForm.js":"82cf-79"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-126"},{"uid":"82cf-111"},{"uid":"82cf-118"}],"importedBy":[{"uid":"82cf-58"}]},"82cf-80":{"id":"/src/layout/components/CustomLayoutItemComponent.tsx","moduleParts":{"layout/components/CustomLayoutItemComponent.js":"82cf-81"},"imported":[{"uid":"82cf-110"}],"importedBy":[{"uid":"82cf-62"}]},"82cf-82":{"id":"/src/layout/components/DropdownItem.tsx","moduleParts":{"layout/components/DropdownItem.js":"82cf-83"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-111"},{"uid":"82cf-118"},{"uid":"82cf-52"},{"uid":"82cf-32"}],"importedBy":[{"uid":"82cf-62"}]},"82cf-84":{"id":"/src/layout/components/MenuItem.tsx","moduleParts":{"layout/components/MenuItem.js":"82cf-85"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-118"}],"importedBy":[{"uid":"82cf-62"}]},"82cf-86":{"id":"/src/layout/components/PlainItem.tsx","moduleParts":{"layout/components/PlainItem.js":"82cf-87"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-117"},{"uid":"82cf-118"},{"uid":"82cf-52"}],"importedBy":[{"uid":"82cf-62"}]},"82cf-88":{"id":"/home/artemis/Github/imperium/node_modules/@loadable/component/dist/loadable.esm.js","moduleParts":{"external/@loadable/component/dist/loadable.esm.js":"82cf-89"},"imported":[{"uid":"82cf-110"},{"uid":"82cf-90"},{"uid":"82cf-94"},{"uid":"82cf-92"},{"uid":"82cf-96"},{"uid":"82cf-98"},{"uid":"82cf-100"}],"importedBy":[{"uid":"82cf-8"}]},"82cf-90":{"id":"/home/artemis/Github/imperium/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","moduleParts":{"external/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js":"82cf-91"},"imported":[],"importedBy":[{"uid":"82cf-88"}]},"82cf-92":{"id":"/home/artemis/Github/imperium/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","moduleParts":{"external/@babel/runtime/helpers/esm/assertThisInitialized.js":"82cf-93"},"imported":[],"importedBy":[{"uid":"82cf-88"}]},"82cf-94":{"id":"/home/artemis/Github/imperium/node_modules/@babel/runtime/helpers/esm/extends.js","moduleParts":{"external/@babel/runtime/helpers/esm/extends.js":"82cf-95"},"imported":[],"importedBy":[{"uid":"82cf-88"}]},"82cf-96":{"id":"/home/artemis/Github/imperium/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","moduleParts":{"external/@babel/runtime/helpers/esm/inheritsLoose.js":"82cf-97"},"imported":[{"uid":"82cf-102"}],"importedBy":[{"uid":"82cf-88"}]},"82cf-98":{"id":"/home/artemis/Github/imperium/node_modules/react-is/index.js","moduleParts":{"external/react-is/index.js":"82cf-99"},"imported":[{"uid":"82cf-120"},{"uid":"82cf-46"},{"uid":"82cf-104"},{"uid":"82cf-121"},{"uid":"82cf-106"},{"uid":"82cf-122"}],"importedBy":[{"uid":"82cf-88"},{"uid":"82cf-100"},{"uid":"82cf-123"}]},"82cf-100":{"id":"/home/artemis/Github/imperium/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","moduleParts":{"external/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js":"82cf-101"},"imported":[{"uid":"82cf-120"},{"uid":"82cf-98"},{"uid":"82cf-123"}],"importedBy":[{"uid":"82cf-88"}]},"82cf-102":{"id":"/home/artemis/Github/imperium/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","moduleParts":{"external/@babel/runtime/helpers/esm/setPrototypeOf.js":"82cf-103"},"imported":[],"importedBy":[{"uid":"82cf-96"}]},"82cf-104":{"id":"/home/artemis/Github/imperium/node_modules/react-is/cjs/react-is.production.min.js","moduleParts":{"external/react-is/cjs/react-is.production.min.js":"82cf-105"},"imported":[{"uid":"82cf-120"},{"uid":"82cf-64"}],"importedBy":[{"uid":"82cf-98"},{"uid":"82cf-121"}]},"82cf-106":{"id":"/home/artemis/Github/imperium/node_modules/react-is/cjs/react-is.development.js","moduleParts":{"external/react-is/cjs/react-is.development.js":"82cf-107"},"imported":[{"uid":"82cf-120"},{"uid":"82cf-66"}],"importedBy":[{"uid":"82cf-98"},{"uid":"82cf-122"}]},"82cf-108":{"id":"/home/artemis/Github/imperium/node_modules/style-inject/dist/style-inject.es.js","moduleParts":{"external/style-inject/dist/style-inject.es.js":"82cf-109"},"imported":[],"importedBy":[{"uid":"82cf-32"},{"uid":"82cf-34"}]},"82cf-110":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"82cf-6"},{"uid":"82cf-8"},{"uid":"82cf-14"},{"uid":"82cf-18"},{"uid":"82cf-16"},{"uid":"82cf-20"},{"uid":"82cf-88"},{"uid":"82cf-22"},{"uid":"82cf-26"},{"uid":"82cf-24"},{"uid":"82cf-42"},{"uid":"82cf-44"},{"uid":"82cf-38"},{"uid":"82cf-40"},{"uid":"82cf-52"},{"uid":"82cf-62"},{"uid":"82cf-58"},{"uid":"82cf-54"},{"uid":"82cf-56"},{"uid":"82cf-60"},{"uid":"82cf-80"},{"uid":"82cf-82"},{"uid":"82cf-84"},{"uid":"82cf-86"},{"uid":"82cf-76"},{"uid":"82cf-78"}],"isExternal":true},"82cf-111":{"id":"debug","moduleParts":{},"imported":[],"importedBy":[{"uid":"82cf-6"},{"uid":"82cf-14"},{"uid":"82cf-18"},{"uid":"82cf-16"},{"uid":"82cf-20"},{"uid":"82cf-22"},{"uid":"82cf-30"},{"uid":"82cf-42"},{"uid":"82cf-38"},{"uid":"82cf-40"},{"uid":"82cf-62"},{"uid":"82cf-50"},{"uid":"82cf-58"},{"uid":"82cf-82"},{"uid":"82cf-78"}],"isExternal":true},"82cf-112":{"id":"@imperium/state","moduleParts":{},"imported":[],"importedBy":[{"uid":"82cf-2"}],"isExternal":true},"82cf-113":{"id":"@reduxjs/toolkit","moduleParts":{},"imported":[],"importedBy":[{"uid":"82cf-2"}],"isExternal":true},"82cf-114":{"id":"react-router-dom","moduleParts":{},"imported":[],"importedBy":[{"uid":"82cf-14"},{"uid":"82cf-52"},{"uid":"82cf-50"},{"uid":"82cf-60"}],"isExternal":true},"82cf-115":{"id":"@imperium/auth-client","moduleParts":{},"imported":[],"importedBy":[{"uid":"82cf-16"},{"uid":"82cf-50"}],"isExternal":true},"82cf-116":{"id":"react-redux","moduleParts":{},"imported":[],"importedBy":[{"uid":"82cf-16"},{"uid":"82cf-22"},{"uid":"82cf-24"}],"isExternal":true},"82cf-117":{"id":"react-responsive","moduleParts":{},"imported":[],"importedBy":[{"uid":"82cf-20"},{"uid":"82cf-22"},{"uid":"82cf-86"}],"isExternal":true},"82cf-118":{"id":"semantic-ui-react","moduleParts":{},"imported":[],"importedBy":[{"uid":"82cf-20"},{"uid":"82cf-22"},{"uid":"82cf-42"},{"uid":"82cf-44"},{"uid":"82cf-38"},{"uid":"82cf-40"},{"uid":"82cf-52"},{"uid":"82cf-62"},{"uid":"82cf-58"},{"uid":"82cf-54"},{"uid":"82cf-60"},{"uid":"82cf-82"},{"uid":"82cf-84"},{"uid":"82cf-86"},{"uid":"82cf-76"},{"uid":"82cf-78"}],"isExternal":true},"82cf-119":{"id":"lodash-es","moduleParts":{},"imported":[],"importedBy":[{"uid":"82cf-22"},{"uid":"82cf-30"},{"uid":"82cf-28"},{"uid":"82cf-50"},{"uid":"82cf-72"},{"uid":"82cf-74"}],"isExternal":true},"82cf-120":{"id":"\u0000commonjsHelpers.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"82cf-98"},{"uid":"82cf-100"},{"uid":"82cf-104"},{"uid":"82cf-106"}]},"82cf-121":{"id":"\u0000/home/artemis/Github/imperium/node_modules/react-is/cjs/react-is.production.min.js?commonjs-proxy","moduleParts":{},"imported":[{"uid":"82cf-104"}],"importedBy":[{"uid":"82cf-98"}]},"82cf-122":{"id":"\u0000/home/artemis/Github/imperium/node_modules/react-is/cjs/react-is.development.js?commonjs-proxy","moduleParts":{},"imported":[{"uid":"82cf-106"}],"importedBy":[{"uid":"82cf-98"}]},"82cf-123":{"id":"\u0000/home/artemis/Github/imperium/node_modules/react-is/index.js?commonjs-proxy","moduleParts":{},"imported":[{"uid":"82cf-98"}],"importedBy":[{"uid":"82cf-100"}]},"82cf-124":{"id":"mingo","moduleParts":{},"imported":[],"importedBy":[{"uid":"82cf-40"},{"uid":"82cf-62"}],"isExternal":true},"82cf-125":{"id":"react-router","moduleParts":{},"imported":[],"importedBy":[{"uid":"82cf-70"}],"isExternal":true},"82cf-126":{"id":"@thx/controls","moduleParts":{},"imported":[],"importedBy":[{"uid":"82cf-78"}],"isExternal":true}},"env":{"rollup":"2.79.1"},"options":{"gzip":true,"brotli":true,"sourcemap":false}};
2672
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src/index.ts","uid":"be4a-1"}]},{"name":"state.js","children":[{"name":"src/state.ts","uid":"be4a-3"}]},{"name":"content/dividerSidebarItem.js","children":[{"name":"src/content/dividerSidebarItem.ts","uid":"be4a-5"}]},{"name":"layout/withLayout.js","children":[{"name":"src/layout/withLayout.tsx","uid":"be4a-7"}]},{"name":"content/createPages.js","children":[{"name":"src/content/createPages.tsx","uid":"be4a-9"}]},{"name":"types.js","children":[{"name":"src/types.ts","uid":"be4a-11"}]},{"name":"content/types.js","children":[{"name":"src/content/types.ts","uid":"be4a-13"}]},{"name":"datahooks/DataHooks.js","children":[{"name":"src/datahooks/DataHooks.tsx","uid":"be4a-15"}]},{"name":"datahooks/PermissionHooks.js","children":[{"name":"src/datahooks/PermissionHooks.tsx","uid":"be4a-17"}]},{"name":"datahooks/Permissions.js","children":[{"name":"src/datahooks/Permissions.tsx","uid":"be4a-19"}]},{"name":"content/components/ContentComponent.js","children":[{"name":"src/content/components/ContentComponent.tsx","uid":"be4a-21"}]},{"name":"layout/components/Layout.js","children":[{"name":"src/layout/components/Layout.tsx","uid":"be4a-23"}]},{"name":"utils.js","children":[{"name":"src/utils.ts","uid":"be4a-25"}]},{"name":"datahooks/ExecuteDataHook.js","children":[{"name":"src/datahooks/ExecuteDataHook.tsx","uid":"be4a-27"}]},{"name":"datahooks/ExecutePermissionHook.js","children":[{"name":"src/datahooks/ExecutePermissionHook.tsx","uid":"be4a-29"}]},{"name":"content/components/styles.module.css.js","children":[{"name":"src/content/components/styles.module.css","uid":"be4a-31"}]},{"name":"layout/moveItems.js","children":[{"name":"src/layout/moveItems.ts","uid":"be4a-33"}]},{"name":"layout/components/styles.module.css.js","children":[{"name":"src/layout/components/styles.module.css","uid":"be4a-35"}]},{"name":"content/components/Header.js","children":[{"name":"src/content/components/Header.tsx","uid":"be4a-37"}]},{"name":"content/hooks/useBuildContentData.js","children":[{"name":"src/content/hooks/useBuildContentData.ts","uid":"be4a-39"}]},{"name":"content/components/SidebarItemWrapper.js","children":[{"name":"src/content/components/SidebarItemWrapper.tsx","uid":"be4a-41"}]},{"name":"layout/components/LayoutItemBar.js","children":[{"name":"src/layout/components/LayoutItemBar.tsx","uid":"be4a-43"}]},{"name":"layout/components/SecondaryMenuToggleItem.js","children":[{"name":"src/layout/components/SecondaryMenuToggleItem.tsx","uid":"be4a-45"}]},{"name":"layout/types.js","children":[{"name":"src/layout/types.ts","uid":"be4a-47"}]},{"name":"hooks/useBuildData.js","children":[{"name":"src/hooks/useBuildData.ts","uid":"be4a-49"}]},{"name":"layout/utils.js","children":[{"name":"src/layout/utils.tsx","uid":"be4a-51"}]},{"name":"content/components/ActionFormSidebarItemComponent.js","children":[{"name":"src/content/components/ActionFormSidebarItemComponent.tsx","uid":"be4a-53"}]},{"name":"content/components/ActionSidebarItemComponent.js","children":[{"name":"src/content/components/ActionSidebarItemComponent.tsx","uid":"be4a-55"}]},{"name":"content/components/CustomSidebarItemComponent.js","children":[{"name":"src/content/components/CustomSidebarItemComponent.tsx","uid":"be4a-57"}]},{"name":"content/components/PlainSidebarItem.js","children":[{"name":"src/content/components/PlainSidebarItem.tsx","uid":"be4a-59"}]},{"name":"layout/components/LayoutItemWrapper.js","children":[{"name":"src/layout/components/LayoutItemWrapper.tsx","uid":"be4a-61"}]},{"name":"hooks/useSelectPermission.js","children":[{"name":"src/hooks/useSelectPermission.ts","uid":"be4a-63"}]},{"name":"hooks/useIsActiveRoute.js","children":[{"name":"src/hooks/useIsActiveRoute.ts","uid":"be4a-65"}]},{"name":"hooks/useSelectState.js","children":[{"name":"src/hooks/useSelectState.ts","uid":"be4a-67"}]},{"name":"commonItems.js","children":[{"name":"src/commonItems.ts","uid":"be4a-69"}]},{"name":"content/utils.js","children":[{"name":"src/content/utils.tsx","uid":"be4a-71"}]},{"name":"content/components/ActionForm.js","children":[{"name":"src/content/components/ActionForm.tsx","uid":"be4a-73"}]},{"name":"layout/components/CustomLayoutItemComponent.js","children":[{"name":"src/layout/components/CustomLayoutItemComponent.tsx","uid":"be4a-75"}]},{"name":"layout/components/MenuItem.js","children":[{"name":"src/layout/components/MenuItem.tsx","uid":"be4a-77"}]},{"name":"layout/components/PlainItem.js","children":[{"name":"src/layout/components/PlainItem.tsx","uid":"be4a-79"}]},{"name":"layout/components/DropdownItem.js","children":[{"name":"src/layout/components/DropdownItem.tsx","uid":"be4a-81"}]},{"name":"external/style-inject/dist/style-inject.es.js","children":[{"name":"home/artemis/Github/imperium/node_modules/style-inject/dist/style-inject.es.js","uid":"be4a-83"}]}],"isRoot":true},"nodeParts":{"be4a-1":{"renderedLength":144,"gzipLength":131,"brotliLength":106,"mainUid":"be4a-0"},"be4a-3":{"renderedLength":591,"gzipLength":268,"brotliLength":243,"mainUid":"be4a-2"},"be4a-5":{"renderedLength":59,"gzipLength":73,"brotliLength":63,"mainUid":"be4a-4"},"be4a-7":{"renderedLength":1913,"gzipLength":563,"brotliLength":489,"mainUid":"be4a-6"},"be4a-9":{"renderedLength":650,"gzipLength":301,"brotliLength":268,"mainUid":"be4a-8"},"be4a-11":{"renderedLength":121,"gzipLength":111,"brotliLength":90,"mainUid":"be4a-10"},"be4a-13":{"renderedLength":388,"gzipLength":167,"brotliLength":111,"mainUid":"be4a-12"},"be4a-15":{"renderedLength":1058,"gzipLength":390,"brotliLength":330,"mainUid":"be4a-14"},"be4a-17":{"renderedLength":339,"gzipLength":202,"brotliLength":164,"mainUid":"be4a-16"},"be4a-19":{"renderedLength":842,"gzipLength":361,"brotliLength":320,"mainUid":"be4a-18"},"be4a-21":{"renderedLength":3568,"gzipLength":927,"brotliLength":804,"mainUid":"be4a-20"},"be4a-23":{"renderedLength":2512,"gzipLength":751,"brotliLength":636,"mainUid":"be4a-22"},"be4a-25":{"renderedLength":145,"gzipLength":117,"brotliLength":116,"mainUid":"be4a-24"},"be4a-27":{"renderedLength":123,"gzipLength":111,"brotliLength":93,"mainUid":"be4a-26"},"be4a-29":{"renderedLength":345,"gzipLength":207,"brotliLength":172,"mainUid":"be4a-28"},"be4a-31":{"renderedLength":2119,"gzipLength":680,"brotliLength":565,"mainUid":"be4a-30"},"be4a-33":{"renderedLength":1413,"gzipLength":381,"brotliLength":359,"mainUid":"be4a-32"},"be4a-35":{"renderedLength":3176,"gzipLength":928,"brotliLength":762,"mainUid":"be4a-34"},"be4a-37":{"renderedLength":1042,"gzipLength":377,"brotliLength":323,"mainUid":"be4a-36"},"be4a-39":{"renderedLength":257,"gzipLength":158,"brotliLength":122,"mainUid":"be4a-38"},"be4a-41":{"renderedLength":1183,"gzipLength":394,"brotliLength":310,"mainUid":"be4a-40"},"be4a-43":{"renderedLength":726,"gzipLength":294,"brotliLength":252,"mainUid":"be4a-42"},"be4a-45":{"renderedLength":356,"gzipLength":233,"brotliLength":176,"mainUid":"be4a-44"},"be4a-47":{"renderedLength":191,"gzipLength":113,"brotliLength":89,"mainUid":"be4a-46"},"be4a-49":{"renderedLength":799,"gzipLength":370,"brotliLength":330,"mainUid":"be4a-48"},"be4a-51":{"renderedLength":915,"gzipLength":393,"brotliLength":328,"mainUid":"be4a-50"},"be4a-53":{"renderedLength":644,"gzipLength":341,"brotliLength":295,"mainUid":"be4a-52"},"be4a-55":{"renderedLength":343,"gzipLength":239,"brotliLength":181,"mainUid":"be4a-54"},"be4a-57":{"renderedLength":83,"gzipLength":97,"brotliLength":66,"mainUid":"be4a-56"},"be4a-59":{"renderedLength":325,"gzipLength":230,"brotliLength":183,"mainUid":"be4a-58"},"be4a-61":{"renderedLength":1497,"gzipLength":481,"brotliLength":413,"mainUid":"be4a-60"},"be4a-63":{"renderedLength":294,"gzipLength":155,"brotliLength":114,"mainUid":"be4a-62"},"be4a-65":{"renderedLength":514,"gzipLength":227,"brotliLength":187,"mainUid":"be4a-64"},"be4a-67":{"renderedLength":326,"gzipLength":176,"brotliLength":141,"mainUid":"be4a-66"},"be4a-69":{"renderedLength":203,"gzipLength":136,"brotliLength":97,"mainUid":"be4a-68"},"be4a-71":{"renderedLength":628,"gzipLength":259,"brotliLength":219,"mainUid":"be4a-70"},"be4a-73":{"renderedLength":1667,"gzipLength":624,"brotliLength":519,"mainUid":"be4a-72"},"be4a-75":{"renderedLength":82,"gzipLength":96,"brotliLength":66,"mainUid":"be4a-74"},"be4a-77":{"renderedLength":252,"gzipLength":157,"brotliLength":116,"mainUid":"be4a-76"},"be4a-79":{"renderedLength":379,"gzipLength":264,"brotliLength":224,"mainUid":"be4a-78"},"be4a-81":{"renderedLength":1179,"gzipLength":450,"brotliLength":362,"mainUid":"be4a-80"},"be4a-83":{"renderedLength":636,"gzipLength":318,"brotliLength":242,"mainUid":"be4a-82"}},"nodeMetas":{"be4a-0":{"id":"/src/index.ts","moduleParts":{"index.js":"be4a-1"},"imported":[{"uid":"be4a-6"},{"uid":"be4a-2"},{"uid":"be4a-8"},{"uid":"be4a-4"}],"importedBy":[],"isEntry":true},"be4a-2":{"id":"/src/state.ts","moduleParts":{"state.js":"be4a-3"},"imported":[{"uid":"be4a-86"},{"uid":"be4a-87"}],"importedBy":[{"uid":"be4a-0"},{"uid":"be4a-18"},{"uid":"be4a-20"},{"uid":"be4a-28"},{"uid":"be4a-48"}]},"be4a-4":{"id":"/src/content/dividerSidebarItem.ts","moduleParts":{"content/dividerSidebarItem.js":"be4a-5"},"imported":[],"importedBy":[{"uid":"be4a-0"}]},"be4a-6":{"id":"/src/layout/withLayout.tsx","moduleParts":{"layout/withLayout.js":"be4a-7"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-85"},{"uid":"be4a-14"},{"uid":"be4a-16"},{"uid":"be4a-18"},{"uid":"be4a-10"},{"uid":"be4a-22"}],"importedBy":[{"uid":"be4a-0"}]},"be4a-8":{"id":"/src/content/createPages.tsx","moduleParts":{"content/createPages.js":"be4a-9"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-85"},{"uid":"be4a-20"},{"uid":"be4a-12"}],"importedBy":[{"uid":"be4a-0"}]},"be4a-10":{"id":"/src/types.ts","moduleParts":{"types.js":"be4a-11"},"imported":[],"importedBy":[{"uid":"be4a-6"}]},"be4a-12":{"id":"/src/content/types.ts","moduleParts":{"content/types.js":"be4a-13"},"imported":[],"importedBy":[{"uid":"be4a-8"},{"uid":"be4a-36"},{"uid":"be4a-40"}]},"be4a-14":{"id":"/src/datahooks/DataHooks.tsx","moduleParts":{"datahooks/DataHooks.js":"be4a-15"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-85"},{"uid":"be4a-88"},{"uid":"be4a-26"}],"importedBy":[{"uid":"be4a-6"},{"uid":"be4a-20"}]},"be4a-16":{"id":"/src/datahooks/PermissionHooks.tsx","moduleParts":{"datahooks/PermissionHooks.js":"be4a-17"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-85"},{"uid":"be4a-28"}],"importedBy":[{"uid":"be4a-6"}]},"be4a-18":{"id":"/src/datahooks/Permissions.tsx","moduleParts":{"datahooks/Permissions.js":"be4a-19"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-89"},{"uid":"be4a-85"},{"uid":"be4a-90"},{"uid":"be4a-2"}],"importedBy":[{"uid":"be4a-6"}]},"be4a-20":{"id":"/src/content/components/ContentComponent.tsx","moduleParts":{"content/components/ContentComponent.js":"be4a-21"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-85"},{"uid":"be4a-93"},{"uid":"be4a-90"},{"uid":"be4a-92"},{"uid":"be4a-91"},{"uid":"be4a-14"},{"uid":"be4a-2"},{"uid":"be4a-24"},{"uid":"be4a-38"},{"uid":"be4a-36"},{"uid":"be4a-40"},{"uid":"be4a-30"}],"importedBy":[{"uid":"be4a-8"}]},"be4a-22":{"id":"/src/layout/components/Layout.tsx","moduleParts":{"layout/components/Layout.js":"be4a-23"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-85"},{"uid":"be4a-91"},{"uid":"be4a-92"},{"uid":"be4a-32"},{"uid":"be4a-42"},{"uid":"be4a-44"},{"uid":"be4a-34"}],"importedBy":[{"uid":"be4a-6"}]},"be4a-24":{"id":"/src/utils.ts","moduleParts":{"utils.js":"be4a-25"},"imported":[{"uid":"be4a-93"}],"importedBy":[{"uid":"be4a-20"},{"uid":"be4a-42"},{"uid":"be4a-60"}]},"be4a-26":{"id":"/src/datahooks/ExecuteDataHook.tsx","moduleParts":{"datahooks/ExecuteDataHook.js":"be4a-27"},"imported":[{"uid":"be4a-84"}],"importedBy":[{"uid":"be4a-14"}]},"be4a-28":{"id":"/src/datahooks/ExecutePermissionHook.tsx","moduleParts":{"datahooks/ExecutePermissionHook.js":"be4a-29"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-90"},{"uid":"be4a-2"}],"importedBy":[{"uid":"be4a-16"}]},"be4a-30":{"id":"/src/content/components/styles.module.css","moduleParts":{"content/components/styles.module.css.js":"be4a-31"},"imported":[{"uid":"be4a-82"}],"importedBy":[{"uid":"be4a-20"},{"uid":"be4a-36"}]},"be4a-32":{"id":"/src/layout/moveItems.ts","moduleParts":{"layout/moveItems.js":"be4a-33"},"imported":[{"uid":"be4a-85"},{"uid":"be4a-93"},{"uid":"be4a-46"}],"importedBy":[{"uid":"be4a-22"}]},"be4a-34":{"id":"/src/layout/components/styles.module.css","moduleParts":{"layout/components/styles.module.css.js":"be4a-35"},"imported":[{"uid":"be4a-82"}],"importedBy":[{"uid":"be4a-22"},{"uid":"be4a-44"},{"uid":"be4a-80"}]},"be4a-36":{"id":"/src/content/components/Header.tsx","moduleParts":{"content/components/Header.js":"be4a-37"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-85"},{"uid":"be4a-92"},{"uid":"be4a-12"},{"uid":"be4a-30"}],"importedBy":[{"uid":"be4a-20"}]},"be4a-38":{"id":"/src/content/hooks/useBuildContentData.ts","moduleParts":{"content/hooks/useBuildContentData.js":"be4a-39"},"imported":[{"uid":"be4a-48"}],"importedBy":[{"uid":"be4a-20"},{"uid":"be4a-40"}]},"be4a-40":{"id":"/src/content/components/SidebarItemWrapper.tsx","moduleParts":{"content/components/SidebarItemWrapper.js":"be4a-41"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-85"},{"uid":"be4a-94"},{"uid":"be4a-92"},{"uid":"be4a-38"},{"uid":"be4a-12"},{"uid":"be4a-52"},{"uid":"be4a-54"},{"uid":"be4a-56"},{"uid":"be4a-58"}],"importedBy":[{"uid":"be4a-20"}]},"be4a-42":{"id":"/src/layout/components/LayoutItemBar.tsx","moduleParts":{"layout/components/LayoutItemBar.js":"be4a-43"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-85"},{"uid":"be4a-92"},{"uid":"be4a-24"},{"uid":"be4a-50"},{"uid":"be4a-60"}],"importedBy":[{"uid":"be4a-22"}]},"be4a-44":{"id":"/src/layout/components/SecondaryMenuToggleItem.tsx","moduleParts":{"layout/components/SecondaryMenuToggleItem.js":"be4a-45"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-92"},{"uid":"be4a-34"}],"importedBy":[{"uid":"be4a-22"}]},"be4a-46":{"id":"/src/layout/types.ts","moduleParts":{"layout/types.js":"be4a-47"},"imported":[],"importedBy":[{"uid":"be4a-32"},{"uid":"be4a-60"}]},"be4a-48":{"id":"/src/hooks/useBuildData.ts","moduleParts":{"hooks/useBuildData.js":"be4a-49"},"imported":[{"uid":"be4a-89"},{"uid":"be4a-85"},{"uid":"be4a-93"},{"uid":"be4a-88"},{"uid":"be4a-2"},{"uid":"be4a-64"},{"uid":"be4a-62"},{"uid":"be4a-66"}],"importedBy":[{"uid":"be4a-38"},{"uid":"be4a-60"}]},"be4a-50":{"id":"/src/layout/utils.tsx","moduleParts":{"layout/utils.js":"be4a-51"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-88"},{"uid":"be4a-92"},{"uid":"be4a-68"}],"importedBy":[{"uid":"be4a-42"},{"uid":"be4a-80"},{"uid":"be4a-78"}]},"be4a-52":{"id":"/src/content/components/ActionFormSidebarItemComponent.tsx","moduleParts":{"content/components/ActionFormSidebarItemComponent.js":"be4a-53"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-85"},{"uid":"be4a-92"},{"uid":"be4a-70"},{"uid":"be4a-72"}],"importedBy":[{"uid":"be4a-40"}]},"be4a-54":{"id":"/src/content/components/ActionSidebarItemComponent.tsx","moduleParts":{"content/components/ActionSidebarItemComponent.js":"be4a-55"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-92"},{"uid":"be4a-70"}],"importedBy":[{"uid":"be4a-40"}]},"be4a-56":{"id":"/src/content/components/CustomSidebarItemComponent.tsx","moduleParts":{"content/components/CustomSidebarItemComponent.js":"be4a-57"},"imported":[{"uid":"be4a-84"}],"importedBy":[{"uid":"be4a-40"}]},"be4a-58":{"id":"/src/content/components/PlainSidebarItem.tsx","moduleParts":{"content/components/PlainSidebarItem.js":"be4a-59"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-88"},{"uid":"be4a-92"},{"uid":"be4a-70"}],"importedBy":[{"uid":"be4a-40"}]},"be4a-60":{"id":"/src/layout/components/LayoutItemWrapper.tsx","moduleParts":{"layout/components/LayoutItemWrapper.js":"be4a-61"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-85"},{"uid":"be4a-94"},{"uid":"be4a-92"},{"uid":"be4a-48"},{"uid":"be4a-24"},{"uid":"be4a-46"},{"uid":"be4a-74"},{"uid":"be4a-80"},{"uid":"be4a-76"},{"uid":"be4a-78"}],"importedBy":[{"uid":"be4a-42"}]},"be4a-62":{"id":"/src/hooks/useSelectPermission.ts","moduleParts":{"hooks/useSelectPermission.js":"be4a-63"},"imported":[{"uid":"be4a-93"}],"importedBy":[{"uid":"be4a-48"}]},"be4a-64":{"id":"/src/hooks/useIsActiveRoute.ts","moduleParts":{"hooks/useIsActiveRoute.js":"be4a-65"},"imported":[{"uid":"be4a-95"},{"uid":"be4a-68"}],"importedBy":[{"uid":"be4a-48"}]},"be4a-66":{"id":"/src/hooks/useSelectState.ts","moduleParts":{"hooks/useSelectState.js":"be4a-67"},"imported":[{"uid":"be4a-93"}],"importedBy":[{"uid":"be4a-48"}]},"be4a-68":{"id":"/src/commonItems.ts","moduleParts":{"commonItems.js":"be4a-69"},"imported":[],"importedBy":[{"uid":"be4a-50"},{"uid":"be4a-64"}]},"be4a-70":{"id":"/src/content/utils.tsx","moduleParts":{"content/utils.js":"be4a-71"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-92"}],"importedBy":[{"uid":"be4a-52"},{"uid":"be4a-54"},{"uid":"be4a-58"}]},"be4a-72":{"id":"/src/content/components/ActionForm.tsx","moduleParts":{"content/components/ActionForm.js":"be4a-73"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-96"},{"uid":"be4a-85"},{"uid":"be4a-92"}],"importedBy":[{"uid":"be4a-52"}]},"be4a-74":{"id":"/src/layout/components/CustomLayoutItemComponent.tsx","moduleParts":{"layout/components/CustomLayoutItemComponent.js":"be4a-75"},"imported":[{"uid":"be4a-84"}],"importedBy":[{"uid":"be4a-60"}]},"be4a-76":{"id":"/src/layout/components/MenuItem.tsx","moduleParts":{"layout/components/MenuItem.js":"be4a-77"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-92"}],"importedBy":[{"uid":"be4a-60"}]},"be4a-78":{"id":"/src/layout/components/PlainItem.tsx","moduleParts":{"layout/components/PlainItem.js":"be4a-79"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-91"},{"uid":"be4a-92"},{"uid":"be4a-50"}],"importedBy":[{"uid":"be4a-60"}]},"be4a-80":{"id":"/src/layout/components/DropdownItem.tsx","moduleParts":{"layout/components/DropdownItem.js":"be4a-81"},"imported":[{"uid":"be4a-84"},{"uid":"be4a-85"},{"uid":"be4a-92"},{"uid":"be4a-50"},{"uid":"be4a-34"}],"importedBy":[{"uid":"be4a-60"}]},"be4a-82":{"id":"/home/artemis/Github/imperium/node_modules/style-inject/dist/style-inject.es.js","moduleParts":{"external/style-inject/dist/style-inject.es.js":"be4a-83"},"imported":[],"importedBy":[{"uid":"be4a-34"},{"uid":"be4a-30"}]},"be4a-84":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"be4a-6"},{"uid":"be4a-8"},{"uid":"be4a-14"},{"uid":"be4a-16"},{"uid":"be4a-18"},{"uid":"be4a-22"},{"uid":"be4a-20"},{"uid":"be4a-26"},{"uid":"be4a-28"},{"uid":"be4a-42"},{"uid":"be4a-44"},{"uid":"be4a-36"},{"uid":"be4a-40"},{"uid":"be4a-50"},{"uid":"be4a-60"},{"uid":"be4a-52"},{"uid":"be4a-54"},{"uid":"be4a-56"},{"uid":"be4a-58"},{"uid":"be4a-74"},{"uid":"be4a-80"},{"uid":"be4a-76"},{"uid":"be4a-78"},{"uid":"be4a-70"},{"uid":"be4a-72"}],"isExternal":true},"be4a-85":{"id":"debug","moduleParts":{},"imported":[],"importedBy":[{"uid":"be4a-6"},{"uid":"be4a-8"},{"uid":"be4a-14"},{"uid":"be4a-16"},{"uid":"be4a-18"},{"uid":"be4a-22"},{"uid":"be4a-20"},{"uid":"be4a-32"},{"uid":"be4a-42"},{"uid":"be4a-36"},{"uid":"be4a-40"},{"uid":"be4a-60"},{"uid":"be4a-48"},{"uid":"be4a-52"},{"uid":"be4a-80"},{"uid":"be4a-72"}],"isExternal":true},"be4a-86":{"id":"@imperium/state","moduleParts":{},"imported":[],"importedBy":[{"uid":"be4a-2"}],"isExternal":true},"be4a-87":{"id":"@reduxjs/toolkit","moduleParts":{},"imported":[],"importedBy":[{"uid":"be4a-2"}],"isExternal":true},"be4a-88":{"id":"react-router-dom","moduleParts":{},"imported":[],"importedBy":[{"uid":"be4a-14"},{"uid":"be4a-50"},{"uid":"be4a-48"},{"uid":"be4a-58"}],"isExternal":true},"be4a-89":{"id":"@imperium/auth-client","moduleParts":{},"imported":[],"importedBy":[{"uid":"be4a-18"},{"uid":"be4a-48"}],"isExternal":true},"be4a-90":{"id":"react-redux","moduleParts":{},"imported":[],"importedBy":[{"uid":"be4a-18"},{"uid":"be4a-20"},{"uid":"be4a-28"}],"isExternal":true},"be4a-91":{"id":"react-responsive","moduleParts":{},"imported":[],"importedBy":[{"uid":"be4a-22"},{"uid":"be4a-20"},{"uid":"be4a-78"}],"isExternal":true},"be4a-92":{"id":"semantic-ui-react","moduleParts":{},"imported":[],"importedBy":[{"uid":"be4a-22"},{"uid":"be4a-20"},{"uid":"be4a-42"},{"uid":"be4a-44"},{"uid":"be4a-36"},{"uid":"be4a-40"},{"uid":"be4a-50"},{"uid":"be4a-60"},{"uid":"be4a-52"},{"uid":"be4a-54"},{"uid":"be4a-58"},{"uid":"be4a-80"},{"uid":"be4a-76"},{"uid":"be4a-78"},{"uid":"be4a-70"},{"uid":"be4a-72"}],"isExternal":true},"be4a-93":{"id":"lodash-es","moduleParts":{},"imported":[],"importedBy":[{"uid":"be4a-20"},{"uid":"be4a-32"},{"uid":"be4a-24"},{"uid":"be4a-48"},{"uid":"be4a-62"},{"uid":"be4a-66"}],"isExternal":true},"be4a-94":{"id":"mingo","moduleParts":{},"imported":[],"importedBy":[{"uid":"be4a-40"},{"uid":"be4a-60"}],"isExternal":true},"be4a-95":{"id":"react-router","moduleParts":{},"imported":[],"importedBy":[{"uid":"be4a-64"}],"isExternal":true},"be4a-96":{"id":"@thx/controls","moduleParts":{},"imported":[],"importedBy":[{"uid":"be4a-72"}],"isExternal":true}},"env":{"rollup":"2.79.1"},"options":{"gzip":true,"brotli":true,"sourcemap":false}};
2673
2673
 
2674
2674
  const run = () => {
2675
2675
  const width = window.innerWidth;