@ai-matrx/rich-content 0.2.52 → 0.2.54
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 +12 -0
- package/dist/levels/prose/remote-image-policy.d.ts +7 -1
- package/dist/levels/prose/remote-image-policy.js +5 -1
- package/dist/rich-document/RichDocumentActions.d.ts +2 -0
- package/dist/rich-document/RichDocumentActions.js +3 -2
- package/dist/rich-document/variants/ActionBar.d.ts +5 -0
- package/dist/rich-document/variants/ActionBar.js +3 -3
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.54
|
|
4
|
+
|
|
5
|
+
- `RemoteImageGate` (every image the core draws, `DurableMarkdownImg` included) waits for the app's lazy host (`RichContentHostGate`) before it reads the knob hooks. Rendered before the host landed — Write's image island after a reload, whose node view sits outside any gate — it ran the bare defaults, then the app's hooks on the next render: React refused ("Rendered more hooks") and the image vanished.
|
|
6
|
+
|
|
7
|
+
Consumer action: none.
|
|
8
|
+
|
|
9
|
+
## 0.2.53
|
|
10
|
+
|
|
11
|
+
- `RichDocumentActions` / `ActionBar` take `contentActions={false}` for a host whose own bar already carries the content action set for the same item (a `<RichCopySplit>` beside it), so Copy, Export, Print and Transform show once.
|
|
12
|
+
|
|
13
|
+
Consumer action: none.
|
|
14
|
+
|
|
3
15
|
## 0.2.52
|
|
4
16
|
|
|
5
17
|
- `copy/ContentActions` — THE content action set (Arman, 2026-10-08): compact icons for a host's existing bar — split Copy, Plain/Formatted (the item's exact source, monospace, wrapped, selectable; per item, in memory), Export (one click: PDF · Word · HTML · Markdown file · Text file), Print, Transform (the Alchemy palette). On a phone it folds to Copy + "…" with every action one tap inside. `ContentView` / `PlainTextView` / `usePlainView` (copy/content-view-store) let a host's content area honor the switch; `hasContentActions(key)` lets a ⋯ row that duplicates the set hide itself.
|
|
@@ -25,8 +25,14 @@ export declare function remoteImageHost(src: string): string | null;
|
|
|
25
25
|
/**
|
|
26
26
|
* Renders `children` (the real image) when it may load; otherwise the
|
|
27
27
|
* click-to-load placeholder. `block` lays the placeholder out as a line.
|
|
28
|
+
*
|
|
29
|
+
* It reads the app's knob hooks, so it waits for the app's lazy host first
|
|
30
|
+
* (RichContentHostGate): rendered before the host lands it would run the bare
|
|
31
|
+
* defaults, then the app's hooks on the next render — a different hook list
|
|
32
|
+
* React refuses, and the image vanished. Write's image island hit exactly that
|
|
33
|
+
* after a reload (its node view mounts outside any gate); Read sits behind one.
|
|
28
34
|
*/
|
|
29
|
-
export declare function RemoteImageGate(
|
|
35
|
+
export declare function RemoteImageGate(props: {
|
|
30
36
|
src: string;
|
|
31
37
|
alt?: string;
|
|
32
38
|
block?: boolean;
|
|
@@ -5,6 +5,7 @@ import { ImageOff } from "lucide-react";
|
|
|
5
5
|
import { recognizeOurFileUrl } from "@ai-matrx/media/files/engine/media/our-file-sources";
|
|
6
6
|
import { imageKnobPrincipals as sessionKnobPrincipals, setImageKnobMapEntry as setUserKnobMapEntry, useImageKnob as useEffectiveKnob } from "../../host/app-bindings.js";
|
|
7
7
|
import { ErrorNotice } from "../../host/ErrorNotice.js";
|
|
8
|
+
import { RichContentHostGate } from "../../host/RichContentHostGate.js";
|
|
8
9
|
function withImagePolicy(declaration, node) {
|
|
9
10
|
return declaration && declaration !== "inherit" ? /* @__PURE__ */ jsx(ImagePolicyProvider, { value: declaration, children: node }) : node;
|
|
10
11
|
}
|
|
@@ -47,7 +48,10 @@ function remoteImageHost(src) {
|
|
|
47
48
|
function asHostMap(v) {
|
|
48
49
|
return v && typeof v === "object" && !Array.isArray(v) ? v : {};
|
|
49
50
|
}
|
|
50
|
-
function RemoteImageGate({
|
|
51
|
+
function RemoteImageGate(props) {
|
|
52
|
+
return /* @__PURE__ */ jsx(RichContentHostGate, { fallback: /* @__PURE__ */ jsx("span", { "data-rc-image-waiting": "", "aria-label": props.alt || "Image" }), children: /* @__PURE__ */ jsx(RemoteImageGateWithHost, { ...props }) });
|
|
53
|
+
}
|
|
54
|
+
function RemoteImageGateWithHost({
|
|
51
55
|
src,
|
|
52
56
|
alt,
|
|
53
57
|
block = false,
|
|
@@ -7,6 +7,8 @@ export interface RichDocumentActionsProps {
|
|
|
7
7
|
className?: string;
|
|
8
8
|
/** Hide the ⋯ overflow menu (the primary row still renders). */
|
|
9
9
|
hideOverflow?: boolean;
|
|
10
|
+
/** False only where the host's own bar already carries the content action set for this item. */
|
|
11
|
+
contentActions?: boolean;
|
|
10
12
|
}
|
|
11
13
|
export declare function RichDocumentActions(props: RichDocumentActionsProps): React.ReactElement;
|
|
12
14
|
export default RichDocumentActions;
|
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useActionSurfaceProvider } from "./runtime/useActionSurfaceProvider.js";
|
|
4
4
|
import { ActionBar } from "./variants/ActionBar.js";
|
|
5
5
|
function RichDocumentActions(props) {
|
|
6
|
-
const { content, source, actions, className, hideOverflow } = props;
|
|
6
|
+
const { content, source, actions, className, hideOverflow, contentActions } = props;
|
|
7
7
|
const { ctx, getCtx, resolvedActions, target } = useActionSurfaceProvider({
|
|
8
8
|
content,
|
|
9
9
|
source,
|
|
@@ -18,7 +18,8 @@ function RichDocumentActions(props) {
|
|
|
18
18
|
target,
|
|
19
19
|
sourceId: ctx.instanceKey("alchemy"),
|
|
20
20
|
className,
|
|
21
|
-
hideOverflow
|
|
21
|
+
hideOverflow,
|
|
22
|
+
contentActions
|
|
22
23
|
}
|
|
23
24
|
);
|
|
24
25
|
}
|
|
@@ -13,6 +13,11 @@ export interface ActionBarProps {
|
|
|
13
13
|
hideOverflow?: boolean;
|
|
14
14
|
/** Condensed presentation (the "mini-bar" variant). */
|
|
15
15
|
mini?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Render the content action set (default true). False ONLY where the host's own bar
|
|
18
|
+
* already carries it for the same item (a `<RichCopySplit>` beside this bar) — never twice.
|
|
19
|
+
*/
|
|
20
|
+
contentActions?: boolean;
|
|
16
21
|
}
|
|
17
22
|
/** The registry rows the split Copy runs, by flavor (features/rich-document/actions/handlers/transfer.ts). */
|
|
18
23
|
export declare const SPLIT_COPY_ACTION_IDS: Readonly<Record<SplitCopyFlavor, string>>;
|
|
@@ -28,7 +28,7 @@ const EXPORT_ACTION_IDS = {
|
|
|
28
28
|
html: "download-html"
|
|
29
29
|
};
|
|
30
30
|
function ActionBar(props) {
|
|
31
|
-
const { actions, getCtx, target, sourceId, className, hideOverflow = false, mini = false } = props;
|
|
31
|
+
const { actions, getCtx, target, sourceId, className, hideOverflow = false, mini = false, contentActions = true } = props;
|
|
32
32
|
useRichDocumentProvider();
|
|
33
33
|
const oneMenu = useOneMenuFor(getCtx().source);
|
|
34
34
|
const hasCopy = actions.some((action) => action.category === "copy");
|
|
@@ -57,7 +57,7 @@ function ActionBar(props) {
|
|
|
57
57
|
),
|
|
58
58
|
children: [
|
|
59
59
|
hasCopy ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
60
|
-
/* @__PURE__ */ jsx(
|
|
60
|
+
contentActions ? /* @__PURE__ */ jsx(
|
|
61
61
|
ContentActions,
|
|
62
62
|
{
|
|
63
63
|
content: () => getCtx().content,
|
|
@@ -69,7 +69,7 @@ function ActionBar(props) {
|
|
|
69
69
|
onPrint: printAction ? () => printAction.run(getCtx()) : void 0,
|
|
70
70
|
onTransform: () => void openExportPalette(sourceId)
|
|
71
71
|
}
|
|
72
|
-
),
|
|
72
|
+
) : null,
|
|
73
73
|
/* @__PURE__ */ jsx(
|
|
74
74
|
AlchemyDocumentMenu,
|
|
75
75
|
{
|
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.54",
|
|
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",
|
|
134
133
|
"@ai-matrx/alchemy": "latest",
|
|
135
|
-
"@ai-matrx/content-ir": "latest",
|
|
136
134
|
"@ai-matrx/canvas": "latest",
|
|
137
|
-
"@ai-matrx/
|
|
135
|
+
"@ai-matrx/agents": "latest",
|
|
136
|
+
"@ai-matrx/content-ir": "latest",
|
|
138
137
|
"@ai-matrx/content-ir-react": "latest",
|
|
139
|
-
"@ai-matrx/
|
|
138
|
+
"@ai-matrx/data": "latest",
|
|
140
139
|
"@ai-matrx/diff": "latest",
|
|
140
|
+
"@ai-matrx/design-system": "latest",
|
|
141
141
|
"@ai-matrx/icons": "latest",
|
|
142
142
|
"@ai-matrx/kit": "latest",
|
|
143
|
+
"@ai-matrx/media": "latest",
|
|
143
144
|
"@ai-matrx/print": "latest",
|
|
144
145
|
"@ai-matrx/records": "latest",
|
|
145
|
-
"@ai-matrx/tap-target": "latest",
|
|
146
146
|
"@ai-matrx/records-ui": "latest",
|
|
147
|
-
"@ai-matrx/
|
|
147
|
+
"@ai-matrx/tap-target": "latest"
|
|
148
148
|
},
|
|
149
149
|
"peerDependencies": {
|
|
150
150
|
"react": ">=19.0.0",
|