@octaviaflow/core 3.0.18-beta.45 → 3.0.18-beta.47
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/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts +7 -0
- package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/index.cjs +1088 -964
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +668 -543
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utils/useAnchoredPopover.d.ts +60 -0
- package/dist/utils/useAnchoredPopover.d.ts.map +1 -0
- package/dist/workflow/types.d.ts +58 -33
- package/dist/workflow/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11873,12 +11873,99 @@ function ChevronRightSmall() {
|
|
|
11873
11873
|
import { CalendarIcon, ChevronDownIcon as ChevronDownIcon5 } from "@octaviaflow/icons";
|
|
11874
11874
|
import {
|
|
11875
11875
|
forwardRef as forwardRef36,
|
|
11876
|
-
useEffect as
|
|
11876
|
+
useEffect as useEffect18,
|
|
11877
11877
|
useId as useId21,
|
|
11878
11878
|
useImperativeHandle as useImperativeHandle7,
|
|
11879
11879
|
useRef as useRef21,
|
|
11880
|
+
useState as useState22
|
|
11881
|
+
} from "react";
|
|
11882
|
+
import { createPortal as createPortal9 } from "react-dom";
|
|
11883
|
+
|
|
11884
|
+
// src/utils/useAnchoredPopover.ts
|
|
11885
|
+
import {
|
|
11886
|
+
useCallback as useCallback19,
|
|
11887
|
+
useEffect as useEffect17,
|
|
11880
11888
|
useState as useState21
|
|
11881
11889
|
} from "react";
|
|
11890
|
+
function computeAnchoredPosition({
|
|
11891
|
+
anchor,
|
|
11892
|
+
viewport,
|
|
11893
|
+
popoverWidth,
|
|
11894
|
+
gap,
|
|
11895
|
+
margin,
|
|
11896
|
+
preferredMinHeight
|
|
11897
|
+
}) {
|
|
11898
|
+
const spaceBelow = viewport.height - anchor.bottom - gap - margin;
|
|
11899
|
+
const spaceAbove = anchor.top - gap - margin;
|
|
11900
|
+
const openUp = spaceBelow < preferredMinHeight && spaceAbove > spaceBelow;
|
|
11901
|
+
const popW = popoverWidth && popoverWidth > 0 ? popoverWidth : anchor.width;
|
|
11902
|
+
const maxLeft = viewport.width - popW - margin;
|
|
11903
|
+
let left = anchor.left;
|
|
11904
|
+
if (left > maxLeft) left = maxLeft;
|
|
11905
|
+
if (left < margin) left = margin;
|
|
11906
|
+
return {
|
|
11907
|
+
...openUp ? { bottom: viewport.height - anchor.top + gap } : { top: anchor.bottom + gap },
|
|
11908
|
+
left,
|
|
11909
|
+
width: anchor.width,
|
|
11910
|
+
maxHeight: Math.max(120, openUp ? spaceAbove : spaceBelow),
|
|
11911
|
+
direction: openUp ? "up" : "down"
|
|
11912
|
+
};
|
|
11913
|
+
}
|
|
11914
|
+
function useAnchoredPopover(anchorRef, open, options = {}) {
|
|
11915
|
+
const { gap = 4, margin = 8, preferredMinHeight = 200, popoverRef } = options;
|
|
11916
|
+
const [pos, setPos] = useState21({
|
|
11917
|
+
top: -9999,
|
|
11918
|
+
left: -9999,
|
|
11919
|
+
width: 0,
|
|
11920
|
+
maxHeight: 320,
|
|
11921
|
+
direction: "down"
|
|
11922
|
+
});
|
|
11923
|
+
const update = useCallback19(() => {
|
|
11924
|
+
const el = anchorRef.current;
|
|
11925
|
+
if (!el) return;
|
|
11926
|
+
const rect = el.getBoundingClientRect();
|
|
11927
|
+
const popoverWidth = popoverRef?.current?.offsetWidth;
|
|
11928
|
+
setPos(
|
|
11929
|
+
computeAnchoredPosition({
|
|
11930
|
+
anchor: {
|
|
11931
|
+
top: rect.top,
|
|
11932
|
+
bottom: rect.bottom,
|
|
11933
|
+
left: rect.left,
|
|
11934
|
+
width: rect.width
|
|
11935
|
+
},
|
|
11936
|
+
viewport: { width: window.innerWidth, height: window.innerHeight },
|
|
11937
|
+
popoverWidth,
|
|
11938
|
+
gap,
|
|
11939
|
+
margin,
|
|
11940
|
+
preferredMinHeight
|
|
11941
|
+
})
|
|
11942
|
+
);
|
|
11943
|
+
}, [anchorRef, popoverRef, gap, margin, preferredMinHeight]);
|
|
11944
|
+
useEffect17(() => {
|
|
11945
|
+
if (!open) return;
|
|
11946
|
+
update();
|
|
11947
|
+
window.addEventListener("scroll", update, true);
|
|
11948
|
+
window.addEventListener("resize", update);
|
|
11949
|
+
return () => {
|
|
11950
|
+
window.removeEventListener("scroll", update, true);
|
|
11951
|
+
window.removeEventListener("resize", update);
|
|
11952
|
+
};
|
|
11953
|
+
}, [open, update]);
|
|
11954
|
+
return pos;
|
|
11955
|
+
}
|
|
11956
|
+
function anchoredPopoverStyle(pos, extra) {
|
|
11957
|
+
return {
|
|
11958
|
+
position: "fixed",
|
|
11959
|
+
...pos.top !== void 0 ? { top: pos.top } : {},
|
|
11960
|
+
...pos.bottom !== void 0 ? { bottom: pos.bottom } : {},
|
|
11961
|
+
left: pos.left,
|
|
11962
|
+
minWidth: pos.width,
|
|
11963
|
+
maxHeight: pos.maxHeight,
|
|
11964
|
+
...extra
|
|
11965
|
+
};
|
|
11966
|
+
}
|
|
11967
|
+
|
|
11968
|
+
// src/components/DatePicker/DatePicker.tsx
|
|
11882
11969
|
import { jsx as jsx39, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
11883
11970
|
var defaultFormat2 = (d) => d.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric" });
|
|
11884
11971
|
function toIsoDate(d) {
|
|
@@ -11911,22 +11998,36 @@ var DatePicker = forwardRef36(
|
|
|
11911
11998
|
className,
|
|
11912
11999
|
...rest
|
|
11913
12000
|
}, forwardedRef) {
|
|
11914
|
-
const [open, setOpen] =
|
|
12001
|
+
const [open, setOpen] = useState22(false);
|
|
11915
12002
|
const wrapRef = useRef21(null);
|
|
11916
12003
|
const triggerRef = useRef21(null);
|
|
12004
|
+
const popoverRef = useRef21(null);
|
|
12005
|
+
const popoverPos = useAnchoredPopover(triggerRef, open, { popoverRef });
|
|
11917
12006
|
useImperativeHandle7(forwardedRef, () => triggerRef.current);
|
|
11918
12007
|
const reactId = useId21();
|
|
11919
12008
|
const baseId = id ?? `ods-dp-${reactId}`;
|
|
11920
12009
|
const helperId = error || helperText ? `${baseId}-helper` : void 0;
|
|
11921
12010
|
const ariaLabelForDialog = popoverAriaLabel ?? (typeof label === "string" ? `${label} calendar` : "Date picker");
|
|
11922
|
-
|
|
12011
|
+
useEffect18(() => {
|
|
11923
12012
|
if (!open) return;
|
|
11924
12013
|
const onDoc = (e) => {
|
|
11925
|
-
|
|
12014
|
+
const target = e.target;
|
|
12015
|
+
if (!wrapRef.current?.contains(target) && !popoverRef.current?.contains(target))
|
|
12016
|
+
setOpen(false);
|
|
12017
|
+
};
|
|
12018
|
+
const onKey = (e) => {
|
|
12019
|
+
if (closeOnEsc && e.key === "Escape") {
|
|
12020
|
+
setOpen(false);
|
|
12021
|
+
triggerRef.current?.focus();
|
|
12022
|
+
}
|
|
11926
12023
|
};
|
|
11927
12024
|
document.addEventListener("mousedown", onDoc);
|
|
11928
|
-
|
|
11929
|
-
|
|
12025
|
+
document.addEventListener("keydown", onKey);
|
|
12026
|
+
return () => {
|
|
12027
|
+
document.removeEventListener("mousedown", onDoc);
|
|
12028
|
+
document.removeEventListener("keydown", onKey);
|
|
12029
|
+
};
|
|
12030
|
+
}, [open, closeOnEsc]);
|
|
11930
12031
|
const handleKeyDown = (e) => {
|
|
11931
12032
|
if (closeOnEsc && e.key === "Escape" && open) {
|
|
11932
12033
|
e.stopPropagation();
|
|
@@ -11992,30 +12093,35 @@ var DatePicker = forwardRef36(
|
|
|
11992
12093
|
required
|
|
11993
12094
|
}
|
|
11994
12095
|
),
|
|
11995
|
-
open &&
|
|
11996
|
-
|
|
11997
|
-
|
|
11998
|
-
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
|
|
12006
|
-
|
|
12007
|
-
|
|
12008
|
-
|
|
12009
|
-
|
|
12010
|
-
|
|
12011
|
-
|
|
12012
|
-
|
|
12013
|
-
|
|
12014
|
-
|
|
12015
|
-
|
|
12016
|
-
|
|
12017
|
-
|
|
12018
|
-
|
|
12096
|
+
open && typeof document !== "undefined" && createPortal9(
|
|
12097
|
+
/* @__PURE__ */ jsx39(
|
|
12098
|
+
"div",
|
|
12099
|
+
{
|
|
12100
|
+
ref: popoverRef,
|
|
12101
|
+
className: "ods-datepicker__popover",
|
|
12102
|
+
role: "dialog",
|
|
12103
|
+
"aria-modal": "false",
|
|
12104
|
+
"aria-label": ariaLabelForDialog,
|
|
12105
|
+
style: anchoredPopoverStyle(popoverPos),
|
|
12106
|
+
children: /* @__PURE__ */ jsx39(
|
|
12107
|
+
Calendar,
|
|
12108
|
+
{
|
|
12109
|
+
mode: "single",
|
|
12110
|
+
value,
|
|
12111
|
+
onChange: (d) => {
|
|
12112
|
+
onChange?.(d);
|
|
12113
|
+
setOpen(false);
|
|
12114
|
+
triggerRef.current?.focus();
|
|
12115
|
+
},
|
|
12116
|
+
minDate,
|
|
12117
|
+
maxDate,
|
|
12118
|
+
locale,
|
|
12119
|
+
autoFocus: true
|
|
12120
|
+
}
|
|
12121
|
+
)
|
|
12122
|
+
}
|
|
12123
|
+
),
|
|
12124
|
+
document.body
|
|
12019
12125
|
),
|
|
12020
12126
|
(error || helperText) && /* @__PURE__ */ jsx39(
|
|
12021
12127
|
"div",
|
|
@@ -12376,9 +12482,9 @@ Drawer.displayName = "Drawer";
|
|
|
12376
12482
|
|
|
12377
12483
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
12378
12484
|
import { AnimatePresence as AnimatePresence13, motion as motion19 } from "framer-motion";
|
|
12379
|
-
import { useEffect as
|
|
12485
|
+
import { useEffect as useEffect19, useMemo as useMemo14, useRef as useRef22 } from "react";
|
|
12380
12486
|
import { useButton as useButton4, useMenu, useMenuItem, useMenuTrigger } from "react-aria";
|
|
12381
|
-
import { createPortal as
|
|
12487
|
+
import { createPortal as createPortal10 } from "react-dom";
|
|
12382
12488
|
import { Fragment as Fragment22, jsx as jsx44, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
12383
12489
|
function MenuItemComponent({ item, state, onAction }) {
|
|
12384
12490
|
const ref = useRef22(null);
|
|
@@ -12414,7 +12520,7 @@ function MenuPopup({
|
|
|
12414
12520
|
ariaNameProps
|
|
12415
12521
|
}) {
|
|
12416
12522
|
const menuRef = useRef22(null);
|
|
12417
|
-
|
|
12523
|
+
useEffect19(() => {
|
|
12418
12524
|
if (!state.isOpen || !closeOnOutsideClick) return;
|
|
12419
12525
|
const handler = (e) => {
|
|
12420
12526
|
const target = e.target;
|
|
@@ -12428,7 +12534,7 @@ function MenuPopup({
|
|
|
12428
12534
|
document.addEventListener("mousedown", handler, true);
|
|
12429
12535
|
return () => document.removeEventListener("mousedown", handler, true);
|
|
12430
12536
|
}, [state.isOpen, closeOnOutsideClick]);
|
|
12431
|
-
|
|
12537
|
+
useEffect19(() => {
|
|
12432
12538
|
if (!state.isOpen || !closeOnEscape) return;
|
|
12433
12539
|
const handler = (e) => {
|
|
12434
12540
|
if (e.key === "Escape") {
|
|
@@ -12542,7 +12648,7 @@ function MenuPopup({
|
|
|
12542
12648
|
}
|
|
12543
12649
|
) });
|
|
12544
12650
|
if (typeof document !== "undefined") {
|
|
12545
|
-
return
|
|
12651
|
+
return createPortal10(portalContent, document.body);
|
|
12546
12652
|
}
|
|
12547
12653
|
return null;
|
|
12548
12654
|
}
|
|
@@ -12639,7 +12745,7 @@ EmptyState.displayName = "EmptyState";
|
|
|
12639
12745
|
|
|
12640
12746
|
// src/components/ExecutionConsole/ExecutionConsole.tsx
|
|
12641
12747
|
import { motion as motion20 } from "framer-motion";
|
|
12642
|
-
import { useEffect as
|
|
12748
|
+
import { useEffect as useEffect20, useMemo as useMemo15, useRef as useRef23, useState as useState23 } from "react";
|
|
12643
12749
|
import { Fragment as Fragment23, jsx as jsx46, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
12644
12750
|
var iconProps = {
|
|
12645
12751
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12712,12 +12818,12 @@ function ExecutionConsole({
|
|
|
12712
12818
|
const logEndRef = useRef23(null);
|
|
12713
12819
|
const logsRef = useRef23(null);
|
|
12714
12820
|
const lastScrollTopRef = useRef23(0);
|
|
12715
|
-
const [query, setQuery] =
|
|
12716
|
-
const [activeLevels, setActiveLevels] =
|
|
12717
|
-
const [activeNode, setActiveNode] =
|
|
12718
|
-
const [autoScroll, setAutoScroll] =
|
|
12719
|
-
const [expandedLines, setExpandedLines] =
|
|
12720
|
-
const [exportMenuOpen, setExportMenuOpen] =
|
|
12821
|
+
const [query, setQuery] = useState23("");
|
|
12822
|
+
const [activeLevels, setActiveLevels] = useState23(() => new Set(ALL_LEVELS));
|
|
12823
|
+
const [activeNode, setActiveNode] = useState23("all");
|
|
12824
|
+
const [autoScroll, setAutoScroll] = useState23(running);
|
|
12825
|
+
const [expandedLines, setExpandedLines] = useState23(/* @__PURE__ */ new Set());
|
|
12826
|
+
const [exportMenuOpen, setExportMenuOpen] = useState23(false);
|
|
12721
12827
|
const nodeOptions = useMemo15(() => {
|
|
12722
12828
|
const seen = /* @__PURE__ */ new Map();
|
|
12723
12829
|
for (const log of logs) {
|
|
@@ -12740,13 +12846,13 @@ function ExecutionConsole({
|
|
|
12740
12846
|
});
|
|
12741
12847
|
}, [logs, query, activeLevels, activeNode]);
|
|
12742
12848
|
const prevRunningRef = useRef23(running);
|
|
12743
|
-
|
|
12849
|
+
useEffect20(() => {
|
|
12744
12850
|
if (prevRunningRef.current !== running) {
|
|
12745
12851
|
setAutoScroll(running);
|
|
12746
12852
|
prevRunningRef.current = running;
|
|
12747
12853
|
}
|
|
12748
12854
|
}, [running]);
|
|
12749
|
-
|
|
12855
|
+
useEffect20(() => {
|
|
12750
12856
|
if (!open || !autoScroll) return;
|
|
12751
12857
|
const el = logEndRef.current;
|
|
12752
12858
|
if (el && typeof el.scrollIntoView === "function") {
|
|
@@ -13226,12 +13332,12 @@ import {
|
|
|
13226
13332
|
} from "@octaviaflow/icons";
|
|
13227
13333
|
import {
|
|
13228
13334
|
forwardRef as forwardRef43,
|
|
13229
|
-
useCallback as
|
|
13230
|
-
useEffect as
|
|
13335
|
+
useCallback as useCallback20,
|
|
13336
|
+
useEffect as useEffect21,
|
|
13231
13337
|
useId as useId24,
|
|
13232
13338
|
useImperativeHandle as useImperativeHandle8,
|
|
13233
13339
|
useRef as useRef24,
|
|
13234
|
-
useState as
|
|
13340
|
+
useState as useState24
|
|
13235
13341
|
} from "react";
|
|
13236
13342
|
|
|
13237
13343
|
// src/utils/sanitizeUrl.ts
|
|
@@ -13359,10 +13465,10 @@ var FileDropzone = forwardRef43(
|
|
|
13359
13465
|
const dropzoneRef = useRef24(null);
|
|
13360
13466
|
useImperativeHandle8(forwardedRef, () => dropzoneRef.current);
|
|
13361
13467
|
const inputId = useId24();
|
|
13362
|
-
const [isOver, setOver] =
|
|
13363
|
-
const [error, setError] =
|
|
13364
|
-
const [autoPreviews, setAutoPreviews] =
|
|
13365
|
-
const validate =
|
|
13468
|
+
const [isOver, setOver] = useState24(false);
|
|
13469
|
+
const [error, setError] = useState24(null);
|
|
13470
|
+
const [autoPreviews, setAutoPreviews] = useState24({});
|
|
13471
|
+
const validate = useCallback20(
|
|
13366
13472
|
(list) => {
|
|
13367
13473
|
if (maxFiles && list.length > maxFiles) {
|
|
13368
13474
|
return { ok: [], error: `Too many files \u2014 max ${maxFiles}` };
|
|
@@ -13391,7 +13497,7 @@ var FileDropzone = forwardRef43(
|
|
|
13391
13497
|
},
|
|
13392
13498
|
[accept, maxFiles, maxSize]
|
|
13393
13499
|
);
|
|
13394
|
-
const handleFiles =
|
|
13500
|
+
const handleFiles = useCallback20(
|
|
13395
13501
|
(incoming) => {
|
|
13396
13502
|
if (disabled) return;
|
|
13397
13503
|
const { ok, error: error2 } = validate(incoming);
|
|
@@ -13400,7 +13506,7 @@ var FileDropzone = forwardRef43(
|
|
|
13400
13506
|
},
|
|
13401
13507
|
[disabled, onFiles, validate]
|
|
13402
13508
|
);
|
|
13403
|
-
|
|
13509
|
+
useEffect21(() => {
|
|
13404
13510
|
if (!files) return;
|
|
13405
13511
|
const next = {};
|
|
13406
13512
|
const created = [];
|
|
@@ -13417,7 +13523,7 @@ var FileDropzone = forwardRef43(
|
|
|
13417
13523
|
for (const u of created) URL.revokeObjectURL(u);
|
|
13418
13524
|
};
|
|
13419
13525
|
}, [files]);
|
|
13420
|
-
|
|
13526
|
+
useEffect21(() => {
|
|
13421
13527
|
if (!pasteEnabled || disabled) return;
|
|
13422
13528
|
const onPaste = (e) => {
|
|
13423
13529
|
const active = document.activeElement;
|
|
@@ -13675,10 +13781,10 @@ FileDropzone.displayName = "FileDropzone";
|
|
|
13675
13781
|
|
|
13676
13782
|
// src/components/FlowCanvas/FlowCanvas.tsx
|
|
13677
13783
|
import { AnimatePresence as AnimatePresence14 } from "framer-motion";
|
|
13678
|
-
import { useCallback as
|
|
13784
|
+
import { useCallback as useCallback22, useRef as useRef26 } from "react";
|
|
13679
13785
|
|
|
13680
13786
|
// src/components/FlowEdge/FlowEdge.tsx
|
|
13681
|
-
import { useId as useId25, useState as
|
|
13787
|
+
import { useId as useId25, useState as useState25 } from "react";
|
|
13682
13788
|
import { jsx as jsx49, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
13683
13789
|
var DEFAULT_NODE_WIDTH = 368;
|
|
13684
13790
|
var DEFAULT_NODE_HEIGHT = 96;
|
|
@@ -13722,7 +13828,7 @@ function FlowEdge({
|
|
|
13722
13828
|
}) {
|
|
13723
13829
|
const uid = useId25();
|
|
13724
13830
|
const markerId = `ods-flow-edge-arrow-${uid.replace(/:/g, "")}`;
|
|
13725
|
-
const [hovered, setHovered] =
|
|
13831
|
+
const [hovered, setHovered] = useState25(false);
|
|
13726
13832
|
const sourceNode = nodes.find((n) => n.id === edge.source);
|
|
13727
13833
|
const targetNode = nodes.find((n) => n.id === edge.target);
|
|
13728
13834
|
if (!sourceNode || !targetNode) return null;
|
|
@@ -13862,10 +13968,10 @@ function FlowEdge({
|
|
|
13862
13968
|
import { motion as motion21 } from "framer-motion";
|
|
13863
13969
|
import {
|
|
13864
13970
|
forwardRef as forwardRef44,
|
|
13865
|
-
useCallback as
|
|
13866
|
-
useEffect as
|
|
13971
|
+
useCallback as useCallback21,
|
|
13972
|
+
useEffect as useEffect22,
|
|
13867
13973
|
useRef as useRef25,
|
|
13868
|
-
useState as
|
|
13974
|
+
useState as useState26
|
|
13869
13975
|
} from "react";
|
|
13870
13976
|
import { jsx as jsx50, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
13871
13977
|
var DRAG_THRESHOLD_PX = 5;
|
|
@@ -13926,11 +14032,11 @@ var FlowNode = forwardRef44(function FlowNode2({
|
|
|
13926
14032
|
className,
|
|
13927
14033
|
style
|
|
13928
14034
|
}, ref) {
|
|
13929
|
-
const [isDragging, setIsDragging] =
|
|
13930
|
-
const [wasDragged, setWasDragged] =
|
|
14035
|
+
const [isDragging, setIsDragging] = useState26(false);
|
|
14036
|
+
const [wasDragged, setWasDragged] = useState26(false);
|
|
13931
14037
|
const dragStartRef = useRef25(null);
|
|
13932
14038
|
const zoom = viewport?.zoom ?? 1;
|
|
13933
|
-
const handleClick =
|
|
14039
|
+
const handleClick = useCallback21(
|
|
13934
14040
|
(e) => {
|
|
13935
14041
|
e.stopPropagation();
|
|
13936
14042
|
if (wasDragged) {
|
|
@@ -13941,7 +14047,7 @@ var FlowNode = forwardRef44(function FlowNode2({
|
|
|
13941
14047
|
},
|
|
13942
14048
|
[node.id, onSelect, wasDragged]
|
|
13943
14049
|
);
|
|
13944
|
-
const handleDelete =
|
|
14050
|
+
const handleDelete = useCallback21(
|
|
13945
14051
|
(e) => {
|
|
13946
14052
|
e.stopPropagation();
|
|
13947
14053
|
if (isLockMode) return;
|
|
@@ -13949,7 +14055,7 @@ var FlowNode = forwardRef44(function FlowNode2({
|
|
|
13949
14055
|
},
|
|
13950
14056
|
[node.id, onDelete, isLockMode]
|
|
13951
14057
|
);
|
|
13952
|
-
const handleMouseDown =
|
|
14058
|
+
const handleMouseDown = useCallback21(
|
|
13953
14059
|
(e) => {
|
|
13954
14060
|
if (isLockMode) return;
|
|
13955
14061
|
const target = e.target;
|
|
@@ -13962,7 +14068,7 @@ var FlowNode = forwardRef44(function FlowNode2({
|
|
|
13962
14068
|
},
|
|
13963
14069
|
[isLockMode]
|
|
13964
14070
|
);
|
|
13965
|
-
const handleTouchStart =
|
|
14071
|
+
const handleTouchStart = useCallback21(
|
|
13966
14072
|
(e) => {
|
|
13967
14073
|
if (isLockMode) return;
|
|
13968
14074
|
if (e.touches.length !== 1) return;
|
|
@@ -13979,7 +14085,7 @@ var FlowNode = forwardRef44(function FlowNode2({
|
|
|
13979
14085
|
},
|
|
13980
14086
|
[isLockMode]
|
|
13981
14087
|
);
|
|
13982
|
-
|
|
14088
|
+
useEffect22(() => {
|
|
13983
14089
|
if (!isDragging) return;
|
|
13984
14090
|
const applyDelta = (clientX, clientY) => {
|
|
13985
14091
|
const start = dragStartRef.current;
|
|
@@ -14024,7 +14130,7 @@ var FlowNode = forwardRef44(function FlowNode2({
|
|
|
14024
14130
|
document.removeEventListener("touchcancel", onTouchEnd);
|
|
14025
14131
|
};
|
|
14026
14132
|
}, [isDragging, zoom, node.id, node.position.x, node.position.y, onPositionChange]);
|
|
14027
|
-
const handlePortMouseDown =
|
|
14133
|
+
const handlePortMouseDown = useCallback21(
|
|
14028
14134
|
(e, portId, portType) => {
|
|
14029
14135
|
e.stopPropagation();
|
|
14030
14136
|
if (isLockMode) return;
|
|
@@ -14034,7 +14140,7 @@ var FlowNode = forwardRef44(function FlowNode2({
|
|
|
14034
14140
|
},
|
|
14035
14141
|
[connectingFrom, isLockMode, node.id, onStartConnecting]
|
|
14036
14142
|
);
|
|
14037
|
-
const handlePortMouseUp =
|
|
14143
|
+
const handlePortMouseUp = useCallback21(
|
|
14038
14144
|
(e, portId, portType) => {
|
|
14039
14145
|
e.stopPropagation();
|
|
14040
14146
|
if (isLockMode) return;
|
|
@@ -14043,7 +14149,7 @@ var FlowNode = forwardRef44(function FlowNode2({
|
|
|
14043
14149
|
},
|
|
14044
14150
|
[connectingFrom, isLockMode, node.id, onEndConnecting]
|
|
14045
14151
|
);
|
|
14046
|
-
const isPortEdgeSelected =
|
|
14152
|
+
const isPortEdgeSelected = useCallback21(
|
|
14047
14153
|
(portId, portType) => edges.some(
|
|
14048
14154
|
(edge) => edge.selected && (portType === "input" ? edge.target === node.id && edge.targetPort === portId : edge.source === node.id && edge.sourcePort === portId)
|
|
14049
14155
|
),
|
|
@@ -14278,7 +14384,7 @@ function FlowCanvas2({
|
|
|
14278
14384
|
}) {
|
|
14279
14385
|
const canvasRef = useRef26(null);
|
|
14280
14386
|
const isEmpty = nodes.length === 0 && edges.length === 0;
|
|
14281
|
-
const handleCanvasClick =
|
|
14387
|
+
const handleCanvasClick = useCallback22(
|
|
14282
14388
|
(e) => {
|
|
14283
14389
|
const target = e.target;
|
|
14284
14390
|
if (target === canvasRef.current) {
|
|
@@ -14370,12 +14476,12 @@ function FlowCanvas2({
|
|
|
14370
14476
|
|
|
14371
14477
|
// src/components/FlowMinimap/FlowMinimap.tsx
|
|
14372
14478
|
import {
|
|
14373
|
-
useCallback as
|
|
14479
|
+
useCallback as useCallback23,
|
|
14374
14480
|
useContext,
|
|
14375
|
-
useEffect as
|
|
14481
|
+
useEffect as useEffect23,
|
|
14376
14482
|
useMemo as useMemo16,
|
|
14377
14483
|
useRef as useRef27,
|
|
14378
|
-
useState as
|
|
14484
|
+
useState as useState27,
|
|
14379
14485
|
useSyncExternalStore
|
|
14380
14486
|
} from "react";
|
|
14381
14487
|
import { jsx as jsx52, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
@@ -14408,8 +14514,8 @@ function FlowMinimap(props) {
|
|
|
14408
14514
|
[store]
|
|
14409
14515
|
);
|
|
14410
14516
|
const liveSnapshot = useSyncExternalStore(sub, snap, snap);
|
|
14411
|
-
const [registryVersion, setRegistryVersion] =
|
|
14412
|
-
|
|
14517
|
+
const [registryVersion, setRegistryVersion] = useState27(0);
|
|
14518
|
+
useEffect23(() => {
|
|
14413
14519
|
if (!handleRegistry) return;
|
|
14414
14520
|
return handleRegistry.subscribe(() => setRegistryVersion((v) => v + 1));
|
|
14415
14521
|
}, [handleRegistry]);
|
|
@@ -14463,8 +14569,8 @@ function FlowMinimap(props) {
|
|
|
14463
14569
|
});
|
|
14464
14570
|
}, [edgesProp, liveSnapshot, handleRegistry, registryVersion]);
|
|
14465
14571
|
const minimapRef = useRef27(null);
|
|
14466
|
-
const [canvasSize, setCanvasSize] =
|
|
14467
|
-
|
|
14572
|
+
const [canvasSize, setCanvasSize] = useState27(null);
|
|
14573
|
+
useEffect23(() => {
|
|
14468
14574
|
if (!liveSnapshot) return;
|
|
14469
14575
|
const el = minimapRef.current?.closest(".ods-flow-canvas-v2");
|
|
14470
14576
|
if (!el) return;
|
|
@@ -14518,7 +14624,7 @@ function FlowMinimap(props) {
|
|
|
14518
14624
|
h: maxY - minY + bounds_padding * 2
|
|
14519
14625
|
};
|
|
14520
14626
|
}, [totalWidthProp, totalHeightProp, contentBounds, bounds_padding]);
|
|
14521
|
-
const clampWorldTopLeft =
|
|
14627
|
+
const clampWorldTopLeft = useCallback23(
|
|
14522
14628
|
(worldX, worldY, vw, vh) => {
|
|
14523
14629
|
if (!contentBounds) return { x: worldX, y: worldY };
|
|
14524
14630
|
const minTLX = viewBox.x;
|
|
@@ -14531,7 +14637,7 @@ function FlowMinimap(props) {
|
|
|
14531
14637
|
},
|
|
14532
14638
|
[contentBounds, viewBox.x, viewBox.y, viewBox.w, viewBox.h]
|
|
14533
14639
|
);
|
|
14534
|
-
const reportViewportChange =
|
|
14640
|
+
const reportViewportChange = useCallback23(
|
|
14535
14641
|
(worldX, worldY) => {
|
|
14536
14642
|
if (effectiveViewportRect) {
|
|
14537
14643
|
const clamped = clampWorldTopLeft(
|
|
@@ -14567,7 +14673,7 @@ function FlowMinimap(props) {
|
|
|
14567
14673
|
[onViewportChange, viewportProp?.zoom, instance, liveSnapshot, effectiveViewportRect, clampWorldTopLeft]
|
|
14568
14674
|
);
|
|
14569
14675
|
const svgRef = useRef27(null);
|
|
14570
|
-
const pointToWorld =
|
|
14676
|
+
const pointToWorld = useCallback23(
|
|
14571
14677
|
(clientX, clientY) => {
|
|
14572
14678
|
const svg = svgRef.current;
|
|
14573
14679
|
if (!svg) return null;
|
|
@@ -14593,8 +14699,8 @@ function FlowMinimap(props) {
|
|
|
14593
14699
|
startClientY: 0
|
|
14594
14700
|
});
|
|
14595
14701
|
const suppressNextClickRef = useRef27(false);
|
|
14596
|
-
const [isDragging, setIsDragging] =
|
|
14597
|
-
const onViewportPointerDown =
|
|
14702
|
+
const [isDragging, setIsDragging] = useState27(false);
|
|
14703
|
+
const onViewportPointerDown = useCallback23(
|
|
14598
14704
|
(e) => {
|
|
14599
14705
|
if (!effectiveViewportRect) return;
|
|
14600
14706
|
e.stopPropagation();
|
|
@@ -14616,7 +14722,7 @@ function FlowMinimap(props) {
|
|
|
14616
14722
|
},
|
|
14617
14723
|
[effectiveViewportRect, pointToWorld]
|
|
14618
14724
|
);
|
|
14619
|
-
const onSvgPointerMove =
|
|
14725
|
+
const onSvgPointerMove = useCallback23(
|
|
14620
14726
|
(e) => {
|
|
14621
14727
|
const d = dragRef.current;
|
|
14622
14728
|
if (!d.dragging || d.pointerId !== e.pointerId) return;
|
|
@@ -14632,7 +14738,7 @@ function FlowMinimap(props) {
|
|
|
14632
14738
|
},
|
|
14633
14739
|
[pointToWorld, reportViewportChange]
|
|
14634
14740
|
);
|
|
14635
|
-
const onSvgPointerUp =
|
|
14741
|
+
const onSvgPointerUp = useCallback23((e) => {
|
|
14636
14742
|
const d = dragRef.current;
|
|
14637
14743
|
if (d.dragging && d.pointerId === e.pointerId) {
|
|
14638
14744
|
d.dragging = false;
|
|
@@ -14641,7 +14747,7 @@ function FlowMinimap(props) {
|
|
|
14641
14747
|
e.currentTarget.releasePointerCapture?.(e.pointerId);
|
|
14642
14748
|
}
|
|
14643
14749
|
}, []);
|
|
14644
|
-
const handleSvgClick =
|
|
14750
|
+
const handleSvgClick = useCallback23(
|
|
14645
14751
|
(e) => {
|
|
14646
14752
|
if (suppressNextClickRef.current) {
|
|
14647
14753
|
suppressNextClickRef.current = false;
|
|
@@ -14659,7 +14765,7 @@ function FlowMinimap(props) {
|
|
|
14659
14765
|
},
|
|
14660
14766
|
[pointToWorld, effectiveViewportRect, reportViewportChange]
|
|
14661
14767
|
);
|
|
14662
|
-
const handleWheel =
|
|
14768
|
+
const handleWheel = useCallback23(
|
|
14663
14769
|
(e) => {
|
|
14664
14770
|
if (!zoomOnScroll) return;
|
|
14665
14771
|
if (!instance || !liveSnapshot) return;
|
|
@@ -14685,7 +14791,7 @@ function FlowMinimap(props) {
|
|
|
14685
14791
|
},
|
|
14686
14792
|
[zoomOnScroll, instance, liveSnapshot, canvasSize, pointToWorld, clampWorldTopLeft]
|
|
14687
14793
|
);
|
|
14688
|
-
|
|
14794
|
+
useEffect23(
|
|
14689
14795
|
() => () => {
|
|
14690
14796
|
dragRef.current.dragging = false;
|
|
14691
14797
|
},
|
|
@@ -14785,7 +14891,7 @@ import {
|
|
|
14785
14891
|
ZoomInIcon,
|
|
14786
14892
|
ZoomOutIcon
|
|
14787
14893
|
} from "@octaviaflow/icons";
|
|
14788
|
-
import { useEffect as
|
|
14894
|
+
import { useEffect as useEffect24, useRef as useRef28, useState as useState28 } from "react";
|
|
14789
14895
|
|
|
14790
14896
|
// src/components/Spinner/Spinner.tsx
|
|
14791
14897
|
import {
|
|
@@ -14939,10 +15045,10 @@ function FlowToolbarSave({
|
|
|
14939
15045
|
showLabel = false,
|
|
14940
15046
|
className
|
|
14941
15047
|
}) {
|
|
14942
|
-
const [inferred, setInferred] =
|
|
15048
|
+
const [inferred, setInferred] = useState28("idle");
|
|
14943
15049
|
const prevSavedAt = useRef28(lastSavedAt);
|
|
14944
15050
|
const prevLoading = useRef28(loading);
|
|
14945
|
-
|
|
15051
|
+
useEffect24(() => {
|
|
14946
15052
|
if (state !== void 0) return;
|
|
14947
15053
|
if (error) {
|
|
14948
15054
|
setInferred("error");
|
|
@@ -15581,10 +15687,10 @@ var Grid2 = Object.assign(GridBase, { Item: GridItem });
|
|
|
15581
15687
|
import { AnimatePresence as AnimatePresence15, motion as motion23 } from "framer-motion";
|
|
15582
15688
|
import {
|
|
15583
15689
|
forwardRef as forwardRef48,
|
|
15584
|
-
useCallback as
|
|
15690
|
+
useCallback as useCallback24,
|
|
15585
15691
|
useId as useId27,
|
|
15586
15692
|
useMemo as useMemo18,
|
|
15587
|
-
useState as
|
|
15693
|
+
useState as useState29
|
|
15588
15694
|
} from "react";
|
|
15589
15695
|
import { jsx as jsx58, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
15590
15696
|
var DEFAULT_SCALE2 = [
|
|
@@ -15657,15 +15763,15 @@ var Heatmap = forwardRef48(
|
|
|
15657
15763
|
() => domainMax ?? (data.length ? Math.max(...data.map((d) => d.value)) : 1),
|
|
15658
15764
|
[domainMax, data]
|
|
15659
15765
|
);
|
|
15660
|
-
const [hovered, setHovered] =
|
|
15661
|
-
const fire =
|
|
15766
|
+
const [hovered, setHovered] = useState29(null);
|
|
15767
|
+
const fire = useCallback24(
|
|
15662
15768
|
(cell) => {
|
|
15663
15769
|
setHovered(cell);
|
|
15664
15770
|
onCellHover?.(cell);
|
|
15665
15771
|
},
|
|
15666
15772
|
[onCellHover]
|
|
15667
15773
|
);
|
|
15668
|
-
const handleKey =
|
|
15774
|
+
const handleKey = useCallback24(
|
|
15669
15775
|
(e, cell) => {
|
|
15670
15776
|
if (!onCellClick) return;
|
|
15671
15777
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -15838,8 +15944,8 @@ var Heatmap = forwardRef48(
|
|
|
15838
15944
|
Heatmap.displayName = "Heatmap";
|
|
15839
15945
|
|
|
15840
15946
|
// src/components/HoverCard/HoverCard.tsx
|
|
15841
|
-
import { useCallback as
|
|
15842
|
-
import { createPortal as
|
|
15947
|
+
import { useCallback as useCallback25, useEffect as useEffect25, useLayoutEffect as useLayoutEffect6, useRef as useRef29, useState as useState30 } from "react";
|
|
15948
|
+
import { createPortal as createPortal11 } from "react-dom";
|
|
15843
15949
|
import { Fragment as Fragment25, jsx as jsx59, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
15844
15950
|
function computePosition3(rect, panelRect, placement, offset) {
|
|
15845
15951
|
const cx = rect.left + rect.width / 2;
|
|
@@ -15864,12 +15970,12 @@ function HoverCard({
|
|
|
15864
15970
|
children,
|
|
15865
15971
|
className
|
|
15866
15972
|
}) {
|
|
15867
|
-
const [open, setOpen] =
|
|
15973
|
+
const [open, setOpen] = useState30(false);
|
|
15868
15974
|
const triggerRef = useRef29(null);
|
|
15869
15975
|
const panelRef = useRef29(null);
|
|
15870
15976
|
const openTimer = useRef29(null);
|
|
15871
15977
|
const closeTimer = useRef29(null);
|
|
15872
|
-
const [coords, setCoords] =
|
|
15978
|
+
const [coords, setCoords] = useState30(null);
|
|
15873
15979
|
const clearTimers = () => {
|
|
15874
15980
|
if (openTimer.current) {
|
|
15875
15981
|
clearTimeout(openTimer.current);
|
|
@@ -15880,7 +15986,7 @@ function HoverCard({
|
|
|
15880
15986
|
closeTimer.current = null;
|
|
15881
15987
|
}
|
|
15882
15988
|
};
|
|
15883
|
-
|
|
15989
|
+
useEffect25(() => () => clearTimers(), []);
|
|
15884
15990
|
const show = () => {
|
|
15885
15991
|
clearTimers();
|
|
15886
15992
|
openTimer.current = setTimeout(() => setOpen(true), openDelay);
|
|
@@ -15889,7 +15995,7 @@ function HoverCard({
|
|
|
15889
15995
|
clearTimers();
|
|
15890
15996
|
closeTimer.current = setTimeout(() => setOpen(false), closeDelay);
|
|
15891
15997
|
};
|
|
15892
|
-
const reposition =
|
|
15998
|
+
const reposition = useCallback25(() => {
|
|
15893
15999
|
if (!triggerRef.current || !panelRef.current) return;
|
|
15894
16000
|
const trigRect = triggerRef.current.getBoundingClientRect();
|
|
15895
16001
|
const panelRect = panelRef.current.getBoundingClientRect();
|
|
@@ -15901,7 +16007,7 @@ function HoverCard({
|
|
|
15901
16007
|
const id = requestAnimationFrame(reposition);
|
|
15902
16008
|
return () => cancelAnimationFrame(id);
|
|
15903
16009
|
}, [open, reposition]);
|
|
15904
|
-
|
|
16010
|
+
useEffect25(() => {
|
|
15905
16011
|
if (!open) return;
|
|
15906
16012
|
const h = () => reposition();
|
|
15907
16013
|
window.addEventListener("scroll", h, true);
|
|
@@ -15923,7 +16029,7 @@ function HoverCard({
|
|
|
15923
16029
|
children
|
|
15924
16030
|
}
|
|
15925
16031
|
);
|
|
15926
|
-
const portal = typeof document !== "undefined" && open ?
|
|
16032
|
+
const portal = typeof document !== "undefined" && open ? createPortal11(
|
|
15927
16033
|
/* @__PURE__ */ jsx59(
|
|
15928
16034
|
"div",
|
|
15929
16035
|
{
|
|
@@ -16413,9 +16519,9 @@ IntegrationCard.displayName = "IntegrationCard";
|
|
|
16413
16519
|
import { CheckmarkIcon as CheckmarkIcon8, ChevronRightIcon as ChevronRightIcon3, CopyIcon as CopyIcon4 } from "@octaviaflow/icons";
|
|
16414
16520
|
import {
|
|
16415
16521
|
forwardRef as forwardRef52,
|
|
16416
|
-
useEffect as
|
|
16522
|
+
useEffect as useEffect26,
|
|
16417
16523
|
useMemo as useMemo19,
|
|
16418
|
-
useState as
|
|
16524
|
+
useState as useState31
|
|
16419
16525
|
} from "react";
|
|
16420
16526
|
import { Fragment as Fragment28, jsx as jsx63, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
16421
16527
|
var JsonViewer = forwardRef52(
|
|
@@ -16466,7 +16572,7 @@ function JsonNode({
|
|
|
16466
16572
|
truncateAt,
|
|
16467
16573
|
isLast = true
|
|
16468
16574
|
}) {
|
|
16469
|
-
const [open, setOpen] =
|
|
16575
|
+
const [open, setOpen] = useState31(depth < defaultExpandDepth);
|
|
16470
16576
|
const isObject = value !== null && typeof value === "object" && !Array.isArray(value);
|
|
16471
16577
|
const isArray = Array.isArray(value);
|
|
16472
16578
|
const isContainer = isObject || isArray;
|
|
@@ -16557,7 +16663,7 @@ function Leaf({
|
|
|
16557
16663
|
truncateAt,
|
|
16558
16664
|
copyable
|
|
16559
16665
|
}) {
|
|
16560
|
-
const [copied, setCopied] =
|
|
16666
|
+
const [copied, setCopied] = useState31(false);
|
|
16561
16667
|
let display;
|
|
16562
16668
|
let variant;
|
|
16563
16669
|
if (value === null) {
|
|
@@ -16643,8 +16749,8 @@ function JsonEditBody({ data, onChange, onValidate }) {
|
|
|
16643
16749
|
return "{}";
|
|
16644
16750
|
}
|
|
16645
16751
|
}, []);
|
|
16646
|
-
const [text, setText] =
|
|
16647
|
-
const [parseError, setParseError] =
|
|
16752
|
+
const [text, setText] = useState31(initial);
|
|
16753
|
+
const [parseError, setParseError] = useState31(null);
|
|
16648
16754
|
const validate = (next) => {
|
|
16649
16755
|
try {
|
|
16650
16756
|
JSON.parse(next);
|
|
@@ -16661,7 +16767,7 @@ function JsonEditBody({ data, onChange, onValidate }) {
|
|
|
16661
16767
|
onChange?.(next);
|
|
16662
16768
|
validate(next);
|
|
16663
16769
|
};
|
|
16664
|
-
|
|
16770
|
+
useEffect26(() => {
|
|
16665
16771
|
validate(initial);
|
|
16666
16772
|
}, []);
|
|
16667
16773
|
return /* @__PURE__ */ jsxs60("div", { className: "ods-json-viewer__edit", children: [
|
|
@@ -16893,12 +16999,12 @@ KbdGroup.displayName = "KbdGroup";
|
|
|
16893
16999
|
import { AnimatePresence as AnimatePresence16, motion as motion24 } from "framer-motion";
|
|
16894
17000
|
import {
|
|
16895
17001
|
forwardRef as forwardRef55,
|
|
16896
|
-
useCallback as
|
|
16897
|
-
useEffect as
|
|
17002
|
+
useCallback as useCallback26,
|
|
17003
|
+
useEffect as useEffect27,
|
|
16898
17004
|
useId as useId32,
|
|
16899
17005
|
useMemo as useMemo20,
|
|
16900
17006
|
useRef as useRef31,
|
|
16901
|
-
useState as
|
|
17007
|
+
useState as useState32
|
|
16902
17008
|
} from "react";
|
|
16903
17009
|
import { jsx as jsx66, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
16904
17010
|
var defaultFormat5 = (n) => {
|
|
@@ -16976,7 +17082,7 @@ var LineChart = forwardRef55(
|
|
|
16976
17082
|
}
|
|
16977
17083
|
];
|
|
16978
17084
|
}, [series, data, stroke, fill]);
|
|
16979
|
-
const [zoom, setZoom] =
|
|
17085
|
+
const [zoom, setZoom] = useState32(
|
|
16980
17086
|
null
|
|
16981
17087
|
);
|
|
16982
17088
|
const totalX = allLines[0]?.data.length ?? 0;
|
|
@@ -17017,11 +17123,11 @@ var LineChart = forwardRef55(
|
|
|
17017
17123
|
() => buildTicks2(lo, hi, Math.max(2, yTicks)),
|
|
17018
17124
|
[lo, hi, yTicks]
|
|
17019
17125
|
);
|
|
17020
|
-
const [hoveredIdx, setHoveredIdx] =
|
|
17021
|
-
const [pointerPct, setPointerPct] =
|
|
17126
|
+
const [hoveredIdx, setHoveredIdx] = useState32(null);
|
|
17127
|
+
const [pointerPct, setPointerPct] = useState32(null);
|
|
17022
17128
|
const plotRef = useRef31(null);
|
|
17023
|
-
const [brush, setBrush] =
|
|
17024
|
-
const indexFromPct =
|
|
17129
|
+
const [brush, setBrush] = useState32(null);
|
|
17130
|
+
const indexFromPct = useCallback26(
|
|
17025
17131
|
(pct) => {
|
|
17026
17132
|
if (xCount === 0) return 0;
|
|
17027
17133
|
return Math.max(
|
|
@@ -17031,7 +17137,7 @@ var LineChart = forwardRef55(
|
|
|
17031
17137
|
},
|
|
17032
17138
|
[xCount]
|
|
17033
17139
|
);
|
|
17034
|
-
const handlePlotMove =
|
|
17140
|
+
const handlePlotMove = useCallback26(
|
|
17035
17141
|
(e) => {
|
|
17036
17142
|
if (xCount === 0) return;
|
|
17037
17143
|
const rect = plotRef.current?.getBoundingClientRect();
|
|
@@ -17060,12 +17166,12 @@ var LineChart = forwardRef55(
|
|
|
17060
17166
|
visibleRange.start
|
|
17061
17167
|
]
|
|
17062
17168
|
);
|
|
17063
|
-
const handlePlotLeave =
|
|
17169
|
+
const handlePlotLeave = useCallback26(() => {
|
|
17064
17170
|
setHoveredIdx(null);
|
|
17065
17171
|
setPointerPct(null);
|
|
17066
17172
|
onPointHover?.(null, null, null);
|
|
17067
17173
|
}, [onPointHover]);
|
|
17068
|
-
const handlePlotDown =
|
|
17174
|
+
const handlePlotDown = useCallback26(
|
|
17069
17175
|
(e) => {
|
|
17070
17176
|
if (!zoomable) return;
|
|
17071
17177
|
const rect = plotRef.current?.getBoundingClientRect();
|
|
@@ -17078,7 +17184,7 @@ var LineChart = forwardRef55(
|
|
|
17078
17184
|
},
|
|
17079
17185
|
[zoomable]
|
|
17080
17186
|
);
|
|
17081
|
-
|
|
17187
|
+
useEffect27(() => {
|
|
17082
17188
|
if (!brush) return;
|
|
17083
17189
|
const onUp = () => {
|
|
17084
17190
|
const a = Math.min(brush.startPct, brush.currentPct);
|
|
@@ -17099,12 +17205,12 @@ var LineChart = forwardRef55(
|
|
|
17099
17205
|
window.addEventListener("mouseup", onUp);
|
|
17100
17206
|
return () => window.removeEventListener("mouseup", onUp);
|
|
17101
17207
|
}, [brush, indexFromPct, visibleRange.start, onZoomChange]);
|
|
17102
|
-
const handleDoubleClick =
|
|
17208
|
+
const handleDoubleClick = useCallback26(() => {
|
|
17103
17209
|
if (!zoomable || !zoom) return;
|
|
17104
17210
|
setZoom(null);
|
|
17105
17211
|
onZoomChange?.(null);
|
|
17106
17212
|
}, [zoomable, zoom, onZoomChange]);
|
|
17107
|
-
const handlePlotClick =
|
|
17213
|
+
const handlePlotClick = useCallback26(() => {
|
|
17108
17214
|
if (hoveredIdx === null || !onPointClick) return;
|
|
17109
17215
|
const s = lines[0];
|
|
17110
17216
|
const p = s?.data[hoveredIdx];
|
|
@@ -17124,11 +17230,11 @@ var LineChart = forwardRef55(
|
|
|
17124
17230
|
const showX = showAxis === "x" || showAxis === "both";
|
|
17125
17231
|
const isMulti = (series?.length ?? 0) > 0;
|
|
17126
17232
|
const tooltipPoint = hoveredIdx !== null ? lines[0]?.data[hoveredIdx] : void 0;
|
|
17127
|
-
const dataXPct =
|
|
17233
|
+
const dataXPct = useCallback26(
|
|
17128
17234
|
(i) => (PAD + i * stepX) / W * 100,
|
|
17129
17235
|
[stepX]
|
|
17130
17236
|
);
|
|
17131
|
-
const dataYPct =
|
|
17237
|
+
const dataYPct = useCallback26(
|
|
17132
17238
|
(v) => (PAD + (1 - (v - lo) / (hi - lo)) * (H - PAD * 2)) / H * 100,
|
|
17133
17239
|
[lo, hi]
|
|
17134
17240
|
);
|
|
@@ -17520,9 +17626,9 @@ import {
|
|
|
17520
17626
|
// src/components/CountUp/CountUp.tsx
|
|
17521
17627
|
import {
|
|
17522
17628
|
forwardRef as forwardRef57,
|
|
17523
|
-
useEffect as
|
|
17629
|
+
useEffect as useEffect28,
|
|
17524
17630
|
useRef as useRef32,
|
|
17525
|
-
useState as
|
|
17631
|
+
useState as useState33
|
|
17526
17632
|
} from "react";
|
|
17527
17633
|
import { jsxs as jsxs65 } from "react/jsx-runtime";
|
|
17528
17634
|
var easeLinear = (t) => t;
|
|
@@ -17545,9 +17651,9 @@ var CountUp = forwardRef57(
|
|
|
17545
17651
|
className,
|
|
17546
17652
|
...rest
|
|
17547
17653
|
}, ref) {
|
|
17548
|
-
const [n, setN] =
|
|
17654
|
+
const [n, setN] = useState33(disableAnimation ? value : from);
|
|
17549
17655
|
const lastRendered = useRef32(disableAnimation ? value : from);
|
|
17550
|
-
|
|
17656
|
+
useEffect28(() => {
|
|
17551
17657
|
const reduced = typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
17552
17658
|
if (disableAnimation || reduced) {
|
|
17553
17659
|
setN(value);
|
|
@@ -18153,15 +18259,15 @@ MetricCard.displayName = "MetricCard";
|
|
|
18153
18259
|
import { AnimatePresence as AnimatePresence17, motion as motion26 } from "framer-motion";
|
|
18154
18260
|
import {
|
|
18155
18261
|
forwardRef as forwardRef60,
|
|
18156
|
-
useCallback as
|
|
18157
|
-
useEffect as
|
|
18262
|
+
useCallback as useCallback27,
|
|
18263
|
+
useEffect as useEffect29,
|
|
18158
18264
|
useId as useId35,
|
|
18159
18265
|
useLayoutEffect as useLayoutEffect7,
|
|
18160
18266
|
useMemo as useMemo22,
|
|
18161
18267
|
useRef as useRef33,
|
|
18162
|
-
useState as
|
|
18268
|
+
useState as useState34
|
|
18163
18269
|
} from "react";
|
|
18164
|
-
import { createPortal as
|
|
18270
|
+
import { createPortal as createPortal12 } from "react-dom";
|
|
18165
18271
|
import {
|
|
18166
18272
|
ChevronDownIcon as ChevronDownIcon6,
|
|
18167
18273
|
CloseIcon as CloseIcon11,
|
|
@@ -18205,14 +18311,14 @@ var MultiSelect = forwardRef60(
|
|
|
18205
18311
|
}, ref) {
|
|
18206
18312
|
const reactId = useId35();
|
|
18207
18313
|
const baseId = providedId ?? `ods-multiselect-${reactId}`;
|
|
18208
|
-
const [internalValue, setInternalValue] =
|
|
18314
|
+
const [internalValue, setInternalValue] = useState34(
|
|
18209
18315
|
defaultValue ?? []
|
|
18210
18316
|
);
|
|
18211
18317
|
const selectedValues = controlledValue ?? internalValue;
|
|
18212
|
-
const [open, setOpen] =
|
|
18213
|
-
const [query, setQuery] =
|
|
18214
|
-
const [activeIdx, setActiveIdx] =
|
|
18215
|
-
const [dropdownPos, setDropdownPos] =
|
|
18318
|
+
const [open, setOpen] = useState34(false);
|
|
18319
|
+
const [query, setQuery] = useState34("");
|
|
18320
|
+
const [activeIdx, setActiveIdx] = useState34(0);
|
|
18321
|
+
const [dropdownPos, setDropdownPos] = useState34({
|
|
18216
18322
|
top: 0,
|
|
18217
18323
|
left: 0,
|
|
18218
18324
|
width: 0
|
|
@@ -18222,7 +18328,7 @@ var MultiSelect = forwardRef60(
|
|
|
18222
18328
|
const searchRef = useRef33(null);
|
|
18223
18329
|
const dropdownRef = useRef33(null);
|
|
18224
18330
|
const chipRefs = useRef33([]);
|
|
18225
|
-
const commit =
|
|
18331
|
+
const commit = useCallback27(
|
|
18226
18332
|
(next) => {
|
|
18227
18333
|
if (controlledValue === void 0) setInternalValue(next);
|
|
18228
18334
|
onChange?.(next);
|
|
@@ -18244,7 +18350,7 @@ var MultiSelect = forwardRef60(
|
|
|
18244
18350
|
const showSearch = searchable ?? options.length > 6;
|
|
18245
18351
|
const getLabel = (v) => options.find((o) => o.value === v)?.label ?? v;
|
|
18246
18352
|
const getIcon = (v) => options.find((o) => o.value === v)?.icon;
|
|
18247
|
-
const updatePosition =
|
|
18353
|
+
const updatePosition = useCallback27(() => {
|
|
18248
18354
|
if (!wrapRef.current) return;
|
|
18249
18355
|
const rect = wrapRef.current.getBoundingClientRect();
|
|
18250
18356
|
setDropdownPos({
|
|
@@ -18253,7 +18359,7 @@ var MultiSelect = forwardRef60(
|
|
|
18253
18359
|
width: rect.width
|
|
18254
18360
|
});
|
|
18255
18361
|
}, []);
|
|
18256
|
-
|
|
18362
|
+
useEffect29(() => {
|
|
18257
18363
|
if (!open) return;
|
|
18258
18364
|
updatePosition();
|
|
18259
18365
|
window.addEventListener("scroll", updatePosition, true);
|
|
@@ -18263,7 +18369,7 @@ var MultiSelect = forwardRef60(
|
|
|
18263
18369
|
window.removeEventListener("resize", updatePosition);
|
|
18264
18370
|
};
|
|
18265
18371
|
}, [open, updatePosition]);
|
|
18266
|
-
|
|
18372
|
+
useEffect29(() => {
|
|
18267
18373
|
if (!open) return;
|
|
18268
18374
|
const onDoc = (e) => {
|
|
18269
18375
|
const t = e.target;
|
|
@@ -18275,14 +18381,14 @@ var MultiSelect = forwardRef60(
|
|
|
18275
18381
|
document.addEventListener("mousedown", onDoc);
|
|
18276
18382
|
return () => document.removeEventListener("mousedown", onDoc);
|
|
18277
18383
|
}, [open]);
|
|
18278
|
-
|
|
18384
|
+
useEffect29(() => {
|
|
18279
18385
|
if (open && showSearch) {
|
|
18280
18386
|
requestAnimationFrame(() => searchRef.current?.focus());
|
|
18281
18387
|
}
|
|
18282
18388
|
}, [open, showSearch]);
|
|
18283
|
-
|
|
18284
|
-
const [fitCount, setFitCount] =
|
|
18285
|
-
const [tick, setTick] =
|
|
18389
|
+
useEffect29(() => setActiveIdx(0), [query, open]);
|
|
18390
|
+
const [fitCount, setFitCount] = useState34(selectedValues.length);
|
|
18391
|
+
const [tick, setTick] = useState34(0);
|
|
18286
18392
|
useLayoutEffect7(() => {
|
|
18287
18393
|
if (maxVisibleTags !== void 0) {
|
|
18288
18394
|
setFitCount(Math.min(selectedValues.length, maxVisibleTags));
|
|
@@ -18310,7 +18416,7 @@ var MultiSelect = forwardRef60(
|
|
|
18310
18416
|
count = Math.max(1, count - 1);
|
|
18311
18417
|
setFitCount(count);
|
|
18312
18418
|
}, [tick, selectedValues, maxVisibleTags]);
|
|
18313
|
-
|
|
18419
|
+
useEffect29(() => {
|
|
18314
18420
|
if (typeof ResizeObserver === "undefined") return;
|
|
18315
18421
|
const row = tagsRowRef.current;
|
|
18316
18422
|
if (!row) return;
|
|
@@ -18318,7 +18424,7 @@ var MultiSelect = forwardRef60(
|
|
|
18318
18424
|
ro.observe(row);
|
|
18319
18425
|
return () => ro.disconnect();
|
|
18320
18426
|
}, []);
|
|
18321
|
-
const addValue =
|
|
18427
|
+
const addValue = useCallback27(
|
|
18322
18428
|
(val) => {
|
|
18323
18429
|
if (maxTags && selectedValues.length >= maxTags) return;
|
|
18324
18430
|
commit([...selectedValues, val]);
|
|
@@ -18328,13 +18434,13 @@ var MultiSelect = forwardRef60(
|
|
|
18328
18434
|
},
|
|
18329
18435
|
[selectedValues, maxTags, commit]
|
|
18330
18436
|
);
|
|
18331
|
-
const removeValue =
|
|
18437
|
+
const removeValue = useCallback27(
|
|
18332
18438
|
(val) => {
|
|
18333
18439
|
commit(selectedValues.filter((v) => v !== val));
|
|
18334
18440
|
},
|
|
18335
18441
|
[selectedValues, commit]
|
|
18336
18442
|
);
|
|
18337
|
-
const toggleValue =
|
|
18443
|
+
const toggleValue = useCallback27(
|
|
18338
18444
|
(val) => {
|
|
18339
18445
|
if (selectedSet.has(val)) {
|
|
18340
18446
|
removeValue(val);
|
|
@@ -18344,11 +18450,11 @@ var MultiSelect = forwardRef60(
|
|
|
18344
18450
|
},
|
|
18345
18451
|
[selectedSet, addValue, removeValue]
|
|
18346
18452
|
);
|
|
18347
|
-
const clearAll =
|
|
18453
|
+
const clearAll = useCallback27(() => {
|
|
18348
18454
|
commit([]);
|
|
18349
18455
|
setQuery("");
|
|
18350
18456
|
}, [commit]);
|
|
18351
|
-
const handleSearchKey =
|
|
18457
|
+
const handleSearchKey = useCallback27(
|
|
18352
18458
|
(e) => {
|
|
18353
18459
|
if (e.key === "Escape") {
|
|
18354
18460
|
setOpen(false);
|
|
@@ -18533,7 +18639,7 @@ var MultiSelect = forwardRef60(
|
|
|
18533
18639
|
]
|
|
18534
18640
|
}
|
|
18535
18641
|
),
|
|
18536
|
-
typeof document !== "undefined" &&
|
|
18642
|
+
typeof document !== "undefined" && createPortal12(
|
|
18537
18643
|
/* @__PURE__ */ jsx70(AnimatePresence17, { children: open && /* @__PURE__ */ jsxs68(
|
|
18538
18644
|
motion26.div,
|
|
18539
18645
|
{
|
|
@@ -18713,7 +18819,7 @@ MultiSelect.displayName = "MultiSelect";
|
|
|
18713
18819
|
// src/components/NumberInput/NumberInput.tsx
|
|
18714
18820
|
import {
|
|
18715
18821
|
forwardRef as forwardRef61,
|
|
18716
|
-
useCallback as
|
|
18822
|
+
useCallback as useCallback28,
|
|
18717
18823
|
useId as useId36
|
|
18718
18824
|
} from "react";
|
|
18719
18825
|
import { AddIcon as AddIcon2, SubtractIcon as SubtractIcon2 } from "@octaviaflow/icons";
|
|
@@ -18735,16 +18841,19 @@ var NumberInput = forwardRef61(
|
|
|
18735
18841
|
id: providedId,
|
|
18736
18842
|
className,
|
|
18737
18843
|
wrapperClassName,
|
|
18844
|
+
hideControls = false,
|
|
18845
|
+
align,
|
|
18738
18846
|
"aria-label": ariaLabel,
|
|
18739
18847
|
"aria-labelledby": ariaLabelledBy,
|
|
18740
18848
|
"aria-describedby": consumerDescribedBy,
|
|
18741
18849
|
...rest
|
|
18742
18850
|
}, ref) {
|
|
18851
|
+
const resolvedAlign = align ?? (hideControls ? "left" : "center");
|
|
18743
18852
|
const reactId = useId36();
|
|
18744
18853
|
const inputId = providedId ?? `ods-num-${reactId}`;
|
|
18745
18854
|
const labelId = label ? `${inputId}-label` : void 0;
|
|
18746
18855
|
const hintId = error || helperText ? `${inputId}-hint` : void 0;
|
|
18747
|
-
const clamp =
|
|
18856
|
+
const clamp = useCallback28(
|
|
18748
18857
|
(v) => {
|
|
18749
18858
|
if (typeof min === "number") v = Math.max(min, v);
|
|
18750
18859
|
if (typeof max === "number") v = Math.min(max, v);
|
|
@@ -18769,6 +18878,8 @@ var NumberInput = forwardRef61(
|
|
|
18769
18878
|
`ods-num--${size}`,
|
|
18770
18879
|
disabled && "ods-num--disabled",
|
|
18771
18880
|
error && "ods-num--error",
|
|
18881
|
+
hideControls && "ods-num--no-controls",
|
|
18882
|
+
resolvedAlign === "left" && "ods-num--align-left",
|
|
18772
18883
|
wrapperClassName
|
|
18773
18884
|
),
|
|
18774
18885
|
children: [
|
|
@@ -18782,7 +18893,7 @@ var NumberInput = forwardRef61(
|
|
|
18782
18893
|
}
|
|
18783
18894
|
),
|
|
18784
18895
|
/* @__PURE__ */ jsxs69("div", { className: "ods-num__field", children: [
|
|
18785
|
-
/* @__PURE__ */ jsx71(
|
|
18896
|
+
!hideControls && /* @__PURE__ */ jsx71(
|
|
18786
18897
|
"button",
|
|
18787
18898
|
{
|
|
18788
18899
|
type: "button",
|
|
@@ -18816,7 +18927,7 @@ var NumberInput = forwardRef61(
|
|
|
18816
18927
|
}
|
|
18817
18928
|
),
|
|
18818
18929
|
suffix && /* @__PURE__ */ jsx71("span", { className: "ods-num__suffix", "aria-hidden": "true", children: suffix }),
|
|
18819
|
-
/* @__PURE__ */ jsx71(
|
|
18930
|
+
!hideControls && /* @__PURE__ */ jsx71(
|
|
18820
18931
|
"button",
|
|
18821
18932
|
{
|
|
18822
18933
|
type: "button",
|
|
@@ -18848,7 +18959,7 @@ NumberInput.displayName = "NumberInput";
|
|
|
18848
18959
|
// src/components/OTPInput/OTPInput.tsx
|
|
18849
18960
|
import {
|
|
18850
18961
|
forwardRef as forwardRef62,
|
|
18851
|
-
useCallback as
|
|
18962
|
+
useCallback as useCallback29,
|
|
18852
18963
|
useId as useId37,
|
|
18853
18964
|
useImperativeHandle as useImperativeHandle10,
|
|
18854
18965
|
useRef as useRef34
|
|
@@ -18895,7 +19006,7 @@ var OTPInput = forwardRef62(
|
|
|
18895
19006
|
}),
|
|
18896
19007
|
[value, length, onChange]
|
|
18897
19008
|
);
|
|
18898
|
-
const setCharAt =
|
|
19009
|
+
const setCharAt = useCallback29(
|
|
18899
19010
|
(idx, ch) => {
|
|
18900
19011
|
const cleaned = ch.replace(pattern, "").slice(0, 1);
|
|
18901
19012
|
const chars = value.split("");
|
|
@@ -19036,10 +19147,10 @@ import {
|
|
|
19036
19147
|
} from "@octaviaflow/icons";
|
|
19037
19148
|
import {
|
|
19038
19149
|
forwardRef as forwardRef63,
|
|
19039
|
-
useCallback as
|
|
19150
|
+
useCallback as useCallback30,
|
|
19040
19151
|
useId as useId38,
|
|
19041
19152
|
useMemo as useMemo23,
|
|
19042
|
-
useState as
|
|
19153
|
+
useState as useState35
|
|
19043
19154
|
} from "react";
|
|
19044
19155
|
import { jsx as jsx74, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
19045
19156
|
function buildPageRange(totalPages, current, siblingCount, boundaryCount) {
|
|
@@ -19115,7 +19226,7 @@ var Pagination = forwardRef63(
|
|
|
19115
19226
|
1,
|
|
19116
19227
|
Math.ceil(Math.max(0, totalItems) / Math.max(1, pageSize))
|
|
19117
19228
|
);
|
|
19118
|
-
const [internalPage, setInternalPage] =
|
|
19229
|
+
const [internalPage, setInternalPage] = useState35(
|
|
19119
19230
|
Math.min(Math.max(1, defaultPage), totalPages)
|
|
19120
19231
|
);
|
|
19121
19232
|
const isControlled = controlledPage !== void 0;
|
|
@@ -19123,7 +19234,7 @@ var Pagination = forwardRef63(
|
|
|
19123
19234
|
totalPages,
|
|
19124
19235
|
Math.max(1, isControlled ? controlledPage : internalPage)
|
|
19125
19236
|
);
|
|
19126
|
-
const goTo =
|
|
19237
|
+
const goTo = useCallback30(
|
|
19127
19238
|
(next) => {
|
|
19128
19239
|
const clamped = Math.min(totalPages, Math.max(1, next));
|
|
19129
19240
|
if (clamped === currentPage) return;
|
|
@@ -19139,7 +19250,7 @@ var Pagination = forwardRef63(
|
|
|
19139
19250
|
const from = totalItems === 0 ? 0 : (currentPage - 1) * pageSize + 1;
|
|
19140
19251
|
const to = Math.min(totalItems, currentPage * pageSize);
|
|
19141
19252
|
const totalContent = formatTotal ? formatTotal({ from, to, total: totalItems }) : `Showing ${from.toLocaleString()}\u2013${to.toLocaleString()} of ${totalItems.toLocaleString()}`;
|
|
19142
|
-
const [jumpValue, setJumpValue] =
|
|
19253
|
+
const [jumpValue, setJumpValue] = useState35("");
|
|
19143
19254
|
const commitJump = (raw) => {
|
|
19144
19255
|
const parsed = Number.parseInt(raw, 10);
|
|
19145
19256
|
if (Number.isFinite(parsed)) goTo(parsed);
|
|
@@ -19323,7 +19434,7 @@ Pagination.displayName = "Pagination";
|
|
|
19323
19434
|
import {
|
|
19324
19435
|
forwardRef as forwardRef64,
|
|
19325
19436
|
useId as useId39,
|
|
19326
|
-
useState as
|
|
19437
|
+
useState as useState36
|
|
19327
19438
|
} from "react";
|
|
19328
19439
|
import { CheckmarkIcon as CheckmarkIcon9, ViewIcon, ViewOffIcon } from "@octaviaflow/icons";
|
|
19329
19440
|
|
|
@@ -19400,7 +19511,7 @@ var PasswordInput = forwardRef64(
|
|
|
19400
19511
|
const inputId = providedId ?? `ods-pwd-${reactId}`;
|
|
19401
19512
|
const labelId = label ? `${inputId}-label` : void 0;
|
|
19402
19513
|
const hintId = error || helperText ? `${inputId}-hint` : void 0;
|
|
19403
|
-
const [shown, setShown] =
|
|
19514
|
+
const [shown, setShown] = useState36(false);
|
|
19404
19515
|
const handle = (e) => onChange?.(e.target.value);
|
|
19405
19516
|
const derived = usePasswordStrength(value, strengthRules ?? []);
|
|
19406
19517
|
const ruleDriven = (strengthRules?.length ?? 0) > 0;
|
|
@@ -19542,11 +19653,11 @@ PasswordInput.displayName = "PasswordInput";
|
|
|
19542
19653
|
// src/components/PhoneInput/PhoneInput.tsx
|
|
19543
19654
|
import {
|
|
19544
19655
|
forwardRef as forwardRef65,
|
|
19545
|
-
useCallback as
|
|
19546
|
-
useEffect as
|
|
19656
|
+
useCallback as useCallback31,
|
|
19657
|
+
useEffect as useEffect30,
|
|
19547
19658
|
useId as useId40,
|
|
19548
19659
|
useRef as useRef35,
|
|
19549
|
-
useState as
|
|
19660
|
+
useState as useState37
|
|
19550
19661
|
} from "react";
|
|
19551
19662
|
import { ChevronDownIcon as ChevronDownIcon7, SearchIcon as SearchIcon9 } from "@octaviaflow/icons";
|
|
19552
19663
|
import { jsx as jsx76, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
@@ -19590,9 +19701,9 @@ var PhoneInput = forwardRef65(
|
|
|
19590
19701
|
const hintId = error || helperText ? `${baseId}-hint` : void 0;
|
|
19591
19702
|
const listboxId = `${baseId}-listbox`;
|
|
19592
19703
|
const countryBtnId = `${baseId}-country`;
|
|
19593
|
-
const [open, setOpen] =
|
|
19594
|
-
const [activeIdx, setActiveIdx] =
|
|
19595
|
-
const [query, setQuery] =
|
|
19704
|
+
const [open, setOpen] = useState37(false);
|
|
19705
|
+
const [activeIdx, setActiveIdx] = useState37(0);
|
|
19706
|
+
const [query, setQuery] = useState37("");
|
|
19596
19707
|
const fieldRef = useRef35(null);
|
|
19597
19708
|
const menuRef = useRef35(null);
|
|
19598
19709
|
const listRef = useRef35(null);
|
|
@@ -19606,7 +19717,7 @@ var PhoneInput = forwardRef65(
|
|
|
19606
19717
|
(c) => c.name.toLowerCase().includes(q2) || c.dialCode.includes(q2) || c.code.toLowerCase().includes(q2)
|
|
19607
19718
|
);
|
|
19608
19719
|
})();
|
|
19609
|
-
|
|
19720
|
+
useEffect30(() => {
|
|
19610
19721
|
if (!open) return;
|
|
19611
19722
|
const onDocMouseDown = (e) => {
|
|
19612
19723
|
const t = e.target;
|
|
@@ -19624,7 +19735,7 @@ var PhoneInput = forwardRef65(
|
|
|
19624
19735
|
document.removeEventListener("keydown", onDocKey);
|
|
19625
19736
|
};
|
|
19626
19737
|
}, [open]);
|
|
19627
|
-
|
|
19738
|
+
useEffect30(() => {
|
|
19628
19739
|
if (!open) {
|
|
19629
19740
|
setQuery("");
|
|
19630
19741
|
return;
|
|
@@ -19632,10 +19743,10 @@ var PhoneInput = forwardRef65(
|
|
|
19632
19743
|
const idx = countries.findIndex((c) => c.code === country.code);
|
|
19633
19744
|
setActiveIdx(idx === -1 ? 0 : idx);
|
|
19634
19745
|
}, [open, countries, country.code]);
|
|
19635
|
-
|
|
19746
|
+
useEffect30(() => {
|
|
19636
19747
|
setActiveIdx(0);
|
|
19637
19748
|
}, [query]);
|
|
19638
|
-
const handleTriggerKey =
|
|
19749
|
+
const handleTriggerKey = useCallback31(
|
|
19639
19750
|
(e) => {
|
|
19640
19751
|
if (disabled) return;
|
|
19641
19752
|
if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") {
|
|
@@ -19645,7 +19756,7 @@ var PhoneInput = forwardRef65(
|
|
|
19645
19756
|
},
|
|
19646
19757
|
[disabled]
|
|
19647
19758
|
);
|
|
19648
|
-
const handleNavKey =
|
|
19759
|
+
const handleNavKey = useCallback31(
|
|
19649
19760
|
(e) => {
|
|
19650
19761
|
if (e.key === "ArrowDown") {
|
|
19651
19762
|
e.preventDefault();
|
|
@@ -19672,7 +19783,7 @@ var PhoneInput = forwardRef65(
|
|
|
19672
19783
|
},
|
|
19673
19784
|
[filteredCountries, activeIdx, onCountryChange]
|
|
19674
19785
|
);
|
|
19675
|
-
|
|
19786
|
+
useEffect30(() => {
|
|
19676
19787
|
if (!open) return;
|
|
19677
19788
|
if (showSearch) searchRef.current?.focus();
|
|
19678
19789
|
else listRef.current?.focus();
|
|
@@ -20536,8 +20647,8 @@ var PipelineCard = forwardRef66(
|
|
|
20536
20647
|
PipelineCard.displayName = "PipelineCard";
|
|
20537
20648
|
|
|
20538
20649
|
// src/components/Popover/Popover.tsx
|
|
20539
|
-
import { useCallback as
|
|
20540
|
-
import { createPortal as
|
|
20650
|
+
import { useCallback as useCallback32, useEffect as useEffect31, useLayoutEffect as useLayoutEffect8, useRef as useRef36, useState as useState38 } from "react";
|
|
20651
|
+
import { createPortal as createPortal13 } from "react-dom";
|
|
20541
20652
|
import { Fragment as Fragment34, jsx as jsx78, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
20542
20653
|
function computePosition4(rect, popRect, placement, offset) {
|
|
20543
20654
|
const cx = rect.left + rect.width / 2;
|
|
@@ -20568,9 +20679,9 @@ function Popover({
|
|
|
20568
20679
|
children,
|
|
20569
20680
|
className
|
|
20570
20681
|
}) {
|
|
20571
|
-
const [openState, setOpenState] =
|
|
20682
|
+
const [openState, setOpenState] = useState38(defaultOpen);
|
|
20572
20683
|
const open = openProp ?? openState;
|
|
20573
|
-
const setOpen =
|
|
20684
|
+
const setOpen = useCallback32(
|
|
20574
20685
|
(v) => {
|
|
20575
20686
|
if (openProp === void 0) setOpenState(v);
|
|
20576
20687
|
onOpenChange?.(v);
|
|
@@ -20579,8 +20690,8 @@ function Popover({
|
|
|
20579
20690
|
);
|
|
20580
20691
|
const triggerRef = useRef36(null);
|
|
20581
20692
|
const popRef = useRef36(null);
|
|
20582
|
-
const [coords, setCoords] =
|
|
20583
|
-
const reposition =
|
|
20693
|
+
const [coords, setCoords] = useState38(null);
|
|
20694
|
+
const reposition = useCallback32(() => {
|
|
20584
20695
|
if (!triggerRef.current || !popRef.current) return;
|
|
20585
20696
|
const trigRect = triggerRef.current.getBoundingClientRect();
|
|
20586
20697
|
const popRect = popRef.current.getBoundingClientRect();
|
|
@@ -20592,7 +20703,7 @@ function Popover({
|
|
|
20592
20703
|
const id = requestAnimationFrame(reposition);
|
|
20593
20704
|
return () => cancelAnimationFrame(id);
|
|
20594
20705
|
}, [open, reposition, content]);
|
|
20595
|
-
|
|
20706
|
+
useEffect31(() => {
|
|
20596
20707
|
if (!open) return;
|
|
20597
20708
|
const onScroll = () => reposition();
|
|
20598
20709
|
window.addEventListener("scroll", onScroll, true);
|
|
@@ -20602,7 +20713,7 @@ function Popover({
|
|
|
20602
20713
|
window.removeEventListener("resize", onScroll);
|
|
20603
20714
|
};
|
|
20604
20715
|
}, [open, reposition]);
|
|
20605
|
-
|
|
20716
|
+
useEffect31(() => {
|
|
20606
20717
|
if (!open || !closeOnClickOutside) return;
|
|
20607
20718
|
const onDoc = (e) => {
|
|
20608
20719
|
const t = e.target;
|
|
@@ -20613,7 +20724,7 @@ function Popover({
|
|
|
20613
20724
|
document.addEventListener("mousedown", onDoc);
|
|
20614
20725
|
return () => document.removeEventListener("mousedown", onDoc);
|
|
20615
20726
|
}, [open, closeOnClickOutside, setOpen]);
|
|
20616
|
-
|
|
20727
|
+
useEffect31(() => {
|
|
20617
20728
|
if (!open || !closeOnEsc) return;
|
|
20618
20729
|
const onKey = (e) => {
|
|
20619
20730
|
if (e.key === "Escape") setOpen(false);
|
|
@@ -20634,7 +20745,7 @@ function Popover({
|
|
|
20634
20745
|
children
|
|
20635
20746
|
}
|
|
20636
20747
|
);
|
|
20637
|
-
const portal = typeof document !== "undefined" && open ?
|
|
20748
|
+
const portal = typeof document !== "undefined" && open ? createPortal13(
|
|
20638
20749
|
/* @__PURE__ */ jsxs76(
|
|
20639
20750
|
"div",
|
|
20640
20751
|
{
|
|
@@ -21099,12 +21210,12 @@ ProgressRing.displayName = "ProgressRing";
|
|
|
21099
21210
|
// src/components/PromptInput/PromptInput.tsx
|
|
21100
21211
|
import {
|
|
21101
21212
|
forwardRef as forwardRef71,
|
|
21102
|
-
useCallback as
|
|
21103
|
-
useEffect as
|
|
21213
|
+
useCallback as useCallback33,
|
|
21214
|
+
useEffect as useEffect32,
|
|
21104
21215
|
useId as useId45,
|
|
21105
21216
|
useImperativeHandle as useImperativeHandle11,
|
|
21106
21217
|
useRef as useRef37,
|
|
21107
|
-
useState as
|
|
21218
|
+
useState as useState39
|
|
21108
21219
|
} from "react";
|
|
21109
21220
|
import {
|
|
21110
21221
|
AttachmentIcon,
|
|
@@ -21156,14 +21267,14 @@ var PromptInput = forwardRef71(
|
|
|
21156
21267
|
const suggestionsId = `${baseId}-suggestions`;
|
|
21157
21268
|
const counterId = `${baseId}-counter`;
|
|
21158
21269
|
const taRef = useRef37(null);
|
|
21159
|
-
const [internal, setInternal] =
|
|
21270
|
+
const [internal, setInternal] = useState39(defaultValue);
|
|
21160
21271
|
const v = value ?? internal;
|
|
21161
21272
|
const isControlled = value !== void 0;
|
|
21162
|
-
const [suggestionsOpen, setSuggestionsOpen] =
|
|
21163
|
-
const [suggestionIndex, setSuggestionIndex] =
|
|
21164
|
-
const [isDragOver, setIsDragOver] =
|
|
21165
|
-
const [historyIdx, setHistoryIdx] =
|
|
21166
|
-
const setValue =
|
|
21273
|
+
const [suggestionsOpen, setSuggestionsOpen] = useState39(false);
|
|
21274
|
+
const [suggestionIndex, setSuggestionIndex] = useState39(0);
|
|
21275
|
+
const [isDragOver, setIsDragOver] = useState39(false);
|
|
21276
|
+
const [historyIdx, setHistoryIdx] = useState39(null);
|
|
21277
|
+
const setValue = useCallback33(
|
|
21167
21278
|
(next) => {
|
|
21168
21279
|
if (!isControlled) setInternal(next);
|
|
21169
21280
|
onChange?.(next);
|
|
@@ -21204,7 +21315,7 @@ var PromptInput = forwardRef71(
|
|
|
21204
21315
|
// biome-ignore lint/correctness/useExhaustiveDependencies: handleSubmit closes over up-to-date locals each render.
|
|
21205
21316
|
[v, setValue]
|
|
21206
21317
|
);
|
|
21207
|
-
|
|
21318
|
+
useEffect32(() => {
|
|
21208
21319
|
const el = taRef.current;
|
|
21209
21320
|
if (!el) return;
|
|
21210
21321
|
const computed = window.getComputedStyle(el);
|
|
@@ -21961,7 +22072,7 @@ RangeSlider.displayName = "RangeSlider";
|
|
|
21961
22072
|
// src/components/Rating/Rating.tsx
|
|
21962
22073
|
import {
|
|
21963
22074
|
forwardRef as forwardRef76,
|
|
21964
|
-
useState as
|
|
22075
|
+
useState as useState40
|
|
21965
22076
|
} from "react";
|
|
21966
22077
|
import {
|
|
21967
22078
|
FavoriteFilledIcon,
|
|
@@ -21988,7 +22099,7 @@ var Rating = forwardRef76(function Rating2({
|
|
|
21988
22099
|
"aria-label": ariaLabel,
|
|
21989
22100
|
...rest
|
|
21990
22101
|
}, ref) {
|
|
21991
|
-
const [hover, setHover] =
|
|
22102
|
+
const [hover, setHover] = useState40(null);
|
|
21992
22103
|
const display = hover ?? value;
|
|
21993
22104
|
const interactive = !readOnly && !disabled;
|
|
21994
22105
|
const Empty = icon === "heart" ? FavoriteIcon : StarIcon2;
|
|
@@ -22216,11 +22327,11 @@ function BinaryButton({
|
|
|
22216
22327
|
// src/components/Resizable/Resizable.tsx
|
|
22217
22328
|
import {
|
|
22218
22329
|
forwardRef as forwardRef78,
|
|
22219
|
-
useCallback as
|
|
22220
|
-
useEffect as
|
|
22330
|
+
useCallback as useCallback34,
|
|
22331
|
+
useEffect as useEffect33,
|
|
22221
22332
|
useLayoutEffect as useLayoutEffect9,
|
|
22222
22333
|
useRef as useRef40,
|
|
22223
|
-
useState as
|
|
22334
|
+
useState as useState41
|
|
22224
22335
|
} from "react";
|
|
22225
22336
|
import { jsx as jsx90, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
22226
22337
|
function setDragOverlay(direction) {
|
|
@@ -22254,9 +22365,9 @@ var Resizable = forwardRef78(
|
|
|
22254
22365
|
}, ref) {
|
|
22255
22366
|
const wrapRef = useRef40(null);
|
|
22256
22367
|
const draggingRef = useRef40(false);
|
|
22257
|
-
const [isDragging, setIsDragging] =
|
|
22258
|
-
const [split, setSplit] =
|
|
22259
|
-
const [total, setTotal] =
|
|
22368
|
+
const [isDragging, setIsDragging] = useState41(false);
|
|
22369
|
+
const [split, setSplit] = useState41(0);
|
|
22370
|
+
const [total, setTotal] = useState41(0);
|
|
22260
22371
|
const setRef = (node) => {
|
|
22261
22372
|
wrapRef.current = node;
|
|
22262
22373
|
if (typeof ref === "function") ref(node);
|
|
@@ -22286,7 +22397,7 @@ var Resizable = forwardRef78(
|
|
|
22286
22397
|
}
|
|
22287
22398
|
setSplit(defaultSplit >= 1 ? defaultSplit : t * defaultSplit);
|
|
22288
22399
|
}, []);
|
|
22289
|
-
|
|
22400
|
+
useEffect33(() => {
|
|
22290
22401
|
const el = wrapRef.current;
|
|
22291
22402
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
22292
22403
|
const ro = new ResizeObserver(() => {
|
|
@@ -22300,7 +22411,7 @@ var Resizable = forwardRef78(
|
|
|
22300
22411
|
ro.observe(el);
|
|
22301
22412
|
return () => ro.disconnect();
|
|
22302
22413
|
}, [direction, minSecond]);
|
|
22303
|
-
const persist =
|
|
22414
|
+
const persist = useCallback34(
|
|
22304
22415
|
(next) => {
|
|
22305
22416
|
onSplitChange?.(next);
|
|
22306
22417
|
if (storageKey && typeof window !== "undefined" && total > 0) {
|
|
@@ -22319,7 +22430,7 @@ var Resizable = forwardRef78(
|
|
|
22319
22430
|
setIsDragging(true);
|
|
22320
22431
|
setDragOverlay(direction);
|
|
22321
22432
|
};
|
|
22322
|
-
|
|
22433
|
+
useEffect33(() => {
|
|
22323
22434
|
const onMove = (e) => {
|
|
22324
22435
|
if (!draggingRef.current) return;
|
|
22325
22436
|
const el = wrapRef.current;
|
|
@@ -22448,10 +22559,10 @@ var ResizablePanel = forwardRef78(
|
|
|
22448
22559
|
...rest
|
|
22449
22560
|
}, ref) {
|
|
22450
22561
|
const isVertical = side === "bottom";
|
|
22451
|
-
const [internal, setInternal] =
|
|
22562
|
+
const [internal, setInternal] = useState41(sizeProp ?? defaultSize);
|
|
22452
22563
|
const size = sizeProp ?? internal;
|
|
22453
22564
|
const draggingRef = useRef40(false);
|
|
22454
|
-
const [isDragging, setIsDragging] =
|
|
22565
|
+
const [isDragging, setIsDragging] = useState41(false);
|
|
22455
22566
|
const startRef = useRef40({ at: 0, size });
|
|
22456
22567
|
const onPointerDown = (e) => {
|
|
22457
22568
|
e.preventDefault();
|
|
@@ -22464,7 +22575,7 @@ var ResizablePanel = forwardRef78(
|
|
|
22464
22575
|
};
|
|
22465
22576
|
setDragOverlay(isVertical ? "vertical" : "horizontal");
|
|
22466
22577
|
};
|
|
22467
|
-
|
|
22578
|
+
useEffect33(() => {
|
|
22468
22579
|
const onMove = (e) => {
|
|
22469
22580
|
if (!draggingRef.current) return;
|
|
22470
22581
|
const delta = (isVertical ? e.clientY : e.clientX) - startRef.current.at;
|
|
@@ -22636,8 +22747,8 @@ function SettingsRow({
|
|
|
22636
22747
|
|
|
22637
22748
|
// src/components/Sheet/Sheet.tsx
|
|
22638
22749
|
import { AnimatePresence as AnimatePresence18, motion as motion28 } from "framer-motion";
|
|
22639
|
-
import { useEffect as
|
|
22640
|
-
import { createPortal as
|
|
22750
|
+
import { useEffect as useEffect34 } from "react";
|
|
22751
|
+
import { createPortal as createPortal14 } from "react-dom";
|
|
22641
22752
|
import { Fragment as Fragment37, jsx as jsx94, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
22642
22753
|
var slideVariants = {
|
|
22643
22754
|
top: { initial: { y: "-100%" }, animate: { y: 0 }, exit: { y: "-100%" } },
|
|
@@ -22671,7 +22782,7 @@ function Sheet({
|
|
|
22671
22782
|
dragHandle = true,
|
|
22672
22783
|
className
|
|
22673
22784
|
}) {
|
|
22674
|
-
|
|
22785
|
+
useEffect34(() => {
|
|
22675
22786
|
if (!open || !closeOnEsc) return;
|
|
22676
22787
|
const onKey = (e) => {
|
|
22677
22788
|
if (e.key === "Escape") onClose();
|
|
@@ -22720,7 +22831,7 @@ function Sheet({
|
|
|
22720
22831
|
)
|
|
22721
22832
|
] }) });
|
|
22722
22833
|
if (typeof document === "undefined") return null;
|
|
22723
|
-
return
|
|
22834
|
+
return createPortal14(content, document.body);
|
|
22724
22835
|
}
|
|
22725
22836
|
|
|
22726
22837
|
// src/components/Show/Show.tsx
|
|
@@ -22740,7 +22851,7 @@ function Show({ above, below, children, ...rest }) {
|
|
|
22740
22851
|
Show.displayName = "Show";
|
|
22741
22852
|
|
|
22742
22853
|
// src/components/Sidebar/Sidebar.tsx
|
|
22743
|
-
import { useCallback as
|
|
22854
|
+
import { useCallback as useCallback35, useEffect as useEffect35, useRef as useRef41, useState as useState42 } from "react";
|
|
22744
22855
|
import { Fragment as Fragment38, jsx as jsx96, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
22745
22856
|
function Sidebar({
|
|
22746
22857
|
variant = "expanded",
|
|
@@ -22760,8 +22871,8 @@ function Sidebar({
|
|
|
22760
22871
|
className
|
|
22761
22872
|
}) {
|
|
22762
22873
|
const allSections = sections ?? (items ? [{ items }] : []);
|
|
22763
|
-
const [internalPinned, setInternalPinned] =
|
|
22764
|
-
|
|
22874
|
+
const [internalPinned, setInternalPinned] = useState42(defaultPinned);
|
|
22875
|
+
useEffect35(() => {
|
|
22765
22876
|
if (pinnedProp !== void 0) return;
|
|
22766
22877
|
try {
|
|
22767
22878
|
const stored = window.localStorage.getItem(pinStorageKey);
|
|
@@ -22772,7 +22883,7 @@ function Sidebar({
|
|
|
22772
22883
|
}
|
|
22773
22884
|
}, []);
|
|
22774
22885
|
const pinned = pinnedProp ?? internalPinned;
|
|
22775
|
-
const setPinned =
|
|
22886
|
+
const setPinned = useCallback35(
|
|
22776
22887
|
(p) => {
|
|
22777
22888
|
if (pinnedProp === void 0) setInternalPinned(p);
|
|
22778
22889
|
try {
|
|
@@ -22783,7 +22894,7 @@ function Sidebar({
|
|
|
22783
22894
|
},
|
|
22784
22895
|
[pinnedProp, pinStorageKey, onPinnedChange]
|
|
22785
22896
|
);
|
|
22786
|
-
const [hoverOpen, setHoverOpen] =
|
|
22897
|
+
const [hoverOpen, setHoverOpen] = useState42(false);
|
|
22787
22898
|
const openTimer = useRef41(null);
|
|
22788
22899
|
const closeTimer = useRef41(null);
|
|
22789
22900
|
const clearTimers = () => {
|
|
@@ -22796,7 +22907,7 @@ function Sidebar({
|
|
|
22796
22907
|
closeTimer.current = null;
|
|
22797
22908
|
}
|
|
22798
22909
|
};
|
|
22799
|
-
|
|
22910
|
+
useEffect35(() => () => clearTimers(), []);
|
|
22800
22911
|
const handleEnter = () => {
|
|
22801
22912
|
clearTimers();
|
|
22802
22913
|
openTimer.current = setTimeout(() => setHoverOpen(true), hoverOpenDelay);
|
|
@@ -22808,7 +22919,7 @@ function Sidebar({
|
|
|
22808
22919
|
const autoMode = variant === "auto";
|
|
22809
22920
|
const showAsRail = autoMode ? !pinned : variant === "rail";
|
|
22810
22921
|
const overlayOpen = autoMode && !pinned && hoverOpen;
|
|
22811
|
-
|
|
22922
|
+
useEffect35(() => {
|
|
22812
22923
|
if (!overlayOpen) return;
|
|
22813
22924
|
const handler = (e) => {
|
|
22814
22925
|
if (e.key === "Escape") {
|
|
@@ -22942,7 +23053,7 @@ function RailItem({
|
|
|
22942
23053
|
tooltipDelay,
|
|
22943
23054
|
suppressTooltip
|
|
22944
23055
|
}) {
|
|
22945
|
-
const [open, setOpen] =
|
|
23056
|
+
const [open, setOpen] = useState42(false);
|
|
22946
23057
|
const timerRef = useRef41(null);
|
|
22947
23058
|
const hasChildren = !!(item.children && item.children.length > 0);
|
|
22948
23059
|
const clear = () => {
|
|
@@ -22951,7 +23062,7 @@ function RailItem({
|
|
|
22951
23062
|
timerRef.current = null;
|
|
22952
23063
|
}
|
|
22953
23064
|
};
|
|
22954
|
-
|
|
23065
|
+
useEffect35(() => () => clear(), []);
|
|
22955
23066
|
const show = () => {
|
|
22956
23067
|
if (suppressTooltip) return;
|
|
22957
23068
|
clear();
|
|
@@ -23095,7 +23206,7 @@ function SidebarToggleIcon({ collapsed }) {
|
|
|
23095
23206
|
}
|
|
23096
23207
|
function ExpandedItem({ item, level }) {
|
|
23097
23208
|
const hasChildren = !!(item.children && item.children.length > 0);
|
|
23098
|
-
const [open, setOpen] =
|
|
23209
|
+
const [open, setOpen] = useState42(
|
|
23099
23210
|
item.defaultExpanded ?? (hasChildren && hasActiveDescendant(item))
|
|
23100
23211
|
);
|
|
23101
23212
|
if (hasChildren) {
|
|
@@ -23355,7 +23466,7 @@ SkeletonGroup.displayName = "SkeletonGroup";
|
|
|
23355
23466
|
import { AnimatePresence as AnimatePresence19, motion as motion29 } from "framer-motion";
|
|
23356
23467
|
import { useRef as useRef42 } from "react";
|
|
23357
23468
|
import { FocusScope as FocusScope2, OverlayProvider as OverlayProvider2, useDialog as useDialog2, useModal as useModal2, useOverlay as useOverlay2 } from "react-aria";
|
|
23358
|
-
import { createPortal as
|
|
23469
|
+
import { createPortal as createPortal15 } from "react-dom";
|
|
23359
23470
|
import { Fragment as Fragment39, jsx as jsx98, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
23360
23471
|
var slideVariants2 = {
|
|
23361
23472
|
left: {
|
|
@@ -23447,7 +23558,7 @@ function SlideoutContent({
|
|
|
23447
23558
|
}
|
|
23448
23559
|
function SlideoutPanel(props) {
|
|
23449
23560
|
if (typeof document === "undefined") return null;
|
|
23450
|
-
return
|
|
23561
|
+
return createPortal15(
|
|
23451
23562
|
/* @__PURE__ */ jsx98(OverlayProvider2, { children: /* @__PURE__ */ jsx98(SlideoutContent, { ...props }) }),
|
|
23452
23563
|
document.body
|
|
23453
23564
|
);
|
|
@@ -23700,10 +23811,10 @@ SocialButton.displayName = "SocialButton";
|
|
|
23700
23811
|
// src/components/Sortable/Sortable.tsx
|
|
23701
23812
|
import {
|
|
23702
23813
|
forwardRef as forwardRef84,
|
|
23703
|
-
useCallback as
|
|
23704
|
-
useEffect as
|
|
23814
|
+
useCallback as useCallback36,
|
|
23815
|
+
useEffect as useEffect36,
|
|
23705
23816
|
useRef as useRef43,
|
|
23706
|
-
useState as
|
|
23817
|
+
useState as useState43
|
|
23707
23818
|
} from "react";
|
|
23708
23819
|
import { DraggableIcon } from "@octaviaflow/icons";
|
|
23709
23820
|
import { jsx as jsx101, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
@@ -23723,11 +23834,11 @@ function Sortable({
|
|
|
23723
23834
|
const itemRefs = useRef43(/* @__PURE__ */ new Map());
|
|
23724
23835
|
const originalOrderRef = useRef43(null);
|
|
23725
23836
|
const scrollTimerRef = useRef43(null);
|
|
23726
|
-
const [draggingId, setDraggingId] =
|
|
23727
|
-
const [dropPos, setDropPos] =
|
|
23728
|
-
const [kbActiveId, setKbActiveId] =
|
|
23837
|
+
const [draggingId, setDraggingId] = useState43(null);
|
|
23838
|
+
const [dropPos, setDropPos] = useState43(null);
|
|
23839
|
+
const [kbActiveId, setKbActiveId] = useState43(null);
|
|
23729
23840
|
const isVertical = direction === "vertical";
|
|
23730
|
-
const onDragStart =
|
|
23841
|
+
const onDragStart = useCallback36(
|
|
23731
23842
|
(id) => (e) => {
|
|
23732
23843
|
if (disabled) return;
|
|
23733
23844
|
e.dataTransfer.effectAllowed = "move";
|
|
@@ -23738,7 +23849,7 @@ function Sortable({
|
|
|
23738
23849
|
},
|
|
23739
23850
|
[disabled, items]
|
|
23740
23851
|
);
|
|
23741
|
-
const cancelDrag =
|
|
23852
|
+
const cancelDrag = useCallback36(() => {
|
|
23742
23853
|
setDraggingId(null);
|
|
23743
23854
|
setDropPos(null);
|
|
23744
23855
|
originalOrderRef.current = null;
|
|
@@ -23747,7 +23858,7 @@ function Sortable({
|
|
|
23747
23858
|
scrollTimerRef.current = null;
|
|
23748
23859
|
}
|
|
23749
23860
|
}, []);
|
|
23750
|
-
const onDragEnd =
|
|
23861
|
+
const onDragEnd = useCallback36(() => {
|
|
23751
23862
|
cancelDrag();
|
|
23752
23863
|
}, [cancelDrag]);
|
|
23753
23864
|
const onItemDragOver = (id) => (e) => {
|
|
@@ -23772,7 +23883,7 @@ function Sortable({
|
|
|
23772
23883
|
if (sourceId === target.id) return;
|
|
23773
23884
|
commitMove(sourceId, target.id, target.edge);
|
|
23774
23885
|
};
|
|
23775
|
-
const commitMove =
|
|
23886
|
+
const commitMove = useCallback36(
|
|
23776
23887
|
(sourceId, targetId, edge) => {
|
|
23777
23888
|
const from = items.findIndex((i) => i.id === sourceId);
|
|
23778
23889
|
let to = items.findIndex((i) => i.id === targetId);
|
|
@@ -23786,7 +23897,7 @@ function Sortable({
|
|
|
23786
23897
|
},
|
|
23787
23898
|
[items, onChange]
|
|
23788
23899
|
);
|
|
23789
|
-
|
|
23900
|
+
useEffect36(() => {
|
|
23790
23901
|
if (!autoScroll || !draggingId) return;
|
|
23791
23902
|
const container = containerRef.current;
|
|
23792
23903
|
if (!container) return;
|
|
@@ -23836,7 +23947,7 @@ function Sortable({
|
|
|
23836
23947
|
}
|
|
23837
23948
|
};
|
|
23838
23949
|
}, [autoScroll, autoScrollEdge, draggingId, isVertical]);
|
|
23839
|
-
|
|
23950
|
+
useEffect36(() => {
|
|
23840
23951
|
if (!draggingId) return;
|
|
23841
23952
|
const onKey = (e) => {
|
|
23842
23953
|
if (e.key === "Escape") cancelDrag();
|
|
@@ -24080,13 +24191,13 @@ VStack.displayName = "VStack";
|
|
|
24080
24191
|
import { AnimatePresence as AnimatePresence20, motion as motion30, useReducedMotion as useReducedMotion13 } from "framer-motion";
|
|
24081
24192
|
import {
|
|
24082
24193
|
forwardRef as forwardRef86,
|
|
24083
|
-
useCallback as
|
|
24084
|
-
useEffect as
|
|
24194
|
+
useCallback as useCallback37,
|
|
24195
|
+
useEffect as useEffect37,
|
|
24085
24196
|
useLayoutEffect as useLayoutEffect10,
|
|
24086
24197
|
useMemo as useMemo25,
|
|
24087
|
-
useState as
|
|
24198
|
+
useState as useState44
|
|
24088
24199
|
} from "react";
|
|
24089
|
-
import { createPortal as
|
|
24200
|
+
import { createPortal as createPortal16 } from "react-dom";
|
|
24090
24201
|
import { jsx as jsx103, jsxs as jsxs97 } from "react/jsx-runtime";
|
|
24091
24202
|
var Spotlight = forwardRef86(
|
|
24092
24203
|
function Spotlight2({
|
|
@@ -24105,8 +24216,8 @@ var Spotlight = forwardRef86(
|
|
|
24105
24216
|
...rest
|
|
24106
24217
|
}, ref) {
|
|
24107
24218
|
const reducedMotion = useReducedMotion13();
|
|
24108
|
-
const [rect, setRect] =
|
|
24109
|
-
const [viewport, setViewport] =
|
|
24219
|
+
const [rect, setRect] = useState44(null);
|
|
24220
|
+
const [viewport, setViewport] = useState44(() => ({
|
|
24110
24221
|
width: typeof window !== "undefined" ? window.innerWidth : 0,
|
|
24111
24222
|
height: typeof window !== "undefined" ? window.innerHeight : 0
|
|
24112
24223
|
}));
|
|
@@ -24114,7 +24225,7 @@ var Spotlight = forwardRef86(
|
|
|
24114
24225
|
() => `ods-spotlight-${Math.random().toString(36).slice(2, 9)}`,
|
|
24115
24226
|
[]
|
|
24116
24227
|
);
|
|
24117
|
-
const measure =
|
|
24228
|
+
const measure = useCallback37(() => {
|
|
24118
24229
|
if (!open) return;
|
|
24119
24230
|
const el = target.current;
|
|
24120
24231
|
if (!el) return;
|
|
@@ -24127,7 +24238,7 @@ var Spotlight = forwardRef86(
|
|
|
24127
24238
|
useLayoutEffect10(() => {
|
|
24128
24239
|
measure();
|
|
24129
24240
|
}, [measure]);
|
|
24130
|
-
|
|
24241
|
+
useEffect37(() => {
|
|
24131
24242
|
if (!open) return;
|
|
24132
24243
|
const handler = () => measure();
|
|
24133
24244
|
window.addEventListener("resize", handler);
|
|
@@ -24137,7 +24248,7 @@ var Spotlight = forwardRef86(
|
|
|
24137
24248
|
window.removeEventListener("scroll", handler, true);
|
|
24138
24249
|
};
|
|
24139
24250
|
}, [open, measure]);
|
|
24140
|
-
|
|
24251
|
+
useEffect37(() => {
|
|
24141
24252
|
if (!open || !onDismiss) return;
|
|
24142
24253
|
const onKey = (e) => {
|
|
24143
24254
|
if (e.key === "Escape") onDismiss();
|
|
@@ -24153,7 +24264,7 @@ var Spotlight = forwardRef86(
|
|
|
24153
24264
|
width: rect.width + padding * 2,
|
|
24154
24265
|
height: rect.height + padding * 2
|
|
24155
24266
|
} : null;
|
|
24156
|
-
return
|
|
24267
|
+
return createPortal16(
|
|
24157
24268
|
/* @__PURE__ */ jsx103(AnimatePresence20, { children: open && /* @__PURE__ */ jsxs97(
|
|
24158
24269
|
motion30.div,
|
|
24159
24270
|
{
|
|
@@ -24285,10 +24396,10 @@ Stat.displayName = "Stat";
|
|
|
24285
24396
|
import { motion as motion31 } from "framer-motion";
|
|
24286
24397
|
import {
|
|
24287
24398
|
forwardRef as forwardRef88,
|
|
24288
|
-
useCallback as
|
|
24399
|
+
useCallback as useCallback38,
|
|
24289
24400
|
useId as useId49,
|
|
24290
24401
|
useMemo as useMemo26,
|
|
24291
|
-
useState as
|
|
24402
|
+
useState as useState45
|
|
24292
24403
|
} from "react";
|
|
24293
24404
|
import { jsx as jsx105, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
24294
24405
|
var STATUS_COLORS = {
|
|
@@ -24329,8 +24440,8 @@ var StatusTiles = forwardRef88(
|
|
|
24329
24440
|
() => max < data.length ? data.slice(data.length - max) : data,
|
|
24330
24441
|
[data, max]
|
|
24331
24442
|
);
|
|
24332
|
-
const [hoveredIdx, setHoveredIdx] =
|
|
24333
|
-
const fire =
|
|
24443
|
+
const [hoveredIdx, setHoveredIdx] = useState45(null);
|
|
24444
|
+
const fire = useCallback38(
|
|
24334
24445
|
(idx) => {
|
|
24335
24446
|
setHoveredIdx(idx);
|
|
24336
24447
|
if (idx === null) {
|
|
@@ -24342,7 +24453,7 @@ var StatusTiles = forwardRef88(
|
|
|
24342
24453
|
},
|
|
24343
24454
|
[onTileHover, visible]
|
|
24344
24455
|
);
|
|
24345
|
-
const handleKey =
|
|
24456
|
+
const handleKey = useCallback38(
|
|
24346
24457
|
(e, idx) => {
|
|
24347
24458
|
if (!onTileClick) return;
|
|
24348
24459
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -24605,10 +24716,10 @@ Stepper.displayName = "Stepper";
|
|
|
24605
24716
|
import { motion as motion32 } from "framer-motion";
|
|
24606
24717
|
import {
|
|
24607
24718
|
forwardRef as forwardRef90,
|
|
24608
|
-
useCallback as
|
|
24719
|
+
useCallback as useCallback39,
|
|
24609
24720
|
useId as useId51,
|
|
24610
24721
|
useMemo as useMemo27,
|
|
24611
|
-
useState as
|
|
24722
|
+
useState as useState46
|
|
24612
24723
|
} from "react";
|
|
24613
24724
|
import { jsx as jsx107, jsxs as jsxs101 } from "react/jsx-runtime";
|
|
24614
24725
|
var defaultFormat7 = (n) => {
|
|
@@ -24803,23 +24914,23 @@ var Sankey = forwardRef90(function Sankey2({
|
|
|
24803
24914
|
}
|
|
24804
24915
|
return out;
|
|
24805
24916
|
}, [links, layoutNodes, nodeWidth, scale]);
|
|
24806
|
-
const [hoveredNode, setHoveredNode] =
|
|
24807
|
-
const [hoveredLink, setHoveredLink] =
|
|
24808
|
-
const fireNode =
|
|
24917
|
+
const [hoveredNode, setHoveredNode] = useState46(null);
|
|
24918
|
+
const [hoveredLink, setHoveredLink] = useState46(null);
|
|
24919
|
+
const fireNode = useCallback39(
|
|
24809
24920
|
(n) => {
|
|
24810
24921
|
setHoveredNode(n);
|
|
24811
24922
|
onNodeHover?.(n);
|
|
24812
24923
|
},
|
|
24813
24924
|
[onNodeHover]
|
|
24814
24925
|
);
|
|
24815
|
-
const fireLink =
|
|
24926
|
+
const fireLink = useCallback39(
|
|
24816
24927
|
(l) => {
|
|
24817
24928
|
setHoveredLink(l);
|
|
24818
24929
|
onLinkHover?.(l);
|
|
24819
24930
|
},
|
|
24820
24931
|
[onLinkHover]
|
|
24821
24932
|
);
|
|
24822
|
-
const handleNodeKey =
|
|
24933
|
+
const handleNodeKey = useCallback39(
|
|
24823
24934
|
(e, n) => {
|
|
24824
24935
|
if (!onNodeClick) return;
|
|
24825
24936
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -25057,8 +25168,8 @@ Switch.displayName = "Switch";
|
|
|
25057
25168
|
// src/components/Table/Table.tsx
|
|
25058
25169
|
import {
|
|
25059
25170
|
forwardRef as forwardRef92,
|
|
25060
|
-
useCallback as
|
|
25061
|
-
useState as
|
|
25171
|
+
useCallback as useCallback40,
|
|
25172
|
+
useState as useState47
|
|
25062
25173
|
} from "react";
|
|
25063
25174
|
import {
|
|
25064
25175
|
CaretDownIcon as CaretDownIcon2,
|
|
@@ -25084,7 +25195,7 @@ function TableInner({
|
|
|
25084
25195
|
"aria-label": ariaLabel = "Data table",
|
|
25085
25196
|
...rest
|
|
25086
25197
|
}, ref) {
|
|
25087
|
-
const handleSort =
|
|
25198
|
+
const handleSort = useCallback40(
|
|
25088
25199
|
(key) => {
|
|
25089
25200
|
if (!onSort) return;
|
|
25090
25201
|
const col = columns.find((c) => c.key === key);
|
|
@@ -25094,7 +25205,7 @@ function TableInner({
|
|
|
25094
25205
|
},
|
|
25095
25206
|
[columns, onSort, sortKey, sortDirection]
|
|
25096
25207
|
);
|
|
25097
|
-
const handleSelectAll =
|
|
25208
|
+
const handleSelectAll = useCallback40(() => {
|
|
25098
25209
|
if (!onSelectionChange) return;
|
|
25099
25210
|
const allSelected = selectedRows?.size === data.length;
|
|
25100
25211
|
if (allSelected) {
|
|
@@ -25103,7 +25214,7 @@ function TableInner({
|
|
|
25103
25214
|
onSelectionChange(new Set(data.map((_, i) => i)));
|
|
25104
25215
|
}
|
|
25105
25216
|
}, [data, onSelectionChange, selectedRows]);
|
|
25106
|
-
const handleSelectRow =
|
|
25217
|
+
const handleSelectRow = useCallback40(
|
|
25107
25218
|
(index) => {
|
|
25108
25219
|
if (!onSelectionChange || !selectedRows) return;
|
|
25109
25220
|
const next = new Set(selectedRows);
|
|
@@ -25199,7 +25310,7 @@ function TableRow({
|
|
|
25199
25310
|
totalCols
|
|
25200
25311
|
}) {
|
|
25201
25312
|
const isSelected = selectedRows?.has(rowIndex) ?? false;
|
|
25202
|
-
const [expanded, setExpanded] =
|
|
25313
|
+
const [expanded, setExpanded] = useState47(false);
|
|
25203
25314
|
return /* @__PURE__ */ jsxs103(Fragment41, { children: [
|
|
25204
25315
|
/* @__PURE__ */ jsxs103(
|
|
25205
25316
|
"tr",
|
|
@@ -25237,7 +25348,7 @@ function TableRow({
|
|
|
25237
25348
|
|
|
25238
25349
|
// src/components/Tabs/Tabs.tsx
|
|
25239
25350
|
import { motion as motion33 } from "framer-motion";
|
|
25240
|
-
import { useCallback as
|
|
25351
|
+
import { useCallback as useCallback41, useEffect as useEffect38, useId as useId52, useMemo as useMemo28, useRef as useRef45, useState as useState48 } from "react";
|
|
25241
25352
|
import { useTab, useTabList, useTabPanel } from "react-aria";
|
|
25242
25353
|
import { jsx as jsx110, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
25243
25354
|
function TabButton({
|
|
@@ -25291,7 +25402,7 @@ function Tabs({
|
|
|
25291
25402
|
}) {
|
|
25292
25403
|
const reactId = useId52();
|
|
25293
25404
|
const indicatorLayoutId = `ods-tabs-indicator-${reactId}`;
|
|
25294
|
-
const [internalValue, setInternalValue] =
|
|
25405
|
+
const [internalValue, setInternalValue] = useState48(defaultValue || items[0]?.value);
|
|
25295
25406
|
const selectedKey = value ?? internalValue;
|
|
25296
25407
|
const handleSelectionChange = (key) => {
|
|
25297
25408
|
const keyStr = String(key);
|
|
@@ -25318,9 +25429,9 @@ function Tabs({
|
|
|
25318
25429
|
const ref = useRef45(null);
|
|
25319
25430
|
const { tabListProps } = useTabList({ ...stateProps, orientation }, state, ref);
|
|
25320
25431
|
const scrollContainerRef = useRef45(null);
|
|
25321
|
-
const [canScrollLeft, setCanScrollLeft] =
|
|
25322
|
-
const [canScrollRight, setCanScrollRight] =
|
|
25323
|
-
const measureOverflow =
|
|
25432
|
+
const [canScrollLeft, setCanScrollLeft] = useState48(false);
|
|
25433
|
+
const [canScrollRight, setCanScrollRight] = useState48(false);
|
|
25434
|
+
const measureOverflow = useCallback41(() => {
|
|
25324
25435
|
const el = scrollContainerRef.current;
|
|
25325
25436
|
if (!el || orientation !== "horizontal") {
|
|
25326
25437
|
setCanScrollLeft(false);
|
|
@@ -25331,7 +25442,7 @@ function Tabs({
|
|
|
25331
25442
|
setCanScrollLeft(el.scrollLeft > SCROLL_EDGE_EPSILON);
|
|
25332
25443
|
setCanScrollRight(el.scrollLeft < max - SCROLL_EDGE_EPSILON);
|
|
25333
25444
|
}, [orientation]);
|
|
25334
|
-
|
|
25445
|
+
useEffect38(() => {
|
|
25335
25446
|
measureOverflow();
|
|
25336
25447
|
const el = scrollContainerRef.current;
|
|
25337
25448
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -25414,7 +25525,7 @@ function ChevronSvg({ dir }) {
|
|
|
25414
25525
|
import {
|
|
25415
25526
|
forwardRef as forwardRef93,
|
|
25416
25527
|
useId as useId53,
|
|
25417
|
-
useState as
|
|
25528
|
+
useState as useState49
|
|
25418
25529
|
} from "react";
|
|
25419
25530
|
import { CloseIcon as CloseIcon14 } from "@octaviaflow/icons";
|
|
25420
25531
|
import { jsx as jsx111, jsxs as jsxs105 } from "react/jsx-runtime";
|
|
@@ -25439,7 +25550,7 @@ var TagsInput = forwardRef93(
|
|
|
25439
25550
|
"aria-describedby": consumerDescribedBy,
|
|
25440
25551
|
...rest
|
|
25441
25552
|
}, ref) {
|
|
25442
|
-
const [draft, setDraft] =
|
|
25553
|
+
const [draft, setDraft] = useState49("");
|
|
25443
25554
|
const reactId = useId53();
|
|
25444
25555
|
const inputId = providedId ?? `ods-tags-${reactId}`;
|
|
25445
25556
|
const labelId = label ? `${inputId}-label` : void 0;
|
|
@@ -25887,22 +25998,22 @@ TestimonialCard.displayName = "TestimonialCard";
|
|
|
25887
25998
|
// src/components/Textarea/Textarea.tsx
|
|
25888
25999
|
import {
|
|
25889
26000
|
forwardRef as forwardRef96,
|
|
25890
|
-
useEffect as
|
|
26001
|
+
useEffect as useEffect41,
|
|
25891
26002
|
useId as useId56,
|
|
25892
26003
|
useRef as useRef48,
|
|
25893
|
-
useState as
|
|
26004
|
+
useState as useState52
|
|
25894
26005
|
} from "react";
|
|
25895
26006
|
import { useTextField } from "react-aria";
|
|
25896
|
-
import { createPortal as
|
|
26007
|
+
import { createPortal as createPortal17 } from "react-dom";
|
|
25897
26008
|
import { CopyIcon as CopyIcon5, CutIcon } from "@octaviaflow/icons";
|
|
25898
26009
|
|
|
25899
26010
|
// src/hooks/useTextareaCommands.ts
|
|
25900
26011
|
import {
|
|
25901
|
-
useCallback as
|
|
25902
|
-
useEffect as
|
|
26012
|
+
useCallback as useCallback42,
|
|
26013
|
+
useEffect as useEffect39,
|
|
25903
26014
|
useMemo as useMemo29,
|
|
25904
26015
|
useRef as useRef46,
|
|
25905
|
-
useState as
|
|
26016
|
+
useState as useState50
|
|
25906
26017
|
} from "react";
|
|
25907
26018
|
function findOpenTrigger(value, caret, trigger) {
|
|
25908
26019
|
let i = caret - 1;
|
|
@@ -25981,11 +26092,11 @@ function useTextareaCommands({
|
|
|
25981
26092
|
openOnEmptyTrigger = true,
|
|
25982
26093
|
maxItems = 8
|
|
25983
26094
|
}) {
|
|
25984
|
-
const [isOpen, setIsOpen] =
|
|
25985
|
-
const [query, setQuery] =
|
|
25986
|
-
const [activeIndex, setActiveIndex] =
|
|
25987
|
-
const [triggerIndex, setTriggerIndex] =
|
|
25988
|
-
const [caretRect, setCaretRect] =
|
|
26095
|
+
const [isOpen, setIsOpen] = useState50(false);
|
|
26096
|
+
const [query, setQuery] = useState50("");
|
|
26097
|
+
const [activeIndex, setActiveIndex] = useState50(0);
|
|
26098
|
+
const [triggerIndex, setTriggerIndex] = useState50(null);
|
|
26099
|
+
const [caretRect, setCaretRect] = useState50(null);
|
|
25989
26100
|
const dismissedAtRef = useRef46(
|
|
25990
26101
|
null
|
|
25991
26102
|
);
|
|
@@ -26002,7 +26113,7 @@ function useTextareaCommands({
|
|
|
26002
26113
|
return hay.includes(q2);
|
|
26003
26114
|
}).slice(0, maxItems);
|
|
26004
26115
|
}, [commands, query, maxItems]);
|
|
26005
|
-
|
|
26116
|
+
useEffect39(() => {
|
|
26006
26117
|
const ta = textareaRef.current;
|
|
26007
26118
|
if (!ta) return;
|
|
26008
26119
|
const caret = ta.selectionStart ?? 0;
|
|
@@ -26025,7 +26136,7 @@ function useTextareaCommands({
|
|
|
26025
26136
|
setCaretRect(getCaretRect(ta, caret));
|
|
26026
26137
|
}
|
|
26027
26138
|
}, [value, trigger, openOnEmptyTrigger, isOpen, textareaRef]);
|
|
26028
|
-
const commit =
|
|
26139
|
+
const commit = useCallback42(
|
|
26029
26140
|
(cmd) => {
|
|
26030
26141
|
const ta = textareaRef.current;
|
|
26031
26142
|
if (!ta || triggerIndex == null) return;
|
|
@@ -26049,7 +26160,7 @@ function useTextareaCommands({
|
|
|
26049
26160
|
},
|
|
26050
26161
|
[textareaRef, triggerIndex, query, value, onChange]
|
|
26051
26162
|
);
|
|
26052
|
-
const dismiss =
|
|
26163
|
+
const dismiss = useCallback42(() => {
|
|
26053
26164
|
const ta = textareaRef.current;
|
|
26054
26165
|
dismissedAtRef.current = {
|
|
26055
26166
|
value,
|
|
@@ -26058,7 +26169,7 @@ function useTextareaCommands({
|
|
|
26058
26169
|
setIsOpen(false);
|
|
26059
26170
|
setTriggerIndex(null);
|
|
26060
26171
|
}, [textareaRef, value]);
|
|
26061
|
-
const onKeyDown =
|
|
26172
|
+
const onKeyDown = useCallback42(
|
|
26062
26173
|
(e) => {
|
|
26063
26174
|
if (!isOpen) return false;
|
|
26064
26175
|
if (e.key === "ArrowDown") {
|
|
@@ -26101,7 +26212,7 @@ function useTextareaCommands({
|
|
|
26101
26212
|
}
|
|
26102
26213
|
|
|
26103
26214
|
// src/hooks/useTextareaSelection.ts
|
|
26104
|
-
import { useCallback as
|
|
26215
|
+
import { useCallback as useCallback43, useEffect as useEffect40, useState as useState51 } from "react";
|
|
26105
26216
|
function getSelectionRect(textarea, start, end) {
|
|
26106
26217
|
if (typeof document === "undefined") return null;
|
|
26107
26218
|
if (start === end) return null;
|
|
@@ -26163,10 +26274,10 @@ function useTextareaSelection({
|
|
|
26163
26274
|
value,
|
|
26164
26275
|
onChange
|
|
26165
26276
|
}) {
|
|
26166
|
-
const [start, setStart] =
|
|
26167
|
-
const [end, setEnd] =
|
|
26168
|
-
const [rect, setRect] =
|
|
26169
|
-
|
|
26277
|
+
const [start, setStart] = useState51(0);
|
|
26278
|
+
const [end, setEnd] = useState51(0);
|
|
26279
|
+
const [rect, setRect] = useState51(null);
|
|
26280
|
+
useEffect40(() => {
|
|
26170
26281
|
if (typeof document === "undefined") return;
|
|
26171
26282
|
const handler = () => {
|
|
26172
26283
|
const ta = textareaRef.current;
|
|
@@ -26187,7 +26298,7 @@ function useTextareaSelection({
|
|
|
26187
26298
|
}, [textareaRef]);
|
|
26188
26299
|
const active = start !== end;
|
|
26189
26300
|
const text = active ? value.slice(start, end) : "";
|
|
26190
|
-
const writeToClipboard =
|
|
26301
|
+
const writeToClipboard = useCallback43(
|
|
26191
26302
|
async (str) => {
|
|
26192
26303
|
try {
|
|
26193
26304
|
if (typeof navigator !== "undefined" && navigator.clipboard?.writeText) {
|
|
@@ -26212,11 +26323,11 @@ function useTextareaSelection({
|
|
|
26212
26323
|
},
|
|
26213
26324
|
[]
|
|
26214
26325
|
);
|
|
26215
|
-
const copy =
|
|
26326
|
+
const copy = useCallback43(async () => {
|
|
26216
26327
|
if (!active) return false;
|
|
26217
26328
|
return writeToClipboard(text);
|
|
26218
26329
|
}, [active, text, writeToClipboard]);
|
|
26219
|
-
const replace =
|
|
26330
|
+
const replace = useCallback43(
|
|
26220
26331
|
(str) => {
|
|
26221
26332
|
const ta = textareaRef.current;
|
|
26222
26333
|
if (!ta) return;
|
|
@@ -26230,13 +26341,13 @@ function useTextareaSelection({
|
|
|
26230
26341
|
},
|
|
26231
26342
|
[textareaRef, value, start, end, onChange]
|
|
26232
26343
|
);
|
|
26233
|
-
const cut =
|
|
26344
|
+
const cut = useCallback43(async () => {
|
|
26234
26345
|
if (!active) return false;
|
|
26235
26346
|
const ok = await writeToClipboard(text);
|
|
26236
26347
|
if (ok) replace("");
|
|
26237
26348
|
return ok;
|
|
26238
26349
|
}, [active, text, writeToClipboard, replace]);
|
|
26239
|
-
const wrap =
|
|
26350
|
+
const wrap = useCallback43(
|
|
26240
26351
|
(open, close) => {
|
|
26241
26352
|
const ta = textareaRef.current;
|
|
26242
26353
|
if (!ta) return;
|
|
@@ -26282,7 +26393,7 @@ import {
|
|
|
26282
26393
|
TextStrikethroughIcon,
|
|
26283
26394
|
UndoIcon as UndoIcon2
|
|
26284
26395
|
} from "@octaviaflow/icons";
|
|
26285
|
-
import { useCallback as
|
|
26396
|
+
import { useCallback as useCallback44, useMemo as useMemo30, useRef as useRef47 } from "react";
|
|
26286
26397
|
import { jsx as jsx114 } from "react/jsx-runtime";
|
|
26287
26398
|
function useTextareaTools({
|
|
26288
26399
|
textareaRef,
|
|
@@ -26394,7 +26505,7 @@ function useTextareaTools({
|
|
|
26394
26505
|
() => tools.filter((t) => t.isVisible ? t.isVisible(helpers) : true),
|
|
26395
26506
|
[tools, helpers]
|
|
26396
26507
|
);
|
|
26397
|
-
const runTool =
|
|
26508
|
+
const runTool = useCallback44(
|
|
26398
26509
|
async (id) => {
|
|
26399
26510
|
const tool = tools.find((t) => t.id === id);
|
|
26400
26511
|
if (!tool || tool.kind === "divider") return;
|
|
@@ -26542,7 +26653,7 @@ var Textarea = forwardRef96(
|
|
|
26542
26653
|
const reactId = useId56();
|
|
26543
26654
|
const baseId = providedId ?? `ods-textarea-${reactId}`;
|
|
26544
26655
|
const hintId = error && errorMessage || helperText ? `${baseId}-hint` : void 0;
|
|
26545
|
-
const [charCount, setCharCount] =
|
|
26656
|
+
const [charCount, setCharCount] = useState52(
|
|
26546
26657
|
() => String(value ?? defaultValue ?? "").length
|
|
26547
26658
|
);
|
|
26548
26659
|
const ariaNameProps = resolveAccessibleName({
|
|
@@ -26572,10 +26683,10 @@ var Textarea = forwardRef96(
|
|
|
26572
26683
|
setCharCount(e.target.value.length);
|
|
26573
26684
|
onChange?.(e);
|
|
26574
26685
|
};
|
|
26575
|
-
const [liveValue, setLiveValue] =
|
|
26686
|
+
const [liveValue, setLiveValue] = useState52(
|
|
26576
26687
|
String(value ?? defaultValue ?? "")
|
|
26577
26688
|
);
|
|
26578
|
-
|
|
26689
|
+
useEffect41(() => {
|
|
26579
26690
|
if (value != null) setLiveValue(String(value));
|
|
26580
26691
|
}, [value]);
|
|
26581
26692
|
const handleChangeWithMirror = (e) => {
|
|
@@ -26618,7 +26729,7 @@ var Textarea = forwardRef96(
|
|
|
26618
26729
|
}
|
|
26619
26730
|
props.onKeyDown?.(e);
|
|
26620
26731
|
};
|
|
26621
|
-
|
|
26732
|
+
useEffect41(() => {
|
|
26622
26733
|
if (!autoResize) return;
|
|
26623
26734
|
const el = innerRef.current;
|
|
26624
26735
|
if (!el) return;
|
|
@@ -26703,7 +26814,7 @@ var Textarea = forwardRef96(
|
|
|
26703
26814
|
"aria-activedescendant": cmdEnabled && cmdPalette.isOpen && cmdPalette.items[cmdPalette.activeIndex] ? `${baseId}-cmd-${cmdPalette.items[cmdPalette.activeIndex].id}` : void 0
|
|
26704
26815
|
}
|
|
26705
26816
|
),
|
|
26706
|
-
cmdEnabled && cmdPalette.isOpen && cmdPalette.items.length > 0 && typeof document !== "undefined" &&
|
|
26817
|
+
cmdEnabled && cmdPalette.isOpen && cmdPalette.items.length > 0 && typeof document !== "undefined" && createPortal17(
|
|
26707
26818
|
/* @__PURE__ */ jsx115(
|
|
26708
26819
|
"ul",
|
|
26709
26820
|
{
|
|
@@ -26746,7 +26857,7 @@ var Textarea = forwardRef96(
|
|
|
26746
26857
|
),
|
|
26747
26858
|
document.body
|
|
26748
26859
|
),
|
|
26749
|
-
selectionToolbar && sel.active && sel.rect && typeof document !== "undefined" &&
|
|
26860
|
+
selectionToolbar && sel.active && sel.rect && typeof document !== "undefined" && createPortal17(
|
|
26750
26861
|
/* @__PURE__ */ jsxs108(
|
|
26751
26862
|
"div",
|
|
26752
26863
|
{
|
|
@@ -26959,12 +27070,13 @@ Timeline.displayName = "Timeline";
|
|
|
26959
27070
|
import {
|
|
26960
27071
|
forwardRef as forwardRef98,
|
|
26961
27072
|
Fragment as Fragment43,
|
|
26962
|
-
useCallback as
|
|
26963
|
-
useEffect as
|
|
27073
|
+
useCallback as useCallback45,
|
|
27074
|
+
useEffect as useEffect42,
|
|
26964
27075
|
useId as useId57,
|
|
26965
27076
|
useRef as useRef49,
|
|
26966
|
-
useState as
|
|
27077
|
+
useState as useState53
|
|
26967
27078
|
} from "react";
|
|
27079
|
+
import { createPortal as createPortal18 } from "react-dom";
|
|
26968
27080
|
import {
|
|
26969
27081
|
CaretDownIcon as CaretDownIcon3,
|
|
26970
27082
|
CaretUpIcon as CaretUpIcon3,
|
|
@@ -27009,14 +27121,14 @@ var TimePicker = forwardRef98(
|
|
|
27009
27121
|
const labelId = label ? `${baseId}-label` : void 0;
|
|
27010
27122
|
const hintId = error || helperText ? `${baseId}-hint` : void 0;
|
|
27011
27123
|
const describedBy = [consumerDescribedBy, hintId].filter(Boolean).join(" ") || void 0;
|
|
27012
|
-
const [open, setOpen] =
|
|
27013
|
-
const [activeSeg, setActiveSeg] =
|
|
27124
|
+
const [open, setOpen] = useState53(false);
|
|
27125
|
+
const [activeSeg, setActiveSeg] = useState53(null);
|
|
27014
27126
|
const COMMIT_TIMEOUT_MS = 1500;
|
|
27015
|
-
const [draft, setDraft] =
|
|
27127
|
+
const [draft, setDraft] = useState53(
|
|
27016
27128
|
null
|
|
27017
27129
|
);
|
|
27018
27130
|
const draftRef = useRef49(null);
|
|
27019
|
-
const setDraftBoth =
|
|
27131
|
+
const setDraftBoth = useCallback45(
|
|
27020
27132
|
(next) => {
|
|
27021
27133
|
draftRef.current = next;
|
|
27022
27134
|
setDraft(next);
|
|
@@ -27033,11 +27145,14 @@ var TimePicker = forwardRef98(
|
|
|
27033
27145
|
else if (forwardedRef)
|
|
27034
27146
|
forwardedRef.current = node;
|
|
27035
27147
|
};
|
|
27148
|
+
const triggerRef = useRef49(null);
|
|
27149
|
+
const popoverRef = useRef49(null);
|
|
27150
|
+
const popoverPos = useAnchoredPopover(triggerRef, open, { popoverRef });
|
|
27036
27151
|
const hoursRef = useRef49(null);
|
|
27037
27152
|
const minutesRef = useRef49(null);
|
|
27038
27153
|
const secondsRef = useRef49(null);
|
|
27039
27154
|
const refOf = (s) => s === "hours" ? hoursRef : s === "minutes" ? minutesRef : secondsRef;
|
|
27040
|
-
const commit =
|
|
27155
|
+
const commit = useCallback45(
|
|
27041
27156
|
(seg, n) => {
|
|
27042
27157
|
const base = valueRef.current;
|
|
27043
27158
|
const next = { ...base, [seg]: clampSeg(seg, n, use24h) };
|
|
@@ -27069,13 +27184,13 @@ var TimePicker = forwardRef98(
|
|
|
27069
27184
|
valueRef.current = next;
|
|
27070
27185
|
onChange?.(next);
|
|
27071
27186
|
};
|
|
27072
|
-
const clearCommitTimer =
|
|
27187
|
+
const clearCommitTimer = useCallback45(() => {
|
|
27073
27188
|
if (commitTimerRef.current != null) {
|
|
27074
27189
|
clearTimeout(commitTimerRef.current);
|
|
27075
27190
|
commitTimerRef.current = null;
|
|
27076
27191
|
}
|
|
27077
27192
|
}, []);
|
|
27078
|
-
const commitDraft =
|
|
27193
|
+
const commitDraft = useCallback45(
|
|
27079
27194
|
(seg, digits) => {
|
|
27080
27195
|
clearCommitTimer();
|
|
27081
27196
|
const n = parseInt(digits || "0", 10);
|
|
@@ -27087,11 +27202,11 @@ var TimePicker = forwardRef98(
|
|
|
27087
27202
|
},
|
|
27088
27203
|
[clearCommitTimer, commit, use24h, setDraftBoth]
|
|
27089
27204
|
);
|
|
27090
|
-
const flushDraft =
|
|
27205
|
+
const flushDraft = useCallback45(() => {
|
|
27091
27206
|
const d = draftRef.current;
|
|
27092
27207
|
if (d) commitDraft(d.seg, d.digits);
|
|
27093
27208
|
}, [commitDraft]);
|
|
27094
|
-
const focusSegment =
|
|
27209
|
+
const focusSegment = useCallback45(
|
|
27095
27210
|
(seg) => {
|
|
27096
27211
|
const d = draftRef.current;
|
|
27097
27212
|
if (d && d.seg !== seg) commitDraft(d.seg, d.digits);
|
|
@@ -27100,17 +27215,18 @@ var TimePicker = forwardRef98(
|
|
|
27100
27215
|
},
|
|
27101
27216
|
[commitDraft]
|
|
27102
27217
|
);
|
|
27103
|
-
|
|
27218
|
+
useEffect42(() => {
|
|
27104
27219
|
if (!open) {
|
|
27105
27220
|
clearCommitTimer();
|
|
27106
27221
|
setDraftBoth(null);
|
|
27107
27222
|
}
|
|
27108
27223
|
return clearCommitTimer;
|
|
27109
27224
|
}, [open, clearCommitTimer, setDraftBoth]);
|
|
27110
|
-
|
|
27225
|
+
useEffect42(() => {
|
|
27111
27226
|
if (!open) return;
|
|
27112
27227
|
const onDoc = (e) => {
|
|
27113
|
-
|
|
27228
|
+
const target = e.target;
|
|
27229
|
+
if (!wrapRef.current?.contains(target) && !popoverRef.current?.contains(target)) {
|
|
27114
27230
|
flushDraft();
|
|
27115
27231
|
setOpen(false);
|
|
27116
27232
|
setActiveSeg(null);
|
|
@@ -27233,6 +27349,7 @@ var TimePicker = forwardRef98(
|
|
|
27233
27349
|
"button",
|
|
27234
27350
|
{
|
|
27235
27351
|
type: "button",
|
|
27352
|
+
ref: triggerRef,
|
|
27236
27353
|
id: baseId,
|
|
27237
27354
|
className: "ods-timepicker__trigger",
|
|
27238
27355
|
onClick: () => !disabled && setOpen((o) => !o),
|
|
@@ -27260,81 +27377,86 @@ var TimePicker = forwardRef98(
|
|
|
27260
27377
|
]
|
|
27261
27378
|
}
|
|
27262
27379
|
),
|
|
27263
|
-
open &&
|
|
27264
|
-
|
|
27265
|
-
|
|
27266
|
-
|
|
27267
|
-
|
|
27268
|
-
|
|
27269
|
-
|
|
27270
|
-
|
|
27271
|
-
|
|
27272
|
-
|
|
27273
|
-
|
|
27274
|
-
|
|
27275
|
-
|
|
27380
|
+
open && typeof document !== "undefined" && createPortal18(
|
|
27381
|
+
/* @__PURE__ */ jsxs110(
|
|
27382
|
+
"div",
|
|
27383
|
+
{
|
|
27384
|
+
ref: popoverRef,
|
|
27385
|
+
className: "ods-timepicker__popover",
|
|
27386
|
+
role: "dialog",
|
|
27387
|
+
"aria-label": "Select time",
|
|
27388
|
+
style: anchoredPopoverStyle(popoverPos),
|
|
27389
|
+
children: [
|
|
27390
|
+
/* @__PURE__ */ jsxs110("div", { className: "ods-timepicker__head", children: [
|
|
27391
|
+
/* @__PURE__ */ jsxs110("div", { className: "ods-timepicker__display", children: [
|
|
27392
|
+
segButton("hours", value.hours),
|
|
27276
27393
|
/* @__PURE__ */ jsx117("span", { className: "ods-timepicker__display-sep", children: ":" }),
|
|
27277
|
-
segButton("
|
|
27394
|
+
segButton("minutes", value.minutes),
|
|
27395
|
+
showSeconds && /* @__PURE__ */ jsxs110(Fragment44, { children: [
|
|
27396
|
+
/* @__PURE__ */ jsx117("span", { className: "ods-timepicker__display-sep", children: ":" }),
|
|
27397
|
+
segButton("seconds", value.seconds ?? 0)
|
|
27398
|
+
] })
|
|
27399
|
+
] }),
|
|
27400
|
+
!use24h && /* @__PURE__ */ jsxs110("div", { className: "ods-timepicker__period", children: [
|
|
27401
|
+
/* @__PURE__ */ jsx117(
|
|
27402
|
+
"button",
|
|
27403
|
+
{
|
|
27404
|
+
type: "button",
|
|
27405
|
+
className: cn(
|
|
27406
|
+
"ods-timepicker__period-btn",
|
|
27407
|
+
value.period === "AM" && "ods-timepicker__period-btn--active"
|
|
27408
|
+
),
|
|
27409
|
+
onClick: () => setPeriod("AM"),
|
|
27410
|
+
children: "AM"
|
|
27411
|
+
}
|
|
27412
|
+
),
|
|
27413
|
+
/* @__PURE__ */ jsx117(
|
|
27414
|
+
"button",
|
|
27415
|
+
{
|
|
27416
|
+
type: "button",
|
|
27417
|
+
className: cn(
|
|
27418
|
+
"ods-timepicker__period-btn",
|
|
27419
|
+
value.period === "PM" && "ods-timepicker__period-btn--active"
|
|
27420
|
+
),
|
|
27421
|
+
onClick: () => setPeriod("PM"),
|
|
27422
|
+
children: "PM"
|
|
27423
|
+
}
|
|
27424
|
+
)
|
|
27278
27425
|
] })
|
|
27279
27426
|
] }),
|
|
27280
|
-
|
|
27281
|
-
/* @__PURE__ */
|
|
27282
|
-
"
|
|
27283
|
-
|
|
27284
|
-
|
|
27285
|
-
|
|
27286
|
-
"
|
|
27287
|
-
|
|
27288
|
-
|
|
27289
|
-
|
|
27290
|
-
|
|
27291
|
-
|
|
27292
|
-
|
|
27293
|
-
|
|
27294
|
-
|
|
27295
|
-
|
|
27296
|
-
|
|
27297
|
-
|
|
27298
|
-
|
|
27299
|
-
|
|
27300
|
-
|
|
27301
|
-
|
|
27302
|
-
|
|
27303
|
-
|
|
27304
|
-
|
|
27305
|
-
|
|
27306
|
-
|
|
27307
|
-
|
|
27308
|
-
|
|
27309
|
-
|
|
27310
|
-
|
|
27311
|
-
|
|
27312
|
-
|
|
27313
|
-
type: "button",
|
|
27314
|
-
className: "ods-timepicker__step",
|
|
27315
|
-
onClick: () => stepBy(seg, 1),
|
|
27316
|
-
"aria-label": `${seg} up`,
|
|
27317
|
-
children: /* @__PURE__ */ jsx117(CaretUpIcon3, { size: "xs" })
|
|
27318
|
-
}
|
|
27319
|
-
),
|
|
27320
|
-
/* @__PURE__ */ jsx117("span", { className: "ods-timepicker__col-val", children: pad(
|
|
27321
|
-
seg === "hours" ? value.hours : seg === "minutes" ? value.minutes : value.seconds ?? 0
|
|
27322
|
-
) }),
|
|
27323
|
-
/* @__PURE__ */ jsx117(
|
|
27324
|
-
"button",
|
|
27325
|
-
{
|
|
27326
|
-
type: "button",
|
|
27327
|
-
className: "ods-timepicker__step",
|
|
27328
|
-
onClick: () => stepBy(seg, -1),
|
|
27329
|
-
"aria-label": `${seg} down`,
|
|
27330
|
-
children: /* @__PURE__ */ jsx117(CaretDownIcon3, { size: "xs" })
|
|
27331
|
-
}
|
|
27332
|
-
)
|
|
27333
|
-
] }),
|
|
27334
|
-
i < arr.length - 1 && /* @__PURE__ */ jsx117("span", { className: "ods-timepicker__sep", children: ":" })
|
|
27335
|
-
] }, seg)) })
|
|
27336
|
-
]
|
|
27337
|
-
}
|
|
27427
|
+
/* @__PURE__ */ jsx117("div", { className: "ods-timepicker__body", children: segOrder().map((seg, i, arr) => /* @__PURE__ */ jsxs110(Fragment43, { children: [
|
|
27428
|
+
/* @__PURE__ */ jsxs110("div", { className: "ods-timepicker__col", children: [
|
|
27429
|
+
/* @__PURE__ */ jsx117("span", { className: "ods-timepicker__col-lbl", children: seg === "hours" ? "HOUR" : seg === "minutes" ? "MIN" : "SEC" }),
|
|
27430
|
+
/* @__PURE__ */ jsx117(
|
|
27431
|
+
"button",
|
|
27432
|
+
{
|
|
27433
|
+
type: "button",
|
|
27434
|
+
className: "ods-timepicker__step",
|
|
27435
|
+
onClick: () => stepBy(seg, 1),
|
|
27436
|
+
"aria-label": `${seg} up`,
|
|
27437
|
+
children: /* @__PURE__ */ jsx117(CaretUpIcon3, { size: "xs" })
|
|
27438
|
+
}
|
|
27439
|
+
),
|
|
27440
|
+
/* @__PURE__ */ jsx117("span", { className: "ods-timepicker__col-val", children: pad(
|
|
27441
|
+
seg === "hours" ? value.hours : seg === "minutes" ? value.minutes : value.seconds ?? 0
|
|
27442
|
+
) }),
|
|
27443
|
+
/* @__PURE__ */ jsx117(
|
|
27444
|
+
"button",
|
|
27445
|
+
{
|
|
27446
|
+
type: "button",
|
|
27447
|
+
className: "ods-timepicker__step",
|
|
27448
|
+
onClick: () => stepBy(seg, -1),
|
|
27449
|
+
"aria-label": `${seg} down`,
|
|
27450
|
+
children: /* @__PURE__ */ jsx117(CaretDownIcon3, { size: "xs" })
|
|
27451
|
+
}
|
|
27452
|
+
)
|
|
27453
|
+
] }),
|
|
27454
|
+
i < arr.length - 1 && /* @__PURE__ */ jsx117("span", { className: "ods-timepicker__sep", children: ":" })
|
|
27455
|
+
] }, seg)) })
|
|
27456
|
+
]
|
|
27457
|
+
}
|
|
27458
|
+
),
|
|
27459
|
+
document.body
|
|
27338
27460
|
),
|
|
27339
27461
|
error ? /* @__PURE__ */ jsx117(
|
|
27340
27462
|
"div",
|
|
@@ -27355,12 +27477,12 @@ TimePicker.displayName = "TimePicker";
|
|
|
27355
27477
|
// src/components/TimezonePicker/TimezonePicker.tsx
|
|
27356
27478
|
import {
|
|
27357
27479
|
forwardRef as forwardRef99,
|
|
27358
|
-
useCallback as
|
|
27359
|
-
useEffect as
|
|
27480
|
+
useCallback as useCallback46,
|
|
27481
|
+
useEffect as useEffect43,
|
|
27360
27482
|
useId as useId58,
|
|
27361
27483
|
useMemo as useMemo31,
|
|
27362
27484
|
useRef as useRef50,
|
|
27363
|
-
useState as
|
|
27485
|
+
useState as useState54
|
|
27364
27486
|
} from "react";
|
|
27365
27487
|
import {
|
|
27366
27488
|
CheckmarkIcon as CheckmarkIcon12,
|
|
@@ -27407,9 +27529,9 @@ var TimezonePicker = forwardRef99(
|
|
|
27407
27529
|
const listboxId = `${baseId}-listbox`;
|
|
27408
27530
|
const hintId = error || helperText ? `${baseId}-hint` : void 0;
|
|
27409
27531
|
const describedBy = [consumerDescribedBy, hintId].filter(Boolean).join(" ") || void 0;
|
|
27410
|
-
const [open, setOpen] =
|
|
27411
|
-
const [query, setQuery] =
|
|
27412
|
-
const [activeIndex, setActiveIndex] =
|
|
27532
|
+
const [open, setOpen] = useState54(false);
|
|
27533
|
+
const [query, setQuery] = useState54("");
|
|
27534
|
+
const [activeIndex, setActiveIndex] = useState54(0);
|
|
27413
27535
|
const wrapRef = useRef50(null);
|
|
27414
27536
|
const triggerRef = useRef50(null);
|
|
27415
27537
|
const inputRef = useRef50(null);
|
|
@@ -27431,16 +27553,16 @@ var TimezonePicker = forwardRef99(
|
|
|
27431
27553
|
(o) => o.iana.toLowerCase().includes(q2) || o.label.toLowerCase().includes(q2) || o.offset.toLowerCase().includes(q2) || o.region?.toLowerCase().includes(q2)
|
|
27432
27554
|
);
|
|
27433
27555
|
}, [options, query]);
|
|
27434
|
-
|
|
27556
|
+
useEffect43(() => {
|
|
27435
27557
|
if (activeIndex >= filtered.length) setActiveIndex(0);
|
|
27436
27558
|
}, [filtered.length, activeIndex]);
|
|
27437
|
-
|
|
27559
|
+
useEffect43(() => {
|
|
27438
27560
|
if (!open) return;
|
|
27439
27561
|
const idx = filtered.findIndex((o) => o.iana === value);
|
|
27440
27562
|
setActiveIndex(idx >= 0 ? idx : 0);
|
|
27441
27563
|
inputRef.current?.focus();
|
|
27442
27564
|
}, [open]);
|
|
27443
|
-
|
|
27565
|
+
useEffect43(() => {
|
|
27444
27566
|
if (!open) return;
|
|
27445
27567
|
const onDoc = (e) => {
|
|
27446
27568
|
if (!wrapRef.current?.contains(e.target)) {
|
|
@@ -27451,7 +27573,7 @@ var TimezonePicker = forwardRef99(
|
|
|
27451
27573
|
document.addEventListener("mousedown", onDoc);
|
|
27452
27574
|
return () => document.removeEventListener("mousedown", onDoc);
|
|
27453
27575
|
}, [open]);
|
|
27454
|
-
|
|
27576
|
+
useEffect43(() => {
|
|
27455
27577
|
if (!open) return;
|
|
27456
27578
|
const list = listRef.current;
|
|
27457
27579
|
if (!list) return;
|
|
@@ -27460,7 +27582,7 @@ var TimezonePicker = forwardRef99(
|
|
|
27460
27582
|
);
|
|
27461
27583
|
active?.scrollIntoView?.({ block: "nearest" });
|
|
27462
27584
|
}, [activeIndex, open]);
|
|
27463
|
-
const select =
|
|
27585
|
+
const select = useCallback46(
|
|
27464
27586
|
(iana) => {
|
|
27465
27587
|
onChange?.(iana);
|
|
27466
27588
|
setOpen(false);
|
|
@@ -27469,7 +27591,7 @@ var TimezonePicker = forwardRef99(
|
|
|
27469
27591
|
},
|
|
27470
27592
|
[onChange]
|
|
27471
27593
|
);
|
|
27472
|
-
const handlePopoverKey =
|
|
27594
|
+
const handlePopoverKey = useCallback46(
|
|
27473
27595
|
(e) => {
|
|
27474
27596
|
if (e.key === "ArrowDown") {
|
|
27475
27597
|
e.preventDefault();
|
|
@@ -27665,13 +27787,13 @@ TimezonePicker.displayName = "TimezonePicker";
|
|
|
27665
27787
|
import { AnimatePresence as AnimatePresence22, motion as motion35 } from "framer-motion";
|
|
27666
27788
|
import {
|
|
27667
27789
|
createContext as createContext2,
|
|
27668
|
-
useCallback as
|
|
27790
|
+
useCallback as useCallback47,
|
|
27669
27791
|
useContext as useContext3,
|
|
27670
27792
|
useMemo as useMemo32,
|
|
27671
27793
|
useRef as useRef51,
|
|
27672
|
-
useState as
|
|
27794
|
+
useState as useState55
|
|
27673
27795
|
} from "react";
|
|
27674
|
-
import { createPortal as
|
|
27796
|
+
import { createPortal as createPortal19 } from "react-dom";
|
|
27675
27797
|
import { Fragment as Fragment46, jsx as jsx119, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
27676
27798
|
var defaultIcons = {
|
|
27677
27799
|
success: /* @__PURE__ */ jsxs112("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
|
|
@@ -27818,8 +27940,8 @@ function ToastBody({ item, onDismiss }) {
|
|
|
27818
27940
|
] });
|
|
27819
27941
|
}
|
|
27820
27942
|
function PositionStack({ items, position, onDismiss, maxStack }) {
|
|
27821
|
-
const [hovered, setHovered] =
|
|
27822
|
-
const [pinned, setPinned] =
|
|
27943
|
+
const [hovered, setHovered] = useState55(false);
|
|
27944
|
+
const [pinned, setPinned] = useState55(false);
|
|
27823
27945
|
const expanded = hovered || pinned;
|
|
27824
27946
|
const ordered = useMemo32(() => [...items].reverse(), [items]);
|
|
27825
27947
|
const isBottom = position.startsWith("bottom");
|
|
@@ -27919,10 +28041,10 @@ function ToastProvider({
|
|
|
27919
28041
|
defaultPosition = "bottom-right",
|
|
27920
28042
|
maxStack = 3
|
|
27921
28043
|
}) {
|
|
27922
|
-
const [toasts, setToasts] =
|
|
28044
|
+
const [toasts, setToasts] = useState55([]);
|
|
27923
28045
|
const timers = useRef51(/* @__PURE__ */ new Map());
|
|
27924
28046
|
const idCounter2 = useRef51(0);
|
|
27925
|
-
const dismiss =
|
|
28047
|
+
const dismiss = useCallback47((id) => {
|
|
27926
28048
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
27927
28049
|
const timer = timers.current.get(id);
|
|
27928
28050
|
if (timer) {
|
|
@@ -27930,7 +28052,7 @@ function ToastProvider({
|
|
|
27930
28052
|
timers.current.delete(id);
|
|
27931
28053
|
}
|
|
27932
28054
|
}, []);
|
|
27933
|
-
const dismissAll =
|
|
28055
|
+
const dismissAll = useCallback47((position) => {
|
|
27934
28056
|
setToasts((prev) => {
|
|
27935
28057
|
const remaining = position ? prev.filter((t) => t.position !== position) : [];
|
|
27936
28058
|
for (const t of prev) {
|
|
@@ -27945,7 +28067,7 @@ function ToastProvider({
|
|
|
27945
28067
|
return remaining;
|
|
27946
28068
|
});
|
|
27947
28069
|
}, []);
|
|
27948
|
-
const toast =
|
|
28070
|
+
const toast = useCallback47(
|
|
27949
28071
|
(options) => {
|
|
27950
28072
|
const id = `toast-${++idCounter2.current}`;
|
|
27951
28073
|
const item = {
|
|
@@ -28001,7 +28123,7 @@ function ToastProvider({
|
|
|
28001
28123
|
}) });
|
|
28002
28124
|
return /* @__PURE__ */ jsxs112(ToastContext.Provider, { value: ctx, children: [
|
|
28003
28125
|
children,
|
|
28004
|
-
typeof document !== "undefined" &&
|
|
28126
|
+
typeof document !== "undefined" && createPortal19(containers, document.body)
|
|
28005
28127
|
] });
|
|
28006
28128
|
}
|
|
28007
28129
|
function useToast() {
|
|
@@ -28020,7 +28142,7 @@ function useToast() {
|
|
|
28020
28142
|
|
|
28021
28143
|
// src/components/Toggle/Toggle.tsx
|
|
28022
28144
|
import {
|
|
28023
|
-
useCallback as
|
|
28145
|
+
useCallback as useCallback48,
|
|
28024
28146
|
useId as useId59,
|
|
28025
28147
|
useRef as useRef52
|
|
28026
28148
|
} from "react";
|
|
@@ -28051,7 +28173,7 @@ function Toggle({
|
|
|
28051
28173
|
const groupLabelledBy = ariaLabelledBy ?? labelId;
|
|
28052
28174
|
const groupAriaLabel = !groupLabelledBy ? ariaLabel ?? "Toggle group" : void 0;
|
|
28053
28175
|
const buttonRefs = useRef52([]);
|
|
28054
|
-
const findNextEnabled =
|
|
28176
|
+
const findNextEnabled = useCallback48(
|
|
28055
28177
|
(from, dir) => {
|
|
28056
28178
|
if (options.length === 0) return -1;
|
|
28057
28179
|
let i = from;
|
|
@@ -28064,11 +28186,11 @@ function Toggle({
|
|
|
28064
28186
|
},
|
|
28065
28187
|
[options, disabled]
|
|
28066
28188
|
);
|
|
28067
|
-
const focusIndex =
|
|
28189
|
+
const focusIndex = useCallback48((i) => {
|
|
28068
28190
|
if (i < 0) return;
|
|
28069
28191
|
buttonRefs.current[i]?.focus();
|
|
28070
28192
|
}, []);
|
|
28071
|
-
const handleKey =
|
|
28193
|
+
const handleKey = useCallback48(
|
|
28072
28194
|
(e, idx) => {
|
|
28073
28195
|
if (e.key === "ArrowRight" || e.key === "ArrowDown") {
|
|
28074
28196
|
e.preventDefault();
|
|
@@ -28436,9 +28558,9 @@ function TopBar({
|
|
|
28436
28558
|
import { AnimatePresence as AnimatePresence23, motion as motion36 } from "framer-motion";
|
|
28437
28559
|
import {
|
|
28438
28560
|
forwardRef as forwardRef101,
|
|
28439
|
-
useCallback as
|
|
28561
|
+
useCallback as useCallback49,
|
|
28440
28562
|
useId as useId61,
|
|
28441
|
-
useState as
|
|
28563
|
+
useState as useState56
|
|
28442
28564
|
} from "react";
|
|
28443
28565
|
import {
|
|
28444
28566
|
BuildToolIcon,
|
|
@@ -28484,11 +28606,11 @@ var TraceStep = forwardRef101(
|
|
|
28484
28606
|
const baseId = providedId ?? `ods-trace-step-${reactId}`;
|
|
28485
28607
|
const headId = `${baseId}-head`;
|
|
28486
28608
|
const contentId = `${baseId}-content`;
|
|
28487
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
28609
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState56(defaultOpen);
|
|
28488
28610
|
const isControlled = controlledOpen !== void 0;
|
|
28489
28611
|
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
28490
28612
|
const canExpand = !!children;
|
|
28491
|
-
const toggle =
|
|
28613
|
+
const toggle = useCallback49(() => {
|
|
28492
28614
|
if (!canExpand) return;
|
|
28493
28615
|
const next = !open;
|
|
28494
28616
|
if (!isControlled) setUncontrolledOpen(next);
|
|
@@ -28630,11 +28752,11 @@ import { ChevronRightIcon as ChevronRightIcon5 } from "@octaviaflow/icons";
|
|
|
28630
28752
|
import { motion as motion37, useReducedMotion as useReducedMotion14 } from "framer-motion";
|
|
28631
28753
|
import {
|
|
28632
28754
|
forwardRef as forwardRef102,
|
|
28633
|
-
useCallback as
|
|
28634
|
-
useEffect as
|
|
28755
|
+
useCallback as useCallback50,
|
|
28756
|
+
useEffect as useEffect44,
|
|
28635
28757
|
useId as useId62,
|
|
28636
28758
|
useMemo as useMemo33,
|
|
28637
|
-
useState as
|
|
28759
|
+
useState as useState57
|
|
28638
28760
|
} from "react";
|
|
28639
28761
|
import { jsx as jsx125, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
28640
28762
|
function buildVisibleList(nodes, expanded, out = [], level = 0, parentId = null) {
|
|
@@ -28666,17 +28788,17 @@ var TreeView = forwardRef102(
|
|
|
28666
28788
|
const reactId = useId62();
|
|
28667
28789
|
const baseId = providedId ?? `ods-tree-${reactId}`;
|
|
28668
28790
|
const reducedMotion = useReducedMotion14();
|
|
28669
|
-
const [internalSelected, setInternalSelected] =
|
|
28791
|
+
const [internalSelected, setInternalSelected] = useState57(defaultSelectedId);
|
|
28670
28792
|
const isSelectedControlled = controlledSelected !== void 0;
|
|
28671
28793
|
const selectedId = isSelectedControlled ? controlledSelected : internalSelected;
|
|
28672
|
-
const [internalExpanded, setInternalExpanded] =
|
|
28794
|
+
const [internalExpanded, setInternalExpanded] = useState57(
|
|
28673
28795
|
() => new Set(defaultExpandedIds ?? [])
|
|
28674
28796
|
);
|
|
28675
28797
|
const isExpandedControlled = controlledExpanded !== void 0;
|
|
28676
28798
|
const expandedSet = isExpandedControlled ? controlledExpanded : internalExpanded;
|
|
28677
|
-
const [loaded, setLoaded] =
|
|
28678
|
-
const [loading, setLoading] =
|
|
28679
|
-
const resolveChildren =
|
|
28799
|
+
const [loaded, setLoaded] = useState57({});
|
|
28800
|
+
const [loading, setLoading] = useState57(/* @__PURE__ */ new Set());
|
|
28801
|
+
const resolveChildren = useCallback50(
|
|
28680
28802
|
(node) => node.children ?? loaded[node.id],
|
|
28681
28803
|
[loaded]
|
|
28682
28804
|
);
|
|
@@ -28692,14 +28814,14 @@ var TreeView = forwardRef102(
|
|
|
28692
28814
|
() => buildVisibleList(resolvedNodes, expandedSet),
|
|
28693
28815
|
[resolvedNodes, expandedSet]
|
|
28694
28816
|
);
|
|
28695
|
-
const setExpanded =
|
|
28817
|
+
const setExpanded = useCallback50(
|
|
28696
28818
|
(next) => {
|
|
28697
28819
|
if (!isExpandedControlled) setInternalExpanded(new Set(next));
|
|
28698
28820
|
onExpandedChange?.(new Set(next));
|
|
28699
28821
|
},
|
|
28700
28822
|
[isExpandedControlled, onExpandedChange]
|
|
28701
28823
|
);
|
|
28702
|
-
const toggleExpand =
|
|
28824
|
+
const toggleExpand = useCallback50(
|
|
28703
28825
|
async (node) => {
|
|
28704
28826
|
const next = new Set(expandedSet);
|
|
28705
28827
|
const isOpen = next.has(node.id);
|
|
@@ -28728,7 +28850,7 @@ var TreeView = forwardRef102(
|
|
|
28728
28850
|
},
|
|
28729
28851
|
[expandedSet, setExpanded, onLoadChildren, loaded, loading]
|
|
28730
28852
|
);
|
|
28731
|
-
const handleSelect =
|
|
28853
|
+
const handleSelect = useCallback50(
|
|
28732
28854
|
(node) => {
|
|
28733
28855
|
if (node.disabled || disabled) return;
|
|
28734
28856
|
if (!isSelectedControlled) setInternalSelected(node.id);
|
|
@@ -28903,7 +29025,7 @@ var TreeView = forwardRef102(
|
|
|
28903
29025
|
);
|
|
28904
29026
|
};
|
|
28905
29027
|
const visibleIdxCursor = { value: 0 };
|
|
28906
|
-
|
|
29028
|
+
useEffect44(() => {
|
|
28907
29029
|
}, [tabStopId]);
|
|
28908
29030
|
return /* @__PURE__ */ jsx125(
|
|
28909
29031
|
"ul",
|
|
@@ -29053,10 +29175,10 @@ var UserCard = forwardRef103(
|
|
|
29053
29175
|
UserCard.displayName = "UserCard";
|
|
29054
29176
|
|
|
29055
29177
|
// src/components/WorkflowEditor/WorkflowEditor.tsx
|
|
29056
|
-
import { useCallback as
|
|
29178
|
+
import { useCallback as useCallback52, useMemo as useMemo35, useState as useState58 } from "react";
|
|
29057
29179
|
|
|
29058
29180
|
// src/hooks/useWorkflow.ts
|
|
29059
|
-
import { useCallback as
|
|
29181
|
+
import { useCallback as useCallback51, useMemo as useMemo34, useReducer } from "react";
|
|
29060
29182
|
|
|
29061
29183
|
// src/workflow/types.ts
|
|
29062
29184
|
var types_exports = {};
|
|
@@ -29570,11 +29692,11 @@ function useWorkflow(options = {}) {
|
|
|
29570
29692
|
[]
|
|
29571
29693
|
);
|
|
29572
29694
|
const [workflow, dispatch] = useReducer(reducer, initial);
|
|
29573
|
-
const addNode =
|
|
29695
|
+
const addNode = useCallback51(
|
|
29574
29696
|
(node) => dispatch({ type: "ADD_NODE", payload: node }),
|
|
29575
29697
|
[]
|
|
29576
29698
|
);
|
|
29577
|
-
const createNode =
|
|
29699
|
+
const createNode = useCallback51(
|
|
29578
29700
|
(partial) => {
|
|
29579
29701
|
const id = partial.id ?? genId("node");
|
|
29580
29702
|
const ports = partial.ports ?? {
|
|
@@ -29623,27 +29745,27 @@ function useWorkflow(options = {}) {
|
|
|
29623
29745
|
},
|
|
29624
29746
|
[]
|
|
29625
29747
|
);
|
|
29626
|
-
const updateNode =
|
|
29748
|
+
const updateNode = useCallback51(
|
|
29627
29749
|
(id, updates) => dispatch({ type: "UPDATE_NODE", payload: { id, updates } }),
|
|
29628
29750
|
[]
|
|
29629
29751
|
);
|
|
29630
|
-
const deleteNode =
|
|
29752
|
+
const deleteNode = useCallback51(
|
|
29631
29753
|
(id) => dispatch({ type: "DELETE_NODE", payload: id }),
|
|
29632
29754
|
[]
|
|
29633
29755
|
);
|
|
29634
|
-
const deleteNodes =
|
|
29756
|
+
const deleteNodes = useCallback51(
|
|
29635
29757
|
(ids) => dispatch({ type: "DELETE_NODES", payload: ids }),
|
|
29636
29758
|
[]
|
|
29637
29759
|
);
|
|
29638
|
-
const replaceNodes =
|
|
29760
|
+
const replaceNodes = useCallback51(
|
|
29639
29761
|
(nodes) => dispatch({ type: "REPLACE_NODES", payload: nodes }),
|
|
29640
29762
|
[]
|
|
29641
29763
|
);
|
|
29642
|
-
const addEdge =
|
|
29764
|
+
const addEdge = useCallback51(
|
|
29643
29765
|
(edge) => dispatch({ type: "ADD_EDGE", payload: edge }),
|
|
29644
29766
|
[]
|
|
29645
29767
|
);
|
|
29646
|
-
const createEdge =
|
|
29768
|
+
const createEdge = useCallback51(
|
|
29647
29769
|
(source, sourcePort, target, targetPort) => {
|
|
29648
29770
|
const edge = {
|
|
29649
29771
|
id: genId("edge"),
|
|
@@ -29661,20 +29783,20 @@ function useWorkflow(options = {}) {
|
|
|
29661
29783
|
},
|
|
29662
29784
|
[]
|
|
29663
29785
|
);
|
|
29664
|
-
const deleteEdge =
|
|
29786
|
+
const deleteEdge = useCallback51(
|
|
29665
29787
|
(id) => dispatch({ type: "DELETE_EDGE", payload: id }),
|
|
29666
29788
|
[]
|
|
29667
29789
|
);
|
|
29668
|
-
const replaceEdges =
|
|
29790
|
+
const replaceEdges = useCallback51(
|
|
29669
29791
|
(edges) => dispatch({ type: "REPLACE_EDGES", payload: edges }),
|
|
29670
29792
|
[]
|
|
29671
29793
|
);
|
|
29672
|
-
const startConnecting =
|
|
29794
|
+
const startConnecting = useCallback51(
|
|
29673
29795
|
(nodeId, portId, portType) => dispatch({ type: "START_CONNECTING", payload: { nodeId, portId, portType } }),
|
|
29674
29796
|
[]
|
|
29675
29797
|
);
|
|
29676
|
-
const endConnecting =
|
|
29677
|
-
const selectNode =
|
|
29798
|
+
const endConnecting = useCallback51(() => dispatch({ type: "END_CONNECTING" }), []);
|
|
29799
|
+
const selectNode = useCallback51(
|
|
29678
29800
|
(id, multi = false) => {
|
|
29679
29801
|
if (multi) {
|
|
29680
29802
|
const current = workflow.canvas.selectedNodes;
|
|
@@ -29686,36 +29808,36 @@ function useWorkflow(options = {}) {
|
|
|
29686
29808
|
},
|
|
29687
29809
|
[workflow.canvas.selectedNodes]
|
|
29688
29810
|
);
|
|
29689
|
-
const selectNodes =
|
|
29811
|
+
const selectNodes = useCallback51(
|
|
29690
29812
|
(ids) => dispatch({ type: "SELECT_NODES", payload: ids }),
|
|
29691
29813
|
[]
|
|
29692
29814
|
);
|
|
29693
|
-
const selectEdge =
|
|
29815
|
+
const selectEdge = useCallback51(
|
|
29694
29816
|
(id) => dispatch({ type: "SELECT_EDGE", payload: id }),
|
|
29695
29817
|
[]
|
|
29696
29818
|
);
|
|
29697
|
-
const deselectAll =
|
|
29698
|
-
const zoomIn =
|
|
29819
|
+
const deselectAll = useCallback51(() => dispatch({ type: "DESELECT_ALL" }), []);
|
|
29820
|
+
const zoomIn = useCallback51(() => {
|
|
29699
29821
|
const z = Math.min(workflow.canvas.viewport.zoom * 1.2, 2);
|
|
29700
29822
|
dispatch({ type: "UPDATE_VIEWPORT", payload: { zoom: z } });
|
|
29701
29823
|
}, [workflow.canvas.viewport.zoom]);
|
|
29702
|
-
const zoomOut =
|
|
29824
|
+
const zoomOut = useCallback51(() => {
|
|
29703
29825
|
const z = Math.max(workflow.canvas.viewport.zoom / 1.2, 0.25);
|
|
29704
29826
|
dispatch({ type: "UPDATE_VIEWPORT", payload: { zoom: z } });
|
|
29705
29827
|
}, [workflow.canvas.viewport.zoom]);
|
|
29706
|
-
const resetViewport =
|
|
29828
|
+
const resetViewport = useCallback51(
|
|
29707
29829
|
() => dispatch({ type: "UPDATE_VIEWPORT", payload: { x: 0, y: 0, zoom: 1 } }),
|
|
29708
29830
|
[]
|
|
29709
29831
|
);
|
|
29710
|
-
const setViewport =
|
|
29832
|
+
const setViewport = useCallback51(
|
|
29711
29833
|
(viewport) => dispatch({ type: "UPDATE_VIEWPORT", payload: viewport }),
|
|
29712
29834
|
[]
|
|
29713
29835
|
);
|
|
29714
|
-
const undo =
|
|
29715
|
-
const redo =
|
|
29836
|
+
const undo = useCallback51(() => dispatch({ type: "UNDO" }), []);
|
|
29837
|
+
const redo = useCallback51(() => dispatch({ type: "REDO" }), []);
|
|
29716
29838
|
const canUndo = workflow.canvas.history.past.length > 0;
|
|
29717
29839
|
const canRedo = workflow.canvas.history.future.length > 0;
|
|
29718
|
-
const validate =
|
|
29840
|
+
const validate = useCallback51(() => workflow.validation, [workflow.validation]);
|
|
29719
29841
|
return {
|
|
29720
29842
|
workflow,
|
|
29721
29843
|
dispatch,
|
|
@@ -29821,35 +29943,35 @@ function WorkflowEditor({
|
|
|
29821
29943
|
}) {
|
|
29822
29944
|
const wf = useWorkflow(options);
|
|
29823
29945
|
const { workflow, dispatch, canUndo, canRedo, undo, redo } = wf;
|
|
29824
|
-
const [uncontrolledLock, setUncontrolledLock] =
|
|
29825
|
-
const [uncontrolledDrawer, setUncontrolledDrawer] =
|
|
29826
|
-
const [uncontrolledHistory, setUncontrolledHistory] =
|
|
29827
|
-
const [uncontrolledDebug, setUncontrolledDebug] =
|
|
29946
|
+
const [uncontrolledLock, setUncontrolledLock] = useState58(false);
|
|
29947
|
+
const [uncontrolledDrawer, setUncontrolledDrawer] = useState58(!!drawer);
|
|
29948
|
+
const [uncontrolledHistory, setUncontrolledHistory] = useState58(false);
|
|
29949
|
+
const [uncontrolledDebug, setUncontrolledDebug] = useState58(false);
|
|
29828
29950
|
const isLockMode = controlledLockMode ?? uncontrolledLock;
|
|
29829
29951
|
const isDrawerOpen = controlledDrawerOpen ?? uncontrolledDrawer;
|
|
29830
29952
|
const isHistoryOpen = controlledHistoryOpen ?? uncontrolledHistory;
|
|
29831
29953
|
const isDebugOpen = controlledDebugOpen ?? uncontrolledDebug;
|
|
29832
|
-
const toggleLock =
|
|
29954
|
+
const toggleLock = useCallback52(() => {
|
|
29833
29955
|
const next = !isLockMode;
|
|
29834
29956
|
if (controlledLockMode === void 0) setUncontrolledLock(next);
|
|
29835
29957
|
onToggleLockMode?.(next);
|
|
29836
29958
|
}, [isLockMode, controlledLockMode, onToggleLockMode]);
|
|
29837
|
-
const toggleDrawer =
|
|
29959
|
+
const toggleDrawer = useCallback52(() => {
|
|
29838
29960
|
const next = !isDrawerOpen;
|
|
29839
29961
|
if (controlledDrawerOpen === void 0) setUncontrolledDrawer(next);
|
|
29840
29962
|
onToggleDrawer?.(next);
|
|
29841
29963
|
}, [isDrawerOpen, controlledDrawerOpen, onToggleDrawer]);
|
|
29842
|
-
const toggleHistory =
|
|
29964
|
+
const toggleHistory = useCallback52(() => {
|
|
29843
29965
|
const next = !isHistoryOpen;
|
|
29844
29966
|
if (controlledHistoryOpen === void 0) setUncontrolledHistory(next);
|
|
29845
29967
|
onToggleHistory?.(next);
|
|
29846
29968
|
}, [isHistoryOpen, controlledHistoryOpen, onToggleHistory]);
|
|
29847
|
-
const toggleDebug =
|
|
29969
|
+
const toggleDebug = useCallback52(() => {
|
|
29848
29970
|
const next = !isDebugOpen;
|
|
29849
29971
|
if (controlledDebugOpen === void 0) setUncontrolledDebug(next);
|
|
29850
29972
|
onToggleDebug?.(next);
|
|
29851
29973
|
}, [isDebugOpen, controlledDebugOpen, onToggleDebug]);
|
|
29852
|
-
const handleReset =
|
|
29974
|
+
const handleReset = useCallback52(() => {
|
|
29853
29975
|
if (onReset) onReset();
|
|
29854
29976
|
else dispatch({ type: "RESET" });
|
|
29855
29977
|
}, [onReset, dispatch]);
|
|
@@ -29858,7 +29980,7 @@ function WorkflowEditor({
|
|
|
29858
29980
|
[workflow.canvas.nodes]
|
|
29859
29981
|
);
|
|
29860
29982
|
const nextEdges = useMemo35(() => workflow.canvas.edges.map(toNextEdge), [workflow.canvas.edges]);
|
|
29861
|
-
const onNodesChange =
|
|
29983
|
+
const onNodesChange = useCallback52(
|
|
29862
29984
|
(changes) => {
|
|
29863
29985
|
const reduced = applyNodeChanges(
|
|
29864
29986
|
nextNodes,
|
|
@@ -29899,7 +30021,7 @@ function WorkflowEditor({
|
|
|
29899
30021
|
},
|
|
29900
30022
|
[nextNodes, workflow.canvas.nodes, wf, onNodeSelect]
|
|
29901
30023
|
);
|
|
29902
|
-
const onEdgesChange =
|
|
30024
|
+
const onEdgesChange = useCallback52(
|
|
29903
30025
|
(changes) => {
|
|
29904
30026
|
const reduced = applyEdgeChanges(nextEdges, changes);
|
|
29905
30027
|
const byId = new Map(reduced.map((e) => [e.id, e]));
|
|
@@ -29909,18 +30031,18 @@ function WorkflowEditor({
|
|
|
29909
30031
|
},
|
|
29910
30032
|
[nextEdges, workflow.canvas.edges, wf]
|
|
29911
30033
|
);
|
|
29912
|
-
const onConnect =
|
|
30034
|
+
const onConnect = useCallback52(
|
|
29913
30035
|
(c) => {
|
|
29914
30036
|
wf.createEdge(c.source, c.sourceHandle ?? "default", c.target, c.targetHandle ?? "default");
|
|
29915
30037
|
},
|
|
29916
30038
|
[wf]
|
|
29917
30039
|
);
|
|
29918
|
-
const [canvasSize, setCanvasSize] =
|
|
29919
|
-
const handleCanvasRef =
|
|
30040
|
+
const [canvasSize, setCanvasSize] = useState58({ w: 0, h: 0 });
|
|
30041
|
+
const handleCanvasRef = useCallback52((node) => {
|
|
29920
30042
|
if (!node) return;
|
|
29921
30043
|
setCanvasSize({ w: node.clientWidth, h: node.clientHeight });
|
|
29922
30044
|
}, []);
|
|
29923
|
-
const fitToView =
|
|
30045
|
+
const fitToView = useCallback52(() => {
|
|
29924
30046
|
const nodes = workflow.canvas.nodes;
|
|
29925
30047
|
if (nodes.length === 0) return;
|
|
29926
30048
|
let minX = Infinity;
|
|
@@ -30163,7 +30285,7 @@ import {
|
|
|
30163
30285
|
} from "@octaviaflow/icons";
|
|
30164
30286
|
|
|
30165
30287
|
// src/hooks/useRelativeTime.ts
|
|
30166
|
-
import { useEffect as
|
|
30288
|
+
import { useEffect as useEffect45, useState as useState59 } from "react";
|
|
30167
30289
|
function toMs(t) {
|
|
30168
30290
|
if (t == null) return null;
|
|
30169
30291
|
return typeof t === "number" ? t : t.getTime();
|
|
@@ -30182,8 +30304,8 @@ function formatRelativeTime(when, now2 = Date.now()) {
|
|
|
30182
30304
|
}
|
|
30183
30305
|
function useRelativeTime(date, options = {}) {
|
|
30184
30306
|
const { intervalMs = 3e4 } = options;
|
|
30185
|
-
const [now2, setNow] =
|
|
30186
|
-
|
|
30307
|
+
const [now2, setNow] = useState59(() => Date.now());
|
|
30308
|
+
useEffect45(() => {
|
|
30187
30309
|
if (typeof window === "undefined") return;
|
|
30188
30310
|
const id = window.setInterval(() => setNow(Date.now()), intervalMs);
|
|
30189
30311
|
return () => window.clearInterval(id);
|
|
@@ -30192,7 +30314,7 @@ function useRelativeTime(date, options = {}) {
|
|
|
30192
30314
|
}
|
|
30193
30315
|
|
|
30194
30316
|
// src/hooks/useWorkflowRuntime.ts
|
|
30195
|
-
import { useEffect as
|
|
30317
|
+
import { useEffect as useEffect46, useState as useState60 } from "react";
|
|
30196
30318
|
function toMs2(t) {
|
|
30197
30319
|
if (t == null) return null;
|
|
30198
30320
|
return typeof t === "number" ? t : t.getTime();
|
|
@@ -30206,8 +30328,8 @@ function formatWorkflowRuntime(ms) {
|
|
|
30206
30328
|
return h > 0 ? `${h}:${pad2(m)}:${pad2(sec)}` : `${pad2(m)}:${pad2(sec)}`;
|
|
30207
30329
|
}
|
|
30208
30330
|
function useWorkflowRuntime(startedAt, active) {
|
|
30209
|
-
const [, force] =
|
|
30210
|
-
|
|
30331
|
+
const [, force] = useState60(0);
|
|
30332
|
+
useEffect46(() => {
|
|
30211
30333
|
if (!active || startedAt == null) return;
|
|
30212
30334
|
if (typeof window === "undefined") return;
|
|
30213
30335
|
const id = window.setInterval(() => force((n) => n + 1), 1e3);
|
|
@@ -30576,11 +30698,11 @@ import {
|
|
|
30576
30698
|
import { XMLValidator } from "fast-xml-parser";
|
|
30577
30699
|
import {
|
|
30578
30700
|
forwardRef as forwardRef104,
|
|
30579
|
-
useCallback as
|
|
30580
|
-
useEffect as
|
|
30701
|
+
useCallback as useCallback53,
|
|
30702
|
+
useEffect as useEffect47,
|
|
30581
30703
|
useId as useId64,
|
|
30582
30704
|
useMemo as useMemo36,
|
|
30583
|
-
useState as
|
|
30705
|
+
useState as useState61
|
|
30584
30706
|
} from "react";
|
|
30585
30707
|
import { Fragment as Fragment50, jsx as jsx130, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
30586
30708
|
function parseXml(src) {
|
|
@@ -30711,8 +30833,8 @@ var XmlViewer = forwardRef104(
|
|
|
30711
30833
|
);
|
|
30712
30834
|
XmlViewer.displayName = "XmlViewer";
|
|
30713
30835
|
function XmlEditBody({ text: initial, onChange, onValidate }) {
|
|
30714
|
-
const [text, setText] =
|
|
30715
|
-
const [parseError, setParseError] =
|
|
30836
|
+
const [text, setText] = useState61(initial);
|
|
30837
|
+
const [parseError, setParseError] = useState61(null);
|
|
30716
30838
|
const validate = (next) => {
|
|
30717
30839
|
const result = XMLValidator.validate(next);
|
|
30718
30840
|
if (result === true) {
|
|
@@ -30734,7 +30856,7 @@ function XmlEditBody({ text: initial, onChange, onValidate }) {
|
|
|
30734
30856
|
onChange?.(next);
|
|
30735
30857
|
validate(next);
|
|
30736
30858
|
};
|
|
30737
|
-
|
|
30859
|
+
useEffect47(() => {
|
|
30738
30860
|
validate(initial);
|
|
30739
30861
|
}, []);
|
|
30740
30862
|
return /* @__PURE__ */ jsxs123("div", { className: "ods-xml-viewer__edit", children: [
|
|
@@ -30775,10 +30897,10 @@ function XmlNodeRow({
|
|
|
30775
30897
|
truncateAt,
|
|
30776
30898
|
copyable
|
|
30777
30899
|
}) {
|
|
30778
|
-
const [open, setOpen] =
|
|
30779
|
-
const [copied, setCopied] =
|
|
30900
|
+
const [open, setOpen] = useState61(depth < defaultExpandDepth);
|
|
30901
|
+
const [copied, setCopied] = useState61(false);
|
|
30780
30902
|
const pad2 = depth * 14;
|
|
30781
|
-
const onCopy =
|
|
30903
|
+
const onCopy = useCallback53(
|
|
30782
30904
|
(e) => {
|
|
30783
30905
|
e.stopPropagation();
|
|
30784
30906
|
const text = serializeNode(node);
|
|
@@ -30962,11 +31084,11 @@ import {
|
|
|
30962
31084
|
} from "@octaviaflow/icons";
|
|
30963
31085
|
import {
|
|
30964
31086
|
forwardRef as forwardRef105,
|
|
30965
|
-
useCallback as
|
|
30966
|
-
useEffect as
|
|
31087
|
+
useCallback as useCallback54,
|
|
31088
|
+
useEffect as useEffect48,
|
|
30967
31089
|
useId as useId65,
|
|
30968
31090
|
useMemo as useMemo37,
|
|
30969
|
-
useState as
|
|
31091
|
+
useState as useState62
|
|
30970
31092
|
} from "react";
|
|
30971
31093
|
import YAML from "yaml";
|
|
30972
31094
|
import { Fragment as Fragment51, jsx as jsx131, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
@@ -31123,14 +31245,14 @@ var YamlViewer = forwardRef105(
|
|
|
31123
31245
|
}
|
|
31124
31246
|
}, [data]);
|
|
31125
31247
|
const tokens = useMemo37(() => tokenizeYaml(text), [text]);
|
|
31126
|
-
const [collapsed, setCollapsed] =
|
|
31248
|
+
const [collapsed, setCollapsed] = useState62(() => {
|
|
31127
31249
|
const s = /* @__PURE__ */ new Set();
|
|
31128
31250
|
tokens.forEach((t) => {
|
|
31129
31251
|
if (t.hasChildren && t.depth >= defaultExpandDepth) s.add(t.index);
|
|
31130
31252
|
});
|
|
31131
31253
|
return s;
|
|
31132
31254
|
});
|
|
31133
|
-
const toggle =
|
|
31255
|
+
const toggle = useCallback54((idx) => {
|
|
31134
31256
|
setCollapsed((prev) => {
|
|
31135
31257
|
const next = new Set(prev);
|
|
31136
31258
|
if (next.has(idx)) next.delete(idx);
|
|
@@ -31153,8 +31275,8 @@ var YamlViewer = forwardRef105(
|
|
|
31153
31275
|
}
|
|
31154
31276
|
return hide;
|
|
31155
31277
|
}, [tokens, collapsed]);
|
|
31156
|
-
const [copied, setCopied] =
|
|
31157
|
-
const onCopy =
|
|
31278
|
+
const [copied, setCopied] = useState62(false);
|
|
31279
|
+
const onCopy = useCallback54(() => {
|
|
31158
31280
|
if (!navigator?.clipboard?.writeText) return;
|
|
31159
31281
|
navigator.clipboard.writeText(text).then(
|
|
31160
31282
|
() => {
|
|
@@ -31320,8 +31442,8 @@ function extractYamlErrorPosition(err, text) {
|
|
|
31320
31442
|
return { line: 1, col: 1, message };
|
|
31321
31443
|
}
|
|
31322
31444
|
function YamlEditBody({ text: initial, onChange, onValidate }) {
|
|
31323
|
-
const [text, setText] =
|
|
31324
|
-
const [parseError, setParseError] =
|
|
31445
|
+
const [text, setText] = useState62(initial);
|
|
31446
|
+
const [parseError, setParseError] = useState62(null);
|
|
31325
31447
|
const validate = (next) => {
|
|
31326
31448
|
try {
|
|
31327
31449
|
YAML.parse(next);
|
|
@@ -31338,7 +31460,7 @@ function YamlEditBody({ text: initial, onChange, onValidate }) {
|
|
|
31338
31460
|
onChange?.(next);
|
|
31339
31461
|
validate(next);
|
|
31340
31462
|
};
|
|
31341
|
-
|
|
31463
|
+
useEffect48(() => {
|
|
31342
31464
|
validate(initial);
|
|
31343
31465
|
}, []);
|
|
31344
31466
|
return /* @__PURE__ */ jsxs124("div", { className: "ods-yaml-viewer__edit", children: [
|
|
@@ -31373,29 +31495,29 @@ function YamlEditBody({ text: initial, onChange, onValidate }) {
|
|
|
31373
31495
|
}
|
|
31374
31496
|
|
|
31375
31497
|
// src/hooks/useBanner.ts
|
|
31376
|
-
import { useCallback as
|
|
31498
|
+
import { useCallback as useCallback55, useEffect as useEffect49, useRef as useRef53, useState as useState63 } from "react";
|
|
31377
31499
|
function useBanner(options = {}) {
|
|
31378
31500
|
const { defaultOpen = false, autoDismissAfter, onDismiss } = options;
|
|
31379
|
-
const [open, setOpen] =
|
|
31501
|
+
const [open, setOpen] = useState63(defaultOpen);
|
|
31380
31502
|
const timerRef = useRef53(null);
|
|
31381
31503
|
const onDismissRef = useRef53(onDismiss);
|
|
31382
|
-
|
|
31504
|
+
useEffect49(() => {
|
|
31383
31505
|
onDismissRef.current = onDismiss;
|
|
31384
31506
|
}, [onDismiss]);
|
|
31385
|
-
const clearTimer =
|
|
31507
|
+
const clearTimer = useCallback55(() => {
|
|
31386
31508
|
if (timerRef.current !== null) {
|
|
31387
31509
|
clearTimeout(timerRef.current);
|
|
31388
31510
|
timerRef.current = null;
|
|
31389
31511
|
}
|
|
31390
31512
|
}, []);
|
|
31391
|
-
const hide =
|
|
31513
|
+
const hide = useCallback55(() => {
|
|
31392
31514
|
clearTimer();
|
|
31393
31515
|
setOpen((wasOpen) => {
|
|
31394
31516
|
if (wasOpen) onDismissRef.current?.();
|
|
31395
31517
|
return false;
|
|
31396
31518
|
});
|
|
31397
31519
|
}, [clearTimer]);
|
|
31398
|
-
const show =
|
|
31520
|
+
const show = useCallback55(() => {
|
|
31399
31521
|
clearTimer();
|
|
31400
31522
|
setOpen(true);
|
|
31401
31523
|
if (typeof autoDismissAfter === "number" && Number.isFinite(autoDismissAfter) && autoDismissAfter > 0) {
|
|
@@ -31406,11 +31528,11 @@ function useBanner(options = {}) {
|
|
|
31406
31528
|
}, autoDismissAfter);
|
|
31407
31529
|
}
|
|
31408
31530
|
}, [autoDismissAfter, clearTimer]);
|
|
31409
|
-
const toggle =
|
|
31531
|
+
const toggle = useCallback55(() => {
|
|
31410
31532
|
if (open) hide();
|
|
31411
31533
|
else show();
|
|
31412
31534
|
}, [open, show, hide]);
|
|
31413
|
-
|
|
31535
|
+
useEffect49(() => () => clearTimer(), [clearTimer]);
|
|
31414
31536
|
return {
|
|
31415
31537
|
open,
|
|
31416
31538
|
show,
|
|
@@ -31421,7 +31543,7 @@ function useBanner(options = {}) {
|
|
|
31421
31543
|
}
|
|
31422
31544
|
|
|
31423
31545
|
// src/hooks/useCallout.ts
|
|
31424
|
-
import { useCallback as
|
|
31546
|
+
import { useCallback as useCallback56, useEffect as useEffect50, useState as useState64 } from "react";
|
|
31425
31547
|
var STORAGE_PREFIX = "ods:callout:dismissed:";
|
|
31426
31548
|
function readPersisted(key) {
|
|
31427
31549
|
if (!key || typeof window === "undefined") return false;
|
|
@@ -31444,13 +31566,13 @@ function writePersisted(key, value) {
|
|
|
31444
31566
|
}
|
|
31445
31567
|
function useCallout(options = {}) {
|
|
31446
31568
|
const { defaultOpen = true, persistKey, onDismiss } = options;
|
|
31447
|
-
const [open, setOpen] =
|
|
31448
|
-
|
|
31569
|
+
const [open, setOpen] = useState64(defaultOpen);
|
|
31570
|
+
useEffect50(() => {
|
|
31449
31571
|
if (persistKey && readPersisted(persistKey)) {
|
|
31450
31572
|
setOpen(false);
|
|
31451
31573
|
}
|
|
31452
31574
|
}, []);
|
|
31453
|
-
const dismiss =
|
|
31575
|
+
const dismiss = useCallback56(() => {
|
|
31454
31576
|
setOpen((wasOpen) => {
|
|
31455
31577
|
if (wasOpen) {
|
|
31456
31578
|
writePersisted(persistKey, true);
|
|
@@ -31459,10 +31581,10 @@ function useCallout(options = {}) {
|
|
|
31459
31581
|
return false;
|
|
31460
31582
|
});
|
|
31461
31583
|
}, [persistKey, onDismiss]);
|
|
31462
|
-
const show =
|
|
31584
|
+
const show = useCallback56(() => {
|
|
31463
31585
|
setOpen(true);
|
|
31464
31586
|
}, []);
|
|
31465
|
-
const toggle =
|
|
31587
|
+
const toggle = useCallback56(() => {
|
|
31466
31588
|
setOpen((prev) => {
|
|
31467
31589
|
const next = !prev;
|
|
31468
31590
|
if (!next) {
|
|
@@ -31472,7 +31594,7 @@ function useCallout(options = {}) {
|
|
|
31472
31594
|
return next;
|
|
31473
31595
|
});
|
|
31474
31596
|
}, [persistKey, onDismiss]);
|
|
31475
|
-
const reset =
|
|
31597
|
+
const reset = useCallback56(() => {
|
|
31476
31598
|
writePersisted(persistKey, false);
|
|
31477
31599
|
setOpen(true);
|
|
31478
31600
|
}, [persistKey]);
|
|
@@ -31545,7 +31667,7 @@ function breakpointMinWidth(name) {
|
|
|
31545
31667
|
}
|
|
31546
31668
|
|
|
31547
31669
|
// src/hooks/useRating.ts
|
|
31548
|
-
import { useCallback as
|
|
31670
|
+
import { useCallback as useCallback57, useState as useState65 } from "react";
|
|
31549
31671
|
function useRating({
|
|
31550
31672
|
value: controlled,
|
|
31551
31673
|
defaultValue = 0,
|
|
@@ -31553,14 +31675,14 @@ function useRating({
|
|
|
31553
31675
|
step = 1,
|
|
31554
31676
|
onChange
|
|
31555
31677
|
} = {}) {
|
|
31556
|
-
const [internal, setInternal] =
|
|
31678
|
+
const [internal, setInternal] = useState65(defaultValue);
|
|
31557
31679
|
const value = controlled ?? internal;
|
|
31558
31680
|
const isControlled = controlled !== void 0;
|
|
31559
|
-
const clamp =
|
|
31681
|
+
const clamp = useCallback57(
|
|
31560
31682
|
(v) => Math.max(0, Math.min(max, v)),
|
|
31561
31683
|
[max]
|
|
31562
31684
|
);
|
|
31563
|
-
const set =
|
|
31685
|
+
const set = useCallback57(
|
|
31564
31686
|
(next) => {
|
|
31565
31687
|
const clamped = clamp(next);
|
|
31566
31688
|
if (!isControlled) setInternal(clamped);
|
|
@@ -31582,10 +31704,10 @@ function useBinaryRating({
|
|
|
31582
31704
|
defaultValue = null,
|
|
31583
31705
|
onChange
|
|
31584
31706
|
} = {}) {
|
|
31585
|
-
const [internal, setInternal] =
|
|
31707
|
+
const [internal, setInternal] = useState65(defaultValue);
|
|
31586
31708
|
const value = controlled ?? internal;
|
|
31587
31709
|
const isControlled = controlled !== void 0;
|
|
31588
|
-
const set =
|
|
31710
|
+
const set = useCallback57(
|
|
31589
31711
|
(next) => {
|
|
31590
31712
|
if (!isControlled) setInternal(next);
|
|
31591
31713
|
onChange?.(next);
|
|
@@ -31604,30 +31726,30 @@ function useBinaryRating({
|
|
|
31604
31726
|
}
|
|
31605
31727
|
|
|
31606
31728
|
// src/hooks/useTimeline.ts
|
|
31607
|
-
import { useCallback as
|
|
31729
|
+
import { useCallback as useCallback58, useState as useState66 } from "react";
|
|
31608
31730
|
function useTimeline({
|
|
31609
31731
|
items: controlled,
|
|
31610
31732
|
defaultItems = [],
|
|
31611
31733
|
onChange
|
|
31612
31734
|
} = {}) {
|
|
31613
|
-
const [internal, setInternal] =
|
|
31735
|
+
const [internal, setInternal] = useState66(defaultItems);
|
|
31614
31736
|
const items = controlled ?? internal;
|
|
31615
31737
|
const isControlled = controlled !== void 0;
|
|
31616
|
-
const commit =
|
|
31738
|
+
const commit = useCallback58(
|
|
31617
31739
|
(next) => {
|
|
31618
31740
|
if (!isControlled) setInternal(next);
|
|
31619
31741
|
onChange?.(next);
|
|
31620
31742
|
},
|
|
31621
31743
|
[isControlled, onChange]
|
|
31622
31744
|
);
|
|
31623
|
-
const add =
|
|
31745
|
+
const add = useCallback58(
|
|
31624
31746
|
(item) => {
|
|
31625
31747
|
if (items.some((i) => i.id === item.id)) return;
|
|
31626
31748
|
commit([...items, item]);
|
|
31627
31749
|
},
|
|
31628
31750
|
[items, commit]
|
|
31629
31751
|
);
|
|
31630
|
-
const insert =
|
|
31752
|
+
const insert = useCallback58(
|
|
31631
31753
|
(index, item) => {
|
|
31632
31754
|
if (items.some((i) => i.id === item.id)) return;
|
|
31633
31755
|
const at = Math.max(0, Math.min(items.length, index));
|
|
@@ -31637,7 +31759,7 @@ function useTimeline({
|
|
|
31637
31759
|
},
|
|
31638
31760
|
[items, commit]
|
|
31639
31761
|
);
|
|
31640
|
-
const remove =
|
|
31762
|
+
const remove = useCallback58(
|
|
31641
31763
|
(id) => {
|
|
31642
31764
|
const next = items.filter((i) => i.id !== id);
|
|
31643
31765
|
if (next.length === items.length) return;
|
|
@@ -31645,7 +31767,7 @@ function useTimeline({
|
|
|
31645
31767
|
},
|
|
31646
31768
|
[items, commit]
|
|
31647
31769
|
);
|
|
31648
|
-
const update =
|
|
31770
|
+
const update = useCallback58(
|
|
31649
31771
|
(id, patch) => {
|
|
31650
31772
|
let changed = false;
|
|
31651
31773
|
const next = items.map((i) => {
|
|
@@ -31670,7 +31792,7 @@ function useTimeline({
|
|
|
31670
31792
|
}
|
|
31671
31793
|
|
|
31672
31794
|
// src/hooks/useTraceTimeline.ts
|
|
31673
|
-
import { useCallback as
|
|
31795
|
+
import { useCallback as useCallback59, useRef as useRef54, useState as useState67 } from "react";
|
|
31674
31796
|
var GLOBAL_SEQ = 0;
|
|
31675
31797
|
var generateId = () => `ods-trace-${Date.now().toString(36)}-${(GLOBAL_SEQ++).toString(36)}`;
|
|
31676
31798
|
function useTraceTimeline({
|
|
@@ -31678,12 +31800,12 @@ function useTraceTimeline({
|
|
|
31678
31800
|
defaultSteps = [],
|
|
31679
31801
|
onChange
|
|
31680
31802
|
} = {}) {
|
|
31681
|
-
const [internal, setInternal] =
|
|
31803
|
+
const [internal, setInternal] = useState67(defaultSteps);
|
|
31682
31804
|
const steps = controlled ?? internal;
|
|
31683
31805
|
const isControlled = controlled !== void 0;
|
|
31684
31806
|
const stepsRef = useRef54(steps);
|
|
31685
31807
|
stepsRef.current = steps;
|
|
31686
|
-
const commit =
|
|
31808
|
+
const commit = useCallback59(
|
|
31687
31809
|
(next) => {
|
|
31688
31810
|
stepsRef.current = next;
|
|
31689
31811
|
if (!isControlled) setInternal(next);
|
|
@@ -31691,7 +31813,7 @@ function useTraceTimeline({
|
|
|
31691
31813
|
},
|
|
31692
31814
|
[isControlled, onChange]
|
|
31693
31815
|
);
|
|
31694
|
-
const start =
|
|
31816
|
+
const start = useCallback59(
|
|
31695
31817
|
(input) => {
|
|
31696
31818
|
const id = input.id ?? generateId();
|
|
31697
31819
|
const record = {
|
|
@@ -31711,7 +31833,7 @@ function useTraceTimeline({
|
|
|
31711
31833
|
},
|
|
31712
31834
|
[commit]
|
|
31713
31835
|
);
|
|
31714
|
-
const update =
|
|
31836
|
+
const update = useCallback59(
|
|
31715
31837
|
(id, patch) => {
|
|
31716
31838
|
let changed = false;
|
|
31717
31839
|
const next = stepsRef.current.map((s) => {
|
|
@@ -31723,19 +31845,19 @@ function useTraceTimeline({
|
|
|
31723
31845
|
},
|
|
31724
31846
|
[commit]
|
|
31725
31847
|
);
|
|
31726
|
-
const complete =
|
|
31848
|
+
const complete = useCallback59(
|
|
31727
31849
|
(id, patch = {}) => {
|
|
31728
31850
|
update(id, { ...patch, status: "success" });
|
|
31729
31851
|
},
|
|
31730
31852
|
[update]
|
|
31731
31853
|
);
|
|
31732
|
-
const fail =
|
|
31854
|
+
const fail = useCallback59(
|
|
31733
31855
|
(id, patch = {}) => {
|
|
31734
31856
|
update(id, { ...patch, status: "failed" });
|
|
31735
31857
|
},
|
|
31736
31858
|
[update]
|
|
31737
31859
|
);
|
|
31738
|
-
const remove =
|
|
31860
|
+
const remove = useCallback59(
|
|
31739
31861
|
(id) => {
|
|
31740
31862
|
const next = stepsRef.current.filter((s) => s.id !== id);
|
|
31741
31863
|
if (next.length === stepsRef.current.length) return;
|
|
@@ -31761,13 +31883,13 @@ function useTraceTimeline({
|
|
|
31761
31883
|
|
|
31762
31884
|
// src/provider/OdsProvider.tsx
|
|
31763
31885
|
import { generateCssVars, resolveConfig } from "@octaviaflow/config";
|
|
31764
|
-
import { createContext as createContext3, useContext as useContext4, useEffect as
|
|
31886
|
+
import { createContext as createContext3, useContext as useContext4, useEffect as useEffect51, useMemo as useMemo38 } from "react";
|
|
31765
31887
|
import { OverlayProvider as OverlayProvider3 } from "react-aria";
|
|
31766
31888
|
import { jsx as jsx132 } from "react/jsx-runtime";
|
|
31767
31889
|
var OdsContext = createContext3(null);
|
|
31768
31890
|
function OdsProvider({ config: userConfig, children }) {
|
|
31769
31891
|
const resolved = useMemo38(() => resolveConfig(userConfig), [userConfig]);
|
|
31770
|
-
|
|
31892
|
+
useEffect51(() => {
|
|
31771
31893
|
const cssVarsBlock = generateCssVars(resolved);
|
|
31772
31894
|
const match = cssVarsBlock.match(/:root\s*\{([\s\S]*)\}/);
|
|
31773
31895
|
if (match) {
|
|
@@ -32263,12 +32385,14 @@ export {
|
|
|
32263
32385
|
WorkflowHeaderExpanded,
|
|
32264
32386
|
XmlViewer,
|
|
32265
32387
|
YamlViewer,
|
|
32388
|
+
anchoredPopoverStyle,
|
|
32266
32389
|
applyHorizontalLayout,
|
|
32267
32390
|
applyLayout,
|
|
32268
32391
|
applyVerticalLayout,
|
|
32269
32392
|
breakpointMinWidth,
|
|
32270
32393
|
cn,
|
|
32271
32394
|
codeToFlag,
|
|
32395
|
+
computeAnchoredPosition,
|
|
32272
32396
|
easeLinear,
|
|
32273
32397
|
easeOutCubic,
|
|
32274
32398
|
easeOutExpo,
|
|
@@ -32287,6 +32411,7 @@ export {
|
|
|
32287
32411
|
sanitizeHref,
|
|
32288
32412
|
sanitizeImageUrl,
|
|
32289
32413
|
textareaTools,
|
|
32414
|
+
useAnchoredPopover,
|
|
32290
32415
|
useBanner,
|
|
32291
32416
|
useBinaryRating,
|
|
32292
32417
|
useBreakpoint,
|