@readme/markdown 6.87.1 → 6.89.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 (96) hide show
  1. package/README.md +81 -23
  2. package/components/Anchor.jsx +15 -26
  3. package/components/Callout/index.tsx +41 -0
  4. package/components/Callout/style.scss +11 -39
  5. package/components/CardsGrid/index.tsx +18 -0
  6. package/components/CardsGrid/style.scss +12 -0
  7. package/components/Code/index.tsx +75 -0
  8. package/components/Code/style.scss +54 -47
  9. package/components/CodeTabs/index.tsx +38 -0
  10. package/components/CodeTabs/style.scss +22 -30
  11. package/components/Embed/index.tsx +98 -0
  12. package/components/Embed/style.scss +59 -69
  13. package/components/Glossary/index.tsx +37 -0
  14. package/components/{GlossaryItem → Glossary}/style.scss +16 -18
  15. package/components/HTMLBlock/index.tsx +38 -0
  16. package/components/Heading/index.tsx +31 -0
  17. package/components/Heading/style.scss +9 -15
  18. package/components/Image/index.tsx +113 -0
  19. package/components/Image/style.scss +62 -64
  20. package/components/Table/index.tsx +20 -0
  21. package/components/Table/style.scss +17 -23
  22. package/components/TableOfContents/{index.jsx → index.tsx} +3 -8
  23. package/components/{index.js → index.ts} +2 -2
  24. package/dist/components/Callout/index.d.ts +9 -0
  25. package/dist/components/CardsGrid/index.d.ts +7 -0
  26. package/dist/components/Code/index.d.ts +11 -0
  27. package/dist/components/CodeTabs/index.d.ts +3 -0
  28. package/dist/components/Embed/index.d.ts +15 -0
  29. package/dist/components/Glossary/index.d.ts +10 -0
  30. package/dist/components/HTMLBlock/index.d.ts +7 -0
  31. package/dist/components/Heading/index.d.ts +8 -0
  32. package/dist/components/Image/index.d.ts +16 -0
  33. package/dist/components/Table/index.d.ts +7 -0
  34. package/dist/components/TableOfContents/index.d.ts +3 -0
  35. package/dist/components/index.d.ts +12 -0
  36. package/dist/contexts/GlossaryTerms.d.ts +7 -0
  37. package/dist/contexts/index.d.ts +5 -0
  38. package/dist/enums.d.ts +14 -0
  39. package/dist/errors/mdx-syntax-error.d.ts +5 -0
  40. package/dist/example/App.d.ts +4 -0
  41. package/dist/example/Doc.d.ts +3 -0
  42. package/dist/example/Form.d.ts +3 -0
  43. package/dist/example/Header.d.ts +3 -0
  44. package/dist/example/RenderError.d.ts +23 -0
  45. package/dist/example/Root.d.ts +3 -0
  46. package/dist/example/docs.d.ts +2 -0
  47. package/dist/example/index.d.ts +1 -0
  48. package/dist/index.d.ts +9 -0
  49. package/dist/lib/ast-processor.d.ts +12 -0
  50. package/dist/lib/compile.d.ts +8 -0
  51. package/dist/lib/hast.d.ts +3 -0
  52. package/dist/lib/index.d.ts +9 -0
  53. package/dist/lib/mdast.d.ts +2 -0
  54. package/dist/lib/mdx.d.ts +4 -0
  55. package/dist/lib/owlmoji.d.ts +4 -0
  56. package/dist/lib/plain.d.ts +6 -0
  57. package/dist/lib/run.d.ts +24 -0
  58. package/dist/main.css +2 -17
  59. package/dist/main.js +70676 -29848
  60. package/dist/main.node.js +90238 -50277
  61. package/dist/processor/compile/callout.d.ts +3 -0
  62. package/dist/processor/compile/code-tabs.d.ts +3 -0
  63. package/dist/processor/compile/compatibility.d.ts +53 -0
  64. package/dist/processor/compile/embed.d.ts +3 -0
  65. package/dist/processor/compile/gemoji.d.ts +3 -0
  66. package/dist/processor/compile/html-block.d.ts +3 -0
  67. package/dist/processor/compile/image.d.ts +3 -0
  68. package/dist/processor/compile/index.d.ts +2 -0
  69. package/dist/processor/compile/table.d.ts +0 -0
  70. package/dist/processor/compile/variable.d.ts +3 -0
  71. package/dist/processor/plugin/toc.d.ts +9 -0
  72. package/dist/processor/transform/callouts.d.ts +2 -0
  73. package/dist/processor/transform/code-tabs.d.ts +3 -0
  74. package/dist/processor/transform/div.d.ts +3 -0
  75. package/dist/processor/transform/embeds.d.ts +3 -0
  76. package/dist/processor/transform/gemoji+.d.ts +3 -0
  77. package/dist/processor/transform/images.d.ts +3 -0
  78. package/dist/processor/transform/index.d.ts +9 -0
  79. package/dist/processor/transform/inject-components.d.ts +7 -0
  80. package/dist/processor/transform/readme-components.d.ts +7 -0
  81. package/dist/processor/transform/readme-to-mdx.d.ts +3 -0
  82. package/dist/processor/transform/tables-to-jsx.d.ts +3 -0
  83. package/dist/processor/transform/variables.d.ts +5 -0
  84. package/dist/processor/utils.d.ts +77 -0
  85. package/package.json +93 -99
  86. package/styles/components.scss +1 -1
  87. package/components/Callout/index.jsx +0 -42
  88. package/components/Code/index.jsx +0 -103
  89. package/components/CodeTabs/index.jsx +0 -60
  90. package/components/Embed/index.jsx +0 -88
  91. package/components/GlossaryItem/index.jsx +0 -44
  92. package/components/HTMLBlock/index.jsx +0 -68
  93. package/components/Heading/index.jsx +0 -56
  94. package/components/Image/index.jsx +0 -107
  95. package/components/Style.jsx +0 -30
  96. package/components/Table/index.jsx +0 -19
