@readme/markdown 8.1.0 → 8.3.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/README.md +38 -22
- package/components/Accordion/index.tsx +5 -2
- package/components/Anchor.jsx +1 -1
- package/components/Callout/index.tsx +5 -4
- package/components/Cards/index.tsx +17 -5
- package/components/Code/index.tsx +11 -2
- package/components/CodeTabs/index.tsx +5 -1
- package/components/Columns/index.tsx +7 -6
- package/components/Embed/index.tsx +10 -7
- package/components/Glossary/index.tsx +8 -4
- package/components/HTMLBlock/index.tsx +10 -2
- package/components/Heading/index.tsx +6 -2
- package/components/Image/index.tsx +15 -13
- package/components/Table/index.tsx +2 -2
- package/components/Tabs/index.tsx +21 -14
- package/components/TailwindRoot/index.tsx +3 -1
- package/dist/components/Accordion/index.d.ts +7 -6
- package/dist/components/Callout/index.d.ts +2 -2
- package/dist/components/Cards/index.d.ts +13 -11
- package/dist/components/CodeTabs/index.d.ts +5 -1
- package/dist/components/Columns/index.d.ts +6 -7
- package/dist/components/Embed/index.d.ts +6 -6
- package/dist/components/Glossary/index.d.ts +4 -3
- package/dist/components/HTMLBlock/index.d.ts +5 -4
- package/dist/components/Heading/index.d.ts +1 -1
- package/dist/components/Image/index.d.ts +2 -2
- package/dist/components/Table/index.d.ts +2 -2
- package/dist/components/Tabs/index.d.ts +5 -6
- package/dist/components/TailwindRoot/index.d.ts +5 -4
- package/dist/contexts/GlossaryTerms.d.ts +4 -4
- package/dist/contexts/index.d.ts +2 -2
- package/dist/errors/mdx-syntax-error.d.ts +1 -1
- package/dist/example/RenderError.d.ts +5 -4
- package/dist/lib/ast-processor.d.ts +5 -5
- package/dist/lib/compile.d.ts +1 -3
- package/dist/lib/hast.d.ts +1 -1
- package/dist/lib/mdast.d.ts +3 -1
- package/dist/lib/mdastV6.d.ts +4 -1
- package/dist/lib/mdx.d.ts +3 -1
- package/dist/lib/plain.d.ts +1 -1
- package/dist/lib/run.d.ts +6 -12
- package/dist/main.js +28652 -28499
- package/dist/main.node.js +29301 -29148
- package/dist/main.node.js.map +1 -1
- package/dist/processor/compile/callout.d.ts +1 -1
- package/dist/processor/compile/code-tabs.d.ts +1 -1
- package/dist/processor/compile/compatibility.d.ts +20 -31
- package/dist/processor/compile/embed.d.ts +1 -1
- package/dist/processor/compile/gemoji.d.ts +1 -1
- package/dist/processor/compile/html-block.d.ts +1 -1
- package/dist/processor/compile/variable.d.ts +1 -1
- package/dist/processor/plugin/toc.d.ts +4 -4
- package/dist/processor/transform/callouts.d.ts +2 -1
- package/dist/processor/transform/code-tabs.d.ts +1 -1
- package/dist/processor/transform/compatability.d.ts +1 -1
- package/dist/processor/transform/div.d.ts +1 -1
- package/dist/processor/transform/embeds.d.ts +1 -1
- package/dist/processor/transform/gemoji+.d.ts +1 -1
- package/dist/processor/transform/images.d.ts +1 -1
- package/dist/processor/transform/index.d.ts +4 -4
- package/dist/processor/transform/inject-components.d.ts +2 -2
- package/dist/processor/transform/mdx-to-hast.d.ts +1 -1
- package/dist/processor/transform/mermaid.d.ts +1 -1
- package/dist/processor/transform/readme-components.d.ts +1 -1
- package/dist/processor/transform/readme-to-mdx.d.ts +1 -1
- package/dist/processor/transform/tables-to-jsx.d.ts +1 -1
- package/dist/processor/transform/tailwind.d.ts +1 -1
- package/dist/processor/transform/variables.d.ts +1 -1
- package/dist/processor/utils.d.ts +9 -8
- package/dist/utils/user.d.ts +2 -2
- package/package.json +4 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
children
|
|
4
|
-
runScripts
|
|
2
|
+
interface Props {
|
|
3
|
+
children: React.ReactElement | string;
|
|
4
|
+
runScripts?: boolean | string;
|
|
5
5
|
safeMode?: boolean;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
|
+
declare const HTMLBlock: ({ children, runScripts, safeMode }: Props) => React.JSX.Element;
|
|
7
8
|
export default HTMLBlock;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type Depth = 1 | 2 | 3 | 4 | 5 | 6;
|
|
3
3
|
interface Props extends React.PropsWithChildren<React.HTMLAttributes<HTMLHeadingElement>> {
|
|
4
|
-
tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
5
4
|
depth: Depth;
|
|
5
|
+
tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
6
6
|
}
|
|
7
7
|
declare const CreateHeading: (depth: Depth) => (props: Props) => React.JSX.Element;
|
|
8
8
|
export default CreateHeading;
|
|
@@ -4,13 +4,13 @@ interface ImageProps {
|
|
|
4
4
|
alt?: string;
|
|
5
5
|
border?: boolean;
|
|
6
6
|
caption?: string;
|
|
7
|
+
children?: [React.ReactElement];
|
|
7
8
|
className?: string;
|
|
8
9
|
height?: string;
|
|
10
|
+
lazy?: boolean;
|
|
9
11
|
src: string;
|
|
10
12
|
title?: string;
|
|
11
13
|
width?: string;
|
|
12
|
-
lazy?: boolean;
|
|
13
|
-
children?: [React.ReactElement];
|
|
14
14
|
}
|
|
15
15
|
declare const Image: (Props: ImageProps) => React.JSX.Element;
|
|
16
16
|
export default Image;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface Props extends JSX.IntrinsicAttributes {
|
|
3
|
-
align: ('
|
|
4
|
-
children: [React.ReactElement<HTMLTableCaptionElement |
|
|
3
|
+
align: ('center' | 'left' | 'right')[];
|
|
4
|
+
children: [React.ReactElement<HTMLTableCaptionElement | HTMLTableRowElement | HTMLTableSectionElement>];
|
|
5
5
|
}
|
|
6
6
|
declare const Table: (props: Props) => React.JSX.Element;
|
|
7
7
|
export default Table;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './style.scss';
|
|
3
|
-
export declare const Tab: ({ children }:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}) => React.JSX.Element;
|
|
3
|
+
export declare const Tab: ({ children }: React.PropsWithChildren) => React.JSX.Element;
|
|
4
|
+
interface TabsProps {
|
|
5
|
+
children?: React.ReactElement[];
|
|
6
|
+
}
|
|
7
|
+
declare const Tabs: ({ children }: TabsProps) => React.JSX.Element;
|
|
9
8
|
export default Tabs;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
2
|
+
interface Props extends React.PropsWithChildren<{
|
|
3
|
+
flow: boolean;
|
|
4
|
+
}> {
|
|
5
|
+
}
|
|
6
|
+
declare const TailwindRoot: ({ children, flow }: Props) => React.JSX.Element;
|
|
6
7
|
export default TailwindRoot;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
term: string;
|
|
3
|
-
definition: string;
|
|
1
|
+
export interface GlossaryTerm {
|
|
4
2
|
_id?: string;
|
|
5
|
-
|
|
3
|
+
definition: string;
|
|
4
|
+
term: string;
|
|
5
|
+
}
|
|
6
6
|
declare const GlossaryContext: import("react").Context<GlossaryTerm[]>;
|
|
7
7
|
export default GlossaryContext;
|
package/dist/contexts/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { RunOpts } from '../lib/run';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
type Props = React.PropsWithChildren & Pick<RunOpts, 'baseUrl' | 'terms' | 'variables'>;
|
|
3
|
+
type Props = Pick<RunOpts, 'baseUrl' | 'terms' | 'variables'> & React.PropsWithChildren;
|
|
4
4
|
declare const Contexts: ({ children, terms, variables, baseUrl }: Props) => React.ReactNode;
|
|
5
5
|
export default Contexts;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
interface Props {
|
|
3
4
|
error?: string;
|
|
4
5
|
}
|
|
@@ -15,9 +16,9 @@ declare class RenderError extends React.Component<PropsWithChildren<Props>, Stat
|
|
|
15
16
|
hasError: boolean;
|
|
16
17
|
message: string;
|
|
17
18
|
};
|
|
18
|
-
componentDidCatch(error:
|
|
19
|
-
componentStack:
|
|
19
|
+
static componentDidCatch(error: Error, info: {
|
|
20
|
+
componentStack: string;
|
|
20
21
|
}): void;
|
|
21
|
-
render(): string | number | boolean | React.
|
|
22
|
+
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element;
|
|
22
23
|
}
|
|
23
24
|
export default RenderError;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { PluggableList } from 'unified';
|
|
2
|
+
import rehypeSlug from 'rehype-slug';
|
|
1
3
|
import remarkFrontmatter from 'remark-frontmatter';
|
|
2
4
|
import remarkGfm from 'remark-gfm';
|
|
3
|
-
|
|
4
|
-
import { PluggableList } from 'unified';
|
|
5
|
-
export type MdastOpts = {
|
|
5
|
+
export interface MdastOpts {
|
|
6
6
|
components?: Record<string, string>;
|
|
7
7
|
remarkPlugins?: PluggableList;
|
|
8
|
-
}
|
|
9
|
-
export declare const remarkPlugins: ((() => (tree:
|
|
8
|
+
}
|
|
9
|
+
export declare const remarkPlugins: ((() => (tree: import("mdast").Root) => void) | (({ copyButtons }?: {
|
|
10
10
|
copyButtons?: boolean;
|
|
11
11
|
}) => (tree: import("mdast").Node) => import("mdast").Node) | typeof remarkFrontmatter | typeof remarkGfm)[];
|
|
12
12
|
export declare const rehypePlugins: ((() => (tree: import("unist").Node) => import("unist").Node) | typeof rehypeSlug)[];
|
package/dist/lib/compile.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { CompileOptions } from '@mdx-js/mdx';
|
|
1
|
+
import type { CompileOptions } from '@mdx-js/mdx';
|
|
2
2
|
export type CompileOpts = CompileOptions & {
|
|
3
|
-
lazyImages?: boolean;
|
|
4
|
-
safeMode?: boolean;
|
|
5
3
|
components?: Record<string, string>;
|
|
6
4
|
copyButtons?: boolean;
|
|
7
5
|
useTailwind?: boolean;
|
package/dist/lib/hast.d.ts
CHANGED
package/dist/lib/mdast.d.ts
CHANGED
package/dist/lib/mdastV6.d.ts
CHANGED
package/dist/lib/mdx.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Root as HastRoot } from 'hast';
|
|
2
|
+
import type { Root as MdastRoot } from 'mdast';
|
|
3
|
+
export declare const mdx: (tree: HastRoot | MdastRoot, { hast, ...opts }?: {
|
|
2
4
|
hast?: boolean;
|
|
3
5
|
}) => string;
|
|
4
6
|
export default mdx;
|
package/dist/lib/plain.d.ts
CHANGED
package/dist/lib/run.d.ts
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Variables } from '../utils/user';
|
|
1
|
+
import type { GlossaryTerm } from '../contexts/GlossaryTerms';
|
|
2
|
+
import type { CustomComponents, RMDXModule } from '../types';
|
|
3
|
+
import type { Variables } from '../utils/user';
|
|
4
|
+
import type { RunOptions } from '@mdx-js/mdx';
|
|
6
5
|
export type RunOpts = Omit<RunOptions, 'Fragment'> & {
|
|
6
|
+
baseUrl?: string;
|
|
7
7
|
components?: CustomComponents;
|
|
8
8
|
imports?: Record<string, unknown>;
|
|
9
|
-
baseUrl?: string;
|
|
10
9
|
terms?: GlossaryTerm[];
|
|
11
10
|
variables?: Variables;
|
|
12
11
|
};
|
|
13
|
-
declare const run: (string: string, _opts?: RunOpts) => Promise<
|
|
14
|
-
default: () => React.JSX.Element;
|
|
15
|
-
toc: import("../types").IndexableElements[];
|
|
16
|
-
Toc: () => React.JSX.Element;
|
|
17
|
-
stylesheet: string;
|
|
18
|
-
}>;
|
|
12
|
+
declare const run: (string: string, _opts?: RunOpts) => Promise<RMDXModule>;
|
|
19
13
|
export default run;
|