@inf-monkeys-tech/monkeys-design 2.0.30 → 2.0.32
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/components/agent-workbench/index.js +53 -11
- package/dist/components/agent-workbench/index.js.map +1 -1
- package/dist/components/agent-workbench/index.mjs +54 -12
- package/dist/components/agent-workbench/index.mjs.map +1 -1
- package/dist/index.js +53 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1818,6 +1818,7 @@ var ICONS = {
|
|
|
1818
1818
|
code: lucideReact.Code2,
|
|
1819
1819
|
"shopping-bag": lucideReact.ShoppingBag
|
|
1820
1820
|
};
|
|
1821
|
+
var QUICK_START_CATEGORY_ID = "__quick-start__";
|
|
1821
1822
|
function TemplateVisual({ template }) {
|
|
1822
1823
|
const Icon2 = ICONS[template.icon || "sparkles"];
|
|
1823
1824
|
if (template.coverImageUrl) {
|
|
@@ -1841,21 +1842,47 @@ function AgentWorkbenchQuickStart({ viewModel, className, onIntent }) {
|
|
|
1841
1842
|
})).filter((category) => category.sections.length > 0),
|
|
1842
1843
|
[viewModel.categories, viewModel.mode]
|
|
1843
1844
|
);
|
|
1844
|
-
const
|
|
1845
|
+
const quickStartCategory = React5.useMemo(() => {
|
|
1846
|
+
const templates = categories.flatMap((category) => category.sections.filter((section) => section.id === "quick-start")).map((section) => section.templates).flat().filter((template, index, allTemplates) => allTemplates.findIndex((item) => item.id === template.id) === index);
|
|
1847
|
+
if (templates.length === 0) return void 0;
|
|
1848
|
+
return {
|
|
1849
|
+
id: QUICK_START_CATEGORY_ID,
|
|
1850
|
+
label: messages.label,
|
|
1851
|
+
icon: "sparkles",
|
|
1852
|
+
sections: [
|
|
1853
|
+
{
|
|
1854
|
+
id: "quick-start",
|
|
1855
|
+
label: messages.label,
|
|
1856
|
+
templates
|
|
1857
|
+
}
|
|
1858
|
+
]
|
|
1859
|
+
};
|
|
1860
|
+
}, [categories, messages.label]);
|
|
1861
|
+
const activeCategory = activeCategoryId === QUICK_START_CATEGORY_ID ? quickStartCategory : categories.find((category) => category.id === activeCategoryId);
|
|
1845
1862
|
const activeSection = activeCategory?.sections.find((section) => section.id === activeSectionId) || activeCategory?.sections[0];
|
|
1846
1863
|
const usesCompactList = activeSection?.templates.length ? activeSection.templates.every((template) => !template.coverImageUrl) : false;
|
|
1847
1864
|
React5.useEffect(() => {
|
|
1848
|
-
if (activeCategoryId && !categories.some((category) => category.id === activeCategoryId)) {
|
|
1865
|
+
if (activeCategoryId && activeCategoryId !== QUICK_START_CATEGORY_ID && !categories.some((category) => category.id === activeCategoryId)) {
|
|
1849
1866
|
setActiveCategoryId(void 0);
|
|
1850
1867
|
setActiveSectionId(void 0);
|
|
1851
1868
|
}
|
|
1852
|
-
|
|
1869
|
+
if (activeCategoryId === QUICK_START_CATEGORY_ID && !quickStartCategory) {
|
|
1870
|
+
setActiveCategoryId(void 0);
|
|
1871
|
+
setActiveSectionId(void 0);
|
|
1872
|
+
}
|
|
1873
|
+
}, [activeCategoryId, categories, quickStartCategory]);
|
|
1853
1874
|
if (categories.length === 0) return null;
|
|
1854
1875
|
const selectCategory = (category) => {
|
|
1855
1876
|
setActiveCategoryId(category.id);
|
|
1856
1877
|
setActiveSectionId(category.sections[0]?.id);
|
|
1857
1878
|
onIntent?.({ type: "change-category", categoryId: category.id });
|
|
1858
1879
|
};
|
|
1880
|
+
const selectQuickStart = () => {
|
|
1881
|
+
if (!quickStartCategory) return;
|
|
1882
|
+
setActiveCategoryId(QUICK_START_CATEGORY_ID);
|
|
1883
|
+
setActiveSectionId(quickStartCategory.sections[0]?.id);
|
|
1884
|
+
onIntent?.({ type: "change-category" });
|
|
1885
|
+
};
|
|
1859
1886
|
const selectSection = (sectionId) => {
|
|
1860
1887
|
if (!activeCategory) return;
|
|
1861
1888
|
setActiveSectionId(sectionId);
|
|
@@ -1904,13 +1931,28 @@ function AgentWorkbenchQuickStart({ viewModel, className, onIntent }) {
|
|
|
1904
1931
|
}
|
|
1905
1932
|
}
|
|
1906
1933
|
),
|
|
1907
|
-
!activeCategory ? /* @__PURE__ */ jsxRuntime.
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1934
|
+
!activeCategory ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex max-w-full items-center justify-center gap-2 overflow-x-auto px-1 pb-1", children: [
|
|
1935
|
+
quickStartCategory ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1936
|
+
"button",
|
|
1937
|
+
{
|
|
1938
|
+
type: "button",
|
|
1939
|
+
className: "inline-flex h-10 shrink-0 items-center gap-2 rounded-full border border-border bg-background px-4 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1940
|
+
"aria-pressed": activeCategoryId === QUICK_START_CATEGORY_ID,
|
|
1941
|
+
onClick: selectQuickStart,
|
|
1942
|
+
children: [
|
|
1943
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, { className: "size-4 text-muted-foreground", "aria-hidden": "true" }),
|
|
1944
|
+
messages.label
|
|
1945
|
+
]
|
|
1946
|
+
}
|
|
1947
|
+
) : null,
|
|
1948
|
+
categories.map((category) => {
|
|
1949
|
+
const Icon2 = ICONS[category.icon || "sparkles"];
|
|
1950
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "inline-flex h-10 shrink-0 items-center gap-2 rounded-full border border-border bg-background px-4 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", onClick: () => selectCategory(category), children: [
|
|
1951
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "size-4 text-muted-foreground", "aria-hidden": "true" }),
|
|
1952
|
+
category.label
|
|
1953
|
+
] }, category.id);
|
|
1954
|
+
})
|
|
1955
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
1914
1956
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 max-w-full items-center gap-1 overflow-x-auto pb-1", children: [
|
|
1915
1957
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1916
1958
|
"button",
|
|
@@ -1928,7 +1970,7 @@ function AgentWorkbenchQuickStart({ viewModel, className, onIntent }) {
|
|
|
1928
1970
|
]
|
|
1929
1971
|
}
|
|
1930
1972
|
),
|
|
1931
|
-
activeCategory.sections.map((section) => /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-pressed": activeSection?.id === section.id, className: cn2("h-9 shrink-0 rounded-full px-4 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", activeSection?.id === section.id ? "bg-muted text-foreground" : "text-muted-foreground hover:bg-muted/70 hover:text-foreground"), onClick: () => selectSection(section.id), children: section.label }, section.id))
|
|
1973
|
+
activeCategory.sections.map((section, index) => /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-pressed": activeSection?.id === section.id, className: cn2("h-9 shrink-0 rounded-full px-4 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", activeSection?.id === section.id ? "bg-muted text-foreground" : "text-muted-foreground hover:bg-muted/70 hover:text-foreground"), onClick: () => selectSection(section.id), children: activeCategory.id !== QUICK_START_CATEGORY_ID && index === 0 ? activeCategory.label : section.label }, section.id))
|
|
1932
1974
|
] }),
|
|
1933
1975
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1934
1976
|
"div",
|