@@ -0,0 +1,3 @@
1
+ import { Callout } from '../../types';
2
+ declare const callout: (node: Callout, _: any, state: any, info: any) => any;
3
+ export default callout;
@@ -0,0 +1,3 @@
1
+ import { CodeTabs } from '../../types';
2
+ declare const codeTabs: (node: CodeTabs, _: any, state: any, info: any) => any;
3
+ export default codeTabs;
@@ -0,0 +1,53 @@
1
+ import { Html, Image } from 'mdast';
2
+ import { NodeTypes } from '../../enums';
3
+ type CompatNodes = {
4
+ type: NodeTypes.glossary;
5
+ data: {
6
+ hProperties: {
7
+ term: string;
8
+ };
9
+ };
10
+ } | {
11
+ type: NodeTypes.glossary;
12
+ data: {
13
+ hName: 'Glossary';
14
+ };
15
+ children: [{
16
+ type: 'text';
17
+ value: string;
18
+ }];
19
+ } | {
20
+ type: NodeTypes.reusableContent;
21
+ tag: string;
22
+ } | {
23
+ type: 'embed';
24
+ data: {
25
+ hProperties: {
26
+ [key: string]: string;
27
+ };
28
+ };
29
+ } | {
30
+ type: 'escape';
31
+ value: string;
32
+ } | {
33
+ type: 'figure';
34
+ children: [Image, {
35
+ type: 'figcaption';
36
+ children: [{
37
+ type: 'text';
38
+ value: string;
39
+ }];
40
+ }];
41
+ } | {
42
+ type: 'i';
43
+ data: {
44
+ hProperties: {
45
+ className: string[];
46
+ };
47
+ };
48
+ } | {
49
+ type: 'yaml';
50
+ value: string;
51
+ } | Html;
52
+ declare const compatibility: (node: CompatNodes) => string;
53
+ export default compatibility;
@@ -0,0 +1,3 @@
1
+ import type { EmbedBlock } from "types";
2
+ declare const embed: (node: EmbedBlock) => string;
3
+ export default embed;
@@ -0,0 +1,3 @@
1
+ import { Gemoji } from '../../types';
2
+ declare const gemoji: (node: Gemoji) => string;
3
+ export default gemoji;
@@ -0,0 +1,3 @@
1
+ import { HTMLBlock } from '../../types';
2
+ declare const htmlBlock: (node: HTMLBlock) => string;
3
+ export default htmlBlock;
@@ -0,0 +1,3 @@
1
+ import type { ImageBlock } from 'types';
2
+ declare const image: (node: ImageBlock) => string;
3
+ export default image;
@@ -0,0 +1,2 @@
1
+ declare function compilers(): void;
2
+ export default compilers;
File without changes
@@ -0,0 +1,3 @@
1
+ import { Variable } from '../../types';
2
+ declare const variable: (node: Variable) => string;
3
+ export default variable;
@@ -0,0 +1,9 @@
1
+ import { Transformer } from 'unified';
2
+ import { Root } from 'hast';
3
+ import { CustomComponents, IndexableElements } from '../../types';
4
+ interface Options {
5
+ components?: Record<string, any>;
6
+ }
7
+ export declare const rehypeToc: ({ components }: Options) => Transformer<Root, Root>;
8
+ export declare const tocToMdx: (toc: IndexableElements[], components: CustomComponents) => string;
9
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const calloutTransformer: () => (tree: any) => void;
2
+ export default calloutTransformer;
@@ -0,0 +1,3 @@
1
+ import { Node } from 'mdast';
2
+ declare const codeTabsTransformer: () => (tree: Node) => Node;
3
+ export default codeTabsTransformer;
@@ -0,0 +1,3 @@
1
+ import { Transform } from 'mdast-util-from-markdown';
2
+ declare const divTransformer: () => Transform;
3
+ export default divTransformer;
@@ -0,0 +1,3 @@
1
+ import { Node } from 'mdast';
2
+ declare const embedTransformer: () => (tree: Node) => void;
3
+ export default embedTransformer;
@@ -0,0 +1,3 @@
1
+ import { Root } from 'mdast';
2
+ declare const gemojiTransformer: () => (tree: Root) => Root;
3
+ export default gemojiTransformer;
@@ -0,0 +1,3 @@
1
+ import { Node } from 'mdast';
2
+ declare const imageTransformer: () => (tree: Node) => Node;
3
+ export default imageTransformer;
@@ -0,0 +1,9 @@
1
+ import divTransformer from './div';
2
+ import injectComponents from './inject-components';
3
+ import readmeComponentsTransformer from './readme-components';
4
+ import readmeToMdx from './readme-to-mdx';
5
+ import variablesTransformer from './variables';
6
+ import tablesToJsx from './tables-to-jsx';
7
+ export { divTransformer, readmeComponentsTransformer, readmeToMdx, injectComponents, variablesTransformer, tablesToJsx, };
8
+ declare const _default: (() => (tree: any) => void)[];
9
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { MdastComponents } from '../../types';
2
+ import { Transform } from 'mdast-util-from-markdown';
3
+ interface Options {
4
+ components?: MdastComponents;
5
+ }
6
+ declare const injectComponents: (opts: Options) => () => Transform;
7
+ export default injectComponents;
@@ -0,0 +1,7 @@
1
+ import { Transform } from 'mdast-util-from-markdown';
2
+ interface Options {
3
+ components: Record<string, string>;
4
+ html?: boolean;
5
+ }
6
+ declare const readmeComponents: (opts: Options) => () => Transform;
7
+ export default readmeComponents;
@@ -0,0 +1,3 @@
1
+ import { Transform } from 'mdast-util-from-markdown';
2
+ declare const readmeToMdx: () => Transform;
3
+ export default readmeToMdx;
@@ -0,0 +1,3 @@
1
+ import { Transform } from 'mdast-util-from-markdown';
2
+ declare const tablesToJsx: () => Transform;
3
+ export default tablesToJsx;
@@ -0,0 +1,5 @@
1
+ import { Transform } from 'mdast-util-from-markdown';
2
+ declare const variables: ({ asMdx }?: {
3
+ asMdx: boolean;
4
+ }) => Transform;
5
+ export default variables;
@@ -0,0 +1,77 @@
1
+ import { Node } from 'mdast';
2
+ import { MdxJsxFlowElement, MdxJsxTextElement } from 'mdast-util-mdx';
3
+ /**
4
+ * Formats the hProperties of a node as a string, so they can be compiled back into JSX/MDX.
5
+ * This currently sets all the values to a string since we process/compile the MDX on the fly
6
+ * through the editor, and it'll throw errors over malformed JSX. TODO: fix this.
7
+ *
8
+ * @template T
9
+ * @param {Node} node
10
+ * @returns {string} formatted hProperties as JSX attributes
11
+ */
12
+ export declare const formatHProps: <T>(node: Node) => string;
13
+ /**
14
+ * Formats an object of props as a string.
15
+ *
16
+ * @param {Object} props
17
+ * @returns {string}
18
+ */
19
+ export declare const formatProps: (props: Object) => string;
20
+ /**
21
+ * Returns the hProperties of a node.
22
+ *
23
+ * @template T
24
+ * @param {Node} node
25
+ * @returns {T} hProperties
26
+ */
27
+ export declare const getHProps: <T>(node: Node) => T;
28
+ /**
29
+ * Returns array of hProperty keys.
30
+ *
31
+ * @template T
32
+ * @param {Node} node
33
+ * @returns {Array} array of hProperty keys
34
+ */
35
+ export declare const getHPropKeys: <T>(node: Node) => any;
36
+ /**
37
+ * Gets the attributes of an MDX element and returns them as an object of hProperties.
38
+ *
39
+ * @template T
40
+ * @param {(MdxJsxFlowElement | MdxJsxTextElement)} jsx
41
+ * @returns {T} object of hProperties
42
+ */
43
+ export declare const getAttrs: <T>(jsx: MdxJsxFlowElement | MdxJsxTextElement) => any;
44
+ /**
45
+ * Gets the children of an MDX element and returns them as an array of Text nodes.
46
+ * Currently only being used by the HTML Block component, which only expects a single text node.
47
+ *
48
+ * @template T
49
+ * @param {(MdxJsxFlowElement | MdxJsxTextElement)} jsx
50
+ * @returns {Array} array of child text nodes
51
+ */
52
+ export declare const getChildren: <T>(jsx: MdxJsxFlowElement | MdxJsxTextElement) => any;
53
+ /**
54
+ * Tests if a node is an MDX element.
55
+ * TODO: Make this more extensible to all types of nodes. isElement(node, 'type' or ['type1', 'type2']), say
56
+ *
57
+ * @param {Node} node
58
+ * @returns {(node is MdxJsxFlowElement | MdxJsxTextElement)}
59
+ */
60
+ export declare const isMDXElement: (node: Node) => node is MdxJsxFlowElement | MdxJsxTextElement;
61
+ /**
62
+ * Takes an HTML string and formats it for display in the editor. Removes leading/trailing newlines
63
+ * and unindents the HTML.
64
+ *
65
+ * @param {string} html
66
+ * @returns {string} formatted HTML
67
+ */
68
+ export declare const formatHTML: (html: string) => string;
69
+ /**
70
+ * Reformat HTML for the markdown/mdx by adding an indentation to each line. This assures that the
71
+ * HTML is indentend properly within the HTMLBlock component when rendered in the markdown/mdx.
72
+ *
73
+ * @param {string} html
74
+ * @param {number} [indent=2]
75
+ * @returns {string} re-formatted HTML
76
+ */
77
+ export declare const reformatHTML: (html: string, indent?: number) => string;
package/package.json CHANGED
@@ -2,8 +2,9 @@
2
2
  "name": "@readme/markdown",
