@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/index.js CHANGED
@@ -19213,6 +19213,7 @@ var ICONS = {
19213
19213
  code: lucideReact.Code2,
19214
19214
  "shopping-bag": lucideReact.ShoppingBag
19215
19215
  };
19216
+ var QUICK_START_CATEGORY_ID = "__quick-start__";
19216
19217
  function TemplateVisual({ template }) {
19217
19218
  const Icon2 = ICONS[template.icon || "sparkles"];
19218
19219
  if (template.coverImageUrl) {
@@ -19236,21 +19237,47 @@ function AgentWorkbenchQuickStart({ viewModel, className, onIntent }) {
19236
19237
  })).filter((category) => category.sections.length > 0),
19237
19238
  [viewModel.categories, viewModel.mode]
19238
19239
  );
19239
- const activeCategory = categories.find((category) => category.id === activeCategoryId);
19240
+ const quickStartCategory = React4.useMemo(() => {
19241
+ 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);
19242
+ if (templates.length === 0) return void 0;
19243
+ return {
19244
+ id: QUICK_START_CATEGORY_ID,
19245
+ label: messages.label,
19246
+ icon: "sparkles",
19247
+ sections: [
19248
+ {
19249
+ id: "quick-start",
19250
+ label: messages.label,
19251
+ templates
19252
+ }
19253
+ ]
19254
+ };
19255
+ }, [categories, messages.label]);
19256
+ const activeCategory = activeCategoryId === QUICK_START_CATEGORY_ID ? quickStartCategory : categories.find((category) => category.id === activeCategoryId);
19240
19257
  const activeSection = activeCategory?.sections.find((section) => section.id === activeSectionId) || activeCategory?.sections[0];
19241
19258
  const usesCompactList = activeSection?.templates.length ? activeSection.templates.every((template) => !template.coverImageUrl) : false;
19242
19259
  React4.useEffect(() => {
19243
- if (activeCategoryId && !categories.some((category) => category.id === activeCategoryId)) {
19260
+ if (activeCategoryId && activeCategoryId !== QUICK_START_CATEGORY_ID && !categories.some((category) => category.id === activeCategoryId)) {
19244
19261
  setActiveCategoryId(void 0);
19245
19262
  setActiveSectionId(void 0);
19246
19263
  }
19247
- }, [activeCategoryId, categories]);
19264
+ if (activeCategoryId === QUICK_START_CATEGORY_ID && !quickStartCategory) {
19265
+ setActiveCategoryId(void 0);
19266
+ setActiveSectionId(void 0);
19267
+ }
19268
+ }, [activeCategoryId, categories, quickStartCategory]);
19248
19269
  if (categories.length === 0) return null;
19249
19270
  const selectCategory = (category) => {
19250
19271
  setActiveCategoryId(category.id);
19251
19272
  setActiveSectionId(category.sections[0]?.id);
19252
19273
  onIntent?.({ type: "change-category", categoryId: category.id });
19253
19274
  };
19275
+ const selectQuickStart = () => {
19276
+ if (!quickStartCategory) return;
19277
+ setActiveCategoryId(QUICK_START_CATEGORY_ID);
19278
+ setActiveSectionId(quickStartCategory.sections[0]?.id);
19279
+ onIntent?.({ type: "change-category" });
19280
+ };
19254
19281
  const selectSection = (sectionId) => {
19255
19282
  if (!activeCategory) return;
19256
19283
  setActiveSectionId(sectionId);
@@ -19299,13 +19326,28 @@ function AgentWorkbenchQuickStart({ viewModel, className, onIntent }) {
19299
19326
  }
19300
19327
  }
19301
19328
  ),
19302
- !activeCategory ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex max-w-full items-center justify-center gap-2 overflow-x-auto px-1 pb-1", children: categories.map((category) => {
19303
- const Icon2 = ICONS[category.icon || "sparkles"];
19304
- 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: [
19305
- /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "size-4 text-muted-foreground", "aria-hidden": "true" }),
19306
- category.label
19307
- ] }, category.id);
19308
- }) }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
19329
+ !activeCategory ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex max-w-full items-center justify-center gap-2 overflow-x-auto px-1 pb-1", children: [
19330
+ quickStartCategory ? /* @__PURE__ */ jsxRuntime.jsxs(
19331
+ "button",
19332
+ {
19333
+ type: "button",
19334
+ 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",
19335
+ "aria-pressed": activeCategoryId === QUICK_START_CATEGORY_ID,
19336
+ onClick: selectQuickStart,
19337
+ children: [
19338
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, { className: "size-4 text-muted-foreground", "aria-hidden": "true" }),
19339
+ messages.label
19340
+ ]
19341
+ }
19342
+ ) : null,
19343
+ categories.map((category) => {
19344
+ const Icon2 = ICONS[category.icon || "sparkles"];
19345
+ 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: [
19346
+ /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "size-4 text-muted-foreground", "aria-hidden": "true" }),
19347
+ category.label
19348
+ ] }, category.id);
19349
+ })
19350
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
19309
19351
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 max-w-full items-center gap-1 overflow-x-auto pb-1", children: [
19310
19352
  /* @__PURE__ */ jsxRuntime.jsxs(
19311
19353
  "button",
@@ -19323,7 +19365,7 @@ function AgentWorkbenchQuickStart({ viewModel, className, onIntent }) {
19323
19365
  ]
19324
19366
  }
19325
19367
  ),
19326
- 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))
19368
+ 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))
19327
19369
  ] }),
19328
19370
  /* @__PURE__ */ jsxRuntime.jsx(
19329
19371
  "div",