@uniformdev/design-system 20.55.2-alpha.2 → 20.56.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/esm/index.js +254 -179
- package/dist/index.d.mts +51 -18
- package/dist/index.d.ts +51 -18
- package/dist/index.js +991 -916
- package/package.json +6 -6
package/dist/esm/index.js
CHANGED
|
@@ -4059,7 +4059,7 @@ var UniformLogoLarge = ({ ...props }) => {
|
|
|
4059
4059
|
// src/components/ButtonWithMenu/ButtonWithMenu.tsx
|
|
4060
4060
|
import { CgChevronDown as CgChevronDown3 } from "@react-icons/all-files/cg/CgChevronDown";
|
|
4061
4061
|
import { MdCheckCircle } from "@react-icons/all-files/md/MdCheckCircle";
|
|
4062
|
-
import { useEffect as useEffect5, useRef as useRef3, useState as
|
|
4062
|
+
import { useEffect as useEffect5, useRef as useRef3, useState as useState6 } from "react";
|
|
4063
4063
|
|
|
4064
4064
|
// src/components/LoadingOverlay/LoadingOverlay.styles.ts
|
|
4065
4065
|
import { css as css23 } from "@emotion/react";
|
|
@@ -4914,7 +4914,8 @@ var MenuSelect = forwardRef6(
|
|
|
4914
4914
|
);
|
|
4915
4915
|
|
|
4916
4916
|
// src/components/Menu/SearchableMenu.tsx
|
|
4917
|
-
import {
|
|
4917
|
+
import { useMenuContext } from "@ariakit/react";
|
|
4918
|
+
import { useEffect as useEffect4, useRef as useRef2, useState as useState5 } from "react";
|
|
4918
4919
|
|
|
4919
4920
|
// src/components/Input/styles/CaptionText.styles.ts
|
|
4920
4921
|
import { css as css28 } from "@emotion/react";
|
|
@@ -6168,9 +6169,11 @@ var SearchableMenu = (props) => {
|
|
|
6168
6169
|
}
|
|
6169
6170
|
);
|
|
6170
6171
|
};
|
|
6171
|
-
function MenuSearch({ onSearchTextChanged, searchPlaceholder }) {
|
|
6172
|
+
function MenuSearch({ onSearchTextChanged, searchPlaceholder, onSearchEnterKeyDown }) {
|
|
6172
6173
|
const searchInputRef = useRef2(null);
|
|
6173
6174
|
const hasFocusedRef = useRef2(false);
|
|
6175
|
+
const [currentSearchText, setCurrentSearchText] = useState5("");
|
|
6176
|
+
const menu = useMenuContext();
|
|
6174
6177
|
useEffect4(() => {
|
|
6175
6178
|
if (hasFocusedRef.current || !searchInputRef.current) {
|
|
6176
6179
|
return;
|
|
@@ -6182,11 +6185,71 @@ function MenuSearch({ onSearchTextChanged, searchPlaceholder }) {
|
|
|
6182
6185
|
}
|
|
6183
6186
|
}, 50);
|
|
6184
6187
|
});
|
|
6188
|
+
const handleSearchTextChanged = (text) => {
|
|
6189
|
+
setCurrentSearchText(text);
|
|
6190
|
+
onSearchTextChanged(text);
|
|
6191
|
+
};
|
|
6192
|
+
useEffect4(() => {
|
|
6193
|
+
if (!menu) {
|
|
6194
|
+
return;
|
|
6195
|
+
}
|
|
6196
|
+
if (!currentSearchText) {
|
|
6197
|
+
menu.setActiveId(null);
|
|
6198
|
+
return;
|
|
6199
|
+
}
|
|
6200
|
+
const timer = setTimeout(() => {
|
|
6201
|
+
var _a;
|
|
6202
|
+
const { renderedItems } = menu.getState();
|
|
6203
|
+
const enabledItems = renderedItems.filter((item) => !item.disabled);
|
|
6204
|
+
if (enabledItems.length > 0) {
|
|
6205
|
+
menu.setActiveId(enabledItems[0].id);
|
|
6206
|
+
(_a = enabledItems[0].element) == null ? void 0 : _a.scrollIntoView({ block: "nearest" });
|
|
6207
|
+
} else {
|
|
6208
|
+
menu.setActiveId(null);
|
|
6209
|
+
}
|
|
6210
|
+
}, 0);
|
|
6211
|
+
return () => clearTimeout(timer);
|
|
6212
|
+
}, [menu, currentSearchText]);
|
|
6213
|
+
const handleKeyDown = (e) => {
|
|
6214
|
+
var _a, _b;
|
|
6215
|
+
if (!menu) {
|
|
6216
|
+
return;
|
|
6217
|
+
}
|
|
6218
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
6219
|
+
e.preventDefault();
|
|
6220
|
+
const { renderedItems, activeId } = menu.getState();
|
|
6221
|
+
const enabledItems = renderedItems.filter((item) => !item.disabled);
|
|
6222
|
+
if (enabledItems.length === 0) {
|
|
6223
|
+
return;
|
|
6224
|
+
}
|
|
6225
|
+
const currentIndex = activeId ? enabledItems.findIndex((item) => item.id === activeId) : -1;
|
|
6226
|
+
let nextIndex;
|
|
6227
|
+
if (e.key === "ArrowDown") {
|
|
6228
|
+
nextIndex = currentIndex < enabledItems.length - 1 ? currentIndex + 1 : 0;
|
|
6229
|
+
} else {
|
|
6230
|
+
nextIndex = currentIndex > 0 ? currentIndex - 1 : enabledItems.length - 1;
|
|
6231
|
+
}
|
|
6232
|
+
const nextItem = enabledItems[nextIndex];
|
|
6233
|
+
menu.setActiveId(nextItem.id);
|
|
6234
|
+
(_a = nextItem.element) == null ? void 0 : _a.scrollIntoView({ block: "nearest" });
|
|
6235
|
+
}
|
|
6236
|
+
if (e.key === "Enter") {
|
|
6237
|
+
const { activeId, renderedItems } = menu.getState();
|
|
6238
|
+
if (activeId) {
|
|
6239
|
+
e.preventDefault();
|
|
6240
|
+
const activeItem = renderedItems.find((item) => item.id === activeId);
|
|
6241
|
+
(_b = activeItem == null ? void 0 : activeItem.element) == null ? void 0 : _b.click();
|
|
6242
|
+
} else {
|
|
6243
|
+
onSearchEnterKeyDown == null ? void 0 : onSearchEnterKeyDown();
|
|
6244
|
+
}
|
|
6245
|
+
}
|
|
6246
|
+
};
|
|
6185
6247
|
return /* @__PURE__ */ jsx49(
|
|
6186
6248
|
DebouncedInputKeywordSearch,
|
|
6187
6249
|
{
|
|
6188
6250
|
ref: searchInputRef,
|
|
6189
|
-
onSearchTextChanged,
|
|
6251
|
+
onSearchTextChanged: handleSearchTextChanged,
|
|
6252
|
+
onKeyDown: handleKeyDown,
|
|
6190
6253
|
rounded: true,
|
|
6191
6254
|
compact: "xs",
|
|
6192
6255
|
placeholder: searchPlaceholder != null ? searchPlaceholder : "Search..."
|
|
@@ -6464,7 +6527,7 @@ var ButtonWithMenu = ({
|
|
|
6464
6527
|
const buttonSize = size === "base" ? "md" : size;
|
|
6465
6528
|
const btnSize2 = getButtonSize(buttonSize);
|
|
6466
6529
|
const variant = "variant" in buttonProps && buttonProps.variant === "soft" ? "soft" : void 0;
|
|
6467
|
-
const [showSuccess, setShowSuccess] =
|
|
6530
|
+
const [showSuccess, setShowSuccess] = useState6(false);
|
|
6468
6531
|
const previousDisabledRef = useRef3(disabledValue);
|
|
6469
6532
|
useEffect5(() => {
|
|
6470
6533
|
if (previousDisabledRef.current === "loading" && disabledValue === false) {
|
|
@@ -6578,7 +6641,7 @@ var ButtonWithMenu = ({
|
|
|
6578
6641
|
|
|
6579
6642
|
// src/components/Calendar/Calendar.tsx
|
|
6580
6643
|
import { isToday, parseDate, today } from "@internationalized/date";
|
|
6581
|
-
import { useCallback as useCallback3, useState as
|
|
6644
|
+
import { useCallback as useCallback3, useState as useState7 } from "react";
|
|
6582
6645
|
import {
|
|
6583
6646
|
Button as AriaButton,
|
|
6584
6647
|
Calendar as AriaCalendar,
|
|
@@ -6705,13 +6768,16 @@ var Calendar = ({
|
|
|
6705
6768
|
minValue,
|
|
6706
6769
|
maxValue,
|
|
6707
6770
|
onChange,
|
|
6771
|
+
styles: stylesProp,
|
|
6708
6772
|
autoFocus,
|
|
6709
6773
|
isDisabled,
|
|
6710
6774
|
isInvalid,
|
|
6711
6775
|
isReadOnly,
|
|
6776
|
+
withTodayButton = true,
|
|
6777
|
+
isDateUnavailable,
|
|
6712
6778
|
...props
|
|
6713
6779
|
}) => {
|
|
6714
|
-
const [focusedValue, setFocusedValue] =
|
|
6780
|
+
const [focusedValue, setFocusedValue] = useState7(void 0);
|
|
6715
6781
|
const today_date = today(timeZone);
|
|
6716
6782
|
const minDate = tryParseDate(minValue);
|
|
6717
6783
|
const maxDate = tryParseDate(maxValue);
|
|
@@ -6740,6 +6806,9 @@ var Calendar = ({
|
|
|
6740
6806
|
isDisabled,
|
|
6741
6807
|
isReadOnly,
|
|
6742
6808
|
isInvalid,
|
|
6809
|
+
isDateUnavailable: isDateUnavailable ? (date) => {
|
|
6810
|
+
return isDateUnavailable(date.toDate(timeZone));
|
|
6811
|
+
} : void 0,
|
|
6743
6812
|
children: [
|
|
6744
6813
|
/* @__PURE__ */ jsxs34("header", { css: header, children: [
|
|
6745
6814
|
/* @__PURE__ */ jsx52(Heading, { css: [h6, headerTitle] }),
|
|
@@ -6760,22 +6829,26 @@ var Calendar = ({
|
|
|
6760
6829
|
}
|
|
6761
6830
|
)
|
|
6762
6831
|
] }),
|
|
6763
|
-
/* @__PURE__ */ jsx52(CalendarGrid, { children: (date) =>
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6832
|
+
/* @__PURE__ */ jsx52(CalendarGrid, { children: (date) => {
|
|
6833
|
+
var _a, _b;
|
|
6834
|
+
return /* @__PURE__ */ jsx52(
|
|
6835
|
+
CalendarCell,
|
|
6836
|
+
{
|
|
6837
|
+
css: [
|
|
6838
|
+
cell,
|
|
6839
|
+
minDate && date.compare(minDate) < 0 ? cellIsOutsideRange : null,
|
|
6840
|
+
maxDate && date.compare(maxDate) > 0 ? cellIsOutsideRange : null,
|
|
6841
|
+
isToday(date, timeZone) ? cellIsToday : null,
|
|
6842
|
+
...(_b = (_a = stylesProp == null ? void 0 : stylesProp.calendarCell) == null ? void 0 : _a.call(stylesProp, date.toDate(timeZone))) != null ? _b : []
|
|
6843
|
+
],
|
|
6844
|
+
date
|
|
6845
|
+
}
|
|
6846
|
+
);
|
|
6847
|
+
} })
|
|
6775
6848
|
]
|
|
6776
6849
|
}
|
|
6777
6850
|
),
|
|
6778
|
-
/* @__PURE__ */ jsx52("div", { css: actions, children: /* @__PURE__ */ jsx52(Button, { onClick: gotoToday, buttonType: "ghost", children: "Today" }) })
|
|
6851
|
+
withTodayButton ? /* @__PURE__ */ jsx52("div", { css: actions, children: /* @__PURE__ */ jsx52(Button, { onClick: gotoToday, buttonType: "ghost", children: "Today" }) }) : null
|
|
6779
6852
|
] });
|
|
6780
6853
|
};
|
|
6781
6854
|
|
|
@@ -7236,6 +7309,14 @@ var ChipIcon = css48`
|
|
|
7236
7309
|
display: flex;
|
|
7237
7310
|
opacity: var(--opacity-50);
|
|
7238
7311
|
`;
|
|
7312
|
+
var ChipXxs = css48`
|
|
7313
|
+
height: 1rem;
|
|
7314
|
+
font-size: var(--fs-xs);
|
|
7315
|
+
|
|
7316
|
+
> :where(span:last-of-type) {
|
|
7317
|
+
padding: 0 var(--spacing-sm);
|
|
7318
|
+
}
|
|
7319
|
+
`;
|
|
7239
7320
|
var ChipTiny = (withIcon) => css48`
|
|
7240
7321
|
font-size: var(--fs-xs);
|
|
7241
7322
|
padding-inline: ${withIcon ? "calc(var(--spacing-2xs) + 2px) var(--spacing-sm)" : "var(--spacing-sm)"};
|
|
@@ -7470,6 +7551,7 @@ var Chip = ({
|
|
|
7470
7551
|
...props
|
|
7471
7552
|
}) => {
|
|
7472
7553
|
const chipSize = {
|
|
7554
|
+
xxs: ChipXxs,
|
|
7473
7555
|
xs: ChipTiny(Boolean(icon)),
|
|
7474
7556
|
sm: ChipSmall,
|
|
7475
7557
|
md: ChipMedium
|
|
@@ -7842,7 +7924,7 @@ import {
|
|
|
7842
7924
|
} from "@ariakit/react";
|
|
7843
7925
|
import { CalendarDate as CalendarDate3, parseDate as parseDate2, parseTime as parseTime2, Time as Time2 } from "@internationalized/date";
|
|
7844
7926
|
import { CgCalendar } from "@react-icons/all-files/cg/CgCalendar";
|
|
7845
|
-
import { createContext as createContext2, useCallback as useCallback4, useContext as useContext2, useEffect as useEffect6, useMemo, useState as
|
|
7927
|
+
import { createContext as createContext2, useCallback as useCallback4, useContext as useContext2, useEffect as useEffect6, useMemo, useState as useState8 } from "react";
|
|
7846
7928
|
|
|
7847
7929
|
// src/components/Popover/Popover.styles.ts
|
|
7848
7930
|
import { css as css53 } from "@emotion/react";
|
|
@@ -8092,6 +8174,15 @@ var TIMEZONE_OPTIONS = timeZoneOptions.map((v) => {
|
|
|
8092
8174
|
}
|
|
8093
8175
|
return a.value.localeCompare(b.value);
|
|
8094
8176
|
});
|
|
8177
|
+
function getDraftState(parsedValue) {
|
|
8178
|
+
var _a;
|
|
8179
|
+
const timeZone = (parsedValue == null ? void 0 : parsedValue.timeZone) || getLocalTimeZone();
|
|
8180
|
+
return {
|
|
8181
|
+
date: tryToCalendarDate(parsedValue),
|
|
8182
|
+
time: (_a = tryToTime(parsedValue)) != null ? _a : new Time2(0, 0),
|
|
8183
|
+
timeZone: TIMEZONE_OPTIONS.find(({ value }) => value === timeZone)
|
|
8184
|
+
};
|
|
8185
|
+
}
|
|
8095
8186
|
var DateTimePickerContext = createContext2({
|
|
8096
8187
|
clearValue() {
|
|
8097
8188
|
},
|
|
@@ -8137,19 +8228,17 @@ var DateTimePicker = ({
|
|
|
8137
8228
|
() => tryParseAbsoluteToDateString(maxVisible, value == null ? void 0 : value.timeZone),
|
|
8138
8229
|
[maxVisible, value == null ? void 0 : value.timeZone]
|
|
8139
8230
|
);
|
|
8140
|
-
const
|
|
8141
|
-
const [
|
|
8142
|
-
const [
|
|
8143
|
-
|
|
8144
|
-
return TIMEZONE_OPTIONS.find(({ value: value2 }) => value2 === timeZone);
|
|
8145
|
-
});
|
|
8231
|
+
const draftState = useMemo(() => getDraftState(parsedValue), [parsedValue]);
|
|
8232
|
+
const [draftDate, setDraftDate] = useState8(() => draftState.date);
|
|
8233
|
+
const [draftTime, setDraftTime] = useState8(() => draftState.time);
|
|
8234
|
+
const [draftTimeZone, setDraftTimeZone] = useState8(() => draftState.timeZone);
|
|
8146
8235
|
useEffect6(() => {
|
|
8147
|
-
var _a;
|
|
8148
8236
|
if (visible) {
|
|
8149
|
-
setDraftDate(
|
|
8150
|
-
setDraftTime(
|
|
8237
|
+
setDraftDate(draftState.date);
|
|
8238
|
+
setDraftTime(draftState.time);
|
|
8239
|
+
setDraftTimeZone(draftState.timeZone);
|
|
8151
8240
|
}
|
|
8152
|
-
}, [
|
|
8241
|
+
}, [draftState, visible]);
|
|
8153
8242
|
const handleDateChange = useCallback4((isoDate) => {
|
|
8154
8243
|
setDraftDate(parseDate2(isoDate));
|
|
8155
8244
|
}, []);
|
|
@@ -8528,7 +8617,7 @@ var DragHandle = forwardRef16(
|
|
|
8528
8617
|
|
|
8529
8618
|
// src/components/Drawer/Drawer.tsx
|
|
8530
8619
|
import { CgChevronRight } from "@react-icons/all-files/cg/CgChevronRight";
|
|
8531
|
-
import React14, { createContext as createContext4, useContext as useContext4, useEffect as useEffect7, useRef as useRef5, useState as
|
|
8620
|
+
import React14, { createContext as createContext4, useContext as useContext4, useEffect as useEffect7, useRef as useRef5, useState as useState11 } from "react";
|
|
8532
8621
|
import { createPortal } from "react-dom";
|
|
8533
8622
|
|
|
8534
8623
|
// src/components/Drawer/Drawer.styles.ts
|
|
@@ -8639,7 +8728,7 @@ var drawerWrapperOverlayStyles = css58`
|
|
|
8639
8728
|
`;
|
|
8640
8729
|
|
|
8641
8730
|
// src/components/Drawer/DrawerProvider.tsx
|
|
8642
|
-
import { createContext as createContext3, useCallback as useCallback5, useContext as useContext3, useId, useState as
|
|
8731
|
+
import { createContext as createContext3, useCallback as useCallback5, useContext as useContext3, useId, useState as useState10 } from "react";
|
|
8643
8732
|
import { jsx as jsx70 } from "@emotion/react/jsx-runtime";
|
|
8644
8733
|
var DrawerContext = createContext3({
|
|
8645
8734
|
providerId: "",
|
|
@@ -8654,9 +8743,9 @@ var DrawerContext = createContext3({
|
|
|
8654
8743
|
}
|
|
8655
8744
|
});
|
|
8656
8745
|
var DrawerProvider = ({ children }) => {
|
|
8657
|
-
const [drawersRegistry, setDrawersRegistry] =
|
|
8746
|
+
const [drawersRegistry, setDrawersRegistry] = useState10([]);
|
|
8658
8747
|
const providerId = useId();
|
|
8659
|
-
const [drawerTakeoverStackId, setDrawerTakeoverStackId] =
|
|
8748
|
+
const [drawerTakeoverStackId, setDrawerTakeoverStackId] = useState10(void 0);
|
|
8660
8749
|
useShortcut({
|
|
8661
8750
|
handler: () => {
|
|
8662
8751
|
var _a, _b;
|
|
@@ -8790,7 +8879,7 @@ var DrawerInner = ({
|
|
|
8790
8879
|
}) => {
|
|
8791
8880
|
const { registerDrawer, unregisterDrawer, providerId } = useDrawer();
|
|
8792
8881
|
const closeButtonRef = useRef5(null);
|
|
8793
|
-
const [rendererElement, setRendererElement] =
|
|
8882
|
+
const [rendererElement, setRendererElement] = useState11(null);
|
|
8794
8883
|
useEffect7(() => {
|
|
8795
8884
|
registerDrawer({
|
|
8796
8885
|
drawer: {
|
|
@@ -9136,7 +9225,7 @@ var IconButton = forwardRef17(
|
|
|
9136
9225
|
IconButton.displayName = "IconButton";
|
|
9137
9226
|
|
|
9138
9227
|
// src/components/Image/Image.tsx
|
|
9139
|
-
import { useCallback as useCallback6, useEffect as useEffect10, useRef as useRef6, useState as
|
|
9228
|
+
import { useCallback as useCallback6, useEffect as useEffect10, useRef as useRef6, useState as useState12 } from "react";
|
|
9140
9229
|
|
|
9141
9230
|
// src/components/Image/Image.styles.ts
|
|
9142
9231
|
import { css as css63 } from "@emotion/react";
|
|
@@ -9239,8 +9328,8 @@ function Image({
|
|
|
9239
9328
|
errorFallbackSrc,
|
|
9240
9329
|
...imgAttribs
|
|
9241
9330
|
}) {
|
|
9242
|
-
const [loading, setLoading] =
|
|
9243
|
-
const [loadErrorText, setLoadErrorText] =
|
|
9331
|
+
const [loading, setLoading] = useState12(true);
|
|
9332
|
+
const [loadErrorText, setLoadErrorText] = useState12("");
|
|
9244
9333
|
const { currentSrc, currentSrcSet, tryFallback } = useImageLoadFallback({
|
|
9245
9334
|
src: src != null ? src : "",
|
|
9246
9335
|
srcSet,
|
|
@@ -9610,7 +9699,7 @@ var EditTeamIntegrationTile = ({
|
|
|
9610
9699
|
// src/components/Tiles/IntegrationComingSoon.tsx
|
|
9611
9700
|
import { css as css66 } from "@emotion/react";
|
|
9612
9701
|
import { CgHeart } from "@react-icons/all-files/cg/CgHeart";
|
|
9613
|
-
import { useEffect as useEffect11, useState as
|
|
9702
|
+
import { useEffect as useEffect11, useState as useState13 } from "react";
|
|
9614
9703
|
import { jsx as jsx84, jsxs as jsxs56 } from "@emotion/react/jsx-runtime";
|
|
9615
9704
|
var IntegrationComingSoon = ({
|
|
9616
9705
|
name,
|
|
@@ -9620,7 +9709,7 @@ var IntegrationComingSoon = ({
|
|
|
9620
9709
|
timing = 1e3,
|
|
9621
9710
|
...props
|
|
9622
9711
|
}) => {
|
|
9623
|
-
const [upVote, setUpVote] =
|
|
9712
|
+
const [upVote, setUpVote] = useState13(false);
|
|
9624
9713
|
const handleUpVoteInteraction = () => {
|
|
9625
9714
|
setUpVote((prev) => !prev);
|
|
9626
9715
|
onUpVoteClick();
|
|
@@ -10190,7 +10279,7 @@ import {
|
|
|
10190
10279
|
useEffect as useEffect13,
|
|
10191
10280
|
useMemo as useMemo5,
|
|
10192
10281
|
useRef as useRef8,
|
|
10193
|
-
useState as
|
|
10282
|
+
useState as useState14
|
|
10194
10283
|
} from "react";
|
|
10195
10284
|
|
|
10196
10285
|
// src/utils/useDebouncedCallback.ts
|
|
@@ -10281,11 +10370,11 @@ var KeyValueInput = ({
|
|
|
10281
10370
|
showIconColumn = false,
|
|
10282
10371
|
renderIconSelector
|
|
10283
10372
|
}) => {
|
|
10284
|
-
const [isDragging, setIsDragging] =
|
|
10285
|
-
const [indexToFocus, setIndexToFocus] =
|
|
10373
|
+
const [isDragging, setIsDragging] = useState14(false);
|
|
10374
|
+
const [indexToFocus, setIndexToFocus] = useState14(null);
|
|
10286
10375
|
const popoverStoresMap = useRef8({});
|
|
10287
10376
|
const keyInputRefsMap = useRef8({});
|
|
10288
|
-
const [blockAutoGenerateForValues, setBlockAutoGenerateForValues] =
|
|
10377
|
+
const [blockAutoGenerateForValues, setBlockAutoGenerateForValues] = useState14(
|
|
10289
10378
|
() => new Set(value.map((item) => item.value))
|
|
10290
10379
|
);
|
|
10291
10380
|
const sensors = useSensors(
|
|
@@ -10658,13 +10747,13 @@ var KeyValueInputItem = ({
|
|
|
10658
10747
|
// src/components/LabelsQuickFilter/LabelsQuickFilter.tsx
|
|
10659
10748
|
import { TbChevronRight as TbChevronRight2 } from "@react-icons/all-files/tb/TbChevronRight";
|
|
10660
10749
|
import { TbTags } from "@react-icons/all-files/tb/TbTags";
|
|
10661
|
-
import { useCallback as useCallback8,
|
|
10750
|
+
import { useCallback as useCallback8, useMemo as useMemo6, useState as useState16 } from "react";
|
|
10662
10751
|
|
|
10663
10752
|
// src/components/QuickFilter/QuickFilter.tsx
|
|
10664
10753
|
import { CgMathPlus as CgMathPlus2 } from "@react-icons/all-files/cg/CgMathPlus";
|
|
10665
10754
|
import { CgTag } from "@react-icons/all-files/cg/CgTag";
|
|
10666
10755
|
import { TbWashDryclean } from "@react-icons/all-files/tb/TbWashDryclean";
|
|
10667
|
-
import { useEffect as useEffect14, useRef as useRef9, useState as
|
|
10756
|
+
import { useEffect as useEffect14, useRef as useRef9, useState as useState15 } from "react";
|
|
10668
10757
|
|
|
10669
10758
|
// src/components/Swatch/Swatch.styles.ts
|
|
10670
10759
|
import { css as css74 } from "@emotion/react";
|
|
@@ -11071,12 +11160,13 @@ var QuickFilter = ({
|
|
|
11071
11160
|
onClose,
|
|
11072
11161
|
menuPlacement = "right-start",
|
|
11073
11162
|
menuGetAnchorRect,
|
|
11074
|
-
menuUpdatePosition
|
|
11163
|
+
menuUpdatePosition,
|
|
11164
|
+
onSearchEnterKeyDown
|
|
11075
11165
|
}) => {
|
|
11076
11166
|
const hasSelectedItems = selectedItems && (selectedItems == null ? void 0 : selectedItems.length) > 0;
|
|
11077
11167
|
const containerRef = useRef9(null);
|
|
11078
11168
|
const hasPositionedRef = useRef9(false);
|
|
11079
|
-
const [open, setOpen] =
|
|
11169
|
+
const [open, setOpen] = useState15(false);
|
|
11080
11170
|
useEffect14(() => {
|
|
11081
11171
|
if (open) {
|
|
11082
11172
|
onOpen == null ? void 0 : onOpen();
|
|
@@ -11129,6 +11219,7 @@ var QuickFilter = ({
|
|
|
11129
11219
|
searchPlaceholder: searchPlaceholderText,
|
|
11130
11220
|
disableSearch: totalResults < maxCount,
|
|
11131
11221
|
disabled: disabled2,
|
|
11222
|
+
onSearchEnterKeyDown,
|
|
11132
11223
|
placement: menuPlacement,
|
|
11133
11224
|
getAnchorRect: resolvedGetAnchorRect,
|
|
11134
11225
|
updatePosition: resolvedUpdatePosition,
|
|
@@ -11255,7 +11346,7 @@ var LabelsQuickFilter = ({
|
|
|
11255
11346
|
menuUpdatePosition,
|
|
11256
11347
|
maxCount = 0
|
|
11257
11348
|
}) => {
|
|
11258
|
-
const [searchTerm, setSearchTerm] =
|
|
11349
|
+
const [searchTerm, setSearchTerm] = useState16("");
|
|
11259
11350
|
const selectedIdsSet = useMemo6(
|
|
11260
11351
|
() => selectedIds instanceof Set ? selectedIds : new Set(selectedIds),
|
|
11261
11352
|
[selectedIds]
|
|
@@ -11405,33 +11496,21 @@ var LabelsQuickFilter = ({
|
|
|
11405
11496
|
group.id
|
|
11406
11497
|
);
|
|
11407
11498
|
};
|
|
11408
|
-
const { canCreateLabel, isCreateDisabled
|
|
11409
|
-
const
|
|
11499
|
+
const { canCreateLabel, isCreateDisabled } = useMemo6(() => {
|
|
11500
|
+
const derivedPublicId = searchTerm.toLowerCase().replace(/ /g, "-").replace(/[^A-Za-z0-9$-]+/g, "");
|
|
11501
|
+
const publicIdExists = items.some((item) => item.id === derivedPublicId);
|
|
11502
|
+
const canCreateLabel2 = !!searchTerm && !publicIdExists;
|
|
11410
11503
|
const isCreateDisabled2 = filteredItems.some((item) => item.name === searchTerm);
|
|
11411
|
-
const isCreateSelected2 = selectedIdsSet.has(searchTerm);
|
|
11412
11504
|
return {
|
|
11413
11505
|
canCreateLabel: canCreateLabel2,
|
|
11414
|
-
isCreateDisabled: isCreateDisabled2
|
|
11415
|
-
isCreateSelected: isCreateSelected2
|
|
11506
|
+
isCreateDisabled: isCreateDisabled2
|
|
11416
11507
|
};
|
|
11417
|
-
}, [filteredItems,
|
|
11418
|
-
const
|
|
11419
|
-
|
|
11420
|
-
|
|
11421
|
-
const { searchTerm: searchTerm2, canCreateLabel: canCreateLabel2, isCreateDisabled: isCreateDisabled2, onCreateLabel: onCreateLabel2 } = createLabelStateRef.current;
|
|
11422
|
-
if (e.key === "Enter" && canCreateLabel2 && onCreateLabel2 && !isCreateDisabled2) {
|
|
11423
|
-
onCreateLabel2(searchTerm2);
|
|
11508
|
+
}, [filteredItems, items, searchTerm]);
|
|
11509
|
+
const handleSearchEnterKeyDown = useCallback8(() => {
|
|
11510
|
+
if (canCreateLabel && !isCreateDisabled && onCreateLabel) {
|
|
11511
|
+
onCreateLabel(searchTerm);
|
|
11424
11512
|
}
|
|
11425
|
-
}, []);
|
|
11426
|
-
useEffect15(() => {
|
|
11427
|
-
if (!onCreateLabel) {
|
|
11428
|
-
return;
|
|
11429
|
-
}
|
|
11430
|
-
window.addEventListener("keydown", handleEnterKey);
|
|
11431
|
-
return () => {
|
|
11432
|
-
window.removeEventListener("keydown", handleEnterKey);
|
|
11433
|
-
};
|
|
11434
|
-
}, [handleEnterKey, onCreateLabel]);
|
|
11513
|
+
}, [canCreateLabel, isCreateDisabled, onCreateLabel, searchTerm]);
|
|
11435
11514
|
return /* @__PURE__ */ jsxs65(
|
|
11436
11515
|
QuickFilter,
|
|
11437
11516
|
{
|
|
@@ -11451,6 +11530,7 @@ var LabelsQuickFilter = ({
|
|
|
11451
11530
|
menuGetAnchorRect,
|
|
11452
11531
|
menuUpdatePosition,
|
|
11453
11532
|
maxCount,
|
|
11533
|
+
onSearchEnterKeyDown: onCreateLabel ? handleSearchEnterKeyDown : void 0,
|
|
11454
11534
|
children: [
|
|
11455
11535
|
filteredItems.map((item) => {
|
|
11456
11536
|
if (!item.isGroup && item.parent) {
|
|
@@ -11463,23 +11543,16 @@ var LabelsQuickFilter = ({
|
|
|
11463
11543
|
}),
|
|
11464
11544
|
canCreateLabel && onCreateLabel ? /* @__PURE__ */ jsxs65(Fragment10, { children: [
|
|
11465
11545
|
filteredItems.length > 0 ? /* @__PURE__ */ jsx99(MenuItemSeparator, {}) : null,
|
|
11466
|
-
/* @__PURE__ */ jsx99(
|
|
11467
|
-
|
|
11468
|
-
{
|
|
11469
|
-
|
|
11470
|
-
|
|
11471
|
-
|
|
11472
|
-
|
|
11473
|
-
selectStyles: "checkbox-select",
|
|
11474
|
-
children: /* @__PURE__ */ jsxs65(HorizontalRhythm, { align: "center", gap: "sm", children: [
|
|
11475
|
-
/* @__PURE__ */ jsx99("span", { children: "Create:" }),
|
|
11476
|
-
/* @__PURE__ */ jsxs65(HorizontalRhythm, { gap: "sm", align: "center", children: [
|
|
11477
|
-
/* @__PURE__ */ jsx99(Swatch, { variant: "swatch-default", size: "small" }),
|
|
11478
|
-
searchTerm
|
|
11479
|
-
] })
|
|
11546
|
+
/* @__PURE__ */ jsx99(MenuItem, { hideOnClick: false, disabled: isCreateDisabled, onClick: () => onCreateLabel(searchTerm), children: /* @__PURE__ */ jsxs65(HorizontalRhythm, { align: "center", gap: "sm", css: { fontSize: "var(--fs-sm)" }, children: [
|
|
11547
|
+
/* @__PURE__ */ jsx99("span", { css: { width: "var(--spacing-base)", flexShrink: 0 } }),
|
|
11548
|
+
/* @__PURE__ */ jsxs65(HorizontalRhythm, { align: "center", gap: "sm", children: [
|
|
11549
|
+
/* @__PURE__ */ jsx99("span", { children: "Create:" }),
|
|
11550
|
+
/* @__PURE__ */ jsxs65(HorizontalRhythm, { gap: "sm", align: "center", children: [
|
|
11551
|
+
/* @__PURE__ */ jsx99(Swatch, { variant: "swatch-default", size: "small" }),
|
|
11552
|
+
searchTerm
|
|
11480
11553
|
] })
|
|
11481
|
-
}
|
|
11482
|
-
)
|
|
11554
|
+
] })
|
|
11555
|
+
] }) })
|
|
11483
11556
|
] }) : null
|
|
11484
11557
|
]
|
|
11485
11558
|
}
|
|
@@ -11494,7 +11567,7 @@ import {
|
|
|
11494
11567
|
usePopoverContext,
|
|
11495
11568
|
usePopoverStore as usePopoverStore2
|
|
11496
11569
|
} from "@ariakit/react";
|
|
11497
|
-
import { useEffect as
|
|
11570
|
+
import { useEffect as useEffect15 } from "react";
|
|
11498
11571
|
|
|
11499
11572
|
// src/components/Popover/PopoverBody.tsx
|
|
11500
11573
|
import { jsx as jsx100 } from "@emotion/react/jsx-runtime";
|
|
@@ -11538,7 +11611,7 @@ var Popover3 = ({
|
|
|
11538
11611
|
...otherProps
|
|
11539
11612
|
}) => {
|
|
11540
11613
|
const popover2 = usePopoverStore2({ placement });
|
|
11541
|
-
|
|
11614
|
+
useEffect15(() => {
|
|
11542
11615
|
onInit == null ? void 0 : onInit({ store: popover2 });
|
|
11543
11616
|
}, [popover2]);
|
|
11544
11617
|
return /* @__PURE__ */ jsxs66(PopoverProvider2, { store: popover2, children: [
|
|
@@ -11548,6 +11621,7 @@ var Popover3 = ({
|
|
|
11548
11621
|
css: [PopoverBtn, trigger2 ? void 0 : PopoverDefaulterTriggerBtn],
|
|
11549
11622
|
title: buttonText,
|
|
11550
11623
|
"data-testid": testId,
|
|
11624
|
+
disabled: otherProps.disabled,
|
|
11551
11625
|
children: trigger2 ? trigger2 : /* @__PURE__ */ jsxs66(Fragment11, { children: [
|
|
11552
11626
|
/* @__PURE__ */ jsx101(Icon, { icon, iconColor, size: iconSize2 }),
|
|
11553
11627
|
/* @__PURE__ */ jsx101("span", { hidden: true, children: buttonText })
|
|
@@ -11591,12 +11665,13 @@ var LimitsBarTextColor = (statusColor) => css77`
|
|
|
11591
11665
|
|
|
11592
11666
|
// src/components/LimitsBar/LimitsBar.tsx
|
|
11593
11667
|
import { jsx as jsx102, jsxs as jsxs67 } from "@emotion/react/jsx-runtime";
|
|
11594
|
-
var LimitsBar = ({ current, max, popoverContent }) => {
|
|
11668
|
+
var LimitsBar = ({ current, max, popoverContent, barColor, ...props }) => {
|
|
11595
11669
|
const maxPercentage = 100;
|
|
11596
11670
|
const isUnlimited = max < 0;
|
|
11597
11671
|
const progressBarValue = isUnlimited ? maxPercentage : Math.min(Math.ceil(current / max * maxPercentage), maxPercentage);
|
|
11598
11672
|
const percentage = isUnlimited ? 0 : current / max * 100;
|
|
11599
11673
|
const getBarColor = () => {
|
|
11674
|
+
if (barColor) return barColor;
|
|
11600
11675
|
if (isUnlimited) return "var(--utility-success-icon)";
|
|
11601
11676
|
if (percentage >= 100) return "var(--utility-danger-icon)";
|
|
11602
11677
|
if (percentage >= 90) return "var(--utility-caution-icon)";
|
|
@@ -11613,7 +11688,7 @@ var LimitsBar = ({ current, max, popoverContent }) => {
|
|
|
11613
11688
|
const displayText = isUnlimited ? `${current} of unlimited` : `${current} of ${max}`;
|
|
11614
11689
|
const ariaValueMax = isUnlimited ? -1 : max;
|
|
11615
11690
|
const ariaValueText = displayText;
|
|
11616
|
-
return /* @__PURE__ */ jsxs67("div", { css: [LimitsBarContainer, functionalColors], children: [
|
|
11691
|
+
return /* @__PURE__ */ jsxs67("div", { css: [LimitsBarContainer, functionalColors], ...props, children: [
|
|
11617
11692
|
/* @__PURE__ */ jsx102(
|
|
11618
11693
|
"div",
|
|
11619
11694
|
{
|
|
@@ -11929,7 +12004,7 @@ var LoadingIndicator = ({ size = "lg", color = "gray", ...props }) => {
|
|
|
11929
12004
|
// src/components/Modal/Modal.tsx
|
|
11930
12005
|
import { PortalContext } from "@ariakit/react";
|
|
11931
12006
|
import { CgClose as CgClose5 } from "@react-icons/all-files/cg/CgClose";
|
|
11932
|
-
import React16, { useCallback as useCallback9, useEffect as
|
|
12007
|
+
import React16, { useCallback as useCallback9, useEffect as useEffect16, useRef as useRef10, useState as useState17 } from "react";
|
|
11933
12008
|
|
|
11934
12009
|
// src/components/Modal/Modal.styles.ts
|
|
11935
12010
|
import { css as css83 } from "@emotion/react";
|
|
@@ -12033,9 +12108,9 @@ var Modal = React16.forwardRef(
|
|
|
12033
12108
|
disableBodyScroll = false,
|
|
12034
12109
|
...modalProps
|
|
12035
12110
|
}, ref) => {
|
|
12036
|
-
const mouseDownInsideModal =
|
|
12037
|
-
const dialogRef =
|
|
12038
|
-
const [portalTarget, setPortalTarget] =
|
|
12111
|
+
const mouseDownInsideModal = useRef10(false);
|
|
12112
|
+
const dialogRef = useRef10(null);
|
|
12113
|
+
const [portalTarget, setPortalTarget] = useState17(null);
|
|
12039
12114
|
const setDialogRef = useCallback9(
|
|
12040
12115
|
(element) => {
|
|
12041
12116
|
dialogRef.current = element;
|
|
@@ -12059,7 +12134,7 @@ var Modal = React16.forwardRef(
|
|
|
12059
12134
|
},
|
|
12060
12135
|
shortcut: "escape"
|
|
12061
12136
|
});
|
|
12062
|
-
|
|
12137
|
+
useEffect16(() => {
|
|
12063
12138
|
var _a;
|
|
12064
12139
|
if (!document.contains(dialogRef.current)) {
|
|
12065
12140
|
console.warn(
|
|
@@ -12485,7 +12560,7 @@ var ObjectGridItemCoverButton = ({
|
|
|
12485
12560
|
};
|
|
12486
12561
|
|
|
12487
12562
|
// src/components/Objects/ObjectGridItemHeading.tsx
|
|
12488
|
-
import { useEffect as
|
|
12563
|
+
import { useEffect as useEffect17, useRef as useRef11, useState as useState18 } from "react";
|
|
12489
12564
|
|
|
12490
12565
|
// src/components/Objects/styles/ObjectGridItemHeading.styles.ts
|
|
12491
12566
|
import { css as css87 } from "@emotion/react";
|
|
@@ -12511,12 +12586,12 @@ var ObjectGridItemHeading2 = ({
|
|
|
12511
12586
|
tooltip,
|
|
12512
12587
|
...props
|
|
12513
12588
|
}) => {
|
|
12514
|
-
const [hasTruncation, setHasTruncation] =
|
|
12515
|
-
const headingRef =
|
|
12589
|
+
const [hasTruncation, setHasTruncation] = useState18(false);
|
|
12590
|
+
const headingRef = useRef11(null);
|
|
12516
12591
|
const onStopPropagation = (e) => {
|
|
12517
12592
|
e.stopPropagation();
|
|
12518
12593
|
};
|
|
12519
|
-
|
|
12594
|
+
useEffect17(() => {
|
|
12520
12595
|
const currentHeading = headingRef.current;
|
|
12521
12596
|
const observer = new ResizeObserver((entries) => {
|
|
12522
12597
|
for (const entry of entries) {
|
|
@@ -13211,7 +13286,7 @@ var ParameterGroup = forwardRef21(
|
|
|
13211
13286
|
import { forwardRef as forwardRef23, useDeferredValue } from "react";
|
|
13212
13287
|
|
|
13213
13288
|
// src/components/ParameterInputs/ParameterImagePreview.tsx
|
|
13214
|
-
import { useState as
|
|
13289
|
+
import { useState as useState19 } from "react";
|
|
13215
13290
|
import { createPortal as createPortal2 } from "react-dom";
|
|
13216
13291
|
|
|
13217
13292
|
// src/components/ParameterInputs/styles/ParameterImage.styles.ts
|
|
@@ -13254,7 +13329,7 @@ var previewModalImage = css96`
|
|
|
13254
13329
|
// src/components/ParameterInputs/ParameterImagePreview.tsx
|
|
13255
13330
|
import { Fragment as Fragment13, jsx as jsx126, jsxs as jsxs85 } from "@emotion/react/jsx-runtime";
|
|
13256
13331
|
function ParameterImagePreview({ imageSrc }) {
|
|
13257
|
-
const [showModal, setShowModal] =
|
|
13332
|
+
const [showModal, setShowModal] = useState19(false);
|
|
13258
13333
|
return imageSrc ? /* @__PURE__ */ jsxs85("div", { css: previewWrapper, children: [
|
|
13259
13334
|
/* @__PURE__ */ jsx126(PreviewImageModal, { open: showModal, imageSrc, onRequestClose: () => setShowModal(false) }),
|
|
13260
13335
|
/* @__PURE__ */ jsx126(
|
|
@@ -13286,7 +13361,7 @@ var PreviewImageModal = ({ open, onRequestClose, imageSrc }) => {
|
|
|
13286
13361
|
|
|
13287
13362
|
// src/components/ParameterInputs/ParameterShell.tsx
|
|
13288
13363
|
import { css as css99 } from "@emotion/react";
|
|
13289
|
-
import { useState as
|
|
13364
|
+
import { useState as useState20 } from "react";
|
|
13290
13365
|
|
|
13291
13366
|
// src/components/ParameterInputs/styles/ParameterInput.styles.ts
|
|
13292
13367
|
import { css as css97 } from "@emotion/react";
|
|
@@ -13739,7 +13814,7 @@ var ParameterShell = ({
|
|
|
13739
13814
|
menuWithoutPortal,
|
|
13740
13815
|
...props
|
|
13741
13816
|
}) => {
|
|
13742
|
-
const [manualErrorMessage, setManualErrorMessage] =
|
|
13817
|
+
const [manualErrorMessage, setManualErrorMessage] = useState20(void 0);
|
|
13743
13818
|
const setErrorMessage = (message) => setManualErrorMessage(message);
|
|
13744
13819
|
const errorMessaging = errorMessage || manualErrorMessage;
|
|
13745
13820
|
return /* @__PURE__ */ jsxs86("div", { css: inputContainer2, ...props, id, children: [
|
|
@@ -13876,7 +13951,7 @@ var ParameterInputInner = forwardRef24(({ enableMouseWheel = false, ...props },
|
|
|
13876
13951
|
});
|
|
13877
13952
|
|
|
13878
13953
|
// src/components/ParameterInputs/ParameterLabels.tsx
|
|
13879
|
-
import { useMemo as useMemo7, useRef as
|
|
13954
|
+
import { useMemo as useMemo7, useRef as useRef12 } from "react";
|
|
13880
13955
|
import { jsx as jsx132 } from "@emotion/react/jsx-runtime";
|
|
13881
13956
|
var ParameterLabels = ({ disabled: disabled2 = false, ...props }) => {
|
|
13882
13957
|
const { shellProps, innerProps } = extractParameterProps(props);
|
|
@@ -13938,8 +14013,8 @@ var ParameterLabelsInner = (props) => {
|
|
|
13938
14013
|
var _a;
|
|
13939
14014
|
const { label: label2 } = useParameterShell();
|
|
13940
14015
|
const { onChange } = props;
|
|
13941
|
-
const containerRef =
|
|
13942
|
-
const hasPositionedRef =
|
|
14016
|
+
const containerRef = useRef12(null);
|
|
14017
|
+
const hasPositionedRef = useRef12(false);
|
|
13943
14018
|
const selectedValues = useMemo7(
|
|
13944
14019
|
() => {
|
|
13945
14020
|
var _a2, _b;
|
|
@@ -14254,7 +14329,7 @@ import { forwardRef as forwardRef27 } from "react";
|
|
|
14254
14329
|
import { forwardRef as forwardRef26, useCallback as useCallback10, useMemo as useMemo8 } from "react";
|
|
14255
14330
|
|
|
14256
14331
|
// src/components/Slider/SliderLabels.tsx
|
|
14257
|
-
import { useEffect as
|
|
14332
|
+
import { useEffect as useEffect18, useRef as useRef13, useState as useState21 } from "react";
|
|
14258
14333
|
|
|
14259
14334
|
// src/components/Slider/styles/Slider.styles.ts
|
|
14260
14335
|
import { css as css100 } from "@emotion/react";
|
|
@@ -14679,9 +14754,9 @@ function calculateLabelVisibility(ticks, currentValue, containerWidth) {
|
|
|
14679
14754
|
}));
|
|
14680
14755
|
}
|
|
14681
14756
|
function SliderLabels({ ticks, currentValue, containerWidth = 300 }) {
|
|
14682
|
-
const containerRef =
|
|
14683
|
-
const [measuredWidth, setMeasuredWidth] =
|
|
14684
|
-
|
|
14757
|
+
const containerRef = useRef13(null);
|
|
14758
|
+
const [measuredWidth, setMeasuredWidth] = useState21(containerWidth);
|
|
14759
|
+
useEffect18(() => {
|
|
14685
14760
|
if (containerRef.current) {
|
|
14686
14761
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
14687
14762
|
for (const entry of entries) {
|
|
@@ -15059,7 +15134,7 @@ var defaultParameterConfiguration = {
|
|
|
15059
15134
|
// src/components/ParameterInputs/ParameterRichText.tsx
|
|
15060
15135
|
import { deepEqual as deepEqual2 } from "fast-equals";
|
|
15061
15136
|
import { ParagraphNode as ParagraphNode2 } from "lexical";
|
|
15062
|
-
import { useEffect as
|
|
15137
|
+
import { useEffect as useEffect27, useState as useState27 } from "react";
|
|
15063
15138
|
|
|
15064
15139
|
// src/components/ParameterInputs/rich-text/CustomCodeNode.ts
|
|
15065
15140
|
import { CodeNode } from "@lexical/code";
|
|
@@ -15080,10 +15155,10 @@ CustomCodeNode.importDOM = function() {
|
|
|
15080
15155
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
15081
15156
|
import { mergeRegister } from "@lexical/utils";
|
|
15082
15157
|
import { ParagraphNode } from "lexical";
|
|
15083
|
-
import { useEffect as
|
|
15158
|
+
import { useEffect as useEffect19 } from "react";
|
|
15084
15159
|
function DisableStylesPlugin() {
|
|
15085
15160
|
const [editor] = useLexicalComposerContext();
|
|
15086
|
-
|
|
15161
|
+
useEffect19(() => {
|
|
15087
15162
|
return mergeRegister(
|
|
15088
15163
|
// Disable text alignment on paragraph nodes
|
|
15089
15164
|
editor.registerNodeTransform(ParagraphNode, (node) => {
|
|
@@ -15342,10 +15417,10 @@ var tableHeaderElement = css101`
|
|
|
15342
15417
|
import { useLexicalComposerContext as useLexicalComposerContext2 } from "@lexical/react/LexicalComposerContext";
|
|
15343
15418
|
import { $insertFirst } from "@lexical/utils";
|
|
15344
15419
|
import { $createParagraphNode, $getRoot, $insertNodes } from "lexical";
|
|
15345
|
-
import { useEffect as
|
|
15420
|
+
import { useEffect as useEffect20 } from "react";
|
|
15346
15421
|
var ImprovedAssetSelectionPlugin = () => {
|
|
15347
15422
|
const [editor] = useLexicalComposerContext2();
|
|
15348
|
-
|
|
15423
|
+
useEffect20(() => {
|
|
15349
15424
|
editor.getRootElement();
|
|
15350
15425
|
const onRootClick = (event) => {
|
|
15351
15426
|
if (event.target !== editor.getRootElement()) {
|
|
@@ -15416,7 +15491,7 @@ import {
|
|
|
15416
15491
|
FOCUS_COMMAND,
|
|
15417
15492
|
PASTE_COMMAND
|
|
15418
15493
|
} from "lexical";
|
|
15419
|
-
import { useCallback as useCallback11, useEffect as
|
|
15494
|
+
import { useCallback as useCallback11, useEffect as useEffect21, useRef as useRef14, useState as useState22 } from "react";
|
|
15420
15495
|
|
|
15421
15496
|
// src/components/ParameterInputs/rich-text/utils.ts
|
|
15422
15497
|
import { $isAtNodeEnd } from "@lexical/selection";
|
|
@@ -15789,17 +15864,17 @@ function LinkNodePlugin({
|
|
|
15789
15864
|
return path;
|
|
15790
15865
|
};
|
|
15791
15866
|
const [editor] = useLexicalComposerContext3();
|
|
15792
|
-
const [linkPopoverState, setLinkPopoverState] =
|
|
15793
|
-
const linkPopoverElRef =
|
|
15794
|
-
const [isEditorFocused, setIsEditorFocused] =
|
|
15795
|
-
const [isLinkPopoverFocused, setIsLinkPopoverFocused] =
|
|
15796
|
-
|
|
15867
|
+
const [linkPopoverState, setLinkPopoverState] = useState22();
|
|
15868
|
+
const linkPopoverElRef = useRef14(null);
|
|
15869
|
+
const [isEditorFocused, setIsEditorFocused] = useState22(false);
|
|
15870
|
+
const [isLinkPopoverFocused, setIsLinkPopoverFocused] = useState22(false);
|
|
15871
|
+
useEffect21(() => {
|
|
15797
15872
|
if (!isEditorFocused && !isLinkPopoverFocused) {
|
|
15798
15873
|
setLinkPopoverState(void 0);
|
|
15799
15874
|
return;
|
|
15800
15875
|
}
|
|
15801
15876
|
}, [isEditorFocused, isLinkPopoverFocused]);
|
|
15802
|
-
|
|
15877
|
+
useEffect21(() => {
|
|
15803
15878
|
if (!editor.hasNodes([LinkNode])) {
|
|
15804
15879
|
throw new Error("LinkNode not registered on editor");
|
|
15805
15880
|
}
|
|
@@ -15937,7 +16012,7 @@ function LinkNodePlugin({
|
|
|
15937
16012
|
}
|
|
15938
16013
|
});
|
|
15939
16014
|
}, [editor, positioningAnchorEl]);
|
|
15940
|
-
|
|
16015
|
+
useEffect21(() => {
|
|
15941
16016
|
return editor.registerUpdateListener(({ editorState }) => {
|
|
15942
16017
|
requestAnimationFrame(() => {
|
|
15943
16018
|
editorState.read(() => {
|
|
@@ -16041,7 +16116,7 @@ import {
|
|
|
16041
16116
|
OUTDENT_CONTENT_COMMAND,
|
|
16042
16117
|
SELECTION_CHANGE_COMMAND
|
|
16043
16118
|
} from "lexical";
|
|
16044
|
-
import { useEffect as
|
|
16119
|
+
import { useEffect as useEffect22, useRef as useRef15 } from "react";
|
|
16045
16120
|
function isIndentPermitted(maxDepth) {
|
|
16046
16121
|
const selection = $getSelection2();
|
|
16047
16122
|
if (!$isRangeSelection2(selection)) {
|
|
@@ -16096,8 +16171,8 @@ function $indentOverTab(selection) {
|
|
|
16096
16171
|
}
|
|
16097
16172
|
function ListIndentPlugin({ maxDepth }) {
|
|
16098
16173
|
const [editor] = useLexicalComposerContext4();
|
|
16099
|
-
const isInListItemNode =
|
|
16100
|
-
|
|
16174
|
+
const isInListItemNode = useRef15(false);
|
|
16175
|
+
useEffect22(() => {
|
|
16101
16176
|
return editor.registerCommand(
|
|
16102
16177
|
SELECTION_CHANGE_COMMAND,
|
|
16103
16178
|
() => {
|
|
@@ -16114,7 +16189,7 @@ function ListIndentPlugin({ maxDepth }) {
|
|
|
16114
16189
|
COMMAND_PRIORITY_NORMAL
|
|
16115
16190
|
);
|
|
16116
16191
|
}, [editor]);
|
|
16117
|
-
|
|
16192
|
+
useEffect22(() => {
|
|
16118
16193
|
return mergeRegister3(
|
|
16119
16194
|
editor.registerCommand(
|
|
16120
16195
|
INDENT_CONTENT_COMMAND,
|
|
@@ -16163,7 +16238,7 @@ import {
|
|
|
16163
16238
|
TableCellNode
|
|
16164
16239
|
} from "@lexical/table";
|
|
16165
16240
|
import { $getSelection as $getSelection3, $isRangeSelection as $isRangeSelection3, $setSelection } from "lexical";
|
|
16166
|
-
import { forwardRef as forwardRef28, useCallback as useCallback12, useEffect as
|
|
16241
|
+
import { forwardRef as forwardRef28, useCallback as useCallback12, useEffect as useEffect23, useLayoutEffect, useState as useState23 } from "react";
|
|
16167
16242
|
import { jsx as jsx140, jsxs as jsxs92 } from "@emotion/react/jsx-runtime";
|
|
16168
16243
|
function computeSelectionCount(selection) {
|
|
16169
16244
|
const selectionShape = selection.getShape();
|
|
@@ -16178,7 +16253,7 @@ var tableActionMenuTrigger = css103`
|
|
|
16178
16253
|
`;
|
|
16179
16254
|
var TableActionMenuTrigger = forwardRef28((props, ref) => {
|
|
16180
16255
|
const { tableCellEl, positioningAnchorEl, ...rest } = props;
|
|
16181
|
-
const [coordinates, setCoordinates] =
|
|
16256
|
+
const [coordinates, setCoordinates] = useState23({ x: 0, y: 0 });
|
|
16182
16257
|
useLayoutEffect(() => {
|
|
16183
16258
|
const rect = tableCellEl.getBoundingClientRect();
|
|
16184
16259
|
const parentRect = positioningAnchorEl.getBoundingClientRect();
|
|
@@ -16212,16 +16287,16 @@ function TableActionMenu({
|
|
|
16212
16287
|
positioningAnchorEl
|
|
16213
16288
|
}) {
|
|
16214
16289
|
const [editor] = useLexicalComposerContext5();
|
|
16215
|
-
const [tableCellNode, updateTableCellNode] =
|
|
16216
|
-
const [selectionCounts, updateSelectionCounts] =
|
|
16290
|
+
const [tableCellNode, updateTableCellNode] = useState23(_tableCellNode);
|
|
16291
|
+
const [selectionCounts, updateSelectionCounts] = useState23({
|
|
16217
16292
|
columns: 1,
|
|
16218
16293
|
rows: 1
|
|
16219
16294
|
});
|
|
16220
|
-
const [menuTriggerKey, setMenuTriggerKey] =
|
|
16295
|
+
const [menuTriggerKey, setMenuTriggerKey] = useState23(0);
|
|
16221
16296
|
const incrementMenuTriggerKey = () => {
|
|
16222
16297
|
setMenuTriggerKey((key) => key += 1);
|
|
16223
16298
|
};
|
|
16224
|
-
|
|
16299
|
+
useEffect23(() => {
|
|
16225
16300
|
return editor.registerMutationListener(
|
|
16226
16301
|
TableCellNode,
|
|
16227
16302
|
(nodeMutations) => {
|
|
@@ -16235,7 +16310,7 @@ function TableActionMenu({
|
|
|
16235
16310
|
{ skipInitialization: true }
|
|
16236
16311
|
);
|
|
16237
16312
|
}, [editor, tableCellNode]);
|
|
16238
|
-
|
|
16313
|
+
useEffect23(() => {
|
|
16239
16314
|
editor.getEditorState().read(() => {
|
|
16240
16315
|
const selection = $getSelection3();
|
|
16241
16316
|
if ($isTableSelection(selection)) {
|
|
@@ -16410,10 +16485,10 @@ function TableCellActionMenuContainer({
|
|
|
16410
16485
|
positioningAnchorEl
|
|
16411
16486
|
}) {
|
|
16412
16487
|
const [editor] = useLexicalComposerContext5();
|
|
16413
|
-
const [tableCellNode, setTableMenuCellNode] =
|
|
16414
|
-
const [tableCellNodeEl, _setTableMenuCellNodeEl] =
|
|
16415
|
-
const [tableCellMenuPortalEl, setTableMenuCellMenuPortalEl] =
|
|
16416
|
-
|
|
16488
|
+
const [tableCellNode, setTableMenuCellNode] = useState23(null);
|
|
16489
|
+
const [tableCellNodeEl, _setTableMenuCellNodeEl] = useState23(null);
|
|
16490
|
+
const [tableCellMenuPortalEl, setTableMenuCellMenuPortalEl] = useState23(null);
|
|
16491
|
+
useEffect23(() => {
|
|
16417
16492
|
const newPortalEl = document.createElement("div");
|
|
16418
16493
|
setTableMenuCellMenuPortalEl(newPortalEl);
|
|
16419
16494
|
menuPortalEl.appendChild(newPortalEl);
|
|
@@ -16457,7 +16532,7 @@ function TableCellActionMenuContainer({
|
|
|
16457
16532
|
setTableMenuCellNodeElem(null);
|
|
16458
16533
|
}
|
|
16459
16534
|
}, [editor, setTableMenuCellNodeElem]);
|
|
16460
|
-
|
|
16535
|
+
useEffect23(() => {
|
|
16461
16536
|
return editor.registerUpdateListener(() => {
|
|
16462
16537
|
editor.getEditorState().read(() => {
|
|
16463
16538
|
$moveMenu();
|
|
@@ -16496,7 +16571,7 @@ import {
|
|
|
16496
16571
|
} from "@lexical/table";
|
|
16497
16572
|
import { calculateZoomLevel } from "@lexical/utils";
|
|
16498
16573
|
import { $getNearestNodeFromDOMNode } from "lexical";
|
|
16499
|
-
import { useCallback as useCallback13, useEffect as
|
|
16574
|
+
import { useCallback as useCallback13, useEffect as useEffect24, useMemo as useMemo9, useRef as useRef16, useState as useState24 } from "react";
|
|
16500
16575
|
import { createPortal as createPortal3 } from "react-dom";
|
|
16501
16576
|
import { Fragment as Fragment17, jsx as jsx141, jsxs as jsxs93 } from "@emotion/react/jsx-runtime";
|
|
16502
16577
|
var MIN_ROW_HEIGHT = 33;
|
|
@@ -16523,14 +16598,14 @@ var fixedGetDOMCellFromTarget = (node) => {
|
|
|
16523
16598
|
return null;
|
|
16524
16599
|
};
|
|
16525
16600
|
function TableCellResizer({ editor, positioningAnchorEl }) {
|
|
16526
|
-
const targetRef =
|
|
16527
|
-
const resizerRef =
|
|
16528
|
-
const tableRectRef =
|
|
16529
|
-
const mouseStartPosRef =
|
|
16530
|
-
const [mouseCurrentPos, updateMouseCurrentPos] =
|
|
16531
|
-
const [activeCell, updateActiveCell] =
|
|
16532
|
-
const [isMouseDown, updateIsMouseDown] =
|
|
16533
|
-
const [draggingDirection, updateDraggingDirection] =
|
|
16601
|
+
const targetRef = useRef16(null);
|
|
16602
|
+
const resizerRef = useRef16(null);
|
|
16603
|
+
const tableRectRef = useRef16(null);
|
|
16604
|
+
const mouseStartPosRef = useRef16(null);
|
|
16605
|
+
const [mouseCurrentPos, updateMouseCurrentPos] = useState24(null);
|
|
16606
|
+
const [activeCell, updateActiveCell] = useState24(null);
|
|
16607
|
+
const [isMouseDown, updateIsMouseDown] = useState24(false);
|
|
16608
|
+
const [draggingDirection, updateDraggingDirection] = useState24(null);
|
|
16534
16609
|
const resetState = useCallback13(() => {
|
|
16535
16610
|
updateActiveCell(null);
|
|
16536
16611
|
targetRef.current = null;
|
|
@@ -16541,7 +16616,7 @@ function TableCellResizer({ editor, positioningAnchorEl }) {
|
|
|
16541
16616
|
const isMouseDownOnEvent = (event) => {
|
|
16542
16617
|
return (event.buttons & 1) === 1;
|
|
16543
16618
|
};
|
|
16544
|
-
|
|
16619
|
+
useEffect24(() => {
|
|
16545
16620
|
const onMouseMove = (event) => {
|
|
16546
16621
|
setTimeout(() => {
|
|
16547
16622
|
const target = event.target;
|
|
@@ -16840,11 +16915,11 @@ import {
|
|
|
16840
16915
|
COMMAND_PRIORITY_NORMAL as COMMAND_PRIORITY_NORMAL2,
|
|
16841
16916
|
SELECTION_CHANGE_COMMAND as SELECTION_CHANGE_COMMAND2
|
|
16842
16917
|
} from "lexical";
|
|
16843
|
-
import { useEffect as
|
|
16918
|
+
import { useEffect as useEffect25, useState as useState25 } from "react";
|
|
16844
16919
|
var TableSelectionPlugin = () => {
|
|
16845
16920
|
const [editor] = useLexicalComposerContext7();
|
|
16846
|
-
const [closestTableCellNode, setClosestTableCellNode] =
|
|
16847
|
-
|
|
16921
|
+
const [closestTableCellNode, setClosestTableCellNode] = useState25(null);
|
|
16922
|
+
useEffect25(() => {
|
|
16848
16923
|
return editor.registerCommand(
|
|
16849
16924
|
SELECTION_CHANGE_COMMAND2,
|
|
16850
16925
|
() => {
|
|
@@ -16866,7 +16941,7 @@ var TableSelectionPlugin = () => {
|
|
|
16866
16941
|
COMMAND_PRIORITY_NORMAL2
|
|
16867
16942
|
);
|
|
16868
16943
|
}, [editor]);
|
|
16869
|
-
|
|
16944
|
+
useEffect25(() => {
|
|
16870
16945
|
const onControlA = (event) => {
|
|
16871
16946
|
if (event.key === "a" && (event.ctrlKey || event.metaKey)) {
|
|
16872
16947
|
if (!closestTableCellNode) {
|
|
@@ -16913,7 +16988,7 @@ import {
|
|
|
16913
16988
|
FORMAT_TEXT_COMMAND,
|
|
16914
16989
|
SELECTION_CHANGE_COMMAND as SELECTION_CHANGE_COMMAND3
|
|
16915
16990
|
} from "lexical";
|
|
16916
|
-
import { useCallback as useCallback14, useEffect as
|
|
16991
|
+
import { useCallback as useCallback14, useEffect as useEffect26 } from "react";
|
|
16917
16992
|
|
|
16918
16993
|
// src/components/ParameterInputs/rich-text/toolbar/constants.ts
|
|
16919
16994
|
var FORMATS_WITH_ICON = /* @__PURE__ */ new Map([
|
|
@@ -16929,7 +17004,7 @@ var HEADING_ELEMENTS = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
|
16929
17004
|
var TEXTUAL_ELEMENTS = HEADING_ELEMENTS;
|
|
16930
17005
|
|
|
16931
17006
|
// src/components/ParameterInputs/rich-text/toolbar/useRichTextToolbarState.ts
|
|
16932
|
-
import { useMemo as useMemo10, useState as
|
|
17007
|
+
import { useMemo as useMemo10, useState as useState26 } from "react";
|
|
16933
17008
|
var useRichTextToolbarState = ({ config }) => {
|
|
16934
17009
|
var _a;
|
|
16935
17010
|
const enabledBuiltInFormats = useMemo10(() => {
|
|
@@ -16950,7 +17025,7 @@ var useRichTextToolbarState = ({ config }) => {
|
|
|
16950
17025
|
const enabledBuiltInFormatsWithoutIcon = enabledBuiltInFormats.filter(
|
|
16951
17026
|
(format) => !FORMATS_WITH_ICON.has(format.type)
|
|
16952
17027
|
);
|
|
16953
|
-
const [activeFormats, setActiveFormats] =
|
|
17028
|
+
const [activeFormats, setActiveFormats] = useState26([]);
|
|
16954
17029
|
const visibleFormatsWithIcon = useMemo10(() => {
|
|
16955
17030
|
const visibleFormats = /* @__PURE__ */ new Set();
|
|
16956
17031
|
activeFormats.filter((type) => FORMATS_WITH_ICON.has(type)).forEach((type) => {
|
|
@@ -16971,7 +17046,7 @@ var useRichTextToolbarState = ({ config }) => {
|
|
|
16971
17046
|
});
|
|
16972
17047
|
return richTextBuiltInFormats.filter((format) => visibleFormats.has(format.type));
|
|
16973
17048
|
}, [activeFormats, enabledBuiltInFormatsWithoutIcon]);
|
|
16974
|
-
const [activeElement, setActiveElement] =
|
|
17049
|
+
const [activeElement, setActiveElement] = useState26("paragraph");
|
|
16975
17050
|
const enabledTextualElements = enabledBuiltInElements.filter(
|
|
16976
17051
|
(element) => TEXTUAL_ELEMENTS.includes(element.type)
|
|
16977
17052
|
);
|
|
@@ -16986,7 +17061,7 @@ var useRichTextToolbarState = ({ config }) => {
|
|
|
16986
17061
|
}
|
|
16987
17062
|
);
|
|
16988
17063
|
}, [activeElement, (_a = config == null ? void 0 : config.elements) == null ? void 0 : _a.builtIn, enabledTextualElements]);
|
|
16989
|
-
const [isLink, setIsLink] =
|
|
17064
|
+
const [isLink, setIsLink] = useState26(false);
|
|
16990
17065
|
const linkElementVisible = useMemo10(() => {
|
|
16991
17066
|
return enabledBuiltInElements.some((element) => element.type === "link") || isLink;
|
|
16992
17067
|
}, [isLink, enabledBuiltInElements]);
|
|
@@ -17214,7 +17289,7 @@ var RichTextToolbar = ({ config, customControls, onInsertTable, onInsertAsset })
|
|
|
17214
17289
|
setIsLink(false);
|
|
17215
17290
|
}
|
|
17216
17291
|
}, [editor, setActiveElement, setActiveFormats, setIsLink]);
|
|
17217
|
-
|
|
17292
|
+
useEffect26(() => {
|
|
17218
17293
|
return editor.registerCommand(
|
|
17219
17294
|
SELECTION_CHANGE_COMMAND3,
|
|
17220
17295
|
(_payload) => {
|
|
@@ -17224,7 +17299,7 @@ var RichTextToolbar = ({ config, customControls, onInsertTable, onInsertAsset })
|
|
|
17224
17299
|
COMMAND_PRIORITY_CRITICAL2
|
|
17225
17300
|
);
|
|
17226
17301
|
}, [editor, updateToolbar]);
|
|
17227
|
-
|
|
17302
|
+
useEffect26(() => {
|
|
17228
17303
|
return editor.registerUpdateListener(({ editorState }) => {
|
|
17229
17304
|
requestAnimationFrame(() => {
|
|
17230
17305
|
editorState.read(() => {
|
|
@@ -17625,12 +17700,12 @@ var RichText = ({
|
|
|
17625
17700
|
placeholder
|
|
17626
17701
|
}) => {
|
|
17627
17702
|
const [editor] = useLexicalComposerContext9();
|
|
17628
|
-
|
|
17703
|
+
useEffect27(() => {
|
|
17629
17704
|
if (onRichTextInit) {
|
|
17630
17705
|
onRichTextInit(editor);
|
|
17631
17706
|
}
|
|
17632
17707
|
}, [editor, onRichTextInit]);
|
|
17633
|
-
|
|
17708
|
+
useEffect27(() => {
|
|
17634
17709
|
const removeUpdateListener = editor.registerUpdateListener(({ editorState, prevEditorState, tags }) => {
|
|
17635
17710
|
requestAnimationFrame(() => {
|
|
17636
17711
|
const previousEditorState = prevEditorState.toJSON();
|
|
@@ -17647,16 +17722,16 @@ var RichText = ({
|
|
|
17647
17722
|
removeUpdateListener();
|
|
17648
17723
|
};
|
|
17649
17724
|
}, [editor, onChange]);
|
|
17650
|
-
|
|
17725
|
+
useEffect27(() => {
|
|
17651
17726
|
editor.setEditable(!readOnly);
|
|
17652
17727
|
}, [editor, readOnly]);
|
|
17653
|
-
const [editorContainerRef, setEditorContainerRef] =
|
|
17728
|
+
const [editorContainerRef, setEditorContainerRef] = useState27(null);
|
|
17654
17729
|
const onEditorContainerRef = (_editorContainerRef) => {
|
|
17655
17730
|
if (_editorContainerRef !== null) {
|
|
17656
17731
|
setEditorContainerRef(_editorContainerRef);
|
|
17657
17732
|
}
|
|
17658
17733
|
};
|
|
17659
|
-
const [portalContainerRef, setPortalContainerRef] =
|
|
17734
|
+
const [portalContainerRef, setPortalContainerRef] = useState27(null);
|
|
17660
17735
|
const onPortalContainerRef = (_portalContainerRef) => {
|
|
17661
17736
|
if (_portalContainerRef !== null) {
|
|
17662
17737
|
setPortalContainerRef(_portalContainerRef);
|
|
@@ -18064,7 +18139,7 @@ var ProgressListItem = ({
|
|
|
18064
18139
|
|
|
18065
18140
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
18066
18141
|
import { css as css111 } from "@emotion/react";
|
|
18067
|
-
import { useCallback as useCallback16, useEffect as
|
|
18142
|
+
import { useCallback as useCallback16, useEffect as useEffect28, useMemo as useMemo13, useRef as useRef17, useState as useState28 } from "react";
|
|
18068
18143
|
|
|
18069
18144
|
// src/components/SegmentedControl/SegmentedControl.styles.ts
|
|
18070
18145
|
import { css as css110 } from "@emotion/react";
|
|
@@ -18243,9 +18318,9 @@ var SegmentedControl = ({
|
|
|
18243
18318
|
// deprecated, destructured to prevent spreading to DOM
|
|
18244
18319
|
...props
|
|
18245
18320
|
}) => {
|
|
18246
|
-
const wrapperRef =
|
|
18247
|
-
const [isOverflowStartShadowVisible, setIsOverflowStartShadowVisible] =
|
|
18248
|
-
const [isOverflowEndShadowVisible, setIsOverflowEndShadowVisible] =
|
|
18321
|
+
const wrapperRef = useRef17(null);
|
|
18322
|
+
const [isOverflowStartShadowVisible, setIsOverflowStartShadowVisible] = useState28(false);
|
|
18323
|
+
const [isOverflowEndShadowVisible, setIsOverflowEndShadowVisible] = useState28(false);
|
|
18249
18324
|
const onOptionChange = useCallback16(
|
|
18250
18325
|
(event) => {
|
|
18251
18326
|
if (event.target.checked) {
|
|
@@ -18266,7 +18341,7 @@ var SegmentedControl = ({
|
|
|
18266
18341
|
const isIconOnly = useMemo13(() => {
|
|
18267
18342
|
return options.every((option) => option && option.icon && !option.label);
|
|
18268
18343
|
}, [options]);
|
|
18269
|
-
|
|
18344
|
+
useEffect28(() => {
|
|
18270
18345
|
const wrapperElement = wrapperRef.current;
|
|
18271
18346
|
const onScroll = () => {
|
|
18272
18347
|
if (!wrapperElement) {
|
|
@@ -18396,7 +18471,7 @@ var Skeleton = ({
|
|
|
18396
18471
|
);
|
|
18397
18472
|
|
|
18398
18473
|
// src/components/Spinner/Spinner.tsx
|
|
18399
|
-
import { useEffect as
|
|
18474
|
+
import { useEffect as useEffect29, useRef as useRef18 } from "react";
|
|
18400
18475
|
|
|
18401
18476
|
// src/components/Spinner/Spinner.styles.ts
|
|
18402
18477
|
import { css as css113 } from "@emotion/react";
|
|
@@ -18836,8 +18911,8 @@ var Spinner = ({
|
|
|
18836
18911
|
label: label2,
|
|
18837
18912
|
isPaused
|
|
18838
18913
|
}) => {
|
|
18839
|
-
const ref =
|
|
18840
|
-
|
|
18914
|
+
const ref = useRef18(null);
|
|
18915
|
+
useEffect29(() => {
|
|
18841
18916
|
var _a, _b, _c;
|
|
18842
18917
|
(_c = ref.current) == null ? void 0 : _c.style.setProperty("--pyramid-size", ((_b = (_a = ref.current) == null ? void 0 : _a.clientWidth) != null ? _b : 200) / 6 + "px");
|
|
18843
18918
|
}, [width]);
|
|
@@ -18905,7 +18980,7 @@ var Spinner = ({
|
|
|
18905
18980
|
};
|
|
18906
18981
|
|
|
18907
18982
|
// src/components/StackedModal/hooks/StackedModalProvider.tsx
|
|
18908
|
-
import { createContext as createContext6, useCallback as useCallback17, useContext as useContext6, useMemo as useMemo14, useRef as
|
|
18983
|
+
import { createContext as createContext6, useCallback as useCallback17, useContext as useContext6, useMemo as useMemo14, useRef as useRef19, useState as useState29 } from "react";
|
|
18909
18984
|
import { jsx as jsx153 } from "@emotion/react/jsx-runtime";
|
|
18910
18985
|
var StackedModalContext = createContext6(null);
|
|
18911
18986
|
function useStackedModal() {
|
|
@@ -18925,9 +19000,9 @@ function useStepTransition(index) {
|
|
|
18925
19000
|
};
|
|
18926
19001
|
}
|
|
18927
19002
|
function StackedModalProvider({ children, totalSteps, initialStep }) {
|
|
18928
|
-
const [currentStep, setCurrentStep] =
|
|
18929
|
-
const [direction, setDirection] =
|
|
18930
|
-
const previousStepRef =
|
|
19003
|
+
const [currentStep, setCurrentStep] = useState29(initialStep);
|
|
19004
|
+
const [direction, setDirection] = useState29("forward");
|
|
19005
|
+
const previousStepRef = useRef19(initialStep);
|
|
18931
19006
|
const nextStep = useCallback17(() => {
|
|
18932
19007
|
setCurrentStep((prev) => {
|
|
18933
19008
|
if (prev >= totalSteps - 1) {
|