@cjlapao/ui-kit 0.2.40 → 0.2.41
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.cjs +227 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +100 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +73 -1
- package/dist/index.d.ts +73 -1
- package/dist/index.js +456 -262
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -69464,11 +69464,11 @@ import classNames124 from "classnames";
|
|
|
69464
69464
|
|
|
69465
69465
|
// src/components/WorkflowTracker/WorkflowTrackerRail.tsx
|
|
69466
69466
|
import {
|
|
69467
|
-
useEffect as
|
|
69467
|
+
useEffect as useEffect77,
|
|
69468
69468
|
useId as useId47,
|
|
69469
69469
|
useMemo as useMemo55,
|
|
69470
|
-
useRef as
|
|
69471
|
-
useState as
|
|
69470
|
+
useRef as useRef78,
|
|
69471
|
+
useState as useState87
|
|
69472
69472
|
} from "react";
|
|
69473
69473
|
import classNames117 from "classnames";
|
|
69474
69474
|
|
|
@@ -69537,7 +69537,7 @@ function useWorkflowFooterResize({ height, defaultHeight, onChange, enabled }) {
|
|
|
69537
69537
|
}
|
|
69538
69538
|
|
|
69539
69539
|
// src/components/WorkflowTracker/WorkflowTimeline.tsx
|
|
69540
|
-
import React96 from "react";
|
|
69540
|
+
import React96, { useEffect as useEffect76, useLayoutEffect as useLayoutEffect30, useRef as useRef77, useState as useState86 } from "react";
|
|
69541
69541
|
import classNames116 from "classnames";
|
|
69542
69542
|
|
|
69543
69543
|
// src/components/WorkflowTracker/WorkflowSkeleton.tsx
|
|
@@ -70014,6 +70014,7 @@ import { Fragment as Fragment52, jsx as jsx344, jsxs as jsxs209 } from "react/js
|
|
|
70014
70014
|
var CONNECTOR_LEFT = 9;
|
|
70015
70015
|
var CONNECTOR_TOP = 24;
|
|
70016
70016
|
var NESTED_INDENT = 32;
|
|
70017
|
+
var SUB_STEP_ROOT_MARGIN = 120;
|
|
70017
70018
|
var LEGEND_ORDER = [
|
|
70018
70019
|
"done",
|
|
70019
70020
|
"in_progress",
|
|
@@ -70026,43 +70027,202 @@ var LEGEND_ORDER = [
|
|
|
70026
70027
|
var NestedSubSteps = ({
|
|
70027
70028
|
stepId,
|
|
70028
70029
|
subSteps,
|
|
70030
|
+
maxVisible,
|
|
70031
|
+
loadMode = "scroll",
|
|
70032
|
+
order = "reverse",
|
|
70029
70033
|
palette,
|
|
70030
70034
|
customStatuses,
|
|
70031
70035
|
surfaces,
|
|
70036
|
+
labels,
|
|
70032
70037
|
onSubStepSelect
|
|
70033
|
-
}) =>
|
|
70034
|
-
|
|
70035
|
-
|
|
70036
|
-
|
|
70037
|
-
|
|
70038
|
-
|
|
70039
|
-
|
|
70040
|
-
|
|
70041
|
-
|
|
70042
|
-
|
|
70043
|
-
|
|
70044
|
-
|
|
70045
|
-
|
|
70046
|
-
|
|
70047
|
-
|
|
70048
|
-
|
|
70049
|
-
|
|
70050
|
-
|
|
70051
|
-
|
|
70052
|
-
|
|
70053
|
-
|
|
70054
|
-
|
|
70055
|
-
|
|
70038
|
+
}) => {
|
|
70039
|
+
const total = subSteps.length;
|
|
70040
|
+
const capped = maxVisible !== void 0 && maxVisible > 0 && maxVisible < total;
|
|
70041
|
+
const [visibleCount, setVisibleCount] = useState86(maxVisible ?? total);
|
|
70042
|
+
const shownCount = Math.min(visibleCount, total);
|
|
70043
|
+
const visible = subSteps.slice(
|
|
70044
|
+
order === "reverse" ? total - shownCount : 0,
|
|
70045
|
+
order === "reverse" ? total : shownCount
|
|
70046
|
+
);
|
|
70047
|
+
const hasMore = capped && shownCount < total;
|
|
70048
|
+
const viewportRef = useRef77(null);
|
|
70049
|
+
const sentinelRef = useRef77(null);
|
|
70050
|
+
const listRef = useRef77(null);
|
|
70051
|
+
const [frozenMaxPx, setFrozenMaxPx] = useState86(null);
|
|
70052
|
+
const hasObserver = typeof IntersectionObserver !== "undefined";
|
|
70053
|
+
const scrolls = capped && loadMode === "scroll" && hasObserver;
|
|
70054
|
+
const reverse = order === "reverse";
|
|
70055
|
+
const capRef = useRef77(maxVisible);
|
|
70056
|
+
useEffect76(() => {
|
|
70057
|
+
if (capRef.current === maxVisible) return;
|
|
70058
|
+
capRef.current = maxVisible;
|
|
70059
|
+
setVisibleCount(
|
|
70060
|
+
maxVisible !== void 0 && maxVisible > 0 ? Math.min(maxVisible, total) : total
|
|
70061
|
+
);
|
|
70062
|
+
setFrozenMaxPx(null);
|
|
70063
|
+
}, [maxVisible, total]);
|
|
70064
|
+
useLayoutEffect30(() => {
|
|
70065
|
+
if (!scrolls || frozenMaxPx != null) return;
|
|
70066
|
+
const height = listRef.current?.offsetHeight ?? 0;
|
|
70067
|
+
if (height > 0) setFrozenMaxPx(height);
|
|
70068
|
+
}, [scrolls, frozenMaxPx]);
|
|
70069
|
+
const anchorRef = useRef77(null);
|
|
70070
|
+
useLayoutEffect30(() => {
|
|
70071
|
+
const before = anchorRef.current;
|
|
70072
|
+
if (before == null) return;
|
|
70073
|
+
anchorRef.current = null;
|
|
70074
|
+
const vp = viewportRef.current;
|
|
70075
|
+
if (vp) vp.scrollTop += vp.scrollHeight - before;
|
|
70076
|
+
}, [shownCount]);
|
|
70077
|
+
const bottomedRef = useRef77(false);
|
|
70078
|
+
useLayoutEffect30(() => {
|
|
70079
|
+
if (!scrolls || !reverse || bottomedRef.current || frozenMaxPx == null) return;
|
|
70080
|
+
const vp = viewportRef.current;
|
|
70081
|
+
if (vp) {
|
|
70082
|
+
vp.scrollTop = vp.scrollHeight;
|
|
70083
|
+
bottomedRef.current = true;
|
|
70084
|
+
}
|
|
70085
|
+
}, [scrolls, reverse, frozenMaxPx]);
|
|
70086
|
+
const atBottomRef = useRef77(true);
|
|
70087
|
+
useEffect76(() => {
|
|
70088
|
+
if (!scrolls || !reverse) return;
|
|
70089
|
+
const vp = viewportRef.current;
|
|
70090
|
+
if (!vp) return;
|
|
70091
|
+
const onScroll = () => {
|
|
70092
|
+
atBottomRef.current = vp.scrollHeight - vp.scrollTop - vp.clientHeight <= 8;
|
|
70093
|
+
};
|
|
70094
|
+
vp.addEventListener("scroll", onScroll, { passive: true });
|
|
70095
|
+
return () => vp.removeEventListener("scroll", onScroll);
|
|
70096
|
+
}, [scrolls, reverse]);
|
|
70097
|
+
const prevTotalRef = useRef77(total);
|
|
70098
|
+
useLayoutEffect30(() => {
|
|
70099
|
+
const delta = total - prevTotalRef.current;
|
|
70100
|
+
const prevTotal = prevTotalRef.current;
|
|
70101
|
+
prevTotalRef.current = total;
|
|
70102
|
+
if (delta <= 0 || !reverse) return;
|
|
70103
|
+
setVisibleCount(
|
|
70104
|
+
(count) => count >= prevTotal || maxVisible === void 0 || count > maxVisible ? count + delta : count
|
|
70105
|
+
);
|
|
70106
|
+
const vp = viewportRef.current;
|
|
70107
|
+
if (vp && atBottomRef.current) vp.scrollTop = vp.scrollHeight;
|
|
70108
|
+
}, [total, reverse, maxVisible]);
|
|
70109
|
+
const scroll = useInfiniteScroll({
|
|
70110
|
+
rootRef: viewportRef,
|
|
70111
|
+
sentinelRef,
|
|
70112
|
+
hasMore: scrolls && hasMore,
|
|
70113
|
+
itemCount: shownCount,
|
|
70114
|
+
rootMargin: SUB_STEP_ROOT_MARGIN,
|
|
70115
|
+
onLoadMore: async () => {
|
|
70116
|
+
if (reverse) anchorRef.current = viewportRef.current?.scrollHeight ?? null;
|
|
70117
|
+
setVisibleCount(
|
|
70118
|
+
(count) => Math.min(count + (maxVisible ?? total), total)
|
|
70119
|
+
);
|
|
70120
|
+
}
|
|
70121
|
+
});
|
|
70122
|
+
const list = /* @__PURE__ */ jsx344("ul", { ref: listRef, className: "space-y-2.5", children: visible.map((subStep) => {
|
|
70123
|
+
const status = normalizeStatus(subStep.status, customStatuses);
|
|
70124
|
+
const isActive = status === "running" || status === "in_progress";
|
|
70125
|
+
const content = /* @__PURE__ */ jsxs209(Fragment52, { children: [
|
|
70126
|
+
/* @__PURE__ */ jsx344(WorkflowStatusNode_default, { status, palette, customStatuses, size: "sm" }),
|
|
70127
|
+
/* @__PURE__ */ jsx344(
|
|
70128
|
+
"span",
|
|
70056
70129
|
{
|
|
70057
|
-
|
|
70058
|
-
|
|
70059
|
-
|
|
70060
|
-
|
|
70130
|
+
className: classNames116(
|
|
70131
|
+
"min-w-0 flex-1 truncate text-sm",
|
|
70132
|
+
isActive ? "font-semibold text-neutral-900 dark:text-white" : "text-neutral-600 dark:text-neutral-300"
|
|
70133
|
+
),
|
|
70134
|
+
children: subStep.label
|
|
70061
70135
|
}
|
|
70062
|
-
)
|
|
70063
|
-
|
|
70064
|
-
|
|
70065
|
-
|
|
70136
|
+
)
|
|
70137
|
+
] });
|
|
70138
|
+
return /* @__PURE__ */ jsx344("li", { children: onSubStepSelect ? /* @__PURE__ */ jsx344(
|
|
70139
|
+
"button",
|
|
70140
|
+
{
|
|
70141
|
+
type: "button",
|
|
70142
|
+
onClick: () => onSubStepSelect(stepId, subStep.id),
|
|
70143
|
+
className: "flex w-full min-w-0 items-center gap-2.5 rounded-sm text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 dark:focus-visible:ring-neutral-500",
|
|
70144
|
+
children: content
|
|
70145
|
+
}
|
|
70146
|
+
) : /* @__PURE__ */ jsx344("div", { className: "flex w-full min-w-0 items-center gap-2.5", children: content }) }, subStep.id);
|
|
70147
|
+
}) });
|
|
70148
|
+
const scrollTail = /* @__PURE__ */ jsxs209(Fragment52, { children: [
|
|
70149
|
+
/* @__PURE__ */ jsx344("div", { ref: sentinelRef, "aria-hidden": "true" }),
|
|
70150
|
+
scroll.error ? /* @__PURE__ */ jsxs209(
|
|
70151
|
+
"div",
|
|
70152
|
+
{
|
|
70153
|
+
"data-slot": "workflow-substeps-scroll-error",
|
|
70154
|
+
className: classNames116(
|
|
70155
|
+
"flex items-center justify-center gap-2 text-xs text-rose-600 dark:text-rose-400",
|
|
70156
|
+
reverse ? "mb-2" : "mt-2"
|
|
70157
|
+
),
|
|
70158
|
+
children: [
|
|
70159
|
+
labels.loadMoreError,
|
|
70160
|
+
/* @__PURE__ */ jsx344(Button_default, { size: "xs", variant: "link", onClick: () => void scroll.loadMore(), children: "Try again" })
|
|
70161
|
+
]
|
|
70162
|
+
}
|
|
70163
|
+
) : scroll.isLoadingMore ? /* @__PURE__ */ jsx344(
|
|
70164
|
+
"div",
|
|
70165
|
+
{
|
|
70166
|
+
"data-slot": "workflow-substeps-scroll-loading",
|
|
70167
|
+
className: classNames116("flex justify-center py-1", reverse ? "mb-1" : "mt-1"),
|
|
70168
|
+
role: "status",
|
|
70169
|
+
"aria-label": labels.loadingMore,
|
|
70170
|
+
children: /* @__PURE__ */ jsx344(Spinner_default, { size: "xs", color: palette.accent })
|
|
70171
|
+
}
|
|
70172
|
+
) : null
|
|
70173
|
+
] });
|
|
70174
|
+
const remaining = total - shownCount;
|
|
70175
|
+
const buttonTail = hasMore ? /* @__PURE__ */ jsx344("div", { className: "mt-2 flex justify-center", children: /* @__PURE__ */ jsx344(
|
|
70176
|
+
Button_default,
|
|
70177
|
+
{
|
|
70178
|
+
size: "xs",
|
|
70179
|
+
variant: "link",
|
|
70180
|
+
color: palette.accent,
|
|
70181
|
+
onClick: () => setVisibleCount(
|
|
70182
|
+
(count) => Math.min(count + (maxVisible ?? total), total)
|
|
70183
|
+
),
|
|
70184
|
+
children: labels.showMore.replace(
|
|
70185
|
+
"{count}",
|
|
70186
|
+
String(Math.min(maxVisible ?? remaining, remaining))
|
|
70187
|
+
)
|
|
70188
|
+
}
|
|
70189
|
+
) }) : capped ? /* @__PURE__ */ jsx344("div", { className: "mt-2 flex justify-center", children: /* @__PURE__ */ jsx344(
|
|
70190
|
+
Button_default,
|
|
70191
|
+
{
|
|
70192
|
+
size: "xs",
|
|
70193
|
+
variant: "link",
|
|
70194
|
+
color: palette.accent,
|
|
70195
|
+
onClick: () => setVisibleCount(maxVisible ?? total),
|
|
70196
|
+
children: labels.showLess
|
|
70197
|
+
}
|
|
70198
|
+
) }) : null;
|
|
70199
|
+
return /* @__PURE__ */ jsx344(
|
|
70200
|
+
"div",
|
|
70201
|
+
{
|
|
70202
|
+
className: classNames116("mt-3 overflow-hidden rounded-lg p-3", surfaces.nestedBox),
|
|
70203
|
+
style: { marginLeft: NESTED_INDENT },
|
|
70204
|
+
children: scrolls ? /* @__PURE__ */ jsx344(
|
|
70205
|
+
ScrollArea_default,
|
|
70206
|
+
{
|
|
70207
|
+
variant: "hover",
|
|
70208
|
+
horizontal: false,
|
|
70209
|
+
viewportRef,
|
|
70210
|
+
style: frozenMaxPx != null ? { maxHeight: frozenMaxPx } : void 0,
|
|
70211
|
+
viewportClassName: "overscroll-contain",
|
|
70212
|
+
contentClassName: "table-fixed w-full",
|
|
70213
|
+
children: /* @__PURE__ */ jsxs209("div", { children: [
|
|
70214
|
+
reverse && scrollTail,
|
|
70215
|
+
list,
|
|
70216
|
+
!reverse && scrollTail
|
|
70217
|
+
] })
|
|
70218
|
+
}
|
|
70219
|
+
) : /* @__PURE__ */ jsxs209(Fragment52, { children: [
|
|
70220
|
+
list,
|
|
70221
|
+
hasMore || capped ? buttonTail : null
|
|
70222
|
+
] })
|
|
70223
|
+
}
|
|
70224
|
+
);
|
|
70225
|
+
};
|
|
70066
70226
|
var WorkflowTimeline = ({
|
|
70067
70227
|
disableFutureSteps = false,
|
|
70068
70228
|
controls,
|
|
@@ -70081,6 +70241,9 @@ var WorkflowTimeline = ({
|
|
|
70081
70241
|
fillHeight = false,
|
|
70082
70242
|
steps,
|
|
70083
70243
|
activeStepId,
|
|
70244
|
+
maxVisibleSubSteps,
|
|
70245
|
+
subStepLoadMode = "scroll",
|
|
70246
|
+
subStepOrder = "reverse",
|
|
70084
70247
|
palette,
|
|
70085
70248
|
customStatuses,
|
|
70086
70249
|
surfaces,
|
|
@@ -70196,10 +70359,18 @@ var WorkflowTimeline = ({
|
|
|
70196
70359
|
ScrollArea_default,
|
|
70197
70360
|
{
|
|
70198
70361
|
variant: "hover",
|
|
70362
|
+
horizontal: false,
|
|
70199
70363
|
className: fillHeight ? "min-h-0 flex-1" : void 0,
|
|
70200
70364
|
style: fillHeight ? { flex: `${hasFooter ? 100 - footer.percentage : 100} 1 0%` } : void 0,
|
|
70201
70365
|
viewportClassName: "overscroll-contain",
|
|
70202
70366
|
contentClassName: classNames116(
|
|
70367
|
+
// The rail is a vertical list: the content table must size to the
|
|
70368
|
+
// viewport, never to the widest row. Without this, one long
|
|
70369
|
+
// unbreakable label sets the table's min-content width wider than
|
|
70370
|
+
// the card (the row's truncation cannot help — a table sizes from
|
|
70371
|
+
// descendants' min-content), and the scroller — or the card's own
|
|
70372
|
+
// edge, clipped — eats the rows.
|
|
70373
|
+
"table-fixed w-full",
|
|
70203
70374
|
!loading && !isEmpty2 && (collapsed ? "px-2 py-4" : "px-5 py-5")
|
|
70204
70375
|
),
|
|
70205
70376
|
children: loading ? /* @__PURE__ */ jsx344(WorkflowRailSkeleton, { rows: loadingRows, collapsed }) : isEmpty2 ? collapsed ? /* @__PURE__ */ jsx344("span", { className: "sr-only", children: labels.empty }) : emptyState ?? /* @__PURE__ */ jsx344(
|
|
@@ -70387,9 +70558,13 @@ var WorkflowTimeline = ({
|
|
|
70387
70558
|
{
|
|
70388
70559
|
stepId: step.id,
|
|
70389
70560
|
subSteps: nested,
|
|
70561
|
+
maxVisible: maxVisibleSubSteps,
|
|
70562
|
+
loadMode: subStepLoadMode,
|
|
70563
|
+
order: subStepOrder,
|
|
70390
70564
|
palette,
|
|
70391
70565
|
customStatuses,
|
|
70392
70566
|
surfaces,
|
|
70567
|
+
labels,
|
|
70393
70568
|
onSubStepSelect: disabled ? void 0 : onSubStepSelect
|
|
70394
70569
|
}
|
|
70395
70570
|
)
|
|
@@ -70426,9 +70601,10 @@ var WorkflowTimeline = ({
|
|
|
70426
70601
|
ScrollArea_default,
|
|
70427
70602
|
{
|
|
70428
70603
|
variant: "hover",
|
|
70604
|
+
horizontal: false,
|
|
70429
70605
|
className: fillHeight ? "min-h-0 flex-1" : void 0,
|
|
70430
70606
|
viewportClassName: "overscroll-contain",
|
|
70431
|
-
contentClassName: classNames116(collapsed ? "px-2 pb-4" : "px-5 pb-4", !hasFooterHeader && "pt-4"),
|
|
70607
|
+
contentClassName: classNames116("table-fixed w-full", collapsed ? "px-2 pb-4" : "px-5 pb-4", !hasFooterHeader && "pt-4"),
|
|
70432
70608
|
children: controls
|
|
70433
70609
|
}
|
|
70434
70610
|
)
|
|
@@ -70488,6 +70664,10 @@ var DEFAULT_LABELS = {
|
|
|
70488
70664
|
noActiveStep: "No step selected",
|
|
70489
70665
|
details: "Step details",
|
|
70490
70666
|
quickActions: "Quick actions",
|
|
70667
|
+
showMore: "Show {count} more",
|
|
70668
|
+
showLess: "Show less",
|
|
70669
|
+
loadMoreError: "Couldn\u2019t load more",
|
|
70670
|
+
loadingMore: "Loading more",
|
|
70491
70671
|
statuses: {
|
|
70492
70672
|
done: "Done",
|
|
70493
70673
|
in_progress: "In progress",
|
|
@@ -70838,6 +71018,9 @@ var WorkflowTrackerRail = ({
|
|
|
70838
71018
|
footerResizeLabel = "Resize workflow footer",
|
|
70839
71019
|
stepPopoverProps,
|
|
70840
71020
|
data = sampleWorkflow,
|
|
71021
|
+
maxVisibleSubSteps,
|
|
71022
|
+
subStepLoadMode = "scroll",
|
|
71023
|
+
subStepOrder = "reverse",
|
|
70841
71024
|
loading = false,
|
|
70842
71025
|
loadingRows = 6,
|
|
70843
71026
|
showLegend = true,
|
|
@@ -70853,7 +71036,7 @@ var WorkflowTrackerRail = ({
|
|
|
70853
71036
|
style,
|
|
70854
71037
|
...styleProps
|
|
70855
71038
|
}) => {
|
|
70856
|
-
const [internalCollapsed, setInternalCollapsed] =
|
|
71039
|
+
const [internalCollapsed, setInternalCollapsed] = useState87(defaultCollapsed);
|
|
70857
71040
|
const isCollapsed = collapsible && (collapsed ?? internalCollapsed);
|
|
70858
71041
|
const timelineId = useId47();
|
|
70859
71042
|
const scrollBody = fillHeight || (cardScrollable ?? false);
|
|
@@ -70871,16 +71054,16 @@ var WorkflowTrackerRail = ({
|
|
|
70871
71054
|
const slide = motion === "slide";
|
|
70872
71055
|
const padPx = getSurfacePaddingPx(cardProps.padding ?? "none");
|
|
70873
71056
|
const expandedWidth = typeof style?.width === "number" ? style.width : 360;
|
|
70874
|
-
const [sweepDir, setSweepDir] =
|
|
70875
|
-
const sweepKeyRef =
|
|
70876
|
-
|
|
71057
|
+
const [sweepDir, setSweepDir] = useState87(null);
|
|
71058
|
+
const sweepKeyRef = useRef78(isCollapsed);
|
|
71059
|
+
useEffect77(() => {
|
|
70877
71060
|
const prev = sweepKeyRef.current;
|
|
70878
71061
|
sweepKeyRef.current = isCollapsed;
|
|
70879
71062
|
if (!slide || reduced || prev === isCollapsed) return;
|
|
70880
71063
|
setSweepDir(isCollapsed ? "out" : "in");
|
|
70881
71064
|
}, [slide, reduced, isCollapsed]);
|
|
70882
|
-
const railRef =
|
|
70883
|
-
|
|
71065
|
+
const railRef = useRef78(null);
|
|
71066
|
+
useEffect77(() => {
|
|
70884
71067
|
if (!collapsible) return;
|
|
70885
71068
|
const prop = side === "left" ? "--page-zone-min-left" : "--page-zone-min-right";
|
|
70886
71069
|
const row = railRef.current?.closest("[data-page-row]");
|
|
@@ -71002,6 +71185,9 @@ var WorkflowTrackerRail = ({
|
|
|
71002
71185
|
fillHeight: scrollBody,
|
|
71003
71186
|
steps,
|
|
71004
71187
|
activeStepId: active?.step.id,
|
|
71188
|
+
maxVisibleSubSteps,
|
|
71189
|
+
subStepLoadMode,
|
|
71190
|
+
subStepOrder,
|
|
71005
71191
|
palette,
|
|
71006
71192
|
customStatuses,
|
|
71007
71193
|
surfaces,
|
|
@@ -71465,6 +71651,9 @@ var WorkflowTracker = ({
|
|
|
71465
71651
|
fillHeightOffset = 0,
|
|
71466
71652
|
loading = false,
|
|
71467
71653
|
loadingRows = 6,
|
|
71654
|
+
maxVisibleSubSteps,
|
|
71655
|
+
subStepLoadMode = "scroll",
|
|
71656
|
+
subStepOrder = "reverse",
|
|
71468
71657
|
emptyState,
|
|
71469
71658
|
showHeader = true,
|
|
71470
71659
|
showLegend = true,
|
|
@@ -71581,6 +71770,9 @@ var WorkflowTracker = ({
|
|
|
71581
71770
|
data,
|
|
71582
71771
|
loading,
|
|
71583
71772
|
loadingRows,
|
|
71773
|
+
maxVisibleSubSteps,
|
|
71774
|
+
subStepLoadMode,
|
|
71775
|
+
subStepOrder,
|
|
71584
71776
|
showLegend,
|
|
71585
71777
|
emptyState,
|
|
71586
71778
|
labels: labelOverrides,
|
|
@@ -71645,7 +71837,7 @@ var WorkflowTracker = ({
|
|
|
71645
71837
|
var WorkflowTracker_default = WorkflowTracker;
|
|
71646
71838
|
|
|
71647
71839
|
// src/components/Gantt/Gantt.tsx
|
|
71648
|
-
import { useCallback as useCallback48, useEffect as
|
|
71840
|
+
import { useCallback as useCallback48, useEffect as useEffect79, useMemo as useMemo63, useRef as useRef81, useState as useState89 } from "react";
|
|
71649
71841
|
import { createPortal as createPortal16 } from "react-dom";
|
|
71650
71842
|
import classNames128 from "classnames";
|
|
71651
71843
|
|
|
@@ -73277,7 +73469,7 @@ var GanttScale = ({ levels, height }) => {
|
|
|
73277
73469
|
GanttScale.displayName = "GanttScale";
|
|
73278
73470
|
|
|
73279
73471
|
// src/components/Gantt/GanttLinkLayer.tsx
|
|
73280
|
-
import { forwardRef as forwardRef197, useRef as
|
|
73472
|
+
import { forwardRef as forwardRef197, useRef as useRef79 } from "react";
|
|
73281
73473
|
import { jsx as jsx355, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
73282
73474
|
var GanttLinkLayer = forwardRef197(
|
|
73283
73475
|
function GanttLinkLayer2({
|
|
@@ -73293,7 +73485,7 @@ var GanttLinkLayer = forwardRef197(
|
|
|
73293
73485
|
onDeleteLink
|
|
73294
73486
|
}, ref) {
|
|
73295
73487
|
const t = useKitT();
|
|
73296
|
-
const svgRef =
|
|
73488
|
+
const svgRef = useRef79(null);
|
|
73297
73489
|
const selPath = selected ? paths.find((p) => p.link === selected) : void 0;
|
|
73298
73490
|
const selColor = selPath ? selPath.color ?? color2 : color2;
|
|
73299
73491
|
const selMid = selPath ? { x: (selPath.from.x + selPath.to.x) / 2, y: (selPath.from.y + selPath.to.y) / 2 } : null;
|
|
@@ -73956,13 +74148,13 @@ var GanttToolbar = ({
|
|
|
73956
74148
|
GanttToolbar.displayName = "GanttToolbar";
|
|
73957
74149
|
|
|
73958
74150
|
// src/components/Gantt/useGanttDrag.ts
|
|
73959
|
-
import { useCallback as useCallback47, useEffect as
|
|
74151
|
+
import { useCallback as useCallback47, useEffect as useEffect78, useMemo as useMemo62, useRef as useRef80, useState as useState88 } from "react";
|
|
73960
74152
|
function useGanttDrag(opts) {
|
|
73961
|
-
const [drag, setDrag] =
|
|
73962
|
-
const [linkSelected, setLinkSelected] =
|
|
73963
|
-
const optsRef =
|
|
74153
|
+
const [drag, setDrag] = useState88(null);
|
|
74154
|
+
const [linkSelected, setLinkSelected] = useState88(null);
|
|
74155
|
+
const optsRef = useRef80(opts);
|
|
73964
74156
|
optsRef.current = opts;
|
|
73965
|
-
const dragRef =
|
|
74157
|
+
const dragRef = useRef80(null);
|
|
73966
74158
|
dragRef.current = drag;
|
|
73967
74159
|
const { rows, zoom, rangeStart, accentColor } = opts;
|
|
73968
74160
|
const barGeom = useCallback47(
|
|
@@ -74015,7 +74207,7 @@ function useGanttDrag(opts) {
|
|
|
74015
74207
|
if (!overlay) return 0;
|
|
74016
74208
|
return clientY - overlay.getBoundingClientRect().top;
|
|
74017
74209
|
}, []);
|
|
74018
|
-
|
|
74210
|
+
useEffect78(() => {
|
|
74019
74211
|
if (!drag) return;
|
|
74020
74212
|
const onMove = (e) => {
|
|
74021
74213
|
e.preventDefault();
|
|
@@ -74390,7 +74582,7 @@ var Gantt2 = ({
|
|
|
74390
74582
|
}));
|
|
74391
74583
|
const interactive = editable ?? Boolean(onTasksChange || onLinksChange || onReorder);
|
|
74392
74584
|
const surfaceText = useMemo63(() => getSurfaceTextTokens(variant), [variant]);
|
|
74393
|
-
const [internalZoom, setInternalZoom] =
|
|
74585
|
+
const [internalZoom, setInternalZoom] = useState89(initialZoom);
|
|
74394
74586
|
const zoom = zoomProp ?? internalZoom;
|
|
74395
74587
|
const setZoom = useCallback48(
|
|
74396
74588
|
(z) => {
|
|
@@ -74400,7 +74592,7 @@ var Gantt2 = ({
|
|
|
74400
74592
|
},
|
|
74401
74593
|
[minZoom, maxZoom, onZoomChange]
|
|
74402
74594
|
);
|
|
74403
|
-
const [internalSelection, setInternalSelection] =
|
|
74595
|
+
const [internalSelection, setInternalSelection] = useState89(null);
|
|
74404
74596
|
const selectedId = selectedIdProp !== void 0 ? selectedIdProp : internalSelection;
|
|
74405
74597
|
const setSelected = useCallback48(
|
|
74406
74598
|
(id) => {
|
|
@@ -74409,7 +74601,7 @@ var Gantt2 = ({
|
|
|
74409
74601
|
},
|
|
74410
74602
|
[onSelect, selectedIdProp]
|
|
74411
74603
|
);
|
|
74412
|
-
const [internalOrder, setInternalOrder] =
|
|
74604
|
+
const [internalOrder, setInternalOrder] = useState89(void 0);
|
|
74413
74605
|
const rowOrder = rowOrderProp ?? internalOrder;
|
|
74414
74606
|
const handleReorder = useCallback48(
|
|
74415
74607
|
(order) => {
|
|
@@ -74418,15 +74610,15 @@ var Gantt2 = ({
|
|
|
74418
74610
|
},
|
|
74419
74611
|
[onReorder, rowOrderProp]
|
|
74420
74612
|
);
|
|
74421
|
-
const [collapsed, setCollapsed] =
|
|
74613
|
+
const [collapsed, setCollapsed] = useState89(
|
|
74422
74614
|
() => new Set(tasks.filter((t2) => t2.open === false).map((t2) => t2.id))
|
|
74423
74615
|
);
|
|
74424
|
-
const [closedLanes, setClosedLanes] =
|
|
74616
|
+
const [closedLanes, setClosedLanes] = useState89(
|
|
74425
74617
|
() => new Set((lanes ?? []).filter((l) => l.open === false).map((l) => l.id))
|
|
74426
74618
|
);
|
|
74427
|
-
const tasksRef =
|
|
74428
|
-
const lanesRef =
|
|
74429
|
-
|
|
74619
|
+
const tasksRef = useRef81(tasks);
|
|
74620
|
+
const lanesRef = useRef81(lanes);
|
|
74621
|
+
useEffect79(() => {
|
|
74430
74622
|
if (tasksRef.current !== tasks) {
|
|
74431
74623
|
tasksRef.current = tasks;
|
|
74432
74624
|
setCollapsed(new Set(tasks.filter((t2) => t2.open === false).map((t2) => t2.id)));
|
|
@@ -74479,10 +74671,10 @@ var Gantt2 = ({
|
|
|
74479
74671
|
() => buildTimeScale(range.start, range.end, zoom, dateLocale),
|
|
74480
74672
|
[range, zoom, dateLocale]
|
|
74481
74673
|
);
|
|
74482
|
-
const [colWidths, setColWidths] =
|
|
74674
|
+
const [colWidths, setColWidths] = useState89(
|
|
74483
74675
|
() => columnWidths ? { ...columnWidths } : {}
|
|
74484
74676
|
);
|
|
74485
|
-
|
|
74677
|
+
useEffect79(() => {
|
|
74486
74678
|
if (!columnWidths) return;
|
|
74487
74679
|
setColWidths((prev) => ({ ...prev, ...columnWidths }));
|
|
74488
74680
|
}, [columnWidths]);
|
|
@@ -74496,7 +74688,7 @@ var Gantt2 = ({
|
|
|
74496
74688
|
() => resolvedColumns.map((c) => ({ ...c, width: `${effectiveColWidth(c)}px` })),
|
|
74497
74689
|
[resolvedColumns, colWidths]
|
|
74498
74690
|
);
|
|
74499
|
-
const effectiveWidthsRef =
|
|
74691
|
+
const effectiveWidthsRef = useRef81({});
|
|
74500
74692
|
effectiveWidthsRef.current = Object.fromEntries(
|
|
74501
74693
|
sizedColumns.map((c) => [c.key, effectiveColWidth(c)])
|
|
74502
74694
|
);
|
|
@@ -74504,8 +74696,8 @@ var Gantt2 = ({
|
|
|
74504
74696
|
() => GRIP_WIDTH + resolvedColumns.reduce((sum, c) => sum + effectiveColWidth(c), 0),
|
|
74505
74697
|
[resolvedColumns, colWidths]
|
|
74506
74698
|
);
|
|
74507
|
-
const resizingRef =
|
|
74508
|
-
const [resizingKey, setResizingKey] =
|
|
74699
|
+
const resizingRef = useRef81(null);
|
|
74700
|
+
const [resizingKey, setResizingKey] = useState89(null);
|
|
74509
74701
|
const startColumnResize = useCallback48(
|
|
74510
74702
|
(e, key) => {
|
|
74511
74703
|
if (e.button !== 0) return;
|
|
@@ -74537,17 +74729,17 @@ var Gantt2 = ({
|
|
|
74537
74729
|
},
|
|
74538
74730
|
[onColumnWidthChange]
|
|
74539
74731
|
);
|
|
74540
|
-
|
|
74732
|
+
useEffect79(
|
|
74541
74733
|
() => () => {
|
|
74542
74734
|
document.body.style.cursor = "";
|
|
74543
74735
|
document.body.style.userSelect = "";
|
|
74544
74736
|
},
|
|
74545
74737
|
[]
|
|
74546
74738
|
);
|
|
74547
|
-
const scrollRef =
|
|
74548
|
-
const overlayRef =
|
|
74549
|
-
const rootRef =
|
|
74550
|
-
const headerScaleRef =
|
|
74739
|
+
const scrollRef = useRef81(null);
|
|
74740
|
+
const overlayRef = useRef81(null);
|
|
74741
|
+
const rootRef = useRef81(null);
|
|
74742
|
+
const headerScaleRef = useRef81(null);
|
|
74551
74743
|
const syncHeaderScale = useCallback48(() => {
|
|
74552
74744
|
const s = scrollRef.current;
|
|
74553
74745
|
const h = headerScaleRef.current;
|
|
@@ -74572,7 +74764,7 @@ var Gantt2 = ({
|
|
|
74572
74764
|
},
|
|
74573
74765
|
[zoom, minZoom, maxZoom, leftWidth, setZoom]
|
|
74574
74766
|
);
|
|
74575
|
-
|
|
74767
|
+
useEffect79(() => {
|
|
74576
74768
|
const el = scrollRef.current;
|
|
74577
74769
|
if (!el) return;
|
|
74578
74770
|
const onWheel = (e) => {
|
|
@@ -74584,10 +74776,10 @@ var Gantt2 = ({
|
|
|
74584
74776
|
el.addEventListener("wheel", onWheel, { passive: false });
|
|
74585
74777
|
return () => el.removeEventListener("wheel", onWheel);
|
|
74586
74778
|
}, [zoomBy]);
|
|
74587
|
-
|
|
74779
|
+
useEffect79(() => {
|
|
74588
74780
|
syncHeaderScale();
|
|
74589
74781
|
}, [syncHeaderScale, timelineWidth, zoom, range.start, leftWidth]);
|
|
74590
|
-
const liveRowsRef =
|
|
74782
|
+
const liveRowsRef = useRef81(null);
|
|
74591
74783
|
const dragApi = useGanttDrag({
|
|
74592
74784
|
scrollRef,
|
|
74593
74785
|
overlayRef,
|
|
@@ -74849,7 +75041,7 @@ var Gantt2 = ({
|
|
|
74849
75041
|
() => ganttLinkLayerWidth(linkPaths, timelineWidth),
|
|
74850
75042
|
[linkPaths, timelineWidth]
|
|
74851
75043
|
);
|
|
74852
|
-
|
|
75044
|
+
useEffect79(() => {
|
|
74853
75045
|
syncHeaderScale();
|
|
74854
75046
|
}, [linkLayerWidth, syncHeaderScale]);
|
|
74855
75047
|
const linkFan = useMemo63(() => computeLinkFanOffsets(links, bars), [links, bars]);
|
|
@@ -75263,7 +75455,7 @@ var GanttSkeleton = ({
|
|
|
75263
75455
|
] }, i)) });
|
|
75264
75456
|
|
|
75265
75457
|
// src/components/TaskBoard/TaskBoard.tsx
|
|
75266
|
-
import { useCallback as useCallback54, useEffect as
|
|
75458
|
+
import { useCallback as useCallback54, useEffect as useEffect84, useMemo as useMemo68, useRef as useRef87, useState as useState98 } from "react";
|
|
75267
75459
|
import classNames139 from "classnames";
|
|
75268
75460
|
|
|
75269
75461
|
// ../common/taskboard/types.ts
|
|
@@ -76072,11 +76264,11 @@ var TaskBoardBucket = ({ column, lane, cards, className, label }) => {
|
|
|
76072
76264
|
};
|
|
76073
76265
|
|
|
76074
76266
|
// src/components/TaskBoard/usePresence.ts
|
|
76075
|
-
import { useEffect as
|
|
76267
|
+
import { useEffect as useEffect80, useState as useState90 } from "react";
|
|
76076
76268
|
var COLLAPSE_MS = 200;
|
|
76077
76269
|
function usePresence(open, ms = COLLAPSE_MS) {
|
|
76078
|
-
const [mounted, setMounted] =
|
|
76079
|
-
|
|
76270
|
+
const [mounted, setMounted] = useState90(open);
|
|
76271
|
+
useEffect80(() => {
|
|
76080
76272
|
if (open) {
|
|
76081
76273
|
setMounted(true);
|
|
76082
76274
|
return;
|
|
@@ -76093,7 +76285,7 @@ function usePresence(open, ms = COLLAPSE_MS) {
|
|
|
76093
76285
|
}
|
|
76094
76286
|
|
|
76095
76287
|
// src/components/TaskBoard/TaskBoardColumnEdit.tsx
|
|
76096
|
-
import { useState as
|
|
76288
|
+
import { useState as useState91 } from "react";
|
|
76097
76289
|
import { createPortal as createPortal17 } from "react-dom";
|
|
76098
76290
|
import classNames131 from "classnames";
|
|
76099
76291
|
import { jsx as jsx361, jsxs as jsxs222 } from "react/jsx-runtime";
|
|
@@ -76121,8 +76313,8 @@ var TaskBoardAddColumn = ({
|
|
|
76121
76313
|
variant
|
|
76122
76314
|
}) => {
|
|
76123
76315
|
const { text: text2, surface, color: color2, size, columnCornerClass } = useTaskBoard();
|
|
76124
|
-
const [editing, setEditing] =
|
|
76125
|
-
const [title, setTitle] =
|
|
76316
|
+
const [editing, setEditing] = useState91(false);
|
|
76317
|
+
const [title, setTitle] = useState91("");
|
|
76126
76318
|
const trigger = getSurfaceTriggerTokens(color2);
|
|
76127
76319
|
const close = () => {
|
|
76128
76320
|
setEditing(false);
|
|
@@ -76235,7 +76427,7 @@ var TaskBoardColumnClone = ({ drag, column, cards, count }) => {
|
|
|
76235
76427
|
};
|
|
76236
76428
|
|
|
76237
76429
|
// src/components/TaskBoard/TaskBoardColumnEditor.tsx
|
|
76238
|
-
import { useId as useId48, useState as
|
|
76430
|
+
import { useId as useId48, useState as useState92 } from "react";
|
|
76239
76431
|
import classNames132 from "classnames";
|
|
76240
76432
|
import { jsx as jsx362, jsxs as jsxs223 } from "react/jsx-runtime";
|
|
76241
76433
|
var toDraft = (c) => ({
|
|
@@ -76259,8 +76451,8 @@ function fromDraft(column, d) {
|
|
|
76259
76451
|
var limitValid = (wip) => wip.trim() === "" || Number.isInteger(Number(wip)) && Number(wip) >= 1;
|
|
76260
76452
|
var TaskBoardColumnEditButton = ({ column }) => {
|
|
76261
76453
|
const { onEditColumn, allColumns, text: text2, surface, color: color2 } = useTaskBoard();
|
|
76262
|
-
const [open, setOpen] =
|
|
76263
|
-
const [draft, setDraft] =
|
|
76454
|
+
const [open, setOpen] = useState92(false);
|
|
76455
|
+
const [draft, setDraft] = useState92(() => toDraft(column));
|
|
76264
76456
|
const id = useId48();
|
|
76265
76457
|
if (!onEditColumn) return null;
|
|
76266
76458
|
const trigger = getSurfaceTriggerTokens(color2);
|
|
@@ -76877,7 +77069,7 @@ var TaskBoardDragLayer = ({ drag, card }) => {
|
|
|
76877
77069
|
};
|
|
76878
77070
|
|
|
76879
77071
|
// src/components/TaskBoard/useTaskBoardDrag.ts
|
|
76880
|
-
import { useCallback as useCallback49, useEffect as
|
|
77072
|
+
import { useCallback as useCallback49, useEffect as useEffect81, useMemo as useMemo64, useRef as useRef82, useState as useState93 } from "react";
|
|
76881
77073
|
var DRAG_THRESHOLD_PX = 4;
|
|
76882
77074
|
var TOUCH_GRAB_DELAY_MS = 250;
|
|
76883
77075
|
var TOUCH_SLOP_PX = 8;
|
|
@@ -76892,17 +77084,17 @@ function bucketOf(el) {
|
|
|
76892
77084
|
return column === null ? null : { column, lane: lane || null, el: bucket };
|
|
76893
77085
|
}
|
|
76894
77086
|
function useTaskBoardDrag(opts) {
|
|
76895
|
-
const [drag, setDrag] =
|
|
76896
|
-
const [pending, setPending] =
|
|
76897
|
-
const optsRef =
|
|
77087
|
+
const [drag, setDrag] = useState93(null);
|
|
77088
|
+
const [pending, setPending] = useState93(null);
|
|
77089
|
+
const optsRef = useRef82(opts);
|
|
76898
77090
|
optsRef.current = opts;
|
|
76899
|
-
const dragRef =
|
|
76900
|
-
const pressRef =
|
|
76901
|
-
const suppressClickRef =
|
|
76902
|
-
const pointerRef =
|
|
76903
|
-
const rafRef =
|
|
76904
|
-
const cleanupRef =
|
|
76905
|
-
const userSelectRef =
|
|
77091
|
+
const dragRef = useRef82(null);
|
|
77092
|
+
const pressRef = useRef82(null);
|
|
77093
|
+
const suppressClickRef = useRef82(false);
|
|
77094
|
+
const pointerRef = useRef82({ x: 0, y: 0 });
|
|
77095
|
+
const rafRef = useRef82(null);
|
|
77096
|
+
const cleanupRef = useRef82(null);
|
|
77097
|
+
const userSelectRef = useRef82(null);
|
|
76906
77098
|
const setDragState = useCallback49((next) => {
|
|
76907
77099
|
dragRef.current = next;
|
|
76908
77100
|
setDrag(next);
|
|
@@ -77148,11 +77340,11 @@ function useTaskBoardDrag(opts) {
|
|
|
77148
77340
|
},
|
|
77149
77341
|
[cancel, endGesture, finish, onWindowMove]
|
|
77150
77342
|
);
|
|
77151
|
-
|
|
77343
|
+
useEffect81(() => {
|
|
77152
77344
|
const d = dragRef.current;
|
|
77153
77345
|
if (d && !opts.cards.some((c) => c.id === d.cardId)) cancel("removed");
|
|
77154
77346
|
}, [opts.cards, cancel]);
|
|
77155
|
-
|
|
77347
|
+
useEffect81(() => () => endGesture(), [endGesture]);
|
|
77156
77348
|
const previewCards = useMemo64(() => {
|
|
77157
77349
|
const { cards, columns, lanes } = opts;
|
|
77158
77350
|
if (pending) return applyMove(cards, pending, columns, lanes);
|
|
@@ -77176,23 +77368,23 @@ function useTaskBoardDrag(opts) {
|
|
|
77176
77368
|
}
|
|
77177
77369
|
|
|
77178
77370
|
// src/components/TaskBoard/useTaskBoardKeyboard.ts
|
|
77179
|
-
import { useCallback as useCallback50, useLayoutEffect as
|
|
77371
|
+
import { useCallback as useCallback50, useLayoutEffect as useLayoutEffect31, useMemo as useMemo65, useRef as useRef83, useState as useState94 } from "react";
|
|
77180
77372
|
var isRtl = (el) => el?.closest("[dir]")?.getAttribute("dir") === "rtl";
|
|
77181
77373
|
function useTaskBoardKeyboard(o) {
|
|
77182
77374
|
const { rootRef, cards, viewCards, columns, lanes, text: text2, drag } = o;
|
|
77183
|
-
const [message, setMessage] =
|
|
77184
|
-
const [activeId, setActiveId] =
|
|
77185
|
-
const [ownSelection, setOwnSelection] =
|
|
77375
|
+
const [message, setMessage] = useState94("");
|
|
77376
|
+
const [activeId, setActiveId] = useState94(null);
|
|
77377
|
+
const [ownSelection, setOwnSelection] = useState94([]);
|
|
77186
77378
|
const selection = o.selectedIds ?? ownSelection;
|
|
77187
|
-
const anchorRef =
|
|
77188
|
-
const refocusRef =
|
|
77379
|
+
const anchorRef = useRef83(null);
|
|
77380
|
+
const refocusRef = useRef83(null);
|
|
77189
77381
|
const viewBuckets = useMemo65(() => bucketCards(viewCards, columns, lanes), [viewCards, columns, lanes]);
|
|
77190
77382
|
const firstId = useMemo65(() => {
|
|
77191
77383
|
for (const cards2 of viewBuckets.values()) if (cards2.length) return cards2[0].id;
|
|
77192
77384
|
return null;
|
|
77193
77385
|
}, [viewBuckets]);
|
|
77194
77386
|
const tabStop = activeId && viewCards.some((c) => c.id === activeId) ? activeId : firstId;
|
|
77195
|
-
|
|
77387
|
+
useLayoutEffect31(() => {
|
|
77196
77388
|
const id = refocusRef.current;
|
|
77197
77389
|
if (!id) return;
|
|
77198
77390
|
refocusRef.current = null;
|
|
@@ -77363,17 +77555,17 @@ function useTaskBoardKeyboard(o) {
|
|
|
77363
77555
|
}
|
|
77364
77556
|
|
|
77365
77557
|
// src/components/TaskBoard/useTaskBoardColumnDrag.ts
|
|
77366
|
-
import { useCallback as useCallback51, useEffect as
|
|
77558
|
+
import { useCallback as useCallback51, useEffect as useEffect82, useLayoutEffect as useLayoutEffect32, useMemo as useMemo66, useRef as useRef84, useState as useState95 } from "react";
|
|
77367
77559
|
var DRAG_THRESHOLD_PX2 = 4;
|
|
77368
77560
|
var isRtl2 = (el) => el?.closest("[dir]")?.getAttribute("dir") === "rtl";
|
|
77369
77561
|
function useTaskBoardColumnDrag(opts) {
|
|
77370
|
-
const [drag, setDrag] =
|
|
77371
|
-
const optsRef =
|
|
77562
|
+
const [drag, setDrag] = useState95(null);
|
|
77563
|
+
const optsRef = useRef84(opts);
|
|
77372
77564
|
optsRef.current = opts;
|
|
77373
|
-
const dragRef =
|
|
77374
|
-
const cleanupRef =
|
|
77375
|
-
const userSelectRef =
|
|
77376
|
-
const refocusRef =
|
|
77565
|
+
const dragRef = useRef84(null);
|
|
77566
|
+
const cleanupRef = useRef84(null);
|
|
77567
|
+
const userSelectRef = useRef84(null);
|
|
77568
|
+
const refocusRef = useRef84(null);
|
|
77377
77569
|
const set = useCallback51((next) => {
|
|
77378
77570
|
dragRef.current = next;
|
|
77379
77571
|
setDrag(next);
|
|
@@ -77398,13 +77590,13 @@ function useTaskBoardColumnDrag(opts) {
|
|
|
77398
77590
|
optsRef.current.onCommit(moveColumn(optsRef.current.columns, d.id, d.to));
|
|
77399
77591
|
return true;
|
|
77400
77592
|
}, [end, set]);
|
|
77401
|
-
|
|
77593
|
+
useLayoutEffect32(() => {
|
|
77402
77594
|
const id = refocusRef.current;
|
|
77403
77595
|
if (!id) return;
|
|
77404
77596
|
refocusRef.current = null;
|
|
77405
77597
|
opts.rootRef.current?.querySelector(`[data-column-grip="${CSS.escape(id)}"]`)?.focus();
|
|
77406
77598
|
});
|
|
77407
|
-
|
|
77599
|
+
useEffect82(() => () => end(), [end]);
|
|
77408
77600
|
const startPointer = useCallback51(
|
|
77409
77601
|
(column, from, e) => {
|
|
77410
77602
|
if (!optsRef.current.enabled || e.button !== 0) return;
|
|
@@ -77512,11 +77704,11 @@ function useTaskBoardColumnDrag(opts) {
|
|
|
77512
77704
|
}
|
|
77513
77705
|
|
|
77514
77706
|
// src/components/TaskBoard/useFlip.ts
|
|
77515
|
-
import { useLayoutEffect as
|
|
77707
|
+
import { useLayoutEffect as useLayoutEffect33, useRef as useRef85 } from "react";
|
|
77516
77708
|
function useFlip(rootRef, orderKey) {
|
|
77517
|
-
const positions =
|
|
77518
|
-
const lastKey =
|
|
77519
|
-
|
|
77709
|
+
const positions = useRef85(/* @__PURE__ */ new Map());
|
|
77710
|
+
const lastKey = useRef85(orderKey);
|
|
77711
|
+
useLayoutEffect33(() => {
|
|
77520
77712
|
const root = rootRef.current;
|
|
77521
77713
|
if (!root) return;
|
|
77522
77714
|
const reorder = lastKey.current !== orderKey;
|
|
@@ -77544,15 +77736,15 @@ function useFlip(rootRef, orderKey) {
|
|
|
77544
77736
|
}
|
|
77545
77737
|
|
|
77546
77738
|
// src/components/TaskBoard/useTaskBoardCollab.ts
|
|
77547
|
-
import { useCallback as useCallback52, useEffect as
|
|
77739
|
+
import { useCallback as useCallback52, useEffect as useEffect83, useMemo as useMemo67, useRef as useRef86, useState as useState96 } from "react";
|
|
77548
77740
|
var EXPIRE_TICK_MS = 1e3;
|
|
77549
77741
|
function useTaskBoardCollab(transport, currentUser) {
|
|
77550
|
-
const [presence, setPresence] =
|
|
77742
|
+
const [presence, setPresence] = useState96(emptyPresence);
|
|
77551
77743
|
const active = Boolean(transport && currentUser);
|
|
77552
|
-
const mountedRef =
|
|
77553
|
-
const userRef =
|
|
77744
|
+
const mountedRef = useRef86(false);
|
|
77745
|
+
const userRef = useRef86(currentUser);
|
|
77554
77746
|
userRef.current = currentUser;
|
|
77555
|
-
const hoverRef =
|
|
77747
|
+
const hoverRef = useRef86({ last: 0, timer: null });
|
|
77556
77748
|
const apply = useCallback52((event) => {
|
|
77557
77749
|
if (!mountedRef.current) return;
|
|
77558
77750
|
const now2 = Date.now();
|
|
@@ -77567,7 +77759,7 @@ function useTaskBoardCollab(transport, currentUser) {
|
|
|
77567
77759
|
[transport, apply]
|
|
77568
77760
|
);
|
|
77569
77761
|
const userId = currentUser?.id;
|
|
77570
|
-
|
|
77762
|
+
useEffect83(() => {
|
|
77571
77763
|
if (!transport || !userId) return;
|
|
77572
77764
|
mountedRef.current = true;
|
|
77573
77765
|
const hello = () => {
|
|
@@ -77664,15 +77856,15 @@ function safePublish(transport, event) {
|
|
|
77664
77856
|
}
|
|
77665
77857
|
|
|
77666
77858
|
// src/components/TaskBoard/TaskBoardRemoteGhosts.tsx
|
|
77667
|
-
import { useLayoutEffect as
|
|
77859
|
+
import { useLayoutEffect as useLayoutEffect34, useState as useState97 } from "react";
|
|
77668
77860
|
import { createPortal as createPortal19 } from "react-dom";
|
|
77669
77861
|
import classNames137 from "classnames";
|
|
77670
77862
|
import { Fragment as Fragment56, jsx as jsx367, jsxs as jsxs227 } from "react/jsx-runtime";
|
|
77671
77863
|
var GHOST_HEIGHT = 40;
|
|
77672
77864
|
var TaskBoardRemoteGhosts = ({ rootRef, holds, selfId, cards, userById }) => {
|
|
77673
|
-
const [ghosts, setGhosts] =
|
|
77674
|
-
const [tick, setTick] =
|
|
77675
|
-
|
|
77865
|
+
const [ghosts, setGhosts] = useState97([]);
|
|
77866
|
+
const [tick, setTick] = useState97(0);
|
|
77867
|
+
useLayoutEffect34(() => {
|
|
77676
77868
|
const root = rootRef.current;
|
|
77677
77869
|
if (!root) return;
|
|
77678
77870
|
const bump = () => setTick((t) => t + 1);
|
|
@@ -77683,7 +77875,7 @@ var TaskBoardRemoteGhosts = ({ rootRef, holds, selfId, cards, userById }) => {
|
|
|
77683
77875
|
window.removeEventListener("resize", bump);
|
|
77684
77876
|
};
|
|
77685
77877
|
}, [rootRef]);
|
|
77686
|
-
|
|
77878
|
+
useLayoutEffect34(() => {
|
|
77687
77879
|
const root = rootRef.current;
|
|
77688
77880
|
if (!root) return;
|
|
77689
77881
|
const next = [];
|
|
@@ -77876,7 +78068,7 @@ var TaskBoardBody = (props) => {
|
|
|
77876
78068
|
const resolvedColumnWidth = normalizedColumnWidth === "auto" || normalizedColumnWidth === "" || typeof normalizedColumnWidth === "number" && (!Number.isFinite(normalizedColumnWidth) || normalizedColumnWidth <= 0) ? sizeTokens12.columnWidth : normalizedColumnWidth;
|
|
77877
78069
|
const wellSurface = surface.translucent ? GLASS_WELL : SOLID_WELL;
|
|
77878
78070
|
const columnCornerClass = getSurfaceCornerClass(columnCorner);
|
|
77879
|
-
const rootRef =
|
|
78071
|
+
const rootRef = useRef87(null);
|
|
77880
78072
|
const isEditable = editable ?? Boolean(onCardsChange);
|
|
77881
78073
|
const laneView = layout === "lanes" && Boolean(lanes?.length);
|
|
77882
78074
|
const viewLanes = laneView ? lanes : void 0;
|
|
@@ -77897,8 +78089,8 @@ var TaskBoardBody = (props) => {
|
|
|
77897
78089
|
onDragTarget: (cardId, slot) => slot && collab.hover(cardId, slot),
|
|
77898
78090
|
onDragEnd: collab.release
|
|
77899
78091
|
});
|
|
77900
|
-
const [notice, setNotice] =
|
|
77901
|
-
|
|
78092
|
+
const [notice, setNotice] = useState98(null);
|
|
78093
|
+
useEffect84(() => {
|
|
77902
78094
|
if (!drag || !selfId) return;
|
|
77903
78095
|
const holder = collab.heldBy.get(drag.cardId);
|
|
77904
78096
|
if (!holder || holder === selfId) return;
|
|
@@ -77906,7 +78098,7 @@ var TaskBoardBody = (props) => {
|
|
|
77906
78098
|
cancel("held");
|
|
77907
78099
|
setNotice({ cardId: drag.cardId, text: text2("heldShort", { name: peer.name }), color: peer.color ?? peerColor(peer.id) });
|
|
77908
78100
|
}, [collab, drag, selfId, cancel, text2]);
|
|
77909
|
-
|
|
78101
|
+
useEffect84(() => {
|
|
77910
78102
|
if (!notice) return;
|
|
77911
78103
|
const t = setTimeout(() => setNotice(null), NOTICE_MS);
|
|
77912
78104
|
return () => clearTimeout(t);
|
|
@@ -78339,11 +78531,11 @@ import { forwardRef as forwardRef199 } from "react";
|
|
|
78339
78531
|
import {
|
|
78340
78532
|
forwardRef as forwardRef198,
|
|
78341
78533
|
useCallback as useCallback55,
|
|
78342
|
-
useEffect as
|
|
78534
|
+
useEffect as useEffect85,
|
|
78343
78535
|
useImperativeHandle as useImperativeHandle5,
|
|
78344
78536
|
useMemo as useMemo70,
|
|
78345
|
-
useRef as
|
|
78346
|
-
useState as
|
|
78537
|
+
useRef as useRef88,
|
|
78538
|
+
useState as useState99
|
|
78347
78539
|
} from "react";
|
|
78348
78540
|
|
|
78349
78541
|
// src/components/Terminal/engine.ts
|
|
@@ -78404,10 +78596,10 @@ var TERMINAL_DARK_THEME = {
|
|
|
78404
78596
|
// src/components/Terminal/TerminalViewport.tsx
|
|
78405
78597
|
import { jsx as jsx371 } from "react/jsx-runtime";
|
|
78406
78598
|
var TerminalViewport = forwardRef198(function TerminalViewport2(props, ref) {
|
|
78407
|
-
const host =
|
|
78408
|
-
const engine =
|
|
78409
|
-
const fitAddon =
|
|
78410
|
-
const [scroll, setScroll] =
|
|
78599
|
+
const host = useRef88(null);
|
|
78600
|
+
const engine = useRef88(null);
|
|
78601
|
+
const fitAddon = useRef88(null);
|
|
78602
|
+
const [scroll, setScroll] = useState99({
|
|
78411
78603
|
contentSize: 0,
|
|
78412
78604
|
viewportSize: 0,
|
|
78413
78605
|
offset: 0
|
|
@@ -78420,10 +78612,10 @@ var TerminalViewport = forwardRef198(function TerminalViewport2(props, ref) {
|
|
|
78420
78612
|
() => ({ ...scroll, onScroll: scrollTo }),
|
|
78421
78613
|
[scroll, scrollTo]
|
|
78422
78614
|
);
|
|
78423
|
-
const latest =
|
|
78615
|
+
const latest = useRef88(props);
|
|
78424
78616
|
latest.current = props;
|
|
78425
|
-
const initialData =
|
|
78426
|
-
const pending =
|
|
78617
|
+
const initialData = useRef88(props.initialData);
|
|
78618
|
+
const pending = useRef88([]);
|
|
78427
78619
|
const handle = useMemo70(
|
|
78428
78620
|
() => ({
|
|
78429
78621
|
write(data) {
|
|
@@ -78472,9 +78664,9 @@ var TerminalViewport = forwardRef198(function TerminalViewport2(props, ref) {
|
|
|
78472
78664
|
}
|
|
78473
78665
|
};
|
|
78474
78666
|
};
|
|
78475
|
-
const updateOptions =
|
|
78667
|
+
const updateOptions = useRef88(applyOptions);
|
|
78476
78668
|
updateOptions.current = applyOptions;
|
|
78477
|
-
|
|
78669
|
+
useEffect85(() => {
|
|
78478
78670
|
let cancelled = false;
|
|
78479
78671
|
let initialized = false;
|
|
78480
78672
|
let instance;
|
|
@@ -78565,7 +78757,7 @@ var TerminalViewport = forwardRef198(function TerminalViewport2(props, ref) {
|
|
|
78565
78757
|
fitAddon.current = null;
|
|
78566
78758
|
};
|
|
78567
78759
|
}, [handle]);
|
|
78568
|
-
|
|
78760
|
+
useEffect85(() => {
|
|
78569
78761
|
updateOptions.current();
|
|
78570
78762
|
if (props.active !== false) handle.fit();
|
|
78571
78763
|
}, [
|
|
@@ -78665,11 +78857,11 @@ var Terminal = forwardRef199(
|
|
|
78665
78857
|
import classNames142 from "classnames";
|
|
78666
78858
|
import {
|
|
78667
78859
|
forwardRef as forwardRef200,
|
|
78668
|
-
useEffect as
|
|
78860
|
+
useEffect as useEffect86,
|
|
78669
78861
|
useId as useId49,
|
|
78670
78862
|
useImperativeHandle as useImperativeHandle6,
|
|
78671
|
-
useRef as
|
|
78672
|
-
useState as
|
|
78863
|
+
useRef as useRef89,
|
|
78864
|
+
useState as useState100
|
|
78673
78865
|
} from "react";
|
|
78674
78866
|
import { jsx as jsx373, jsxs as jsxs231 } from "react/jsx-runtime";
|
|
78675
78867
|
var TerminalTabs = forwardRef200(
|
|
@@ -78702,17 +78894,17 @@ var TerminalTabs = forwardRef200(
|
|
|
78702
78894
|
}, ref) {
|
|
78703
78895
|
const tone = getSurfaceAccentColor(surfaceTone);
|
|
78704
78896
|
const prefix = useId49();
|
|
78705
|
-
const [selected, setSelected] =
|
|
78897
|
+
const [selected, setSelected] = useState100(defaultValue ?? sessions[0]?.id);
|
|
78706
78898
|
const requested = value ?? selected;
|
|
78707
78899
|
const active = sessions.find((session) => session.id === requested) ?? sessions[0];
|
|
78708
78900
|
const activeId = active?.id;
|
|
78709
|
-
const handles =
|
|
78901
|
+
const handles = useRef89(/* @__PURE__ */ new Map());
|
|
78710
78902
|
useImperativeHandle6(
|
|
78711
78903
|
ref,
|
|
78712
78904
|
() => ({ getSession: (id) => handles.current.get(id) }),
|
|
78713
78905
|
[]
|
|
78714
78906
|
);
|
|
78715
|
-
|
|
78907
|
+
useEffect86(() => {
|
|
78716
78908
|
if (value === void 0 && selected !== activeId) setSelected(activeId);
|
|
78717
78909
|
}, [value, selected, activeId]);
|
|
78718
78910
|
return /* @__PURE__ */ jsx373(
|
|
@@ -78858,18 +79050,18 @@ function hasZone(node) {
|
|
|
78858
79050
|
}
|
|
78859
79051
|
|
|
78860
79052
|
// src/components/Menu/Menu.tsx
|
|
78861
|
-
import React112, { cloneElement as cloneElement4, useCallback as useCallback56, useEffect as
|
|
79053
|
+
import React112, { cloneElement as cloneElement4, useCallback as useCallback56, useEffect as useEffect87, useId as useId50, useLayoutEffect as useLayoutEffect36, useRef as useRef91, useState as useState102 } from "react";
|
|
78862
79054
|
import { Link as Link3 } from "react-router-dom";
|
|
78863
79055
|
import classNames144 from "classnames";
|
|
78864
79056
|
|
|
78865
79057
|
// src/components/Menu/MenuPopup.tsx
|
|
78866
|
-
import { useLayoutEffect as
|
|
79058
|
+
import { useLayoutEffect as useLayoutEffect35, useRef as useRef90, useState as useState101 } from "react";
|
|
78867
79059
|
import { createPortal as createPortal20 } from "react-dom";
|
|
78868
79060
|
import { jsx as jsx375 } from "react/jsx-runtime";
|
|
78869
79061
|
function MenuPopup({ anchor, placement, width, children }) {
|
|
78870
|
-
const ref =
|
|
78871
|
-
const [style, setStyle] =
|
|
78872
|
-
|
|
79062
|
+
const ref = useRef90(null);
|
|
79063
|
+
const [style, setStyle] = useState101({ visibility: "hidden" });
|
|
79064
|
+
useLayoutEffect35(() => {
|
|
78873
79065
|
const update = () => {
|
|
78874
79066
|
if (!anchor.current || !ref.current) return;
|
|
78875
79067
|
const trigger = anchor.current.getBoundingClientRect();
|
|
@@ -78913,11 +79105,11 @@ var menuPadding = {
|
|
|
78913
79105
|
var rowSizes = { xs: "px-2 py-1 text-xs", sm: "px-2.5 py-1.5 text-xs", md: "px-3 py-2 text-sm", lg: "px-4 py-2.5 text-base", xl: "px-5 py-3 text-lg" };
|
|
78914
79106
|
var text = (item) => item.textValue ?? (typeof item.label === "string" ? item.label : item.id);
|
|
78915
79107
|
function MenuList({ items, state, depth = 0, parentLabel, onBack, focusOnMount = false, grouped = false }) {
|
|
78916
|
-
const list =
|
|
78917
|
-
const buffer =
|
|
78918
|
-
const timer =
|
|
79108
|
+
const list = useRef91(null);
|
|
79109
|
+
const buffer = useRef91("");
|
|
79110
|
+
const timer = useRef91(void 0);
|
|
78919
79111
|
const actions = () => Array.from(list.current?.querySelectorAll("[data-menu-action]") ?? []).filter((el) => el.closest('[role="menu"]') === list.current && el.getAttribute("aria-disabled") !== "true");
|
|
78920
|
-
|
|
79112
|
+
useLayoutEffect36(() => {
|
|
78921
79113
|
if (grouped) return;
|
|
78922
79114
|
const entries = actions();
|
|
78923
79115
|
const selected = entries.find((el) => el === document.activeElement) ?? entries[0];
|
|
@@ -78925,12 +79117,12 @@ function MenuList({ items, state, depth = 0, parentLabel, onBack, focusOnMount =
|
|
|
78925
79117
|
el.tabIndex = el === selected ? 0 : -1;
|
|
78926
79118
|
});
|
|
78927
79119
|
}, [items, grouped]);
|
|
78928
|
-
|
|
79120
|
+
useLayoutEffect36(() => {
|
|
78929
79121
|
if (!focusOnMount) return;
|
|
78930
79122
|
const frame = requestAnimationFrame(() => actions()[0]?.focus());
|
|
78931
79123
|
return () => cancelAnimationFrame(frame);
|
|
78932
79124
|
}, [focusOnMount]);
|
|
78933
|
-
|
|
79125
|
+
useEffect87(() => () => clearTimeout(timer.current), []);
|
|
78934
79126
|
return /* @__PURE__ */ jsx376(
|
|
78935
79127
|
"ul",
|
|
78936
79128
|
{
|
|
@@ -78990,7 +79182,7 @@ function MenuList({ items, state, depth = 0, parentLabel, onBack, focusOnMount =
|
|
|
78990
79182
|
);
|
|
78991
79183
|
}
|
|
78992
79184
|
function MenuRow({ item, state, depth }) {
|
|
78993
|
-
const anchor =
|
|
79185
|
+
const anchor = useRef91(null);
|
|
78994
79186
|
const { props } = state;
|
|
78995
79187
|
const tiered = (item.submenuMode ?? props.submenuMode) === "tiered";
|
|
78996
79188
|
const nested = Boolean(item.items?.some((child) => !child.hidden) || item.content != null);
|
|
@@ -79129,15 +79321,15 @@ function MenuSurface({ state, children, root = false }) {
|
|
|
79129
79321
|
}
|
|
79130
79322
|
function Menu(props) {
|
|
79131
79323
|
const owner = useId50();
|
|
79132
|
-
const triggerRef =
|
|
79324
|
+
const triggerRef = useRef91(null);
|
|
79133
79325
|
const anchor = props.anchorRef ?? triggerRef;
|
|
79134
79326
|
const popup = props.popup ?? Boolean(props.trigger || props.anchorRef);
|
|
79135
|
-
const [internalOpen, setInternalOpen] =
|
|
79327
|
+
const [internalOpen, setInternalOpen] = useState102(props.defaultOpen ?? false);
|
|
79136
79328
|
const open = props.open ?? internalOpen;
|
|
79137
|
-
const [expanded, setExpanded] =
|
|
79138
|
-
const [path, setPath] =
|
|
79139
|
-
const keyboard =
|
|
79140
|
-
const leave =
|
|
79329
|
+
const [expanded, setExpanded] = useState102(props.defaultExpandedKeys ?? []);
|
|
79330
|
+
const [path, setPath] = useState102([]);
|
|
79331
|
+
const keyboard = useRef91(false);
|
|
79332
|
+
const leave = useRef91(void 0);
|
|
79141
79333
|
const cancelLeave = useCallback56(() => clearTimeout(leave.current), []);
|
|
79142
79334
|
const requestOpen = useCallback56((value) => {
|
|
79143
79335
|
if (props.open === void 0) setInternalOpen(value);
|
|
@@ -79155,7 +79347,7 @@ function Menu(props) {
|
|
|
79155
79347
|
}
|
|
79156
79348
|
}
|
|
79157
79349
|
};
|
|
79158
|
-
|
|
79350
|
+
useEffect87(() => {
|
|
79159
79351
|
if (popup ? !open : path.length === 0) return;
|
|
79160
79352
|
const outside = (event) => {
|
|
79161
79353
|
const target = event.target;
|
|
@@ -79166,7 +79358,7 @@ function Menu(props) {
|
|
|
79166
79358
|
document.addEventListener("pointerdown", outside);
|
|
79167
79359
|
return () => document.removeEventListener("pointerdown", outside);
|
|
79168
79360
|
}, [popup, open, path.length, anchor, owner, requestOpen]);
|
|
79169
|
-
|
|
79361
|
+
useEffect87(() => () => clearTimeout(leave.current), []);
|
|
79170
79362
|
const state = {
|
|
79171
79363
|
owner,
|
|
79172
79364
|
props,
|
|
@@ -79221,7 +79413,7 @@ function Menu(props) {
|
|
|
79221
79413
|
}
|
|
79222
79414
|
|
|
79223
79415
|
// src/components/FileUpload/FileUpload.tsx
|
|
79224
|
-
import { useId as useId51, useRef as
|
|
79416
|
+
import { useId as useId51, useRef as useRef92, useState as useState104 } from "react";
|
|
79225
79417
|
import classNames145 from "classnames";
|
|
79226
79418
|
|
|
79227
79419
|
// src/components/FileUpload/fileSelection.ts
|
|
@@ -79264,12 +79456,12 @@ var uploadSizeTokens = {
|
|
|
79264
79456
|
};
|
|
79265
79457
|
|
|
79266
79458
|
// src/components/FileUpload/ImagePreview.tsx
|
|
79267
|
-
import { useEffect as
|
|
79459
|
+
import { useEffect as useEffect88, useState as useState103 } from "react";
|
|
79268
79460
|
import { jsx as jsx377 } from "react/jsx-runtime";
|
|
79269
79461
|
function ImagePreview({ file, src, alt, className }) {
|
|
79270
|
-
const [preview, setPreview] =
|
|
79271
|
-
const [failed, setFailed] =
|
|
79272
|
-
|
|
79462
|
+
const [preview, setPreview] = useState103(null);
|
|
79463
|
+
const [failed, setFailed] = useState103(null);
|
|
79464
|
+
useEffect88(() => {
|
|
79273
79465
|
if (!file) return;
|
|
79274
79466
|
let active = true;
|
|
79275
79467
|
let url2;
|
|
@@ -79310,11 +79502,11 @@ var defaultLabels = {
|
|
|
79310
79502
|
};
|
|
79311
79503
|
function FileUpload({ embedded = false, compact: compact2 = false, value, defaultValue = [], onChange, onReject, accept, maxSize, multiple = false, maxFiles = 20, size = "md", disabled = false, loading = false, error, preview = true, labels: overrides, rejectionMessage, className, "aria-label": ariaLabel, ...surface }) {
|
|
79312
79504
|
const density = uploadSizeTokens[size];
|
|
79313
|
-
const [internal, setInternal] =
|
|
79314
|
-
const [rejections, setRejections] =
|
|
79315
|
-
const [dragging, setDragging] =
|
|
79316
|
-
const depth =
|
|
79317
|
-
const input =
|
|
79505
|
+
const [internal, setInternal] = useState104(defaultValue);
|
|
79506
|
+
const [rejections, setRejections] = useState104([]);
|
|
79507
|
+
const [dragging, setDragging] = useState104(false);
|
|
79508
|
+
const depth = useRef92(0);
|
|
79509
|
+
const input = useRef92(null);
|
|
79318
79510
|
const id = useId51();
|
|
79319
79511
|
const files = value ?? internal;
|
|
79320
79512
|
const locked = disabled || loading;
|
|
@@ -79398,7 +79590,7 @@ function FileUpload({ embedded = false, compact: compact2 = false, value, defaul
|
|
|
79398
79590
|
}
|
|
79399
79591
|
|
|
79400
79592
|
// src/components/IdentityPicker/IdentityPicker.tsx
|
|
79401
|
-
import { useId as useId52, useState as
|
|
79593
|
+
import { useId as useId52, useState as useState105 } from "react";
|
|
79402
79594
|
import classNames146 from "classnames";
|
|
79403
79595
|
|
|
79404
79596
|
// src/components/IdentityPicker/sizeTokens.ts
|
|
@@ -79594,9 +79786,9 @@ function IdentityPicker({
|
|
|
79594
79786
|
const monogramLayout = compact2 ? classNames146("flex flex-wrap items-end gap-2", spacing.panel.split(" ").filter((token) => !token.startsWith("space-y-"))) : spacing.panel;
|
|
79595
79787
|
const categoryLineHeight = size === "xs" || size === "sm" ? "1rem" : size === "md" ? "1.25rem" : "1.5rem";
|
|
79596
79788
|
const tabsId = useId52();
|
|
79597
|
-
const [internal, setInternal] =
|
|
79598
|
-
const [query, setQuery] =
|
|
79599
|
-
const [category, setCategory] =
|
|
79789
|
+
const [internal, setInternal] = useState105(defaultValue);
|
|
79790
|
+
const [query, setQuery] = useState105("");
|
|
79791
|
+
const [category, setCategory] = useState105("recommended");
|
|
79600
79792
|
const selected = value === void 0 ? internal : value;
|
|
79601
79793
|
const labels = { ...defaults, ...overrides };
|
|
79602
79794
|
const locked = disabled || loading;
|
|
@@ -79730,7 +79922,7 @@ function IdentityPicker({
|
|
|
79730
79922
|
}
|
|
79731
79923
|
|
|
79732
79924
|
// src/components/DotStepper/DotStepper.tsx
|
|
79733
|
-
import React115, { forwardRef as forwardRef201, useState as
|
|
79925
|
+
import React115, { forwardRef as forwardRef201, useState as useState106 } from "react";
|
|
79734
79926
|
import classNames147 from "classnames";
|
|
79735
79927
|
|
|
79736
79928
|
// src/components/DotStepper/plan.ts
|
|
@@ -79768,7 +79960,7 @@ var DotTrigger = forwardRef201(function DotTrigger2({ tooltip, ...props }, ref)
|
|
|
79768
79960
|
return /* @__PURE__ */ jsx380(TooltipWrapper_default, { text: tooltip, children: /* @__PURE__ */ jsx380("button", { ...props, ref }) });
|
|
79769
79961
|
});
|
|
79770
79962
|
function ActivePopover({ trigger, content, options }) {
|
|
79771
|
-
const [open, setOpen] =
|
|
79963
|
+
const [open, setOpen] = useState106(false);
|
|
79772
79964
|
const { onOpenChange, ...rest } = options ?? {};
|
|
79773
79965
|
const anchor = React115.cloneElement(trigger, { tooltip: open ? void 0 : trigger.props.tooltip });
|
|
79774
79966
|
return /* @__PURE__ */ jsx380(Popover_default, { ...rest, trigger: anchor, visible: open, onOpenChange: (value) => {
|
|
@@ -79802,7 +79994,7 @@ function DotStepper({ steps, currentIndex, currentStepId, maxVisible = 5, size =
|
|
|
79802
79994
|
}
|
|
79803
79995
|
|
|
79804
79996
|
// src/components/knowledge/shared.tsx
|
|
79805
|
-
import { useState as
|
|
79997
|
+
import { useState as useState107 } from "react";
|
|
79806
79998
|
import { jsx as jsx381, jsxs as jsxs237 } from "react/jsx-runtime";
|
|
79807
79999
|
var MESSAGE_KEYS = {
|
|
79808
80000
|
"library": "kit.knowledge.library",
|
|
@@ -79861,7 +80053,7 @@ function useKnowledgeCopy(labels) {
|
|
|
79861
80053
|
return (key) => labels?.[key] ?? t(MESSAGE_KEYS[key]);
|
|
79862
80054
|
}
|
|
79863
80055
|
function useKnowledgeState(value, initial, onChange) {
|
|
79864
|
-
const [internal, setInternal] =
|
|
80056
|
+
const [internal, setInternal] = useState107(initial);
|
|
79865
80057
|
return [value === void 0 ? internal : value, (next) => {
|
|
79866
80058
|
if (value === void 0) setInternal(next);
|
|
79867
80059
|
onChange?.(next);
|
|
@@ -80159,7 +80351,7 @@ function MemoryDetail({
|
|
|
80159
80351
|
}
|
|
80160
80352
|
|
|
80161
80353
|
// src/components/knowledge/KnowledgeMap.tsx
|
|
80162
|
-
import { useCallback as useCallback57, useEffect as
|
|
80354
|
+
import { useCallback as useCallback57, useEffect as useEffect89, useId as useId53, useMemo as useMemo72, useRef as useRef93, useState as useState108 } from "react";
|
|
80163
80355
|
import { jsx as jsx385, jsxs as jsxs241 } from "react/jsx-runtime";
|
|
80164
80356
|
var COLORS = ["#0891b2", "#d97706", "#059669", "#e11d48", "#6366f1", "#8b5cf6"];
|
|
80165
80357
|
var PAGE_SIZE = 24;
|
|
@@ -80187,10 +80379,10 @@ function KnowledgeMap({
|
|
|
80187
80379
|
const copy = useKnowledgeCopy(labels), helpId = useId53();
|
|
80188
80380
|
const scene = useMemo72(() => buildKnowledgeScene(memories, points), [memories, points]);
|
|
80189
80381
|
const [selection, select] = useKnowledgeState(selectedId, defaultSelectedId, onSelectionChange);
|
|
80190
|
-
const canvasRef =
|
|
80191
|
-
const drag =
|
|
80192
|
-
const [camera, setCamera] =
|
|
80193
|
-
const [query, setQuery] =
|
|
80382
|
+
const canvasRef = useRef93(null), hostRef = useRef93(null);
|
|
80383
|
+
const drag = useRef93(null);
|
|
80384
|
+
const [camera, setCamera] = useState108(INITIAL_CAMERA), [size, setSize] = useState108({ width: 640, height });
|
|
80385
|
+
const [query, setQuery] = useState108(""), [page, setPage] = useState108(0);
|
|
80194
80386
|
const highlighted = useMemo72(() => new Set(highlightedIds), [highlightedIds]);
|
|
80195
80387
|
const clusters = useMemo72(() => {
|
|
80196
80388
|
const groups = /* @__PURE__ */ new Map();
|
|
@@ -80222,10 +80414,10 @@ function KnowledgeMap({
|
|
|
80222
80414
|
});
|
|
80223
80415
|
return { edges, diagnostics };
|
|
80224
80416
|
}, [scene, relationships]);
|
|
80225
|
-
|
|
80417
|
+
useEffect89(() => {
|
|
80226
80418
|
onDiagnostics?.(geometry.diagnostics);
|
|
80227
80419
|
}, [geometry.diagnostics, onDiagnostics]);
|
|
80228
|
-
|
|
80420
|
+
useEffect89(() => {
|
|
80229
80421
|
const host = hostRef.current;
|
|
80230
80422
|
if (!host) return;
|
|
80231
80423
|
const update = () => setSize({ width: Math.max(1, host.clientWidth), height: Math.max(120, height) });
|
|
@@ -80250,7 +80442,7 @@ function KnowledgeMap({
|
|
|
80250
80442
|
x: (point.x - bounds.x) * fitZoom * camera.zoom + size.width / 2 + camera.x,
|
|
80251
80443
|
y: (point.y - bounds.y) * fitZoom * camera.zoom + size.height / 2 + camera.y
|
|
80252
80444
|
}), [bounds, fitZoom, camera, size]);
|
|
80253
|
-
|
|
80445
|
+
useEffect89(() => {
|
|
80254
80446
|
const canvas = canvasRef.current;
|
|
80255
80447
|
if (!canvas) return;
|
|
80256
80448
|
const ctx = canvas.getContext("2d");
|
|
@@ -80324,7 +80516,7 @@ function KnowledgeMap({
|
|
|
80324
80516
|
ctx.globalAlpha = 1;
|
|
80325
80517
|
}
|
|
80326
80518
|
});
|
|
80327
|
-
|
|
80519
|
+
useEffect89(() => {
|
|
80328
80520
|
const observer = new MutationObserver(() => setSize((value) => ({ ...value })));
|
|
80329
80521
|
for (let node = hostRef.current; node; node = node.parentElement) observer.observe(node, { attributes: true, attributeFilter: ["class", "data-color-scheme", "style"] });
|
|
80330
80522
|
return () => observer.disconnect();
|
|
@@ -80337,7 +80529,7 @@ function KnowledgeMap({
|
|
|
80337
80529
|
y: anchor.y - size.height / 2 - (anchor.y - size.height / 2 - current.y) * scale
|
|
80338
80530
|
};
|
|
80339
80531
|
}), [size.width, size.height]);
|
|
80340
|
-
|
|
80532
|
+
useEffect89(() => {
|
|
80341
80533
|
const canvas = canvasRef.current;
|
|
80342
80534
|
if (!canvas) return;
|
|
80343
80535
|
const wheel = (event) => {
|
|
@@ -80468,7 +80660,7 @@ function KnowledgeMap({
|
|
|
80468
80660
|
}
|
|
80469
80661
|
|
|
80470
80662
|
// src/components/knowledge/KnowledgeExplorer.tsx
|
|
80471
|
-
import { useMemo as useMemo73, useState as
|
|
80663
|
+
import { useMemo as useMemo73, useState as useState109 } from "react";
|
|
80472
80664
|
import { Fragment as Fragment63, jsx as jsx386, jsxs as jsxs242 } from "react/jsx-runtime";
|
|
80473
80665
|
function KnowledgeExplorer({
|
|
80474
80666
|
memories,
|
|
@@ -80504,7 +80696,7 @@ function KnowledgeExplorer({
|
|
|
80504
80696
|
const [query, setQuery] = useKnowledgeState(queryProp, defaultQuery, onQueryChange);
|
|
80505
80697
|
const [filters, setFilters] = useKnowledgeState(filtersProp, defaultFilters, onFiltersChange);
|
|
80506
80698
|
const [traceId, selectTrace] = useKnowledgeState(traceIdProp, defaultSelectedTraceId, onTraceSelectionChange);
|
|
80507
|
-
const [mobileView, setMobileView] =
|
|
80699
|
+
const [mobileView, setMobileView] = useState109("library");
|
|
80508
80700
|
const records = useMemo73(() => new Map(memories.map((memory) => [memory.id, memory])), [memories]);
|
|
80509
80701
|
const selectedMemory = selection ? records.get(selection) ?? null : null;
|
|
80510
80702
|
const highlightedIds = useMemo73(() => [...new Set(traceLinks.filter((link) => link.traceNodeId === traceId && records.has(link.memoryId)).map((link) => link.memoryId))], [traceLinks, traceId, records]);
|
|
@@ -80596,7 +80788,7 @@ function ContentActions({
|
|
|
80596
80788
|
var ContentActions_default = ContentActions;
|
|
80597
80789
|
|
|
80598
80790
|
// src/components/CodeBlock.tsx
|
|
80599
|
-
import React116, { useEffect as
|
|
80791
|
+
import React116, { useEffect as useEffect90, useMemo as useMemo74, useRef as useRef94, useState as useState110 } from "react";
|
|
80600
80792
|
import { refractor } from "refractor";
|
|
80601
80793
|
import tsx from "refractor/tsx";
|
|
80602
80794
|
import { jsx as jsx388, jsxs as jsxs244 } from "react/jsx-runtime";
|
|
@@ -80648,10 +80840,10 @@ function CodeBlock({
|
|
|
80648
80840
|
...rest
|
|
80649
80841
|
}) {
|
|
80650
80842
|
const t = useKitT();
|
|
80651
|
-
const [copyState, setCopyState] =
|
|
80652
|
-
const timer =
|
|
80653
|
-
const generation =
|
|
80654
|
-
|
|
80843
|
+
const [copyState, setCopyState] = useState110("idle");
|
|
80844
|
+
const timer = useRef94(void 0);
|
|
80845
|
+
const generation = useRef94(0);
|
|
80846
|
+
useEffect90(() => {
|
|
80655
80847
|
generation.current++;
|
|
80656
80848
|
setCopyState("idle");
|
|
80657
80849
|
clearTimeout(timer.current);
|
|
@@ -80709,7 +80901,7 @@ function CodeBlock({
|
|
|
80709
80901
|
}
|
|
80710
80902
|
|
|
80711
80903
|
// src/components/FilterBar.tsx
|
|
80712
|
-
import { useEffect as
|
|
80904
|
+
import { useEffect as useEffect91, useId as useId54, useLayoutEffect as useLayoutEffect37, useRef as useRef95, useState as useState111 } from "react";
|
|
80713
80905
|
import classNames149 from "classnames";
|
|
80714
80906
|
import { Fragment as Fragment64, jsx as jsx389, jsxs as jsxs245 } from "react/jsx-runtime";
|
|
80715
80907
|
function normalize(filters, value) {
|
|
@@ -80746,6 +80938,7 @@ function FilterBar({
|
|
|
80746
80938
|
buttonVariant = "outline",
|
|
80747
80939
|
secondaryButtonVariant = "ghost",
|
|
80748
80940
|
applyButtonVariant = "solid",
|
|
80941
|
+
searchButtonVariant = "icon",
|
|
80749
80942
|
buttonTone = color2,
|
|
80750
80943
|
buttonSize = size,
|
|
80751
80944
|
buttonCorner,
|
|
@@ -80769,15 +80962,15 @@ function FilterBar({
|
|
|
80769
80962
|
transparency,
|
|
80770
80963
|
liquidExtras: classNames149(getGlassVibrancyClass(vibrancy), getSurfaceGlassFillClass(tone, glassOpacity))
|
|
80771
80964
|
});
|
|
80772
|
-
const [internal, setInternal] =
|
|
80965
|
+
const [internal, setInternal] = useState111(defaultValue);
|
|
80773
80966
|
const applied = normalize(filters, value ?? internal);
|
|
80774
|
-
const [open, setOpen] =
|
|
80775
|
-
const [category, setCategory] =
|
|
80776
|
-
const [draft, setDraft] =
|
|
80777
|
-
const anchor =
|
|
80778
|
-
const searchRegion =
|
|
80967
|
+
const [open, setOpen] = useState111(false);
|
|
80968
|
+
const [category, setCategory] = useState111(null);
|
|
80969
|
+
const [draft, setDraft] = useState111([]);
|
|
80970
|
+
const anchor = useRef95(null);
|
|
80971
|
+
const searchRegion = useRef95(null);
|
|
80779
80972
|
const searchId = useId54();
|
|
80780
|
-
const [expanded, setExpanded] =
|
|
80973
|
+
const [expanded, setExpanded] = useState111(Boolean(searchProps.initialValue));
|
|
80781
80974
|
const searchDisabled = disabled || searchProps.disabled;
|
|
80782
80975
|
const active = filters.find((filter) => filter.id === category);
|
|
80783
80976
|
const motion = CONTROL_SPRING_TOKENS[spring];
|
|
@@ -80798,12 +80991,12 @@ function FilterBar({
|
|
|
80798
80991
|
setCategory(filter.id);
|
|
80799
80992
|
setOpen(true);
|
|
80800
80993
|
};
|
|
80801
|
-
const previouslyExpanded =
|
|
80802
|
-
|
|
80994
|
+
const previouslyExpanded = useRef95(expanded);
|
|
80995
|
+
useLayoutEffect37(() => {
|
|
80803
80996
|
if (showSearch && expanded && !previouslyExpanded.current && !searchDisabled) searchRegion.current?.querySelector("input")?.focus();
|
|
80804
80997
|
previouslyExpanded.current = expanded;
|
|
80805
80998
|
}, [expanded, searchDisabled, showSearch]);
|
|
80806
|
-
|
|
80999
|
+
useEffect91(() => {
|
|
80807
81000
|
if (disabled || category !== null && (!active || active.disabled)) {
|
|
80808
81001
|
setOpen(false);
|
|
80809
81002
|
setCategory(null);
|
|
@@ -80882,7 +81075,8 @@ function FilterBar({
|
|
|
80882
81075
|
Button_default,
|
|
80883
81076
|
{
|
|
80884
81077
|
...actionStyle,
|
|
80885
|
-
variant:
|
|
81078
|
+
variant: searchButtonVariant,
|
|
81079
|
+
iconOnly: true,
|
|
80886
81080
|
leadingIcon: "Search",
|
|
80887
81081
|
"aria-label": t("kit.filterbar.search"),
|
|
80888
81082
|
"aria-expanded": expanded,
|
|
@@ -80982,18 +81176,18 @@ function FilterBar({
|
|
|
80982
81176
|
);
|
|
80983
81177
|
}
|
|
80984
81178
|
function FilterChips({ chips, color: color2, variant, size, buttonTone, buttonStyle, removeLabel }) {
|
|
80985
|
-
const [visible, setVisible] =
|
|
80986
|
-
const region =
|
|
80987
|
-
const positions =
|
|
81179
|
+
const [visible, setVisible] = useState111(chips);
|
|
81180
|
+
const region = useRef95(null);
|
|
81181
|
+
const positions = useRef95(/* @__PURE__ */ new Map());
|
|
80988
81182
|
const signature = chips.map((chip) => chip.id).join("\0");
|
|
80989
|
-
|
|
81183
|
+
useEffect91(() => {
|
|
80990
81184
|
const timer = setTimeout(() => setVisible((current) => current.filter((chip) => signature.split("\0").includes(chip.id))), 900);
|
|
80991
81185
|
return () => clearTimeout(timer);
|
|
80992
81186
|
}, [signature]);
|
|
80993
|
-
|
|
81187
|
+
useLayoutEffect37(() => {
|
|
80994
81188
|
setVisible((current) => [...chips, ...current.filter((chip) => !chips.some((next) => next.id === chip.id))]);
|
|
80995
81189
|
}, [signature]);
|
|
80996
|
-
|
|
81190
|
+
useLayoutEffect37(() => {
|
|
80997
81191
|
if (typeof matchMedia === "undefined" || matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
80998
81192
|
const next = /* @__PURE__ */ new Map();
|
|
80999
81193
|
region.current?.querySelectorAll("[data-chip]").forEach((element) => {
|
|
@@ -81072,7 +81266,7 @@ var AiRobot = memo2(function AiRobot2({ size = "md", tone = "neutral", paused =
|
|
|
81072
81266
|
});
|
|
81073
81267
|
|
|
81074
81268
|
// src/components/AgentMap/AgentMap.tsx
|
|
81075
|
-
import { useEffect as
|
|
81269
|
+
import { useEffect as useEffect92, useMemo as useMemo75, useRef as useRef96, useState as useState112 } from "react";
|
|
81076
81270
|
|
|
81077
81271
|
// src/components/GridBackground.tsx
|
|
81078
81272
|
import { jsx as jsx391, jsxs as jsxs247 } from "react/jsx-runtime";
|
|
@@ -81178,16 +81372,16 @@ var MAX_FOCUS_AGENTS = 20;
|
|
|
81178
81372
|
var EXPANDED_RADIUS = 164;
|
|
81179
81373
|
var COLLAPSED_RADIUS = 62;
|
|
81180
81374
|
function AgentMap({ projects, expandedProjectId, defaultExpandedProjectId = null, onExpandedProjectChange, selectedAgentId, defaultSelectedAgentId = null, onAgentSelect, renderAgentDetails, ariaLabel = "Agent activity", live = false, scattered = false, grid, panelVariant = "elevated", detailsVariant = "elevated", listVariant = "subtle", panelTone = "none", detailsTone = "none", listTone = "none", gridTone, glowTone, className, style }) {
|
|
81181
|
-
const [internalExpanded, setInternalExpanded] =
|
|
81182
|
-
const [internalSelected, setInternalSelected] =
|
|
81183
|
-
const [width, setWidth] =
|
|
81184
|
-
const [stacked, setStacked] =
|
|
81185
|
-
const rootRef =
|
|
81186
|
-
const viewportRef =
|
|
81375
|
+
const [internalExpanded, setInternalExpanded] = useState112(defaultExpandedProjectId);
|
|
81376
|
+
const [internalSelected, setInternalSelected] = useState112(defaultSelectedAgentId);
|
|
81377
|
+
const [width, setWidth] = useState112(720);
|
|
81378
|
+
const [stacked, setStacked] = useState112(false);
|
|
81379
|
+
const rootRef = useRef96(null);
|
|
81380
|
+
const viewportRef = useRef96(null);
|
|
81187
81381
|
const expanded = expandedProjectId === void 0 ? internalExpanded : expandedProjectId;
|
|
81188
81382
|
const selected = selectedAgentId === void 0 ? internalSelected : selectedAgentId;
|
|
81189
81383
|
const narrow = width < 400;
|
|
81190
|
-
|
|
81384
|
+
useEffect92(() => {
|
|
81191
81385
|
const el = viewportRef.current;
|
|
81192
81386
|
if (!el) return;
|
|
81193
81387
|
const measure = () => {
|
|
@@ -81200,7 +81394,7 @@ function AgentMap({ projects, expandedProjectId, defaultExpandedProjectId = null
|
|
|
81200
81394
|
observer.observe(el);
|
|
81201
81395
|
return () => observer.disconnect();
|
|
81202
81396
|
}, []);
|
|
81203
|
-
|
|
81397
|
+
useEffect92(() => {
|
|
81204
81398
|
const el = rootRef.current;
|
|
81205
81399
|
if (!el) return;
|
|
81206
81400
|
const measure = () => {
|
|
@@ -81363,10 +81557,10 @@ import {
|
|
|
81363
81557
|
createContext as createContext10,
|
|
81364
81558
|
useCallback as useCallback58,
|
|
81365
81559
|
useContext as useContext10,
|
|
81366
|
-
useEffect as
|
|
81560
|
+
useEffect as useEffect93,
|
|
81367
81561
|
useMemo as useMemo76,
|
|
81368
|
-
useRef as
|
|
81369
|
-
useState as
|
|
81562
|
+
useRef as useRef97,
|
|
81563
|
+
useState as useState113
|
|
81370
81564
|
} from "react";
|
|
81371
81565
|
import { createPortal as createPortal21 } from "react-dom";
|
|
81372
81566
|
import classNames150 from "classnames";
|
|
@@ -81382,9 +81576,9 @@ var renderSlot = (slot, controls) => {
|
|
|
81382
81576
|
var BottomSheetProvider = ({
|
|
81383
81577
|
children
|
|
81384
81578
|
}) => {
|
|
81385
|
-
const [sheet, setSheet] =
|
|
81386
|
-
const [isVisible, setIsVisible] =
|
|
81387
|
-
const pendingCloseRef =
|
|
81579
|
+
const [sheet, setSheet] = useState113(null);
|
|
81580
|
+
const [isVisible, setIsVisible] = useState113(false);
|
|
81581
|
+
const pendingCloseRef = useRef97(null);
|
|
81388
81582
|
const dismissSheet = useCallback58(() => {
|
|
81389
81583
|
setIsVisible(false);
|
|
81390
81584
|
}, []);
|
|
@@ -81401,7 +81595,7 @@ var BottomSheetProvider = ({
|
|
|
81401
81595
|
setTimeout(animateIn, 0);
|
|
81402
81596
|
}
|
|
81403
81597
|
}, []);
|
|
81404
|
-
|
|
81598
|
+
useEffect93(() => {
|
|
81405
81599
|
if (!isVisible && sheet) {
|
|
81406
81600
|
pendingCloseRef.current = setTimeout(() => {
|
|
81407
81601
|
sheet.onClose?.();
|
|
@@ -81416,7 +81610,7 @@ var BottomSheetProvider = ({
|
|
|
81416
81610
|
}
|
|
81417
81611
|
return void 0;
|
|
81418
81612
|
}, [isVisible, sheet]);
|
|
81419
|
-
|
|
81613
|
+
useEffect93(
|
|
81420
81614
|
() => () => {
|
|
81421
81615
|
if (pendingCloseRef.current) {
|
|
81422
81616
|
clearTimeout(pendingCloseRef.current);
|
|
@@ -82158,7 +82352,7 @@ var MetricBar = ({
|
|
|
82158
82352
|
MetricBar.displayName = "MetricBar";
|
|
82159
82353
|
|
|
82160
82354
|
// src/components/NetworkGraph/NetworkGraph.tsx
|
|
82161
|
-
import { useEffect as
|
|
82355
|
+
import { useEffect as useEffect95, useId as useId55, useMemo as useMemo77, useRef as useRef99, useState as useState115 } from "react";
|
|
82162
82356
|
|
|
82163
82357
|
// src/components/NetworkGraph/model.ts
|
|
82164
82358
|
var CELL = 64;
|
|
@@ -82302,16 +82496,16 @@ function findNetworkPath(edges, source, target) {
|
|
|
82302
82496
|
}
|
|
82303
82497
|
|
|
82304
82498
|
// src/components/NetworkGraph/useNetworkCanvas.ts
|
|
82305
|
-
import { useCallback as useCallback59, useEffect as
|
|
82499
|
+
import { useCallback as useCallback59, useEffect as useEffect94, useRef as useRef98, useState as useState114 } from "react";
|
|
82306
82500
|
function useNetworkCanvas(options) {
|
|
82307
|
-
const canvasRef =
|
|
82308
|
-
const view =
|
|
82309
|
-
const size =
|
|
82310
|
-
const latest =
|
|
82311
|
-
const frame =
|
|
82312
|
-
const [zoom, setZoom] =
|
|
82313
|
-
const colors3 =
|
|
82314
|
-
const textColor =
|
|
82501
|
+
const canvasRef = useRef98(null);
|
|
82502
|
+
const view = useRef98({ x: 0, y: 0, zoom: 1 });
|
|
82503
|
+
const size = useRef98({ width: 1, height: 1 });
|
|
82504
|
+
const latest = useRef98(options);
|
|
82505
|
+
const frame = useRef98(null);
|
|
82506
|
+
const [zoom, setZoom] = useState114(1);
|
|
82507
|
+
const colors3 = useRef98(/* @__PURE__ */ new Map());
|
|
82508
|
+
const textColor = useRef98("#737373");
|
|
82315
82509
|
const draw = useCallback59(() => {
|
|
82316
82510
|
const canvas = canvasRef.current;
|
|
82317
82511
|
const ctx = canvas?.getContext("2d");
|
|
@@ -82452,14 +82646,14 @@ function useNetworkCanvas(options) {
|
|
|
82452
82646
|
},
|
|
82453
82647
|
[update]
|
|
82454
82648
|
);
|
|
82455
|
-
|
|
82649
|
+
useEffect94(() => {
|
|
82456
82650
|
latest.current = options;
|
|
82457
82651
|
requestDraw();
|
|
82458
82652
|
}, [options, requestDraw]);
|
|
82459
|
-
|
|
82653
|
+
useEffect94(() => {
|
|
82460
82654
|
fit();
|
|
82461
82655
|
}, [options.model, fit]);
|
|
82462
|
-
|
|
82656
|
+
useEffect94(() => {
|
|
82463
82657
|
const canvas = canvasRef.current;
|
|
82464
82658
|
if (!canvas) return;
|
|
82465
82659
|
const measure = () => {
|
|
@@ -82545,10 +82739,10 @@ function NetworkGraph({
|
|
|
82545
82739
|
const tone = getSurfaceAccentColor(surfaceTone);
|
|
82546
82740
|
const t = useKitT();
|
|
82547
82741
|
const helpId = useId55();
|
|
82548
|
-
const layoutRef =
|
|
82549
|
-
const [hasLegendSpace, setHasLegendSpace] =
|
|
82742
|
+
const layoutRef = useRef99(null);
|
|
82743
|
+
const [hasLegendSpace, setHasLegendSpace] = useState115(true);
|
|
82550
82744
|
const legendOnRight = legendPosition === "right" || legendPosition === "auto" && hasLegendSpace;
|
|
82551
|
-
|
|
82745
|
+
useEffect95(() => {
|
|
82552
82746
|
const element = layoutRef.current;
|
|
82553
82747
|
if (!element || legendPosition !== "auto") return;
|
|
82554
82748
|
const measure = () => setHasLegendSpace(element.getBoundingClientRect().width >= 600);
|
|
@@ -82561,12 +82755,12 @@ function NetworkGraph({
|
|
|
82561
82755
|
() => buildNetwork(nodes, edges, communities),
|
|
82562
82756
|
[nodes, edges, communities]
|
|
82563
82757
|
);
|
|
82564
|
-
const [internalSelected, setInternalSelected] =
|
|
82758
|
+
const [internalSelected, setInternalSelected] = useState115(
|
|
82565
82759
|
defaultSelectedNodeId
|
|
82566
82760
|
);
|
|
82567
|
-
const [hidden, setHidden] =
|
|
82568
|
-
const [focused, setFocused] =
|
|
82569
|
-
const [query, setQuery] =
|
|
82761
|
+
const [hidden, setHidden] = useState115(() => /* @__PURE__ */ new Set());
|
|
82762
|
+
const [focused, setFocused] = useState115(null);
|
|
82763
|
+
const [query, setQuery] = useState115("");
|
|
82570
82764
|
const enabled = useMemo77(
|
|
82571
82765
|
() => new Set(
|
|
82572
82766
|
visibleCommunityIds ?? model.groups.filter((g) => !hidden.has(g.id)).map((g) => g.id)
|
|
@@ -82608,7 +82802,7 @@ function NetworkGraph({
|
|
|
82608
82802
|
onViewportChange
|
|
82609
82803
|
});
|
|
82610
82804
|
const locked = disabled || loading;
|
|
82611
|
-
const drag =
|
|
82805
|
+
const drag = useRef99(null);
|
|
82612
82806
|
const select = (id) => {
|
|
82613
82807
|
if (locked) return;
|
|
82614
82808
|
if (selectedNodeId === void 0) setInternalSelected(id);
|
|
@@ -82624,7 +82818,7 @@ function NetworkGraph({
|
|
|
82624
82818
|
);
|
|
82625
82819
|
onVisibleCommunitiesChange?.(ids);
|
|
82626
82820
|
};
|
|
82627
|
-
|
|
82821
|
+
useEffect95(() => {
|
|
82628
82822
|
const element = canvas.canvasRef.current;
|
|
82629
82823
|
if (!element || locked) return;
|
|
82630
82824
|
const wheel = (event) => {
|