@ai-matrx/rich-content 0.2.69 → 0.2.71

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.71
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/rich-content/v0.2.70..npm/rich-content/v0.2.71 -- apps/shared/rich-content`).
7
+ No source changes intended and no consumer action required.
8
+
9
+ ## 0.2.70
10
+
11
+ - `CopyMenuButton trigger`: a host's own control (the phone note dock's labelled Copy tile) as the trigger — the same one click (raw, then Copy raw / formatted / for AI), never a chevron.
12
+
13
+ Consumer action: none.
14
+
3
15
  ## 0.2.69
4
16
  ### printMessage passes artifact attributes
5
17
 
@@ -16,8 +16,16 @@ export interface CopyMenuButtonProps {
16
16
  preserveSelection?: boolean;
17
17
  disabled?: boolean;
18
18
  className?: string;
19
+ /**
20
+ * The host's own control as the trigger (the phone note dock's labelled Copy tile) — same one
21
+ * click (raw, then the three rows), the host's look. Receives the click handler to wire.
22
+ */
23
+ trigger?: (props: {
24
+ onClick: () => void;
25
+ "data-content-copy": "";
26
+ }) => React.ReactElement;
19
27
  }
20
28
  export declare const contentIconButton: (size?: "sm" | "xs") => string;
21
29
  export declare const contentIconSize: (size?: "sm" | "xs") => "h-3.5 w-3.5" | "h-4 w-4";
22
- export declare function CopyMenuButton({ content, copyRaw, copyForAi, label, title, size, preserveSelection, disabled, className, }: CopyMenuButtonProps): React.ReactElement;
30
+ export declare function CopyMenuButton({ content, copyRaw, copyForAi, label, title, size, preserveSelection, disabled, className, trigger, }: CopyMenuButtonProps): React.ReactElement;
23
31
  export default CopyMenuButton;
@@ -28,7 +28,8 @@ function CopyMenuButton({
28
28
  size = "sm",
29
29
  preserveSelection = false,
30
30
  disabled = false,
31
- className
31
+ className,
32
+ trigger
32
33
  }) {
33
34
  const [open, setOpen] = React.useState(false);
34
35
  const [copied, setCopied] = React.useState(false);
@@ -68,8 +69,12 @@ function CopyMenuButton({
68
69
  const keep = preserveSelection ? (event) => event.preventDefault() : void 0;
69
70
  const Icon = copied ? Check : Copy;
70
71
  const name = `Copy ${label}`;
72
+ const openAndCopy = () => {
73
+ void Promise.resolve(run("raw")).then(flash);
74
+ setOpen(true);
75
+ };
71
76
  return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
72
- /* @__PURE__ */ jsx(PopoverAnchor, { asChild: true, children: /* @__PURE__ */ jsx(
77
+ /* @__PURE__ */ jsx(PopoverAnchor, { asChild: true, children: trigger ? trigger({ onClick: openAndCopy, "data-content-copy": "" }) : /* @__PURE__ */ jsx(
73
78
  "button",
74
79
  {
75
80
  type: "button",
@@ -79,10 +84,7 @@ function CopyMenuButton({
79
84
  "data-matrx-button": "",
80
85
  disabled,
81
86
  onMouseDown: keep,
82
- onClick: () => {
83
- void Promise.resolve(run("raw")).then(flash);
84
- setOpen(true);
85
- },
87
+ onClick: openAndCopy,
86
88
  className: cn(contentIconButton(size), copied && "text-foreground", disabled && "pointer-events-none opacity-50", className),
87
89
  children: /* @__PURE__ */ jsx(Icon, { className: contentIconSize(size) })
88
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/rich-content",
3
- "version": "0.2.69",
3
+ "version": "0.2.71",
4
4
  "description": "The AI Matrx formatted-text engine: the one markdown renderer, streaming markdown, the block splitter and renderer, the generic blocks, <RichContent> levels, the rich-document action registry and menus, copy, and the selection toolbar — as portable React.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -130,19 +130,19 @@
130
130
  "unist-util-visit": "^5.1.0",
131
131
  "unist-util-visit-parents": "^6.0.2",
132
132
  "yaml": "^2.9.1",
133
- "@ai-matrx/alchemy": "latest",
134
- "@ai-matrx/canvas": "latest",
133
+ "@ai-matrx/agents": "latest",
135
134
  "@ai-matrx/content-ir": "latest",
135
+ "@ai-matrx/alchemy": "latest",
136
136
  "@ai-matrx/content-ir-react": "latest",
137
+ "@ai-matrx/canvas": "latest",
137
138
  "@ai-matrx/data": "latest",
138
- "@ai-matrx/agents": "latest",
139
139
  "@ai-matrx/diff": "latest",
140
- "@ai-matrx/design-system": "latest",
141
140
  "@ai-matrx/icons": "latest",
142
141
  "@ai-matrx/media": "latest",
143
142
  "@ai-matrx/print": "latest",
144
143
  "@ai-matrx/records-ui": "latest",
145
144
  "@ai-matrx/records": "latest",
145
+ "@ai-matrx/design-system": "latest",
146
146
  "@ai-matrx/kit": "latest"
147
147
  },
148
148
  "peerDependencies": {
@@ -204,5 +204,5 @@
204
204
  "verify:modules-tarball": "node ./scripts/verify-modules-tarball.mjs",
205
205
  "verify:tarball": "node ./scripts/verify-tarball.mjs"
206
206
  },
207
- "gitHead": "4373d5235659e2396e00d67adcaa77c08a2fe7f9"
207
+ "gitHead": "34bd69fa1e3738827a5154368e2c3b780e826ff3"
208
208
  }