3
3
  "description": "ReadMe's React-based Markdown parser",
4
4
  "author": "Rafe Goldberg <rafe@readme.io>",
5
- "version": "6.87.1",
5
+ "version": "6.89.0",
6
6
  "main": "dist/main.node.js",
7
+ "types": "dist/index.d.ts",
7
8
  "browser": "dist/main.js",
8
9
  "files": [
9
10
  "styles",
@@ -11,104 +12,122 @@
11
12
  "dist"
12
13
  ],
13
14
  "scripts": {
14
- "build": "webpack --mode production",
15
- "heroku-postbuild": "webpack --mode production --config ./webpack.dev.js",
16
- "lint": "npm run lint:js && npm run lint:css",
17
- "lint:css": "stylelint '{components,styles}/**/*.{css,scss}'",
18
- "lint:js": "eslint --ext ts,tsx,js,jsx .",
19
- "prepare": "husky install",
20
- "pretest": "npm run lint",
21
- "prettier": "prettier --list-different --write \"./**/**.{js,jsx}\"",
15
+ "build": "webpack --mode production && npm run build-types",
16
+ "build-types": "npx tsc --declaration --emitDeclarationOnly --declarationDir ./dist --skipLibCheck",
17
+ "lint": "eslint . --ext .jsx --ext .js --ext .ts --ext .tsx",
22
18
  "release": "npx semantic-release",
23
19
  "release.dry": "npx semantic-release --dry-run",
24
- "start": "webpack serve --config ./webpack.dev.js --open --mode development",
25
- "test": "jest --coverage --runInBand --testPathIgnorePatterns '__tests__/browser'",
26
- "test.watch": "jest --watch --coverage=false --testPathIgnorePatterns '__tests__/browser'",
27
- "test.browser": "jest --config jest.browser.js --runInBand --testPathPattern '__tests__/browser'",
28
- "watch": "webpack -w --progress --mode production"
20
+ "start": "webpack serve --open --mode development --config ./webpack.dev.js",
21
+ "test": "vitest",
22
+ "test.ui": "vitest --ui",
23
+ "test.browser": "jest",
24
+ "watch": "webpack --watch --progress --mode development"
29
25
  },
