@admin-layout/tailwind-ui 12.2.4-alpha.85 → 12.2.4-alpha.97
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/AIToolbar/components/Markdown/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/AIToolbar/components/Markdown/index.tsx"],"names":[],"mappings":"AAeA,UAAU,qBAAqB;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,WAAmB,EAAE,EAAE,qBAAqB,2CAsBhF"}
|
|
@@ -1,22 +1,41 @@
|
|
|
1
|
-
import {jsx}from'react/jsx-runtime';import {
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import {lazy,Suspense}from'react';import {openUrl}from'@tauri-apps/plugin-opener';// `streamdown` statically pulls in mermaid + shiki + katex (~4 MB uncompressed of
|
|
2
|
+
// diagram/syntax/math renderers). Neither streamdown nor mermaid marks
|
|
3
|
+
// `sideEffects: false`, so a top-level `import { Streamdown } from 'streamdown'`
|
|
4
|
+
// here cannot be tree-shaken out of the package barrel: every app that imports
|
|
5
|
+
// ANYTHING from `@admin-layout/tailwind-ui` (e.g. `import { Spin }`) drags that
|
|
6
|
+
// whole tree into its initial bundle, even on routes that never render markdown.
|
|
7
|
+
//
|
|
8
|
+
// Load it lazily so streamdown/mermaid live in their own async chunk that is only
|
|
9
|
+
// fetched when a Markdown block actually renders. The Suspense fallback shows the
|
|
10
|
+
// raw markdown text (readable, and preserved whitespace) until the renderer loads.
|
|
11
|
+
const Streamdown = lazy(() => import('streamdown').then(mod => ({
|
|
12
|
+
default: mod.Streamdown
|
|
13
|
+
})));
|
|
14
|
+
function Markdown({
|
|
2
15
|
children,
|
|
3
16
|
isStreaming = false
|
|
4
17
|
}) {
|
|
5
|
-
return jsx(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
return jsx(Suspense, {
|
|
19
|
+
fallback: jsx("span", {
|
|
20
|
+
className: "whitespace-pre-wrap break-words",
|
|
21
|
+
children: children
|
|
22
|
+
}),
|
|
23
|
+
children: jsx(Streamdown, {
|
|
24
|
+
isAnimating: isStreaming,
|
|
25
|
+
shikiTheme: ['github-light', 'github-dark'],
|
|
26
|
+
components: COMPONENTS,
|
|
27
|
+
controls: {
|
|
28
|
+
table: true,
|
|
29
|
+
code: true,
|
|
30
|
+
mermaid: {
|
|
31
|
+
download: true,
|
|
32
|
+
copy: true,
|
|
33
|
+
fullscreen: false,
|
|
34
|
+
panZoom: false
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
children: children
|
|
38
|
+
})
|
|
20
39
|
});
|
|
21
40
|
}
|
|
22
41
|
const COMPONENTS = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/AIToolbar/components/Markdown/index.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/AIToolbar/components/Markdown/index.tsx"],"sourcesContent":[null],"names":[],"mappings":"sHAkBC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@admin-layout/tailwind-ui",
|
|
3
|
-
"version": "12.2.4-alpha.
|
|
3
|
+
"version": "12.2.4-alpha.97",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"publishConfig": {
|
|
94
94
|
"access": "public"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "2e160f665e73ab8d20cc1563363b7088393fc71e",
|
|
97
97
|
"typescript": {
|
|
98
98
|
"definition": "lib/index.d.ts"
|
|
99
99
|
}
|