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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/package.json +17 -20
  2. package/src/ShellContextProvider.js +20 -0
  3. package/src/app-header/AppHeader.css.js +21 -0
  4. package/src/app-header/AppHeader.js +97 -0
  5. package/src/app-header/index.js +1 -0
  6. package/src/application-provider/ApplicationContext.js +9 -0
  7. package/src/application-provider/ApplicationProvider.js +77 -0
  8. package/src/application-provider/index.js +1 -0
  9. package/src/feature/Feature.js +37 -0
  10. package/src/feature/FeatureErrorBoundary.js +33 -0
  11. package/src/feature/Loader.js +5 -0
  12. package/src/feature/index.js +1 -0
  13. package/src/feature-and-layout-provider/FeatureAndLayoutProvider.js +42 -0
  14. package/src/feature-and-layout-provider/index.js +1 -0
  15. package/src/feature-list/FeatureList.css.js +62 -0
  16. package/src/feature-list/FeatureList.js +128 -0
  17. package/src/feature-list/index.js +1 -0
  18. package/src/get-layout-history.js +7 -0
  19. package/src/index.js +14 -0
  20. package/src/left-nav/LeftNav.css.js +177 -0
  21. package/src/left-nav/LeftNav.js +193 -0
  22. package/src/left-nav/index.js +1 -0
  23. package/src/login/LoginPanel.css.js +72 -0
  24. package/src/login/LoginPanel.js +124 -0
  25. package/src/login/VuuLogo.js +108 -0
  26. package/src/persistence-manager/LocalPersistenceManager.js +156 -0
  27. package/src/persistence-manager/PersistenceManager.js +0 -0
  28. package/src/persistence-manager/PersistenceProvider.js +14 -0
  29. package/src/persistence-manager/RemotePersistenceManager.js +123 -0
  30. package/src/persistence-manager/StaticPersistenceManager.js +53 -0
  31. package/src/persistence-manager/index.js +5 -0
  32. package/src/shell-layout-templates/context-panel/ContextPanel.css.js +66 -0
  33. package/src/shell-layout-templates/context-panel/ContextPanel.js +92 -0
  34. package/src/shell-layout-templates/context-panel/index.js +1 -0
  35. package/src/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +44 -0
  36. package/src/shell-layout-templates/index.js +3 -0
  37. package/src/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js +68 -0
  38. package/src/shell-layout-templates/left-main-tabs/useLeftMainTabs.js +32 -0
  39. package/src/shell-layout-templates/side-panel/SidePanel.css.js +9 -0
  40. package/src/shell-layout-templates/side-panel/SidePanel.js +31 -0
  41. package/src/shell-layout-templates/side-panel/index.js +1 -0
  42. package/src/shell-layout-templates/simple-content-pane/useSimpleContentPane.js +38 -0
  43. package/src/shell-layout-templates/useShellLayout.js +15 -0
  44. package/src/shell.css.js +59 -0
  45. package/src/shell.js +108 -0
  46. package/src/theme-switch/ThemeSwitch.css.js +34 -0
  47. package/src/theme-switch/ThemeSwitch.js +50 -0
  48. package/src/theme-switch/index.js +1 -0
  49. package/src/user-settings/SettingsForm.css.js +10 -0
  50. package/src/user-settings/SettingsForm.js +141 -0
  51. package/src/user-settings/UserSettingsPanel.css.js +9 -0
  52. package/src/user-settings/UserSettingsPanel.js +29 -0
  53. package/src/user-settings/index.js +2 -0
  54. package/src/workspace-management/LayoutList.css.js +74 -0
  55. package/src/workspace-management/LayoutList.js +130 -0
  56. package/src/workspace-management/LayoutTile.css.js +31 -0
  57. package/src/workspace-management/LayoutTile.js +41 -0
  58. package/src/workspace-management/SaveLayoutPanel.css.js +123 -0
  59. package/src/workspace-management/SaveLayoutPanel.js +141 -0
  60. package/src/workspace-management/WorkspaceProvider.js +209 -0
  61. package/src/workspace-management/defaultWorkspaceJSON.js +88 -0
  62. package/src/workspace-management/index.js +5 -0
  63. package/src/workspace-management/screenshot-utils.js +13 -0
  64. package/src/workspace-management/useWorkspaceContextMenuItems.js +58 -0
  65. package/types/feature/FeatureErrorBoundary.d.ts +1 -1
  66. package/types/workspace-management/WorkspaceProvider.d.ts +5 -5
  67. package/cjs/ShellContextProvider.js +0 -25
  68. package/cjs/ShellContextProvider.js.map +0 -1
  69. package/cjs/app-header/AppHeader.css.js +0 -6
  70. package/cjs/app-header/AppHeader.css.js.map +0 -1
  71. package/cjs/app-header/AppHeader.js +0 -118
  72. package/cjs/app-header/AppHeader.js.map +0 -1
  73. package/cjs/application-provider/ApplicationContext.js +0 -17
  74. package/cjs/application-provider/ApplicationContext.js.map +0 -1
  75. package/cjs/application-provider/ApplicationProvider.js +0 -102
  76. package/cjs/application-provider/ApplicationProvider.js.map +0 -1
  77. package/cjs/feature/Feature.js +0 -54
  78. package/cjs/feature/Feature.js.map +0 -1
  79. package/cjs/feature/FeatureErrorBoundary.js +0 -30
  80. package/cjs/feature/FeatureErrorBoundary.js.map +0 -1
  81. package/cjs/feature-and-layout-provider/FeatureAndLayoutProvider.js +0 -60
  82. package/cjs/feature-and-layout-provider/FeatureAndLayoutProvider.js.map +0 -1
  83. package/cjs/feature-list/FeatureList.css.js +0 -6
  84. package/cjs/feature-list/FeatureList.css.js.map +0 -1
  85. package/cjs/feature-list/FeatureList.js +0 -109
  86. package/cjs/feature-list/FeatureList.js.map +0 -1
  87. package/cjs/index.js +0 -71
  88. package/cjs/index.js.map +0 -1
  89. package/cjs/left-nav/LeftNav.css.js +0 -6
  90. package/cjs/left-nav/LeftNav.css.js.map +0 -1
  91. package/cjs/left-nav/LeftNav.js +0 -202
  92. package/cjs/left-nav/LeftNav.js.map +0 -1
  93. package/cjs/login/LoginPanel.css.js +0 -6
  94. package/cjs/login/LoginPanel.css.js.map +0 -1
  95. package/cjs/login/LoginPanel.js +0 -110
  96. package/cjs/login/LoginPanel.js.map +0 -1
  97. package/cjs/login/VuuLogo.js +0 -134
  98. package/cjs/login/VuuLogo.js.map +0 -1
  99. package/cjs/persistence-manager/LocalPersistenceManager.js +0 -193
  100. package/cjs/persistence-manager/LocalPersistenceManager.js.map +0 -1
  101. package/cjs/persistence-manager/PersistenceProvider.js +0 -21
  102. package/cjs/persistence-manager/PersistenceProvider.js.map +0 -1
  103. package/cjs/persistence-manager/RemotePersistenceManager.js +0 -165
  104. package/cjs/persistence-manager/RemotePersistenceManager.js.map +0 -1
  105. package/cjs/persistence-manager/StaticPersistenceManager.js +0 -73
  106. package/cjs/persistence-manager/StaticPersistenceManager.js.map +0 -1
  107. package/cjs/shell-layout-templates/context-panel/ContextPanel.css.js +0 -6
  108. package/cjs/shell-layout-templates/context-panel/ContextPanel.css.js.map +0 -1
  109. package/cjs/shell-layout-templates/context-panel/ContextPanel.js +0 -100
  110. package/cjs/shell-layout-templates/context-panel/ContextPanel.js.map +0 -1
  111. package/cjs/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +0 -51
  112. package/cjs/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js.map +0 -1
  113. package/cjs/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js +0 -83
  114. package/cjs/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js.map +0 -1
  115. package/cjs/shell-layout-templates/left-main-tabs/useLeftMainTabs.js +0 -46
  116. package/cjs/shell-layout-templates/left-main-tabs/useLeftMainTabs.js.map +0 -1
  117. package/cjs/shell-layout-templates/side-panel/SidePanel.css.js +0 -6
  118. package/cjs/shell-layout-templates/side-panel/SidePanel.css.js.map +0 -1
  119. package/cjs/shell-layout-templates/side-panel/SidePanel.js +0 -36
  120. package/cjs/shell-layout-templates/side-panel/SidePanel.js.map +0 -1
  121. package/cjs/shell-layout-templates/simple-content-pane/useSimpleContentPane.js +0 -48
  122. package/cjs/shell-layout-templates/simple-content-pane/useSimpleContentPane.js.map +0 -1
  123. package/cjs/shell-layout-templates/useShellLayout.js +0 -23
  124. package/cjs/shell-layout-templates/useShellLayout.js.map +0 -1
  125. package/cjs/shell.css.js +0 -6
  126. package/cjs/shell.css.js.map +0 -1
  127. package/cjs/shell.js +0 -137
  128. package/cjs/shell.js.map +0 -1
  129. package/cjs/theme-switch/ThemeSwitch.css.js +0 -6
  130. package/cjs/theme-switch/ThemeSwitch.css.js.map +0 -1
  131. package/cjs/theme-switch/ThemeSwitch.js +0 -56
  132. package/cjs/theme-switch/ThemeSwitch.js.map +0 -1
  133. package/cjs/user-settings/SettingsForm.css.js +0 -6
  134. package/cjs/user-settings/SettingsForm.css.js.map +0 -1
  135. package/cjs/user-settings/SettingsForm.js +0 -168
  136. package/cjs/user-settings/SettingsForm.js.map +0 -1
  137. package/cjs/user-settings/UserSettingsPanel.css.js +0 -6
  138. package/cjs/user-settings/UserSettingsPanel.css.js.map +0 -1
  139. package/cjs/user-settings/UserSettingsPanel.js +0 -42
  140. package/cjs/user-settings/UserSettingsPanel.js.map +0 -1
  141. package/cjs/workspace-management/LayoutList.css.js +0 -6
  142. package/cjs/workspace-management/LayoutList.css.js.map +0 -1
  143. package/cjs/workspace-management/LayoutList.js +0 -116
  144. package/cjs/workspace-management/LayoutList.js.map +0 -1
  145. package/cjs/workspace-management/LayoutTile.css.js +0 -6
  146. package/cjs/workspace-management/LayoutTile.css.js.map +0 -1
  147. package/cjs/workspace-management/LayoutTile.js +0 -41
  148. package/cjs/workspace-management/LayoutTile.js.map +0 -1
  149. package/cjs/workspace-management/SaveLayoutPanel.css.js +0 -6
  150. package/cjs/workspace-management/SaveLayoutPanel.css.js.map +0 -1
  151. package/cjs/workspace-management/SaveLayoutPanel.js +0 -128
  152. package/cjs/workspace-management/SaveLayoutPanel.js.map +0 -1
  153. package/cjs/workspace-management/WorkspaceProvider.js +0 -265
  154. package/cjs/workspace-management/WorkspaceProvider.js.map +0 -1
  155. package/cjs/workspace-management/defaultWorkspaceJSON.js +0 -101
  156. package/cjs/workspace-management/defaultWorkspaceJSON.js.map +0 -1
  157. package/cjs/workspace-management/screenshot-utils.js +0 -25
  158. package/cjs/workspace-management/screenshot-utils.js.map +0 -1
  159. package/cjs/workspace-management/useWorkspaceContextMenuItems.js +0 -72
  160. package/cjs/workspace-management/useWorkspaceContextMenuItems.js.map +0 -1
  161. package/esm/ShellContextProvider.js +0 -23
  162. package/esm/ShellContextProvider.js.map +0 -1
  163. package/esm/app-header/AppHeader.css.js +0 -4
  164. package/esm/app-header/AppHeader.css.js.map +0 -1
  165. package/esm/app-header/AppHeader.js +0 -116
  166. package/esm/app-header/AppHeader.js.map +0 -1
  167. package/esm/application-provider/ApplicationContext.js +0 -15
  168. package/esm/application-provider/ApplicationContext.js.map +0 -1
  169. package/esm/application-provider/ApplicationProvider.js +0 -96
  170. package/esm/application-provider/ApplicationProvider.js.map +0 -1
  171. package/esm/feature/Feature.js +0 -52
  172. package/esm/feature/Feature.js.map +0 -1
  173. package/esm/feature/FeatureErrorBoundary.js +0 -28
  174. package/esm/feature/FeatureErrorBoundary.js.map +0 -1
  175. package/esm/feature-and-layout-provider/FeatureAndLayoutProvider.js +0 -56
  176. package/esm/feature-and-layout-provider/FeatureAndLayoutProvider.js.map +0 -1
  177. package/esm/feature-list/FeatureList.css.js +0 -4
  178. package/esm/feature-list/FeatureList.css.js.map +0 -1
  179. package/esm/feature-list/FeatureList.js +0 -107
  180. package/esm/feature-list/FeatureList.js.map +0 -1
  181. package/esm/index.js +0 -25
  182. package/esm/index.js.map +0 -1
  183. package/esm/left-nav/LeftNav.css.js +0 -4
  184. package/esm/left-nav/LeftNav.css.js.map +0 -1
  185. package/esm/left-nav/LeftNav.js +0 -200
  186. package/esm/left-nav/LeftNav.js.map +0 -1
  187. package/esm/login/LoginPanel.css.js +0 -4
  188. package/esm/login/LoginPanel.css.js.map +0 -1
  189. package/esm/login/LoginPanel.js +0 -108
  190. package/esm/login/LoginPanel.js.map +0 -1
  191. package/esm/login/VuuLogo.js +0 -132
  192. package/esm/login/VuuLogo.js.map +0 -1
  193. package/esm/persistence-manager/LocalPersistenceManager.js +0 -191
  194. package/esm/persistence-manager/LocalPersistenceManager.js.map +0 -1
  195. package/esm/persistence-manager/PersistenceProvider.js +0 -17
  196. package/esm/persistence-manager/PersistenceProvider.js.map +0 -1
  197. package/esm/persistence-manager/RemotePersistenceManager.js +0 -163
  198. package/esm/persistence-manager/RemotePersistenceManager.js.map +0 -1
  199. package/esm/persistence-manager/StaticPersistenceManager.js +0 -71
  200. package/esm/persistence-manager/StaticPersistenceManager.js.map +0 -1
  201. package/esm/shell-layout-templates/context-panel/ContextPanel.css.js +0 -4
  202. package/esm/shell-layout-templates/context-panel/ContextPanel.css.js.map +0 -1
  203. package/esm/shell-layout-templates/context-panel/ContextPanel.js +0 -98
  204. package/esm/shell-layout-templates/context-panel/ContextPanel.js.map +0 -1
  205. package/esm/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +0 -49
  206. package/esm/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js.map +0 -1
  207. package/esm/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js +0 -81
  208. package/esm/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js.map +0 -1
  209. package/esm/shell-layout-templates/left-main-tabs/useLeftMainTabs.js +0 -44
  210. package/esm/shell-layout-templates/left-main-tabs/useLeftMainTabs.js.map +0 -1
  211. package/esm/shell-layout-templates/side-panel/SidePanel.css.js +0 -4
  212. package/esm/shell-layout-templates/side-panel/SidePanel.css.js.map +0 -1
  213. package/esm/shell-layout-templates/side-panel/SidePanel.js +0 -34
  214. package/esm/shell-layout-templates/side-panel/SidePanel.js.map +0 -1
  215. package/esm/shell-layout-templates/simple-content-pane/useSimpleContentPane.js +0 -46
  216. package/esm/shell-layout-templates/simple-content-pane/useSimpleContentPane.js.map +0 -1
  217. package/esm/shell-layout-templates/useShellLayout.js +0 -21
  218. package/esm/shell-layout-templates/useShellLayout.js.map +0 -1
  219. package/esm/shell.css.js +0 -4
  220. package/esm/shell.css.js.map +0 -1
  221. package/esm/shell.js +0 -135
  222. package/esm/shell.js.map +0 -1
  223. package/esm/theme-switch/ThemeSwitch.css.js +0 -4
  224. package/esm/theme-switch/ThemeSwitch.css.js.map +0 -1
  225. package/esm/theme-switch/ThemeSwitch.js +0 -54
  226. package/esm/theme-switch/ThemeSwitch.js.map +0 -1
  227. package/esm/user-settings/SettingsForm.css.js +0 -4
  228. package/esm/user-settings/SettingsForm.css.js.map +0 -1
  229. package/esm/user-settings/SettingsForm.js +0 -162
  230. package/esm/user-settings/SettingsForm.js.map +0 -1
  231. package/esm/user-settings/UserSettingsPanel.css.js +0 -4
  232. package/esm/user-settings/UserSettingsPanel.css.js.map +0 -1
  233. package/esm/user-settings/UserSettingsPanel.js +0 -40
  234. package/esm/user-settings/UserSettingsPanel.js.map +0 -1
  235. package/esm/workspace-management/LayoutList.css.js +0 -4
  236. package/esm/workspace-management/LayoutList.css.js.map +0 -1
  237. package/esm/workspace-management/LayoutList.js +0 -114
  238. package/esm/workspace-management/LayoutList.js.map +0 -1
  239. package/esm/workspace-management/LayoutTile.css.js +0 -4
  240. package/esm/workspace-management/LayoutTile.css.js.map +0 -1
  241. package/esm/workspace-management/LayoutTile.js +0 -39
  242. package/esm/workspace-management/LayoutTile.js.map +0 -1
  243. package/esm/workspace-management/SaveLayoutPanel.css.js +0 -4
  244. package/esm/workspace-management/SaveLayoutPanel.css.js.map +0 -1
  245. package/esm/workspace-management/SaveLayoutPanel.js +0 -126
  246. package/esm/workspace-management/SaveLayoutPanel.js.map +0 -1
  247. package/esm/workspace-management/WorkspaceProvider.js +0 -262
  248. package/esm/workspace-management/WorkspaceProvider.js.map +0 -1
  249. package/esm/workspace-management/defaultWorkspaceJSON.js +0 -95
  250. package/esm/workspace-management/defaultWorkspaceJSON.js.map +0 -1
  251. package/esm/workspace-management/screenshot-utils.js +0 -23
  252. package/esm/workspace-management/screenshot-utils.js.map +0 -1
  253. package/esm/workspace-management/useWorkspaceContextMenuItems.js +0 -70
  254. package/esm/workspace-management/useWorkspaceContextMenuItems.js.map +0 -1
