@docfuse/markdown 0.1.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/LICENSE +21 -0
- package/README.md +50 -0
- package/README.zh-CN.md +50 -0
- package/dist/Markdown-D33gcJbF.js +2116 -0
- package/dist/base.css +2 -0
- package/dist/client/chunks/client-DIoaSmq2.js +334 -0
- package/dist/client/chunks/gallery-BPqV7HsS.js +40 -0
- package/dist/client/chunks/image-BGExZy1g.js +36 -0
- package/dist/client/chunks/provider-DL6V8F7z.js +841 -0
- package/dist/client/chunks/react-runtime-ByABE9MG.js +10571 -0
- package/dist/client/chunks/serialized-BvfsNeRQ.js +3464 -0
- package/dist/client/chunks/table-DBiKAEbC.js +30 -0
- package/dist/client/index.js +4 -0
- package/dist/client/nativeBehaviors.d.ts +4 -0
- package/dist/client.d.ts +15 -0
- package/dist/compiler/analyze.d.ts +27 -0
- package/dist/compiler/assets.d.ts +29 -0
- package/dist/compiler/ast.d.ts +68 -0
- package/dist/compiler/createPipeline.d.ts +18 -0
- package/dist/compiler/defaultLabels.d.ts +28 -0
- package/dist/compiler/directiveValidation.d.ts +17 -0
- package/dist/compiler/highlighter.d.ts +3 -0
- package/dist/compiler/mdxModules.d.ts +19 -0
- package/dist/compiler/mdxPlugins.d.ts +16 -0
- package/dist/compiler/normalizeOptions.d.ts +16 -0
- package/dist/compiler/pluginPlan.d.ts +18 -0
- package/dist/compiler/plugins/code.d.ts +16 -0
- package/dist/compiler/plugins/directives.d.ts +24 -0
- package/dist/compiler/plugins/documentBlocks.d.ts +5 -0
- package/dist/compiler/plugins/tables.d.ts +5 -0
- package/dist/compiler/plugins.d.ts +24 -0
- package/dist/compiler/prepareMarkdown.d.ts +11 -0
- package/dist/compiler/sanitizeBoundary.d.ts +18 -0
- package/dist/compiler/stableJson.d.ts +2 -0
- package/dist/compiler/syntaxFeatures.d.ts +10 -0
- package/dist/compiler/types.d.ts +177 -0
- package/dist/components/blocks/MarkdownCodeBlock.d.ts +10 -0
- package/dist/components/blocks/MarkdownCopySnippet.d.ts +10 -0
- package/dist/components/blocks/MarkdownHeading.d.ts +13 -0
- package/dist/components/blocks/MarkdownImage.d.ts +16 -0
- package/dist/components/blocks/MarkdownTable.d.ts +12 -0
- package/dist/components/blocks/MarkdownTerminal.d.ts +9 -0
- package/dist/components/composite/MarkdownComposite.d.ts +37 -0
- package/dist/components/composite/MarkdownFileTree.d.ts +5 -0
- package/dist/components/composite/MarkdownTabs.d.ts +6 -0
- package/dist/components/gallery/ImageGallery.d.ts +25 -0
- package/dist/components/shared/MarkdownActions.d.ts +18 -0
- package/dist/components/shared/MarkdownDialog.d.ts +11 -0
- package/dist/components/shared/MarkdownFileIcon.d.ts +4 -0
- package/dist/components/shared/MarkdownIcon.d.ts +8 -0
- package/dist/components/shared/interactionConstants.d.ts +1 -0
- package/dist/components/shared/reactText.d.ts +14 -0
- package/dist/directiveValidation-BdIao7Yn.js +741 -0
- package/dist/file-icons/LICENSE +21 -0
- package/dist/file-icons/astro.svg +1 -0
- package/dist/file-icons/bun.svg +1 -0
- package/dist/file-icons/bun_light.svg +1 -0
- package/dist/file-icons/config.svg +1 -0
- package/dist/file-icons/console.svg +1 -0
- package/dist/file-icons/css.svg +1 -0
- package/dist/file-icons/database.svg +1 -0
- package/dist/file-icons/deno.svg +1 -0
- package/dist/file-icons/deno_light.svg +1 -0
- package/dist/file-icons/diff.svg +1 -0
- package/dist/file-icons/docker.svg +1 -0
- package/dist/file-icons/document.svg +1 -0
- package/dist/file-icons/download.svg +1 -0
- package/dist/file-icons/environment.svg +1 -0
- package/dist/file-icons/excel.svg +1 -0
- package/dist/file-icons/git.svg +1 -0
- package/dist/file-icons/github-actions.svg +1 -0
- package/dist/file-icons/go.svg +1 -0
- package/dist/file-icons/javascript.svg +1 -0
- package/dist/file-icons/json.svg +1 -0
- package/dist/file-icons/markdown.svg +1 -0
- package/dist/file-icons/nodejs.svg +1 -0
- package/dist/file-icons/npm.svg +1 -0
- package/dist/file-icons/pdf.svg +1 -0
- package/dist/file-icons/pnpm.svg +1 -0
- package/dist/file-icons/pnpm_light.svg +1 -0
- package/dist/file-icons/powerpoint.svg +1 -0
- package/dist/file-icons/python.svg +1 -0
- package/dist/file-icons/react.svg +1 -0
- package/dist/file-icons/rust.svg +1 -0
- package/dist/file-icons/sass.svg +1 -0
- package/dist/file-icons/settings.svg +1 -0
- package/dist/file-icons/svelte.svg +1 -0
- package/dist/file-icons/typescript.svg +1 -0
- package/dist/file-icons/vue.svg +1 -0
- package/dist/file-icons/word.svg +1 -0
- package/dist/file-icons/yaml.svg +1 -0
- package/dist/file-icons/yarn.svg +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +6 -0
- package/dist/islands/gallery.d.ts +2 -0
- package/dist/islands/image.d.ts +2 -0
- package/dist/islands/options.d.ts +8 -0
- package/dist/islands/provider.d.ts +4 -0
- package/dist/islands/serialized.d.ts +4 -0
- package/dist/islands/table.d.ts +2 -0
- package/dist/islands.d.ts +13 -0
- package/dist/plugins-DQ-VUuCT.js +288 -0
- package/dist/prepareMarkdown-CHqN2JF5.js +852 -0
- package/dist/protocol/serializedNode.d.ts +3 -0
- package/dist/react/Markdown.d.ts +54 -0
- package/dist/react/componentMap.d.ts +172 -0
- package/dist/react/semanticOverrideProps.d.ts +4 -0
- package/dist/react/slots.d.ts +39 -0
- package/dist/react/urlTransform.d.ts +12 -0
- package/dist/server/analyze.d.ts +6 -0
- package/dist/server/analyze.js +132 -0
- package/dist/server/cache.d.ts +16 -0
- package/dist/server/createMarkdownRenderer.d.ts +39 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.js +137 -0
- package/dist/shared/copyText.d.ts +2 -0
- package/dist/shared/fileKinds.d.ts +6 -0
- package/dist/theme.css +183 -0
- package/dist/theme.d.ts +167 -0
- package/dist/theme.js +228 -0
- package/package.json +110 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface MarkdownCopySnippetProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
value?: string;
|
|
5
|
+
copyLabel?: string;
|
|
6
|
+
copyFailureLabel?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Inline copy interaction shared by React applications and static islands. */
|
|
10
|
+
export declare function MarkdownCopySnippet(props: MarkdownCopySnippetProps): ReactNode;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ElementType, type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
interface MarkdownHeadingProps extends Omit<HTMLAttributes<HTMLHeadingElement>, 'children' | 'id'> {
|
|
3
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
4
|
+
as?: ElementType;
|
|
5
|
+
id?: string;
|
|
6
|
+
anchor?: string;
|
|
7
|
+
anchorLabel?: string;
|
|
8
|
+
copyFailureLabel?: string;
|
|
9
|
+
'data-df-element'?: string;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare function MarkdownHeading({ level, as, id, anchor, anchorLabel, copyFailureLabel, children, className, ...props }: MarkdownHeadingProps): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface MarkdownImageProps extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'title'> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
src?: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
caption?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
width?: number | string;
|
|
9
|
+
height?: number | string;
|
|
10
|
+
loading?: 'eager' | 'lazy';
|
|
11
|
+
srcSet?: string;
|
|
12
|
+
sizes?: string;
|
|
13
|
+
zoomLabel?: string;
|
|
14
|
+
closeLabel?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function MarkdownImage(props: MarkdownImageProps): ReactNode;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface MarkdownTableProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
tableTitle?: string;
|
|
5
|
+
copyLabel?: string;
|
|
6
|
+
copyFailureLabel?: string;
|
|
7
|
+
downloadLabel?: string;
|
|
8
|
+
zoomLabel?: string;
|
|
9
|
+
closeLabel?: string;
|
|
10
|
+
sortLabel?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function MarkdownTable(props: MarkdownTableProps): ReactNode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface MarkdownTerminalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'title'> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
title?: string;
|
|
5
|
+
source?: string;
|
|
6
|
+
copyLabel?: string;
|
|
7
|
+
copyFailureLabel?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function MarkdownTerminal(props: MarkdownTerminalProps): ReactNode;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type DetailsHTMLAttributes, type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { MarkdownCodeBlock } from '../blocks/MarkdownCodeBlock';
|
|
3
|
+
import { MarkdownCopySnippet } from '../blocks/MarkdownCopySnippet';
|
|
4
|
+
import { MarkdownImage } from '../blocks/MarkdownImage';
|
|
5
|
+
import { MarkdownTable } from '../blocks/MarkdownTable';
|
|
6
|
+
import { MarkdownTerminal } from '../blocks/MarkdownTerminal';
|
|
7
|
+
type MarkdownCompositeKind = 'callout' | 'tabs' | 'code-group' | 'steps' | 'code-block' | 'copy-snippet' | 'table' | 'image' | 'terminal' | 'details' | 'file-tree' | 'gallery' | 'card-grid' | 'api' | 'aside' | 'badge';
|
|
8
|
+
export interface MarkdownCompositeProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface MarkdownDetailsProps extends Omit<DetailsHTMLAttributes<HTMLDetailsElement>, 'children'> {
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare function MarkdownCallout({ children, ...props }: MarkdownCompositeProps): import("react").DetailedReactHTMLElement<{
|
|
15
|
+
'data-df-component': MarkdownCompositeKind;
|
|
16
|
+
'data-df-slot': string;
|
|
17
|
+
className?: string | undefined;
|
|
18
|
+
}, HTMLElement>;
|
|
19
|
+
export declare function MarkdownSteps({ children, ...props }: MarkdownCompositeProps): import("react").DetailedReactHTMLElement<{
|
|
20
|
+
'data-df-component': MarkdownCompositeKind;
|
|
21
|
+
'data-df-slot': string;
|
|
22
|
+
className?: string | undefined;
|
|
23
|
+
}, HTMLElement>;
|
|
24
|
+
/**
|
|
25
|
+
* Keeps native <details> semantics for static output, then upgrades its content
|
|
26
|
+
* area to a deterministic React disclosure transition after hydration.
|
|
27
|
+
*/
|
|
28
|
+
export declare function MarkdownDetails(props: MarkdownDetailsProps): ReactNode;
|
|
29
|
+
/** Structural React wrappers for trusted/document extension blocks. */
|
|
30
|
+
export { ImageGallery as MarkdownGallery } from '../gallery/ImageGallery';
|
|
31
|
+
export { MarkdownTabs } from './MarkdownTabs';
|
|
32
|
+
export { MarkdownFileTree } from './MarkdownFileTree';
|
|
33
|
+
export declare function MarkdownCardGrid({ children, ...props }: MarkdownCompositeProps): import("react").JSX.Element;
|
|
34
|
+
export declare function MarkdownApiBlock({ children, ...props }: MarkdownCompositeProps): import("react").JSX.Element;
|
|
35
|
+
export declare function MarkdownAside({ children, ...props }: MarkdownCompositeProps): import("react").JSX.Element;
|
|
36
|
+
export declare function MarkdownBadge({ children, ...props }: MarkdownCompositeProps): import("react").JSX.Element;
|
|
37
|
+
export { MarkdownCodeBlock, MarkdownCopySnippet, MarkdownImage, MarkdownTable, MarkdownTerminal };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface MarkdownFileTreeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function MarkdownFileTree(props: MarkdownFileTreeProps): ReactNode;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface MarkdownTabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
kind?: 'tabs' | 'code-group';
|
|
5
|
+
}
|
|
6
|
+
export declare function MarkdownTabs(props: MarkdownTabsProps): ReactNode;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface MarkdownGalleryItem {
|
|
3
|
+
src: string;
|
|
4
|
+
alt: string;
|
|
5
|
+
caption?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
srcSet?: string;
|
|
8
|
+
sizes?: string;
|
|
9
|
+
width?: number | string;
|
|
10
|
+
height?: number | string;
|
|
11
|
+
}
|
|
12
|
+
export interface ImageGalleryProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'role'> {
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
items?: MarkdownGalleryItem[];
|
|
15
|
+
role?: 'group' | 'region';
|
|
16
|
+
labels?: Partial<{
|
|
17
|
+
gallery: string;
|
|
18
|
+
close: string;
|
|
19
|
+
previous: string;
|
|
20
|
+
next: string;
|
|
21
|
+
thumbnails: string;
|
|
22
|
+
image: string;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
export declare function ImageGallery(props: ImageGalleryProps): ReactNode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type MarkdownIconName } from './MarkdownIcon';
|
|
2
|
+
export { copyMarkdownText } from '../../shared/copyText';
|
|
3
|
+
export declare function MarkdownCopyButton({ value, label, action, className, icon, failureLabel }: {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
action: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
icon?: MarkdownIconName;
|
|
9
|
+
failureLabel?: string;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
export declare function MarkdownDownloadButton({ value, filename, label, action, className, contentType }: {
|
|
12
|
+
value: string;
|
|
13
|
+
filename: string;
|
|
14
|
+
label: string;
|
|
15
|
+
action: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
contentType?: string;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type KeyboardEvent, type ReactNode, type RefObject } from 'react';
|
|
2
|
+
export declare function MarkdownDialogPortal({ children }: {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}): import("react").ReactPortal | null;
|
|
5
|
+
export declare function useMarkdownDialog({ open, close, dialogRef, initialFocusRef, triggerRef }: {
|
|
6
|
+
open: boolean;
|
|
7
|
+
close: () => void;
|
|
8
|
+
dialogRef: RefObject<HTMLElement | null>;
|
|
9
|
+
initialFocusRef: RefObject<HTMLElement | null>;
|
|
10
|
+
triggerRef: RefObject<HTMLElement | null>;
|
|
11
|
+
}): (event: KeyboardEvent<HTMLElement>) => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type MarkdownIconName } from '../../react/slots';
|
|
2
|
+
export type { MarkdownIconName } from '../../react/slots';
|
|
3
|
+
export declare function MarkdownIcon({ name, size, className }: {
|
|
4
|
+
name: MarkdownIconName;
|
|
5
|
+
size?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
direction?: 'asc' | 'desc';
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ACTION_FEEDBACK_DURATION_MS = 1500;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
export declare function reactText(value: unknown): string;
|
|
3
|
+
export type MarkdownReactElement = ReactElement<Record<string, unknown> & {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function elementChildren(value: ReactNode): MarkdownReactElement[];
|
|
7
|
+
/** Resolve names from raw elements and the mapped Markdown element functions. */
|
|
8
|
+
export declare function elementTag(element: MarkdownReactElement): string;
|
|
9
|
+
export declare function readProp(props: object, ...names: string[]): {} | undefined;
|
|
10
|
+
export declare function stringProp(props: object, ...names: string[]): string;
|
|
11
|
+
export declare function markdownDomProps(props: object, omitted?: readonly string[]): {
|
|
12
|
+
[k: string]: any;
|
|
13
|
+
};
|
|
14
|
+
export declare function mergeMarkdownClasses(base: string, value: unknown): string;
|