@vuu-ui/vuu-shell 0.8.22-debug → 0.8.23-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/esm/index.js CHANGED
@@ -19,7 +19,7 @@ var __privateSet = (obj, member, value, setter) => {
19
19
 
20
20
  // src/app-header/AppHeader.tsx
21
21
  import { useCallback as useCallback2 } from "react";
22
- import { Toolbar } from "@vuu-ui/vuu-layout";
22
+ import { Toolbar } from "@vuu-ui/vuu-ui-controls";
23
23
  import cx2 from "clsx";
24
24
 
25
25
  // src/login/LoginPanel.tsx
@@ -288,7 +288,7 @@ var AppHeader = ({
288
288
  loginUrl,
289
289
  onNavigate,
290
290
  onSwitchTheme,
291
- themeMode = "light",
291
+ themeMode: _,
292
292
  user,
293
293
  ...htmlAttributes
294
294
  }) => {
@@ -1375,7 +1375,8 @@ import React5, {
1375
1375
  useState as useState7
1376
1376
  } from "react";
1377
1377
  import {
1378
- resolveJSONPath
1378
+ resolveJSONPath,
1379
+ isLayoutJSON
1379
1380
  } from "@vuu-ui/vuu-layout";
1380
1381
 
1381
1382
  // ../vuu-popups/src/dialog/Dialog.tsx
@@ -1411,8 +1412,11 @@ var DialogHeader = ({
1411
1412
 
1412
1413
  // ../vuu-popups/src/popup/useAnchoredPosition.ts
1413
1414
  import { useCallback as useCallback3, useLayoutEffect, useRef as useRef2, useState as useState4 } from "react";
1415
+
1416
+ // ../vuu-popups/src/popup/getPositionRelativeToAnchor.ts
1414
1417
  var getPositionRelativeToAnchor = (anchorElement, placement, offsetLeft, offsetTop, minWidth, dimensions) => {
1415
1418
  const { bottom, height, left, right, top, width } = anchorElement.getBoundingClientRect();
1419
+ console.log({ top });
1416
1420
  switch (placement) {
1417
1421
  case "below":
1418
1422
  return { left: left + offsetLeft, top: bottom + offsetTop };
@@ -1445,10 +1449,12 @@ var getPositionRelativeToAnchor = (anchorElement, placement, offsetLeft, offsetT
1445
1449
  }
1446
1450
  default:
1447
1451
  throw Error(
1448
- "Popup getPositionRelativeToAnchor only supported placement values are below and right"
1452
+ `Popup getPositionRelativeToAnchor non-supported placement value ${placement}`
1449
1453
  );
1450
1454
  }
1451
1455
  };
1456
+
1457
+ // ../vuu-popups/src/popup/useAnchoredPosition.ts
1452
1458
  var useAnchoredPosition = ({
1453
1459
  anchorElement,
1454
1460
  minWidth,
@@ -1524,7 +1530,7 @@ var Dialog = ({
1524
1530
  } = PopupProps;
1525
1531
  const rootRef = useRef3(null);
1526
1532
  const portalRef = useRef3(null);
1527
- const [themeClass, densityClass, dataMode] = useThemeAttributes();
1533
+ const [themeClass, _, dataMode] = useThemeAttributes();
1528
1534
  const { position } = useAnchoredPosition({
1529
1535
  anchorElement,
1530
1536
  offsetLeft,
@@ -2036,8 +2042,12 @@ var LayoutManagementProvider = (props) => {
2036
2042
  }, [notify, setApplicationJSON]);
2037
2043
  const saveApplicationLayout = useCallback9(
2038
2044
  (layout) => {
2039
- setApplicationLayout(layout, false);
2040
- getPersistenceManager().saveApplicationJSON(applicationJSONRef.current);
2045
+ if (isLayoutJSON(layout)) {
2046
+ setApplicationLayout(layout, false);
2047
+ getPersistenceManager().saveApplicationJSON(applicationJSONRef.current);
2048
+ } else {
2049
+ console.error("Tried to save invalid application layout", layout);
2050
+ }
2041
2051
  },
2042
2052
  [setApplicationLayout]
2043
2053
  );
@@ -2047,7 +2057,7 @@ var LayoutManagementProvider = (props) => {
2047
2057
  applicationJSONRef.current.layout,
2048
2058
  "#main-tabs.ACTIVE_CHILD"
2049
2059
  );
2050
- if (layoutToSave) {
2060
+ if (layoutToSave && isLayoutJSON(layoutToSave)) {
2051
2061
  getPersistenceManager().createLayout(metadata, ensureLayoutHasTitle(layoutToSave, metadata)).then((metadata2) => {
2052
2062
  notify({
2053
2063
  type: "success" /* Success */,
@@ -2064,10 +2074,11 @@ var LayoutManagementProvider = (props) => {
2064
2074
  console.error("Error occurred while saving layout", error2);
2065
2075
  });
2066
2076
  } else {
2077
+ console.error("Tried to save invalid layout", layoutToSave);
2067
2078
  notify({
2068
2079
  type: "error" /* Error */,
2069
2080
  header: "Failed to Save Layout",
2070
- body: "Cannot save undefined layout"
2081
+ body: "Cannot save invalid layout"
2071
2082
  });
2072
2083
  }
2073
2084
  },
@@ -2936,7 +2947,7 @@ var Shell = ({
2936
2947
  className: classNameProp,
2937
2948
  leftSidePanelLayout,
2938
2949
  loginUrl,
2939
- saveLocation = "remote",
2950
+ saveLocation: _,
2940
2951
  saveUrl,
2941
2952
  serverUrl,
2942
2953
  user,