package/package.json CHANGED
@@ -1,26 +1,27 @@
1
1
  {
2
- "version": "2.1.18",
2
+ "version": "2.1.19-beta.2",
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.18",
8
- "@vuu-ui/vuu-protocol-types": "2.1.18",
9
- "@vuu-ui/vuu-table-types": "2.1.18"
8
+ "@vuu-ui/vuu-data-types": "2.1.19-beta.2",
9
+ "@vuu-ui/vuu-protocol-types": "2.1.19-beta.2",
10
+ "@vuu-ui/vuu-table-types": "2.1.19-beta.2"
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.18",
16
- "@vuu-ui/vuu-data-react": "2.1.18",
17
- "@vuu-ui/vuu-data-remote": "2.1.18",
18
- "@vuu-ui/vuu-icons": "2.1.18",
19
- "@vuu-ui/vuu-layout": "2.1.18",
20
- "@vuu-ui/vuu-notifications": "2.1.18",
21
- "@vuu-ui/vuu-table": "2.1.18",
22
- "@vuu-ui/vuu-ui-controls": "2.1.18",
23
- "@vuu-ui/vuu-utils": "2.1.18",
16
+ "@vuu-ui/vuu-context-menu": "2.1.19-beta.2",
17
+ "@vuu-ui/vuu-data-react": "2.1.19-beta.2",
18
+ "@vuu-ui/vuu-data-remote": "2.1.19-beta.2",
19
+ "@vuu-ui/vuu-icons": "2.1.19-beta.2",
20
+ "@vuu-ui/vuu-layout": "2.1.19-beta.2",
21
+ "@vuu-ui/vuu-notifications": "2.1.19-beta.2",
22
+ "@vuu-ui/vuu-table": "2.1.19-beta.2",
23
+ "@vuu-ui/vuu-ui-controls": "2.1.19-beta.2",
24
+ "@vuu-ui/vuu-utils": "2.1.19-beta.2",
24
25
  "html-to-image": "^1.11.11"
25
26
  },
