markstream-angular 0.0.2-beta.6 → 0.0.2-beta.8
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.js +2121 -1988
- package/dist/types/index.d.ts +6 -73
- package/dist/types/{components → markstream-angular/src/components}/CodeBlockNode/HtmlPreviewFrame.component.d.ts +3 -0
- package/dist/types/{components → markstream-angular/src/components}/InfographicBlockNode/InfographicBlockNode.component.d.ts +3 -0
- package/dist/types/{components → markstream-angular/src/components}/MermaidBlockNode/MermaidBlockNode.component.d.ts +2 -0
- package/dist/types/{components → markstream-angular/src/components}/NestedRenderer/NestedRenderer.component.d.ts +1 -1
- package/dist/types/{components → markstream-angular/src/components}/NodeOutlet/NodeOutlet.component.d.ts +1 -1
- package/dist/types/{components → markstream-angular/src/components}/NodeRenderer/NodeRenderer.component.d.ts +1 -0
- package/dist/types/markstream-angular/src/components/shared/diagram-height.d.ts +9 -0
- package/dist/types/{components → markstream-angular/src/components}/shared/node-helpers.d.ts +3 -1
- package/dist/types/{components → markstream-angular/src/components}/shared/node-outlet-helpers.d.ts +1 -0
- package/dist/types/{hydrateCustomTagContent.d.ts → markstream-angular/src/hydrateCustomTagContent.d.ts} +1 -1
- package/dist/types/markstream-angular/src/index.d.ts +73 -0
- package/dist/types/{parseNestedMarkdownToNodes.d.ts → markstream-angular/src/parseNestedMarkdownToNodes.d.ts} +1 -1
- package/dist/types/{renderMarkdownHtml.d.ts → markstream-angular/src/renderMarkdownHtml.d.ts} +3 -1
- package/dist/types/markstream-angular/src/sanitizeHtmlContent.d.ts +2 -0
- package/dist/workers/mermaidParser.worker.js +8 -8
- package/package.json +3 -3
- package/dist/types/sanitizeHtmlContent.d.ts +0 -1
- /package/dist/types/{components → markstream-angular/src/components}/AdmonitionNode/AdmonitionNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/BlockquoteNode/BlockquoteNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/CheckboxNode/CheckboxNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/CodeBlockNode/CodeBlockNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/D2BlockNode/D2BlockNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/DefinitionListNode/DefinitionListNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/DynamicNodeHost/DynamicNodeHost.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/EmojiNode/EmojiNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/EmphasisNode/EmphasisNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/FallbackComponent/FallbackComponent.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/FootnoteAnchorNode/FootnoteAnchorNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/FootnoteNode/FootnoteNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/FootnoteReferenceNode/FootnoteReferenceNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/HardBreakNode/HardBreakNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/HeadingNode/HeadingNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/HighlightNode/HighlightNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/HtmlBlockNode/HtmlBlockNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/HtmlInlineNode/HtmlInlineNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/ImageNode/ImageNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/InlineCodeNode/InlineCodeNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/InsertNode/InsertNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/LinkNode/LinkNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/ListItemNode/ListItemNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/ListNode/ListNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/MathBlockNode/MathBlockNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/MathInlineNode/MathInlineNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/ParagraphNode/ParagraphNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/PreCodeNode/PreCodeNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/ReferenceNode/ReferenceNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/StrikethroughNode/StrikethroughNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/StrongNode/StrongNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/SubscriptNode/SubscriptNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/SuperscriptNode/SuperscriptNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/TableNode/TableNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/TextNode/TextNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/TextNode/streamingTextState.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/ThematicBreakNode/ThematicBreakNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/VmrContainerNode/VmrContainerNode.component.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/shared/render-window.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/shared/rich-block-helpers.d.ts +0 -0
- /package/dist/types/{components → markstream-angular/src/components}/shared/safe-attrs.directive.d.ts +0 -0
- /package/dist/types/{customComponents.d.ts → markstream-angular/src/customComponents.d.ts} +0 -0
- /package/dist/types/{enhanceRenderedHtml.d.ts → markstream-angular/src/enhanceRenderedHtml.d.ts} +0 -0
- /package/dist/types/{i18n → markstream-angular/src/i18n}/useSafeI18n.d.ts +0 -0
- /package/dist/types/{markstream-angular.component.d.ts → markstream-angular/src/markstream-angular.component.d.ts} +0 -0
- /package/dist/types/{optional → markstream-angular/src/optional}/d2.d.ts +0 -0
- /package/dist/types/{optional → markstream-angular/src/optional}/infographic.d.ts +0 -0
- /package/dist/types/{optional → markstream-angular/src/optional}/katex.d.ts +0 -0
- /package/dist/types/{optional → markstream-angular/src/optional}/mermaid.d.ts +0 -0
- /package/dist/types/{optional → markstream-angular/src/optional}/monaco.d.ts +0 -0
- /package/dist/types/{sanitizeSvg.d.ts → markstream-angular/src/sanitizeSvg.d.ts} +0 -0
- /package/dist/types/{tooltip → markstream-angular/src/tooltip}/singletonTooltip.d.ts +0 -0
- /package/dist/types/{types → markstream-angular/src/types}/monaco.d.ts +0 -0
- /package/dist/types/{utils → markstream-angular/src/utils}/languageIcon.d.ts +0 -0
- /package/dist/types/{utils → markstream-angular/src/utils}/normalizeKaTeXRenderInput.d.ts +0 -0
- /package/dist/types/{workers → markstream-angular/src/workers}/katexCdnWorker.d.ts +0 -0
- /package/dist/types/{workers → markstream-angular/src/workers}/katexRenderer.worker.d.ts +0 -0
- /package/dist/types/{workers → markstream-angular/src/workers}/katexWorkerClient.d.ts +0 -0
- /package/dist/types/{workers → markstream-angular/src/workers}/mermaidCdnWorker.d.ts +0 -0
- /package/dist/types/{workers → markstream-angular/src/workers}/mermaidParser.worker.d.ts +0 -0
- /package/dist/types/{workers → markstream-angular/src/workers}/mermaidWorkerClient.d.ts +0 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -1,73 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export {
|
|
7
|
-
export { HtmlPreviewFrameComponent as HtmlPreviewFrame } from './components/CodeBlockNode/HtmlPreviewFrame.component';
|
|
8
|
-
export { D2BlockNodeComponent as D2BlockNode } from './components/D2BlockNode/D2BlockNode.component';
|
|
9
|
-
export { DefinitionListNodeComponent as DefinitionListNode } from './components/DefinitionListNode/DefinitionListNode.component';
|
|
10
|
-
export { EmojiNodeComponent as EmojiNode } from './components/EmojiNode/EmojiNode.component';
|
|
11
|
-
export { EmphasisNodeComponent as EmphasisNode } from './components/EmphasisNode/EmphasisNode.component';
|
|
12
|
-
export { FallbackComponent } from './components/FallbackComponent/FallbackComponent.component';
|
|
13
|
-
export { FootnoteAnchorNodeComponent as FootnoteAnchorNode } from './components/FootnoteAnchorNode/FootnoteAnchorNode.component';
|
|
14
|
-
export { FootnoteNodeComponent as FootnoteNode } from './components/FootnoteNode/FootnoteNode.component';
|
|
15
|
-
export { FootnoteReferenceNodeComponent as FootnoteReferenceNode } from './components/FootnoteReferenceNode/FootnoteReferenceNode.component';
|
|
16
|
-
export { HardBreakNodeComponent as HardBreakNode } from './components/HardBreakNode/HardBreakNode.component';
|
|
17
|
-
export { HeadingNodeComponent as HeadingNode } from './components/HeadingNode/HeadingNode.component';
|
|
18
|
-
export { HighlightNodeComponent as HighlightNode } from './components/HighlightNode/HighlightNode.component';
|
|
19
|
-
export { HtmlBlockNodeComponent as HtmlBlockNode } from './components/HtmlBlockNode/HtmlBlockNode.component';
|
|
20
|
-
export { HtmlInlineNodeComponent as HtmlInlineNode } from './components/HtmlInlineNode/HtmlInlineNode.component';
|
|
21
|
-
export { ImageNodeComponent as ImageNode } from './components/ImageNode/ImageNode.component';
|
|
22
|
-
export { InfographicBlockNodeComponent as InfographicBlockNode } from './components/InfographicBlockNode/InfographicBlockNode.component';
|
|
23
|
-
export { InlineCodeNodeComponent as InlineCodeNode } from './components/InlineCodeNode/InlineCodeNode.component';
|
|
24
|
-
export { InsertNodeComponent as InsertNode } from './components/InsertNode/InsertNode.component';
|
|
25
|
-
export { LinkNodeComponent as LinkNode } from './components/LinkNode/LinkNode.component';
|
|
26
|
-
export { ListItemNodeComponent as ListItemNode } from './components/ListItemNode/ListItemNode.component';
|
|
27
|
-
export { ListNodeComponent as ListNode } from './components/ListNode/ListNode.component';
|
|
28
|
-
export { MathBlockNodeComponent as MathBlockNode } from './components/MathBlockNode/MathBlockNode.component';
|
|
29
|
-
export { MathInlineNodeComponent as MathInlineNode } from './components/MathInlineNode/MathInlineNode.component';
|
|
30
|
-
export { MermaidBlockNodeComponent as MermaidBlockNode } from './components/MermaidBlockNode/MermaidBlockNode.component';
|
|
31
|
-
export { NestedRendererComponent as NestedRenderer } from './components/NestedRenderer/NestedRenderer.component';
|
|
32
|
-
export { NodeRendererComponent as NodeRenderer } from './components/NodeRenderer/NodeRenderer.component';
|
|
33
|
-
export { ParagraphNodeComponent as ParagraphNode } from './components/ParagraphNode/ParagraphNode.component';
|
|
34
|
-
export { PreCodeNodeComponent as PreCodeNode } from './components/PreCodeNode/PreCodeNode.component';
|
|
35
|
-
export { ReferenceNodeComponent as ReferenceNode } from './components/ReferenceNode/ReferenceNode.component';
|
|
36
|
-
export type { AngularRenderableNode, AngularRenderContext, NodeRendererEvents, NodeRendererProps, } from './components/shared/node-helpers';
|
|
37
|
-
export { buildRenderContext, resolveParsedNodes, } from './components/shared/node-helpers';
|
|
38
|
-
export { SafeAttrsDirective } from './components/shared/safe-attrs.directive';
|
|
39
|
-
export { StrikethroughNodeComponent as StrikethroughNode } from './components/StrikethroughNode/StrikethroughNode.component';
|
|
40
|
-
export { StrongNodeComponent as StrongNode } from './components/StrongNode/StrongNode.component';
|
|
41
|
-
export { SubscriptNodeComponent as SubscriptNode } from './components/SubscriptNode/SubscriptNode.component';
|
|
42
|
-
export { SuperscriptNodeComponent as SuperscriptNode } from './components/SuperscriptNode/SuperscriptNode.component';
|
|
43
|
-
export { TableNodeComponent as TableNode } from './components/TableNode/TableNode.component';
|
|
44
|
-
export { TextNodeComponent as TextNode } from './components/TextNode/TextNode.component';
|
|
45
|
-
export { ThematicBreakNodeComponent as ThematicBreakNode } from './components/ThematicBreakNode/ThematicBreakNode.component';
|
|
46
|
-
export { VmrContainerNodeComponent as VmrContainerNode } from './components/VmrContainerNode/VmrContainerNode.component';
|
|
47
|
-
export { clearGlobalCustomComponents, getCustomComponentsRevision, getCustomNodeComponents, removeCustomComponents, setCustomComponents, subscribeCustomComponents, } from './customComponents';
|
|
48
|
-
export type { CustomComponentMap } from './customComponents';
|
|
49
|
-
export { disposeRenderedHtmlEnhancements, enhanceRenderedHtml, } from './enhanceRenderedHtml';
|
|
50
|
-
export type { EnhanceRenderedHtmlOptions, RenderedHtmlEnhancementHandle } from './enhanceRenderedHtml';
|
|
51
|
-
export { setDefaultI18nMap, useSafeI18n } from './i18n/useSafeI18n';
|
|
52
|
-
export { MarkstreamAngularComponent } from './markstream-angular.component';
|
|
53
|
-
export { MarkstreamAngularComponent as MarkdownRenderComponent } from './markstream-angular.component';
|
|
54
|
-
export { MarkstreamAngularComponent as default } from './markstream-angular.component';
|
|
55
|
-
export type { MarkstreamAngularComponentProps } from './markstream-angular.component';
|
|
56
|
-
export type { D2Loader } from './optional/d2';
|
|
57
|
-
export { disableD2, enableD2, isD2Enabled, setD2Loader, } from './optional/d2';
|
|
58
|
-
export type { KatexLoader } from './optional/katex';
|
|
59
|
-
export { disableKatex, enableKatex, getKatex, isKatexEnabled, setKatexLoader, } from './optional/katex';
|
|
60
|
-
export type { MermaidLoader } from './optional/mermaid';
|
|
61
|
-
export { disableMermaid, enableMermaid, getMermaid, isMermaidEnabled, setMermaidLoader, } from './optional/mermaid';
|
|
62
|
-
export { parseNestedMarkdownToNodes, } from './parseNestedMarkdownToNodes';
|
|
63
|
-
export type { NestedMarkdownNodesInput, NestedMarkdownNodesOptions, } from './parseNestedMarkdownToNodes';
|
|
64
|
-
export { renderMarkdownNodesToHtml, renderMarkdownNodeToHtml, renderMarkdownToHtml, renderNestedMarkdownToHtml, } from './renderMarkdownHtml';
|
|
65
|
-
export type { MarkstreamAngularRenderOptions, NestedMarkdownHtmlInput, NestedMarkdownHtmlOptions, RenderableMarkdownNode, } from './renderMarkdownHtml';
|
|
66
|
-
export { sanitizeHtmlContent } from './sanitizeHtmlContent';
|
|
67
|
-
export type { CodeBlockDiffAppearance, CodeBlockDiffHideUnchangedRegions, CodeBlockDiffHideUnchangedRegionsOptions, CodeBlockDiffHunkActionContext, CodeBlockDiffHunkActionKind, CodeBlockDiffHunkSide, CodeBlockDiffLineStyle, CodeBlockDiffUnchangedRegionStyle, CodeBlockMonacoLanguage, CodeBlockMonacoOptions, CodeBlockMonacoTheme, CodeBlockMonacoThemeObject, } from './types/monaco';
|
|
68
|
-
export { getLanguageIcon, languageMap, normalizeLanguageIdentifier, resolveMonacoLanguageId, setLanguageIconResolver, } from './utils/languageIcon';
|
|
69
|
-
export type { LanguageIconResolver } from './utils/languageIcon';
|
|
70
|
-
export * from './workers/katexCdnWorker';
|
|
71
|
-
export * from './workers/katexWorkerClient';
|
|
72
|
-
export * from './workers/mermaidCdnWorker';
|
|
73
|
-
export * from './workers/mermaidWorkerClient';
|
|
1
|
+
export * from './markstream-angular/src/index'
|
|
2
|
+
export {}
|
|
3
|
+
import MarkstreamAngular from './markstream-angular/src/index'
|
|
4
|
+
export default MarkstreamAngular
|
|
5
|
+
export * from './markstream-angular/src/index'
|
|
6
|
+
export {}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export declare class HtmlPreviewFrameComponent {
|
|
2
2
|
code: string;
|
|
3
3
|
isDark: boolean;
|
|
4
|
+
htmlPreviewAllowScripts: boolean;
|
|
5
|
+
htmlPreviewSandbox?: string;
|
|
4
6
|
title?: string;
|
|
5
7
|
onClose?: () => void;
|
|
6
8
|
private readonly i18n;
|
|
7
9
|
get resolvedTitle(): string;
|
|
10
|
+
get sandboxValue(): string;
|
|
8
11
|
get srcdoc(): string;
|
|
9
12
|
}
|
|
@@ -35,6 +35,9 @@ export declare class InfographicBlockNodeComponent implements AfterViewInit, OnC
|
|
|
35
35
|
get resolvedShowZoomControls(): boolean;
|
|
36
36
|
get resolvedShowTooltips(): boolean;
|
|
37
37
|
get resolvedMaxHeight(): string;
|
|
38
|
+
get estimatedPreviewHeightPx(): number;
|
|
39
|
+
get resolvedContainerMinHeight(): string;
|
|
40
|
+
private get maxPreviewHeight();
|
|
38
41
|
private resolveContainerMinHeight;
|
|
39
42
|
get resolvedLoading(): boolean;
|
|
40
43
|
get resolvedProgressiveRender(): boolean;
|
|
@@ -33,6 +33,8 @@ export declare class MermaidBlockNodeComponent implements AfterViewInit, OnChang
|
|
|
33
33
|
get resolvedShowZoomControls(): boolean;
|
|
34
34
|
get resolvedShowTooltips(): boolean;
|
|
35
35
|
get resolvedMaxHeight(): string;
|
|
36
|
+
get estimatedPreviewHeightPx(): number;
|
|
37
|
+
private get maxPreviewHeight();
|
|
36
38
|
get resolvedWorkerTimeout(): number;
|
|
37
39
|
get resolvedParseTimeout(): number;
|
|
38
40
|
get resolvedRenderTimeout(): number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OnChanges } from '@angular/core';
|
|
2
|
-
import { MarkdownIt, ParseOptions } from '
|
|
2
|
+
import { MarkdownIt, ParseOptions } from '../../../../markdown-parser/src/index.ts';
|
|
3
3
|
import { AngularRenderableNode, AngularRenderContext } from '../shared/node-helpers';
|
|
4
4
|
type NestedRenderItem = {
|
|
5
5
|
kind: 'label';
|
|
@@ -5,7 +5,7 @@ export declare class NodeOutletComponent {
|
|
|
5
5
|
indexKey?: string;
|
|
6
6
|
get resolvedType(): string;
|
|
7
7
|
get customComponentMap(): Record<string, import('@angular/core').Type<any>>;
|
|
8
|
-
get resolvedCustomComponent():
|
|
8
|
+
get resolvedCustomComponent(): any;
|
|
9
9
|
get customNode(): AngularRenderableNode;
|
|
10
10
|
get codeMode(): import('../shared/node-outlet-helpers').CodeBlockMode;
|
|
11
11
|
get htmlTag(): string;
|
|
@@ -18,6 +18,7 @@ export declare class NodeRendererComponent implements NodeRendererProps, OnChang
|
|
|
18
18
|
customMarkdownIt?: NodeRendererProps['customMarkdownIt'];
|
|
19
19
|
debugPerformance?: boolean;
|
|
20
20
|
customHtmlTags?: readonly string[];
|
|
21
|
+
htmlPolicy: NodeRendererProps['htmlPolicy'];
|
|
21
22
|
viewportPriority?: boolean;
|
|
22
23
|
codeBlockStream: boolean;
|
|
23
24
|
codeBlockDarkTheme?: any;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const MERMAID_PREVIEW_MIN_HEIGHT = 360;
|
|
2
|
+
export declare const MERMAID_PREVIEW_MAX_HEIGHT = 500;
|
|
3
|
+
export declare const INFOGRAPHIC_PREVIEW_MIN_HEIGHT = 360;
|
|
4
|
+
export declare const INFOGRAPHIC_PREVIEW_MAX_HEIGHT = 500;
|
|
5
|
+
export declare function parsePositiveNumber(value: unknown): number;
|
|
6
|
+
export declare function getMermaidDiagramKind(code: string): string;
|
|
7
|
+
export declare function estimateMermaidPreviewHeight(code: string): number;
|
|
8
|
+
export declare function estimateInfographicPreviewHeight(code: string): number;
|
|
9
|
+
export declare function clampPreviewHeight(height: number, minHeight?: number, maxHeight?: number | null): number;
|
package/dist/types/{components → markstream-angular/src/components}/shared/node-helpers.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
|
-
import { BaseNode, MarkdownIt, ParsedNode, ParseOptions, getHtmlTagFromContent, hasCompleteHtmlTagContent, normalizeCustomHtmlTags, normalizeCustomHtmlTagName as normalizeTagName, stripCustomHtmlWrapper } from '
|
|
2
|
+
import { BaseNode, HtmlPolicy, MarkdownIt, ParsedNode, ParseOptions, getHtmlTagFromContent, hasCompleteHtmlTagContent, normalizeCustomHtmlTags, normalizeCustomHtmlTagName as normalizeTagName, stripCustomHtmlWrapper } from '../../../../markdown-parser/src/index.ts';
|
|
3
3
|
import { CodeBlockMonacoOptions, CodeBlockMonacoTheme } from '../../types/monaco';
|
|
4
4
|
export { getHtmlTagFromContent, hasCompleteHtmlTagContent, normalizeCustomHtmlTags, normalizeTagName, stripCustomHtmlWrapper, };
|
|
5
5
|
export type AngularRenderableNode = (ParsedNode | BaseNode) & Record<string, unknown>;
|
|
@@ -15,6 +15,7 @@ export interface NodeRendererProps {
|
|
|
15
15
|
customMarkdownIt?: (md: MarkdownIt) => MarkdownIt;
|
|
16
16
|
debugPerformance?: boolean;
|
|
17
17
|
customHtmlTags?: readonly string[];
|
|
18
|
+
htmlPolicy?: HtmlPolicy;
|
|
18
19
|
viewportPriority?: boolean;
|
|
19
20
|
codeBlockStream?: boolean;
|
|
20
21
|
codeBlockDarkTheme?: CodeBlockMonacoTheme;
|
|
@@ -57,6 +58,7 @@ export interface AngularRenderContext {
|
|
|
57
58
|
codeBlockStream?: boolean;
|
|
58
59
|
renderCodeBlocksAsPre?: boolean;
|
|
59
60
|
allowHtml?: boolean;
|
|
61
|
+
htmlPolicy?: HtmlPolicy;
|
|
60
62
|
customHtmlTags?: readonly string[];
|
|
61
63
|
parseOptions?: ParseOptions;
|
|
62
64
|
customMarkdownIt?: (md: MarkdownIt) => MarkdownIt;
|
package/dist/types/{components → markstream-angular/src/components}/shared/node-outlet-helpers.d.ts
RENAMED
|
@@ -5,3 +5,4 @@ export declare function resolveHtmlTag(node: AngularRenderableNode): string;
|
|
|
5
5
|
export declare function coerceCustomHtmlNode(node: AngularRenderableNode): AngularRenderableNode;
|
|
6
6
|
export declare function coerceBuiltinHtmlNode(node: AngularRenderableNode, resolvedType: string): AngularRenderableNode;
|
|
7
7
|
export declare function resolveNodeOutletCustomInputs(node: AngularRenderableNode, context?: AngularRenderContext): Record<string, any>;
|
|
8
|
+
export declare function resolveNodeOutletCustomComponent(node: AngularRenderableNode, context?: AngularRenderContext, customComponents?: Record<string, any> | null): any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BaseNode } from '
|
|
1
|
+
import { BaseNode } from '../../markdown-parser/src/index.ts';
|
|
2
2
|
export declare function hydrateCustomTagContent<T extends BaseNode>(nodes: readonly T[] | null | undefined, source: string, customHtmlTags?: readonly string[]): T[];
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export { AdmonitionNodeComponent as AdmonitionNode } from './components/AdmonitionNode/AdmonitionNode.component';
|
|
2
|
+
export { BlockquoteNodeComponent as BlockquoteNode } from './components/BlockquoteNode/BlockquoteNode.component';
|
|
3
|
+
export { CheckboxNodeComponent as CheckboxNode } from './components/CheckboxNode/CheckboxNode.component';
|
|
4
|
+
export { CodeBlockNodeComponent as CodeBlockNode } from './components/CodeBlockNode/CodeBlockNode.component';
|
|
5
|
+
export { CodeBlockNodeComponent as AngularCodeBlockNode } from './components/CodeBlockNode/CodeBlockNode.component';
|
|
6
|
+
export { CodeBlockNodeComponent as MarkdownCodeBlockNode } from './components/CodeBlockNode/CodeBlockNode.component';
|
|
7
|
+
export { HtmlPreviewFrameComponent as HtmlPreviewFrame } from './components/CodeBlockNode/HtmlPreviewFrame.component';
|
|
8
|
+
export { D2BlockNodeComponent as D2BlockNode } from './components/D2BlockNode/D2BlockNode.component';
|
|
9
|
+
export { DefinitionListNodeComponent as DefinitionListNode } from './components/DefinitionListNode/DefinitionListNode.component';
|
|
10
|
+
export { EmojiNodeComponent as EmojiNode } from './components/EmojiNode/EmojiNode.component';
|
|
11
|
+
export { EmphasisNodeComponent as EmphasisNode } from './components/EmphasisNode/EmphasisNode.component';
|
|
12
|
+
export { FallbackComponent } from './components/FallbackComponent/FallbackComponent.component';
|
|
13
|
+
export { FootnoteAnchorNodeComponent as FootnoteAnchorNode } from './components/FootnoteAnchorNode/FootnoteAnchorNode.component';
|
|
14
|
+
export { FootnoteNodeComponent as FootnoteNode } from './components/FootnoteNode/FootnoteNode.component';
|
|
15
|
+
export { FootnoteReferenceNodeComponent as FootnoteReferenceNode } from './components/FootnoteReferenceNode/FootnoteReferenceNode.component';
|
|
16
|
+
export { HardBreakNodeComponent as HardBreakNode } from './components/HardBreakNode/HardBreakNode.component';
|
|
17
|
+
export { HeadingNodeComponent as HeadingNode } from './components/HeadingNode/HeadingNode.component';
|
|
18
|
+
export { HighlightNodeComponent as HighlightNode } from './components/HighlightNode/HighlightNode.component';
|
|
19
|
+
export { HtmlBlockNodeComponent as HtmlBlockNode } from './components/HtmlBlockNode/HtmlBlockNode.component';
|
|
20
|
+
export { HtmlInlineNodeComponent as HtmlInlineNode } from './components/HtmlInlineNode/HtmlInlineNode.component';
|
|
21
|
+
export { ImageNodeComponent as ImageNode } from './components/ImageNode/ImageNode.component';
|
|
22
|
+
export { InfographicBlockNodeComponent as InfographicBlockNode } from './components/InfographicBlockNode/InfographicBlockNode.component';
|
|
23
|
+
export { InlineCodeNodeComponent as InlineCodeNode } from './components/InlineCodeNode/InlineCodeNode.component';
|
|
24
|
+
export { InsertNodeComponent as InsertNode } from './components/InsertNode/InsertNode.component';
|
|
25
|
+
export { LinkNodeComponent as LinkNode } from './components/LinkNode/LinkNode.component';
|
|
26
|
+
export { ListItemNodeComponent as ListItemNode } from './components/ListItemNode/ListItemNode.component';
|
|
27
|
+
export { ListNodeComponent as ListNode } from './components/ListNode/ListNode.component';
|
|
28
|
+
export { MathBlockNodeComponent as MathBlockNode } from './components/MathBlockNode/MathBlockNode.component';
|
|
29
|
+
export { MathInlineNodeComponent as MathInlineNode } from './components/MathInlineNode/MathInlineNode.component';
|
|
30
|
+
export { MermaidBlockNodeComponent as MermaidBlockNode } from './components/MermaidBlockNode/MermaidBlockNode.component';
|
|
31
|
+
export { NestedRendererComponent as NestedRenderer } from './components/NestedRenderer/NestedRenderer.component';
|
|
32
|
+
export { NodeRendererComponent as NodeRenderer } from './components/NodeRenderer/NodeRenderer.component';
|
|
33
|
+
export { ParagraphNodeComponent as ParagraphNode } from './components/ParagraphNode/ParagraphNode.component';
|
|
34
|
+
export { PreCodeNodeComponent as PreCodeNode } from './components/PreCodeNode/PreCodeNode.component';
|
|
35
|
+
export { ReferenceNodeComponent as ReferenceNode } from './components/ReferenceNode/ReferenceNode.component';
|
|
36
|
+
export type { AngularRenderableNode, AngularRenderContext, NodeRendererEvents, NodeRendererProps, } from './components/shared/node-helpers';
|
|
37
|
+
export { buildRenderContext, resolveParsedNodes, } from './components/shared/node-helpers';
|
|
38
|
+
export { SafeAttrsDirective } from './components/shared/safe-attrs.directive';
|
|
39
|
+
export { StrikethroughNodeComponent as StrikethroughNode } from './components/StrikethroughNode/StrikethroughNode.component';
|
|
40
|
+
export { StrongNodeComponent as StrongNode } from './components/StrongNode/StrongNode.component';
|
|
41
|
+
export { SubscriptNodeComponent as SubscriptNode } from './components/SubscriptNode/SubscriptNode.component';
|
|
42
|
+
export { SuperscriptNodeComponent as SuperscriptNode } from './components/SuperscriptNode/SuperscriptNode.component';
|
|
43
|
+
export { TableNodeComponent as TableNode } from './components/TableNode/TableNode.component';
|
|
44
|
+
export { TextNodeComponent as TextNode } from './components/TextNode/TextNode.component';
|
|
45
|
+
export { ThematicBreakNodeComponent as ThematicBreakNode } from './components/ThematicBreakNode/ThematicBreakNode.component';
|
|
46
|
+
export { VmrContainerNodeComponent as VmrContainerNode } from './components/VmrContainerNode/VmrContainerNode.component';
|
|
47
|
+
export { clearGlobalCustomComponents, getCustomComponentsRevision, getCustomNodeComponents, removeCustomComponents, setCustomComponents, subscribeCustomComponents, } from './customComponents';
|
|
48
|
+
export type { CustomComponentMap } from './customComponents';
|
|
49
|
+
export { disposeRenderedHtmlEnhancements, enhanceRenderedHtml, } from './enhanceRenderedHtml';
|
|
50
|
+
export type { EnhanceRenderedHtmlOptions, RenderedHtmlEnhancementHandle } from './enhanceRenderedHtml';
|
|
51
|
+
export { setDefaultI18nMap, useSafeI18n } from './i18n/useSafeI18n';
|
|
52
|
+
export { MarkstreamAngularComponent } from './markstream-angular.component';
|
|
53
|
+
export { MarkstreamAngularComponent as MarkdownRenderComponent } from './markstream-angular.component';
|
|
54
|
+
export { MarkstreamAngularComponent as default } from './markstream-angular.component';
|
|
55
|
+
export type { MarkstreamAngularComponentProps } from './markstream-angular.component';
|
|
56
|
+
export type { D2Loader } from './optional/d2';
|
|
57
|
+
export { disableD2, enableD2, isD2Enabled, setD2Loader, } from './optional/d2';
|
|
58
|
+
export type { KatexLoader } from './optional/katex';
|
|
59
|
+
export { disableKatex, enableKatex, getKatex, isKatexEnabled, setKatexLoader, } from './optional/katex';
|
|
60
|
+
export type { MermaidLoader } from './optional/mermaid';
|
|
61
|
+
export { disableMermaid, enableMermaid, getMermaid, isMermaidEnabled, setMermaidLoader, } from './optional/mermaid';
|
|
62
|
+
export { parseNestedMarkdownToNodes, } from './parseNestedMarkdownToNodes';
|
|
63
|
+
export type { NestedMarkdownNodesInput, NestedMarkdownNodesOptions, } from './parseNestedMarkdownToNodes';
|
|
64
|
+
export { renderMarkdownNodesToHtml, renderMarkdownNodeToHtml, renderMarkdownToHtml, renderNestedMarkdownToHtml, } from './renderMarkdownHtml';
|
|
65
|
+
export type { MarkstreamAngularRenderOptions, NestedMarkdownHtmlInput, NestedMarkdownHtmlOptions, RenderableMarkdownNode, } from './renderMarkdownHtml';
|
|
66
|
+
export { sanitizeHtmlContent } from './sanitizeHtmlContent';
|
|
67
|
+
export type { CodeBlockDiffAppearance, CodeBlockDiffHideUnchangedRegions, CodeBlockDiffHideUnchangedRegionsOptions, CodeBlockDiffHunkActionContext, CodeBlockDiffHunkActionKind, CodeBlockDiffHunkSide, CodeBlockDiffLineStyle, CodeBlockDiffUnchangedRegionStyle, CodeBlockMonacoLanguage, CodeBlockMonacoOptions, CodeBlockMonacoTheme, CodeBlockMonacoThemeObject, } from './types/monaco';
|
|
68
|
+
export { getLanguageIcon, languageMap, normalizeLanguageIdentifier, resolveMonacoLanguageId, setLanguageIconResolver, } from './utils/languageIcon';
|
|
69
|
+
export type { LanguageIconResolver } from './utils/languageIcon';
|
|
70
|
+
export * from './workers/katexCdnWorker';
|
|
71
|
+
export * from './workers/katexWorkerClient';
|
|
72
|
+
export * from './workers/mermaidCdnWorker';
|
|
73
|
+
export * from './workers/mermaidWorkerClient';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseNode, MarkdownIt, ParseOptions } from '
|
|
1
|
+
import { BaseNode, MarkdownIt, ParseOptions } from '../../markdown-parser/src/index.ts';
|
|
2
2
|
export interface NestedMarkdownNodesInput {
|
|
3
3
|
node?: (BaseNode & Record<string, any>) | null;
|
|
4
4
|
nodes?: readonly BaseNode[] | null;
|
package/dist/types/{renderMarkdownHtml.d.ts → markstream-angular/src/renderMarkdownHtml.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseNode, ParsedNode, ParseOptions } from '
|
|
1
|
+
import { BaseNode, HtmlPolicy, ParsedNode, ParseOptions } from '../../markdown-parser/src/index.ts';
|
|
2
2
|
export type RenderableMarkdownNode = (ParsedNode | BaseNode) & Record<string, unknown>;
|
|
3
3
|
type NestedClassValue = string | readonly string[] | null | undefined;
|
|
4
4
|
export interface MarkstreamAngularRenderOptions {
|
|
@@ -8,11 +8,13 @@ export interface MarkstreamAngularRenderOptions {
|
|
|
8
8
|
parseOptions?: ParseOptions;
|
|
9
9
|
customHtmlTags?: readonly string[];
|
|
10
10
|
allowHtml?: boolean;
|
|
11
|
+
htmlPolicy?: HtmlPolicy;
|
|
11
12
|
}
|
|
12
13
|
export interface NestedMarkdownHtmlOptions {
|
|
13
14
|
cacheKey?: string;
|
|
14
15
|
customHtmlTags?: readonly string[];
|
|
15
16
|
allowHtml?: boolean;
|
|
17
|
+
htmlPolicy?: HtmlPolicy;
|
|
16
18
|
customNodeTag?: string;
|
|
17
19
|
customNodeClass?: NestedClassValue | ((node: RenderableMarkdownNode) => NestedClassValue);
|
|
18
20
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import f from "mermaid";
|
|
2
|
-
f.initialize({ startOnLoad: !1, securityLevel: "
|
|
3
|
-
function
|
|
2
|
+
f.initialize({ startOnLoad: !1, securityLevel: "strict", flowchart: { htmlLabels: !1 } });
|
|
3
|
+
function u(r, t) {
|
|
4
4
|
const e = `%%{init: {"theme": "${t === "dark" ? "dark" : "default"}"}}%%
|
|
5
5
|
`;
|
|
6
6
|
return r.trimStart().startsWith("%%{") ? r : e + r;
|
|
@@ -15,7 +15,7 @@ function g(r) {
|
|
|
15
15
|
return -1;
|
|
16
16
|
}
|
|
17
17
|
async function l(r, t) {
|
|
18
|
-
const a =
|
|
18
|
+
const a = u(r, t), e = f;
|
|
19
19
|
if (typeof e.parse == "function")
|
|
20
20
|
return await e.parse(a), !0;
|
|
21
21
|
throw new Error("mermaid.parse not available in worker");
|
|
@@ -28,16 +28,16 @@ async function p(r, t) {
|
|
|
28
28
|
const n = a.slice(0, e + 1);
|
|
29
29
|
await l(n.join(`
|
|
30
30
|
`), t);
|
|
31
|
-
let
|
|
31
|
+
let s = e + 1, o = a.length, c = e + 1, d = 0;
|
|
32
32
|
const m = 12;
|
|
33
|
-
for (;
|
|
34
|
-
const i = Math.floor((
|
|
33
|
+
for (; s <= o && d < m; ) {
|
|
34
|
+
const i = Math.floor((s + o) / 2), h = [...n, ...a.slice(e + 1, i)].join(`
|
|
35
35
|
`);
|
|
36
36
|
d += 1;
|
|
37
37
|
try {
|
|
38
|
-
await l(
|
|
38
|
+
await l(h, t), c = i, s = i + 1;
|
|
39
39
|
} catch {
|
|
40
|
-
|
|
40
|
+
o = i - 1;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
return [...n, ...a.slice(e + 1, c)].join(`
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markstream-angular",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.2-beta.
|
|
4
|
+
"version": "0.0.2-beta.8",
|
|
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.40"
|
|
51
51
|
},
|
|
52
52
|
"peerDependenciesMeta": {
|
|
53
53
|
"@antv/infographic": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@floating-ui/dom": "^1.7.6",
|
|
71
|
-
"stream-markdown-parser": "0.0.
|
|
71
|
+
"stream-markdown-parser": "0.0.91"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@types/node": "^18.19.130",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function sanitizeHtmlContent(content: string): string;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/types/{components → markstream-angular/src/components}/shared/render-window.d.ts
RENAMED
|
File without changes
|
/package/dist/types/{components → markstream-angular/src/components}/shared/rich-block-helpers.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/types/{enhanceRenderedHtml.d.ts → markstream-angular/src/enhanceRenderedHtml.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|