@ai-matrx/rich-content 0.2.86 → 0.2.88
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.88
|
|
4
|
+
|
|
5
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
|
+
`git diff npm/rich-content/v0.2.87..npm/rich-content/v0.2.88 -- apps/shared/rich-content`).
|
|
7
|
+
No source changes intended and no consumer action required.
|
|
8
|
+
|
|
9
|
+
## 0.2.87
|
|
10
|
+
|
|
11
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
12
|
+
`git diff npm/rich-content/v0.2.86..npm/rich-content/v0.2.87 -- apps/shared/rich-content`).
|
|
13
|
+
No source changes intended and no consumer action required.
|
|
14
|
+
|
|
3
15
|
## 0.2.86
|
|
4
16
|
|
|
5
17
|
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { renderMermaid } from "./runtime.js";
|
|
2
|
-
import { closeFence, fenceOpenerOf } from "@ai-matrx/content-ir/source";
|
|
2
|
+
import { closeFence, fenceOpenerOf, soleFence } from "@ai-matrx/content-ir/source";
|
|
3
3
|
const PRINT_OPTIONS = { theme: "default", look: "classic", layout: "dagre" };
|
|
4
4
|
function mermaidFenceSources(markdown) {
|
|
5
5
|
const out = [];
|
|
@@ -21,8 +21,7 @@ function mermaidFenceSources(markdown) {
|
|
|
21
21
|
return out;
|
|
22
22
|
}
|
|
23
23
|
function mermaidSourceOf(body) {
|
|
24
|
-
|
|
25
|
-
return (fenced ? fenced[2] : body).trim();
|
|
24
|
+
return (soleFence(body)?.body ?? body).trim();
|
|
26
25
|
}
|
|
27
26
|
async function drawMermaidForPrint(markdown, extraBodies = []) {
|
|
28
27
|
const pictures = /* @__PURE__ */ new Map();
|
|
@@ -3,13 +3,18 @@ export interface ShimmerTextProps {
|
|
|
3
3
|
className?: string;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
* The shimmer's
|
|
7
|
-
* `hsl(var(--x))` wrap (a host whose theme variables are full colour values
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* classes resolves these identically.
|
|
6
|
+
* The shimmer's look as inline style, derived from the label's own text colour (`currentColor`): no
|
|
7
|
+
* `hsl(var(--x))` wrap (a host whose theme variables are full colour values reads that as invalid and
|
|
8
|
+
* paints transparent text), no theme variable at all, and no utility class a host's Tailwind scan must
|
|
9
|
+
* find in this package. Works in any host, whatever its colour format.
|
|
11
10
|
*/
|
|
12
|
-
export declare const
|
|
11
|
+
export declare const SHIMMER_STYLE: {
|
|
12
|
+
readonly backgroundImage: "linear-gradient(90deg, color-mix(in srgb, currentColor 18%, transparent) 0%, currentColor 50%, color-mix(in srgb, currentColor 18%, transparent) 100%)";
|
|
13
|
+
readonly backgroundSize: "200% 100%";
|
|
14
|
+
readonly WebkitBackgroundClip: "text";
|
|
15
|
+
readonly backgroundClip: "text";
|
|
16
|
+
readonly WebkitTextFillColor: "transparent";
|
|
17
|
+
};
|
|
13
18
|
/**
|
|
14
19
|
* Drives the left-to-right sweep with the Web Animations API, so the package
|
|
15
20
|
* ships its own motion: no `@keyframes`, no Tailwind `animate-*` entry, no
|
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "@ai-matrx/design-system";
|
|
4
4
|
import { useCallback, useRef } from "react";
|
|
5
|
-
const
|
|
5
|
+
const SHIMMER_STYLE = {
|
|
6
|
+
backgroundImage: "linear-gradient(90deg, color-mix(in srgb, currentColor 18%, transparent) 0%, currentColor 50%, color-mix(in srgb, currentColor 18%, transparent) 100%)",
|
|
7
|
+
backgroundSize: "200% 100%",
|
|
8
|
+
WebkitBackgroundClip: "text",
|
|
9
|
+
backgroundClip: "text",
|
|
10
|
+
WebkitTextFillColor: "transparent"
|
|
11
|
+
};
|
|
6
12
|
function useShimmerSweep(durationMs = 2e3) {
|
|
7
13
|
const animationRef = useRef(null);
|
|
8
14
|
return useCallback(
|
|
@@ -15,6 +21,8 @@ function useShimmerSweep(durationMs = 2e3) {
|
|
|
15
21
|
[{ backgroundPosition: "0 0" }, { backgroundPosition: "-200% 0" }],
|
|
16
22
|
{ duration: durationMs, iterations: Infinity, easing: "linear" }
|
|
17
23
|
);
|
|
24
|
+
animationRef.current.finished?.catch(() => {
|
|
25
|
+
});
|
|
18
26
|
},
|
|
19
27
|
[durationMs]
|
|
20
28
|
);
|
|
@@ -25,13 +33,14 @@ function ShimmerText({ text, className }) {
|
|
|
25
33
|
"span",
|
|
26
34
|
{
|
|
27
35
|
ref,
|
|
28
|
-
className: cn("inline-block
|
|
36
|
+
className: cn("inline-block", className),
|
|
37
|
+
style: SHIMMER_STYLE,
|
|
29
38
|
children: text
|
|
30
39
|
}
|
|
31
40
|
);
|
|
32
41
|
}
|
|
33
42
|
export {
|
|
34
|
-
|
|
43
|
+
SHIMMER_STYLE,
|
|
35
44
|
ShimmerText,
|
|
36
45
|
useShimmerSweep
|
|
37
46
|
};
|
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.88",
|
|
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",
|
|
@@ -131,19 +131,19 @@
|
|
|
131
131
|
"unist-util-visit-parents": "^6.0.2",
|
|
132
132
|
"yaml": "^2.9.1",
|
|
133
133
|
"@ai-matrx/agents": "latest",
|
|
134
|
-
"@ai-matrx/
|
|
135
|
-
"@ai-matrx/content-ir": "latest",
|
|
134
|
+
"@ai-matrx/alchemy": "latest",
|
|
136
135
|
"@ai-matrx/content-ir-react": "latest",
|
|
137
136
|
"@ai-matrx/data": "latest",
|
|
138
|
-
"@ai-matrx/
|
|
137
|
+
"@ai-matrx/design-system": "latest",
|
|
139
138
|
"@ai-matrx/diff": "latest",
|
|
139
|
+
"@ai-matrx/icons": "latest",
|
|
140
140
|
"@ai-matrx/kit": "latest",
|
|
141
|
-
"@ai-matrx/records": "latest",
|
|
142
|
-
"@ai-matrx/records-ui": "latest",
|
|
143
141
|
"@ai-matrx/media": "latest",
|
|
144
|
-
"@ai-matrx/icons": "latest",
|
|
145
142
|
"@ai-matrx/print": "latest",
|
|
146
|
-
"@ai-matrx/
|
|
143
|
+
"@ai-matrx/records": "latest",
|
|
144
|
+
"@ai-matrx/records-ui": "latest",
|
|
145
|
+
"@ai-matrx/canvas": "latest",
|
|
146
|
+
"@ai-matrx/content-ir": "latest"
|
|
147
147
|
},
|
|
148
148
|
"peerDependencies": {
|
|
149
149
|
"react": ">=19.0.0",
|
|
@@ -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": "
|
|
207
|
+
"gitHead": "866ca66b4a2457b230b36cdbc6d4052d4f72fe7a"
|
|
208
208
|
}
|