@vuu-ui/vuu-shell 0.13.45 → 0.13.47

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 (328) hide show
  1. package/cjs/index.js +0 -4
  2. package/cjs/index.js.map +1 -1
  3. package/cjs/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +1 -3
  4. package/cjs/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js.map +1 -1
  5. package/cjs/shell.js +2 -23
  6. package/cjs/shell.js.map +1 -1
  7. package/cjs/workspace-management/WorkspaceProvider.js +28 -22
  8. package/cjs/workspace-management/WorkspaceProvider.js.map +1 -1
  9. package/esm/index.js +0 -2
  10. package/esm/index.js.map +1 -1
  11. package/esm/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +1 -3
  12. package/esm/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js.map +1 -1
  13. package/esm/shell.js +3 -24
  14. package/esm/shell.js.map +1 -1
  15. package/esm/workspace-management/WorkspaceProvider.js +28 -22
  16. package/esm/workspace-management/WorkspaceProvider.js.map +1 -1
  17. package/package.json +13 -13
  18. package/types/vuu-context-menu/src/ContextMenu.d.ts +10 -0
  19. package/types/vuu-context-menu/src/ContextMenuProvider.d.ts +16 -0
  20. package/types/vuu-context-menu/src/index.d.ts +3 -0
  21. package/types/vuu-context-menu/src/menu-utils.d.ts +21 -0
  22. package/types/vuu-context-menu/src/useContextMenu.d.ts +10 -0
  23. package/types/vuu-popups/src/index.d.ts +5 -0
  24. package/types/vuu-popups/src/notifications/NotificationsCenter.d.ts +5 -0
  25. package/types/vuu-popups/src/notifications/NotificationsContext.d.ts +36 -0
  26. package/types/vuu-popups/src/notifications/NotificationsProvider.d.ts +9 -0
  27. package/types/vuu-popups/src/notifications/ToastNotification.d.ts +7 -0
  28. package/types/vuu-popups/src/notifications/WorkspaceNotification.d.ts +5 -0
  29. package/types/vuu-popups/src/notifications/index.d.ts +3 -0
  30. package/types/vuu-popups/src/popup/Popup.d.ts +12 -0
  31. package/types/vuu-popups/src/popup/getPositionRelativeToAnchor.d.ts +19 -0
  32. package/types/vuu-popups/src/popup/index.d.ts +2 -0
  33. package/types/vuu-popups/src/popup/useAnchoredPosition.d.ts +7 -0
  34. package/types/vuu-popups/src/popup-menu/PopupMenu.d.ts +45 -0
  35. package/types/vuu-popups/src/popup-menu/index.d.ts +1 -0
  36. package/types/vuu-popups/src/popup-menu/usePopupMenu.d.ts +19 -0
  37. package/types/vuu-popups/src/portal/Portal.d.ts +42 -0
  38. package/types/vuu-popups/src/portal/index.d.ts +1 -0
  39. package/types/vuu-popups/src/tooltip/Tooltip.d.ts +15 -0
  40. package/types/vuu-popups/src/tooltip/index.d.ts +2 -0
  41. package/types/vuu-popups/src/tooltip/useTooltip.d.ts +19 -0
  42. package/types/vuu-popups/src/tooltip/useTooltipAnchoredPosition.d.ts +7 -0
  43. package/types/{index.d.ts → vuu-shell/src/index.d.ts} +0 -1
  44. package/types/vuu-ui-controls/src/calendar/Calendar.d.ts +13 -0
  45. package/types/vuu-ui-controls/src/calendar/index.d.ts +4 -0
  46. package/types/vuu-ui-controls/src/calendar/internal/CalendarCarousel.d.ts +3 -0
  47. package/types/vuu-ui-controls/src/calendar/internal/CalendarContext.d.ts +8 -0
  48. package/types/vuu-ui-controls/src/calendar/internal/CalendarDay.d.ts +14 -0
  49. package/types/vuu-ui-controls/src/calendar/internal/CalendarMonth.d.ts +10 -0
  50. package/types/vuu-ui-controls/src/calendar/internal/CalendarNavigation.d.ts +16 -0
  51. package/types/vuu-ui-controls/src/calendar/internal/CalendarWeekHeader.d.ts +3 -0
  52. package/types/vuu-ui-controls/src/calendar/internal/useFocusManagement.d.ts +9 -0
  53. package/types/vuu-ui-controls/src/calendar/internal/utils.d.ts +15 -0
  54. package/types/vuu-ui-controls/src/calendar/useCalendar.d.ts +54 -0
  55. package/types/vuu-ui-controls/src/calendar/useCalendarDay.d.ts +22 -0
  56. package/types/vuu-ui-controls/src/calendar/useSelection.d.ts +78 -0
  57. package/types/vuu-ui-controls/src/column-picker/ColumnPicker.d.ts +7 -0
  58. package/types/vuu-ui-controls/src/column-picker/ColumnSearch.d.ts +12 -0
  59. package/types/vuu-ui-controls/src/column-picker/index.d.ts +2 -0
  60. package/types/vuu-ui-controls/src/common-hooks/index.d.ts +3 -0
  61. package/types/vuu-ui-controls/src/common-hooks/selectionTypes.d.ts +70 -0
  62. package/types/vuu-ui-controls/src/common-hooks/use-resize-observer.d.ts +16 -0
  63. package/types/vuu-ui-controls/src/common-hooks/useControlled.d.ts +24 -0
  64. package/types/vuu-ui-controls/src/context-panel-provider/ContextPanelProvider.d.ts +17 -0
  65. package/types/vuu-ui-controls/src/cycle-state-button/CycleStateButton.d.ts +11 -0
  66. package/types/vuu-ui-controls/src/cycle-state-button/index.d.ts +1 -0
  67. package/types/vuu-ui-controls/src/date-input/DateInput.d.ts +60 -0
  68. package/types/vuu-ui-controls/src/date-input/index.d.ts +1 -0
  69. package/types/vuu-ui-controls/src/date-picker/DatePicker.d.ts +66 -0
  70. package/types/vuu-ui-controls/src/date-picker/DatePickerContext.d.ts +19 -0
  71. package/types/vuu-ui-controls/src/date-picker/DatePickerPanel.d.ts +10 -0
  72. package/types/vuu-ui-controls/src/date-picker/index.d.ts +1 -0
  73. package/types/vuu-ui-controls/src/drag-drop/DragDropProvider.d.ts +38 -0
  74. package/types/vuu-ui-controls/src/drag-drop/DragDropState.d.ts +15 -0
  75. package/types/vuu-ui-controls/src/drag-drop/Draggable.d.ts +13 -0
  76. package/types/vuu-ui-controls/src/drag-drop/dragDropTypes.d.ts +100 -0
  77. package/types/vuu-ui-controls/src/drag-drop/drop-target-utils.d.ts +82 -0
  78. package/types/vuu-ui-controls/src/drag-drop/index.d.ts +6 -0
  79. package/types/vuu-ui-controls/src/drag-drop/useAutoScroll.d.ts +11 -0
  80. package/types/vuu-ui-controls/src/drag-drop/useDragDisplacers.d.ts +17 -0
  81. package/types/vuu-ui-controls/src/drag-drop/useDragDrop.d.ts +2 -0
  82. package/types/vuu-ui-controls/src/drag-drop/useDragDropCopy.d.ts +6 -0
  83. package/types/vuu-ui-controls/src/drag-drop/useDragDropIndicator.d.ts +2 -0
  84. package/types/vuu-ui-controls/src/drag-drop/useDragDropNaturalMovement.d.ts +2 -0
  85. package/types/vuu-ui-controls/src/drag-drop/useDropIndicator.d.ts +8 -0
  86. package/types/vuu-ui-controls/src/drag-drop/useGlobalDragDrop.d.ts +11 -0
  87. package/types/vuu-ui-controls/src/editable/index.d.ts +1 -0
  88. package/types/vuu-ui-controls/src/editable/useEditableText.d.ts +19 -0
  89. package/types/vuu-ui-controls/src/editable-label/EditableLabel.d.ts +19 -0
  90. package/types/vuu-ui-controls/src/editable-label/index.d.ts +1 -0
  91. package/types/vuu-ui-controls/src/expando-input/ExpandoInput.d.ts +6 -0
  92. package/types/vuu-ui-controls/src/expando-input/index.d.ts +1 -0
  93. package/types/vuu-ui-controls/src/icon-button/Icon.d.ts +6 -0
  94. package/types/vuu-ui-controls/src/icon-button/IconButton.d.ts +6 -0
  95. package/types/vuu-ui-controls/src/icon-button/ToggleIconButton.d.ts +5 -0
  96. package/types/vuu-ui-controls/src/icon-button/index.d.ts +3 -0
  97. package/types/vuu-ui-controls/src/index.d.ts +30 -0
  98. package/types/vuu-ui-controls/src/instrument-picker/TablePicker.d.ts +10 -0
  99. package/types/vuu-ui-controls/src/instrument-picker/index.d.ts +1 -0
  100. package/types/vuu-ui-controls/src/instrument-picker/useTablePicker.d.ts +47 -0
  101. package/types/vuu-ui-controls/src/measured-container/MeasuredContainer.d.ts +14 -0
  102. package/types/vuu-ui-controls/src/measured-container/index.d.ts +2 -0
  103. package/types/vuu-ui-controls/src/measured-container/useMeasuredContainer.d.ts +23 -0
  104. package/types/vuu-ui-controls/src/measured-container/useResizeObserver.d.ts +15 -0
  105. package/types/vuu-ui-controls/src/modal-provider/ModalProvider.d.ts +13 -0
  106. package/types/vuu-ui-controls/src/overflow-container/OverflowContainer.d.ts +15 -0
  107. package/types/vuu-ui-controls/src/overflow-container/index.d.ts +2 -0
  108. package/types/vuu-ui-controls/src/overflow-container/overflow-utils.d.ts +48 -0
  109. package/types/vuu-ui-controls/src/overflow-container/useOverflowContainer.d.ts +19 -0
  110. package/types/vuu-ui-controls/src/price-ticker/PriceTicker.d.ts +7 -0
  111. package/types/vuu-ui-controls/src/price-ticker/index.d.ts +1 -0
  112. package/types/vuu-ui-controls/src/prompt/Prompt.d.ts +48 -0
  113. package/types/vuu-ui-controls/src/sortable-list/SortableList.d.ts +8 -0
  114. package/types/vuu-ui-controls/src/split-button/SplitButton.d.ts +11 -0
  115. package/types/vuu-ui-controls/src/split-button/SplitStateButton.d.ts +5 -0
  116. package/types/vuu-ui-controls/src/split-button/index.d.ts +2 -0
  117. package/types/vuu-ui-controls/src/split-button/useSplitButton.d.ts +311 -0
  118. package/types/vuu-ui-controls/src/table-search/SearchCell.d.ts +2 -0
  119. package/types/vuu-ui-controls/src/table-search/TableSearch.d.ts +9 -0
  120. package/types/vuu-ui-controls/src/table-search/index.d.ts +1 -0
  121. package/types/vuu-ui-controls/src/table-search/useTableSearch.d.ts +15 -0
  122. package/types/vuu-ui-controls/src/tabs-next/TabBar.d.ts +12 -0
  123. package/types/vuu-ui-controls/src/tabs-next/TabListNext.d.ts +12 -0
  124. package/types/vuu-ui-controls/src/tabs-next/TabNext.d.ts +12 -0
  125. package/types/vuu-ui-controls/src/tabs-next/TabNextAction.d.ts +5 -0
  126. package/types/vuu-ui-controls/src/tabs-next/TabNextContext.d.ts +12 -0
  127. package/types/vuu-ui-controls/src/tabs-next/TabNextPanel.d.ts +8 -0
  128. package/types/vuu-ui-controls/src/tabs-next/TabNextTrigger.d.ts +5 -0
  129. package/types/vuu-ui-controls/src/tabs-next/TabOverflowList.d.ts +11 -0
  130. package/types/vuu-ui-controls/src/tabs-next/TabsNext.d.ts +17 -0
  131. package/types/vuu-ui-controls/src/tabs-next/TabsNextContext.d.ts +21 -0
  132. package/types/vuu-ui-controls/src/tabs-next/hooks/useCollection.d.ts +18 -0
  133. package/types/vuu-ui-controls/src/tabs-next/hooks/useFocusOutside.d.ts +2 -0
  134. package/types/vuu-ui-controls/src/tabs-next/hooks/useOverflow.d.ts +11 -0
  135. package/types/vuu-ui-controls/src/tabs-next/index.d.ts +7 -0
  136. package/types/vuu-ui-controls/src/tabstrip/Tab.d.ts +27 -0
  137. package/types/vuu-ui-controls/src/tabstrip/TabMenu.d.ts +23 -0
  138. package/types/vuu-ui-controls/src/tabstrip/TabMenuOptions.d.ts +10 -0
  139. package/types/vuu-ui-controls/src/tabstrip/TabsTypes.d.ts +127 -0
  140. package/types/vuu-ui-controls/src/tabstrip/Tabstrip.d.ts +2 -0
  141. package/types/vuu-ui-controls/src/tabstrip/index.d.ts +5 -0
  142. package/types/vuu-ui-controls/src/tabstrip/tabstrip-dom-utils.d.ts +2 -0
  143. package/types/vuu-ui-controls/src/tabstrip/useAnimatedSelectionThumb.d.ts +7 -0
  144. package/types/vuu-ui-controls/src/tabstrip/useKeyboardNavigation.d.ts +29 -0
  145. package/types/vuu-ui-controls/src/tabstrip/useSelection.d.ts +13 -0
  146. package/types/vuu-ui-controls/src/tabstrip/useTabstrip.d.ts +55 -0
  147. package/types/vuu-ui-controls/src/time-input/MaskedInput.d.ts +49 -0
  148. package/types/vuu-ui-controls/src/time-input/TimeInput.d.ts +5 -0
  149. package/types/vuu-ui-controls/src/time-input/useTimeInput.d.ts +21 -0
  150. package/types/vuu-ui-controls/src/toolbar/Toolbar.d.ts +19 -0
  151. package/types/vuu-ui-controls/src/toolbar/index.d.ts +1 -0
  152. package/types/vuu-ui-controls/src/toolbar/toolbar-dom-utils.d.ts +3 -0
  153. package/types/vuu-ui-controls/src/toolbar/useKeyboardNavigation.d.ts +32 -0
  154. package/types/vuu-ui-controls/src/toolbar/useSelection.d.ts +22 -0
  155. package/types/vuu-ui-controls/src/toolbar/useToolbar.d.ts +28 -0
  156. package/types/vuu-ui-controls/src/utils/deprecated-types.d.ts +2 -0
  157. package/types/vuu-ui-controls/src/utils/escapeRegExp.d.ts +1 -0
  158. package/types/vuu-ui-controls/src/utils/forwardCallbackProps.d.ts +3 -0
  159. package/types/vuu-ui-controls/src/utils/index.d.ts +5 -0
  160. package/types/vuu-ui-controls/src/utils/isOverflowElement.d.ts +1 -0
  161. package/types/vuu-ui-controls/src/utils/isPlainObject.d.ts +1 -0
  162. package/types/vuu-ui-controls/src/vuu-date-picker/VuuDatePicker.d.ts +7 -0
  163. package/types/vuu-ui-controls/src/vuu-date-picker/index.d.ts +1 -0
  164. package/types/vuu-ui-controls/src/vuu-input/VuuInput.d.ts +18 -0
  165. package/types/vuu-ui-controls/src/vuu-input/index.d.ts +1 -0
  166. package/types/vuu-ui-controls/src/vuu-time-picker/VuuTimePicker.d.ts +7 -0
  167. package/types/vuu-ui-controls/src/vuu-typeahead-input/VuuTypeaheadInput.d.ts +6 -0
  168. package/types/vuu-ui-controls/src/vuu-typeahead-input/index.d.ts +1 -0
  169. package/types/vuu-ui-controls/src/vuu-typeahead-input/useVuuTypeaheadInput.d.ts +49 -0
  170. package/types/vuu-utils/src/Clock.d.ts +20 -0
  171. package/types/vuu-utils/src/DataWindow.d.ts +39 -0
  172. package/types/vuu-utils/src/ShellContext.d.ts +11 -0
  173. package/types/vuu-utils/src/ThemeProvider.d.ts +32 -0
  174. package/types/vuu-utils/src/array-utils.d.ts +8 -0
  175. package/types/vuu-utils/src/box-utils.d.ts +24 -0
  176. package/types/vuu-utils/src/broadcast-channel.d.ts +16 -0
  177. package/types/vuu-utils/src/column-utils.d.ts +181 -0
  178. package/types/vuu-utils/src/common-types.d.ts +6 -0
  179. package/types/vuu-utils/src/component-registry.d.ts +65 -0
  180. package/types/vuu-utils/src/context-definitions/DataContext.d.ts +18 -0
  181. package/types/vuu-utils/src/context-definitions/DataProvider.d.ts +7 -0
  182. package/types/vuu-utils/src/context-definitions/DataSourceProvider.d.ts +12 -0
  183. package/types/vuu-utils/src/context-definitions/WorkspaceContext.d.ts +17 -0
  184. package/types/vuu-utils/src/cookie-utils.d.ts +1 -0
  185. package/types/vuu-utils/src/css-utils.d.ts +1 -0
  186. package/types/vuu-utils/src/data-utils.d.ts +19 -0
  187. package/types/vuu-utils/src/datasource/BaseDataSource.d.ts +60 -0
  188. package/types/vuu-utils/src/datasource/datasource-action-utils.d.ts +7 -0
  189. package/types/vuu-utils/src/datasource/datasource-filter-utils.d.ts +2 -0
  190. package/types/vuu-utils/src/datasource/datasource-utils.d.ts +49 -0
  191. package/types/vuu-utils/src/date/date-utils.d.ts +36 -0
  192. package/types/vuu-utils/src/date/dateTimePattern.d.ts +8 -0
  193. package/types/vuu-utils/src/date/formatter.d.ts +4 -0
  194. package/types/vuu-utils/src/date/index.d.ts +4 -0
  195. package/types/vuu-utils/src/date/types.d.ts +24 -0
  196. package/types/vuu-utils/src/debug-utils.d.ts +9 -0
  197. package/types/vuu-utils/src/event-emitter.d.ts +21 -0
  198. package/types/vuu-utils/src/feature-utils.d.ts +110 -0
  199. package/types/vuu-utils/src/filters/filter-utils.d.ts +82 -0
  200. package/types/vuu-utils/src/filters/filterAsQuery.d.ts +7 -0
  201. package/types/vuu-utils/src/filters/index.d.ts +2 -0
  202. package/types/vuu-utils/src/form-utils.d.ts +23 -0
  203. package/types/vuu-utils/src/formatting-utils.d.ts +14 -0
  204. package/types/vuu-utils/src/getUniqueId.d.ts +1 -0
  205. package/types/vuu-utils/src/group-utils.d.ts +10 -0
  206. package/types/vuu-utils/src/html-utils.d.ts +21 -0
  207. package/types/vuu-utils/src/index.d.ts +73 -0
  208. package/types/vuu-utils/src/input-utils.d.ts +2 -0
  209. package/types/vuu-utils/src/invariant.d.ts +1 -0
  210. package/types/vuu-utils/src/itemToString.d.ts +2 -0
  211. package/types/vuu-utils/src/json-types.d.ts +52 -0
  212. package/types/vuu-utils/src/json-utils.d.ts +6 -0
  213. package/types/vuu-utils/src/keyboard-utils.d.ts +15 -0
  214. package/types/vuu-utils/src/keyset.d.ts +16 -0
  215. package/types/vuu-utils/src/layout-types.d.ts +22 -0
  216. package/types/vuu-utils/src/list-utils.d.ts +2 -0
  217. package/types/vuu-utils/src/local-storage-utils.d.ts +3 -0
  218. package/types/vuu-utils/src/logging-utils.d.ts +45 -0
  219. package/types/vuu-utils/src/module-utils.d.ts +8 -0
  220. package/types/vuu-utils/src/moving-window.d.ts +18 -0
  221. package/types/vuu-utils/src/nanoid/index.d.ts +1 -0
  222. package/types/vuu-utils/src/perf-utils.d.ts +5 -0
  223. package/types/vuu-utils/src/promise-utils.d.ts +8 -0
  224. package/types/vuu-utils/src/protocol-message-utils.d.ts +34 -0
  225. package/types/vuu-utils/src/range-utils.d.ts +31 -0
  226. package/types/vuu-utils/src/react-utils.d.ts +8 -0
  227. package/types/vuu-utils/src/round-decimal.d.ts +1 -0
  228. package/types/vuu-utils/src/row-utils.d.ts +27 -0
  229. package/types/vuu-utils/src/selection-utils.d.ts +4 -0
  230. package/types/vuu-utils/src/shell-layout-types.d.ts +15 -0
  231. package/types/vuu-utils/src/sort-utils.d.ts +11 -0
  232. package/types/vuu-utils/src/table-schema-utils.d.ts +3 -0
  233. package/types/vuu-utils/src/text-utils.d.ts +2 -0
  234. package/types/vuu-utils/src/tree-types.d.ts +9 -0
  235. package/types/vuu-utils/src/tree-utils.d.ts +9 -0
  236. package/types/vuu-utils/src/ts-utils.d.ts +20 -0
  237. package/types/vuu-utils/src/typeahead-utils.d.ts +1 -0
  238. package/types/vuu-utils/src/url-utils.d.ts +2 -0
  239. package/types/vuu-utils/src/useId.d.ts +1 -0
  240. package/types/vuu-utils/src/useLayoutEffectSkipFirst.d.ts +2 -0
  241. package/types/vuu-utils/src/useStateRef.d.ts +2 -0
  242. package/types/vuu-utils/src/user-types.d.ts +4 -0
  243. package/cjs/app-status-bar/AppStatusBar.css.js +0 -6
  244. package/cjs/app-status-bar/AppStatusBar.css.js.map +0 -1
  245. package/cjs/app-status-bar/AppStatusBar.js +0 -47
  246. package/cjs/app-status-bar/AppStatusBar.js.map +0 -1
  247. package/cjs/connection-status/ConnectionRetryCountdown.js +0 -36
  248. package/cjs/connection-status/ConnectionRetryCountdown.js.map +0 -1
  249. package/cjs/connection-status/ConnectionStateDisplay.css.js +0 -6
  250. package/cjs/connection-status/ConnectionStateDisplay.css.js.map +0 -1
  251. package/cjs/connection-status/ConnectionStateDisplay.js +0 -65
  252. package/cjs/connection-status/ConnectionStateDisplay.js.map +0 -1
  253. package/cjs/connection-status/ConnectionStatusIndicator.css.js +0 -6
  254. package/cjs/connection-status/ConnectionStatusIndicator.css.js.map +0 -1
  255. package/cjs/connection-status/ConnectionStatusIndicator.js +0 -81
  256. package/cjs/connection-status/ConnectionStatusIndicator.js.map +0 -1
  257. package/esm/app-status-bar/AppStatusBar.css.js +0 -4
  258. package/esm/app-status-bar/AppStatusBar.css.js.map +0 -1
  259. package/esm/app-status-bar/AppStatusBar.js +0 -45
  260. package/esm/app-status-bar/AppStatusBar.js.map +0 -1
  261. package/esm/connection-status/ConnectionRetryCountdown.js +0 -34
  262. package/esm/connection-status/ConnectionRetryCountdown.js.map +0 -1
  263. package/esm/connection-status/ConnectionStateDisplay.css.js +0 -4
  264. package/esm/connection-status/ConnectionStateDisplay.css.js.map +0 -1
  265. package/esm/connection-status/ConnectionStateDisplay.js +0 -63
  266. package/esm/connection-status/ConnectionStateDisplay.js.map +0 -1
  267. package/esm/connection-status/ConnectionStatusIndicator.css.js +0 -4
  268. package/esm/connection-status/ConnectionStatusIndicator.css.js.map +0 -1
  269. package/esm/connection-status/ConnectionStatusIndicator.js +0 -79
  270. package/esm/connection-status/ConnectionStatusIndicator.js.map +0 -1
  271. package/types/app-status-bar/AppStatusBar.d.ts +0 -1
  272. package/types/app-status-bar/index.d.ts +0 -1
  273. package/types/connection-status/ConnectionRetryCountdown.d.ts +0 -3
  274. package/types/connection-status/ConnectionStateDisplay.d.ts +0 -9
  275. package/types/connection-status/ConnectionStatusIndicator.d.ts +0 -6
  276. package/types/connection-status/index.d.ts +0 -2
  277. /package/types/{ShellContextProvider.d.ts → vuu-shell/src/ShellContextProvider.d.ts} +0 -0
  278. /package/types/{app-header → vuu-shell/src/app-header}/AppHeader.d.ts +0 -0
  279. /package/types/{app-header → vuu-shell/src/app-header}/index.d.ts +0 -0
  280. /package/types/{application-provider → vuu-shell/src/application-provider}/ApplicationContext.d.ts +0 -0
  281. /package/types/{application-provider → vuu-shell/src/application-provider}/ApplicationProvider.d.ts +0 -0
  282. /package/types/{application-provider → vuu-shell/src/application-provider}/index.d.ts +0 -0
  283. /package/types/{feature → vuu-shell/src/feature}/Feature.d.ts +0 -0
  284. /package/types/{feature → vuu-shell/src/feature}/FeatureErrorBoundary.d.ts +0 -0
  285. /package/types/{feature → vuu-shell/src/feature}/Loader.d.ts +0 -0
  286. /package/types/{feature → vuu-shell/src/feature}/index.d.ts +0 -0
  287. /package/types/{feature-and-layout-provider → vuu-shell/src/feature-and-layout-provider}/FeatureAndLayoutProvider.d.ts +0 -0
  288. /package/types/{feature-and-layout-provider → vuu-shell/src/feature-and-layout-provider}/index.d.ts +0 -0
  289. /package/types/{feature-list → vuu-shell/src/feature-list}/FeatureList.d.ts +0 -0
  290. /package/types/{feature-list → vuu-shell/src/feature-list}/index.d.ts +0 -0
  291. /package/types/{get-layout-history.d.ts → vuu-shell/src/get-layout-history.d.ts} +0 -0
  292. /package/types/{left-nav → vuu-shell/src/left-nav}/LeftNav.d.ts +0 -0
  293. /package/types/{left-nav → vuu-shell/src/left-nav}/index.d.ts +0 -0
  294. /package/types/{login → vuu-shell/src/login}/LoginPanel.d.ts +0 -0
  295. /package/types/{login → vuu-shell/src/login}/VuuLogo.d.ts +0 -0
  296. /package/types/{login → vuu-shell/src/login}/index.d.ts +0 -0
  297. /package/types/{login → vuu-shell/src/login}/login-utils.d.ts +0 -0
  298. /package/types/{persistence-manager → vuu-shell/src/persistence-manager}/LocalPersistenceManager.d.ts +0 -0
  299. /package/types/{persistence-manager → vuu-shell/src/persistence-manager}/PersistenceManager.d.ts +0 -0
  300. /package/types/{persistence-manager → vuu-shell/src/persistence-manager}/PersistenceProvider.d.ts +0 -0
  301. /package/types/{persistence-manager → vuu-shell/src/persistence-manager}/RemotePersistenceManager.d.ts +0 -0
  302. /package/types/{persistence-manager → vuu-shell/src/persistence-manager}/StaticPersistenceManager.d.ts +0 -0
  303. /package/types/{persistence-manager → vuu-shell/src/persistence-manager}/index.d.ts +0 -0
  304. /package/types/{shell-layout-templates → vuu-shell/src/shell-layout-templates}/context-panel/ContextPanel.d.ts +0 -0
  305. /package/types/{shell-layout-templates → vuu-shell/src/shell-layout-templates}/context-panel/index.d.ts +0 -0
  306. /package/types/{shell-layout-templates → vuu-shell/src/shell-layout-templates}/full-height-left-panel/useFullHeightLeftPanel.d.ts +0 -0
  307. /package/types/{shell-layout-templates → vuu-shell/src/shell-layout-templates}/index.d.ts +0 -0
  308. /package/types/{shell-layout-templates → vuu-shell/src/shell-layout-templates}/inlay-left-panel/useInlayLeftPanel.d.ts +0 -0
  309. /package/types/{shell-layout-templates → vuu-shell/src/shell-layout-templates}/left-main-tabs/useLeftMainTabs.d.ts +0 -0
  310. /package/types/{shell-layout-templates → vuu-shell/src/shell-layout-templates}/side-panel/SidePanel.d.ts +0 -0
  311. /package/types/{shell-layout-templates → vuu-shell/src/shell-layout-templates}/side-panel/index.d.ts +0 -0
  312. /package/types/{shell-layout-templates → vuu-shell/src/shell-layout-templates}/simple-content-pane/useSimpleContentPane.d.ts +0 -0
  313. /package/types/{shell-layout-templates → vuu-shell/src/shell-layout-templates}/useShellLayout.d.ts +0 -0
  314. /package/types/{shell.d.ts → vuu-shell/src/shell.d.ts} +0 -0
  315. /package/types/{theme-switch → vuu-shell/src/theme-switch}/ThemeSwitch.d.ts +0 -0
  316. /package/types/{theme-switch → vuu-shell/src/theme-switch}/index.d.ts +0 -0
  317. /package/types/{use-force-render.d.ts → vuu-shell/src/use-force-render.d.ts} +0 -0
  318. /package/types/{user-settings → vuu-shell/src/user-settings}/SettingsForm.d.ts +0 -0
  319. /package/types/{user-settings → vuu-shell/src/user-settings}/UserSettingsPanel.d.ts +0 -0
  320. /package/types/{user-settings → vuu-shell/src/user-settings}/index.d.ts +0 -0
  321. /package/types/{workspace-management → vuu-shell/src/workspace-management}/LayoutList.d.ts +0 -0
  322. /package/types/{workspace-management → vuu-shell/src/workspace-management}/LayoutTile.d.ts +0 -0
  323. /package/types/{workspace-management → vuu-shell/src/workspace-management}/SaveLayoutPanel.d.ts +0 -0
  324. /package/types/{workspace-management → vuu-shell/src/workspace-management}/WorkspaceProvider.d.ts +0 -0
  325. /package/types/{workspace-management → vuu-shell/src/workspace-management}/defaultWorkspaceJSON.d.ts +0 -0
  326. /package/types/{workspace-management → vuu-shell/src/workspace-management}/index.d.ts +0 -0
  327. /package/types/{workspace-management → vuu-shell/src/workspace-management}/screenshot-utils.d.ts +0 -0
  328. /package/types/{workspace-management → vuu-shell/src/workspace-management}/useWorkspaceContextMenuItems.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceProvider.js","sources":["../../../../packages/vuu-shell/src/workspace-management/WorkspaceProvider.tsx"],"sourcesContent":["import { isLayoutJSON, resolveJSONPath } from \"@vuu-ui/vuu-layout\";\nimport { useNotifications } from \"@vuu-ui/vuu-popups\";\nimport {\n LayoutMetadata,\n LayoutMetadataDto,\n VuuShellLocation,\n WorkspaceContext,\n logger,\n type ApplicationJSON,\n type ApplicationSetting,\n type ApplicationSettings,\n type LayoutJSON,\n} from \"@vuu-ui/vuu-utils\";\nimport {\n ReactElement,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { usePersistenceManager } from \"../persistence-manager\";\nimport {\n getWorkspaceWithLayoutJSON,\n loadingJSON,\n type WorkspaceStackProps,\n} from \"./defaultWorkspaceJSON\";\n\nconst { info } = logger(\"useLayoutManager\");\n\nexport type WorkspaceProps = WorkspaceStackProps & {\n layoutPlaceholderJSON?: LayoutJSON;\n /**\n * layoutJSON defines the default layout to render on first load and until such time as\n * layout state has been persisted. After that, the persisted state will be rendered.\n */\n layoutJSON?: LayoutJSON | LayoutJSON[];\n activeLayoutIndex?: number;\n /**\n * The Vuu workspace is the container into which layouts are loaded. By default, it will be\n * a Tabbed Panel (Stack + Tabstrip), showing a tab per Layout.\n */\n workspaceJSON?: LayoutJSON | LayoutJSON[];\n};\n\nexport interface WorkspaceProviderProps extends WorkspaceProps {\n children: ReactElement | ReactElement[];\n\n /**\n * layoutPlaceholderJSON defines the layout to render when a new workspace layout is created.\n */\n layoutPlaceholderJSON?: LayoutJSON;\n}\n\nconst ensureLayoutHasTitle = (\n layout: LayoutJSON,\n layoutMetadata: LayoutMetadataDto,\n) => {\n if (layout.props?.title !== undefined) {\n return layout;\n } else {\n return {\n ...layout,\n props: {\n ...layout.props,\n title: layoutMetadata.name,\n },\n };\n }\n};\n\nconst loadingApplicationJSON: ApplicationJSON = {\n workspaceJSON: loadingJSON,\n};\n\n/**\n * LayoutManagementProvider supplies an API for loading and saving layout documents.\n * Initial layout is automatically loaded on startup. Because this hook is responsible\n * only for loading and saving layouts, it only triggers a render when content is loaded.\n *\n * Initial layout displays a loading state\n * User may supply a default layout. This will not be displayed until call has been made to\n * persistenceManager to retrieve stored layout state. If no stored state is returned, the\n * default layout provided by user will be set as current state (and hence rendered). If no\n * default layout has been provided by user, the sysem default will be used (simple PlaceHolder)\n * If saved layout state has been returned, that will be set as current state (and rendered)\n *\n */\nexport const WorkspaceProvider = ({\n TabstripProps,\n children,\n layoutJSON,\n activeLayoutIndex,\n layoutPlaceholderJSON,\n showTabs,\n workspaceJSON: customWorkspaceJSON,\n}: WorkspaceProviderProps) => {\n const [layoutMetadata, setLayoutMetadata] = useState<LayoutMetadata[]>([]);\n // TODO this default should probably be a loading state rather than the placeholder\n // It will be replaced as soon as the localStorage/remote layout is resolved\n const [, forceRefresh] = useState({});\n const notify = useNotifications();\n const persistenceManager = usePersistenceManager();\n const applicationJSONRef = useRef<ApplicationJSON>(loadingApplicationJSON);\n\n const setApplicationJSON = useCallback(\n (applicationJSON: ApplicationJSON, rerender = true) => {\n applicationJSONRef.current = applicationJSON;\n if (rerender) {\n forceRefresh({});\n }\n },\n [],\n );\n\n const setWorkspaceJSON = useCallback(\n (workspaceJSON: LayoutJSON, rerender = true) => {\n setApplicationJSON(\n {\n ...applicationJSONRef.current,\n workspaceJSON,\n },\n rerender,\n );\n },\n [setApplicationJSON],\n );\n\n const setApplicationSettings = useCallback(\n (settings: ApplicationSettings) => {\n setApplicationJSON(\n {\n ...applicationJSONRef.current,\n settings: {\n ...applicationJSONRef.current.settings,\n ...settings,\n },\n },\n false,\n );\n },\n [setApplicationJSON],\n );\n\n useEffect(() => {\n //TODO this does not need to be done ahead of time\n persistenceManager\n ?.loadMetadata()\n .then((metadata) => {\n setLayoutMetadata(metadata);\n })\n .catch((error: Error) => {\n notify({\n type: \"error\",\n header: \"Failed to Load Layouts\",\n body: \"Could not load list of available layouts\",\n });\n console.error(\"Error occurred while retrieving metadata\", error);\n });\n\n persistenceManager\n ?.loadApplicationJSON()\n .then((applicationJSON?: ApplicationJSON) => {\n if (applicationJSON) {\n info?.(\"applicationJSON loaded successfully\");\n setApplicationJSON(applicationJSON);\n } else {\n // No applicationJSON has been saved yet. Construct our\n // initial applicationJSON from user configuration and\n // default values.\n const workspaceJSON = getWorkspaceWithLayoutJSON(\n customWorkspaceJSON,\n layoutJSON,\n activeLayoutIndex,\n { TabstripProps, showTabs },\n );\n info?.(`applicationJSON not found, getting defaultWorkspaceJSON,\n ${JSON.stringify(workspaceJSON, null, 2)}\n `);\n setApplicationJSON({\n workspaceJSON,\n });\n }\n })\n .catch((error: Error) => {\n notify({\n type: \"error\",\n header: \"Failed to Load Layout\",\n body: \"Could not load your latest view\",\n });\n console.error(\n \"Error occurred while retrieving application layout\",\n error,\n );\n });\n }, [\n TabstripProps,\n activeLayoutIndex,\n customWorkspaceJSON,\n layoutJSON,\n notify,\n persistenceManager,\n setApplicationJSON,\n showTabs,\n ]);\n\n const saveApplicationLayout = useCallback(\n (layout: LayoutJSON) => {\n if (isLayoutJSON(layout)) {\n setWorkspaceJSON(layout, false);\n persistenceManager?.saveApplicationJSON(applicationJSONRef.current);\n } else {\n console.error(\"Tried to save invalid application layout\", layout);\n }\n },\n [persistenceManager, setWorkspaceJSON],\n );\n\n const saveLayout = useCallback(\n (metadata: LayoutMetadataDto) => {\n let layoutToSave: LayoutJSON | undefined;\n try {\n const { workspaceJSON } = applicationJSONRef.current;\n if (Array.isArray(workspaceJSON)) {\n console.log(\"how do we identify the right thing to save\");\n } else {\n layoutToSave = resolveJSONPath(\n workspaceJSON,\n `#${VuuShellLocation.Workspace}.ACTIVE_CHILD`,\n );\n }\n } catch (e) {\n // ignore, code below will handle\n }\n\n if (layoutToSave && isLayoutJSON(layoutToSave)) {\n persistenceManager\n ?.createLayout(metadata, ensureLayoutHasTitle(layoutToSave, metadata))\n .then((metadata) => {\n notify({\n type: \"success\",\n header: \"Layout Saved Successfully\",\n body: `${metadata.name} saved successfully`,\n });\n setLayoutMetadata((prev) => [...prev, metadata]);\n })\n .catch((error: Error) => {\n notify({\n type: \"error\",\n header: \"Failed to Save Layout\",\n body: `Failed to save layout ${metadata.name}`,\n });\n console.error(\"Error occurred while saving layout\", error);\n });\n } else {\n console.error(\"Tried to save invalid layout\", layoutToSave);\n notify({\n type: \"error\",\n header: \"Failed to Save Layout\",\n body: \"Cannot save invalid layout\",\n });\n }\n },\n [notify, persistenceManager],\n );\n\n const saveApplicationSettings = useCallback(\n (\n settings: ApplicationSettings | ApplicationSetting,\n key?: keyof ApplicationSettings,\n ) => {\n const { settings: applicationSettings } = applicationJSONRef.current;\n if (key) {\n setApplicationSettings({\n ...applicationSettings,\n [key]: settings,\n });\n } else {\n setApplicationSettings(settings as ApplicationSettings);\n }\n persistenceManager?.saveApplicationJSON(applicationJSONRef.current);\n },\n [persistenceManager, setApplicationSettings],\n );\n\n const getApplicationSettings = useCallback(\n (key?: keyof ApplicationSettings) => {\n const { settings } = applicationJSONRef.current;\n return key ? settings?.[key] : settings;\n },\n [],\n );\n\n const loadLayoutById = useCallback(\n (id: string) => {\n persistenceManager\n ?.loadLayout(id)\n .then((layoutJson) => {\n const { workspaceJSON: currentLayout } = applicationJSONRef.current;\n if (Array.isArray(currentLayout)) {\n console.log(\"how do we deal witha amulti layoput\");\n } else {\n setWorkspaceJSON({\n ...currentLayout,\n children: (currentLayout.children || []).concat(layoutJson),\n props: {\n ...currentLayout.props,\n active: currentLayout.children?.length ?? 0,\n },\n });\n }\n })\n .catch((error: Error) => {\n notify({\n type: \"error\",\n header: \"Failed to Load Layout\",\n body: \"Failed to load the requested layout\",\n });\n console.error(\"Error occurred while loading layout\", error);\n });\n },\n [notify, persistenceManager, setWorkspaceJSON],\n );\n\n return (\n <WorkspaceContext.Provider\n value={{\n getApplicationSettings,\n layoutMetadata,\n layoutPlaceholderJSON,\n saveLayout,\n workspaceJSON: applicationJSONRef.current.workspaceJSON,\n saveApplicationLayout,\n saveApplicationSettings,\n loadLayoutById,\n }}\n >\n {children}\n </WorkspaceContext.Provider>\n );\n};\n\nexport const useWorkspace = () => {\n // The default Application JSON will be served if no LayoutManagementProvider\n const { workspaceJSON = getWorkspaceWithLayoutJSON(), ...contextProps } =\n useContext(WorkspaceContext);\n\n return {\n ...contextProps,\n workspaceJSON,\n };\n};\n"],"names":["metadata"],"mappings":";;;;;;;;;;;;;;;AA4BA,MAAM,EAAE,IAAA,EAAS,GAAA,MAAA,CAAO,kBAAkB,CAAA;AA0B1C,MAAM,oBAAA,GAAuB,CAC3B,MAAA,EACA,cACG,KAAA;AACH,EAAI,IAAA,MAAA,CAAO,KAAO,EAAA,KAAA,KAAU,KAAW,CAAA,EAAA;AACrC,IAAO,OAAA,MAAA;AAAA,GACF,MAAA;AACL,IAAO,OAAA;AAAA,MACL,GAAG,MAAA;AAAA,MACH,KAAO,EAAA;AAAA,QACL,GAAG,MAAO,CAAA,KAAA;AAAA,QACV,OAAO,cAAe,CAAA;AAAA;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AgB;AAAA,GAC/C;AAEA,EACE,uBAAA,GAAA;AAAA,IAAC,gBAAiB,CAAA,QAAA;AAAA,IAAjB;AAAA,MACC,KAAO,EAAA;AAAA,QACL,sBAAA;AAAA,QACA,cAAA;AAAA,QACA,qBAAA;AAAA,QACA,UAAA;AAAA,QACA,aAAA,EAAe,mBAAmB,OAAQ,CAAA,aAAA;AAAA,QAC1C,qBAAA;AAAA,QACA,uBAAA;AAAA,QACA;AAAA,OACF;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ;AAEO,MAAM,eAAe,MAAM;AAEhC,EAAM,MAAA,EAAE,gBAAgB,0BAA2B,EAAA,EAAG,GAAG,YAAa,EAAA,GACpE,WAAW,gBAAgB,CAAA;AAE7B,EAAO,OAAA;AAAA,IACL,GAAG,YAAA;AAAA,IACH;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"WorkspaceProvider.js","sources":["../../../../packages/vuu-shell/src/workspace-management/WorkspaceProvider.tsx"],"sourcesContent":["import { isLayoutJSON, resolveJSONPath } from \"@vuu-ui/vuu-layout\";\nimport { useNotifications } from \"@vuu-ui/vuu-popups\";\nimport {\n LayoutMetadata,\n LayoutMetadataDto,\n VuuShellLocation,\n WorkspaceContext,\n logger,\n type ApplicationJSON,\n type ApplicationSetting,\n type ApplicationSettings,\n type LayoutJSON,\n} from \"@vuu-ui/vuu-utils\";\nimport {\n ReactElement,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { usePersistenceManager } from \"../persistence-manager\";\nimport {\n getWorkspaceWithLayoutJSON,\n loadingJSON,\n type WorkspaceStackProps,\n} from \"./defaultWorkspaceJSON\";\n\nconst { info } = logger(\"useLayoutManager\");\n\nexport type WorkspaceProps = WorkspaceStackProps & {\n layoutPlaceholderJSON?: LayoutJSON;\n /**\n * layoutJSON defines the default layout to render on first load and until such time as\n * layout state has been persisted. After that, the persisted state will be rendered.\n */\n layoutJSON?: LayoutJSON | LayoutJSON[];\n activeLayoutIndex?: number;\n /**\n * The Vuu workspace is the container into which layouts are loaded. By default, it will be\n * a Tabbed Panel (Stack + Tabstrip), showing a tab per Layout.\n */\n workspaceJSON?: LayoutJSON | LayoutJSON[];\n};\n\nexport interface WorkspaceProviderProps extends WorkspaceProps {\n children: ReactElement | ReactElement[];\n\n /**\n * layoutPlaceholderJSON defines the layout to render when a new workspace layout is created.\n */\n layoutPlaceholderJSON?: LayoutJSON;\n}\n\nconst ensureLayoutHasTitle = (\n layout: LayoutJSON,\n layoutMetadata: LayoutMetadataDto,\n) => {\n if (layout.props?.title !== undefined) {\n return layout;\n } else {\n return {\n ...layout,\n props: {\n ...layout.props,\n title: layoutMetadata.name,\n },\n };\n }\n};\n\nconst loadingApplicationJSON: ApplicationJSON = {\n workspaceJSON: loadingJSON,\n};\n\n/**\n * LayoutManagementProvider supplies an API for loading and saving layout documents.\n * Initial layout is automatically loaded on startup. Because this hook is responsible\n * only for loading and saving layouts, it only triggers a render when content is loaded.\n *\n * Initial layout displays a loading state\n * User may supply a default layout. This will not be displayed until call has been made to\n * persistenceManager to retrieve stored layout state. If no stored state is returned, the\n * default layout provided by user will be set as current state (and hence rendered). If no\n * default layout has been provided by user, the sysem default will be used (simple PlaceHolder)\n * If saved layout state has been returned, that will be set as current state (and rendered)\n *\n */\nexport const WorkspaceProvider = ({\n TabstripProps,\n children,\n layoutJSON,\n activeLayoutIndex,\n layoutPlaceholderJSON,\n showTabs,\n workspaceJSON: customWorkspaceJSON,\n}: WorkspaceProviderProps) => {\n const [layoutMetadata, setLayoutMetadata] = useState<LayoutMetadata[]>([]);\n // TODO this default should probably be a loading state rather than the placeholder\n // It will be replaced as soon as the localStorage/remote layout is resolved\n const [, forceRefresh] = useState({});\n const { showNotification } = useNotifications();\n const persistenceManager = usePersistenceManager();\n const applicationJSONRef = useRef<ApplicationJSON>(loadingApplicationJSON);\n\n const setApplicationJSON = useCallback(\n (applicationJSON: ApplicationJSON, rerender = true) => {\n applicationJSONRef.current = applicationJSON;\n if (rerender) {\n forceRefresh({});\n }\n },\n [],\n );\n\n const setWorkspaceJSON = useCallback(\n (workspaceJSON: LayoutJSON, rerender = true) => {\n setApplicationJSON(\n {\n ...applicationJSONRef.current,\n workspaceJSON,\n },\n rerender,\n );\n },\n [setApplicationJSON],\n );\n\n const setApplicationSettings = useCallback(\n (settings: ApplicationSettings) => {\n setApplicationJSON(\n {\n ...applicationJSONRef.current,\n settings: {\n ...applicationJSONRef.current.settings,\n ...settings,\n },\n },\n false,\n );\n },\n [setApplicationJSON],\n );\n\n useEffect(() => {\n //TODO this does not need to be done ahead of time\n persistenceManager\n ?.loadMetadata()\n .then((metadata) => {\n setLayoutMetadata(metadata);\n })\n .catch((error: Error) => {\n showNotification({\n content: \"Could not load list of available layouts\",\n header: \"Failed to Load Layouts\",\n level: \"error\",\n type: \"toast\",\n });\n console.error(\"Error occurred while retrieving metadata\", error);\n });\n\n persistenceManager\n ?.loadApplicationJSON()\n .then((applicationJSON?: ApplicationJSON) => {\n if (applicationJSON) {\n info?.(\"applicationJSON loaded successfully\");\n setApplicationJSON(applicationJSON);\n } else {\n // No applicationJSON has been saved yet. Construct our\n // initial applicationJSON from user configuration and\n // default values.\n const workspaceJSON = getWorkspaceWithLayoutJSON(\n customWorkspaceJSON,\n layoutJSON,\n activeLayoutIndex,\n { TabstripProps, showTabs },\n );\n info?.(`applicationJSON not found, getting defaultWorkspaceJSON,\n ${JSON.stringify(workspaceJSON, null, 2)}\n `);\n setApplicationJSON({\n workspaceJSON,\n });\n }\n })\n .catch((error: Error) => {\n showNotification({\n content: \"Could not load your latest view\",\n header: \"Failed to Load Layout\",\n level: \"error\",\n type: \"toast\",\n });\n console.error(\n \"Error occurred while retrieving application layout\",\n error,\n );\n });\n }, [\n TabstripProps,\n activeLayoutIndex,\n customWorkspaceJSON,\n layoutJSON,\n showNotification,\n persistenceManager,\n setApplicationJSON,\n showTabs,\n ]);\n\n const saveApplicationLayout = useCallback(\n (layout: LayoutJSON) => {\n if (isLayoutJSON(layout)) {\n setWorkspaceJSON(layout, false);\n persistenceManager?.saveApplicationJSON(applicationJSONRef.current);\n } else {\n console.error(\"Tried to save invalid application layout\", layout);\n }\n },\n [persistenceManager, setWorkspaceJSON],\n );\n\n const saveLayout = useCallback(\n (metadata: LayoutMetadataDto) => {\n let layoutToSave: LayoutJSON | undefined;\n try {\n const { workspaceJSON } = applicationJSONRef.current;\n if (Array.isArray(workspaceJSON)) {\n console.log(\"how do we identify the right thing to save\");\n } else {\n layoutToSave = resolveJSONPath(\n workspaceJSON,\n `#${VuuShellLocation.Workspace}.ACTIVE_CHILD`,\n );\n }\n } catch (e) {\n // ignore, code below will handle\n }\n\n if (layoutToSave && isLayoutJSON(layoutToSave)) {\n persistenceManager\n ?.createLayout(metadata, ensureLayoutHasTitle(layoutToSave, metadata))\n .then((metadata) => {\n showNotification({\n content: `${metadata.name} saved successfully`,\n header: \"Layout Saved Successfully\",\n level: \"success\",\n type: \"toast\",\n });\n setLayoutMetadata((prev) => [...prev, metadata]);\n })\n .catch((error: Error) => {\n showNotification({\n content: `Failed to save layout ${metadata.name}`,\n header: \"Failed to Save Layout\",\n level: \"error\",\n type: \"toast\",\n });\n console.error(\"Error occurred while saving layout\", error);\n });\n } else {\n console.error(\"Tried to save invalid layout\", layoutToSave);\n showNotification({\n content: \"Cannot save invalid layout\",\n header: \"Failed to Save Layout\",\n level: \"error\",\n type: \"toast\",\n });\n }\n },\n [showNotification, persistenceManager],\n );\n\n const saveApplicationSettings = useCallback(\n (\n settings: ApplicationSettings | ApplicationSetting,\n key?: keyof ApplicationSettings,\n ) => {\n const { settings: applicationSettings } = applicationJSONRef.current;\n if (key) {\n setApplicationSettings({\n ...applicationSettings,\n [key]: settings,\n });\n } else {\n setApplicationSettings(settings as ApplicationSettings);\n }\n persistenceManager?.saveApplicationJSON(applicationJSONRef.current);\n },\n [persistenceManager, setApplicationSettings],\n );\n\n const getApplicationSettings = useCallback(\n (key?: keyof ApplicationSettings) => {\n const { settings } = applicationJSONRef.current;\n return key ? settings?.[key] : settings;\n },\n [],\n );\n\n const loadLayoutById = useCallback(\n (id: string) => {\n persistenceManager\n ?.loadLayout(id)\n .then((layoutJson) => {\n const { workspaceJSON: currentLayout } = applicationJSONRef.current;\n if (Array.isArray(currentLayout)) {\n console.log(\"how do we deal witha amulti layoput\");\n } else {\n setWorkspaceJSON({\n ...currentLayout,\n children: (currentLayout.children || []).concat(layoutJson),\n props: {\n ...currentLayout.props,\n active: currentLayout.children?.length ?? 0,\n },\n });\n }\n })\n .catch((error: Error) => {\n showNotification({\n content: \"Failed to load the requested layout\",\n header: \"Failed to Load Layout\",\n level: \"error\",\n type: \"toast\",\n });\n console.error(\"Error occurred while loading layout\", error);\n });\n },\n [showNotification, persistenceManager, setWorkspaceJSON],\n );\n\n return (\n <WorkspaceContext.Provider\n value={{\n getApplicationSettings,\n layoutMetadata,\n layoutPlaceholderJSON,\n saveLayout,\n workspaceJSON: applicationJSONRef.current.workspaceJSON,\n saveApplicationLayout,\n saveApplicationSettings,\n loadLayoutById,\n }}\n >\n {children}\n </WorkspaceContext.Provider>\n );\n};\n\nexport const useWorkspace = () => {\n // The default Application JSON will be served if no LayoutManagementProvider\n const { workspaceJSON = getWorkspaceWithLayoutJSON(), ...contextProps } =\n useContext(WorkspaceContext);\n\n return {\n ...contextProps,\n workspaceJSON,\n };\n};\n"],"names":["metadata"],"mappings":";;;;;;;;;;;;;;;AA4BA,MAAM,EAAE,IAAA,EAAS,GAAA,MAAA,CAAO,kBAAkB,CAAA;AA0B1C,MAAM,oBAAA,GAAuB,CAC3B,MAAA,EACA,cACG,KAAA;AACH,EAAI,IAAA,MAAA,CAAO,KAAO,EAAA,KAAA,KAAU,KAAW,CAAA,EAAA;AACrC,IAAO,OAAA,MAAA;AAAA,GACF,MAAA;AACL,IAAO,OAAA;AAAA,MACL,GAAG,MAAA;AAAA,MACH,KAAO,EAAA;AAAA,QACL,GAAG,MAAO,CAAA,KAAA;AAAA,QACV,OAAO,cAAe,CAA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MAAQ,EAAA,uBAAA;AAAA,UACR,KAAO,EAAA,OAAA;AAAA,UACP,IAAM,EAAA;AAAA,SACP,CAAA;AACD,QAAQ,OAAA,CAAA,KAAA,CAAM,uCAAuC,KAAK,CAAA;AAAA,OAC3D,CAAA;AAAA,KACL;AAAA,IACA,CAAC,gBAAkB,EAAA,kBAAA,EAAoB,gBAAgB;AAAA,GACzD;AAEA,EACE,uBAAA,GAAA;AAAA,IAAC,gBAAiB,CAAA,QAAA;AAAA,IAAjB;AAAA,MACC,KAAO,EAAA;AAAA,QACL,sBAAA;AAAA,QACA,cAAA;AAAA,QACA,qBAAA;AAAA,QACA,UAAA;AAAA,QACA,aAAA,EAAe,mBAAmB,OAAQ,CAAA,aAAA;AAAA,QAC1C,qBAAA;AAAA,QACA,uBAAA;AAAA,QACA;AAAA,OACF;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ;AAEO,MAAM,eAAe,MAAM;AAEhC,EAAM,MAAA,EAAE,gBAAgB,0BAA2B,EAAA,EAAG,GAAG,YAAa,EAAA,GACpE,WAAW,gBAAgB,CAAA;AAE7B,EAAO,OAAA;AAAA,IACL,GAAG,YAAA;AAAA,IACH;AAAA,GACF;AACF;;;;"}
