@linzjs/windows 16.0.0 → 16.2.0

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/dist/index.js CHANGED
@@ -2230,70 +2230,29 @@ const LuiModalAsyncContextProvider = ({ children }) => {
2230
2230
  showModal
2231
2231
  },
2232
2232
  children: [
2233
- /* @__PURE__ */ jsx(Fragment, { children: modals.filter(modalHasView).map((modalInstance) => /* @__PURE__ */ jsx(
2234
- LuiModalAsyncInstanceContext.Provider,
2235
- {
2236
- value: {
2237
- ownerRef: modalInstance.ownerRef,
2238
- close: () => modalInstance.resolve(void 0),
2239
- resolve: modalInstance.resolve
2233
+ /* @__PURE__ */ jsx(Fragment, {
2234
+ // oxlint-disable-next-line react/refs
2235
+ children: modals.filter(modalHasView).map((modalInstance) => /* @__PURE__ */ jsx(
2236
+ LuiModalAsyncInstanceContext.Provider,
2237
+ {
2238
+ value: {
2239
+ ownerRef: modalInstance.ownerRef,
2240
+ close: () => modalInstance.resolve(void 0),
2241
+ resolve: modalInstance.resolve
2242
+ },
2243
+ children: portalOwners(modalInstance).map(
2244
+ (element) => createPortal(/* @__PURE__ */ jsx(Fragment, { children: modalInstance.componentInstance }), element)
2245
+ )
2240
2246
  },
2241
- children: portalOwners(modalInstance).map(
2242
- (element) => createPortal(/* @__PURE__ */ jsx(Fragment, { children: modalInstance.componentInstance }), element)
2243
- )
2244
- },
2245
- modalInstance.uuid
2246
- )) }),
2247
+ modalInstance.uuid
2248
+ ))
2249
+ }),
2247
2250
  /* @__PURE__ */ jsx(Fragment, { children })
2248
2251
  ]
2249
2252
  }
2250
2253
  );
2251
2254
  };
2252
2255
 
2253
- const NoContext = () => {
2254
- console.error("Missing PanelContext Provider");
2255
- return void 0;
2256
- };
2257
- const PanelsContext = createContext({
2258
- openPanels: /* @__PURE__ */ new Set(),
2259
- hasOpenPanel: () => false,
2260
- openPanel: NoContext,
2261
- closePanel: NoContext,
2262
- hidePanel: NoContext,
2263
- hideAllPanels: NoContext,
2264
- unhidePanel: NoContext,
2265
- unhideAllPanels: NoContext,
2266
- hasHiddenPanel: NoContext,
2267
- bringPanelToFront: NoContext,
2268
- dockElements: {},
2269
- setDockElement: NoContext,
2270
- nextStackPosition: () => ({ x: 0, y: 0 })
2271
- });
2272
-
2273
- const OpenPanelButton = ({
2274
- buttonText,
2275
- testId,
2276
- uniqueId = buttonText,
2277
- ...openPanelOptions
2278
- }) => {
2279
- const { openPanel, closePanel, hidePanel, unhidePanel, hasOpenPanel, hasHiddenPanel } = useContext(PanelsContext);
2280
- const open = hasOpenPanel(uniqueId);
2281
- const hidden = hasHiddenPanel(uniqueId);
2282
- return /* @__PURE__ */ jsxs("div", { children: [
2283
- /* @__PURE__ */ jsxs("b", { children: [
2284
- buttonText,
2285
- " ",
2286
- open ? "(Open)" : ""
2287
- ] }),
2288
- /* @__PURE__ */ jsx("br", {}),
2289
- !open && /* @__PURE__ */ jsx("button", { "data-testid": testId + "Open", onClick: () => openPanel({ uniqueId, ...openPanelOptions }), children: "Open" }),
2290
- open && /* @__PURE__ */ jsxs(Fragment, { children: [
2291
- /* @__PURE__ */ jsx("button", { "data-testid": testId + "Close", onClick: () => closePanel(uniqueId), children: "Close" }),
2292
- hidden ? /* @__PURE__ */ jsx("button", { "data-testid": testId + "Unhide", onClick: () => unhidePanel(uniqueId), children: "Unhide" }) : /* @__PURE__ */ jsx("button", { "data-testid": testId + "Hide", onClick: () => hidePanel(uniqueId), children: "Hide" })
2293
- ] })
2294
- ] });
2295
- };
2296
-
2297
2256
  const NoContextError$1 = () => {
2298
2257
  console.error("Missing PanelInstanceContext Provider");
2299
2258
  };
