@homebound/beam 2.416.0-alpha.1 → 2.416.1
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 +15 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +63 -56
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5127,7 +5127,7 @@ function CollapseToggle(props) {
|
|
|
5127
5127
|
import { useContext as useContext11 } from "react";
|
|
5128
5128
|
|
|
5129
5129
|
// src/inputs/Autocomplete.tsx
|
|
5130
|
-
import { useRef as useRef25 } from "react";
|
|
5130
|
+
import { useCallback as useCallback13, useRef as useRef25 } from "react";
|
|
5131
5131
|
import { useComboBox as useComboBox3, useOverlayPosition as useOverlayPosition5 } from "react-aria";
|
|
5132
5132
|
import { Item as Item5, useComboBoxState as useComboBoxState3 } from "react-stately";
|
|
5133
5133
|
|
|
@@ -10207,23 +10207,22 @@ function TreeSelectFieldBase(props) {
|
|
|
10207
10207
|
}));
|
|
10208
10208
|
}
|
|
10209
10209
|
}
|
|
10210
|
+
const comboBoxChildren = useCallback11(
|
|
10211
|
+
([item]) => /* @__PURE__ */ jsx55(Item3, { textValue: getOptionLabel(item), children: getOptionMenuLabel(item) }, valueToKey(getOptionValue(item))),
|
|
10212
|
+
[getOptionValue, getOptionLabel, getOptionMenuLabel]
|
|
10213
|
+
);
|
|
10210
10214
|
const comboBoxProps = {
|
|
10211
10215
|
...otherProps,
|
|
10212
10216
|
disabledKeys: Object.keys(disabledOptionsWithReasons),
|
|
10213
10217
|
placeholder: !values || values.length === 0 ? placeholder : "",
|
|
10214
10218
|
label: props.label,
|
|
10215
10219
|
inputValue: fieldState.inputValue,
|
|
10216
|
-
// where we might want to do flatmap and return diff kind of array (children ? add level prop) inside children callback - can put markup wrapper div adds padding
|
|
10217
|
-
// so we're not doing it multiple places
|
|
10218
10220
|
items: fieldState.filteredOptions,
|
|
10219
10221
|
isDisabled,
|
|
10220
10222
|
isReadOnly,
|
|
10221
10223
|
onInputChange,
|
|
10222
10224
|
onOpenChange,
|
|
10223
|
-
children:
|
|
10224
|
-
// what we're telling it to render. look at padding here - don't have to pass down to tree option - filtered options is where we're flat mapping
|
|
10225
|
-
/* @__PURE__ */ jsx55(Item3, { textValue: getOptionLabel(item), children: getOptionMenuLabel(item) }, valueToKey(getOptionValue(item)))
|
|
10226
|
-
)
|
|
10225
|
+
children: comboBoxChildren
|
|
10227
10226
|
};
|
|
10228
10227
|
const state = useComboBoxState({
|
|
10229
10228
|
...comboBoxProps,
|
|
@@ -10741,6 +10740,10 @@ function ComboBoxBase(props) {
|
|
|
10741
10740
|
const listBoxRef = useRef24(null);
|
|
10742
10741
|
const popoverRef = useRef24(null);
|
|
10743
10742
|
const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
|
|
10743
|
+
const comboBoxChildren = useCallback12(
|
|
10744
|
+
(item) => /* @__PURE__ */ jsx57(Item4, { textValue: getOptionLabel(item), children: getOptionMenuLabel(item) }, valueToKey(getOptionValue(item))),
|
|
10745
|
+
[getOptionValue, getOptionLabel, getOptionMenuLabel]
|
|
10746
|
+
);
|
|
10744
10747
|
const comboBoxProps = {
|
|
10745
10748
|
...otherProps,
|
|
10746
10749
|
disabledKeys: Object.keys(disabledOptionsWithReasons),
|
|
@@ -10750,7 +10753,7 @@ function ComboBoxBase(props) {
|
|
|
10750
10753
|
isReadOnly,
|
|
10751
10754
|
onInputChange,
|
|
10752
10755
|
onOpenChange,
|
|
10753
|
-
children:
|
|
10756
|
+
children: comboBoxChildren
|
|
10754
10757
|
};
|
|
10755
10758
|
const state = useComboBoxState2({
|
|
10756
10759
|
...comboBoxProps,
|
|
@@ -10950,6 +10953,10 @@ function Autocomplete(props) {
|
|
|
10950
10953
|
...others
|
|
10951
10954
|
} = props;
|
|
10952
10955
|
const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
|
|
10956
|
+
const comboBoxChildren = useCallback13(
|
|
10957
|
+
(item) => /* @__PURE__ */ jsx58(Item5, { textValue: getOptionLabel(item), children: getOptionMenuLabel ? getOptionMenuLabel(item) : getOptionLabel(item) }, getOptionValue(item)),
|
|
10958
|
+
[getOptionValue, getOptionLabel, getOptionMenuLabel]
|
|
10959
|
+
);
|
|
10953
10960
|
const comboBoxProps = {
|
|
10954
10961
|
isDisabled: !!disabled,
|
|
10955
10962
|
disabledKeys: Object.keys(disabledOptionsWithReasons),
|
|
@@ -10958,7 +10965,7 @@ function Autocomplete(props) {
|
|
|
10958
10965
|
items: options,
|
|
10959
10966
|
// Allow the user to type in a value that is not in the list. Allows for the text to stay in the input when the user clicks away
|
|
10960
10967
|
allowsCustomValue: true,
|
|
10961
|
-
children:
|
|
10968
|
+
children: comboBoxChildren,
|
|
10962
10969
|
onSelectionChange: (key) => {
|
|
10963
10970
|
if (key == null) return;
|
|
10964
10971
|
const selectedItem = options.find((i) => getOptionValue(i) === key);
|
|
@@ -11166,7 +11173,7 @@ function DateFieldMock(props) {
|
|
|
11166
11173
|
}
|
|
11167
11174
|
|
|
11168
11175
|
// src/inputs/DateFields/DateFieldBase.tsx
|
|
11169
|
-
import { useCallback as
|
|
11176
|
+
import { useCallback as useCallback14, useEffect as useEffect16, useRef as useRef28, useState as useState23 } from "react";
|
|
11170
11177
|
import { FocusScope as FocusScope3, useButton as useButton8, useOverlayPosition as useOverlayPosition6, useOverlayTrigger, useTextField as useTextField2 } from "react-aria";
|
|
11171
11178
|
import { isDateRange } from "react-day-picker";
|
|
11172
11179
|
import { useOverlayTriggerState } from "react-stately";
|
|
@@ -11346,7 +11353,7 @@ function DateFieldBase(props) {
|
|
|
11346
11353
|
);
|
|
11347
11354
|
}
|
|
11348
11355
|
}, [value, dateFormat]);
|
|
11349
|
-
const onChange =
|
|
11356
|
+
const onChange = useCallback14(
|
|
11350
11357
|
(d) => {
|
|
11351
11358
|
setWipValue(d);
|
|
11352
11359
|
if (d && isParsedDateValid(d)) {
|
|
@@ -13445,10 +13452,10 @@ function maybeApply(maybeFn) {
|
|
|
13445
13452
|
}
|
|
13446
13453
|
|
|
13447
13454
|
// src/components/Table/hooks/useColumnResizeHandlers.ts
|
|
13448
|
-
import { useCallback as
|
|
13455
|
+
import { useCallback as useCallback15, useRef as useRef37 } from "react";
|
|
13449
13456
|
function useColumnResizeHandlers(columns, columnSizes, tableWidth, setResizedWidth, setResizedWidths) {
|
|
13450
13457
|
const hasLockedColumnsRef = useRef37(false);
|
|
13451
|
-
const distributeAdjustment =
|
|
13458
|
+
const distributeAdjustment = useCallback15(
|
|
13452
13459
|
(rightColumns, totalRightWidth, adjustment) => {
|
|
13453
13460
|
const updates = {};
|
|
13454
13461
|
let remainingAdjustment = adjustment;
|
|
@@ -13463,7 +13470,7 @@ function useColumnResizeHandlers(columns, columnSizes, tableWidth, setResizedWid
|
|
|
13463
13470
|
},
|
|
13464
13471
|
[]
|
|
13465
13472
|
);
|
|
13466
|
-
const calculateResizeUpdates =
|
|
13473
|
+
const calculateResizeUpdates = useCallback15(
|
|
13467
13474
|
(columnId, newWidth, columnIndex) => {
|
|
13468
13475
|
if (!tableWidth || !columnSizes || columnSizes.length === 0) {
|
|
13469
13476
|
return null;
|
|
@@ -13509,7 +13516,7 @@ function useColumnResizeHandlers(columns, columnSizes, tableWidth, setResizedWid
|
|
|
13509
13516
|
},
|
|
13510
13517
|
[tableWidth, columnSizes, columns, distributeAdjustment]
|
|
13511
13518
|
);
|
|
13512
|
-
const calculatePreviewWidth =
|
|
13519
|
+
const calculatePreviewWidth = useCallback15(
|
|
13513
13520
|
(columnId, newWidth, columnIndex) => {
|
|
13514
13521
|
const result = calculateResizeUpdates(columnId, newWidth, columnIndex);
|
|
13515
13522
|
if (!result) {
|
|
@@ -13519,7 +13526,7 @@ function useColumnResizeHandlers(columns, columnSizes, tableWidth, setResizedWid
|
|
|
13519
13526
|
},
|
|
13520
13527
|
[calculateResizeUpdates]
|
|
13521
13528
|
);
|
|
13522
|
-
const handleColumnResize =
|
|
13529
|
+
const handleColumnResize = useCallback15(
|
|
13523
13530
|
(columnId, newWidth, columnIndex) => {
|
|
13524
13531
|
const result = calculateResizeUpdates(columnId, newWidth, columnIndex);
|
|
13525
13532
|
if (!result) {
|
|
@@ -13575,10 +13582,10 @@ function useScrollStorage(tableId, enabled = true) {
|
|
|
13575
13582
|
}
|
|
13576
13583
|
|
|
13577
13584
|
// src/hooks/useRenderCount.ts
|
|
13578
|
-
import { useCallback as
|
|
13585
|
+
import { useCallback as useCallback16, useRef as useRef38 } from "react";
|
|
13579
13586
|
function useRenderCount() {
|
|
13580
13587
|
const ref = useRef38(/* @__PURE__ */ new Map());
|
|
13581
|
-
const getCount =
|
|
13588
|
+
const getCount = useCallback16((id) => {
|
|
13582
13589
|
const count = ref.current.get(id) || 1;
|
|
13583
13590
|
ref.current.set(id, count + 1);
|
|
13584
13591
|
return { "data-render": count };
|
|
@@ -14095,7 +14102,7 @@ function ToggleChips(props) {
|
|
|
14095
14102
|
|
|
14096
14103
|
// src/components/Accordion.tsx
|
|
14097
14104
|
import { useId, useResizeObserver as useResizeObserver2 } from "@react-aria/utils";
|
|
14098
|
-
import { useCallback as
|
|
14105
|
+
import { useCallback as useCallback17, useEffect as useEffect19, useMemo as useMemo25, useRef as useRef40, useState as useState29 } from "react";
|
|
14099
14106
|
import { useFocusRing as useFocusRing10 } from "react-aria";
|
|
14100
14107
|
import { jsx as jsx84, jsxs as jsxs48 } from "@emotion/react/jsx-runtime";
|
|
14101
14108
|
function Accordion(props) {
|
|
@@ -14127,13 +14134,13 @@ function Accordion(props) {
|
|
|
14127
14134
|
useEffect19(() => {
|
|
14128
14135
|
setContentHeight(expanded && contentRef.current ? `${contentRef.current.scrollHeight}px` : "0");
|
|
14129
14136
|
}, [expanded]);
|
|
14130
|
-
const onResize =
|
|
14137
|
+
const onResize = useCallback17(() => {
|
|
14131
14138
|
if (contentRef.current && expanded) {
|
|
14132
14139
|
setContentHeight(`${contentRef.current.scrollHeight}px`);
|
|
14133
14140
|
}
|
|
14134
14141
|
}, [expanded, setContentHeight]);
|
|
14135
14142
|
useResizeObserver2({ ref: contentRef, onResize });
|
|
14136
|
-
const toggle =
|
|
14143
|
+
const toggle = useCallback17(() => {
|
|
14137
14144
|
setExpanded((prev) => !prev);
|
|
14138
14145
|
if (setExpandedIndex) setExpandedIndex(index);
|
|
14139
14146
|
if (onToggle) onToggle();
|
|
@@ -14325,7 +14332,7 @@ import { OverlayProvider } from "react-aria";
|
|
|
14325
14332
|
|
|
14326
14333
|
// src/components/Modal/Modal.tsx
|
|
14327
14334
|
import { useResizeObserver as useResizeObserver3 } from "@react-aria/utils";
|
|
14328
|
-
import { useCallback as
|
|
14335
|
+
import { useCallback as useCallback18, useEffect as useEffect22, useRef as useRef42, useState as useState31 } from "react";
|
|
14329
14336
|
import { FocusScope as FocusScope4, OverlayContainer as OverlayContainer2, useDialog, useModal as useModal2, useOverlay as useOverlay2, usePreventScroll } from "react-aria";
|
|
14330
14337
|
import { createPortal as createPortal2 } from "react-dom";
|
|
14331
14338
|
|
|
@@ -14424,7 +14431,7 @@ function Modal(props) {
|
|
|
14424
14431
|
const [hasScroll, setHasScroll] = useState31(forceScrolling ?? false);
|
|
14425
14432
|
useResizeObserver3({
|
|
14426
14433
|
ref: modalBodyRef,
|
|
14427
|
-
onResize:
|
|
14434
|
+
onResize: useCallback18(
|
|
14428
14435
|
() => {
|
|
14429
14436
|
const target = modalBodyRef.current;
|
|
14430
14437
|
if (forceScrolling === void 0 && !isFixedHeight) {
|
|
@@ -14655,7 +14662,7 @@ function SuperDrawer() {
|
|
|
14655
14662
|
}
|
|
14656
14663
|
|
|
14657
14664
|
// src/components/Layout/FormPageLayout.tsx
|
|
14658
|
-
import React16, { createRef, useCallback as
|
|
14665
|
+
import React16, { createRef, useCallback as useCallback22, useEffect as useEffect24, useMemo as useMemo33, useRef as useRef44, useState as useState37 } from "react";
|
|
14659
14666
|
import { useButton as useButton9, useFocusRing as useFocusRing11 } from "react-aria";
|
|
14660
14667
|
|
|
14661
14668
|
// src/forms/BoundCheckboxField.tsx
|
|
@@ -14881,7 +14888,7 @@ function BoundDateRangeField(props) {
|
|
|
14881
14888
|
}
|
|
14882
14889
|
|
|
14883
14890
|
// src/forms/BoundForm.tsx
|
|
14884
|
-
import { useCallback as
|
|
14891
|
+
import { useCallback as useCallback20, useMemo as useMemo30 } from "react";
|
|
14885
14892
|
|
|
14886
14893
|
// src/forms/BoundIconCardField.tsx
|
|
14887
14894
|
import { Observer as Observer6 } from "mobx-react";
|
|
@@ -14910,7 +14917,7 @@ function BoundIconCardField(props) {
|
|
|
14910
14917
|
import { Observer as Observer7 } from "mobx-react";
|
|
14911
14918
|
|
|
14912
14919
|
// src/inputs/IconCardGroup.tsx
|
|
14913
|
-
import { useCallback as
|
|
14920
|
+
import { useCallback as useCallback19, useMemo as useMemo29, useState as useState33 } from "react";
|
|
14914
14921
|
import { mergeProps as mergeProps11, useField } from "react-aria";
|
|
14915
14922
|
import { jsx as jsx100, jsxs as jsxs55 } from "@emotion/react/jsx-runtime";
|
|
14916
14923
|
function IconCardGroup(props) {
|
|
@@ -14927,7 +14934,7 @@ function IconCardGroup(props) {
|
|
|
14927
14934
|
} = props;
|
|
14928
14935
|
const [selected, setSelected] = useState33(values);
|
|
14929
14936
|
const exclusiveOptions = useMemo29(() => options.filter((o) => o.exclusive), [options]);
|
|
14930
|
-
const toggleValue =
|
|
14937
|
+
const toggleValue = useCallback19(
|
|
14931
14938
|
(value) => {
|
|
14932
14939
|
if (isDisabled) return;
|
|
14933
14940
|
const option = options.find((o) => o.value === value);
|
|
@@ -15590,7 +15597,7 @@ var listFieldPrefix = "listField";
|
|
|
15590
15597
|
function BoundForm(props) {
|
|
15591
15598
|
const { rows, formState } = props;
|
|
15592
15599
|
const tid = useTestIds({}, "boundForm");
|
|
15593
|
-
const getRowKey =
|
|
15600
|
+
const getRowKey = useCallback20((row, rowType) => {
|
|
15594
15601
|
return `${rowType}-${Object.keys(row).join("-")}`;
|
|
15595
15602
|
}, []);
|
|
15596
15603
|
return /* @__PURE__ */ jsx115("div", { ...tid, children: /* @__PURE__ */ jsx115(FormLines, { width: "full", gap: 3.5, children: rows.map(
|
|
@@ -15932,7 +15939,7 @@ function IconButtonList({ content, selectedIcon, onIconClick }) {
|
|
|
15932
15939
|
}
|
|
15933
15940
|
|
|
15934
15941
|
// src/components/Toast/ToastContext.tsx
|
|
15935
|
-
import { createContext as createContext5, useCallback as
|
|
15942
|
+
import { createContext as createContext5, useCallback as useCallback21, useContext as useContext14, useMemo as useMemo31, useState as useState35 } from "react";
|
|
15936
15943
|
import { jsx as jsx122 } from "@emotion/react/jsx-runtime";
|
|
15937
15944
|
var ToastContext = createContext5({
|
|
15938
15945
|
setNotice: () => {
|
|
@@ -15944,7 +15951,7 @@ var ToastContext = createContext5({
|
|
|
15944
15951
|
});
|
|
15945
15952
|
function ToastProvider(props) {
|
|
15946
15953
|
const [notice, setNotice] = useState35();
|
|
15947
|
-
const clear =
|
|
15954
|
+
const clear = useCallback21(() => setNotice(void 0), [setNotice]);
|
|
15948
15955
|
const contextValue = useMemo31(() => ({ setNotice, notice, clear }), [notice, clear]);
|
|
15949
15956
|
return /* @__PURE__ */ jsx122(ToastContext.Provider, { value: contextValue, children: props.children });
|
|
15950
15957
|
}
|
|
@@ -16104,7 +16111,7 @@ function SectionNavLink(props) {
|
|
|
16104
16111
|
const { sectionWithRef, activeSection } = props;
|
|
16105
16112
|
const { section, ref: sectionRef } = sectionWithRef;
|
|
16106
16113
|
const active = activeSection === sectionWithRef.sectionKey;
|
|
16107
|
-
const handleNavClick =
|
|
16114
|
+
const handleNavClick = useCallback22(() => {
|
|
16108
16115
|
sectionRef.current?.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
16109
16116
|
}, [sectionRef]);
|
|
16110
16117
|
const tids = useTestIds(props);
|
|
@@ -17316,7 +17323,7 @@ function PreventBrowserScroll({ children }) {
|
|
|
17316
17323
|
}
|
|
17317
17324
|
|
|
17318
17325
|
// src/components/Layout/RightPaneLayout/RightPaneContext.tsx
|
|
17319
|
-
import React18, { useCallback as
|
|
17326
|
+
import React18, { useCallback as useCallback23, useContext as useContext15, useMemo as useMemo38, useState as useState41 } from "react";
|
|
17320
17327
|
import { jsx as jsx148 } from "@emotion/react/jsx-runtime";
|
|
17321
17328
|
var RightPaneContext = React18.createContext({
|
|
17322
17329
|
openInPane: () => {
|
|
@@ -17331,15 +17338,15 @@ var RightPaneContext = React18.createContext({
|
|
|
17331
17338
|
function RightPaneProvider({ children }) {
|
|
17332
17339
|
const [rightPaneContent, setRightPaneContent] = useState41(void 0);
|
|
17333
17340
|
const [isRightPaneOpen, setIsRightPaneOpen] = useState41(false);
|
|
17334
|
-
const openInPane =
|
|
17341
|
+
const openInPane = useCallback23(
|
|
17335
17342
|
(opts) => {
|
|
17336
17343
|
setRightPaneContent(opts?.content);
|
|
17337
17344
|
setIsRightPaneOpen(true);
|
|
17338
17345
|
},
|
|
17339
17346
|
[setRightPaneContent]
|
|
17340
17347
|
);
|
|
17341
|
-
const closePane =
|
|
17342
|
-
const clearPane =
|
|
17348
|
+
const closePane = useCallback23(() => setIsRightPaneOpen(false), []);
|
|
17349
|
+
const clearPane = useCallback23(() => setRightPaneContent(void 0), [setRightPaneContent]);
|
|
17343
17350
|
const context = useMemo38(
|
|
17344
17351
|
() => ({ openInPane, closePane, clearPane, rightPaneContent, isRightPaneOpen }),
|
|
17345
17352
|
[openInPane, closePane, rightPaneContent, clearPane, isRightPaneOpen]
|
|
@@ -17707,7 +17714,7 @@ function Copy(props) {
|
|
|
17707
17714
|
|
|
17708
17715
|
// src/components/DnDGrid/DnDGrid.tsx
|
|
17709
17716
|
import equal2 from "fast-deep-equal";
|
|
17710
|
-
import { useCallback as
|
|
17717
|
+
import { useCallback as useCallback24, useRef as useRef50 } from "react";
|
|
17711
17718
|
|
|
17712
17719
|
// src/components/DnDGrid/DnDGridContext.tsx
|
|
17713
17720
|
import { createContext as createContext7, useContext as useContext17 } from "react";
|
|
@@ -17731,19 +17738,19 @@ function DnDGrid(props) {
|
|
|
17731
17738
|
const reorderViaKeyboard = useRef50(false);
|
|
17732
17739
|
const transformFrom = useRef50({ x: 0, y: 0 });
|
|
17733
17740
|
const tid = useTestIds(props, "dndGrid");
|
|
17734
|
-
const getGridItems =
|
|
17741
|
+
const getGridItems = useCallback24(() => {
|
|
17735
17742
|
return gridEl.current ? Array.from(gridEl.current.querySelectorAll(`[${gridItemIdKey}]`)) : [];
|
|
17736
17743
|
}, []);
|
|
17737
|
-
const getGridItemIdOrder =
|
|
17744
|
+
const getGridItemIdOrder = useCallback24(() => {
|
|
17738
17745
|
return getGridItems().map((child) => child.getAttribute(gridItemIdKey)).filter(isDefined);
|
|
17739
17746
|
}, [getGridItems]);
|
|
17740
|
-
const initReorder =
|
|
17747
|
+
const initReorder = useCallback24(() => {
|
|
17741
17748
|
if (gridEl.current && dragEl.current) {
|
|
17742
17749
|
initialOrder.current = getGridItemIdOrder();
|
|
17743
17750
|
dragEl.current.classList.add(activeGridItemClass);
|
|
17744
17751
|
}
|
|
17745
17752
|
}, [getGridItemIdOrder]);
|
|
17746
|
-
const commitReorder =
|
|
17753
|
+
const commitReorder = useCallback24(() => {
|
|
17747
17754
|
if (gridEl.current && dragEl.current) {
|
|
17748
17755
|
const currentOrder = getGridItemIdOrder();
|
|
17749
17756
|
if (!equal2(currentOrder, initialOrder.current)) onReorder(currentOrder);
|
|
@@ -17753,7 +17760,7 @@ function DnDGrid(props) {
|
|
|
17753
17760
|
initialOrder.current = currentOrder;
|
|
17754
17761
|
}
|
|
17755
17762
|
}, [onReorder, getGridItemIdOrder]);
|
|
17756
|
-
const cancelReorder =
|
|
17763
|
+
const cancelReorder = useCallback24(() => {
|
|
17757
17764
|
if (gridEl.current && dragEl.current && initialOrder.current) {
|
|
17758
17765
|
const currentOrder = getGridItemIdOrder();
|
|
17759
17766
|
if (!equal2(currentOrder, initialOrder.current)) {
|
|
@@ -17775,7 +17782,7 @@ function DnDGrid(props) {
|
|
|
17775
17782
|
reorderViaKeyboard.current = false;
|
|
17776
17783
|
}
|
|
17777
17784
|
}, [getGridItemIdOrder, getGridItems]);
|
|
17778
|
-
const onMove =
|
|
17785
|
+
const onMove = useCallback24((e) => {
|
|
17779
17786
|
if (!reorderViaKeyboard.current && dragEl.current && cloneEl.current && gridEl.current) {
|
|
17780
17787
|
const clientX = "clientX" in e ? e.clientX : e.touches[0].clientX;
|
|
17781
17788
|
const clientY = "clientY" in e ? e.clientY : e.touches[0].clientY;
|
|
@@ -17796,7 +17803,7 @@ function DnDGrid(props) {
|
|
|
17796
17803
|
}
|
|
17797
17804
|
}
|
|
17798
17805
|
}, []);
|
|
17799
|
-
const onDragStart =
|
|
17806
|
+
const onDragStart = useCallback24(
|
|
17800
17807
|
(e) => {
|
|
17801
17808
|
if (!reorderViaKeyboard.current && dragEl.current && gridEl.current) {
|
|
17802
17809
|
initReorder();
|
|
@@ -17826,7 +17833,7 @@ function DnDGrid(props) {
|
|
|
17826
17833
|
},
|
|
17827
17834
|
[initReorder, onMove]
|
|
17828
17835
|
);
|
|
17829
|
-
const onDragEnd =
|
|
17836
|
+
const onDragEnd = useCallback24(
|
|
17830
17837
|
(e) => {
|
|
17831
17838
|
if (!reorderViaKeyboard.current && dragEl.current && cloneEl.current && gridEl.current) {
|
|
17832
17839
|
e.preventDefault();
|
|
@@ -17842,7 +17849,7 @@ function DnDGrid(props) {
|
|
|
17842
17849
|
},
|
|
17843
17850
|
[commitReorder, onMove]
|
|
17844
17851
|
);
|
|
17845
|
-
const onDragHandleKeyDown =
|
|
17852
|
+
const onDragHandleKeyDown = useCallback24(
|
|
17846
17853
|
(e) => {
|
|
17847
17854
|
const moveHandle = e.target;
|
|
17848
17855
|
if (dragEl.current instanceof HTMLElement && moveHandle instanceof HTMLElement && gridEl.current) {
|
|
@@ -18097,7 +18104,7 @@ function HbSpinnerProvider({ quips = [], children }) {
|
|
|
18097
18104
|
|
|
18098
18105
|
// src/components/MaxLines.tsx
|
|
18099
18106
|
import { useLayoutEffect as useLayoutEffect2, useResizeObserver as useResizeObserver5 } from "@react-aria/utils";
|
|
18100
|
-
import { useCallback as
|
|
18107
|
+
import { useCallback as useCallback25, useEffect as useEffect29, useRef as useRef51, useState as useState43 } from "react";
|
|
18101
18108
|
import { jsx as jsx161, jsxs as jsxs79 } from "@emotion/react/jsx-runtime";
|
|
18102
18109
|
function MaxLines({ maxLines, children }) {
|
|
18103
18110
|
const elRef = useRef51(null);
|
|
@@ -18110,7 +18117,7 @@ function MaxLines({ maxLines, children }) {
|
|
|
18110
18117
|
useEffect29(() => {
|
|
18111
18118
|
setExpanded(false);
|
|
18112
18119
|
}, [children]);
|
|
18113
|
-
const onResize =
|
|
18120
|
+
const onResize = useCallback25(() => {
|
|
18114
18121
|
if (!elRef.current) return;
|
|
18115
18122
|
!expanded && setHasMore(elRef.current.scrollHeight > elRef.current.clientHeight);
|
|
18116
18123
|
}, [expanded]);
|
|
@@ -18123,7 +18130,7 @@ function MaxLines({ maxLines, children }) {
|
|
|
18123
18130
|
|
|
18124
18131
|
// src/components/ScrollShadows.tsx
|
|
18125
18132
|
import { useResizeObserver as useResizeObserver6 } from "@react-aria/utils";
|
|
18126
|
-
import { useCallback as
|
|
18133
|
+
import { useCallback as useCallback26, useMemo as useMemo44, useRef as useRef52, useState as useState44 } from "react";
|
|
18127
18134
|
import { jsx as jsx162, jsxs as jsxs80 } from "@emotion/react/jsx-runtime";
|
|
18128
18135
|
function ScrollShadows(props) {
|
|
18129
18136
|
const { children, xss, horizontal = false, bgColor = "rgba(255,255,255,1)" /* White */ } = props;
|
|
@@ -18147,7 +18154,7 @@ function ScrollShadows(props) {
|
|
|
18147
18154
|
{ ...commonStyles, ...endShadowStyles2, ...Css.add("background", endGradient).$ }
|
|
18148
18155
|
];
|
|
18149
18156
|
}, [horizontal, bgColor]);
|
|
18150
|
-
const updateScrollProps =
|
|
18157
|
+
const updateScrollProps = useCallback26(
|
|
18151
18158
|
(el) => {
|
|
18152
18159
|
const { scrollTop, scrollHeight, clientHeight, scrollWidth, scrollLeft, clientWidth } = el;
|
|
18153
18160
|
const start = horizontal ? scrollLeft : scrollTop;
|
|
@@ -18158,7 +18165,7 @@ function ScrollShadows(props) {
|
|
|
18158
18165
|
},
|
|
18159
18166
|
[horizontal]
|
|
18160
18167
|
);
|
|
18161
|
-
const onResize =
|
|
18168
|
+
const onResize = useCallback26(() => scrollRef.current && updateScrollProps(scrollRef.current), [updateScrollProps]);
|
|
18162
18169
|
useResizeObserver6({ ref: scrollRef, onResize });
|
|
18163
18170
|
return /* @__PURE__ */ jsxs80(
|
|
18164
18171
|
"div",
|
|
@@ -18186,10 +18193,10 @@ function ScrollShadows(props) {
|
|
|
18186
18193
|
}
|
|
18187
18194
|
|
|
18188
18195
|
// src/components/Snackbar/useSnackbar.tsx
|
|
18189
|
-
import { useCallback as
|
|
18196
|
+
import { useCallback as useCallback27, useEffect as useEffect30 } from "react";
|
|
18190
18197
|
function useSnackbar() {
|
|
18191
18198
|
const { setNotices, setOffset } = useSnackbarContext();
|
|
18192
|
-
const onClose =
|
|
18199
|
+
const onClose = useCallback27(
|
|
18193
18200
|
(noticeId) => {
|
|
18194
18201
|
setNotices((prev) => {
|
|
18195
18202
|
let returnValue = prev;
|
|
@@ -18206,7 +18213,7 @@ function useSnackbar() {
|
|
|
18206
18213
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18207
18214
|
[]
|
|
18208
18215
|
);
|
|
18209
|
-
const triggerNotice =
|
|
18216
|
+
const triggerNotice = useCallback27(
|
|
18210
18217
|
(props) => {
|
|
18211
18218
|
const noticeId = props.id ?? `beamSnackbar:${snackbarId++}`;
|
|
18212
18219
|
let maybeTimeout;
|
|
@@ -18235,7 +18242,7 @@ function useSnackbar() {
|
|
|
18235
18242
|
},
|
|
18236
18243
|
[onClose, setNotices]
|
|
18237
18244
|
);
|
|
18238
|
-
const closeNotice =
|
|
18245
|
+
const closeNotice = useCallback27((id) => onClose(id), [onClose]);
|
|
18239
18246
|
const useSnackbarOffset = ({ bottom }) => useEffect30(() => {
|
|
18240
18247
|
setOffset({ bottom });
|
|
18241
18248
|
return () => setOffset({});
|
|
@@ -18740,10 +18747,10 @@ function hideTabs(props) {
|
|
|
18740
18747
|
}
|
|
18741
18748
|
|
|
18742
18749
|
// src/components/Toast/useToast.tsx
|
|
18743
|
-
import { useCallback as
|
|
18750
|
+
import { useCallback as useCallback28 } from "react";
|
|
18744
18751
|
function useToast() {
|
|
18745
18752
|
const { setNotice, clear } = useToastContext();
|
|
18746
|
-
const showToast =
|
|
18753
|
+
const showToast = useCallback28((props) => setNotice(props), [setNotice]);
|
|
18747
18754
|
return { showToast, clear };
|
|
18748
18755
|
}
|
|
18749
18756
|
export {
|