@aiquants/markdown 13.2.0 → 13.4.0
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/components/MarkdownRenderer.d.ts +4 -2
- package/dist/components/MarkdownViewer.d.ts +4 -1
- package/dist/components/MermaidDiagram.d.ts +3 -2
- package/dist/components/mermaidInteraction.d.ts +9 -3
- package/dist/extractHeadings-DXugjr7W.js +6796 -0
- package/dist/extractHeadings-PPInR6qd.cjs +12 -0
- package/dist/index.cjs +1 -1
- package/dist/index.client.cjs +1 -1
- package/dist/index.client.d.ts +2 -2
- package/dist/index.client.js +53 -51
- package/dist/index.js +53 -51
- package/dist/mermaidFrame/NOTICES.md +1 -1
- package/dist/viewer-settings.cjs +1 -1
- package/dist/viewer-settings.d.ts +1 -0
- package/dist/viewer-settings.js +6 -5
- package/package.json +7 -7
- package/dist/extractHeadings-BfYlTVvN.js +0 -6773
- package/dist/extractHeadings-CZPJi4gM.cjs +0 -12
|
@@ -5,7 +5,7 @@ import { CodeBlockLabels } from "./codeBlockLabels.ts";
|
|
|
5
5
|
import { DisplayMathLabels } from "./displayMathLabels.ts";
|
|
6
6
|
import { MarkdownEmbedLabels } from "./embeds/embedLabels.ts";
|
|
7
7
|
import { MarkdownLinkAttributes } from "./links.ts";
|
|
8
|
-
import { MermaidDocumentExporting, MermaidDrawing, MermaidInteractionMode } from "./MermaidDiagram.tsx";
|
|
8
|
+
import { MermaidDocumentExporting, MermaidDrawing, MermaidInteractionMode, PanZoomModifier } from "./MermaidDiagram.tsx";
|
|
9
9
|
import { MarkdownMathDiagnostic } from "./mathRendering.ts";
|
|
10
10
|
import { MermaidDiagramLabels } from "./mermaidLabels.ts";
|
|
11
11
|
import { SpreadsheetEditor } from "./SpreadsheetBlock.tsx";
|
|
@@ -44,7 +44,9 @@ type RendererProps = {
|
|
|
44
44
|
iFrameAllowedDomains?: readonly string[];
|
|
45
45
|
embeds?: MarkdownEmbeds;
|
|
46
46
|
embedLabels?: MarkdownEmbedLabels;
|
|
47
|
+
documentFontFamily?: string;
|
|
47
48
|
mermaidInteraction?: MermaidInteractionMode;
|
|
49
|
+
mermaidModifier?: PanZoomModifier;
|
|
48
50
|
mermaidLabels?: MermaidDiagramLabels;
|
|
49
51
|
mermaidDrawing?: MermaidDrawing;
|
|
50
52
|
mermaidExporting?: MermaidDocumentExporting;
|
|
@@ -78,5 +80,5 @@ type AllowlistProps = {
|
|
|
78
80
|
readonly iFrameAllowedDomains?: undefined;
|
|
79
81
|
};
|
|
80
82
|
type Props = RendererProps & AllowlistProps;
|
|
81
|
-
export declare const MarkdownRenderer: ({ htmlContent, blockOffsets, blockKeyEpoch, streaming, truncated, theme, topHeadingLevel, iFrameAllowedDomains, embeds, embedLabels, mermaidInteraction, mermaidLabels, mermaidDrawing, mermaidExporting, maxMermaidDiagrams, codeBlockLabels, displayMathLabels, spreadsheetEditor, spreadsheetLocale, spreadsheetLabels, spreadsheetTapScrollCircle, spreadsheetScrollBarControls, linkComponent: LinkComponent, missingImageLabel, blockFailedLabel, labelsLang, imageSource, svgImageLabels, onMathDiagnostics, allowlist, imageComponent: ImageComponent, idPrefix, }: Props) => import("react").JSX.Element;
|
|
83
|
+
export declare const MarkdownRenderer: ({ htmlContent, blockOffsets, blockKeyEpoch, streaming, truncated, theme, topHeadingLevel, iFrameAllowedDomains, embeds, embedLabels, documentFontFamily, mermaidInteraction, mermaidModifier, mermaidLabels, mermaidDrawing, mermaidExporting, maxMermaidDiagrams, codeBlockLabels, displayMathLabels, spreadsheetEditor, spreadsheetLocale, spreadsheetLabels, spreadsheetTapScrollCircle, spreadsheetScrollBarControls, linkComponent: LinkComponent, missingImageLabel, blockFailedLabel, labelsLang, imageSource, svgImageLabels, onMathDiagnostics, allowlist, imageComponent: ImageComponent, idPrefix, }: Props) => import("react").JSX.Element;
|
|
82
84
|
export {};
|
|
@@ -4,6 +4,7 @@ import { MarkdownEmbeds } from "../embeds/linkCards.ts";
|
|
|
4
4
|
import { ContentAlign, ContentColors, ContentMeasure, MarkdownStyleOption } from "../viewer-settings.ts";
|
|
5
5
|
import { MarkdownScrollBarRenderer } from "./HostedScrollArea.tsx";
|
|
6
6
|
import { MarkdownLinkComponent } from "./MarkdownRenderer.tsx";
|
|
7
|
+
import { PanZoomModifier } from "./MermaidDiagram.tsx";
|
|
7
8
|
import { MarkdownMathDiagnostic } from "./mathRendering.ts";
|
|
8
9
|
import { SpreadsheetEditor } from "./SpreadsheetBlock.tsx";
|
|
9
10
|
import { MarkdownImageSourceReader } from "./SvgImageBlock.tsx";
|
|
@@ -85,6 +86,8 @@ export interface MarkdownViewerProps {
|
|
|
85
86
|
spreadsheetLocale?: SpreadsheetBlockLocale;
|
|
86
87
|
spreadsheetTapScrollCircle?: ScrollBarTapCircleOptions;
|
|
87
88
|
spreadsheetScrollBarControls?: SpreadsheetScrollBarControls;
|
|
89
|
+
mermaidModifier?: PanZoomModifier;
|
|
90
|
+
documentFontFamily?: string;
|
|
88
91
|
imageSource?: MarkdownImageSourceReader;
|
|
89
92
|
emptyMessage?: string;
|
|
90
93
|
toolbar?: MarkdownToolbarState;
|
|
@@ -92,4 +95,4 @@ export interface MarkdownViewerProps {
|
|
|
92
95
|
scrollBarGutter?: number | string;
|
|
93
96
|
scrollBarInlineSize?: number | string;
|
|
94
97
|
}
|
|
95
|
-
export declare function MarkdownViewer({ parseResult, content, error, isLoading, labels, labelsLang, theme, style, onStyleChange, availableStyles, align, onAlignChange, showToc, showStyle, showAlign, contentLang, measure, onMeasureChange, showMeasure, contentColors, onContentColorsChange, showContentColors, width, maxWidth, padding, iFrameAllowedDomains, embeds, fetch: hostFetch, emptyMessage, toolbar: toolbarProp, linkComponent, onHeadingSelect, headingHref, onMathDiagnostics, spreadsheetEditor, spreadsheetLocale, spreadsheetTapScrollCircle, spreadsheetScrollBarControls, imageSource, renderScrollBar, scrollBarGutter, scrollBarInlineSize, }: MarkdownViewerProps): import("react").JSX.Element;
|
|
98
|
+
export declare function MarkdownViewer({ parseResult, content, error, isLoading, labels, labelsLang, theme, style, onStyleChange, availableStyles, align, onAlignChange, showToc, showStyle, showAlign, contentLang, measure, onMeasureChange, showMeasure, contentColors, onContentColorsChange, showContentColors, width, maxWidth, padding, iFrameAllowedDomains, embeds, fetch: hostFetch, emptyMessage, toolbar: toolbarProp, linkComponent, onHeadingSelect, headingHref, onMathDiagnostics, spreadsheetEditor, spreadsheetLocale, spreadsheetTapScrollCircle, spreadsheetScrollBarControls, mermaidModifier, documentFontFamily, imageSource, renderScrollBar, scrollBarGutter, scrollBarInlineSize, }: MarkdownViewerProps): import("react").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { MermaidDrawer } from "../mermaidFrame/drawer.ts";
|
|
2
2
|
import { MermaidExporting } from "./mermaidExport.ts";
|
|
3
|
-
import { MermaidInteractionMode } from "./mermaidInteraction.ts";
|
|
3
|
+
import { MermaidInteractionMode, PanZoomModifier } from "./mermaidInteraction.ts";
|
|
4
4
|
import { MermaidDiagramLabels } from "./mermaidLabels.ts";
|
|
5
5
|
export type { MermaidDiagramFile, MermaidDocumentExporting, MermaidExporting, MermaidSaveFormat } from "./mermaidExport.ts";
|
|
6
|
-
export { DEFAULT_MERMAID_INTERACTION, type MermaidInteractionMode } from "./mermaidInteraction.ts";
|
|
6
|
+
export { DEFAULT_MERMAID_INTERACTION, DEFAULT_PAN_ZOOM_MODIFIER, type MermaidInteractionMode, type PanZoomModifier } from "./mermaidInteraction.ts";
|
|
7
7
|
export { DEFAULT_MERMAID_DIAGRAM_LABELS, type MermaidDiagramLabels } from "./mermaidLabels.ts";
|
|
8
8
|
export interface MermaidDrawing {
|
|
9
9
|
readonly drawer: MermaidDrawer;
|
|
@@ -21,6 +21,7 @@ export type MermaidHeld = {
|
|
|
21
21
|
interface MermaidDiagramProps {
|
|
22
22
|
chartContent: string;
|
|
23
23
|
interaction?: MermaidInteractionMode;
|
|
24
|
+
modifier?: PanZoomModifier;
|
|
24
25
|
hideInteractionMenu?: boolean;
|
|
25
26
|
labels?: MermaidDiagramLabels;
|
|
26
27
|
labelsLang?: string;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export type MermaidInteractionMode = "none" | "zoom" | "pan" | "pan-shift" | "both" | "both-shift";
|
|
2
2
|
export declare const DEFAULT_MERMAID_INTERACTION: MermaidInteractionMode;
|
|
3
|
-
export type
|
|
3
|
+
export type PanZoomModifier = "ctrl" | "shift";
|
|
4
|
+
export declare const DEFAULT_PAN_ZOOM_MODIFIER: PanZoomModifier;
|
|
5
|
+
export declare function modifierHeldOf(event: {
|
|
6
|
+
ctrlKey: boolean;
|
|
7
|
+
shiftKey: boolean;
|
|
8
|
+
}, modifier: PanZoomModifier): boolean;
|
|
9
|
+
export type PanTrigger = null | "drag" | "modifier-drag";
|
|
4
10
|
export interface InteractionCapabilities {
|
|
5
11
|
panTrigger: PanTrigger;
|
|
6
12
|
zoom: boolean;
|
|
@@ -38,11 +44,11 @@ export interface DrawingBox extends BoxSize {
|
|
|
38
44
|
export declare function touchActionOf(capabilities: InteractionCapabilities, overflowing: boolean): "auto" | "pan-x pan-y" | "pinch-zoom" | "none";
|
|
39
45
|
export declare function shouldStartPan(capabilities: InteractionCapabilities, event: {
|
|
40
46
|
button: number;
|
|
41
|
-
|
|
47
|
+
modifierHeld: boolean;
|
|
42
48
|
pointerType?: string;
|
|
43
49
|
}, overflowing: boolean): boolean;
|
|
44
50
|
export declare function shouldZoomOnWheel(capabilities: InteractionCapabilities, event: {
|
|
45
|
-
|
|
51
|
+
modifierHeld: boolean;
|
|
46
52
|
}): boolean;
|
|
47
53
|
export declare function naturalSizeOf(viewBox: string | null): BoxSize | null;
|
|
48
54
|
export declare function fitScaleOf(laidOutInline: number, naturalInline: number | null): number;
|