markstream-angular 0.0.2-beta.9 → 0.0.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/dist/index.css +1 -1
- package/dist/index.js +2254 -2022
- package/dist/types/markstream-angular/src/components/CodeBlockNode/CodeBlockNode.component.d.ts +57 -4
- package/dist/types/markstream-angular/src/components/D2BlockNode/D2BlockNode.component.d.ts +8 -0
- package/dist/types/markstream-angular/src/components/InfographicBlockNode/InfographicBlockNode.component.d.ts +9 -0
- package/dist/types/markstream-angular/src/components/InlineCodeNode/InlineCodeNode.component.d.ts +2 -0
- package/dist/types/markstream-angular/src/components/LinkNode/LinkNode.component.d.ts +1 -0
- package/dist/types/markstream-angular/src/components/MermaidBlockNode/MermaidBlockNode.component.d.ts +18 -1
- package/dist/types/markstream-angular/src/components/NodeOutlet/NodeOutlet.component.d.ts +4 -2
- package/dist/types/markstream-angular/src/components/NodeRenderer/NodeRenderer.component.d.ts +47 -9
- package/dist/types/markstream-angular/src/components/TextNode/TextNode.component.d.ts +2 -0
- package/dist/types/markstream-angular/src/components/TextNode/streamingTextState.d.ts +2 -11
- package/dist/types/markstream-angular/src/components/shared/node-helpers.d.ts +82 -12
- package/dist/types/markstream-angular/src/components/shared/node-outlet-helpers.d.ts +3 -1
- package/dist/types/markstream-angular/src/components/shared/smooth-streaming-scope.d.ts +5 -0
- package/dist/types/markstream-angular/src/customComponents.d.ts +1 -1
- package/dist/types/markstream-angular/src/enhanceRenderedHtml.d.ts +7 -5
- package/dist/types/markstream-angular/src/index.d.ts +5 -1
- package/dist/types/markstream-angular/src/optional/d2.d.ts +13 -2
- package/dist/types/markstream-angular/src/optional/infographic.d.ts +13 -1
- package/dist/types/markstream-angular/src/optional/katex.d.ts +5 -2
- package/dist/types/markstream-angular/src/optional/mermaid.d.ts +23 -2
- package/dist/types/markstream-angular/src/optional/monaco.d.ts +18 -1
- package/dist/types/markstream-angular/src/parseNestedMarkdownToNodes.d.ts +6 -1
- package/dist/types/markstream-angular/src/services/smooth-markdown-stream.service.d.ts +33 -0
- package/dist/types/markstream-angular/src/types/monaco.d.ts +3 -3
- package/package.json +9 -6
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { BaseNode, MarkdownIt, ParseOptions } from '../../markdown-parser/src/index.ts';
|
|
2
|
+
type NestedMarkdownSourceNode = BaseNode & {
|
|
3
|
+
children?: BaseNode[];
|
|
4
|
+
content?: string;
|
|
5
|
+
};
|
|
2
6
|
export interface NestedMarkdownNodesInput {
|
|
3
|
-
node?:
|
|
7
|
+
node?: NestedMarkdownSourceNode | null;
|
|
4
8
|
nodes?: readonly BaseNode[] | null;
|
|
5
9
|
content?: string | null;
|
|
6
10
|
}
|
|
@@ -12,3 +16,4 @@ export interface NestedMarkdownNodesOptions {
|
|
|
12
16
|
customMarkdownIt?: (markdown: MarkdownIt) => MarkdownIt;
|
|
13
17
|
}
|
|
14
18
|
export declare function parseNestedMarkdownToNodes(input: NestedMarkdownNodesInput, options?: NestedMarkdownNodesOptions): BaseNode[];
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { SmoothMarkdownStreamOptions } from '../../../markstream-core/src/index.ts';
|
|
3
|
+
export type { SmoothMarkdownStreamOptions };
|
|
4
|
+
export declare class SmoothMarkdownStreamService implements OnDestroy {
|
|
5
|
+
private controller;
|
|
6
|
+
private snapshot;
|
|
7
|
+
private readonly listeners;
|
|
8
|
+
private unsubscribeFromController?;
|
|
9
|
+
init(options?: SmoothMarkdownStreamOptions): void;
|
|
10
|
+
ngOnDestroy(): void;
|
|
11
|
+
/**
|
|
12
|
+
* Subscribe to snapshot updates. Called when the controller's visible
|
|
13
|
+
* content advances during smooth streaming. The listener is invoked
|
|
14
|
+
* after each snapshot sync so that Angular components can trigger
|
|
15
|
+
* rebuild / markForCheck.
|
|
16
|
+
*/
|
|
17
|
+
subscribe(listener: () => void): () => void;
|
|
18
|
+
get source(): string;
|
|
19
|
+
get visible(): string;
|
|
20
|
+
get done(): boolean;
|
|
21
|
+
get caughtUp(): boolean;
|
|
22
|
+
get final(): boolean;
|
|
23
|
+
get pendingChars(): number;
|
|
24
|
+
enqueue(chunk: string): void;
|
|
25
|
+
finish(options?: {
|
|
26
|
+
flush?: boolean;
|
|
27
|
+
}): void;
|
|
28
|
+
flush(): void;
|
|
29
|
+
reset(initialMarkdown?: string): void;
|
|
30
|
+
pause(): void;
|
|
31
|
+
resume(): void;
|
|
32
|
+
private syncSnapshot;
|
|
33
|
+
}
|
|
@@ -7,7 +7,7 @@ export interface CodeBlockMonacoThemeObject {
|
|
|
7
7
|
[key: string]: unknown;
|
|
8
8
|
}
|
|
9
9
|
export type CodeBlockMonacoTheme = string | CodeBlockMonacoThemeObject;
|
|
10
|
-
export type CodeBlockMonacoLanguage = string | ((...args:
|
|
10
|
+
export type CodeBlockMonacoLanguage = string | ((...args: unknown[]) => unknown);
|
|
11
11
|
export interface CodeBlockDiffHideUnchangedRegionsOptions {
|
|
12
12
|
enabled?: boolean;
|
|
13
13
|
contextLineCount?: number;
|
|
@@ -60,6 +60,6 @@ export interface CodeBlockMonacoOptions {
|
|
|
60
60
|
diffHunkActionsOnHover?: boolean;
|
|
61
61
|
diffHunkHoverHideDelayMs?: number;
|
|
62
62
|
onDiffHunkAction?: (context: CodeBlockDiffHunkActionContext) => void | boolean | Promise<void | boolean>;
|
|
63
|
-
scrollbar?: Record<string,
|
|
64
|
-
[key: string]:
|
|
63
|
+
scrollbar?: Record<string, unknown>;
|
|
64
|
+
[key: string]: unknown;
|
|
65
65
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markstream-angular",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.3",
|
|
5
5
|
"description": "Experimental Angular Markdown renderer for Markstream, built on stream-markdown AST and a stable HTML baseline renderer.",
|
|
6
6
|
"author": "Simon He",
|
|
7
7
|
"license": "MIT",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@terrastruct/d2": ">=0.1.33",
|
|
48
48
|
"katex": ">=0.16.22",
|
|
49
49
|
"mermaid": ">=11",
|
|
50
|
-
"stream-monaco": ">=0.0.
|
|
50
|
+
"stream-monaco": ">=0.0.41"
|
|
51
51
|
},
|
|
52
52
|
"peerDependenciesMeta": {
|
|
53
53
|
"@antv/infographic": {
|
|
@@ -68,20 +68,23 @@
|
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@floating-ui/dom": "^1.7.6",
|
|
71
|
-
"stream-markdown-parser": "
|
|
71
|
+
"stream-markdown-parser": "1.0.5",
|
|
72
|
+
"markstream-core": "1.0.3"
|
|
72
73
|
},
|
|
73
74
|
"devDependencies": {
|
|
74
75
|
"@types/node": "^18.19.130",
|
|
75
76
|
"rollup": "^3.30.0",
|
|
76
77
|
"typescript": "^5.9.3",
|
|
77
|
-
"vite": "^7.3.
|
|
78
|
+
"vite": "^7.3.3",
|
|
78
79
|
"vite-plugin-dts": "^4.5.4"
|
|
79
80
|
},
|
|
80
81
|
"scripts": {
|
|
81
|
-
"build": "vite build --mode npm",
|
|
82
|
+
"build": "pnpm --dir ../markstream-core build && vite build --mode npm",
|
|
82
83
|
"dev": "vite dev",
|
|
83
84
|
"preview": "vite preview",
|
|
84
85
|
"typecheck": "tsc --noEmit",
|
|
85
|
-
"
|
|
86
|
+
"check:core-published": "node ../../scripts/check-core-published.mjs --package-json package.json --core-package-json ../markstream-core/package.json",
|
|
87
|
+
"check:workspace-deps-published": "node ../../scripts/check-workspace-deps-published.mjs --package-json package.json",
|
|
88
|
+
"release": "pnpm run check:workspace-deps-published && bumpp --commit --no-tag --no-push && pnpm publish --access public && node ../../scripts/tag-package.mjs --package-json package.json --push"
|
|
86
89
|
}
|
|
87
90
|
}
|