@ai-matrx/rich-content 0.2.45 → 0.2.46
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,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.46
|
|
4
|
+
|
|
5
|
+
- **A text field's "…" menu reads its text aloud.** `RegistryActionList` has no bar above it,
|
|
6
|
+
so it now lists the bar's primary rows too (new `barlessMenuActions`): plain "Read aloud"
|
|
7
|
+
(`tts-play`) leads ProTextarea's menu instead of being filtered out, leaving only the AI
|
|
8
|
+
summaries. Guard: `variants/shared/__tests__/barless-menu-reads-aloud.test.ts`.
|
|
9
|
+
|
|
10
|
+
Consumer action: none.
|
|
11
|
+
|
|
3
12
|
## 0.2.45
|
|
4
13
|
|
|
5
14
|
- The delimiter guard and the thinking-tag helpers are read from their one home,
|
|
@@ -6,11 +6,11 @@ import { cn } from "@ai-matrx/design-system";
|
|
|
6
6
|
import { useActionSurfaceProvider } from "../runtime/useActionSurfaceProvider.js";
|
|
7
7
|
import {
|
|
8
8
|
AI_SUBMENU_LABEL,
|
|
9
|
+
barlessMenuActions,
|
|
9
10
|
buildMenuTree,
|
|
10
11
|
withAiSlot
|
|
11
12
|
} from "./shared/menuStructure.js";
|
|
12
13
|
import { resolveActionDisplay, runAction } from "./shared/runAction.js";
|
|
13
|
-
import { menuActions } from "./RegistryActionMenu.js";
|
|
14
14
|
const ROW = "flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm text-foreground transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50";
|
|
15
15
|
function RegistryActionList(props) {
|
|
16
16
|
const { content, source, actions, onClose, className, aiSlot } = props;
|
|
@@ -25,7 +25,9 @@ function RegistryActionList(props) {
|
|
|
25
25
|
...getCtx(),
|
|
26
26
|
onClose
|
|
27
27
|
});
|
|
28
|
-
const tree = buildMenuTree(
|
|
28
|
+
const tree = buildMenuTree(barlessMenuActions(resolvedActions), {
|
|
29
|
+
aiSlot: Boolean(aiSlot)
|
|
30
|
+
});
|
|
29
31
|
const submenus = withAiSlot(tree.submenus, Boolean(aiSlot));
|
|
30
32
|
if (!aiSlot && tree.topLevel.length === 0 && tree.submenus.length === 0 && tree.extras.length === 0) {
|
|
31
33
|
return null;
|
|
@@ -68,6 +68,14 @@ export declare function buildMenuTree(input: RichDocumentAction[], options?: {
|
|
|
68
68
|
* keeps every host's tree identical (guard: __tests__/oneMenuTree.test.ts).
|
|
69
69
|
*/
|
|
70
70
|
export declare function registryMenuActions(actions: RichDocumentAction[]): RichDocumentAction[];
|
|
71
|
+
/**
|
|
72
|
+
* The rows of a menu that has NO bar above it (ProTextarea / ProInput's "…"
|
|
73
|
+
* menu). A bar's primary buttons — Read aloud above all — have nowhere else to
|
|
74
|
+
* appear there, so they are listed too, in MENU_STRUCTURE's promoted section
|
|
75
|
+
* (which names them first for exactly these hosts). Dropping them is how a
|
|
76
|
+
* text field's menu lost plain read-aloud and offered only AI summaries.
|
|
77
|
+
*/
|
|
78
|
+
export declare function barlessMenuActions(actions: RichDocumentAction[]): RichDocumentAction[];
|
|
71
79
|
/**
|
|
72
80
|
* The AI submenu, guaranteed present when a host has its own AI rows to fold
|
|
73
81
|
* in (a ProTextarea's bound agents, the v3 agent-shortcut libraries), at the
|
|
@@ -222,6 +222,9 @@ function buildMenuTree(input, options = {}) {
|
|
|
222
222
|
function registryMenuActions(actions) {
|
|
223
223
|
return actions.filter((a) => (a.renderSlot ?? "overflow") !== "primary");
|
|
224
224
|
}
|
|
225
|
+
function barlessMenuActions(actions) {
|
|
226
|
+
return actions;
|
|
227
|
+
}
|
|
225
228
|
function withAiSlot(submenus, hasSlot) {
|
|
226
229
|
if (!hasSlot || submenus.some((s) => s.label === AI_SUBMENU_LABEL)) return submenus;
|
|
227
230
|
const ai = {
|
|
@@ -262,6 +265,7 @@ export {
|
|
|
262
265
|
AI_SUBMENU_LABEL,
|
|
263
266
|
CONVERSATION_SUBMENU_LABEL,
|
|
264
267
|
MENU_STRUCTURE,
|
|
268
|
+
barlessMenuActions,
|
|
265
269
|
buildMenuTree,
|
|
266
270
|
extendMenuSection,
|
|
267
271
|
flattenMenuTreeIds,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-matrx/rich-content",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.46",
|
|
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,21 +130,21 @@
|
|
|
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/agents": "latest",
|
|
133
134
|
"@ai-matrx/alchemy": "latest",
|
|
134
135
|
"@ai-matrx/canvas": "latest",
|
|
135
136
|
"@ai-matrx/content-ir": "latest",
|
|
136
137
|
"@ai-matrx/content-ir-react": "latest",
|
|
137
138
|
"@ai-matrx/data": "latest",
|
|
138
139
|
"@ai-matrx/design-system": "latest",
|
|
140
|
+
"@ai-matrx/diff": "latest",
|
|
139
141
|
"@ai-matrx/icons": "latest",
|
|
140
142
|
"@ai-matrx/kit": "latest",
|
|
141
|
-
"@ai-matrx/print": "latest",
|
|
142
143
|
"@ai-matrx/media": "latest",
|
|
143
|
-
"@ai-matrx/
|
|
144
|
+
"@ai-matrx/print": "latest",
|
|
144
145
|
"@ai-matrx/records": "latest",
|
|
145
146
|
"@ai-matrx/records-ui": "latest",
|
|
146
|
-
"@ai-matrx/tap-target": "latest"
|
|
147
|
-
"@ai-matrx/agents": "latest"
|
|
147
|
+
"@ai-matrx/tap-target": "latest"
|
|
148
148
|
},
|
|
149
149
|
"peerDependencies": {
|
|
150
150
|
"react": ">=19.0.0",
|