30
26
  "dependencies": {
31
- "@readme/syntax-highlighter": "^13.0.0",
32
- "copy-to-clipboard": "^3.3.3",
33
- "emoji-regex": "^10.3.0",
27
+ "@mdx-js/mdx": "^3.0.0",
28
+ "@readme/emojis": "^5.1.0",
29
+ "@readme/syntax-highlighter": "^13.1.0",
30
+ "copy-to-clipboard": "^3.3.2",
31
+ "core-js": "^3.36.1",
32
+ "debug": "^4.3.4",
33
+ "emoji-regex": "^10.2.1",
34
+ "estree-util-value-to-estree": "^3.1.1",
34
35
  "gemoji": "^8.1.0",
36
+ "hast-util-from-html": "^2.0.1",
35
37
  "hast-util-sanitize": "^4.0.0",
38
+ "hast-util-to-xast": "^3.0.0",
39
+ "hastscript": "^9.0.0",
36
40
  "lodash.escape": "^4.0.1",
37
41
  "lodash.kebabcase": "^4.1.1",
38
- "mdast-util-toc": "^5.1.0",
39
- "parse-entities": "^4.0.1",
42
+ "mdast-util-find-and-replace": "^3.0.1",
43
+ "mdast-util-phrasing": "^4.1.0",
40
44
  "path-browserify": "^1.0.1",
41
45
  "process": "^0.11.10",
42
46
  "prop-types": "^15.8.1",
43
- "rehype-raw": "^5.1.0",
44
- "rehype-react": "^6.2.1",
45
- "rehype-sanitize": "^4.0.0",
46
- "rehype-stringify": "^6.0.0",
47
- "remark-breaks": "^1.0.0",
48
- "remark-disable-tokenizers": "^1.0.24",
49
- "remark-frontmatter": "^2.0.0",
50
- "remark-parse": "^8.0.0",
51
- "remark-rehype": "^8.1.0",
52
- "remark-slug": "^6.0.0",
53
- "remark-stringify": "^8.0.0",
54
- "unified": "^9.2.2",
47
+ "rehype-remark": "^10.0.0",
48
+ "rehype-slug": "^6.0.0",
49
+ "remark": "^15.0.1",
50
+ "remark-frontmatter": "^5.0.0",
51
+ "remark-gfm": "^4.0.0",
52
+ "remark-mdx": "^3.0.0",
53
+ "remark-parse": "^11.0.0",
54
+ "trim": "^1.0.1",
55
+ "unified": "^11.0.4",
55
56
  "unist-util-flatmap": "^1.0.0",
56
- "unist-util-map": "^3.1.2",
57
- "unist-util-select": "^4.0.0",
58
- "unist-util-visit": "^4.1.1"
57
+ "unist-util-visit": "^5.0.0",
58
+ "util": "^0.12.5",
59
+ "xast-util-to-xml": "^4.0.0"
59
60
  },
