@octaviaflow/core 3.0.11 → 3.0.12
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/AuthCard/AuthCard.d.ts +7 -0
- package/dist/components/AuthCard/AuthCard.d.ts.map +1 -1
- package/dist/components/AuthCard/index.d.ts +1 -1
- package/dist/components/AuthCard/index.d.ts.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +13 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/index.cjs +75 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +124 -56
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6343,7 +6343,7 @@ function Drawer({
|
|
|
6343
6343
|
|
|
6344
6344
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
6345
6345
|
import { AnimatePresence as AnimatePresence4, motion as motion6 } from "framer-motion";
|
|
6346
|
-
import { useRef as useRef13 } from "react";
|
|
6346
|
+
import { useEffect as useEffect6, useRef as useRef13 } from "react";
|
|
6347
6347
|
import { useButton as useButton3, useMenu, useMenuItem, useMenuTrigger } from "react-aria";
|
|
6348
6348
|
import { createPortal as createPortal2 } from "react-dom";
|
|
6349
6349
|
import { Fragment as Fragment6, jsx as jsx29, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
@@ -6374,9 +6374,37 @@ function MenuPopup({
|
|
|
6374
6374
|
menuItems,
|
|
6375
6375
|
triggerRef,
|
|
6376
6376
|
align,
|
|
6377
|
-
className
|
|
6377
|
+
className,
|
|
6378
|
+
closeOnOutsideClick,
|
|
6379
|
+
closeOnEscape
|
|
6378
6380
|
}) {
|
|
6379
6381
|
const menuRef = useRef13(null);
|
|
6382
|
+
useEffect6(() => {
|
|
6383
|
+
if (!state.isOpen || !closeOnOutsideClick) return;
|
|
6384
|
+
const handler = (e) => {
|
|
6385
|
+
const target = e.target;
|
|
6386
|
+
if (!target) return;
|
|
6387
|
+
const insideMenu = menuRef.current?.contains(target);
|
|
6388
|
+
const insideTrigger = triggerRef.current?.contains(target);
|
|
6389
|
+
if (!insideMenu && !insideTrigger) {
|
|
6390
|
+
state.close();
|
|
6391
|
+
}
|
|
6392
|
+
};
|
|
6393
|
+
document.addEventListener("mousedown", handler, true);
|
|
6394
|
+
return () => document.removeEventListener("mousedown", handler, true);
|
|
6395
|
+
}, [state.isOpen, closeOnOutsideClick]);
|
|
6396
|
+
useEffect6(() => {
|
|
6397
|
+
if (!state.isOpen || !closeOnEscape) return;
|
|
6398
|
+
const handler = (e) => {
|
|
6399
|
+
if (e.key === "Escape") {
|
|
6400
|
+
e.stopPropagation();
|
|
6401
|
+
state.close();
|
|
6402
|
+
triggerRef.current?.focus();
|
|
6403
|
+
}
|
|
6404
|
+
};
|
|
6405
|
+
document.addEventListener("keydown", handler);
|
|
6406
|
+
return () => document.removeEventListener("keydown", handler);
|
|
6407
|
+
}, [state.isOpen, closeOnEscape]);
|
|
6380
6408
|
const nonSepItems = menuItems.filter((i) => !i.separator);
|
|
6381
6409
|
const children = nonSepItems.map((item, idx) => /* @__PURE__ */ jsx29($05678f3aee5e7d1a$export$6d08773d2e66f8f2, { textValue: item.label, children: item.label }, idx));
|
|
6382
6410
|
const treeState = $6b915bde6cd300dd$export$728d6ba534403756({
|
|
@@ -6456,6 +6484,8 @@ function DropdownMenu({
|
|
|
6456
6484
|
align = "start",
|
|
6457
6485
|
className,
|
|
6458
6486
|
triggerClassName,
|
|
6487
|
+
closeOnOutsideClick = true,
|
|
6488
|
+
closeOnEscape = true,
|
|
6459
6489
|
"aria-label": ariaLabel,
|
|
6460
6490
|
"aria-labelledby": ariaLabelledby
|
|
6461
6491
|
}) {
|
|
@@ -6490,7 +6520,9 @@ function DropdownMenu({
|
|
|
6490
6520
|
menuItems: items,
|
|
6491
6521
|
triggerRef,
|
|
6492
6522
|
align,
|
|
6493
|
-
className
|
|
6523
|
+
className,
|
|
6524
|
+
closeOnOutsideClick,
|
|
6525
|
+
closeOnEscape
|
|
6494
6526
|
}
|
|
6495
6527
|
)
|
|
6496
6528
|
] });
|
|
@@ -6509,7 +6541,7 @@ function EmptyState({ icon, title, description, action, className }) {
|
|
|
6509
6541
|
|
|
6510
6542
|
// src/components/ExecutionConsole/ExecutionConsole.tsx
|
|
6511
6543
|
import { motion as motion7 } from "framer-motion";
|
|
6512
|
-
import { useEffect as
|
|
6544
|
+
import { useEffect as useEffect7, useRef as useRef14 } from "react";
|
|
6513
6545
|
import { Fragment as Fragment7, jsx as jsx31, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6514
6546
|
var iconProps = {
|
|
6515
6547
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6556,7 +6588,7 @@ function ExecutionConsole({
|
|
|
6556
6588
|
void navigator.clipboard.writeText(text);
|
|
6557
6589
|
}
|
|
6558
6590
|
};
|
|
6559
|
-
|
|
6591
|
+
useEffect7(() => {
|
|
6560
6592
|
if (open && logEndRef.current) {
|
|
6561
6593
|
logEndRef.current.scrollIntoView?.({ behavior: "smooth" });
|
|
6562
6594
|
}
|
|
@@ -6722,7 +6754,7 @@ function FeatureCard({
|
|
|
6722
6754
|
// src/components/FileDropzone/FileDropzone.tsx
|
|
6723
6755
|
import {
|
|
6724
6756
|
useCallback as useCallback4,
|
|
6725
|
-
useEffect as
|
|
6757
|
+
useEffect as useEffect8,
|
|
6726
6758
|
useId as useId3,
|
|
6727
6759
|
useRef as useRef15,
|
|
6728
6760
|
useState as useState9
|
|
@@ -6908,7 +6940,7 @@ function FileDropzone({
|
|
|
6908
6940
|
},
|
|
6909
6941
|
[disabled, onFiles, validate]
|
|
6910
6942
|
);
|
|
6911
|
-
|
|
6943
|
+
useEffect8(() => {
|
|
6912
6944
|
if (!files) return;
|
|
6913
6945
|
const next = {};
|
|
6914
6946
|
const created = [];
|
|
@@ -6925,7 +6957,7 @@ function FileDropzone({
|
|
|
6925
6957
|
created.forEach((u) => URL.revokeObjectURL(u));
|
|
6926
6958
|
};
|
|
6927
6959
|
}, [files]);
|
|
6928
|
-
|
|
6960
|
+
useEffect8(() => {
|
|
6929
6961
|
if (!pasteEnabled || disabled) return;
|
|
6930
6962
|
const onPaste = (e) => {
|
|
6931
6963
|
const active = document.activeElement;
|
|
@@ -7210,7 +7242,7 @@ import { motion as motion8 } from "framer-motion";
|
|
|
7210
7242
|
import {
|
|
7211
7243
|
forwardRef,
|
|
7212
7244
|
useCallback as useCallback5,
|
|
7213
|
-
useEffect as
|
|
7245
|
+
useEffect as useEffect9,
|
|
7214
7246
|
useRef as useRef16,
|
|
7215
7247
|
useState as useState10
|
|
7216
7248
|
} from "react";
|
|
@@ -7326,7 +7358,7 @@ var FlowNode = forwardRef(function FlowNode2({
|
|
|
7326
7358
|
},
|
|
7327
7359
|
[isLockMode]
|
|
7328
7360
|
);
|
|
7329
|
-
|
|
7361
|
+
useEffect9(() => {
|
|
7330
7362
|
if (!isDragging) return;
|
|
7331
7363
|
const applyDelta = (clientX, clientY) => {
|
|
7332
7364
|
const start = dragStartRef.current;
|
|
@@ -8067,7 +8099,7 @@ function FormSection({
|
|
|
8067
8099
|
}
|
|
8068
8100
|
|
|
8069
8101
|
// src/components/HoverCard/HoverCard.tsx
|
|
8070
|
-
import { useCallback as useCallback8, useEffect as
|
|
8102
|
+
import { useCallback as useCallback8, useEffect as useEffect10, useLayoutEffect, useRef as useRef18, useState as useState11 } from "react";
|
|
8071
8103
|
import { createPortal as createPortal3 } from "react-dom";
|
|
8072
8104
|
import { Fragment as Fragment10, jsx as jsx40, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
8073
8105
|
function computePosition(rect, panelRect, placement, offset) {
|
|
@@ -8109,7 +8141,7 @@ function HoverCard({
|
|
|
8109
8141
|
closeTimer.current = null;
|
|
8110
8142
|
}
|
|
8111
8143
|
};
|
|
8112
|
-
|
|
8144
|
+
useEffect10(() => () => clearTimers(), []);
|
|
8113
8145
|
const show = () => {
|
|
8114
8146
|
clearTimers();
|
|
8115
8147
|
openTimer.current = setTimeout(() => setOpen(true), openDelay);
|
|
@@ -8130,7 +8162,7 @@ function HoverCard({
|
|
|
8130
8162
|
const id = requestAnimationFrame(reposition);
|
|
8131
8163
|
return () => cancelAnimationFrame(id);
|
|
8132
8164
|
}, [open, reposition]);
|
|
8133
|
-
|
|
8165
|
+
useEffect10(() => {
|
|
8134
8166
|
if (!open) return;
|
|
8135
8167
|
const h = () => reposition();
|
|
8136
8168
|
window.addEventListener("scroll", h, true);
|
|
@@ -8741,7 +8773,7 @@ function LinkButton({
|
|
|
8741
8773
|
import { AnimatePresence as AnimatePresence6, motion as motion9 } from "framer-motion";
|
|
8742
8774
|
import {
|
|
8743
8775
|
useCallback as useCallback9,
|
|
8744
|
-
useEffect as
|
|
8776
|
+
useEffect as useEffect11,
|
|
8745
8777
|
useLayoutEffect as useLayoutEffect2,
|
|
8746
8778
|
useMemo as useMemo9,
|
|
8747
8779
|
useRef as useRef20,
|
|
@@ -8803,7 +8835,7 @@ function MultiSelect({
|
|
|
8803
8835
|
const rect = wrapRef.current.getBoundingClientRect();
|
|
8804
8836
|
setDropdownPos({ top: rect.bottom + 4, left: rect.left, width: rect.width });
|
|
8805
8837
|
}, []);
|
|
8806
|
-
|
|
8838
|
+
useEffect11(() => {
|
|
8807
8839
|
if (!open) return;
|
|
8808
8840
|
updatePosition();
|
|
8809
8841
|
window.addEventListener("scroll", updatePosition, true);
|
|
@@ -8813,7 +8845,7 @@ function MultiSelect({
|
|
|
8813
8845
|
window.removeEventListener("resize", updatePosition);
|
|
8814
8846
|
};
|
|
8815
8847
|
}, [open, updatePosition]);
|
|
8816
|
-
|
|
8848
|
+
useEffect11(() => {
|
|
8817
8849
|
if (!open) return;
|
|
8818
8850
|
const onDoc = (e) => {
|
|
8819
8851
|
const t = e.target;
|
|
@@ -8825,12 +8857,12 @@ function MultiSelect({
|
|
|
8825
8857
|
document.addEventListener("mousedown", onDoc);
|
|
8826
8858
|
return () => document.removeEventListener("mousedown", onDoc);
|
|
8827
8859
|
}, [open]);
|
|
8828
|
-
|
|
8860
|
+
useEffect11(() => {
|
|
8829
8861
|
if (open && showSearch) {
|
|
8830
8862
|
requestAnimationFrame(() => searchRef.current?.focus());
|
|
8831
8863
|
}
|
|
8832
8864
|
}, [open, showSearch]);
|
|
8833
|
-
|
|
8865
|
+
useEffect11(() => setActiveIdx(0), [query, open]);
|
|
8834
8866
|
const [fitCount, setFitCount] = useState13(selectedValues.length);
|
|
8835
8867
|
const [tick, setTick] = useState13(0);
|
|
8836
8868
|
useLayoutEffect2(() => {
|
|
@@ -8859,7 +8891,7 @@ function MultiSelect({
|
|
|
8859
8891
|
if (count < selectedValues.length && count > 0) count = Math.max(1, count - 1);
|
|
8860
8892
|
setFitCount(count);
|
|
8861
8893
|
}, [tick, selectedValues, maxVisibleTags]);
|
|
8862
|
-
|
|
8894
|
+
useEffect11(() => {
|
|
8863
8895
|
if (typeof ResizeObserver === "undefined") return;
|
|
8864
8896
|
const row = tagsRowRef.current;
|
|
8865
8897
|
if (!row) return;
|
|
@@ -9542,7 +9574,7 @@ function PhoneInput({
|
|
|
9542
9574
|
}
|
|
9543
9575
|
|
|
9544
9576
|
// src/components/Popover/Popover.tsx
|
|
9545
|
-
import { useCallback as useCallback12, useEffect as
|
|
9577
|
+
import { useCallback as useCallback12, useEffect as useEffect12, useLayoutEffect as useLayoutEffect3, useRef as useRef22, useState as useState16 } from "react";
|
|
9546
9578
|
import { createPortal as createPortal5 } from "react-dom";
|
|
9547
9579
|
import { Fragment as Fragment12, jsx as jsx54, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
9548
9580
|
function computePosition2(rect, popRect, placement, offset) {
|
|
@@ -9597,7 +9629,7 @@ function Popover({
|
|
|
9597
9629
|
const id = requestAnimationFrame(reposition);
|
|
9598
9630
|
return () => cancelAnimationFrame(id);
|
|
9599
9631
|
}, [open, reposition, content]);
|
|
9600
|
-
|
|
9632
|
+
useEffect12(() => {
|
|
9601
9633
|
if (!open) return;
|
|
9602
9634
|
const onScroll = () => reposition();
|
|
9603
9635
|
window.addEventListener("scroll", onScroll, true);
|
|
@@ -9607,7 +9639,7 @@ function Popover({
|
|
|
9607
9639
|
window.removeEventListener("resize", onScroll);
|
|
9608
9640
|
};
|
|
9609
9641
|
}, [open, reposition]);
|
|
9610
|
-
|
|
9642
|
+
useEffect12(() => {
|
|
9611
9643
|
if (!open || !closeOnClickOutside) return;
|
|
9612
9644
|
const onDoc = (e) => {
|
|
9613
9645
|
const t = e.target;
|
|
@@ -9618,7 +9650,7 @@ function Popover({
|
|
|
9618
9650
|
document.addEventListener("mousedown", onDoc);
|
|
9619
9651
|
return () => document.removeEventListener("mousedown", onDoc);
|
|
9620
9652
|
}, [open, closeOnClickOutside, setOpen]);
|
|
9621
|
-
|
|
9653
|
+
useEffect12(() => {
|
|
9622
9654
|
if (!open || !closeOnEsc) return;
|
|
9623
9655
|
const onKey = (e) => {
|
|
9624
9656
|
if (e.key === "Escape") setOpen(false);
|
|
@@ -9819,7 +9851,7 @@ function ProgressRing({
|
|
|
9819
9851
|
// src/components/PromptInput/PromptInput.tsx
|
|
9820
9852
|
import {
|
|
9821
9853
|
useCallback as useCallback13,
|
|
9822
|
-
useEffect as
|
|
9854
|
+
useEffect as useEffect13,
|
|
9823
9855
|
useRef as useRef23,
|
|
9824
9856
|
useState as useState17
|
|
9825
9857
|
} from "react";
|
|
@@ -9888,7 +9920,7 @@ function PromptInput({
|
|
|
9888
9920
|
},
|
|
9889
9921
|
[isControlled, onChange]
|
|
9890
9922
|
);
|
|
9891
|
-
|
|
9923
|
+
useEffect13(() => {
|
|
9892
9924
|
const el = taRef.current;
|
|
9893
9925
|
if (!el) return;
|
|
9894
9926
|
const computed = window.getComputedStyle(el);
|
|
@@ -10551,7 +10583,7 @@ function Rating({
|
|
|
10551
10583
|
// src/components/Resizable/Resizable.tsx
|
|
10552
10584
|
import {
|
|
10553
10585
|
useCallback as useCallback14,
|
|
10554
|
-
useEffect as
|
|
10586
|
+
useEffect as useEffect14,
|
|
10555
10587
|
useRef as useRef26,
|
|
10556
10588
|
useState as useState19
|
|
10557
10589
|
} from "react";
|
|
@@ -10592,7 +10624,7 @@ function Resizable({
|
|
|
10592
10624
|
if (internalSplit != null) return internalSplit;
|
|
10593
10625
|
return defaultSplit > 0 && defaultSplit < 1 ? 0 : defaultSplit;
|
|
10594
10626
|
});
|
|
10595
|
-
|
|
10627
|
+
useEffect14(() => {
|
|
10596
10628
|
if (splitProp != null) {
|
|
10597
10629
|
setSplit(splitProp);
|
|
10598
10630
|
return;
|
|
@@ -10625,7 +10657,7 @@ function Resizable({
|
|
|
10625
10657
|
draggingRef.current = true;
|
|
10626
10658
|
setDragging(true);
|
|
10627
10659
|
};
|
|
10628
|
-
|
|
10660
|
+
useEffect14(() => {
|
|
10629
10661
|
const onMove = (e) => {
|
|
10630
10662
|
if (!draggingRef.current) return;
|
|
10631
10663
|
const el = wrapRef.current;
|
|
@@ -10732,7 +10764,7 @@ function ResizablePanel({
|
|
|
10732
10764
|
setDragging(true);
|
|
10733
10765
|
startRef.current = { x: e.clientX, size };
|
|
10734
10766
|
};
|
|
10735
|
-
|
|
10767
|
+
useEffect14(() => {
|
|
10736
10768
|
const onMove = (e) => {
|
|
10737
10769
|
if (!draggingRef.current) return;
|
|
10738
10770
|
const dx = e.clientX - startRef.current.x;
|
|
@@ -10795,7 +10827,7 @@ function Ribbon({
|
|
|
10795
10827
|
|
|
10796
10828
|
// src/components/Select/Select.tsx
|
|
10797
10829
|
import { AnimatePresence as AnimatePresence7, motion as motion10 } from "framer-motion";
|
|
10798
|
-
import { useCallback as useCallback15, useEffect as
|
|
10830
|
+
import { useCallback as useCallback15, useEffect as useEffect15, useMemo as useMemo10, useRef as useRef27, useState as useState20 } from "react";
|
|
10799
10831
|
import { HiddenSelect, useButton as useButton4, useListBox, useOption, useSelect } from "react-aria";
|
|
10800
10832
|
import { createPortal as createPortal6 } from "react-dom";
|
|
10801
10833
|
import { Fragment as Fragment13, jsx as jsx66, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
@@ -10951,7 +10983,7 @@ function Select({
|
|
|
10951
10983
|
width: rect.width
|
|
10952
10984
|
});
|
|
10953
10985
|
}, []);
|
|
10954
|
-
|
|
10986
|
+
useEffect15(() => {
|
|
10955
10987
|
if (state.isOpen) {
|
|
10956
10988
|
updatePosition();
|
|
10957
10989
|
window.addEventListener("scroll", updatePosition, true);
|
|
@@ -10962,7 +10994,7 @@ function Select({
|
|
|
10962
10994
|
};
|
|
10963
10995
|
}
|
|
10964
10996
|
}, [state.isOpen, updatePosition]);
|
|
10965
|
-
|
|
10997
|
+
useEffect15(() => {
|
|
10966
10998
|
if (state.isOpen && searchable && searchRef.current) {
|
|
10967
10999
|
requestAnimationFrame(() => searchRef.current?.focus());
|
|
10968
11000
|
}
|
|
@@ -11076,7 +11108,7 @@ function SettingsRow({
|
|
|
11076
11108
|
|
|
11077
11109
|
// src/components/Sheet/Sheet.tsx
|
|
11078
11110
|
import { AnimatePresence as AnimatePresence8, motion as motion11 } from "framer-motion";
|
|
11079
|
-
import { useEffect as
|
|
11111
|
+
import { useEffect as useEffect16 } from "react";
|
|
11080
11112
|
import { createPortal as createPortal7 } from "react-dom";
|
|
11081
11113
|
import { Fragment as Fragment14, jsx as jsx68, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
11082
11114
|
var slideVariants = {
|
|
@@ -11111,7 +11143,7 @@ function Sheet({
|
|
|
11111
11143
|
dragHandle = true,
|
|
11112
11144
|
className
|
|
11113
11145
|
}) {
|
|
11114
|
-
|
|
11146
|
+
useEffect16(() => {
|
|
11115
11147
|
if (!open || !closeOnEsc) return;
|
|
11116
11148
|
const onKey = (e) => {
|
|
11117
11149
|
if (e.key === "Escape") onClose();
|
|
@@ -11163,7 +11195,7 @@ function Sheet({
|
|
|
11163
11195
|
}
|
|
11164
11196
|
|
|
11165
11197
|
// src/components/Sidebar/Sidebar.tsx
|
|
11166
|
-
import { useCallback as useCallback16, useEffect as
|
|
11198
|
+
import { useCallback as useCallback16, useEffect as useEffect17, useRef as useRef28, useState as useState21 } from "react";
|
|
11167
11199
|
import { Fragment as Fragment15, jsx as jsx69, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
11168
11200
|
function Sidebar({
|
|
11169
11201
|
variant = "expanded",
|
|
@@ -11186,7 +11218,7 @@ function Sidebar({
|
|
|
11186
11218
|
}) {
|
|
11187
11219
|
const allSections = sections ?? (items ? [{ items }] : []);
|
|
11188
11220
|
const [internalPinned, setInternalPinned] = useState21(defaultPinned);
|
|
11189
|
-
|
|
11221
|
+
useEffect17(() => {
|
|
11190
11222
|
if (pinnedProp !== void 0) return;
|
|
11191
11223
|
try {
|
|
11192
11224
|
const stored = window.localStorage.getItem(pinStorageKey);
|
|
@@ -11221,7 +11253,7 @@ function Sidebar({
|
|
|
11221
11253
|
closeTimer.current = null;
|
|
11222
11254
|
}
|
|
11223
11255
|
};
|
|
11224
|
-
|
|
11256
|
+
useEffect17(() => () => clearTimers(), []);
|
|
11225
11257
|
const handleEnter = () => {
|
|
11226
11258
|
clearTimers();
|
|
11227
11259
|
openTimer.current = setTimeout(() => setHoverOpen(true), hoverOpenDelay);
|
|
@@ -11233,7 +11265,7 @@ function Sidebar({
|
|
|
11233
11265
|
const autoMode = variant === "auto";
|
|
11234
11266
|
const showAsRail = autoMode ? !pinned : variant === "rail";
|
|
11235
11267
|
const overlayOpen = autoMode && !pinned && hoverOpen;
|
|
11236
|
-
|
|
11268
|
+
useEffect17(() => {
|
|
11237
11269
|
if (!overlayOpen) return;
|
|
11238
11270
|
const handler = (e) => {
|
|
11239
11271
|
if (e.key === "Escape") {
|
|
@@ -11383,23 +11415,24 @@ function RailItem({
|
|
|
11383
11415
|
tooltipDelay,
|
|
11384
11416
|
suppressTooltip
|
|
11385
11417
|
}) {
|
|
11386
|
-
const [
|
|
11418
|
+
const [open, setOpen] = useState21(false);
|
|
11387
11419
|
const timerRef = useRef28(null);
|
|
11420
|
+
const hasChildren = !!(item.children && item.children.length > 0);
|
|
11388
11421
|
const clear = () => {
|
|
11389
11422
|
if (timerRef.current) {
|
|
11390
11423
|
clearTimeout(timerRef.current);
|
|
11391
11424
|
timerRef.current = null;
|
|
11392
11425
|
}
|
|
11393
11426
|
};
|
|
11394
|
-
|
|
11427
|
+
useEffect17(() => () => clear(), []);
|
|
11395
11428
|
const show = () => {
|
|
11396
11429
|
if (suppressTooltip) return;
|
|
11397
11430
|
clear();
|
|
11398
|
-
timerRef.current = setTimeout(() =>
|
|
11431
|
+
timerRef.current = setTimeout(() => setOpen(true), tooltipDelay);
|
|
11399
11432
|
};
|
|
11400
11433
|
const hide = () => {
|
|
11401
11434
|
clear();
|
|
11402
|
-
|
|
11435
|
+
setOpen(false);
|
|
11403
11436
|
};
|
|
11404
11437
|
const Comp = item.href ? "a" : "button";
|
|
11405
11438
|
const labelText = typeof item.label === "string" ? item.label : void 0;
|
|
@@ -11418,13 +11451,20 @@ function RailItem({
|
|
|
11418
11451
|
type: item.href ? void 0 : "button",
|
|
11419
11452
|
href: item.href,
|
|
11420
11453
|
onClick: item.onClick,
|
|
11421
|
-
className: cn(
|
|
11454
|
+
className: cn(
|
|
11455
|
+
"ods-sidebar__rail-item",
|
|
11456
|
+
hasChildren && "ods-sidebar__rail-item--parent",
|
|
11457
|
+
item.active && "ods-sidebar__rail-item--active"
|
|
11458
|
+
),
|
|
11422
11459
|
"aria-current": item.active ? "page" : void 0,
|
|
11423
11460
|
"aria-label": labelText,
|
|
11461
|
+
"aria-haspopup": hasChildren ? "menu" : void 0,
|
|
11462
|
+
"aria-expanded": hasChildren ? open : void 0,
|
|
11424
11463
|
children: /* @__PURE__ */ jsx69("span", { className: "ods-sidebar__rail-icon", children: item.icon })
|
|
11425
11464
|
}
|
|
11426
11465
|
),
|
|
11427
|
-
|
|
11466
|
+
open && labelText && hasChildren && /* @__PURE__ */ jsx69(RailFlyout, { title: labelText, items: item.children ?? [] }),
|
|
11467
|
+
open && labelText && !hasChildren && /* @__PURE__ */ jsxs68("div", { className: "ods-sidebar__rail-tooltip", role: "tooltip", children: [
|
|
11428
11468
|
/* @__PURE__ */ jsx69("span", { className: "ods-sidebar__rail-tooltip-label", children: labelText }),
|
|
11429
11469
|
item.shortcut && /* @__PURE__ */ jsx69("kbd", { className: "ods-sidebar__rail-kbd", children: item.shortcut })
|
|
11430
11470
|
] })
|
|
@@ -11432,6 +11472,34 @@ function RailItem({
|
|
|
11432
11472
|
}
|
|
11433
11473
|
);
|
|
11434
11474
|
}
|
|
11475
|
+
function RailFlyout({ title, items }) {
|
|
11476
|
+
return /* @__PURE__ */ jsxs68("div", { className: "ods-sidebar__rail-flyout", role: "menu", children: [
|
|
11477
|
+
/* @__PURE__ */ jsx69("div", { className: "ods-sidebar__rail-flyout-header", children: /* @__PURE__ */ jsx69("span", { className: "ods-sidebar__rail-flyout-title", children: title }) }),
|
|
11478
|
+
/* @__PURE__ */ jsx69("ul", { className: "ods-sidebar__rail-flyout-list", children: items.map((child) => {
|
|
11479
|
+
const ChildComp = child.href ? "a" : "button";
|
|
11480
|
+
return /* @__PURE__ */ jsx69("li", { children: /* @__PURE__ */ jsxs68(
|
|
11481
|
+
ChildComp,
|
|
11482
|
+
{
|
|
11483
|
+
type: child.href ? void 0 : "button",
|
|
11484
|
+
href: child.href,
|
|
11485
|
+
onClick: child.onClick,
|
|
11486
|
+
role: "menuitem",
|
|
11487
|
+
className: cn(
|
|
11488
|
+
"ods-sidebar__rail-flyout-item",
|
|
11489
|
+
child.active && "ods-sidebar__rail-flyout-item--active"
|
|
11490
|
+
),
|
|
11491
|
+
"aria-current": child.active ? "page" : void 0,
|
|
11492
|
+
children: [
|
|
11493
|
+
/* @__PURE__ */ jsx69("span", { className: "ods-sidebar__rail-flyout-icon", children: child.icon }),
|
|
11494
|
+
/* @__PURE__ */ jsx69("span", { className: "ods-sidebar__rail-flyout-label", children: child.label }),
|
|
11495
|
+
child.tag && /* @__PURE__ */ jsx69("span", { className: "ods-sidebar__rail-flyout-tag", children: child.tag }),
|
|
11496
|
+
child.badge && /* @__PURE__ */ jsx69("span", { className: "ods-sidebar__rail-flyout-badge", children: child.badge })
|
|
11497
|
+
]
|
|
11498
|
+
}
|
|
11499
|
+
) }, child.id);
|
|
11500
|
+
}) })
|
|
11501
|
+
] });
|
|
11502
|
+
}
|
|
11435
11503
|
function ExpandedLayout({
|
|
11436
11504
|
logo,
|
|
11437
11505
|
brand,
|
|
@@ -11913,7 +11981,7 @@ function SocialButton({
|
|
|
11913
11981
|
// src/components/Sortable/Sortable.tsx
|
|
11914
11982
|
import {
|
|
11915
11983
|
useCallback as useCallback17,
|
|
11916
|
-
useEffect as
|
|
11984
|
+
useEffect as useEffect18,
|
|
11917
11985
|
useRef as useRef30,
|
|
11918
11986
|
useState as useState22
|
|
11919
11987
|
} from "react";
|
|
@@ -11996,7 +12064,7 @@ function Sortable({
|
|
|
11996
12064
|
},
|
|
11997
12065
|
[items, onChange]
|
|
11998
12066
|
);
|
|
11999
|
-
|
|
12067
|
+
useEffect18(() => {
|
|
12000
12068
|
if (!autoScroll || !draggingId) return;
|
|
12001
12069
|
const container = containerRef.current;
|
|
12002
12070
|
if (!container) return;
|
|
@@ -12046,7 +12114,7 @@ function Sortable({
|
|
|
12046
12114
|
}
|
|
12047
12115
|
};
|
|
12048
12116
|
}, [autoScroll, autoScrollEdge, draggingId, isVertical]);
|
|
12049
|
-
|
|
12117
|
+
useEffect18(() => {
|
|
12050
12118
|
if (!draggingId) return;
|
|
12051
12119
|
const onKey = (e) => {
|
|
12052
12120
|
if (e.key === "Escape") cancelDrag();
|
|
@@ -12899,7 +12967,7 @@ function Timeline({ items, size = "md", className }) {
|
|
|
12899
12967
|
import {
|
|
12900
12968
|
Fragment as Fragment18,
|
|
12901
12969
|
useCallback as useCallback19,
|
|
12902
|
-
useEffect as
|
|
12970
|
+
useEffect as useEffect19,
|
|
12903
12971
|
useRef as useRef34,
|
|
12904
12972
|
useState as useState27
|
|
12905
12973
|
} from "react";
|
|
@@ -12938,7 +13006,7 @@ function TimePicker({
|
|
|
12938
13006
|
const minutesRef = useRef34(null);
|
|
12939
13007
|
const secondsRef = useRef34(null);
|
|
12940
13008
|
const refOf = (s) => s === "hours" ? hoursRef : s === "minutes" ? minutesRef : secondsRef;
|
|
12941
|
-
|
|
13009
|
+
useEffect19(() => {
|
|
12942
13010
|
if (!open) return;
|
|
12943
13011
|
const onDoc = (e) => {
|
|
12944
13012
|
if (!wrapRef.current?.contains(e.target)) {
|
|
@@ -13199,7 +13267,7 @@ function TimePicker({
|
|
|
13199
13267
|
}
|
|
13200
13268
|
|
|
13201
13269
|
// src/components/TimezonePicker/TimezonePicker.tsx
|
|
13202
|
-
import { useEffect as
|
|
13270
|
+
import { useEffect as useEffect20, useMemo as useMemo12, useRef as useRef35, useState as useState28 } from "react";
|
|
13203
13271
|
import { Fragment as Fragment20, jsx as jsx86, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
13204
13272
|
var DEFAULT_TZS = [
|
|
13205
13273
|
{ iana: "America/Los_Angeles", label: "Pacific Time", offset: "UTC\u22128" },
|
|
@@ -13239,7 +13307,7 @@ function TimezonePicker({
|
|
|
13239
13307
|
(o) => o.iana.toLowerCase().includes(q) || o.label.toLowerCase().includes(q) || o.offset.toLowerCase().includes(q) || o.region?.toLowerCase().includes(q)
|
|
13240
13308
|
);
|
|
13241
13309
|
}, [options, query]);
|
|
13242
|
-
|
|
13310
|
+
useEffect20(() => {
|
|
13243
13311
|
if (!open) return;
|
|
13244
13312
|
const onDoc = (e) => {
|
|
13245
13313
|
if (!wrapRef.current?.contains(e.target)) {
|
|
@@ -13250,7 +13318,7 @@ function TimezonePicker({
|
|
|
13250
13318
|
document.addEventListener("mousedown", onDoc);
|
|
13251
13319
|
return () => document.removeEventListener("mousedown", onDoc);
|
|
13252
13320
|
}, [open]);
|
|
13253
|
-
|
|
13321
|
+
useEffect20(() => {
|
|
13254
13322
|
if (open) requestAnimationFrame(() => inputRef.current?.focus());
|
|
13255
13323
|
}, [open]);
|
|
13256
13324
|
const select = (iana) => {
|
|
@@ -13871,7 +13939,7 @@ import { AnimatePresence as AnimatePresence11, motion as motion15 } from "framer
|
|
|
13871
13939
|
import {
|
|
13872
13940
|
cloneElement,
|
|
13873
13941
|
useCallback as useCallback21,
|
|
13874
|
-
useEffect as
|
|
13942
|
+
useEffect as useEffect21,
|
|
13875
13943
|
useLayoutEffect as useLayoutEffect4,
|
|
13876
13944
|
useRef as useRef37,
|
|
13877
13945
|
useState as useState30
|
|
@@ -13922,7 +13990,7 @@ function TooltipContent({
|
|
|
13922
13990
|
const id = requestAnimationFrame(reposition);
|
|
13923
13991
|
return () => cancelAnimationFrame(id);
|
|
13924
13992
|
}, [state.isOpen, reposition]);
|
|
13925
|
-
|
|
13993
|
+
useEffect21(() => {
|
|
13926
13994
|
if (!state.isOpen) return;
|
|
13927
13995
|
const handler = () => reposition();
|
|
13928
13996
|
window.addEventListener("scroll", handler, true);
|
|
@@ -15702,13 +15770,13 @@ function YamlViewer({
|
|
|
15702
15770
|
|
|
15703
15771
|
// src/provider/OdsProvider.tsx
|
|
15704
15772
|
import { generateCssVars, resolveConfig } from "@octaviaflow/config";
|
|
15705
|
-
import { createContext as createContext3, useContext as useContext3, useEffect as
|
|
15773
|
+
import { createContext as createContext3, useContext as useContext3, useEffect as useEffect22, useMemo as useMemo18 } from "react";
|
|
15706
15774
|
import { OverlayProvider as OverlayProvider3 } from "react-aria";
|
|
15707
15775
|
import { jsx as jsx98 } from "react/jsx-runtime";
|
|
15708
15776
|
var OdsContext = createContext3(null);
|
|
15709
15777
|
function OdsProvider({ config: userConfig, children }) {
|
|
15710
15778
|
const resolved = useMemo18(() => resolveConfig(userConfig), [userConfig]);
|
|
15711
|
-
|
|
15779
|
+
useEffect22(() => {
|
|
15712
15780
|
const cssVarsBlock = generateCssVars(resolved);
|
|
15713
15781
|
const match = cssVarsBlock.match(/:root\s*\{([\s\S]*)\}/);
|
|
15714
15782
|
if (match) {
|