@octaviaflow/core 3.0.18-beta.33 → 3.0.18-beta.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -12641,7 +12641,7 @@ var COLLAPSED_HEIGHT = 36;
|
|
|
12641
12641
|
var DEFAULT_EXPANDED_HEIGHT = 240;
|
|
12642
12642
|
var ALL_LEVELS = ["info", "warn", "error", "debug", "success"];
|
|
12643
12643
|
function ExecutionConsole({
|
|
12644
|
-
open
|
|
12644
|
+
open: openProp,
|
|
12645
12645
|
onToggle,
|
|
12646
12646
|
logs = [],
|
|
12647
12647
|
running = false,
|
|
@@ -12660,8 +12660,10 @@ function ExecutionConsole({
|
|
|
12660
12660
|
emptyState,
|
|
12661
12661
|
className
|
|
12662
12662
|
}) {
|
|
12663
|
+
const open = openProp ?? height != null;
|
|
12663
12664
|
const logEndRef = useRef23(null);
|
|
12664
12665
|
const logsRef = useRef23(null);
|
|
12666
|
+
const lastScrollTopRef = useRef23(0);
|
|
12665
12667
|
const [query, setQuery] = useState22("");
|
|
12666
12668
|
const [activeLevels, setActiveLevels] = useState22(() => new Set(ALL_LEVELS));
|
|
12667
12669
|
const [activeNode, setActiveNode] = useState22("all");
|
|
@@ -12699,9 +12701,13 @@ function ExecutionConsole({
|
|
|
12699
12701
|
const handleLogsScroll = () => {
|
|
12700
12702
|
const el = logsRef.current;
|
|
12701
12703
|
if (!el) return;
|
|
12702
|
-
const
|
|
12703
|
-
|
|
12704
|
+
const prev = lastScrollTopRef.current;
|
|
12705
|
+
const curr = el.scrollTop;
|
|
12706
|
+
const distance = el.scrollHeight - curr - el.clientHeight;
|
|
12707
|
+
const userScrolledUp = curr < prev - 1;
|
|
12708
|
+
if (userScrolledUp && distance > 60 && autoScroll) setAutoScroll(false);
|
|
12704
12709
|
if (distance <= 8 && !autoScroll) setAutoScroll(true);
|
|
12710
|
+
lastScrollTopRef.current = curr;
|
|
12705
12711
|
};
|
|
12706
12712
|
const toggleLevel = (level) => {
|
|
12707
12713
|
setActiveLevels((prev) => {
|