@ai-matrx/design-system 0.86.329 → 0.86.330
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/CHANGELOG.md +3 -8284
- package/dist/item.cjs +3 -27
- package/dist/item.cjs.map +1 -1
- package/dist/item.d.cts +1 -9
- package/dist/item.d.ts +1 -9
- package/dist/item.js +3 -27
- package/dist/item.js.map +1 -1
- package/dist/menu-look.cjs +27 -8
- package/dist/menu-look.cjs.map +1 -1
- package/dist/menu-look.css +29 -0
- package/dist/menu-look.d.cts +25 -7
- package/dist/menu-look.d.ts +25 -7
- package/dist/menu-look.js +27 -8
- package/dist/menu-look.js.map +1 -1
- package/package.json +2 -2
package/dist/item.cjs
CHANGED
|
@@ -42,7 +42,6 @@ __export(item_exports, {
|
|
|
42
42
|
isCommand: () => isCommand,
|
|
43
43
|
isLink: () => isLink,
|
|
44
44
|
isSubmenu: () => isSubmenu,
|
|
45
|
-
matchSidebarPlaces: () => matchSidebarPlaces,
|
|
46
45
|
resolveItemMenuConfig: () => resolveItemMenuConfig,
|
|
47
46
|
runCommand: () => runCommand,
|
|
48
47
|
runToggle: () => runToggle,
|
|
@@ -3507,21 +3506,6 @@ function splitSidebarPlaces(places, chosen) {
|
|
|
3507
3506
|
const aboveIds = new Set(above.map((p) => p.id));
|
|
3508
3507
|
return { above, more: places.filter((p) => !aboveIds.has(p.id)) };
|
|
3509
3508
|
}
|
|
3510
|
-
function matchSidebarPlaces(pool, query) {
|
|
3511
|
-
const q = query.trim().toLowerCase();
|
|
3512
|
-
if (!q) return [];
|
|
3513
|
-
const seen = /* @__PURE__ */ new Set();
|
|
3514
|
-
const out = [];
|
|
3515
|
-
const visit = (p) => {
|
|
3516
|
-
if (!seen.has(p.id) && p.label.toLowerCase().includes(q)) {
|
|
3517
|
-
seen.add(p.id);
|
|
3518
|
-
out.push({ ...p, children: void 0 });
|
|
3519
|
-
}
|
|
3520
|
-
p.children?.forEach(visit);
|
|
3521
|
-
};
|
|
3522
|
-
pool.forEach(visit);
|
|
3523
|
-
return out;
|
|
3524
|
-
}
|
|
3525
3509
|
function ProductSidebarTop({
|
|
3526
3510
|
status,
|
|
3527
3511
|
search,
|
|
@@ -3537,19 +3521,11 @@ function ProductSidebarTop({
|
|
|
3537
3521
|
}) {
|
|
3538
3522
|
const { above, more } = splitSidebarPlaces(places, chosen);
|
|
3539
3523
|
const groups = (moreGroups ?? []).filter((g) => g.places.length > 0);
|
|
3540
|
-
const searching = !!search?.pool && search.value.trim().length > 0;
|
|
3541
|
-
const matches = searching ? matchSidebarPlaces([...places, ...groups.flatMap((g) => g.places), ...search?.pool ?? []], search.value) : [];
|
|
3542
3524
|
const open = (place) => onOpenPlace?.(place);
|
|
3543
3525
|
const onSearchKeyDown = (e) => {
|
|
3544
|
-
if (
|
|
3545
|
-
if (e.key === "Escape" && search.value) {
|
|
3526
|
+
if (search && e.key === "Escape" && search.value) {
|
|
3546
3527
|
e.preventDefault();
|
|
3547
3528
|
search.onChange("");
|
|
3548
|
-
} else if (e.key === "Enter" && searching && matches[0]) {
|
|
3549
|
-
e.preventDefault();
|
|
3550
|
-
const first = matches[0];
|
|
3551
|
-
if (onOpenPlace) open(first);
|
|
3552
|
-
else if (first.href && typeof window !== "undefined") window.location.assign(first.href);
|
|
3553
3529
|
}
|
|
3554
3530
|
};
|
|
3555
3531
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { "data-product-sidebar-top": "", className: cn("flex shrink-0 flex-col gap-1 px-2 pb-1 pt-2", className), children: [
|
|
@@ -3567,7 +3543,7 @@ function ProductSidebarTop({
|
|
|
3567
3543
|
className: "h-8"
|
|
3568
3544
|
}
|
|
3569
3545
|
) : null,
|
|
3570
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.
|
|
3546
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cn("flex flex-col", search && "pt-1"), children: [
|
|
3571
3547
|
newItem ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3572
3548
|
ItemRow,
|
|
3573
3549
|
{
|
|
@@ -3606,7 +3582,7 @@ function ProductSidebarTop({
|
|
|
3606
3582
|
] }) : null
|
|
3607
3583
|
] })
|
|
3608
3584
|
] }) : null
|
|
3609
|
-
] })
|
|
3585
|
+
] }),
|
|
3610
3586
|
children
|
|
3611
3587
|
] });
|
|
3612
3588
|
}
|