@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.
- package/README.md +81 -23
- package/components/Anchor.jsx +15 -26
- package/components/Callout/index.tsx +41 -0
- package/components/Callout/style.scss +11 -39
- package/components/CardsGrid/index.tsx +18 -0
- package/components/CardsGrid/style.scss +12 -0
- package/components/Code/index.tsx +75 -0
- package/components/Code/style.scss +54 -47
- package/components/CodeTabs/index.tsx +38 -0
- package/components/CodeTabs/style.scss +22 -30
- package/components/Embed/index.tsx +98 -0
- package/components/Embed/style.scss +59 -69
- package/components/Glossary/index.tsx +37 -0
- package/components/{GlossaryItem → Glossary}/style.scss +16 -18
- package/components/HTMLBlock/index.tsx +38 -0
- package/components/Heading/index.tsx +31 -0
- package/components/Heading/style.scss +9 -15
- package/components/Image/index.tsx +113 -0
- package/components/Image/style.scss +62 -64
- package/components/Table/index.tsx +20 -0
- package/components/Table/style.scss +17 -23
- package/components/TableOfContents/{index.jsx → index.tsx} +3 -8
- package/components/{index.js → index.ts} +2 -2
- package/dist/components/Callout/index.d.ts +9 -0
- package/dist/components/CardsGrid/index.d.ts +7 -0
- package/dist/components/Code/index.d.ts +11 -0
- package/dist/components/CodeTabs/index.d.ts +3 -0
- package/dist/components/Embed/index.d.ts +15 -0
- package/dist/components/Glossary/index.d.ts +10 -0
- package/dist/components/HTMLBlock/index.d.ts +7 -0
- package/dist/components/Heading/index.d.ts +8 -0
- package/dist/components/Image/index.d.ts +16 -0
- package/dist/components/Table/index.d.ts +7 -0
- package/dist/components/TableOfContents/index.d.ts +3 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/contexts/GlossaryTerms.d.ts +7 -0
- package/dist/contexts/index.d.ts +5 -0
- package/dist/enums.d.ts +14 -0
- package/dist/errors/mdx-syntax-error.d.ts +5 -0
- package/dist/example/App.d.ts +4 -0
- package/dist/example/Doc.d.ts +3 -0
- package/dist/example/Form.d.ts +3 -0
- package/dist/example/Header.d.ts +3 -0
- package/dist/example/RenderError.d.ts +23 -0
- package/dist/example/Root.d.ts +3 -0
- package/dist/example/docs.d.ts +2 -0
- package/dist/example/index.d.ts +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/lib/ast-processor.d.ts +12 -0
- package/dist/lib/compile.d.ts +8 -0
- package/dist/lib/hast.d.ts +3 -0
- package/dist/lib/index.d.ts +9 -0
- package/dist/lib/mdast.d.ts +2 -0
- package/dist/lib/mdx.d.ts +4 -0
- package/dist/lib/owlmoji.d.ts +4 -0
- package/dist/lib/plain.d.ts +6 -0
- package/dist/lib/run.d.ts +24 -0
- package/dist/main.css +2 -17
- package/dist/main.js +70676 -29848
- package/dist/main.node.js +90238 -50277
- package/dist/processor/compile/callout.d.ts +3 -0
- package/dist/processor/compile/code-tabs.d.ts +3 -0
- package/dist/processor/compile/compatibility.d.ts +53 -0
- package/dist/processor/compile/embed.d.ts +3 -0
- package/dist/processor/compile/gemoji.d.ts +3 -0
- package/dist/processor/compile/html-block.d.ts +3 -0
- package/dist/processor/compile/image.d.ts +3 -0
- package/dist/processor/compile/index.d.ts +2 -0
- package/dist/processor/compile/table.d.ts +0 -0
- package/dist/processor/compile/variable.d.ts +3 -0
- package/dist/processor/plugin/toc.d.ts +9 -0
- package/dist/processor/transform/callouts.d.ts +2 -0
- package/dist/processor/transform/code-tabs.d.ts +3 -0
- package/dist/processor/transform/div.d.ts +3 -0
- package/dist/processor/transform/embeds.d.ts +3 -0
- package/dist/processor/transform/gemoji+.d.ts +3 -0
- package/dist/processor/transform/images.d.ts +3 -0
- package/dist/processor/transform/index.d.ts +9 -0
- package/dist/processor/transform/inject-components.d.ts +7 -0
- package/dist/processor/transform/readme-components.d.ts +7 -0
- package/dist/processor/transform/readme-to-mdx.d.ts +3 -0
- package/dist/processor/transform/tables-to-jsx.d.ts +3 -0
- package/dist/processor/transform/variables.d.ts +5 -0
- package/dist/processor/utils.d.ts +77 -0
- package/package.json +93 -99
- package/styles/components.scss +1 -1
- package/components/Callout/index.jsx +0 -42
- package/components/Code/index.jsx +0 -103
- package/components/CodeTabs/index.jsx +0 -60
- package/components/Embed/index.jsx +0 -88
- package/components/GlossaryItem/index.jsx +0 -44
- package/components/HTMLBlock/index.jsx +0 -68
- package/components/Heading/index.jsx +0 -56
- package/components/Image/index.jsx +0 -107
- package/components/Style.jsx +0 -30
- package/components/Table/index.jsx +0 -19
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ImageProps {
|
|
4
|
+
align?: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
border?: boolean;
|
|
7
|
+
caption?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
height?: string;
|
|
10
|
+
src: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
width?: string;
|
|
13
|
+
lazy?: boolean;
|
|
14
|
+
children?: [React.ReactElement];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const Image = (Props: ImageProps) => {
|
|
18
|
+
const {
|
|
19
|
+
align = 'center',
|
|
20
|
+
alt = '',
|
|
21
|
+
border = false,
|
|
22
|
+
caption,
|
|
23
|
+
className = '',
|
|
24
|
+
height = 'auto',
|
|
25
|
+
src,
|
|
26
|
+
title = '',
|
|
27
|
+
width = 'auto',
|
|
28
|
+
lazy = true,
|
|
29
|
+
children,
|
|
30
|
+
} = Props;
|
|
31
|
+
|
|
32
|
+
const [lightbox, setLightbox] = React.useState(false);
|
|
33
|
+
|
|
34
|
+
if (className === 'emoji') {
|
|
35
|
+
return <img src={src} width={width} height={height} title={title} alt={alt} loading={lazy ? 'lazy' : 'eager'} />;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const handleKeyDown = ({ key, metaKey: cmd }: React.KeyboardEvent<HTMLImageElement>) => {
|
|
39
|
+
const cmdKey = cmd ? 'cmd+' : '';
|
|
40
|
+
key = `${cmdKey}${key.toLowerCase()}`;
|
|
41
|
+
|
|
42
|
+
switch (key) {
|
|
43
|
+
case 'cmd+.':
|
|
44
|
+
case 'escape':
|
|
45
|
+
// CLOSE
|
|
46
|
+
setLightbox(false);
|
|
47
|
+
break;
|
|
48
|
+
case ' ':
|
|
49
|
+
case 'enter':
|
|
50
|
+
// OPEN
|
|
51
|
+
if (!lightbox) setLightbox(true);
|
|
52
|
+
default:
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const toggle = () => {
|
|
57
|
+
if (className === 'emoji') return;
|
|
58
|
+
setLightbox(!lightbox);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
if (caption) {
|
|
62
|
+
return (
|
|
63
|
+
<figure>
|
|
64
|
+
<span
|
|
65
|
+
aria-label={alt}
|
|
66
|
+
className={`img lightbox ${lightbox ? 'open' : 'closed'}`}
|
|
67
|
+
onClick={toggle}
|
|
68
|
+
onKeyDown={handleKeyDown}
|
|
69
|
+
role={'button'}
|
|
70
|
+
tabIndex={0}
|
|
71
|
+
>
|
|
72
|
+
<span className="lightbox-inner">
|
|
73
|
+
<img
|
|
74
|
+
src={src}
|
|
75
|
+
width={width}
|
|
76
|
+
height={height}
|
|
77
|
+
title={title}
|
|
78
|
+
className={`img img-align-center${border ? ' border' : ''}`}
|
|
79
|
+
alt={alt}
|
|
80
|
+
loading={lazy ? 'lazy' : 'eager'}
|
|
81
|
+
/>
|
|
82
|
+
<figcaption>{children || caption}</figcaption>
|
|
83
|
+
</span>
|
|
84
|
+
</span>
|
|
85
|
+
</figure>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<span
|
|
91
|
+
aria-label={alt}
|
|
92
|
+
className={`img lightbox ${lightbox ? 'open' : 'closed'}`}
|
|
93
|
+
onClick={toggle}
|
|
94
|
+
onKeyDown={handleKeyDown}
|
|
95
|
+
role={'button'}
|
|
96
|
+
tabIndex={0}
|
|
97
|
+
>
|
|
98
|
+
<span className="lightbox-inner">
|
|
99
|
+
<img
|
|
100
|
+
src={src}
|
|
101
|
+
width={width}
|
|
102
|
+
height={height}
|
|
103
|
+
title={title}
|
|
104
|
+
className={`img img-align-${align}${border ? ' border' : ''}`}
|
|
105
|
+
alt={alt}
|
|
106
|
+
loading={lazy ? 'lazy' : 'eager'}
|
|
107
|
+
/>
|
|
108
|
+
</span>
|
|
109
|
+
</span>
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export default Image;
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
/* stylelint-disable selector-max-compound-selectors */
|
|
2
|
-
/* stylelint-disable no-descending-specificity */
|
|
3
|
-
/* stylelint-disable font-family-no-missing-generic-family-keyword */
|
|
4
1
|
%img-align {
|
|
5
2
|
&-right {
|
|
6
3
|
float: right;
|
|
7
4
|
margin-left: 0.75rem;
|
|
8
5
|
}
|
|
9
|
-
|
|
10
6
|
&-left {
|
|
11
7
|
float: left;
|
|
12
8
|
margin-right: 0.75rem;
|
|
13
9
|
}
|
|
14
|
-
|
|
15
10
|
&-center {
|
|
16
11
|
display: block;
|
|
17
12
|
}
|
|
@@ -19,36 +14,36 @@
|
|
|
19
14
|
|
|
20
15
|
.markdown-body {
|
|
21
16
|
img {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
& {
|
|
18
|
+
box-sizing: content-box;
|
|
19
|
+
display: inline-block;
|
|
20
|
+
vertical-align: middle;
|
|
21
|
+
max-width: 100%;
|
|
22
|
+
margin-left: auto;
|
|
23
|
+
margin-right: auto;
|
|
24
|
+
border-style: none;
|
|
25
|
+
|
|
26
|
+
outline: none !important;
|
|
27
|
+
}
|
|
30
28
|
|
|
31
29
|
&[align='right'],
|
|
32
30
|
&[alt~='align-right'] {
|
|
33
31
|
@extend %img-align-right;
|
|
34
32
|
}
|
|
35
|
-
|
|
36
33
|
&[align='left'],
|
|
37
34
|
&[alt~='align-left'] {
|
|
38
35
|
@extend %img-align-left;
|
|
39
36
|
}
|
|
40
|
-
|
|
41
37
|
&[width='80%'],
|
|
42
|
-
&[align='center'],
|
|
43
38
|
&[align='middle'],
|
|
44
39
|
&[alt~='align-center'] {
|
|
45
40
|
@extend %img-align-center;
|
|
46
41
|
}
|
|
47
42
|
|
|
48
43
|
&[width='smart'] {
|
|
49
|
-
max-height: 450px;
|
|
50
|
-
max-width: 100%;
|
|
51
44
|
width: auto;
|
|
45
|
+
max-width: 100%;
|
|
46
|
+
max-height: 450px;
|
|
52
47
|
}
|
|
53
48
|
|
|
54
49
|
&.border {
|
|
@@ -57,12 +52,13 @@
|
|
|
57
52
|
}
|
|
58
53
|
|
|
59
54
|
figure {
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
& {
|
|
56
|
+
margin: 15px auto;
|
|
57
|
+
}
|
|
62
58
|
figcaption {
|
|
59
|
+
margin-top: 8px;
|
|
63
60
|
font-size: 0.93em;
|
|
64
61
|
font-style: italic;
|
|
65
|
-
margin-top: 8px;
|
|
66
62
|
text-align: center;
|
|
67
63
|
}
|
|
68
64
|
}
|
|
@@ -73,81 +69,83 @@
|
|
|
73
69
|
}
|
|
74
70
|
|
|
75
71
|
figure .img {
|
|
76
|
-
display: block;
|
|
72
|
+
display: inline-block;
|
|
73
|
+
&,
|
|
74
|
+
> img:only-of-type {
|
|
75
|
+
display: block;
|
|
76
|
+
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
.lightbox.open {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
80
|
+
& {
|
|
81
|
+
position: fixed;
|
|
82
|
+
z-index: 9999999;
|
|
83
|
+
top: 0;
|
|
84
|
+
left: 0;
|
|
85
|
+
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-flow: nowrap column;
|
|
88
|
+
justify-content: flex-start;
|
|
89
|
+
align-items: center;
|
|
90
|
+
|
|
91
|
+
width: 100vw;
|
|
92
|
+
height: 100vh;
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
overflow-y: scroll;
|
|
95
|
+
background: rgba(white, 0.966);
|
|
96
|
+
user-select: none;
|
|
97
|
+
|
|
98
|
+
margin-top: 0;
|
|
99
|
+
margin-bottom: 0;
|
|
100
|
+
}
|
|
96
101
|
|
|
97
102
|
// Close Button
|
|
98
|
-
|
|
103
|
+
//
|
|
104
|
+
&:after {
|
|
105
|
+
position: fixed;
|
|
106
|
+
top: 1em;
|
|
107
|
+
right: 1em;
|
|
99
108
|
content: '\f00d';
|
|
100
|
-
cursor: pointer;
|
|
101
109
|
display: inline-block;
|
|
102
110
|
font: normal normal normal 2em/1 FontAwesome;
|
|
103
111
|
font-size: inherit;
|
|
112
|
+
text-rendering: auto;
|
|
104
113
|
-webkit-font-smoothing: antialiased;
|
|
105
114
|
-moz-osx-font-smoothing: grayscale;
|
|
106
|
-
opacity: 1;
|
|
107
|
-
position: fixed;
|
|
108
|
-
right: 1em;
|
|
109
|
-
text-rendering: auto;
|
|
110
|
-
top: 1em;
|
|
111
115
|
transform: translate(0, 0);
|
|
116
|
+
display: inline-block;
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
|
|
119
|
+
opacity: 1;
|
|
112
120
|
transform: scale(1.5);
|
|
113
121
|
transition: 0.3s 0.3s ease-in;
|
|
114
122
|
}
|
|
115
|
-
|
|
116
|
-
&:not(.open)::after {
|
|
117
|
-
opacity: 0;
|
|
123
|
+
&:not(.open):after {
|
|
118
124
|
transform: scale(0);
|
|
125
|
+
opacity: 0;
|
|
119
126
|
}
|
|
120
127
|
|
|
121
128
|
.lightbox-inner {
|
|
122
|
-
|
|
123
|
-
box-sizing: content-box;
|
|
129
|
+
position: relative;
|
|
124
130
|
display: inline-flex;
|
|
125
131
|
justify-content: center;
|
|
126
|
-
|
|
132
|
+
align-items: center;
|
|
127
133
|
min-height: calc(100vh + 8px);
|
|
134
|
+
margin: auto;
|
|
128
135
|
padding: 0;
|
|
129
|
-
|
|
136
|
+
box-sizing: content-box;
|
|
130
137
|
}
|
|
131
138
|
|
|
132
139
|
img {
|
|
140
|
+
width: auto !important;
|
|
133
141
|
height: auto !important;
|
|
134
|
-
max-height: 97.5vh !important;
|
|
135
|
-
max-width: 97.5vw !important;
|
|
136
142
|
min-width: unset !important;
|
|
137
|
-
width:
|
|
138
|
-
|
|
143
|
+
max-width: 97.5vw !important;
|
|
144
|
+
max-height: 97.5vh !important;
|
|
139
145
|
&.border,
|
|
140
146
|
&:not([src$='.png']):not([src$='.svg']):not([src$='.jp2']):not([src$='.tiff']) {
|
|
141
147
|
box-shadow: 0 0.5em 3em -1em rgba(0, 0, 0, 0.2);
|
|
142
148
|
}
|
|
143
|
-
|
|
144
|
-
&[src$='svg'] {
|
|
145
|
-
display: block !important;
|
|
146
|
-
height: 66vw !important;
|
|
147
|
-
max-width: 100% !important;
|
|
148
|
-
min-width: 200px !important;
|
|
149
|
-
width: 42vw !important;
|
|
150
|
-
}
|
|
151
149
|
}
|
|
152
150
|
}
|
|
153
151
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface Props extends JSX.IntrinsicAttributes {
|
|
4
|
+
align: ('left' | 'center' | 'right')[];
|
|
5
|
+
children: [React.ReactElement<HTMLTableCaptionElement | HTMLTableSectionElement | HTMLTableRowElement>];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const Table = (props: Props) => {
|
|
9
|
+
const { children } = props;
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div className="rdmd-table">
|
|
13
|
+
<div className="rdmd-table-inner">
|
|
14
|
+
<table>{children}</table>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default Table;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
@mixin markdown-table(
|
|
2
|
+
$row: #fff,
|
|
3
|
+
$head: #f6f8fa,
|
|
4
|
+
$stripe: #fbfcfd,
|
|
5
|
+
$edges: #dfe2e5,
|
|
6
|
+
) {
|
|
6
7
|
table {
|
|
8
|
+
display: table;
|
|
7
9
|
border-collapse: collapse;
|
|
8
10
|
border-spacing: 0;
|
|
9
|
-
color: var(--table-text);
|
|
10
|
-
display: table;
|
|
11
11
|
width: 100%;
|
|
12
|
+
color: var(--table-text);
|
|
12
13
|
|
|
13
14
|
thead {
|
|
14
15
|
color: var(--table-head-text, inherit);
|
|
@@ -20,7 +21,6 @@
|
|
|
20
21
|
|
|
21
22
|
tr {
|
|
22
23
|
background-color: var(--table-row, #{$row});
|
|
23
|
-
|
|
24
24
|
& + tr {
|
|
25
25
|
border-top: 1px solid var(--table-edges, #{$edges});
|
|
26
26
|
}
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
th,
|
|
30
30
|
thead td {
|
|
31
31
|
font-weight: 600;
|
|
32
|
-
|
|
33
32
|
&:empty {
|
|
34
33
|
padding: 0;
|
|
35
34
|
}
|
|
@@ -37,20 +36,13 @@
|
|
|
37
36
|
|
|
38
37
|
td,
|
|
39
38
|
th {
|
|
40
|
-
|
|
39
|
+
padding: 0;
|
|
41
40
|
color: inherit;
|
|
42
|
-
padding: 6px 13px;
|
|
43
41
|
vertical-align: middle;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
> :only-child {
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
> :last-child,
|
|
51
|
-
> :only-child {
|
|
52
|
-
margin-bottom: 0 !important;
|
|
53
|
-
}
|
|
42
|
+
border: 1px solid var(--table-edges, #{$edges});
|
|
43
|
+
padding: 6px 13px;
|
|
44
|
+
> :first-child, > :only-child { margin-top: 0 !important }
|
|
45
|
+
> :last-child, > :only-child { margin-bottom: 0 !important }
|
|
54
46
|
}
|
|
55
47
|
|
|
56
48
|
&:not(.plain) tr:nth-child(2n) {
|
|
@@ -65,8 +57,10 @@
|
|
|
65
57
|
.rdmd-table {
|
|
66
58
|
$border-wrap-width: 1px;
|
|
67
59
|
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
& {
|
|
61
|
+
display: block;
|
|
62
|
+
position: relative;
|
|
63
|
+
}
|
|
70
64
|
|
|
71
65
|
&-inner {
|
|
72
66
|
box-sizing: content-box;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
const React = require('react');
|
|
1
|
+
import React from 'react';
|
|
3
2
|
|
|
4
|
-
function TableOfContents({ children }) {
|
|
3
|
+
function TableOfContents({ children }: React.PropsWithChildren) {
|
|
5
4
|
return (
|
|
6
5
|
<nav>
|
|
7
6
|
<ul className="toc-list">
|
|
@@ -18,8 +17,4 @@ function TableOfContents({ children }) {
|
|
|
18
17
|
);
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
children: PropTypes.element,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
module.exports = TableOfContents;
|
|
20
|
+
export default TableOfContents;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { default as Anchor } from './Anchor';
|
|
2
2
|
export { default as Callout } from './Callout';
|
|
3
|
+
export { default as Cards } from './CardsGrid';
|
|
3
4
|
export { default as Code } from './Code';
|
|
4
5
|
export { default as CodeTabs } from './CodeTabs';
|
|
5
6
|
export { default as Embed } from './Embed';
|
|
6
|
-
export { default as
|
|
7
|
+
export { default as Glossary } from './Glossary';
|
|
7
8
|
export { default as HTMLBlock } from './HTMLBlock';
|
|
8
9
|
export { default as Heading } from './Heading';
|
|
9
10
|
export { default as Image } from './Image';
|
|
10
|
-
export { default as Style } from './Style';
|
|
11
11
|
export { default as Table } from './Table';
|
|
12
12
|
export { default as TableOfContents } from './TableOfContents';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface Props extends React.PropsWithChildren<React.HTMLAttributes<HTMLQuoteElement>> {
|
|
3
|
+
attributes?: {};
|
|
4
|
+
icon: string;
|
|
5
|
+
theme?: string;
|
|
6
|
+
empty?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const Callout: (props: Props) => React.JSX.Element;
|
|
9
|
+
export default Callout;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface CodeProps {
|
|
3
|
+
children?: string[] | string;
|
|
4
|
+
copyButtons?: boolean;
|
|
5
|
+
lang?: string;
|
|
6
|
+
meta?: string;
|
|
7
|
+
theme?: string;
|
|
8
|
+
value?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const Code: (props: CodeProps) => React.JSX.Element;
|
|
11
|
+
export default Code;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface EmbedProps {
|
|
3
|
+
lazy?: boolean;
|
|
4
|
+
url: string;
|
|
5
|
+
title: string;
|
|
6
|
+
providerName?: string;
|
|
7
|
+
providerUrl?: string;
|
|
8
|
+
html?: string;
|
|
9
|
+
iframe?: boolean;
|
|
10
|
+
image?: string;
|
|
11
|
+
favicon?: string;
|
|
12
|
+
typeOfEmbed?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const Embed: ({ lazy, url, html, providerName, providerUrl, title, iframe, image, favicon, ...attrs }: EmbedProps) => React.JSX.Element;
|
|
15
|
+
export default Embed;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import GlossaryContext from '../../contexts/GlossaryTerms';
|
|
3
|
+
import type { GlossaryTerm } from '../../contexts/GlossaryTerms';
|
|
4
|
+
interface Props extends React.PropsWithChildren {
|
|
5
|
+
term?: string;
|
|
6
|
+
terms: GlossaryTerm[];
|
|
7
|
+
}
|
|
8
|
+
declare const Glossary: ({ children, term: termProp, terms }: Props) => React.JSX.Element;
|
|
9
|
+
declare const GlossaryWithContext: (props: any) => React.JSX.Element;
|
|
10
|
+
export { Glossary, GlossaryWithContext as default, GlossaryContext };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type Depth = 1 | 2 | 3 | 4 | 5 | 6;
|
|
3
|
+
interface Props extends React.PropsWithChildren<React.HTMLAttributes<HTMLHeadingElement>> {
|
|
4
|
+
tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
5
|
+
depth: Depth;
|
|
6
|
+
}
|
|
7
|
+
declare const CreateHeading: (depth: Depth) => (props: Props) => React.JSX.Element;
|
|
8
|
+
export default CreateHeading;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface ImageProps {
|
|
3
|
+
align?: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
border?: boolean;
|
|
6
|
+
caption?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
height?: string;
|
|
9
|
+
src: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
width?: string;
|
|
12
|
+
lazy?: boolean;
|
|
13
|
+
children?: [React.ReactElement];
|
|
14
|
+
}
|
|
15
|
+
declare const Image: (Props: ImageProps) => React.JSX.Element;
|
|
16
|
+
export default Image;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props extends JSX.IntrinsicAttributes {
|
|
3
|
+
align: ('left' | 'center' | 'right')[];
|
|
4
|
+
children: [React.ReactElement<HTMLTableCaptionElement | HTMLTableSectionElement | HTMLTableRowElement>];
|
|
5
|
+
}
|
|
6
|
+
declare const Table: (props: Props) => React.JSX.Element;
|
|
7
|
+
export default Table;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { default as Anchor } from './Anchor';
|
|
2
|
+
export { default as Callout } from './Callout';
|
|
3
|
+
export { default as Cards } from './CardsGrid';
|
|
4
|
+
export { default as Code } from './Code';
|
|
5
|
+
export { default as CodeTabs } from './CodeTabs';
|
|
6
|
+
export { default as Embed } from './Embed';
|
|
7
|
+
export { default as Glossary } from './Glossary';
|
|
8
|
+
export { default as HTMLBlock } from './HTMLBlock';
|
|
9
|
+
export { default as Heading } from './Heading';
|
|
10
|
+
export { default as Image } from './Image';
|
|
11
|
+
export { default as Table } from './Table';
|
|
12
|
+
export { default as TableOfContents } from './TableOfContents';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RunOpts } from '../lib/run';
|
|
3
|
+
type Props = React.PropsWithChildren & Pick<RunOpts, 'baseUrl' | 'terms' | 'variables'>;
|
|
4
|
+
declare const Contexts: ({ children, terms, variables, baseUrl }: Props) => React.ReactNode;
|
|
5
|
+
export default Contexts;
|
package/dist/enums.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum NodeTypes {
|
|
2
|
+
callout = "rdme-callout",
|
|
3
|
+
codeTabs = "code-tabs",
|
|
4
|
+
embedBlock = "embed-block",
|
|
5
|
+
emoji = "gemoji",
|
|
6
|
+
glossary = "readme-glossary-item",
|
|
7
|
+
htmlBlock = "html-block",
|
|
8
|
+
i = "i",
|
|
9
|
+
imageBlock = "image-block",
|
|
10
|
+
reusableContent = "reusable-content",
|
|
11
|
+
tableau = "tableau",
|
|
12
|
+
tutorialTile = "tutorial-tile",
|
|
13
|
+
variable = "readme-variable"
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
error?: string;
|
|
4
|
+
}
|
|
5
|
+
interface State {
|
|
6
|
+
hasError: boolean;
|
|
7
|
+
message?: string;
|
|
8
|
+
}
|
|
9
|
+
declare class RenderError extends React.Component<PropsWithChildren<Props>, State> {
|
|
10
|
+
state: {
|
|
11
|
+
hasError: boolean;
|
|
12
|
+
message: any;
|
|
13
|
+
};
|
|
14
|
+
static getDerivedStateFromError(error: Error): {
|
|
15
|
+
hasError: boolean;
|
|
16
|
+
message: string;
|
|
17
|
+
};
|
|
18
|
+
componentDidCatch(error: any, info: {
|
|
19
|
+
componentStack: any;
|
|
20
|
+
}): void;
|
|
21
|
+
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element;
|
|
22
|
+
}
|
|
23
|
+
export default RenderError;
|