60
61
  "peerDependencies": {
61
- "@readme/variable": "^16.0.0",
62
+ "@mdx-js/react": "^3.0.0",
63
+ "@readme/variable": "^16.1.0",
62
64
  "@tippyjs/react": "^4.1.0",
63
65
  "react": "16.x || 17.x || 18.x",
64
66
  "react-dom": "16.x || 17.x || 18.x"
65
67
  },
66
68
  "devDependencies": {
67
- "@babel/core": "^7.24.0",
68
- "@babel/eslint-parser": "^7.23.10",
69
+ "@babel/core": "^7.21.4",
70
+ "@babel/eslint-parser": "^7.21.3",
69
71
  "@babel/plugin-proposal-class-properties": "^7.18.6",
70
- "@babel/plugin-proposal-object-rest-spread": "^7.19.4",
71
- "@babel/plugin-proposal-optional-chaining": "^7.18.9",
72
- "@babel/plugin-transform-runtime": "^7.24.0",
73
- "@babel/preset-env": "^7.24.0",
74
- "@babel/preset-react": "^7.23.3",
75
- "@commitlint/cli": "^19.0.3",
76
- "@commitlint/config-conventional": "^19.0.3",
77
- "@readme/eslint-config": "^13.5.0",
78
- "@readme/stylelint-config": "^6.1.0",
72
+ "@babel/plugin-proposal-export-default-from": "^7.23.3",
73
+ "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
74
+ "@babel/plugin-proposal-optional-chaining": "^7.21.0",
75
+ "@babel/plugin-proposal-private-methods": "^7.18.6",
76
+ "@babel/plugin-transform-runtime": "^7.21.4",
77
+ "@babel/preset-env": "^7.21.4",
78
+ "@babel/preset-react": "^7.18.6",
79
+ "@babel/preset-typescript": "^7.21.4",
80
+ "@commitlint/cli": "^17.5.1",
81
+ "@commitlint/config-angular": "^17.4.4",
82
+ "@commitlint/config-conventional": "^17.4.4",
83
+ "@readme/eslint-config": "^14.0.0",
84
+ "@readme/markdown-legacy": "npm:@readme/markdown@^6.84.0",
79
85
  "@semantic-release/changelog": "^6.0.3",
80
86
  "@semantic-release/git": "^10.0.1",
81
87
  "@testing-library/jest-dom": "^6.4.2",
82
- "@testing-library/react": "^14.0.0",
83
- "babel-jest": "^29.7.0",
84
- "babel-loader": "^9.1.3",
88
+ "@testing-library/react": "^14",
89
+ "@testing-library/user-event": "^14.5.2",
90
+ "@types/hast": "^3.0.4",
91
+ "@types/jest": "^29.5.12",
92
+ "@types/mdast": "^4.0.3",
93
+ "@types/mdx": "^2.0.12",
94
+ "@types/unist": "^3.0.2",
95
+ "@vitejs/plugin-react": "^4.2.1",
96
+ "@vitest/coverage-v8": "^1.6.0",
97
+ "@vitest/ui": "^1.6.0",
98
+ "babel-jest": "^29.5.0",
99
+ "babel-loader": "^9.1.2",
100
+ "browserify-fs": "^1.0.0",
85
101
  "codemirror": "^5.54.0",
86
- "core-js": "^3.36.0",
87
- "css-loader": "^6.10.0",
88
- "eslint": "^8.57.0",
89
- "husky": "^9.0.11",
102
+ "css-loader": "^6.7.3",
103
+ "eslint": "^8.37.0",
104
+ "hast-util-to-text": "^4.0.2",
90
105
  "identity-obj-proxy": "^3.0.0",
91
- "jest": "^28.1.3",
92
- "jest-environment-jsdom": "^29.7.0",
93
- "jest-environment-puppeteer": "^10.0.1",
106
+ "jest": "^29.5.0",
107
+ "jest-environment-jsdom": "^29.5.0",
108
+ "jest-environment-puppeteer": "^8.0.6",
94
109
  "jest-image-snapshot": "^6.4.0",
95
- "jest-puppeteer": "^10.0.1",
96
- "mini-css-extract-plugin": "^2.8.1",
97
- "node-sass": "^9.0.0",
98
- "postcss": "^8.4.35",
110
+ "jest-puppeteer": "^8.0.6",
111
+ "mini-css-extract-plugin": "^2.7.5",
112
+ "node-sass": "^8.0.0",
99
113
  "prettier": "^3.2.5",
100
- "prettier-2": "npm:prettier@^2.8.8",
101
- "puppeteer": "^22.4.0",
102
- "regenerator-runtime": "^0.14.1",
103
- "sass-loader": "^14.1.1",
104
- "semantic-release": "^23.0.2",
105
- "string.prototype.trimend": "^1.0.7",
106
- "stylelint": "^16.2.1",
107
- "terser-webpack-plugin": "^5.3.10",
108
- "webpack": "^5.90.3",
109
- "webpack-cli": "^5.1.4",
110
- "webpack-dev-server": "^5.0.2",
111
- "webpack-merge": "^5.10.0"
114
+ "puppeteer": "^19.8.3",
115
+ "react-router-dom": "^6.22.3",
116
+ "remark-slug": "^7.0.1",
117
+ "sass": "^1.77.3",
118
+ "sass-loader": "^13.2.2",
119
+ "semantic-release": "^22.0.12",
120
+ "stream-browserify": "^3.0.0",
121
+ "string.prototype.trimend": "^1.0.6",
122
+ "terser-webpack-plugin": "^5.3.7",
123
+ "ts-loader": "^9.4.2",
124
+ "typescript": "^5.4.5",
125
+ "unist-util-map": "^4.0.0",
126
+ "vitest": "^1.4.0",
127
+ "webpack": "^5.56.0",
128
+ "webpack-cli": "^5.0.1",
129
+ "webpack-dev-server": "^4.13.2",
130
+ "webpack-merge": "^5.8.0"
112
131
  },
