@vuu-ui/vuu-shell 0.8.10-debug → 0.8.11-debug

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.js CHANGED
@@ -54,7 +54,6 @@ __export(src_exports, {
54
54
  getAuthModeFromCookies: () => getAuthModeFromCookies,
55
55
  logout: () => logout,
56
56
  redirectToLogin: () => redirectToLogin,
57
- useLayoutConfig: () => useLayoutConfig,
58
57
  useLayoutManager: () => useLayoutManager,
59
58
  useShellContext: () => useShellContext,
60
59
  useShellLayout: () => useShellLayout,
@@ -218,107 +217,8 @@ var Feature = import_react4.default.memo(RawFeature);
218
217
  Feature.displayName = "Feature";
219
218
  (0, import_vuu_layout.registerComponent)("Feature", Feature, "view");
220
219
 
221
- // src/layout-config/use-layout-config.ts
222
- var import_react5 = require("react");
223
-
224
- // src/layout-config/local-config.ts
225
- var import_vuu_layout2 = require("@vuu-ui/vuu-layout");
226
- var loadLocalConfig = (saveUrl, user, id = "latest") => new Promise((resolve, reject) => {
227
- console.log(
228
- `load local config at ${saveUrl} for user ${user == null ? void 0 : user.username}, id ${id}`
229
- );
230
- const data = localStorage.getItem(saveUrl);
231
- if (data) {
232
- const layout = JSON.parse(data);
233
- resolve(layout);
234
- } else {
235
- reject();
236
- }
237
- });
238
- var saveLocalConfig = (saveUrl, user, data) => new Promise((resolve, reject) => {
239
- try {
240
- const layoutJson = (0, import_vuu_layout2.resolveJSONPath)(data, "#main-tabs.ACTIVE_CHILD");
241
- console.log(layoutJson);
242
- localStorage.setItem(saveUrl, JSON.stringify(data));
243
- resolve(void 0);
244
- } catch {
245
- reject();
246
- }
247
- });
248
-
249
- // src/layout-config/remote-config.ts
250
- var loadRemoteConfig = (saveUrl, user, id = "latest") => new Promise((resolve, reject) => {
251
- if (user === void 0) {
252
- throw Error("user mustb be provided to load remote config");
253
- }
254
- fetch(`${saveUrl}/${user.username}/${id}`, {}).then((response) => {
255
- if (response.ok) {
256
- resolve(response.json());
257
- } else {
258
- reject(void 0);
259
- }
260
- }).catch(() => {
261
- reject(void 0);
262
- });
263
- });
264
- var saveRemoteConfig = (saveUrl, user, data) => new Promise((resolve, reject) => {
265
- if (user === void 0) {
266
- throw Error("user mustb be provided to load remote config");
267
- }
268
- fetch(`${saveUrl}/${user.username}`, {
269
- method: "POST",
270
- headers: {
271
- "Content-Type": "application/json"
272
- },
273
- body: JSON.stringify(data)
274
- }).then((response) => {
275
- if (response.ok) {
276
- resolve(void 0);
277
- } else {
278
- reject();
279
- }
280
- });
281
- });
282
-
283
- // src/layout-config/use-layout-config.ts
284
- var FALLBACK_LAYOUT = { type: "Placeholder" };
285
- var useLayoutConfig = ({
286
- saveLocation,
287
- saveUrl = "api/vui",
288
- user,
289
- // TODO this should be an error panel
290
- defaultLayout = FALLBACK_LAYOUT
291
- }) => {
292
- const [layout, _setLayout] = (0, import_react5.useState)(defaultLayout);
293
- const usingRemote = saveLocation === "remote";
294
- const loadConfig = usingRemote ? loadRemoteConfig : loadLocalConfig;
295
- const saveConfig = usingRemote ? saveRemoteConfig : saveLocalConfig;
296
- const load = (0, import_react5.useCallback)(
297
- async (id = "latest") => {
298
- try {
299
- const layout2 = await loadConfig(saveUrl, user, id);
300
- _setLayout(layout2);
301
- } catch {
302
- _setLayout(defaultLayout);
303
- }
304
- },
305
- [defaultLayout, loadConfig, saveUrl, user]
306
- );
307
- (0, import_react5.useEffect)(() => {
308
- load();
309
- }, [load]);
310
- const saveData = (0, import_react5.useCallback)(
311
- (data) => {
312
- saveConfig(saveUrl, user, data);
313
- },
314
- [saveConfig, saveUrl, user]
315
- );
316
- const loadLayoutById = (0, import_react5.useCallback)((id) => load(id), [load]);
317
- return [layout, saveData, loadLayoutById];
318
- };
319
-
320
220
  // src/layout-management/SaveLayoutPanel.tsx
321
- var import_react6 = require("react");
221
+ var import_react5 = require("react");
322
222
  var import_core = require("@salt-ds/core");
323
223
  var import_vuu_ui_controls = require("@vuu-ui/vuu-ui-controls");
324
224
  var import_vuu_utils = require("@vuu-ui/vuu-utils");
@@ -330,18 +230,18 @@ var checkboxValues = ["Value 1", "Value 2", "Value 3"];
330
230
  var radioValues = ["Value 1", "Value 2", "Value 3"];
331
231
  var SaveLayoutPanel = (props) => {
332
232
  const { onCancel, onSave, componentId } = props;
333
- const [layoutName, setLayoutName] = (0, import_react6.useState)("");
334
- const [group, setGroup] = (0, import_react6.useState)("");
335
- const [checkValues, setCheckValues] = (0, import_react6.useState)([]);
336
- const [radioValue, setRadioValue] = (0, import_react6.useState)(radioValues[0]);
337
- const [screenshot, setScreenshot] = (0, import_react6.useState)();
338
- (0, import_react6.useEffect)(() => {
233
+ const [layoutName, setLayoutName] = (0, import_react5.useState)("");
234
+ const [group, setGroup] = (0, import_react5.useState)("");
235
+ const [checkValues, setCheckValues] = (0, import_react5.useState)([]);
236
+ const [radioValue, setRadioValue] = (0, import_react5.useState)(radioValues[0]);
237
+ const [screenshot, setScreenshot] = (0, import_react5.useState)();
238
+ (0, import_react5.useEffect)(() => {
339
239
  if (componentId) {
340
240
  (0, import_vuu_utils.takeScreenshot)(document.getElementById(componentId)).then(
341
241
  (screenshot2) => setScreenshot(screenshot2)
342
242
  );
343
243
  }
344
- }, []);
244
+ }, [componentId]);
345
245
  const handleSubmit = () => {
346
246
  onSave({
347
247
  name: layoutName,
@@ -359,14 +259,6 @@ var SaveLayoutPanel = (props) => {
359
259
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
360
260
  import_vuu_ui_controls.ComboBox,
361
261
  {
362
- ListProps: {
363
- style: {
364
- zIndex: 1e4,
365
- border: "1px solid #777C94",
366
- borderRadius: 10,
367
- boxSizing: "border-box"
368
- }
369
- },
370
262
  source: groups,
371
263
  allowFreeText: true,
372
264
  InputProps: {
@@ -451,52 +343,86 @@ var SaveLayoutPanel = (props) => {
451
343
  var import_vuu_ui_controls2 = require("@vuu-ui/vuu-ui-controls");
452
344
 
453
345
  // src/layout-management/useLayoutManager.tsx
454
- var import_react7 = __toESM(require("react"));
455
- var import_vuu_filters = require("@vuu-ui/vuu-filters");
456
- var import_vuu_utils2 = require("@vuu-ui/vuu-utils");
346
+ var import_react6 = __toESM(require("react"));
347
+ var import_vuu_layout2 = require("@vuu-ui/vuu-layout");
348
+ var import_vuu_layout3 = require("@vuu-ui/vuu-layout/");
457
349
  var import_jsx_runtime7 = require("react/jsx-runtime");
458
- var LayoutManagementContext = import_react7.default.createContext({ layouts: [], saveLayout: () => {
459
- } });
350
+ var persistenceManager = new import_vuu_layout2.LocalLayoutPersistenceManager();
351
+ var LayoutManagementContext = import_react6.default.createContext({
352
+ layoutMetadata: [],
353
+ saveLayout: () => {
354
+ },
355
+ applicationLayout: import_vuu_layout3.defaultLayout,
356
+ saveApplicationLayout: () => {
357
+ },
358
+ loadLayoutById: () => import_vuu_layout3.defaultLayout
359
+ });
460
360
  var LayoutManagementProvider = (props) => {
461
- const [layouts, setLayouts] = (0, import_react7.useState)([]);
462
- (0, import_react7.useEffect)(() => {
463
- const layouts2 = (0, import_vuu_filters.getLocalEntity)("layouts");
464
- setLayouts(layouts2 || []);
361
+ const [layoutMetadata, setLayoutMetadata] = (0, import_react6.useState)([]);
362
+ const [applicationLayout, setApplicationLayout] = (0, import_react6.useState)(import_vuu_layout3.defaultLayout);
363
+ (0, import_react6.useEffect)(() => {
364
+ persistenceManager.loadMetadata().then((metadata) => {
365
+ setLayoutMetadata(metadata);
366
+ });
367
+ persistenceManager.loadApplicationLayout().then((layout) => {
368
+ setApplicationLayout(layout);
369
+ });
465
370
  }, []);
466
- (0, import_react7.useEffect)(() => {
467
- (0, import_vuu_filters.saveLocalEntity)("layouts", layouts);
468
- }, [layouts]);
469
- const saveLayout = (0, import_react7.useCallback)((metadata) => {
470
- const json = (0, import_vuu_filters.getLocalEntity)("api/vui");
471
- if (json) {
472
- setLayouts((prev) => [
473
- ...prev,
474
- {
475
- metadata: {
371
+ const saveApplicationLayout = (0, import_react6.useCallback)((layout) => {
372
+ setApplicationLayout(layout);
373
+ persistenceManager.saveApplicationLayout(layout);
374
+ }, []);
375
+ const saveLayout = (0, import_react6.useCallback)(
376
+ (metadata) => {
377
+ const layoutToSave = (0, import_vuu_layout2.resolveJSONPath)(
378
+ applicationLayout,
379
+ "#main-tabs.ACTIVE_CHILD"
380
+ );
381
+ if (layoutToSave) {
382
+ persistenceManager.createLayout(metadata, layoutToSave).then((generatedId) => {
383
+ const newMetadata = {
476
384
  ...metadata,
477
- id: (0, import_vuu_utils2.getUniqueId)()
478
- },
479
- json
480
- }
481
- ]);
482
- }
385
+ id: generatedId
386
+ };
387
+ setLayoutMetadata((prev) => [...prev, newMetadata]);
388
+ });
389
+ }
390
+ },
391
+ [applicationLayout]
392
+ );
393
+ const loadLayoutById = (0, import_react6.useCallback)((id) => {
394
+ persistenceManager.loadLayout(id).then((layoutJson) => {
395
+ setApplicationLayout((prev) => ({
396
+ ...prev,
397
+ children: [...prev.children || [], layoutJson]
398
+ }));
399
+ });
483
400
  }, []);
484
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(LayoutManagementContext.Provider, { value: { layouts, saveLayout }, children: props.children });
401
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
402
+ LayoutManagementContext.Provider,
403
+ {
404
+ value: {
405
+ layoutMetadata,
406
+ saveLayout,
407
+ applicationLayout,
408
+ saveApplicationLayout,
409
+ loadLayoutById
410
+ },
411
+ children: props.children
412
+ }
413
+ );
485
414
  };
486
- var useLayoutManager = () => (0, import_react7.useContext)(LayoutManagementContext);
415
+ var useLayoutManager = () => (0, import_react6.useContext)(LayoutManagementContext);
487
416
 
488
417
  // src/layout-management/LayoutList.tsx
489
418
  var import_jsx_runtime8 = require("react/jsx-runtime");
490
419
  var classBase3 = "vuuLayoutList";
491
420
  var LayoutsList = (props) => {
492
- const { layouts } = useLayoutManager();
493
- const layoutMetadata = layouts.map((layout) => layout.metadata);
421
+ const { layoutMetadata, loadLayoutById } = useLayoutManager();
494
422
  const handleLoadLayout = (layoutId) => {
495
- console.log("loading layout with id", layoutId);
496
- console.log(
497
- "json:",
498
- layouts.find((layout) => layout.metadata.id === layoutId)
499
- );
423
+ if (layoutId) {
424
+ loadLayoutById(layoutId);
425
+ }
500
426
  };
501
427
  const layoutsByGroup = layoutMetadata.reduce((acc, cur) => {
502
428
  if (acc[cur.group]) {
@@ -517,46 +443,44 @@ var LayoutsList = (props) => {
517
443
  {
518
444
  height: "fit-content",
519
445
  source: Object.entries(layoutsByGroup),
520
- ListItem: ({ item }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
521
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `${classBase3}-groupName`, children: item == null ? void 0 : item[0] }),
522
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
523
- import_vuu_ui_controls2.List,
524
- {
525
- height: "fit-content",
526
- source: item == null ? void 0 : item[1],
527
- ListItem: ({ item: layout }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
528
- "div",
529
- {
530
- className: `${classBase3}-layoutContainer`,
531
- onClick: () => handleLoadLayout(layout == null ? void 0 : layout.id),
532
- children: [
533
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
534
- "img",
535
- {
536
- className: `${classBase3}-screenshot`,
537
- src: layout == null ? void 0 : layout.screenshot
538
- }
539
- ),
540
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
541
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `${classBase3}-layoutName`, children: layout == null ? void 0 : layout.name }),
542
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `${classBase3}-layoutDetails`, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: `${layout == null ? void 0 : layout.user}, ${layout == null ? void 0 : layout.date}` }) })
543
- ] })
544
- ]
545
- },
546
- layout == null ? void 0 : layout.id
547
- )
548
- }
549
- )
550
- ] })
446
+ ListItem: ({ item }) => {
447
+ if (!item)
448
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, {});
449
+ const [groupName, layouts] = item;
450
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
451
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `${classBase3}-groupName`, children: groupName }),
452
+ layouts.map((layout) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
453
+ "div",
454
+ {
455
+ className: `${classBase3}-layoutContainer`,
456
+ onClick: () => handleLoadLayout(layout == null ? void 0 : layout.id),
457
+ children: [
458
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
459
+ "img",
460
+ {
461
+ className: `${classBase3}-screenshot`,
462
+ src: layout == null ? void 0 : layout.screenshot
463
+ }
464
+ ),
465
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
466
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `${classBase3}-layoutName`, children: layout == null ? void 0 : layout.name }),
467
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `${classBase3}-layoutDetails`, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: `${layout == null ? void 0 : layout.user}, ${layout == null ? void 0 : layout.date}` }) })
468
+ ] })
469
+ ]
470
+ },
471
+ layout == null ? void 0 : layout.id
472
+ ))
473
+ ] });
474
+ }
551
475
  }
