@cjlapao/ui-kit 0.2.33 → 0.2.34
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 +539 -432
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +311 -204
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -51227,7 +51227,7 @@ function useResizable({
|
|
|
51227
51227
|
const getMaxWidth = useCallback37(() => {
|
|
51228
51228
|
return typeof maxWidthOpt === "function" ? maxWidthOpt() : maxWidthOpt;
|
|
51229
51229
|
}, [maxWidthOpt]);
|
|
51230
|
-
const
|
|
51230
|
+
const clamp5 = useCallback37(
|
|
51231
51231
|
(value) => Math.max(minWidth, Math.min(getMaxWidth(), value)),
|
|
51232
51232
|
[minWidth, getMaxWidth]
|
|
51233
51233
|
);
|
|
@@ -51235,7 +51235,7 @@ function useResizable({
|
|
|
51235
51235
|
if (!isDragging) return;
|
|
51236
51236
|
const handlePointerMove = (e) => {
|
|
51237
51237
|
const delta = e.clientX - startXRef.current;
|
|
51238
|
-
const newWidth =
|
|
51238
|
+
const newWidth = clamp5(startWidthRef.current + delta);
|
|
51239
51239
|
setWidth(newWidth);
|
|
51240
51240
|
onResize?.(newWidth);
|
|
51241
51241
|
};
|
|
@@ -51258,7 +51258,7 @@ function useResizable({
|
|
|
51258
51258
|
document.body.style.cursor = "";
|
|
51259
51259
|
document.body.style.userSelect = "";
|
|
51260
51260
|
};
|
|
51261
|
-
}, [isDragging,
|
|
51261
|
+
}, [isDragging, clamp5, onResize, onResizeEnd]);
|
|
51262
51262
|
const onPointerDown = useCallback37(
|
|
51263
51263
|
(e) => {
|
|
51264
51264
|
if (!enabled) return;
|
|
@@ -51275,9 +51275,9 @@ function useResizable({
|
|
|
51275
51275
|
const step = 20;
|
|
51276
51276
|
let newWidth = width;
|
|
51277
51277
|
if (e.key === "ArrowRight") {
|
|
51278
|
-
newWidth =
|
|
51278
|
+
newWidth = clamp5(width + step);
|
|
51279
51279
|
} else if (e.key === "ArrowLeft") {
|
|
51280
|
-
newWidth =
|
|
51280
|
+
newWidth = clamp5(width - step);
|
|
51281
51281
|
} else {
|
|
51282
51282
|
return;
|
|
51283
51283
|
}
|
|
@@ -51286,7 +51286,7 @@ function useResizable({
|
|
|
51286
51286
|
onResize?.(newWidth);
|
|
51287
51287
|
onResizeEnd?.(newWidth);
|
|
51288
51288
|
},
|
|
51289
|
-
[enabled, width,
|
|
51289
|
+
[enabled, width, clamp5, onResize, onResizeEnd]
|
|
51290
51290
|
);
|
|
51291
51291
|
const resolvedMax = getMaxWidth();
|
|
51292
51292
|
return {
|
|
@@ -67650,9 +67650,73 @@ import { useMemo as useMemo59 } from "react";
|
|
|
67650
67650
|
import classNames124 from "classnames";
|
|
67651
67651
|
|
|
67652
67652
|
// src/components/WorkflowTracker/WorkflowTrackerRail.tsx
|
|
67653
|
-
import { useId as
|
|
67653
|
+
import { useId as useId47, useMemo as useMemo55, useState as useState86 } from "react";
|
|
67654
67654
|
import classNames117 from "classnames";
|
|
67655
67655
|
|
|
67656
|
+
// src/components/WorkflowTracker/useWorkflowFooterResize.ts
|
|
67657
|
+
import { useId as useId46, useRef as useRef74, useState as useState85 } from "react";
|
|
67658
|
+
var clamp4 = (value) => Number.isFinite(value) ? Math.max(10, Math.min(80, value)) : 30;
|
|
67659
|
+
function useWorkflowFooterResize({ height, defaultHeight, onChange, enabled }) {
|
|
67660
|
+
const [internal, setInternal] = useState85(() => clamp4(defaultHeight));
|
|
67661
|
+
const percentage = clamp4(height ?? internal);
|
|
67662
|
+
const bodyRef = useRef74(null);
|
|
67663
|
+
const drag = useRef74(null);
|
|
67664
|
+
const [dragging, setDragging] = useState85(false);
|
|
67665
|
+
const footerId = useId46();
|
|
67666
|
+
const update = (next) => {
|
|
67667
|
+
const value = clamp4(next);
|
|
67668
|
+
if (height === void 0) setInternal(value);
|
|
67669
|
+
onChange?.(value);
|
|
67670
|
+
};
|
|
67671
|
+
const finish = () => {
|
|
67672
|
+
drag.current = null;
|
|
67673
|
+
setDragging(false);
|
|
67674
|
+
};
|
|
67675
|
+
return {
|
|
67676
|
+
percentage,
|
|
67677
|
+
bodyRef,
|
|
67678
|
+
footerId,
|
|
67679
|
+
dragging: enabled && dragging,
|
|
67680
|
+
handleProps: {
|
|
67681
|
+
role: "separator",
|
|
67682
|
+
tabIndex: 0,
|
|
67683
|
+
"aria-orientation": "horizontal",
|
|
67684
|
+
"aria-valuemin": 10,
|
|
67685
|
+
"aria-valuemax": 80,
|
|
67686
|
+
"aria-valuenow": Math.round(percentage),
|
|
67687
|
+
"aria-valuetext": `${Math.round(percentage)}%`,
|
|
67688
|
+
"aria-controls": footerId,
|
|
67689
|
+
onPointerDown: (event) => {
|
|
67690
|
+
if (!enabled || event.button !== 0 || event.isPrimary === false) return;
|
|
67691
|
+
const bounds = bodyRef.current?.getBoundingClientRect();
|
|
67692
|
+
const available = (bounds?.height ?? 0) - event.currentTarget.getBoundingClientRect().height;
|
|
67693
|
+
if (available <= 0) return;
|
|
67694
|
+
event.preventDefault();
|
|
67695
|
+
event.currentTarget.focus();
|
|
67696
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
67697
|
+
drag.current = { y: event.clientY, height: available, percentage, pointerId: event.pointerId };
|
|
67698
|
+
setDragging(true);
|
|
67699
|
+
},
|
|
67700
|
+
onPointerMove: (event) => {
|
|
67701
|
+
const start = drag.current;
|
|
67702
|
+
if (!enabled || !start || start.pointerId !== event.pointerId) return;
|
|
67703
|
+
update(start.percentage + (start.y - event.clientY) / start.height * 100);
|
|
67704
|
+
},
|
|
67705
|
+
onPointerUp: finish,
|
|
67706
|
+
onPointerCancel: finish,
|
|
67707
|
+
onLostPointerCapture: finish,
|
|
67708
|
+
onKeyDown: (event) => {
|
|
67709
|
+
if (!enabled) return;
|
|
67710
|
+
const step = event.shiftKey ? 10 : 5;
|
|
67711
|
+
const next = event.key === "ArrowUp" ? percentage + step : event.key === "ArrowDown" ? percentage - step : event.key === "Home" ? 10 : event.key === "End" ? 80 : void 0;
|
|
67712
|
+
if (next === void 0) return;
|
|
67713
|
+
event.preventDefault();
|
|
67714
|
+
update(next);
|
|
67715
|
+
}
|
|
67716
|
+
}
|
|
67717
|
+
};
|
|
67718
|
+
}
|
|
67719
|
+
|
|
67656
67720
|
// src/components/WorkflowTracker/WorkflowTimeline.tsx
|
|
67657
67721
|
import React96 from "react";
|
|
67658
67722
|
import classNames116 from "classnames";
|
|
@@ -68183,6 +68247,12 @@ var NestedSubSteps = ({
|
|
|
68183
68247
|
var WorkflowTimeline = ({
|
|
68184
68248
|
disableFutureSteps = false,
|
|
68185
68249
|
controls,
|
|
68250
|
+
footerResizable = false,
|
|
68251
|
+
defaultFooterHeight = 30,
|
|
68252
|
+
footerHeight,
|
|
68253
|
+
onFooterHeightChange,
|
|
68254
|
+
footerLabel = "Workflow footer",
|
|
68255
|
+
footerResizeLabel = "Resize workflow footer",
|
|
68186
68256
|
hasCollapseToggle = false,
|
|
68187
68257
|
renderStepPopover,
|
|
68188
68258
|
stepPopoverProps,
|
|
@@ -68206,6 +68276,14 @@ var WorkflowTimeline = ({
|
|
|
68206
68276
|
onStepAction
|
|
68207
68277
|
}) => {
|
|
68208
68278
|
const isEmpty2 = steps.length === 0;
|
|
68279
|
+
const hasFooter = controls != null && controls !== false;
|
|
68280
|
+
const resizableFooter = footerResizable && fillHeight && hasFooter;
|
|
68281
|
+
const footer = useWorkflowFooterResize({
|
|
68282
|
+
height: footerHeight,
|
|
68283
|
+
defaultHeight: defaultFooterHeight,
|
|
68284
|
+
onChange: onFooterHeightChange,
|
|
68285
|
+
enabled: resizableFooter
|
|
68286
|
+
});
|
|
68209
68287
|
const tallyEntries = [
|
|
68210
68288
|
{ count: tallies.done, label: labels.done },
|
|
68211
68289
|
{ count: tallies.skipped, label: labels.skipped },
|
|
@@ -68292,16 +68370,18 @@ var WorkflowTimeline = ({
|
|
|
68292
68370
|
]
|
|
68293
68371
|
}
|
|
68294
68372
|
),
|
|
68295
|
-
/* @__PURE__ */ jsxs194(
|
|
68296
|
-
|
|
68297
|
-
|
|
68298
|
-
|
|
68299
|
-
|
|
68300
|
-
|
|
68301
|
-
|
|
68302
|
-
|
|
68303
|
-
|
|
68304
|
-
|
|
68373
|
+
/* @__PURE__ */ jsxs194("div", { ref: footer.bodyRef, className: classNames116("flex min-h-0 flex-col", fillHeight && "flex-1", footer.dragging && "select-none"), children: [
|
|
68374
|
+
/* @__PURE__ */ jsx314(
|
|
68375
|
+
ScrollArea_default,
|
|
68376
|
+
{
|
|
68377
|
+
variant: "hover",
|
|
68378
|
+
className: fillHeight ? "min-h-0 flex-1" : void 0,
|
|
68379
|
+
style: fillHeight ? { flex: `${hasFooter ? 100 - footer.percentage : 100} 1 0%` } : void 0,
|
|
68380
|
+
viewportClassName: "overscroll-contain",
|
|
68381
|
+
contentClassName: classNames116(
|
|
68382
|
+
!loading && !isEmpty2 && (collapsed ? "px-2 py-4" : "px-5 py-5")
|
|
68383
|
+
),
|
|
68384
|
+
children: loading ? /* @__PURE__ */ jsx314(WorkflowRailSkeleton, { rows: loadingRows, collapsed }) : isEmpty2 ? collapsed ? /* @__PURE__ */ jsx314("span", { className: "sr-only", children: labels.empty }) : emptyState ?? /* @__PURE__ */ jsx314(
|
|
68305
68385
|
WorkflowPlaceholder,
|
|
68306
68386
|
{
|
|
68307
68387
|
title: labels.empty,
|
|
@@ -68496,21 +68576,36 @@ var WorkflowTimeline = ({
|
|
|
68496
68576
|
},
|
|
68497
68577
|
step.id
|
|
68498
68578
|
);
|
|
68499
|
-
}) })
|
|
68500
|
-
|
|
68501
|
-
|
|
68502
|
-
|
|
68503
|
-
|
|
68504
|
-
|
|
68505
|
-
|
|
68506
|
-
|
|
68507
|
-
|
|
68508
|
-
|
|
68509
|
-
}
|
|
68510
|
-
|
|
68511
|
-
|
|
68512
|
-
|
|
68513
|
-
|
|
68579
|
+
}) })
|
|
68580
|
+
}
|
|
68581
|
+
),
|
|
68582
|
+
resizableFooter && /* @__PURE__ */ jsxs194(
|
|
68583
|
+
"div",
|
|
68584
|
+
{
|
|
68585
|
+
...footer.handleProps,
|
|
68586
|
+
"aria-label": footerResizeLabel,
|
|
68587
|
+
className: classNames116("group relative flex h-3 shrink-0 touch-none cursor-row-resize items-center justify-center outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-neutral-400", surfaces.border),
|
|
68588
|
+
children: [
|
|
68589
|
+
/* @__PURE__ */ jsx314("span", { "aria-hidden": "true", className: classNames116("pointer-events-none absolute inset-x-0 top-1/2 border-t", surfaces.border) }),
|
|
68590
|
+
/* @__PURE__ */ jsx314("span", { "aria-hidden": "true", className: classNames116("relative h-1 w-10 rounded-full bg-neutral-400 transition-opacity dark:bg-neutral-500", footer.dragging ? "opacity-100" : "opacity-40 group-hover:opacity-100 group-focus-visible:opacity-100") })
|
|
68591
|
+
]
|
|
68592
|
+
}
|
|
68593
|
+
),
|
|
68594
|
+
hasFooter && /* @__PURE__ */ jsx314(
|
|
68595
|
+
ScrollArea_default,
|
|
68596
|
+
{
|
|
68597
|
+
id: footer.footerId,
|
|
68598
|
+
role: "region",
|
|
68599
|
+
"aria-label": footerLabel,
|
|
68600
|
+
variant: "hover",
|
|
68601
|
+
className: classNames116(!resizableFooter && "border-t", surfaces.border, fillHeight && "min-h-0"),
|
|
68602
|
+
style: fillHeight ? { flex: `${footer.percentage} 1 0%` } : void 0,
|
|
68603
|
+
viewportClassName: "overscroll-contain",
|
|
68604
|
+
contentClassName: collapsed ? "px-2 py-4" : "px-5 py-4",
|
|
68605
|
+
children: controls
|
|
68606
|
+
}
|
|
68607
|
+
)
|
|
68608
|
+
] }),
|
|
68514
68609
|
showLegend && !isEmpty2 && !collapsed && /* @__PURE__ */ jsx314(
|
|
68515
68610
|
"div",
|
|
68516
68611
|
{
|
|
@@ -68903,6 +68998,12 @@ var WorkflowTrackerRail = ({
|
|
|
68903
68998
|
collapseLabel = "Collapse workflow rail",
|
|
68904
68999
|
renderStepPopover,
|
|
68905
69000
|
renderControls,
|
|
69001
|
+
footerResizable = false,
|
|
69002
|
+
defaultFooterHeight = 30,
|
|
69003
|
+
footerHeight,
|
|
69004
|
+
onFooterHeightChange,
|
|
69005
|
+
footerLabel = "Workflow footer",
|
|
69006
|
+
footerResizeLabel = "Resize workflow footer",
|
|
68906
69007
|
stepPopoverProps,
|
|
68907
69008
|
data = sampleWorkflow,
|
|
68908
69009
|
loading = false,
|
|
@@ -68920,9 +69021,9 @@ var WorkflowTrackerRail = ({
|
|
|
68920
69021
|
style,
|
|
68921
69022
|
...styleProps
|
|
68922
69023
|
}) => {
|
|
68923
|
-
const [internalCollapsed, setInternalCollapsed] =
|
|
69024
|
+
const [internalCollapsed, setInternalCollapsed] = useState86(defaultCollapsed);
|
|
68924
69025
|
const isCollapsed = collapsible && (collapsed ?? internalCollapsed);
|
|
68925
|
-
const timelineId =
|
|
69026
|
+
const timelineId = useId47();
|
|
68926
69027
|
const scrollBody = fillHeight || (cardScrollable ?? false);
|
|
68927
69028
|
const steps = data?.steps ?? [];
|
|
68928
69029
|
const { palette, surfaces, customStatuses } = useWorkflowChrome(styleProps);
|
|
@@ -68994,6 +69095,12 @@ var WorkflowTrackerRail = ({
|
|
|
68994
69095
|
WorkflowTimeline_default,
|
|
68995
69096
|
{
|
|
68996
69097
|
controls: renderControls?.({ collapsed: isCollapsed }),
|
|
69098
|
+
footerResizable,
|
|
69099
|
+
defaultFooterHeight,
|
|
69100
|
+
footerHeight,
|
|
69101
|
+
onFooterHeightChange,
|
|
69102
|
+
footerLabel,
|
|
69103
|
+
footerResizeLabel,
|
|
68997
69104
|
collapsed: isCollapsed,
|
|
68998
69105
|
side,
|
|
68999
69106
|
hasCollapseToggle: collapsible,
|
|
@@ -69651,7 +69758,7 @@ var WorkflowTracker = ({
|
|
|
69651
69758
|
var WorkflowTracker_default = WorkflowTracker;
|
|
69652
69759
|
|
|
69653
69760
|
// src/components/Gantt/Gantt.tsx
|
|
69654
|
-
import { useCallback as useCallback48, useEffect as useEffect76, useMemo as useMemo63, useRef as
|
|
69761
|
+
import { useCallback as useCallback48, useEffect as useEffect76, useMemo as useMemo63, useRef as useRef77, useState as useState88 } from "react";
|
|
69655
69762
|
import { createPortal as createPortal16 } from "react-dom";
|
|
69656
69763
|
import classNames128 from "classnames";
|
|
69657
69764
|
|
|
@@ -71283,7 +71390,7 @@ var GanttScale = ({ levels, height }) => {
|
|
|
71283
71390
|
GanttScale.displayName = "GanttScale";
|
|
71284
71391
|
|
|
71285
71392
|
// src/components/Gantt/GanttLinkLayer.tsx
|
|
71286
|
-
import { forwardRef as forwardRef168, useRef as
|
|
71393
|
+
import { forwardRef as forwardRef168, useRef as useRef75 } from "react";
|
|
71287
71394
|
import { jsx as jsx325, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
71288
71395
|
var GanttLinkLayer = forwardRef168(
|
|
71289
71396
|
function GanttLinkLayer2({
|
|
@@ -71299,7 +71406,7 @@ var GanttLinkLayer = forwardRef168(
|
|
|
71299
71406
|
onDeleteLink
|
|
71300
71407
|
}, ref) {
|
|
71301
71408
|
const t = useKitT();
|
|
71302
|
-
const svgRef =
|
|
71409
|
+
const svgRef = useRef75(null);
|
|
71303
71410
|
const selPath = selected ? paths.find((p) => p.link === selected) : void 0;
|
|
71304
71411
|
const selColor = selPath ? selPath.color ?? color2 : color2;
|
|
71305
71412
|
const selMid = selPath ? { x: (selPath.from.x + selPath.to.x) / 2, y: (selPath.from.y + selPath.to.y) / 2 } : null;
|
|
@@ -71962,13 +72069,13 @@ var GanttToolbar = ({
|
|
|
71962
72069
|
GanttToolbar.displayName = "GanttToolbar";
|
|
71963
72070
|
|
|
71964
72071
|
// src/components/Gantt/useGanttDrag.ts
|
|
71965
|
-
import { useCallback as useCallback47, useEffect as useEffect75, useMemo as useMemo62, useRef as
|
|
72072
|
+
import { useCallback as useCallback47, useEffect as useEffect75, useMemo as useMemo62, useRef as useRef76, useState as useState87 } from "react";
|
|
71966
72073
|
function useGanttDrag(opts) {
|
|
71967
|
-
const [drag, setDrag] =
|
|
71968
|
-
const [linkSelected, setLinkSelected] =
|
|
71969
|
-
const optsRef =
|
|
72074
|
+
const [drag, setDrag] = useState87(null);
|
|
72075
|
+
const [linkSelected, setLinkSelected] = useState87(null);
|
|
72076
|
+
const optsRef = useRef76(opts);
|
|
71970
72077
|
optsRef.current = opts;
|
|
71971
|
-
const dragRef =
|
|
72078
|
+
const dragRef = useRef76(null);
|
|
71972
72079
|
dragRef.current = drag;
|
|
71973
72080
|
const { rows, zoom, rangeStart, accentColor } = opts;
|
|
71974
72081
|
const barGeom = useCallback47(
|
|
@@ -72396,7 +72503,7 @@ var Gantt = ({
|
|
|
72396
72503
|
}));
|
|
72397
72504
|
const interactive = editable ?? Boolean(onTasksChange || onLinksChange || onReorder);
|
|
72398
72505
|
const surfaceText = useMemo63(() => getSurfaceTextTokens(variant), [variant]);
|
|
72399
|
-
const [internalZoom, setInternalZoom] =
|
|
72506
|
+
const [internalZoom, setInternalZoom] = useState88(initialZoom);
|
|
72400
72507
|
const zoom = zoomProp ?? internalZoom;
|
|
72401
72508
|
const setZoom = useCallback48(
|
|
72402
72509
|
(z) => {
|
|
@@ -72406,7 +72513,7 @@ var Gantt = ({
|
|
|
72406
72513
|
},
|
|
72407
72514
|
[minZoom, maxZoom, onZoomChange]
|
|
72408
72515
|
);
|
|
72409
|
-
const [internalSelection, setInternalSelection] =
|
|
72516
|
+
const [internalSelection, setInternalSelection] = useState88(null);
|
|
72410
72517
|
const selectedId = selectedIdProp !== void 0 ? selectedIdProp : internalSelection;
|
|
72411
72518
|
const setSelected = useCallback48(
|
|
72412
72519
|
(id) => {
|
|
@@ -72415,7 +72522,7 @@ var Gantt = ({
|
|
|
72415
72522
|
},
|
|
72416
72523
|
[onSelect, selectedIdProp]
|
|
72417
72524
|
);
|
|
72418
|
-
const [internalOrder, setInternalOrder] =
|
|
72525
|
+
const [internalOrder, setInternalOrder] = useState88(void 0);
|
|
72419
72526
|
const rowOrder = rowOrderProp ?? internalOrder;
|
|
72420
72527
|
const handleReorder = useCallback48(
|
|
72421
72528
|
(order) => {
|
|
@@ -72424,14 +72531,14 @@ var Gantt = ({
|
|
|
72424
72531
|
},
|
|
72425
72532
|
[onReorder, rowOrderProp]
|
|
72426
72533
|
);
|
|
72427
|
-
const [collapsed, setCollapsed] =
|
|
72534
|
+
const [collapsed, setCollapsed] = useState88(
|
|
72428
72535
|
() => new Set(tasks.filter((t2) => t2.open === false).map((t2) => t2.id))
|
|
72429
72536
|
);
|
|
72430
|
-
const [closedLanes, setClosedLanes] =
|
|
72537
|
+
const [closedLanes, setClosedLanes] = useState88(
|
|
72431
72538
|
() => new Set((lanes ?? []).filter((l) => l.open === false).map((l) => l.id))
|
|
72432
72539
|
);
|
|
72433
|
-
const tasksRef =
|
|
72434
|
-
const lanesRef =
|
|
72540
|
+
const tasksRef = useRef77(tasks);
|
|
72541
|
+
const lanesRef = useRef77(lanes);
|
|
72435
72542
|
useEffect76(() => {
|
|
72436
72543
|
if (tasksRef.current !== tasks) {
|
|
72437
72544
|
tasksRef.current = tasks;
|
|
@@ -72485,7 +72592,7 @@ var Gantt = ({
|
|
|
72485
72592
|
() => buildTimeScale(range.start, range.end, zoom, dateLocale),
|
|
72486
72593
|
[range, zoom, dateLocale]
|
|
72487
72594
|
);
|
|
72488
|
-
const [colWidths, setColWidths] =
|
|
72595
|
+
const [colWidths, setColWidths] = useState88(
|
|
72489
72596
|
() => columnWidths ? { ...columnWidths } : {}
|
|
72490
72597
|
);
|
|
72491
72598
|
useEffect76(() => {
|
|
@@ -72502,7 +72609,7 @@ var Gantt = ({
|
|
|
72502
72609
|
() => resolvedColumns.map((c) => ({ ...c, width: `${effectiveColWidth(c)}px` })),
|
|
72503
72610
|
[resolvedColumns, colWidths]
|
|
72504
72611
|
);
|
|
72505
|
-
const effectiveWidthsRef =
|
|
72612
|
+
const effectiveWidthsRef = useRef77({});
|
|
72506
72613
|
effectiveWidthsRef.current = Object.fromEntries(
|
|
72507
72614
|
sizedColumns.map((c) => [c.key, effectiveColWidth(c)])
|
|
72508
72615
|
);
|
|
@@ -72510,8 +72617,8 @@ var Gantt = ({
|
|
|
72510
72617
|
() => GRIP_WIDTH + resolvedColumns.reduce((sum, c) => sum + effectiveColWidth(c), 0),
|
|
72511
72618
|
[resolvedColumns, colWidths]
|
|
72512
72619
|
);
|
|
72513
|
-
const resizingRef =
|
|
72514
|
-
const [resizingKey, setResizingKey] =
|
|
72620
|
+
const resizingRef = useRef77(null);
|
|
72621
|
+
const [resizingKey, setResizingKey] = useState88(null);
|
|
72515
72622
|
const startColumnResize = useCallback48(
|
|
72516
72623
|
(e, key) => {
|
|
72517
72624
|
if (e.button !== 0) return;
|
|
@@ -72550,10 +72657,10 @@ var Gantt = ({
|
|
|
72550
72657
|
},
|
|
72551
72658
|
[]
|
|
72552
72659
|
);
|
|
72553
|
-
const scrollRef =
|
|
72554
|
-
const overlayRef =
|
|
72555
|
-
const rootRef =
|
|
72556
|
-
const headerScaleRef =
|
|
72660
|
+
const scrollRef = useRef77(null);
|
|
72661
|
+
const overlayRef = useRef77(null);
|
|
72662
|
+
const rootRef = useRef77(null);
|
|
72663
|
+
const headerScaleRef = useRef77(null);
|
|
72557
72664
|
const syncHeaderScale = useCallback48(() => {
|
|
72558
72665
|
const s = scrollRef.current;
|
|
72559
72666
|
const h = headerScaleRef.current;
|
|
@@ -72593,7 +72700,7 @@ var Gantt = ({
|
|
|
72593
72700
|
useEffect76(() => {
|
|
72594
72701
|
syncHeaderScale();
|
|
72595
72702
|
}, [syncHeaderScale, timelineWidth, zoom, range.start, leftWidth]);
|
|
72596
|
-
const liveRowsRef =
|
|
72703
|
+
const liveRowsRef = useRef77(null);
|
|
72597
72704
|
const dragApi = useGanttDrag({
|
|
72598
72705
|
scrollRef,
|
|
72599
72706
|
overlayRef,
|
|
@@ -73269,7 +73376,7 @@ var GanttSkeleton = ({
|
|
|
73269
73376
|
] }, i)) });
|
|
73270
73377
|
|
|
73271
73378
|
// src/components/TaskBoard/TaskBoard.tsx
|
|
73272
|
-
import { useCallback as useCallback54, useEffect as useEffect81, useMemo as useMemo68, useRef as
|
|
73379
|
+
import { useCallback as useCallback54, useEffect as useEffect81, useMemo as useMemo68, useRef as useRef83, useState as useState97 } from "react";
|
|
73273
73380
|
import classNames139 from "classnames";
|
|
73274
73381
|
|
|
73275
73382
|
// ../common/taskboard/types.ts
|
|
@@ -74078,10 +74185,10 @@ var TaskBoardBucket = ({ column, lane, cards, className, label }) => {
|
|
|
74078
74185
|
};
|
|
74079
74186
|
|
|
74080
74187
|
// src/components/TaskBoard/usePresence.ts
|
|
74081
|
-
import { useEffect as useEffect77, useState as
|
|
74188
|
+
import { useEffect as useEffect77, useState as useState89 } from "react";
|
|
74082
74189
|
var COLLAPSE_MS = 200;
|
|
74083
74190
|
function usePresence(open, ms = COLLAPSE_MS) {
|
|
74084
|
-
const [mounted, setMounted] =
|
|
74191
|
+
const [mounted, setMounted] = useState89(open);
|
|
74085
74192
|
useEffect77(() => {
|
|
74086
74193
|
if (open) {
|
|
74087
74194
|
setMounted(true);
|
|
@@ -74099,7 +74206,7 @@ function usePresence(open, ms = COLLAPSE_MS) {
|
|
|
74099
74206
|
}
|
|
74100
74207
|
|
|
74101
74208
|
// src/components/TaskBoard/TaskBoardColumnEdit.tsx
|
|
74102
|
-
import { useState as
|
|
74209
|
+
import { useState as useState90 } from "react";
|
|
74103
74210
|
import { createPortal as createPortal17 } from "react-dom";
|
|
74104
74211
|
import classNames131 from "classnames";
|
|
74105
74212
|
import { jsx as jsx331, jsxs as jsxs207 } from "react/jsx-runtime";
|
|
@@ -74127,8 +74234,8 @@ var TaskBoardAddColumn = ({
|
|
|
74127
74234
|
variant
|
|
74128
74235
|
}) => {
|
|
74129
74236
|
const { text: text2, surface, color: color2, size, columnCornerClass } = useTaskBoard();
|
|
74130
|
-
const [editing, setEditing] =
|
|
74131
|
-
const [title, setTitle] =
|
|
74237
|
+
const [editing, setEditing] = useState90(false);
|
|
74238
|
+
const [title, setTitle] = useState90("");
|
|
74132
74239
|
const trigger = getSurfaceTriggerTokens(color2);
|
|
74133
74240
|
const close = () => {
|
|
74134
74241
|
setEditing(false);
|
|
@@ -74241,7 +74348,7 @@ var TaskBoardColumnClone = ({ drag, column, cards, count }) => {
|
|
|
74241
74348
|
};
|
|
74242
74349
|
|
|
74243
74350
|
// src/components/TaskBoard/TaskBoardColumnEditor.tsx
|
|
74244
|
-
import { useId as
|
|
74351
|
+
import { useId as useId48, useState as useState91 } from "react";
|
|
74245
74352
|
import classNames132 from "classnames";
|
|
74246
74353
|
import { jsx as jsx332, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
74247
74354
|
var toDraft = (c) => ({
|
|
@@ -74265,9 +74372,9 @@ function fromDraft(column, d) {
|
|
|
74265
74372
|
var limitValid = (wip) => wip.trim() === "" || Number.isInteger(Number(wip)) && Number(wip) >= 1;
|
|
74266
74373
|
var TaskBoardColumnEditButton = ({ column }) => {
|
|
74267
74374
|
const { onEditColumn, allColumns, text: text2, surface, color: color2 } = useTaskBoard();
|
|
74268
|
-
const [open, setOpen] =
|
|
74269
|
-
const [draft, setDraft] =
|
|
74270
|
-
const id =
|
|
74375
|
+
const [open, setOpen] = useState91(false);
|
|
74376
|
+
const [draft, setDraft] = useState91(() => toDraft(column));
|
|
74377
|
+
const id = useId48();
|
|
74271
74378
|
if (!onEditColumn) return null;
|
|
74272
74379
|
const trigger = getSurfaceTriggerTokens(color2);
|
|
74273
74380
|
const valid = draft.title.trim() !== "" && limitValid(draft.wip) && limitValid(draft.max);
|
|
@@ -74883,7 +74990,7 @@ var TaskBoardDragLayer = ({ drag, card }) => {
|
|
|
74883
74990
|
};
|
|
74884
74991
|
|
|
74885
74992
|
// src/components/TaskBoard/useTaskBoardDrag.ts
|
|
74886
|
-
import { useCallback as useCallback49, useEffect as useEffect78, useMemo as useMemo64, useRef as
|
|
74993
|
+
import { useCallback as useCallback49, useEffect as useEffect78, useMemo as useMemo64, useRef as useRef78, useState as useState92 } from "react";
|
|
74887
74994
|
var DRAG_THRESHOLD_PX = 4;
|
|
74888
74995
|
var TOUCH_GRAB_DELAY_MS = 250;
|
|
74889
74996
|
var TOUCH_SLOP_PX = 8;
|
|
@@ -74898,17 +75005,17 @@ function bucketOf(el) {
|
|
|
74898
75005
|
return column === null ? null : { column, lane: lane || null, el: bucket };
|
|
74899
75006
|
}
|
|
74900
75007
|
function useTaskBoardDrag(opts) {
|
|
74901
|
-
const [drag, setDrag] =
|
|
74902
|
-
const [pending, setPending] =
|
|
74903
|
-
const optsRef =
|
|
75008
|
+
const [drag, setDrag] = useState92(null);
|
|
75009
|
+
const [pending, setPending] = useState92(null);
|
|
75010
|
+
const optsRef = useRef78(opts);
|
|
74904
75011
|
optsRef.current = opts;
|
|
74905
|
-
const dragRef =
|
|
74906
|
-
const pressRef =
|
|
74907
|
-
const suppressClickRef =
|
|
74908
|
-
const pointerRef =
|
|
74909
|
-
const rafRef =
|
|
74910
|
-
const cleanupRef =
|
|
74911
|
-
const userSelectRef =
|
|
75012
|
+
const dragRef = useRef78(null);
|
|
75013
|
+
const pressRef = useRef78(null);
|
|
75014
|
+
const suppressClickRef = useRef78(false);
|
|
75015
|
+
const pointerRef = useRef78({ x: 0, y: 0 });
|
|
75016
|
+
const rafRef = useRef78(null);
|
|
75017
|
+
const cleanupRef = useRef78(null);
|
|
75018
|
+
const userSelectRef = useRef78(null);
|
|
74912
75019
|
const setDragState = useCallback49((next) => {
|
|
74913
75020
|
dragRef.current = next;
|
|
74914
75021
|
setDrag(next);
|
|
@@ -75182,16 +75289,16 @@ function useTaskBoardDrag(opts) {
|
|
|
75182
75289
|
}
|
|
75183
75290
|
|
|
75184
75291
|
// src/components/TaskBoard/useTaskBoardKeyboard.ts
|
|
75185
|
-
import { useCallback as useCallback50, useLayoutEffect as useLayoutEffect30, useMemo as useMemo65, useRef as
|
|
75292
|
+
import { useCallback as useCallback50, useLayoutEffect as useLayoutEffect30, useMemo as useMemo65, useRef as useRef79, useState as useState93 } from "react";
|
|
75186
75293
|
var isRtl = (el) => el?.closest("[dir]")?.getAttribute("dir") === "rtl";
|
|
75187
75294
|
function useTaskBoardKeyboard(o) {
|
|
75188
75295
|
const { rootRef, cards, viewCards, columns, lanes, text: text2, drag } = o;
|
|
75189
|
-
const [message, setMessage] =
|
|
75190
|
-
const [activeId, setActiveId] =
|
|
75191
|
-
const [ownSelection, setOwnSelection] =
|
|
75296
|
+
const [message, setMessage] = useState93("");
|
|
75297
|
+
const [activeId, setActiveId] = useState93(null);
|
|
75298
|
+
const [ownSelection, setOwnSelection] = useState93([]);
|
|
75192
75299
|
const selection = o.selectedIds ?? ownSelection;
|
|
75193
|
-
const anchorRef =
|
|
75194
|
-
const refocusRef =
|
|
75300
|
+
const anchorRef = useRef79(null);
|
|
75301
|
+
const refocusRef = useRef79(null);
|
|
75195
75302
|
const viewBuckets = useMemo65(() => bucketCards(viewCards, columns, lanes), [viewCards, columns, lanes]);
|
|
75196
75303
|
const firstId = useMemo65(() => {
|
|
75197
75304
|
for (const cards2 of viewBuckets.values()) if (cards2.length) return cards2[0].id;
|
|
@@ -75369,17 +75476,17 @@ function useTaskBoardKeyboard(o) {
|
|
|
75369
75476
|
}
|
|
75370
75477
|
|
|
75371
75478
|
// src/components/TaskBoard/useTaskBoardColumnDrag.ts
|
|
75372
|
-
import { useCallback as useCallback51, useEffect as useEffect79, useLayoutEffect as useLayoutEffect31, useMemo as useMemo66, useRef as
|
|
75479
|
+
import { useCallback as useCallback51, useEffect as useEffect79, useLayoutEffect as useLayoutEffect31, useMemo as useMemo66, useRef as useRef80, useState as useState94 } from "react";
|
|
75373
75480
|
var DRAG_THRESHOLD_PX2 = 4;
|
|
75374
75481
|
var isRtl2 = (el) => el?.closest("[dir]")?.getAttribute("dir") === "rtl";
|
|
75375
75482
|
function useTaskBoardColumnDrag(opts) {
|
|
75376
|
-
const [drag, setDrag] =
|
|
75377
|
-
const optsRef =
|
|
75483
|
+
const [drag, setDrag] = useState94(null);
|
|
75484
|
+
const optsRef = useRef80(opts);
|
|
75378
75485
|
optsRef.current = opts;
|
|
75379
|
-
const dragRef =
|
|
75380
|
-
const cleanupRef =
|
|
75381
|
-
const userSelectRef =
|
|
75382
|
-
const refocusRef =
|
|
75486
|
+
const dragRef = useRef80(null);
|
|
75487
|
+
const cleanupRef = useRef80(null);
|
|
75488
|
+
const userSelectRef = useRef80(null);
|
|
75489
|
+
const refocusRef = useRef80(null);
|
|
75383
75490
|
const set = useCallback51((next) => {
|
|
75384
75491
|
dragRef.current = next;
|
|
75385
75492
|
setDrag(next);
|
|
@@ -75518,10 +75625,10 @@ function useTaskBoardColumnDrag(opts) {
|
|
|
75518
75625
|
}
|
|
75519
75626
|
|
|
75520
75627
|
// src/components/TaskBoard/useFlip.ts
|
|
75521
|
-
import { useLayoutEffect as useLayoutEffect32, useRef as
|
|
75628
|
+
import { useLayoutEffect as useLayoutEffect32, useRef as useRef81 } from "react";
|
|
75522
75629
|
function useFlip(rootRef, orderKey) {
|
|
75523
|
-
const positions =
|
|
75524
|
-
const lastKey =
|
|
75630
|
+
const positions = useRef81(/* @__PURE__ */ new Map());
|
|
75631
|
+
const lastKey = useRef81(orderKey);
|
|
75525
75632
|
useLayoutEffect32(() => {
|
|
75526
75633
|
const root = rootRef.current;
|
|
75527
75634
|
if (!root) return;
|
|
@@ -75550,15 +75657,15 @@ function useFlip(rootRef, orderKey) {
|
|
|
75550
75657
|
}
|
|
75551
75658
|
|
|
75552
75659
|
// src/components/TaskBoard/useTaskBoardCollab.ts
|
|
75553
|
-
import { useCallback as useCallback52, useEffect as useEffect80, useMemo as useMemo67, useRef as
|
|
75660
|
+
import { useCallback as useCallback52, useEffect as useEffect80, useMemo as useMemo67, useRef as useRef82, useState as useState95 } from "react";
|
|
75554
75661
|
var EXPIRE_TICK_MS = 1e3;
|
|
75555
75662
|
function useTaskBoardCollab(transport, currentUser) {
|
|
75556
|
-
const [presence, setPresence] =
|
|
75663
|
+
const [presence, setPresence] = useState95(emptyPresence);
|
|
75557
75664
|
const active = Boolean(transport && currentUser);
|
|
75558
|
-
const mountedRef =
|
|
75559
|
-
const userRef =
|
|
75665
|
+
const mountedRef = useRef82(false);
|
|
75666
|
+
const userRef = useRef82(currentUser);
|
|
75560
75667
|
userRef.current = currentUser;
|
|
75561
|
-
const hoverRef =
|
|
75668
|
+
const hoverRef = useRef82({ last: 0, timer: null });
|
|
75562
75669
|
const apply = useCallback52((event) => {
|
|
75563
75670
|
if (!mountedRef.current) return;
|
|
75564
75671
|
const now2 = Date.now();
|
|
@@ -75670,14 +75777,14 @@ function safePublish(transport, event) {
|
|
|
75670
75777
|
}
|
|
75671
75778
|
|
|
75672
75779
|
// src/components/TaskBoard/TaskBoardRemoteGhosts.tsx
|
|
75673
|
-
import { useLayoutEffect as useLayoutEffect33, useState as
|
|
75780
|
+
import { useLayoutEffect as useLayoutEffect33, useState as useState96 } from "react";
|
|
75674
75781
|
import { createPortal as createPortal19 } from "react-dom";
|
|
75675
75782
|
import classNames137 from "classnames";
|
|
75676
75783
|
import { Fragment as Fragment54, jsx as jsx337, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
75677
75784
|
var GHOST_HEIGHT = 40;
|
|
75678
75785
|
var TaskBoardRemoteGhosts = ({ rootRef, holds, selfId, cards, userById }) => {
|
|
75679
|
-
const [ghosts, setGhosts] =
|
|
75680
|
-
const [tick, setTick] =
|
|
75786
|
+
const [ghosts, setGhosts] = useState96([]);
|
|
75787
|
+
const [tick, setTick] = useState96(0);
|
|
75681
75788
|
useLayoutEffect33(() => {
|
|
75682
75789
|
const root = rootRef.current;
|
|
75683
75790
|
if (!root) return;
|
|
@@ -75882,7 +75989,7 @@ var TaskBoardBody = (props) => {
|
|
|
75882
75989
|
const resolvedColumnWidth = normalizedColumnWidth === "auto" || normalizedColumnWidth === "" || typeof normalizedColumnWidth === "number" && (!Number.isFinite(normalizedColumnWidth) || normalizedColumnWidth <= 0) ? sizeTokens12.columnWidth : normalizedColumnWidth;
|
|
75883
75990
|
const wellSurface = surface.translucent ? GLASS_WELL : SOLID_WELL;
|
|
75884
75991
|
const columnCornerClass = getSurfaceCornerClass(columnCorner);
|
|
75885
|
-
const rootRef =
|
|
75992
|
+
const rootRef = useRef83(null);
|
|
75886
75993
|
const isEditable = editable ?? Boolean(onCardsChange);
|
|
75887
75994
|
const laneView = layout === "lanes" && Boolean(lanes?.length);
|
|
75888
75995
|
const viewLanes = laneView ? lanes : void 0;
|
|
@@ -75903,7 +76010,7 @@ var TaskBoardBody = (props) => {
|
|
|
75903
76010
|
onDragTarget: (cardId, slot) => slot && collab.hover(cardId, slot),
|
|
75904
76011
|
onDragEnd: collab.release
|
|
75905
76012
|
});
|
|
75906
|
-
const [notice, setNotice] =
|
|
76013
|
+
const [notice, setNotice] = useState97(null);
|
|
75907
76014
|
useEffect81(() => {
|
|
75908
76015
|
if (!drag || !selfId) return;
|
|
75909
76016
|
const holder = collab.heldBy.get(drag.cardId);
|
|
@@ -76348,8 +76455,8 @@ import {
|
|
|
76348
76455
|
useEffect as useEffect82,
|
|
76349
76456
|
useImperativeHandle as useImperativeHandle5,
|
|
76350
76457
|
useMemo as useMemo70,
|
|
76351
|
-
useRef as
|
|
76352
|
-
useState as
|
|
76458
|
+
useRef as useRef84,
|
|
76459
|
+
useState as useState98
|
|
76353
76460
|
} from "react";
|
|
76354
76461
|
|
|
76355
76462
|
// src/components/Terminal/engine.ts
|
|
@@ -76410,10 +76517,10 @@ var TERMINAL_DARK_THEME = {
|
|
|
76410
76517
|
// src/components/Terminal/TerminalViewport.tsx
|
|
76411
76518
|
import { jsx as jsx341 } from "react/jsx-runtime";
|
|
76412
76519
|
var TerminalViewport = forwardRef169(function TerminalViewport2(props, ref) {
|
|
76413
|
-
const host =
|
|
76414
|
-
const engine =
|
|
76415
|
-
const fitAddon =
|
|
76416
|
-
const [scroll, setScroll] =
|
|
76520
|
+
const host = useRef84(null);
|
|
76521
|
+
const engine = useRef84(null);
|
|
76522
|
+
const fitAddon = useRef84(null);
|
|
76523
|
+
const [scroll, setScroll] = useState98({
|
|
76417
76524
|
contentSize: 0,
|
|
76418
76525
|
viewportSize: 0,
|
|
76419
76526
|
offset: 0
|
|
@@ -76426,10 +76533,10 @@ var TerminalViewport = forwardRef169(function TerminalViewport2(props, ref) {
|
|
|
76426
76533
|
() => ({ ...scroll, onScroll: scrollTo }),
|
|
76427
76534
|
[scroll, scrollTo]
|
|
76428
76535
|
);
|
|
76429
|
-
const latest =
|
|
76536
|
+
const latest = useRef84(props);
|
|
76430
76537
|
latest.current = props;
|
|
76431
|
-
const initialData =
|
|
76432
|
-
const pending =
|
|
76538
|
+
const initialData = useRef84(props.initialData);
|
|
76539
|
+
const pending = useRef84([]);
|
|
76433
76540
|
const handle = useMemo70(
|
|
76434
76541
|
() => ({
|
|
76435
76542
|
write(data) {
|
|
@@ -76478,7 +76585,7 @@ var TerminalViewport = forwardRef169(function TerminalViewport2(props, ref) {
|
|
|
76478
76585
|
}
|
|
76479
76586
|
};
|
|
76480
76587
|
};
|
|
76481
|
-
const updateOptions =
|
|
76588
|
+
const updateOptions = useRef84(applyOptions);
|
|
76482
76589
|
updateOptions.current = applyOptions;
|
|
76483
76590
|
useEffect82(() => {
|
|
76484
76591
|
let cancelled = false;
|
|
@@ -76672,10 +76779,10 @@ import classNames142 from "classnames";
|
|
|
76672
76779
|
import {
|
|
76673
76780
|
forwardRef as forwardRef171,
|
|
76674
76781
|
useEffect as useEffect83,
|
|
76675
|
-
useId as
|
|
76782
|
+
useId as useId49,
|
|
76676
76783
|
useImperativeHandle as useImperativeHandle6,
|
|
76677
|
-
useRef as
|
|
76678
|
-
useState as
|
|
76784
|
+
useRef as useRef85,
|
|
76785
|
+
useState as useState99
|
|
76679
76786
|
} from "react";
|
|
76680
76787
|
import { jsx as jsx343, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
76681
76788
|
var TerminalTabs = forwardRef171(
|
|
@@ -76707,12 +76814,12 @@ var TerminalTabs = forwardRef171(
|
|
|
76707
76814
|
...surface
|
|
76708
76815
|
}, ref) {
|
|
76709
76816
|
const tone = getSurfaceAccentColor(surfaceTone);
|
|
76710
|
-
const prefix =
|
|
76711
|
-
const [selected, setSelected] =
|
|
76817
|
+
const prefix = useId49();
|
|
76818
|
+
const [selected, setSelected] = useState99(defaultValue ?? sessions[0]?.id);
|
|
76712
76819
|
const requested = value ?? selected;
|
|
76713
76820
|
const active = sessions.find((session) => session.id === requested) ?? sessions[0];
|
|
76714
76821
|
const activeId = active?.id;
|
|
76715
|
-
const handles =
|
|
76822
|
+
const handles = useRef85(/* @__PURE__ */ new Map());
|
|
76716
76823
|
useImperativeHandle6(
|
|
76717
76824
|
ref,
|
|
76718
76825
|
() => ({ getSession: (id) => handles.current.get(id) }),
|
|
@@ -76858,17 +76965,17 @@ function hasZone(node) {
|
|
|
76858
76965
|
}
|
|
76859
76966
|
|
|
76860
76967
|
// src/components/Menu/Menu.tsx
|
|
76861
|
-
import React112, { cloneElement as cloneElement4, useCallback as useCallback56, useEffect as useEffect84, useId as
|
|
76968
|
+
import React112, { cloneElement as cloneElement4, useCallback as useCallback56, useEffect as useEffect84, useId as useId50, useLayoutEffect as useLayoutEffect35, useRef as useRef87, useState as useState101 } from "react";
|
|
76862
76969
|
import { Link as Link3 } from "react-router-dom";
|
|
76863
76970
|
import classNames144 from "classnames";
|
|
76864
76971
|
|
|
76865
76972
|
// src/components/Menu/MenuPopup.tsx
|
|
76866
|
-
import { useLayoutEffect as useLayoutEffect34, useRef as
|
|
76973
|
+
import { useLayoutEffect as useLayoutEffect34, useRef as useRef86, useState as useState100 } from "react";
|
|
76867
76974
|
import { createPortal as createPortal20 } from "react-dom";
|
|
76868
76975
|
import { jsx as jsx345 } from "react/jsx-runtime";
|
|
76869
76976
|
function MenuPopup({ anchor, placement, width, children }) {
|
|
76870
|
-
const ref =
|
|
76871
|
-
const [style, setStyle] =
|
|
76977
|
+
const ref = useRef86(null);
|
|
76978
|
+
const [style, setStyle] = useState100({ visibility: "hidden" });
|
|
76872
76979
|
useLayoutEffect34(() => {
|
|
76873
76980
|
const update = () => {
|
|
76874
76981
|
if (!anchor.current || !ref.current) return;
|
|
@@ -76913,9 +77020,9 @@ var menuPadding = {
|
|
|
76913
77020
|
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" };
|
|
76914
77021
|
var text = (item) => item.textValue ?? (typeof item.label === "string" ? item.label : item.id);
|
|
76915
77022
|
function MenuList({ items, state, depth = 0, parentLabel, onBack, focusOnMount = false, grouped = false }) {
|
|
76916
|
-
const list =
|
|
76917
|
-
const buffer =
|
|
76918
|
-
const timer =
|
|
77023
|
+
const list = useRef87(null);
|
|
77024
|
+
const buffer = useRef87("");
|
|
77025
|
+
const timer = useRef87(void 0);
|
|
76919
77026
|
const actions = () => Array.from(list.current?.querySelectorAll("[data-menu-action]") ?? []).filter((el) => el.closest('[role="menu"]') === list.current && el.getAttribute("aria-disabled") !== "true");
|
|
76920
77027
|
useLayoutEffect35(() => {
|
|
76921
77028
|
if (grouped) return;
|
|
@@ -76990,13 +77097,13 @@ function MenuList({ items, state, depth = 0, parentLabel, onBack, focusOnMount =
|
|
|
76990
77097
|
);
|
|
76991
77098
|
}
|
|
76992
77099
|
function MenuRow({ item, state, depth }) {
|
|
76993
|
-
const anchor =
|
|
77100
|
+
const anchor = useRef87(null);
|
|
76994
77101
|
const { props } = state;
|
|
76995
77102
|
const tiered = (item.submenuMode ?? props.submenuMode) === "tiered";
|
|
76996
77103
|
const nested = Boolean(item.items?.some((child) => !child.hidden) || item.content != null);
|
|
76997
77104
|
const expanded = tiered ? state.path[depth] === item.id : state.expanded.includes(item.id);
|
|
76998
77105
|
const label = text(item);
|
|
76999
|
-
const id =
|
|
77106
|
+
const id = useId50();
|
|
77000
77107
|
const open = (keyboard) => {
|
|
77001
77108
|
if (item.disabled || !nested) return;
|
|
77002
77109
|
state.keyboard.current = keyboard;
|
|
@@ -77128,16 +77235,16 @@ function MenuSurface({ state, children, root = false }) {
|
|
|
77128
77235
|
) });
|
|
77129
77236
|
}
|
|
77130
77237
|
function Menu(props) {
|
|
77131
|
-
const owner =
|
|
77132
|
-
const triggerRef =
|
|
77238
|
+
const owner = useId50();
|
|
77239
|
+
const triggerRef = useRef87(null);
|
|
77133
77240
|
const anchor = props.anchorRef ?? triggerRef;
|
|
77134
77241
|
const popup = props.popup ?? Boolean(props.trigger || props.anchorRef);
|
|
77135
|
-
const [internalOpen, setInternalOpen] =
|
|
77242
|
+
const [internalOpen, setInternalOpen] = useState101(props.defaultOpen ?? false);
|
|
77136
77243
|
const open = props.open ?? internalOpen;
|
|
77137
|
-
const [expanded, setExpanded] =
|
|
77138
|
-
const [path, setPath] =
|
|
77139
|
-
const keyboard =
|
|
77140
|
-
const leave =
|
|
77244
|
+
const [expanded, setExpanded] = useState101(props.defaultExpandedKeys ?? []);
|
|
77245
|
+
const [path, setPath] = useState101([]);
|
|
77246
|
+
const keyboard = useRef87(false);
|
|
77247
|
+
const leave = useRef87(void 0);
|
|
77141
77248
|
const cancelLeave = useCallback56(() => clearTimeout(leave.current), []);
|
|
77142
77249
|
const requestOpen = useCallback56((value) => {
|
|
77143
77250
|
if (props.open === void 0) setInternalOpen(value);
|
|
@@ -77221,7 +77328,7 @@ function Menu(props) {
|
|
|
77221
77328
|
}
|
|
77222
77329
|
|
|
77223
77330
|
// src/components/FileUpload/FileUpload.tsx
|
|
77224
|
-
import { useId as
|
|
77331
|
+
import { useId as useId51, useRef as useRef88, useState as useState103 } from "react";
|
|
77225
77332
|
import classNames145 from "classnames";
|
|
77226
77333
|
|
|
77227
77334
|
// src/components/FileUpload/fileSelection.ts
|
|
@@ -77264,11 +77371,11 @@ var uploadSizeTokens = {
|
|
|
77264
77371
|
};
|
|
77265
77372
|
|
|
77266
77373
|
// src/components/FileUpload/ImagePreview.tsx
|
|
77267
|
-
import { useEffect as useEffect85, useState as
|
|
77374
|
+
import { useEffect as useEffect85, useState as useState102 } from "react";
|
|
77268
77375
|
import { jsx as jsx347 } from "react/jsx-runtime";
|
|
77269
77376
|
function ImagePreview({ file, src, alt, className }) {
|
|
77270
|
-
const [preview, setPreview] =
|
|
77271
|
-
const [failed, setFailed] =
|
|
77377
|
+
const [preview, setPreview] = useState102(null);
|
|
77378
|
+
const [failed, setFailed] = useState102(null);
|
|
77272
77379
|
useEffect85(() => {
|
|
77273
77380
|
if (!file) return;
|
|
77274
77381
|
let active = true;
|
|
@@ -77310,12 +77417,12 @@ var defaultLabels = {
|
|
|
77310
77417
|
};
|
|
77311
77418
|
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 }) {
|
|
77312
77419
|
const density = uploadSizeTokens[size];
|
|
77313
|
-
const [internal, setInternal] =
|
|
77314
|
-
const [rejections, setRejections] =
|
|
77315
|
-
const [dragging, setDragging] =
|
|
77316
|
-
const depth =
|
|
77317
|
-
const input =
|
|
77318
|
-
const id =
|
|
77420
|
+
const [internal, setInternal] = useState103(defaultValue);
|
|
77421
|
+
const [rejections, setRejections] = useState103([]);
|
|
77422
|
+
const [dragging, setDragging] = useState103(false);
|
|
77423
|
+
const depth = useRef88(0);
|
|
77424
|
+
const input = useRef88(null);
|
|
77425
|
+
const id = useId51();
|
|
77319
77426
|
const files = value ?? internal;
|
|
77320
77427
|
const locked = disabled || loading;
|
|
77321
77428
|
const labels = { ...defaultLabels, ...overrides };
|
|
@@ -77398,7 +77505,7 @@ function FileUpload({ embedded = false, compact: compact2 = false, value, defaul
|
|
|
77398
77505
|
}
|
|
77399
77506
|
|
|
77400
77507
|
// src/components/IdentityPicker/IdentityPicker.tsx
|
|
77401
|
-
import { useId as
|
|
77508
|
+
import { useId as useId52, useState as useState104 } from "react";
|
|
77402
77509
|
import classNames146 from "classnames";
|
|
77403
77510
|
|
|
77404
77511
|
// src/components/IdentityPicker/sizeTokens.ts
|
|
@@ -77593,10 +77700,10 @@ function IdentityPicker({
|
|
|
77593
77700
|
const spacing = compact2 ? compactIdentitySpacing[size] : density;
|
|
77594
77701
|
const monogramLayout = compact2 ? classNames146("flex flex-wrap items-end gap-2", spacing.panel.split(" ").filter((token) => !token.startsWith("space-y-"))) : spacing.panel;
|
|
77595
77702
|
const categoryLineHeight = size === "xs" || size === "sm" ? "1rem" : size === "md" ? "1.25rem" : "1.5rem";
|
|
77596
|
-
const tabsId =
|
|
77597
|
-
const [internal, setInternal] =
|
|
77598
|
-
const [query, setQuery] =
|
|
77599
|
-
const [category, setCategory] =
|
|
77703
|
+
const tabsId = useId52();
|
|
77704
|
+
const [internal, setInternal] = useState104(defaultValue);
|
|
77705
|
+
const [query, setQuery] = useState104("");
|
|
77706
|
+
const [category, setCategory] = useState104("recommended");
|
|
77600
77707
|
const selected = value === void 0 ? internal : value;
|
|
77601
77708
|
const labels = { ...defaults, ...overrides };
|
|
77602
77709
|
const locked = disabled || loading;
|
|
@@ -77730,7 +77837,7 @@ function IdentityPicker({
|
|
|
77730
77837
|
}
|
|
77731
77838
|
|
|
77732
77839
|
// src/components/DotStepper/DotStepper.tsx
|
|
77733
|
-
import React115, { forwardRef as forwardRef172, useState as
|
|
77840
|
+
import React115, { forwardRef as forwardRef172, useState as useState105 } from "react";
|
|
77734
77841
|
import classNames147 from "classnames";
|
|
77735
77842
|
|
|
77736
77843
|
// src/components/DotStepper/plan.ts
|
|
@@ -77768,7 +77875,7 @@ var DotTrigger = forwardRef172(function DotTrigger2({ tooltip, ...props }, ref)
|
|
|
77768
77875
|
return /* @__PURE__ */ jsx350(TooltipWrapper_default, { text: tooltip, children: /* @__PURE__ */ jsx350("button", { ...props, ref }) });
|
|
77769
77876
|
});
|
|
77770
77877
|
function ActivePopover({ trigger, content, options }) {
|
|
77771
|
-
const [open, setOpen] =
|
|
77878
|
+
const [open, setOpen] = useState105(false);
|
|
77772
77879
|
const { onOpenChange, ...rest } = options ?? {};
|
|
77773
77880
|
const anchor = React115.cloneElement(trigger, { tooltip: open ? void 0 : trigger.props.tooltip });
|
|
77774
77881
|
return /* @__PURE__ */ jsx350(Popover_default, { ...rest, trigger: anchor, visible: open, onOpenChange: (value) => {
|
|
@@ -77802,7 +77909,7 @@ function DotStepper({ steps, currentIndex, currentStepId, maxVisible = 5, size =
|
|
|
77802
77909
|
}
|
|
77803
77910
|
|
|
77804
77911
|
// src/components/knowledge/shared.tsx
|
|
77805
|
-
import { useState as
|
|
77912
|
+
import { useState as useState106 } from "react";
|
|
77806
77913
|
import { jsx as jsx351, jsxs as jsxs222 } from "react/jsx-runtime";
|
|
77807
77914
|
var MESSAGE_KEYS = {
|
|
77808
77915
|
"library": "kit.knowledge.library",
|
|
@@ -77861,7 +77968,7 @@ function useKnowledgeCopy(labels) {
|
|
|
77861
77968
|
return (key) => labels?.[key] ?? t(MESSAGE_KEYS[key]);
|
|
77862
77969
|
}
|
|
77863
77970
|
function useKnowledgeState(value, initial, onChange) {
|
|
77864
|
-
const [internal, setInternal] =
|
|
77971
|
+
const [internal, setInternal] = useState106(initial);
|
|
77865
77972
|
return [value === void 0 ? internal : value, (next) => {
|
|
77866
77973
|
if (value === void 0) setInternal(next);
|
|
77867
77974
|
onChange?.(next);
|
|
@@ -78159,7 +78266,7 @@ function MemoryDetail({
|
|
|
78159
78266
|
}
|
|
78160
78267
|
|
|
78161
78268
|
// src/components/knowledge/KnowledgeMap.tsx
|
|
78162
|
-
import { useCallback as useCallback57, useEffect as useEffect86, useId as
|
|
78269
|
+
import { useCallback as useCallback57, useEffect as useEffect86, useId as useId53, useMemo as useMemo72, useRef as useRef89, useState as useState107 } from "react";
|
|
78163
78270
|
import { jsx as jsx355, jsxs as jsxs226 } from "react/jsx-runtime";
|
|
78164
78271
|
var COLORS = ["#0891b2", "#d97706", "#059669", "#e11d48", "#6366f1", "#8b5cf6"];
|
|
78165
78272
|
var PAGE_SIZE = 24;
|
|
@@ -78184,13 +78291,13 @@ function KnowledgeMap({
|
|
|
78184
78291
|
disabled = false,
|
|
78185
78292
|
...surface
|
|
78186
78293
|
}) {
|
|
78187
|
-
const copy = useKnowledgeCopy(labels), helpId =
|
|
78294
|
+
const copy = useKnowledgeCopy(labels), helpId = useId53();
|
|
78188
78295
|
const scene = useMemo72(() => buildKnowledgeScene(memories, points), [memories, points]);
|
|
78189
78296
|
const [selection, select] = useKnowledgeState(selectedId, defaultSelectedId, onSelectionChange);
|
|
78190
|
-
const canvasRef =
|
|
78191
|
-
const drag =
|
|
78192
|
-
const [camera, setCamera] =
|
|
78193
|
-
const [query, setQuery] =
|
|
78297
|
+
const canvasRef = useRef89(null), hostRef = useRef89(null);
|
|
78298
|
+
const drag = useRef89(null);
|
|
78299
|
+
const [camera, setCamera] = useState107(INITIAL_CAMERA), [size, setSize] = useState107({ width: 640, height });
|
|
78300
|
+
const [query, setQuery] = useState107(""), [page, setPage] = useState107(0);
|
|
78194
78301
|
const highlighted = useMemo72(() => new Set(highlightedIds), [highlightedIds]);
|
|
78195
78302
|
const clusters = useMemo72(() => {
|
|
78196
78303
|
const groups = /* @__PURE__ */ new Map();
|
|
@@ -78468,7 +78575,7 @@ function KnowledgeMap({
|
|
|
78468
78575
|
}
|
|
78469
78576
|
|
|
78470
78577
|
// src/components/knowledge/KnowledgeExplorer.tsx
|
|
78471
|
-
import { useMemo as useMemo73, useState as
|
|
78578
|
+
import { useMemo as useMemo73, useState as useState108 } from "react";
|
|
78472
78579
|
import { Fragment as Fragment61, jsx as jsx356, jsxs as jsxs227 } from "react/jsx-runtime";
|
|
78473
78580
|
function KnowledgeExplorer({
|
|
78474
78581
|
memories,
|
|
@@ -78504,7 +78611,7 @@ function KnowledgeExplorer({
|
|
|
78504
78611
|
const [query, setQuery] = useKnowledgeState(queryProp, defaultQuery, onQueryChange);
|
|
78505
78612
|
const [filters, setFilters] = useKnowledgeState(filtersProp, defaultFilters, onFiltersChange);
|
|
78506
78613
|
const [traceId, selectTrace] = useKnowledgeState(traceIdProp, defaultSelectedTraceId, onTraceSelectionChange);
|
|
78507
|
-
const [mobileView, setMobileView] =
|
|
78614
|
+
const [mobileView, setMobileView] = useState108("library");
|
|
78508
78615
|
const records = useMemo73(() => new Map(memories.map((memory) => [memory.id, memory])), [memories]);
|
|
78509
78616
|
const selectedMemory = selection ? records.get(selection) ?? null : null;
|
|
78510
78617
|
const highlightedIds = useMemo73(() => [...new Set(traceLinks.filter((link) => link.traceNodeId === traceId && records.has(link.memoryId)).map((link) => link.memoryId))], [traceLinks, traceId, records]);
|
|
@@ -78596,7 +78703,7 @@ function ContentActions({
|
|
|
78596
78703
|
var ContentActions_default = ContentActions;
|
|
78597
78704
|
|
|
78598
78705
|
// src/components/CodeBlock.tsx
|
|
78599
|
-
import React116, { useEffect as useEffect87, useMemo as useMemo74, useRef as
|
|
78706
|
+
import React116, { useEffect as useEffect87, useMemo as useMemo74, useRef as useRef90, useState as useState109 } from "react";
|
|
78600
78707
|
import { refractor } from "refractor";
|
|
78601
78708
|
import tsx from "refractor/tsx";
|
|
78602
78709
|
import { jsx as jsx358, jsxs as jsxs229 } from "react/jsx-runtime";
|
|
@@ -78648,9 +78755,9 @@ function CodeBlock({
|
|
|
78648
78755
|
...rest
|
|
78649
78756
|
}) {
|
|
78650
78757
|
const t = useKitT();
|
|
78651
|
-
const [copyState, setCopyState] =
|
|
78652
|
-
const timer =
|
|
78653
|
-
const generation =
|
|
78758
|
+
const [copyState, setCopyState] = useState109("idle");
|
|
78759
|
+
const timer = useRef90(void 0);
|
|
78760
|
+
const generation = useRef90(0);
|
|
78654
78761
|
useEffect87(() => {
|
|
78655
78762
|
generation.current++;
|
|
78656
78763
|
setCopyState("idle");
|
|
@@ -78709,7 +78816,7 @@ function CodeBlock({
|
|
|
78709
78816
|
}
|
|
78710
78817
|
|
|
78711
78818
|
// src/components/FilterBar.tsx
|
|
78712
|
-
import { useEffect as useEffect88, useId as
|
|
78819
|
+
import { useEffect as useEffect88, useId as useId54, useLayoutEffect as useLayoutEffect36, useRef as useRef91, useState as useState110 } from "react";
|
|
78713
78820
|
import classNames149 from "classnames";
|
|
78714
78821
|
import { Fragment as Fragment62, jsx as jsx359, jsxs as jsxs230 } from "react/jsx-runtime";
|
|
78715
78822
|
function normalize(filters, value) {
|
|
@@ -78769,15 +78876,15 @@ function FilterBar({
|
|
|
78769
78876
|
transparency,
|
|
78770
78877
|
liquidExtras: classNames149(getGlassVibrancyClass(vibrancy), getSurfaceGlassFillClass(tone, glassOpacity))
|
|
78771
78878
|
});
|
|
78772
|
-
const [internal, setInternal] =
|
|
78879
|
+
const [internal, setInternal] = useState110(defaultValue);
|
|
78773
78880
|
const applied = normalize(filters, value ?? internal);
|
|
78774
|
-
const [open, setOpen] =
|
|
78775
|
-
const [category, setCategory] =
|
|
78776
|
-
const [draft, setDraft] =
|
|
78777
|
-
const anchor =
|
|
78778
|
-
const searchRegion =
|
|
78779
|
-
const searchId =
|
|
78780
|
-
const [expanded, setExpanded] =
|
|
78881
|
+
const [open, setOpen] = useState110(false);
|
|
78882
|
+
const [category, setCategory] = useState110(null);
|
|
78883
|
+
const [draft, setDraft] = useState110([]);
|
|
78884
|
+
const anchor = useRef91(null);
|
|
78885
|
+
const searchRegion = useRef91(null);
|
|
78886
|
+
const searchId = useId54();
|
|
78887
|
+
const [expanded, setExpanded] = useState110(Boolean(searchProps.initialValue));
|
|
78781
78888
|
const searchDisabled = disabled || searchProps.disabled;
|
|
78782
78889
|
const active = filters.find((filter) => filter.id === category);
|
|
78783
78890
|
const motion = CONTROL_SPRING_TOKENS[spring];
|
|
@@ -78798,7 +78905,7 @@ function FilterBar({
|
|
|
78798
78905
|
setCategory(filter.id);
|
|
78799
78906
|
setOpen(true);
|
|
78800
78907
|
};
|
|
78801
|
-
const previouslyExpanded =
|
|
78908
|
+
const previouslyExpanded = useRef91(expanded);
|
|
78802
78909
|
useLayoutEffect36(() => {
|
|
78803
78910
|
if (showSearch && expanded && !previouslyExpanded.current && !searchDisabled) searchRegion.current?.querySelector("input")?.focus();
|
|
78804
78911
|
previouslyExpanded.current = expanded;
|
|
@@ -78982,9 +79089,9 @@ function FilterBar({
|
|
|
78982
79089
|
);
|
|
78983
79090
|
}
|
|
78984
79091
|
function FilterChips({ chips, color: color2, variant, size, buttonTone, buttonStyle, removeLabel }) {
|
|
78985
|
-
const [visible, setVisible] =
|
|
78986
|
-
const region =
|
|
78987
|
-
const positions =
|
|
79092
|
+
const [visible, setVisible] = useState110(chips);
|
|
79093
|
+
const region = useRef91(null);
|
|
79094
|
+
const positions = useRef91(/* @__PURE__ */ new Map());
|
|
78988
79095
|
const signature = chips.map((chip) => chip.id).join("\0");
|
|
78989
79096
|
useEffect88(() => {
|
|
78990
79097
|
const timer = setTimeout(() => setVisible((current) => current.filter((chip) => signature.split("\0").includes(chip.id))), 900);
|
|
@@ -79022,8 +79129,8 @@ import {
|
|
|
79022
79129
|
useContext as useContext10,
|
|
79023
79130
|
useEffect as useEffect89,
|
|
79024
79131
|
useMemo as useMemo75,
|
|
79025
|
-
useRef as
|
|
79026
|
-
useState as
|
|
79132
|
+
useRef as useRef92,
|
|
79133
|
+
useState as useState111
|
|
79027
79134
|
} from "react";
|
|
79028
79135
|
import { createPortal as createPortal21 } from "react-dom";
|
|
79029
79136
|
import classNames150 from "classnames";
|
|
@@ -79039,9 +79146,9 @@ var renderSlot = (slot, controls) => {
|
|
|
79039
79146
|
var BottomSheetProvider = ({
|
|
79040
79147
|
children
|
|
79041
79148
|
}) => {
|
|
79042
|
-
const [sheet, setSheet] =
|
|
79043
|
-
const [isVisible, setIsVisible] =
|
|
79044
|
-
const pendingCloseRef =
|
|
79149
|
+
const [sheet, setSheet] = useState111(null);
|
|
79150
|
+
const [isVisible, setIsVisible] = useState111(false);
|
|
79151
|
+
const pendingCloseRef = useRef92(null);
|
|
79045
79152
|
const dismissSheet = useCallback58(() => {
|
|
79046
79153
|
setIsVisible(false);
|
|
79047
79154
|
}, []);
|
|
@@ -79815,7 +79922,7 @@ var MetricBar = ({
|
|
|
79815
79922
|
MetricBar.displayName = "MetricBar";
|
|
79816
79923
|
|
|
79817
79924
|
// src/components/NetworkGraph/NetworkGraph.tsx
|
|
79818
|
-
import { useEffect as useEffect91, useId as
|
|
79925
|
+
import { useEffect as useEffect91, useId as useId55, useMemo as useMemo76, useRef as useRef94, useState as useState113 } from "react";
|
|
79819
79926
|
|
|
79820
79927
|
// src/components/NetworkGraph/model.ts
|
|
79821
79928
|
var CELL = 64;
|
|
@@ -79959,16 +80066,16 @@ function findNetworkPath(edges, source, target) {
|
|
|
79959
80066
|
}
|
|
79960
80067
|
|
|
79961
80068
|
// src/components/NetworkGraph/useNetworkCanvas.ts
|
|
79962
|
-
import { useCallback as useCallback59, useEffect as useEffect90, useRef as
|
|
80069
|
+
import { useCallback as useCallback59, useEffect as useEffect90, useRef as useRef93, useState as useState112 } from "react";
|
|
79963
80070
|
function useNetworkCanvas(options) {
|
|
79964
|
-
const canvasRef =
|
|
79965
|
-
const view =
|
|
79966
|
-
const size =
|
|
79967
|
-
const latest =
|
|
79968
|
-
const frame =
|
|
79969
|
-
const [zoom, setZoom] =
|
|
79970
|
-
const colors3 =
|
|
79971
|
-
const textColor =
|
|
80071
|
+
const canvasRef = useRef93(null);
|
|
80072
|
+
const view = useRef93({ x: 0, y: 0, zoom: 1 });
|
|
80073
|
+
const size = useRef93({ width: 1, height: 1 });
|
|
80074
|
+
const latest = useRef93(options);
|
|
80075
|
+
const frame = useRef93(null);
|
|
80076
|
+
const [zoom, setZoom] = useState112(1);
|
|
80077
|
+
const colors3 = useRef93(/* @__PURE__ */ new Map());
|
|
80078
|
+
const textColor = useRef93("#737373");
|
|
79972
80079
|
const draw = useCallback59(() => {
|
|
79973
80080
|
const canvas = canvasRef.current;
|
|
79974
80081
|
const ctx = canvas?.getContext("2d");
|
|
@@ -80201,9 +80308,9 @@ function NetworkGraph({
|
|
|
80201
80308
|
}) {
|
|
80202
80309
|
const tone = getSurfaceAccentColor(surfaceTone);
|
|
80203
80310
|
const t = useKitT();
|
|
80204
|
-
const helpId =
|
|
80205
|
-
const layoutRef =
|
|
80206
|
-
const [hasLegendSpace, setHasLegendSpace] =
|
|
80311
|
+
const helpId = useId55();
|
|
80312
|
+
const layoutRef = useRef94(null);
|
|
80313
|
+
const [hasLegendSpace, setHasLegendSpace] = useState113(true);
|
|
80207
80314
|
const legendOnRight = legendPosition === "right" || legendPosition === "auto" && hasLegendSpace;
|
|
80208
80315
|
useEffect91(() => {
|
|
80209
80316
|
const element = layoutRef.current;
|
|
@@ -80218,12 +80325,12 @@ function NetworkGraph({
|
|
|
80218
80325
|
() => buildNetwork(nodes, edges, communities),
|
|
80219
80326
|
[nodes, edges, communities]
|
|
80220
80327
|
);
|
|
80221
|
-
const [internalSelected, setInternalSelected] =
|
|
80328
|
+
const [internalSelected, setInternalSelected] = useState113(
|
|
80222
80329
|
defaultSelectedNodeId
|
|
80223
80330
|
);
|
|
80224
|
-
const [hidden, setHidden] =
|
|
80225
|
-
const [focused, setFocused] =
|
|
80226
|
-
const [query, setQuery] =
|
|
80331
|
+
const [hidden, setHidden] = useState113(() => /* @__PURE__ */ new Set());
|
|
80332
|
+
const [focused, setFocused] = useState113(null);
|
|
80333
|
+
const [query, setQuery] = useState113("");
|
|
80227
80334
|
const enabled = useMemo76(
|
|
80228
80335
|
() => new Set(
|
|
80229
80336
|
visibleCommunityIds ?? model.groups.filter((g) => !hidden.has(g.id)).map((g) => g.id)
|
|
@@ -80265,7 +80372,7 @@ function NetworkGraph({
|
|
|
80265
80372
|
onViewportChange
|
|
80266
80373
|
});
|
|
80267
80374
|
const locked = disabled || loading;
|
|
80268
|
-
const drag =
|
|
80375
|
+
const drag = useRef94(null);
|
|
80269
80376
|
const select = (id) => {
|
|
80270
80377
|
if (locked) return;
|
|
80271
80378
|
if (selectedNodeId === void 0) setInternalSelected(id);
|