@vuu-ui/vuu-shell 2.1.19-beta.2 → 2.1.19-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/cjs/ShellContextProvider.js +25 -0
  2. package/cjs/ShellContextProvider.js.map +1 -0
  3. package/cjs/app-header/AppHeader.css.js +6 -0
  4. package/cjs/app-header/AppHeader.css.js.map +1 -0
  5. package/cjs/app-header/AppHeader.js +118 -0
  6. package/cjs/app-header/AppHeader.js.map +1 -0
  7. package/cjs/application-provider/ApplicationContext.js +17 -0
  8. package/cjs/application-provider/ApplicationContext.js.map +1 -0
  9. package/cjs/application-provider/ApplicationProvider.js +102 -0
  10. package/cjs/application-provider/ApplicationProvider.js.map +1 -0
  11. package/cjs/feature/Feature.js +54 -0
  12. package/cjs/feature/Feature.js.map +1 -0
  13. package/cjs/feature/FeatureErrorBoundary.js +30 -0
  14. package/cjs/feature/FeatureErrorBoundary.js.map +1 -0
  15. package/cjs/feature-and-layout-provider/FeatureAndLayoutProvider.js +60 -0
  16. package/cjs/feature-and-layout-provider/FeatureAndLayoutProvider.js.map +1 -0
  17. package/cjs/feature-list/FeatureList.css.js +6 -0
  18. package/cjs/feature-list/FeatureList.css.js.map +1 -0
  19. package/cjs/feature-list/FeatureList.js +109 -0
  20. package/cjs/feature-list/FeatureList.js.map +1 -0
  21. package/cjs/index.js +71 -0
  22. package/cjs/index.js.map +1 -0
  23. package/cjs/left-nav/LeftNav.css.js +6 -0
  24. package/cjs/left-nav/LeftNav.css.js.map +1 -0
  25. package/cjs/left-nav/LeftNav.js +202 -0
  26. package/cjs/left-nav/LeftNav.js.map +1 -0
  27. package/cjs/login/LoginPanel.css.js +6 -0
  28. package/cjs/login/LoginPanel.css.js.map +1 -0
  29. package/cjs/login/LoginPanel.js +110 -0
  30. package/cjs/login/LoginPanel.js.map +1 -0
  31. package/cjs/login/VuuLogo.js +134 -0
  32. package/cjs/login/VuuLogo.js.map +1 -0
  33. package/cjs/persistence-manager/LocalPersistenceManager.js +193 -0
  34. package/cjs/persistence-manager/LocalPersistenceManager.js.map +1 -0
  35. package/cjs/persistence-manager/PersistenceProvider.js +21 -0
  36. package/cjs/persistence-manager/PersistenceProvider.js.map +1 -0
  37. package/cjs/persistence-manager/RemotePersistenceManager.js +165 -0
  38. package/cjs/persistence-manager/RemotePersistenceManager.js.map +1 -0
  39. package/cjs/persistence-manager/StaticPersistenceManager.js +73 -0
  40. package/cjs/persistence-manager/StaticPersistenceManager.js.map +1 -0
  41. package/cjs/shell-layout-templates/context-panel/ContextPanel.css.js +6 -0
  42. package/cjs/shell-layout-templates/context-panel/ContextPanel.css.js.map +1 -0
  43. package/cjs/shell-layout-templates/context-panel/ContextPanel.js +100 -0
  44. package/cjs/shell-layout-templates/context-panel/ContextPanel.js.map +1 -0
  45. package/cjs/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +51 -0
  46. package/cjs/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js.map +1 -0
  47. package/cjs/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js +83 -0
  48. package/cjs/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js.map +1 -0
  49. package/cjs/shell-layout-templates/left-main-tabs/useLeftMainTabs.js +46 -0
  50. package/cjs/shell-layout-templates/left-main-tabs/useLeftMainTabs.js.map +1 -0
  51. package/cjs/shell-layout-templates/side-panel/SidePanel.css.js +6 -0
  52. package/cjs/shell-layout-templates/side-panel/SidePanel.css.js.map +1 -0
  53. package/cjs/shell-layout-templates/side-panel/SidePanel.js +36 -0
  54. package/cjs/shell-layout-templates/side-panel/SidePanel.js.map +1 -0
  55. package/cjs/shell-layout-templates/simple-content-pane/useSimpleContentPane.js +48 -0
  56. package/cjs/shell-layout-templates/simple-content-pane/useSimpleContentPane.js.map +1 -0
  57. package/cjs/shell-layout-templates/useShellLayout.js +23 -0
  58. package/cjs/shell-layout-templates/useShellLayout.js.map +1 -0
  59. package/cjs/shell.css.js +6 -0
  60. package/cjs/shell.css.js.map +1 -0
  61. package/cjs/shell.js +137 -0
  62. package/cjs/shell.js.map +1 -0
  63. package/cjs/theme-switch/ThemeSwitch.css.js +6 -0
  64. package/cjs/theme-switch/ThemeSwitch.css.js.map +1 -0
  65. package/cjs/theme-switch/ThemeSwitch.js +56 -0
  66. package/cjs/theme-switch/ThemeSwitch.js.map +1 -0
  67. package/cjs/user-settings/SettingsForm.css.js +6 -0
  68. package/cjs/user-settings/SettingsForm.css.js.map +1 -0
  69. package/cjs/user-settings/SettingsForm.js +168 -0
  70. package/cjs/user-settings/SettingsForm.js.map +1 -0
  71. package/cjs/user-settings/UserSettingsPanel.css.js +6 -0
  72. package/cjs/user-settings/UserSettingsPanel.css.js.map +1 -0
  73. package/cjs/user-settings/UserSettingsPanel.js +42 -0
  74. package/cjs/user-settings/UserSettingsPanel.js.map +1 -0
  75. package/cjs/workspace-management/LayoutList.css.js +6 -0
  76. package/cjs/workspace-management/LayoutList.css.js.map +1 -0
  77. package/cjs/workspace-management/LayoutList.js +116 -0
  78. package/cjs/workspace-management/LayoutList.js.map +1 -0
  79. package/cjs/workspace-management/LayoutTile.css.js +6 -0
  80. package/cjs/workspace-management/LayoutTile.css.js.map +1 -0
  81. package/cjs/workspace-management/LayoutTile.js +41 -0
  82. package/cjs/workspace-management/LayoutTile.js.map +1 -0
  83. package/cjs/workspace-management/SaveLayoutPanel.css.js +6 -0
  84. package/cjs/workspace-management/SaveLayoutPanel.css.js.map +1 -0
  85. package/cjs/workspace-management/SaveLayoutPanel.js +128 -0
  86. package/cjs/workspace-management/SaveLayoutPanel.js.map +1 -0
  87. package/cjs/workspace-management/WorkspaceProvider.js +265 -0
  88. package/cjs/workspace-management/WorkspaceProvider.js.map +1 -0
  89. package/cjs/workspace-management/defaultWorkspaceJSON.js +101 -0
  90. package/cjs/workspace-management/defaultWorkspaceJSON.js.map +1 -0
  91. package/cjs/workspace-management/screenshot-utils.js +25 -0
  92. package/cjs/workspace-management/screenshot-utils.js.map +1 -0
  93. package/cjs/workspace-management/useWorkspaceContextMenuItems.js +72 -0
  94. package/cjs/workspace-management/useWorkspaceContextMenuItems.js.map +1 -0
  95. package/esm/ShellContextProvider.js +23 -0
  96. package/esm/ShellContextProvider.js.map +1 -0
  97. package/esm/app-header/AppHeader.css.js +4 -0
  98. package/esm/app-header/AppHeader.css.js.map +1 -0
  99. package/esm/app-header/AppHeader.js +116 -0
  100. package/esm/app-header/AppHeader.js.map +1 -0
  101. package/esm/application-provider/ApplicationContext.js +15 -0
  102. package/esm/application-provider/ApplicationContext.js.map +1 -0
  103. package/esm/application-provider/ApplicationProvider.js +96 -0
  104. package/esm/application-provider/ApplicationProvider.js.map +1 -0
  105. package/esm/feature/Feature.js +52 -0
  106. package/esm/feature/Feature.js.map +1 -0
  107. package/esm/feature/FeatureErrorBoundary.js +28 -0
  108. package/esm/feature/FeatureErrorBoundary.js.map +1 -0
  109. package/esm/feature-and-layout-provider/FeatureAndLayoutProvider.js +56 -0
  110. package/esm/feature-and-layout-provider/FeatureAndLayoutProvider.js.map +1 -0
  111. package/esm/feature-list/FeatureList.css.js +4 -0
  112. package/esm/feature-list/FeatureList.css.js.map +1 -0
  113. package/esm/feature-list/FeatureList.js +107 -0
  114. package/esm/feature-list/FeatureList.js.map +1 -0
  115. package/esm/index.js +25 -0
  116. package/esm/index.js.map +1 -0
  117. package/esm/left-nav/LeftNav.css.js +4 -0
  118. package/esm/left-nav/LeftNav.css.js.map +1 -0
  119. package/esm/left-nav/LeftNav.js +200 -0
  120. package/esm/left-nav/LeftNav.js.map +1 -0
  121. package/esm/login/LoginPanel.css.js +4 -0
  122. package/esm/login/LoginPanel.css.js.map +1 -0
  123. package/esm/login/LoginPanel.js +108 -0
  124. package/esm/login/LoginPanel.js.map +1 -0
  125. package/esm/login/VuuLogo.js +132 -0
  126. package/esm/login/VuuLogo.js.map +1 -0
  127. package/esm/persistence-manager/LocalPersistenceManager.js +191 -0
  128. package/esm/persistence-manager/LocalPersistenceManager.js.map +1 -0
  129. package/esm/persistence-manager/PersistenceProvider.js +17 -0
  130. package/esm/persistence-manager/PersistenceProvider.js.map +1 -0
  131. package/esm/persistence-manager/RemotePersistenceManager.js +163 -0
  132. package/esm/persistence-manager/RemotePersistenceManager.js.map +1 -0
  133. package/esm/persistence-manager/StaticPersistenceManager.js +71 -0
  134. package/esm/persistence-manager/StaticPersistenceManager.js.map +1 -0
  135. package/esm/shell-layout-templates/context-panel/ContextPanel.css.js +4 -0
  136. package/esm/shell-layout-templates/context-panel/ContextPanel.css.js.map +1 -0
  137. package/esm/shell-layout-templates/context-panel/ContextPanel.js +98 -0
  138. package/esm/shell-layout-templates/context-panel/ContextPanel.js.map +1 -0
  139. package/esm/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +49 -0
  140. package/esm/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js.map +1 -0
  141. package/esm/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js +81 -0
  142. package/esm/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js.map +1 -0
  143. package/esm/shell-layout-templates/left-main-tabs/useLeftMainTabs.js +44 -0
  144. package/esm/shell-layout-templates/left-main-tabs/useLeftMainTabs.js.map +1 -0
  145. package/esm/shell-layout-templates/side-panel/SidePanel.css.js +4 -0
  146. package/esm/shell-layout-templates/side-panel/SidePanel.css.js.map +1 -0
  147. package/esm/shell-layout-templates/side-panel/SidePanel.js +34 -0
  148. package/esm/shell-layout-templates/side-panel/SidePanel.js.map +1 -0
  149. package/esm/shell-layout-templates/simple-content-pane/useSimpleContentPane.js +46 -0
  150. package/esm/shell-layout-templates/simple-content-pane/useSimpleContentPane.js.map +1 -0
  151. package/esm/shell-layout-templates/useShellLayout.js +21 -0
  152. package/esm/shell-layout-templates/useShellLayout.js.map +1 -0
  153. package/esm/shell.css.js +4 -0
  154. package/esm/shell.css.js.map +1 -0
  155. package/esm/shell.js +135 -0
  156. package/esm/shell.js.map +1 -0
  157. package/esm/theme-switch/ThemeSwitch.css.js +4 -0
  158. package/esm/theme-switch/ThemeSwitch.css.js.map +1 -0
  159. package/esm/theme-switch/ThemeSwitch.js +54 -0
  160. package/esm/theme-switch/ThemeSwitch.js.map +1 -0
  161. package/esm/user-settings/SettingsForm.css.js +4 -0
  162. package/esm/user-settings/SettingsForm.css.js.map +1 -0
  163. package/esm/user-settings/SettingsForm.js +162 -0
  164. package/esm/user-settings/SettingsForm.js.map +1 -0
  165. package/esm/user-settings/UserSettingsPanel.css.js +4 -0
  166. package/esm/user-settings/UserSettingsPanel.css.js.map +1 -0
  167. package/esm/user-settings/UserSettingsPanel.js +40 -0
  168. package/esm/user-settings/UserSettingsPanel.js.map +1 -0
  169. package/esm/workspace-management/LayoutList.css.js +4 -0
  170. package/esm/workspace-management/LayoutList.css.js.map +1 -0
  171. package/esm/workspace-management/LayoutList.js +114 -0
  172. package/esm/workspace-management/LayoutList.js.map +1 -0
  173. package/esm/workspace-management/LayoutTile.css.js +4 -0
  174. package/esm/workspace-management/LayoutTile.css.js.map +1 -0
  175. package/esm/workspace-management/LayoutTile.js +39 -0
  176. package/esm/workspace-management/LayoutTile.js.map +1 -0
  177. package/esm/workspace-management/SaveLayoutPanel.css.js +4 -0
  178. package/esm/workspace-management/SaveLayoutPanel.css.js.map +1 -0
  179. package/esm/workspace-management/SaveLayoutPanel.js +126 -0
  180. package/esm/workspace-management/SaveLayoutPanel.js.map +1 -0
  181. package/esm/workspace-management/WorkspaceProvider.js +262 -0
  182. package/esm/workspace-management/WorkspaceProvider.js.map +1 -0
  183. package/esm/workspace-management/defaultWorkspaceJSON.js +95 -0
  184. package/esm/workspace-management/defaultWorkspaceJSON.js.map +1 -0
  185. package/esm/workspace-management/screenshot-utils.js +23 -0
  186. package/esm/workspace-management/screenshot-utils.js.map +1 -0
  187. package/esm/workspace-management/useWorkspaceContextMenuItems.js +70 -0
  188. package/esm/workspace-management/useWorkspaceContextMenuItems.js.map +1 -0
  189. package/package.json +20 -17
  190. package/types/feature/FeatureErrorBoundary.d.ts +1 -1
  191. package/types/workspace-management/WorkspaceProvider.d.ts +5 -5
  192. package/src/ShellContextProvider.js +0 -20
  193. package/src/app-header/AppHeader.css.js +0 -21
  194. package/src/app-header/AppHeader.js +0 -97
  195. package/src/app-header/index.js +0 -1
  196. package/src/application-provider/ApplicationContext.js +0 -9
  197. package/src/application-provider/ApplicationProvider.js +0 -77
  198. package/src/application-provider/index.js +0 -1
  199. package/src/feature/Feature.js +0 -37
  200. package/src/feature/FeatureErrorBoundary.js +0 -33
  201. package/src/feature/Loader.js +0 -5
  202. package/src/feature/index.js +0 -1
  203. package/src/feature-and-layout-provider/FeatureAndLayoutProvider.js +0 -42
  204. package/src/feature-and-layout-provider/index.js +0 -1
  205. package/src/feature-list/FeatureList.css.js +0 -62
  206. package/src/feature-list/FeatureList.js +0 -128
  207. package/src/feature-list/index.js +0 -1
  208. package/src/get-layout-history.js +0 -7
  209. package/src/index.js +0 -14
  210. package/src/left-nav/LeftNav.css.js +0 -177
  211. package/src/left-nav/LeftNav.js +0 -193
  212. package/src/left-nav/index.js +0 -1
  213. package/src/login/LoginPanel.css.js +0 -72
  214. package/src/login/LoginPanel.js +0 -124
  215. package/src/login/VuuLogo.js +0 -108
  216. package/src/persistence-manager/LocalPersistenceManager.js +0 -156
  217. package/src/persistence-manager/PersistenceManager.js +0 -0
  218. package/src/persistence-manager/PersistenceProvider.js +0 -14
  219. package/src/persistence-manager/RemotePersistenceManager.js +0 -123
  220. package/src/persistence-manager/StaticPersistenceManager.js +0 -53
  221. package/src/persistence-manager/index.js +0 -5
  222. package/src/shell-layout-templates/context-panel/ContextPanel.css.js +0 -66
  223. package/src/shell-layout-templates/context-panel/ContextPanel.js +0 -92
  224. package/src/shell-layout-templates/context-panel/index.js +0 -1
  225. package/src/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +0 -44
  226. package/src/shell-layout-templates/index.js +0 -3
  227. package/src/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js +0 -68
  228. package/src/shell-layout-templates/left-main-tabs/useLeftMainTabs.js +0 -32
  229. package/src/shell-layout-templates/side-panel/SidePanel.css.js +0 -9
  230. package/src/shell-layout-templates/side-panel/SidePanel.js +0 -31
  231. package/src/shell-layout-templates/side-panel/index.js +0 -1
  232. package/src/shell-layout-templates/simple-content-pane/useSimpleContentPane.js +0 -38
  233. package/src/shell-layout-templates/useShellLayout.js +0 -15
  234. package/src/shell.css.js +0 -59
  235. package/src/shell.js +0 -108
  236. package/src/theme-switch/ThemeSwitch.css.js +0 -34
  237. package/src/theme-switch/ThemeSwitch.js +0 -50
  238. package/src/theme-switch/index.js +0 -1
  239. package/src/user-settings/SettingsForm.css.js +0 -10
  240. package/src/user-settings/SettingsForm.js +0 -141
  241. package/src/user-settings/UserSettingsPanel.css.js +0 -9
  242. package/src/user-settings/UserSettingsPanel.js +0 -29
  243. package/src/user-settings/index.js +0 -2
  244. package/src/workspace-management/LayoutList.css.js +0 -74
  245. package/src/workspace-management/LayoutList.js +0 -130
  246. package/src/workspace-management/LayoutTile.css.js +0 -31
  247. package/src/workspace-management/LayoutTile.js +0 -41
  248. package/src/workspace-management/SaveLayoutPanel.css.js +0 -123
  249. package/src/workspace-management/SaveLayoutPanel.js +0 -141
  250. package/src/workspace-management/WorkspaceProvider.js +0 -209
  251. package/src/workspace-management/defaultWorkspaceJSON.js +0 -88
  252. package/src/workspace-management/index.js +0 -5
  253. package/src/workspace-management/screenshot-utils.js +0 -13
  254. package/src/workspace-management/useWorkspaceContextMenuItems.js +0 -58
