markstream-octane 0.0.56-beta.4 → 0.1.0-beta.3
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/README.md +10 -3
- package/dist/client/index.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +68 -120
- package/dist/index.px.css +1 -1
- package/dist/index.tailwind.css +37 -173
- package/dist/server/index.js +1 -1
- package/dist/server.d.ts +67 -120
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.js +1 -1
- package/dist/types/components/CodeBlockNode/monaco.d.ts +1 -1
- package/dist/types/components/CodeBlockNode/streamDiffs.d.ts +2 -0
- package/dist/types/components/NodeRenderer/preloadStreamDiffs.d.ts +2 -0
- package/dist/types/index.d.ts +1 -3
- package/dist/types/server-renderer/index.d.ts +1 -3
- package/dist/types/server.d.ts +0 -2
- package/dist/types/types/component-props.d.ts +53 -65
- package/dist/types/types.d.ts +13 -22
- package/dist/types/utils/languageIcon.d.ts +2 -1
- package/package.json +24 -30
package/dist/types/types.d.ts
CHANGED
|
@@ -4,10 +4,11 @@ import type { ComponentBody } from 'octane';
|
|
|
4
4
|
import type { BaseNode, HtmlPolicy, MarkdownIt, ParsedNode, ParseOptions } from 'stream-markdown-parser';
|
|
5
5
|
import type { CustomComponentMap, HtmlComponentDefinitions, HtmlComponentMap, StreamingComponentDefinitions, StreamingComponentMap } from './customComponents';
|
|
6
6
|
import type { SmoothMarkdownStreamOptions } from './hooks/useSmoothMarkdownStream';
|
|
7
|
-
import type {
|
|
8
|
-
type NodeRendererCodeBlockThemes = CodeBlockNodeProps['themes']
|
|
9
|
-
export type NodeRendererCodeBlockProps = Partial<Omit<CodeBlockNodeProps, 'node' | 'themes'
|
|
7
|
+
import type { CodeBlockNodeProps, CodeBlockOptions, CodeBlockPreviewPayload, CodeBlockTheme, CodeBlockThemes, D2BlockNodeProps, InfographicBlockNodeProps, MermaidBlockNodeProps } from './types/component-props';
|
|
8
|
+
type NodeRendererCodeBlockThemes = CodeBlockNodeProps['themes'];
|
|
9
|
+
export type NodeRendererCodeBlockProps = Partial<Omit<CodeBlockNodeProps, 'node' | 'themes' | 'codeBlockOptions'>> & {
|
|
10
10
|
themes?: NodeRendererCodeBlockThemes;
|
|
11
|
+
codeBlockOptions?: never;
|
|
11
12
|
} & Record<string, unknown>;
|
|
12
13
|
export interface NodeRendererProps<TStreamingComponents extends Record<string, ComponentBody<any>> = StreamingComponentMap, THtmlComponents extends Record<string, any> = HtmlComponentMap> {
|
|
13
14
|
content?: string;
|
|
@@ -31,30 +32,21 @@ export interface NodeRendererProps<TStreamingComponents extends Record<string, C
|
|
|
31
32
|
htmlPolicy?: HtmlPolicy;
|
|
32
33
|
viewportPriority?: boolean;
|
|
33
34
|
codeBlockStream?: boolean;
|
|
34
|
-
codeBlockDarkTheme?:
|
|
35
|
-
codeBlockLightTheme?:
|
|
36
|
-
codeBlockMonacoOptions?: CodeBlockMonacoOptions;
|
|
35
|
+
codeBlockDarkTheme?: CodeBlockTheme;
|
|
36
|
+
codeBlockLightTheme?: CodeBlockTheme;
|
|
37
37
|
renderCodeBlocksAsPre?: boolean;
|
|
38
38
|
codeBlockMinWidth?: string | number;
|
|
39
39
|
codeBlockMaxWidth?: string | number;
|
|
40
|
+
codeBlockOptions?: CodeBlockOptions;
|
|
40
41
|
codeBlockProps?: NodeRendererCodeBlockProps;
|
|
41
42
|
mermaidProps?: Partial<Omit<MermaidBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
42
43
|
d2Props?: Partial<Omit<D2BlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
43
44
|
infographicProps?: Partial<Omit<InfographicBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
44
45
|
showTooltips?: boolean;
|
|
45
46
|
/**
|
|
46
|
-
*
|
|
47
|
-
* When Shiki code blocks are used, only string theme names are forwarded to
|
|
48
|
-
* MarkdownCodeBlockNode / stream-markdown; theme objects are ignored.
|
|
47
|
+
* Dark/light theme names used by stream-diffs backed code blocks.
|
|
49
48
|
*/
|
|
50
|
-
themes?:
|
|
51
|
-
/**
|
|
52
|
-
* Shiki language preload list forwarded to MarkdownCodeBlockNode.
|
|
53
|
-
*
|
|
54
|
-
* The default Octane code block renderer is Monaco-backed. This prop is used
|
|
55
|
-
* when a custom `code_block` or language renderer uses MarkdownCodeBlockNode.
|
|
56
|
-
*/
|
|
57
|
-
langs?: readonly string[];
|
|
49
|
+
themes?: CodeBlockThemes;
|
|
58
50
|
isDark?: boolean;
|
|
59
51
|
customId?: string;
|
|
60
52
|
indexKey?: number | string;
|
|
@@ -102,6 +94,7 @@ export interface RenderContext {
|
|
|
102
94
|
htmlComponents?: HtmlComponentMap;
|
|
103
95
|
customHtmlTags?: readonly string[];
|
|
104
96
|
htmlPolicy?: HtmlPolicy;
|
|
97
|
+
codeBlockOptions?: CodeBlockOptions;
|
|
105
98
|
codeBlockProps?: NodeRendererCodeBlockProps;
|
|
106
99
|
mermaidProps?: Partial<Omit<MermaidBlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
107
100
|
d2Props?: Partial<Omit<D2BlockNodeProps, 'node' | 'loading' | 'isDark'>>;
|
|
@@ -110,13 +103,11 @@ export interface RenderContext {
|
|
|
110
103
|
codeBlockStream?: boolean;
|
|
111
104
|
renderCodeBlocksAsPre?: boolean;
|
|
112
105
|
codeBlockThemes?: {
|
|
113
|
-
themes?:
|
|
114
|
-
darkTheme?:
|
|
115
|
-
lightTheme?:
|
|
116
|
-
monacoOptions?: CodeBlockMonacoOptions;
|
|
106
|
+
themes?: CodeBlockThemes;
|
|
107
|
+
darkTheme?: CodeBlockTheme;
|
|
108
|
+
lightTheme?: CodeBlockTheme;
|
|
117
109
|
minWidth?: string | number;
|
|
118
110
|
maxWidth?: string | number;
|
|
119
|
-
langs?: readonly string[];
|
|
120
111
|
};
|
|
121
112
|
events: {
|
|
122
113
|
onCopy?: (code: string) => void;
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
export type LanguageIconResolver = (lang: string) => string | undefined | null;
|
|
3
3
|
export declare function setLanguageIconResolver(resolver?: LanguageIconResolver | null): void;
|
|
4
4
|
export declare function normalizeLanguageIdentifier(lang?: string | null): string;
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function resolveLanguageId(lang?: string | null): string;
|
|
6
6
|
export declare function preloadExtendedLanguageIcons(): Promise<void>;
|
|
7
7
|
export declare function subscribeLanguageIconsRevision(listener: () => void): () => void;
|
|
8
8
|
export declare function getLanguageIcon(lang: string): string;
|
|
9
9
|
export declare const languageMap: Record<string, string>;
|
|
10
|
+
export declare function isLikelyIncompleteLanguageIdentifier(lang?: string | null): boolean;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markstream-octane",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0
|
|
5
|
-
"description": "Octane streaming Markdown renderer for AI chat, LLM token streams, SSE/WebSocket output, incomplete Markdown, long documents, Mermaid, KaTeX,
|
|
4
|
+
"version": "0.1.0-beta.3",
|
|
5
|
+
"description": "Octane streaming Markdown renderer for AI chat, LLM token streams, SSE/WebSocket output, incomplete Markdown, long documents, Mermaid, KaTeX, stream-diffs powered code blocks, and custom Octane components.",
|
|
6
6
|
"author": "Simon He",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://markstream.simonhe.me",
|
|
@@ -35,9 +35,7 @@
|
|
|
35
35
|
"streaming-mermaid",
|
|
36
36
|
"katex",
|
|
37
37
|
"streaming-katex",
|
|
38
|
-
"
|
|
39
|
-
"monaco",
|
|
40
|
-
"monaco-editor",
|
|
38
|
+
"stream-diffs",
|
|
41
39
|
"streaming-code-blocks",
|
|
42
40
|
"large-documents",
|
|
43
41
|
"safe-html",
|
|
@@ -78,14 +76,29 @@
|
|
|
78
76
|
"files": [
|
|
79
77
|
"dist"
|
|
80
78
|
],
|
|
79
|
+
"scripts": {
|
|
80
|
+
"dev": "vite dev",
|
|
81
|
+
"build": "pnpm --dir ../markdown-parser build && pnpm --dir ../markstream-core build && vite build --mode npm-client && vite build --mode npm-server && node ./scripts/finalize-runtime-build.mjs && node ./scripts/finalize-tailwind-export.mjs && vite build -c vite.config.tailwind.ts --mode npm && node ./scripts/copy-tailwind-css.mjs && node ../../scripts/generate-px-css.mjs && pnpm run build:dts && node ./scripts/check-built-package.mjs",
|
|
82
|
+
"build:analyze": "ANALYZE=true pnpm build",
|
|
83
|
+
"build:dts": "node ./scripts/generate-tsrx-types.mjs --out-dir dist/types && rollup -c ./scripts/rollup.dts.config.mjs",
|
|
84
|
+
"check:exports": "node ./scripts/check-built-package.mjs",
|
|
85
|
+
"preview": "vite preview",
|
|
86
|
+
"test": "pnpm run test:client && pnpm run test:ssr",
|
|
87
|
+
"test:client": "vitest run --config vitest.config.ts",
|
|
88
|
+
"test:ssr": "vitest run --config vitest.ssr.config.ts",
|
|
89
|
+
"typecheck": "tsrx-tsc --noEmit -p tsconfig.json",
|
|
90
|
+
"size:check": "node ../../scripts/check-package-size.mjs",
|
|
91
|
+
"check:core-published": "node ../../scripts/check-core-published.mjs --package-json package.json --core-package-json ../markstream-core/package.json",
|
|
92
|
+
"check:workspace-deps-published": "node ../../scripts/check-workspace-deps-published.mjs --package-json package.json",
|
|
93
|
+
"release": "pnpm run check:workspace-deps-published && bumpp --all --commit --no-tag --no-push --execute 'pnpm --workspace-root run docs:llms:generate' && DIST_TAG=\"$(node ../../scripts/dist-tag.mjs)\" && pnpm publish --access public --tag \"${DIST_TAG}\" && node ../../scripts/tag-package.mjs --package-json package.json --push"
|
|
94
|
+
},
|
|
81
95
|
"peerDependencies": {
|
|
82
96
|
"@antv/infographic": "^0.2.3",
|
|
83
97
|
"@terrastruct/d2": ">=0.1.33",
|
|
84
98
|
"katex": ">=0.16.22",
|
|
85
99
|
"mermaid": ">=11",
|
|
86
100
|
"octane": "^0.1.21",
|
|
87
|
-
"stream-
|
|
88
|
-
"stream-monaco": ">=0.0.48"
|
|
101
|
+
"stream-diffs": ">=0.0.2"
|
|
89
102
|
},
|
|
90
103
|
"peerDependenciesMeta": {
|
|
91
104
|
"@antv/infographic": {
|
|
@@ -100,18 +113,15 @@
|
|
|
100
113
|
"mermaid": {
|
|
101
114
|
"optional": true
|
|
102
115
|
},
|
|
103
|
-
"stream-
|
|
104
|
-
"optional": true
|
|
105
|
-
},
|
|
106
|
-
"stream-monaco": {
|
|
116
|
+
"stream-diffs": {
|
|
107
117
|
"optional": true
|
|
108
118
|
}
|
|
109
119
|
},
|
|
110
120
|
"dependencies": {
|
|
111
121
|
"@floating-ui/dom": "^1.8.0",
|
|
112
122
|
"clsx": "^2.1.1",
|
|
113
|
-
"markstream-core": "1.0.
|
|
114
|
-
"stream-markdown-parser": "1.2.
|
|
123
|
+
"markstream-core": "1.1.0-beta.2",
|
|
124
|
+
"stream-markdown-parser": "1.2.6-beta.1"
|
|
115
125
|
},
|
|
116
126
|
"devDependencies": {
|
|
117
127
|
"@octanejs/testing-library": "^0.1.18",
|
|
@@ -129,21 +139,5 @@
|
|
|
129
139
|
"typescript": "^5.9.3",
|
|
130
140
|
"vite": "^8.0.16",
|
|
131
141
|
"vite-plugin-dts": "^4.5.4"
|
|
132
|
-
},
|
|
133
|
-
"scripts": {
|
|
134
|
-
"dev": "vite dev",
|
|
135
|
-
"build": "pnpm --dir ../markdown-parser build && pnpm --dir ../markstream-core build && vite build --mode npm-client && vite build --mode npm-server && node ./scripts/finalize-runtime-build.mjs && node ./scripts/finalize-tailwind-export.mjs && vite build -c vite.config.tailwind.ts --mode npm && node ./scripts/copy-tailwind-css.mjs && node ../../scripts/generate-px-css.mjs && pnpm run build:dts && node ./scripts/check-built-package.mjs",
|
|
136
|
-
"build:analyze": "ANALYZE=true pnpm build",
|
|
137
|
-
"build:dts": "node ./scripts/generate-tsrx-types.mjs --out-dir dist/types && rollup -c ./scripts/rollup.dts.config.mjs",
|
|
138
|
-
"check:exports": "node ./scripts/check-built-package.mjs",
|
|
139
|
-
"preview": "vite preview",
|
|
140
|
-
"test": "pnpm run test:client && pnpm run test:ssr",
|
|
141
|
-
"test:client": "vitest run --config vitest.config.ts",
|
|
142
|
-
"test:ssr": "vitest run --config vitest.ssr.config.ts",
|
|
143
|
-
"typecheck": "tsrx-tsc --noEmit -p tsconfig.json",
|
|
144
|
-
"size:check": "node ../../scripts/check-package-size.mjs",
|
|
145
|
-
"check:core-published": "node ../../scripts/check-core-published.mjs --package-json package.json --core-package-json ../markstream-core/package.json",
|
|
146
|
-
"check:workspace-deps-published": "node ../../scripts/check-workspace-deps-published.mjs --package-json package.json",
|
|
147
|
-
"release": "pnpm run check:workspace-deps-published && bumpp --all --commit --no-tag --no-push --execute 'pnpm --workspace-root run docs:llms:generate' && pnpm publish --access public $(node ../../scripts/dist-tag.mjs) && node ../../scripts/tag-package.mjs --package-json package.json --push"
|
|
148
142
|
}
|
|
149
|
-
}
|
|
143
|
+
}
|