26
27
  "peerDependencies": {
@@ -31,20 +32,16 @@
31
32
  "sideEffects": false,
32
33
  "files": [
33
34
  "README.md",
34
- "esm",
35
- "cjs",
35
+ "src",
36
36
  "/types"
37
37
  ],
38
38
  "exports": {
39
39
  ".": {
40
- "require": "./cjs/index.js",
41
- "import": "./esm/index.js",
40
+ "import": "./src/index.js",
42
41
  "types": "./types/index.d.ts"
43
42
  }
44
43
  },
45
- "main": "cjs/index.js",
46
- "module": "esm/index.js",
44
+ "module": "index.js",
47
45
  "name": "@vuu-ui/vuu-shell",
48
- "type": "module",
49
46
  "types": "types/index.d.ts"
50
47
  }
@@ -0,0 +1,20 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { ShellContext } from "@vuu-ui/vuu-utils";
3
+ const Provider = ({ children, context, inheritedContext })=>{
4
+ const mergedContext = {
5
+ ...inheritedContext,
6
+ ...context
7
+ };
8
+ return /*#__PURE__*/ jsx(ShellContext.Provider, {
9
+ value: mergedContext,
10
+ children: children
11
+ });
12
+ };
13
+ const ShellContextProvider = ({ children, value })=>/*#__PURE__*/ jsx(ShellContext.Consumer, {
14
+ children: (context)=>/*#__PURE__*/ jsx(Provider, {
15
+ context: value,
16
+ inheritedContext: context,
17
+ children: children
18
+ })
19
+ });
20
+ export { ShellContextProvider };
@@ -0,0 +1,21 @@
1
+ const css = `
2
+ .vuuAppHeader {
3
+ --saltButton-borderRadius: 6px;
4
+ --saltButton-text-color: var(--vuu-color-gray-50);
5
+ --saltButton-padding: 12px;
6
+ --vuuToolbarItem-height: 26px;
7
+ --vuuOverflowContainer-gap: 8px;
8
+ --vuuOverflowContainer-height: var(--vuuAppHeader-height, 42px);
9
+ --vuu-icon-color: var(--vuu-color-gray-45);
10
+ --vuu-icon-size: 16px;
11
+ --vuuToolbar-borderWidth: 1px;
12
+ --vuuToolbar-borderStyle: solid;
13
+ --vuuToolbar-borderColor: var(--salt-separable-primary-borderColor);
14
+ justify-content: flex-end;
15
+ align-items: center;
16
+ display: flex;
17
+ }
18
+
19
+
20
+ `;
21
+ export default css;
@@ -0,0 +1,97 @@
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 };
@@ -0,0 +1 @@
1
+ export * from "./AppHeader.js";
@@ -0,0 +1,9 @@
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 };
@@ -0,0 +1,77 @@
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 };
@@ -0,0 +1 @@
1
+ export * from "./ApplicationProvider.js";
@@ -0,0 +1,37 @@
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 };
@@ -0,0 +1,33 @@
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 };
@@ -0,0 +1,5 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ const Loader = ()=>/*#__PURE__*/ jsx("div", {
3
+ className: "hwLoader"
4
+ });
5
+ export { Loader };
@@ -0,0 +1 @@
1
+ export * from "./Feature.js";
@@ -0,0 +1,42 @@
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 };
@@ -0,0 +1 @@
1
+ export * from "./FeatureAndLayoutProvider.js";
@@ -0,0 +1,62 @@
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;
@@ -0,0 +1,128 @@
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 };
@@ -0,0 +1 @@
1
+ export * from "./FeatureList.js";
@@ -0,0 +1,7 @@
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 ADDED
@@ -0,0 +1,14 @@
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";