@vuu-ui/vuu-shell 0.13.4 → 0.13.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/shell-layout-templates/context-panel/ContextPanel.js +2 -1
- package/cjs/shell-layout-templates/context-panel/ContextPanel.js.map +1 -1
- package/esm/shell-layout-templates/context-panel/ContextPanel.js +2 -1
- package/esm/shell-layout-templates/context-panel/ContextPanel.js.map +1 -1
- package/package.json +19 -16
- package/types/ShellContextProvider.d.ts +7 -0
- package/types/app-header/AppHeader.d.ts +6 -0
- package/types/app-header/index.d.ts +1 -0
- package/types/app-status-bar/AppStatusBar.d.ts +1 -0
- package/types/app-status-bar/index.d.ts +1 -0
- package/types/application-provider/ApplicationContext.d.ts +11 -0
- package/types/application-provider/ApplicationProvider.d.ts +17 -0
- package/types/application-provider/index.d.ts +1 -0
- package/types/connection-status/ConnectionRetryCountdown.d.ts +3 -0
- package/types/connection-status/ConnectionStateDisplay.d.ts +9 -0
- package/types/connection-status/ConnectionStatusIndicator.d.ts +6 -0
- package/types/connection-status/index.d.ts +2 -0
- package/types/feature/Feature.d.ts +10 -0
- package/types/feature/FeatureErrorBoundary.d.ts +13 -0
- package/types/feature/Loader.d.ts +1 -0
- package/types/feature/index.d.ts +1 -0
- package/types/feature-and-layout-provider/FeatureAndLayoutProvider.d.ts +19 -0
- package/types/feature-and-layout-provider/index.d.ts +1 -0
- package/types/feature-list/FeatureList.d.ts +7 -0
- package/types/feature-list/index.d.ts +1 -0
- package/types/get-layout-history.d.ts +8 -0
- package/types/index.d.ts +15 -0
- package/types/left-nav/LeftNav.d.ts +14 -0
- package/types/left-nav/index.d.ts +1 -0
- package/types/login/LoginPanel.d.ts +7 -0
- package/types/login/VuuLogo.d.ts +1 -0
- package/types/login/index.d.ts +2 -0
- package/types/login/login-utils.d.ts +4 -0
- package/types/persistence-manager/LocalPersistenceManager.d.ts +21 -0
- package/types/persistence-manager/PersistenceManager.d.ts +66 -0
- package/types/persistence-manager/PersistenceProvider.d.ts +11 -0
- package/types/persistence-manager/RemotePersistenceManager.d.ts +23 -0
- package/types/persistence-manager/StaticPersistenceManager.d.ts +21 -0
- package/types/persistence-manager/index.d.ts +5 -0
- package/types/shell-layout-templates/context-panel/ContextPanel.d.ts +13 -0
- package/types/shell-layout-templates/context-panel/index.d.ts +1 -0
- package/types/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.d.ts +2 -0
- package/types/shell-layout-templates/index.d.ts +3 -0
- package/types/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.d.ts +2 -0
- package/types/shell-layout-templates/left-main-tabs/useLeftMainTabs.d.ts +2 -0
- package/types/shell-layout-templates/side-panel/SidePanel.d.ts +8 -0
- package/types/shell-layout-templates/side-panel/index.d.ts +1 -0
- package/types/shell-layout-templates/simple-content-pane/useSimpleContentPane.d.ts +2 -0
- package/types/shell-layout-templates/useShellLayout.d.ts +51 -0
- package/types/shell.d.ts +17 -0
- package/types/theme-switch/ThemeSwitch.d.ts +8 -0
- package/types/theme-switch/index.d.ts +1 -0
- package/types/use-force-render.d.ts +1 -0
- package/types/user-settings/SettingsForm.d.ts +46 -0
- package/types/user-settings/UserSettingsPanel.d.ts +3 -0
- package/types/user-settings/index.d.ts +2 -0
- package/types/workspace-management/LayoutList.d.ts +2 -0
- package/types/workspace-management/LayoutTile.d.ts +7 -0
- package/types/workspace-management/SaveLayoutPanel.d.ts +9 -0
- package/types/workspace-management/WorkspaceProvider.d.ts +52 -0
- package/types/workspace-management/defaultWorkspaceJSON.d.ts +10 -0
- package/types/workspace-management/index.d.ts +5 -0
- package/types/workspace-management/screenshot-utils.d.ts +6 -0
- package/types/workspace-management/useWorkspaceContextMenuItems.d.ts +5 -0
|
@@ -15,7 +15,7 @@ const ContextPanel = ({
|
|
|
15
15
|
className: classNameProp,
|
|
16
16
|
expanded = false,
|
|
17
17
|
content: contentProp,
|
|
18
|
-
id
|
|
18
|
+
id,
|
|
19
19
|
onClose,
|
|
20
20
|
overlay = false,
|
|
21
21
|
title
|
|
@@ -66,6 +66,7 @@ const ContextPanel = ({
|
|
|
66
66
|
className: cx(classBase, className, "vuuScrollable", {
|
|
67
67
|
[`${classBase}-expanded`]: expanded
|
|
68
68
|
}),
|
|
69
|
+
id,
|
|
69
70
|
children: /* @__PURE__ */ jsxRuntime.jsxs(vuuLayout.View, { className: `${classBase}-inner`, header: false, id, children: [
|
|
70
71
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${classBase}-header`, children: [
|
|
71
72
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: `${classBase}-title`, children: title }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextPanel.js","sources":["../../../src/shell-layout-templates/context-panel/ContextPanel.tsx"],"sourcesContent":["import {\n View,\n layoutFromJson,\n useLayoutProviderDispatch,\n} from \"@vuu-ui/vuu-layout\";\nimport { IconButton } from \"@vuu-ui/vuu-ui-controls\";\nimport { LayoutJSON, VuuShellLocation } from \"@vuu-ui/vuu-utils\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport cx from \"clsx\";\nimport {\n KeyboardEventHandler,\n ReactNode,\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n} from \"react\";\n\nimport contextPanelCss from \"./ContextPanel.css\";\n\nconst classBase = \"vuuContextPanel\";\n\nexport interface ContextPanelProps {\n [key: string]: unknown;\n className?: string;\n content?: LayoutJSON;\n expanded?: boolean;\n id?: string;\n onClose?: () => void;\n overlay?: boolean;\n title?: ReactNode;\n}\n\nexport const ContextPanel = ({\n className: classNameProp,\n expanded = false,\n content: contentProp,\n id
|
|
1
|
+
{"version":3,"file":"ContextPanel.js","sources":["../../../src/shell-layout-templates/context-panel/ContextPanel.tsx"],"sourcesContent":["import {\n View,\n layoutFromJson,\n useLayoutProviderDispatch,\n} from \"@vuu-ui/vuu-layout\";\nimport { IconButton } from \"@vuu-ui/vuu-ui-controls\";\nimport { LayoutJSON, VuuShellLocation } from \"@vuu-ui/vuu-utils\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport cx from \"clsx\";\nimport {\n KeyboardEventHandler,\n ReactNode,\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n} from \"react\";\n\nimport contextPanelCss from \"./ContextPanel.css\";\n\nconst classBase = \"vuuContextPanel\";\n\nexport interface ContextPanelProps {\n [key: string]: unknown;\n className?: string;\n content?: LayoutJSON;\n expanded?: boolean;\n id?: string;\n onClose?: () => void;\n overlay?: boolean;\n title?: ReactNode;\n}\n\nexport const ContextPanel = ({\n className: classNameProp,\n expanded = false,\n content: contentProp,\n id,\n onClose,\n overlay = false,\n title,\n}: ContextPanelProps) => {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-context-panel\",\n css: contextPanelCss,\n window: targetWindow,\n });\n\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n const dispatchLayoutAction = useLayoutProviderDispatch();\n const handleClose = useCallback(() => {\n dispatchLayoutAction({\n path: `#${VuuShellLocation.ContextPanel}`,\n propName: \"expanded\",\n propValue: false,\n type: \"set-prop\",\n });\n }, [dispatchLayoutAction]);\n\n const handleKeyDown = useCallback<KeyboardEventHandler>(\n (e) => {\n if (e.key === \"Escape\") {\n handleClose();\n }\n },\n [handleClose],\n );\n\n const className = cx(classBase, classNameProp, {\n [`${classBase}-expanded`]: expanded,\n [`${classBase}-inline`]: overlay !== true,\n [`${classBase}-overlay`]: overlay,\n });\n\n const content = useMemo(\n () =>\n contentProp && expanded ? layoutFromJson(contentProp, \"context-0\") : null,\n [contentProp, expanded],\n );\n\n useLayoutEffect(() => {\n if (expanded) {\n // Components loaded into the ContextPanel will often assume focus themselves,\n //but if not, default to close button\n closeButtonRef.current?.focus();\n } else {\n onClose?.();\n }\n }, [expanded, onClose]);\n\n return (\n <div\n className={cx(classBase, className, \"vuuScrollable\", {\n [`${classBase}-expanded`]: expanded,\n })}\n id={id}\n >\n <View className={`${classBase}-inner`} header={false} id={id}>\n <div className={`${classBase}-header`}>\n <h2 className={`${classBase}-title`}>{title}</h2>\n <IconButton\n className={`${classBase}-close`}\n data-embedded\n icon=\"close\"\n onClick={handleClose}\n onKeyDown={handleKeyDown}\n ref={closeButtonRef}\n size={16}\n variant=\"secondary\"\n />\n </div>\n <div className={`${classBase}-content`}>{content}</div>\n </View>\n </div>\n );\n};\n"],"names":["useWindow","useComponentCssInjection","contextPanelCss","useRef","useLayoutProviderDispatch","useCallback","VuuShellLocation","useMemo","layoutFromJson","useLayoutEffect","jsx","jsxs","View","IconButton"],"mappings":";;;;;;;;;;;;AAqBA,MAAM,SAAY,GAAA,iBAAA;AAaX,MAAM,eAAe,CAAC;AAAA,EAC3B,SAAW,EAAA,aAAA;AAAA,EACX,QAAW,GAAA,KAAA;AAAA,EACX,OAAS,EAAA,WAAA;AAAA,EACT,EAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAU,GAAA,KAAA;AAAA,EACV;AACF,CAAyB,KAAA;AACvB,EAAA,MAAM,eAAeA,gBAAU,EAAA;AAC/B,EAAyBC,+BAAA,CAAA;AAAA,IACvB,MAAQ,EAAA,mBAAA;AAAA,IACR,GAAK,EAAAC,cAAA;AAAA,IACL,MAAQ,EAAA;AAAA,GACT,CAAA;AAED,EAAM,MAAA,cAAA,GAAiBC,aAA0B,IAAI,CAAA;AACrD,EAAA,MAAM,uBAAuBC,mCAA0B,EAAA;AACvD,EAAM,MAAA,WAAA,GAAcC,kBAAY,MAAM;AACpC,IAAqB,oBAAA,CAAA;AAAA,MACnB,IAAA,EAAM,CAAI,CAAA,EAAAC,yBAAA,CAAiB,YAAY,CAAA,CAAA;AAAA,MACvC,QAAU,EAAA,UAAA;AAAA,MACV,SAAW,EAAA,KAAA;AAAA,MACX,IAAM,EAAA;AAAA,KACP,CAAA;AAAA,GACH,EAAG,CAAC,oBAAoB,CAAC,CAAA;AAEzB,EAAA,MAAM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CAAC,KAAI,EAAA,EAAA,SAAA,EAAW,CAAG,EAAA,SAAS,CAC1B,OAAA,CAAA,EAAA,QAAA,EAAA;AAAA,0BAAAD,cAAA,CAAC,IAAG,EAAA,EAAA,SAAA,EAAW,CAAG,EAAA,SAAS,UAAW,QAAM,EAAA,KAAA,EAAA,CAAA;AAAA,0BAC5CA,cAAA;AAAA,YAACG,wBAAA;AAAA,YAAA;AAAA,cACC,SAAA,EAAW,GAAG,SAAS,CAAA,MAAA,CAAA;AAAA,cACvB,eAAa,EAAA,IAAA;AAAA,cACb,IAAK,EAAA,OAAA;AAAA,cACL,OAAS,EAAA,WAAA;AAAA,cACT,SAAW,EAAA,aAAA;AAAA,cACX,GAAK,EAAA,cAAA;AAAA,cACL,IAAM,EAAA,EAAA;AAAA,cACN,OAAQ,EAAA;AAAA;AAAA;AACV,SACF,EAAA,CAAA;AAAA,uCACC,KAAI,EAAA,EAAA,SAAA,EAAW,CAAG,EAAA,SAAS,YAAa,QAAQ,EAAA,OAAA,EAAA;AAAA,OACnD,EAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -13,7 +13,7 @@ const ContextPanel = ({
|
|
|
13
13
|
className: classNameProp,
|
|
14
14
|
expanded = false,
|
|
15
15
|
content: contentProp,
|
|
16
|
-
id
|
|
16
|
+
id,
|
|
17
17
|
onClose,
|
|
18
18
|
overlay = false,
|
|
19
19
|
title
|
|
@@ -64,6 +64,7 @@ const ContextPanel = ({
|
|
|
64
64
|
className: cx(classBase, className, "vuuScrollable", {
|
|
65
65
|
[`${classBase}-expanded`]: expanded
|
|
66
66
|
}),
|
|
67
|
+
id,
|
|
67
68
|
children: /* @__PURE__ */ jsxs(View, { className: `${classBase}-inner`, header: false, id, children: [
|
|
68
69
|
/* @__PURE__ */ jsxs("div", { className: `${classBase}-header`, children: [
|
|
69
70
|
/* @__PURE__ */ jsx("h2", { className: `${classBase}-title`, children: title }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextPanel.js","sources":["../../../src/shell-layout-templates/context-panel/ContextPanel.tsx"],"sourcesContent":["import {\n View,\n layoutFromJson,\n useLayoutProviderDispatch,\n} from \"@vuu-ui/vuu-layout\";\nimport { IconButton } from \"@vuu-ui/vuu-ui-controls\";\nimport { LayoutJSON, VuuShellLocation } from \"@vuu-ui/vuu-utils\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport cx from \"clsx\";\nimport {\n KeyboardEventHandler,\n ReactNode,\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n} from \"react\";\n\nimport contextPanelCss from \"./ContextPanel.css\";\n\nconst classBase = \"vuuContextPanel\";\n\nexport interface ContextPanelProps {\n [key: string]: unknown;\n className?: string;\n content?: LayoutJSON;\n expanded?: boolean;\n id?: string;\n onClose?: () => void;\n overlay?: boolean;\n title?: ReactNode;\n}\n\nexport const ContextPanel = ({\n className: classNameProp,\n expanded = false,\n content: contentProp,\n id
|
|
1
|
+
{"version":3,"file":"ContextPanel.js","sources":["../../../src/shell-layout-templates/context-panel/ContextPanel.tsx"],"sourcesContent":["import {\n View,\n layoutFromJson,\n useLayoutProviderDispatch,\n} from \"@vuu-ui/vuu-layout\";\nimport { IconButton } from \"@vuu-ui/vuu-ui-controls\";\nimport { LayoutJSON, VuuShellLocation } from \"@vuu-ui/vuu-utils\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport cx from \"clsx\";\nimport {\n KeyboardEventHandler,\n ReactNode,\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n} from \"react\";\n\nimport contextPanelCss from \"./ContextPanel.css\";\n\nconst classBase = \"vuuContextPanel\";\n\nexport interface ContextPanelProps {\n [key: string]: unknown;\n className?: string;\n content?: LayoutJSON;\n expanded?: boolean;\n id?: string;\n onClose?: () => void;\n overlay?: boolean;\n title?: ReactNode;\n}\n\nexport const ContextPanel = ({\n className: classNameProp,\n expanded = false,\n content: contentProp,\n id,\n onClose,\n overlay = false,\n title,\n}: ContextPanelProps) => {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-context-panel\",\n css: contextPanelCss,\n window: targetWindow,\n });\n\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n const dispatchLayoutAction = useLayoutProviderDispatch();\n const handleClose = useCallback(() => {\n dispatchLayoutAction({\n path: `#${VuuShellLocation.ContextPanel}`,\n propName: \"expanded\",\n propValue: false,\n type: \"set-prop\",\n });\n }, [dispatchLayoutAction]);\n\n const handleKeyDown = useCallback<KeyboardEventHandler>(\n (e) => {\n if (e.key === \"Escape\") {\n handleClose();\n }\n },\n [handleClose],\n );\n\n const className = cx(classBase, classNameProp, {\n [`${classBase}-expanded`]: expanded,\n [`${classBase}-inline`]: overlay !== true,\n [`${classBase}-overlay`]: overlay,\n });\n\n const content = useMemo(\n () =>\n contentProp && expanded ? layoutFromJson(contentProp, \"context-0\") : null,\n [contentProp, expanded],\n );\n\n useLayoutEffect(() => {\n if (expanded) {\n // Components loaded into the ContextPanel will often assume focus themselves,\n //but if not, default to close button\n closeButtonRef.current?.focus();\n } else {\n onClose?.();\n }\n }, [expanded, onClose]);\n\n return (\n <div\n className={cx(classBase, className, \"vuuScrollable\", {\n [`${classBase}-expanded`]: expanded,\n })}\n id={id}\n >\n <View className={`${classBase}-inner`} header={false} id={id}>\n <div className={`${classBase}-header`}>\n <h2 className={`${classBase}-title`}>{title}</h2>\n <IconButton\n className={`${classBase}-close`}\n data-embedded\n icon=\"close\"\n onClick={handleClose}\n onKeyDown={handleKeyDown}\n ref={closeButtonRef}\n size={16}\n variant=\"secondary\"\n />\n </div>\n <div className={`${classBase}-content`}>{content}</div>\n </View>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAqBA,MAAM,SAAY,GAAA,iBAAA;AAaX,MAAM,eAAe,CAAC;AAAA,EAC3B,SAAW,EAAA,aAAA;AAAA,EACX,QAAW,GAAA,KAAA;AAA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AA,EAAW,CAAG,EAAA,SAAS,YAAa,QAAQ,EAAA,OAAA,EAAA;AAAA,OACnD,EAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.13.
|
|
2
|
+
"version": "0.13.6",
|
|
3
3
|
"description": "VUU UI Shell",
|
|
4
4
|
"author": "heswell",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@vuu-ui/vuu-data-types": "0.13.
|
|
8
|
-
"@vuu-ui/vuu-protocol-types": "0.13.
|
|
9
|
-
"@vuu-ui/vuu-table-types": "0.13.
|
|
7
|
+
"@vuu-ui/vuu-data-types": "0.13.6",
|
|
8
|
+
"@vuu-ui/vuu-protocol-types": "0.13.6",
|
|
9
|
+
"@vuu-ui/vuu-table-types": "0.13.6"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@salt-ds/core": "1.43.0",
|
|
13
13
|
"@salt-ds/styles": "0.2.1",
|
|
14
14
|
"@salt-ds/window": "0.1.1",
|
|
15
|
-
"@vuu-ui/vuu-context-menu": "0.13.
|
|
16
|
-
"@vuu-ui/vuu-data-react": "0.13.
|
|
17
|
-
"@vuu-ui/vuu-data-remote": "0.13.
|
|
18
|
-
"@vuu-ui/vuu-icons": "0.13.
|
|
19
|
-
"@vuu-ui/vuu-layout": "0.13.
|
|
20
|
-
"@vuu-ui/vuu-popups": "0.13.
|
|
21
|
-
"@vuu-ui/vuu-table": "0.13.
|
|
22
|
-
"@vuu-ui/vuu-ui-controls": "0.13.
|
|
23
|
-
"@vuu-ui/vuu-utils": "0.13.
|
|
15
|
+
"@vuu-ui/vuu-context-menu": "0.13.6",
|
|
16
|
+
"@vuu-ui/vuu-data-react": "0.13.6",
|
|
17
|
+
"@vuu-ui/vuu-data-remote": "0.13.6",
|
|
18
|
+
"@vuu-ui/vuu-icons": "0.13.6",
|
|
19
|
+
"@vuu-ui/vuu-layout": "0.13.6",
|
|
20
|
+
"@vuu-ui/vuu-popups": "0.13.6",
|
|
21
|
+
"@vuu-ui/vuu-table": "0.13.6",
|
|
22
|
+
"@vuu-ui/vuu-ui-controls": "0.13.6",
|
|
23
|
+
"@vuu-ui/vuu-utils": "0.13.6",
|
|
24
24
|
"html-to-image": "^1.11.11"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
@@ -32,16 +32,19 @@
|
|
|
32
32
|
"files": [
|
|
33
33
|
"README.md",
|
|
34
34
|
"esm",
|
|
35
|
-
"cjs"
|
|
35
|
+
"cjs",
|
|
36
|
+
"/types"
|
|
36
37
|
],
|
|
37
38
|
"exports": {
|
|
38
39
|
".": {
|
|
39
40
|
"require": "./cjs/index.js",
|
|
40
|
-
"import": "./esm/index.js"
|
|
41
|
+
"import": "./esm/index.js",
|
|
42
|
+
"types": "./types/index.d.ts"
|
|
41
43
|
}
|
|
42
44
|
},
|
|
43
45
|
"main": "cjs/index.js",
|
|
44
46
|
"module": "esm/index.js",
|
|
45
47
|
"name": "@vuu-ui/vuu-shell",
|
|
46
|
-
"type": "module"
|
|
48
|
+
"type": "module",
|
|
49
|
+
"types": "types/index.d.ts"
|
|
47
50
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ShellContextProps } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { ReactElement, ReactNode } from "react";
|
|
3
|
+
export interface ShellProviderProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
value?: ShellContextProps;
|
|
6
|
+
}
|
|
7
|
+
export declare const ShellContextProvider: ({ children, value, }: ShellProviderProps) => ReactElement;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ThemeMode } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { HTMLAttributes } from "react";
|
|
3
|
+
export interface AppHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
themeMode?: ThemeMode;
|
|
5
|
+
}
|
|
6
|
+
export declare const AppHeader: ({ className: classNameProp, themeMode: _, ...htmlAttributes }: AppHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AppHeader';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ApplicationStatusBar: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AppStatusBar";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Settings, VuuUser } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
import { SettingsSchema } from "../user-settings";
|
|
4
|
+
export interface ApplicationContextProps {
|
|
5
|
+
onUserSettingChanged: (propertyName: string, value: VuuRowDataItemType) => void;
|
|
6
|
+
loginUrl?: string;
|
|
7
|
+
userSettings?: Settings;
|
|
8
|
+
userSettingsSchema?: SettingsSchema;
|
|
9
|
+
user: VuuUser;
|
|
10
|
+
}
|
|
11
|
+
export declare const ApplicationContext: import("react").Context<ApplicationContextProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
2
|
+
import { Density, ThemeContextProps } from "@salt-ds/core";
|
|
3
|
+
import { ReactElement, ReactNode } from "react";
|
|
4
|
+
import { ApplicationContextProps } from "./ApplicationContext";
|
|
5
|
+
export interface ApplicationProviderProps extends Partial<Pick<ThemeContextProps, "theme" | "mode">>, Partial<Omit<ApplicationContextProps, "userSettings">> {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
density?: Density;
|
|
8
|
+
}
|
|
9
|
+
export declare const ApplicationProvider: ({ children, density: densityProp, loginUrl, mode, theme, userSettingsSchema: userSettingsSchema, user, }: ApplicationProviderProps) => ReactElement | null;
|
|
10
|
+
export declare const useApplicationUser: () => import("@vuu-ui/vuu-utils").VuuUser;
|
|
11
|
+
export declare const useLoginUrl: () => string | undefined;
|
|
12
|
+
export declare const useApplicationSettings: () => {
|
|
13
|
+
onUserSettingChanged: (propertyName: string, value: VuuRowDataItemType) => void;
|
|
14
|
+
userSettings: import("@vuu-ui/vuu-utils").Settings | undefined;
|
|
15
|
+
userSettingsSchema: import("..").SettingsSchema | undefined;
|
|
16
|
+
};
|
|
17
|
+
export declare const useUserSetting: () => import("@vuu-ui/vuu-utils").Settings | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ApplicationProvider";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WebSocketConnectionState } from "@vuu-ui/vuu-data-remote/src/WebSocketConnection";
|
|
2
|
+
import { HTMLAttributes } from "react";
|
|
3
|
+
interface ConnectionStateDisplayProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
className?: string;
|
|
5
|
+
connectionState?: WebSocketConnectionState;
|
|
6
|
+
showText?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const ConnectionStateDisplay: ({ connectionState: connectionStateProp, showText, ...htmlAttributes }: ConnectionStateDisplayProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { WebSocketConnectionState } from "@vuu-ui/vuu-data-remote";
|
|
2
|
+
interface ConnectionStatusIndicatorProps {
|
|
3
|
+
connectionState: WebSocketConnectionState;
|
|
4
|
+
}
|
|
5
|
+
export declare const ConnectionStatusIndicator: ({ connectionState, }: ConnectionStatusIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DynamicFeatureProps } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare function RawFeature<Params extends object | undefined>({ url, css, ComponentProps: params, ...props }: DynamicFeatureProps<Params>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
/**
|
|
5
|
+
Feature is a wrapper around React Lazy Loading. It will load a component
|
|
6
|
+
from the given url. That url must resolve to a javascript bundle with a
|
|
7
|
+
single default export. That export must be a React component.
|
|
8
|
+
*/
|
|
9
|
+
export declare const Feature: React.MemoExoticComponent<typeof RawFeature>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DynamicFeatureProps } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import React, { ErrorInfo, ReactNode } from "react";
|
|
3
|
+
export interface FeatureErrorBoundaryProps extends DynamicFeatureProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare class FeatureErrorBoundary extends React.Component<FeatureErrorBoundaryProps, any> {
|
|
7
|
+
constructor(props: FeatureErrorBoundaryProps);
|
|
8
|
+
static getDerivedStateFromError(error: Error): {
|
|
9
|
+
errorMessage: string;
|
|
10
|
+
};
|
|
11
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
12
|
+
render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Loader: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Feature';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DynamicFeatureDescriptor, DynamicFeatureProps, FilterTableFeatureProps, StaticFeatureDescriptor, SystemLayoutMetadata } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { ReactElement, ReactNode } from "react";
|
|
3
|
+
export interface FeatureContextProps {
|
|
4
|
+
dynamicFeatures?: DynamicFeatureProps[];
|
|
5
|
+
tableFeatures?: DynamicFeatureProps<FilterTableFeatureProps>[];
|
|
6
|
+
staticFeatures?: StaticFeatureDescriptor[];
|
|
7
|
+
}
|
|
8
|
+
export interface LayoutContextProps {
|
|
9
|
+
systemLayouts?: SystemLayoutMetadata[];
|
|
10
|
+
}
|
|
11
|
+
export interface FeatureAndLayoutProviderProps extends Partial<FeatureContextProps> {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
dynamicFeatures?: DynamicFeatureDescriptor[];
|
|
14
|
+
staticFeatures?: StaticFeatureDescriptor[];
|
|
15
|
+
systemLayouts?: SystemLayoutMetadata[];
|
|
16
|
+
}
|
|
17
|
+
export declare const FeatureAndLayoutProvider: ({ children, dynamicFeatures: dynamicFeaturesProp, staticFeatures, systemLayouts, }: FeatureAndLayoutProviderProps) => ReactElement;
|
|
18
|
+
export declare const useFeatures: () => FeatureContextProps;
|
|
19
|
+
export declare const useLayouts: () => LayoutContextProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FeatureAndLayoutProvider";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DynamicFeatureProps, StaticFeatureDescriptor } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { HTMLAttributes } from "react";
|
|
3
|
+
export type GroupedFeatureProps<P extends object | undefined = object> = Record<string, DynamicFeatureProps<P>[]>;
|
|
4
|
+
export interface FeatureListProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
features: DynamicFeatureProps[] | GroupedFeatureProps | StaticFeatureDescriptor[];
|
|
6
|
+
}
|
|
7
|
+
export declare const FeatureList: ({ features, title, ...htmlAttributes }: FeatureListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FeatureList";
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./application-provider";
|
|
2
|
+
export * from "./app-header";
|
|
3
|
+
export * from "./connection-status";
|
|
4
|
+
export * from "./feature";
|
|
5
|
+
export * from "./feature-and-layout-provider";
|
|
6
|
+
export * from "./left-nav";
|
|
7
|
+
export * from "./login";
|
|
8
|
+
export * from "./persistence-manager";
|
|
9
|
+
export * from "./shell";
|
|
10
|
+
export * from "./shell-layout-templates";
|
|
11
|
+
export * from "./ShellContextProvider";
|
|
12
|
+
export * from "./feature-list";
|
|
13
|
+
export * from "./theme-switch";
|
|
14
|
+
export * from "./user-settings";
|
|
15
|
+
export * from "./workspace-management";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
export type NavDisplayStatus = "menu-full" | "menu-icons" | "menu-full-content" | "menu-icons-content";
|
|
3
|
+
export type NavDisplayStatusHandler = (navDisplayStatus: NavDisplayStatus) => void;
|
|
4
|
+
export interface LeftNavProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
"data-path"?: string;
|
|
6
|
+
defaultActiveTabIndex?: number;
|
|
7
|
+
defaultExpanded?: boolean;
|
|
8
|
+
onActiveChange?: (activeTabIndex: number) => void;
|
|
9
|
+
onTogglePrimaryMenu?: (expanded: boolean) => void;
|
|
10
|
+
sizeCollapsed?: number;
|
|
11
|
+
sizeContent?: number;
|
|
12
|
+
sizeExpanded?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const LeftNav: (props: LeftNavProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./LeftNav";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
export interface LoginPanelProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSubmit"> {
|
|
3
|
+
appName?: string;
|
|
4
|
+
onSubmit: (username: string, password?: string) => void;
|
|
5
|
+
requirePassword?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const LoginPanel: ({ appName, className, requirePassword, onSubmit, ...htmlAttributes }: LoginPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VuuLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ApplicationJSON, LayoutJSON, Settings, Layout, LayoutMetadata, LayoutMetadataDto } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { IPersistenceManager } from "./PersistenceManager";
|
|
3
|
+
export declare class LocalPersistenceManager implements IPersistenceManager {
|
|
4
|
+
#private;
|
|
5
|
+
metadataSaveLocation: string;
|
|
6
|
+
layoutsSaveLocation: string;
|
|
7
|
+
constructor(urlKey?: string);
|
|
8
|
+
createLayout(metadata: LayoutMetadataDto, layout: LayoutJSON): Promise<LayoutMetadata>;
|
|
9
|
+
updateLayout(id: string, newMetadata: LayoutMetadataDto, newLayout: LayoutJSON): Promise<void>;
|
|
10
|
+
deleteLayout(id: string): Promise<void>;
|
|
11
|
+
loadLayout(id: string): Promise<LayoutJSON>;
|
|
12
|
+
loadMetadata(): Promise<LayoutMetadata[]>;
|
|
13
|
+
loadApplicationJSON(): Promise<ApplicationJSON | undefined>;
|
|
14
|
+
saveApplicationJSON(applicationJSON: ApplicationJSON): Promise<void>;
|
|
15
|
+
loadLayouts: () => Promise<Layout[]>;
|
|
16
|
+
saveLayoutsWithMetadata: (layouts: Layout[], metadata: LayoutMetadata[]) => void;
|
|
17
|
+
validateIds: (id: string) => Promise<void>;
|
|
18
|
+
validateId: (id: string, dataType: "metadata" | "layout") => Promise<void>;
|
|
19
|
+
getUserSettings(): Promise<Settings>;
|
|
20
|
+
saveUserSettings(userSettings: Settings): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { ApplicationJSON, LayoutJSON, LayoutMetadata, LayoutMetadataDto, Settings } from "@vuu-ui/vuu-utils";
|
|
2
|
+
export interface IPersistenceManager {
|
|
3
|
+
/**
|
|
4
|
+
* Saves a new layout and its corresponding metadata
|
|
5
|
+
*
|
|
6
|
+
* @param metadata - Metadata about the layout to be saved
|
|
7
|
+
* @param layout - Full JSON representation of the layout to be saved
|
|
8
|
+
*
|
|
9
|
+
* @returns Unique identifier assigned to the saved layout
|
|
10
|
+
*/
|
|
11
|
+
createLayout: (metadata: LayoutMetadataDto, layout: LayoutJSON) => Promise<LayoutMetadata>;
|
|
12
|
+
/**
|
|
13
|
+
* Overwrites an existing layout and its corresponding metadata with the provided information
|
|
14
|
+
*
|
|
15
|
+
* @param id - Unique identifier of the existing layout to be updated
|
|
16
|
+
* @param metadata - Metadata describing the new layout to overwrite with
|
|
17
|
+
* @param layout - Full JSON representation of the new layout to overwrite with
|
|
18
|
+
*/
|
|
19
|
+
updateLayout: (id: string, metadata: LayoutMetadataDto, layout: LayoutJSON) => Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Deletes an existing layout and its corresponding metadata
|
|
22
|
+
*
|
|
23
|
+
* @param id - Unique identifier of the existing layout to be deleted
|
|
24
|
+
*/
|
|
25
|
+
deleteLayout: (id: string) => Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves an existing layout
|
|
28
|
+
*
|
|
29
|
+
* @param id - Unique identifier of the existing layout to be retrieved
|
|
30
|
+
*
|
|
31
|
+
* @returns Full JSON representation of the layout corresponding to the provided ID
|
|
32
|
+
*/
|
|
33
|
+
loadLayout: (id: string) => Promise<LayoutJSON>;
|
|
34
|
+
/**
|
|
35
|
+
* Retrieves metadata for all existing layouts
|
|
36
|
+
*
|
|
37
|
+
* @returns an array of all persisted layout metadata
|
|
38
|
+
*/
|
|
39
|
+
loadMetadata: () => Promise<LayoutMetadata[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves the application JSON. This includes the application layout,
|
|
42
|
+
* which describes all layouts on screen
|
|
43
|
+
*
|
|
44
|
+
* @returns Full JSON representation of the application json
|
|
45
|
+
*/
|
|
46
|
+
loadApplicationJSON: () => Promise<ApplicationJSON | undefined>;
|
|
47
|
+
/**
|
|
48
|
+
* Saves the application JSON. This includes the application layout,
|
|
49
|
+
* which describes all layouts on screen
|
|
50
|
+
*
|
|
51
|
+
* @param layout - Full JSON representation of the application layout to be saved
|
|
52
|
+
*/
|
|
53
|
+
saveApplicationJSON: (layout: ApplicationJSON) => Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Save user settings. These get saved within the Application JSON.
|
|
56
|
+
*
|
|
57
|
+
* @param userSettings
|
|
58
|
+
*/
|
|
59
|
+
saveUserSettings: (userSettings: Settings) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Get the user settings. These are stored within Application JSON.
|
|
62
|
+
*
|
|
63
|
+
* @returns userSettings
|
|
64
|
+
*/
|
|
65
|
+
getUserSettings: () => Promise<Settings>;
|
|
66
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
2
|
+
import { IPersistenceManager } from ".";
|
|
3
|
+
export interface PersistenceContextProps {
|
|
4
|
+
persistenceManager?: IPersistenceManager;
|
|
5
|
+
}
|
|
6
|
+
export declare const PersistenceContext: import("react").Context<PersistenceContextProps>;
|
|
7
|
+
export interface PersistenceProviderProps extends PersistenceContextProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const PersistenceProvider: ({ children, persistenceManager, }: PersistenceProviderProps) => ReactElement;
|
|
11
|
+
export declare const usePersistenceManager: () => IPersistenceManager | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ApplicationJSON, LayoutJSON, LayoutMetadata, LayoutMetadataDto, Settings } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { IPersistenceManager } from "./PersistenceManager";
|
|
3
|
+
export type CreateLayoutResponseDto = {
|
|
4
|
+
metadata: LayoutMetadata;
|
|
5
|
+
};
|
|
6
|
+
export type GetLayoutResponseDto = {
|
|
7
|
+
definition: LayoutJSON;
|
|
8
|
+
};
|
|
9
|
+
export type GetApplicationResponseDto = {
|
|
10
|
+
definition: ApplicationJSON;
|
|
11
|
+
};
|
|
12
|
+
export declare class RemotePersistenceManager implements IPersistenceManager {
|
|
13
|
+
username: string;
|
|
14
|
+
createLayout(metadata: LayoutMetadataDto, layout: LayoutJSON): Promise<LayoutMetadata>;
|
|
15
|
+
updateLayout(id: string, metadata: LayoutMetadataDto, newLayoutJson: LayoutJSON): Promise<void>;
|
|
16
|
+
deleteLayout(id: string): Promise<void>;
|
|
17
|
+
loadLayout(id: string): Promise<LayoutJSON>;
|
|
18
|
+
loadMetadata(): Promise<LayoutMetadata[]>;
|
|
19
|
+
saveApplicationJSON(applicationJSON: ApplicationJSON): Promise<void>;
|
|
20
|
+
loadApplicationJSON(): Promise<ApplicationJSON>;
|
|
21
|
+
getUserSettings(): Promise<{}>;
|
|
22
|
+
saveUserSettings(userSettings: Settings): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ApplicationJSON, LayoutJSON, LayoutMetadata, Settings } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { IPersistenceManager } from "./PersistenceManager";
|
|
3
|
+
export declare class StaticPersistenceManager implements IPersistenceManager {
|
|
4
|
+
#private;
|
|
5
|
+
constructor({ applicationJSON, applicationLoadDelay, layoutMetadata, }: {
|
|
6
|
+
applicationJSON?: ApplicationJSON;
|
|
7
|
+
applicationLoadDelay?: number;
|
|
8
|
+
layoutMetadata?: LayoutMetadata[];
|
|
9
|
+
});
|
|
10
|
+
createLayout(): Promise<LayoutMetadata>;
|
|
11
|
+
updateLayout(): Promise<void>;
|
|
12
|
+
deleteLayout(): Promise<void>;
|
|
13
|
+
loadLayout(id: string): Promise<LayoutJSON<{
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}>>;
|
|
16
|
+
loadMetadata(): Promise<LayoutMetadata[]>;
|
|
17
|
+
loadApplicationJSON(): Promise<ApplicationJSON | undefined>;
|
|
18
|
+
saveApplicationJSON(applicationJson: ApplicationJSON): Promise<void>;
|
|
19
|
+
getUserSettings(): Promise<Settings>;
|
|
20
|
+
saveUserSettings(userSettings: Settings): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LayoutJSON } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
export interface ContextPanelProps {
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
className?: string;
|
|
6
|
+
content?: LayoutJSON;
|
|
7
|
+
expanded?: boolean;
|
|
8
|
+
id?: string;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
overlay?: boolean;
|
|
11
|
+
title?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare const ContextPanel: ({ className: classNameProp, expanded, content: contentProp, id, onClose, overlay, title, }: ContextPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ContextPanel";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
export interface SidePanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
path?: string;
|
|
5
|
+
sizeOpen?: number;
|
|
6
|
+
sizeClosed?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const SidePanel: ({ children, open, sizeClosed, sizeOpen, style: styleProp, ...htmlAttributes }: SidePanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SidePanel";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactElement, ReactNode } from "react";
|
|
2
|
+
import { SidePanelProps as ShellSidePanelProps } from "./side-panel";
|
|
3
|
+
declare const LayoutHook: {
|
|
4
|
+
"full-height": ShellLayoutTemplateHook;
|
|
5
|
+
inlay: ShellLayoutTemplateHook;
|
|
6
|
+
"left-main-tabs": ShellLayoutTemplateHook;
|
|
7
|
+
"simple-content-pane": ShellLayoutTemplateHook;
|
|
8
|
+
};
|
|
9
|
+
export type LayoutTemplateId = keyof typeof LayoutHook;
|
|
10
|
+
export type ShellLayoutTemplateProps = Omit<ShellLayoutProps, "layoutTemplateId">;
|
|
11
|
+
export type ShellToolbarProps = {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
position?: "left";
|
|
14
|
+
width?: number;
|
|
15
|
+
};
|
|
16
|
+
export type ShellLayoutTemplateHook = (props: ShellLayoutTemplateProps) => ReactElement;
|
|
17
|
+
/**
|
|
18
|
+
* The Shell Layout is the outermost 'chrome' of the appliciation,
|
|
19
|
+
* enclosing the main content area. It will be rendered by one of
|
|
20
|
+
* two available templates, determined by the layoutTemplateId,
|
|
21
|
+
*/
|
|
22
|
+
export interface ShellLayoutProps {
|
|
23
|
+
/**
|
|
24
|
+
* App Header will be rendered in position determined by layout-template
|
|
25
|
+
*/
|
|
26
|
+
appHeader?: ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* HTML attributes that will be applied to root div.
|
|
29
|
+
*/
|
|
30
|
+
htmlAttributes?: HTMLAttributes<HTMLDivElement>;
|
|
31
|
+
/**
|
|
32
|
+
* identifier for shell layout template to be used. Default template
|
|
33
|
+
* will be "inlay"
|
|
34
|
+
*/
|
|
35
|
+
layoutTemplateId?: LayoutTemplateId;
|
|
36
|
+
/**
|
|
37
|
+
* If template renders SidePanel, these props will be provided
|
|
38
|
+
*/
|
|
39
|
+
SidePanelProps?: ShellSidePanelProps;
|
|
40
|
+
/**
|
|
41
|
+
* If template renders Toolbar, these props will be provided
|
|
42
|
+
*/
|
|
43
|
+
ToolbarProps?: ShellToolbarProps;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* This hook acts as a stub for the actual shell layout
|
|
47
|
+
* template hooks. It will delegate to the appropriate shell
|
|
48
|
+
* layout hook, based on the value of layoutTemplateId.
|
|
49
|
+
*/
|
|
50
|
+
export declare const useShellLayout: ({ layoutTemplateId, ...props }: ShellLayoutProps) => ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
51
|
+
export {};
|
package/types/shell.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VuuUser } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
3
|
+
import { ShellLayoutProps } from "./shell-layout-templates";
|
|
4
|
+
import { SettingsSchema } from "./user-settings";
|
|
5
|
+
import { WorkspaceProps } from "./workspace-management";
|
|
6
|
+
export type LayoutTemplateName = "full-height" | "inlay";
|
|
7
|
+
export interface ShellProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
shellLayoutProps?: ShellLayoutProps;
|
|
9
|
+
userSettingsSchema?: SettingsSchema;
|
|
10
|
+
workspaceProps?: WorkspaceProps;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
loginUrl?: string;
|
|
13
|
+
saveUrl?: string;
|
|
14
|
+
serverUrl?: string;
|
|
15
|
+
user: VuuUser;
|
|
16
|
+
}
|
|
17
|
+
export declare const Shell: ({ loginUrl, user, userSettingsSchema, workspaceProps, ...props }: ShellProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import { ThemeMode } from "@vuu-ui/vuu-utils";
|
|
3
|
+
export interface ThemeSwitchProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
4
|
+
defaultMode?: ThemeMode;
|
|
5
|
+
mode?: ThemeMode;
|
|
6
|
+
onChange: (mode: ThemeMode) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const ThemeSwitch: ({ className: classNameProp, defaultMode: defaultModeProp, mode: modeProp, onChange, ...htmlAttributes }: ThemeSwitchProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ThemeSwitch";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function useForceRender(): import("react").Dispatch<import("react").SetStateAction<{}>>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
2
|
+
import { Settings } from "@vuu-ui/vuu-utils";
|
|
3
|
+
import { DropdownProps } from "@salt-ds/core";
|
|
4
|
+
import { FormEventHandler, HTMLAttributes } from "react";
|
|
5
|
+
export interface SettingsSchema {
|
|
6
|
+
properties: SettingsProperty[];
|
|
7
|
+
}
|
|
8
|
+
export type Option<T> = {
|
|
9
|
+
label: string;
|
|
10
|
+
value: T;
|
|
11
|
+
};
|
|
12
|
+
export declare const isOption: (value: Option<number | string> | number | string) => value is Option<number | string>;
|
|
13
|
+
export interface BaseProperty {
|
|
14
|
+
name: string;
|
|
15
|
+
label: string;
|
|
16
|
+
}
|
|
17
|
+
export interface StringProperty extends BaseProperty {
|
|
18
|
+
values?: string[] | Option<string>[];
|
|
19
|
+
defaultValue?: string;
|
|
20
|
+
type: "string";
|
|
21
|
+
}
|
|
22
|
+
export interface NumericProperty extends BaseProperty {
|
|
23
|
+
values?: number[] | Option<number>[];
|
|
24
|
+
defaultValue?: number;
|
|
25
|
+
type: "number";
|
|
26
|
+
}
|
|
27
|
+
export interface BooleanProperty extends BaseProperty {
|
|
28
|
+
defaultValue?: boolean;
|
|
29
|
+
type: "boolean";
|
|
30
|
+
}
|
|
31
|
+
export type SettingsProperty = StringProperty | NumericProperty | BooleanProperty;
|
|
32
|
+
export declare const isBooleanProperty: (property: SettingsProperty) => property is BooleanProperty;
|
|
33
|
+
export declare const isStringOrNumber: (value: unknown) => value is string | number;
|
|
34
|
+
export declare function FormControl({ property, changeHandler, selectHandler, inputHandler, currentValue, }: {
|
|
35
|
+
property: SettingsProperty;
|
|
36
|
+
changeHandler: FormEventHandler;
|
|
37
|
+
selectHandler: DropdownProps["onSelectionChange"];
|
|
38
|
+
inputHandler: FormEventHandler;
|
|
39
|
+
currentValue: VuuRowDataItemType;
|
|
40
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
41
|
+
export interface SettingsFormProps extends HTMLAttributes<HTMLDivElement> {
|
|
42
|
+
settingsSchema: SettingsSchema;
|
|
43
|
+
settings: Settings;
|
|
44
|
+
onSettingChanged: (propertyName: string, value: string | number | boolean) => void;
|
|
45
|
+
}
|
|
46
|
+
export declare const SettingsForm: ({ className, settingsSchema, settings, onSettingChanged, ...htmlAttributes }: SettingsFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LayoutJSON, LayoutMetadata, SystemLayoutMetadata } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { HTMLAttributes } from "react";
|
|
3
|
+
export interface LayoutTileProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
metadata: LayoutMetadata | SystemLayoutMetadata;
|
|
5
|
+
onLoadLayout: (layoutId?: string, layoutJSON?: LayoutJSON) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const LayoutTile: ({ metadata, onLoadLayout, ...htmlAttributes }: LayoutTileProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LayoutMetadataDto } from "@vuu-ui/vuu-utils";
|
|
2
|
+
type SaveLayoutPanelProps = {
|
|
3
|
+
componentId?: string;
|
|
4
|
+
defaultTitle?: string;
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
onSave: (layoutMetadata: LayoutMetadataDto) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const SaveLayoutPanel: (props: SaveLayoutPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { LayoutMetadata, LayoutMetadataDto, type ApplicationSetting, type ApplicationSettings, type LayoutJSON } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { ReactElement } from "react";
|
|
3
|
+
import { type WorkspaceStackProps } from "./defaultWorkspaceJSON";
|
|
4
|
+
export type WorkspaceProps = WorkspaceStackProps & {
|
|
5
|
+
layoutPlaceholderJSON?: LayoutJSON;
|
|
6
|
+
/**
|
|
7
|
+
* layoutJSON defines the default layout to render on first load and until such time as
|
|
8
|
+
* layout state has been persisted. After that, the persisted state will be rendered.
|
|
9
|
+
*/
|
|
10
|
+
layoutJSON?: LayoutJSON | LayoutJSON[];
|
|
11
|
+
activeLayoutIndex?: number;
|
|
12
|
+
/**
|
|
13
|
+
* The Vuu workspace is the container into which layouts are loaded. By default, it will be
|
|
14
|
+
* a Tabbed Panel (Stack + Tabstrip), showing a tab per Layout.
|
|
15
|
+
*/
|
|
16
|
+
workspaceJSON?: LayoutJSON | LayoutJSON[];
|
|
17
|
+
};
|
|
18
|
+
export interface WorkspaceProviderProps extends WorkspaceProps {
|
|
19
|
+
children: ReactElement | ReactElement[];
|
|
20
|
+
/**
|
|
21
|
+
* layoutPlaceholderJSON defines the layout to render when a new workspace layout is created.
|
|
22
|
+
*/
|
|
23
|
+
layoutPlaceholderJSON?: LayoutJSON;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* LayoutManagementProvider supplies an API for loading and saving layout documents.
|
|
27
|
+
* Initial layout is automatically loaded on startup. Because this hook is responsible
|
|
28
|
+
* only for loading and saving layouts, it only triggers a render when content is loaded.
|
|
29
|
+
*
|
|
30
|
+
* Initial layout displays a loading state
|
|
31
|
+
* User may supply a default layout. This will not be displayed until call has been made to
|
|
32
|
+
* persistenceManager to retrieve stored layout state. If no stored state is returned, the
|
|
33
|
+
* default layout provided by user will be set as current state (and hence rendered). If no
|
|
34
|
+
* default layout has been provided by user, the sysem default will be used (simple PlaceHolder)
|
|
35
|
+
* If saved layout state has been returned, that will be set as current state (and rendered)
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
export declare const WorkspaceProvider: ({ TabstripProps, children, layoutJSON, activeLayoutIndex, layoutPlaceholderJSON, showTabs, workspaceJSON: customWorkspaceJSON, }: WorkspaceProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare const useWorkspace: () => {
|
|
40
|
+
workspaceJSON: LayoutJSON<{
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
}> | LayoutJSON<{
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
}>[];
|
|
45
|
+
layoutMetadata: LayoutMetadata[];
|
|
46
|
+
layoutPlaceholderJSON?: LayoutJSON;
|
|
47
|
+
getApplicationSettings: (key?: keyof ApplicationSettings) => ApplicationSettings | ApplicationSetting | undefined;
|
|
48
|
+
loadLayoutById: (id: string) => void;
|
|
49
|
+
saveApplicationSettings: (settings: ApplicationSettings | ApplicationSetting, key?: keyof ApplicationSettings) => void;
|
|
50
|
+
saveLayout: (n: LayoutMetadataDto) => void;
|
|
51
|
+
saveApplicationLayout: (layout: LayoutJSON) => void;
|
|
52
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StackProps } from "@vuu-ui/vuu-layout";
|
|
2
|
+
import { LayoutJSON } from "@vuu-ui/vuu-utils";
|
|
3
|
+
export type WorkspaceStackProps = Pick<StackProps, "showTabs" | "TabstripProps">;
|
|
4
|
+
export declare const warningLayout: LayoutJSON;
|
|
5
|
+
export declare const loadingJSON: Readonly<LayoutJSON>;
|
|
6
|
+
export declare const defaultWorkspaceJSON: LayoutJSON<StackProps & {
|
|
7
|
+
preserve: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const getStackWorkspaceJSON: (activeLayoutIndex?: number) => LayoutJSON;
|
|
10
|
+
export declare const getWorkspaceWithLayoutJSON: (customWorkspaceJSON?: LayoutJSON | LayoutJSON[], layoutJSON?: LayoutJSON | LayoutJSON[], activeLayoutIndex?: number, stackProps?: WorkspaceStackProps) => LayoutJSON | LayoutJSON[];
|