552
476
  )
553
477
  ] });
554
478
  };
555
479
 
556
480
  // ../vuu-icons/src/VuuLogo.tsx
557
- var import_react8 = require("react");
481
+ var import_react7 = require("react");
558
482
  var import_jsx_runtime9 = require("react/jsx-runtime");
559
- var VuuLogo = (0, import_react8.memo)(() => {
483
+ var VuuLogo = (0, import_react7.memo)(() => {
560
484
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
561
485
  "svg",
562
486
  {
@@ -652,13 +576,13 @@ var VuuLogo = (0, import_react8.memo)(() => {
652
576
  VuuLogo.displayName = "VuuLogo";
653
577
 
654
578
  // src/left-nav/LeftNav.tsx
655
- var import_vuu_layout4 = require("@vuu-ui/vuu-layout");
579
+ var import_vuu_layout5 = require("@vuu-ui/vuu-layout");
656
580
  var import_vuu_ui_controls3 = require("@vuu-ui/vuu-ui-controls");
657
581
  var import_classnames4 = __toESM(require("classnames"));
658
- var import_react10 = require("react");
582
+ var import_react9 = require("react");
659
583
 
660
584
  // src/feature-list/FeatureList.tsx
661
- var import_vuu_layout3 = require("@vuu-ui/vuu-layout");
585
+ var import_vuu_layout4 = require("@vuu-ui/vuu-layout");
662
586
  var import_jsx_runtime10 = require("react/jsx-runtime");
663
587
  var classBase4 = "vuuFeatureList";
664
588
  var FeatureList = ({
@@ -670,8 +594,8 @@ var FeatureList = ({
670
594
  console.log({ features });
671
595
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { ...htmlAttributes, className: classBase4, children: [
672
596
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `${classBase4}-header`, children: title }),
673
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_vuu_layout3.Palette, { orientation: "vertical", ViewProps, children: features.map((featureProps, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
674
- import_vuu_layout3.PaletteItem,
597
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_vuu_layout4.Palette, { orientation: "vertical", ViewProps, children: features.map((featureProps, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
598
+ import_vuu_layout4.PaletteItem,
675
599
  {
676
600
  closeable: true,
677
601
  label: featureProps.title,
@@ -686,13 +610,13 @@ var FeatureList = ({
686
610
  };
687
611
 
688
612
  // src/theme-provider/ThemeProvider.tsx
689
- var import_react9 = require("react");
613
+ var import_react8 = require("react");
690
614
  var import_classnames3 = __toESM(require("classnames"));
691
615
  var import_jsx_runtime11 = require("react/jsx-runtime");
692
616
  var DEFAULT_DENSITY2 = "medium";
693
617
  var DEFAULT_THEME = "salt-theme";
694
618
  var DEFAULT_THEME_MODE = "light";
695
- var ThemeContext = (0, import_react9.createContext)({
619
+ var ThemeContext = (0, import_react8.createContext)({
696
620
  density: "high",
697
621
  theme: "vuu",
698
622
  themeMode: "light"
@@ -702,9 +626,15 @@ var DEFAULT_THEME_ATTRIBUTES = [
702
626
  "vuu-density-high",
703
627
  "light"
704
628
  ];
705
- var useThemeAttributes = () => {
706
- const context = (0, import_react9.useContext)(ThemeContext);
707
- if (context) {
629
+ var useThemeAttributes = (themeAttributes) => {
630
+ const context = (0, import_react8.useContext)(ThemeContext);
631
+ if (themeAttributes) {
632
+ return [
633
+ themeAttributes.themeClass,
634
+ themeAttributes.densityClass,
635
+ themeAttributes.dataMode
636
+ ];
637
+ } else if (context) {
708
638
  return [
709
639
  `${context.theme}-theme`,
710
640
  `${context.theme}-density-${context.density}`,
@@ -715,8 +645,8 @@ var useThemeAttributes = () => {
715
645
  };
716
646
  var createThemedChildren = (children, theme, themeMode, density) => {
717
647
  var _a;
718
- if ((0, import_react9.isValidElement)(children)) {
719
- return (0, import_react9.cloneElement)(children, {
648
+ if ((0, import_react8.isValidElement)(children)) {
649
+ return (0, import_react8.cloneElement)(children, {
720
650
  className: (0, import_classnames3.default)(
721
651
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
722
652
  (_a = children.props) == null ? void 0 : _a.className,
@@ -748,7 +678,7 @@ var ThemeProvider = ({
748
678
  density: inheritedDensity,
749
679
  themeMode: inheritedThemeMode,
750
680
  theme: inheritedTheme
751
- } = (0, import_react9.useContext)(ThemeContext);
681
+ } = (0, import_react8.useContext)(ThemeContext);
752
682
  const density = (_a = densityProp != null ? densityProp : inheritedDensity) != null ? _a : DEFAULT_DENSITY2;
753
683
  const themeMode = (_b = themeModeProp != null ? themeModeProp : inheritedThemeMode) != null ? _b : DEFAULT_THEME_MODE;
754
684
  const theme = (_c = themeProp != null ? themeProp : inheritedTheme) != null ? _c : DEFAULT_THEME;
@@ -771,13 +701,13 @@ var LeftNav = ({
771
701
  tableFeatures,
772
702
  ...htmlAttributes
773
703
  }) => {
774
- const dispatch = (0, import_vuu_layout4.useLayoutProviderDispatch)();
775
- const [navState, setNavState] = (0, import_react10.useState)({
704
+ const dispatch = (0, import_vuu_layout5.useLayoutProviderDispatch)();
705
+ const [navState, setNavState] = (0, import_react9.useState)({
776
706
  activeTabIndex: 0,
777
707
  navStatus: "menu-full"
778
708
  });
779
709
  const [themeClass] = useThemeAttributes();
780
- const toggleNavWidth = (0, import_react10.useCallback)(
710
+ const toggleNavWidth = (0, import_react9.useCallback)(
781
711
  (navStatus) => {
782
712
  switch (navStatus) {
783
713
  case "menu-icons":
@@ -804,7 +734,7 @@ var LeftNav = ({
804
734
  return "menu-full-content";
805
735
  }
806
736
  };
807
- const getWidthAndStatus = (0, import_react10.useCallback)(
737
+ const getWidthAndStatus = (0, import_react9.useCallback)(
808
738
  (navState2, tabIndex) => {
809
739
  if (tabIndex === 0) {
810
740
  const newNavState = navState2 === "menu-full-content" ? "menu-full" : navState2 === "menu-icons-content" ? "menu-icons" : navState2;
@@ -816,7 +746,7 @@ var LeftNav = ({
816
746
  },
817
747
  [sizeCollapsed, sizeContent, sizeExpanded]
818
748
  );
819
- const handleTabSelection = (0, import_react10.useCallback)(
749
+ const handleTabSelection = (0, import_react9.useCallback)(
820
750
  (value) => {
821
751
  const [width, navStatus] = getWidthAndStatus(navState.navStatus, value);
822
752
  setNavState({
@@ -824,21 +754,21 @@ var LeftNav = ({
824
754
  navStatus
825
755
  });
826
756
  dispatch({
827
- type: import_vuu_layout4.Action.LAYOUT_RESIZE,
757
+ type: import_vuu_layout5.Action.LAYOUT_RESIZE,
828
758
  path,
829
759
  size: width
830
760
  });
831
761
  },
832
762
  [dispatch, getWidthAndStatus, navState, path]
833
763
  );
834
- const toggleSize = (0, import_react10.useCallback)(() => {
764
+ const toggleSize = (0, import_react9.useCallback)(() => {
835
765
  const { activeTabIndex, navStatus: currentNavStatus } = navState;
836
766
  setNavState({
837
767
  activeTabIndex,
838
768
  navStatus: toggleNavStatus(currentNavStatus)
839
769
  });
840
770
  dispatch({
841
- type: import_vuu_layout4.Action.LAYOUT_RESIZE,
771
+ type: import_vuu_layout5.Action.LAYOUT_RESIZE,
842
772
  path,
843
773
  size: toggleNavWidth(currentNavStatus)
844
774
  });
@@ -894,7 +824,7 @@ var LeftNav = ({
894
824
  }
895
825
  ),
896
826
  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
897
- import_vuu_layout4.Stack,
827
+ import_vuu_layout5.Stack,
898
828
  {
899
829
  active: navState.activeTabIndex - 1,
900
830
  className: `${classBase5}-menu-secondary`,
@@ -913,7 +843,7 @@ var LeftNav = ({
913
843
  };
914
844
 
915
845
  // src/login/LoginPanel.tsx
916
- var import_react11 = require("react");
846
+ var import_react10 = require("react");
917
847
  var import_core2 = require("@salt-ds/core");
918
848
  var import_jsx_runtime13 = require("react/jsx-runtime");
919
849
  var classBase6 = "vuuLoginPanel";
@@ -921,8 +851,8 @@ var LoginPanel = ({
921
851
  requirePassword = true,
922
852
  onSubmit
923
853
  }) => {
924
- const [username, setUserName] = (0, import_react11.useState)("");
925
- const [password, setPassword] = (0, import_react11.useState)("");
854
+ const [username, setUserName] = (0, import_react10.useState)("");
855
+ const [password, setPassword] = (0, import_react10.useState)("");
926
856
  const login = () => {
927
857
  onSubmit(username, password);
928
858
  };
@@ -966,14 +896,14 @@ var LoginPanel = ({
966
896
  };
967
897
 
968
898
  // src/login/login-utils.ts
969
- var import_vuu_utils3 = require("@vuu-ui/vuu-utils");
899
+ var import_vuu_utils2 = require("@vuu-ui/vuu-utils");
970
900
  var getAuthModeFromCookies = () => {
971
- const mode = (0, import_vuu_utils3.getCookieValue)("vuu-auth-mode");
901
+ const mode = (0, import_vuu_utils2.getCookieValue)("vuu-auth-mode");
972
902
  return mode != null ? mode : "";
973
903
  };
974
904
  var getAuthDetailsFromCookies = () => {
975
- const username = (0, import_vuu_utils3.getCookieValue)("vuu-username");
976
- const token = (0, import_vuu_utils3.getCookieValue)("vuu-auth-token");
905
+ const username = (0, import_vuu_utils2.getCookieValue)("vuu-username");
906
+ const token = (0, import_vuu_utils2.getCookieValue)("vuu-auth-token");
977
907
  return [username, token];
978
908
  };
979
909
  var getDefaultLoginUrl = () => {
@@ -990,12 +920,12 @@ var logout = (loginUrl) => {
990
920
  };
991
921
 
992
922
  // src/session-editing-form/SessionEditingForm.tsx
993
- var import_react12 = require("react");
923
+ var import_react11 = require("react");
994
924
  var import_classnames5 = __toESM(require("classnames"));
995
925
  var import_core3 = require("@salt-ds/core");
996
926
  var import_core4 = require("@salt-ds/core");
997
927
  var import_vuu_data = require("@vuu-ui/vuu-data");
998
- var import_vuu_utils4 = require("@vuu-ui/vuu-utils");
928
+ var import_vuu_utils3 = require("@vuu-ui/vuu-utils");
999
929
  var import_jsx_runtime14 = require("react/jsx-runtime");
1000
930
  var classBase7 = "vuuSessionEditingForm";
1001
931
  var getField = (fields, name) => {
@@ -1027,7 +957,7 @@ function getTypedValue(value, type, throwIfUndefined = false) {
1027
957
  case "int":
1028
958
  case "long": {
1029
959
  const typedValue = parseInt(value, 10);
1030
- if ((0, import_vuu_utils4.isValidNumber)(typedValue)) {
960
+ if ((0, import_vuu_utils3.isValidNumber)(typedValue)) {
1031
961
  return typedValue;
1032
962
  } else if (throwIfUndefined) {
1033
963
  throw Error("SessionEditingForm getTypedValue");
@@ -1037,7 +967,7 @@ function getTypedValue(value, type, throwIfUndefined = false) {
1037
967
  }
1038
968
  case "double": {
1039
969
  const typedValue = parseFloat(value);
1040
- if ((0, import_vuu_utils4.isValidNumber)(typedValue)) {
970
+ if ((0, import_vuu_utils3.isValidNumber)(typedValue)) {
1041
971
  return typedValue;
1042
972
  }
1043
973
  return void 0;
@@ -1072,12 +1002,12 @@ var SessionEditingForm = ({
1072
1002
  schema,
1073
1003
  ...htmlAttributes
1074
1004
  }) => {
1075
- const [values, setValues] = (0, import_react12.useState)();
1076
- const [errorMessage, setErrorMessage] = (0, import_react12.useState)("");
1077
- const formContentRef = (0, import_react12.useRef)(null);
1078
- const initialDataRef = (0, import_react12.useRef)();
1079
- const dataStatusRef = (0, import_react12.useRef)(Status.uninitialised);
1080
- const dataSource = (0, import_react12.useMemo)(() => {
1005
+ const [values, setValues] = (0, import_react11.useState)();
1006
+ const [errorMessage, setErrorMessage] = (0, import_react11.useState)("");
1007
+ const formContentRef = (0, import_react11.useRef)(null);
1008
+ const initialDataRef = (0, import_react11.useRef)();
1009
+ const dataStatusRef = (0, import_react11.useRef)(Status.uninitialised);
1010
+ const dataSource = (0, import_react11.useMemo)(() => {
1081
1011
  const applyServerData = (data) => {
1082
1012
  if (columnMap) {
1083
1013
  const values2 = {};
@@ -1092,7 +1022,7 @@ var SessionEditingForm = ({
1092
1022
  }
1093
1023
  };
1094
1024
  const ds = getDataSource(dataSourceProp, schema);
1095
- const columnMap = (0, import_vuu_utils4.buildColumnMap)(ds.columns);
1025
+ const columnMap = (0, import_vuu_utils3.buildColumnMap)(ds.columns);
1096
1026
  ds.subscribe({ range: { from: 0, to: 5 } }, (message) => {
1097
1027
  if (message.type === "viewport-update" && message.rows) {
1098
1028
  if (dataStatusRef.current === Status.uninitialised) {
@@ -1105,7 +1035,7 @@ var SessionEditingForm = ({
1105
1035
  return ds;
1106
1036
  }, [dataSourceProp, schema]);
1107
1037
  const id = (0, import_core3.useIdMemo)(idProp);
1108
- const handleChange = (0, import_react12.useCallback)(
1038
+ const handleChange = (0, import_react11.useCallback)(
1109
1039
  (evt) => {
1110
1040
  const [field, value] = getFieldNameAndValue(evt);
1111
1041
  const { type } = getField(fields, field);
@@ -1115,14 +1045,14 @@ var SessionEditingForm = ({
1115
1045
  ...values2,
1116
1046
  [field]: typedValue
1117
1047
  };
1118
- const notUpdated = (0, import_vuu_utils4.shallowEquals)(newValues, initialDataRef.current);
1048
+ const notUpdated = (0, import_vuu_utils3.shallowEquals)(newValues, initialDataRef.current);
1119
1049
  dataStatusRef.current = notUpdated ? Status.unchanged : typedValue !== void 0 ? Status.changed : Status.invalid;
1120
1050
  return newValues;
1121
1051
  });
1122
1052
  },
1123
1053
  [fields]
1124
1054
  );
1125
- const handleBlur = (0, import_react12.useCallback)(
1055
+ const handleBlur = (0, import_react11.useCallback)(
1126
1056
  (evt) => {
1127
1057
  const [field, value] = getFieldNameAndValue(evt);
1128
1058
  const { type } = getField(fields, field);
@@ -1139,7 +1069,7 @@ var SessionEditingForm = ({
1139
1069
  },
1140
1070
  [dataSource, fields, keyField, values]
1141
1071
  );
1142
- const applyAction = (0, import_react12.useCallback)(
1072
+ const applyAction = (0, import_react11.useCallback)(
1143
1073
  (action) => {
1144
1074
  if (typeof action === "object" && action !== null) {
1145
1075
  if ("type" in action && action.type === "CLOSE_DIALOG_ACTION") {
@@ -1149,7 +1079,7 @@ var SessionEditingForm = ({
1149
1079
  },
1150
1080
  [onClose]
1151
1081
  );
1152
- const handleSubmit = (0, import_react12.useCallback)(async () => {
1082
+ const handleSubmit = (0, import_react11.useCallback)(async () => {
1153
1083
  const response = await dataSource.menuRpcCall({
1154
1084
  type: "VP_EDIT_SUBMIT_FORM_RPC"
1155
1085
  });
@@ -1159,7 +1089,7 @@ var SessionEditingForm = ({
1159
1089
  applyAction(response.action);
1160
1090
  }
1161
1091
  }, [applyAction, dataSource]);
1162
- const handleKeyDown = (0, import_react12.useCallback)(
1092
+ const handleKeyDown = (0, import_react11.useCallback)(
1163
1093
  (evt) => {
1164
1094
  if (evt.key === "Enter" && dataStatusRef.current === Status.changed) {
1165
1095
  handleSubmit();
@@ -1167,7 +1097,7 @@ var SessionEditingForm = ({
1167
1097
  },
1168
1098
  [handleSubmit]
1169
1099
  );
1170
- const handleCancel = (0, import_react12.useCallback)(() => {
1100
+ const handleCancel = (0, import_react11.useCallback)(() => {
1171
1101
  onClose();
1172
1102
  }, [onClose]);
1173
1103
  const getFormControl = (field) => {
@@ -1190,7 +1120,7 @@ var SessionEditingForm = ({
1190
1120
  );
1191
1121
  }
1192
1122
  };
1193
- (0, import_react12.useEffect)(() => {
1123
+ (0, import_react11.useEffect)(() => {
1194
1124
  if (formContentRef.current) {
1195
1125
  const firstInput = formContentRef.current.querySelector(
1196
1126
  "input"
@@ -1203,7 +1133,7 @@ var SessionEditingForm = ({
1203
1133
  }
1204
1134
  }
1205
1135
  }, []);
1206
- (0, import_react12.useEffect)(() => {
1136
+ (0, import_react11.useEffect)(() => {
1207
1137
  return () => {
1208
1138
  if (dataSource) {
1209
1139
  dataSource.unsubscribe();
@@ -1264,11 +1194,11 @@ var SessionEditingForm = ({
1264
1194
  // src/shell.tsx
1265
1195
  var import_vuu_data2 = require("@vuu-ui/vuu-data");
1266
1196
  var import_classnames9 = __toESM(require("classnames"));
1267
- var import_react18 = require("react");
1268
- var import_vuu_layout8 = require("@vuu-ui/vuu-layout");
1197
+ var import_react17 = require("react");
1198
+ var import_vuu_layout9 = require("@vuu-ui/vuu-layout");
1269
1199
 
1270
1200
  // src/app-header/AppHeader.tsx
1271
- var import_react15 = require("react");
1201
+ var import_react14 = require("react");
1272
1202
 
1273
1203
  // src/user-profile/UserProfile.tsx
1274
1204
  var import_core6 = require("@salt-ds/core");
@@ -1276,11 +1206,11 @@ var import_lab3 = require("@salt-ds/lab");
1276
1206
  var import_icons2 = require("@salt-ds/icons");
1277
1207
 
1278
1208
  // src/user-profile/UserPanel.tsx
1279
- var import_vuu_utils5 = require("@vuu-ui/vuu-utils");
1209
+ var import_vuu_utils4 = require("@vuu-ui/vuu-utils");
1280
1210
  var import_lab2 = require("@salt-ds/lab");
1281
1211
  var import_core5 = require("@salt-ds/core");
1282
1212
  var import_icons = require("@salt-ds/icons");
1283
- var import_react13 = require("react");
1213
+ var import_react12 = require("react");
1284
1214
 
1285
1215
  // src/get-layout-history.ts
1286
1216
  var getLayoutHistory = async (user) => {
@@ -1300,22 +1230,22 @@ var byLastUpdate = ({ lastUpdate: l1 }, { lastUpdate: l2 }) => {
1300
1230
  var HistoryListItem = (props) => {
1301
1231
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lab2.ListItem, { ...props });
1302
1232
  };
1303
- var UserPanel = (0, import_react13.forwardRef)(function UserPanel2({ loginUrl, onNavigate, user, layoutId = "latest" }, forwardedRef) {
1304
- const [history, setHistory] = (0, import_react13.useState)([]);
1305
- (0, import_react13.useEffect)(() => {
1233
+ var UserPanel = (0, import_react12.forwardRef)(function UserPanel2({ loginUrl, onNavigate, user, layoutId = "latest" }, forwardedRef) {
1234
+ const [history, setHistory] = (0, import_react12.useState)([]);
1235
+ (0, import_react12.useEffect)(() => {
1306
1236
  async function getHistory() {
1307
1237
  const history2 = await getLayoutHistory(user);
1308
1238
  const sortedHistory = history2.filter((item) => item.id !== "latest").sort(byLastUpdate).map(({ id, lastUpdate }) => ({
1309
1239
  lastUpdate,
1310
1240
  id,
1311
- label: `Saved at ${(0, import_vuu_utils5.formatDate)(new Date(lastUpdate), "kk:mm:ss")}`
1241
+ label: `Saved at ${(0, import_vuu_utils4.formatDate)(new Date(lastUpdate), "kk:mm:ss")}`
1312
1242
  }));
1313
1243
  console.log({ sortedHistory });
1314
1244
  setHistory(sortedHistory);
1315
1245
  }
1316
1246
  getHistory();
1317
1247
  }, [user]);
1318
- const handleHisorySelected = (0, import_react13.useCallback)(
1248
+ const handleHisorySelected = (0, import_react12.useCallback)(
1319
1249
  (evt, selected2) => {
1320
1250
  if (selected2) {
1321
1251
  onNavigate(selected2.id);
@@ -1323,7 +1253,7 @@ var UserPanel = (0, import_react13.forwardRef)(function UserPanel2({ loginUrl, o
1323
1253
  },
1324
1254
  [onNavigate]
1325
1255
  );
1326
- const handleLogout = (0, import_react13.useCallback)(() => {
1256
+ const handleLogout = (0, import_react12.useCallback)(() => {
1327
1257
  logout(loginUrl);
1328
1258
  }, [loginUrl]);
1329
1259
  const selected = history.length === 0 ? null : layoutId === "latest" ? history[0] : history.find((i) => i.id === layoutId);
@@ -1373,7 +1303,7 @@ var UserProfile = ({
1373
1303
  // src/theme-switch/ThemeSwitch.tsx
1374
1304
  var import_classnames6 = __toESM(require("classnames"));
1375
1305
  var import_core7 = require("@salt-ds/core");
1376
- var import_react14 = require("react");
1306
+ var import_react13 = require("react");
1377
1307
  var import_jsx_runtime17 = require("react/jsx-runtime");
1378
1308
  var classBase8 = "vuuThemeSwitch";
1379
1309
  var ThemeSwitch = ({
@@ -1389,7 +1319,7 @@ var ThemeSwitch = ({
1389
1319
  name: "ThemeSwitch",
1390
1320
  state: "mode"
1391
1321
  });
1392
- const handleChangeSecondary = (0, import_react14.useCallback)(
1322
+ const handleChangeSecondary = (0, import_react13.useCallback)(
1393
1323
  (evt) => {
1394
1324
  const { value } = evt.target;
1395
1325
  setMode(value);
@@ -1428,7 +1358,7 @@ var AppHeader = ({
1428
1358
  ...htmlAttributes
1429
1359
  }) => {
1430
1360
  const className = (0, import_classnames7.default)(classBase9, classNameProp);
1431
- const handleSwitchTheme = (0, import_react15.useCallback)(
1361
+ const handleSwitchTheme = (0, import_react14.useCallback)(
1432
1362
  (mode) => onSwitchTheme == null ? void 0 : onSwitchTheme(mode),
1433
1363
  [onSwitchTheme]
1434
1364
  );
@@ -1447,13 +1377,13 @@ var AppHeader = ({
1447
1377
  };
1448
1378
 
1449
1379
  // src/shell.tsx
1450
- var import_vuu_utils6 = require("@vuu-ui/vuu-utils");
1380
+ var import_vuu_utils5 = require("@vuu-ui/vuu-utils");
1451
1381
 
1452
1382
  // src/shell-layouts/context-panel/ContextPanel.tsx
1453
1383
  var import_core8 = require("@salt-ds/core");
1454
1384
  var import_classnames8 = __toESM(require("classnames"));
1455
- var import_react16 = require("react");
1456
- var import_vuu_layout5 = require("@vuu-ui/vuu-layout");
1385
+ var import_react15 = require("react");
1386
+ var import_vuu_layout6 = require("@vuu-ui/vuu-layout");
1457
1387
  var import_jsx_runtime19 = require("react/jsx-runtime");
1458
1388
  var classBase10 = "vuuContextPanel";
1459
1389
  var ContextPanel = ({
@@ -1463,8 +1393,8 @@ var ContextPanel = ({
1463
1393
  overlay = false,
1464
1394
  title
1465
1395
  }) => {
1466
- const dispatchLayoutAction = (0, import_vuu_layout5.useLayoutProviderDispatch)();
1467
- const handleClose = (0, import_react16.useCallback)(() => {
1396
+ const dispatchLayoutAction = (0, import_vuu_layout6.useLayoutProviderDispatch)();
1397
+ const handleClose = (0, import_react15.useCallback)(() => {
1468
1398
  dispatchLayoutAction({
1469
1399
  path: "#context-panel",
1470
1400
  propName: "expanded",
@@ -1477,8 +1407,8 @@ var ContextPanel = ({
1477
1407
  [`${classBase10}-inline`]: overlay !== true,
1478
1408
  [`${classBase10}-overlay`]: overlay
1479
1409
  });
1480
- const content = (0, import_react16.useMemo)(
1481
- () => contentProp ? (0, import_vuu_layout5.layoutFromJson)(contentProp, "context-0") : null,
1410
+ const content = (0, import_react15.useMemo)(
1411
+ () => contentProp ? (0, import_vuu_layout6.layoutFromJson)(contentProp, "context-0") : null,
1482
1412
  [contentProp]
1483
1413
  );
1484
1414
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: (0, import_classnames8.default)(classBase10, className), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: `${classBase10}-inner`, children: [
@@ -1499,14 +1429,14 @@ var ContextPanel = ({
1499
1429
  };
1500
1430
 
1501
1431
  // src/shell-layouts/useFullHeightLeftPanel.tsx
1502
- var import_vuu_layout6 = require("@vuu-ui/vuu-layout");
1432
+ var import_vuu_layout7 = require("@vuu-ui/vuu-layout");
1503
1433
  var import_jsx_runtime20 = require("react/jsx-runtime");
1504
1434
  var useFullHeightLeftPanel = ({
1505
1435
  appHeader,
1506
1436
  leftSidePanel
1507
1437
  }) => {
1508
1438
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1509
- import_vuu_layout6.Flexbox,
1439
+ import_vuu_layout7.Flexbox,
1510
1440
  {
1511
1441
  className: "App",
1512
1442
  style: {
@@ -1517,13 +1447,13 @@ var useFullHeightLeftPanel = ({
1517
1447
  children: [
1518
1448
  leftSidePanel,
1519
1449
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1520
- import_vuu_layout6.Flexbox,
1450
+ import_vuu_layout7.Flexbox,
1521
1451
  {
1522
1452
  className: "vuuShell-content",
1523
1453
  style: { flex: 1, flexDirection: "column" },
1524
1454
  children: [
1525
1455
  appHeader,
1526
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_vuu_layout6.DraggableLayout, { dropTarget: true, style: { flex: 1 } }, "main-content")
1456
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_vuu_layout7.DraggableLayout, { dropTarget: true, style: { flex: 1 } }, "main-content")
1527
1457
  ]
1528
1458
  }
1529
1459
  ),
@@ -1541,16 +1471,16 @@ var useFullHeightLeftPanel = ({
1541
1471
  };
1542
1472
 
1543
1473
  // src/shell-layouts/useInlayLeftPanel.tsx
1544
- var import_vuu_layout7 = require("@vuu-ui/vuu-layout");
1545
- var import_react17 = require("react");
1474
+ var import_vuu_layout8 = require("@vuu-ui/vuu-layout");
1475
+ var import_react16 = require("react");
1546
1476
  var import_jsx_runtime21 = require("react/jsx-runtime");
1547
1477
  var useInlayLeftPanel = ({
1548
1478
  appHeader,
1549
1479
  leftSidePanel
1550
1480
  }) => {
1551
- const paletteView = (0, import_react17.useRef)(null);
1552
- const [open, setOpen] = (0, import_react17.useState)(true);
1553
- const handleDrawerClick = (0, import_react17.useCallback)(
1481
+ const paletteView = (0, import_react16.useRef)(null);
1482
+ const [open, setOpen] = (0, import_react16.useState)(true);
1483
+ const handleDrawerClick = (0, import_react16.useCallback)(
1554
1484
  (e) => {
1555
1485
  var _a;
1556
1486
  const target = e.target;
@@ -1560,12 +1490,12 @@ var useInlayLeftPanel = ({
1560
1490
  },
1561
1491
  [open]
1562
1492
  );
1563
- const getDrawers = (0, import_react17.useCallback)(
1493
+ const getDrawers = (0, import_react16.useCallback)(
1564
1494
  (leftSidePanel2) => {
1565
1495
  const drawers = [];
1566
1496
  drawers.push(
1567
1497
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1568
- import_vuu_layout7.Drawer,
1498
+ import_vuu_layout8.Drawer,
1569
1499
  {
1570
1500
  onClick: handleDrawerClick,
1571
1501
  open,
@@ -1575,7 +1505,7 @@ var useInlayLeftPanel = ({
1575
1505
  sizeOpen: 200,
1576
1506
  toggleButton: "end",
1577
1507
  children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1578
- import_vuu_layout7.View,
1508
+ import_vuu_layout8.View,
1579
1509
  {
1580
1510
  className: "vuuShell-palette",
1581
1511
  id: "vw-app-palette",
@@ -1594,15 +1524,15 @@ var useInlayLeftPanel = ({
1594
1524
  [handleDrawerClick, open]
1595
1525
  );
1596
1526
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
1597
- import_vuu_layout7.Flexbox,
1527
+ import_vuu_layout8.Flexbox,
1598
1528
  {
1599
1529
  className: "App",
1600
1530
  style: { flexDirection: "column", height: "100%", width: "100%" },
1601
1531
  children: [
1602
1532
  appHeader,
1603
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_vuu_layout7.DockLayout, { style: { flex: 1 }, children: getDrawers(leftSidePanel).concat(
1533
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_vuu_layout8.DockLayout, { style: { flex: 1 }, children: getDrawers(leftSidePanel).concat(
1604
1534
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1605
- import_vuu_layout7.DraggableLayout,
1535
+ import_vuu_layout8.DraggableLayout,
1606
1536
  {
1607
1537
  dropTarget: true,
1608
1538
  style: { width: "100%", height: "100%" }
@@ -1626,26 +1556,11 @@ var useShellLayout = ({
1626
1556
 
1627
1557
  // src/shell.tsx
1628
1558
  var import_jsx_runtime22 = require("react/jsx-runtime");
1629
- var { error } = (0, import_vuu_utils6.logger)("Shell");
1630
- var warningLayout = {
1631
- type: "View",
1632
- props: {
1633
- style: { height: "calc(100% - 6px)" }
1634
- },
1635
- children: [
1636
- {
1637
- props: {
1638
- className: "vuuShell-warningPlaceholder"
1639
- },
1640
- type: "Placeholder"
1641
- }
1642
- ]
1643
- };
1559
+ var { error } = (0, import_vuu_utils5.logger)("Shell");
1644
1560
  var Shell = ({
1645
1561
  LayoutProps,
1646
1562
  children,
1647
1563
  className: classNameProp,
1648
- defaultLayout = warningLayout,
1649
1564
  leftSidePanel,
1650
1565
  leftSidePanelLayout,
1651
1566
  loginUrl,
@@ -1655,38 +1570,33 @@ var Shell = ({
1655
1570
  user,
1656
1571
  ...htmlAttributes
1657
1572
  }) => {
1658
- const rootRef = (0, import_react18.useRef)(null);
1659
- const layoutId = (0, import_react18.useRef)("latest");
1660
- const [layout, saveLayoutConfig, loadLayoutById] = useLayoutConfig({
1661
- defaultLayout,
1662
- saveLocation,
1663
- saveUrl,
1664
- user
1665
- });
1666
- const handleLayoutChange = (0, import_react18.useCallback)(
1667
- (layout2, layoutChangeReason) => {
1573
+ const rootRef = (0, import_react17.useRef)(null);
1574
+ const layoutId = (0, import_react17.useRef)("latest");
1575
+ const { applicationLayout, saveApplicationLayout, loadLayoutById } = useLayoutManager();
1576
+ const handleLayoutChange = (0, import_react17.useCallback)(
1577
+ (layout, layoutChangeReason) => {
1668
1578
  try {
1579
+ saveApplicationLayout(layout);
1669
1580
  console.log(`handle layout changed ${layoutChangeReason}`);
1670
- saveLayoutConfig(layout2);
1671
1581
  } catch {
1672
1582
  error == null ? void 0 : error("Failed to save layout");
1673
1583
  }
1674
1584
  },
1675
- [saveLayoutConfig]
1585
+ [saveApplicationLayout]
1676
1586
  );
1677
- const handleSwitchTheme = (0, import_react18.useCallback)((mode) => {
1587
+ const handleSwitchTheme = (0, import_react17.useCallback)((mode) => {
1678
1588
  if (rootRef.current) {
1679
1589
  rootRef.current.dataset.mode = mode;
1680
1590
  }
1681
1591
  }, []);
1682
- const handleNavigate = (0, import_react18.useCallback)(
1592
+ const handleNavigate = (0, import_react17.useCallback)(
1683
1593
  (id) => {
1684
1594
  layoutId.current = id;
1685
1595
  loadLayoutById(id);
1686
1596
  },
1687
1597
  [loadLayoutById]
1688
1598
  );
1689
- (0, import_react18.useEffect)(() => {
1599
+ (0, import_react17.useEffect)(() => {
1690
1600
  if (serverUrl && user.token) {
1691
1601
  (0, import_vuu_data2.connectToServer)({
1692
1602
  authToken: user.token,
@@ -1713,13 +1623,13 @@ var Shell = ({
1713
1623
  });
1714
1624
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(ThemeProvider, { children: [
1715
1625
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1716
- import_vuu_layout8.LayoutProvider,
1626
+ import_vuu_layout9.LayoutProvider,
1717
1627
  {
1718
1628
  ...LayoutProps,
1719
- layout,
1629
+ layout: applicationLayout,
1720
1630
  onLayoutChange: handleLayoutChange,
1721
1631
  children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1722
- import_vuu_layout8.DraggableLayout,
1632
+ import_vuu_layout9.DraggableLayout,
1723
1633
  {
1724
1634
  className,
1725
1635
  "data-mode": dataMode,
@@ -1735,10 +1645,10 @@ var Shell = ({
1735
1645
  };
1736
1646
 
1737
1647
  // src/ShellContextProvider.tsx
1738
- var import_react19 = require("react");
1648
+ var import_react18 = require("react");
1739
1649
  var import_jsx_runtime23 = require("react/jsx-runtime");
1740
1650
  var defaultConfig = {};
1741
- var ShellContext = (0, import_react19.createContext)(defaultConfig);
1651
+ var ShellContext = (0, import_react18.createContext)(defaultConfig);
1742
1652
  var Provider = ({
1743
1653
  children,
1744
1654
  context,
@@ -1757,6 +1667,6 @@ var ShellContextProvider = ({
1757
1667
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ShellContext.Consumer, { children: (context) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Provider, { context: value, inheritedContext: context, children }) });
1758
1668
  };
1759
1669
  var useShellContext = () => {
1760
- return (0, import_react19.useContext)(ShellContext);
1670
+ return (0, import_react18.useContext)(ShellContext);
1761
1671
  };
1762
1672
  //# sourceMappingURL=index.js.map