@vuu-ui/vuu-shell 2.1.18 → 2.1.19-beta.1
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/package.json +16 -18
- package/types/feature/FeatureErrorBoundary.d.ts +1 -1
- package/types/workspace-management/WorkspaceProvider.d.ts +5 -5
- package/cjs/ShellContextProvider.js +0 -25
- package/cjs/ShellContextProvider.js.map +0 -1
- package/cjs/app-header/AppHeader.css.js +0 -6
- package/cjs/app-header/AppHeader.css.js.map +0 -1
- package/cjs/app-header/AppHeader.js +0 -118
- package/cjs/app-header/AppHeader.js.map +0 -1
- package/cjs/application-provider/ApplicationContext.js +0 -17
- package/cjs/application-provider/ApplicationContext.js.map +0 -1
- package/cjs/application-provider/ApplicationProvider.js +0 -102
- package/cjs/application-provider/ApplicationProvider.js.map +0 -1
- package/cjs/feature/Feature.js +0 -54
- package/cjs/feature/Feature.js.map +0 -1
- package/cjs/feature/FeatureErrorBoundary.js +0 -30
- package/cjs/feature/FeatureErrorBoundary.js.map +0 -1
- package/cjs/feature-and-layout-provider/FeatureAndLayoutProvider.js +0 -60
- package/cjs/feature-and-layout-provider/FeatureAndLayoutProvider.js.map +0 -1
- package/cjs/feature-list/FeatureList.css.js +0 -6
- package/cjs/feature-list/FeatureList.css.js.map +0 -1
- package/cjs/feature-list/FeatureList.js +0 -109
- package/cjs/feature-list/FeatureList.js.map +0 -1
- package/cjs/index.js +0 -71
- package/cjs/index.js.map +0 -1
- package/cjs/left-nav/LeftNav.css.js +0 -6
- package/cjs/left-nav/LeftNav.css.js.map +0 -1
- package/cjs/left-nav/LeftNav.js +0 -202
- package/cjs/left-nav/LeftNav.js.map +0 -1
- package/cjs/login/LoginPanel.css.js +0 -6
- package/cjs/login/LoginPanel.css.js.map +0 -1
- package/cjs/login/LoginPanel.js +0 -110
- package/cjs/login/LoginPanel.js.map +0 -1
- package/cjs/login/VuuLogo.js +0 -134
- package/cjs/login/VuuLogo.js.map +0 -1
- package/cjs/persistence-manager/LocalPersistenceManager.js +0 -193
- package/cjs/persistence-manager/LocalPersistenceManager.js.map +0 -1
- package/cjs/persistence-manager/PersistenceProvider.js +0 -21
- package/cjs/persistence-manager/PersistenceProvider.js.map +0 -1
- package/cjs/persistence-manager/RemotePersistenceManager.js +0 -165
- package/cjs/persistence-manager/RemotePersistenceManager.js.map +0 -1
- package/cjs/persistence-manager/StaticPersistenceManager.js +0 -73
- package/cjs/persistence-manager/StaticPersistenceManager.js.map +0 -1
- package/cjs/shell-layout-templates/context-panel/ContextPanel.css.js +0 -6
- package/cjs/shell-layout-templates/context-panel/ContextPanel.css.js.map +0 -1
- package/cjs/shell-layout-templates/context-panel/ContextPanel.js +0 -100
- package/cjs/shell-layout-templates/context-panel/ContextPanel.js.map +0 -1
- package/cjs/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +0 -51
- package/cjs/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js.map +0 -1
- package/cjs/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js +0 -83
- package/cjs/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js.map +0 -1
- package/cjs/shell-layout-templates/left-main-tabs/useLeftMainTabs.js +0 -46
- package/cjs/shell-layout-templates/left-main-tabs/useLeftMainTabs.js.map +0 -1
- package/cjs/shell-layout-templates/side-panel/SidePanel.css.js +0 -6
- package/cjs/shell-layout-templates/side-panel/SidePanel.css.js.map +0 -1
- package/cjs/shell-layout-templates/side-panel/SidePanel.js +0 -36
- package/cjs/shell-layout-templates/side-panel/SidePanel.js.map +0 -1
- package/cjs/shell-layout-templates/simple-content-pane/useSimpleContentPane.js +0 -48
- package/cjs/shell-layout-templates/simple-content-pane/useSimpleContentPane.js.map +0 -1
- package/cjs/shell-layout-templates/useShellLayout.js +0 -23
- package/cjs/shell-layout-templates/useShellLayout.js.map +0 -1
- package/cjs/shell.css.js +0 -6
- package/cjs/shell.css.js.map +0 -1
- package/cjs/shell.js +0 -137
- package/cjs/shell.js.map +0 -1
- package/cjs/theme-switch/ThemeSwitch.css.js +0 -6
- package/cjs/theme-switch/ThemeSwitch.css.js.map +0 -1
- package/cjs/theme-switch/ThemeSwitch.js +0 -56
- package/cjs/theme-switch/ThemeSwitch.js.map +0 -1
- package/cjs/user-settings/SettingsForm.css.js +0 -6
- package/cjs/user-settings/SettingsForm.css.js.map +0 -1
- package/cjs/user-settings/SettingsForm.js +0 -168
- package/cjs/user-settings/SettingsForm.js.map +0 -1
- package/cjs/user-settings/UserSettingsPanel.css.js +0 -6
- package/cjs/user-settings/UserSettingsPanel.css.js.map +0 -1
- package/cjs/user-settings/UserSettingsPanel.js +0 -42
- package/cjs/user-settings/UserSettingsPanel.js.map +0 -1
- package/cjs/workspace-management/LayoutList.css.js +0 -6
- package/cjs/workspace-management/LayoutList.css.js.map +0 -1
- package/cjs/workspace-management/LayoutList.js +0 -116
- package/cjs/workspace-management/LayoutList.js.map +0 -1
- package/cjs/workspace-management/LayoutTile.css.js +0 -6
- package/cjs/workspace-management/LayoutTile.css.js.map +0 -1
- package/cjs/workspace-management/LayoutTile.js +0 -41
- package/cjs/workspace-management/LayoutTile.js.map +0 -1
- package/cjs/workspace-management/SaveLayoutPanel.css.js +0 -6
- package/cjs/workspace-management/SaveLayoutPanel.css.js.map +0 -1
- package/cjs/workspace-management/SaveLayoutPanel.js +0 -128
- package/cjs/workspace-management/SaveLayoutPanel.js.map +0 -1
- package/cjs/workspace-management/WorkspaceProvider.js +0 -265
- package/cjs/workspace-management/WorkspaceProvider.js.map +0 -1
- package/cjs/workspace-management/defaultWorkspaceJSON.js +0 -101
- package/cjs/workspace-management/defaultWorkspaceJSON.js.map +0 -1
- package/cjs/workspace-management/screenshot-utils.js +0 -25
- package/cjs/workspace-management/screenshot-utils.js.map +0 -1
- package/cjs/workspace-management/useWorkspaceContextMenuItems.js +0 -72
- package/cjs/workspace-management/useWorkspaceContextMenuItems.js.map +0 -1
- package/esm/ShellContextProvider.js +0 -23
- package/esm/ShellContextProvider.js.map +0 -1
- package/esm/app-header/AppHeader.css.js +0 -4
- package/esm/app-header/AppHeader.css.js.map +0 -1
- package/esm/app-header/AppHeader.js +0 -116
- package/esm/app-header/AppHeader.js.map +0 -1
- package/esm/application-provider/ApplicationContext.js +0 -15
- package/esm/application-provider/ApplicationContext.js.map +0 -1
- package/esm/application-provider/ApplicationProvider.js +0 -96
- package/esm/application-provider/ApplicationProvider.js.map +0 -1
- package/esm/feature/Feature.js +0 -52
- package/esm/feature/Feature.js.map +0 -1
- package/esm/feature/FeatureErrorBoundary.js +0 -28
- package/esm/feature/FeatureErrorBoundary.js.map +0 -1
- package/esm/feature-and-layout-provider/FeatureAndLayoutProvider.js +0 -56
- package/esm/feature-and-layout-provider/FeatureAndLayoutProvider.js.map +0 -1
- package/esm/feature-list/FeatureList.css.js +0 -4
- package/esm/feature-list/FeatureList.css.js.map +0 -1
- package/esm/feature-list/FeatureList.js +0 -107
- package/esm/feature-list/FeatureList.js.map +0 -1
- package/esm/index.js +0 -25
- package/esm/index.js.map +0 -1
- package/esm/left-nav/LeftNav.css.js +0 -4
- package/esm/left-nav/LeftNav.css.js.map +0 -1
- package/esm/left-nav/LeftNav.js +0 -200
- package/esm/left-nav/LeftNav.js.map +0 -1
- package/esm/login/LoginPanel.css.js +0 -4
- package/esm/login/LoginPanel.css.js.map +0 -1
- package/esm/login/LoginPanel.js +0 -108
- package/esm/login/LoginPanel.js.map +0 -1
- package/esm/login/VuuLogo.js +0 -132
- package/esm/login/VuuLogo.js.map +0 -1
- package/esm/persistence-manager/LocalPersistenceManager.js +0 -191
- package/esm/persistence-manager/LocalPersistenceManager.js.map +0 -1
- package/esm/persistence-manager/PersistenceProvider.js +0 -17
- package/esm/persistence-manager/PersistenceProvider.js.map +0 -1
- package/esm/persistence-manager/RemotePersistenceManager.js +0 -163
- package/esm/persistence-manager/RemotePersistenceManager.js.map +0 -1
- package/esm/persistence-manager/StaticPersistenceManager.js +0 -71
- package/esm/persistence-manager/StaticPersistenceManager.js.map +0 -1
- package/esm/shell-layout-templates/context-panel/ContextPanel.css.js +0 -4
- package/esm/shell-layout-templates/context-panel/ContextPanel.css.js.map +0 -1
- package/esm/shell-layout-templates/context-panel/ContextPanel.js +0 -98
- package/esm/shell-layout-templates/context-panel/ContextPanel.js.map +0 -1
- package/esm/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +0 -49
- package/esm/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js.map +0 -1
- package/esm/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js +0 -81
- package/esm/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js.map +0 -1
- package/esm/shell-layout-templates/left-main-tabs/useLeftMainTabs.js +0 -44
- package/esm/shell-layout-templates/left-main-tabs/useLeftMainTabs.js.map +0 -1
- package/esm/shell-layout-templates/side-panel/SidePanel.css.js +0 -4
- package/esm/shell-layout-templates/side-panel/SidePanel.css.js.map +0 -1
- package/esm/shell-layout-templates/side-panel/SidePanel.js +0 -34
- package/esm/shell-layout-templates/side-panel/SidePanel.js.map +0 -1
- package/esm/shell-layout-templates/simple-content-pane/useSimpleContentPane.js +0 -46
- package/esm/shell-layout-templates/simple-content-pane/useSimpleContentPane.js.map +0 -1
- package/esm/shell-layout-templates/useShellLayout.js +0 -21
- package/esm/shell-layout-templates/useShellLayout.js.map +0 -1
- package/esm/shell.css.js +0 -4
- package/esm/shell.css.js.map +0 -1
- package/esm/shell.js +0 -135
- package/esm/shell.js.map +0 -1
- package/esm/theme-switch/ThemeSwitch.css.js +0 -4
- package/esm/theme-switch/ThemeSwitch.css.js.map +0 -1
- package/esm/theme-switch/ThemeSwitch.js +0 -54
- package/esm/theme-switch/ThemeSwitch.js.map +0 -1
- package/esm/user-settings/SettingsForm.css.js +0 -4
- package/esm/user-settings/SettingsForm.css.js.map +0 -1
- package/esm/user-settings/SettingsForm.js +0 -162
- package/esm/user-settings/SettingsForm.js.map +0 -1
- package/esm/user-settings/UserSettingsPanel.css.js +0 -4
- package/esm/user-settings/UserSettingsPanel.css.js.map +0 -1
- package/esm/user-settings/UserSettingsPanel.js +0 -40
- package/esm/user-settings/UserSettingsPanel.js.map +0 -1
- package/esm/workspace-management/LayoutList.css.js +0 -4
- package/esm/workspace-management/LayoutList.css.js.map +0 -1
- package/esm/workspace-management/LayoutList.js +0 -114
- package/esm/workspace-management/LayoutList.js.map +0 -1
- package/esm/workspace-management/LayoutTile.css.js +0 -4
- package/esm/workspace-management/LayoutTile.css.js.map +0 -1
- package/esm/workspace-management/LayoutTile.js +0 -39
- package/esm/workspace-management/LayoutTile.js.map +0 -1
- package/esm/workspace-management/SaveLayoutPanel.css.js +0 -4
- package/esm/workspace-management/SaveLayoutPanel.css.js.map +0 -1
- package/esm/workspace-management/SaveLayoutPanel.js +0 -126
- package/esm/workspace-management/SaveLayoutPanel.js.map +0 -1
- package/esm/workspace-management/WorkspaceProvider.js +0 -262
- package/esm/workspace-management/WorkspaceProvider.js.map +0 -1
- package/esm/workspace-management/defaultWorkspaceJSON.js +0 -95
- package/esm/workspace-management/defaultWorkspaceJSON.js.map +0 -1
- package/esm/workspace-management/screenshot-utils.js +0 -23
- package/esm/workspace-management/screenshot-utils.js.map +0 -1
- package/esm/workspace-management/useWorkspaceContextMenuItems.js +0 -70
- package/esm/workspace-management/useWorkspaceContextMenuItems.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
2
|
+
"version": "2.1.19-beta.1",
|
|
3
3
|
"description": "VUU UI Shell",
|
|
4
4
|
"author": "heswell",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"devDependencies": {
|
|
7
|
-
"@vuu-ui/vuu-data-types": "2.1.
|
|
8
|
-
"@vuu-ui/vuu-protocol-types": "2.1.
|
|
9
|
-
"@vuu-ui/vuu-table-types": "2.1.
|
|
8
|
+
"@vuu-ui/vuu-data-types": "2.1.19-beta.1",
|
|
9
|
+
"@vuu-ui/vuu-protocol-types": "2.1.19-beta.1",
|
|
10
|
+
"@vuu-ui/vuu-table-types": "2.1.19-beta.1"
|
|
10
11
|
},
|
|
11
12
|
"dependencies": {
|
|
12
13
|
"@salt-ds/core": "1.54.1",
|
|
13
14
|
"@salt-ds/styles": "0.2.1",
|
|
14
15
|
"@salt-ds/window": "0.1.1",
|
|
15
|
-
"@vuu-ui/vuu-context-menu": "2.1.
|
|
16
|
-
"@vuu-ui/vuu-data-react": "2.1.
|
|
17
|
-
"@vuu-ui/vuu-data-remote": "2.1.
|
|
18
|
-
"@vuu-ui/vuu-icons": "2.1.
|
|
19
|
-
"@vuu-ui/vuu-layout": "2.1.
|
|
20
|
-
"@vuu-ui/vuu-notifications": "2.1.
|
|
21
|
-
"@vuu-ui/vuu-table": "2.1.
|
|
22
|
-
"@vuu-ui/vuu-ui-controls": "2.1.
|
|
23
|
-
"@vuu-ui/vuu-utils": "2.1.
|
|
16
|
+
"@vuu-ui/vuu-context-menu": "2.1.19-beta.1",
|
|
17
|
+
"@vuu-ui/vuu-data-react": "2.1.19-beta.1",
|
|
18
|
+
"@vuu-ui/vuu-data-remote": "2.1.19-beta.1",
|
|
19
|
+
"@vuu-ui/vuu-icons": "2.1.19-beta.1",
|
|
20
|
+
"@vuu-ui/vuu-layout": "2.1.19-beta.1",
|
|
21
|
+
"@vuu-ui/vuu-notifications": "2.1.19-beta.1",
|
|
22
|
+
"@vuu-ui/vuu-table": "2.1.19-beta.1",
|
|
23
|
+
"@vuu-ui/vuu-ui-controls": "2.1.19-beta.1",
|
|
24
|
+
"@vuu-ui/vuu-utils": "2.1.19-beta.1",
|
|
24
25
|
"html-to-image": "^1.11.11"
|
|
25
26
|
},
|
|
26
27
|
"peerDependencies": {
|
|
@@ -37,14 +38,11 @@
|
|
|
37
38
|
],
|
|
38
39
|
"exports": {
|
|
39
40
|
".": {
|
|
40
|
-
"
|
|
41
|
-
"import": "./esm/index.js",
|
|
41
|
+
"import": "./index.js",
|
|
42
42
|
"types": "./types/index.d.ts"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
-
"
|
|
46
|
-
"module": "esm/index.js",
|
|
45
|
+
"module": "index.js",
|
|
47
46
|
"name": "@vuu-ui/vuu-shell",
|
|
48
|
-
"type": "module",
|
|
49
47
|
"types": "types/index.d.ts"
|
|
50
48
|
}
|
|
@@ -9,5 +9,5 @@ export declare class FeatureErrorBoundary extends React.Component<FeatureErrorBo
|
|
|
9
9
|
errorMessage: string;
|
|
10
10
|
};
|
|
11
11
|
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
12
|
-
render(): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<
|
|
12
|
+
render(): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | React.ReactPortal | null | undefined> | null | undefined;
|
|
13
13
|
}
|
|
@@ -37,11 +37,6 @@ export interface WorkspaceProviderProps extends WorkspaceProps {
|
|
|
37
37
|
*/
|
|
38
38
|
export declare const WorkspaceProvider: ({ TabstripProps, children, layoutJSON, activeLayoutIndex, layoutPlaceholderJSON, showTabs, workspaceJSON: customWorkspaceJSON, }: WorkspaceProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
39
|
export declare const useWorkspace: () => {
|
|
40
|
-
workspaceJSON: LayoutJSON<{
|
|
41
|
-
[key: string]: any;
|
|
42
|
-
}> | LayoutJSON<{
|
|
43
|
-
[key: string]: any;
|
|
44
|
-
}>[];
|
|
45
40
|
layoutMetadata: LayoutMetadata[];
|
|
46
41
|
layoutPlaceholderJSON?: LayoutJSON;
|
|
47
42
|
getApplicationSettings: (key?: keyof ApplicationSettings) => ApplicationSettings | ApplicationSetting | undefined;
|
|
@@ -49,4 +44,9 @@ export declare const useWorkspace: () => {
|
|
|
49
44
|
saveApplicationSettings: (settings: ApplicationSettings | ApplicationSetting, key?: keyof ApplicationSettings) => void;
|
|
50
45
|
saveLayout: (n: LayoutMetadataDto) => void;
|
|
51
46
|
saveApplicationLayout: (layout: LayoutJSON) => void;
|
|
47
|
+
workspaceJSON: LayoutJSON<{
|
|
48
|
+
[key: string]: any;
|
|
49
|
+
}>[] | LayoutJSON<{
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
}>;
|
|
52
52
|
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var vuuUtils = require('@vuu-ui/vuu-utils');
|
|
5
|
-
|
|
6
|
-
const Provider = ({
|
|
7
|
-
children,
|
|
8
|
-
context,
|
|
9
|
-
inheritedContext
|
|
10
|
-
}) => {
|
|
11
|
-
const mergedContext = {
|
|
12
|
-
...inheritedContext,
|
|
13
|
-
...context
|
|
14
|
-
};
|
|
15
|
-
return /* @__PURE__ */ jsxRuntime.jsx(vuuUtils.ShellContext.Provider, { value: mergedContext, children });
|
|
16
|
-
};
|
|
17
|
-
const ShellContextProvider = ({
|
|
18
|
-
children,
|
|
19
|
-
value
|
|
20
|
-
}) => {
|
|
21
|
-
return /* @__PURE__ */ jsxRuntime.jsx(vuuUtils.ShellContext.Consumer, { children: (context) => /* @__PURE__ */ jsxRuntime.jsx(Provider, { context: value, inheritedContext: context, children }) });
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
exports.ShellContextProvider = ShellContextProvider;
|
|
25
|
-
//# sourceMappingURL=ShellContextProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ShellContextProvider.js","sources":["../../../packages/vuu-shell/src/ShellContextProvider.tsx"],"sourcesContent":["import { ShellContext, ShellContextProps } from \"@vuu-ui/vuu-utils\";\nimport { ReactElement, ReactNode } from \"react\";\n\nexport interface ShellProviderProps {\n children: ReactNode;\n value?: ShellContextProps;\n}\n\nconst Provider = ({\n children,\n context,\n inheritedContext,\n}: {\n children: ReactNode;\n context?: ShellContextProps;\n inheritedContext?: ShellContextProps;\n}) => {\n // TODO functions provided at multiple levels must be merged\n const mergedContext = {\n ...inheritedContext,\n ...context,\n };\n return (\n <ShellContext.Provider value={mergedContext}>\n {children}\n </ShellContext.Provider>\n );\n};\n\nexport const ShellContextProvider = ({\n children,\n value,\n}: ShellProviderProps): ReactElement => {\n return (\n <ShellContext.Consumer>\n {(context) => (\n <Provider context={value} inheritedContext={context}>\n {children}\n </Provider>\n )}\n </ShellContext.Consumer>\n );\n};\n"],"names":["ShellContext","jsx"],"mappings":";;;;;AAQA,MAAM,WAAW,CAAC;AAAA,EAChB,QAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAIM,KAAA;AAEJ,EAAA,MAAM,aAAgB,GAAA;AAAA,IACpB,GAAG,gBAAA;AAAA,IACH,GAAG;AAAA,GACL;AACA,EAAA,sCACGA,qBAAa,CAAA,QAAA,EAAb,EAAsB,KAAA,EAAO,eAC3B,QACH,EAAA,CAAA;AAEJ,CAAA;AAEO,MAAM,uBAAuB,CAAC;AAAA,EACnC,QAAA;AAAA,EACA;AACF,CAAwC,KAAA;AACtC,EAAA,uBACGC,cAAA,CAAAD,qBAAA,CAAa,QAAb,EAAA,EACE,QAAC,EAAA,CAAA,OAAA,qBACCC,cAAA,CAAA,QAAA,EAAA,EAAS,OAAS,EAAA,KAAA,EAAO,gBAAkB,EAAA,OAAA,EACzC,UACH,CAEJ,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var appHeaderCss = ".vuuAppHeader {\n --saltButton-borderRadius: 6px;\n --saltButton-text-color: var(--vuu-color-gray-50);\n --saltButton-padding: 12px;\n --vuuToolbarItem-height: 26px;\n --vuuOverflowContainer-gap: 8px;\n --vuuOverflowContainer-height: var(--vuuAppHeader-height, 42px);\n --vuu-icon-color: var(--vuu-color-gray-45);\n --vuu-icon-size: 16px;\n --vuuToolbar-borderWidth: 1px;\n --vuuToolbar-borderStyle: solid;\n --vuuToolbar-borderColor: var(--salt-separable-primary-borderColor);\n\n align-items: center;\n display: flex;\n justify-content: flex-end;\n}\n\n";
|
|
4
|
-
|
|
5
|
-
module.exports = appHeaderCss;
|
|
6
|
-
//# sourceMappingURL=AppHeader.css.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var core = require('@salt-ds/core');
|
|
5
|
-
var styles = require('@salt-ds/styles');
|
|
6
|
-
var window = require('@salt-ds/window');
|
|
7
|
-
var vuuLayout = require('@vuu-ui/vuu-layout');
|
|
8
|
-
var vuuUiControls = require('@vuu-ui/vuu-ui-controls');
|
|
9
|
-
var cx = require('clsx');
|
|
10
|
-
var React = require('react');
|
|
11
|
-
var PersistenceProvider = require('../persistence-manager/PersistenceProvider.js');
|
|
12
|
-
require('../persistence-manager/LocalPersistenceManager.js');
|
|
13
|
-
require('../persistence-manager/StaticPersistenceManager.js');
|
|
14
|
-
var vuuNotifications = require('@vuu-ui/vuu-notifications');
|
|
15
|
-
var ApplicationProvider = require('../application-provider/ApplicationProvider.js');
|
|
16
|
-
var AppHeader$1 = require('./AppHeader.css.js');
|
|
17
|
-
|
|
18
|
-
const classBase = "vuuAppHeader";
|
|
19
|
-
const AppHeader = ({
|
|
20
|
-
className: classNameProp,
|
|
21
|
-
themeMode: _,
|
|
22
|
-
...htmlAttributes
|
|
23
|
-
}) => {
|
|
24
|
-
const targetWindow = window.useWindow();
|
|
25
|
-
styles.useComponentCssInjection({
|
|
26
|
-
testId: "vuu-app-header",
|
|
27
|
-
css: AppHeader$1,
|
|
28
|
-
window: targetWindow
|
|
29
|
-
});
|
|
30
|
-
const persistenceManager = PersistenceProvider.usePersistenceManager();
|
|
31
|
-
const settingsButtonRef = React.useRef(null);
|
|
32
|
-
const className = cx(classBase, classNameProp);
|
|
33
|
-
const logout = ApplicationProvider.useLogout();
|
|
34
|
-
const { showComponentInContextPanel } = vuuLayout.useLayoutOperation();
|
|
35
|
-
const { showNotification } = vuuNotifications.useNotifications();
|
|
36
|
-
const handleReset = React.useCallback(() => {
|
|
37
|
-
persistenceManager?.clearUserSettings();
|
|
38
|
-
showNotification({
|
|
39
|
-
animationType: "slide-out",
|
|
40
|
-
renderPostRefresh: true,
|
|
41
|
-
type: vuuNotifications.NotificationType.Toast,
|
|
42
|
-
header: "Success",
|
|
43
|
-
content: "Settings cleared",
|
|
44
|
-
status: "success"
|
|
45
|
-
});
|
|
46
|
-
location.reload();
|
|
47
|
-
}, [persistenceManager, showNotification]);
|
|
48
|
-
const handleShowSettings = React.useCallback(() => {
|
|
49
|
-
showComponentInContextPanel(
|
|
50
|
-
{
|
|
51
|
-
type: "ApplicationSettings"
|
|
52
|
-
},
|
|
53
|
-
"Settings",
|
|
54
|
-
() => settingsButtonRef.current?.focus()
|
|
55
|
-
);
|
|
56
|
-
}, [showComponentInContextPanel]);
|
|
57
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
58
|
-
vuuUiControls.Toolbar,
|
|
59
|
-
{
|
|
60
|
-
alignItems: "end",
|
|
61
|
-
className,
|
|
62
|
-
role: "banner",
|
|
63
|
-
showSeparators: true,
|
|
64
|
-
...htmlAttributes,
|
|
65
|
-
children: [
|
|
66
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
67
|
-
core.Button,
|
|
68
|
-
{
|
|
69
|
-
className: `${classBase}-menuItem`,
|
|
70
|
-
appearance: "transparent",
|
|
71
|
-
sentiment: "neutral",
|
|
72
|
-
children: "Help"
|
|
73
|
-
}
|
|
74
|
-
),
|
|
75
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
76
|
-
core.Button,
|
|
77
|
-
{
|
|
78
|
-
appearance: "transparent",
|
|
79
|
-
className: `${classBase}-menuItem`,
|
|
80
|
-
onClick: handleReset,
|
|
81
|
-
sentiment: "neutral",
|
|
82
|
-
children: [
|
|
83
|
-
"Reset ",
|
|
84
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-icon": "history" })
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
),
|
|
88
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
89
|
-
core.Button,
|
|
90
|
-
{
|
|
91
|
-
appearance: "transparent",
|
|
92
|
-
className: `${classBase}-menuItem`,
|
|
93
|
-
onClick: handleShowSettings,
|
|
94
|
-
ref: settingsButtonRef,
|
|
95
|
-
sentiment: "neutral",
|
|
96
|
-
children: [
|
|
97
|
-
"Settings ",
|
|
98
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-icon": "settings" })
|
|
99
|
-
]
|
|
100
|
-
}
|
|
101
|
-
),
|
|
102
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
103
|
-
core.Button,
|
|
104
|
-
{
|
|
105
|
-
appearance: "transparent",
|
|
106
|
-
className: `${classBase}-menuItem`,
|
|
107
|
-
onClick: logout,
|
|
108
|
-
sentiment: "neutral",
|
|
109
|
-
children: "Log out"
|
|
110
|
-
}
|
|
111
|
-
)
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
exports.AppHeader = AppHeader;
|
|
118
|
-
//# sourceMappingURL=AppHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.js","sources":["../../../../packages/vuu-shell/src/app-header/AppHeader.tsx"],"sourcesContent":["import { Button } from \"@salt-ds/core\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { useLayoutOperation } from \"@vuu-ui/vuu-layout\";\nimport { Toolbar } from \"@vuu-ui/vuu-ui-controls\";\nimport type { ThemeMode } from \"@vuu-ui/vuu-utils\";\nimport cx from \"clsx\";\nimport { HTMLAttributes, useCallback, useRef } from \"react\";\nimport { usePersistenceManager } from \"../persistence-manager\";\nimport { NotificationType, useNotifications } from \"@vuu-ui/vuu-notifications\";\nimport { useLogout } from \"../application-provider\";\n\nimport appHeaderCss from \"./AppHeader.css\";\n\nconst classBase = \"vuuAppHeader\";\nexport interface AppHeaderProps extends HTMLAttributes<HTMLDivElement> {\n themeMode?: ThemeMode;\n}\n\nexport const AppHeader = ({\n className: classNameProp,\n themeMode: _,\n ...htmlAttributes\n}: AppHeaderProps) => {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-app-header\",\n css: appHeaderCss,\n window: targetWindow,\n });\n\n const persistenceManager = usePersistenceManager();\n const settingsButtonRef = useRef<HTMLButtonElement>(null);\n\n const className = cx(classBase, classNameProp);\n const logout = useLogout();\n\n const { showComponentInContextPanel } = useLayoutOperation();\n const { showNotification } = useNotifications();\n\n const handleReset = useCallback(() => {\n persistenceManager?.clearUserSettings();\n showNotification({\n animationType: \"slide-out\",\n renderPostRefresh: true,\n type: NotificationType.Toast,\n header: \"Success\",\n content: \"Settings cleared\",\n status: \"success\",\n });\n location.reload();\n }, [persistenceManager, showNotification]);\n\n const handleShowSettings = useCallback(() => {\n showComponentInContextPanel(\n {\n type: \"ApplicationSettings\",\n },\n \"Settings\",\n () => settingsButtonRef.current?.focus(),\n );\n }, [showComponentInContextPanel]);\n\n return (\n <Toolbar\n alignItems=\"end\"\n className={className}\n role=\"banner\"\n showSeparators\n {...htmlAttributes}\n >\n <Button\n className={`${classBase}-menuItem`}\n appearance=\"transparent\"\n sentiment=\"neutral\"\n >\n Help\n </Button>\n <Button\n appearance=\"transparent\"\n className={`${classBase}-menuItem`}\n onClick={handleReset}\n sentiment=\"neutral\"\n >\n Reset <span data-icon=\"history\" />\n </Button>\n <Button\n appearance=\"transparent\"\n className={`${classBase}-menuItem`}\n onClick={handleShowSettings}\n ref={settingsButtonRef}\n sentiment=\"neutral\"\n >\n Settings <span data-icon=\"settings\" />\n </Button>\n <Button\n appearance=\"transparent\"\n className={`${classBase}-menuItem`}\n onClick={logout}\n sentiment=\"neutral\"\n >\n Log out\n </Button>\n </Toolbar>\n );\n};\n"],"names":["useWindow","useComponentCssInjection","appHeaderCss","usePersistenceManager","useRef","useLogout","useLayoutOperation","useNotifications","useCallback","NotificationType","jsxs","Toolbar","jsx","Button"],"mappings":"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"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
|
|
5
|
-
const Guest = {
|
|
6
|
-
username: "unknown"
|
|
7
|
-
};
|
|
8
|
-
const ApplicationContext = React.createContext({
|
|
9
|
-
onUserSettingChanged: (propertyName) => console.warn(
|
|
10
|
-
`Cannot change setting '${propertyName}'.
|
|
11
|
-
Did you forget to declare an ApplicationProvider ?`
|
|
12
|
-
),
|
|
13
|
-
user: Guest
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
exports.ApplicationContext = ApplicationContext;
|
|
17
|
-
//# sourceMappingURL=ApplicationContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationContext.js","sources":["../../../../packages/vuu-shell/src/application-provider/ApplicationContext.tsx"],"sourcesContent":["import type { Settings, VuuUser } from \"@vuu-ui/vuu-utils\";\nimport { VuuRowDataItemType } from \"@vuu-ui/vuu-protocol-types\";\nimport { createContext } from \"react\";\nimport { SettingsSchema } from \"../user-settings\";\n\nconst Guest: VuuUser = {\n username: \"unknown\",\n};\n\nexport interface ApplicationContextProps {\n onUserSettingChanged: (\n propertyName: string,\n value: VuuRowDataItemType,\n ) => void;\n logout?: () => void;\n userSettings?: Settings;\n userSettingsSchema?: SettingsSchema;\n user: VuuUser;\n}\n\nexport const ApplicationContext = createContext<ApplicationContextProps>({\n onUserSettingChanged: (propertyName: string) =>\n console.warn(\n `Cannot change setting '${propertyName}'.\\nDid you forget to declare an ApplicationProvider ?`,\n ),\n user: Guest,\n});\n"],"names":["createContext"],"mappings":";;;;AAKA,MAAM,KAAiB,GAAA;AAAA,EACrB,QAAU,EAAA;AACZ,CAAA;AAaO,MAAM,qBAAqBA,mBAAuC,CAAA;AAAA,EACvE,oBAAA,EAAsB,CAAC,YAAA,KACrB,OAAQ,CAAA,IAAA;AAAA,IACN,0BAA0B,YAAY,CAAA;AAAA,kDAAA;AAAA,GACxC;AAAA,EACF,IAAM,EAAA;AACR,CAAC;;;;"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var core = require('@salt-ds/core');
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var ApplicationContext = require('./ApplicationContext.js');
|
|
7
|
-
var PersistenceProvider = require('../persistence-manager/PersistenceProvider.js');
|
|
8
|
-
require('../persistence-manager/LocalPersistenceManager.js');
|
|
9
|
-
require('../persistence-manager/StaticPersistenceManager.js');
|
|
10
|
-
|
|
11
|
-
const accentPurple = "purple";
|
|
12
|
-
const getThemeMode = (mode = "light", userSettings) => {
|
|
13
|
-
const themeMode = userSettings?.themeMode;
|
|
14
|
-
if (themeMode === "light" || themeMode === "dark") {
|
|
15
|
-
return themeMode;
|
|
16
|
-
}
|
|
17
|
-
return mode;
|
|
18
|
-
};
|
|
19
|
-
const ApplicationProvider = ({
|
|
20
|
-
children,
|
|
21
|
-
density: densityProp,
|
|
22
|
-
logout,
|
|
23
|
-
mode,
|
|
24
|
-
theme,
|
|
25
|
-
userSettingsSchema,
|
|
26
|
-
user
|
|
27
|
-
}) => {
|
|
28
|
-
const { mode: inheritedMode, theme: inheritedTheme } = core.useTheme();
|
|
29
|
-
const density = core.useDensity(densityProp);
|
|
30
|
-
const persistenceManager = PersistenceProvider.usePersistenceManager();
|
|
31
|
-
const context = React.useContext(ApplicationContext.ApplicationContext);
|
|
32
|
-
const [userSettings, setSettings] = React.useState();
|
|
33
|
-
React.useMemo(async () => {
|
|
34
|
-
if (persistenceManager) {
|
|
35
|
-
const userSettings2 = await persistenceManager.getUserSettings();
|
|
36
|
-
setSettings(userSettings2);
|
|
37
|
-
} else {
|
|
38
|
-
setSettings({});
|
|
39
|
-
}
|
|
40
|
-
}, [persistenceManager]);
|
|
41
|
-
const onUserSettingChanged = React.useCallback(
|
|
42
|
-
(propertyName, value) => {
|
|
43
|
-
setSettings((currentSettings) => {
|
|
44
|
-
const newSettings = { ...currentSettings, [propertyName]: value };
|
|
45
|
-
persistenceManager?.saveUserSettings(newSettings);
|
|
46
|
-
return newSettings;
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
[persistenceManager]
|
|
50
|
-
);
|
|
51
|
-
return userSettings ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
52
|
-
ApplicationContext.ApplicationContext.Provider,
|
|
53
|
-
{
|
|
54
|
-
value: {
|
|
55
|
-
...context,
|
|
56
|
-
logout,
|
|
57
|
-
onUserSettingChanged,
|
|
58
|
-
userSettings,
|
|
59
|
-
userSettingsSchema,
|
|
60
|
-
user: user ?? context.user
|
|
61
|
-
},
|
|
62
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
63
|
-
core.SaltProviderNext,
|
|
64
|
-
{
|
|
65
|
-
accent: accentPurple,
|
|
66
|
-
corner: "rounded",
|
|
67
|
-
theme: theme ?? inheritedTheme ?? "vuu-theme",
|
|
68
|
-
density,
|
|
69
|
-
mode: getThemeMode(mode ?? inheritedMode, userSettings),
|
|
70
|
-
children
|
|
71
|
-
}
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
|
-
) : null;
|
|
75
|
-
};
|
|
76
|
-
const useApplicationUser = () => {
|
|
77
|
-
const { user } = React.useContext(ApplicationContext.ApplicationContext);
|
|
78
|
-
return user;
|
|
79
|
-
};
|
|
80
|
-
const useApplicationSettings = () => {
|
|
81
|
-
const { onUserSettingChanged, userSettings, userSettingsSchema } = React.useContext(ApplicationContext.ApplicationContext);
|
|
82
|
-
return {
|
|
83
|
-
onUserSettingChanged,
|
|
84
|
-
userSettings,
|
|
85
|
-
userSettingsSchema
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
const useUserSetting = () => {
|
|
89
|
-
const { userSettings } = React.useContext(ApplicationContext.ApplicationContext);
|
|
90
|
-
return userSettings;
|
|
91
|
-
};
|
|
92
|
-
const useLogout = () => {
|
|
93
|
-
const { logout } = React.useContext(ApplicationContext.ApplicationContext);
|
|
94
|
-
return logout;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
exports.ApplicationProvider = ApplicationProvider;
|
|
98
|
-
exports.useApplicationSettings = useApplicationSettings;
|
|
99
|
-
exports.useApplicationUser = useApplicationUser;
|
|
100
|
-
exports.useLogout = useLogout;
|
|
101
|
-
exports.useUserSetting = useUserSetting;
|
|
102
|
-
//# sourceMappingURL=ApplicationProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationProvider.js","sources":["../../../../packages/vuu-shell/src/application-provider/ApplicationProvider.tsx"],"sourcesContent":["import { VuuRowDataItemType } from \"@vuu-ui/vuu-protocol-types\";\nimport {\n Accent,\n Density,\n Mode,\n SaltProviderNext,\n ThemeContextProps,\n useDensity,\n useTheme,\n} from \"@salt-ds/core\";\nimport {\n ReactElement,\n ReactNode,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from \"react\";\nimport {\n ApplicationContext,\n ApplicationContextProps,\n} from \"./ApplicationContext\";\nimport { usePersistenceManager } from \"../persistence-manager\";\n\nexport interface ApplicationProviderProps\n extends Partial<Pick<ThemeContextProps, \"theme\" | \"mode\">>,\n Partial<Omit<ApplicationContextProps, \"userSettings\">> {\n children: ReactNode;\n density?: Density;\n}\n\nconst accentPurple = \"purple\" as Accent;\n\nconst getThemeMode = (\n mode: Mode = \"light\",\n userSettings?: Record<string, string | number | boolean>,\n) => {\n const themeMode = userSettings?.themeMode;\n if (themeMode === \"light\" || themeMode === \"dark\") {\n return themeMode;\n }\n return mode;\n};\n\nexport const ApplicationProvider = ({\n children,\n density: densityProp,\n logout,\n mode,\n theme,\n userSettingsSchema: userSettingsSchema,\n user,\n}: ApplicationProviderProps): ReactElement | null => {\n const { mode: inheritedMode, theme: inheritedTheme } = useTheme();\n const density = useDensity(densityProp);\n const persistenceManager = usePersistenceManager();\n const context = useContext(ApplicationContext);\n const [userSettings, setSettings] =\n useState<Record<string, string | number | boolean>>();\n\n useMemo(async () => {\n if (persistenceManager) {\n const userSettings = await persistenceManager.getUserSettings();\n setSettings(userSettings);\n } else {\n setSettings({});\n }\n }, [persistenceManager]);\n\n const onUserSettingChanged = useCallback(\n (propertyName: string, value: VuuRowDataItemType) => {\n setSettings((currentSettings) => {\n const newSettings = { ...currentSettings, [propertyName]: value };\n persistenceManager?.saveUserSettings(newSettings);\n return newSettings;\n });\n },\n [persistenceManager],\n );\n\n return userSettings ? (\n <ApplicationContext.Provider\n value={{\n ...context,\n logout,\n onUserSettingChanged,\n userSettings,\n userSettingsSchema,\n user: user ?? context.user,\n }}\n >\n <SaltProviderNext\n accent={accentPurple}\n corner=\"rounded\"\n theme={theme ?? inheritedTheme ?? \"vuu-theme\"}\n density={density}\n mode={getThemeMode(mode ?? inheritedMode, userSettings)}\n >\n {children}\n </SaltProviderNext>\n </ApplicationContext.Provider>\n ) : null;\n};\n\nexport const useApplicationUser = () => {\n const { user } = useContext(ApplicationContext);\n return user;\n};\n\n//Setter method (only used within the shell)\nexport const useApplicationSettings = () => {\n const { onUserSettingChanged, userSettings, userSettingsSchema } =\n useContext(ApplicationContext);\n return {\n onUserSettingChanged,\n userSettings,\n userSettingsSchema,\n };\n};\n\n//Getter method (read only access to applicationSetting)\nexport const useUserSetting = () => {\n const { userSettings } = useContext(ApplicationContext);\n return userSettings;\n};\n\nexport const useLogout = () => {\n const { logout } = useContext(ApplicationContext);\n return logout;\n};\n"],"names":["useTheme","useDensity","usePersistenceManager","useContext","ApplicationContext","useState","useMemo","userSettings","useCallback","jsx","SaltProviderNext"],"mappings":"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"}
|
package/cjs/feature/Feature.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var vuuUtils = require('@vuu-ui/vuu-utils');
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var FeatureErrorBoundary = require('./FeatureErrorBoundary.js');
|
|
7
|
-
|
|
8
|
-
const componentsMap = /* @__PURE__ */ new Map();
|
|
9
|
-
const useCachedFeature = (url) => {
|
|
10
|
-
React.useEffect(
|
|
11
|
-
() => () => {
|
|
12
|
-
componentsMap.delete(url);
|
|
13
|
-
},
|
|
14
|
-
[url]
|
|
15
|
-
);
|
|
16
|
-
if (!componentsMap.has(url)) {
|
|
17
|
-
componentsMap.set(
|
|
18
|
-
url,
|
|
19
|
-
React.lazy(() => import(
|
|
20
|
-
/* @vite-ignore */
|
|
21
|
-
url
|
|
22
|
-
))
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
const lazyFeature = componentsMap.get(url);
|
|
26
|
-
if (!lazyFeature) {
|
|
27
|
-
throw Error(`Unable to load Lazy Feature at url ${url}`);
|
|
28
|
-
} else {
|
|
29
|
-
return lazyFeature;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
function RawFeature({
|
|
33
|
-
url,
|
|
34
|
-
css,
|
|
35
|
-
ComponentProps: params,
|
|
36
|
-
...props
|
|
37
|
-
}) {
|
|
38
|
-
if (css) {
|
|
39
|
-
vuuUtils.importCSS(css).then((styleSheet) => {
|
|
40
|
-
document.adoptedStyleSheets = [
|
|
41
|
-
...document.adoptedStyleSheets,
|
|
42
|
-
styleSheet
|
|
43
|
-
];
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
const LazyFeature = useCachedFeature(url);
|
|
47
|
-
return /* @__PURE__ */ jsxRuntime.jsx(FeatureErrorBoundary.FeatureErrorBoundary, { url, children: /* @__PURE__ */ jsxRuntime.jsx(LazyFeature, { ...props, ...params }) });
|
|
48
|
-
}
|
|
49
|
-
const Feature = React.memo(RawFeature);
|
|
50
|
-
Feature.displayName = "Feature";
|
|
51
|
-
vuuUtils.registerComponent("Feature", Feature, "view");
|
|
52
|
-
|
|
53
|
-
exports.Feature = Feature;
|
|
54
|
-
//# sourceMappingURL=Feature.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Feature.js","sources":["../../../../packages/vuu-shell/src/feature/Feature.tsx"],"sourcesContent":["import {\n DynamicFeatureProps,\n importCSS,\n registerComponent,\n} from \"@vuu-ui/vuu-utils\";\nimport React, { useEffect } from \"react\";\nimport { FeatureErrorBoundary } from \"./FeatureErrorBoundary\";\n\n/**\n * Ensure we never lazy load the same component more than once\n */\nconst componentsMap = new Map<string, ReturnType<typeof React.lazy>>();\nconst useCachedFeature = (url: string) => {\n useEffect(\n () => () => {\n componentsMap.delete(url);\n },\n [url],\n );\n\n if (!componentsMap.has(url)) {\n componentsMap.set(\n url,\n React.lazy(() => import(/* @vite-ignore */ url)),\n );\n }\n\n const lazyFeature = componentsMap.get(url);\n\n if (!lazyFeature) {\n throw Error(`Unable to load Lazy Feature at url ${url}`);\n } else {\n return lazyFeature;\n }\n};\n\nfunction RawFeature<Params extends object | undefined>({\n url,\n css,\n ComponentProps: params,\n ...props\n}: DynamicFeatureProps<Params>) {\n if (css) {\n // import(/* @vite-ignore */ css, { assert: { type: \"css\" } }).then(\n // (cssModule) => {\n // console.log(\"%cInject Styles\", \"color: blue;font-weight: bold\");\n // document.adoptedStyleSheets = [\n // ...document.adoptedStyleSheets,\n // cssModule.default,\n // ];\n // }\n // );\n // Polyfill until cypress build supports import assertions\n // Note: already fully supported in esbuild and vite\n importCSS(css).then((styleSheet) => {\n document.adoptedStyleSheets = [\n ...document.adoptedStyleSheets,\n styleSheet,\n ];\n });\n }\n\n const LazyFeature = useCachedFeature(url);\n // Suspense has been removed here - caused components to render twice\n return (\n <FeatureErrorBoundary url={url}>\n <LazyFeature {...props} {...params} />\n </FeatureErrorBoundary>\n );\n}\n\n/**\n Feature is a wrapper around React Lazy Loading. It will load a component\n from the given url. That url must resolve to a javascript bundle with a\n single default export. That export must be a React component.\n */\nexport const Feature = React.memo(RawFeature);\nFeature.displayName = \"Feature\";\nregisterComponent(\"Feature\", Feature, \"view\");\n"],"names":["useEffect","importCSS","jsx","FeatureErrorBoundary","registerComponent"],"mappings":";;;;;;;AAWA,MAAM,aAAA,uBAAoB,GAA2C,EAAA;AACrE,MAAM,gBAAA,GAAmB,CAAC,GAAgB,KAAA;AACxC,EAAAA,eAAA;AAAA,IACE,MAAM,MAAM;AACV,MAAA,aAAA,CAAc,OAAO,GAAG,CAAA;AAAA,KAC1B;AAAA,IACA,CAAC,GAAG;AAAA,GACN;AAEA,EAAA,IAAI,CAAC,aAAA,CAAc,GAAI,CAAA,GAAG,CAAG,EAAA;AAC3B,IAAc,aAAA,CAAA,GAAA;AAAA,MACZ,GAAA;AAAA,MACA,KAAA,CAAM,KAAK,MAAM;AAAA;AAAA,QAA0B;AAAA,OAAI;AAAA,KACjD;AAAA;AAGF,EAAM,MAAA,WAAA,GAAc,aAAc,CAAA,GAAA,CAAI,GAAG,CAAA;AAEzC,EAAA,IAAI,CAAC,WAAa,EAAA;AAChB,IAAM,MAAA,KAAA,CAAM,CAAsC,mCAAA,EAAA,GAAG,CAAE,CAAA,CAAA;AAAA,GAClD,MAAA;AACL,IAAO,OAAA,WAAA;AAAA;AAEX,CAAA;AAEA,SAAS,UAA8C,CAAA;AAAA,EACrD,GAAA;AAAA,EACA,GAAA;AAAA,EACA,cAAgB,EAAA,MAAA;AAAA,EAChB,GAAG;AACL,CAAgC,EAAA;AAC9B,EAAA,IAAI,GAAK,EAAA;AAYP,IAAAC,kBAAA,CAAU,GAAG,CAAA,CAAE,IAAK,CAAA,CAAC,UAAe,KAAA;AAClC,MAAA,QAAA,CAAS,kBAAqB,GAAA;AAAA,QAC5B,GAAG,QAAS,CAAA,kBAAA;AAAA,QACZ;AAAA,OACF;AAAA,KACD,CAAA;AAAA;AAGH,EAAM,MAAA,WAAA,GAAc,iBAAiB,GAAG,CAAA;AAExC,EACE,uBAAAC,cAAA,CAACC,6CAAqB,GACpB,EAAA,QAAA,kBAAAD,cAAA,CAAC,eAAa,GAAG,KAAA,EAAQ,GAAG,MAAA,EAAQ,CACtC,EAAA,CAAA;AAEJ;AAOa,MAAA,OAAA,GAAU,KAAM,CAAA,IAAA,CAAK,UAAU;AAC5C,OAAA,CAAQ,WAAc,GAAA,SAAA;AACtBE,0BAAkB,CAAA,SAAA,EAAW,SAAS,MAAM,CAAA;;;;"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
|
|
6
|
-
class FeatureErrorBoundary extends React.Component {
|
|
7
|
-
constructor(props) {
|
|
8
|
-
super(props);
|
|
9
|
-
this.state = { errorMessage: null };
|
|
10
|
-
}
|
|
11
|
-
static getDerivedStateFromError(error) {
|
|
12
|
-
return { errorMessage: error.message };
|
|
13
|
-
}
|
|
14
|
-
componentDidCatch(error, errorInfo) {
|
|
15
|
-
console.log(`error creating component at ${this.props.url}`);
|
|
16
|
-
console.log(error, errorInfo);
|
|
17
|
-
}
|
|
18
|
-
render() {
|
|
19
|
-
if (this.state.errorMessage) {
|
|
20
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
21
|
-
/* @__PURE__ */ jsxRuntime.jsx("h1", { children: "An error occured while creating component." }),
|
|
22
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { children: this.state.errorMessage })
|
|
23
|
-
] });
|
|
24
|
-
}
|
|
25
|
-
return this.props.children;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
exports.FeatureErrorBoundary = FeatureErrorBoundary;
|
|
30
|
-
//# sourceMappingURL=FeatureErrorBoundary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureErrorBoundary.js","sources":["../../../../packages/vuu-shell/src/feature/FeatureErrorBoundary.tsx"],"sourcesContent":["import { DynamicFeatureProps } from \"@vuu-ui/vuu-utils\";\nimport React, { ErrorInfo, ReactNode } from \"react\";\n\nexport interface FeatureErrorBoundaryProps extends DynamicFeatureProps {\n children: ReactNode;\n}\n\nexport class FeatureErrorBoundary extends React.Component<\n FeatureErrorBoundaryProps,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n any\n> {\n constructor(props: FeatureErrorBoundaryProps) {\n super(props);\n this.state = { errorMessage: null };\n }\n\n static getDerivedStateFromError(error: Error) {\n // Update state so the next render will show the fallback UI.\n return { errorMessage: error.message };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n // You can also log the error to an error reporting service\n console.log(`error creating component at ${this.props.url}`);\n console.log(error, errorInfo);\n }\n\n render() {\n if (this.state.errorMessage) {\n return (\n <>\n <h1>An error occured while creating component.</h1>\n <p>{this.state.errorMessage}</p>\n </>\n );\n }\n\n return this.props.children;\n }\n}\n"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;AAOa,MAAA,oBAAA,SAA6B,MAAM,SAI9C,CAAA;AAAA,EACA,YAAY,KAAkC,EAAA;AAC5C,IAAA,KAAA,CAAM,KAAK,CAAA;AACX,IAAK,IAAA,CAAA,KAAA,GAAQ,EAAE,YAAA,EAAc,IAAK,EAAA;AAAA;AACpC,EAEA,OAAO,yBAAyB,KAAc,EAAA;AAE5C,IAAO,OAAA,EAAE,YAAc,EAAA,KAAA,CAAM,OAAQ,EAAA;AAAA;AACvC,EAEA,iBAAA,CAAkB,OAAc,SAAsB,EAAA;AAEpD,IAAA,OAAA,CAAQ,GAAI,CAAA,CAAA,4BAAA,EAA+B,IAAK,CAAA,KAAA,CAAM,GAAG,CAAE,CAAA,CAAA;AAC3D,IAAQ,OAAA,CAAA,GAAA,CAAI,OAAO,SAAS,CAAA;AAAA;AAC9B,EAEA,MAAS,GAAA;AACP,IAAI,IAAA,IAAA,CAAK,MAAM,YAAc,EAAA;AAC3B,MAAA,uBAEIA,eAAA,CAAAC,mBAAA,EAAA,EAAA,QAAA,EAAA;AAAA,wBAAAC,cAAA,CAAC,QAAG,QAA0C,EAAA,4CAAA,EAAA,CAAA;AAAA,wBAC7CA,cAAA,CAAA,GAAA,EAAA,EAAG,QAAK,EAAA,IAAA,CAAA,KAAA,CAAM,YAAa,EAAA;AAAA,OAC9B,EAAA,CAAA;AAAA;AAIJ,IAAA,OAAO,KAAK,KAAM,CAAA,QAAA;AAAA;AAEtB;;;;"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var vuuUtils = require('@vuu-ui/vuu-utils');
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var vuuDataReact = require('@vuu-ui/vuu-data-react');
|
|
7
|
-
|
|
8
|
-
const NO_FEATURES = [];
|
|
9
|
-
const NO_STATICFEATURES = [];
|
|
10
|
-
const NO_SYSTEMLAYOUTS = [];
|
|
11
|
-
const NO_FEATURES_VUU = {
|
|
12
|
-
dynamicFeatures: NO_FEATURES,
|
|
13
|
-
tableFeatures: NO_FEATURES
|
|
14
|
-
};
|
|
15
|
-
const FeatureContext = React.createContext({
|
|
16
|
-
dynamicFeatures: NO_FEATURES,
|
|
17
|
-
tableFeatures: NO_FEATURES,
|
|
18
|
-
staticFeatures: NO_STATICFEATURES
|
|
19
|
-
});
|
|
20
|
-
const LayoutContext = React.createContext({
|
|
21
|
-
systemLayouts: NO_SYSTEMLAYOUTS
|
|
22
|
-
});
|
|
23
|
-
const FeatureAndLayoutProvider = ({
|
|
24
|
-
children,
|
|
25
|
-
dynamicFeatures: dynamicFeaturesProp = [],
|
|
26
|
-
staticFeatures,
|
|
27
|
-
systemLayouts
|
|
28
|
-
}) => {
|
|
29
|
-
const tableSchemas = vuuDataReact.useVuuTables();
|
|
30
|
-
const { dynamicFeatures, tableFeatures } = React.useMemo(
|
|
31
|
-
() => tableSchemas ? vuuUtils.getCustomAndTableFeatures(dynamicFeaturesProp, tableSchemas) : NO_FEATURES_VUU,
|
|
32
|
-
[dynamicFeaturesProp, tableSchemas]
|
|
33
|
-
);
|
|
34
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
35
|
-
FeatureContext.Provider,
|
|
36
|
-
{
|
|
37
|
-
value: {
|
|
38
|
-
dynamicFeatures,
|
|
39
|
-
tableFeatures,
|
|
40
|
-
staticFeatures
|
|
41
|
-
},
|
|
42
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
|
-
LayoutContext.Provider,
|
|
44
|
-
{
|
|
45
|
-
value: {
|
|
46
|
-
systemLayouts
|
|
47
|
-
},
|
|
48
|
-
children
|
|
49
|
-
}
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
};
|
|
54
|
-
const useFeatures = () => React.useContext(FeatureContext);
|
|
55
|
-
const useLayouts = () => React.useContext(LayoutContext);
|
|
56
|
-
|
|
57
|
-
exports.FeatureAndLayoutProvider = FeatureAndLayoutProvider;
|
|
58
|
-
exports.useFeatures = useFeatures;
|
|
59
|
-
exports.useLayouts = useLayouts;
|
|
60
|
-
//# sourceMappingURL=FeatureAndLayoutProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureAndLayoutProvider.js","sources":["../../../../packages/vuu-shell/src/feature-and-layout-provider/FeatureAndLayoutProvider.tsx"],"sourcesContent":["import {\n DynamicFeatureDescriptor,\n DynamicFeatureProps,\n FilterTableFeatureProps,\n StaticFeatureDescriptor,\n SystemLayoutMetadata,\n getCustomAndTableFeatures,\n} from \"@vuu-ui/vuu-utils\";\nimport {\n ReactElement,\n ReactNode,\n createContext,\n useContext,\n useMemo,\n} from \"react\";\nimport { useVuuTables } from \"@vuu-ui/vuu-data-react\";\n\nexport interface FeatureContextProps {\n dynamicFeatures?: DynamicFeatureProps[];\n tableFeatures?: DynamicFeatureProps<FilterTableFeatureProps>[];\n staticFeatures?: StaticFeatureDescriptor[];\n}\n\nexport interface LayoutContextProps {\n systemLayouts?: SystemLayoutMetadata[];\n}\n\nconst NO_FEATURES: DynamicFeatureDescriptor[] = [];\nconst NO_STATICFEATURES: StaticFeatureDescriptor[] = [];\nconst NO_SYSTEMLAYOUTS: SystemLayoutMetadata[] = [];\n\nconst NO_FEATURES_VUU = {\n dynamicFeatures: NO_FEATURES,\n tableFeatures: NO_FEATURES,\n};\n\nconst FeatureContext = createContext<FeatureContextProps>({\n dynamicFeatures: NO_FEATURES,\n tableFeatures: NO_FEATURES,\n staticFeatures: NO_STATICFEATURES,\n});\n\nconst LayoutContext = createContext<LayoutContextProps>({\n systemLayouts: NO_SYSTEMLAYOUTS,\n});\n\nexport interface FeatureAndLayoutProviderProps\n extends Partial<FeatureContextProps> {\n children: ReactNode;\n dynamicFeatures?: DynamicFeatureDescriptor[];\n staticFeatures?: StaticFeatureDescriptor[];\n systemLayouts?: SystemLayoutMetadata[];\n}\n\nexport const FeatureAndLayoutProvider = ({\n children,\n dynamicFeatures: dynamicFeaturesProp = [],\n staticFeatures,\n systemLayouts,\n}: FeatureAndLayoutProviderProps): ReactElement => {\n const tableSchemas = useVuuTables();\n\n const { dynamicFeatures, tableFeatures } = useMemo<{\n dynamicFeatures: DynamicFeatureProps[];\n tableFeatures: DynamicFeatureProps<FilterTableFeatureProps>[];\n }>(\n () =>\n tableSchemas\n ? getCustomAndTableFeatures(dynamicFeaturesProp, tableSchemas)\n : NO_FEATURES_VUU,\n [dynamicFeaturesProp, tableSchemas],\n );\n\n return (\n <FeatureContext.Provider\n value={{\n dynamicFeatures,\n tableFeatures,\n staticFeatures,\n }}\n >\n <LayoutContext.Provider\n value={{\n systemLayouts,\n }}\n >\n {children}\n </LayoutContext.Provider>\n </FeatureContext.Provider>\n );\n};\n\nexport const useFeatures = () => useContext(FeatureContext);\nexport const useLayouts = () => useContext(LayoutContext);\n"],"names":["createContext","useVuuTables","useMemo","getCustomAndTableFeatures","jsx","useContext"],"mappings":";;;;;;;AA2BA,MAAM,cAA0C,EAAC;AACjD,MAAM,oBAA+C,EAAC;AACtD,MAAM,mBAA2C,EAAC;AAElD,MAAM,eAAkB,GAAA;AAAA,EACtB,eAAiB,EAAA,WAAA;AAAA,EACjB,aAAe,EAAA;AACjB,CAAA;AAEA,MAAM,iBAAiBA,mBAAmC,CAAA;AAAA,EACxD,eAAiB,EAAA,WAAA;AAAA,EACjB,aAAe,EAAA,WAAA;AAAA,EACf,cAAgB,EAAA;AAClB,CAAC,CAAA;AAED,MAAM,gBAAgBA,mBAAkC,CAAA;AAAA,EACtD,aAAe,EAAA;AACjB,CAAC,CAAA;AAUM,MAAM,2BAA2B,CAAC;AAAA,EACvC,QAAA;AAAA,EACA,eAAA,EAAiB,sBAAsB,EAAC;AAAA,EACxC,cAAA;AAAA,EACA;AACF,CAAmD,KAAA;AACjD,EAAA,MAAM,eAAeC,yBAAa,EAAA;AAElC,EAAM,MAAA,EAAE,eAAiB,EAAA,aAAA,EAAkB,GAAAC,aAAA;AAAA,IAIzC,MACE,YAAA,GACIC,kCAA0B,CAAA,mBAAA,EAAqB,YAAY,CAC3D,GAAA,eAAA;AAAA,IACN,CAAC,qBAAqB,YAAY;AAAA,GACpC;AAEA,EACE,uBAAAC,cAAA;AAAA,IAAC,cAAe,CAAA,QAAA;AAAA,IAAf;AAAA,MACC,KAAO,EAAA;AAAA,QACL,eAAA;AAAA,QACA,aAAA;AAAA,QACA;AAAA,OACF;AAAA,MAEA,QAAA,kBAAAA,cAAA;AAAA,QAAC,aAAc,CAAA,QAAA;AAAA,QAAd;AAAA,UACC,KAAO,EAAA;AAAA,YACL;AAAA,WACF;AAAA,UAEC;AAAA;AAAA;AACH;AAAA,GACF;AAEJ;AAEa,MAAA,WAAA,GAAc,MAAMC,gBAAA,CAAW,cAAc;AAC7C,MAAA,UAAA,GAAa,MAAMA,gBAAA,CAAW,aAAa;;;;;;"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var featureListCss = ".vuuFeatureList {\n --vuuListItem-padding: var(--salt-spacing-200);\n background: var(\n --vuuFeatureList-background,\n var(--salt-container-primary-background)\n );\n display: flex;\n flex-direction: column;\n height: 100%;\n padding: 0 var(--vuuFeatureList-padding, 0);\n}\n\n.vuuFeatureList-header {\n align-items: center;\n display: flex;\n flex: 0 0 48px;\n font-weight: 700;\n line-height: 2;\n}\n\n.vuuFeatureList-content {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n font-size: 12px;\n font-weight: 700;\n overflow: auto;\n}\n\n.vuuFeatureList-standalone {\n margin-top: 24px;\n}\n\n.vuuFeatureList-group {\n --vuuMeasuredContainer-flex: 0 0 auto;\n\n display: flex;\n flex-direction: column;\n\n .vuuFeatureList-groupHeader {\n flex: 0 0 32px;\n padding: 8px 0;\n }\n\n .vuuPalette {\n flex: 1 1 auto;\n height: auto;\n }\n}\n\n.vuuFeatureList-group:first-child {\n margin-top: 12px;\n}\n\n.vuuFeatureList-group + .vuuFeatureList-group {\n margin-top: 24px;\n}\n\n.vuuFeatureList-itemName {\n font-weight: 700;\n}\n";
|
|
4
|
-
|
|
5
|
-
module.exports = featureListCss;
|
|
6
|
-
//# sourceMappingURL=FeatureList.css.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureList.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|