@petrarca/sonnet-graph 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1687,6 +1687,7 @@ function ExpandOptionsPanel({
|
|
|
1687
1687
|
const [selectedTypes, setSelectedTypes] = useState3([]);
|
|
1688
1688
|
const [loading, setLoading] = useState3(!!getEdgeTypes);
|
|
1689
1689
|
const [offset, setOffset] = useState3({ x: 0, y: 0 });
|
|
1690
|
+
const expandBtnRef = useRef(null);
|
|
1690
1691
|
const dragRef = useRef(null);
|
|
1691
1692
|
const onPointerDown = useCallback2(
|
|
1692
1693
|
(e) => {
|
|
@@ -1736,6 +1737,11 @@ function ExpandOptionsPanel({
|
|
|
1736
1737
|
};
|
|
1737
1738
|
const allSelected = selectedTypes.length === edgeTypes.length;
|
|
1738
1739
|
const noneSelected = edgeTypes.length > 0 && selectedTypes.length === 0;
|
|
1740
|
+
useEffect2(() => {
|
|
1741
|
+
if (!loading && !noneSelected) {
|
|
1742
|
+
expandBtnRef.current?.focus();
|
|
1743
|
+
}
|
|
1744
|
+
}, [loading, noneSelected]);
|
|
1739
1745
|
return /* @__PURE__ */ jsxs4(
|
|
1740
1746
|
"div",
|
|
1741
1747
|
{
|
|
@@ -1825,6 +1831,7 @@ function ExpandOptionsPanel({
|
|
|
1825
1831
|
/* @__PURE__ */ jsx5(
|
|
1826
1832
|
"button",
|
|
1827
1833
|
{
|
|
1834
|
+
ref: expandBtnRef,
|
|
1828
1835
|
className: "w-full py-1.5 text-[11px] font-medium rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",
|
|
1829
1836
|
onClick: handleExpand,
|
|
1830
1837
|
disabled: loading || noneSelected,
|