@homebound/beam 3.106.0 → 3.108.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.cjs +58 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +88 -55
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -6938,6 +6938,8 @@ type MenuItemBase = {
|
|
|
6938
6938
|
disabled?: boolean | ReactNode;
|
|
6939
6939
|
destructive?: boolean;
|
|
6940
6940
|
hasDivider?: boolean;
|
|
6941
|
+
/** Shows AiStar and styling on label. This ai icon and styling trumps all other subtypes. */
|
|
6942
|
+
ai?: boolean;
|
|
6941
6943
|
};
|
|
6942
6944
|
type IconMenuItemType = MenuItemBase & {
|
|
6943
6945
|
icon: IconProps["icon"];
|
|
@@ -7915,6 +7917,8 @@ type DnDGridProps = {
|
|
|
7915
7917
|
gridStyles?: GridStyles;
|
|
7916
7918
|
/** Defines the styling for the GridItem that is actively being moved */
|
|
7917
7919
|
activeItemStyles?: Properties;
|
|
7920
|
+
/** Restrict drag movement to one axis. Omit to allow free 2D movement. */
|
|
7921
|
+
lockAxis?: "x" | "y";
|
|
7918
7922
|
/** Returns the new order of the GridItems. */
|
|
7919
7923
|
onReorder: (items: string[]) => void;
|
|
7920
7924
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -6938,6 +6938,8 @@ type MenuItemBase = {
|
|
|
6938
6938
|
disabled?: boolean | ReactNode;
|
|
6939
6939
|
destructive?: boolean;
|
|
6940
6940
|
hasDivider?: boolean;
|
|
6941
|
+
/** Shows AiStar and styling on label. This ai icon and styling trumps all other subtypes. */
|
|
6942
|
+
ai?: boolean;
|
|
6941
6943
|
};
|
|
6942
6944
|
type IconMenuItemType = MenuItemBase & {
|
|
6943
6945
|
icon: IconProps["icon"];
|
|
@@ -7915,6 +7917,8 @@ type DnDGridProps = {
|
|
|
7915
7917
|
gridStyles?: GridStyles;
|
|
7916
7918
|
/** Defines the styling for the GridItem that is actively being moved */
|
|
7917
7919
|
activeItemStyles?: Properties;
|
|
7920
|
+
/** Restrict drag movement to one axis. Omit to allow free 2D movement. */
|
|
7921
|
+
lockAxis?: "x" | "y";
|
|
7918
7922
|
/** Returns the new order of the GridItems. */
|
|
7919
7923
|
onReorder: (items: string[]) => void;
|
|
7920
7924
|
};
|
package/dist/index.js
CHANGED
|
@@ -11375,7 +11375,7 @@ function MenuItemImpl(props) {
|
|
|
11375
11375
|
}
|
|
11376
11376
|
function renderMenuItem(menuItem, isSelected, isDisabled) {
|
|
11377
11377
|
return /* @__PURE__ */ jsxs27("div", { className: "df w100 aic jcsb gap2", children: [
|
|
11378
|
-
/* @__PURE__ */ jsx44("div", { className: "df aic", children: maybeWrapInLink(menuItem.onClick, isIconMenuItem(menuItem) ? /* @__PURE__ */ jsx44(IconMenuItem, { ...menuItem }) : isImageMenuItem(menuItem) ? /* @__PURE__ */ jsx44(ImageMenuItem, { ...menuItem }) : menuItem.label, isDisabled) }),
|
|
11378
|
+
/* @__PURE__ */ jsx44("div", { className: "df aic", children: maybeWrapInLink(menuItem.onClick, menuItem.ai ? /* @__PURE__ */ jsx44(AiMenuItem, { label: menuItem.label, isDisabled }) : isIconMenuItem(menuItem) ? /* @__PURE__ */ jsx44(IconMenuItem, { ...menuItem }) : isImageMenuItem(menuItem) ? /* @__PURE__ */ jsx44(ImageMenuItem, { ...menuItem }) : menuItem.label, isDisabled) }),
|
|
11379
11379
|
isSelected && /* @__PURE__ */ jsx44(Icon, { icon: "check", color: isDisabled ? "--b-text-disabled" /* TextDisabled */ : "--b-selection-indicator" /* SelectionIndicator */ })
|
|
11380
11380
|
] });
|
|
11381
11381
|
}
|
|
@@ -11391,6 +11391,21 @@ function ImageMenuItem(item) {
|
|
|
11391
11391
|
label
|
|
11392
11392
|
] });
|
|
11393
11393
|
}
|
|
11394
|
+
function AiMenuItem({
|
|
11395
|
+
label,
|
|
11396
|
+
isDisabled
|
|
11397
|
+
}) {
|
|
11398
|
+
return /* @__PURE__ */ jsxs27(Fragment15, { children: [
|
|
11399
|
+
/* @__PURE__ */ jsx44("span", { className: "df aic jcc fs0 h_24px w_24px mr2", children: /* @__PURE__ */ jsx44(Icon, { icon: "aiStar", inc: 2.125 }) }),
|
|
11400
|
+
/* @__PURE__ */ jsx44("span", { ...trussProps32({
|
|
11401
|
+
...!isDisabled ? {
|
|
11402
|
+
color: ["color_var", {
|
|
11403
|
+
"--color": maybeCssVar15("rgba(124, 58, 237, 1)" /* Purple600 */)
|
|
11404
|
+
}]
|
|
11405
|
+
} : {}
|
|
11406
|
+
}), children: label })
|
|
11407
|
+
] });
|
|
11408
|
+
}
|
|
11394
11409
|
function IconMenuItem(item) {
|
|
11395
11410
|
const {
|
|
11396
11411
|
icon,
|
|
@@ -20046,7 +20061,7 @@ function SuperDrawer() {
|
|
|
20046
20061
|
}
|
|
20047
20062
|
|
|
20048
20063
|
// src/components/Layout/FormPageLayout.tsx
|
|
20049
|
-
import React19, { createRef, useCallback as useCallback29, useEffect as
|
|
20064
|
+
import React19, { createRef, useCallback as useCallback29, useEffect as useEffect27, useMemo as useMemo37, useRef as useRef53, useState as useState44 } from "react";
|
|
20050
20065
|
import { useButton as useButton9, useFocusRing as useFocusRing14 } from "react-aria";
|
|
20051
20066
|
|
|
20052
20067
|
// src/forms/BoundCheckboxField.tsx
|
|
@@ -21230,7 +21245,7 @@ FormHeading.isFormHeading = true;
|
|
|
21230
21245
|
|
|
21231
21246
|
// src/components/DnDGrid/DnDGrid.tsx
|
|
21232
21247
|
import equal2 from "fast-deep-equal";
|
|
21233
|
-
import { useCallback as useCallback27, useRef as useRef50 } from "react";
|
|
21248
|
+
import { useCallback as useCallback27, useEffect as useEffect26, useRef as useRef50 } from "react";
|
|
21234
21249
|
|
|
21235
21250
|
// src/components/DnDGrid/DnDGridContext.tsx
|
|
21236
21251
|
import { createContext as createContext9, useContext as useContext19 } from "react";
|
|
@@ -21251,7 +21266,8 @@ function DnDGrid(props) {
|
|
|
21251
21266
|
children,
|
|
21252
21267
|
gridStyles,
|
|
21253
21268
|
onReorder,
|
|
21254
|
-
activeItemStyles
|
|
21269
|
+
activeItemStyles,
|
|
21270
|
+
lockAxis
|
|
21255
21271
|
} = props;
|
|
21256
21272
|
const gridEl = useRef50(null);
|
|
21257
21273
|
const dragEl = useRef50();
|
|
@@ -21318,15 +21334,15 @@ function DnDGrid(props) {
|
|
|
21318
21334
|
const clientY = "clientY" in e ? e.clientY : e.touches[0].clientY;
|
|
21319
21335
|
const left = dragEl.current.style.left ? parseInt(dragEl.current.style.left) : 0;
|
|
21320
21336
|
const top = dragEl.current.style.top ? parseInt(dragEl.current.style.top) : 0;
|
|
21321
|
-
const x = clientX - transformFrom.current.x - left;
|
|
21322
|
-
const y = clientY - transformFrom.current.y - top;
|
|
21337
|
+
const x = lockAxis === "y" ? 0 : clientX - transformFrom.current.x - left;
|
|
21338
|
+
const y = lockAxis === "x" ? 0 : clientY - transformFrom.current.y - top;
|
|
21323
21339
|
dragEl.current.style.transform = `translate(${x}px, ${y}px)`;
|
|
21324
21340
|
const maybeTarget = "touches" in e ? document.elementFromPoint(clientX, clientY) : e.target;
|
|
21325
21341
|
const target = maybeTarget instanceof HTMLElement ? maybeTarget?.closest(`[${gridItemIdKey}]`) : void 0;
|
|
21326
21342
|
if (target instanceof HTMLElement && target !== cloneEl.current && target !== dragEl.current) {
|
|
21327
21343
|
const targetPos = target.getBoundingClientRect();
|
|
21328
21344
|
const clonePos = cloneEl.current.getBoundingClientRect();
|
|
21329
|
-
const useYAxis = Math.abs(targetPos.top - clonePos.top) >= Math.abs(targetPos.left - clonePos.left);
|
|
21345
|
+
const useYAxis = lockAxis === "y" ? true : lockAxis === "x" ? false : Math.abs(targetPos.top - clonePos.top) >= Math.abs(targetPos.left - clonePos.left);
|
|
21330
21346
|
const isHalfwayPassedTarget = useYAxis ? (clientY - targetPos.top) / (targetPos.bottom - targetPos.top) > 0.5 : (clientX - targetPos.left) / (targetPos.right - targetPos.left) > 0.5;
|
|
21331
21347
|
const shouldInsert = isHalfwayPassedTarget && target.nextSibling !== cloneEl.current || !isHalfwayPassedTarget && target.previousSibling !== cloneEl.current;
|
|
21332
21348
|
if (shouldInsert) {
|
|
@@ -21334,7 +21350,18 @@ function DnDGrid(props) {
|
|
|
21334
21350
|
}
|
|
21335
21351
|
}
|
|
21336
21352
|
}
|
|
21337
|
-
}, []);
|
|
21353
|
+
}, [lockAxis]);
|
|
21354
|
+
const onDragEnd = useCallback27((e) => {
|
|
21355
|
+
if (!reorderViaKeyboard.current && dragEl.current && cloneEl.current && gridEl.current) {
|
|
21356
|
+
e.preventDefault();
|
|
21357
|
+
cloneEl.current.replaceWith(dragEl.current);
|
|
21358
|
+
gridEl.current.querySelectorAll(`[${gridCloneKey}]`).forEach((el) => el.remove());
|
|
21359
|
+
gridEl.current.style.cursor = "auto";
|
|
21360
|
+
cloneEl.current = void 0;
|
|
21361
|
+
commitReorder();
|
|
21362
|
+
removePointerDragListeners(onMove, onDragEnd);
|
|
21363
|
+
}
|
|
21364
|
+
}, [commitReorder, onMove]);
|
|
21338
21365
|
const onDragStart = useCallback27((e) => {
|
|
21339
21366
|
if (!reorderViaKeyboard.current && dragEl.current && gridEl.current) {
|
|
21340
21367
|
const rect = dragEl.current.getBoundingClientRect();
|
|
@@ -21360,22 +21387,12 @@ function DnDGrid(props) {
|
|
|
21360
21387
|
dragEl.current.style.width = `${rect.width}px`;
|
|
21361
21388
|
dragEl.current.style.height = `${rect.height}px`;
|
|
21362
21389
|
gridEl.current.style.cursor = "grabbing";
|
|
21363
|
-
|
|
21364
|
-
gridEl.current.addEventListener("touchmove", onMove);
|
|
21365
|
-
}
|
|
21366
|
-
}, [initReorder, onMove]);
|
|
21367
|
-
const onDragEnd = useCallback27((e) => {
|
|
21368
|
-
if (!reorderViaKeyboard.current && dragEl.current && cloneEl.current && gridEl.current) {
|
|
21369
|
-
e.preventDefault();
|
|
21370
|
-
cloneEl.current.replaceWith(dragEl.current);
|
|
21371
|
-
gridEl.current.querySelectorAll(`[${gridCloneKey}]`).forEach((el) => el.remove());
|
|
21372
|
-
gridEl.current.style.cursor = "auto";
|
|
21373
|
-
cloneEl.current = void 0;
|
|
21374
|
-
commitReorder();
|
|
21375
|
-
gridEl.current.removeEventListener("mousemove", onMove);
|
|
21376
|
-
gridEl.current.removeEventListener("touchmove", onMove);
|
|
21390
|
+
addPointerDragListeners(onMove, onDragEnd);
|
|
21377
21391
|
}
|
|
21378
|
-
}, [
|
|
21392
|
+
}, [initReorder, onMove, onDragEnd]);
|
|
21393
|
+
useEffect26(() => {
|
|
21394
|
+
return () => removePointerDragListeners(onMove, onDragEnd);
|
|
21395
|
+
}, [onMove, onDragEnd]);
|
|
21379
21396
|
const onDragHandleKeyDown = useCallback27((e) => {
|
|
21380
21397
|
const moveHandle = e.target;
|
|
21381
21398
|
if (dragEl.current instanceof HTMLElement && moveHandle instanceof HTMLElement && gridEl.current) {
|
|
@@ -21409,8 +21426,8 @@ function DnDGrid(props) {
|
|
|
21409
21426
|
document.removeEventListener("pointerdown", cancelReorder);
|
|
21410
21427
|
return;
|
|
21411
21428
|
}
|
|
21412
|
-
const movingLeft =
|
|
21413
|
-
const movingRight =
|
|
21429
|
+
const movingLeft = lockAxis !== "x" && e.key === "ArrowUp" || lockAxis !== "y" && e.key === "ArrowLeft";
|
|
21430
|
+
const movingRight = lockAxis !== "x" && e.key === "ArrowDown" || lockAxis !== "y" && e.key === "ArrowRight";
|
|
21414
21431
|
if (movingLeft || movingRight) {
|
|
21415
21432
|
e.preventDefault();
|
|
21416
21433
|
const gridItems = getGridItems();
|
|
@@ -21423,7 +21440,7 @@ function DnDGrid(props) {
|
|
|
21423
21440
|
moveHandle.focus();
|
|
21424
21441
|
}
|
|
21425
21442
|
}
|
|
21426
|
-
}, [cancelReorder, commitReorder, initReorder, getGridItems]);
|
|
21443
|
+
}, [cancelReorder, commitReorder, initReorder, getGridItems, lockAxis]);
|
|
21427
21444
|
return /* @__PURE__ */ jsx147(DnDGridContext.Provider, { value: {
|
|
21428
21445
|
dragEl,
|
|
21429
21446
|
onDragHandleKeyDown
|
|
@@ -21437,6 +21454,22 @@ function DnDGrid(props) {
|
|
|
21437
21454
|
}
|
|
21438
21455
|
var gridItemIdKey = "dndgrid-itemid";
|
|
21439
21456
|
var gridCloneKey = "dndgrid-clone";
|
|
21457
|
+
function addPointerDragListeners(onMove, onEnd) {
|
|
21458
|
+
document.addEventListener("mousemove", onMove);
|
|
21459
|
+
document.addEventListener("touchmove", onMove);
|
|
21460
|
+
document.addEventListener("mouseup", onEnd);
|
|
21461
|
+
document.addEventListener("touchend", onEnd);
|
|
21462
|
+
document.addEventListener("pointercancel", onEnd);
|
|
21463
|
+
document.addEventListener("touchcancel", onEnd);
|
|
21464
|
+
}
|
|
21465
|
+
function removePointerDragListeners(onMove, onEnd) {
|
|
21466
|
+
document.removeEventListener("mousemove", onMove);
|
|
21467
|
+
document.removeEventListener("touchmove", onMove);
|
|
21468
|
+
document.removeEventListener("mouseup", onEnd);
|
|
21469
|
+
document.removeEventListener("touchend", onEnd);
|
|
21470
|
+
document.removeEventListener("pointercancel", onEnd);
|
|
21471
|
+
document.removeEventListener("touchcancel", onEnd);
|
|
21472
|
+
}
|
|
21440
21473
|
function applyActiveStyles(el, activeStyles3) {
|
|
21441
21474
|
const {
|
|
21442
21475
|
className,
|
|
@@ -21825,7 +21858,7 @@ function DraggableChildren(props) {
|
|
|
21825
21858
|
}
|
|
21826
21859
|
});
|
|
21827
21860
|
};
|
|
21828
|
-
return /* @__PURE__ */ jsx153(DnDGrid, { onReorder: handleReorder, gridStyles: {
|
|
21861
|
+
return /* @__PURE__ */ jsx153(DnDGrid, { onReorder: handleReorder, lockAxis: "y", gridStyles: {
|
|
21829
21862
|
gridTemplateColumns: "gtc_minmax_0_1fr",
|
|
21830
21863
|
gap: "gap3"
|
|
21831
21864
|
}, children: sorted.map((child) => /* @__PURE__ */ jsx153(FormSectionChild, { ...child, ...tid }, child.id)) });
|
|
@@ -22389,7 +22422,7 @@ function useActiveSection(sectionsWithRefs) {
|
|
|
22389
22422
|
}, 200, {
|
|
22390
22423
|
maxWait: 500
|
|
22391
22424
|
});
|
|
22392
|
-
|
|
22425
|
+
useEffect27(() => {
|
|
22393
22426
|
if (!("IntersectionObserver" in window)) return;
|
|
22394
22427
|
const observer3 = new IntersectionObserver((entries) => debouncedIntersectionCallback(entries), {
|
|
22395
22428
|
/**
|
|
@@ -22482,7 +22515,7 @@ function invertSpacing(value) {
|
|
|
22482
22515
|
|
|
22483
22516
|
// src/components/Layout/GridTableLayout/GridTableLayout.tsx
|
|
22484
22517
|
import { useResizeObserver as useResizeObserver7 } from "@react-aria/utils";
|
|
22485
|
-
import React21, { useCallback as useCallback33, useEffect as
|
|
22518
|
+
import React21, { useCallback as useCallback33, useEffect as useEffect30, useLayoutEffect as useLayoutEffect9, useMemo as useMemo43, useRef as useRef55, useState as useState49 } from "react";
|
|
22486
22519
|
|
|
22487
22520
|
// src/components/Filters/utils.tsx
|
|
22488
22521
|
function getActiveFilterCount(filter) {
|
|
@@ -22508,7 +22541,7 @@ import { mergeProps as mergeProps27 } from "@homebound/truss/runtime";
|
|
|
22508
22541
|
|
|
22509
22542
|
// src/components/Layout/RightPaneLayout/DocumentScrollRightPane.tsx
|
|
22510
22543
|
import { AnimatePresence as AnimatePresence3, motion as motion3 } from "framer-motion";
|
|
22511
|
-
import { useEffect as
|
|
22544
|
+
import { useEffect as useEffect28 } from "react";
|
|
22512
22545
|
import { usePreventScroll as usePreventScroll2 } from "react-aria";
|
|
22513
22546
|
import { createPortal as createPortal6 } from "react-dom";
|
|
22514
22547
|
|
|
@@ -22582,7 +22615,7 @@ function DocumentScrollRightPane({
|
|
|
22582
22615
|
usePreventScroll2({
|
|
22583
22616
|
isDisabled: !isMobileOverlay
|
|
22584
22617
|
});
|
|
22585
|
-
|
|
22618
|
+
useEffect28(() => closePane, [closePane]);
|
|
22586
22619
|
const slideX = sm ? "100%" : paneWidth;
|
|
22587
22620
|
const pane = /* @__PURE__ */ jsx163(AnimatePresence3, { children: isRightPaneOpen && /* @__PURE__ */ jsx163(motion3.div, { ...tid, ...mergeProps26(void 0, sm ? {
|
|
22588
22621
|
top: bannerHeightPx
|
|
@@ -23244,12 +23277,12 @@ function ConfirmCloseModal(props) {
|
|
|
23244
23277
|
}
|
|
23245
23278
|
|
|
23246
23279
|
// src/components/Modal/OpenModal.tsx
|
|
23247
|
-
import { useEffect as
|
|
23280
|
+
import { useEffect as useEffect29 } from "react";
|
|
23248
23281
|
import { jsx as jsx175 } from "react/jsx-runtime";
|
|
23249
23282
|
function OpenModal(props) {
|
|
23250
23283
|
const { openModal } = useModal();
|
|
23251
23284
|
const { size, children, keepOpen, aiMode } = props;
|
|
23252
|
-
|
|
23285
|
+
useEffect29(() => {
|
|
23253
23286
|
if (!keepOpen) {
|
|
23254
23287
|
openModal({ size, content: children, aiMode });
|
|
23255
23288
|
}
|
|
@@ -23871,7 +23904,7 @@ function GridTableLayoutComponent(props) {
|
|
|
23871
23904
|
const tableWrapperRef = useRef55(null);
|
|
23872
23905
|
useSetTableActionsHeight(tableWrapperRef, tableActionsRef, inDocumentScrollLayout && showTableActions);
|
|
23873
23906
|
const visibleColumnIds = useComputed(() => api.getVisibleColumnIds(), [api]);
|
|
23874
|
-
|
|
23907
|
+
useEffect30(() => {
|
|
23875
23908
|
if (layoutState?.setVisibleColumnIds) {
|
|
23876
23909
|
layoutState.setVisibleColumnIds(visibleColumnIds);
|
|
23877
23910
|
}
|
|
@@ -24044,7 +24077,7 @@ function PreventBrowserScroll({
|
|
|
24044
24077
|
|
|
24045
24078
|
// src/components/Layout/RightPaneLayout/RightPaneLayout.tsx
|
|
24046
24079
|
import { AnimatePresence as AnimatePresence4, motion as motion4 } from "framer-motion";
|
|
24047
|
-
import { useEffect as
|
|
24080
|
+
import { useEffect as useEffect31 } from "react";
|
|
24048
24081
|
import { trussProps as trussProps105, maybeCssVar as maybeCssVar52 } from "@homebound/truss/runtime";
|
|
24049
24082
|
import { Fragment as Fragment41, jsx as jsx188, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
24050
24083
|
var __maybeInc24 = (inc) => {
|
|
@@ -24063,7 +24096,7 @@ function RightPaneLayout(props) {
|
|
|
24063
24096
|
clearPane,
|
|
24064
24097
|
closePane
|
|
24065
24098
|
} = useRightPaneContext();
|
|
24066
|
-
|
|
24099
|
+
useEffect31(() => closePane, [closePane]);
|
|
24067
24100
|
return /* @__PURE__ */ jsx188("div", { className: "h100 df oxh", children: /* @__PURE__ */ jsxs92(Fragment41, { children: [
|
|
24068
24101
|
/* @__PURE__ */ jsx188("div", { ...trussProps105({
|
|
24069
24102
|
...{
|
|
@@ -24175,7 +24208,7 @@ function ScrollableFooter(props) {
|
|
|
24175
24208
|
|
|
24176
24209
|
// src/components/Layout/TableReviewLayout/TableReviewLayout.tsx
|
|
24177
24210
|
import { AnimatePresence as AnimatePresence5, motion as motion5 } from "framer-motion";
|
|
24178
|
-
import { useEffect as
|
|
24211
|
+
import { useEffect as useEffect32, useState as useState50 } from "react";
|
|
24179
24212
|
|
|
24180
24213
|
// src/components/Layout/TableReviewLayout/SidePanel.tsx
|
|
24181
24214
|
import { jsx as jsx190, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
@@ -24216,7 +24249,7 @@ function TableReviewLayout(props) {
|
|
|
24216
24249
|
} = props;
|
|
24217
24250
|
const tid = useTestIds(props, "tableReviewLayout");
|
|
24218
24251
|
const [isPanelVisible, setIsPanelVisible] = useState50(!!panelContent);
|
|
24219
|
-
|
|
24252
|
+
useEffect32(() => {
|
|
24220
24253
|
setIsPanelVisible(!!panelContent);
|
|
24221
24254
|
}, [panelContent]);
|
|
24222
24255
|
function handleClosePanel() {
|
|
@@ -25301,7 +25334,7 @@ function useResponsiveGrid(props) {
|
|
|
25301
25334
|
}
|
|
25302
25335
|
|
|
25303
25336
|
// src/components/Grid/useResponsiveGridItem.ts
|
|
25304
|
-
import { useContext as useContext24, useEffect as
|
|
25337
|
+
import { useContext as useContext24, useEffect as useEffect33, useMemo as useMemo48 } from "react";
|
|
25305
25338
|
var injectedResponsiveGridClasses = /* @__PURE__ */ new Set();
|
|
25306
25339
|
var responsiveGridStyleEl;
|
|
25307
25340
|
function useResponsiveGridItem(props) {
|
|
@@ -25331,7 +25364,7 @@ function useResponsiveGridItem(props) {
|
|
|
25331
25364
|
};
|
|
25332
25365
|
}
|
|
25333
25366
|
function useResponsiveGridItemStyle(className, cssText) {
|
|
25334
|
-
|
|
25367
|
+
useEffect33(
|
|
25335
25368
|
function() {
|
|
25336
25369
|
if (!className || !cssText || typeof document === "undefined") return;
|
|
25337
25370
|
if (!responsiveGridStyleEl) {
|
|
@@ -25593,7 +25626,7 @@ var jumpLinkStyles = {
|
|
|
25593
25626
|
|
|
25594
25627
|
// src/components/MaxLines.tsx
|
|
25595
25628
|
import { useLayoutEffect as useLayoutEffect10, useResizeObserver as useResizeObserver9 } from "@react-aria/utils";
|
|
25596
|
-
import { useCallback as useCallback34, useEffect as
|
|
25629
|
+
import { useCallback as useCallback34, useEffect as useEffect34, useRef as useRef61, useState as useState53 } from "react";
|
|
25597
25630
|
import { trussProps as trussProps116, maybeCssVar as maybeCssVar57 } from "@homebound/truss/runtime";
|
|
25598
25631
|
import { jsx as jsx205, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
25599
25632
|
function MaxLines({
|
|
@@ -25607,7 +25640,7 @@ function MaxLines({
|
|
|
25607
25640
|
if (!elRef.current) return;
|
|
25608
25641
|
setHasMore(elRef.current.scrollHeight > elRef.current.clientHeight);
|
|
25609
25642
|
}, []);
|
|
25610
|
-
|
|
25643
|
+
useEffect34(() => {
|
|
25611
25644
|
setExpanded(false);
|
|
25612
25645
|
}, [children]);
|
|
25613
25646
|
const onResize = useCallback34(() => {
|
|
@@ -25640,7 +25673,7 @@ import { camelCase as camelCase6 } from "change-case";
|
|
|
25640
25673
|
// src/components/AppNav/AppNavGroup.tsx
|
|
25641
25674
|
import { useResizeObserver as useResizeObserver10 } from "@react-aria/utils";
|
|
25642
25675
|
import { camelCase as camelCase5, kebabCase } from "change-case";
|
|
25643
|
-
import { useCallback as useCallback36, useEffect as
|
|
25676
|
+
import { useCallback as useCallback36, useEffect as useEffect35, useMemo as useMemo51, useState as useState55 } from "react";
|
|
25644
25677
|
|
|
25645
25678
|
// src/components/AppNav/AppNavGroupTrigger.tsx
|
|
25646
25679
|
import { useMemo as useMemo50, useRef as useRef62 } from "react";
|
|
@@ -25880,7 +25913,7 @@ function AppNavGroupDisclosure(props) {
|
|
|
25880
25913
|
current: contentEl
|
|
25881
25914
|
}), [contentEl]);
|
|
25882
25915
|
const [contentHeight, setContentHeight] = useState55(expanded ? "auto" : "0");
|
|
25883
|
-
|
|
25916
|
+
useEffect35(() => {
|
|
25884
25917
|
setContentHeight(expanded && contentEl ? `${contentEl.scrollHeight}px` : "0");
|
|
25885
25918
|
}, [expanded, contentEl]);
|
|
25886
25919
|
const onResize = useCallback36(() => {
|
|
@@ -26030,7 +26063,7 @@ function AppNavItems(props) {
|
|
|
26030
26063
|
|
|
26031
26064
|
// src/components/Navbar/NavbarMobileMenu.tsx
|
|
26032
26065
|
import { AnimatePresence as AnimatePresence6, motion as motion6 } from "framer-motion";
|
|
26033
|
-
import { useEffect as
|
|
26066
|
+
import { useEffect as useEffect36, useState as useState57 } from "react";
|
|
26034
26067
|
import { FocusScope as FocusScope5, usePreventScroll as usePreventScroll3 } from "react-aria";
|
|
26035
26068
|
import { createPortal as createPortal8 } from "react-dom";
|
|
26036
26069
|
import { useLocation } from "react-router-dom";
|
|
@@ -26082,7 +26115,7 @@ function NavbarMobileMenu(props) {
|
|
|
26082
26115
|
isDisabled: !isOpen
|
|
26083
26116
|
});
|
|
26084
26117
|
const close = () => setIsOpen(false);
|
|
26085
|
-
|
|
26118
|
+
useEffect36(() => {
|
|
26086
26119
|
close();
|
|
26087
26120
|
}, [pathname, search]);
|
|
26088
26121
|
return /* @__PURE__ */ jsxs107(Fragment47, { children: [
|
|
@@ -26539,7 +26572,7 @@ import {
|
|
|
26539
26572
|
createContext as createContext15,
|
|
26540
26573
|
useCallback as useCallback38,
|
|
26541
26574
|
useContext as useContext27,
|
|
26542
|
-
useEffect as
|
|
26575
|
+
useEffect as useEffect37,
|
|
26543
26576
|
useMemo as useMemo54,
|
|
26544
26577
|
useRef as useRef64,
|
|
26545
26578
|
useState as useState59
|
|
@@ -26573,7 +26606,7 @@ function SideNavLayoutProvider(props) {
|
|
|
26573
26606
|
);
|
|
26574
26607
|
const bp = useBreakpoint();
|
|
26575
26608
|
const prevMdAndUp = useRef64(bp.mdAndUp);
|
|
26576
|
-
|
|
26609
|
+
useEffect37(() => {
|
|
26577
26610
|
if (prevMdAndUp.current && !bp.mdAndUp) {
|
|
26578
26611
|
setNavStateInternal((prev) => prev === "expanded" ? "collapse" : prev);
|
|
26579
26612
|
}
|
|
@@ -26660,7 +26693,7 @@ function SideNav(props) {
|
|
|
26660
26693
|
}
|
|
26661
26694
|
|
|
26662
26695
|
// src/components/Snackbar/useSnackbar.tsx
|
|
26663
|
-
import { useCallback as useCallback39, useEffect as
|
|
26696
|
+
import { useCallback as useCallback39, useEffect as useEffect38 } from "react";
|
|
26664
26697
|
function useSnackbar() {
|
|
26665
26698
|
const { setNotices, setOffset } = useSnackbarContext();
|
|
26666
26699
|
const onClose = useCallback39(
|
|
@@ -26710,7 +26743,7 @@ function useSnackbar() {
|
|
|
26710
26743
|
[onClose, setNotices]
|
|
26711
26744
|
);
|
|
26712
26745
|
const closeNotice = useCallback39((id) => onClose(id), [onClose]);
|
|
26713
|
-
const useSnackbarOffset = ({ bottom }) =>
|
|
26746
|
+
const useSnackbarOffset = ({ bottom }) => useEffect38(() => {
|
|
26714
26747
|
setOffset({ bottom });
|
|
26715
26748
|
return () => setOffset({});
|
|
26716
26749
|
}, [bottom]);
|
|
@@ -27430,7 +27463,7 @@ function visit(rows, fn) {
|
|
|
27430
27463
|
|
|
27431
27464
|
// src/components/Tabs.tsx
|
|
27432
27465
|
import { camelCase as camelCase7 } from "change-case";
|
|
27433
|
-
import { useEffect as
|
|
27466
|
+
import { useEffect as useEffect39, useMemo as useMemo56, useRef as useRef67, useState as useState60 } from "react";
|
|
27434
27467
|
import { mergeProps as mergeProps35, useFocusRing as useFocusRing20, useHover as useHover23 } from "react-aria";
|
|
27435
27468
|
import { matchPath } from "react-router";
|
|
27436
27469
|
import { Link as Link7, useLocation as useLocation2 } from "react-router-dom";
|
|
@@ -27493,7 +27526,7 @@ function Tabs(props) {
|
|
|
27493
27526
|
const tid = useTestIds(others, "tabs");
|
|
27494
27527
|
const [active, setActive] = useState60(selected);
|
|
27495
27528
|
const ref = useRef67(null);
|
|
27496
|
-
|
|
27529
|
+
useEffect39(() => setActive(selected), [selected]);
|
|
27497
27530
|
function onKeyUp(e) {
|
|
27498
27531
|
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
27499
27532
|
const nextTabValue = getNextTabValue(active, e.key, tabs);
|
|
@@ -28444,7 +28477,7 @@ function WorkflowHeader(props) {
|
|
|
28444
28477
|
}
|
|
28445
28478
|
|
|
28446
28479
|
// src/layouts/Workflow/useUnsavedChangesGuard.tsx
|
|
28447
|
-
import { useEffect as
|
|
28480
|
+
import { useEffect as useEffect40, useRef as useRef71 } from "react";
|
|
28448
28481
|
import { useBlocker } from "react-router-dom";
|
|
28449
28482
|
import { jsx as jsx237 } from "react/jsx-runtime";
|
|
28450
28483
|
function useUnsavedChangesGuard(options) {
|
|
@@ -28452,7 +28485,7 @@ function useUnsavedChangesGuard(options) {
|
|
|
28452
28485
|
const { openModal } = useModal();
|
|
28453
28486
|
const isDirtyRef = useRef71(isDirty);
|
|
28454
28487
|
isDirtyRef.current = isDirty;
|
|
28455
|
-
|
|
28488
|
+
useEffect40(() => {
|
|
28456
28489
|
const onBeforeUnload = (e) => {
|
|
28457
28490
|
if (isDirtyRef.current?.()) {
|
|
28458
28491
|
e.preventDefault();
|
|
@@ -28478,7 +28511,7 @@ function useUnsavedChangesGuard(options) {
|
|
|
28478
28511
|
function UnsavedChangesNavigationModal(props) {
|
|
28479
28512
|
const { proceed, cancelNavigation } = props;
|
|
28480
28513
|
const { openModal, closeModal } = useModal();
|
|
28481
|
-
|
|
28514
|
+
useEffect40(() => {
|
|
28482
28515
|
openModal({
|
|
28483
28516
|
allowClosing: false,
|
|
28484
28517
|
content: /* @__PURE__ */ jsx237(ConfirmCloseModal, { title: "Leave page?", onClose: proceed, onContinue: cancelNavigation })
|