@@ -2315,6 +2274,26 @@ const PanelInstanceContext = createContext({
2315
2274
  hidden: false
2316
2275
  });
2317
2276
 
2277
+ const NoContext = () => {
2278
+ console.error("Missing PanelContext Provider");
2279
+ return void 0;
2280
+ };
2281
+ const PanelsContext = createContext({
2282
+ openPanels: /* @__PURE__ */ new Set(),
2283
+ hasOpenPanel: () => false,
2284
+ openPanel: NoContext,
2285
+ closePanel: NoContext,
2286
+ hidePanel: NoContext,
2287
+ hideAllPanels: NoContext,
2288
+ unhidePanel: NoContext,
2289
+ unhideAllPanels: NoContext,
2290
+ hasHiddenPanel: NoContext,
2291
+ bringPanelToFront: NoContext,
2292
+ dockElements: {},
2293
+ setDockElement: NoContext,
2294
+ nextStackPosition: () => ({ x: 0, y: 0 })
2295
+ });
2296
+
2318
2297
  function getDefaultExportFromCjs (x) {
2319
2298
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
2320
2299
  }
@@ -6895,8 +6874,8 @@ const Panel = (props) => {
6895
6874
  const { dockElements, nextStackPosition } = useContext(PanelsContext);
6896
6875
  const { panelPoppedOut, uniqueId, setTitle, dockId, docked, hidden } = useContext(PanelInstanceContext);
6897
6876
  const savedState = useRestoreStateFrom({ uniqueId, panelPoppedOut: false });
6898
- const lastPanelHeightRef = useRef(panelRef.current?.clientHeight);
6899
- lastPanelHeightRef.current = panelRef.current?.clientHeight ?? lastPanelHeightRef.current ?? 400;
6877
+ const lastPanelHeightRef = useRef(400);
6878
+ lastPanelHeightRef.current = panelRef.current?.clientHeight ?? lastPanelHeightRef.current;
6900
6879
  useEffect(() => {
6901
6880
  setTitle(title);
6902
6881
  }, [setTitle, title]);
@@ -6908,6 +6887,11 @@ const Panel = (props) => {
6908
6887
  }
6909
6888
  }
6910
6889
  }, [title]);
