@estiva-app/ui 0.118.0 → 0.119.0
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/ConversationLayout.d.ts.map +1 -1
- package/dist/ListColumn.d.ts +6 -1
- package/dist/ListColumn.d.ts.map +1 -1
- package/dist/NavTree.d.ts.map +1 -1
- package/dist/conversationScroll.d.ts +6 -0
- package/dist/conversationScroll.d.ts.map +1 -1
- package/dist/index.js +165 -116
- package/dist/index.js.map +4 -4
- package/dist/revealCurrentRow.d.ts +28 -0
- package/dist/revealCurrentRow.d.ts.map +1 -0
- package/dist/showInConversation.d.ts +5 -0
- package/dist/showInConversation.d.ts.map +1 -1
- package/package.json +1 -1
- package/registry.json +1 -1
- package/src/ConversationLayout.mdx +5 -2
- package/src/ConversationLayout.scroll.test.tsx +62 -1
- package/src/ConversationLayout.stories.tsx +44 -0
- package/src/ConversationLayout.tsx +33 -2
- package/src/ListColumn.mdx +1 -0
- package/src/ListColumn.stories.tsx +53 -1
- package/src/ListColumn.tsx +10 -2
- package/src/NavTree.mdx +1 -1
- package/src/NavTree.stories.tsx +61 -1
- package/src/NavTree.tsx +7 -33
- package/src/conversationScroll.ts +11 -0
- package/src/revealCurrentRow.test.tsx +168 -0
- package/src/revealCurrentRow.ts +68 -0
- package/src/showInConversation.ts +9 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationLayout.d.ts","sourceRoot":"","sources":["../src/ConversationLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAgB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ConversationLayout.d.ts","sourceRoot":"","sources":["../src/ConversationLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAgB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAaxJ,OAA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AAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAA;IAC7C,0HAA0H;IAC1H,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,yJAAyJ;IACzJ,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,uIAAuI;IACvI,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,wDAAwD;IACxD,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,sBAAsB;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAsJD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,KAAK,EACL,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,GAAG,EACH,KAAK,EACL,KAAK,EACL,GAAG,EACH,OAAe,EACf,KAA0B,EAC1B,MAAM,EACN,KAAkB,EAClB,OAAO,EACP,UAAU,EACV,OAAO,EACP,YAAY,EACZ,IAAI,EACJ,SAAS,GACV,EAAE,uBAAuB,+BA8MzB"}
|
package/dist/ListColumn.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* The list column of a page: the column beside the page's main area that lists
|
|
4
4
|
* what it can open — 290px wide, a line on its right, its name in a
|
|
@@ -15,6 +15,11 @@ import type { ReactNode } from 'react';
|
|
|
15
15
|
* eight mistakes on the page that led to UIG-15: the frame's card clips, so a
|
|
16
16
|
* list that grew past the fold was simply cut off, with nothing to scroll.
|
|
17
17
|
*
|
|
18
|
+
* It shows where the open page lives: its row (a `NavItem` that is `active`)
|
|
19
|
+
* is brought into sight once it is drawn, however late, once for each new open
|
|
20
|
+
* page, and never pulled back after the reader scrolls away (Katerina, 17
|
|
21
|
+
* November: the selected row "could be somewhere above or below the fold").
|
|
22
|
+
*
|
|
18
23
|
* It keeps a crash inside itself (D1, D3): if its rows, its actions or the row
|
|
19
24
|
* above break, the column keeps its title and shows `ErrorBoundary`'s message
|
|
20
25
|
* in the middle of the room the list had, and the rest of the page keeps working.
|
package/dist/ListColumn.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListColumn.d.ts","sourceRoot":"","sources":["../src/ListColumn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ListColumn.d.ts","sourceRoot":"","sources":["../src/ListColumn.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAQ9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,eAAe;IAC9B,oFAAoF;IACpF,KAAK,EAAE,SAAS,CAAA;IAChB,gEAAgE;IAChE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,8GAA8G;IAC9G,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,mHAAmH;IACnH,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,6FAA6F;IAC7F,QAAQ,EAAE,SAAS,CAAA;IACnB,sBAAsB;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAgCD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BAchD"}
|
package/dist/NavTree.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavTree.d.ts","sourceRoot":"","sources":["../src/NavTree.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0D,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAI/G,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"NavTree.d.ts","sourceRoot":"","sources":["../src/NavTree.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0D,KAAK,UAAU,EAAE,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B,+BAyD7O;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAiB,EAAE,UAAU,EAAE,EAAE,YAAY,+BAuChK"}
|
|
@@ -14,6 +14,12 @@ import { type RefObject } from 'react';
|
|
|
14
14
|
export declare const NEAR_BOTTOM_PX = 80;
|
|
15
15
|
/** Whether the box is close enough to the bottom to follow what arrives. */
|
|
16
16
|
export declare function isNearBottom(el: HTMLElement): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Puts one comment in the middle of the comments' box: where two columns land when a conversation opens at a thread, or
|
|
19
|
+
* is asked to show one from outside (Katerina, 17 November: "generalize it so that it works in every similar case").
|
|
20
|
+
* Measured against the box, which is what scrolls.
|
|
21
|
+
*/
|
|
22
|
+
export declare function landOn(el: HTMLElement, item: HTMLElement): void;
|
|
17
23
|
/**
|
|
18
24
|
* The comment at the top of a conversation's view, and how far below the view's top it is: what "the same spot" means
|
|
19
25
|
* to the reader, whatever above it changed height.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversationScroll.d.ts","sourceRoot":"","sources":["../src/conversationScroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE1E;;;;;GAKG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,cAAc,KAAK,CAAA;AAEhC,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAErD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,WAAW,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAWjF;AAED,6FAA6F;AAC7F,eAAO,MAAM,MAAM,GAAI,IAAI,WAAW,EAA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IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAWjF;AAED,6FAA6F;AAC7F,eAAO,MAAM,MAAM,GAAI,IAAI,WAAW,EAAE,IAAI,MAAM,mBAAgG,CAAA;AAElJ;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACxC,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS,EACxC,KAAK,EAAE,MAAM,OAAO,EACpB,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,OAAO,GACf;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CAsDxB;AAED;;;;GAIG;AACH,eAAO,MAAM,MAAM;cAA+B,OAAO;YAAU,MAAM;aAAW;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;YAAU,MAAM;EAAK,CAAA;AAEpI;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAWvE;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa;aAA4B,MAAM,IAAI;aAAW,MAAM,IAAI;SAAgB,CAAA;AAErG;;;GAGG;AACH,eAAO,MAAM,YAAY;WAA0B,MAAM;SAAgB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -4464,10 +4464,52 @@ function NavItem({
|
|
|
4464
4464
|
}
|
|
4465
4465
|
|
|
4466
4466
|
// src/NavTree.tsx
|
|
4467
|
-
import { createContext as createContext8, useContext as useContext8, useEffect as
|
|
4467
|
+
import { createContext as createContext8, useContext as useContext8, useEffect as useEffect11, useRef as useRef17, useState as useState18 } from "react";
|
|
4468
|
+
|
|
4469
|
+
// src/revealCurrentRow.ts
|
|
4470
|
+
import { useEffect as useEffect10, useRef as useRef16 } from "react";
|
|
4471
|
+
var REVEAL_MS = 200;
|
|
4472
|
+
function scrollToRow(row) {
|
|
4473
|
+
let box = row.parentElement;
|
|
4474
|
+
while (box && !(/(auto|scroll)/.test(getComputedStyle(box).overflowY) && box.scrollHeight > box.clientHeight)) box = box.parentElement;
|
|
4475
|
+
if (!box || box === document.documentElement || box === document.body) return;
|
|
4476
|
+
const at = row.getBoundingClientRect();
|
|
4477
|
+
const view = box.getBoundingClientRect();
|
|
4478
|
+
if (at.top < view.top) box.scrollTop -= view.top - at.top;
|
|
4479
|
+
else if (at.bottom > view.bottom) box.scrollTop += Math.min(at.bottom - view.bottom, at.top - view.top);
|
|
4480
|
+
}
|
|
4481
|
+
function useRevealCurrentRow(box, current) {
|
|
4482
|
+
const shown2 = useRef16(void 0);
|
|
4483
|
+
useEffect10(() => {
|
|
4484
|
+
const root = box.current;
|
|
4485
|
+
if (!root) return;
|
|
4486
|
+
let timer;
|
|
4487
|
+
const look = () => {
|
|
4488
|
+
timer = void 0;
|
|
4489
|
+
const row = root.querySelector('[aria-current="page"]');
|
|
4490
|
+
if (!row) return;
|
|
4491
|
+
const key = current ?? row.getAttribute("href") ?? row.textContent ?? "";
|
|
4492
|
+
if (shown2.current === key) return;
|
|
4493
|
+
if (row.getBoundingClientRect().height === 0) return;
|
|
4494
|
+
shown2.current = key;
|
|
4495
|
+
scrollToRow(row);
|
|
4496
|
+
};
|
|
4497
|
+
const soon = () => {
|
|
4498
|
+
if (timer === void 0) timer = setTimeout(look, REVEAL_MS);
|
|
4499
|
+
};
|
|
4500
|
+
const watch = typeof MutationObserver === "undefined" ? void 0 : new MutationObserver(soon);
|
|
4501
|
+
watch?.observe(root, { subtree: true, childList: true, attributes: true, attributeFilter: ["aria-current", "hidden"] });
|
|
4502
|
+
soon();
|
|
4503
|
+
return () => {
|
|
4504
|
+
watch?.disconnect();
|
|
4505
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
4506
|
+
};
|
|
4507
|
+
}, [box, current]);
|
|
4508
|
+
}
|
|
4509
|
+
|
|
4510
|
+
// src/NavTree.tsx
|
|
4468
4511
|
import { jsx as jsx59, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
4469
4512
|
var NAV_TREE_INTENT_MS = 150;
|
|
4470
|
-
var NAV_TREE_REVEAL_MS = 200;
|
|
4471
4513
|
var NAV_TREE_PENDING_MS = 2e3;
|
|
4472
4514
|
function holds(nodes, id) {
|
|
4473
4515
|
return !!nodes && id !== void 0 && nodes.some((node) => node.id === id || holds(node.children ?? null, id));
|
|
@@ -4492,15 +4534,6 @@ function openingFor(groups, selected, selectedParent) {
|
|
|
4492
4534
|
}
|
|
4493
4535
|
return null;
|
|
4494
4536
|
}
|
|
4495
|
-
function scrollToRow(row) {
|
|
4496
|
-
let box = row.parentElement;
|
|
4497
|
-
while (box && !(/(auto|scroll)/.test(getComputedStyle(box).overflowY) && box.scrollHeight > box.clientHeight)) box = box.parentElement;
|
|
4498
|
-
if (!box || box === document.documentElement || box === document.body) return;
|
|
4499
|
-
const at = row.getBoundingClientRect();
|
|
4500
|
-
const view = box.getBoundingClientRect();
|
|
4501
|
-
if (at.top < view.top) box.scrollTop -= view.top - at.top;
|
|
4502
|
-
else if (at.bottom > view.bottom) box.scrollTop += Math.min(at.bottom - view.bottom, at.top - view.top);
|
|
4503
|
-
}
|
|
4504
4537
|
function Line({ message }) {
|
|
4505
4538
|
return /* @__PURE__ */ jsx59(EmptyState, { scope: "rows", message });
|
|
4506
4539
|
}
|
|
@@ -4558,11 +4591,11 @@ function Group({ group, selected, onSelect, opening, storageKey }) {
|
|
|
4558
4591
|
);
|
|
4559
4592
|
}
|
|
4560
4593
|
function NavTreeSection({ id, title, message, loading = false, pending = false, trailing, count, actions, menu, menuLabel, icon, defaultOpen = true, open, onOpenChange, storageKey, openFor, onIntent, children }) {
|
|
4561
|
-
const timer =
|
|
4562
|
-
|
|
4594
|
+
const timer = useRef17(void 0);
|
|
4595
|
+
useEffect11(() => () => clearTimeout(timer.current), []);
|
|
4563
4596
|
const [slow, setSlow] = useState18(false);
|
|
4564
4597
|
if (!pending && slow) setSlow(false);
|
|
4565
|
-
|
|
4598
|
+
useEffect11(() => {
|
|
4566
4599
|
if (!pending) return;
|
|
4567
4600
|
const wait = setTimeout(() => setSlow(true), NAV_TREE_PENDING_MS);
|
|
4568
4601
|
return () => clearTimeout(wait);
|
|
@@ -4608,24 +4641,10 @@ function NavTreeSection({ id, title, message, loading = false, pending = false,
|
|
|
4608
4641
|
}
|
|
4609
4642
|
function NavTree({ title, titleActions, groups, children, selected, selectedParent, selectedGroup, onSelect, emptyMessage = "", storageKey }) {
|
|
4610
4643
|
const opening = groups ? openingFor(groups, selected, selectedParent) : null;
|
|
4611
|
-
const box =
|
|
4612
|
-
|
|
4613
|
-
const
|
|
4614
|
-
|
|
4615
|
-
latest.current = selected;
|
|
4616
|
-
useEffect10(() => {
|
|
4617
|
-
if (selected === void 0 || scrolled.current === selected || waiting.current !== void 0) return;
|
|
4618
|
-
waiting.current = setTimeout(() => {
|
|
4619
|
-
waiting.current = void 0;
|
|
4620
|
-
const row = box.current?.querySelector('[aria-current="page"]');
|
|
4621
|
-
if (!row || row.getBoundingClientRect().height === 0) return;
|
|
4622
|
-
scrolled.current = latest.current;
|
|
4623
|
-
scrollToRow(row);
|
|
4624
|
-
}, NAV_TREE_REVEAL_MS);
|
|
4625
|
-
});
|
|
4626
|
-
useEffect10(() => () => clearTimeout(waiting.current), []);
|
|
4627
|
-
const groupScrolled = useRef16(void 0);
|
|
4628
|
-
useEffect10(() => {
|
|
4644
|
+
const box = useRef17(null);
|
|
4645
|
+
useRevealCurrentRow(box, selected);
|
|
4646
|
+
const groupScrolled = useRef17(void 0);
|
|
4647
|
+
useEffect11(() => {
|
|
4629
4648
|
if (selectedGroup === void 0) {
|
|
4630
4649
|
groupScrolled.current = void 0;
|
|
4631
4650
|
return;
|
|
@@ -4704,10 +4723,10 @@ function Popover({ trigger, anchor, align = "left", side = "bottom", open, onOpe
|
|
|
4704
4723
|
}
|
|
4705
4724
|
|
|
4706
4725
|
// src/SuggestionMenu.tsx
|
|
4707
|
-
import { useCallback as useCallback5, useEffect as
|
|
4726
|
+
import { useCallback as useCallback5, useEffect as useEffect12, useId as useId5, useImperativeHandle, useMemo as useMemo5, useRef as useRef18, useState as useState19 } from "react";
|
|
4708
4727
|
import { jsx as jsx61, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
4709
4728
|
function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sections, itemKey, row, onSelect, handle }) {
|
|
4710
|
-
const last =
|
|
4729
|
+
const last = useRef18(null);
|
|
4711
4730
|
const anchor = useMemo5(() => {
|
|
4712
4731
|
if (typeof rect !== "function") return rect;
|
|
4713
4732
|
return {
|
|
@@ -4724,9 +4743,9 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
|
|
|
4724
4743
|
const [highlight, setHighlight] = useState19(0);
|
|
4725
4744
|
const base = useId5();
|
|
4726
4745
|
const listboxId = `${base}-list`;
|
|
4727
|
-
const chosen =
|
|
4728
|
-
|
|
4729
|
-
|
|
4746
|
+
const chosen = useRef18(null);
|
|
4747
|
+
useEffect12(() => void (chosen.current = highlight > 0 ? keys.split("\n")[highlight] ?? null : null), [highlight]);
|
|
4748
|
+
useEffect12(() => {
|
|
4730
4749
|
const at = chosen.current ? keys.split("\n").indexOf(chosen.current) : -1;
|
|
4731
4750
|
setHighlight(at > 0 ? at : 0);
|
|
4732
4751
|
}, [keys]);
|
|
@@ -4751,7 +4770,7 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
|
|
|
4751
4770
|
}
|
|
4752
4771
|
}), [items, highlight, onSelect]);
|
|
4753
4772
|
const open = rect !== null && items.length > 0;
|
|
4754
|
-
|
|
4773
|
+
useEffect12(() => {
|
|
4755
4774
|
if (!editorElement || !open) return;
|
|
4756
4775
|
editorElement.setAttribute("aria-autocomplete", "list");
|
|
4757
4776
|
editorElement.setAttribute("aria-haspopup", "listbox");
|
|
@@ -4760,7 +4779,7 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
|
|
|
4760
4779
|
for (const name of ["aria-autocomplete", "aria-haspopup", "aria-controls", "aria-activedescendant"]) editorElement.removeAttribute(name);
|
|
4761
4780
|
};
|
|
4762
4781
|
}, [editorElement, open, listboxId]);
|
|
4763
|
-
|
|
4782
|
+
useEffect12(() => {
|
|
4764
4783
|
if (!editorElement || !open) return;
|
|
4765
4784
|
editorElement.setAttribute("aria-activedescendant", `${base}-${highlight}`);
|
|
4766
4785
|
}, [editorElement, open, base, highlight]);
|
|
@@ -4817,12 +4836,12 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
|
|
|
4817
4836
|
}
|
|
4818
4837
|
|
|
4819
4838
|
// src/ShowMore.tsx
|
|
4820
|
-
import { useLayoutEffect as useLayoutEffect5, useRef as
|
|
4839
|
+
import { useLayoutEffect as useLayoutEffect5, useRef as useRef19, useState as useState20 } from "react";
|
|
4821
4840
|
import { IconChevronDown as IconChevronDown4, IconChevronUp } from "@tabler/icons-react";
|
|
4822
4841
|
import { jsx as jsx62, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
4823
4842
|
var FADE = "linear-gradient(to top, transparent, black 40px)";
|
|
4824
4843
|
function ShowMore({ children, maxHeight = 96, contentClassName, className }) {
|
|
4825
|
-
const box =
|
|
4844
|
+
const box = useRef19(null);
|
|
4826
4845
|
const [open, setOpen] = useState20(false);
|
|
4827
4846
|
const [overflows, setOverflows] = useState20(false);
|
|
4828
4847
|
useLayoutEffect5(() => {
|
|
@@ -5700,7 +5719,7 @@ function LinkChip({ link, preview = true }) {
|
|
|
5700
5719
|
}
|
|
5701
5720
|
|
|
5702
5721
|
// src/AttachedCard.tsx
|
|
5703
|
-
import { createContext as createContext10, useContext as useContext12, useEffect as
|
|
5722
|
+
import { createContext as createContext10, useContext as useContext12, useEffect as useEffect13, useRef as useRef20 } from "react";
|
|
5704
5723
|
import { Fragment as Fragment19, jsx as jsx70, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
5705
5724
|
var Attached = createContext10(false);
|
|
5706
5725
|
function useRememberedHeight(link, remember, box) {
|
|
@@ -5709,7 +5728,7 @@ function useRememberedHeight(link, remember, box) {
|
|
|
5709
5728
|
const kept = memory && id && link?.state === "loading" ? memory.of(id, link.kind) : void 0;
|
|
5710
5729
|
const shapeKey = memory && id && link?.state === "ready" ? JSON.stringify(loadingShapeOf(link.linked)) : void 0;
|
|
5711
5730
|
const kind = link?.state === "ready" ? link.linked.kind : link?.kind;
|
|
5712
|
-
|
|
5731
|
+
useEffect13(() => {
|
|
5713
5732
|
const card = box.current;
|
|
5714
5733
|
if (!memory || !id || !kind || !shapeKey || !card) return;
|
|
5715
5734
|
const drawn = JSON.parse(shapeKey);
|
|
@@ -5733,7 +5752,7 @@ function useRememberedHeight(link, remember, box) {
|
|
|
5733
5752
|
return { kept, held: kept?.height ? { minHeight: kept.height } : void 0 };
|
|
5734
5753
|
}
|
|
5735
5754
|
function AttachedCard({ link, children, onRemove, remember }) {
|
|
5736
|
-
const box =
|
|
5755
|
+
const box = useRef20(null);
|
|
5737
5756
|
const { kept, held } = useRememberedHeight(link, remember, box);
|
|
5738
5757
|
const shown2 = link?.state === "loading" && !link.shape && kept ? { ...link, shape: kept } : link;
|
|
5739
5758
|
const card = shown2 ? /* @__PURE__ */ jsx70(LinkCard, { link: shown2 }) : children;
|
|
@@ -6020,7 +6039,7 @@ function ConversationActions({ options, onReact, onReply, resolved = false, onRe
|
|
|
6020
6039
|
}
|
|
6021
6040
|
|
|
6022
6041
|
// src/ConversationCard.tsx
|
|
6023
|
-
import { useContext as useContext14, useLayoutEffect as useLayoutEffect7, useRef as
|
|
6042
|
+
import { useContext as useContext14, useLayoutEffect as useLayoutEffect7, useRef as useRef21, useState as useState26 } from "react";
|
|
6024
6043
|
import { IconArrowNarrowRight, IconCircleCheck as IconCircleCheck4, IconDotsVertical as IconDotsVertical5 } from "@tabler/icons-react";
|
|
6025
6044
|
|
|
6026
6045
|
// src/ConversationMenu.tsx
|
|
@@ -6056,11 +6075,16 @@ function ConversationMenu({ resolved = false, onResolve, onReopen, resolveHint,
|
|
|
6056
6075
|
}
|
|
6057
6076
|
|
|
6058
6077
|
// src/conversationScroll.ts
|
|
6059
|
-
import { createContext as createContext11, useEffect as
|
|
6078
|
+
import { createContext as createContext11, useEffect as useEffect14, useState as useState22 } from "react";
|
|
6060
6079
|
var NEAR_BOTTOM_PX = 80;
|
|
6061
6080
|
function isNearBottom(el) {
|
|
6062
6081
|
return el.scrollHeight - el.scrollTop - el.clientHeight <= NEAR_BOTTOM_PX;
|
|
6063
6082
|
}
|
|
6083
|
+
function landOn(el, item) {
|
|
6084
|
+
const box = el.getBoundingClientRect();
|
|
6085
|
+
const at = item.getBoundingClientRect();
|
|
6086
|
+
el.scrollTop += at.top - box.top - (el.clientHeight - at.height) / 2;
|
|
6087
|
+
}
|
|
6064
6088
|
function anchorIn(el) {
|
|
6065
6089
|
if (typeof document.elementFromPoint !== "function") return void 0;
|
|
6066
6090
|
const box = el.getBoundingClientRect();
|
|
@@ -6075,7 +6099,7 @@ var cardIn = (el, id) => el.querySelector(`[data-conversation-item="${CSS.escape
|
|
|
6075
6099
|
function useSteadyScroll(scrollRef, atBottom, ready, key, enabled) {
|
|
6076
6100
|
const [handle] = useState22(() => ({ rebase: () => {
|
|
6077
6101
|
} }));
|
|
6078
|
-
|
|
6102
|
+
useEffect14(() => {
|
|
6079
6103
|
const el = scrollRef.current;
|
|
6080
6104
|
if (!enabled || !el || typeof ResizeObserver === "undefined") return;
|
|
6081
6105
|
let fromBottom = 0;
|
|
@@ -6406,7 +6430,7 @@ function Words({ children }) {
|
|
|
6406
6430
|
}
|
|
6407
6431
|
function useReactionRefusal(reactions) {
|
|
6408
6432
|
const [refused, setRefused] = useState26();
|
|
6409
|
-
const latest =
|
|
6433
|
+
const latest = useRef21(0);
|
|
6410
6434
|
const toggle = reactions?.onToggle;
|
|
6411
6435
|
if (!reactions || !toggle) return { row: reactions, refused };
|
|
6412
6436
|
const onToggle = (emoji) => {
|
|
@@ -6516,12 +6540,12 @@ function ConversationCard(props) {
|
|
|
6516
6540
|
const resolves = resolved ? onReopen : onResolve;
|
|
6517
6541
|
const lined = inThreadCard;
|
|
6518
6542
|
const toDot = !lined && !!resolved?.note && !isEditing;
|
|
6519
|
-
const root =
|
|
6543
|
+
const root = useRef21(null);
|
|
6520
6544
|
const dotLine = useFaceLine(root, toDot, true);
|
|
6521
6545
|
const settle = () => requestAnimationFrame(() => setHovered(stillHere(root.current)));
|
|
6522
6546
|
const offersMenu = !!resolves || !!menu || !!menuAfter || own && (!!editor || !!onDelete);
|
|
6523
6547
|
const showStrip = hovered && !isEditing && !readOnly;
|
|
6524
|
-
const strip =
|
|
6548
|
+
const strip = useRef21(null);
|
|
6525
6549
|
const wordsEnd = useClearOfStrip(root, strip, showStrip);
|
|
6526
6550
|
const { row: reactionRow, refused: reactionRefused } = useReactionRefusal(reactions);
|
|
6527
6551
|
const react = reactionRow?.onToggle;
|
|
@@ -6654,8 +6678,8 @@ function ReplyCard(props) {
|
|
|
6654
6678
|
const isEditing = editing && !readOnly && !!editor;
|
|
6655
6679
|
const offersMenu = !!menu || !!menuAfter || own && (!!editor || !!onDelete);
|
|
6656
6680
|
const showStrip = hovered && !isEditing && !readOnly && (offersMenu || !!reactions?.onToggle);
|
|
6657
|
-
const root =
|
|
6658
|
-
const strip =
|
|
6681
|
+
const root = useRef21(null);
|
|
6682
|
+
const strip = useRef21(null);
|
|
6659
6683
|
const wordsEnd = useClearOfStrip(root, strip, showStrip);
|
|
6660
6684
|
const settle = () => requestAnimationFrame(() => setHovered(stillHere(root.current)));
|
|
6661
6685
|
const drawn = useContext14(repliesDrawn);
|
|
@@ -6731,7 +6755,7 @@ function ReplyCard(props) {
|
|
|
6731
6755
|
}
|
|
6732
6756
|
|
|
6733
6757
|
// src/ConversationLayout.tsx
|
|
6734
|
-
import { Fragment as Fragment24, useCallback as useCallback6, useEffect as
|
|
6758
|
+
import { Fragment as Fragment24, useCallback as useCallback6, useEffect as useEffect16, useLayoutEffect as useLayoutEffect8, useRef as useRef22, useState as useState28 } from "react";
|
|
6735
6759
|
|
|
6736
6760
|
// src/Panel.tsx
|
|
6737
6761
|
import { jsx as jsx87, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
@@ -6759,8 +6783,55 @@ function Panel(props) {
|
|
|
6759
6783
|
);
|
|
6760
6784
|
}
|
|
6761
6785
|
|
|
6786
|
+
// src/showInConversation.ts
|
|
6787
|
+
var SHOWN_MS = 1800;
|
|
6788
|
+
var WAIT_MS = 3e3;
|
|
6789
|
+
var POLL_MS = 50;
|
|
6790
|
+
var owed = /* @__PURE__ */ new WeakMap();
|
|
6791
|
+
var asked = 0;
|
|
6792
|
+
function find(id, { comments = false }) {
|
|
6793
|
+
const quoted = CSS.escape(id);
|
|
6794
|
+
return document.querySelector(`[data-reply-id="${quoted}"], [data-thread-start="${quoted}"]`) ?? (comments ? document.querySelector(`[data-conversation-item="${quoted}"]`) : null);
|
|
6795
|
+
}
|
|
6796
|
+
function showInConversation(id, options = {}) {
|
|
6797
|
+
asked += 1;
|
|
6798
|
+
return show(id, options);
|
|
6799
|
+
}
|
|
6800
|
+
function show(id, options) {
|
|
6801
|
+
const el = find(id, options);
|
|
6802
|
+
if (!el) return false;
|
|
6803
|
+
el.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
6804
|
+
markShown(el);
|
|
6805
|
+
return true;
|
|
6806
|
+
}
|
|
6807
|
+
function markShown(el) {
|
|
6808
|
+
const previous = owed.get(el);
|
|
6809
|
+
if (previous !== void 0) window.clearTimeout(previous);
|
|
6810
|
+
el.dataset.shown = "true";
|
|
6811
|
+
owed.set(
|
|
6812
|
+
el,
|
|
6813
|
+
window.setTimeout(() => {
|
|
6814
|
+
delete el.dataset.shown;
|
|
6815
|
+
owed.delete(el);
|
|
6816
|
+
}, SHOWN_MS)
|
|
6817
|
+
);
|
|
6818
|
+
}
|
|
6819
|
+
function showInConversationWhenDrawn(id, { wait = WAIT_MS, ...options } = {}) {
|
|
6820
|
+
const mine = ++asked;
|
|
6821
|
+
return new Promise((resolve) => {
|
|
6822
|
+
const deadline = Date.now() + wait;
|
|
6823
|
+
const attempt = () => {
|
|
6824
|
+
if (mine !== asked) return resolve(false);
|
|
6825
|
+
if (show(id, options)) return resolve(true);
|
|
6826
|
+
if (Date.now() >= deadline) return resolve(false);
|
|
6827
|
+
window.setTimeout(attempt, POLL_MS);
|
|
6828
|
+
};
|
|
6829
|
+
attempt();
|
|
6830
|
+
});
|
|
6831
|
+
}
|
|
6832
|
+
|
|
6762
6833
|
// src/seenOnScreen.ts
|
|
6763
|
-
import { useEffect as
|
|
6834
|
+
import { useEffect as useEffect15, useMemo as useMemo6, useState as useState27 } from "react";
|
|
6764
6835
|
var NONE = /* @__PURE__ */ new Set();
|
|
6765
6836
|
var DWELL_MS = 1500;
|
|
6766
6837
|
var TALL_ENOUGH_PX = 120;
|
|
@@ -6769,7 +6840,7 @@ var watchers = /* @__PURE__ */ new WeakMap();
|
|
|
6769
6840
|
function useSeenOnScreen(key) {
|
|
6770
6841
|
const [seen, setSeen] = useState27({ key: null, ids: NONE });
|
|
6771
6842
|
const [watcher] = useState27(() => ({ roots: /* @__PURE__ */ new Map(), watch: { current: null } }));
|
|
6772
|
-
|
|
6843
|
+
useEffect15(() => {
|
|
6773
6844
|
if (!key) return;
|
|
6774
6845
|
const timers = /* @__PURE__ */ new Map();
|
|
6775
6846
|
const showing = /* @__PURE__ */ new Set();
|
|
@@ -6844,7 +6915,7 @@ function useSeenOnScreen(key) {
|
|
|
6844
6915
|
}, [ids, watcher]);
|
|
6845
6916
|
}
|
|
6846
6917
|
function useWatchSeen(seen, root, attribute) {
|
|
6847
|
-
|
|
6918
|
+
useEffect15(() => {
|
|
6848
6919
|
const watcher = seen && watchers.get(seen);
|
|
6849
6920
|
const el = root.current;
|
|
6850
6921
|
if (!watcher || !el) return;
|
|
@@ -6924,7 +6995,7 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
|
|
|
6924
6995
|
] });
|
|
6925
6996
|
}
|
|
6926
6997
|
function UnderItem({ item, isOpen, state, caret }) {
|
|
6927
|
-
const root =
|
|
6998
|
+
const root = useRef22(null);
|
|
6928
6999
|
const line = useFaceLine(root, isOpen);
|
|
6929
7000
|
return /* @__PURE__ */ jsxs66(
|
|
6930
7001
|
Card,
|
|
@@ -6972,7 +7043,7 @@ function ConversationLayout({
|
|
|
6972
7043
|
className
|
|
6973
7044
|
}) {
|
|
6974
7045
|
const beside = threads === "beside";
|
|
6975
|
-
const body =
|
|
7046
|
+
const body = useRef22(null);
|
|
6976
7047
|
const setBody = useCallback6(
|
|
6977
7048
|
(el) => {
|
|
6978
7049
|
body.current = el;
|
|
@@ -6982,7 +7053,8 @@ function ConversationLayout({
|
|
|
6982
7053
|
[bodyRef]
|
|
6983
7054
|
);
|
|
6984
7055
|
useWatchSeen(seen, body, "data-conversation-item");
|
|
6985
|
-
const pressed =
|
|
7056
|
+
const pressed = useRef22(null);
|
|
7057
|
+
const byPress = useRef22(false);
|
|
6986
7058
|
const itemAt = (id) => body.current?.querySelector(`[data-conversation-item="${CSS.escape(id)}"]`) ?? null;
|
|
6987
7059
|
const [caret, setCaret] = useState28(0);
|
|
6988
7060
|
const change = onOpenChange ? (id, next, reply = false) => {
|
|
@@ -6992,6 +7064,7 @@ function ConversationLayout({
|
|
|
6992
7064
|
}
|
|
6993
7065
|
const item = threads === "under" ? itemAt(id) : null;
|
|
6994
7066
|
pressed.current = item ? { id, top: item.getBoundingClientRect().top } : null;
|
|
7067
|
+
byPress.current = true;
|
|
6995
7068
|
onOpenChange(next);
|
|
6996
7069
|
} : void 0;
|
|
6997
7070
|
useLayoutEffect8(() => {
|
|
@@ -7002,13 +7075,13 @@ function ConversationLayout({
|
|
|
7002
7075
|
const moved = item.getBoundingClientRect().top - at.top;
|
|
7003
7076
|
if (moved !== 0) body.current.scrollTop += moved;
|
|
7004
7077
|
}, [open]);
|
|
7005
|
-
const was =
|
|
7006
|
-
|
|
7078
|
+
const was = useRef22(open);
|
|
7079
|
+
useEffect16(() => {
|
|
7007
7080
|
if (open !== void 0 && open !== was.current) setCaret((n) => n + 1);
|
|
7008
7081
|
was.current = open;
|
|
7009
7082
|
}, [open]);
|
|
7010
|
-
const nearBottom =
|
|
7011
|
-
const placedFor =
|
|
7083
|
+
const nearBottom = useRef22(true);
|
|
7084
|
+
const placedFor = useRef22(null);
|
|
7012
7085
|
const placeKey = rememberAs ?? FRESH;
|
|
7013
7086
|
const scrolled = (event) => {
|
|
7014
7087
|
const el = body.current;
|
|
@@ -7028,7 +7101,13 @@ function ConversationLayout({
|
|
|
7028
7101
|
const el = body.current;
|
|
7029
7102
|
if (!el) return;
|
|
7030
7103
|
const left = rememberAs ? places.get(rememberAs) : void 0;
|
|
7031
|
-
|
|
7104
|
+
const opened2 = open !== void 0 ? itemAt(open) : null;
|
|
7105
|
+
if (opened2) {
|
|
7106
|
+
landOn(el, opened2);
|
|
7107
|
+
markShown(opened2);
|
|
7108
|
+
nearBottom.current = isNearBottom(el);
|
|
7109
|
+
if (rememberAs) places.set(rememberAs, { atBottom: nearBottom.current, offset: el.scrollTop, anchor: anchorIn(el), leftAt: Date.now() });
|
|
7110
|
+
} else if (left && !left.atBottom) {
|
|
7032
7111
|
el.scrollTop = left.offset;
|
|
7033
7112
|
const card = left.anchor && cardIn(el, left.anchor.id);
|
|
7034
7113
|
if (card && left.anchor) el.scrollTop += card.getBoundingClientRect().top - el.getBoundingClientRect().top - left.anchor.top;
|
|
@@ -7040,9 +7119,20 @@ function ConversationLayout({
|
|
|
7040
7119
|
}
|
|
7041
7120
|
placedFor.current = placeKey;
|
|
7042
7121
|
}, [beside, placeKey, rememberAs, loading]);
|
|
7122
|
+
useLayoutEffect8(() => {
|
|
7123
|
+
const pressedIt = byPress.current;
|
|
7124
|
+
byPress.current = false;
|
|
7125
|
+
if (!beside || pressedIt || open === void 0 || placedFor.current !== placeKey) return;
|
|
7126
|
+
const el = body.current;
|
|
7127
|
+
const item = itemAt(open);
|
|
7128
|
+
if (!el || !item) return;
|
|
7129
|
+
landOn(el, item);
|
|
7130
|
+
markShown(item);
|
|
7131
|
+
nearBottom.current = isNearBottom(el);
|
|
7132
|
+
}, [open]);
|
|
7043
7133
|
const placed = useCallback6(() => placedFor.current === placeKey, [placeKey]);
|
|
7044
7134
|
useSteadyScroll(body, nearBottom, placed, loading, beside);
|
|
7045
|
-
|
|
7135
|
+
useEffect16(() => {
|
|
7046
7136
|
if (!beside || !rememberAs) return;
|
|
7047
7137
|
return () => {
|
|
7048
7138
|
const left = places.get(rememberAs);
|
|
@@ -7272,7 +7362,7 @@ function NoAccessNotice({ what }) {
|
|
|
7272
7362
|
}
|
|
7273
7363
|
|
|
7274
7364
|
// src/Thread.tsx
|
|
7275
|
-
import { Children, useCallback as useCallback7, useContext as useContext15, useLayoutEffect as useLayoutEffect9, useRef as
|
|
7365
|
+
import { Children, useCallback as useCallback7, useContext as useContext15, useLayoutEffect as useLayoutEffect9, useRef as useRef23, useState as useState32 } from "react";
|
|
7276
7366
|
import { IconX as IconX6 } from "@tabler/icons-react";
|
|
7277
7367
|
import { Fragment as Fragment27, jsx as jsx97, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
7278
7368
|
var always = () => true;
|
|
@@ -7299,7 +7389,7 @@ function Thread({
|
|
|
7299
7389
|
seen,
|
|
7300
7390
|
className
|
|
7301
7391
|
}) {
|
|
7302
|
-
const body =
|
|
7392
|
+
const body = useRef23(null);
|
|
7303
7393
|
const setBody = useCallback7(
|
|
7304
7394
|
(el) => {
|
|
7305
7395
|
body.current = el;
|
|
@@ -7308,10 +7398,10 @@ function Thread({
|
|
|
7308
7398
|
},
|
|
7309
7399
|
[bodyRef]
|
|
7310
7400
|
);
|
|
7311
|
-
const under =
|
|
7401
|
+
const under = useRef23(null);
|
|
7312
7402
|
useWatchSeen(seen, place === "under" ? under : body, "data-reply-id");
|
|
7313
7403
|
const [drawn] = useState32(() => ({ added: 0 }));
|
|
7314
|
-
const last =
|
|
7404
|
+
const last = useRef23(null);
|
|
7315
7405
|
const steady = useSteadyScroll(body, void 0, always, start?.id, place === "beside");
|
|
7316
7406
|
useLayoutEffect9(() => {
|
|
7317
7407
|
const el = body.current;
|
|
@@ -7360,50 +7450,6 @@ function Thread({
|
|
|
7360
7450
|
);
|
|
7361
7451
|
}
|
|
7362
7452
|
|
|
7363
|
-
// src/showInConversation.ts
|
|
7364
|
-
var SHOWN_MS = 1800;
|
|
7365
|
-
var WAIT_MS = 3e3;
|
|
7366
|
-
var POLL_MS = 50;
|
|
7367
|
-
var owed = /* @__PURE__ */ new WeakMap();
|
|
7368
|
-
var asked = 0;
|
|
7369
|
-
function find(id, { comments = false }) {
|
|
7370
|
-
const quoted = CSS.escape(id);
|
|
7371
|
-
return document.querySelector(`[data-reply-id="${quoted}"], [data-thread-start="${quoted}"]`) ?? (comments ? document.querySelector(`[data-conversation-item="${quoted}"]`) : null);
|
|
7372
|
-
}
|
|
7373
|
-
function showInConversation(id, options = {}) {
|
|
7374
|
-
asked += 1;
|
|
7375
|
-
return show(id, options);
|
|
7376
|
-
}
|
|
7377
|
-
function show(id, options) {
|
|
7378
|
-
const el = find(id, options);
|
|
7379
|
-
if (!el) return false;
|
|
7380
|
-
el.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
7381
|
-
const previous = owed.get(el);
|
|
7382
|
-
if (previous !== void 0) window.clearTimeout(previous);
|
|
7383
|
-
el.dataset.shown = "true";
|
|
7384
|
-
owed.set(
|
|
7385
|
-
el,
|
|
7386
|
-
window.setTimeout(() => {
|
|
7387
|
-
delete el.dataset.shown;
|
|
7388
|
-
owed.delete(el);
|
|
7389
|
-
}, SHOWN_MS)
|
|
7390
|
-
);
|
|
7391
|
-
return true;
|
|
7392
|
-
}
|
|
7393
|
-
function showInConversationWhenDrawn(id, { wait = WAIT_MS, ...options } = {}) {
|
|
7394
|
-
const mine = ++asked;
|
|
7395
|
-
return new Promise((resolve) => {
|
|
7396
|
-
const deadline = Date.now() + wait;
|
|
7397
|
-
const attempt = () => {
|
|
7398
|
-
if (mine !== asked) return resolve(false);
|
|
7399
|
-
if (show(id, options)) return resolve(true);
|
|
7400
|
-
if (Date.now() >= deadline) return resolve(false);
|
|
7401
|
-
window.setTimeout(attempt, POLL_MS);
|
|
7402
|
-
};
|
|
7403
|
-
attempt();
|
|
7404
|
-
});
|
|
7405
|
-
}
|
|
7406
|
-
|
|
7407
7453
|
// src/SearchInput.tsx
|
|
7408
7454
|
import "react";
|
|
7409
7455
|
import { Input as Input3 } from "@base-ui/react/input";
|
|
@@ -7468,8 +7514,11 @@ function PageHeader({ title, leading, private: locked = false, after, meta, time
|
|
|
7468
7514
|
}
|
|
7469
7515
|
|
|
7470
7516
|
// src/ListColumn.tsx
|
|
7517
|
+
import { useRef as useRef24 } from "react";
|
|
7471
7518
|
import { jsx as jsx100, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
7472
7519
|
function Column({ title, chevron = false, titleMenu, actions, above, collapsed = false, children, className, broken = false }) {
|
|
7520
|
+
const rows = useRef24(null);
|
|
7521
|
+
useRevealCurrentRow(rows);
|
|
7473
7522
|
return /* @__PURE__ */ jsxs77(
|
|
7474
7523
|
"div",
|
|
7475
7524
|
{
|
|
@@ -7488,7 +7537,7 @@ function Column({ title, chevron = false, titleMenu, actions, above, collapsed =
|
|
|
7488
7537
|
broken ? (
|
|
7489
7538
|
// The message takes the room the list had and centres itself in it (Katerina, 19 September).
|
|
7490
7539
|
/* @__PURE__ */ jsx100("div", { className: "flex min-h-0 flex-1 flex-col px-3", children })
|
|
7491
|
-
) : /* @__PURE__ */ jsx100(ScrollArea, { className: "flex-1", contentClassName: "flex flex-col gap-0.5 px-3 pt-4 pb-3", children })
|
|
7540
|
+
) : /* @__PURE__ */ jsx100(ScrollArea, { className: "flex-1", viewportRef: rows, contentClassName: "flex flex-col gap-0.5 px-3 pt-4 pb-3", children })
|
|
7492
7541
|
]
|
|
7493
7542
|
}
|
|
7494
7543
|
);
|
|
@@ -7508,7 +7557,7 @@ function ListColumn(props) {
|
|
|
7508
7557
|
}
|
|
7509
7558
|
|
|
7510
7559
|
// src/ListTable.tsx
|
|
7511
|
-
import { createContext as createContext13, useCallback as useCallback8, useContext as useContext16, useLayoutEffect as useLayoutEffect10, useRef as
|
|
7560
|
+
import { createContext as createContext13, useCallback as useCallback8, useContext as useContext16, useLayoutEffect as useLayoutEffect10, useRef as useRef25, useState as useState33 } from "react";
|
|
7512
7561
|
import { jsx as jsx101, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
7513
7562
|
var WIDTH_PX = { small: 80, medium: 96, large: 112 };
|
|
7514
7563
|
var WIDTH_CLASSES = { small: "w-20", medium: "w-24", large: "w-28" };
|
|
@@ -7522,7 +7571,7 @@ var ListTableContext = createContext13(null);
|
|
|
7522
7571
|
var showsColumn = (column, shown2) => shown2 === "all" || shown2 === "high" && (column.keep ?? "high") === "high";
|
|
7523
7572
|
var widthOf = (columns, end) => ROW_FRAME_PX + NAME_LEAST_PX + columns.reduce((sum, column) => sum + GAP_PX + WIDTH_PX[sizeOf(column)], 0) + (end ? GAP_PX + END_PX : 0);
|
|
7524
7573
|
function ListTable({ "aria-label": label, nameLabel = "Name", columns, end = false, headings = true, children, className }) {
|
|
7525
|
-
const box =
|
|
7574
|
+
const box = useRef25(null);
|
|
7526
7575
|
const [shown2, setShown] = useState33("all");
|
|
7527
7576
|
const measure = useCallback8(() => {
|
|
7528
7577
|
const width = box.current?.getBoundingClientRect().width ?? 0;
|