package/package.json CHANGED
@@ -1,26 +1,26 @@
1
1
  {
2
- "version": "0.13.45",
2
+ "version": "0.13.47",
3
3
  "description": "VUU UI Shell",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
6
6
  "devDependencies": {
7
- "@vuu-ui/vuu-data-types": "0.13.45",
8
- "@vuu-ui/vuu-protocol-types": "0.13.45",
9
- "@vuu-ui/vuu-table-types": "0.13.45"
7
+ "@vuu-ui/vuu-data-types": "0.13.47",
8
+ "@vuu-ui/vuu-protocol-types": "0.13.47",
9
+ "@vuu-ui/vuu-table-types": "0.13.47"
10
10
  },
11
11
  "dependencies": {
12
12
  "@salt-ds/core": "1.48.0",
13
13
  "@salt-ds/styles": "0.2.1",
14
14
  "@salt-ds/window": "0.1.1",
15
- "@vuu-ui/vuu-context-menu": "0.13.45",
16
- "@vuu-ui/vuu-data-react": "0.13.45",
17
- "@vuu-ui/vuu-data-remote": "0.13.45",
18
- "@vuu-ui/vuu-icons": "0.13.45",
19
- "@vuu-ui/vuu-layout": "0.13.45",
20
- "@vuu-ui/vuu-popups": "0.13.45",
21
- "@vuu-ui/vuu-table": "0.13.45",
22
- "@vuu-ui/vuu-ui-controls": "0.13.45",
23
- "@vuu-ui/vuu-utils": "0.13.45",
15
+ "@vuu-ui/vuu-context-menu": "0.13.47",
16
+ "@vuu-ui/vuu-data-react": "0.13.47",
17
+ "@vuu-ui/vuu-data-remote": "0.13.47",
18
+ "@vuu-ui/vuu-icons": "0.13.47",
19
+ "@vuu-ui/vuu-layout": "0.13.47",
20
+ "@vuu-ui/vuu-popups": "0.13.47",
21
+ "@vuu-ui/vuu-table": "0.13.47",
22
+ "@vuu-ui/vuu-ui-controls": "0.13.47",
23
+ "@vuu-ui/vuu-utils": "0.13.47",
24
24
  "html-to-image": "^1.11.11"
25
25
  },
26
26
  "peerDependencies": {
@@ -0,0 +1,10 @@
1
+ import { MenuProps } from "@salt-ds/core";
2
+ import { MenuActionHandler } from "./ContextMenuProvider";
3
+ import { ContextMenuItemDescriptor } from "./menu-utils";
4
+ export interface ContextMenuProps extends Pick<MenuProps, "open" | "onOpenChange"> {
5
+ menuHandler: MenuActionHandler;
6
+ menuItemDescriptors: ContextMenuItemDescriptor[];
7
+ x: number;
8
+ y: number;
9
+ }
10
+ export declare const ContextMenu: ({ menuHandler, menuItemDescriptors, onOpenChange, open, x, y, }: ContextMenuProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { ReactElement, ReactNode } from "react";
2
+ import { ContextMenuItemDescriptor } from "./menu-utils";
3
+ export type MenuActionHandler<T extends string = string, Options = unknown> = (menuItemId: T, options?: Options) => boolean | undefined;
4
+ export type MenuBuilder<Location extends string = string, Options = unknown> = (location: Location, options: Options) => ContextMenuItemDescriptor[];
5
+ export interface ContextMenuContextType {
6
+ menuBuilders: MenuBuilder[];
7
+ menuActionHandler: MenuActionHandler;
8
+ showContextMenu: (contextMenu: ReactElement | null) => void;
9
+ }
10
+ export declare const ContextMenuContext: import("react").Context<ContextMenuContextType | null>;
11
+ export interface ContextMenuProviderProps<L extends string = string, O = unknown> {
12
+ children: ReactNode;
13
+ menuActionHandler?: MenuActionHandler;
14
+ menuBuilder?: MenuBuilder<L, O>;
15
+ }
16
+ export declare const ContextMenuProvider: <L extends string = string, O = unknown>({ children, menuActionHandler, menuBuilder, }: ContextMenuProviderProps<L, O>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export { ContextMenuProvider, type MenuActionHandler, type MenuBuilder, } from "./ContextMenuProvider";
2
+ export { hasShowNotificationAction, isGroupMenuItemDescriptor, isOpenBulkEditResponse, type ContextMenuGroupItemDescriptor, type ContextMenuItemDescriptor, } from "./menu-utils";
3
+ export { useContextMenu } from "./useContextMenu";
@@ -0,0 +1,21 @@
1
+ import type { MenuRpcResponse, OpenDialogActionWithSchema } from "@vuu-ui/vuu-data-types";
2
+ import type { ShowNotificationAction, VuuRpcResponse } from "@vuu-ui/vuu-protocol-types";
3
+ import { MenuActionHandler } from "./ContextMenuProvider";
4
+ export interface ContextMenuItemBase {
5
+ className?: string;
6
+ icon?: string;
7
+ label: string;
8
+ location?: string;
9
+ }
10
+ export interface ContextMenuLeafItemDescriptor extends ContextMenuItemBase {
11
+ id: string;
12
+ options?: unknown;
13
+ }
14
+ export interface ContextMenuGroupItemDescriptor extends ContextMenuItemBase {
15
+ children: ContextMenuItemDescriptor[];
16
+ }
17
+ export type ContextMenuItemDescriptor = ContextMenuLeafItemDescriptor | ContextMenuGroupItemDescriptor;
18
+ export declare const isGroupMenuItemDescriptor: (menuItem?: ContextMenuItemDescriptor) => menuItem is ContextMenuGroupItemDescriptor;
19
+ export declare const isOpenBulkEditResponse: (rpcResponse: Partial<VuuRpcResponse>) => rpcResponse is MenuRpcResponse<OpenDialogActionWithSchema>;
20
+ export declare const hasShowNotificationAction: (res: Partial<VuuRpcResponse>) => res is MenuRpcResponse<ShowNotificationAction>;
21
+ export declare const menuItemsFromMenuDescriptors: (menuDescriptors: ContextMenuItemDescriptor[], menuActionHandler: MenuActionHandler) => import("react/jsx-runtime").JSX.Element[];
@@ -0,0 +1,10 @@
1
+ import { ContextMenuProps } from "./ContextMenu";
2
+ import { MenuActionHandler, MenuBuilder } from "./ContextMenuProvider";
3
+ export type EventLike = {
4
+ clientX: number;
5
+ clientY: number;
6
+ preventDefault?: () => void;
7
+ stopPropagation?: () => void;
8
+ };
9
+ export type ShowContextMenu = (e: EventLike, location: string, options: unknown, contextMenuProps?: Partial<Pick<ContextMenuProps, "onOpenChange" | "x" | "y">>) => boolean;
10
+ export declare const useContextMenu: (menuBuilder?: MenuBuilder, menuActionHandler?: MenuActionHandler) => ShowContextMenu;
@@ -0,0 +1,5 @@
1
+ export * from "./popup";
2
+ export * from "./popup-menu";
3
+ export * from "./portal";
4
+ export * from "./tooltip";
5
+ export * from "./notifications";
@@ -0,0 +1,5 @@
1
+ import { NotificationsContext } from "./NotificationsContext";
2
+ export interface NotificationsCenterProps {
3
+ notificationsContext: NotificationsContext;
4
+ }
5
+ export declare const NotificationsCenter: ({ notificationsContext, }: NotificationsCenterProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,36 @@
1
+ import { ValueOf } from "@vuu-ui/vuu-utils";
2
+ import { ReactNode } from "react";
3
+ export type DispatchShowNotification = (notification: Notification) => void;
4
+ export type DispatchHideNotification = () => void;
5
+ export declare const NotificationLevel: {
6
+ readonly Error: "error";
7
+ readonly Info: "info";
8
+ readonly Success: "success";
9
+ readonly Warning: "warning";
10
+ };
11
+ export type NotificationLevel = ValueOf<typeof NotificationLevel>;
12
+ export declare const NotificationType: {
13
+ readonly Toast: "toast";
14
+ readonly Workspace: "workspace";
15
+ };
16
+ export type NotificationType = ValueOf<typeof NotificationType>;
17
+ interface NotificationDescriptorBase<T extends NotificationType> {
18
+ level: NotificationLevel;
19
+ type: T;
20
+ }
21
+ export interface ToastNotificationDescriptor extends NotificationDescriptorBase<"toast"> {
22
+ content: string;
23
+ header: string;
24
+ }
25
+ export interface WorkspaceNotificationDescriptor extends NotificationDescriptorBase<"workspace"> {
26
+ content: ReactNode;
27
+ }
28
+ export type Notification = ToastNotificationDescriptor | WorkspaceNotificationDescriptor;
29
+ export declare const isToastNotification: (n: Notification) => n is ToastNotificationDescriptor;
30
+ export declare const isWorkspaceNotification: (n: Notification) => n is WorkspaceNotificationDescriptor;
31
+ export type NotificationsContext = {
32
+ hideNotification: DispatchHideNotification;
33
+ showNotification: DispatchShowNotification;
34
+ setNotify: (showNotificationDispatcher: DispatchShowNotification, hideNotificationDispatcher: DispatchHideNotification) => void;
35
+ };
36
+ export {};
@@ -0,0 +1,9 @@
1
+ import { ReactElement } from "react";
2
+ import { DispatchHideNotification, DispatchShowNotification } from "./NotificationsContext";
3
+ export declare const NotificationsProvider: (props: {
4
+ children: ReactElement | ReactElement[];
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const useNotifications: () => {
7
+ hideNotification: DispatchHideNotification;
8
+ showNotification: DispatchShowNotification;
9
+ };
@@ -0,0 +1,7 @@
1
+ import type { ToastNotificationDescriptor } from "./NotificationsContext";
2
+ export type ToastNotificationProps = {
3
+ top: number;
4
+ notification: ToastNotificationDescriptor;
5
+ animated?: boolean;
6
+ };
7
+ export declare const ToastNotification: (props: ToastNotificationProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { HTMLAttributes, ReactNode } from "react";
2
+ export interface WorkspaceNotificationProps extends HTMLAttributes<HTMLDivElement> {
3
+ children: ReactNode;
4
+ }
5
+ export declare const WorkspaceNotification: ({ children, className, style: styleProp, ...htmlAttributes }: WorkspaceNotificationProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export * from "./NotificationsContext";
2
+ export * from "./NotificationsProvider";
3
+ export * from "./ToastNotification";
@@ -0,0 +1,12 @@
1
+ import { HTMLAttributes, RefObject } from "react";
2
+ import { Position } from "./getPositionRelativeToAnchor";
3
+ export type PopupPlacement = "absolute" | "auto" | "below" | "below-center" | "below-right" | "below-full-width" | "center" | "right";
4
+ export interface PopupComponentProps extends HTMLAttributes<HTMLDivElement> {
5
+ anchorElement: RefObject<HTMLElement | null>;
6
+ minWidth?: number | string;
7
+ offsetLeft?: number;
8
+ offsetTop?: number;
9
+ placement: PopupPlacement;
10
+ position?: Position;
11
+ }
12
+ export declare const PopupComponent: ({ children, className, anchorElement, minWidth, offsetLeft, offsetTop, placement, position: positionProp, }: PopupComponentProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,19 @@
1
+ import { PopupPlacement } from "./Popup";
2
+ export type Visibility = "hidden" | "visible";
3
+ export type Position = {
4
+ left: number;
5
+ minWidth?: number | string;
6
+ top: number;
7
+ visibility?: Visibility;
8
+ width?: number;
9
+ };
10
+ export declare const getPositionRelativeToAnchor: (anchorElement: HTMLElement, placement: PopupPlacement, offsetLeft: number, offsetTop: number, minWidth?: number | string, dimensions?: {
11
+ height: number;
12
+ width: number;
13
+ }) => {
14
+ left: number;
15
+ minWidth?: number | string;
16
+ top: number;
17
+ visibility?: Visibility;
18
+ width?: number;
19
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./Popup";
2
+ export * from "./useAnchoredPosition";
@@ -0,0 +1,7 @@
1
+ import { Position } from "./getPositionRelativeToAnchor";
2
+ import { PopupComponentProps } from "./Popup";
3
+ export type AnchoredPositionHookProps = Pick<PopupComponentProps, "anchorElement" | "minWidth" | "offsetLeft" | "offsetTop" | "placement" | "position">;
4
+ export declare const useAnchoredPosition: ({ anchorElement, minWidth, offsetLeft, offsetTop, placement, position: positionProp, }: AnchoredPositionHookProps) => {
5
+ position: Position | undefined;
6
+ popupRef: ((el: HTMLDivElement | null) => void) | undefined;
7
+ };
@@ -0,0 +1,45 @@
1
+ import { ButtonProps } from "@salt-ds/core";
2
+ import { MenuActionHandler, MenuBuilder } from "@vuu-ui/vuu-context-menu";
3
+ import { HTMLAttributes, KeyboardEvent, RefObject } from "react";
4
+ import { PopupPlacement } from "../popup/Popup";
5
+ export type TabAwayClosePopup = {
6
+ closedBy?: string;
7
+ type: "tab-away";
8
+ event: KeyboardEvent;
9
+ };
10
+ export type ClickAwayClosePopup = {
11
+ closedBy?: string;
12
+ type: "click-away";
13
+ mouseEvt: MouseEvent;
14
+ };
15
+ export type EscapeClosePopup = {
16
+ closedBy?: string;
17
+ event: KeyboardEvent;
18
+ type: "escape";
19
+ };
20
+ export type MenuActionClosePopup = {
21
+ closedBy?: string;
22
+ menuId: string;
23
+ options: unknown;
24
+ type: "menu-action";
25
+ };
26
+ export type PopupCloseReason = ClickAwayClosePopup | EscapeClosePopup | MenuActionClosePopup | TabAwayClosePopup;
27
+ export type MenuCloseHandler = (reason?: PopupCloseReason) => void;
28
+ export interface PopupMenuProps extends HTMLAttributes<HTMLButtonElement> {
29
+ anchorElement?: RefObject<HTMLElement | null>;
30
+ disabled?: boolean;
31
+ icon?: string;
32
+ label?: string;
33
+ menuActionHandler?: MenuActionHandler;
34
+ menuBuilder?: MenuBuilder;
35
+ menuClassName?: string;
36
+ menuLocation?: string;
37
+ menuOptions?: {
38
+ [key: string]: unknown;
39
+ };
40
+ onMenuClose?: MenuCloseHandler;
41
+ onMenuOpen?: () => void;
42
+ popupPlacement?: PopupPlacement;
43
+ variant?: ButtonProps["variant"];
44
+ }
45
+ export declare const PopupMenu: ({ anchorElement, className, disabled, label, icon, id: idProp, menuActionHandler, menuBuilder, menuClassName, menuLocation, menuOptions, onMenuClose, onMenuOpen, popupPlacement, tabIndex, variant, ...htmlAttributes }: PopupMenuProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export * from "./PopupMenu";
@@ -0,0 +1,19 @@
1
+ import { AriaAttributes, MouseEvent } from "react";
2
+ import { PopupMenuProps } from "./PopupMenu";
3
+ import { PopupPlacement } from "../popup/Popup";
4
+ export interface PopupMenuHookProps extends Pick<PopupMenuProps, "anchorElement" | "menuActionHandler" | "menuBuilder" | "menuClassName" | "menuOptions" | "onMenuClose" | "onMenuOpen"> {
5
+ id: string;
6
+ menuLocation: string;
7
+ popupPlacement: PopupPlacement;
8
+ tabIndex: number;
9
+ }
10
+ export declare const usePopupMenu: ({ anchorElement, id, menuActionHandler, menuBuilder, menuLocation, menuOptions, onMenuClose, onMenuOpen, popupPlacement, tabIndex, }: PopupMenuHookProps) => {
11
+ ariaAttributes: AriaAttributes;
12
+ buttonProps: {
13
+ id: string;
14
+ onClick: (e: MouseEvent<HTMLElement>) => void;
15
+ tabIndex: number;
16
+ };
17
+ menuOpen: boolean;
18
+ rootRef: import("react").RefObject<HTMLButtonElement | null>;
19
+ };
@@ -0,0 +1,42 @@
1
+ import { ThemeAttributes } from "@vuu-ui/vuu-utils";
2
+ import { ReactNode } from "react";
3
+ export interface PortalProps {
4
+ /**
5
+ * The children to render into the `container`.
6
+ */
7
+ children?: ReactNode;
8
+ /**
9
+ * An HTML element, component instance, or function that returns either.
10
+ * The `container` will have the portal children appended to it.
11
+ *
12
+ * By default, it uses the body of the top-level document object,
13
+ * so it's simply `document.body` most of the time.
14
+ */
15
+ container?: Element | (() => Element | null) | null;
16
+ /**
17
+ * Id of element into which portal will be rendered. If this node does not exist on the document,
18
+ * it will be created for you. If more than one value is provided, the first element found will
19
+ * be used.
20
+ */
21
+ id?: string | string[];
22
+ /**
23
+ * Callback invoked immediately after render (in layoutEffect). Can be
24
+ * used to check position vis-a-vis viewport and adjust if out of bounds
25
+ */
26
+ onRender?: () => void;
27
+ /**
28
+ * Allow conditional rendering of this Portal, if false, will render nothing.
29
+ * Defaults to true
30
+ */
31
+ open?: boolean;
32
+ /**
33
+ * ThemeAttributes can be passed in for cases where ContextMenu is
34
+ * rendered via popup-service showPopup, outside the Context hierarchy.
35
+ */
36
+ themeAttributes?: ThemeAttributes;
37
+ }
38
+ /**
39
+ * Portals provide a first-class way to render children into a DOM node
40
+ * that exists outside the DOM hierarchy of the parent component.
41
+ */
42
+ export declare const Portal: ({ children, container: containerProp, id, onRender, open, themeAttributes, }: PortalProps) => import("react").ReactPortal | null;
@@ -0,0 +1 @@
1
+ export * from "./Portal";
@@ -0,0 +1,15 @@
1
+ import { CSSProperties, MouseEventHandler, ReactNode, RefObject } from "react";
2
+ import { TooltipPlacement } from "./useTooltipAnchoredPosition";
3
+ export type TooltipStatus = "warning" | "error" | "info";
4
+ export interface TooltipProps {
5
+ anchorElement: RefObject<HTMLElement | null>;
6
+ children: ReactNode;
7
+ className?: string;
8
+ id?: string;
9
+ onMouseEnter: MouseEventHandler;
10
+ onMouseLeave: MouseEventHandler;
11
+ placement: TooltipPlacement | TooltipPlacement[];
12
+ status?: TooltipStatus;
13
+ style?: CSSProperties;
14
+ }
15
+ export declare const Tooltip: ({ anchorElement, children, className, id, onMouseEnter, onMouseLeave, placement: placementProp, status, style: styleProp, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from "./Tooltip";
2
+ export * from "./useTooltip";
@@ -0,0 +1,19 @@
1
+ import { MouseEvent, ReactNode } from "react";
2
+ import { TooltipProps } from "./Tooltip";
3
+ import { TooltipPlacement } from "./useTooltipAnchoredPosition";
4
+ export interface TooltipHookProps {
5
+ anchorQuery?: string;
6
+ id: string;
7
+ placement?: TooltipPlacement | TooltipPlacement[];
8
+ tooltipContent: ReactNode;
9
+ }
10
+ export declare const useTooltip: ({ anchorQuery, id: idProp, placement, tooltipContent, }: TooltipHookProps) => {
11
+ anchorProps: {
12
+ "aria-describedby": string;
13
+ onMouseEnter: (evt: MouseEvent) => void;
14
+ onMouseLeave: () => void;
15
+ };
16
+ hideTooltip: (defer?: number) => void;
17
+ showTooltip: (ref?: import("react").RefObject<HTMLElement | null>) => void;
18
+ tooltipProps: TooltipProps | undefined;
19
+ };
@@ -0,0 +1,7 @@
1
+ import { RefCallback, RefObject } from "react";
2
+ export type TooltipPlacement = "above" | "right" | "below" | "left";
3
+ export interface TooltipAnchoredPositionHookProps {
4
+ anchorElement: RefObject<HTMLElement | null>;
5
+ placement: TooltipPlacement | TooltipPlacement[];
6
+ }
7
+ export declare const useTooltipAnchoredPosition: ({ anchorElement, placement, }: TooltipAnchoredPositionHookProps) => RefCallback<HTMLDivElement>;
@@ -1,6 +1,5 @@
1
1
  export * from "./application-provider";
2
2
  export * from "./app-header";
3
- export * from "./connection-status";
4
3
  export * from "./feature";
5
4
  export * from "./feature-and-layout-provider";
6
5
  export * from "./left-nav";
@@ -0,0 +1,13 @@
1
+ import { type CalendarCarouselProps } from "./internal/CalendarCarousel";
2
+ import { type CalendarNavigationProps } from "./internal/CalendarNavigation";
3
+ import { type useCalendarProps } from "./useCalendar";
4
+ export type CalendarProps = useCalendarProps & {
5
+ className?: string;
6
+ id?: string;
7
+ renderDayContents?: CalendarCarouselProps["renderDayContents"];
8
+ hideYearDropdown?: CalendarNavigationProps["hideYearDropdown"];
9
+ borderedDropdown?: CalendarNavigationProps["borderedDropdown"];
10
+ TooltipProps?: CalendarCarouselProps["TooltipProps"];
11
+ hideOutOfRangeDates?: CalendarCarouselProps["hideOutOfRangeDates"];
12
+ };
13
+ export declare const Calendar: import("react").ForwardRefExoticComponent<CalendarProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,4 @@
1
+ export * from "./Calendar";
2
+ export * from "./useCalendarDay";
3
+ export * from "./useCalendar";
4
+ export * from "./useSelection";
@@ -0,0 +1,3 @@
1
+ import { type CalendarMonthProps } from "./CalendarMonth";
2
+ export type CalendarCarouselProps = Omit<CalendarMonthProps, "date">;
3
+ export declare const CalendarCarousel: import("react").ForwardRefExoticComponent<Omit<CalendarCarouselProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,8 @@
1
+ import type { useCalendar } from "../useCalendar";
2
+ interface CalendarState {
3
+ state: ReturnType<typeof useCalendar>["state"];
4
+ helpers: ReturnType<typeof useCalendar>["helpers"];
5
+ }
6
+ declare const CalendarContext: import("react").Context<CalendarState | null>;
7
+ declare function useCalendarContext(): CalendarState;
8
+ export { CalendarContext, useCalendarContext };
@@ -0,0 +1,14 @@
1
+ import type { DateValue } from "@internationalized/date";
2
+ import { type TooltipProps } from "@salt-ds/core";
3
+ import { type ComponentPropsWithRef, type ReactElement } from "react";
4
+ import { type DayStatus } from "../useCalendarDay";
5
+ export type DateFormatter = (day: Date) => string | undefined;
6
+ export interface CalendarDayProps extends Omit<ComponentPropsWithRef<"button">, "children"> {
7
+ day: DateValue;
8
+ formatDate?: DateFormatter;
9
+ renderDayContents?: (date: DateValue, status: DayStatus) => ReactElement;
10
+ status?: DayStatus;
11
+ month: DateValue;
12
+ TooltipProps?: Partial<TooltipProps>;
13
+ }
14
+ export declare const CalendarDay: import("react").ForwardRefExoticComponent<Omit<CalendarDayProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,10 @@
1
+ import type { DateValue } from "@internationalized/date";
2
+ import { type ComponentPropsWithRef } from "react";
3
+ import { type CalendarDayProps } from "./CalendarDay";
4
+ export interface CalendarMonthProps extends ComponentPropsWithRef<"div"> {
5
+ date: DateValue;
6
+ hideOutOfRangeDates?: boolean;
7
+ renderDayContents?: CalendarDayProps["renderDayContents"];
8
+ TooltipProps?: CalendarDayProps["TooltipProps"];
9
+ }
10
+ export declare const CalendarMonth: import("react").ForwardRefExoticComponent<Omit<CalendarMonthProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,16 @@
1
+ import { type ButtonProps, type DropdownProps } from "@salt-ds/core";
2
+ import { type ComponentPropsWithRef } from "react";
3
+ import { type DateValue } from "@internationalized/date";
4
+ type dateDropdownProps = DropdownProps<DateValue>;
5
+ export interface CalendarNavigationProps extends ComponentPropsWithRef<"div"> {
6
+ MonthDropdownProps?: dateDropdownProps;
7
+ YearDropdownProps?: dateDropdownProps;
8
+ onMonthSelect?: dateDropdownProps["onChange"];
9
+ onYearSelect?: dateDropdownProps["onChange"];
10
+ borderedDropdown?: dateDropdownProps["bordered"];
11
+ onNavigateNext?: ButtonProps["onClick"];
12
+ onNavigatePrevious?: ButtonProps["onClick"];
13
+ hideYearDropdown?: boolean;
14
+ }
15
+ export declare const CalendarNavigation: import("react").ForwardRefExoticComponent<Omit<CalendarNavigationProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
16
+ export {};
@@ -0,0 +1,3 @@
1
+ import { type ComponentPropsWithRef } from "react";
2
+ export type CalendarWeekHeaderProps = ComponentPropsWithRef<"div">;
3
+ export declare const CalendarWeekHeader: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,9 @@
1
+ import { type DateValue } from "@internationalized/date";
2
+ import type { FocusEventHandler, KeyboardEventHandler, MouseEventHandler } from "react";
3
+ export declare function useFocusManagement({ date }: {
4
+ date: DateValue;
5
+ }): {
6
+ handleClick: MouseEventHandler<HTMLButtonElement>;
7
+ handleKeyDown: KeyboardEventHandler<HTMLButtonElement>;
8
+ handleFocus: FocusEventHandler<HTMLButtonElement>;
9
+ };
@@ -0,0 +1,15 @@
1
+ import { DateFormatter, type DateValue } from "@internationalized/date";
2
+ export declare function getCurrentLocale(): string;
3
+ export declare function getDateFormatter(options?: Intl.DateTimeFormatOptions): DateFormatter;
4
+ export declare function formatDate(date: DateValue, options?: Intl.DateTimeFormatOptions): string;
5
+ export declare function getCalender(): import("@internationalized/date").Calendar;
6
+ type WeekdayFormat = Intl.DateTimeFormatOptions["weekday"];
7
+ export declare function daysForLocale(weekday?: WeekdayFormat): string[];
8
+ export declare function monthsForLocale(currentYear: DateValue): (import("@internationalized/date").CalendarDate | import("@internationalized/date").CalendarDateTime | import("@internationalized/date").ZonedDateTime)[];
9
+ export declare function generateVisibleDays(currentMonth: DateValue): {
10
+ date: DateValue;
11
+ dateOfMonth: number;
12
+ isCurrentMonth: boolean;
13
+ }[];
14
+ export declare function monthDiff(a: DateValue, b: DateValue): number;
15
+ export {};