@octaviaflow/core 3.1.0-beta.110 → 3.1.0-beta.112
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/ExpressionField/ExpressionField.d.ts.map +1 -1
- package/dist/components/ExpressionField/parseExpression.d.ts +17 -1
- package/dist/components/ExpressionField/parseExpression.d.ts.map +1 -1
- package/dist/components/SlideoutPanel/SlideoutPanel.d.ts +2 -0
- package/dist/components/SlideoutPanel/SlideoutPanel.d.ts.map +1 -1
- package/dist/components/Toast/Toast.d.ts +6 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/VersionHistory/VersionHistory.d.ts.map +1 -1
- package/dist/index.cjs +168 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +183 -72
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/workflow/components/FxPanel/FxPanel.d.ts.map +1 -1
- package/dist/workflow.cjs +3 -2
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.js +3 -2
- package/dist/workflow.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -11637,7 +11637,9 @@ function splitArguments(argsText) {
|
|
|
11637
11637
|
}
|
|
11638
11638
|
current += ch;
|
|
11639
11639
|
}
|
|
11640
|
-
|
|
11640
|
+
const tail = current.trim();
|
|
11641
|
+
if (tail) args.push(tail);
|
|
11642
|
+
else if (args.length) args.push("");
|
|
11641
11643
|
return args;
|
|
11642
11644
|
}
|
|
11643
11645
|
function parseCall(raw) {
|
|
@@ -11650,7 +11652,7 @@ function parseCall(raw) {
|
|
|
11650
11652
|
return { name: head[1], args: splitArguments(inner.slice(open + 1, close)) };
|
|
11651
11653
|
}
|
|
11652
11654
|
function formatCall(name, args) {
|
|
11653
|
-
return `{{${name}(${args.
|
|
11655
|
+
return `{{${name}(${args.join(", ")})}}`;
|
|
11654
11656
|
}
|
|
11655
11657
|
function parseExpression(value, pillEveryToken = false) {
|
|
11656
11658
|
const segments = [];
|
|
@@ -11692,7 +11694,15 @@ function callAt(raw, path) {
|
|
|
11692
11694
|
return current;
|
|
11693
11695
|
}
|
|
11694
11696
|
function formatNestedCall(name, args) {
|
|
11695
|
-
return `${name}(${args.
|
|
11697
|
+
return `${name}(${args.join(", ")})`;
|
|
11698
|
+
}
|
|
11699
|
+
function normalizeCall(raw) {
|
|
11700
|
+
const call = parseCall(raw);
|
|
11701
|
+
if (!call) return raw;
|
|
11702
|
+
const args = call.args.map((arg) => parseCall(arg) ? normalizeCall(arg) : arg);
|
|
11703
|
+
while (args.length > 0 && args[args.length - 1].trim() === "") args.pop();
|
|
11704
|
+
const held = args.map((arg) => arg.trim() === "" ? '""' : arg);
|
|
11705
|
+
return raw.trim().startsWith("{{") ? formatCall(call.name, held) : formatNestedCall(call.name, held);
|
|
11696
11706
|
}
|
|
11697
11707
|
function replaceArgument(raw, path, next) {
|
|
11698
11708
|
if (path.length === 0) return next;
|
|
@@ -11724,7 +11734,10 @@ function shortReferenceLabel(token) {
|
|
|
11724
11734
|
if (token.startsWith("{{ods://")) {
|
|
11725
11735
|
const path = token.slice(8, -2);
|
|
11726
11736
|
const parts = path.split("/");
|
|
11727
|
-
if (parts[0] === "steps"
|
|
11737
|
+
if (parts[0] === "steps") {
|
|
11738
|
+
if (parts.length >= 4) return parts.slice(3).join(".");
|
|
11739
|
+
return parts[2] ?? "output";
|
|
11740
|
+
}
|
|
11728
11741
|
if (parts[0] === "flow") return `flow.${parts.slice(1).join(".")}`;
|
|
11729
11742
|
return parts.join(".");
|
|
11730
11743
|
}
|
|
@@ -12160,7 +12173,9 @@ function CallEditor({
|
|
|
12160
12173
|
const target = e.target;
|
|
12161
12174
|
if (panelRef.current?.contains(target)) return;
|
|
12162
12175
|
if (anchor.contains(target)) return;
|
|
12163
|
-
|
|
12176
|
+
const el = target instanceof Element ? target : target.parentElement;
|
|
12177
|
+
if (el?.closest('[draggable="true"]')) return;
|
|
12178
|
+
onApplyRef.current(normalizeCall(draftRef.current));
|
|
12164
12179
|
};
|
|
12165
12180
|
document.addEventListener("keydown", onKey);
|
|
12166
12181
|
document.addEventListener("mousedown", onPointerDown, true);
|
|
@@ -12357,7 +12372,7 @@ function CallEditor({
|
|
|
12357
12372
|
] }),
|
|
12358
12373
|
/* @__PURE__ */ jsxs49("div", { className: "ods-expression-field__editor-foot", children: [
|
|
12359
12374
|
/* @__PURE__ */ jsx49(Button, { variant: "secondary", size: "sm", onClick: onCancel, children: "Cancel" }),
|
|
12360
|
-
/* @__PURE__ */ jsx49(Button, { variant: "primary", size: "sm", onClick: () => onApply(draft), children: "Apply" })
|
|
12375
|
+
/* @__PURE__ */ jsx49(Button, { variant: "primary", size: "sm", onClick: () => onApply(normalizeCall(draft)), children: "Apply" })
|
|
12361
12376
|
] })
|
|
12362
12377
|
]
|
|
12363
12378
|
}
|
|
@@ -33197,6 +33212,7 @@ function SlideoutContent({
|
|
|
33197
33212
|
title,
|
|
33198
33213
|
children,
|
|
33199
33214
|
footer,
|
|
33215
|
+
headerActions,
|
|
33200
33216
|
className,
|
|
33201
33217
|
offsetTop = 0,
|
|
33202
33218
|
offsetBottom = 0
|
|
@@ -33282,16 +33298,19 @@ function SlideoutContent({
|
|
|
33282
33298
|
children: [
|
|
33283
33299
|
title && /* @__PURE__ */ jsxs130("div", { className: "ods-slideout__header", children: [
|
|
33284
33300
|
/* @__PURE__ */ jsx135("h2", { ...titleProps, className: "ods-slideout__title", children: title }),
|
|
33285
|
-
/* @__PURE__ */
|
|
33286
|
-
|
|
33287
|
-
|
|
33288
|
-
|
|
33289
|
-
|
|
33290
|
-
|
|
33291
|
-
|
|
33292
|
-
|
|
33293
|
-
|
|
33294
|
-
|
|
33301
|
+
/* @__PURE__ */ jsxs130("div", { className: "ods-slideout__header-actions", children: [
|
|
33302
|
+
headerActions,
|
|
33303
|
+
/* @__PURE__ */ jsx135(
|
|
33304
|
+
"button",
|
|
33305
|
+
{
|
|
33306
|
+
className: "ods-slideout__close",
|
|
33307
|
+
onClick: onClose,
|
|
33308
|
+
"aria-label": "Close panel",
|
|
33309
|
+
type: "button",
|
|
33310
|
+
children: /* @__PURE__ */ jsx135("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx135("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) })
|
|
33311
|
+
}
|
|
33312
|
+
)
|
|
33313
|
+
] })
|
|
33295
33314
|
] }),
|
|
33296
33315
|
/* @__PURE__ */ jsx135("div", { className: "ods-slideout__body", children }),
|
|
33297
33316
|
footer && /* @__PURE__ */ jsx135("div", { className: "ods-slideout__footer", children: footer })
|
|
@@ -34649,6 +34668,8 @@ import {
|
|
|
34649
34668
|
createContext as createContext3,
|
|
34650
34669
|
useCallback as useCallback51,
|
|
34651
34670
|
useContext as useContext4,
|
|
34671
|
+
useEffect as useEffect57,
|
|
34672
|
+
useLayoutEffect as useLayoutEffect12,
|
|
34652
34673
|
useMemo as useMemo37,
|
|
34653
34674
|
useRef as useRef50,
|
|
34654
34675
|
useState as useState71
|
|
@@ -34743,15 +34764,57 @@ var defaultIcons = {
|
|
|
34743
34764
|
] })
|
|
34744
34765
|
};
|
|
34745
34766
|
var ToastContext = createContext3(null);
|
|
34746
|
-
function ToastBody({ item, onDismiss }) {
|
|
34767
|
+
function ToastBody({ item, stacked, onDismiss }) {
|
|
34747
34768
|
const dismiss = () => onDismiss(item.id);
|
|
34769
|
+
const [expanded, setExpanded] = useState71(false);
|
|
34770
|
+
const [overflowing, setOverflowing] = useState71(false);
|
|
34771
|
+
const descRef = useRef50(null);
|
|
34772
|
+
const cut = item.clampLines > 0 && !expanded;
|
|
34773
|
+
useLayoutEffect12(() => {
|
|
34774
|
+
if (!cut) return;
|
|
34775
|
+
const el = descRef.current;
|
|
34776
|
+
if (el) setOverflowing(el.scrollHeight > el.clientHeight + 1);
|
|
34777
|
+
}, [cut, item.description]);
|
|
34748
34778
|
if (item.render) return /* @__PURE__ */ jsx147(Fragment61, { children: item.render({ id: item.id, dismiss }) });
|
|
34749
34779
|
const title = item.title ?? item.message;
|
|
34780
|
+
const toggles = overflowing && !stacked;
|
|
34781
|
+
const toggle = () => setExpanded((v) => !v);
|
|
34782
|
+
const onTextClick = (e) => {
|
|
34783
|
+
if (!toggles) return;
|
|
34784
|
+
if (window.getSelection()?.toString()) return;
|
|
34785
|
+
e.stopPropagation();
|
|
34786
|
+
toggle();
|
|
34787
|
+
};
|
|
34750
34788
|
return /* @__PURE__ */ jsxs141(Fragment61, { children: [
|
|
34751
34789
|
/* @__PURE__ */ jsx147("span", { className: "ods-toast__icon", "aria-hidden": "true", children: item.icon ?? defaultIcons[item.variant] }),
|
|
34752
|
-
/* @__PURE__ */ jsxs141("div", { className: "ods-toast__body", children: [
|
|
34790
|
+
/* @__PURE__ */ jsxs141("div", { className: "ods-toast__body", onClick: onTextClick, children: [
|
|
34753
34791
|
title && /* @__PURE__ */ jsx147("div", { className: "ods-toast__title", children: title }),
|
|
34754
|
-
item.description && /* @__PURE__ */ jsx147(
|
|
34792
|
+
item.description && /* @__PURE__ */ jsx147(
|
|
34793
|
+
"div",
|
|
34794
|
+
{
|
|
34795
|
+
ref: descRef,
|
|
34796
|
+
className: cn(
|
|
34797
|
+
"ods-toast__desc",
|
|
34798
|
+
cut && "ods-toast__desc--cut",
|
|
34799
|
+
toggles && "ods-toast__desc--toggles"
|
|
34800
|
+
),
|
|
34801
|
+
style: cut ? { "--ods-toast-clamp": item.clampLines } : void 0,
|
|
34802
|
+
children: item.description
|
|
34803
|
+
}
|
|
34804
|
+
),
|
|
34805
|
+
toggles && /* @__PURE__ */ jsx147(
|
|
34806
|
+
"button",
|
|
34807
|
+
{
|
|
34808
|
+
type: "button",
|
|
34809
|
+
className: "ods-toast__more",
|
|
34810
|
+
"aria-expanded": expanded,
|
|
34811
|
+
onClick: (e) => {
|
|
34812
|
+
e.stopPropagation();
|
|
34813
|
+
toggle();
|
|
34814
|
+
},
|
|
34815
|
+
children: expanded ? "Less" : "More"
|
|
34816
|
+
}
|
|
34817
|
+
)
|
|
34755
34818
|
] }),
|
|
34756
34819
|
(item.actionLabel || item.action) && /* @__PURE__ */ jsx147("div", { className: "ods-toast__action", children: item.actionLabel ? (
|
|
34757
34820
|
// First-class action chip — consistent styling, auto-dismiss
|
|
@@ -34799,10 +34862,17 @@ function ToastBody({ item, onDismiss }) {
|
|
|
34799
34862
|
)
|
|
34800
34863
|
] });
|
|
34801
34864
|
}
|
|
34802
|
-
function PositionStack({ items, position, onDismiss, maxStack }) {
|
|
34865
|
+
function PositionStack({ items, position, onDismiss, onHold, onRelease, maxStack }) {
|
|
34803
34866
|
const [hovered, setHovered] = useState71(false);
|
|
34867
|
+
const [focused, setFocused] = useState71(false);
|
|
34804
34868
|
const [pinned, setPinned] = useState71(false);
|
|
34805
34869
|
const expanded = hovered || pinned;
|
|
34870
|
+
const held = hovered || focused;
|
|
34871
|
+
const ids = useMemo37(() => items.map((t) => t.id), [items]);
|
|
34872
|
+
useEffect57(() => {
|
|
34873
|
+
if (held) onHold(ids);
|
|
34874
|
+
else onRelease(ids);
|
|
34875
|
+
}, [held, ids, onHold, onRelease]);
|
|
34806
34876
|
const ordered = useMemo37(() => [...items].reverse(), [items]);
|
|
34807
34877
|
const isBottom = position.startsWith("bottom");
|
|
34808
34878
|
const dir = isBottom ? -1 : 1;
|
|
@@ -34830,6 +34900,10 @@ function PositionStack({ items, position, onDismiss, maxStack }) {
|
|
|
34830
34900
|
),
|
|
34831
34901
|
onMouseEnter: () => setHovered(true),
|
|
34832
34902
|
onMouseLeave: () => setHovered(false),
|
|
34903
|
+
onFocus: () => setFocused(true),
|
|
34904
|
+
onBlur: (e) => {
|
|
34905
|
+
if (!e.currentTarget.contains(e.relatedTarget)) setFocused(false);
|
|
34906
|
+
},
|
|
34833
34907
|
"aria-live": "polite",
|
|
34834
34908
|
children: [
|
|
34835
34909
|
/* @__PURE__ */ jsx147(
|
|
@@ -34867,7 +34941,14 @@ function PositionStack({ items, position, onDismiss, maxStack }) {
|
|
|
34867
34941
|
setPinned(true);
|
|
34868
34942
|
}
|
|
34869
34943
|
},
|
|
34870
|
-
children: /* @__PURE__ */ jsx147(
|
|
34944
|
+
children: /* @__PURE__ */ jsx147(
|
|
34945
|
+
ToastBody,
|
|
34946
|
+
{
|
|
34947
|
+
item,
|
|
34948
|
+
stacked: !expanded && items.length > 1,
|
|
34949
|
+
onDismiss
|
|
34950
|
+
}
|
|
34951
|
+
)
|
|
34871
34952
|
},
|
|
34872
34953
|
item.id
|
|
34873
34954
|
);
|
|
@@ -34904,29 +34985,51 @@ function ToastProvider({
|
|
|
34904
34985
|
const [toasts, setToasts] = useState71([]);
|
|
34905
34986
|
const timers = useRef50(/* @__PURE__ */ new Map());
|
|
34906
34987
|
const idCounter2 = useRef50(0);
|
|
34907
|
-
const
|
|
34908
|
-
|
|
34909
|
-
|
|
34910
|
-
|
|
34911
|
-
clearTimeout(timer);
|
|
34912
|
-
timers.current.delete(id);
|
|
34913
|
-
}
|
|
34988
|
+
const forget = useCallback51((id) => {
|
|
34989
|
+
const c = timers.current.get(id);
|
|
34990
|
+
if (c?.handle) clearTimeout(c.handle);
|
|
34991
|
+
timers.current.delete(id);
|
|
34914
34992
|
}, []);
|
|
34915
|
-
const
|
|
34916
|
-
|
|
34917
|
-
|
|
34918
|
-
|
|
34919
|
-
|
|
34920
|
-
|
|
34921
|
-
|
|
34922
|
-
|
|
34923
|
-
|
|
34924
|
-
|
|
34993
|
+
const dismiss = useCallback51(
|
|
34994
|
+
(id) => {
|
|
34995
|
+
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
34996
|
+
forget(id);
|
|
34997
|
+
},
|
|
34998
|
+
[forget]
|
|
34999
|
+
);
|
|
35000
|
+
const dismissAll = useCallback51(
|
|
35001
|
+
(position) => {
|
|
35002
|
+
setToasts((prev) => {
|
|
35003
|
+
const remaining = position ? prev.filter((t) => t.position !== position) : [];
|
|
35004
|
+
for (const t of prev) {
|
|
35005
|
+
if (!remaining.find((r) => r.id === t.id)) forget(t.id);
|
|
34925
35006
|
}
|
|
34926
|
-
|
|
34927
|
-
|
|
34928
|
-
}
|
|
35007
|
+
return remaining;
|
|
35008
|
+
});
|
|
35009
|
+
},
|
|
35010
|
+
[forget]
|
|
35011
|
+
);
|
|
35012
|
+
const hold = useCallback51((ids) => {
|
|
35013
|
+
const now2 = Date.now();
|
|
35014
|
+
for (const id of ids) {
|
|
35015
|
+
const c = timers.current.get(id);
|
|
35016
|
+
if (!c || c.handle === null) continue;
|
|
35017
|
+
clearTimeout(c.handle);
|
|
35018
|
+
c.handle = null;
|
|
35019
|
+
c.remaining = Math.max(0, c.remaining - (now2 - c.since));
|
|
35020
|
+
}
|
|
34929
35021
|
}, []);
|
|
35022
|
+
const release = useCallback51(
|
|
35023
|
+
(ids) => {
|
|
35024
|
+
for (const id of ids) {
|
|
35025
|
+
const c = timers.current.get(id);
|
|
35026
|
+
if (!c || c.handle !== null) continue;
|
|
35027
|
+
c.since = Date.now();
|
|
35028
|
+
c.handle = setTimeout(() => dismiss(id), c.remaining);
|
|
35029
|
+
}
|
|
35030
|
+
},
|
|
35031
|
+
[dismiss]
|
|
35032
|
+
);
|
|
34930
35033
|
const toast = useCallback51(
|
|
34931
35034
|
(options2) => {
|
|
34932
35035
|
const id = `toast-${++idCounter2.current}`;
|
|
@@ -34943,12 +35046,16 @@ function ToastProvider({
|
|
|
34943
35046
|
render: options2.render,
|
|
34944
35047
|
duration: options2.duration ?? 5e3,
|
|
34945
35048
|
closeable: options2.closeable ?? true,
|
|
34946
|
-
position: options2.position ?? defaultPosition
|
|
35049
|
+
position: options2.position ?? defaultPosition,
|
|
35050
|
+
clampLines: options2.clampLines ?? 2
|
|
34947
35051
|
};
|
|
34948
35052
|
setToasts((prev) => [...prev, item]);
|
|
34949
35053
|
if (item.duration > 0) {
|
|
34950
|
-
|
|
34951
|
-
|
|
35054
|
+
timers.current.set(id, {
|
|
35055
|
+
handle: setTimeout(() => dismiss(id), item.duration),
|
|
35056
|
+
remaining: item.duration,
|
|
35057
|
+
since: Date.now()
|
|
35058
|
+
});
|
|
34952
35059
|
}
|
|
34953
35060
|
return id;
|
|
34954
35061
|
},
|
|
@@ -34976,7 +35083,9 @@ function ToastProvider({
|
|
|
34976
35083
|
items: list,
|
|
34977
35084
|
position: pos,
|
|
34978
35085
|
maxStack,
|
|
34979
|
-
onDismiss: dismiss
|
|
35086
|
+
onDismiss: dismiss,
|
|
35087
|
+
onHold: hold,
|
|
35088
|
+
onRelease: release
|
|
34980
35089
|
},
|
|
34981
35090
|
pos
|
|
34982
35091
|
);
|
|
@@ -35828,7 +35937,7 @@ UserCard.displayName = "UserCard";
|
|
|
35828
35937
|
import { useId as useId64, useState as useState74 } from "react";
|
|
35829
35938
|
|
|
35830
35939
|
// src/hooks/useRelativeTime.ts
|
|
35831
|
-
import { useEffect as
|
|
35940
|
+
import { useEffect as useEffect58, useState as useState73 } from "react";
|
|
35832
35941
|
function toMs(t) {
|
|
35833
35942
|
if (t == null) return null;
|
|
35834
35943
|
return typeof t === "number" ? t : t.getTime();
|
|
@@ -35848,7 +35957,7 @@ function formatRelativeTime(when, now2 = Date.now()) {
|
|
|
35848
35957
|
function useRelativeTime(date, options2 = {}) {
|
|
35849
35958
|
const { intervalMs = 3e4 } = options2;
|
|
35850
35959
|
const [now2, setNow] = useState73(() => Date.now());
|
|
35851
|
-
|
|
35960
|
+
useEffect58(() => {
|
|
35852
35961
|
if (typeof window === "undefined") return;
|
|
35853
35962
|
const id = window.setInterval(() => setNow(Date.now()), intervalMs);
|
|
35854
35963
|
return () => window.clearInterval(id);
|
|
@@ -35912,7 +36021,20 @@ function VersionHistory({
|
|
|
35912
36021
|
}) {
|
|
35913
36022
|
const [expandedId, setExpandedId] = useState74(defaultExpandedId);
|
|
35914
36023
|
const baseId = useId64();
|
|
35915
|
-
const showToolbar = Boolean(tabs && tabs.length > 0
|
|
36024
|
+
const showToolbar = Boolean(tabs && tabs.length > 0);
|
|
36025
|
+
const refreshButton = onRefresh ? /* @__PURE__ */ jsx155(
|
|
36026
|
+
"button",
|
|
36027
|
+
{
|
|
36028
|
+
type: "button",
|
|
36029
|
+
className: "ods-version-history__refresh",
|
|
36030
|
+
onClick: onRefresh,
|
|
36031
|
+
disabled: refreshing,
|
|
36032
|
+
"aria-label": "Refresh history",
|
|
36033
|
+
title: "Refresh",
|
|
36034
|
+
"data-spinning": refreshing || void 0,
|
|
36035
|
+
children: /* @__PURE__ */ jsx155(RefreshGlyph, {})
|
|
36036
|
+
}
|
|
36037
|
+
) : null;
|
|
35916
36038
|
return /* @__PURE__ */ jsxs149(
|
|
35917
36039
|
SlideoutPanel,
|
|
35918
36040
|
{
|
|
@@ -35921,6 +36043,7 @@ function VersionHistory({
|
|
|
35921
36043
|
position,
|
|
35922
36044
|
width,
|
|
35923
36045
|
title,
|
|
36046
|
+
headerActions: showToolbar ? void 0 : refreshButton,
|
|
35924
36047
|
offsetTop,
|
|
35925
36048
|
offsetBottom,
|
|
35926
36049
|
className: cn("ods-version-history", className),
|
|
@@ -35948,19 +36071,7 @@ function VersionHistory({
|
|
|
35948
36071
|
tab.id
|
|
35949
36072
|
);
|
|
35950
36073
|
}) }) : /* @__PURE__ */ jsx155("span", {}),
|
|
35951
|
-
|
|
35952
|
-
"button",
|
|
35953
|
-
{
|
|
35954
|
-
type: "button",
|
|
35955
|
-
className: "ods-version-history__refresh",
|
|
35956
|
-
onClick: onRefresh,
|
|
35957
|
-
disabled: refreshing,
|
|
35958
|
-
"aria-label": "Refresh history",
|
|
35959
|
-
title: "Refresh",
|
|
35960
|
-
"data-spinning": refreshing || void 0,
|
|
35961
|
-
children: /* @__PURE__ */ jsx155(RefreshGlyph, {})
|
|
35962
|
-
}
|
|
35963
|
-
)
|
|
36074
|
+
refreshButton
|
|
35964
36075
|
] }),
|
|
35965
36076
|
error && /* @__PURE__ */ jsx155("div", { className: "ods-version-history__banner", children: /* @__PURE__ */ jsx155(Banner, { variant: "error", appearance: "subtle", title: "Couldn't load history", description: error }) }),
|
|
35966
36077
|
/* @__PURE__ */ jsx155("div", { className: "ods-version-history__body", role: "tabpanel", children: loading ? /* @__PURE__ */ jsxs149("div", { className: "ods-version-history__status", role: "status", "aria-live": "polite", children: [
|
|
@@ -37165,7 +37276,7 @@ import {
|
|
|
37165
37276
|
} from "@octaviaflow/icons";
|
|
37166
37277
|
|
|
37167
37278
|
// src/hooks/useWorkflowRuntime.ts
|
|
37168
|
-
import { useEffect as
|
|
37279
|
+
import { useEffect as useEffect59, useState as useState76 } from "react";
|
|
37169
37280
|
function toMs2(t) {
|
|
37170
37281
|
if (t == null) return null;
|
|
37171
37282
|
return typeof t === "number" ? t : t.getTime();
|
|
@@ -37180,7 +37291,7 @@ function formatWorkflowRuntime(ms) {
|
|
|
37180
37291
|
}
|
|
37181
37292
|
function useWorkflowRuntime(startedAt, active) {
|
|
37182
37293
|
const [, force] = useState76(0);
|
|
37183
|
-
|
|
37294
|
+
useEffect59(() => {
|
|
37184
37295
|
if (!active || startedAt == null) return;
|
|
37185
37296
|
if (typeof window === "undefined") return;
|
|
37186
37297
|
const id = window.setInterval(() => force((n) => n + 1), 1e3);
|
|
@@ -37560,13 +37671,13 @@ function WorkflowHeaderExpanded({
|
|
|
37560
37671
|
}
|
|
37561
37672
|
|
|
37562
37673
|
// src/hooks/useBanner.ts
|
|
37563
|
-
import { useCallback as useCallback56, useEffect as
|
|
37674
|
+
import { useCallback as useCallback56, useEffect as useEffect60, useRef as useRef52, useState as useState77 } from "react";
|
|
37564
37675
|
function useBanner(options2 = {}) {
|
|
37565
37676
|
const { defaultOpen = false, autoDismissAfter, onDismiss } = options2;
|
|
37566
37677
|
const [open, setOpen] = useState77(defaultOpen);
|
|
37567
37678
|
const timerRef = useRef52(null);
|
|
37568
37679
|
const onDismissRef = useRef52(onDismiss);
|
|
37569
|
-
|
|
37680
|
+
useEffect60(() => {
|
|
37570
37681
|
onDismissRef.current = onDismiss;
|
|
37571
37682
|
}, [onDismiss]);
|
|
37572
37683
|
const clearTimer = useCallback56(() => {
|
|
@@ -37597,7 +37708,7 @@ function useBanner(options2 = {}) {
|
|
|
37597
37708
|
if (open) hide();
|
|
37598
37709
|
else show();
|
|
37599
37710
|
}, [open, show, hide]);
|
|
37600
|
-
|
|
37711
|
+
useEffect60(() => () => clearTimer(), [clearTimer]);
|
|
37601
37712
|
return {
|
|
37602
37713
|
open,
|
|
37603
37714
|
show,
|
|
@@ -37665,7 +37776,7 @@ function breakpointMinWidth(name) {
|
|
|
37665
37776
|
}
|
|
37666
37777
|
|
|
37667
37778
|
// src/hooks/useCallout.ts
|
|
37668
|
-
import { useCallback as useCallback57, useEffect as
|
|
37779
|
+
import { useCallback as useCallback57, useEffect as useEffect61, useState as useState78 } from "react";
|
|
37669
37780
|
var STORAGE_PREFIX = "ods:callout:dismissed:";
|
|
37670
37781
|
function readPersisted(key) {
|
|
37671
37782
|
if (!key || typeof window === "undefined") return false;
|
|
@@ -37689,7 +37800,7 @@ function writePersisted(key, value) {
|
|
|
37689
37800
|
function useCallout(options2 = {}) {
|
|
37690
37801
|
const { defaultOpen = true, persistKey, onDismiss } = options2;
|
|
37691
37802
|
const [open, setOpen] = useState78(defaultOpen);
|
|
37692
|
-
|
|
37803
|
+
useEffect61(() => {
|
|
37693
37804
|
if (persistKey && readPersisted(persistKey)) {
|
|
37694
37805
|
setOpen(false);
|
|
37695
37806
|
}
|
|
@@ -39510,7 +39621,7 @@ NotificationChannelCard.displayName = "NotificationChannelCard";
|
|
|
39510
39621
|
|
|
39511
39622
|
// src/notifications/components/NotificationChannelDialog/NotificationChannelDialog.tsx
|
|
39512
39623
|
import { SendIcon as SendIcon2 } from "@octaviaflow/icons";
|
|
39513
|
-
import { useEffect as
|
|
39624
|
+
import { useEffect as useEffect62, useMemo as useMemo42, useState as useState86 } from "react";
|
|
39514
39625
|
|
|
39515
39626
|
// src/notifications/engine/channels.ts
|
|
39516
39627
|
var CONNECTED_CHANNEL_TYPES = [
|
|
@@ -39968,7 +40079,7 @@ function NotificationChannelDialog({
|
|
|
39968
40079
|
const [testing, setTesting] = useState86(false);
|
|
39969
40080
|
const [testResult, setTestResult] = useState86(null);
|
|
39970
40081
|
const [submitError, setSubmitError] = useState86(null);
|
|
39971
|
-
|
|
40082
|
+
useEffect62(() => {
|
|
39972
40083
|
if (!open) return;
|
|
39973
40084
|
setDraft(draftFromChannel(channel, initialType));
|
|
39974
40085
|
setSubmitted(false);
|
|
@@ -40909,13 +41020,13 @@ NotificationRuleList.displayName = "NotificationRuleList";
|
|
|
40909
41020
|
|
|
40910
41021
|
// src/provider/OdsProvider.tsx
|
|
40911
41022
|
import { generateCssVars, resolveConfig } from "@octaviaflow/config";
|
|
40912
|
-
import { createContext as createContext4, useContext as useContext5, useEffect as
|
|
41023
|
+
import { createContext as createContext4, useContext as useContext5, useEffect as useEffect63, useMemo as useMemo45 } from "react";
|
|
40913
41024
|
import { OverlayProvider as OverlayProvider3 } from "react-aria";
|
|
40914
41025
|
import { jsx as jsx173 } from "react/jsx-runtime";
|
|
40915
41026
|
var OdsContext = createContext4(null);
|
|
40916
41027
|
function OdsProvider({ config: userConfig, children }) {
|
|
40917
41028
|
const resolved = useMemo45(() => resolveConfig(userConfig), [userConfig]);
|
|
40918
|
-
|
|
41029
|
+
useEffect63(() => {
|
|
40919
41030
|
const cssVarsBlock = generateCssVars(resolved);
|
|
40920
41031
|
const match = cssVarsBlock.match(/:root\s*\{([\s\S]*)\}/);
|
|
40921
41032
|
if (match) {
|