6890
+ useEffect(() => {
6891
+ if (panelRef.current) {
6892
+ panelRef.current.inert = hidden ?? false;
6893
+ }
6894
+ }, [hidden, panelPoppedOut]);
6911
6895
  const [panelPosition, setPanelPosition] = useState(() => {
6912
6896
  if (dynamicBounds) {
6913
6897
  const result = dynamicBounds();
@@ -6984,7 +6968,7 @@ const Panel = (props) => {
6984
6968
  }, [dynamicResize]);
6985
6969
  useInterval(dynamicResize, dynamicBounds ? 250 : null);
6986
6970
  const dockElement = docked && dockId && dockElements[dockId];
6987
- return /* @__PURE__ */ jsx(Fragment, { children: dockElement && dockElement.isConnected ? createPortal(children, dockElement) : panelPoppedOut ? /* @__PURE__ */ jsx(
6971
+ return /* @__PURE__ */ jsx(Fragment, { children: dockElement && dockElement.isConnected ? createPortal(children, dockElement) : panelPoppedOut ? /* @__PURE__ */ jsxs(
6988
6972
  PopoutWindow,
6989
6973
  {
6990
6974
  name: uniqueId,
@@ -6993,22 +6977,26 @@ const Panel = (props) => {
6993
6977
  popInPanelPosition: panelPosition,
6994
6978
  popInPanelSize: {
6995
6979
  width: panelSize.width,
6980
+ // oxlint-disable-next-line react/refs
6996
6981
  height: panelSize.height === "auto" ? lastPanelHeightRef.current : panelSize.height
6997
6982
  },
6998
- children: /* @__PURE__ */ jsx(
6999
- "div",
7000
- {
7001
- ref: panelRef,
7002
- style: {
7003
- display: "flex",
7004
- flexDirection: "column",
7005
- width: "100%",
7006
- height: "100%"
7007
- },
7008
- className,
7009
- children
7010
- }
7011
- )
6983
+ children: [
6984
+ hidden && /* @__PURE__ */ jsx("div", { className: "PopoutWindowContainer--hidden" }),
6985
+ /* @__PURE__ */ jsx(
6986
+ "div",
6987
+ {
6988
+ ref: panelRef,
6989
+ style: {
6990
+ display: "flex",
6991
+ flexDirection: "column",
6992
+ width: "100%",
6993
+ height: "100%"
6994
+ },
6995
+ className,
6996
+ children
6997
+ }
6998
+ )
6999
+ ]
7012
7000
  }
7013
7001
  ) : /* @__PURE__ */ jsx(
7014
7002
  PopinWindow,
@@ -7044,7 +7032,7 @@ const PanelFooter = forwardRef(function PanelFooterFr({ children, className }, r
7044
7032
  const PanelHeaderButton = ({ "aria-label": ariaLabel, href, icon, onClick }) => {
7045
7033
  const [disabled, setDisabled] = useState(true);
7046
7034
  useLayoutEffect(() => {
7047
- void setDisabled(false);
7035
+ setDisabled(false);
7048
7036
  }, []);
7049
7037
  return /* @__PURE__ */ jsx(
7050
7038
  LuiButton,
@@ -7427,7 +7415,7 @@ const LuiModalAsyncHeader = ({
7427
7415
  const { ownerRef, close } = useContext(LuiModalAsyncInstanceContext);
7428
7416
  const [disabled, setDisabled] = useState(true);
7429
7417
  useLayoutEffect(() => {
7430
- void setDisabled(false);
7418
+ setDisabled(false);
7431
7419
  }, []);
7432
7420
  return /* @__PURE__ */ jsxs("div", { className: "LuiModalAsync-header", children: [
7433
7421
  icon && (typeof icon === "string" ? /* @__PURE__ */ jsx(
@@ -7998,5 +7986,5 @@ const focusNextRibbonButton = () => {
7998
7986
  button?.focus();
7999
7987
  };
8000
7988
 
8001
- export { ButtonIconHorizontalGroup, ButtonIconSeparator, ButtonIconVerticalGroup, CopyableText, LuiModalAsync, LuiModalAsyncButtonContinue, LuiModalAsyncButtonDismiss, LuiModalAsyncButtonGroup, LuiModalAsyncContent, LuiModalAsyncContext, LuiModalAsyncContextProvider, LuiModalAsyncHeader, LuiModalAsyncInstanceContext, LuiModalAsyncMain, LuiModalDontShowSessionCheck, LuiModalDontShowSessionRemove, LuiModalDontShowSessionSet, LuiModalPrefab, LuiModalUpload, OpenPanelButton, OpenPanelIcon, Panel, PanelContent, PanelContext, PanelDock, PanelFooter, PanelHeader, PanelHeaderButton, PanelInline, PanelInstanceContext, PanelInstanceContextProvider, PanelsContext, PanelsContextProvider, RibbonButton, RibbonButtonLink, RibbonButtonOpenPanel, RibbonButtonSlider, RibbonButtonSliderContext, RibbonContainer, RibbonMenu, RibbonMenuContext, RibbonMenuOption, RibbonMenuSeparator, RibbonSeparator, getIconForLevel, openModalOnAllWindows, ribbonSliderAlignments, tabToNextSiblingElement, tabToPreviousSiblingElement, tabToSiblingElement, useConstFunction, useLuiModalPrefab, useLuiModalUpload, useShowAsyncModal };
7989
+ export { ButtonIconHorizontalGroup, ButtonIconSeparator, ButtonIconVerticalGroup, CopyableText, LuiModalAsync, LuiModalAsyncButtonContinue, LuiModalAsyncButtonDismiss, LuiModalAsyncButtonGroup, LuiModalAsyncContent, LuiModalAsyncContext, LuiModalAsyncContextProvider, LuiModalAsyncHeader, LuiModalAsyncInstanceContext, LuiModalAsyncMain, LuiModalDontShowSessionCheck, LuiModalDontShowSessionRemove, LuiModalDontShowSessionSet, LuiModalPrefab, LuiModalUpload, OpenPanelIcon, Panel, PanelContent, PanelContext, PanelDock, PanelFooter, PanelHeader, PanelHeaderButton, PanelInline, PanelInstanceContext, PanelInstanceContextProvider, PanelsContext, PanelsContextProvider, RibbonButton, RibbonButtonLink, RibbonButtonOpenPanel, RibbonButtonSlider, RibbonButtonSliderContext, RibbonContainer, RibbonMenu, RibbonMenuContext, RibbonMenuOption, RibbonMenuSeparator, RibbonSeparator, getIconForLevel, openModalOnAllWindows, ribbonSliderAlignments, tabToNextSiblingElement, tabToPreviousSiblingElement, tabToSiblingElement, useConstFunction, useLuiModalPrefab, useLuiModalUpload, useShowAsyncModal };
8002
7990
  //# sourceMappingURL=index.js.map