@readme/markdown 8.2.0 → 8.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.
Files changed (71) hide show
  1. package/components/Accordion/index.tsx +5 -2
  2. package/components/Anchor.jsx +1 -1
  3. package/components/Callout/index.tsx +5 -4
  4. package/components/Cards/index.tsx +17 -5
  5. package/components/Code/index.tsx +11 -2
  6. package/components/CodeTabs/index.tsx +5 -1
  7. package/components/Columns/index.tsx +7 -6
  8. package/components/Embed/index.tsx +10 -7
  9. package/components/Glossary/index.tsx +8 -4
  10. package/components/HTMLBlock/index.tsx +10 -2
  11. package/components/Heading/index.tsx +6 -2
  12. package/components/Image/index.tsx +15 -13
  13. package/components/Table/index.tsx +2 -2
  14. package/components/Tabs/index.tsx +21 -14
  15. package/components/TailwindRoot/index.tsx +6 -2
  16. package/dist/components/Accordion/index.d.ts +7 -6
  17. package/dist/components/Callout/index.d.ts +2 -2
  18. package/dist/components/Cards/index.d.ts +13 -11
  19. package/dist/components/CodeTabs/index.d.ts +5 -1
  20. package/dist/components/Columns/index.d.ts +6 -7
  21. package/dist/components/Embed/index.d.ts +6 -6
  22. package/dist/components/Glossary/index.d.ts +4 -3
  23. package/dist/components/HTMLBlock/index.d.ts +5 -4
  24. package/dist/components/Heading/index.d.ts +1 -1
  25. package/dist/components/Image/index.d.ts +2 -2
  26. package/dist/components/Table/index.d.ts +2 -2
  27. package/dist/components/Tabs/index.d.ts +5 -6
  28. package/dist/components/TailwindRoot/index.d.ts +5 -4
  29. package/dist/contexts/GlossaryTerms.d.ts +4 -4
  30. package/dist/contexts/index.d.ts +2 -2
  31. package/dist/errors/mdx-syntax-error.d.ts +1 -1
  32. package/dist/example/RenderError.d.ts +5 -4
  33. package/dist/lib/ast-processor.d.ts +5 -5
  34. package/dist/lib/compile.d.ts +3 -4
  35. package/dist/lib/hast.d.ts +1 -1
  36. package/dist/lib/mdast.d.ts +3 -1
  37. package/dist/lib/mdastV6.d.ts +4 -1
  38. package/dist/lib/mdx.d.ts +3 -1
  39. package/dist/lib/plain.d.ts +1 -1
  40. package/dist/lib/run.d.ts +6 -12
  41. package/dist/main.js +24553 -24400
  42. package/dist/main.node.js +22070 -21917
  43. package/dist/main.node.js.map +1 -1
  44. package/dist/processor/compile/callout.d.ts +1 -1
  45. package/dist/processor/compile/code-tabs.d.ts +1 -1
  46. package/dist/processor/compile/compatibility.d.ts +20 -31
  47. package/dist/processor/compile/embed.d.ts +1 -1
  48. package/dist/processor/compile/gemoji.d.ts +1 -1
  49. package/dist/processor/compile/html-block.d.ts +1 -1
  50. package/dist/processor/compile/variable.d.ts +1 -1
  51. package/dist/processor/plugin/toc.d.ts +4 -4
  52. package/dist/processor/transform/callouts.d.ts +2 -1
  53. package/dist/processor/transform/code-tabs.d.ts +1 -1
  54. package/dist/processor/transform/compatability.d.ts +1 -1
  55. package/dist/processor/transform/div.d.ts +1 -1
  56. package/dist/processor/transform/embeds.d.ts +1 -1
  57. package/dist/processor/transform/gemoji+.d.ts +1 -1
  58. package/dist/processor/transform/images.d.ts +1 -1
  59. package/dist/processor/transform/index.d.ts +4 -4
  60. package/dist/processor/transform/inject-components.d.ts +2 -2
  61. package/dist/processor/transform/mdx-to-hast.d.ts +1 -1
  62. package/dist/processor/transform/mermaid.d.ts +1 -1
  63. package/dist/processor/transform/readme-components.d.ts +1 -1
  64. package/dist/processor/transform/readme-to-mdx.d.ts +1 -1
  65. package/dist/processor/transform/tables-to-jsx.d.ts +1 -1
  66. package/dist/processor/transform/tailwind.d.ts +2 -1
  67. package/dist/processor/transform/variables.d.ts +1 -1
  68. package/dist/processor/utils.d.ts +8 -8
  69. package/dist/utils/consts.d.ts +1 -0
  70. package/dist/utils/user.d.ts +2 -2
  71. package/package.json +4 -1
@@ -1,5 +1,5 @@
1
+ import type { RunOpts } from '../lib/run';
1
2
  import React from 'react';
2
- import { RunOpts } from '../lib/run';
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,4 @@
1
- import { VFileMessage } from 'vfile-message';
1
+ import type { VFileMessage } from 'vfile-message';
2
2
  export default class MdxSyntaxError extends SyntaxError {
3
3
  original: VFileMessage;
4
4
  constructor(error: VFileMessage, doc: string);
@@ -1,4 +1,5 @@
1
- import React, { PropsWithChildren } from 'react';
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: any, info: {
19
- componentStack: any;
19
+ static componentDidCatch(error: Error, info: {
20
+ componentStack: string;
20
21
  }): void;
21
- render(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode>;
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
- import rehypeSlug from 'rehype-slug';
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: any) => void) | (({ copyButtons }?: {
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)[];
@@ -1,10 +1,9 @@
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;
6
+ useTailwindRoot?: boolean;
8
7
  };
9
- declare const compile: (text: string, { components, copyButtons, useTailwind, ...opts }?: CompileOpts) => Promise<string>;
8
+ declare const compile: (text: string, { components, copyButtons, useTailwind, useTailwindRoot, ...opts }?: CompileOpts) => Promise<string>;
10
9
  export default compile;
@@ -1,3 +1,3 @@
1
- import { MdastOpts } from './ast-processor';
1
+ import type { MdastOpts } from './ast-processor';
2
2
  declare const hast: (text: string, opts?: MdastOpts) => import("hast").Root;
3
3
  export default hast;
@@ -1,2 +1,4 @@
1
- declare const mdast: any;
1
+ import type { MdastOpts } from './ast-processor';
2
+ import type { Root } from 'mdast';
3
+ declare const mdast: (text: string, opts?: MdastOpts) => Root;
2
4
  export default mdast;
@@ -1,2 +1,5 @@
1
- declare const mdastV6: any;
1
+ import type { Root } from 'mdast';
2
+ declare const mdastV6: (doc: string, { rdmd }: {
3
+ rdmd: any;
4
+ }) => Root;
2
5
  export default mdastV6;
package/dist/lib/mdx.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- export declare const mdx: (tree: any, { hast, ...opts }?: {
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;
@@ -1,4 +1,4 @@
1
- import { Nodes } from 'hast';
1
+ import type { Nodes } from 'hast';
2
2
  interface Options {
3
3
  variables?: Record<string, string>;
4
4
  }
package/dist/lib/run.d.ts CHANGED
@@ -1,19 +1,13 @@
1
- import React from 'react';
2
- import { RunOptions } from '@mdx-js/mdx';
3
- import { GlossaryTerm } from '../contexts/GlossaryTerms';
4
- import { CustomComponents } from '../types';
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;