113
132
  "license": "MIT",
114
133
  "homepage": "https://rdmd.readme.io",
@@ -118,37 +137,12 @@
118
137
  "files": [
119
138
  {
120
139
  "path": "dist/main.js",
121
- "maxSize": "450KB"
140
+ "maxSize": "1MB"
122
141
  },
123
142
  {
124
143
  "path": "dist/main.node.js",
125
- "maxSize": "300KB"
144
+ "maxSize": "750KB"
126
145
  }
127
146
  ]
128
- },
129
- "commitlint": {
130
- "extends": [
131
- "@commitlint/config-conventional"
132
- ],
133
- "rules": {
134
- "body-max-line-length": [
135
- 0,
136
- "always",
137
- "Infinity"
138
- ],
139
- "footer-max-line-length": [
140
- 0,
141
- "always",
142
- "Infinity"
143
- ],
144
- "scope-case": [
145
- 2,
146
- "never",
147
- "upper-case"
148
- ]
149
- }
150
- },
151
- "overrides": {
152
- "trim": "^1"
153
147
  }
154
148
  }
@@ -6,4 +6,4 @@
6
6
  @import '../components/Callout/style';
7
7
  @import '../components/Heading/style';
8
8
  @import '../components/Embed/style';
9
- @import '../components/GlossaryItem/style';
9
+ @import '../components/Glossary/style';
@@ -1,42 +0,0 @@
1
- const PropTypes = require('prop-types');
2
- const React = require('react');
3
-
4
- const Callout = props => {
5
- const { attributes, theme, icon } = props;
6
- const [title, ...content] = !props.title ? [null, props.children] : props.children;
7
-
8
- return (
9
- // eslint-disable-next-line react/jsx-props-no-spreading, react/no-unknown-property
10
- <blockquote {...attributes} className={`callout callout_${theme}`} theme={icon}>
11
- <h2 className={`callout-heading${title ? '' : ' empty'}`}>
12
- <span className="callout-icon">{icon}</span>
13
- {title}
14
- </h2>
15
- {content}
16
- </blockquote>
17
- );
18
- };
19
-
20
- Callout.propTypes = {
21
- attributes: PropTypes.shape({}),
22
- calloutStyle: PropTypes.string,
23
- children: PropTypes.arrayOf(PropTypes.any).isRequired,
24
- icon: PropTypes.string,
25
- node: PropTypes.shape(),
26
- theme: PropTypes.string,
27
- title: PropTypes.string,
28
- };
29
-
30
- Callout.defaultProps = {
31
- attributes: null,
32
- calloutStyle: 'info',
33
- node: null,
34
- };
35
-
36
- Callout.sanitize = sanitizeSchema => {
37
- sanitizeSchema.attributes['rdme-callout'] = ['icon', 'theme', 'title'];
38
-
39
- return sanitizeSchema;
40
- };
41
-
42
- module.exports = Callout;