@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.cjs CHANGED
@@ -46,7 +46,7 @@ function _interopNamespace(e) {
46
46
  var React28__namespace = /*#__PURE__*/_interopNamespace(React28);
47
47
 
48
48
  // src/version.ts
49
- var version = "0.4.8-alpha";
49
+ var version = "0.4.9-alpha";
50
50
  function Placeholder({ label = "mosaic-blocks placeholder" }) {
51
51
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-mosaic-block": "placeholder", children: label });
52
52
  }
@@ -6047,25 +6047,24 @@ var SOURCE_ICONS = {
6047
6047
  document: FileIcon,
6048
6048
  url: LinkIcon
6049
6049
  };
6050
- function MosaicMemoryCard({
6051
- memory,
6052
- variant = "detailed",
6053
- onEdit,
6054
- onDelete,
6055
- editLabel,
6056
- deleteLabel,
6057
- moreActionsLabel,
6058
- formatScope,
6059
- formatTimeAgo,
6060
- formatUsageCount,
6061
- formatMoreTags,
6062
- className,
6063
- ref
6064
- }) {
6050
+ function MosaicMemoryCard(props) {
6051
+ const {
6052
+ memory,
6053
+ onEdit,
6054
+ onDelete,
6055
+ editLabel,
6056
+ deleteLabel,
6057
+ moreActionsLabel,
6058
+ formatScope,
6059
+ formatTimeAgo,
6060
+ formatUsageCount,
6061
+ className,
6062
+ ref
6063
+ } = props;
6064
+ const variant = props.variant ?? "detailed";
6065
6065
  const [menuOpen, setMenuOpen] = React28__namespace.useState(false);
6066
6066
  const menuRef = React28__namespace.useRef(null);
6067
6067
  const SourceIcon = SOURCE_ICONS[memory.source];
6068
- const isDetailed = variant === "detailed";
6069
6068
  React28__namespace.useEffect(() => {
6070
6069
  if (!menuOpen) return;
6071
6070
  const handler = (event) => {
@@ -6137,7 +6136,7 @@ function MosaicMemoryCard({
6137
6136
  "data-slot": "memory-card",
6138
6137
  "data-variant": variant,
6139
6138
  className: cn53(memoryCardVariants({ variant }), className),
6140
- children: isDetailed ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
6139
+ children: props.variant !== "compact" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
6141
6140
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
6142
6141
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
6143
6142
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg bg-muted p-2 text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(SourceIcon, {}) }),
@@ -6160,7 +6159,7 @@ function MosaicMemoryCard({
6160
6159
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "line-clamp-3 text-sm text-muted-foreground", children: memory.content }),
6161
6160
  /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "memory-tags", className: "flex flex-wrap gap-1", children: [
6162
6161
  visibleTags.map((tag) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn53(memoryTagBadgeVariants()), children: tag }, tag)),
6163
- hiddenTagCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn53(memoryTagBadgeVariants()), children: formatMoreTags(hiddenTagCount) })
6162
+ hiddenTagCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn53(memoryTagBadgeVariants()), children: props.formatMoreTags(hiddenTagCount) })
6164
6163
  ] }),
6165
6164
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between border-t pt-2 text-xs text-muted-foreground", children: [
6166
6165
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1", children: [
@@ -8568,21 +8567,20 @@ function XIcon2() {
8568
8567
  }
8569
8568
  );
8570
8569
  }
8571
- function MosaicModuleForm({
8572
- item,
8573
- mode,
8574
- formFields = [],
8575
- onSave,
8576
- onCancel,
8577
- nameFieldLabel,
8578
- descriptionFieldLabel,
8579
- namePlaceholder,
8580
- descriptionPlaceholder,
8581
- cancelLabel,
8582
- saveChangesLabel,
8583
- createItemLabel,
8584
- tagListAddPlaceholder
8585
- }) {
8570
+ function MosaicModuleForm(props) {
8571
+ const {
8572
+ item,
8573
+ mode,
8574
+ formFields = [],
8575
+ onSave,
8576
+ onCancel,
8577
+ nameFieldLabel,
8578
+ descriptionFieldLabel,
8579
+ namePlaceholder,
8580
+ descriptionPlaceholder,
8581
+ cancelLabel,
8582
+ tagListAddPlaceholder
8583
+ } = props;
8586
8584
  const [formData, setFormData] = React28__namespace.useState({
8587
8585
  name: item?.name ?? "",
8588
8586
  description: item?.description ?? "",
@@ -8780,7 +8778,7 @@ function MosaicModuleForm({
8780
8778
  onClick: handleSave,
8781
8779
  disabled: !formData.name,
8782
8780
  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",
8783
- children: mode === "edit" ? saveChangesLabel : createItemLabel
8781
+ children: props.mode === "edit" ? props.saveChangesLabel : props.createItemLabel
8784
8782
  }
8785
8783
  )
8786
8784
  ] })
@@ -9001,7 +8999,6 @@ function LibraryContent({
9001
8999
  MosaicModuleForm,
9002
9000
  {
9003
9001
  item: editingItem,
9004
- mode: editorMode,
9005
9002
  formFields,
9006
9003
  onSave: handleSave,
9007
9004
  onCancel: () => setEditorOpen(false),
@@ -9010,9 +9007,8 @@ function LibraryContent({
9010
9007
  namePlaceholder,
9011
9008
  descriptionPlaceholder,
9012
9009
  cancelLabel,
9013
- saveChangesLabel,
9014
- createItemLabel,
9015
- tagListAddPlaceholder
9010
+ tagListAddPlaceholder,
9011
+ ...editorMode === "edit" ? { mode: "edit", saveChangesLabel } : { mode: "create", createItemLabel }
9016
9012
  }
9017
9013
  )
9018
9014
  }