@cjlapao/ui-kit 0.2.32 → 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/{CodeBlock-Dm0yAxf-.d.cts → CodeBlock-QDW3hqU0.d.cts} +1 -1
- package/dist/{CodeBlock-Dm0yAxf-.d.ts → CodeBlock-QDW3hqU0.d.ts} +1 -1
- package/dist/index.cjs +1020 -490
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +675 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +134 -7
- package/dist/index.d.ts +134 -7
- package/dist/index.js +804 -275
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs +102 -3
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.d.cts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.js +102 -3
- package/dist/markdown.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -154,6 +154,7 @@ __export(src_exports, {
|
|
|
154
154
|
FR_KIT_CATALOG: () => FR_KIT_CATALOG,
|
|
155
155
|
FUNNEL_MAX_STAGES: () => FUNNEL_MAX_STAGES,
|
|
156
156
|
FileUpload: () => FileUpload,
|
|
157
|
+
FilterBar: () => FilterBar,
|
|
157
158
|
FormField: () => FormField_default,
|
|
158
159
|
FormLayout: () => FormLayout_default,
|
|
159
160
|
FormSection: () => FormSection_default,
|
|
@@ -8749,6 +8750,13 @@ function getLocalizedParseNames(locale, catalog) {
|
|
|
8749
8750
|
// ../common/i18n/builtIn/de.ts
|
|
8750
8751
|
var DE_KIT_CATALOG = {
|
|
8751
8752
|
kit: {
|
|
8753
|
+
codeBlock: {
|
|
8754
|
+
code: "Code",
|
|
8755
|
+
edit: "Code bearbeiten",
|
|
8756
|
+
copy: "Code kopieren",
|
|
8757
|
+
copied: "Kopiert",
|
|
8758
|
+
copyFailed: "Kopieren fehlgeschlagen. Code ausw\xE4hlen und manuell kopieren."
|
|
8759
|
+
},
|
|
8752
8760
|
knowledge: {
|
|
8753
8761
|
"library": "Erinnerungsbibliothek",
|
|
8754
8762
|
"map": "Wissenskarte",
|
|
@@ -9021,6 +9029,20 @@ var DE_KIT_CATALOG = {
|
|
|
9021
9029
|
progressspinner: {
|
|
9022
9030
|
loading: "Wird geladen"
|
|
9023
9031
|
},
|
|
9032
|
+
filterbar: {
|
|
9033
|
+
filters: "Filter",
|
|
9034
|
+
search: "Suchen",
|
|
9035
|
+
empty: "Keine Filter angewendet",
|
|
9036
|
+
add: "Filter hinzuf\xFCgen",
|
|
9037
|
+
filterBy: "Filtern nach",
|
|
9038
|
+
back: "Zur\xFCck",
|
|
9039
|
+
clear: "Leeren",
|
|
9040
|
+
done: "Fertig",
|
|
9041
|
+
clearAll: "Alle l\xF6schen",
|
|
9042
|
+
items: "Eintr\xE4ge",
|
|
9043
|
+
summary: "{filtered} von {total} {items}",
|
|
9044
|
+
remove: "Filter {label} entfernen"
|
|
9045
|
+
},
|
|
9024
9046
|
searchbar: {
|
|
9025
9047
|
clearAria: "Suche l\xF6schen",
|
|
9026
9048
|
placeholder: "Suchen..."
|
|
@@ -9524,6 +9546,20 @@ var EN_KIT_CATALOG = {
|
|
|
9524
9546
|
progressspinner: {
|
|
9525
9547
|
loading: "Loading"
|
|
9526
9548
|
},
|
|
9549
|
+
filterbar: {
|
|
9550
|
+
filters: "Filters",
|
|
9551
|
+
search: "Search",
|
|
9552
|
+
empty: "No filters applied",
|
|
9553
|
+
add: "Add filter",
|
|
9554
|
+
filterBy: "Filter by",
|
|
9555
|
+
back: "Back",
|
|
9556
|
+
clear: "Clear",
|
|
9557
|
+
done: "Done",
|
|
9558
|
+
clearAll: "Clear all",
|
|
9559
|
+
items: "items",
|
|
9560
|
+
summary: "{filtered} of {total} {items}",
|
|
9561
|
+
remove: "Remove {label} filter"
|
|
9562
|
+
},
|
|
9527
9563
|
searchbar: {
|
|
9528
9564
|
clearAria: "Clear search",
|
|
9529
9565
|
placeholder: "Search..."
|
|
@@ -9748,6 +9784,13 @@ var EN_KIT_CATALOG = {
|
|
|
9748
9784
|
// ../common/i18n/builtIn/es.ts
|
|
9749
9785
|
var ES_KIT_CATALOG = {
|
|
9750
9786
|
kit: {
|
|
9787
|
+
codeBlock: {
|
|
9788
|
+
code: "C\xF3digo",
|
|
9789
|
+
edit: "Editar c\xF3digo",
|
|
9790
|
+
copy: "Copiar c\xF3digo",
|
|
9791
|
+
copied: "Copiado",
|
|
9792
|
+
copyFailed: "No se pudo copiar. Selecciona y copia el c\xF3digo manualmente."
|
|
9793
|
+
},
|
|
9751
9794
|
knowledge: {
|
|
9752
9795
|
"library": "Biblioteca de memorias",
|
|
9753
9796
|
"map": "Mapa de conocimiento",
|
|
@@ -10020,6 +10063,20 @@ var ES_KIT_CATALOG = {
|
|
|
10020
10063
|
progressspinner: {
|
|
10021
10064
|
loading: "Cargando"
|
|
10022
10065
|
},
|
|
10066
|
+
filterbar: {
|
|
10067
|
+
filters: "Filtros",
|
|
10068
|
+
search: "Buscar",
|
|
10069
|
+
empty: "Sin filtros aplicados",
|
|
10070
|
+
add: "A\xF1adir filtro",
|
|
10071
|
+
filterBy: "Filtrar por",
|
|
10072
|
+
back: "Volver",
|
|
10073
|
+
clear: "Limpiar",
|
|
10074
|
+
done: "Listo",
|
|
10075
|
+
clearAll: "Borrar todos",
|
|
10076
|
+
items: "elementos",
|
|
10077
|
+
summary: "{filtered} de {total} {items}",
|
|
10078
|
+
remove: "Eliminar filtro {label}"
|
|
10079
|
+
},
|
|
10023
10080
|
searchbar: {
|
|
10024
10081
|
clearAria: "Borrar b\xFAsqueda",
|
|
10025
10082
|
placeholder: "Buscar..."
|
|
@@ -10244,6 +10301,13 @@ var ES_KIT_CATALOG = {
|
|
|
10244
10301
|
// ../common/i18n/builtIn/fr.ts
|
|
10245
10302
|
var FR_KIT_CATALOG = {
|
|
10246
10303
|
kit: {
|
|
10304
|
+
codeBlock: {
|
|
10305
|
+
code: "Code",
|
|
10306
|
+
edit: "Modifier le code",
|
|
10307
|
+
copy: "Copier le code",
|
|
10308
|
+
copied: "Copi\xE9",
|
|
10309
|
+
copyFailed: "Copie impossible. S\xE9lectionnez et copiez le code manuellement."
|
|
10310
|
+
},
|
|
10247
10311
|
knowledge: {
|
|
10248
10312
|
"library": "Biblioth\xE8que de m\xE9moires",
|
|
10249
10313
|
"map": "Carte des connaissances",
|
|
@@ -10516,6 +10580,20 @@ var FR_KIT_CATALOG = {
|
|
|
10516
10580
|
progressspinner: {
|
|
10517
10581
|
loading: "Chargement"
|
|
10518
10582
|
},
|
|
10583
|
+
filterbar: {
|
|
10584
|
+
filters: "Filtres",
|
|
10585
|
+
search: "Rechercher",
|
|
10586
|
+
empty: "Aucun filtre appliqu\xE9",
|
|
10587
|
+
add: "Ajouter un filtre",
|
|
10588
|
+
filterBy: "Filtrer par",
|
|
10589
|
+
back: "Retour",
|
|
10590
|
+
clear: "Effacer",
|
|
10591
|
+
done: "Termin\xE9",
|
|
10592
|
+
clearAll: "Tout effacer",
|
|
10593
|
+
items: "\xE9l\xE9ments",
|
|
10594
|
+
summary: "{filtered} sur {total} {items}",
|
|
10595
|
+
remove: "Supprimer le filtre {label}"
|
|
10596
|
+
},
|
|
10519
10597
|
searchbar: {
|
|
10520
10598
|
clearAria: "Effacer la recherche",
|
|
10521
10599
|
placeholder: "Rechercher..."
|
|
@@ -10740,6 +10818,13 @@ var FR_KIT_CATALOG = {
|
|
|
10740
10818
|
// ../common/i18n/builtIn/pt.ts
|
|
10741
10819
|
var PT_KIT_CATALOG = {
|
|
10742
10820
|
kit: {
|
|
10821
|
+
codeBlock: {
|
|
10822
|
+
code: "C\xF3digo",
|
|
10823
|
+
edit: "Editar c\xF3digo",
|
|
10824
|
+
copy: "Copiar c\xF3digo",
|
|
10825
|
+
copied: "Copiado",
|
|
10826
|
+
copyFailed: "N\xE3o foi poss\xEDvel copiar. Selecione e copie o c\xF3digo manualmente."
|
|
10827
|
+
},
|
|
10743
10828
|
knowledge: {
|
|
10744
10829
|
"library": "Biblioteca de mem\xF3rias",
|
|
10745
10830
|
"map": "Mapa de conhecimento",
|
|
@@ -11012,6 +11097,20 @@ var PT_KIT_CATALOG = {
|
|
|
11012
11097
|
progressspinner: {
|
|
11013
11098
|
loading: "Carregando"
|
|
11014
11099
|
},
|
|
11100
|
+
filterbar: {
|
|
11101
|
+
filters: "Filtros",
|
|
11102
|
+
search: "Pesquisar",
|
|
11103
|
+
empty: "Nenhum filtro aplicado",
|
|
11104
|
+
add: "Adicionar filtro",
|
|
11105
|
+
filterBy: "Filtrar por",
|
|
11106
|
+
back: "Voltar",
|
|
11107
|
+
clear: "Limpar",
|
|
11108
|
+
done: "Conclu\xEDdo",
|
|
11109
|
+
clearAll: "Limpar todos",
|
|
11110
|
+
items: "itens",
|
|
11111
|
+
summary: "{filtered} de {total} {items}",
|
|
11112
|
+
remove: "Remover filtro {label}"
|
|
11113
|
+
},
|
|
11015
11114
|
searchbar: {
|
|
11016
11115
|
clearAria: "Limpar busca",
|
|
11017
11116
|
placeholder: "Buscar..."
|
|
@@ -12353,7 +12452,7 @@ var Panel = import_react158.default.forwardRef(function Panel2({
|
|
|
12353
12452
|
if (specularHighlight === false) return "none";
|
|
12354
12453
|
return "classic";
|
|
12355
12454
|
})();
|
|
12356
|
-
const effectiveHoverColor = hoverColor ?? (
|
|
12455
|
+
const effectiveHoverColor = hoverColor ?? (resolvedTone !== "none" && resolvedTone !== "neutral" ? resolvedTone : void 0);
|
|
12357
12456
|
const hoverColorName = effectiveHoverColor ? effectiveHoverColor : void 0;
|
|
12358
12457
|
const borderPalette = borderColor ? getPanelToneStyles(borderColor) : void 0;
|
|
12359
12458
|
const effectiveBorderClass = borderPalette?.border;
|
|
@@ -15928,7 +16027,7 @@ var ExpandableButton = (0, import_react171.forwardRef)(
|
|
|
15928
16027
|
fadeDuration,
|
|
15929
16028
|
labelGap,
|
|
15930
16029
|
labelSlide,
|
|
15931
|
-
elevate =
|
|
16030
|
+
elevate = false,
|
|
15932
16031
|
iconMotion = "pop-tilt",
|
|
15933
16032
|
squish = true,
|
|
15934
16033
|
labelPlacement = "after",
|
|
@@ -18887,6 +18986,7 @@ var Combobox = import_react184.default.forwardRef(
|
|
|
18887
18986
|
leadingIcon,
|
|
18888
18987
|
visibleRows = 6,
|
|
18889
18988
|
panelVariant = "auto",
|
|
18989
|
+
panelTone = "auto",
|
|
18890
18990
|
panelCorner = "auto",
|
|
18891
18991
|
className,
|
|
18892
18992
|
listClassName,
|
|
@@ -19032,7 +19132,7 @@ var Combobox = import_react184.default.forwardRef(
|
|
|
19032
19132
|
Panel_default,
|
|
19033
19133
|
{
|
|
19034
19134
|
variant: resolvedPanelVariant,
|
|
19035
|
-
tone: PANEL_TONE_FOR_FIELD,
|
|
19135
|
+
tone: panelTone === "auto" ? PANEL_TONE_FOR_FIELD : panelTone,
|
|
19036
19136
|
corner: panelCorner,
|
|
19037
19137
|
padding: "none",
|
|
19038
19138
|
scrollable: false,
|
|
@@ -19261,6 +19361,7 @@ var Picker = ({
|
|
|
19261
19361
|
glowIntensity = DEFAULT_GLOW_INTENSITY,
|
|
19262
19362
|
validationStatus = "none",
|
|
19263
19363
|
panelVariant = "auto",
|
|
19364
|
+
panelTone = "auto",
|
|
19264
19365
|
panelCorner = "auto",
|
|
19265
19366
|
disabled = false,
|
|
19266
19367
|
multi = false,
|
|
@@ -19491,7 +19592,7 @@ var Picker = ({
|
|
|
19491
19592
|
Panel_default,
|
|
19492
19593
|
{
|
|
19493
19594
|
variant: resolvedPanelVariant,
|
|
19494
|
-
tone: PANEL_TONE_FOR_FIELD,
|
|
19595
|
+
tone: panelTone === "auto" ? PANEL_TONE_FOR_FIELD : panelTone,
|
|
19495
19596
|
corner: panelCorner,
|
|
19496
19597
|
padding: "none",
|
|
19497
19598
|
scrollable: false,
|
|
@@ -19593,14 +19694,19 @@ var Picker = ({
|
|
|
19593
19694
|
}
|
|
19594
19695
|
)
|
|
19595
19696
|
] }),
|
|
19596
|
-
multi &&
|
|
19697
|
+
multi && /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(
|
|
19597
19698
|
"button",
|
|
19598
19699
|
{
|
|
19599
19700
|
type: "button",
|
|
19701
|
+
disabled: effectiveSelectedIds.length === 0,
|
|
19600
19702
|
onMouseDown: (e) => e.preventDefault(),
|
|
19601
19703
|
onClick: handleClearMulti,
|
|
19602
19704
|
className: (0, import_classnames38.default)(
|
|
19603
|
-
|
|
19705
|
+
// Always rendered: mounting it on the first pick pushed the
|
|
19706
|
+
// list down and resized the popup (flicker). Hidden, not
|
|
19707
|
+
// removed, while nothing is selected.
|
|
19708
|
+
"flex w-full select-none items-center justify-between border-b border-black/5 px-4 py-1.5 text-xs dark:border-white/10",
|
|
19709
|
+
effectiveSelectedIds.length > 0 ? "cursor-pointer hover:bg-neutral-50 dark:hover:bg-neutral-800/60" : "invisible",
|
|
19604
19710
|
popupText.muted
|
|
19605
19711
|
),
|
|
19606
19712
|
children: [
|
|
@@ -20179,6 +20285,7 @@ var TagPicker = ({
|
|
|
20179
20285
|
glowIntensity = DEFAULT_GLOW_INTENSITY,
|
|
20180
20286
|
validationStatus = "none",
|
|
20181
20287
|
panelVariant = "auto",
|
|
20288
|
+
panelTone = "auto",
|
|
20182
20289
|
panelCorner = "auto",
|
|
20183
20290
|
tagLimit = 3,
|
|
20184
20291
|
highlightNew = true,
|
|
@@ -20362,7 +20469,7 @@ var TagPicker = ({
|
|
|
20362
20469
|
const idx = filtered.findIndex((item) => selectedSet.has(item.id));
|
|
20363
20470
|
setFocusedIndex(idx >= 0 ? idx : multi || filtered.length === 0 ? -1 : 0);
|
|
20364
20471
|
}, [open]);
|
|
20365
|
-
const
|
|
20472
|
+
const normalize2 = (0, import_react186.useCallback)(
|
|
20366
20473
|
(v) => normalizeValue ? normalizeValue(v) : v,
|
|
20367
20474
|
[normalizeValue]
|
|
20368
20475
|
);
|
|
@@ -20372,7 +20479,7 @@ var TagPicker = ({
|
|
|
20372
20479
|
filtered.findIndex((candidate) => candidate.id === item.id)
|
|
20373
20480
|
);
|
|
20374
20481
|
setCursorByKeyboard(fromKeyboard);
|
|
20375
|
-
const id =
|
|
20482
|
+
const id = normalize2(item.id);
|
|
20376
20483
|
if (!multi) {
|
|
20377
20484
|
onChange([id]);
|
|
20378
20485
|
setOpen(false);
|
|
@@ -20385,14 +20492,14 @@ var TagPicker = ({
|
|
|
20385
20492
|
onChange([...value, id]);
|
|
20386
20493
|
}
|
|
20387
20494
|
},
|
|
20388
|
-
[multi,
|
|
20495
|
+
[multi, normalize2, onChange, selectedSet, value, filtered]
|
|
20389
20496
|
);
|
|
20390
20497
|
const handleRemove = (0, import_react186.useCallback)(
|
|
20391
20498
|
(v) => onChange(value.filter((x) => x !== v)),
|
|
20392
20499
|
[onChange, value]
|
|
20393
20500
|
);
|
|
20394
20501
|
const handleCreate = (0, import_react186.useCallback)(() => {
|
|
20395
|
-
const label =
|
|
20502
|
+
const label = normalize2(query.trim());
|
|
20396
20503
|
if (!label) return;
|
|
20397
20504
|
if (onCreateItem) {
|
|
20398
20505
|
onCreateItem(label);
|
|
@@ -20403,7 +20510,7 @@ var TagPicker = ({
|
|
|
20403
20510
|
}
|
|
20404
20511
|
if (!multi) setOpen(false);
|
|
20405
20512
|
setQuery("");
|
|
20406
|
-
}, [query,
|
|
20513
|
+
}, [query, normalize2, onCreateItem, multi, onChange, value]);
|
|
20407
20514
|
const handleKeyDown = (e) => {
|
|
20408
20515
|
if (e.key === "ArrowDown") {
|
|
20409
20516
|
e.preventDefault();
|
|
@@ -20439,7 +20546,7 @@ var TagPicker = ({
|
|
|
20439
20546
|
Panel_default,
|
|
20440
20547
|
{
|
|
20441
20548
|
variant: resolvedPanelVariant,
|
|
20442
|
-
tone: PANEL_TONE_FOR_FIELD,
|
|
20549
|
+
tone: panelTone === "auto" ? PANEL_TONE_FOR_FIELD : panelTone,
|
|
20443
20550
|
corner: panelCorner,
|
|
20444
20551
|
padding: "none",
|
|
20445
20552
|
scrollable: false,
|
|
@@ -22140,8 +22247,8 @@ function StackCarousel({
|
|
|
22140
22247
|
setExpanded(true);
|
|
22141
22248
|
}, Math.max(0, Number.isFinite(hoverExpandDelay) ? hoverExpandDelay : 2e3));
|
|
22142
22249
|
};
|
|
22143
|
-
const
|
|
22144
|
-
const index =
|
|
22250
|
+
const normalize2 = (0, import_react190.useCallback)((value) => loop ? wrap(value, items.length) : Math.max(0, Math.min(items.length - 1, Math.trunc(value))), [loop, items.length]);
|
|
22251
|
+
const index = normalize2(Number.isFinite(activeIndex ?? internalIndex) ? activeIndex ?? internalIndex : 0);
|
|
22145
22252
|
const layers = Math.min(loop ? items.length : items.length - index, Math.max(1, Math.min(3, Math.trunc(visibleCount) || 1)));
|
|
22146
22253
|
const offset = Math.max(0, Number.isFinite(stackOffset) ? stackOffset : 12);
|
|
22147
22254
|
const rootRef = (0, import_react190.useRef)(null);
|
|
@@ -22159,14 +22266,14 @@ function StackCarousel({
|
|
|
22159
22266
|
}, [isExpanded]);
|
|
22160
22267
|
const navigate = (0, import_react190.useCallback)((next, focus = false) => {
|
|
22161
22268
|
if (items.length < 2) return;
|
|
22162
|
-
const normalized =
|
|
22269
|
+
const normalized = normalize2(next);
|
|
22163
22270
|
if (normalized === index) return;
|
|
22164
22271
|
if (focus || measureRef.current?.contains(document.activeElement)) {
|
|
22165
22272
|
rootRef.current?.focus({ preventScroll: true });
|
|
22166
22273
|
}
|
|
22167
22274
|
if (activeIndex === void 0) setInternalIndex(normalized);
|
|
22168
22275
|
onActiveIndexChange?.(normalized);
|
|
22169
|
-
}, [items.length, index, activeIndex, onActiveIndexChange,
|
|
22276
|
+
}, [items.length, index, activeIndex, onActiveIndexChange, normalize2]);
|
|
22170
22277
|
(0, import_react190.useLayoutEffect)(() => {
|
|
22171
22278
|
const old = previousIndex.current;
|
|
22172
22279
|
previousIndex.current = index;
|
|
@@ -22229,7 +22336,7 @@ function StackCarousel({
|
|
|
22229
22336
|
root.addEventListener("wheel", handleWheel, { passive: false });
|
|
22230
22337
|
return () => root.removeEventListener("wheel", handleWheel);
|
|
22231
22338
|
}, [wheel, isExpanded, items.length, index, navigate, canScrollInside]);
|
|
22232
|
-
const visible = isExpanded ? items.map((_, i) => i) : Array.from({ length: layers }, (_, rank) =>
|
|
22339
|
+
const visible = isExpanded ? items.map((_, i) => i) : Array.from({ length: layers }, (_, rank) => normalize2(index + rank));
|
|
22233
22340
|
const rendered = [...visible];
|
|
22234
22341
|
const transitionFrom = previousIndex.current !== index ? previousIndex.current : outgoing;
|
|
22235
22342
|
if (!isExpanded && transitionFrom !== null && transitionFrom < items.length && !rendered.includes(transitionFrom)) rendered.push(transitionFrom);
|
|
@@ -40752,7 +40859,7 @@ var HelpButton = ({
|
|
|
40752
40859
|
window.removeEventListener("resize", recompute);
|
|
40753
40860
|
};
|
|
40754
40861
|
}, [open, recompute]);
|
|
40755
|
-
const palette = getPanelToneStyles(
|
|
40862
|
+
const palette = getPanelToneStyles(tone);
|
|
40756
40863
|
const surfaceText = getSurfaceTextTokens(variant);
|
|
40757
40864
|
const isMarkdown = typeof content === "string";
|
|
40758
40865
|
return /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)("span", { className: (0, import_classnames69.default)("inline-flex items-center", className), children: [
|
|
@@ -42835,7 +42942,7 @@ var Popover = ({
|
|
|
42835
42942
|
"aria-hidden": "true",
|
|
42836
42943
|
className: (0, import_classnames73.default)(
|
|
42837
42944
|
"absolute block h-4 w-4 rotate-45",
|
|
42838
|
-
ARROW_SIDE_BORDERS[position.placement.side],
|
|
42945
|
+
variant !== "none" && ARROW_SIDE_BORDERS[position.placement.side],
|
|
42839
42946
|
chrome.border,
|
|
42840
42947
|
chrome.fill,
|
|
42841
42948
|
chrome.backdrop
|
|
@@ -42861,7 +42968,8 @@ var Popover = ({
|
|
|
42861
42968
|
"aria-hidden": "true",
|
|
42862
42969
|
"data-popover-bubble": true,
|
|
42863
42970
|
className: (0, import_classnames73.default)(
|
|
42864
|
-
"pointer-events-none absolute z-20 block rounded-full
|
|
42971
|
+
"pointer-events-none absolute z-20 block rounded-full",
|
|
42972
|
+
variant !== "none" && "border",
|
|
42865
42973
|
chrome.border,
|
|
42866
42974
|
chrome.fill,
|
|
42867
42975
|
chrome.backdrop
|
|
@@ -46298,6 +46406,7 @@ var SideMenuCtaCard = ({
|
|
|
46298
46406
|
);
|
|
46299
46407
|
};
|
|
46300
46408
|
var SideMenuDetailPanel = ({
|
|
46409
|
+
variant,
|
|
46301
46410
|
items,
|
|
46302
46411
|
tone,
|
|
46303
46412
|
menuTone,
|
|
@@ -46336,11 +46445,11 @@ var SideMenuDetailPanel = ({
|
|
|
46336
46445
|
},
|
|
46337
46446
|
item.slug
|
|
46338
46447
|
));
|
|
46339
|
-
if (glass) {
|
|
46448
|
+
if (glass || variant) {
|
|
46340
46449
|
return /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(
|
|
46341
46450
|
Panel_default,
|
|
46342
46451
|
{
|
|
46343
|
-
variant: "glass",
|
|
46452
|
+
variant: variant ?? "glass",
|
|
46344
46453
|
tone,
|
|
46345
46454
|
corner: "rounded-sm",
|
|
46346
46455
|
padding: "none",
|
|
@@ -46383,6 +46492,7 @@ var SideMenu = ({
|
|
|
46383
46492
|
ctas,
|
|
46384
46493
|
footerDetails,
|
|
46385
46494
|
footerDetailsTone,
|
|
46495
|
+
footerDetailsVariant,
|
|
46386
46496
|
noise = false,
|
|
46387
46497
|
noiseScale,
|
|
46388
46498
|
loading = false,
|
|
@@ -46959,6 +47069,7 @@ var SideMenu = ({
|
|
|
46959
47069
|
!contentCollapsed2 && footerDetails && footerDetails.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime266.jsx)("div", { className: "shrink-0 px-3 pb-1", children: /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(
|
|
46960
47070
|
SideMenuDetailPanel,
|
|
46961
47071
|
{
|
|
47072
|
+
variant: footerDetailsVariant,
|
|
46962
47073
|
items: footerDetails,
|
|
46963
47074
|
tone: footerDetailsTone ?? "none",
|
|
46964
47075
|
menuTone: color2,
|
|
@@ -51616,7 +51727,7 @@ function useResizable({
|
|
|
51616
51727
|
const getMaxWidth = (0, import_react261.useCallback)(() => {
|
|
51617
51728
|
return typeof maxWidthOpt === "function" ? maxWidthOpt() : maxWidthOpt;
|
|
51618
51729
|
}, [maxWidthOpt]);
|
|
51619
|
-
const
|
|
51730
|
+
const clamp5 = (0, import_react261.useCallback)(
|
|
51620
51731
|
(value) => Math.max(minWidth, Math.min(getMaxWidth(), value)),
|
|
51621
51732
|
[minWidth, getMaxWidth]
|
|
51622
51733
|
);
|
|
@@ -51624,7 +51735,7 @@ function useResizable({
|
|
|
51624
51735
|
if (!isDragging) return;
|
|
51625
51736
|
const handlePointerMove = (e) => {
|
|
51626
51737
|
const delta = e.clientX - startXRef.current;
|
|
51627
|
-
const newWidth =
|
|
51738
|
+
const newWidth = clamp5(startWidthRef.current + delta);
|
|
51628
51739
|
setWidth(newWidth);
|
|
51629
51740
|
onResize?.(newWidth);
|
|
51630
51741
|
};
|
|
@@ -51647,7 +51758,7 @@ function useResizable({
|
|
|
51647
51758
|
document.body.style.cursor = "";
|
|
51648
51759
|
document.body.style.userSelect = "";
|
|
51649
51760
|
};
|
|
51650
|
-
}, [isDragging,
|
|
51761
|
+
}, [isDragging, clamp5, onResize, onResizeEnd]);
|
|
51651
51762
|
const onPointerDown = (0, import_react261.useCallback)(
|
|
51652
51763
|
(e) => {
|
|
51653
51764
|
if (!enabled) return;
|
|
@@ -51664,9 +51775,9 @@ function useResizable({
|
|
|
51664
51775
|
const step = 20;
|
|
51665
51776
|
let newWidth = width;
|
|
51666
51777
|
if (e.key === "ArrowRight") {
|
|
51667
|
-
newWidth =
|
|
51778
|
+
newWidth = clamp5(width + step);
|
|
51668
51779
|
} else if (e.key === "ArrowLeft") {
|
|
51669
|
-
newWidth =
|
|
51780
|
+
newWidth = clamp5(width - step);
|
|
51670
51781
|
} else {
|
|
51671
51782
|
return;
|
|
51672
51783
|
}
|
|
@@ -51675,7 +51786,7 @@ function useResizable({
|
|
|
51675
51786
|
onResize?.(newWidth);
|
|
51676
51787
|
onResizeEnd?.(newWidth);
|
|
51677
51788
|
},
|
|
51678
|
-
[enabled, width,
|
|
51789
|
+
[enabled, width, clamp5, onResize, onResizeEnd]
|
|
51679
51790
|
);
|
|
51680
51791
|
const resolvedMax = getMaxWidth();
|
|
51681
51792
|
return {
|
|
@@ -52008,7 +52119,7 @@ var SplitView = ({
|
|
|
52008
52119
|
const border = headerProps.border ?? true;
|
|
52009
52120
|
const detailsVariant = headerDetails?.variant ?? headerDetails?.variants ?? "subtle";
|
|
52010
52121
|
const detailsDecoration = headerDetails?.decoration ?? headerDetails?.decorations ?? "none";
|
|
52011
|
-
const detailsTone = headerDetails?.tone ?? "
|
|
52122
|
+
const detailsTone = headerDetails?.tone ?? "none";
|
|
52012
52123
|
const hasCustomHeaderBody = headerDetails?.headerBody !== void 0 && headerDetails?.headerBody !== null;
|
|
52013
52124
|
const hasHeaderDetailsContent = Boolean(
|
|
52014
52125
|
hasCustomHeaderBody || headerDetails?.title || headerDetails?.subtitle || headerDetails?.description || headerDetails?.tags
|
|
@@ -52951,6 +53062,7 @@ var VariablePicker = ({
|
|
|
52951
53062
|
tone = "blue",
|
|
52952
53063
|
size = "md",
|
|
52953
53064
|
variant = "elevated",
|
|
53065
|
+
panelTone = "auto",
|
|
52954
53066
|
corner = "auto",
|
|
52955
53067
|
initialSearch = "",
|
|
52956
53068
|
title,
|
|
@@ -53026,7 +53138,7 @@ var VariablePicker = ({
|
|
|
53026
53138
|
Panel_default,
|
|
53027
53139
|
{
|
|
53028
53140
|
variant,
|
|
53029
|
-
tone: PANEL_TONE_FOR_FIELD,
|
|
53141
|
+
tone: panelTone === "auto" ? PANEL_TONE_FOR_FIELD : panelTone,
|
|
53030
53142
|
corner,
|
|
53031
53143
|
padding: "none",
|
|
53032
53144
|
scrollable: false,
|
|
@@ -53124,6 +53236,7 @@ var SmartInput = ({
|
|
|
53124
53236
|
gradientTo,
|
|
53125
53237
|
glowIntensity = DEFAULT_GLOW_INTENSITY,
|
|
53126
53238
|
panelVariant = "auto",
|
|
53239
|
+
panelTone = "auto",
|
|
53127
53240
|
panelCorner = "auto",
|
|
53128
53241
|
defaultViewMode = "token",
|
|
53129
53242
|
autocomplete = true,
|
|
@@ -53454,6 +53567,7 @@ var SmartInput = ({
|
|
|
53454
53567
|
tone,
|
|
53455
53568
|
size,
|
|
53456
53569
|
variant: resolvedPanelVariant,
|
|
53570
|
+
panelTone,
|
|
53457
53571
|
corner: panelCorner,
|
|
53458
53572
|
initialSearch: pickerFilter,
|
|
53459
53573
|
onSelect: handleSelect,
|
|
@@ -67960,15 +68074,79 @@ var TreeView = ({
|
|
|
67960
68074
|
var TreeView_default = TreeView;
|
|
67961
68075
|
|
|
67962
68076
|
// src/components/WorkflowTracker/WorkflowTracker.tsx
|
|
67963
|
-
var
|
|
68077
|
+
var import_react298 = require("react");
|
|
67964
68078
|
var import_classnames124 = __toESM(require("classnames"), 1);
|
|
67965
68079
|
|
|
67966
68080
|
// src/components/WorkflowTracker/WorkflowTrackerRail.tsx
|
|
67967
|
-
var
|
|
68081
|
+
var import_react294 = require("react");
|
|
67968
68082
|
var import_classnames117 = __toESM(require("classnames"), 1);
|
|
67969
68083
|
|
|
68084
|
+
// src/components/WorkflowTracker/useWorkflowFooterResize.ts
|
|
68085
|
+
var import_react291 = require("react");
|
|
68086
|
+
var clamp4 = (value) => Number.isFinite(value) ? Math.max(10, Math.min(80, value)) : 30;
|
|
68087
|
+
function useWorkflowFooterResize({ height, defaultHeight, onChange, enabled }) {
|
|
68088
|
+
const [internal, setInternal] = (0, import_react291.useState)(() => clamp4(defaultHeight));
|
|
68089
|
+
const percentage = clamp4(height ?? internal);
|
|
68090
|
+
const bodyRef = (0, import_react291.useRef)(null);
|
|
68091
|
+
const drag = (0, import_react291.useRef)(null);
|
|
68092
|
+
const [dragging, setDragging] = (0, import_react291.useState)(false);
|
|
68093
|
+
const footerId = (0, import_react291.useId)();
|
|
68094
|
+
const update = (next) => {
|
|
68095
|
+
const value = clamp4(next);
|
|
68096
|
+
if (height === void 0) setInternal(value);
|
|
68097
|
+
onChange?.(value);
|
|
68098
|
+
};
|
|
68099
|
+
const finish = () => {
|
|
68100
|
+
drag.current = null;
|
|
68101
|
+
setDragging(false);
|
|
68102
|
+
};
|
|
68103
|
+
return {
|
|
68104
|
+
percentage,
|
|
68105
|
+
bodyRef,
|
|
68106
|
+
footerId,
|
|
68107
|
+
dragging: enabled && dragging,
|
|
68108
|
+
handleProps: {
|
|
68109
|
+
role: "separator",
|
|
68110
|
+
tabIndex: 0,
|
|
68111
|
+
"aria-orientation": "horizontal",
|
|
68112
|
+
"aria-valuemin": 10,
|
|
68113
|
+
"aria-valuemax": 80,
|
|
68114
|
+
"aria-valuenow": Math.round(percentage),
|
|
68115
|
+
"aria-valuetext": `${Math.round(percentage)}%`,
|
|
68116
|
+
"aria-controls": footerId,
|
|
68117
|
+
onPointerDown: (event) => {
|
|
68118
|
+
if (!enabled || event.button !== 0 || event.isPrimary === false) return;
|
|
68119
|
+
const bounds = bodyRef.current?.getBoundingClientRect();
|
|
68120
|
+
const available = (bounds?.height ?? 0) - event.currentTarget.getBoundingClientRect().height;
|
|
68121
|
+
if (available <= 0) return;
|
|
68122
|
+
event.preventDefault();
|
|
68123
|
+
event.currentTarget.focus();
|
|
68124
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
68125
|
+
drag.current = { y: event.clientY, height: available, percentage, pointerId: event.pointerId };
|
|
68126
|
+
setDragging(true);
|
|
68127
|
+
},
|
|
68128
|
+
onPointerMove: (event) => {
|
|
68129
|
+
const start = drag.current;
|
|
68130
|
+
if (!enabled || !start || start.pointerId !== event.pointerId) return;
|
|
68131
|
+
update(start.percentage + (start.y - event.clientY) / start.height * 100);
|
|
68132
|
+
},
|
|
68133
|
+
onPointerUp: finish,
|
|
68134
|
+
onPointerCancel: finish,
|
|
68135
|
+
onLostPointerCapture: finish,
|
|
68136
|
+
onKeyDown: (event) => {
|
|
68137
|
+
if (!enabled) return;
|
|
68138
|
+
const step = event.shiftKey ? 10 : 5;
|
|
68139
|
+
const next = event.key === "ArrowUp" ? percentage + step : event.key === "ArrowDown" ? percentage - step : event.key === "Home" ? 10 : event.key === "End" ? 80 : void 0;
|
|
68140
|
+
if (next === void 0) return;
|
|
68141
|
+
event.preventDefault();
|
|
68142
|
+
update(next);
|
|
68143
|
+
}
|
|
68144
|
+
}
|
|
68145
|
+
};
|
|
68146
|
+
}
|
|
68147
|
+
|
|
67970
68148
|
// src/components/WorkflowTracker/WorkflowTimeline.tsx
|
|
67971
|
-
var
|
|
68149
|
+
var import_react292 = __toESM(require("react"), 1);
|
|
67972
68150
|
var import_classnames116 = __toESM(require("classnames"), 1);
|
|
67973
68151
|
|
|
67974
68152
|
// src/components/WorkflowTracker/WorkflowSkeleton.tsx
|
|
@@ -68497,6 +68675,12 @@ var NestedSubSteps = ({
|
|
|
68497
68675
|
var WorkflowTimeline = ({
|
|
68498
68676
|
disableFutureSteps = false,
|
|
68499
68677
|
controls,
|
|
68678
|
+
footerResizable = false,
|
|
68679
|
+
defaultFooterHeight = 30,
|
|
68680
|
+
footerHeight,
|
|
68681
|
+
onFooterHeightChange,
|
|
68682
|
+
footerLabel = "Workflow footer",
|
|
68683
|
+
footerResizeLabel = "Resize workflow footer",
|
|
68500
68684
|
hasCollapseToggle = false,
|
|
68501
68685
|
renderStepPopover,
|
|
68502
68686
|
stepPopoverProps,
|
|
@@ -68520,6 +68704,14 @@ var WorkflowTimeline = ({
|
|
|
68520
68704
|
onStepAction
|
|
68521
68705
|
}) => {
|
|
68522
68706
|
const isEmpty2 = steps.length === 0;
|
|
68707
|
+
const hasFooter = controls != null && controls !== false;
|
|
68708
|
+
const resizableFooter = footerResizable && fillHeight && hasFooter;
|
|
68709
|
+
const footer = useWorkflowFooterResize({
|
|
68710
|
+
height: footerHeight,
|
|
68711
|
+
defaultHeight: defaultFooterHeight,
|
|
68712
|
+
onChange: onFooterHeightChange,
|
|
68713
|
+
enabled: resizableFooter
|
|
68714
|
+
});
|
|
68523
68715
|
const tallyEntries = [
|
|
68524
68716
|
{ count: tallies.done, label: labels.done },
|
|
68525
68717
|
{ count: tallies.skipped, label: labels.skipped },
|
|
@@ -68585,7 +68777,7 @@ var WorkflowTimeline = ({
|
|
|
68585
68777
|
motion: "none"
|
|
68586
68778
|
}
|
|
68587
68779
|
),
|
|
68588
|
-
tallyEntries.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "mt-3 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs", children: tallyEntries.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(
|
|
68780
|
+
tallyEntries.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "mt-3 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs", children: tallyEntries.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(import_react292.default.Fragment, { children: [
|
|
68589
68781
|
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
68590
68782
|
"span",
|
|
68591
68783
|
{
|
|
@@ -68606,16 +68798,18 @@ var WorkflowTimeline = ({
|
|
|
68606
68798
|
]
|
|
68607
68799
|
}
|
|
68608
68800
|
),
|
|
68609
|
-
/* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(
|
|
68610
|
-
|
|
68611
|
-
|
|
68612
|
-
|
|
68613
|
-
|
|
68614
|
-
|
|
68615
|
-
|
|
68616
|
-
|
|
68617
|
-
|
|
68618
|
-
|
|
68801
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { ref: footer.bodyRef, className: (0, import_classnames116.default)("flex min-h-0 flex-col", fillHeight && "flex-1", footer.dragging && "select-none"), children: [
|
|
68802
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
68803
|
+
ScrollArea_default,
|
|
68804
|
+
{
|
|
68805
|
+
variant: "hover",
|
|
68806
|
+
className: fillHeight ? "min-h-0 flex-1" : void 0,
|
|
68807
|
+
style: fillHeight ? { flex: `${hasFooter ? 100 - footer.percentage : 100} 1 0%` } : void 0,
|
|
68808
|
+
viewportClassName: "overscroll-contain",
|
|
68809
|
+
contentClassName: (0, import_classnames116.default)(
|
|
68810
|
+
!loading && !isEmpty2 && (collapsed ? "px-2 py-4" : "px-5 py-5")
|
|
68811
|
+
),
|
|
68812
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(WorkflowRailSkeleton, { rows: loadingRows, collapsed }) : isEmpty2 ? collapsed ? /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("span", { className: "sr-only", children: labels.empty }) : emptyState ?? /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
68619
68813
|
WorkflowPlaceholder,
|
|
68620
68814
|
{
|
|
68621
68815
|
title: labels.empty,
|
|
@@ -68810,21 +69004,36 @@ var WorkflowTimeline = ({
|
|
|
68810
69004
|
},
|
|
68811
69005
|
step.id
|
|
68812
69006
|
);
|
|
68813
|
-
}) })
|
|
68814
|
-
|
|
68815
|
-
|
|
68816
|
-
|
|
68817
|
-
|
|
68818
|
-
|
|
68819
|
-
|
|
68820
|
-
|
|
68821
|
-
|
|
68822
|
-
|
|
68823
|
-
}
|
|
68824
|
-
|
|
68825
|
-
|
|
68826
|
-
|
|
68827
|
-
|
|
69007
|
+
}) })
|
|
69008
|
+
}
|
|
69009
|
+
),
|
|
69010
|
+
resizableFooter && /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(
|
|
69011
|
+
"div",
|
|
69012
|
+
{
|
|
69013
|
+
...footer.handleProps,
|
|
69014
|
+
"aria-label": footerResizeLabel,
|
|
69015
|
+
className: (0, import_classnames116.default)("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),
|
|
69016
|
+
children: [
|
|
69017
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("span", { "aria-hidden": "true", className: (0, import_classnames116.default)("pointer-events-none absolute inset-x-0 top-1/2 border-t", surfaces.border) }),
|
|
69018
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("span", { "aria-hidden": "true", className: (0, import_classnames116.default)("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") })
|
|
69019
|
+
]
|
|
69020
|
+
}
|
|
69021
|
+
),
|
|
69022
|
+
hasFooter && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
69023
|
+
ScrollArea_default,
|
|
69024
|
+
{
|
|
69025
|
+
id: footer.footerId,
|
|
69026
|
+
role: "region",
|
|
69027
|
+
"aria-label": footerLabel,
|
|
69028
|
+
variant: "hover",
|
|
69029
|
+
className: (0, import_classnames116.default)(!resizableFooter && "border-t", surfaces.border, fillHeight && "min-h-0"),
|
|
69030
|
+
style: fillHeight ? { flex: `${footer.percentage} 1 0%` } : void 0,
|
|
69031
|
+
viewportClassName: "overscroll-contain",
|
|
69032
|
+
contentClassName: collapsed ? "px-2 py-4" : "px-5 py-4",
|
|
69033
|
+
children: controls
|
|
69034
|
+
}
|
|
69035
|
+
)
|
|
69036
|
+
] }),
|
|
68828
69037
|
showLegend && !isEmpty2 && !collapsed && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
68829
69038
|
"div",
|
|
68830
69039
|
{
|
|
@@ -68853,7 +69062,7 @@ var WorkflowTimeline = ({
|
|
|
68853
69062
|
var WorkflowTimeline_default = WorkflowTimeline;
|
|
68854
69063
|
|
|
68855
69064
|
// src/components/WorkflowTracker/chrome.ts
|
|
68856
|
-
var
|
|
69065
|
+
var import_react293 = require("react");
|
|
68857
69066
|
var DEFAULT_LABELS = {
|
|
68858
69067
|
progress: "Progress",
|
|
68859
69068
|
done: "done",
|
|
@@ -68899,7 +69108,7 @@ var useWorkflowChrome = ({
|
|
|
68899
69108
|
translucentSurfaces
|
|
68900
69109
|
}) => {
|
|
68901
69110
|
const translucent = translucentSurfaces ?? isTranslucentVariant(variant);
|
|
68902
|
-
const palette = (0,
|
|
69111
|
+
const palette = (0, import_react293.useMemo)(
|
|
68903
69112
|
() => ({
|
|
68904
69113
|
accent: accentColor,
|
|
68905
69114
|
attention: attentionColor,
|
|
@@ -68910,7 +69119,7 @@ var useWorkflowChrome = ({
|
|
|
68910
69119
|
}),
|
|
68911
69120
|
[accentColor, attentionColor, blockedColor, failedColor, mutedColor, translucent]
|
|
68912
69121
|
);
|
|
68913
|
-
const surfaces = (0,
|
|
69122
|
+
const surfaces = (0, import_react293.useMemo)(() => getSurfaceTokens(translucent), [translucent]);
|
|
68914
69123
|
return { translucent, palette, surfaces, customStatuses };
|
|
68915
69124
|
};
|
|
68916
69125
|
var resolveLabels = (labelOverrides) => labelOverrides ? {
|
|
@@ -69217,6 +69426,12 @@ var WorkflowTrackerRail = ({
|
|
|
69217
69426
|
collapseLabel = "Collapse workflow rail",
|
|
69218
69427
|
renderStepPopover,
|
|
69219
69428
|
renderControls,
|
|
69429
|
+
footerResizable = false,
|
|
69430
|
+
defaultFooterHeight = 30,
|
|
69431
|
+
footerHeight,
|
|
69432
|
+
onFooterHeightChange,
|
|
69433
|
+
footerLabel = "Workflow footer",
|
|
69434
|
+
footerResizeLabel = "Resize workflow footer",
|
|
69220
69435
|
stepPopoverProps,
|
|
69221
69436
|
data = sampleWorkflow,
|
|
69222
69437
|
loading = false,
|
|
@@ -69234,20 +69449,20 @@ var WorkflowTrackerRail = ({
|
|
|
69234
69449
|
style,
|
|
69235
69450
|
...styleProps
|
|
69236
69451
|
}) => {
|
|
69237
|
-
const [internalCollapsed, setInternalCollapsed] = (0,
|
|
69452
|
+
const [internalCollapsed, setInternalCollapsed] = (0, import_react294.useState)(defaultCollapsed);
|
|
69238
69453
|
const isCollapsed = collapsible && (collapsed ?? internalCollapsed);
|
|
69239
|
-
const timelineId = (0,
|
|
69454
|
+
const timelineId = (0, import_react294.useId)();
|
|
69240
69455
|
const scrollBody = fillHeight || (cardScrollable ?? false);
|
|
69241
69456
|
const steps = data?.steps ?? [];
|
|
69242
69457
|
const { palette, surfaces, customStatuses } = useWorkflowChrome(styleProps);
|
|
69243
|
-
const labels = (0,
|
|
69458
|
+
const labels = (0, import_react294.useMemo)(() => resolveLabels(labelOverrides), [labelOverrides]);
|
|
69244
69459
|
const cardProps = buildCardProps(styleProps);
|
|
69245
|
-
const active = (0,
|
|
69460
|
+
const active = (0, import_react294.useMemo)(
|
|
69246
69461
|
() => resolveActiveStep(steps, data?.activeStepId),
|
|
69247
69462
|
[steps, data?.activeStepId]
|
|
69248
69463
|
);
|
|
69249
|
-
const progress = (0,
|
|
69250
|
-
const tallies = (0,
|
|
69464
|
+
const progress = (0, import_react294.useMemo)(() => computeProgress(steps), [steps]);
|
|
69465
|
+
const tallies = (0, import_react294.useMemo)(() => computeTallies(steps, customStatuses), [steps, customStatuses]);
|
|
69251
69466
|
return /* @__PURE__ */ (0, import_jsx_runtime316.jsxs)(
|
|
69252
69467
|
Panel_default,
|
|
69253
69468
|
{
|
|
@@ -69308,6 +69523,12 @@ var WorkflowTrackerRail = ({
|
|
|
69308
69523
|
WorkflowTimeline_default,
|
|
69309
69524
|
{
|
|
69310
69525
|
controls: renderControls?.({ collapsed: isCollapsed }),
|
|
69526
|
+
footerResizable,
|
|
69527
|
+
defaultFooterHeight,
|
|
69528
|
+
footerHeight,
|
|
69529
|
+
onFooterHeightChange,
|
|
69530
|
+
footerLabel,
|
|
69531
|
+
footerResizeLabel,
|
|
69311
69532
|
collapsed: isCollapsed,
|
|
69312
69533
|
side,
|
|
69313
69534
|
hasCollapseToggle: collapsible,
|
|
@@ -69350,7 +69571,7 @@ var WorkflowTrackerRail = ({
|
|
|
69350
69571
|
var WorkflowTrackerRail_default = WorkflowTrackerRail;
|
|
69351
69572
|
|
|
69352
69573
|
// src/components/WorkflowTracker/WorkflowTrackerStepDetails.tsx
|
|
69353
|
-
var
|
|
69574
|
+
var import_react295 = require("react");
|
|
69354
69575
|
var import_classnames119 = __toESM(require("classnames"), 1);
|
|
69355
69576
|
|
|
69356
69577
|
// src/components/WorkflowTracker/WorkflowDetailPanel.tsx
|
|
@@ -69564,12 +69785,12 @@ var WorkflowTrackerStepDetails = ({
|
|
|
69564
69785
|
}) => {
|
|
69565
69786
|
const steps = data?.steps ?? [];
|
|
69566
69787
|
const { palette, surfaces, customStatuses } = useWorkflowChrome(styleProps);
|
|
69567
|
-
const labels = (0,
|
|
69788
|
+
const labels = (0, import_react295.useMemo)(
|
|
69568
69789
|
() => resolveLabels(labelOverrides),
|
|
69569
69790
|
[labelOverrides]
|
|
69570
69791
|
);
|
|
69571
69792
|
const cardProps = buildCardProps(styleProps);
|
|
69572
|
-
const active = (0,
|
|
69793
|
+
const active = (0, import_react295.useMemo)(
|
|
69573
69794
|
() => resolveActiveStep(steps, data?.activeStepId),
|
|
69574
69795
|
[steps, data?.activeStepId]
|
|
69575
69796
|
);
|
|
@@ -69599,7 +69820,7 @@ var WorkflowTrackerStepDetails = ({
|
|
|
69599
69820
|
var WorkflowTrackerStepDetails_default = WorkflowTrackerStepDetails;
|
|
69600
69821
|
|
|
69601
69822
|
// src/components/WorkflowTracker/WorkflowTrackerDetails.tsx
|
|
69602
|
-
var
|
|
69823
|
+
var import_react296 = require("react");
|
|
69603
69824
|
var import_classnames121 = __toESM(require("classnames"), 1);
|
|
69604
69825
|
|
|
69605
69826
|
// src/components/WorkflowTracker/WorkflowDetailsCard.tsx
|
|
@@ -69645,9 +69866,9 @@ var WorkflowTrackerDetails = ({
|
|
|
69645
69866
|
...styleProps
|
|
69646
69867
|
}) => {
|
|
69647
69868
|
const steps = data?.steps ?? [];
|
|
69648
|
-
const labels = (0,
|
|
69869
|
+
const labels = (0, import_react296.useMemo)(() => resolveLabels(labelOverrides), [labelOverrides]);
|
|
69649
69870
|
const cardProps = buildCardProps(styleProps);
|
|
69650
|
-
const active = (0,
|
|
69871
|
+
const active = (0, import_react296.useMemo)(
|
|
69651
69872
|
() => resolveActiveStep(steps, data?.activeStepId),
|
|
69652
69873
|
[steps, data?.activeStepId]
|
|
69653
69874
|
);
|
|
@@ -69667,7 +69888,7 @@ var WorkflowTrackerDetails = ({
|
|
|
69667
69888
|
var WorkflowTrackerDetails_default = WorkflowTrackerDetails;
|
|
69668
69889
|
|
|
69669
69890
|
// src/components/WorkflowTracker/WorkflowTrackerRollups.tsx
|
|
69670
|
-
var
|
|
69891
|
+
var import_react297 = require("react");
|
|
69671
69892
|
var import_classnames123 = __toESM(require("classnames"), 1);
|
|
69672
69893
|
|
|
69673
69894
|
// src/components/WorkflowTracker/WorkflowSummaryCard.tsx
|
|
@@ -69720,10 +69941,10 @@ var WorkflowTrackerRollups = ({
|
|
|
69720
69941
|
}) => {
|
|
69721
69942
|
const steps = data?.steps ?? [];
|
|
69722
69943
|
const { palette, surfaces, customStatuses } = useWorkflowChrome(styleProps);
|
|
69723
|
-
const labels = (0,
|
|
69944
|
+
const labels = (0, import_react297.useMemo)(() => resolveLabels(labelOverrides), [labelOverrides]);
|
|
69724
69945
|
const cardProps = buildCardProps(styleProps);
|
|
69725
|
-
const attentionSteps = (0,
|
|
69726
|
-
const skippedSteps = (0,
|
|
69946
|
+
const attentionSteps = (0, import_react297.useMemo)(() => getAttentionSteps(steps, customStatuses), [steps, customStatuses]);
|
|
69947
|
+
const skippedSteps = (0, import_react297.useMemo)(() => getSkippedSteps(steps), [steps]);
|
|
69727
69948
|
if (loading || attentionSteps.length === 0 && skippedSteps.length === 0) {
|
|
69728
69949
|
return null;
|
|
69729
69950
|
}
|
|
@@ -69814,7 +70035,7 @@ var WorkflowTracker = ({
|
|
|
69814
70035
|
translucentSurfaces
|
|
69815
70036
|
};
|
|
69816
70037
|
const { surfaces } = useWorkflowChrome(styleProps);
|
|
69817
|
-
const labels = (0,
|
|
70038
|
+
const labels = (0, import_react298.useMemo)(() => resolveLabels(labelOverrides), [labelOverrides]);
|
|
69818
70039
|
const railStyle = {
|
|
69819
70040
|
"--wt-rail-width": typeof railWidth === "number" ? `${railWidth}px` : railWidth,
|
|
69820
70041
|
"--wt-fill-offset": typeof fillHeightOffset === "number" ? `${fillHeightOffset}px` : fillHeightOffset
|
|
@@ -69965,7 +70186,7 @@ var WorkflowTracker = ({
|
|
|
69965
70186
|
var WorkflowTracker_default = WorkflowTracker;
|
|
69966
70187
|
|
|
69967
70188
|
// src/components/Gantt/Gantt.tsx
|
|
69968
|
-
var
|
|
70189
|
+
var import_react303 = require("react");
|
|
69969
70190
|
var import_react_dom16 = require("react-dom");
|
|
69970
70191
|
var import_classnames128 = __toESM(require("classnames"), 1);
|
|
69971
70192
|
|
|
@@ -71597,9 +71818,9 @@ var GanttScale = ({ levels, height }) => {
|
|
|
71597
71818
|
GanttScale.displayName = "GanttScale";
|
|
71598
71819
|
|
|
71599
71820
|
// src/components/Gantt/GanttLinkLayer.tsx
|
|
71600
|
-
var
|
|
71821
|
+
var import_react299 = require("react");
|
|
71601
71822
|
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
71602
|
-
var GanttLinkLayer = (0,
|
|
71823
|
+
var GanttLinkLayer = (0, import_react299.forwardRef)(
|
|
71603
71824
|
function GanttLinkLayer2({
|
|
71604
71825
|
width,
|
|
71605
71826
|
height,
|
|
@@ -71613,7 +71834,7 @@ var GanttLinkLayer = (0, import_react298.forwardRef)(
|
|
|
71613
71834
|
onDeleteLink
|
|
71614
71835
|
}, ref) {
|
|
71615
71836
|
const t = useKitT();
|
|
71616
|
-
const svgRef = (0,
|
|
71837
|
+
const svgRef = (0, import_react299.useRef)(null);
|
|
71617
71838
|
const selPath = selected ? paths.find((p) => p.link === selected) : void 0;
|
|
71618
71839
|
const selColor = selPath ? selPath.color ?? color2 : color2;
|
|
71619
71840
|
const selMid = selPath ? { x: (selPath.from.x + selPath.to.x) / 2, y: (selPath.from.y + selPath.to.y) / 2 } : null;
|
|
@@ -71754,7 +71975,7 @@ var GanttLinkLayer = (0, import_react298.forwardRef)(
|
|
|
71754
71975
|
GanttLinkLayer.displayName = "GanttLinkLayer";
|
|
71755
71976
|
|
|
71756
71977
|
// src/components/Gantt/GanttBodyRow.tsx
|
|
71757
|
-
var
|
|
71978
|
+
var import_react300 = require("react");
|
|
71758
71979
|
var import_classnames126 = __toESM(require("classnames"), 1);
|
|
71759
71980
|
var import_jsx_runtime326 = require("react/jsx-runtime");
|
|
71760
71981
|
var BAR_HEIGHT = 24;
|
|
@@ -72051,7 +72272,7 @@ var TaskBar = ({
|
|
|
72051
72272
|
const t = useKitT();
|
|
72052
72273
|
const milestone = task.type === "milestone";
|
|
72053
72274
|
const barColor = task.color ?? color2;
|
|
72054
|
-
const tokens = (0,
|
|
72275
|
+
const tokens = (0, import_react300.useMemo)(() => getGanttBarTokens(barColor), [barColor]);
|
|
72055
72276
|
const startMs = liveDates ? liveDates.start : toMs(task.start);
|
|
72056
72277
|
const endMs = liveDates ? liveDates.end : toMs(task.end);
|
|
72057
72278
|
const left = dateToX(startMs, rangeStart, zoom);
|
|
@@ -72210,7 +72431,7 @@ var TaskBar = ({
|
|
|
72210
72431
|
};
|
|
72211
72432
|
|
|
72212
72433
|
// src/components/Gantt/GanttToolbar.tsx
|
|
72213
|
-
var
|
|
72434
|
+
var import_react301 = require("react");
|
|
72214
72435
|
var import_classnames127 = __toESM(require("classnames"), 1);
|
|
72215
72436
|
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
72216
72437
|
function nearestPreset(zoom, presets) {
|
|
@@ -72240,8 +72461,8 @@ var GanttToolbar = ({
|
|
|
72240
72461
|
Month: t("kit.gantt.zoomMonth"),
|
|
72241
72462
|
Quarter: t("kit.gantt.zoomQuarter")
|
|
72242
72463
|
};
|
|
72243
|
-
const active = (0,
|
|
72244
|
-
const chrome = (0,
|
|
72464
|
+
const active = (0, import_react301.useMemo)(() => nearestPreset(zoom, presets), [zoom, presets]);
|
|
72465
|
+
const chrome = (0, import_react301.useMemo)(
|
|
72245
72466
|
() => getSurfaceVariantClasses(variant, tone),
|
|
72246
72467
|
[variant, tone]
|
|
72247
72468
|
);
|
|
@@ -72276,16 +72497,16 @@ var GanttToolbar = ({
|
|
|
72276
72497
|
GanttToolbar.displayName = "GanttToolbar";
|
|
72277
72498
|
|
|
72278
72499
|
// src/components/Gantt/useGanttDrag.ts
|
|
72279
|
-
var
|
|
72500
|
+
var import_react302 = require("react");
|
|
72280
72501
|
function useGanttDrag(opts) {
|
|
72281
|
-
const [drag, setDrag] = (0,
|
|
72282
|
-
const [linkSelected, setLinkSelected] = (0,
|
|
72283
|
-
const optsRef = (0,
|
|
72502
|
+
const [drag, setDrag] = (0, import_react302.useState)(null);
|
|
72503
|
+
const [linkSelected, setLinkSelected] = (0, import_react302.useState)(null);
|
|
72504
|
+
const optsRef = (0, import_react302.useRef)(opts);
|
|
72284
72505
|
optsRef.current = opts;
|
|
72285
|
-
const dragRef = (0,
|
|
72506
|
+
const dragRef = (0, import_react302.useRef)(null);
|
|
72286
72507
|
dragRef.current = drag;
|
|
72287
72508
|
const { rows, zoom, rangeStart, accentColor } = opts;
|
|
72288
|
-
const barGeom = (0,
|
|
72509
|
+
const barGeom = (0, import_react302.useCallback)(
|
|
72289
72510
|
(taskId) => {
|
|
72290
72511
|
const row = rows.find((r) => r.key === `task:${taskId}`);
|
|
72291
72512
|
if (!row?.task) return null;
|
|
@@ -72305,7 +72526,7 @@ function useGanttDrag(opts) {
|
|
|
72305
72526
|
},
|
|
72306
72527
|
[rows, zoom, rangeStart]
|
|
72307
72528
|
);
|
|
72308
|
-
const findTargetBar = (0,
|
|
72529
|
+
const findTargetBar = (0, import_react302.useCallback)(
|
|
72309
72530
|
(x, y, excludeId) => {
|
|
72310
72531
|
const row = rows.find((r) => r.task && y >= r.top && y < r.top + r.height);
|
|
72311
72532
|
if (!row?.task || row.task.id === excludeId) return null;
|
|
@@ -72316,7 +72537,7 @@ function useGanttDrag(opts) {
|
|
|
72316
72537
|
},
|
|
72317
72538
|
[rows, barGeom]
|
|
72318
72539
|
);
|
|
72319
|
-
const allBarGeoms = (0,
|
|
72540
|
+
const allBarGeoms = (0, import_react302.useCallback)(() => {
|
|
72320
72541
|
const out = [];
|
|
72321
72542
|
for (const row of rows) {
|
|
72322
72543
|
if (!row.task) continue;
|
|
@@ -72325,17 +72546,17 @@ function useGanttDrag(opts) {
|
|
|
72325
72546
|
}
|
|
72326
72547
|
return out;
|
|
72327
72548
|
}, [rows, barGeom]);
|
|
72328
|
-
const timelineX = (0,
|
|
72549
|
+
const timelineX = (0, import_react302.useCallback)((clientX) => {
|
|
72329
72550
|
const overlay = optsRef.current.overlayRef.current;
|
|
72330
72551
|
if (!overlay) return 0;
|
|
72331
72552
|
return clientX - overlay.getBoundingClientRect().left;
|
|
72332
72553
|
}, []);
|
|
72333
|
-
const rowY = (0,
|
|
72554
|
+
const rowY = (0, import_react302.useCallback)((clientY) => {
|
|
72334
72555
|
const overlay = optsRef.current.overlayRef.current;
|
|
72335
72556
|
if (!overlay) return 0;
|
|
72336
72557
|
return clientY - overlay.getBoundingClientRect().top;
|
|
72337
72558
|
}, []);
|
|
72338
|
-
(0,
|
|
72559
|
+
(0, import_react302.useEffect)(() => {
|
|
72339
72560
|
if (!drag) return;
|
|
72340
72561
|
const onMove = (e) => {
|
|
72341
72562
|
e.preventDefault();
|
|
@@ -72460,7 +72681,7 @@ function useGanttDrag(opts) {
|
|
|
72460
72681
|
window.removeEventListener("pointerup", onUp);
|
|
72461
72682
|
};
|
|
72462
72683
|
}, [drag != null, timelineX, rowY]);
|
|
72463
|
-
const beginDrag = (0,
|
|
72684
|
+
const beginDrag = (0, import_react302.useCallback)(
|
|
72464
72685
|
(partial, e, focusEl) => {
|
|
72465
72686
|
const o = optsRef.current;
|
|
72466
72687
|
if (!o.interactive) return;
|
|
@@ -72494,7 +72715,7 @@ function useGanttDrag(opts) {
|
|
|
72494
72715
|
},
|
|
72495
72716
|
[timelineX, rowY]
|
|
72496
72717
|
);
|
|
72497
|
-
const onBarPointerDown = (0,
|
|
72718
|
+
const onBarPointerDown = (0, import_react302.useCallback)(
|
|
72498
72719
|
(task, e) => {
|
|
72499
72720
|
if (e.button !== 0) return;
|
|
72500
72721
|
beginDrag(
|
|
@@ -72512,7 +72733,7 @@ function useGanttDrag(opts) {
|
|
|
72512
72733
|
},
|
|
72513
72734
|
[beginDrag, timelineX, rowY]
|
|
72514
72735
|
);
|
|
72515
|
-
const onResizePointerDown = (0,
|
|
72736
|
+
const onResizePointerDown = (0, import_react302.useCallback)(
|
|
72516
72737
|
(task, edge, e) => {
|
|
72517
72738
|
if (e.button !== 0) return;
|
|
72518
72739
|
e.stopPropagation();
|
|
@@ -72531,7 +72752,7 @@ function useGanttDrag(opts) {
|
|
|
72531
72752
|
},
|
|
72532
72753
|
[beginDrag, timelineX, rowY]
|
|
72533
72754
|
);
|
|
72534
|
-
const onGripPointerDown = (0,
|
|
72755
|
+
const onGripPointerDown = (0, import_react302.useCallback)(
|
|
72535
72756
|
(_rowKey, task, e) => {
|
|
72536
72757
|
if (e.button !== 0) return;
|
|
72537
72758
|
const rowEl = e.currentTarget.closest(
|
|
@@ -72556,7 +72777,7 @@ function useGanttDrag(opts) {
|
|
|
72556
72777
|
},
|
|
72557
72778
|
[beginDrag, timelineX, rowY]
|
|
72558
72779
|
);
|
|
72559
|
-
const onLinkHandlePointerDown = (0,
|
|
72780
|
+
const onLinkHandlePointerDown = (0, import_react302.useCallback)(
|
|
72560
72781
|
(task, side, e, fromOffset = 0) => {
|
|
72561
72782
|
if (e.button !== 0) return;
|
|
72562
72783
|
e.stopPropagation();
|
|
@@ -72576,7 +72797,7 @@ function useGanttDrag(opts) {
|
|
|
72576
72797
|
},
|
|
72577
72798
|
[beginDrag, timelineX, rowY]
|
|
72578
72799
|
);
|
|
72579
|
-
const onProgressPointerDown = (0,
|
|
72800
|
+
const onProgressPointerDown = (0, import_react302.useCallback)(
|
|
72580
72801
|
(task, e) => {
|
|
72581
72802
|
if (e.button !== 0) return;
|
|
72582
72803
|
e.stopPropagation();
|
|
@@ -72594,7 +72815,7 @@ function useGanttDrag(opts) {
|
|
|
72594
72815
|
},
|
|
72595
72816
|
[beginDrag, timelineX, rowY]
|
|
72596
72817
|
);
|
|
72597
|
-
const rubber = (0,
|
|
72818
|
+
const rubber = (0, import_react302.useMemo)(() => {
|
|
72598
72819
|
if (!drag || drag.kind !== "link") return null;
|
|
72599
72820
|
const source = barGeom(drag.taskId);
|
|
72600
72821
|
if (!source) return null;
|
|
@@ -72686,7 +72907,7 @@ var Gantt = ({
|
|
|
72686
72907
|
const t = useKitT();
|
|
72687
72908
|
const kitEngine = useKitEngine();
|
|
72688
72909
|
const dateLocale = locale ?? kitEngine.locale;
|
|
72689
|
-
const allLabels = (0,
|
|
72910
|
+
const allLabels = (0, import_react303.useMemo)(
|
|
72690
72911
|
() => ({
|
|
72691
72912
|
loading: t("kit.gantt.loading"),
|
|
72692
72913
|
empty: t("kit.gantt.empty"),
|
|
@@ -72709,10 +72930,10 @@ var Gantt = ({
|
|
|
72709
72930
|
title: c.key === "name" ? allLabels.task : c.key === "owner" ? t("kit.gantt.colOwner") : t("kit.gantt.colProgress")
|
|
72710
72931
|
}));
|
|
72711
72932
|
const interactive = editable ?? Boolean(onTasksChange || onLinksChange || onReorder);
|
|
72712
|
-
const surfaceText = (0,
|
|
72713
|
-
const [internalZoom, setInternalZoom] = (0,
|
|
72933
|
+
const surfaceText = (0, import_react303.useMemo)(() => getSurfaceTextTokens(variant), [variant]);
|
|
72934
|
+
const [internalZoom, setInternalZoom] = (0, import_react303.useState)(initialZoom);
|
|
72714
72935
|
const zoom = zoomProp ?? internalZoom;
|
|
72715
|
-
const setZoom = (0,
|
|
72936
|
+
const setZoom = (0, import_react303.useCallback)(
|
|
72716
72937
|
(z) => {
|
|
72717
72938
|
const clamped = Math.min(maxZoom, Math.max(minZoom, z));
|
|
72718
72939
|
if (onZoomChange) onZoomChange(clamped);
|
|
@@ -72720,33 +72941,33 @@ var Gantt = ({
|
|
|
72720
72941
|
},
|
|
72721
72942
|
[minZoom, maxZoom, onZoomChange]
|
|
72722
72943
|
);
|
|
72723
|
-
const [internalSelection, setInternalSelection] = (0,
|
|
72944
|
+
const [internalSelection, setInternalSelection] = (0, import_react303.useState)(null);
|
|
72724
72945
|
const selectedId = selectedIdProp !== void 0 ? selectedIdProp : internalSelection;
|
|
72725
|
-
const setSelected = (0,
|
|
72946
|
+
const setSelected = (0, import_react303.useCallback)(
|
|
72726
72947
|
(id) => {
|
|
72727
72948
|
onSelect?.(id);
|
|
72728
72949
|
if (selectedIdProp === void 0) setInternalSelection(id);
|
|
72729
72950
|
},
|
|
72730
72951
|
[onSelect, selectedIdProp]
|
|
72731
72952
|
);
|
|
72732
|
-
const [internalOrder, setInternalOrder] = (0,
|
|
72953
|
+
const [internalOrder, setInternalOrder] = (0, import_react303.useState)(void 0);
|
|
72733
72954
|
const rowOrder = rowOrderProp ?? internalOrder;
|
|
72734
|
-
const handleReorder = (0,
|
|
72955
|
+
const handleReorder = (0, import_react303.useCallback)(
|
|
72735
72956
|
(order) => {
|
|
72736
72957
|
onReorder?.(order);
|
|
72737
72958
|
if (rowOrderProp === void 0) setInternalOrder(order);
|
|
72738
72959
|
},
|
|
72739
72960
|
[onReorder, rowOrderProp]
|
|
72740
72961
|
);
|
|
72741
|
-
const [collapsed, setCollapsed] = (0,
|
|
72962
|
+
const [collapsed, setCollapsed] = (0, import_react303.useState)(
|
|
72742
72963
|
() => new Set(tasks.filter((t2) => t2.open === false).map((t2) => t2.id))
|
|
72743
72964
|
);
|
|
72744
|
-
const [closedLanes, setClosedLanes] = (0,
|
|
72965
|
+
const [closedLanes, setClosedLanes] = (0, import_react303.useState)(
|
|
72745
72966
|
() => new Set((lanes ?? []).filter((l) => l.open === false).map((l) => l.id))
|
|
72746
72967
|
);
|
|
72747
|
-
const tasksRef = (0,
|
|
72748
|
-
const lanesRef = (0,
|
|
72749
|
-
(0,
|
|
72968
|
+
const tasksRef = (0, import_react303.useRef)(tasks);
|
|
72969
|
+
const lanesRef = (0, import_react303.useRef)(lanes);
|
|
72970
|
+
(0, import_react303.useEffect)(() => {
|
|
72750
72971
|
if (tasksRef.current !== tasks) {
|
|
72751
72972
|
tasksRef.current = tasks;
|
|
72752
72973
|
setCollapsed(new Set(tasks.filter((t2) => t2.open === false).map((t2) => t2.id)));
|
|
@@ -72756,7 +72977,7 @@ var Gantt = ({
|
|
|
72756
72977
|
setClosedLanes(new Set((lanes ?? []).filter((l) => l.open === false).map((l) => l.id)));
|
|
72757
72978
|
}
|
|
72758
72979
|
}, [tasks, lanes]);
|
|
72759
|
-
const toggleCollapse = (0,
|
|
72980
|
+
const toggleCollapse = (0, import_react303.useCallback)((taskId, isOpen) => {
|
|
72760
72981
|
setCollapsed((prev) => {
|
|
72761
72982
|
const next = new Set(prev);
|
|
72762
72983
|
if (isOpen) next.add(taskId);
|
|
@@ -72764,7 +72985,7 @@ var Gantt = ({
|
|
|
72764
72985
|
return next;
|
|
72765
72986
|
});
|
|
72766
72987
|
}, []);
|
|
72767
|
-
const toggleLane = (0,
|
|
72988
|
+
const toggleLane = (0, import_react303.useCallback)((laneId, isOpen) => {
|
|
72768
72989
|
setClosedLanes((prev) => {
|
|
72769
72990
|
const next = new Set(prev);
|
|
72770
72991
|
if (isOpen) next.add(laneId);
|
|
@@ -72772,37 +72993,37 @@ var Gantt = ({
|
|
|
72772
72993
|
return next;
|
|
72773
72994
|
});
|
|
72774
72995
|
}, []);
|
|
72775
|
-
const effectiveTasks = (0,
|
|
72996
|
+
const effectiveTasks = (0, import_react303.useMemo)(() => {
|
|
72776
72997
|
let out = tasks;
|
|
72777
72998
|
if (collapsed.size > 0) {
|
|
72778
72999
|
out = out.map((t2) => collapsed.has(t2.id) ? { ...t2, open: false } : t2);
|
|
72779
73000
|
}
|
|
72780
73001
|
return out;
|
|
72781
73002
|
}, [tasks, collapsed]);
|
|
72782
|
-
const effectiveLanes = (0,
|
|
73003
|
+
const effectiveLanes = (0, import_react303.useMemo)(() => {
|
|
72783
73004
|
if (closedLanes.size === 0) return lanes;
|
|
72784
73005
|
return (lanes ?? []).map(
|
|
72785
73006
|
(l) => closedLanes.has(l.id) ? { ...l, open: false } : l
|
|
72786
73007
|
);
|
|
72787
73008
|
}, [lanes, closedLanes]);
|
|
72788
|
-
const committedModel = (0,
|
|
73009
|
+
const committedModel = (0, import_react303.useMemo)(
|
|
72789
73010
|
() => buildRows(effectiveTasks, effectiveLanes, rowOrder, rowHeight2),
|
|
72790
73011
|
[effectiveTasks, effectiveLanes, rowOrder, rowHeight2]
|
|
72791
73012
|
);
|
|
72792
|
-
const range = (0,
|
|
73013
|
+
const range = (0, import_react303.useMemo)(() => {
|
|
72793
73014
|
const starts = tasks.map((t2) => toMs(t2.start));
|
|
72794
73015
|
const ends = tasks.map((t2) => toMs(t2.end));
|
|
72795
73016
|
return computeViewRange(starts, ends);
|
|
72796
73017
|
}, [tasks]);
|
|
72797
73018
|
const timelineWidth = rangeWidth(range.start, range.end, zoom);
|
|
72798
|
-
const scaleLevels = (0,
|
|
73019
|
+
const scaleLevels = (0, import_react303.useMemo)(
|
|
72799
73020
|
() => buildTimeScale(range.start, range.end, zoom, dateLocale),
|
|
72800
73021
|
[range, zoom, dateLocale]
|
|
72801
73022
|
);
|
|
72802
|
-
const [colWidths, setColWidths] = (0,
|
|
73023
|
+
const [colWidths, setColWidths] = (0, import_react303.useState)(
|
|
72803
73024
|
() => columnWidths ? { ...columnWidths } : {}
|
|
72804
73025
|
);
|
|
72805
|
-
(0,
|
|
73026
|
+
(0, import_react303.useEffect)(() => {
|
|
72806
73027
|
if (!columnWidths) return;
|
|
72807
73028
|
setColWidths((prev) => ({ ...prev, ...columnWidths }));
|
|
72808
73029
|
}, [columnWidths]);
|
|
@@ -72812,21 +73033,21 @@ var Gantt = ({
|
|
|
72812
73033
|
const m = /^(\d+(?:\.\d+)?)px$/.exec(col.width ?? "");
|
|
72813
73034
|
return m ? Number(m[1]) : 160;
|
|
72814
73035
|
};
|
|
72815
|
-
const sizedColumns = (0,
|
|
73036
|
+
const sizedColumns = (0, import_react303.useMemo)(
|
|
72816
73037
|
() => resolvedColumns.map((c) => ({ ...c, width: `${effectiveColWidth(c)}px` })),
|
|
72817
73038
|
[resolvedColumns, colWidths]
|
|
72818
73039
|
);
|
|
72819
|
-
const effectiveWidthsRef = (0,
|
|
73040
|
+
const effectiveWidthsRef = (0, import_react303.useRef)({});
|
|
72820
73041
|
effectiveWidthsRef.current = Object.fromEntries(
|
|
72821
73042
|
sizedColumns.map((c) => [c.key, effectiveColWidth(c)])
|
|
72822
73043
|
);
|
|
72823
|
-
const leftWidth = (0,
|
|
73044
|
+
const leftWidth = (0, import_react303.useMemo)(
|
|
72824
73045
|
() => GRIP_WIDTH + resolvedColumns.reduce((sum, c) => sum + effectiveColWidth(c), 0),
|
|
72825
73046
|
[resolvedColumns, colWidths]
|
|
72826
73047
|
);
|
|
72827
|
-
const resizingRef = (0,
|
|
72828
|
-
const [resizingKey, setResizingKey] = (0,
|
|
72829
|
-
const startColumnResize = (0,
|
|
73048
|
+
const resizingRef = (0, import_react303.useRef)(null);
|
|
73049
|
+
const [resizingKey, setResizingKey] = (0, import_react303.useState)(null);
|
|
73050
|
+
const startColumnResize = (0, import_react303.useCallback)(
|
|
72830
73051
|
(e, key) => {
|
|
72831
73052
|
if (e.button !== 0) return;
|
|
72832
73053
|
e.preventDefault();
|
|
@@ -72857,23 +73078,23 @@ var Gantt = ({
|
|
|
72857
73078
|
},
|
|
72858
73079
|
[onColumnWidthChange]
|
|
72859
73080
|
);
|
|
72860
|
-
(0,
|
|
73081
|
+
(0, import_react303.useEffect)(
|
|
72861
73082
|
() => () => {
|
|
72862
73083
|
document.body.style.cursor = "";
|
|
72863
73084
|
document.body.style.userSelect = "";
|
|
72864
73085
|
},
|
|
72865
73086
|
[]
|
|
72866
73087
|
);
|
|
72867
|
-
const scrollRef = (0,
|
|
72868
|
-
const overlayRef = (0,
|
|
72869
|
-
const rootRef = (0,
|
|
72870
|
-
const headerScaleRef = (0,
|
|
72871
|
-
const syncHeaderScale = (0,
|
|
73088
|
+
const scrollRef = (0, import_react303.useRef)(null);
|
|
73089
|
+
const overlayRef = (0, import_react303.useRef)(null);
|
|
73090
|
+
const rootRef = (0, import_react303.useRef)(null);
|
|
73091
|
+
const headerScaleRef = (0, import_react303.useRef)(null);
|
|
73092
|
+
const syncHeaderScale = (0, import_react303.useCallback)(() => {
|
|
72872
73093
|
const s = scrollRef.current;
|
|
72873
73094
|
const h = headerScaleRef.current;
|
|
72874
73095
|
if (s && h) h.style.transform = `translateX(${-s.scrollLeft}px)`;
|
|
72875
73096
|
}, []);
|
|
72876
|
-
const zoomBy = (0,
|
|
73097
|
+
const zoomBy = (0, import_react303.useCallback)(
|
|
72877
73098
|
(factor, pointerClientX) => {
|
|
72878
73099
|
const el = scrollRef.current;
|
|
72879
73100
|
const next = Math.min(maxZoom, Math.max(minZoom, zoom * factor));
|
|
@@ -72892,7 +73113,7 @@ var Gantt = ({
|
|
|
72892
73113
|
},
|
|
72893
73114
|
[zoom, minZoom, maxZoom, leftWidth, setZoom]
|
|
72894
73115
|
);
|
|
72895
|
-
(0,
|
|
73116
|
+
(0, import_react303.useEffect)(() => {
|
|
72896
73117
|
const el = scrollRef.current;
|
|
72897
73118
|
if (!el) return;
|
|
72898
73119
|
const onWheel = (e) => {
|
|
@@ -72904,10 +73125,10 @@ var Gantt = ({
|
|
|
72904
73125
|
el.addEventListener("wheel", onWheel, { passive: false });
|
|
72905
73126
|
return () => el.removeEventListener("wheel", onWheel);
|
|
72906
73127
|
}, [zoomBy]);
|
|
72907
|
-
(0,
|
|
73128
|
+
(0, import_react303.useEffect)(() => {
|
|
72908
73129
|
syncHeaderScale();
|
|
72909
73130
|
}, [syncHeaderScale, timelineWidth, zoom, range.start, leftWidth]);
|
|
72910
|
-
const liveRowsRef = (0,
|
|
73131
|
+
const liveRowsRef = (0, import_react303.useRef)(null);
|
|
72911
73132
|
const dragApi = useGanttDrag({
|
|
72912
73133
|
scrollRef,
|
|
72913
73134
|
overlayRef,
|
|
@@ -72929,12 +73150,12 @@ var Gantt = ({
|
|
|
72929
73150
|
rowOrder,
|
|
72930
73151
|
setSelected
|
|
72931
73152
|
});
|
|
72932
|
-
const liveReorder = (0,
|
|
73153
|
+
const liveReorder = (0, import_react303.useMemo)(() => {
|
|
72933
73154
|
const d = dragApi.drag;
|
|
72934
73155
|
if (d?.kind !== "reorder" || d.beforeId === void 0) return null;
|
|
72935
73156
|
return applyRowReorder(effectiveTasks, d.taskId, d.beforeId, rowOrder);
|
|
72936
73157
|
}, [dragApi.drag, effectiveTasks, rowOrder]);
|
|
72937
|
-
const liveModel = (0,
|
|
73158
|
+
const liveModel = (0, import_react303.useMemo)(
|
|
72938
73159
|
() => liveReorder ? buildRows(
|
|
72939
73160
|
liveReorder.tasks,
|
|
72940
73161
|
effectiveLanes,
|
|
@@ -72944,7 +73165,7 @@ var Gantt = ({
|
|
|
72944
73165
|
[liveReorder, effectiveLanes, rowHeight2, committedModel]
|
|
72945
73166
|
);
|
|
72946
73167
|
liveRowsRef.current = liveModel.rows;
|
|
72947
|
-
const bars = (0,
|
|
73168
|
+
const bars = (0, import_react303.useMemo)(() => {
|
|
72948
73169
|
const map = /* @__PURE__ */ new Map();
|
|
72949
73170
|
for (const row of liveModel.rows) {
|
|
72950
73171
|
if (!row.task) continue;
|
|
@@ -72966,7 +73187,7 @@ var Gantt = ({
|
|
|
72966
73187
|
return map;
|
|
72967
73188
|
}, [liveModel.rows, range, zoom]);
|
|
72968
73189
|
const bodyHeight = liveModel.rows.length > 0 ? liveModel.rows[liveModel.rows.length - 1].top + liveModel.rows[liveModel.rows.length - 1].height : 0;
|
|
72969
|
-
const onBarKeyDown = (0,
|
|
73190
|
+
const onBarKeyDown = (0, import_react303.useCallback)(
|
|
72970
73191
|
(e, task) => {
|
|
72971
73192
|
if (!interactive || task.locked || !onTasksChange) return;
|
|
72972
73193
|
const stepMs = snap2 === "hour" ? 36e5 : snap2 === "week" ? 7 * MS_PER_DAY : MS_PER_DAY;
|
|
@@ -73011,7 +73232,7 @@ var Gantt = ({
|
|
|
73011
73232
|
},
|
|
73012
73233
|
[interactive, snap2, tasks, onTasksChange, setSelected]
|
|
73013
73234
|
);
|
|
73014
|
-
const deleteSelectedLink = (0,
|
|
73235
|
+
const deleteSelectedLink = (0, import_react303.useCallback)(() => {
|
|
73015
73236
|
const sel = dragApi.linkSelected;
|
|
73016
73237
|
if (!sel || !interactive || !onLinksChange) return;
|
|
73017
73238
|
const key = (l) => l.id ?? `${l.source}~${l.target}~${l.type ?? "fs"}`;
|
|
@@ -73019,7 +73240,7 @@ var Gantt = ({
|
|
|
73019
73240
|
onLinksChange(links.filter((l) => key(l) !== selKey));
|
|
73020
73241
|
dragApi.setLinkSelected(null);
|
|
73021
73242
|
}, [dragApi, links, interactive, onLinksChange]);
|
|
73022
|
-
const moveSelection = (0,
|
|
73243
|
+
const moveSelection = (0, import_react303.useCallback)(
|
|
73023
73244
|
(where) => {
|
|
73024
73245
|
const rows = liveModel.rows;
|
|
73025
73246
|
if (!rows.length) return;
|
|
@@ -73032,7 +73253,7 @@ var Gantt = ({
|
|
|
73032
73253
|
},
|
|
73033
73254
|
[liveModel.rows, selectedId, setSelected]
|
|
73034
73255
|
);
|
|
73035
|
-
const onRootKeyDown = (0,
|
|
73256
|
+
const onRootKeyDown = (0, import_react303.useCallback)(
|
|
73036
73257
|
(e) => {
|
|
73037
73258
|
if (dragApi.linkSelected) {
|
|
73038
73259
|
if (e.key === "Escape") {
|
|
@@ -73078,14 +73299,14 @@ var Gantt = ({
|
|
|
73078
73299
|
},
|
|
73079
73300
|
[dragApi, deleteSelectedLink, moveSelection, setZoom, zoom]
|
|
73080
73301
|
);
|
|
73081
|
-
const handleSelectLink = (0,
|
|
73302
|
+
const handleSelectLink = (0, import_react303.useCallback)(
|
|
73082
73303
|
(link) => {
|
|
73083
73304
|
dragApi.setLinkSelected(link);
|
|
73084
73305
|
if (link) rootRef.current?.focus();
|
|
73085
73306
|
},
|
|
73086
73307
|
[dragApi]
|
|
73087
73308
|
);
|
|
73088
|
-
const handleRootPointerDown = (0,
|
|
73309
|
+
const handleRootPointerDown = (0, import_react303.useCallback)(
|
|
73089
73310
|
(e) => {
|
|
73090
73311
|
if (e.target.closest?.("[data-gantt-keep-link-selection]")) return;
|
|
73091
73312
|
if (dragApi.linkSelected) dragApi.setLinkSelected(null);
|
|
@@ -73100,22 +73321,22 @@ var Gantt = ({
|
|
|
73100
73321
|
const drag = dragApi.drag;
|
|
73101
73322
|
const dragTask = drag?.taskId ? committedModel.tasksById.get(drag.taskId) : void 0;
|
|
73102
73323
|
const reorderLineY = drag?.kind === "reorder" && drag.beforeId !== void 0 ? reorderPreviewTop(liveModel.rows, `task:${drag.taskId}`, drag.beforeId) : null;
|
|
73103
|
-
const dragSubtree = (0,
|
|
73324
|
+
const dragSubtree = (0, import_react303.useMemo)(() => {
|
|
73104
73325
|
if (dragApi.drag?.kind !== "reorder") return null;
|
|
73105
73326
|
return reorderDragSubtree(
|
|
73106
73327
|
liveModel.rows,
|
|
73107
73328
|
`task:${dragApi.drag.taskId}`
|
|
73108
73329
|
);
|
|
73109
73330
|
}, [dragApi.drag, liveModel.rows]);
|
|
73110
|
-
const dragSubtreeKeys = (0,
|
|
73331
|
+
const dragSubtreeKeys = (0, import_react303.useMemo)(
|
|
73111
73332
|
() => new Set((dragSubtree ?? []).map((r) => r.key)),
|
|
73112
73333
|
[dragSubtree]
|
|
73113
73334
|
);
|
|
73114
|
-
const dragSubtreeHeight = (0,
|
|
73335
|
+
const dragSubtreeHeight = (0, import_react303.useMemo)(
|
|
73115
73336
|
() => (dragSubtree ?? []).reduce((sum, r) => sum + r.height, 0),
|
|
73116
73337
|
[dragSubtree]
|
|
73117
73338
|
);
|
|
73118
|
-
const liveDragDates = (0,
|
|
73339
|
+
const liveDragDates = (0, import_react303.useMemo)(() => {
|
|
73119
73340
|
if (!drag || !dragTask) return null;
|
|
73120
73341
|
if (drag.kind !== "move" && drag.kind !== "resize-start" && drag.kind !== "resize-end") return null;
|
|
73121
73342
|
return applyDragDates(
|
|
@@ -73126,7 +73347,7 @@ var Gantt = ({
|
|
|
73126
73347
|
);
|
|
73127
73348
|
}, [drag, dragTask, zoom, snap2]);
|
|
73128
73349
|
const liveDragProgress = drag?.kind === "progress" && drag.liveProgress != null ? drag.liveProgress : null;
|
|
73129
|
-
const dragOverride = (0,
|
|
73350
|
+
const dragOverride = (0, import_react303.useMemo)(() => {
|
|
73130
73351
|
if (!drag || !dragTask) return null;
|
|
73131
73352
|
if (drag.kind === "progress" && drag.liveProgress != null) {
|
|
73132
73353
|
return { ...dragTask, progress: drag.liveProgress };
|
|
@@ -73136,11 +73357,11 @@ var Gantt = ({
|
|
|
73136
73357
|
}
|
|
73137
73358
|
return null;
|
|
73138
73359
|
}, [drag, dragTask, liveDragDates]);
|
|
73139
|
-
const liveLaneProgress = (0,
|
|
73360
|
+
const liveLaneProgress = (0, import_react303.useMemo)(
|
|
73140
73361
|
() => dragOverride && dragTask ? laneRollupProgress(effectiveTasks, dragTask.id, dragOverride) : null,
|
|
73141
73362
|
[dragOverride, dragTask, effectiveTasks]
|
|
73142
73363
|
);
|
|
73143
|
-
const liveGroupProgress = (0,
|
|
73364
|
+
const liveGroupProgress = (0, import_react303.useMemo)(() => {
|
|
73144
73365
|
if (!dragOverride || !dragTask) return null;
|
|
73145
73366
|
const byId = new Map(effectiveTasks.map((t2) => [t2.id, t2]));
|
|
73146
73367
|
const m = /* @__PURE__ */ new Map();
|
|
@@ -73152,7 +73373,7 @@ var Gantt = ({
|
|
|
73152
73373
|
}
|
|
73153
73374
|
return m.size > 0 ? m : null;
|
|
73154
73375
|
}, [dragOverride, dragTask, effectiveTasks]);
|
|
73155
|
-
const liveLinkBars = (0,
|
|
73376
|
+
const liveLinkBars = (0, import_react303.useMemo)(() => {
|
|
73156
73377
|
if (!liveDragDates || !dragTask) return bars;
|
|
73157
73378
|
const g = bars.get(dragTask.id);
|
|
73158
73379
|
if (!g) return bars;
|
|
@@ -73161,18 +73382,18 @@ var Gantt = ({
|
|
|
73161
73382
|
if (left === g.left && width === g.width) return bars;
|
|
73162
73383
|
return new Map(bars).set(dragTask.id, { ...g, left, width });
|
|
73163
73384
|
}, [bars, liveDragDates, dragTask, range, zoom]);
|
|
73164
|
-
const linkPaths = (0,
|
|
73385
|
+
const linkPaths = (0, import_react303.useMemo)(
|
|
73165
73386
|
() => computeLinkPaths(links, liveLinkBars, color2),
|
|
73166
73387
|
[links, liveLinkBars, color2]
|
|
73167
73388
|
);
|
|
73168
|
-
const linkLayerWidth = (0,
|
|
73389
|
+
const linkLayerWidth = (0, import_react303.useMemo)(
|
|
73169
73390
|
() => ganttLinkLayerWidth(linkPaths, timelineWidth),
|
|
73170
73391
|
[linkPaths, timelineWidth]
|
|
73171
73392
|
);
|
|
73172
|
-
(0,
|
|
73393
|
+
(0, import_react303.useEffect)(() => {
|
|
73173
73394
|
syncHeaderScale();
|
|
73174
73395
|
}, [linkLayerWidth, syncHeaderScale]);
|
|
73175
|
-
const linkFan = (0,
|
|
73396
|
+
const linkFan = (0, import_react303.useMemo)(() => computeLinkFanOffsets(links, bars), [links, bars]);
|
|
73176
73397
|
return /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(
|
|
73177
73398
|
Panel_default,
|
|
73178
73399
|
{
|
|
@@ -73583,7 +73804,7 @@ var GanttSkeleton = ({
|
|
|
73583
73804
|
] }, i)) });
|
|
73584
73805
|
|
|
73585
73806
|
// src/components/TaskBoard/TaskBoard.tsx
|
|
73586
|
-
var
|
|
73807
|
+
var import_react316 = require("react");
|
|
73587
73808
|
var import_classnames139 = __toESM(require("classnames"), 1);
|
|
73588
73809
|
|
|
73589
73810
|
// ../common/taskboard/types.ts
|
|
@@ -74139,11 +74360,11 @@ var import_classnames133 = __toESM(require("classnames"), 1);
|
|
|
74139
74360
|
var import_classnames130 = __toESM(require("classnames"), 1);
|
|
74140
74361
|
|
|
74141
74362
|
// src/components/TaskBoard/TaskBoardCard.tsx
|
|
74142
|
-
var
|
|
74363
|
+
var import_react305 = __toESM(require("react"), 1);
|
|
74143
74364
|
var import_classnames129 = __toESM(require("classnames"), 1);
|
|
74144
74365
|
|
|
74145
74366
|
// src/components/TaskBoard/context.ts
|
|
74146
|
-
var
|
|
74367
|
+
var import_react304 = require("react");
|
|
74147
74368
|
var TASKBOARD_SIZES = {
|
|
74148
74369
|
xs: { columnWidth: 232, cardPad: "p-2", title: "text-xs", meta: "text-[10px]", gap: "gap-1.5" },
|
|
74149
74370
|
sm: { columnWidth: 248, cardPad: "p-2.5", title: "text-[13px]", meta: "text-[11px]", gap: "gap-2" },
|
|
@@ -74152,9 +74373,9 @@ var TASKBOARD_SIZES = {
|
|
|
74152
74373
|
xl: { columnWidth: 352, cardPad: "p-4", title: "text-base", meta: "text-sm", gap: "gap-3" }
|
|
74153
74374
|
};
|
|
74154
74375
|
var REFUSED_DROP = "cursor-not-allowed bg-red-500/10 ring-2 ring-inset ring-red-500/40 dark:bg-red-500/15";
|
|
74155
|
-
var TaskBoardContext = (0,
|
|
74376
|
+
var TaskBoardContext = (0, import_react304.createContext)(null);
|
|
74156
74377
|
function useTaskBoard() {
|
|
74157
|
-
const ctx = (0,
|
|
74378
|
+
const ctx = (0, import_react304.useContext)(TaskBoardContext);
|
|
74158
74379
|
if (!ctx) throw new Error("TaskBoard parts must render inside <TaskBoard>");
|
|
74159
74380
|
return ctx;
|
|
74160
74381
|
}
|
|
@@ -74262,7 +74483,7 @@ var TaskBoardCardBody = ({ card }) => {
|
|
|
74262
74483
|
] })
|
|
74263
74484
|
] });
|
|
74264
74485
|
};
|
|
74265
|
-
var TaskBoardCard =
|
|
74486
|
+
var TaskBoardCard = import_react305.default.forwardRef(
|
|
74266
74487
|
({ card, column, lane, index, state, className, onClick, onContextMenu, onKeyDown, ...rest }, ref) => {
|
|
74267
74488
|
const ctx = useTaskBoard();
|
|
74268
74489
|
const { renderCard, onCardOpen, onCardContextMenu, cardSurface, size, color: color2 } = ctx;
|
|
@@ -74392,11 +74613,11 @@ var TaskBoardBucket = ({ column, lane, cards, className, label }) => {
|
|
|
74392
74613
|
};
|
|
74393
74614
|
|
|
74394
74615
|
// src/components/TaskBoard/usePresence.ts
|
|
74395
|
-
var
|
|
74616
|
+
var import_react306 = require("react");
|
|
74396
74617
|
var COLLAPSE_MS = 200;
|
|
74397
74618
|
function usePresence(open, ms = COLLAPSE_MS) {
|
|
74398
|
-
const [mounted, setMounted] = (0,
|
|
74399
|
-
(0,
|
|
74619
|
+
const [mounted, setMounted] = (0, import_react306.useState)(open);
|
|
74620
|
+
(0, import_react306.useEffect)(() => {
|
|
74400
74621
|
if (open) {
|
|
74401
74622
|
setMounted(true);
|
|
74402
74623
|
return;
|
|
@@ -74413,7 +74634,7 @@ function usePresence(open, ms = COLLAPSE_MS) {
|
|
|
74413
74634
|
}
|
|
74414
74635
|
|
|
74415
74636
|
// src/components/TaskBoard/TaskBoardColumnEdit.tsx
|
|
74416
|
-
var
|
|
74637
|
+
var import_react307 = require("react");
|
|
74417
74638
|
var import_react_dom17 = require("react-dom");
|
|
74418
74639
|
var import_classnames131 = __toESM(require("classnames"), 1);
|
|
74419
74640
|
var import_jsx_runtime331 = require("react/jsx-runtime");
|
|
@@ -74441,8 +74662,8 @@ var TaskBoardAddColumn = ({
|
|
|
74441
74662
|
variant
|
|
74442
74663
|
}) => {
|
|
74443
74664
|
const { text: text2, surface, color: color2, size, columnCornerClass } = useTaskBoard();
|
|
74444
|
-
const [editing, setEditing] = (0,
|
|
74445
|
-
const [title, setTitle] = (0,
|
|
74665
|
+
const [editing, setEditing] = (0, import_react307.useState)(false);
|
|
74666
|
+
const [title, setTitle] = (0, import_react307.useState)("");
|
|
74446
74667
|
const trigger = getSurfaceTriggerTokens(color2);
|
|
74447
74668
|
const close = () => {
|
|
74448
74669
|
setEditing(false);
|
|
@@ -74555,7 +74776,7 @@ var TaskBoardColumnClone = ({ drag, column, cards, count }) => {
|
|
|
74555
74776
|
};
|
|
74556
74777
|
|
|
74557
74778
|
// src/components/TaskBoard/TaskBoardColumnEditor.tsx
|
|
74558
|
-
var
|
|
74779
|
+
var import_react308 = require("react");
|
|
74559
74780
|
var import_classnames132 = __toESM(require("classnames"), 1);
|
|
74560
74781
|
var import_jsx_runtime332 = require("react/jsx-runtime");
|
|
74561
74782
|
var toDraft = (c) => ({
|
|
@@ -74579,9 +74800,9 @@ function fromDraft(column, d) {
|
|
|
74579
74800
|
var limitValid = (wip) => wip.trim() === "" || Number.isInteger(Number(wip)) && Number(wip) >= 1;
|
|
74580
74801
|
var TaskBoardColumnEditButton = ({ column }) => {
|
|
74581
74802
|
const { onEditColumn, allColumns, text: text2, surface, color: color2 } = useTaskBoard();
|
|
74582
|
-
const [open, setOpen] = (0,
|
|
74583
|
-
const [draft, setDraft] = (0,
|
|
74584
|
-
const id = (0,
|
|
74803
|
+
const [open, setOpen] = (0, import_react308.useState)(false);
|
|
74804
|
+
const [draft, setDraft] = (0, import_react308.useState)(() => toDraft(column));
|
|
74805
|
+
const id = (0, import_react308.useId)();
|
|
74585
74806
|
if (!onEditColumn) return null;
|
|
74586
74807
|
const trigger = getSurfaceTriggerTokens(color2);
|
|
74587
74808
|
const valid = draft.title.trim() !== "" && limitValid(draft.wip) && limitValid(draft.max);
|
|
@@ -75197,7 +75418,7 @@ var TaskBoardDragLayer = ({ drag, card }) => {
|
|
|
75197
75418
|
};
|
|
75198
75419
|
|
|
75199
75420
|
// src/components/TaskBoard/useTaskBoardDrag.ts
|
|
75200
|
-
var
|
|
75421
|
+
var import_react309 = require("react");
|
|
75201
75422
|
var DRAG_THRESHOLD_PX = 4;
|
|
75202
75423
|
var TOUCH_GRAB_DELAY_MS = 250;
|
|
75203
75424
|
var TOUCH_SLOP_PX = 8;
|
|
@@ -75212,18 +75433,18 @@ function bucketOf(el) {
|
|
|
75212
75433
|
return column === null ? null : { column, lane: lane || null, el: bucket };
|
|
75213
75434
|
}
|
|
75214
75435
|
function useTaskBoardDrag(opts) {
|
|
75215
|
-
const [drag, setDrag] = (0,
|
|
75216
|
-
const [pending, setPending] = (0,
|
|
75217
|
-
const optsRef = (0,
|
|
75436
|
+
const [drag, setDrag] = (0, import_react309.useState)(null);
|
|
75437
|
+
const [pending, setPending] = (0, import_react309.useState)(null);
|
|
75438
|
+
const optsRef = (0, import_react309.useRef)(opts);
|
|
75218
75439
|
optsRef.current = opts;
|
|
75219
|
-
const dragRef = (0,
|
|
75220
|
-
const pressRef = (0,
|
|
75221
|
-
const suppressClickRef = (0,
|
|
75222
|
-
const pointerRef = (0,
|
|
75223
|
-
const rafRef = (0,
|
|
75224
|
-
const cleanupRef = (0,
|
|
75225
|
-
const userSelectRef = (0,
|
|
75226
|
-
const setDragState = (0,
|
|
75440
|
+
const dragRef = (0, import_react309.useRef)(null);
|
|
75441
|
+
const pressRef = (0, import_react309.useRef)(null);
|
|
75442
|
+
const suppressClickRef = (0, import_react309.useRef)(false);
|
|
75443
|
+
const pointerRef = (0, import_react309.useRef)({ x: 0, y: 0 });
|
|
75444
|
+
const rafRef = (0, import_react309.useRef)(null);
|
|
75445
|
+
const cleanupRef = (0, import_react309.useRef)(null);
|
|
75446
|
+
const userSelectRef = (0, import_react309.useRef)(null);
|
|
75447
|
+
const setDragState = (0, import_react309.useCallback)((next) => {
|
|
75227
75448
|
dragRef.current = next;
|
|
75228
75449
|
setDrag(next);
|
|
75229
75450
|
}, []);
|
|
@@ -75231,7 +75452,7 @@ function useTaskBoardDrag(opts) {
|
|
|
75231
75452
|
const o = optsRef.current;
|
|
75232
75453
|
return { cards: o.cards, columns: o.columns, lanes: o.lanes, heldBy: o.heldBy, selfId: o.selfId, maxItems: o.maxItems };
|
|
75233
75454
|
};
|
|
75234
|
-
const resolveTarget = (0,
|
|
75455
|
+
const resolveTarget = (0, import_react309.useCallback)((x, y) => {
|
|
75235
75456
|
const d = dragRef.current;
|
|
75236
75457
|
if (!d) return;
|
|
75237
75458
|
const hit = bucketOf(document.elementFromPoint?.(x, y) ?? null);
|
|
@@ -75251,7 +75472,7 @@ function useTaskBoardDrag(opts) {
|
|
|
75251
75472
|
setDragState({ ...d, x, y, to, valid });
|
|
75252
75473
|
if (changed) optsRef.current.onDragTarget?.(d.cardId, valid ? to : null);
|
|
75253
75474
|
}, [setDragState]);
|
|
75254
|
-
const autoScroll = (0,
|
|
75475
|
+
const autoScroll = (0, import_react309.useCallback)(() => {
|
|
75255
75476
|
rafRef.current = null;
|
|
75256
75477
|
if (!dragRef.current) return;
|
|
75257
75478
|
const { x, y } = pointerRef.current;
|
|
@@ -75282,7 +75503,7 @@ function useTaskBoardDrag(opts) {
|
|
|
75282
75503
|
rafRef.current = requestAnimationFrame(autoScroll);
|
|
75283
75504
|
}
|
|
75284
75505
|
}, [resolveTarget]);
|
|
75285
|
-
const endGesture = (0,
|
|
75506
|
+
const endGesture = (0, import_react309.useCallback)(() => {
|
|
75286
75507
|
const p = pressRef.current;
|
|
75287
75508
|
if (p?.timer) clearTimeout(p.timer);
|
|
75288
75509
|
pressRef.current = null;
|
|
@@ -75295,7 +75516,7 @@ function useTaskBoardDrag(opts) {
|
|
|
75295
75516
|
userSelectRef.current = null;
|
|
75296
75517
|
}
|
|
75297
75518
|
}, []);
|
|
75298
|
-
const cancel = (0,
|
|
75519
|
+
const cancel = (0, import_react309.useCallback)(
|
|
75299
75520
|
(_reason) => {
|
|
75300
75521
|
const d = dragRef.current;
|
|
75301
75522
|
endGesture();
|
|
@@ -75306,7 +75527,7 @@ function useTaskBoardDrag(opts) {
|
|
|
75306
75527
|
},
|
|
75307
75528
|
[endGesture, setDragState]
|
|
75308
75529
|
);
|
|
75309
|
-
const finish = (0,
|
|
75530
|
+
const finish = (0, import_react309.useCallback)(async () => {
|
|
75310
75531
|
const d = dragRef.current;
|
|
75311
75532
|
endGesture();
|
|
75312
75533
|
if (!d) return false;
|
|
@@ -75340,7 +75561,7 @@ function useTaskBoardDrag(opts) {
|
|
|
75340
75561
|
optsRef.current.onDragEnd?.(d.cardId, ok);
|
|
75341
75562
|
return ok;
|
|
75342
75563
|
}, [endGesture, setDragState]);
|
|
75343
|
-
const keyboardGrab = (0,
|
|
75564
|
+
const keyboardGrab = (0, import_react309.useCallback)(
|
|
75344
75565
|
(card, from) => {
|
|
75345
75566
|
const o = optsRef.current;
|
|
75346
75567
|
if (!o.editable || card.locked || dragRef.current) return false;
|
|
@@ -75353,7 +75574,7 @@ function useTaskBoardDrag(opts) {
|
|
|
75353
75574
|
},
|
|
75354
75575
|
[setDragState]
|
|
75355
75576
|
);
|
|
75356
|
-
const keyboardMove = (0,
|
|
75577
|
+
const keyboardMove = (0, import_react309.useCallback)(
|
|
75357
75578
|
(to) => {
|
|
75358
75579
|
const d = dragRef.current;
|
|
75359
75580
|
if (!d) return;
|
|
@@ -75362,7 +75583,7 @@ function useTaskBoardDrag(opts) {
|
|
|
75362
75583
|
},
|
|
75363
75584
|
[setDragState]
|
|
75364
75585
|
);
|
|
75365
|
-
const lift = (0,
|
|
75586
|
+
const lift = (0, import_react309.useCallback)(
|
|
75366
75587
|
(p, x, y) => {
|
|
75367
75588
|
if (userSelectRef.current === null) {
|
|
75368
75589
|
userSelectRef.current = document.body.style.userSelect;
|
|
@@ -75384,7 +75605,7 @@ function useTaskBoardDrag(opts) {
|
|
|
75384
75605
|
},
|
|
75385
75606
|
[resolveTarget, setDragState]
|
|
75386
75607
|
);
|
|
75387
|
-
const onWindowMove = (0,
|
|
75608
|
+
const onWindowMove = (0, import_react309.useCallback)(
|
|
75388
75609
|
(e) => {
|
|
75389
75610
|
const p = pressRef.current;
|
|
75390
75611
|
if (!p) return;
|
|
@@ -75411,7 +75632,7 @@ function useTaskBoardDrag(opts) {
|
|
|
75411
75632
|
},
|
|
75412
75633
|
[autoScroll, endGesture, lift, resolveTarget]
|
|
75413
75634
|
);
|
|
75414
|
-
const startPress = (0,
|
|
75635
|
+
const startPress = (0, import_react309.useCallback)(
|
|
75415
75636
|
(card, from, e) => {
|
|
75416
75637
|
const o = optsRef.current;
|
|
75417
75638
|
if (!o.editable || e.button !== 0 || card.locked) return;
|
|
@@ -75468,18 +75689,18 @@ function useTaskBoardDrag(opts) {
|
|
|
75468
75689
|
},
|
|
75469
75690
|
[cancel, endGesture, finish, onWindowMove]
|
|
75470
75691
|
);
|
|
75471
|
-
(0,
|
|
75692
|
+
(0, import_react309.useEffect)(() => {
|
|
75472
75693
|
const d = dragRef.current;
|
|
75473
75694
|
if (d && !opts.cards.some((c) => c.id === d.cardId)) cancel("removed");
|
|
75474
75695
|
}, [opts.cards, cancel]);
|
|
75475
|
-
(0,
|
|
75476
|
-
const previewCards = (0,
|
|
75696
|
+
(0, import_react309.useEffect)(() => () => endGesture(), [endGesture]);
|
|
75697
|
+
const previewCards = (0, import_react309.useMemo)(() => {
|
|
75477
75698
|
const { cards, columns, lanes } = opts;
|
|
75478
75699
|
if (pending) return applyMove(cards, pending, columns, lanes);
|
|
75479
75700
|
if (drag?.to && drag.valid) return applyMove(cards, { cardId: drag.cardId, from: drag.from, to: drag.to }, columns, lanes);
|
|
75480
75701
|
return cards;
|
|
75481
75702
|
}, [opts.cards, opts.columns, opts.lanes, drag, pending]);
|
|
75482
|
-
const cardHandlers = (0,
|
|
75703
|
+
const cardHandlers = (0, import_react309.useCallback)(
|
|
75483
75704
|
(card, from) => ({
|
|
75484
75705
|
onPointerDown: (e) => startPress(card, from, e),
|
|
75485
75706
|
onClickCapture: (e) => {
|
|
@@ -75496,31 +75717,31 @@ function useTaskBoardDrag(opts) {
|
|
|
75496
75717
|
}
|
|
75497
75718
|
|
|
75498
75719
|
// src/components/TaskBoard/useTaskBoardKeyboard.ts
|
|
75499
|
-
var
|
|
75720
|
+
var import_react310 = require("react");
|
|
75500
75721
|
var isRtl = (el) => el?.closest("[dir]")?.getAttribute("dir") === "rtl";
|
|
75501
75722
|
function useTaskBoardKeyboard(o) {
|
|
75502
75723
|
const { rootRef, cards, viewCards, columns, lanes, text: text2, drag } = o;
|
|
75503
|
-
const [message, setMessage] = (0,
|
|
75504
|
-
const [activeId, setActiveId] = (0,
|
|
75505
|
-
const [ownSelection, setOwnSelection] = (0,
|
|
75724
|
+
const [message, setMessage] = (0, import_react310.useState)("");
|
|
75725
|
+
const [activeId, setActiveId] = (0, import_react310.useState)(null);
|
|
75726
|
+
const [ownSelection, setOwnSelection] = (0, import_react310.useState)([]);
|
|
75506
75727
|
const selection = o.selectedIds ?? ownSelection;
|
|
75507
|
-
const anchorRef = (0,
|
|
75508
|
-
const refocusRef = (0,
|
|
75509
|
-
const viewBuckets = (0,
|
|
75510
|
-
const firstId = (0,
|
|
75728
|
+
const anchorRef = (0, import_react310.useRef)(null);
|
|
75729
|
+
const refocusRef = (0, import_react310.useRef)(null);
|
|
75730
|
+
const viewBuckets = (0, import_react310.useMemo)(() => bucketCards(viewCards, columns, lanes), [viewCards, columns, lanes]);
|
|
75731
|
+
const firstId = (0, import_react310.useMemo)(() => {
|
|
75511
75732
|
for (const cards2 of viewBuckets.values()) if (cards2.length) return cards2[0].id;
|
|
75512
75733
|
return null;
|
|
75513
75734
|
}, [viewBuckets]);
|
|
75514
75735
|
const tabStop = activeId && viewCards.some((c) => c.id === activeId) ? activeId : firstId;
|
|
75515
|
-
(0,
|
|
75736
|
+
(0, import_react310.useLayoutEffect)(() => {
|
|
75516
75737
|
const id = refocusRef.current;
|
|
75517
75738
|
if (!id) return;
|
|
75518
75739
|
refocusRef.current = null;
|
|
75519
75740
|
rootRef.current?.querySelector(`[data-card-id="${CSS.escape(id)}"]`)?.focus();
|
|
75520
75741
|
});
|
|
75521
|
-
const announce = (0,
|
|
75522
|
-
const columnTitle = (0,
|
|
75523
|
-
const announceSlot = (0,
|
|
75742
|
+
const announce = (0, import_react310.useCallback)((s) => setMessage(s), []);
|
|
75743
|
+
const columnTitle = (0, import_react310.useCallback)((id) => columns.find((c) => c.id === id)?.title ?? id, [columns]);
|
|
75744
|
+
const announceSlot = (0, import_react310.useCallback)(
|
|
75524
75745
|
(cardId, to) => {
|
|
75525
75746
|
const others = bucketCards(cards.filter((c) => c.id !== cardId), columns, lanes);
|
|
75526
75747
|
const total = (others.get(bucketKey(to.column, to.lane))?.length ?? 0) + 1;
|
|
@@ -75530,14 +75751,14 @@ function useTaskBoardKeyboard(o) {
|
|
|
75530
75751
|
},
|
|
75531
75752
|
[announce, cards, columns, lanes, columnTitle, text2]
|
|
75532
75753
|
);
|
|
75533
|
-
const setSelection = (0,
|
|
75754
|
+
const setSelection = (0, import_react310.useCallback)(
|
|
75534
75755
|
(ids) => {
|
|
75535
75756
|
if (o.selectedIds === void 0) setOwnSelection(ids);
|
|
75536
75757
|
o.onSelectionChange?.(ids);
|
|
75537
75758
|
},
|
|
75538
75759
|
[o]
|
|
75539
75760
|
);
|
|
75540
|
-
const focusStep = (0,
|
|
75761
|
+
const focusStep = (0, import_react310.useCallback)(
|
|
75541
75762
|
(from, dir) => {
|
|
75542
75763
|
const root = rootRef.current;
|
|
75543
75764
|
const bucket = from.closest("[data-bucket]");
|
|
@@ -75580,7 +75801,7 @@ function useTaskBoardKeyboard(o) {
|
|
|
75580
75801
|
return null;
|
|
75581
75802
|
}
|
|
75582
75803
|
};
|
|
75583
|
-
const cardProps = (0,
|
|
75804
|
+
const cardProps = (0, import_react310.useCallback)(
|
|
75584
75805
|
(card, slot) => ({
|
|
75585
75806
|
tabIndex: card.id === tabStop ? 0 : -1,
|
|
75586
75807
|
onFocus: () => setActiveId(card.id),
|
|
@@ -75683,22 +75904,22 @@ function useTaskBoardKeyboard(o) {
|
|
|
75683
75904
|
}
|
|
75684
75905
|
|
|
75685
75906
|
// src/components/TaskBoard/useTaskBoardColumnDrag.ts
|
|
75686
|
-
var
|
|
75907
|
+
var import_react311 = require("react");
|
|
75687
75908
|
var DRAG_THRESHOLD_PX2 = 4;
|
|
75688
75909
|
var isRtl2 = (el) => el?.closest("[dir]")?.getAttribute("dir") === "rtl";
|
|
75689
75910
|
function useTaskBoardColumnDrag(opts) {
|
|
75690
|
-
const [drag, setDrag] = (0,
|
|
75691
|
-
const optsRef = (0,
|
|
75911
|
+
const [drag, setDrag] = (0, import_react311.useState)(null);
|
|
75912
|
+
const optsRef = (0, import_react311.useRef)(opts);
|
|
75692
75913
|
optsRef.current = opts;
|
|
75693
|
-
const dragRef = (0,
|
|
75694
|
-
const cleanupRef = (0,
|
|
75695
|
-
const userSelectRef = (0,
|
|
75696
|
-
const refocusRef = (0,
|
|
75697
|
-
const set = (0,
|
|
75914
|
+
const dragRef = (0, import_react311.useRef)(null);
|
|
75915
|
+
const cleanupRef = (0, import_react311.useRef)(null);
|
|
75916
|
+
const userSelectRef = (0, import_react311.useRef)(null);
|
|
75917
|
+
const refocusRef = (0, import_react311.useRef)(null);
|
|
75918
|
+
const set = (0, import_react311.useCallback)((next) => {
|
|
75698
75919
|
dragRef.current = next;
|
|
75699
75920
|
setDrag(next);
|
|
75700
75921
|
}, []);
|
|
75701
|
-
const end = (0,
|
|
75922
|
+
const end = (0, import_react311.useCallback)(() => {
|
|
75702
75923
|
cleanupRef.current?.();
|
|
75703
75924
|
cleanupRef.current = null;
|
|
75704
75925
|
if (userSelectRef.current !== null) {
|
|
@@ -75706,11 +75927,11 @@ function useTaskBoardColumnDrag(opts) {
|
|
|
75706
75927
|
userSelectRef.current = null;
|
|
75707
75928
|
}
|
|
75708
75929
|
}, []);
|
|
75709
|
-
const cancel = (0,
|
|
75930
|
+
const cancel = (0, import_react311.useCallback)(() => {
|
|
75710
75931
|
end();
|
|
75711
75932
|
set(null);
|
|
75712
75933
|
}, [end, set]);
|
|
75713
|
-
const commit = (0,
|
|
75934
|
+
const commit = (0, import_react311.useCallback)(() => {
|
|
75714
75935
|
const d = dragRef.current;
|
|
75715
75936
|
end();
|
|
75716
75937
|
set(null);
|
|
@@ -75718,14 +75939,14 @@ function useTaskBoardColumnDrag(opts) {
|
|
|
75718
75939
|
optsRef.current.onCommit(moveColumn(optsRef.current.columns, d.id, d.to));
|
|
75719
75940
|
return true;
|
|
75720
75941
|
}, [end, set]);
|
|
75721
|
-
(0,
|
|
75942
|
+
(0, import_react311.useLayoutEffect)(() => {
|
|
75722
75943
|
const id = refocusRef.current;
|
|
75723
75944
|
if (!id) return;
|
|
75724
75945
|
refocusRef.current = null;
|
|
75725
75946
|
opts.rootRef.current?.querySelector(`[data-column-grip="${CSS.escape(id)}"]`)?.focus();
|
|
75726
75947
|
});
|
|
75727
|
-
(0,
|
|
75728
|
-
const startPointer = (0,
|
|
75948
|
+
(0, import_react311.useEffect)(() => () => end(), [end]);
|
|
75949
|
+
const startPointer = (0, import_react311.useCallback)(
|
|
75729
75950
|
(column, from, e) => {
|
|
75730
75951
|
if (!optsRef.current.enabled || e.button !== 0) return;
|
|
75731
75952
|
e.preventDefault();
|
|
@@ -75779,7 +76000,7 @@ function useTaskBoardColumnDrag(opts) {
|
|
|
75779
76000
|
},
|
|
75780
76001
|
[cancel, commit, end, set]
|
|
75781
76002
|
);
|
|
75782
|
-
const onGripKey = (0,
|
|
76003
|
+
const onGripKey = (0, import_react311.useCallback)(
|
|
75783
76004
|
(column, from, e) => {
|
|
75784
76005
|
const o = optsRef.current;
|
|
75785
76006
|
if (!o.enabled) return;
|
|
@@ -75815,11 +76036,11 @@ function useTaskBoardColumnDrag(opts) {
|
|
|
75815
76036
|
},
|
|
75816
76037
|
[cancel, commit, set]
|
|
75817
76038
|
);
|
|
75818
|
-
const previewColumns = (0,
|
|
76039
|
+
const previewColumns = (0, import_react311.useMemo)(
|
|
75819
76040
|
() => drag && drag.to !== drag.from ? moveColumn(opts.columns, drag.id, drag.to) : opts.columns,
|
|
75820
76041
|
[drag, opts.columns]
|
|
75821
76042
|
);
|
|
75822
|
-
const gripProps = (0,
|
|
76043
|
+
const gripProps = (0, import_react311.useCallback)(
|
|
75823
76044
|
(column, index) => ({
|
|
75824
76045
|
"data-column-grip": column.id,
|
|
75825
76046
|
"aria-label": opts.text("moveColumn", { name: column.title }),
|
|
@@ -75832,11 +76053,11 @@ function useTaskBoardColumnDrag(opts) {
|
|
|
75832
76053
|
}
|
|
75833
76054
|
|
|
75834
76055
|
// src/components/TaskBoard/useFlip.ts
|
|
75835
|
-
var
|
|
76056
|
+
var import_react312 = require("react");
|
|
75836
76057
|
function useFlip(rootRef, orderKey) {
|
|
75837
|
-
const positions = (0,
|
|
75838
|
-
const lastKey = (0,
|
|
75839
|
-
(0,
|
|
76058
|
+
const positions = (0, import_react312.useRef)(/* @__PURE__ */ new Map());
|
|
76059
|
+
const lastKey = (0, import_react312.useRef)(orderKey);
|
|
76060
|
+
(0, import_react312.useLayoutEffect)(() => {
|
|
75840
76061
|
const root = rootRef.current;
|
|
75841
76062
|
if (!root) return;
|
|
75842
76063
|
const reorder = lastKey.current !== orderKey;
|
|
@@ -75864,21 +76085,21 @@ function useFlip(rootRef, orderKey) {
|
|
|
75864
76085
|
}
|
|
75865
76086
|
|
|
75866
76087
|
// src/components/TaskBoard/useTaskBoardCollab.ts
|
|
75867
|
-
var
|
|
76088
|
+
var import_react313 = require("react");
|
|
75868
76089
|
var EXPIRE_TICK_MS = 1e3;
|
|
75869
76090
|
function useTaskBoardCollab(transport, currentUser) {
|
|
75870
|
-
const [presence, setPresence] = (0,
|
|
76091
|
+
const [presence, setPresence] = (0, import_react313.useState)(emptyPresence);
|
|
75871
76092
|
const active = Boolean(transport && currentUser);
|
|
75872
|
-
const mountedRef = (0,
|
|
75873
|
-
const userRef = (0,
|
|
76093
|
+
const mountedRef = (0, import_react313.useRef)(false);
|
|
76094
|
+
const userRef = (0, import_react313.useRef)(currentUser);
|
|
75874
76095
|
userRef.current = currentUser;
|
|
75875
|
-
const hoverRef = (0,
|
|
75876
|
-
const apply = (0,
|
|
76096
|
+
const hoverRef = (0, import_react313.useRef)({ last: 0, timer: null });
|
|
76097
|
+
const apply = (0, import_react313.useCallback)((event) => {
|
|
75877
76098
|
if (!mountedRef.current) return;
|
|
75878
76099
|
const now2 = Date.now();
|
|
75879
76100
|
setPresence((s) => presenceReducer(s, event, now2));
|
|
75880
76101
|
}, []);
|
|
75881
|
-
const send = (0,
|
|
76102
|
+
const send = (0, import_react313.useCallback)(
|
|
75882
76103
|
(event) => {
|
|
75883
76104
|
if (!transport) return;
|
|
75884
76105
|
safePublish(transport, event);
|
|
@@ -75887,7 +76108,7 @@ function useTaskBoardCollab(transport, currentUser) {
|
|
|
75887
76108
|
[transport, apply]
|
|
75888
76109
|
);
|
|
75889
76110
|
const userId = currentUser?.id;
|
|
75890
|
-
(0,
|
|
76111
|
+
(0, import_react313.useEffect)(() => {
|
|
75891
76112
|
if (!transport || !userId) return;
|
|
75892
76113
|
mountedRef.current = true;
|
|
75893
76114
|
const hello = () => {
|
|
@@ -75927,13 +76148,13 @@ function useTaskBoardCollab(transport, currentUser) {
|
|
|
75927
76148
|
setPresence(emptyPresence());
|
|
75928
76149
|
};
|
|
75929
76150
|
}, [transport, userId, apply, send]);
|
|
75930
|
-
const grab = (0,
|
|
76151
|
+
const grab = (0, import_react313.useCallback)(
|
|
75931
76152
|
(cardId) => {
|
|
75932
76153
|
if (userId) send({ type: "grab", userId, cardId, at: Date.now() });
|
|
75933
76154
|
},
|
|
75934
76155
|
[send, userId]
|
|
75935
76156
|
);
|
|
75936
|
-
const hover = (0,
|
|
76157
|
+
const hover = (0, import_react313.useCallback)(
|
|
75937
76158
|
(cardId, slot) => {
|
|
75938
76159
|
if (!userId) return;
|
|
75939
76160
|
const h = hoverRef.current;
|
|
@@ -75949,7 +76170,7 @@ function useTaskBoardCollab(transport, currentUser) {
|
|
|
75949
76170
|
},
|
|
75950
76171
|
[send, userId]
|
|
75951
76172
|
);
|
|
75952
|
-
const release = (0,
|
|
76173
|
+
const release = (0, import_react313.useCallback)(
|
|
75953
76174
|
(cardId, dropped) => {
|
|
75954
76175
|
if (!userId) return;
|
|
75955
76176
|
const h = hoverRef.current;
|
|
@@ -75959,16 +76180,16 @@ function useTaskBoardCollab(transport, currentUser) {
|
|
|
75959
76180
|
},
|
|
75960
76181
|
[send, userId]
|
|
75961
76182
|
);
|
|
75962
|
-
const peers = (0,
|
|
76183
|
+
const peers = (0, import_react313.useMemo)(
|
|
75963
76184
|
() => [...presence.peers.values()].map((p) => p.user).filter((u2) => u2.id !== userId),
|
|
75964
76185
|
[presence.peers, userId]
|
|
75965
76186
|
);
|
|
75966
|
-
const heldBy = (0,
|
|
76187
|
+
const heldBy = (0, import_react313.useMemo)(() => {
|
|
75967
76188
|
const m = /* @__PURE__ */ new Map();
|
|
75968
76189
|
for (const [cardId, h] of presence.holds) m.set(cardId, h.userId);
|
|
75969
76190
|
return m;
|
|
75970
76191
|
}, [presence.holds]);
|
|
75971
|
-
const userById = (0,
|
|
76192
|
+
const userById = (0, import_react313.useCallback)(
|
|
75972
76193
|
(id) => presence.peers.get(id)?.user ?? { id, name: id },
|
|
75973
76194
|
[presence.peers]
|
|
75974
76195
|
);
|
|
@@ -75984,15 +76205,15 @@ function safePublish(transport, event) {
|
|
|
75984
76205
|
}
|
|
75985
76206
|
|
|
75986
76207
|
// src/components/TaskBoard/TaskBoardRemoteGhosts.tsx
|
|
75987
|
-
var
|
|
76208
|
+
var import_react314 = require("react");
|
|
75988
76209
|
var import_react_dom19 = require("react-dom");
|
|
75989
76210
|
var import_classnames137 = __toESM(require("classnames"), 1);
|
|
75990
76211
|
var import_jsx_runtime337 = require("react/jsx-runtime");
|
|
75991
76212
|
var GHOST_HEIGHT = 40;
|
|
75992
76213
|
var TaskBoardRemoteGhosts = ({ rootRef, holds, selfId, cards, userById }) => {
|
|
75993
|
-
const [ghosts, setGhosts] = (0,
|
|
75994
|
-
const [tick, setTick] = (0,
|
|
75995
|
-
(0,
|
|
76214
|
+
const [ghosts, setGhosts] = (0, import_react314.useState)([]);
|
|
76215
|
+
const [tick, setTick] = (0, import_react314.useState)(0);
|
|
76216
|
+
(0, import_react314.useLayoutEffect)(() => {
|
|
75996
76217
|
const root = rootRef.current;
|
|
75997
76218
|
if (!root) return;
|
|
75998
76219
|
const bump = () => setTick((t) => t + 1);
|
|
@@ -76003,7 +76224,7 @@ var TaskBoardRemoteGhosts = ({ rootRef, holds, selfId, cards, userById }) => {
|
|
|
76003
76224
|
window.removeEventListener("resize", bump);
|
|
76004
76225
|
};
|
|
76005
76226
|
}, [rootRef]);
|
|
76006
|
-
(0,
|
|
76227
|
+
(0, import_react314.useLayoutEffect)(() => {
|
|
76007
76228
|
const root = rootRef.current;
|
|
76008
76229
|
if (!root) return;
|
|
76009
76230
|
const next = [];
|
|
@@ -76084,7 +76305,7 @@ var TaskBoardSkeleton = ({ columns, columnWidth, wellSurface, cornerClass }) =>
|
|
|
76084
76305
|
)) });
|
|
76085
76306
|
|
|
76086
76307
|
// src/components/TaskBoard/labels.ts
|
|
76087
|
-
var
|
|
76308
|
+
var import_react315 = require("react");
|
|
76088
76309
|
var KEYS = {
|
|
76089
76310
|
root: "kit.taskboard.root",
|
|
76090
76311
|
loading: "kit.taskboard.loading",
|
|
@@ -76130,7 +76351,7 @@ var KEYS = {
|
|
|
76130
76351
|
var interpolate = (s, values) => values ? s.replace(/\{(\w+)\}/g, (m, k) => k in values ? String(values[k]) : m) : s;
|
|
76131
76352
|
function useTaskBoardText(labels) {
|
|
76132
76353
|
const t = useKitT();
|
|
76133
|
-
return (0,
|
|
76354
|
+
return (0, import_react315.useCallback)(
|
|
76134
76355
|
(key, values) => {
|
|
76135
76356
|
const own = labels?.[key];
|
|
76136
76357
|
return own !== void 0 ? interpolate(own, values) : t(KEYS[key], values);
|
|
@@ -76196,7 +76417,7 @@ var TaskBoardBody = (props) => {
|
|
|
76196
76417
|
const resolvedColumnWidth = normalizedColumnWidth === "auto" || normalizedColumnWidth === "" || typeof normalizedColumnWidth === "number" && (!Number.isFinite(normalizedColumnWidth) || normalizedColumnWidth <= 0) ? sizeTokens12.columnWidth : normalizedColumnWidth;
|
|
76197
76418
|
const wellSurface = surface.translucent ? GLASS_WELL : SOLID_WELL;
|
|
76198
76419
|
const columnCornerClass = getSurfaceCornerClass(columnCorner);
|
|
76199
|
-
const rootRef = (0,
|
|
76420
|
+
const rootRef = (0, import_react316.useRef)(null);
|
|
76200
76421
|
const isEditable = editable ?? Boolean(onCardsChange);
|
|
76201
76422
|
const laneView = layout === "lanes" && Boolean(lanes?.length);
|
|
76202
76423
|
const viewLanes = laneView ? lanes : void 0;
|
|
@@ -76217,8 +76438,8 @@ var TaskBoardBody = (props) => {
|
|
|
76217
76438
|
onDragTarget: (cardId, slot) => slot && collab.hover(cardId, slot),
|
|
76218
76439
|
onDragEnd: collab.release
|
|
76219
76440
|
});
|
|
76220
|
-
const [notice, setNotice] = (0,
|
|
76221
|
-
(0,
|
|
76441
|
+
const [notice, setNotice] = (0, import_react316.useState)(null);
|
|
76442
|
+
(0, import_react316.useEffect)(() => {
|
|
76222
76443
|
if (!drag || !selfId) return;
|
|
76223
76444
|
const holder = collab.heldBy.get(drag.cardId);
|
|
76224
76445
|
if (!holder || holder === selfId) return;
|
|
@@ -76226,7 +76447,7 @@ var TaskBoardBody = (props) => {
|
|
|
76226
76447
|
cancel("held");
|
|
76227
76448
|
setNotice({ cardId: drag.cardId, text: text2("heldShort", { name: peer.name }), color: peer.color ?? peerColor(peer.id) });
|
|
76228
76449
|
}, [collab, drag, selfId, cancel, text2]);
|
|
76229
|
-
(0,
|
|
76450
|
+
(0, import_react316.useEffect)(() => {
|
|
76230
76451
|
if (!notice) return;
|
|
76231
76452
|
const t = setTimeout(() => setNotice(null), NOTICE_MS);
|
|
76232
76453
|
return () => clearTimeout(t);
|
|
@@ -76250,7 +76471,7 @@ var TaskBoardBody = (props) => {
|
|
|
76250
76471
|
selectedIds,
|
|
76251
76472
|
onSelectionChange
|
|
76252
76473
|
});
|
|
76253
|
-
const selected = (0,
|
|
76474
|
+
const selected = (0, import_react316.useMemo)(() => new Set(keyboard.selection), [keyboard.selection]);
|
|
76254
76475
|
const columnEditing = Boolean(editMode && onColumnsChange);
|
|
76255
76476
|
const columnDrag = useTaskBoardColumnDrag({
|
|
76256
76477
|
rootRef,
|
|
@@ -76262,20 +76483,20 @@ var TaskBoardBody = (props) => {
|
|
|
76262
76483
|
});
|
|
76263
76484
|
const viewColumns = columnDrag.previewColumns;
|
|
76264
76485
|
useFlip(rootRef, viewColumns.map((c) => c.id).join("|"));
|
|
76265
|
-
const editColumn = (0,
|
|
76486
|
+
const editColumn = (0, import_react316.useCallback)(
|
|
76266
76487
|
(next) => onColumnsChange?.(columns.map((c) => c.id === next.id ? next : c)),
|
|
76267
76488
|
[columns, onColumnsChange]
|
|
76268
76489
|
);
|
|
76269
76490
|
const addColumn = (title2) => onColumnsChange?.([...columns, { id: uniqueColumnId(title2, columns), title: title2 }]);
|
|
76270
76491
|
const keyboardProps = keyboard.cardProps;
|
|
76271
|
-
const heldPeer = (0,
|
|
76492
|
+
const heldPeer = (0, import_react316.useCallback)(
|
|
76272
76493
|
(cardId) => {
|
|
76273
76494
|
const holder = collab.heldBy.get(cardId);
|
|
76274
76495
|
return holder && holder !== selfId ? collab.userById(holder) : void 0;
|
|
76275
76496
|
},
|
|
76276
76497
|
[collab, selfId]
|
|
76277
76498
|
);
|
|
76278
|
-
const ctx = (0,
|
|
76499
|
+
const ctx = (0, import_react316.useMemo)(
|
|
76279
76500
|
() => ({
|
|
76280
76501
|
text: text2,
|
|
76281
76502
|
surface,
|
|
@@ -76313,7 +76534,7 @@ var TaskBoardBody = (props) => {
|
|
|
76313
76534
|
}),
|
|
76314
76535
|
[text2, surface, color2, sizeTokens12, resolvedColumnWidth, cardLayout, priorities, locale, isEditable, renderCard, onCardOpen, onCardContextMenu, onAddCard, wellSurface, columnCornerClass, columnEditing, columnDrag.gripProps, columnDrag.drag, editColumn, columns, maxItems, selected, drag, pending, cardHandlers, keyboardProps, heldPeer, notice]
|
|
76315
76536
|
);
|
|
76316
|
-
const buckets = (0,
|
|
76537
|
+
const buckets = (0, import_react316.useMemo)(() => bucketCards(previewCards, columns, viewLanes), [previewCards, columns, viewLanes]);
|
|
76317
76538
|
const draggedCard = drag ? cards.find((c) => c.id === drag.cardId) : void 0;
|
|
76318
76539
|
const toggleColumn = onColumnsChange ? (id) => onColumnsChange(columns.map((c) => c.id === id ? { ...c, collapsed: !c.collapsed } : c)) : void 0;
|
|
76319
76540
|
const toggleLane = onLanesChange && lanes ? (id) => onLanesChange(lanes.map((l) => l.id === id ? { ...l, collapsed: !l.collapsed } : l)) : void 0;
|
|
@@ -76465,7 +76686,7 @@ var TaskBoard = (props) => {
|
|
|
76465
76686
|
};
|
|
76466
76687
|
|
|
76467
76688
|
// src/components/GradientBackdrop/GradientBackdrop.tsx
|
|
76468
|
-
var
|
|
76689
|
+
var import_react317 = __toESM(require("react"), 1);
|
|
76469
76690
|
var import_classnames140 = __toESM(require("classnames"), 1);
|
|
76470
76691
|
|
|
76471
76692
|
// ../common/backdrop/color.ts
|
|
@@ -76601,10 +76822,10 @@ function gradientBackdropCss(colors3, s) {
|
|
|
76601
76822
|
// src/components/GradientBackdrop/GradientBackdrop.tsx
|
|
76602
76823
|
var import_jsx_runtime340 = require("react/jsx-runtime");
|
|
76603
76824
|
var GRADIENT_BACKDROP_SCHEMES = ["auto", "light", "dark"];
|
|
76604
|
-
var GradientBackdrop =
|
|
76825
|
+
var GradientBackdrop = import_react317.default.forwardRef(
|
|
76605
76826
|
({ theme = "slate", scheme = "auto", noise = false, noiseScale, className, style, children, ...rest }, ref) => {
|
|
76606
76827
|
const themeKey = typeof theme === "string" ? theme : JSON.stringify(theme);
|
|
76607
|
-
const resolved = (0,
|
|
76828
|
+
const resolved = (0, import_react317.useMemo)(() => {
|
|
76608
76829
|
const t = resolveGradientBackdropTheme(theme);
|
|
76609
76830
|
return { light: gradientBackdropCss(t.light, t.shape), dark: gradientBackdropCss(t.dark, t.shape) };
|
|
76610
76831
|
}, [themeKey]);
|
|
@@ -76653,10 +76874,10 @@ GradientBackdrop.displayName = "GradientBackdrop";
|
|
|
76653
76874
|
|
|
76654
76875
|
// src/components/Terminal/Terminal.tsx
|
|
76655
76876
|
var import_classnames141 = __toESM(require("classnames"), 1);
|
|
76656
|
-
var
|
|
76877
|
+
var import_react319 = require("react");
|
|
76657
76878
|
|
|
76658
76879
|
// src/components/Terminal/TerminalViewport.tsx
|
|
76659
|
-
var
|
|
76880
|
+
var import_react318 = require("react");
|
|
76660
76881
|
|
|
76661
76882
|
// src/components/Terminal/engine.ts
|
|
76662
76883
|
async function loadTerminalEngine() {
|
|
@@ -76715,28 +76936,28 @@ var TERMINAL_DARK_THEME = {
|
|
|
76715
76936
|
|
|
76716
76937
|
// src/components/Terminal/TerminalViewport.tsx
|
|
76717
76938
|
var import_jsx_runtime341 = require("react/jsx-runtime");
|
|
76718
|
-
var TerminalViewport = (0,
|
|
76719
|
-
const host = (0,
|
|
76720
|
-
const engine = (0,
|
|
76721
|
-
const fitAddon = (0,
|
|
76722
|
-
const [scroll, setScroll] = (0,
|
|
76939
|
+
var TerminalViewport = (0, import_react318.forwardRef)(function TerminalViewport2(props, ref) {
|
|
76940
|
+
const host = (0, import_react318.useRef)(null);
|
|
76941
|
+
const engine = (0, import_react318.useRef)(null);
|
|
76942
|
+
const fitAddon = (0, import_react318.useRef)(null);
|
|
76943
|
+
const [scroll, setScroll] = (0, import_react318.useState)({
|
|
76723
76944
|
contentSize: 0,
|
|
76724
76945
|
viewportSize: 0,
|
|
76725
76946
|
offset: 0
|
|
76726
76947
|
});
|
|
76727
|
-
const scrollTo = (0,
|
|
76948
|
+
const scrollTo = (0, import_react318.useCallback)(
|
|
76728
76949
|
(offset) => engine.current?.scrollToLine(Math.round(offset)),
|
|
76729
76950
|
[]
|
|
76730
76951
|
);
|
|
76731
|
-
const virtualScroll = (0,
|
|
76952
|
+
const virtualScroll = (0, import_react318.useMemo)(
|
|
76732
76953
|
() => ({ ...scroll, onScroll: scrollTo }),
|
|
76733
76954
|
[scroll, scrollTo]
|
|
76734
76955
|
);
|
|
76735
|
-
const latest = (0,
|
|
76956
|
+
const latest = (0, import_react318.useRef)(props);
|
|
76736
76957
|
latest.current = props;
|
|
76737
|
-
const initialData = (0,
|
|
76738
|
-
const pending = (0,
|
|
76739
|
-
const handle = (0,
|
|
76958
|
+
const initialData = (0, import_react318.useRef)(props.initialData);
|
|
76959
|
+
const pending = (0, import_react318.useRef)([]);
|
|
76960
|
+
const handle = (0, import_react318.useMemo)(
|
|
76740
76961
|
() => ({
|
|
76741
76962
|
write(data) {
|
|
76742
76963
|
if (engine.current) engine.current.write(data);
|
|
@@ -76764,7 +76985,7 @@ var TerminalViewport = (0, import_react317.forwardRef)(function TerminalViewport
|
|
|
76764
76985
|
}),
|
|
76765
76986
|
[]
|
|
76766
76987
|
);
|
|
76767
|
-
(0,
|
|
76988
|
+
(0, import_react318.useImperativeHandle)(ref, () => handle, [handle]);
|
|
76768
76989
|
const applyOptions = () => {
|
|
76769
76990
|
const term = engine.current;
|
|
76770
76991
|
if (!term) return;
|
|
@@ -76784,9 +77005,9 @@ var TerminalViewport = (0, import_react317.forwardRef)(function TerminalViewport
|
|
|
76784
77005
|
}
|
|
76785
77006
|
};
|
|
76786
77007
|
};
|
|
76787
|
-
const updateOptions = (0,
|
|
77008
|
+
const updateOptions = (0, import_react318.useRef)(applyOptions);
|
|
76788
77009
|
updateOptions.current = applyOptions;
|
|
76789
|
-
(0,
|
|
77010
|
+
(0, import_react318.useEffect)(() => {
|
|
76790
77011
|
let cancelled = false;
|
|
76791
77012
|
let initialized = false;
|
|
76792
77013
|
let instance;
|
|
@@ -76877,7 +77098,7 @@ var TerminalViewport = (0, import_react317.forwardRef)(function TerminalViewport
|
|
|
76877
77098
|
fitAddon.current = null;
|
|
76878
77099
|
};
|
|
76879
77100
|
}, [handle]);
|
|
76880
|
-
(0,
|
|
77101
|
+
(0, import_react318.useEffect)(() => {
|
|
76881
77102
|
updateOptions.current();
|
|
76882
77103
|
if (props.active !== false) handle.fit();
|
|
76883
77104
|
}, [
|
|
@@ -76913,7 +77134,7 @@ var TerminalViewport = (0, import_react317.forwardRef)(function TerminalViewport
|
|
|
76913
77134
|
|
|
76914
77135
|
// src/components/Terminal/Terminal.tsx
|
|
76915
77136
|
var import_jsx_runtime342 = require("react/jsx-runtime");
|
|
76916
|
-
var Terminal = (0,
|
|
77137
|
+
var Terminal = (0, import_react319.forwardRef)(
|
|
76917
77138
|
function Terminal2({
|
|
76918
77139
|
initialData,
|
|
76919
77140
|
readOnly,
|
|
@@ -76975,9 +77196,9 @@ var Terminal = (0, import_react318.forwardRef)(
|
|
|
76975
77196
|
|
|
76976
77197
|
// src/components/Terminal/TerminalTabs.tsx
|
|
76977
77198
|
var import_classnames142 = __toESM(require("classnames"), 1);
|
|
76978
|
-
var
|
|
77199
|
+
var import_react320 = require("react");
|
|
76979
77200
|
var import_jsx_runtime343 = require("react/jsx-runtime");
|
|
76980
|
-
var TerminalTabs = (0,
|
|
77201
|
+
var TerminalTabs = (0, import_react320.forwardRef)(
|
|
76981
77202
|
function TerminalTabs2({
|
|
76982
77203
|
sessions,
|
|
76983
77204
|
value,
|
|
@@ -77006,18 +77227,18 @@ var TerminalTabs = (0, import_react319.forwardRef)(
|
|
|
77006
77227
|
...surface
|
|
77007
77228
|
}, ref) {
|
|
77008
77229
|
const tone = getSurfaceAccentColor(surfaceTone);
|
|
77009
|
-
const prefix = (0,
|
|
77010
|
-
const [selected, setSelected] = (0,
|
|
77230
|
+
const prefix = (0, import_react320.useId)();
|
|
77231
|
+
const [selected, setSelected] = (0, import_react320.useState)(defaultValue ?? sessions[0]?.id);
|
|
77011
77232
|
const requested = value ?? selected;
|
|
77012
77233
|
const active = sessions.find((session) => session.id === requested) ?? sessions[0];
|
|
77013
77234
|
const activeId = active?.id;
|
|
77014
|
-
const handles = (0,
|
|
77015
|
-
(0,
|
|
77235
|
+
const handles = (0, import_react320.useRef)(/* @__PURE__ */ new Map());
|
|
77236
|
+
(0, import_react320.useImperativeHandle)(
|
|
77016
77237
|
ref,
|
|
77017
77238
|
() => ({ getSession: (id) => handles.current.get(id) }),
|
|
77018
77239
|
[]
|
|
77019
77240
|
);
|
|
77020
|
-
(0,
|
|
77241
|
+
(0, import_react320.useEffect)(() => {
|
|
77021
77242
|
if (value === void 0 && selected !== activeId) setSelected(activeId);
|
|
77022
77243
|
}, [value, selected, activeId]);
|
|
77023
77244
|
return /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(
|
|
@@ -77157,18 +77378,18 @@ function hasZone(node) {
|
|
|
77157
77378
|
}
|
|
77158
77379
|
|
|
77159
77380
|
// src/components/Menu/Menu.tsx
|
|
77160
|
-
var
|
|
77381
|
+
var import_react322 = __toESM(require("react"), 1);
|
|
77161
77382
|
var import_react_router_dom3 = require("react-router-dom");
|
|
77162
77383
|
var import_classnames144 = __toESM(require("classnames"), 1);
|
|
77163
77384
|
|
|
77164
77385
|
// src/components/Menu/MenuPopup.tsx
|
|
77165
|
-
var
|
|
77386
|
+
var import_react321 = require("react");
|
|
77166
77387
|
var import_react_dom20 = require("react-dom");
|
|
77167
77388
|
var import_jsx_runtime345 = require("react/jsx-runtime");
|
|
77168
77389
|
function MenuPopup({ anchor, placement, width, children }) {
|
|
77169
|
-
const ref = (0,
|
|
77170
|
-
const [style, setStyle] = (0,
|
|
77171
|
-
(0,
|
|
77390
|
+
const ref = (0, import_react321.useRef)(null);
|
|
77391
|
+
const [style, setStyle] = (0, import_react321.useState)({ visibility: "hidden" });
|
|
77392
|
+
(0, import_react321.useLayoutEffect)(() => {
|
|
77172
77393
|
const update = () => {
|
|
77173
77394
|
if (!anchor.current || !ref.current) return;
|
|
77174
77395
|
const trigger = anchor.current.getBoundingClientRect();
|
|
@@ -77212,11 +77433,11 @@ var menuPadding = {
|
|
|
77212
77433
|
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" };
|
|
77213
77434
|
var text = (item) => item.textValue ?? (typeof item.label === "string" ? item.label : item.id);
|
|
77214
77435
|
function MenuList({ items, state, depth = 0, parentLabel, onBack, focusOnMount = false, grouped = false }) {
|
|
77215
|
-
const list = (0,
|
|
77216
|
-
const buffer = (0,
|
|
77217
|
-
const timer = (0,
|
|
77436
|
+
const list = (0, import_react322.useRef)(null);
|
|
77437
|
+
const buffer = (0, import_react322.useRef)("");
|
|
77438
|
+
const timer = (0, import_react322.useRef)(void 0);
|
|
77218
77439
|
const actions = () => Array.from(list.current?.querySelectorAll("[data-menu-action]") ?? []).filter((el) => el.closest('[role="menu"]') === list.current && el.getAttribute("aria-disabled") !== "true");
|
|
77219
|
-
(0,
|
|
77440
|
+
(0, import_react322.useLayoutEffect)(() => {
|
|
77220
77441
|
if (grouped) return;
|
|
77221
77442
|
const entries = actions();
|
|
77222
77443
|
const selected = entries.find((el) => el === document.activeElement) ?? entries[0];
|
|
@@ -77224,12 +77445,12 @@ function MenuList({ items, state, depth = 0, parentLabel, onBack, focusOnMount =
|
|
|
77224
77445
|
el.tabIndex = el === selected ? 0 : -1;
|
|
77225
77446
|
});
|
|
77226
77447
|
}, [items, grouped]);
|
|
77227
|
-
(0,
|
|
77448
|
+
(0, import_react322.useLayoutEffect)(() => {
|
|
77228
77449
|
if (!focusOnMount) return;
|
|
77229
77450
|
const frame = requestAnimationFrame(() => actions()[0]?.focus());
|
|
77230
77451
|
return () => cancelAnimationFrame(frame);
|
|
77231
77452
|
}, [focusOnMount]);
|
|
77232
|
-
(0,
|
|
77453
|
+
(0, import_react322.useEffect)(() => () => clearTimeout(timer.current), []);
|
|
77233
77454
|
return /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
|
|
77234
77455
|
"ul",
|
|
77235
77456
|
{
|
|
@@ -77289,13 +77510,13 @@ function MenuList({ items, state, depth = 0, parentLabel, onBack, focusOnMount =
|
|
|
77289
77510
|
);
|
|
77290
77511
|
}
|
|
77291
77512
|
function MenuRow({ item, state, depth }) {
|
|
77292
|
-
const anchor = (0,
|
|
77513
|
+
const anchor = (0, import_react322.useRef)(null);
|
|
77293
77514
|
const { props } = state;
|
|
77294
77515
|
const tiered = (item.submenuMode ?? props.submenuMode) === "tiered";
|
|
77295
77516
|
const nested = Boolean(item.items?.some((child) => !child.hidden) || item.content != null);
|
|
77296
77517
|
const expanded = tiered ? state.path[depth] === item.id : state.expanded.includes(item.id);
|
|
77297
77518
|
const label = text(item);
|
|
77298
|
-
const id = (0,
|
|
77519
|
+
const id = (0, import_react322.useId)();
|
|
77299
77520
|
const open = (keyboard) => {
|
|
77300
77521
|
if (item.disabled || !nested) return;
|
|
77301
77522
|
state.keyboard.current = keyboard;
|
|
@@ -77334,7 +77555,7 @@ function MenuRow({ item, state, depth }) {
|
|
|
77334
77555
|
if (item.closeOnSelect ?? !checkable) state.close(true);
|
|
77335
77556
|
};
|
|
77336
77557
|
const content = props.renderItem?.(item, { expanded, checked: Boolean(item.checked) }) ?? /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)(import_jsx_runtime346.Fragment, { children: [
|
|
77337
|
-
/* @__PURE__ */ (0, import_jsx_runtime346.jsx)("span", { "aria-hidden": "true", className: "inline-flex h-5 w-5 shrink-0 items-center justify-center", children: checkable ? item.checked && (item.type === "radio" ? /* @__PURE__ */ (0, import_jsx_runtime346.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current" }) : /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(CustomIcon_default, { icon: "Check", size: "sm" })) :
|
|
77558
|
+
/* @__PURE__ */ (0, import_jsx_runtime346.jsx)("span", { "aria-hidden": "true", className: "inline-flex h-5 w-5 shrink-0 items-center justify-center", children: checkable ? item.checked && (item.type === "radio" ? /* @__PURE__ */ (0, import_jsx_runtime346.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current" }) : /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(CustomIcon_default, { icon: "Check", size: "sm" })) : import_react322.default.isValidElement(item.icon) ? item.icon : typeof item.icon === "string" ? /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(CustomIcon_default, { icon: item.icon, size: "sm" }) : null }),
|
|
77338
77559
|
/* @__PURE__ */ (0, import_jsx_runtime346.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
77339
77560
|
/* @__PURE__ */ (0, import_jsx_runtime346.jsx)("span", { className: "block truncate", children: item.label }),
|
|
77340
77561
|
item.description && /* @__PURE__ */ (0, import_jsx_runtime346.jsx)("span", { className: "block text-xs font-normal opacity-70", children: item.description })
|
|
@@ -77413,6 +77634,7 @@ function MenuSurface({ state, children, root = false }) {
|
|
|
77413
77634
|
transparency: props.transparency,
|
|
77414
77635
|
vibrancy: props.vibrancy,
|
|
77415
77636
|
specularMode: props.specularMode,
|
|
77637
|
+
style: root ? props.style : void 0,
|
|
77416
77638
|
className: (0, import_classnames144.default)(
|
|
77417
77639
|
root ? props.className : void 0,
|
|
77418
77640
|
(!root || props.popup || props.trigger || props.anchorRef) && "backdrop-blur-xl"
|
|
@@ -77426,18 +77648,18 @@ function MenuSurface({ state, children, root = false }) {
|
|
|
77426
77648
|
) });
|
|
77427
77649
|
}
|
|
77428
77650
|
function Menu(props) {
|
|
77429
|
-
const owner = (0,
|
|
77430
|
-
const triggerRef = (0,
|
|
77651
|
+
const owner = (0, import_react322.useId)();
|
|
77652
|
+
const triggerRef = (0, import_react322.useRef)(null);
|
|
77431
77653
|
const anchor = props.anchorRef ?? triggerRef;
|
|
77432
77654
|
const popup = props.popup ?? Boolean(props.trigger || props.anchorRef);
|
|
77433
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
77655
|
+
const [internalOpen, setInternalOpen] = (0, import_react322.useState)(props.defaultOpen ?? false);
|
|
77434
77656
|
const open = props.open ?? internalOpen;
|
|
77435
|
-
const [expanded, setExpanded] = (0,
|
|
77436
|
-
const [path, setPath] = (0,
|
|
77437
|
-
const keyboard = (0,
|
|
77438
|
-
const leave = (0,
|
|
77439
|
-
const cancelLeave = (0,
|
|
77440
|
-
const requestOpen = (0,
|
|
77657
|
+
const [expanded, setExpanded] = (0, import_react322.useState)(props.defaultExpandedKeys ?? []);
|
|
77658
|
+
const [path, setPath] = (0, import_react322.useState)([]);
|
|
77659
|
+
const keyboard = (0, import_react322.useRef)(false);
|
|
77660
|
+
const leave = (0, import_react322.useRef)(void 0);
|
|
77661
|
+
const cancelLeave = (0, import_react322.useCallback)(() => clearTimeout(leave.current), []);
|
|
77662
|
+
const requestOpen = (0, import_react322.useCallback)((value) => {
|
|
77441
77663
|
if (props.open === void 0) setInternalOpen(value);
|
|
77442
77664
|
props.onOpenChange?.(value);
|
|
77443
77665
|
if (!value) setPath([]);
|
|
@@ -77453,7 +77675,7 @@ function Menu(props) {
|
|
|
77453
77675
|
}
|
|
77454
77676
|
}
|
|
77455
77677
|
};
|
|
77456
|
-
(0,
|
|
77678
|
+
(0, import_react322.useEffect)(() => {
|
|
77457
77679
|
if (popup ? !open : path.length === 0) return;
|
|
77458
77680
|
const outside = (event) => {
|
|
77459
77681
|
const target = event.target;
|
|
@@ -77464,7 +77686,7 @@ function Menu(props) {
|
|
|
77464
77686
|
document.addEventListener("pointerdown", outside);
|
|
77465
77687
|
return () => document.removeEventListener("pointerdown", outside);
|
|
77466
77688
|
}, [popup, open, path.length, anchor, owner, requestOpen]);
|
|
77467
|
-
(0,
|
|
77689
|
+
(0, import_react322.useEffect)(() => () => clearTimeout(leave.current), []);
|
|
77468
77690
|
const state = {
|
|
77469
77691
|
owner,
|
|
77470
77692
|
props,
|
|
@@ -77489,8 +77711,8 @@ function Menu(props) {
|
|
|
77489
77711
|
let trigger = null;
|
|
77490
77712
|
if (props.trigger) {
|
|
77491
77713
|
const original = props.trigger.props;
|
|
77492
|
-
const originalRef = Number(
|
|
77493
|
-
trigger = (0,
|
|
77714
|
+
const originalRef = Number(import_react322.default.version.split(".")[0]) >= 19 ? original.ref : props.trigger.ref;
|
|
77715
|
+
trigger = (0, import_react322.cloneElement)(props.trigger, {
|
|
77494
77716
|
ref: (el) => {
|
|
77495
77717
|
triggerRef.current = el;
|
|
77496
77718
|
if (typeof originalRef === "function") originalRef(el);
|
|
@@ -77519,7 +77741,7 @@ function Menu(props) {
|
|
|
77519
77741
|
}
|
|
77520
77742
|
|
|
77521
77743
|
// src/components/FileUpload/FileUpload.tsx
|
|
77522
|
-
var
|
|
77744
|
+
var import_react324 = require("react");
|
|
77523
77745
|
var import_classnames145 = __toESM(require("classnames"), 1);
|
|
77524
77746
|
|
|
77525
77747
|
// src/components/FileUpload/fileSelection.ts
|
|
@@ -77562,12 +77784,12 @@ var uploadSizeTokens = {
|
|
|
77562
77784
|
};
|
|
77563
77785
|
|
|
77564
77786
|
// src/components/FileUpload/ImagePreview.tsx
|
|
77565
|
-
var
|
|
77787
|
+
var import_react323 = require("react");
|
|
77566
77788
|
var import_jsx_runtime347 = require("react/jsx-runtime");
|
|
77567
77789
|
function ImagePreview({ file, src, alt, className }) {
|
|
77568
|
-
const [preview, setPreview] = (0,
|
|
77569
|
-
const [failed, setFailed] = (0,
|
|
77570
|
-
(0,
|
|
77790
|
+
const [preview, setPreview] = (0, import_react323.useState)(null);
|
|
77791
|
+
const [failed, setFailed] = (0, import_react323.useState)(null);
|
|
77792
|
+
(0, import_react323.useEffect)(() => {
|
|
77571
77793
|
if (!file) return;
|
|
77572
77794
|
let active = true;
|
|
77573
77795
|
let url2;
|
|
@@ -77608,12 +77830,12 @@ var defaultLabels = {
|
|
|
77608
77830
|
};
|
|
77609
77831
|
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 }) {
|
|
77610
77832
|
const density = uploadSizeTokens[size];
|
|
77611
|
-
const [internal, setInternal] = (0,
|
|
77612
|
-
const [rejections, setRejections] = (0,
|
|
77613
|
-
const [dragging, setDragging] = (0,
|
|
77614
|
-
const depth = (0,
|
|
77615
|
-
const input = (0,
|
|
77616
|
-
const id = (0,
|
|
77833
|
+
const [internal, setInternal] = (0, import_react324.useState)(defaultValue);
|
|
77834
|
+
const [rejections, setRejections] = (0, import_react324.useState)([]);
|
|
77835
|
+
const [dragging, setDragging] = (0, import_react324.useState)(false);
|
|
77836
|
+
const depth = (0, import_react324.useRef)(0);
|
|
77837
|
+
const input = (0, import_react324.useRef)(null);
|
|
77838
|
+
const id = (0, import_react324.useId)();
|
|
77617
77839
|
const files = value ?? internal;
|
|
77618
77840
|
const locked = disabled || loading;
|
|
77619
77841
|
const labels = { ...defaultLabels, ...overrides };
|
|
@@ -77696,7 +77918,7 @@ function FileUpload({ embedded = false, compact: compact2 = false, value, defaul
|
|
|
77696
77918
|
}
|
|
77697
77919
|
|
|
77698
77920
|
// src/components/IdentityPicker/IdentityPicker.tsx
|
|
77699
|
-
var
|
|
77921
|
+
var import_react325 = require("react");
|
|
77700
77922
|
var import_classnames146 = __toESM(require("classnames"), 1);
|
|
77701
77923
|
|
|
77702
77924
|
// src/components/IdentityPicker/sizeTokens.ts
|
|
@@ -77891,10 +78113,10 @@ function IdentityPicker({
|
|
|
77891
78113
|
const spacing = compact2 ? compactIdentitySpacing[size] : density;
|
|
77892
78114
|
const monogramLayout = compact2 ? (0, import_classnames146.default)("flex flex-wrap items-end gap-2", spacing.panel.split(" ").filter((token) => !token.startsWith("space-y-"))) : spacing.panel;
|
|
77893
78115
|
const categoryLineHeight = size === "xs" || size === "sm" ? "1rem" : size === "md" ? "1.25rem" : "1.5rem";
|
|
77894
|
-
const tabsId = (0,
|
|
77895
|
-
const [internal, setInternal] = (0,
|
|
77896
|
-
const [query, setQuery] = (0,
|
|
77897
|
-
const [category, setCategory] = (0,
|
|
78116
|
+
const tabsId = (0, import_react325.useId)();
|
|
78117
|
+
const [internal, setInternal] = (0, import_react325.useState)(defaultValue);
|
|
78118
|
+
const [query, setQuery] = (0, import_react325.useState)("");
|
|
78119
|
+
const [category, setCategory] = (0, import_react325.useState)("recommended");
|
|
77898
78120
|
const selected = value === void 0 ? internal : value;
|
|
77899
78121
|
const labels = { ...defaults, ...overrides };
|
|
77900
78122
|
const locked = disabled || loading;
|
|
@@ -77914,7 +78136,7 @@ function IdentityPicker({
|
|
|
77914
78136
|
});
|
|
77915
78137
|
const previewClass = (0, import_classnames146.default)("flex shrink-0 items-center justify-center overflow-hidden border border-neutral-200 dark:border-neutral-600", density.preview, getSurfaceCornerClass(surface.corner ?? "rounded-md"), tokens.bg);
|
|
77916
78138
|
const preview = selected?.type === "image" ? /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(ImagePreview, { file: selected.file, src: selected.src, alt: labels.preview, className: "h-full w-full object-contain" }) : /* @__PURE__ */ (0, import_jsx_runtime349.jsx)("span", { style: { fontFamily }, "aria-hidden": "true", children: selected?.type === "emoji" ? selected.emoji : selected?.type === "monogram" ? selected.text : automatic });
|
|
77917
|
-
return /* @__PURE__ */ (0, import_jsx_runtime349.jsxs)(Panel_default, { ...surface, variant: surface.variant ?? "outlined", tone, padding: surface.padding ?? (compact2 ? "xs" : "sm"), className, "aria-busy": loading || void 0, children: [
|
|
78139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime349.jsxs)(Panel_default, { ...surface, variant: surface.variant ?? "outlined", tone: surface.tone ?? "none", padding: surface.padding ?? (compact2 ? "xs" : "sm"), className, "aria-busy": loading || void 0, children: [
|
|
77918
78140
|
/* @__PURE__ */ (0, import_jsx_runtime349.jsxs)("div", { className: (0, import_classnames146.default)("flex items-start", density.headerGap), children: [
|
|
77919
78141
|
/* @__PURE__ */ (0, import_jsx_runtime349.jsx)("div", { className: previewClass, role: selected?.type === "image" ? void 0 : "img", "aria-label": selected?.type === "image" ? void 0 : `${labels.preview}: ${selected?.type === "emoji" ? selected.emoji : selected?.type === "monogram" ? selected.text : automatic}`, children: preview }),
|
|
77920
78142
|
/* @__PURE__ */ (0, import_jsx_runtime349.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
@@ -77988,7 +78210,7 @@ function IdentityPicker({
|
|
|
77988
78210
|
embedded: true,
|
|
77989
78211
|
compact: compact2,
|
|
77990
78212
|
variant: surface.variant,
|
|
77991
|
-
tone,
|
|
78213
|
+
tone: surface.tone ?? "none",
|
|
77992
78214
|
corner: surface.corner,
|
|
77993
78215
|
padding: "none",
|
|
77994
78216
|
size,
|
|
@@ -78028,7 +78250,7 @@ function IdentityPicker({
|
|
|
78028
78250
|
}
|
|
78029
78251
|
|
|
78030
78252
|
// src/components/DotStepper/DotStepper.tsx
|
|
78031
|
-
var
|
|
78253
|
+
var import_react326 = __toESM(require("react"), 1);
|
|
78032
78254
|
var import_classnames147 = __toESM(require("classnames"), 1);
|
|
78033
78255
|
|
|
78034
78256
|
// src/components/DotStepper/plan.ts
|
|
@@ -78062,13 +78284,13 @@ var sizes = {
|
|
|
78062
78284
|
lg: { target: "h-8 w-8", dot: "h-4 w-4", gap: "gap-1", stack: "w-5" },
|
|
78063
78285
|
xl: { target: "h-10 w-10", dot: "h-5 w-5", gap: "gap-1.5", stack: "w-6" }
|
|
78064
78286
|
};
|
|
78065
|
-
var DotTrigger = (0,
|
|
78287
|
+
var DotTrigger = (0, import_react326.forwardRef)(function DotTrigger2({ tooltip, ...props }, ref) {
|
|
78066
78288
|
return /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(TooltipWrapper_default, { text: tooltip, children: /* @__PURE__ */ (0, import_jsx_runtime350.jsx)("button", { ...props, ref }) });
|
|
78067
78289
|
});
|
|
78068
78290
|
function ActivePopover({ trigger, content, options }) {
|
|
78069
|
-
const [open, setOpen] = (0,
|
|
78291
|
+
const [open, setOpen] = (0, import_react326.useState)(false);
|
|
78070
78292
|
const { onOpenChange, ...rest } = options ?? {};
|
|
78071
|
-
const anchor =
|
|
78293
|
+
const anchor = import_react326.default.cloneElement(trigger, { tooltip: open ? void 0 : trigger.props.tooltip });
|
|
78072
78294
|
return /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(Popover_default, { ...rest, trigger: anchor, visible: open, onOpenChange: (value) => {
|
|
78073
78295
|
setOpen(value);
|
|
78074
78296
|
onOpenChange?.(value);
|
|
@@ -78093,14 +78315,14 @@ function DotStepper({ steps, currentIndex, currentStepId, maxVisible = 5, size =
|
|
|
78093
78315
|
active && animated && /* @__PURE__ */ (0, import_jsx_runtime350.jsx)("span", { "data-dot-pulse": "", className: (0, import_classnames147.default)("pointer-events-none absolute inset-0 rounded-full motion-safe:animate-ping [animation-duration:1.6s] motion-reduce:hidden", getTrueColorDotClass(tone)) }),
|
|
78094
78316
|
/* @__PURE__ */ (0, import_jsx_runtime350.jsx)("span", { "data-dot-status": status, className: (0, import_classnames147.default)("absolute inset-0 rounded-full", fill(status)) })
|
|
78095
78317
|
] }) });
|
|
78096
|
-
return /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(
|
|
78318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(import_react326.default.Fragment, { children: content !== void 0 && content !== null ? /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(ActivePopover, { trigger, content, options: popoverProps }) : trigger }, `${step.id ?? index}:${status}:${locked ? "disabled" : "enabled"}`);
|
|
78097
78319
|
}),
|
|
78098
78320
|
overflow("after", plan.after)
|
|
78099
78321
|
] }) });
|
|
78100
78322
|
}
|
|
78101
78323
|
|
|
78102
78324
|
// src/components/knowledge/shared.tsx
|
|
78103
|
-
var
|
|
78325
|
+
var import_react327 = require("react");
|
|
78104
78326
|
var import_jsx_runtime351 = require("react/jsx-runtime");
|
|
78105
78327
|
var MESSAGE_KEYS = {
|
|
78106
78328
|
"library": "kit.knowledge.library",
|
|
@@ -78159,7 +78381,7 @@ function useKnowledgeCopy(labels) {
|
|
|
78159
78381
|
return (key) => labels?.[key] ?? t(MESSAGE_KEYS[key]);
|
|
78160
78382
|
}
|
|
78161
78383
|
function useKnowledgeState(value, initial, onChange) {
|
|
78162
|
-
const [internal, setInternal] = (0,
|
|
78384
|
+
const [internal, setInternal] = (0, import_react327.useState)(initial);
|
|
78163
78385
|
return [value === void 0 ? internal : value, (next) => {
|
|
78164
78386
|
if (value === void 0) setInternal(next);
|
|
78165
78387
|
onChange?.(next);
|
|
@@ -78216,7 +78438,7 @@ function MemoryCard({
|
|
|
78216
78438
|
}
|
|
78217
78439
|
|
|
78218
78440
|
// src/components/knowledge/MemoryLibrary.tsx
|
|
78219
|
-
var
|
|
78441
|
+
var import_react328 = require("react");
|
|
78220
78442
|
|
|
78221
78443
|
// ../common/knowledge/model.ts
|
|
78222
78444
|
var MEMORY_KINDS = ["lesson", "decision", "convention", "pitfall", "code", "documentation"];
|
|
@@ -78330,10 +78552,10 @@ function MemoryLibrary({
|
|
|
78330
78552
|
const [filters, setFilters] = useKnowledgeState(filtersProp, defaultFilters, onFiltersChange);
|
|
78331
78553
|
const [selection, select] = useKnowledgeState(selectedId, defaultSelectedId, onSelectionChange);
|
|
78332
78554
|
const [view, setView] = useKnowledgeState(viewProp, defaultView, onViewChange);
|
|
78333
|
-
const visible = (0,
|
|
78334
|
-
const topics = (0,
|
|
78335
|
-
const highlighted = (0,
|
|
78336
|
-
const groups = (0,
|
|
78555
|
+
const visible = (0, import_react328.useMemo)(() => remote ? [...memories] : filterMemories(memories, query, filters), [memories, query, filters, remote]);
|
|
78556
|
+
const topics = (0, import_react328.useMemo)(() => [...new Set(memories.flatMap((memory) => memory.topic ? [memory.topic] : []))].sort(), [memories]);
|
|
78557
|
+
const highlighted = (0, import_react328.useMemo)(() => new Set(highlightedIds), [highlightedIds]);
|
|
78558
|
+
const groups = (0, import_react328.useMemo)(() => {
|
|
78337
78559
|
const result = /* @__PURE__ */ new Map();
|
|
78338
78560
|
for (const memory of visible) {
|
|
78339
78561
|
const key = groupByTopic ? memory.topic ?? "" : "";
|
|
@@ -78457,7 +78679,7 @@ function MemoryDetail({
|
|
|
78457
78679
|
}
|
|
78458
78680
|
|
|
78459
78681
|
// src/components/knowledge/KnowledgeMap.tsx
|
|
78460
|
-
var
|
|
78682
|
+
var import_react329 = require("react");
|
|
78461
78683
|
var import_jsx_runtime355 = require("react/jsx-runtime");
|
|
78462
78684
|
var COLORS = ["#0891b2", "#d97706", "#059669", "#e11d48", "#6366f1", "#8b5cf6"];
|
|
78463
78685
|
var PAGE_SIZE = 24;
|
|
@@ -78482,15 +78704,15 @@ function KnowledgeMap({
|
|
|
78482
78704
|
disabled = false,
|
|
78483
78705
|
...surface
|
|
78484
78706
|
}) {
|
|
78485
|
-
const copy = useKnowledgeCopy(labels), helpId = (0,
|
|
78486
|
-
const scene = (0,
|
|
78707
|
+
const copy = useKnowledgeCopy(labels), helpId = (0, import_react329.useId)();
|
|
78708
|
+
const scene = (0, import_react329.useMemo)(() => buildKnowledgeScene(memories, points), [memories, points]);
|
|
78487
78709
|
const [selection, select] = useKnowledgeState(selectedId, defaultSelectedId, onSelectionChange);
|
|
78488
|
-
const canvasRef = (0,
|
|
78489
|
-
const drag = (0,
|
|
78490
|
-
const [camera, setCamera] = (0,
|
|
78491
|
-
const [query, setQuery] = (0,
|
|
78492
|
-
const highlighted = (0,
|
|
78493
|
-
const clusters = (0,
|
|
78710
|
+
const canvasRef = (0, import_react329.useRef)(null), hostRef = (0, import_react329.useRef)(null);
|
|
78711
|
+
const drag = (0, import_react329.useRef)(null);
|
|
78712
|
+
const [camera, setCamera] = (0, import_react329.useState)(INITIAL_CAMERA), [size, setSize] = (0, import_react329.useState)({ width: 640, height });
|
|
78713
|
+
const [query, setQuery] = (0, import_react329.useState)(""), [page, setPage] = (0, import_react329.useState)(0);
|
|
78714
|
+
const highlighted = (0, import_react329.useMemo)(() => new Set(highlightedIds), [highlightedIds]);
|
|
78715
|
+
const clusters = (0, import_react329.useMemo)(() => {
|
|
78494
78716
|
const groups = /* @__PURE__ */ new Map();
|
|
78495
78717
|
const names = [...new Set(scene.points.map((point) => point.clusterId))].sort();
|
|
78496
78718
|
const colors3 = new Map(names.map((name, index) => [name, COLORS[index % COLORS.length]]));
|
|
@@ -78507,7 +78729,7 @@ function KnowledgeMap({
|
|
|
78507
78729
|
}
|
|
78508
78730
|
return groups;
|
|
78509
78731
|
}, [scene]);
|
|
78510
|
-
const geometry = (0,
|
|
78732
|
+
const geometry = (0, import_react329.useMemo)(() => {
|
|
78511
78733
|
const byId = new Map(scene.points.map((point) => [point.memoryId, point]));
|
|
78512
78734
|
const diagnostics = [...scene.diagnostics];
|
|
78513
78735
|
const edges = relationships.flatMap((edge) => {
|
|
@@ -78520,10 +78742,10 @@ function KnowledgeMap({
|
|
|
78520
78742
|
});
|
|
78521
78743
|
return { edges, diagnostics };
|
|
78522
78744
|
}, [scene, relationships]);
|
|
78523
|
-
(0,
|
|
78745
|
+
(0, import_react329.useEffect)(() => {
|
|
78524
78746
|
onDiagnostics?.(geometry.diagnostics);
|
|
78525
78747
|
}, [geometry.diagnostics, onDiagnostics]);
|
|
78526
|
-
(0,
|
|
78748
|
+
(0, import_react329.useEffect)(() => {
|
|
78527
78749
|
const host = hostRef.current;
|
|
78528
78750
|
if (!host) return;
|
|
78529
78751
|
const update = () => setSize({ width: Math.max(1, host.clientWidth), height: Math.max(120, height) });
|
|
@@ -78533,7 +78755,7 @@ function KnowledgeMap({
|
|
|
78533
78755
|
observer.observe(host);
|
|
78534
78756
|
return () => observer.disconnect();
|
|
78535
78757
|
}, [height]);
|
|
78536
|
-
const bounds = (0,
|
|
78758
|
+
const bounds = (0, import_react329.useMemo)(() => {
|
|
78537
78759
|
let minX = Infinity, maxX = -Infinity, minY = Infinity, maxY = -Infinity;
|
|
78538
78760
|
for (const point of scene.points) {
|
|
78539
78761
|
minX = Math.min(minX, point.x);
|
|
@@ -78544,11 +78766,11 @@ function KnowledgeMap({
|
|
|
78544
78766
|
return scene.points.length ? { x: (minX + maxX) / 2, y: (minY + maxY) / 2, width: Math.max(80, maxX - minX), height: Math.max(80, maxY - minY) } : { x: 0, y: 0, width: 640, height: 360 };
|
|
78545
78767
|
}, [scene]);
|
|
78546
78768
|
const fitZoom = Math.max(1e-6, Math.min((size.width - 100) / bounds.width, (size.height - 100) / bounds.height, 3));
|
|
78547
|
-
const transform = (0,
|
|
78769
|
+
const transform = (0, import_react329.useCallback)((point) => ({
|
|
78548
78770
|
x: (point.x - bounds.x) * fitZoom * camera.zoom + size.width / 2 + camera.x,
|
|
78549
78771
|
y: (point.y - bounds.y) * fitZoom * camera.zoom + size.height / 2 + camera.y
|
|
78550
78772
|
}), [bounds, fitZoom, camera, size]);
|
|
78551
|
-
(0,
|
|
78773
|
+
(0, import_react329.useEffect)(() => {
|
|
78552
78774
|
const canvas = canvasRef.current;
|
|
78553
78775
|
if (!canvas) return;
|
|
78554
78776
|
const ctx = canvas.getContext("2d");
|
|
@@ -78622,12 +78844,12 @@ function KnowledgeMap({
|
|
|
78622
78844
|
ctx.globalAlpha = 1;
|
|
78623
78845
|
}
|
|
78624
78846
|
});
|
|
78625
|
-
(0,
|
|
78847
|
+
(0, import_react329.useEffect)(() => {
|
|
78626
78848
|
const observer = new MutationObserver(() => setSize((value) => ({ ...value })));
|
|
78627
78849
|
for (let node = hostRef.current; node; node = node.parentElement) observer.observe(node, { attributes: true, attributeFilter: ["class", "data-color-scheme", "style"] });
|
|
78628
78850
|
return () => observer.disconnect();
|
|
78629
78851
|
}, []);
|
|
78630
|
-
const zoom = (0,
|
|
78852
|
+
const zoom = (0, import_react329.useCallback)((factor, anchor = { x: size.width / 2, y: size.height / 2 }) => setCamera((current) => {
|
|
78631
78853
|
const next = Math.max(0.25, Math.min(24, current.zoom * factor)), scale = next / current.zoom;
|
|
78632
78854
|
return {
|
|
78633
78855
|
zoom: next,
|
|
@@ -78635,7 +78857,7 @@ function KnowledgeMap({
|
|
|
78635
78857
|
y: anchor.y - size.height / 2 - (anchor.y - size.height / 2 - current.y) * scale
|
|
78636
78858
|
};
|
|
78637
78859
|
}), [size.width, size.height]);
|
|
78638
|
-
(0,
|
|
78860
|
+
(0, import_react329.useEffect)(() => {
|
|
78639
78861
|
const canvas = canvasRef.current;
|
|
78640
78862
|
if (!canvas) return;
|
|
78641
78863
|
const wheel = (event) => {
|
|
@@ -78658,7 +78880,7 @@ function KnowledgeMap({
|
|
|
78658
78880
|
}
|
|
78659
78881
|
return nearest;
|
|
78660
78882
|
}
|
|
78661
|
-
const matches = (0,
|
|
78883
|
+
const matches = (0, import_react329.useMemo)(() => scene.points.filter((point) => (!selectedTopic || point.memory.topic === selectedTopic) && `${point.memory.title} ${point.memory.topic ?? ""}`.toLocaleLowerCase().includes(query.toLocaleLowerCase())), [scene, query, selectedTopic]);
|
|
78662
78884
|
const lastPage = Math.max(0, Math.ceil(matches.length / PAGE_SIZE) - 1), currentPage = Math.min(page, lastPage);
|
|
78663
78885
|
const selectableRelationships = geometry.edges.filter((edge) => edge.source.memoryId === selection || edge.target.memoryId === selection);
|
|
78664
78886
|
return /* @__PURE__ */ (0, import_jsx_runtime355.jsxs)(Panel_default, { tone: "none", variant: "outlined", padding: "none", loading, disabled, ...surface, className: `kit-knowledge kit-knowledge-map ${className}`, "aria-busy": loading, children: [
|
|
@@ -78766,7 +78988,7 @@ function KnowledgeMap({
|
|
|
78766
78988
|
}
|
|
78767
78989
|
|
|
78768
78990
|
// src/components/knowledge/KnowledgeExplorer.tsx
|
|
78769
|
-
var
|
|
78991
|
+
var import_react330 = require("react");
|
|
78770
78992
|
var import_jsx_runtime356 = require("react/jsx-runtime");
|
|
78771
78993
|
function KnowledgeExplorer({
|
|
78772
78994
|
memories,
|
|
@@ -78802,14 +79024,14 @@ function KnowledgeExplorer({
|
|
|
78802
79024
|
const [query, setQuery] = useKnowledgeState(queryProp, defaultQuery, onQueryChange);
|
|
78803
79025
|
const [filters, setFilters] = useKnowledgeState(filtersProp, defaultFilters, onFiltersChange);
|
|
78804
79026
|
const [traceId, selectTrace] = useKnowledgeState(traceIdProp, defaultSelectedTraceId, onTraceSelectionChange);
|
|
78805
|
-
const [mobileView, setMobileView] = (0,
|
|
78806
|
-
const records = (0,
|
|
79027
|
+
const [mobileView, setMobileView] = (0, import_react330.useState)("library");
|
|
79028
|
+
const records = (0, import_react330.useMemo)(() => new Map(memories.map((memory) => [memory.id, memory])), [memories]);
|
|
78807
79029
|
const selectedMemory = selection ? records.get(selection) ?? null : null;
|
|
78808
|
-
const highlightedIds = (0,
|
|
78809
|
-
const linkedTraceIds = (0,
|
|
78810
|
-
const linkedNodes = (0,
|
|
78811
|
-
const traceNodes = (0,
|
|
78812
|
-
const matchingIds = (0,
|
|
79030
|
+
const highlightedIds = (0, import_react330.useMemo)(() => [...new Set(traceLinks.filter((link) => link.traceNodeId === traceId && records.has(link.memoryId)).map((link) => link.memoryId))], [traceLinks, traceId, records]);
|
|
79031
|
+
const linkedTraceIds = (0, import_react330.useMemo)(() => new Set(traceLinks.filter((link) => link.memoryId === selection).map((link) => link.traceNodeId)), [traceLinks, selection]);
|
|
79032
|
+
const linkedNodes = (0, import_react330.useMemo)(() => trace?.nodes.filter((node) => linkedTraceIds.has(node.id)) ?? [], [trace?.nodes, linkedTraceIds]);
|
|
79033
|
+
const traceNodes = (0, import_react330.useMemo)(() => trace?.nodes.map((node) => linkedTraceIds.has(node.id) ? { ...node, tone: "cyan" } : node) ?? [], [trace?.nodes, linkedTraceIds]);
|
|
79034
|
+
const matchingIds = (0, import_react330.useMemo)(() => filterMemories(memories, query, filters).map((memory) => memory.id), [memories, query, filters]);
|
|
78813
79035
|
const enabled = ["library", "map", "detail", "trace"].filter((region) => regions?.[region] !== false && (region !== "trace" || !!trace || !!renderRegion?.trace));
|
|
78814
79036
|
const view = enabled.includes(mobileView) ? mobileView : enabled[0];
|
|
78815
79037
|
const context = { selectedMemory, selectedId: selection, selectMemory: select, query, setQuery, filters, setFilters, highlightedIds, selectedTraceId: traceId, selectTrace };
|
|
@@ -78894,7 +79116,7 @@ function ContentActions({
|
|
|
78894
79116
|
var ContentActions_default = ContentActions;
|
|
78895
79117
|
|
|
78896
79118
|
// src/components/CodeBlock.tsx
|
|
78897
|
-
var
|
|
79119
|
+
var import_react331 = __toESM(require("react"), 1);
|
|
78898
79120
|
var import_refractor = require("refractor");
|
|
78899
79121
|
var import_tsx = __toESM(require("refractor/tsx"), 1);
|
|
78900
79122
|
var import_jsx_runtime358 = require("react/jsx-runtime");
|
|
@@ -78918,7 +79140,7 @@ function renderLines(runs, numbered, value) {
|
|
|
78918
79140
|
});
|
|
78919
79141
|
}
|
|
78920
79142
|
const digits = String(value.split("\n").length).length;
|
|
78921
|
-
return lines.map((line3, index) => /* @__PURE__ */ (0, import_jsx_runtime358.jsxs)(
|
|
79143
|
+
return lines.map((line3, index) => /* @__PURE__ */ (0, import_jsx_runtime358.jsxs)(import_react331.default.Fragment, { children: [
|
|
78922
79144
|
index > 0 ? "\n" : null,
|
|
78923
79145
|
/* @__PURE__ */ (0, import_jsx_runtime358.jsxs)("span", { className: "ui-code-block-line", children: [
|
|
78924
79146
|
numbered && /* @__PURE__ */ (0, import_jsx_runtime358.jsx)("span", { className: "ui-code-block-line-number", "aria-hidden": "true", "data-line": index + 1, style: { width: `${digits}ch` } }),
|
|
@@ -78946,10 +79168,10 @@ function CodeBlock({
|
|
|
78946
79168
|
...rest
|
|
78947
79169
|
}) {
|
|
78948
79170
|
const t = useKitT();
|
|
78949
|
-
const [copyState, setCopyState] = (0,
|
|
78950
|
-
const timer = (0,
|
|
78951
|
-
const generation = (0,
|
|
78952
|
-
(0,
|
|
79171
|
+
const [copyState, setCopyState] = (0, import_react331.useState)("idle");
|
|
79172
|
+
const timer = (0, import_react331.useRef)(void 0);
|
|
79173
|
+
const generation = (0, import_react331.useRef)(0);
|
|
79174
|
+
(0, import_react331.useEffect)(() => {
|
|
78953
79175
|
generation.current++;
|
|
78954
79176
|
setCopyState("idle");
|
|
78955
79177
|
clearTimeout(timer.current);
|
|
@@ -78958,7 +79180,7 @@ function CodeBlock({
|
|
|
78958
79180
|
clearTimeout(timer.current);
|
|
78959
79181
|
};
|
|
78960
79182
|
}, [value]);
|
|
78961
|
-
const highlighted = (0,
|
|
79183
|
+
const highlighted = (0, import_react331.useMemo)(() => {
|
|
78962
79184
|
if (!readOnly || !language) return [{ text: value, className: "" }];
|
|
78963
79185
|
try {
|
|
78964
79186
|
return tokenRuns(import_refractor.refractor.highlight(value, language.toLowerCase()).children);
|
|
@@ -79006,12 +79228,319 @@ function CodeBlock({
|
|
|
79006
79228
|
] }) });
|
|
79007
79229
|
}
|
|
79008
79230
|
|
|
79009
|
-
// src/
|
|
79010
|
-
var
|
|
79011
|
-
var import_react_dom21 = require("react-dom");
|
|
79231
|
+
// src/components/FilterBar.tsx
|
|
79232
|
+
var import_react332 = require("react");
|
|
79012
79233
|
var import_classnames149 = __toESM(require("classnames"), 1);
|
|
79013
79234
|
var import_jsx_runtime359 = require("react/jsx-runtime");
|
|
79014
|
-
|
|
79235
|
+
function normalize(filters, value) {
|
|
79236
|
+
return Object.assign(/* @__PURE__ */ Object.create(null), Object.fromEntries(filters.flatMap((filter) => {
|
|
79237
|
+
const selected = new Set(Object.prototype.hasOwnProperty.call(value, filter.id) ? value[filter.id] : []);
|
|
79238
|
+
const values = filter.options.filter((option) => selected.has(option.value)).map((option) => option.value);
|
|
79239
|
+
return values.length ? [[filter.id, values]] : [];
|
|
79240
|
+
})));
|
|
79241
|
+
}
|
|
79242
|
+
function FilterBar({
|
|
79243
|
+
searchProps,
|
|
79244
|
+
filters,
|
|
79245
|
+
value,
|
|
79246
|
+
defaultValue = {},
|
|
79247
|
+
onChange,
|
|
79248
|
+
filteredCount,
|
|
79249
|
+
totalCount,
|
|
79250
|
+
itemLabel,
|
|
79251
|
+
size = "md",
|
|
79252
|
+
color: color2 = "blue",
|
|
79253
|
+
showSearch = true,
|
|
79254
|
+
showFilterLabel = true,
|
|
79255
|
+
showEmptyState = true,
|
|
79256
|
+
showClearAll = true,
|
|
79257
|
+
showResultCount = true,
|
|
79258
|
+
showMenuCounts = true,
|
|
79259
|
+
variant = "outlined",
|
|
79260
|
+
tone = "neutral",
|
|
79261
|
+
corner = "rounded-sm",
|
|
79262
|
+
padding = "xs",
|
|
79263
|
+
transparency,
|
|
79264
|
+
glassOpacity = "frosted",
|
|
79265
|
+
vibrancy = "medium",
|
|
79266
|
+
buttonVariant = "outline",
|
|
79267
|
+
secondaryButtonVariant = "ghost",
|
|
79268
|
+
applyButtonVariant = "solid",
|
|
79269
|
+
buttonTone = color2,
|
|
79270
|
+
buttonSize = size,
|
|
79271
|
+
buttonCorner,
|
|
79272
|
+
buttonWeight = "normal",
|
|
79273
|
+
buttonDashed = true,
|
|
79274
|
+
menuVariant = "outlined",
|
|
79275
|
+
menuTone = "none",
|
|
79276
|
+
menuCorner,
|
|
79277
|
+
menuPadding: menuPadding2,
|
|
79278
|
+
chipVariant = "soft",
|
|
79279
|
+
chipTone = color2,
|
|
79280
|
+
spring = "snappy",
|
|
79281
|
+
disabled = false,
|
|
79282
|
+
className,
|
|
79283
|
+
"aria-label": ariaLabel
|
|
79284
|
+
}) {
|
|
79285
|
+
const t = useKitT();
|
|
79286
|
+
const buttonStyle = buttonCorner === void 0 ? void 0 : { borderRadius: getSurfaceCornerRem(buttonCorner) };
|
|
79287
|
+
const actionStyle = { color: buttonTone, size: buttonSize, weight: buttonWeight, style: buttonStyle };
|
|
79288
|
+
const surfaceClasses = getSurfaceVariantClasses(variant, tone, {
|
|
79289
|
+
transparency,
|
|
79290
|
+
liquidExtras: (0, import_classnames149.default)(getGlassVibrancyClass(vibrancy), getSurfaceGlassFillClass(tone, glassOpacity))
|
|
79291
|
+
});
|
|
79292
|
+
const [internal, setInternal] = (0, import_react332.useState)(defaultValue);
|
|
79293
|
+
const applied = normalize(filters, value ?? internal);
|
|
79294
|
+
const [open, setOpen] = (0, import_react332.useState)(false);
|
|
79295
|
+
const [category, setCategory] = (0, import_react332.useState)(null);
|
|
79296
|
+
const [draft, setDraft] = (0, import_react332.useState)([]);
|
|
79297
|
+
const anchor = (0, import_react332.useRef)(null);
|
|
79298
|
+
const searchRegion = (0, import_react332.useRef)(null);
|
|
79299
|
+
const searchId = (0, import_react332.useId)();
|
|
79300
|
+
const [expanded, setExpanded] = (0, import_react332.useState)(Boolean(searchProps.initialValue));
|
|
79301
|
+
const searchDisabled = disabled || searchProps.disabled;
|
|
79302
|
+
const active = filters.find((filter) => filter.id === category);
|
|
79303
|
+
const motion = CONTROL_SPRING_TOKENS[spring];
|
|
79304
|
+
const style = { "--fb-duration": `${motion.duration}ms`, "--fb-easing": motion.easing };
|
|
79305
|
+
const commit = (next) => {
|
|
79306
|
+
const normalized = normalize(filters, next);
|
|
79307
|
+
if (value === void 0) setInternal(normalized);
|
|
79308
|
+
onChange?.(normalized);
|
|
79309
|
+
};
|
|
79310
|
+
const close = (restore = false) => {
|
|
79311
|
+
setOpen(false);
|
|
79312
|
+
setCategory(null);
|
|
79313
|
+
setDraft([]);
|
|
79314
|
+
if (restore) anchor.current?.focus();
|
|
79315
|
+
};
|
|
79316
|
+
const edit = (filter) => {
|
|
79317
|
+
setDraft([...applied[filter.id] ?? []]);
|
|
79318
|
+
setCategory(filter.id);
|
|
79319
|
+
setOpen(true);
|
|
79320
|
+
};
|
|
79321
|
+
const previouslyExpanded = (0, import_react332.useRef)(expanded);
|
|
79322
|
+
(0, import_react332.useLayoutEffect)(() => {
|
|
79323
|
+
if (showSearch && expanded && !previouslyExpanded.current && !searchDisabled) searchRegion.current?.querySelector("input")?.focus();
|
|
79324
|
+
previouslyExpanded.current = expanded;
|
|
79325
|
+
}, [expanded, searchDisabled, showSearch]);
|
|
79326
|
+
(0, import_react332.useEffect)(() => {
|
|
79327
|
+
if (disabled || category !== null && (!active || active.disabled)) {
|
|
79328
|
+
setOpen(false);
|
|
79329
|
+
setCategory(null);
|
|
79330
|
+
setDraft([]);
|
|
79331
|
+
}
|
|
79332
|
+
}, [disabled, category, active]);
|
|
79333
|
+
const items = active ? active.options.map((option) => ({
|
|
79334
|
+
id: option.value,
|
|
79335
|
+
label: option.label,
|
|
79336
|
+
type: "checkbox",
|
|
79337
|
+
checked: draft.includes(option.value),
|
|
79338
|
+
disabled: option.disabled,
|
|
79339
|
+
badge: showMenuCounts ? option.count : void 0,
|
|
79340
|
+
onCheckedChange: (checked) => setDraft((current) => checked ? [.../* @__PURE__ */ new Set([...current, option.value])] : current.filter((entry) => entry !== option.value))
|
|
79341
|
+
})) : filters.map((filter) => ({
|
|
79342
|
+
id: filter.id,
|
|
79343
|
+
label: filter.label,
|
|
79344
|
+
badge: showMenuCounts ? filter.count ?? filter.options.length : void 0,
|
|
79345
|
+
disabled: filter.disabled,
|
|
79346
|
+
trailing: /* @__PURE__ */ (0, import_jsx_runtime359.jsx)(CustomIcon_default, { icon: "ChevronRight", size: "sm" }),
|
|
79347
|
+
closeOnSelect: false,
|
|
79348
|
+
command: () => edit(filter)
|
|
79349
|
+
}));
|
|
79350
|
+
const chips = filters.filter((filter) => applied[filter.id]?.length).map((filter) => ({
|
|
79351
|
+
id: filter.id,
|
|
79352
|
+
label: `${filter.label}: ${filter.options.filter((option) => applied[filter.id].includes(option.value)).map((option) => option.label).join(", ")}`,
|
|
79353
|
+
disabled: disabled || filter.disabled,
|
|
79354
|
+
edit: () => edit(filter),
|
|
79355
|
+
remove: () => {
|
|
79356
|
+
const next = { ...applied };
|
|
79357
|
+
delete next[filter.id];
|
|
79358
|
+
commit(next);
|
|
79359
|
+
anchor.current?.focus();
|
|
79360
|
+
}
|
|
79361
|
+
}));
|
|
79362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime359.jsxs)(
|
|
79363
|
+
"div",
|
|
79364
|
+
{
|
|
79365
|
+
role: "group",
|
|
79366
|
+
"aria-label": ariaLabel ?? t("kit.filterbar.filters"),
|
|
79367
|
+
className: (0, import_classnames149.default)("kit-filter-bar flex min-w-0 flex-wrap items-center gap-2 text-sm", surfaceClasses, getSurfaceCornerClass(corner), getSurfacePaddingClass(padding), className),
|
|
79368
|
+
style,
|
|
79369
|
+
onBlurCapture: (event) => {
|
|
79370
|
+
const menu = event.target.closest("[data-menu-owner]");
|
|
79371
|
+
const next = event.relatedTarget;
|
|
79372
|
+
if (open && menu && !menu.contains(next) && !event.currentTarget.contains(next)) close();
|
|
79373
|
+
},
|
|
79374
|
+
onKeyDownCapture: (event) => {
|
|
79375
|
+
if (open && active && event.key === "Tab") event.stopPropagation();
|
|
79376
|
+
if (open && category && event.key === "ArrowLeft") {
|
|
79377
|
+
event.preventDefault();
|
|
79378
|
+
event.stopPropagation();
|
|
79379
|
+
setCategory(null);
|
|
79380
|
+
setDraft([]);
|
|
79381
|
+
}
|
|
79382
|
+
if (open && event.key === "Escape") {
|
|
79383
|
+
event.preventDefault();
|
|
79384
|
+
event.stopPropagation();
|
|
79385
|
+
close(true);
|
|
79386
|
+
}
|
|
79387
|
+
},
|
|
79388
|
+
children: [
|
|
79389
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsxs)(
|
|
79390
|
+
"div",
|
|
79391
|
+
{
|
|
79392
|
+
ref: searchRegion,
|
|
79393
|
+
className: "fb-search",
|
|
79394
|
+
"data-expanded": expanded,
|
|
79395
|
+
hidden: !showSearch,
|
|
79396
|
+
inert: !showSearch,
|
|
79397
|
+
onBlur: (event) => {
|
|
79398
|
+
if (!event.currentTarget.contains(event.relatedTarget) && !event.currentTarget.querySelector("input")?.value) setExpanded(false);
|
|
79399
|
+
},
|
|
79400
|
+
children: [
|
|
79401
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)(
|
|
79402
|
+
Button_default,
|
|
79403
|
+
{
|
|
79404
|
+
...actionStyle,
|
|
79405
|
+
variant: "icon",
|
|
79406
|
+
leadingIcon: "Search",
|
|
79407
|
+
"aria-label": t("kit.filterbar.search"),
|
|
79408
|
+
"aria-expanded": expanded,
|
|
79409
|
+
"aria-controls": searchId,
|
|
79410
|
+
disabled: searchDisabled,
|
|
79411
|
+
className: "fb-search-trigger",
|
|
79412
|
+
hidden: expanded,
|
|
79413
|
+
onClick: () => setExpanded(true)
|
|
79414
|
+
}
|
|
79415
|
+
),
|
|
79416
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)("div", { id: searchId, className: "fb-search-input", inert: !expanded, "aria-hidden": !expanded, children: /* @__PURE__ */ (0, import_jsx_runtime359.jsx)(SearchBar_default, { size, color: color2, ...searchProps, disabled: searchDisabled }) })
|
|
79417
|
+
]
|
|
79418
|
+
}
|
|
79419
|
+
),
|
|
79420
|
+
showSearch && (showFilterLabel || chips.length > 0 || showEmptyState) && /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { "aria-hidden": "true", className: "h-5 border-l border-neutral-200 dark:border-neutral-700" }),
|
|
79421
|
+
showFilterLabel && /* @__PURE__ */ (0, import_jsx_runtime359.jsxs)("span", { className: "flex items-center gap-1.5 text-neutral-600 dark:text-neutral-300", children: [
|
|
79422
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)("svg", { "aria-hidden": "true", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.7", children: /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("path", { d: "M3 4h18l-7 8v8l-4-2v-6Z" }) }),
|
|
79423
|
+
t("kit.filterbar.filters")
|
|
79424
|
+
] }),
|
|
79425
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)(FilterChips, { chips, color: chipTone, variant: chipVariant, size, buttonTone, buttonStyle, removeLabel: (label) => t("kit.filterbar.remove", { label }) }),
|
|
79426
|
+
showEmptyState && !chips.length && /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { className: "text-neutral-400", children: t("kit.filterbar.empty") }),
|
|
79427
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsxs)("div", { className: "flex flex-1 flex-wrap items-center justify-end gap-2", children: [
|
|
79428
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)(
|
|
79429
|
+
Button_default,
|
|
79430
|
+
{
|
|
79431
|
+
...actionStyle,
|
|
79432
|
+
ref: anchor,
|
|
79433
|
+
variant: buttonVariant,
|
|
79434
|
+
leadingIcon: "Add",
|
|
79435
|
+
disabled: disabled || !filters.length,
|
|
79436
|
+
className: (0, import_classnames149.default)(buttonCorner === void 0 && "rounded-full", buttonDashed && buttonVariant === "outline" && "border-dashed"),
|
|
79437
|
+
"aria-haspopup": "menu",
|
|
79438
|
+
"aria-expanded": open,
|
|
79439
|
+
onClick: () => {
|
|
79440
|
+
if (open) close();
|
|
79441
|
+
else {
|
|
79442
|
+
setCategory(null);
|
|
79443
|
+
setOpen(true);
|
|
79444
|
+
}
|
|
79445
|
+
},
|
|
79446
|
+
onKeyDown: (event) => {
|
|
79447
|
+
if (event.key === "ArrowDown") {
|
|
79448
|
+
event.preventDefault();
|
|
79449
|
+
setCategory(null);
|
|
79450
|
+
setOpen(true);
|
|
79451
|
+
}
|
|
79452
|
+
},
|
|
79453
|
+
children: t("kit.filterbar.add")
|
|
79454
|
+
}
|
|
79455
|
+
),
|
|
79456
|
+
showClearAll && chips.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime359.jsx)(Button_default, { ...actionStyle, variant: secondaryButtonVariant, disabled, onClick: () => {
|
|
79457
|
+
commit({});
|
|
79458
|
+
anchor.current?.focus();
|
|
79459
|
+
}, children: t("kit.filterbar.clearAll") }),
|
|
79460
|
+
showResultCount && /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { className: "border-l border-neutral-200 pl-2 text-neutral-400 dark:border-neutral-700", role: "status", children: t("kit.filterbar.summary", { filtered: filteredCount, total: totalCount, items: itemLabel ?? t("kit.filterbar.items") }) })
|
|
79461
|
+
] }),
|
|
79462
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)(
|
|
79463
|
+
Menu,
|
|
79464
|
+
{
|
|
79465
|
+
popup: true,
|
|
79466
|
+
anchorRef: anchor,
|
|
79467
|
+
open: open && !disabled,
|
|
79468
|
+
onOpenChange: (next) => {
|
|
79469
|
+
if (!next) close();
|
|
79470
|
+
},
|
|
79471
|
+
items,
|
|
79472
|
+
width: 320,
|
|
79473
|
+
size,
|
|
79474
|
+
variant: menuVariant,
|
|
79475
|
+
tone: menuTone,
|
|
79476
|
+
corner: menuCorner,
|
|
79477
|
+
padding: menuPadding2,
|
|
79478
|
+
className: "fb-menu",
|
|
79479
|
+
style,
|
|
79480
|
+
"aria-label": active?.label ?? t("kit.filterbar.filterBy"),
|
|
79481
|
+
renderItem: active ? (item) => /* @__PURE__ */ (0, import_jsx_runtime359.jsxs)(import_jsx_runtime359.Fragment, { children: [
|
|
79482
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { "aria-hidden": "true", className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border border-neutral-300 dark:border-neutral-600", children: item.checked && /* @__PURE__ */ (0, import_jsx_runtime359.jsx)(CustomIcon_default, { icon: "Check", size: "xs" }) }),
|
|
79483
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { className: "min-w-0 flex-1 truncate", children: item.label }),
|
|
79484
|
+
item.badge != null && /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { className: "shrink-0 text-xs text-neutral-400", children: item.badge })
|
|
79485
|
+
] }) : void 0,
|
|
79486
|
+
header: active ? /* @__PURE__ */ (0, import_jsx_runtime359.jsx)(Button_default, { ...actionStyle, variant: secondaryButtonVariant, leadingIcon: "ChevronLeft", onClick: () => {
|
|
79487
|
+
setCategory(null);
|
|
79488
|
+
setDraft([]);
|
|
79489
|
+
}, "aria-label": t("kit.filterbar.back"), children: /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { className: "uppercase tracking-wide", children: active.label }) }) : /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { className: "px-3 text-xs uppercase tracking-wide text-neutral-400", children: t("kit.filterbar.filterBy") }),
|
|
79490
|
+
footer: active ? /* @__PURE__ */ (0, import_jsx_runtime359.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
79491
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)(Button_default, { ...actionStyle, variant: secondaryButtonVariant, onClick: () => setDraft((current) => current.filter((entry) => active.options.some((option) => option.value === entry && option.disabled))), children: t("kit.filterbar.clear") }),
|
|
79492
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)(Button_default, { ...actionStyle, variant: applyButtonVariant, onClick: () => {
|
|
79493
|
+
commit({ ...applied, [active.id]: draft });
|
|
79494
|
+
close(true);
|
|
79495
|
+
}, children: t("kit.filterbar.done") })
|
|
79496
|
+
] }) : void 0
|
|
79497
|
+
},
|
|
79498
|
+
category ?? "categories"
|
|
79499
|
+
)
|
|
79500
|
+
]
|
|
79501
|
+
}
|
|
79502
|
+
);
|
|
79503
|
+
}
|
|
79504
|
+
function FilterChips({ chips, color: color2, variant, size, buttonTone, buttonStyle, removeLabel }) {
|
|
79505
|
+
const [visible, setVisible] = (0, import_react332.useState)(chips);
|
|
79506
|
+
const region = (0, import_react332.useRef)(null);
|
|
79507
|
+
const positions = (0, import_react332.useRef)(/* @__PURE__ */ new Map());
|
|
79508
|
+
const signature = chips.map((chip) => chip.id).join("\0");
|
|
79509
|
+
(0, import_react332.useEffect)(() => {
|
|
79510
|
+
const timer = setTimeout(() => setVisible((current) => current.filter((chip) => signature.split("\0").includes(chip.id))), 900);
|
|
79511
|
+
return () => clearTimeout(timer);
|
|
79512
|
+
}, [signature]);
|
|
79513
|
+
(0, import_react332.useLayoutEffect)(() => {
|
|
79514
|
+
setVisible((current) => [...chips, ...current.filter((chip) => !chips.some((next) => next.id === chip.id))]);
|
|
79515
|
+
}, [signature]);
|
|
79516
|
+
(0, import_react332.useLayoutEffect)(() => {
|
|
79517
|
+
if (typeof matchMedia === "undefined" || matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
79518
|
+
const next = /* @__PURE__ */ new Map();
|
|
79519
|
+
region.current?.querySelectorAll("[data-chip]").forEach((element) => {
|
|
79520
|
+
const key = element.dataset.chip;
|
|
79521
|
+
const left = element.getBoundingClientRect().left;
|
|
79522
|
+
const previous = positions.current.get(key);
|
|
79523
|
+
if (previous !== void 0 && previous !== left) element.animate?.([{ transform: `translateX(${previous - left}px)` }, { transform: "translateX(0)" }], { duration: 320, easing: "ease-out" });
|
|
79524
|
+
next.set(key, left);
|
|
79525
|
+
});
|
|
79526
|
+
positions.current = next;
|
|
79527
|
+
});
|
|
79528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("div", { ref: region, className: "contents", children: visible.map((old) => {
|
|
79529
|
+
const chip = chips.find((current) => current.id === old.id);
|
|
79530
|
+
const entry = chip ?? old;
|
|
79531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { "data-chip": entry.id, className: "fb-chip", "data-exiting": !chip, inert: !chip, "aria-hidden": !chip, children: /* @__PURE__ */ (0, import_jsx_runtime359.jsx)(Badge_default, { tone: color2, variant, size, ring: false, className: "max-w-full py-1", children: /* @__PURE__ */ (0, import_jsx_runtime359.jsxs)("span", { className: "flex min-w-0 items-center gap-1", children: [
|
|
79532
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)("button", { type: "button", disabled: entry.disabled, className: "min-w-0 truncate rounded-full px-1 py-1 focus-visible:outline focus-visible:outline-2 disabled:opacity-50", onClick: entry.edit, children: entry.label }),
|
|
79533
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)(Button_default, { variant: "icon", size: "xs", color: buttonTone, style: buttonStyle, leadingIcon: "Close", disabled: entry.disabled, "aria-label": removeLabel(entry.label), onClick: entry.remove })
|
|
79534
|
+
] }) }) }, entry.id);
|
|
79535
|
+
}) });
|
|
79536
|
+
}
|
|
79537
|
+
|
|
79538
|
+
// src/contexts/BottomSheetContext.tsx
|
|
79539
|
+
var import_react333 = require("react");
|
|
79540
|
+
var import_react_dom21 = require("react-dom");
|
|
79541
|
+
var import_classnames150 = __toESM(require("classnames"), 1);
|
|
79542
|
+
var import_jsx_runtime360 = require("react/jsx-runtime");
|
|
79543
|
+
var BottomSheetContext = (0, import_react333.createContext)(null);
|
|
79015
79544
|
var TRANSITION_MS2 = 260;
|
|
79016
79545
|
var renderSlot = (slot, controls) => {
|
|
79017
79546
|
if (!slot) {
|
|
@@ -79022,13 +79551,13 @@ var renderSlot = (slot, controls) => {
|
|
|
79022
79551
|
var BottomSheetProvider = ({
|
|
79023
79552
|
children
|
|
79024
79553
|
}) => {
|
|
79025
|
-
const [sheet, setSheet] = (0,
|
|
79026
|
-
const [isVisible, setIsVisible] = (0,
|
|
79027
|
-
const pendingCloseRef = (0,
|
|
79028
|
-
const dismissSheet = (0,
|
|
79554
|
+
const [sheet, setSheet] = (0, import_react333.useState)(null);
|
|
79555
|
+
const [isVisible, setIsVisible] = (0, import_react333.useState)(false);
|
|
79556
|
+
const pendingCloseRef = (0, import_react333.useRef)(null);
|
|
79557
|
+
const dismissSheet = (0, import_react333.useCallback)(() => {
|
|
79029
79558
|
setIsVisible(false);
|
|
79030
79559
|
}, []);
|
|
79031
|
-
const presentSheet = (0,
|
|
79560
|
+
const presentSheet = (0, import_react333.useCallback)((options) => {
|
|
79032
79561
|
if (pendingCloseRef.current) {
|
|
79033
79562
|
clearTimeout(pendingCloseRef.current);
|
|
79034
79563
|
pendingCloseRef.current = null;
|
|
@@ -79041,7 +79570,7 @@ var BottomSheetProvider = ({
|
|
|
79041
79570
|
setTimeout(animateIn, 0);
|
|
79042
79571
|
}
|
|
79043
79572
|
}, []);
|
|
79044
|
-
(0,
|
|
79573
|
+
(0, import_react333.useEffect)(() => {
|
|
79045
79574
|
if (!isVisible && sheet) {
|
|
79046
79575
|
pendingCloseRef.current = setTimeout(() => {
|
|
79047
79576
|
sheet.onClose?.();
|
|
@@ -79056,7 +79585,7 @@ var BottomSheetProvider = ({
|
|
|
79056
79585
|
}
|
|
79057
79586
|
return void 0;
|
|
79058
79587
|
}, [isVisible, sheet]);
|
|
79059
|
-
(0,
|
|
79588
|
+
(0, import_react333.useEffect)(
|
|
79060
79589
|
() => () => {
|
|
79061
79590
|
if (pendingCloseRef.current) {
|
|
79062
79591
|
clearTimeout(pendingCloseRef.current);
|
|
@@ -79064,13 +79593,13 @@ var BottomSheetProvider = ({
|
|
|
79064
79593
|
},
|
|
79065
79594
|
[]
|
|
79066
79595
|
);
|
|
79067
|
-
const controls = (0,
|
|
79596
|
+
const controls = (0, import_react333.useMemo)(
|
|
79068
79597
|
() => ({
|
|
79069
79598
|
dismiss: dismissSheet
|
|
79070
79599
|
}),
|
|
79071
79600
|
[dismissSheet]
|
|
79072
79601
|
);
|
|
79073
|
-
const contextValue = (0,
|
|
79602
|
+
const contextValue = (0, import_react333.useMemo)(
|
|
79074
79603
|
() => ({
|
|
79075
79604
|
presentSheet,
|
|
79076
79605
|
dismissSheet,
|
|
@@ -79080,11 +79609,11 @@ var BottomSheetProvider = ({
|
|
|
79080
79609
|
[presentSheet, dismissSheet, sheet, isVisible]
|
|
79081
79610
|
);
|
|
79082
79611
|
const overlayNode = typeof document !== "undefined" && sheet ? (0, import_react_dom21.createPortal)(
|
|
79083
|
-
/* @__PURE__ */ (0,
|
|
79084
|
-
/* @__PURE__ */ (0,
|
|
79612
|
+
/* @__PURE__ */ (0, import_jsx_runtime360.jsxs)("div", { className: "pointer-events-none fixed inset-0 z-[70] flex items-end justify-center", children: [
|
|
79613
|
+
/* @__PURE__ */ (0, import_jsx_runtime360.jsx)(
|
|
79085
79614
|
"div",
|
|
79086
79615
|
{
|
|
79087
|
-
className: (0,
|
|
79616
|
+
className: (0, import_classnames150.default)(
|
|
79088
79617
|
"absolute inset-0 bg-neutral-900/40 transition-opacity duration-300",
|
|
79089
79618
|
isVisible ? "opacity-100 pointer-events-auto" : "opacity-0"
|
|
79090
79619
|
),
|
|
@@ -79094,24 +79623,24 @@ var BottomSheetProvider = ({
|
|
|
79094
79623
|
}
|
|
79095
79624
|
}
|
|
79096
79625
|
),
|
|
79097
|
-
/* @__PURE__ */ (0,
|
|
79626
|
+
/* @__PURE__ */ (0, import_jsx_runtime360.jsx)("div", { className: "relative w-full max-w-4xl px-4 pb-4 sm:px-8", children: /* @__PURE__ */ (0, import_jsx_runtime360.jsxs)(
|
|
79098
79627
|
"section",
|
|
79099
79628
|
{
|
|
79100
79629
|
role: "dialog",
|
|
79101
79630
|
"aria-modal": "true",
|
|
79102
|
-
className: (0,
|
|
79631
|
+
className: (0, import_classnames150.default)(
|
|
79103
79632
|
"pointer-events-auto ml-auto flex w-full flex-col rounded-t-3xl border border-slate-200 bg-white shadow-2xl transition-transform duration-300 dark:border-slate-700 dark:bg-slate-900",
|
|
79104
79633
|
sheet.className,
|
|
79105
79634
|
isVisible ? "translate-y-0" : "translate-y-full"
|
|
79106
79635
|
),
|
|
79107
79636
|
style: { minHeight: "25vh", maxHeight: "85vh" },
|
|
79108
79637
|
children: [
|
|
79109
|
-
/* @__PURE__ */ (0,
|
|
79110
|
-
/* @__PURE__ */ (0,
|
|
79111
|
-
sheet.title && /* @__PURE__ */ (0,
|
|
79112
|
-
sheet.description && /* @__PURE__ */ (0,
|
|
79638
|
+
/* @__PURE__ */ (0, import_jsx_runtime360.jsxs)("header", { className: "flex items-start justify-between gap-3 border-b border-slate-200 px-6 py-4 dark:border-slate-800", children: [
|
|
79639
|
+
/* @__PURE__ */ (0, import_jsx_runtime360.jsxs)("div", { className: "space-y-1", children: [
|
|
79640
|
+
sheet.title && /* @__PURE__ */ (0, import_jsx_runtime360.jsx)("div", { className: "text-base font-semibold text-slate-900 dark:text-slate-100", children: sheet.title }),
|
|
79641
|
+
sheet.description && /* @__PURE__ */ (0, import_jsx_runtime360.jsx)("p", { className: "text-sm text-slate-500 dark:text-slate-300", children: sheet.description })
|
|
79113
79642
|
] }),
|
|
79114
|
-
(sheet.showCloseButton ?? true) && /* @__PURE__ */ (0,
|
|
79643
|
+
(sheet.showCloseButton ?? true) && /* @__PURE__ */ (0, import_jsx_runtime360.jsx)(
|
|
79115
79644
|
IconButton_default,
|
|
79116
79645
|
{
|
|
79117
79646
|
icon: "Close",
|
|
@@ -79123,21 +79652,21 @@ var BottomSheetProvider = ({
|
|
|
79123
79652
|
}
|
|
79124
79653
|
)
|
|
79125
79654
|
] }),
|
|
79126
|
-
/* @__PURE__ */ (0,
|
|
79127
|
-
sheet.actions && /* @__PURE__ */ (0,
|
|
79655
|
+
/* @__PURE__ */ (0, import_jsx_runtime360.jsx)("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: renderSlot(sheet.content, controls) ?? /* @__PURE__ */ (0, import_jsx_runtime360.jsx)("p", { className: "text-sm text-slate-500", children: "No content provided." }) }),
|
|
79656
|
+
sheet.actions && /* @__PURE__ */ (0, import_jsx_runtime360.jsx)("div", { className: "flex flex-wrap items-center justify-end gap-3 border-t border-slate-200 px-6 py-4 dark:border-slate-800", children: renderSlot(sheet.actions, controls) })
|
|
79128
79657
|
]
|
|
79129
79658
|
}
|
|
79130
79659
|
) })
|
|
79131
79660
|
] }),
|
|
79132
79661
|
document.body
|
|
79133
79662
|
) : null;
|
|
79134
|
-
return /* @__PURE__ */ (0,
|
|
79663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime360.jsxs)(BottomSheetContext.Provider, { value: contextValue, children: [
|
|
79135
79664
|
children,
|
|
79136
79665
|
overlayNode
|
|
79137
79666
|
] });
|
|
79138
79667
|
};
|
|
79139
79668
|
var useBottomSheet = () => {
|
|
79140
|
-
const context = (0,
|
|
79669
|
+
const context = (0, import_react333.useContext)(BottomSheetContext);
|
|
79141
79670
|
if (!context) {
|
|
79142
79671
|
throw new Error("useBottomSheet must be used within a BottomSheetProvider");
|
|
79143
79672
|
}
|
|
@@ -79771,8 +80300,8 @@ var SYSTEM_VARIABLES = [
|
|
|
79771
80300
|
];
|
|
79772
80301
|
|
|
79773
80302
|
// src/components/MetricBar.tsx
|
|
79774
|
-
var
|
|
79775
|
-
var
|
|
80303
|
+
var import_classnames151 = __toESM(require("classnames"), 1);
|
|
80304
|
+
var import_jsx_runtime361 = require("react/jsx-runtime");
|
|
79776
80305
|
var MetricBar = ({
|
|
79777
80306
|
label,
|
|
79778
80307
|
value,
|
|
@@ -79782,7 +80311,7 @@ var MetricBar = ({
|
|
|
79782
80311
|
size = "sm",
|
|
79783
80312
|
className,
|
|
79784
80313
|
...rest
|
|
79785
|
-
}) => /* @__PURE__ */ (0,
|
|
80314
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime361.jsx)(
|
|
79786
80315
|
Progress_default,
|
|
79787
80316
|
{
|
|
79788
80317
|
...rest,
|
|
@@ -79792,13 +80321,13 @@ var MetricBar = ({
|
|
|
79792
80321
|
formatValue: value !== void 0 ? () => String(value) : void 0,
|
|
79793
80322
|
size,
|
|
79794
80323
|
color: tone ?? color2 ?? "blue",
|
|
79795
|
-
className: (0,
|
|
80324
|
+
className: (0, import_classnames151.default)("w-full", className)
|
|
79796
80325
|
}
|
|
79797
80326
|
);
|
|
79798
80327
|
MetricBar.displayName = "MetricBar";
|
|
79799
80328
|
|
|
79800
80329
|
// src/components/NetworkGraph/NetworkGraph.tsx
|
|
79801
|
-
var
|
|
80330
|
+
var import_react335 = require("react");
|
|
79802
80331
|
|
|
79803
80332
|
// src/components/NetworkGraph/model.ts
|
|
79804
80333
|
var CELL = 64;
|
|
@@ -79942,17 +80471,17 @@ function findNetworkPath(edges, source, target) {
|
|
|
79942
80471
|
}
|
|
79943
80472
|
|
|
79944
80473
|
// src/components/NetworkGraph/useNetworkCanvas.ts
|
|
79945
|
-
var
|
|
80474
|
+
var import_react334 = require("react");
|
|
79946
80475
|
function useNetworkCanvas(options) {
|
|
79947
|
-
const canvasRef = (0,
|
|
79948
|
-
const view = (0,
|
|
79949
|
-
const size = (0,
|
|
79950
|
-
const latest = (0,
|
|
79951
|
-
const frame = (0,
|
|
79952
|
-
const [zoom, setZoom] = (0,
|
|
79953
|
-
const colors3 = (0,
|
|
79954
|
-
const textColor = (0,
|
|
79955
|
-
const draw = (0,
|
|
80476
|
+
const canvasRef = (0, import_react334.useRef)(null);
|
|
80477
|
+
const view = (0, import_react334.useRef)({ x: 0, y: 0, zoom: 1 });
|
|
80478
|
+
const size = (0, import_react334.useRef)({ width: 1, height: 1 });
|
|
80479
|
+
const latest = (0, import_react334.useRef)(options);
|
|
80480
|
+
const frame = (0, import_react334.useRef)(null);
|
|
80481
|
+
const [zoom, setZoom] = (0, import_react334.useState)(1);
|
|
80482
|
+
const colors3 = (0, import_react334.useRef)(/* @__PURE__ */ new Map());
|
|
80483
|
+
const textColor = (0, import_react334.useRef)("#737373");
|
|
80484
|
+
const draw = (0, import_react334.useCallback)(() => {
|
|
79956
80485
|
const canvas = canvasRef.current;
|
|
79957
80486
|
const ctx = canvas?.getContext("2d");
|
|
79958
80487
|
if (!canvas || !ctx) return;
|
|
@@ -80052,14 +80581,14 @@ function useNetworkCanvas(options) {
|
|
|
80052
80581
|
}
|
|
80053
80582
|
ctx.globalAlpha = 1;
|
|
80054
80583
|
}, []);
|
|
80055
|
-
const requestDraw = (0,
|
|
80584
|
+
const requestDraw = (0, import_react334.useCallback)(() => {
|
|
80056
80585
|
if (frame.current !== null) return;
|
|
80057
80586
|
frame.current = requestAnimationFrame(() => {
|
|
80058
80587
|
frame.current = null;
|
|
80059
80588
|
draw();
|
|
80060
80589
|
});
|
|
80061
80590
|
}, [draw]);
|
|
80062
|
-
const update = (0,
|
|
80591
|
+
const update = (0, import_react334.useCallback)(
|
|
80063
80592
|
(next) => {
|
|
80064
80593
|
view.current = next;
|
|
80065
80594
|
setZoom(next.zoom);
|
|
@@ -80068,7 +80597,7 @@ function useNetworkCanvas(options) {
|
|
|
80068
80597
|
},
|
|
80069
80598
|
[requestDraw]
|
|
80070
80599
|
);
|
|
80071
|
-
const fit = (0,
|
|
80600
|
+
const fit = (0, import_react334.useCallback)(
|
|
80072
80601
|
() => update(
|
|
80073
80602
|
fitNetwork(
|
|
80074
80603
|
latest.current.nodes,
|
|
@@ -80078,11 +80607,11 @@ function useNetworkCanvas(options) {
|
|
|
80078
80607
|
),
|
|
80079
80608
|
[update]
|
|
80080
80609
|
);
|
|
80081
|
-
const zoomBy = (0,
|
|
80610
|
+
const zoomBy = (0, import_react334.useCallback)(
|
|
80082
80611
|
(factor, x = size.current.width / 2, y = size.current.height / 2) => update(zoomAt(view.current, factor, x, y)),
|
|
80083
80612
|
[update]
|
|
80084
80613
|
);
|
|
80085
|
-
const focusNode = (0,
|
|
80614
|
+
const focusNode = (0, import_react334.useCallback)(
|
|
80086
80615
|
(node) => {
|
|
80087
80616
|
update({
|
|
80088
80617
|
...view.current,
|
|
@@ -80092,14 +80621,14 @@ function useNetworkCanvas(options) {
|
|
|
80092
80621
|
},
|
|
80093
80622
|
[update]
|
|
80094
80623
|
);
|
|
80095
|
-
(0,
|
|
80624
|
+
(0, import_react334.useEffect)(() => {
|
|
80096
80625
|
latest.current = options;
|
|
80097
80626
|
requestDraw();
|
|
80098
80627
|
}, [options, requestDraw]);
|
|
80099
|
-
(0,
|
|
80628
|
+
(0, import_react334.useEffect)(() => {
|
|
80100
80629
|
fit();
|
|
80101
80630
|
}, [options.model, fit]);
|
|
80102
|
-
(0,
|
|
80631
|
+
(0, import_react334.useEffect)(() => {
|
|
80103
80632
|
const canvas = canvasRef.current;
|
|
80104
80633
|
if (!canvas) return;
|
|
80105
80634
|
const measure = () => {
|
|
@@ -80152,7 +80681,7 @@ function useNetworkCanvas(options) {
|
|
|
80152
80681
|
}
|
|
80153
80682
|
|
|
80154
80683
|
// src/components/NetworkGraph/NetworkGraph.tsx
|
|
80155
|
-
var
|
|
80684
|
+
var import_jsx_runtime362 = require("react/jsx-runtime");
|
|
80156
80685
|
var NO_COMMUNITIES = [];
|
|
80157
80686
|
var NO_HIGHLIGHTS = [];
|
|
80158
80687
|
function NetworkGraph({
|
|
@@ -80184,11 +80713,11 @@ function NetworkGraph({
|
|
|
80184
80713
|
}) {
|
|
80185
80714
|
const tone = getSurfaceAccentColor(surfaceTone);
|
|
80186
80715
|
const t = useKitT();
|
|
80187
|
-
const helpId = (0,
|
|
80188
|
-
const layoutRef = (0,
|
|
80189
|
-
const [hasLegendSpace, setHasLegendSpace] = (0,
|
|
80716
|
+
const helpId = (0, import_react335.useId)();
|
|
80717
|
+
const layoutRef = (0, import_react335.useRef)(null);
|
|
80718
|
+
const [hasLegendSpace, setHasLegendSpace] = (0, import_react335.useState)(true);
|
|
80190
80719
|
const legendOnRight = legendPosition === "right" || legendPosition === "auto" && hasLegendSpace;
|
|
80191
|
-
(0,
|
|
80720
|
+
(0, import_react335.useEffect)(() => {
|
|
80192
80721
|
const element = layoutRef.current;
|
|
80193
80722
|
if (!element || legendPosition !== "auto") return;
|
|
80194
80723
|
const measure = () => setHasLegendSpace(element.getBoundingClientRect().width >= 600);
|
|
@@ -80197,38 +80726,38 @@ function NetworkGraph({
|
|
|
80197
80726
|
observer.observe(element);
|
|
80198
80727
|
return () => observer.disconnect();
|
|
80199
80728
|
}, [legendPosition, loading]);
|
|
80200
|
-
const model = (0,
|
|
80729
|
+
const model = (0, import_react335.useMemo)(
|
|
80201
80730
|
() => buildNetwork(nodes, edges, communities),
|
|
80202
80731
|
[nodes, edges, communities]
|
|
80203
80732
|
);
|
|
80204
|
-
const [internalSelected, setInternalSelected] = (0,
|
|
80733
|
+
const [internalSelected, setInternalSelected] = (0, import_react335.useState)(
|
|
80205
80734
|
defaultSelectedNodeId
|
|
80206
80735
|
);
|
|
80207
|
-
const [hidden, setHidden] = (0,
|
|
80208
|
-
const [focused, setFocused] = (0,
|
|
80209
|
-
const [query, setQuery] = (0,
|
|
80210
|
-
const enabled = (0,
|
|
80736
|
+
const [hidden, setHidden] = (0, import_react335.useState)(() => /* @__PURE__ */ new Set());
|
|
80737
|
+
const [focused, setFocused] = (0, import_react335.useState)(null);
|
|
80738
|
+
const [query, setQuery] = (0, import_react335.useState)("");
|
|
80739
|
+
const enabled = (0, import_react335.useMemo)(
|
|
80211
80740
|
() => new Set(
|
|
80212
80741
|
visibleCommunityIds ?? model.groups.filter((g) => !hidden.has(g.id)).map((g) => g.id)
|
|
80213
80742
|
),
|
|
80214
80743
|
[visibleCommunityIds, model, hidden]
|
|
80215
80744
|
);
|
|
80216
|
-
const visibleNodes = (0,
|
|
80745
|
+
const visibleNodes = (0, import_react335.useMemo)(
|
|
80217
80746
|
() => model.nodes.filter((n) => !n.community || enabled.has(n.community)),
|
|
80218
80747
|
[model, enabled]
|
|
80219
80748
|
);
|
|
80220
|
-
const visible = (0,
|
|
80749
|
+
const visible = (0, import_react335.useMemo)(
|
|
80221
80750
|
() => new Set(visibleNodes.map((n) => n.id)),
|
|
80222
80751
|
[visibleNodes]
|
|
80223
80752
|
);
|
|
80224
80753
|
const selection = selectedNodeId === void 0 ? internalSelected : selectedNodeId;
|
|
80225
80754
|
const selected = selection !== null && visible.has(selection) ? selection : null;
|
|
80226
80755
|
const activeFocus = focused !== null && visible.has(focused) ? focused : null;
|
|
80227
|
-
const highlighted = (0,
|
|
80756
|
+
const highlighted = (0, import_react335.useMemo)(
|
|
80228
80757
|
() => new Set(highlightedEdgeIds),
|
|
80229
80758
|
[highlightedEdgeIds]
|
|
80230
80759
|
);
|
|
80231
|
-
const counts = (0,
|
|
80760
|
+
const counts = (0, import_react335.useMemo)(() => {
|
|
80232
80761
|
const result = /* @__PURE__ */ new Map();
|
|
80233
80762
|
for (const n of model.nodes)
|
|
80234
80763
|
if (n.community)
|
|
@@ -80248,7 +80777,7 @@ function NetworkGraph({
|
|
|
80248
80777
|
onViewportChange
|
|
80249
80778
|
});
|
|
80250
80779
|
const locked = disabled || loading;
|
|
80251
|
-
const drag = (0,
|
|
80780
|
+
const drag = (0, import_react335.useRef)(null);
|
|
80252
80781
|
const select = (id) => {
|
|
80253
80782
|
if (locked) return;
|
|
80254
80783
|
if (selectedNodeId === void 0) setInternalSelected(id);
|
|
@@ -80264,7 +80793,7 @@ function NetworkGraph({
|
|
|
80264
80793
|
);
|
|
80265
80794
|
onVisibleCommunitiesChange?.(ids);
|
|
80266
80795
|
};
|
|
80267
|
-
(0,
|
|
80796
|
+
(0, import_react335.useEffect)(() => {
|
|
80268
80797
|
const element = canvas.canvasRef.current;
|
|
80269
80798
|
if (!element || locked) return;
|
|
80270
80799
|
const wheel = (event) => {
|
|
@@ -80313,13 +80842,13 @@ function NetworkGraph({
|
|
|
80313
80842
|
}
|
|
80314
80843
|
};
|
|
80315
80844
|
const focusedNode = model.byId.get(activeFocus ?? selected ?? "");
|
|
80316
|
-
const matchingNodes = (0,
|
|
80845
|
+
const matchingNodes = (0, import_react335.useMemo)(() => {
|
|
80317
80846
|
const search = query.toLocaleLowerCase();
|
|
80318
80847
|
return visibleNodes.filter((n) => (n.label ?? n.id).toLocaleLowerCase().includes(search)).slice(0, 50).map((n) => ({ value: n.id, label: n.label ?? n.id }));
|
|
80319
80848
|
}, [visibleNodes, query]);
|
|
80320
80849
|
const graphHeight = Number.isFinite(height) ? Math.max(160, height) : 480;
|
|
80321
80850
|
const resolvedLegendTone = legendTone === "auto" ? surfaceTone : legendTone;
|
|
80322
|
-
const legendContent = /* @__PURE__ */ (0,
|
|
80851
|
+
const legendContent = /* @__PURE__ */ (0, import_jsx_runtime362.jsxs)(
|
|
80323
80852
|
"fieldset",
|
|
80324
80853
|
{
|
|
80325
80854
|
disabled: locked,
|
|
@@ -80328,8 +80857,8 @@ function NetworkGraph({
|
|
|
80328
80857
|
maxHeight: legendPanel ? Math.max(96, graphHeight - 64) : graphHeight
|
|
80329
80858
|
},
|
|
80330
80859
|
children: [
|
|
80331
|
-
/* @__PURE__ */ (0,
|
|
80332
|
-
/* @__PURE__ */ (0,
|
|
80860
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)("legend", { className: "mb-3 text-xs font-semibold uppercase tracking-widest", children: t("kit.networkGraph.communities") }),
|
|
80861
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80333
80862
|
Checkbox_default,
|
|
80334
80863
|
{
|
|
80335
80864
|
size: "sm",
|
|
@@ -80340,8 +80869,8 @@ function NetworkGraph({
|
|
|
80340
80869
|
onChange: (event) => filter(event.target.checked ? model.groups.map((g) => g.id) : [])
|
|
80341
80870
|
}
|
|
80342
80871
|
),
|
|
80343
|
-
model.groups.map((group) => /* @__PURE__ */ (0,
|
|
80344
|
-
/* @__PURE__ */ (0,
|
|
80872
|
+
model.groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime362.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
80873
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80345
80874
|
Checkbox_default,
|
|
80346
80875
|
{
|
|
80347
80876
|
size: "sm",
|
|
@@ -80353,12 +80882,12 @@ function NetworkGraph({
|
|
|
80353
80882
|
)
|
|
80354
80883
|
}
|
|
80355
80884
|
),
|
|
80356
|
-
/* @__PURE__ */ (0,
|
|
80885
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)("span", { className: "text-xs tabular-nums opacity-60", children: counts.get(group.id) ?? 0 })
|
|
80357
80886
|
] }, group.id))
|
|
80358
80887
|
]
|
|
80359
80888
|
}
|
|
80360
80889
|
);
|
|
80361
|
-
return /* @__PURE__ */ (0,
|
|
80890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80362
80891
|
Panel_default,
|
|
80363
80892
|
{
|
|
80364
80893
|
...panelProps,
|
|
@@ -80369,7 +80898,7 @@ function NetworkGraph({
|
|
|
80369
80898
|
loading,
|
|
80370
80899
|
clickable: false,
|
|
80371
80900
|
scrollable: false,
|
|
80372
|
-
children: /* @__PURE__ */ (0,
|
|
80901
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime362.jsxs)(
|
|
80373
80902
|
"div",
|
|
80374
80903
|
{
|
|
80375
80904
|
className: "flex min-w-0 flex-col gap-3",
|
|
@@ -80377,7 +80906,7 @@ function NetworkGraph({
|
|
|
80377
80906
|
"aria-label": ariaLabel ?? t("kit.networkGraph.name"),
|
|
80378
80907
|
"aria-disabled": locked || void 0,
|
|
80379
80908
|
children: [
|
|
80380
|
-
showControls && /* @__PURE__ */ (0,
|
|
80909
|
+
showControls && /* @__PURE__ */ (0, import_jsx_runtime362.jsx)("div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime362.jsx)("div", { className: "min-w-40 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80381
80910
|
Combobox_default,
|
|
80382
80911
|
{
|
|
80383
80912
|
size: "sm",
|
|
@@ -80399,7 +80928,7 @@ function NetworkGraph({
|
|
|
80399
80928
|
}
|
|
80400
80929
|
}
|
|
80401
80930
|
) }) }),
|
|
80402
|
-
/* @__PURE__ */ (0,
|
|
80931
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsxs)(
|
|
80403
80932
|
"div",
|
|
80404
80933
|
{
|
|
80405
80934
|
ref: layoutRef,
|
|
@@ -80407,13 +80936,13 @@ function NetworkGraph({
|
|
|
80407
80936
|
style: { flexDirection: legendOnRight ? "row" : "column" },
|
|
80408
80937
|
"data-legend-position": legendOnRight ? "right" : "bottom",
|
|
80409
80938
|
children: [
|
|
80410
|
-
/* @__PURE__ */ (0,
|
|
80939
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsxs)(
|
|
80411
80940
|
"div",
|
|
80412
80941
|
{
|
|
80413
80942
|
className: "relative min-w-0 flex-1",
|
|
80414
80943
|
style: { height: graphHeight, minHeight: graphHeight },
|
|
80415
80944
|
children: [
|
|
80416
|
-
/* @__PURE__ */ (0,
|
|
80945
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80417
80946
|
"canvas",
|
|
80418
80947
|
{
|
|
80419
80948
|
ref: canvas.canvasRef,
|
|
@@ -80482,11 +81011,11 @@ function NetworkGraph({
|
|
|
80482
81011
|
}
|
|
80483
81012
|
}
|
|
80484
81013
|
),
|
|
80485
|
-
showControls && /* @__PURE__ */ (0,
|
|
80486
|
-
/* @__PURE__ */ (0,
|
|
81014
|
+
showControls && /* @__PURE__ */ (0, import_jsx_runtime362.jsxs)("div", { className: "absolute bottom-3 right-3 z-10 flex items-center gap-0.5 rounded-lg border border-neutral-200 bg-white/90 p-1 shadow-sm backdrop-blur dark:border-neutral-700 dark:bg-neutral-900/90", children: [
|
|
81015
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80487
81016
|
IconButton_default,
|
|
80488
81017
|
{
|
|
80489
|
-
icon: /* @__PURE__ */ (0,
|
|
81018
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime362.jsxs)(
|
|
80490
81019
|
"svg",
|
|
80491
81020
|
{
|
|
80492
81021
|
viewBox: "0 0 24 24",
|
|
@@ -80497,10 +81026,10 @@ function NetworkGraph({
|
|
|
80497
81026
|
strokeLinejoin: "round",
|
|
80498
81027
|
"aria-hidden": "true",
|
|
80499
81028
|
children: [
|
|
80500
|
-
/* @__PURE__ */ (0,
|
|
80501
|
-
/* @__PURE__ */ (0,
|
|
80502
|
-
/* @__PURE__ */ (0,
|
|
80503
|
-
/* @__PURE__ */ (0,
|
|
81029
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)("path", { d: "M4 9V5a1 1 0 0 1 1-1h4" }),
|
|
81030
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)("path", { d: "M15 4h4a1 1 0 0 1 1 1v4" }),
|
|
81031
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)("path", { d: "M20 15v4a1 1 0 0 1-1 1h-4" }),
|
|
81032
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)("path", { d: "M9 20H5a1 1 0 0 1-1-1v-4" })
|
|
80504
81033
|
]
|
|
80505
81034
|
}
|
|
80506
81035
|
),
|
|
@@ -80513,10 +81042,10 @@ function NetworkGraph({
|
|
|
80513
81042
|
onClick: canvas.fit
|
|
80514
81043
|
}
|
|
80515
81044
|
),
|
|
80516
|
-
/* @__PURE__ */ (0,
|
|
81045
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80517
81046
|
IconButton_default,
|
|
80518
81047
|
{
|
|
80519
|
-
icon: /* @__PURE__ */ (0,
|
|
81048
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80520
81049
|
"svg",
|
|
80521
81050
|
{
|
|
80522
81051
|
viewBox: "0 0 24 24",
|
|
@@ -80525,7 +81054,7 @@ function NetworkGraph({
|
|
|
80525
81054
|
strokeWidth: 2,
|
|
80526
81055
|
strokeLinecap: "round",
|
|
80527
81056
|
"aria-hidden": "true",
|
|
80528
|
-
children: /* @__PURE__ */ (0,
|
|
81057
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime362.jsx)("path", { d: "M6 12h12" })
|
|
80529
81058
|
}
|
|
80530
81059
|
),
|
|
80531
81060
|
size: "xs",
|
|
@@ -80537,7 +81066,7 @@ function NetworkGraph({
|
|
|
80537
81066
|
onClick: () => canvas.zoomBy(0.8)
|
|
80538
81067
|
}
|
|
80539
81068
|
),
|
|
80540
|
-
/* @__PURE__ */ (0,
|
|
81069
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsxs)(
|
|
80541
81070
|
"span",
|
|
80542
81071
|
{
|
|
80543
81072
|
className: "min-w-[3.5ch] px-1 text-center text-[11px] tabular-nums text-neutral-500 dark:text-neutral-400",
|
|
@@ -80548,7 +81077,7 @@ function NetworkGraph({
|
|
|
80548
81077
|
]
|
|
80549
81078
|
}
|
|
80550
81079
|
),
|
|
80551
|
-
/* @__PURE__ */ (0,
|
|
81080
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80552
81081
|
IconButton_default,
|
|
80553
81082
|
{
|
|
80554
81083
|
icon: "Add",
|
|
@@ -80561,7 +81090,7 @@ function NetworkGraph({
|
|
|
80561
81090
|
onClick: () => canvas.zoomBy(1.25)
|
|
80562
81091
|
}
|
|
80563
81092
|
),
|
|
80564
|
-
/* @__PURE__ */ (0,
|
|
81093
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80565
81094
|
IconButton_default,
|
|
80566
81095
|
{
|
|
80567
81096
|
icon: "Reset",
|
|
@@ -80579,18 +81108,18 @@ function NetworkGraph({
|
|
|
80579
81108
|
}
|
|
80580
81109
|
)
|
|
80581
81110
|
] }),
|
|
80582
|
-
!visibleNodes.length && /* @__PURE__ */ (0,
|
|
81111
|
+
!visibleNodes.length && /* @__PURE__ */ (0, import_jsx_runtime362.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center text-sm", children: emptyMessage ?? t("kit.networkGraph.empty") })
|
|
80583
81112
|
]
|
|
80584
81113
|
}
|
|
80585
81114
|
),
|
|
80586
|
-
showCommunities && model.groups.length > 0 && /* @__PURE__ */ (0,
|
|
81115
|
+
showCommunities && model.groups.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80587
81116
|
"div",
|
|
80588
81117
|
{
|
|
80589
81118
|
className: "min-w-0 shrink-0",
|
|
80590
81119
|
style: {
|
|
80591
81120
|
width: legendOnRight ? legendPanel ? 224 : 192 : "100%"
|
|
80592
81121
|
},
|
|
80593
|
-
children: legendPanel ? /* @__PURE__ */ (0,
|
|
81122
|
+
children: legendPanel ? /* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80594
81123
|
Panel_default,
|
|
80595
81124
|
{
|
|
80596
81125
|
variant: legendVariant === "auto" ? variant : legendVariant,
|
|
@@ -80609,8 +81138,8 @@ function NetworkGraph({
|
|
|
80609
81138
|
]
|
|
80610
81139
|
}
|
|
80611
81140
|
),
|
|
80612
|
-
/* @__PURE__ */ (0,
|
|
80613
|
-
/* @__PURE__ */ (0,
|
|
81141
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)("p", { id: helpId, className: "text-xs opacity-70", children: t("kit.networkGraph.instructions") }),
|
|
81142
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80614
81143
|
"p",
|
|
80615
81144
|
{
|
|
80616
81145
|
role: "status",
|
|
@@ -80758,6 +81287,7 @@ function NetworkGraph({
|
|
|
80758
81287
|
FR_KIT_CATALOG,
|
|
80759
81288
|
FUNNEL_MAX_STAGES,
|
|
80760
81289
|
FileUpload,
|
|
81290
|
+
FilterBar,
|
|
80761
81291
|
FormField,
|
|
80762
81292
|
FormLayout,
|
|
80763
81293
|
FormSection,
|