@ai-matrx/rich-content 0.2.53 → 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 CHANGED
@@ -1,5 +1,11 @@
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
+
3
9
  ## 0.2.53
4
10
 
5
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.
@@ -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({ src, alt, block, children, }: {
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/rich-content",
3
- "version": "0.2.53",
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,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/agents": "latest",
134
133
  "@ai-matrx/alchemy": "latest",
135
134
  "@ai-matrx/canvas": "latest",
135
+ "@ai-matrx/agents": "latest",
136
+ "@ai-matrx/content-ir": "latest",
136
137
  "@ai-matrx/content-ir-react": "latest",
137
138
  "@ai-matrx/data": "latest",
138
- "@ai-matrx/content-ir": "latest",
139
- "@ai-matrx/design-system": "latest",
140
139
  "@ai-matrx/diff": "latest",
141
- "@ai-matrx/kit": "latest",
140
+ "@ai-matrx/design-system": "latest",
142
141
  "@ai-matrx/icons": "latest",
142
+ "@ai-matrx/kit": "latest",
143
143
  "@ai-matrx/media": "latest",
144
- "@ai-matrx/records": "latest",
145
144
  "@ai-matrx/print": "latest",
145
+ "@ai-matrx/records": "latest",
146
146
  "@ai-matrx/records-ui": "latest",
147
147
  "@ai-matrx/tap-target": "latest"
148
148
  },