@vuu-ui/vuu-shell 0.8.28-debug → 0.8.29-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
@@ -1716,13 +1716,22 @@ var ContextMenuProvider = ({
1716
1716
 
1717
1717
  // ../vuu-popups/src/notifications/NotificationsProvider.tsx
1718
1718
  var import_react12 = __toESM(require("react"));
1719
- var import_clsx6 = __toESM(require("clsx"));
1720
- var import_vuu_utils3 = require("@vuu-ui/vuu-utils");
1721
1719
  var import_jsx_runtime13 = require("react/jsx-runtime");
1722
- var NotificationsContext = import_react12.default.createContext({
1723
- notify: () => "have you forgotten to provide a NotificationProvider?"
1724
- });
1725
- var useNotifications = () => (0, import_react12.useContext)(NotificationsContext);
1720
+ var NotificationsContextObject = class {
1721
+ constructor() {
1722
+ this.notify = () => "have you forgotten to provide a NotificationsCenter?";
1723
+ this.setNotify = (dispatcher) => {
1724
+ this.notify = dispatcher;
1725
+ };
1726
+ }
1727
+ };
1728
+ var NotificationsContext = import_react12.default.createContext(
1729
+ new NotificationsContextObject()
1730
+ );
1731
+ var useNotifications = () => {
1732
+ const { notify } = (0, import_react12.useContext)(NotificationsContext);
1733
+ return notify;
1734
+ };
1726
1735
 
1727
1736
  // src/persistence-management/defaultApplicationJson.ts
1728
1737
  var loadingApplicationJson = {
@@ -1764,7 +1773,7 @@ var defaultApplicationJson = {
1764
1773
 
1765
1774
  // src/persistence-management/LocalPersistenceManager.ts
1766
1775
  var import_vuu_filters = require("@vuu-ui/vuu-filters");
1767
- var import_vuu_utils4 = require("@vuu-ui/vuu-utils");
1776
+ var import_vuu_utils3 = require("@vuu-ui/vuu-utils");
1768
1777
  var baseMetadataSaveLocation = "layouts/metadata";
1769
1778
  var baseLayoutsSaveLocation = "layouts/layouts";
1770
1779
  var _urlKey;
@@ -1827,11 +1836,11 @@ var LocalPersistenceManager = class {
1827
1836
  return new Promise((resolve) => {
1828
1837
  Promise.all([this.loadLayouts(), this.loadMetadata()]).then(
1829
1838
  ([existingLayouts, existingMetadata]) => {
1830
- const id = (0, import_vuu_utils4.getUniqueId)();
1839
+ const id = (0, import_vuu_utils3.getUniqueId)();
1831
1840
  const newMetadata = {
1832
1841
  ...metadata,
1833
1842
  id,
1834
- created: (0, import_vuu_utils4.formatDate)({ date: "dd.mm.yyyy" })(/* @__PURE__ */ new Date())
1843
+ created: (0, import_vuu_utils3.formatDate)({ date: "dd.mm.yyyy" })(/* @__PURE__ */ new Date())
1835
1844
  };
1836
1845
  this.saveLayoutsWithMetadata(
1837
1846
  [...existingLayouts, { id, json: layout }],
@@ -2019,7 +2028,7 @@ var ensureLayoutHasTitle = (layout, layoutMetadata) => {
2019
2028
  var LayoutManagementProvider = (props) => {
2020
2029
  const [layoutMetadata, setLayoutMetadata] = (0, import_react14.useState)([]);
2021
2030
  const [, forceRefresh] = (0, import_react14.useState)({});
2022
- const { notify } = useNotifications();
2031
+ const notify = useNotifications();
2023
2032
  const applicationJSONRef = (0, import_react14.useRef)(loadingApplicationJson);
2024
2033
  const setApplicationJSON = (0, import_react14.useCallback)(
2025
2034
  (applicationJSON, rerender = true) => {
@@ -2063,7 +2072,7 @@ var LayoutManagementProvider = (props) => {
2063
2072
  setLayoutMetadata(metadata);
2064
2073
  }).catch((error2) => {
2065
2074
  notify({
2066
- type: "error" /* Error */,
2075
+ type: "error",
2067
2076
  header: "Failed to Load Layouts",
2068
2077
  body: "Could not load list of available layouts"
2069
2078
  });
@@ -2073,7 +2082,7 @@ var LayoutManagementProvider = (props) => {
2073
2082
  setApplicationJSON(applicationJSON);
2074
2083
  }).catch((error2) => {
2075
2084
  notify({
2076
- type: "error" /* Error */,
2085
+ type: "error",
2077
2086
  header: "Failed to Load Layout",
2078
2087
  body: "Could not load your latest view"
2079
2088
  });
@@ -2103,14 +2112,14 @@ var LayoutManagementProvider = (props) => {
2103
2112
  if (layoutToSave && (0, import_vuu_layout2.isLayoutJSON)(layoutToSave)) {
2104
2113
  getPersistenceManager().createLayout(metadata, ensureLayoutHasTitle(layoutToSave, metadata)).then((metadata2) => {
2105
2114
  notify({
2106
- type: "success" /* Success */,
2115
+ type: "success",
2107
2116
  header: "Layout Saved Successfully",
2108
2117
  body: `${metadata2.name} saved successfully`
2109
2118
  });
2110
2119
  setLayoutMetadata((prev) => [...prev, metadata2]);
2111
2120
  }).catch((error2) => {
2112
2121
  notify({
2113
- type: "error" /* Error */,
2122
+ type: "error",
2114
2123
  header: "Failed to Save Layout",
2115
2124
  body: `Failed to save layout ${metadata.name}`
2116
2125
  });
@@ -2119,7 +2128,7 @@ var LayoutManagementProvider = (props) => {
2119
2128
  } else {
2120
2129
  console.error("Tried to save invalid layout", layoutToSave);
2121
2130
  notify({
2122
- type: "error" /* Error */,
2131
+ type: "error",
2123
2132
  header: "Failed to Save Layout",
2124
2133
  body: "Cannot save invalid layout"
2125
2134
  });
@@ -2164,7 +2173,7 @@ var LayoutManagementProvider = (props) => {
2164
2173
  });
2165
2174
  }).catch((error2) => {
2166
2175
  notify({
2167
- type: "error" /* Error */,
2176
+ type: "error",
2168
2177
  header: "Failed to Load Layout",
2169
2178
  body: "Failed to load the requested layout"
2170
2179
  });
@@ -2277,8 +2286,8 @@ var LayoutList = (props) => {
2277
2286
  var import_vuu_icons = require("@vuu-ui/vuu-icons");
2278
2287
  var import_vuu_layout4 = require("@vuu-ui/vuu-layout");
2279
2288
  var import_vuu_ui_controls5 = require("@vuu-ui/vuu-ui-controls");
2280
- var import_vuu_utils5 = require("@vuu-ui/vuu-utils");
2281
- var import_clsx7 = __toESM(require("clsx"));
2289
+ var import_vuu_utils4 = require("@vuu-ui/vuu-utils");
2290
+ var import_clsx6 = __toESM(require("clsx"));
2282
2291
  var import_react15 = require("react");
2283
2292
 
2284
2293
  // src/feature-list/FeatureList.tsx
@@ -2331,7 +2340,7 @@ var getDisplayStatus = (activeTabIndex, expanded) => {
2331
2340
  };
2332
2341
  var LeftNav = (props) => {
2333
2342
  const dispatch = (0, import_vuu_layout4.useLayoutProviderDispatch)();
2334
- const [themeClass] = (0, import_vuu_utils5.useThemeAttributes)();
2343
+ const [themeClass] = (0, import_vuu_utils4.useThemeAttributes)();
2335
2344
  const {
2336
2345
  "data-path": path,
2337
2346
  defaultExpanded = true,
@@ -2403,13 +2412,13 @@ var LeftNav = (props) => {
2403
2412
  "div",
2404
2413
  {
2405
2414
  ...htmlAttributes,
2406
- className: (0, import_clsx7.default)(classBase9, `${classBase9}-${displayStatus}`),
2415
+ className: (0, import_clsx6.default)(classBase9, `${classBase9}-${displayStatus}`),
2407
2416
  style,
2408
2417
  children: [
2409
2418
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2410
2419
  "div",
2411
2420
  {
2412
- className: (0, import_clsx7.default)(`${classBase9}-menu-primary`, themeClass),
2421
+ className: (0, import_clsx6.default)(`${classBase9}-menu-primary`, themeClass),
2413
2422
  "data-mode": "dark",
2414
2423
  children: [
2415
2424
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "vuuLeftNav-logo", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_vuu_icons.VuuLogo, {}) }),
@@ -2432,7 +2441,7 @@ var LeftNav = (props) => {
2432
2441
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "vuuLeftNav-buttonBar", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2433
2442
  "button",
2434
2443
  {
2435
- className: (0, import_clsx7.default)("vuuLeftNav-toggleButton", {
2444
+ className: (0, import_clsx6.default)("vuuLeftNav-toggleButton", {
2436
2445
  "vuuLeftNav-toggleButton-open": displayStatus.startsWith("menu-full"),
2437
2446
  "vuuLeftNav-toggleButton-closed": displayStatus.startsWith("menu-icons")
2438
2447
  }),
@@ -2463,9 +2472,9 @@ var LeftNav = (props) => {
2463
2472
 
2464
2473
  // src/session-editing-form/SessionEditingForm.tsx
2465
2474
  var import_vuu_data_remote = require("@vuu-ui/vuu-data-remote");
2466
- var import_vuu_utils6 = require("@vuu-ui/vuu-utils");
2475
+ var import_vuu_utils5 = require("@vuu-ui/vuu-utils");
2467
2476
  var import_core5 = require("@salt-ds/core");
2468
- var import_clsx8 = __toESM(require("clsx"));
2477
+ var import_clsx7 = __toESM(require("clsx"));
2469
2478
  var import_react16 = require("react");
2470
2479
  var import_jsx_runtime20 = require("react/jsx-runtime");
2471
2480
  var classBase10 = "vuuSessionEditingForm";
@@ -2498,7 +2507,7 @@ function getTypedValue(value, type, throwIfUndefined = false) {
2498
2507
  case "int":
2499
2508
  case "long": {
2500
2509
  const typedValue = parseInt(value, 10);
2501
- if ((0, import_vuu_utils6.isValidNumber)(typedValue)) {
2510
+ if ((0, import_vuu_utils5.isValidNumber)(typedValue)) {
2502
2511
  return typedValue;
2503
2512
  } else if (throwIfUndefined) {
2504
2513
  throw Error("SessionEditingForm getTypedValue");
@@ -2508,7 +2517,7 @@ function getTypedValue(value, type, throwIfUndefined = false) {
2508
2517
  }
2509
2518
  case "double": {
2510
2519
  const typedValue = parseFloat(value);
2511
- if ((0, import_vuu_utils6.isValidNumber)(typedValue)) {
2520
+ if ((0, import_vuu_utils5.isValidNumber)(typedValue)) {
2512
2521
  return typedValue;
2513
2522
  }
2514
2523
  return void 0;
@@ -2563,7 +2572,7 @@ var SessionEditingForm = ({
2563
2572
  }
2564
2573
  };
2565
2574
  const ds = getDataSource(dataSourceProp, schema);
2566
- const columnMap = (0, import_vuu_utils6.buildColumnMap)(ds.columns);
2575
+ const columnMap = (0, import_vuu_utils5.buildColumnMap)(ds.columns);
2567
2576
  ds.subscribe({ range: { from: 0, to: 5 } }, (message) => {
2568
2577
  if (message.type === "viewport-update" && message.rows) {
2569
2578
  if (dataStatusRef.current === Status.uninitialised) {
@@ -2586,7 +2595,7 @@ var SessionEditingForm = ({
2586
2595
  ...values2,
2587
2596
  [field]: typedValue
2588
2597
  };
2589
- const notUpdated = (0, import_vuu_utils6.shallowEquals)(newValues, initialDataRef.current);
2598
+ const notUpdated = (0, import_vuu_utils5.shallowEquals)(newValues, initialDataRef.current);
2590
2599
  dataStatusRef.current = notUpdated ? Status.unchanged : typedValue !== void 0 ? Status.changed : Status.invalid;
2591
2600
  return newValues;
2592
2601
  });
@@ -2624,9 +2633,9 @@ var SessionEditingForm = ({
2624
2633
  const response = await dataSource.menuRpcCall({
2625
2634
  type: "VP_EDIT_SUBMIT_FORM_RPC"
2626
2635
  });
2627
- if ((0, import_vuu_utils6.isErrorResponse)(response)) {
2636
+ if ((0, import_vuu_utils5.isErrorResponse)(response)) {
2628
2637
  setErrorMessage(response.error);
2629
- } else if ((0, import_vuu_utils6.hasAction)(response)) {
2638
+ } else if ((0, import_vuu_utils5.hasAction)(response)) {
2630
2639
  applyAction(response.action);
2631
2640
  }
2632
2641
  }, [applyAction, dataSource]);
@@ -2682,7 +2691,7 @@ var SessionEditingForm = ({
2682
2691
  };
2683
2692
  }, [dataSource]);
2684
2693
  const isDirty = dataStatusRef.current === Status.changed;
2685
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { ...htmlAttributes, className: (0, import_clsx8.default)(classBase10, className), children: [
2694
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { ...htmlAttributes, className: (0, import_clsx7.default)(classBase10, className), children: [
2686
2695
  errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2687
2696
  "div",
2688
2697
  {
@@ -2704,7 +2713,7 @@ var SessionEditingForm = ({
2704
2713
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2705
2714
  "label",
2706
2715
  {
2707
- className: (0, import_clsx8.default)(`${classBase10}-fieldLabel`, {
2716
+ className: (0, import_clsx7.default)(`${classBase10}-fieldLabel`, {
2708
2717
  [`${classBase10}-required`]: field.required
2709
2718
  }),
2710
2719
  htmlFor: `${id}-input-${field.name}`,
@@ -2735,13 +2744,13 @@ var SessionEditingForm = ({
2735
2744
  // src/shell.tsx
2736
2745
  var import_vuu_data_remote2 = require("@vuu-ui/vuu-data-remote");
2737
2746
  var import_vuu_layout8 = require("@vuu-ui/vuu-layout");
2738
- var import_vuu_utils7 = require("@vuu-ui/vuu-utils");
2739
- var import_clsx11 = __toESM(require("clsx"));
2747
+ var import_vuu_utils6 = require("@vuu-ui/vuu-utils");
2748
+ var import_clsx10 = __toESM(require("clsx"));
2740
2749
  var import_react20 = require("react");
2741
2750
 
2742
2751
  // src/shell-layouts/context-panel/ContextPanel.tsx
2743
2752
  var import_core6 = require("@salt-ds/core");
2744
- var import_clsx9 = __toESM(require("clsx"));
2753
+ var import_clsx8 = __toESM(require("clsx"));
2745
2754
  var import_react17 = require("react");
2746
2755
  var import_vuu_layout5 = require("@vuu-ui/vuu-layout");
2747
2756
  var import_jsx_runtime21 = require("react/jsx-runtime");
@@ -2762,7 +2771,7 @@ var ContextPanel = ({
2762
2771
  type: "set-prop"
2763
2772
  });
2764
2773
  }, [dispatchLayoutAction]);
2765
- const className = (0, import_clsx9.default)(classBase11, classNameProp, {
2774
+ const className = (0, import_clsx8.default)(classBase11, classNameProp, {
2766
2775
  [`${classBase11}-expanded`]: expanded,
2767
2776
  [`${classBase11}-inline`]: overlay !== true,
2768
2777
  [`${classBase11}-overlay`]: overlay
@@ -2774,7 +2783,7 @@ var ContextPanel = ({
2774
2783
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2775
2784
  "div",
2776
2785
  {
2777
- className: (0, import_clsx9.default)(classBase11, className, {
2786
+ className: (0, import_clsx8.default)(classBase11, className, {
2778
2787
  [`${classBase11}-expanded`]: expanded
2779
2788
  }),
2780
2789
  children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_vuu_layout5.View, { className: `${classBase11}-inner`, header: false, id: "context-panel", children: [
@@ -2801,7 +2810,7 @@ var import_vuu_layout6 = require("@vuu-ui/vuu-layout");
2801
2810
 
2802
2811
  // src/shell-layouts/side-panel/SidePanel.tsx
2803
2812
  var import_react18 = require("react");
2804
- var import_clsx10 = __toESM(require("clsx"));
2813
+ var import_clsx9 = __toESM(require("clsx"));
2805
2814
  var import_jsx_runtime22 = require("react/jsx-runtime");
2806
2815
  var classBase12 = "vuuShellSidePanel";
2807
2816
  var SidePanel = ({
@@ -2819,7 +2828,7 @@ var SidePanel = ({
2819
2828
  }),
2820
2829
  [open, sizeClosed, sizeOpen, styleProp]
2821
2830
  );
2822
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { ...htmlAttributes, className: (0, import_clsx10.default)(classBase12), style, children });
2831
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { ...htmlAttributes, className: (0, import_clsx9.default)(classBase12), style, children });
2823
2832
  };
2824
2833
 
2825
2834
  // src/shell-layouts/useFullHeightLeftPanel.tsx
@@ -2947,7 +2956,7 @@ if (typeof import_vuu_layout8.StackLayout !== "function") {
2947
2956
  "StackLayout module not loaded, will be unsbale to deserialize from layout JSON"
2948
2957
  );
2949
2958
  }
2950
- var { error } = (0, import_vuu_utils7.logger)("Shell");
2959
+ var { error } = (0, import_vuu_utils6.logger)("Shell");
2951
2960
  var defaultLeftSidePanel = {};
2952
2961
  var Shell = ({
2953
2962
  LayoutProps,
@@ -3000,8 +3009,8 @@ var Shell = ({
3000
3009
  setConnectionStatus(connectionStatus2);
3001
3010
  }
3002
3011
  }, [serverUrl, user.token, user.username]);
3003
- const [themeClass, densityClass, dataMode] = (0, import_vuu_utils7.useThemeAttributes)();
3004
- const className = (0, import_clsx11.default)("vuuShell", classNameProp, themeClass, densityClass);
3012
+ const [themeClass, densityClass, dataMode] = (0, import_vuu_utils6.useThemeAttributes)();
3013
+ const className = (0, import_clsx10.default)("vuuShell", classNameProp, themeClass, densityClass);
3005
3014
  const isLoading = applicationJson === loadingApplicationJson;
3006
3015
  const shellLayout = useShellLayout({
3007
3016
  LeftSidePanelProps,
@@ -3020,7 +3029,7 @@ var Shell = ({
3020
3029
  if (connectionStatus === "rejected") {
3021
3030
  console.log("game over, no connection to server");
3022
3031
  }
3023
- return isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_vuu_utils7.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
3032
+ return isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_vuu_utils6.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
3024
3033
  ContextMenuProvider,
3025
3034
  {
3026
3035
  menuActionHandler: handleMenuAction,
@@ -3081,7 +3090,7 @@ var useShellContext = () => {
3081
3090
  };
3082
3091
 
3083
3092
  // src/theme-switch/ThemeSwitch.tsx
3084
- var import_clsx12 = __toESM(require("clsx"));
3093
+ var import_clsx11 = __toESM(require("clsx"));
3085
3094
  var import_core7 = require("@salt-ds/core");
3086
3095
  var import_react22 = require("react");
3087
3096
  var import_jsx_runtime27 = require("react/jsx-runtime");
@@ -3107,7 +3116,7 @@ var ThemeSwitch = ({
3107
3116
  },
3108
3117
  [onChange, setMode]
3109
3118
  );
3110
- const className = (0, import_clsx12.default)(classBase13, classNameProp);
3119
+ const className = (0, import_clsx11.default)(classBase13, classNameProp);
3111
3120
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3112
3121
  import_core7.ToggleButtonGroup,
3113
3122
  {