@vantageos/mosaic-blocks 0.4.8-alpha → 0.4.9-alpha

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.d.cts CHANGED
@@ -20,7 +20,7 @@ import { Switch } from '@base-ui/react/switch';
20
20
  export { Tooltip } from '@base-ui/react/tooltip';
21
21
  import 'class-variance-authority/types';
22
22
 
23
- declare const version = "0.4.8-alpha";
23
+ declare const version = "0.4.9-alpha";
24
24
 
25
25
  /**
26
26
  * Placeholder component — infra scaffold only.
@@ -2675,7 +2675,6 @@ interface MosaicAgentComposerProps {
2675
2675
  previewConfigLabel: string;
2676
2676
  customInstructionsPreviewLabel: string;
2677
2677
  selectAllModulesLabel: string;
2678
- requiredLabel: string;
2679
2678
  /** Fallback name shown in the preview when `agentName` is empty. Required, no default. */
2680
2679
  unnamedAgentLabel: string;
2681
2680
  }
@@ -2712,6 +2711,13 @@ declare namespace MosaicAgentComposerDesktop {
2712
2711
  interface MosaicAgentComposerMobileProps extends MosaicAgentComposerProps {
2713
2712
  /** Show loading state on submit button */
2714
2713
  isLoading?: boolean;
2714
+ /**
2715
+ * "Required" marker shown on a mandatory module slot. Declared HERE, not on
2716
+ * the shared MosaicAgentComposerProps, because only the mobile composer
2717
+ * renders it — the desktop one never does. (Moved by the
2718
+ * no-lying-prop-contract guard: a prop is required exactly where it is read.)
2719
+ */
2720
+ requiredLabel: string;
2715
2721
  /**
2716
2722
  * Required host-owned strings (mobile-only extras) — no default,
2717
2723
  * no fallback. The host owns the language (e.g. next-intl `t()`).
@@ -2881,10 +2887,6 @@ interface MosaicDeleteConfirmationDialogProps {
2881
2887
  onOpenChange: (open: boolean) => void;
2882
2888
  /** Called when the user confirms deletion */
2883
2889
  onConfirm: () => void;
2884
- /** Human-readable name of the item to be deleted */
2885
- itemName: string;
2886
- /** Type label shown in the title and button ("agent", "template", etc.). Required, no default. */
2887
- itemType: string;
2888
2890
  /** Dialog title. Required — the host owns the language, no default. */
2889
2891
  title: string;
2890
2892
  /** Dialog description. Required — the host owns the language, no default. */
@@ -3212,6 +3214,15 @@ declare namespace MosaicQuickAgentSelector {
3212
3214
  * required prop or a required formatter function — no optional prop with an
3213
3215
  * English default anywhere in this file.
3214
3216
  *
3217
+ * Props are pushed into the `MosaicMemoryCardVariantProps` discriminated
3218
+ * union exactly where they are read — no prop is required on a variant that
3219
+ * never renders it. `formatMoreTags` is required only on the `"detailed"`
3220
+ * (default) member: the `"compact"` variant drops the tags row entirely and
3221
+ * never calls it, so it is not part of `"compact"`'s member of the union
3222
+ * (fixed after being flagged as a "lying prop contract" by the
3223
+ * `no-lying-prop-contract` guard test — see that file and the memory-card's
3224
+ * own type definitions below).
3225
+ *
3215
3226
  * Closes T1 (bu-mcp memory wave) — mosaic-memory-card.
3216
3227
  *
3217
3228
  * @example
@@ -3258,15 +3269,12 @@ interface MosaicMemoryData {
3258
3269
  createdAt: number;
3259
3270
  usageCount: number;
3260
3271
  }
3261
- interface MosaicMemoryCardProps {
3272
+ /**
3273
+ * Props shared by both variants — read unconditionally regardless of
3274
+ * `variant`.
3275
+ */
3276
+ interface MosaicMemoryCardBaseProps {
3262
3277
  memory: MosaicMemoryData;
3263
- /**
3264
- * Layout density.
3265
- * - `"detailed"` (default): icon chip + tags row + labelled usage footer.
3266
- * - `"compact"`: condensed header row, no tags row, raw usage number.
3267
- * @default "detailed"
3268
- */
3269
- variant?: "detailed" | "compact";
3270
3278
  onEdit?: (memory: MosaicMemoryData) => void;
3271
3279
  onDelete?: (memoryId: string) => void;
3272
3280
  /** Label for the "edit" menu item. Required — host-owned, no default. */
@@ -3295,16 +3303,38 @@ interface MosaicMemoryCardProps {
3295
3303
  * Required — host-owned (e.g. `(count) => t("memory.usageCount", { count })`).
3296
3304
  */
3297
3305
  formatUsageCount: (count: number) => React.ReactNode;
3298
- /**
3299
- * Formatter producing the "+N" overflow caption when a memory has more
3300
- * than 3 tags. Only rendered in the detailed variant. Required —
3301
- * host-owned (e.g. `(count) => \`+\${count}\`` or a pluralized `t()` call).
3302
- */
3303
- formatMoreTags: (count: number) => React.ReactNode;
3304
3306
  className?: string;
3305
3307
  /** React 19 ref prop — forwarded to the root element. */
3306
3308
  ref?: React.Ref<HTMLDivElement>;
3307
3309
  }
3310
+ /**
3311
+ * Discriminated union on `variant` — the sole property that differs between
3312
+ * variants (`formatMoreTags`) is required EXACTLY on the branch that reads
3313
+ * it (`"detailed"`, the default), not on the shared base. The `"compact"`
3314
+ * variant never renders a tags row and therefore never calls
3315
+ * `formatMoreTags` — requiring it there would force every host to supply a
3316
+ * value the library never displays (a "lying prop contract"; see the
3317
+ * `no-lying-prop-contract` guard test and the file's changelog note below).
3318
+ */
3319
+ type MosaicMemoryCardVariantProps = {
3320
+ /**
3321
+ * Full-density layout: icon chip + tags row + labelled usage footer.
3322
+ * Default when omitted.
3323
+ * @default "detailed"
3324
+ */
3325
+ variant?: "detailed";
3326
+ /**
3327
+ * Formatter producing the "+N" overflow caption when a memory has more
3328
+ * than 3 tags. Only ever rendered in the detailed variant — required
3329
+ * here, not on `"compact"`. Host-owned (e.g. `(count) => \`+\${count}\``
3330
+ * or a pluralized `t()` call).
3331
+ */
3332
+ formatMoreTags: (count: number) => React.ReactNode;
3333
+ } | {
3334
+ /** Condensed list row, no tags row, no `formatMoreTags` call. */
3335
+ variant: "compact";
3336
+ };
3337
+ type MosaicMemoryCardProps = MosaicMemoryCardBaseProps & MosaicMemoryCardVariantProps;
3308
3338
  /**
3309
3339
  * MosaicMemoryCard — production memory-item card for @vantageos/mosaic-blocks.
3310
3340
  *
@@ -3312,7 +3342,7 @@ interface MosaicMemoryCardProps {
3312
3342
  * see file JSDoc for the exact desktop/mobile differences and how they were
3313
3343
  * modeled as `variant` + CVA compound variants rather than as two components.
3314
3344
  */
3315
- declare function MosaicMemoryCard({ memory, variant, onEdit, onDelete, editLabel, deleteLabel, moreActionsLabel, formatScope, formatTimeAgo, formatUsageCount, formatMoreTags, className, ref, }: MosaicMemoryCardProps): React.JSX.Element;
3345
+ declare function MosaicMemoryCard(props: MosaicMemoryCardProps): React.JSX.Element;
3316
3346
  declare namespace MosaicMemoryCard {
3317
3347
  var displayName: string;
3318
3348
  }
@@ -3934,9 +3964,9 @@ interface MosaicModuleLibraryProps {
3934
3964
  tagListAddPlaceholder: string;
3935
3965
  className?: string;
3936
3966
  }
3937
- interface MosaicModuleFormProps {
3967
+ /** Props shared by both form modes — read unconditionally. */
3968
+ interface MosaicModuleFormBaseProps {
3938
3969
  item?: MosaicModuleItem;
3939
- mode: "create" | "edit";
3940
3970
  formFields?: MosaicModuleFormField[];
3941
3971
  onSave: (data: Omit<MosaicModuleItem, "id"> | MosaicModuleItem) => void;
3942
3972
  onCancel: () => void;
@@ -3949,8 +3979,6 @@ interface MosaicModuleFormProps {
3949
3979
  namePlaceholder: string;
3950
3980
  descriptionPlaceholder: string;
3951
3981
  cancelLabel: string;
3952
- saveChangesLabel: string;
3953
- createItemLabel: string;
3954
3982
  /**
3955
3983
  * Placeholder for the "add a tag" input in `tag-list` fields (used only
3956
3984
  * when the field itself doesn't set its own `placeholder`). Required,
@@ -3958,7 +3986,25 @@ interface MosaicModuleFormProps {
3958
3986
  */
3959
3987
  tagListAddPlaceholder: string;
3960
3988
  }
3961
- declare function MosaicModuleForm({ item, mode, formFields, onSave, onCancel, nameFieldLabel, descriptionFieldLabel, namePlaceholder, descriptionPlaceholder, cancelLabel, saveChangesLabel, createItemLabel, tagListAddPlaceholder, }: MosaicModuleFormProps): React.JSX.Element;
3989
+ /**
3990
+ * Discriminated union on `mode`. The submit button renders EXACTLY ONE label:
3991
+ * `createItemLabel` in "create", `saveChangesLabel` in "edit". Requiring both
3992
+ * in both modes forced every host to supply a string the form never displays —
3993
+ * a "lying prop contract", found by the `no-lying-prop-contract` guard (the
3994
+ * same defect class as MosaicMemoryCard's `formatMoreTags`). Each label now
3995
+ * lives on the branch that actually renders it.
3996
+ */
3997
+ type MosaicModuleFormModeProps = {
3998
+ mode: "create";
3999
+ /** Submit-button label in create mode. Required here — not in "edit". */
4000
+ createItemLabel: string;
4001
+ } | {
4002
+ mode: "edit";
4003
+ /** Submit-button label in edit mode. Required here — not in "create". */
4004
+ saveChangesLabel: string;
4005
+ };
4006
+ type MosaicModuleFormProps = MosaicModuleFormBaseProps & MosaicModuleFormModeProps;
4007
+ declare function MosaicModuleForm(props: MosaicModuleFormProps): React.JSX.Element;
3962
4008
  declare namespace MosaicModuleForm {
3963
4009
  var displayName: string;
3964
4010
  }
package/dist/index.d.ts CHANGED
@@ -20,7 +20,7 @@ import { Switch } from '@base-ui/react/switch';
20
20
  export { Tooltip } from '@base-ui/react/tooltip';
21
21
  import 'class-variance-authority/types';
22
22
 
23
- declare const version = "0.4.8-alpha";
23
+ declare const version = "0.4.9-alpha";
24
24
 
25
25
  /**
26
26
  * Placeholder component — infra scaffold only.
@@ -2675,7 +2675,6 @@ interface MosaicAgentComposerProps {
2675
2675
  previewConfigLabel: string;
2676
2676
  customInstructionsPreviewLabel: string;
2677
2677
  selectAllModulesLabel: string;
2678
- requiredLabel: string;
2679
2678
  /** Fallback name shown in the preview when `agentName` is empty. Required, no default. */
2680
2679
  unnamedAgentLabel: string;
2681
2680
  }
@@ -2712,6 +2711,13 @@ declare namespace MosaicAgentComposerDesktop {
2712
2711
  interface MosaicAgentComposerMobileProps extends MosaicAgentComposerProps {
2713
2712
  /** Show loading state on submit button */
2714
2713
  isLoading?: boolean;
2714
+ /**
2715
+ * "Required" marker shown on a mandatory module slot. Declared HERE, not on
2716
+ * the shared MosaicAgentComposerProps, because only the mobile composer
2717
+ * renders it — the desktop one never does. (Moved by the
2718
+ * no-lying-prop-contract guard: a prop is required exactly where it is read.)
2719
+ */
2720
+ requiredLabel: string;
2715
2721
  /**
2716
2722
  * Required host-owned strings (mobile-only extras) — no default,
2717
2723
  * no fallback. The host owns the language (e.g. next-intl `t()`).
@@ -2881,10 +2887,6 @@ interface MosaicDeleteConfirmationDialogProps {
2881
2887
  onOpenChange: (open: boolean) => void;
2882
2888
  /** Called when the user confirms deletion */
2883
2889
  onConfirm: () => void;
2884
- /** Human-readable name of the item to be deleted */
2885
- itemName: string;
2886
- /** Type label shown in the title and button ("agent", "template", etc.). Required, no default. */
2887
- itemType: string;
2888
2890
  /** Dialog title. Required — the host owns the language, no default. */
2889
2891
  title: string;
2890
2892
  /** Dialog description. Required — the host owns the language, no default. */
@@ -3212,6 +3214,15 @@ declare namespace MosaicQuickAgentSelector {
3212
3214
  * required prop or a required formatter function — no optional prop with an
3213
3215
  * English default anywhere in this file.
3214
3216
  *
3217
+ * Props are pushed into the `MosaicMemoryCardVariantProps` discriminated
3218
+ * union exactly where they are read — no prop is required on a variant that
3219
+ * never renders it. `formatMoreTags` is required only on the `"detailed"`
3220
+ * (default) member: the `"compact"` variant drops the tags row entirely and
3221
+ * never calls it, so it is not part of `"compact"`'s member of the union
3222
+ * (fixed after being flagged as a "lying prop contract" by the
3223
+ * `no-lying-prop-contract` guard test — see that file and the memory-card's
3224
+ * own type definitions below).
3225
+ *
3215
3226
  * Closes T1 (bu-mcp memory wave) — mosaic-memory-card.
3216
3227
  *
3217
3228
  * @example
@@ -3258,15 +3269,12 @@ interface MosaicMemoryData {
3258
3269
  createdAt: number;
3259
3270
  usageCount: number;
3260
3271
  }
3261
- interface MosaicMemoryCardProps {
3272
+ /**
3273
+ * Props shared by both variants — read unconditionally regardless of
3274
+ * `variant`.
3275
+ */
3276
+ interface MosaicMemoryCardBaseProps {
3262
3277
  memory: MosaicMemoryData;
3263
- /**
3264
- * Layout density.
3265
- * - `"detailed"` (default): icon chip + tags row + labelled usage footer.
3266
- * - `"compact"`: condensed header row, no tags row, raw usage number.
3267
- * @default "detailed"
3268
- */
3269
- variant?: "detailed" | "compact";
3270
3278
  onEdit?: (memory: MosaicMemoryData) => void;
3271
3279
  onDelete?: (memoryId: string) => void;
3272
3280
  /** Label for the "edit" menu item. Required — host-owned, no default. */
@@ -3295,16 +3303,38 @@ interface MosaicMemoryCardProps {
3295
3303
  * Required — host-owned (e.g. `(count) => t("memory.usageCount", { count })`).
3296
3304
  */
3297
3305
  formatUsageCount: (count: number) => React.ReactNode;
3298
- /**
3299
- * Formatter producing the "+N" overflow caption when a memory has more
3300
- * than 3 tags. Only rendered in the detailed variant. Required —
3301
- * host-owned (e.g. `(count) => \`+\${count}\`` or a pluralized `t()` call).
3302
- */
3303
- formatMoreTags: (count: number) => React.ReactNode;
3304
3306
  className?: string;
3305
3307
  /** React 19 ref prop — forwarded to the root element. */
3306
3308
  ref?: React.Ref<HTMLDivElement>;
3307
3309
  }
3310
+ /**
3311
+ * Discriminated union on `variant` — the sole property that differs between
3312
+ * variants (`formatMoreTags`) is required EXACTLY on the branch that reads
3313
+ * it (`"detailed"`, the default), not on the shared base. The `"compact"`
3314
+ * variant never renders a tags row and therefore never calls
3315
+ * `formatMoreTags` — requiring it there would force every host to supply a
3316
+ * value the library never displays (a "lying prop contract"; see the
3317
+ * `no-lying-prop-contract` guard test and the file's changelog note below).
3318
+ */
3319
+ type MosaicMemoryCardVariantProps = {
3320
+ /**
3321
+ * Full-density layout: icon chip + tags row + labelled usage footer.
3322
+ * Default when omitted.
3323
+ * @default "detailed"
3324
+ */
3325
+ variant?: "detailed";
3326
+ /**
3327
+ * Formatter producing the "+N" overflow caption when a memory has more
3328
+ * than 3 tags. Only ever rendered in the detailed variant — required
3329
+ * here, not on `"compact"`. Host-owned (e.g. `(count) => \`+\${count}\``
3330
+ * or a pluralized `t()` call).
3331
+ */
3332
+ formatMoreTags: (count: number) => React.ReactNode;
3333
+ } | {
3334
+ /** Condensed list row, no tags row, no `formatMoreTags` call. */
3335
+ variant: "compact";
3336
+ };
3337
+ type MosaicMemoryCardProps = MosaicMemoryCardBaseProps & MosaicMemoryCardVariantProps;
3308
3338
  /**
3309
3339
  * MosaicMemoryCard — production memory-item card for @vantageos/mosaic-blocks.
3310
3340
  *
@@ -3312,7 +3342,7 @@ interface MosaicMemoryCardProps {
3312
3342
  * see file JSDoc for the exact desktop/mobile differences and how they were
3313
3343
  * modeled as `variant` + CVA compound variants rather than as two components.
3314
3344
  */
3315
- declare function MosaicMemoryCard({ memory, variant, onEdit, onDelete, editLabel, deleteLabel, moreActionsLabel, formatScope, formatTimeAgo, formatUsageCount, formatMoreTags, className, ref, }: MosaicMemoryCardProps): React.JSX.Element;
3345
+ declare function MosaicMemoryCard(props: MosaicMemoryCardProps): React.JSX.Element;
3316
3346
  declare namespace MosaicMemoryCard {
3317
3347
  var displayName: string;
3318
3348
  }
@@ -3934,9 +3964,9 @@ interface MosaicModuleLibraryProps {
3934
3964
  tagListAddPlaceholder: string;
3935
3965
  className?: string;
3936
3966
  }
3937
- interface MosaicModuleFormProps {
3967
+ /** Props shared by both form modes — read unconditionally. */
3968
+ interface MosaicModuleFormBaseProps {
3938
3969
  item?: MosaicModuleItem;
3939
- mode: "create" | "edit";
3940
3970
  formFields?: MosaicModuleFormField[];
3941
3971
  onSave: (data: Omit<MosaicModuleItem, "id"> | MosaicModuleItem) => void;
3942
3972
  onCancel: () => void;
@@ -3949,8 +3979,6 @@ interface MosaicModuleFormProps {
3949
3979
  namePlaceholder: string;
3950
3980
  descriptionPlaceholder: string;
3951
3981
  cancelLabel: string;
3952
- saveChangesLabel: string;
3953
- createItemLabel: string;
3954
3982
  /**
3955
3983
  * Placeholder for the "add a tag" input in `tag-list` fields (used only
3956
3984
  * when the field itself doesn't set its own `placeholder`). Required,
@@ -3958,7 +3986,25 @@ interface MosaicModuleFormProps {
3958
3986
  */
3959
3987
  tagListAddPlaceholder: string;
3960
3988
  }
3961
- declare function MosaicModuleForm({ item, mode, formFields, onSave, onCancel, nameFieldLabel, descriptionFieldLabel, namePlaceholder, descriptionPlaceholder, cancelLabel, saveChangesLabel, createItemLabel, tagListAddPlaceholder, }: MosaicModuleFormProps): React.JSX.Element;
3989
+ /**
3990
+ * Discriminated union on `mode`. The submit button renders EXACTLY ONE label:
3991
+ * `createItemLabel` in "create", `saveChangesLabel` in "edit". Requiring both
3992
+ * in both modes forced every host to supply a string the form never displays —
3993
+ * a "lying prop contract", found by the `no-lying-prop-contract` guard (the
3994
+ * same defect class as MosaicMemoryCard's `formatMoreTags`). Each label now
3995
+ * lives on the branch that actually renders it.
3996
+ */
3997
+ type MosaicModuleFormModeProps = {
3998
+ mode: "create";
3999
+ /** Submit-button label in create mode. Required here — not in "edit". */
4000
+ createItemLabel: string;
4001
+ } | {
4002
+ mode: "edit";
4003
+ /** Submit-button label in edit mode. Required here — not in "create". */
4004
+ saveChangesLabel: string;
4005
+ };
4006
+ type MosaicModuleFormProps = MosaicModuleFormBaseProps & MosaicModuleFormModeProps;
4007
+ declare function MosaicModuleForm(props: MosaicModuleFormProps): React.JSX.Element;
3962
4008
  declare namespace MosaicModuleForm {
3963
4009
  var displayName: string;
3964
4010
  }
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ import { Menu } from '@base-ui/react/menu';
27
27
  import { AlertDialog } from '@base-ui/react/alert-dialog';
28
28
 
29
29
  // src/version.ts
30
- var version = "0.4.8-alpha";
30
+ var version = "0.4.9-alpha";
31
31
  function Placeholder({ label = "mosaic-blocks placeholder" }) {
32
32
  return /* @__PURE__ */ jsx("div", { "data-mosaic-block": "placeholder", children: label });
33
33
  }
@@ -6028,25 +6028,24 @@ var SOURCE_ICONS = {
6028
6028
  document: FileIcon,
6029
6029
  url: LinkIcon
6030
6030
  };
6031
- function MosaicMemoryCard({
6032
- memory,
6033
- variant = "detailed",
6034
- onEdit,
6035
- onDelete,
6036
- editLabel,
6037
- deleteLabel,
6038
- moreActionsLabel,
6039
- formatScope,
6040
- formatTimeAgo,
6041
- formatUsageCount,
6042
- formatMoreTags,
6043
- className,
6044
- ref
6045
- }) {
6031
+ function MosaicMemoryCard(props) {
6032
+ const {
6033
+ memory,
6034
+ onEdit,
6035
+ onDelete,
6036
+ editLabel,
6037
+ deleteLabel,
6038
+ moreActionsLabel,
6039
+ formatScope,
6040
+ formatTimeAgo,
6041
+ formatUsageCount,
6042
+ className,
6043
+ ref
6044
+ } = props;
6045
+ const variant = props.variant ?? "detailed";
6046
6046
  const [menuOpen, setMenuOpen] = React28.useState(false);
6047
6047
  const menuRef = React28.useRef(null);
6048
6048
  const SourceIcon = SOURCE_ICONS[memory.source];
6049
- const isDetailed = variant === "detailed";
6050
6049
  React28.useEffect(() => {
6051
6050
  if (!menuOpen) return;
6052
6051
  const handler = (event) => {
@@ -6118,7 +6117,7 @@ function MosaicMemoryCard({
6118
6117
  "data-slot": "memory-card",
6119
6118
  "data-variant": variant,
6120
6119
  className: cn53(memoryCardVariants({ variant }), className),
6121
- children: isDetailed ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
6120
+ children: props.variant !== "compact" ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
6122
6121
  /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
6123
6122
  /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
6124
6123
  /* @__PURE__ */ jsx("div", { className: "rounded-lg bg-muted p-2 text-muted-foreground", children: /* @__PURE__ */ jsx(SourceIcon, {}) }),
@@ -6141,7 +6140,7 @@ function MosaicMemoryCard({
6141
6140
  /* @__PURE__ */ jsx("p", { className: "line-clamp-3 text-sm text-muted-foreground", children: memory.content }),
6142
6141
  /* @__PURE__ */ jsxs("div", { "data-slot": "memory-tags", className: "flex flex-wrap gap-1", children: [
6143
6142
  visibleTags.map((tag) => /* @__PURE__ */ jsx("span", { className: cn53(memoryTagBadgeVariants()), children: tag }, tag)),
6144
- hiddenTagCount > 0 && /* @__PURE__ */ jsx("span", { className: cn53(memoryTagBadgeVariants()), children: formatMoreTags(hiddenTagCount) })
6143
+ hiddenTagCount > 0 && /* @__PURE__ */ jsx("span", { className: cn53(memoryTagBadgeVariants()), children: props.formatMoreTags(hiddenTagCount) })
6145
6144
  ] }),
6146
6145
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-t pt-2 text-xs text-muted-foreground", children: [
6147
6146
  /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
@@ -8549,21 +8548,20 @@ function XIcon2() {
8549
8548
  }
8550
8549
  );
8551
8550
  }
8552
- function MosaicModuleForm({
8553
- item,
8554
- mode,
8555
- formFields = [],
8556
- onSave,
8557
- onCancel,
8558
- nameFieldLabel,
8559
- descriptionFieldLabel,
8560
- namePlaceholder,
8561
- descriptionPlaceholder,
8562
- cancelLabel,
8563
- saveChangesLabel,
8564
- createItemLabel,
8565
- tagListAddPlaceholder
8566
- }) {
8551
+ function MosaicModuleForm(props) {
8552
+ const {
8553
+ item,
8554
+ mode,
8555
+ formFields = [],
8556
+ onSave,
8557
+ onCancel,
8558
+ nameFieldLabel,
8559
+ descriptionFieldLabel,
8560
+ namePlaceholder,
8561
+ descriptionPlaceholder,
8562
+ cancelLabel,
8563
+ tagListAddPlaceholder
8564
+ } = props;
8567
8565
  const [formData, setFormData] = React28.useState({
8568
8566
  name: item?.name ?? "",
8569
8567
  description: item?.description ?? "",
@@ -8761,7 +8759,7 @@ function MosaicModuleForm({
8761
8759
  onClick: handleSave,
8762
8760
  disabled: !formData.name,
8763
8761
  className: "inline-flex min-h-[44px] items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:pointer-events-none",
8764
- children: mode === "edit" ? saveChangesLabel : createItemLabel
8762
+ children: props.mode === "edit" ? props.saveChangesLabel : props.createItemLabel
8765
8763
  }
8766
8764
  )
8767
8765
  ] })
@@ -8982,7 +8980,6 @@ function LibraryContent({
8982
8980
  MosaicModuleForm,
8983
8981
  {
8984
8982
  item: editingItem,
8985
- mode: editorMode,
8986
8983
  formFields,
8987
8984
  onSave: handleSave,
8988
8985
  onCancel: () => setEditorOpen(false),
@@ -8991,9 +8988,8 @@ function LibraryContent({
8991
8988
  namePlaceholder,
8992
8989
  descriptionPlaceholder,
8993
8990
  cancelLabel,
8994
- saveChangesLabel,
8995
- createItemLabel,
8996
- tagListAddPlaceholder
8991
+ tagListAddPlaceholder,
8992
+ ...editorMode === "edit" ? { mode: "edit", saveChangesLabel } : { mode: "create", createItemLabel }
8997
8993
  }
8998
8994
  )
8999
8995
  }