@@ -1,97 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Button } from "@salt-ds/core";
3
- import { useComponentCssInjection } from "@salt-ds/styles";
4
- import { useWindow } from "@salt-ds/window";
5
- import { useLayoutOperation } from "@vuu-ui/vuu-layout";
6
- import { Toolbar } from "@vuu-ui/vuu-ui-controls";
7
- import clsx from "clsx";
8
- import { useCallback, useRef } from "react";
9
- import { usePersistenceManager } from "../persistence-manager/index.js";
10
- import { NotificationType, useNotifications } from "@vuu-ui/vuu-notifications";
11
- import { useLogout } from "../application-provider/index.js";
12
- import AppHeader from "./AppHeader.css";
13
- const classBase = "vuuAppHeader";
14
- const AppHeader_AppHeader = ({ className: classNameProp, themeMode: _, ...htmlAttributes })=>{
15
- const targetWindow = useWindow();
16
- useComponentCssInjection({
17
- testId: "vuu-app-header",
18
- css: AppHeader,
19
- window: targetWindow
20
- });
21
- const persistenceManager = usePersistenceManager();
22
- const settingsButtonRef = useRef(null);
23
- const className = clsx(classBase, classNameProp);
24
- const logout = useLogout();
25
- const { showComponentInContextPanel } = useLayoutOperation();
26
- const { showNotification } = useNotifications();
27
- const handleReset = useCallback(()=>{
28
- persistenceManager?.clearUserSettings();
29
- showNotification({
30
- animationType: "slide-out",
31
- renderPostRefresh: true,
32
- type: NotificationType.Toast,
33
- header: "Success",
34
- content: "Settings cleared",
35
- status: "success"
36
- });
37
- location.reload();
38
- }, [
39
- persistenceManager,
40
- showNotification
41
- ]);
42
- const handleShowSettings = useCallback(()=>{
43
- showComponentInContextPanel({
44
- type: "ApplicationSettings"
45
- }, "Settings", ()=>settingsButtonRef.current?.focus());
46
- }, [
47
- showComponentInContextPanel
48
- ]);
49
- return /*#__PURE__*/ jsxs(Toolbar, {
50
- alignItems: "end",
51
- className: className,
52
- role: "banner",
53
- showSeparators: true,
54
- ...htmlAttributes,
55
- children: [
56
- /*#__PURE__*/ jsx(Button, {
57
- className: `${classBase}-menuItem`,
58
- appearance: "transparent",
59
- sentiment: "neutral",
60
- children: "Help"
61
- }),
62
- /*#__PURE__*/ jsxs(Button, {
63
- appearance: "transparent",
64
- className: `${classBase}-menuItem`,
65
- onClick: handleReset,
66
- sentiment: "neutral",
67
- children: [
68
- "Reset ",
69
- /*#__PURE__*/ jsx("span", {
70
- "data-icon": "history"
71
- })
72
- ]
73
- }),
74
- /*#__PURE__*/ jsxs(Button, {
75
- appearance: "transparent",
76
- className: `${classBase}-menuItem`,
77
- onClick: handleShowSettings,
78
- ref: settingsButtonRef,
79
- sentiment: "neutral",
80
- children: [
81
- "Settings ",
82
- /*#__PURE__*/ jsx("span", {
83
- "data-icon": "settings"
84
- })
85
- ]
86
- }),
87
- /*#__PURE__*/ jsx(Button, {
88
- appearance: "transparent",
89
- className: `${classBase}-menuItem`,
90
- onClick: logout,
91
- sentiment: "neutral",
92
- children: "Log out"
93
- })
94
- ]
95
- });
96
- };
97
- export { AppHeader_AppHeader as AppHeader };
@@ -1 +0,0 @@
1
- export * from "./AppHeader.js";
@@ -1,9 +0,0 @@
1
- import { createContext } from "react";
2
- const Guest = {
3
- username: "unknown"
4
- };
5
- const ApplicationContext = /*#__PURE__*/ createContext({
6
- onUserSettingChanged: (propertyName)=>console.warn(`Cannot change setting '${propertyName}'.\nDid you forget to declare an ApplicationProvider ?`),
7
- user: Guest
8
- });
9
- export { ApplicationContext };
@@ -1,77 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { SaltProviderNext, useDensity, useTheme } from "@salt-ds/core";
3
- import { useCallback, useContext, useMemo, useState } from "react";
4
- import { ApplicationContext } from "./ApplicationContext.js";
5
- import { usePersistenceManager } from "../persistence-manager/index.js";
6
- const accentPurple = "purple";
7
- const getThemeMode = (mode = "light", userSettings)=>{
8
- const themeMode = userSettings?.themeMode;
9
- if ("light" === themeMode || "dark" === themeMode) return themeMode;
10
- return mode;
11
- };
12
- const ApplicationProvider = ({ children, density: densityProp, logout, mode, theme, userSettingsSchema: userSettingsSchema, user })=>{
13
- const { mode: inheritedMode, theme: inheritedTheme } = useTheme();
14
- const density = useDensity(densityProp);
15
- const persistenceManager = usePersistenceManager();
16
- const context = useContext(ApplicationContext);
17
- const [userSettings, setSettings] = useState();
18
- useMemo(async ()=>{
19
- if (persistenceManager) {
20
- const userSettings = await persistenceManager.getUserSettings();
21
- setSettings(userSettings);
22
- } else setSettings({});
23
- }, [
24
- persistenceManager
25
- ]);
26
- const onUserSettingChanged = useCallback((propertyName, value)=>{
27
- setSettings((currentSettings)=>{
28
- const newSettings = {
29
- ...currentSettings,
30
- [propertyName]: value
31
- };
32
- persistenceManager?.saveUserSettings(newSettings);
33
- return newSettings;
34
- });
35
- }, [
36
- persistenceManager
37
- ]);
38
- return userSettings ? /*#__PURE__*/ jsx(ApplicationContext.Provider, {
39
- value: {
40
- ...context,
41
- logout,
42
- onUserSettingChanged,
43
- userSettings,
44
- userSettingsSchema,
45
- user: user ?? context.user
46
- },
47
- children: /*#__PURE__*/ jsx(SaltProviderNext, {
48
- accent: accentPurple,
49
- corner: "rounded",
50
- theme: theme ?? inheritedTheme ?? "vuu-theme",
51
- density: density,
52
- mode: getThemeMode(mode ?? inheritedMode, userSettings),
53
- children: children
54
- })
55
- }) : null;
56
- };
57
- const useApplicationUser = ()=>{
58
- const { user } = useContext(ApplicationContext);
59
- return user;
60
- };
61
- const useApplicationSettings = ()=>{
62
- const { onUserSettingChanged, userSettings, userSettingsSchema } = useContext(ApplicationContext);
63
- return {
64
- onUserSettingChanged,
65
- userSettings,
66
- userSettingsSchema
67
- };
68
- };
69
- const useUserSetting = ()=>{
70
- const { userSettings } = useContext(ApplicationContext);
71
- return userSettings;
72
- };
73
- const useLogout = ()=>{
74
- const { logout } = useContext(ApplicationContext);
75
- return logout;
76
- };
77
- export { ApplicationProvider, useApplicationSettings, useApplicationUser, useLogout, useUserSetting };
@@ -1 +0,0 @@
1
- export * from "./ApplicationProvider.js";
@@ -1,37 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { importCSS, registerComponent } from "@vuu-ui/vuu-utils";
3
- import react, { useEffect } from "react";
4
- import { FeatureErrorBoundary } from "./FeatureErrorBoundary.js";
5
- const componentsMap = new Map();
6
- const useCachedFeature = (url)=>{
7
- useEffect(()=>()=>{
8
- componentsMap.delete(url);
9
- }, [
10
- url
11
- ]);
12
- if (!componentsMap.has(url)) componentsMap.set(url, /*#__PURE__*/ react.lazy(()=>import(/* @vite-ignore */ url)));
13
- const lazyFeature = componentsMap.get(url);
14
- if (lazyFeature) return lazyFeature;
15
- throw Error(`Unable to load Lazy Feature at url ${url}`);
16
- };
17
- function RawFeature({ url, css, ComponentProps: params, ...props }) {
18
- if (css) // import(/* @vite-ignore */ css, { assert: { type: "css" } }).then(
19
- importCSS(css).then((styleSheet)=>{
20
- document.adoptedStyleSheets = [
21
- ...document.adoptedStyleSheets,
22
- styleSheet
23
- ];
24
- });
25
- const LazyFeature = useCachedFeature(url);
26
- return /*#__PURE__*/ jsx(FeatureErrorBoundary, {
27
- url: url,
28
- children: /*#__PURE__*/ jsx(LazyFeature, {
29
- ...props,
30
- ...params
31
- })
32
- });
33
- }
34
- const Feature = /*#__PURE__*/ react.memo(RawFeature);
35
- Feature.displayName = "Feature";
36
- registerComponent("Feature", Feature, "view");
37
- export { Feature };
@@ -1,33 +0,0 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import react from "react";
3
- class FeatureErrorBoundary extends react.Component {
4
- constructor(props){
5
- super(props);
6
- this.state = {
7
- errorMessage: null
8
- };
9
- }
10
- static getDerivedStateFromError(error) {
11
- return {
12
- errorMessage: error.message
13
- };
14
- }
15
- componentDidCatch(error, errorInfo) {
16
- console.log(`error creating component at ${this.props.url}`);
17
- console.log(error, errorInfo);
18
- }
19
- render() {
20
- if (this.state.errorMessage) return /*#__PURE__*/ jsxs(Fragment, {
21
- children: [
22
- /*#__PURE__*/ jsx("h1", {
23
- children: "An error occured while creating component."
24
- }),
25
- /*#__PURE__*/ jsx("p", {
26
- children: this.state.errorMessage
27
- })
28
- ]
29
- });
30
- return this.props.children;
31
- }
32
- }
33
- export { FeatureErrorBoundary };
@@ -1,5 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- const Loader = ()=>/*#__PURE__*/ jsx("div", {
3
- className: "hwLoader"
4
- });
5
- export { Loader };
@@ -1 +0,0 @@
1
- export * from "./Feature.js";
@@ -1,42 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { getCustomAndTableFeatures } from "@vuu-ui/vuu-utils";
3
- import { createContext, useContext, useMemo } from "react";
4
- import { useVuuTables } from "@vuu-ui/vuu-data-react";
5
- const NO_FEATURES = [];
6
- const NO_STATICFEATURES = [];
7
- const NO_SYSTEMLAYOUTS = [];
8
- const NO_FEATURES_VUU = {
9
- dynamicFeatures: NO_FEATURES,
10
- tableFeatures: NO_FEATURES
11
- };
12
- const FeatureContext = /*#__PURE__*/ createContext({
13
- dynamicFeatures: NO_FEATURES,
14
- tableFeatures: NO_FEATURES,
15
- staticFeatures: NO_STATICFEATURES
16
- });
17
- const LayoutContext = /*#__PURE__*/ createContext({
18
- systemLayouts: NO_SYSTEMLAYOUTS
19
- });
20
- const FeatureAndLayoutProvider = ({ children, dynamicFeatures: dynamicFeaturesProp = [], staticFeatures, systemLayouts })=>{
21
- const tableSchemas = useVuuTables();
22
- const { dynamicFeatures, tableFeatures } = useMemo(()=>tableSchemas ? getCustomAndTableFeatures(dynamicFeaturesProp, tableSchemas) : NO_FEATURES_VUU, [
23
- dynamicFeaturesProp,
24
- tableSchemas
25
- ]);
26
- return /*#__PURE__*/ jsx(FeatureContext.Provider, {
27
- value: {
28
- dynamicFeatures,
29
- tableFeatures,
30
- staticFeatures
31
- },
32
- children: /*#__PURE__*/ jsx(LayoutContext.Provider, {
33
- value: {
34
- systemLayouts
35
- },
36
- children: children
37
- })
38
- });
39
- };
40
- const useFeatures = ()=>useContext(FeatureContext);
41
- const useLayouts = ()=>useContext(LayoutContext);
42
- export { FeatureAndLayoutProvider, useFeatures, useLayouts };
@@ -1 +0,0 @@
1
- export * from "./FeatureAndLayoutProvider.js";
@@ -1,62 +0,0 @@
1
- const css = `
2
- .vuuFeatureList {
3
- --vuuListItem-padding: var(--salt-spacing-200);
4
- background: var(--vuuFeatureList-background, var(--salt-container-primary-background));
5
- height: 100%;
6
- padding: 0 var(--vuuFeatureList-padding, 0);
7
- flex-direction: column;
8
- display: flex;
9
- }
10
-
11
- .vuuFeatureList-header {
12
- flex: 0 0 48px;
13
- align-items: center;
14
- font-weight: 700;
15
- line-height: 2;
16
- display: flex;
17
- }
18
-
19
- .vuuFeatureList-content {
20
- flex-direction: column;
21
- flex: auto;
22
- font-size: 12px;
23
- font-weight: 700;
24
- display: flex;
25
- overflow: auto;
26
- }
27
-
28
- .vuuFeatureList-standalone {
29
- margin-top: 24px;
30
- }
31
-
32
- .vuuFeatureList-group {
33
- --vuuMeasuredContainer-flex: 0 0 auto;
34
- flex-direction: column;
35
- display: flex;
36
-
37
- & .vuuFeatureList-groupHeader {
38
- flex: 0 0 32px;
39
- padding: 8px 0;
40
- }
41
-
42
- & .vuuPalette {
43
- flex: auto;
44
- height: auto;
45
- }
46
- }
47
-
48
- .vuuFeatureList-group:first-child {
49
- margin-top: 12px;
50
- }
51
-
52
- .vuuFeatureList-group + .vuuFeatureList-group {
53
- margin-top: 24px;
54
- }
55
-
56
- .vuuFeatureList-itemName {
57
- font-weight: 700;
58
- }
59
-
60
-
61
- `;
62
- export default css;
@@ -1,128 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Palette, PaletteItem } from "@vuu-ui/vuu-layout";
3
- import { Icon } from "@vuu-ui/vuu-ui-controls";
4
- import { featureFromJson, isStaticFeatures } from "@vuu-ui/vuu-utils";
5
- import { useComponentCssInjection } from "@salt-ds/styles";
6
- import { useWindow } from "@salt-ds/window";
7
- import clsx from "clsx";
8
- import { useMemo } from "react";
9
- import { Feature } from "../feature/Feature.js";
10
- import FeatureList from "./FeatureList.css";
11
- const classBase = "vuuFeatureList";
12
- const FeatureList_FeatureList = ({ features, title = "VUU TABLES", ...htmlAttributes })=>{
13
- const targetWindow = useWindow();
14
- useComponentCssInjection({
15
- testId: "vuu-feature-list",
16
- css: FeatureList,
17
- window: targetWindow
18
- });
19
- const content = useMemo(()=>{
20
- if (isStaticFeatures(features)) return features.map(({ label, type }, idx)=>/*#__PURE__*/ jsxs(PaletteItem, {
21
- ViewProps: {
22
- closeable: true,
23
- header: true,
24
- resize: "defer",
25
- resizeable: true
26
- },
27
- component: featureFromJson({
28
- type
29
- }),
30
- value: label,
31
- children: [
32
- /*#__PURE__*/ jsx(Icon, {
33
- name: "draggable",
34
- size: 18
35
- }),
36
- /*#__PURE__*/ jsx("span", {
37
- className: `${classBase}-itemName`,
38
- children: label
39
- })
40
- ]
41
- }, idx));
42
- if (Array.isArray(features)) return [
43
- /*#__PURE__*/ jsx("div", {
44
- className: `${classBase}-standalone`,
45
- children: /*#__PURE__*/ jsx(Palette, {
46
- orientation: "vertical",
47
- children: features.map(({ ViewProps, ...featureProps }, i)=>/*#__PURE__*/ jsxs(PaletteItem, {
48
- ViewProps: {
49
- closeable: true,
50
- header: true,
51
- resize: "defer",
52
- resizeable: true,
53
- title: featureProps.title,
54
- ...ViewProps
55
- },
56
- component: /*#__PURE__*/ jsx(Feature, {
57
- ...featureProps
58
- }),
59
- value: featureProps.title,
60
- children: [
61
- /*#__PURE__*/ jsx(Icon, {
62
- name: "draggable",
63
- size: 18
64
- }),
65
- /*#__PURE__*/ jsx("span", {
66
- className: `${classBase}-itemName`,
67
- children: featureProps.title
68
- })
69
- ]
70
- }, i))
71
- }, "0")
72
- }, 0)
73
- ];
74
- return Object.entries(features).map(([heading, featureList], index)=>/*#__PURE__*/ jsxs("div", {
75
- className: `${classBase}-group`,
76
- children: [
77
- /*#__PURE__*/ jsx("div", {
78
- className: `${classBase}-groupHeader`,
79
- children: heading
80
- }),
81
- /*#__PURE__*/ jsx(Palette, {
82
- orientation: "vertical",
83
- children: featureList.map(({ ViewProps, ...featureProps }, i)=>/*#__PURE__*/ jsxs(PaletteItem, {
84
- ViewProps: {
85
- closeable: true,
86
- header: true,
87
- resize: "defer",
88
- resizeable: true,
89
- title: featureProps.title,
90
- ...ViewProps
91
- },
92
- component: /*#__PURE__*/ jsx(Feature, {
93
- ...featureProps
94
- }),
95
- value: featureProps.title,
96
- children: [
97
- /*#__PURE__*/ jsx(Icon, {
98
- name: "draggable",
99
- size: 18
100
- }),
101
- /*#__PURE__*/ jsx("span", {
102
- className: `${classBase}-itemName`,
103
- children: featureProps.title
104
- })
105
- ]
106
- }, i))
107
- })
108
- ]
109
- }, index));
110
- }, [
111
- features
112
- ]);
113
- return /*#__PURE__*/ jsxs("div", {
114
- ...htmlAttributes,
115
- className: clsx(classBase, "vuuScrollable"),
116
- children: [
117
- /*#__PURE__*/ jsx("div", {
118
- className: `${classBase}-header`,
119
- children: title
120
- }),
121
- /*#__PURE__*/ jsx("div", {
122
- className: `${classBase}-content`,
123
- children: content
124
- })
125
- ]
126
- });
127
- };
128
- export { FeatureList_FeatureList as FeatureList };
@@ -1 +0,0 @@
1
- export * from "./FeatureList.js";
@@ -1,7 +0,0 @@
1
- const getLayoutHistory = async (user)=>{
2
- const history = await fetch(`api/vui/${user.username}`, {}).then((response)=>response.ok ? response.json() : null).catch(()=>{
3
- console.log("error getting history");
4
- });
5
- return history;
6
- };
7
- export { getLayoutHistory };
package/src/index.js DELETED
@@ -1,14 +0,0 @@
1
- export * from "./application-provider/index.js";
2
- export * from "./app-header/index.js";
3
- export * from "./feature/index.js";
4
- export * from "./feature-and-layout-provider/index.js";
5
- export * from "./left-nav/index.js";
6
- export * from "./persistence-manager/index.js";
7
- export * from "./shell.js";
8
- export * from "./shell-layout-templates/index.js";
9
- export * from "./ShellContextProvider.js";
10
- export * from "./feature-list/index.js";
11
- export * from "./theme-switch/index.js";
12
- export * from "./user-settings/index.js";
13
- export * from "./workspace-management/index.js";
14
- export { LoginPanel } from "./login/LoginPanel.js";