@readme/markdown 6.75.0-beta.59 → 6.75.0-beta.61

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.
@@ -1,21 +1,28 @@
1
- @mixin gfmCodeBaseStyles($background: #F6F8FA, $background-dark: #242E34, $text: inherit) {
1
+ @mixin gfmCodeBaseStyles($background: #f6f8fa, $background-dark: #242e34, $text: inherit) {
2
+ --font-size: 90%;
2
3
 
3
4
  code,
4
5
  kbd,
5
6
  pre {
6
- font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace;
7
+ font-family:
8
+ SFMono-Regular,
9
+ Consolas,
10
+ Liberation Mono,
11
+ Menlo,
12
+ Courier,
13
+ monospace;
7
14
  font-family: var(--md-code-font, SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace);
8
- font-size: 1em
15
+ font-size: 1em;
9
16
  }
10
17
 
11
18
  code,
12
19
  pre {
13
- font-size: 12px
20
+ font-size: 12px;
14
21
  }
15
22
 
16
23
  pre {
17
24
  margin-bottom: 0;
18
- margin-top: 0
25
+ margin-top: 0;
19
26
  }
20
27
 
21
28
  code {
@@ -23,27 +30,27 @@
23
30
  background-color: var(--md-code-background, $background);
24
31
  border-radius: 3px;
25
32
  color: var(--md-code-text);
26
- font-size: 85%;
33
+ font-size: var(--font-size);
27
34
  margin: 0;
28
- padding: .2em .4em;
35
+ padding: 0.2em 0.4em;
29
36
 
30
- >div[class*="cm-"] {
37
+ > div[class*='cm-'] {
31
38
  display: inherit;
32
39
  }
33
40
  }
34
41
 
35
42
  pre {
36
- word-wrap: normal
43
+ word-wrap: normal;
37
44
  }
38
45
 
39
- pre>code {
46
+ pre > code {
40
47
  background: 0 0;
41
48
  border: 0;
42
49
  font-size: 100%;
43
50
  margin: 0;
44
51
  padding: 0;
45
52
  white-space: pre;
46
- word-break: normal
53
+ word-break: normal;
47
54
  }
48
55
 
49
56
  pre {
@@ -54,10 +61,10 @@
54
61
  border-radius: 3px;
55
62
  border-radius: var(--markdown-radius, 3px);
56
63
  border-radius: var(--md-code-radius, var(--markdown-radius, 3px));
57
- font-size: 85%;
64
+ font-size: var(--font-size);
58
65
  line-height: 1.45;
59
66
  overflow: auto;
60
- padding: 1em
67
+ padding: 1em;
61
68
  }
62
69
 
63
70
  pre code.theme-dark {
@@ -74,7 +81,7 @@
74
81
  max-width: auto;
75
82
  overflow: visible;
76
83
  padding: 0;
77
- word-wrap: normal
84
+ word-wrap: normal;
78
85
  }
79
86
 
80
87
  kbd {
@@ -89,18 +96,18 @@
89
96
  font-size: 11px;
90
97
  line-height: 10px;
91
98
  padding: 3px 5px;
92
- vertical-align: middle
99
+ vertical-align: middle;
93
100
  }
94
101
  }
95
102
 
96
103
  @mixin copyCodeButton {
97
104
  button.rdmd-code-copy {
98
- DISPLAY: none !important; // hide by default
105
+ display: none !important; // hide by default
99
106
 
100
107
  & {
101
108
  -webkit-appearance: unset;
102
- margin: .5em .6em 0 0;
103
- padding: .25em .7em;
109
+ margin: 0.5em 0.6em 0 0;
110
+ padding: 0.25em 0.7em;
104
111
  cursor: copy;
105
112
  font: inherit;
106
113
  color: inherit;
@@ -111,67 +118,68 @@
111
118
  background: inherit;
112
119
  background: var(--md-code-background, inherit);
113
120
  box-shadow:
114
- inset 0 0 0 1px rgba(#aaa, .66),
115
- -1px 2px 6px -3px rgba(black, .1);
116
- transition: .15s ease-out;
121
+ inset 0 0 0 1px rgba(#aaa, 0.66),
122
+ -1px 2px 6px -3px rgba(black, 0.1);
123
+ transition: 0.15s ease-out;
117
124
  }
118
125
 
119
126
  &:not(:hover) {
120
-
121
127
  &:before,
122
128
  &:after {
123
- opacity: .66;
129
+ opacity: 0.66;
124
130
  }
125
131
  }
126
132
 
127
133
  &:hover {
128
134
  &:not(:active) {
129
135
  box-shadow:
130
- inset 0 0 0 1px rgba(#8B8B8B, .75),
131
- -1px 2px 6px -3px rgba(black, .2);
136
+ inset 0 0 0 1px rgba(#8b8b8b, 0.75),
137
+ -1px 2px 6px -3px rgba(black, 0.2);
132
138
  }
133
139
  }
134
140
 
135
141
  &:active {
136
142
  box-shadow:
137
- inset 0 0 0 1px rgba(#8B8B8B, .5),
138
- inset 1px 4px 6px -2px rgba(0, 0, 0, .175);
143
+ inset 0 0 0 1px rgba(#8b8b8b, 0.5),
144
+ inset 1px 4px 6px -2px rgba(0, 0, 0, 0.175);
139
145
 
140
146
  &:before,
141
147
  &:after {
142
- opacity: .75;
148
+ opacity: 0.75;
143
149
  }
144
150
  }
145
151
 
146
152
  &:before,
147
153
  &:after {
148
154
  display: inline-block;
149
- font: normal normal normal 1em/1 "Font Awesome 5 Free", "FontAwesome";
155
+ font:
156
+ normal normal normal 1em/1 'Font Awesome 5 Free',
157
+ 'FontAwesome';
150
158
  text-rendering: auto;
151
159
  -webkit-font-smoothing: antialiased;
152
160
 
153
161
  line-height: 2;
154
162
  font-family: 'ReadMe-Icons';
155
163
  font-variant-ligatures: discretionary-ligatures;
156
- font-feature-settings: "liga";
164
+ font-feature-settings: 'liga';
157
165
  }
158
166
 
159
167
  &:before {
160
- content: "\e6c9";
168
+ content: '\e6c9';
161
169
  font-weight: 800;
162
- transition: .3s .15s ease;
170
+ transition: 0.3s 0.15s ease;
163
171
  }
164
172
 
165
173
  &:after {
166
174
  // @todo why are these !important @rafe, you dumbell?
167
- content: "\e942" !important;
175
+ content: '\e942' !important;
168
176
  font-weight: 900 !important;
169
177
  position: absolute;
170
178
  top: 50%;
171
179
  left: 50%;
172
- transform: translate(-50%, -50%) scale(.33);
180
+ transform: translate(-50%, -50%) scale(0.33);
173
181
  opacity: 0 !important;
174
- transition: .3s 0s ease;
182
+ transition: 0.3s 0s ease;
175
183
  }
176
184
 
177
185
  &_copied {
@@ -185,13 +193,13 @@
185
193
  }
186
194
 
187
195
  &:before {
188
- transition: .3s 0s ease;
189
- transform: scale(.33);
196
+ transition: 0.3s 0s ease;
197
+ transform: scale(0.33);
190
198
  opacity: 0 !important;
191
199
  }
192
200
 
193
201
  &:after {
194
- transition: .3s .15s ease;
202
+ transition: 0.3s 0.15s ease;
195
203
  transform: translate(-50%, -50%) scale(1);
196
204
  opacity: 1 !important;
197
205
  }
@@ -201,11 +209,11 @@
201
209
  pre {
202
210
  position: relative;
203
211
 
204
- >code {
212
+ > code {
205
213
  background: inherit;
206
214
  }
207
215
 
208
- >code.theme-dark {
216
+ > code.theme-dark {
209
217
  color: white;
210
218
  }
211
219
 
@@ -221,7 +229,7 @@
221
229
  overflow: hidden;
222
230
  padding: 0;
223
231
 
224
- >code {
232
+ > code {
225
233
  display: block !important;
226
234
  overflow: auto;
227
235
  padding: 1em;
@@ -232,7 +240,7 @@
232
240
  // manage copied state style
233
241
  & {
234
242
  &:hover button.rdmd-code-copy:not(:hover) {
235
- transition-delay: .4s;
243
+ transition-delay: 0.4s;
236
244
  }
237
245
 
238
246
  &:not(:hover) button.rdmd-code-copy:not(.rdmd-code-copy_copied) {
@@ -243,7 +251,7 @@
243
251
  }
244
252
 
245
253
  .markdown-body {
246
- // --md-code-background: #F6F8FA;
254
+ // --md-code-background: #F6F8FA;
247
255
  @include gfmCodeBaseStyles;
248
256
  @include copyCodeButton;
249
257
  }
@@ -13,8 +13,10 @@ const extractScripts = (html: string = ''): [string, () => void] => {
13
13
  return [cleaned, () => scripts.map(js => window.eval(js))];
14
14
  };
15
15
 
16
- const HTMLBlock = ({ children = '', runScripts = false, safeMode = false }) => {
16
+ const HTMLBlock = ({ children = '', runScripts, safeMode = false }) => {
17
17
  let html = children;
18
+ runScripts = typeof runScripts !== 'boolean' ? (runScripts === 'true' ? true : false) : runScripts;
19
+
18
20
  if (typeof html !== 'string') html = renderToStaticMarkup(html);
19
21
  const [cleanedHtml, exec] = extractScripts(html);
20
22
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  declare const HTMLBlock: ({ children, runScripts, safeMode }: {
3
3
  children?: string;
4
- runScripts?: boolean;
4
+ runScripts: any;
5
5
  safeMode?: boolean;
6
6
  }) => React.JSX.Element;
7
7
  export default HTMLBlock;
package/dist/main.css CHANGED
@@ -388,4 +388,4 @@ span.CodeMirror-selectedtext { background: none; }
388
388
  z-index: 1;
389
389
  }
390
390
 
391
- .markdown-body img[align=right],.markdown-body img[alt~=align-right]{float:right;margin-left:.75rem}.markdown-body img[align=left],.markdown-body img[alt~=align-left]{float:left;margin-right:.75rem}.markdown-body>img,.markdown-body figure>img,.markdown-body img[width="80%"],.markdown-body img[align=middle],.markdown-body img[alt~=align-center]{display:block}.markdown-body img{box-sizing:content-box;display:inline-block;vertical-align:middle;max-width:100%;margin-left:auto;margin-right:auto;border-style:none;outline:none !important}.markdown-body img[width=smart]{width:auto;max-width:100%;max-height:450px}.markdown-body img.border{border:1px solid rgba(0,0,0,.2)}.markdown-body figure{margin:15px auto}.markdown-body figure figcaption{margin-top:8px;font-size:.93em;font-style:italic;text-align:center}.markdown-body figure .img{display:inline-block}.markdown-body figure .img,.markdown-body figure .img>img:only-of-type{display:block}.markdown-body .lightbox.open{position:fixed;z-index:9999999;top:0;left:0;display:flex;flex-flow:nowrap column;justify-content:flex-start;align-items:center;width:100vw;height:100vh;overflow:hidden;overflow-y:scroll;background:rgba(255,255,255,.966);user-select:none;margin-top:0;margin-bottom:0}.markdown-body .lightbox.open:after{position:fixed;top:1em;right:1em;content:"";display:inline-block;font:normal normal normal 2em/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;transform:translate(0, 0);display:inline-block;cursor:pointer;opacity:1;transform:scale(1.5);transition:.3s .3s ease-in}.markdown-body .lightbox.open:not(.open):after{transform:scale(0);opacity:0}.markdown-body .lightbox.open .lightbox-inner{position:relative;display:inline-flex;justify-content:center;align-items:center;min-height:calc(100vh + 8px);margin:auto;padding:0;box-sizing:content-box}.markdown-body .lightbox.open img{width:auto !important;height:auto !important;min-width:unset !important;max-width:97.5vw !important;max-height:97.5vh !important}.markdown-body .lightbox.open img.border,.markdown-body .lightbox.open img:not([src$=".png"]):not([src$=".svg"]):not([src$=".jp2"]):not([src$=".tiff"]){box-shadow:0 .5em 3em -1em rgba(0,0,0,.2)}.markdown-body table{display:table;border-collapse:collapse;border-spacing:0;width:100%;color:var(--table-text)}.markdown-body table thead{color:var(--table-head-text, inherit)}.markdown-body table thead tr{background:var(--table-head, #f6f8fa)}.markdown-body table tr{background-color:var(--table-row, #fff)}.markdown-body table tr+tr{border-top:1px solid var(--table-edges, #dfe2e5)}.markdown-body table th,.markdown-body table thead td{font-weight:600}.markdown-body table th:empty,.markdown-body table thead td:empty{padding:0}.markdown-body table td,.markdown-body table th{padding:0;color:inherit;vertical-align:middle;border:1px solid var(--table-edges, #dfe2e5);padding:6px 13px}.markdown-body table td>:first-child,.markdown-body table td>:only-child,.markdown-body table th>:first-child,.markdown-body table th>:only-child{margin-top:0 !important}.markdown-body table td>:last-child,.markdown-body table td>:only-child,.markdown-body table th>:last-child,.markdown-body table th>:only-child{margin-bottom:0 !important}.markdown-body table:not(.plain) tr:nth-child(2n){background-color:var(--table-stripe, #fbfcfd)}.markdown-body .rdmd-table{display:block;position:relative}.markdown-body .rdmd-table-inner{box-sizing:content-box;min-width:100%;overflow:auto;width:100%}.markdown-body .rdmd-table table{border:1px solid var(--table-edges, #dfe2e5)}.markdown-body .rdmd-table table:only-child{margin:0 !important}.markdown-body .rdmd-table table:only-child thead th{background:inherit}.markdown-body .rdmd-table table:only-child td:last-child,.markdown-body .rdmd-table table:only-child th:last-child{border-right:none}.markdown-body .rdmd-table table:only-child thead tr,.markdown-body .rdmd-table table:only-child thead th:last-child{box-shadow:3px 0 0 var(--table-head)}.toc-list .glossary-tooltip{pointer-events:none}.markdown-body code,.markdown-body kbd,.markdown-body pre{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-family:var(--md-code-font, SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace);font-size:1em}.markdown-body code,.markdown-body pre{font-size:12px}.markdown-body pre{margin-bottom:0;margin-top:0}.markdown-body code{background-color:#f6f8fa;background-color:var(--md-code-background, #F6F8FA);border-radius:3px;color:var(--md-code-text);font-size:85%;margin:0;padding:.2em .4em}.markdown-body code>div[class*=cm-]{display:inherit}.markdown-body pre{word-wrap:normal}.markdown-body pre>code{background:0 0;border:0;font-size:100%;margin:0;padding:0;white-space:pre;word-break:normal}.markdown-body pre{background-color:#f6f8fa;background-color:var(--md-code-background, #F6F8FA);color:inherit;color:var(--md-code-text, inherit);border-radius:3px;border-radius:var(--markdown-radius, 3px);border-radius:var(--md-code-radius, var(--markdown-radius, 3px));font-size:85%;line-height:1.45;overflow:auto;padding:1em}.markdown-body pre code.theme-dark{background-color:#242e34;background-color:var(--md-code-background, #242E34)}.markdown-body pre code{background-color:rgba(0,0,0,0);border:0;display:inline;line-height:inherit;margin:0;max-width:auto;overflow:visible;padding:0;word-wrap:normal}.markdown-body kbd{background-color:#f6f8fa;background-color:var(--d-code-background, #F6F8FA);border:1px solid #d1d5da;border-bottom-color:#c6cbd1;border-radius:3px;box-shadow:inset 0 -1px 0 #c6cbd1;color:#444d56;display:inline-block;font-size:11px;line-height:10px;padding:3px 5px;vertical-align:middle}.markdown-body button.rdmd-code-copy{DISPLAY:none !important}.markdown-body button.rdmd-code-copy{-webkit-appearance:unset;margin:.5em .6em 0 0;padding:.25em .7em;cursor:copy;font:inherit;color:inherit;color:var(--md-code-text, inherit);border:none;border-radius:3px;outline:none !important;background:inherit;background:var(--md-code-background, inherit);box-shadow:inset 0 0 0 1px rgba(170,170,170,.66),-1px 2px 6px -3px rgba(0,0,0,.1);transition:.15s ease-out}.markdown-body button.rdmd-code-copy:not(:hover):before,.markdown-body button.rdmd-code-copy:not(:hover):after{opacity:.66}.markdown-body button.rdmd-code-copy:hover:not(:active){box-shadow:inset 0 0 0 1px rgba(139,139,139,.75),-1px 2px 6px -3px rgba(0,0,0,.2)}.markdown-body button.rdmd-code-copy:active{box-shadow:inset 0 0 0 1px rgba(139,139,139,.5),inset 1px 4px 6px -2px rgba(0,0,0,.175)}.markdown-body button.rdmd-code-copy:active:before,.markdown-body button.rdmd-code-copy:active:after{opacity:.75}.markdown-body button.rdmd-code-copy:before,.markdown-body button.rdmd-code-copy:after{display:inline-block;font:normal normal normal 1em/1 "Font Awesome 5 Free","FontAwesome";text-rendering:auto;-webkit-font-smoothing:antialiased;line-height:2;font-family:"ReadMe-Icons";font-variant-ligatures:discretionary-ligatures;font-feature-settings:"liga"}.markdown-body button.rdmd-code-copy:before{content:"";font-weight:800;transition:.3s .15s ease}.markdown-body button.rdmd-code-copy:after{content:"" !important;font-weight:900 !important;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%) scale(0.33);opacity:0 !important;transition:.3s 0s ease}.markdown-body button.rdmd-code-copy_copied{pointer-events:none}.markdown-body button.rdmd-code-copy_copied,.markdown-body button.rdmd-code-copy_copied *{color:green !important;color:var(--md-code-text, green) !important;opacity:1}.markdown-body button.rdmd-code-copy_copied:before{transition:.3s 0s ease;transform:scale(0.33);opacity:0 !important}.markdown-body button.rdmd-code-copy_copied:after{transition:.3s .15s ease;transform:translate(-50%, -50%) scale(1);opacity:1 !important}.markdown-body pre{position:relative}.markdown-body pre>code{background:inherit}.markdown-body pre>code.theme-dark{color:#fff}.markdown-body pre button.rdmd-code-copy{display:inline-block !important;position:absolute;right:0;top:0}.markdown-body pre{overflow:hidden;padding:0}.markdown-body pre>code{display:block !important;overflow:auto;padding:1em;max-height:90vh}.markdown-body pre:hover button.rdmd-code-copy:not(:hover){transition-delay:.4s}.markdown-body pre:not(:hover) button.rdmd-code-copy:not(.rdmd-code-copy_copied){opacity:0 !important}.CodeTabs{color:#333;color:var(--md-code-text, #333);border-radius:var(--md-code-radius, var(--markdown-radius, 3px)) !important;overflow:hidden}.CodeTabs.theme-dark{color:#fff;color:var(--md-code-text, white)}.CodeTabs.theme-dark .CodeTabs-toolbar{background:#373737;background:var(--md-code-tabs, #373737)}.CodeTabs-toolbar{background:#ebedef;background:var(--md-code-tabs, #ebedef);display:flex;flex-flow:row nowrap;overflow:hidden;overflow-x:auto;-ms-overflow-style:none;-webkit-overflow-scrolling:touch}.CodeTabs-toolbar::-webkit-scrollbar{display:none}.CodeTabs-toolbar button{white-space:nowrap;transition:.123s ease;-webkit-appearance:none;appearance:none;display:inline-block;line-height:2;padding:.5em 1em;border:none;background:rgba(0,0,0,0);outline:none;color:inherit;font:inherit;font-size:.75em;cursor:pointer}.CodeTabs.CodeTabs_initial .CodeTabs-toolbar button:first-child,.CodeTabs-toolbar button.CodeTabs_active{background:#f6f8fa;background:var(--md-code-background, #F6F8FA);color:#000;color:var(--md-code-text, black);pointer-events:none}.CodeTabs.theme-dark.CodeTabs_initial .CodeTabs-toolbar button:first-child,.CodeTabs.theme-dark .CodeTabs-toolbar button.CodeTabs_active{background:#242e34;background:var(--md-code-background, #242E34);color:#fff;color:var(--md-code-text, white)}.CodeTabs-toolbar button:not(.CodeTabs_active):hover{background:rgba(0,0,0,.075)}.CodeTabs pre{border-radius:0 0 var(--md-code-radius, var(--markdown-radius, 3px)) var(--md-code-radius, var(--markdown-radius, 3px)) !important;background:#f6f8fa;background:var(--md-code-background, #F6F8FA);margin-bottom:0}.CodeTabs pre:not(.CodeTabs_active){display:none}.CodeTabs.theme-dark pre{background:#242e34;background:var(--md-code-background, #242E34)}.CodeTabs.CodeTabs_initial pre:first-child{display:block}.callout{--emoji: 1em;--icon-font: FontAwesome;border-top-right-radius:var(--markdown-radius);border-bottom-right-radius:var(--markdown-radius)}.callout.callout{--background: #f8f8f9;--border: #8b939c}.callout.callout{background:var(--background);border-color:var(--border);color:var(--text);padding:1.33rem}.callout.callout_info{--background: #e3edf2;--title: #46b8da;--border: #5bc0de}.callout.callout_warn,.callout.callout_warning{--background: #fcf8f2;--title: #eea236;--border: #f0ad4e}.callout.callout_ok,.callout.callout_okay,.callout.callout_success{--background: #f3f8f3;--title: #489e49;--border: #50af51}.callout.callout_err,.callout.callout_error{--background: #fdf7f7;--title: #d43f3a;--border: #d9534f}.callout.callout>*{margin-left:1.33rem;position:relative}.callout.callout ul,.callout.callout ol{padding-left:1.3em}.callout.callout a{color:inherit}.callout.callout hr{border-color:var(--border, var(--markdown-edge, #eee))}.callout.callout blockquote{color:var(--text);border-color:var(--border);border-width:3px;padding:0 0 0 .8em}.callout.callout .callout-heading{color:var(--title, --text);margin-bottom:calc(1.33rem*.5)}.callout.callout .callout-heading:only-child{margin-bottom:0}.callout.callout .callout-heading.empty{float:left;margin-top:calc(1.33rem*.5)}.callout.callout .callout-heading.empty .callout-icon{line-height:0}.callout.callout .callout-heading>*{color:inherit;margin:0}.callout.callout .callout-heading:before{position:absolute;right:100%;width:2.4em;text-align:center;font:normal normal normal 1em/1 FontAwesome}.callout.callout .callout-icon{float:left;margin-left:calc(-1.33rem - .5em);margin-right:-0.25rem}.callout-icon{font-size:var(--emoji, 0);color:var(--icon-color, inherit) !important}.callout-icon:before{content:var(--icon);font-family:var(--icon-font);font-size:var(--icon-size, 1rem);font-weight:var(--icon-weight, 400);position:absolute;top:50%;transform:translate(-50%, -50%);display:inline-block;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.rdmdCallouts--useIconFont .callout{--emoji: unset}.rdmdCallouts--useIconFont .callout_okay{--icon: ""}.rdmdCallouts--useIconFont .callout_info{--icon: ""}.rdmdCallouts--useIconFont .callout_warn{--icon: ""}.rdmdCallouts--useIconFont .callout_error{--icon: ""}.rdmdCallouts--useIconFont .callout_default{--emoji: 1rem}.heading.heading{display:flex;justify-content:flex-start;align-items:center;position:relative}.heading.heading .heading-text{flex:1 100%}.heading.heading .heading-anchor-deprecated{position:absolute;top:0}.heading.heading .heading-anchor{top:-1rem !important}.heading.heading .heading-anchor,.heading.heading .heading-anchor-icon{position:absolute !important;display:inline !important;order:-1;right:100%;top:unset !important;margin-right:-0.8rem;padding:.8rem .2rem .8rem 0 !important;font-size:.8rem !important;text-decoration:none;color:inherit;transform:translateX(-100%);transition:.2s ease}.heading.heading .heading-anchor:hover,.heading.heading .heading-anchor-icon:hover{opacity:1}.heading.heading:not(:hover) .heading-anchor-icon{opacity:0}.markdown-body .embed{padding:15px;color:var(--md-code-text, inherit);border-radius:var(--md-code-radius, var(--markdown-radius, 3px));border-radius:3px;background:rgba(0,0,0,0);box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);transition:.3s ease}.markdown-body .embed:hover{background:var(--md-code-background, #f6f8fa);box-shadow:inset 0 0 0 1px rgba(0,0,0,.1)}.markdown-body>.embed_hasImg:nth-of-type(odd){margin-right:30px;padding-right:0}.markdown-body>.embed_hasImg:nth-of-type(odd) .embed-link{flex-direction:row-reverse}.markdown-body>.embed_hasImg:nth-of-type(odd) .embed-img{margin-left:.88em;margin-right:-30px;box-shadow:-0.3em .3em .9em -0.3em rgba(0,0,0,.15)}.markdown-body>.embed_hasImg:nth-of-type(even){margin-left:30px;padding-left:0}.markdown-body>.embed_hasImg:nth-of-type(even) .embed-img{margin-left:-30px}.markdown-body .embed:empty{display:none}.markdown-body .embed-media{display:flex;justify-content:center}.markdown-body .embed-media>:only-child{flex:1;margin:-15px;border-radius:0 !important}.markdown-body .embed-link{display:flex;align-items:center;color:var(--markdown-text, #333);text-decoration:none !important}.markdown-body .embed-body{flex:1;line-height:1.3}.markdown-body .embed-body,.markdown-body .embed-body .embed-title{font-size:1.15em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.markdown-body .embed-body .embed-provider{display:block;text-decoration-color:rgba(0,0,0,0) !important;opacity:.88}.markdown-body .embed-body-url{opacity:.75}.markdown-body .embed-provider{font-size:.8em;line-height:1.6;transition:.2 ease}.markdown-body .embed-provider code:only-child{display:block;width:100%;font-size:1.15em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;background:rgba(0,0,0,0);margin:0;padding:0;font-size:inherit !important}.markdown-body .embed-provider code{opacity:.8}.markdown-body .embed-img{width:5em;max-width:5em;margin:0 .88em 0 0;padding:4px;background:#fff;border:1px solid rgba(0,0,0,.15);border-radius:3px;transition:inherit;box-shadow:.3em .3em .9em -0.3em rgba(0,0,0,.15)}.markdown-body .embed:not(:hover) .embed-img{box-shadow:0 .25em 1em -0.5em rgba(0,0,0,.133)}.markdown-body .embed:hover .embed-img{border:1px solid rgba(0,0,0,.2)}.markdown-body .embed-favicon{width:12px !important;height:12px !important;margin-top:4px;margin-right:6px;margin-bottom:12px}.GlossaryItem-trigger{border-bottom:1px solid #737c83;border-style:dotted;border-top:none;border-left:none;border-right:none;cursor:pointer}.GlossaryItem-tooltip-content{--Glossary-bg: var(--color-bg-page, var(--white));--Glossary-color: var(--color-text-default, var(--gray20));--Glossary-shadow: var( --box-shadow-menu-light, 0 5px 10px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.025), 0 1px 3px rgba(0, 0, 0, 0.025) );background-color:var(--Glossary-bg);border:1px solid var(--color-border-default, rgba(0, 0, 0, 0.1));border-radius:var(--border-radius);box-shadow:var(--Glossary-shadow);color:var(--Glossary-color);font-size:15px;font-weight:400;line-height:1.5;padding:15px;text-align:left;width:350px}[data-color-mode=dark] .GlossaryItem-tooltip-content{--Glossary-bg: var(--gray15);--Glossary-color: var(--color-text-default, var(--white));--Glossary-shadow: var( --box-shadow-menu-dark, 0 1px 3px rgba(0, 0, 0, 0.025), 0 2px 6px rgba(0, 0, 0, 0.025), 0 5px 10px rgba(0, 0, 0, 0.05) )}@media(prefers-color-scheme: dark){[data-color-mode=auto] .GlossaryItem-tooltip-content{--Glossary-bg: var(--Tooltip-bg, var(--gray0));--Glossary-color: var(--color-text-default, var(--white));--Glossary-shadow: var( --box-shadow-menu-dark, 0 1px 3px rgba(0, 0, 0, 0.025), 0 2px 6px rgba(0, 0, 0, 0.025), 0 5px 10px rgba(0, 0, 0, 0.05) )}}.GlossaryItem-term{font-style:italic}.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}:root{--markdown-text: inherit;--markdown-title: inherit;--markdown-title-font: inherit;--markdown-font: inherit;--markdown-font-size: inherit;--markdown-line-height: 1.5}.field-description,.markdown-body{color:var(--markdown-text);font-family:var(--markdown-font);line-height:var(--markdown-line-height);position:relative;text-size-adjust:100%;word-wrap:break-word;font-size:var(--markdown-font-size, 14px)}.field-description::before,.field-description::after,.markdown-body::before,.markdown-body::after{content:"";display:table}.field-description::after,.markdown-body::after{clear:both}.field-description ul,.markdown-body ul{list-style:initial}.field-description .anchor,.markdown-body .anchor{float:left;line-height:1;margin-left:-20px;padding-right:4px}.field-description .anchor:focus,.markdown-body .anchor:focus{outline:0}.field-description h1:hover .anchor,.field-description h2:hover .anchor,.field-description h3:hover .anchor,.field-description h4:hover .anchor,.field-description h5:hover .anchor,.field-description h6:hover .anchor,.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.field-description details,.markdown-body details{display:block}.field-description summary,.markdown-body summary{display:list-item}.field-description a,.markdown-body a{transition:.15s ease}.field-description a:hover,.markdown-body a:hover{text-decoration:underline}.field-description a:active,.field-description a:hover,.markdown-body a:active,.markdown-body a:hover{outline-width:0}.field-description a:not([href]),.markdown-body a:not([href]){color:inherit;text-decoration:none}.field-description strong,.markdown-body strong{font-weight:inherit;font-weight:bolder}.field-description h1,.markdown-body h1{font-size:2em;margin:.67em 0}.field-description hr,.markdown-body hr{background:rgba(0,0,0,0);border-bottom:1px solid var(--markdown-edge, #dfe2e5);border-width:0 0 1px;box-sizing:content-box;height:0;margin:15px 0;overflow:hidden}.field-description hr::before,.field-description hr::after,.markdown-body hr::before,.markdown-body hr::after{content:"";display:table}.field-description hr::after,.markdown-body hr::after{clear:both}.field-description input,.markdown-body input{font:inherit;margin:0}.field-description input,.markdown-body input{overflow:visible}.field-description [type=checkbox],.markdown-body [type=checkbox]{box-sizing:border-box;padding:0}.field-description *,.markdown-body *{box-sizing:border-box}.field-description input,.markdown-body input{font-family:inherit;font-size:inherit;line-height:inherit}.field-description strong,.markdown-body strong{font-weight:600}.field-description details summary,.markdown-body details summary{cursor:pointer}.field-description h1,.field-description h2,.field-description h3,.field-description h4,.field-description h5,.field-description h6,.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{color:var(--markdown-title);font-family:var(--markdown-title-font);font-size:var(--markdown-title-size);font-weight:var(--markdown-title-weight, 600);line-height:1.25;margin-bottom:var(--markdown-title-marginBottom, 1rem);margin-top:var(--markdown-title-marginTop, 1em)}.field-description h1,.markdown-body h1{font-size:1.75em;font-size:var(--markdown-title-size, 1.75em)}.field-description h2,.markdown-body h2{font-size:1.5em;font-size:var(--markdown-title-size, 1.5em)}.field-description h1,.markdown-body h1{font-weight:700;font-weight:var(--markdown-title-weight, 700)}.field-description h2,.markdown-body h2{font-weight:600;font-weight:var(--markdown-title-weight, 600)}.field-description h3,.field-description h4,.markdown-body h3,.markdown-body h4{font-weight:600;font-weight:var(--markdown-title-weight, 600)}.field-description h3,.markdown-body h3{font-size:1.25em;font-size:var(--markdown-title-size, 1.25em)}.field-description h4,.markdown-body h4{font-size:1em;font-size:var(--markdown-title-size, 1em)}.field-description h5,.field-description h6,.markdown-body h5,.markdown-body h6{font-weight:600;font-weight:var(--markdown-title-weight, 600)}.field-description h5,.markdown-body h5{font-size:.875em;font-size:var(--markdown-title-size, 0.875em)}.field-description h6,.markdown-body h6{color:var(--markdown-title, #6a737d);font-size:.85em;font-size:var(--markdown-title-size, 0.85em)}.field-description p,.field-description .p,.markdown-body p,.markdown-body .p{margin-bottom:10px;margin-top:0}.field-description blockquote,.markdown-body blockquote{margin:0}.field-description ol,.field-description ul,.markdown-body ol,.markdown-body ul{margin-bottom:0;margin-top:0;padding-left:0}.field-description ol ol,.field-description ul ol,.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.field-description ol ol ol,.field-description ol ul ol,.field-description ul ol ol,.field-description ul ul ol,.markdown-body ol ol ol,.markdown-body ol ul ol,.markdown-body ul ol ol,.markdown-body ul ul ol{list-style-type:lower-alpha}.field-description dd,.markdown-body dd{margin-left:0}.field-description input::-webkit-inner-spin-button,.field-description input::-webkit-outer-spin-button,.markdown-body input::-webkit-inner-spin-button,.markdown-body input::-webkit-outer-spin-button{appearance:none;appearance:none;margin:0}.field-description>:first-child,.markdown-body>:first-child{margin-top:0 !important}.field-description>:last-child,.markdown-body>:last-child{margin-bottom:0 !important}.field-description blockquote,.field-description dl,.field-description ol,.field-description p,.field-description pre,.field-description table,.field-description ul,.markdown-body blockquote,.markdown-body dl,.markdown-body ol,.markdown-body p,.markdown-body pre,.markdown-body table,.markdown-body ul{margin-bottom:15px;margin-top:0}.field-description blockquote,.markdown-body blockquote{border-left:.25em solid #dfe2e5;color:#6a737d;display:block;padding:0 1em}.field-description blockquote>:first-child,.markdown-body blockquote>:first-child{margin-top:0}.field-description blockquote>:last-child,.markdown-body blockquote>:last-child{margin-bottom:0}.field-description ol,.field-description ul,.markdown-body ol,.markdown-body ul{padding-left:2em}.field-description ol ol,.field-description ol ul,.field-description ul ol,.field-description ul ul,.markdown-body ol ol,.markdown-body ol ul,.markdown-body ul ol,.markdown-body ul ul{margin-bottom:0;margin-top:0}.field-description li,.markdown-body li{clear:both;word-wrap:break-all}.field-description li>p,.markdown-body li>p{margin-top:1em}.field-description li+li,.markdown-body li+li{margin-top:.25em}.field-description dl,.markdown-body dl{padding:0}.field-description dl dt,.markdown-body dl dt{font-size:1em;font-style:italic;font-weight:600;margin-top:1em;padding:0}.field-description dl dd,.markdown-body dl dd{margin-bottom:1em;padding:0 1em}.field-description :checked+.radio-label,.markdown-body :checked+.radio-label{border-color:var(--project-color-primary);position:relative;z-index:1}.field-description .task-list-item,.markdown-body .task-list-item{list-style-type:none}.field-description .task-list-item+.task-list-item,.markdown-body .task-list-item+.task-list-item{margin-top:3px}.field-description .task-list-item input,.markdown-body .task-list-item input{margin:0 .2em .25em -1.6em;vertical-align:middle}.field-description p.blank-line,.markdown-body p.blank-line{height:1.5em}.field-description h5,.field-description h6,.markdown-body h5,.markdown-body h6{font-size:.9em}.field-description blockquote h1:last-child,.field-description blockquote h2:last-child,.markdown-body blockquote h1:last-child,.markdown-body blockquote h2:last-child{border-bottom:0}.field-description>*,.markdown-body>*{margin-bottom:15px !important;margin-top:15px}.field-description .task-list-item input,.markdown-body .task-list-item input{margin:0 .5em .25em -1.25em}.field-description a[href],.field-description a:not([href=""]),.markdown-body a[href],.markdown-body a:not([href=""]){text-decoration:underline}
391
+ .markdown-body img[align=right],.markdown-body img[alt~=align-right]{float:right;margin-left:.75rem}.markdown-body img[align=left],.markdown-body img[alt~=align-left]{float:left;margin-right:.75rem}.markdown-body>img,.markdown-body figure>img,.markdown-body img[width="80%"],.markdown-body img[align=middle],.markdown-body img[alt~=align-center]{display:block}.markdown-body img{box-sizing:content-box;display:inline-block;vertical-align:middle;max-width:100%;margin-left:auto;margin-right:auto;border-style:none;outline:none !important}.markdown-body img[width=smart]{width:auto;max-width:100%;max-height:450px}.markdown-body img.border{border:1px solid rgba(0,0,0,.2)}.markdown-body figure{margin:15px auto}.markdown-body figure figcaption{margin-top:8px;font-size:.93em;font-style:italic;text-align:center}.markdown-body figure .img{display:inline-block}.markdown-body figure .img,.markdown-body figure .img>img:only-of-type{display:block}.markdown-body .lightbox.open{position:fixed;z-index:9999999;top:0;left:0;display:flex;flex-flow:nowrap column;justify-content:flex-start;align-items:center;width:100vw;height:100vh;overflow:hidden;overflow-y:scroll;background:rgba(255,255,255,.966);user-select:none;margin-top:0;margin-bottom:0}.markdown-body .lightbox.open:after{position:fixed;top:1em;right:1em;content:"";display:inline-block;font:normal normal normal 2em/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;transform:translate(0, 0);display:inline-block;cursor:pointer;opacity:1;transform:scale(1.5);transition:.3s .3s ease-in}.markdown-body .lightbox.open:not(.open):after{transform:scale(0);opacity:0}.markdown-body .lightbox.open .lightbox-inner{position:relative;display:inline-flex;justify-content:center;align-items:center;min-height:calc(100vh + 8px);margin:auto;padding:0;box-sizing:content-box}.markdown-body .lightbox.open img{width:auto !important;height:auto !important;min-width:unset !important;max-width:97.5vw !important;max-height:97.5vh !important}.markdown-body .lightbox.open img.border,.markdown-body .lightbox.open img:not([src$=".png"]):not([src$=".svg"]):not([src$=".jp2"]):not([src$=".tiff"]){box-shadow:0 .5em 3em -1em rgba(0,0,0,.2)}.markdown-body table{display:table;border-collapse:collapse;border-spacing:0;width:100%;color:var(--table-text)}.markdown-body table thead{color:var(--table-head-text, inherit)}.markdown-body table thead tr{background:var(--table-head, #f6f8fa)}.markdown-body table tr{background-color:var(--table-row, #fff)}.markdown-body table tr+tr{border-top:1px solid var(--table-edges, #dfe2e5)}.markdown-body table th,.markdown-body table thead td{font-weight:600}.markdown-body table th:empty,.markdown-body table thead td:empty{padding:0}.markdown-body table td,.markdown-body table th{padding:0;color:inherit;vertical-align:middle;border:1px solid var(--table-edges, #dfe2e5);padding:6px 13px}.markdown-body table td>:first-child,.markdown-body table td>:only-child,.markdown-body table th>:first-child,.markdown-body table th>:only-child{margin-top:0 !important}.markdown-body table td>:last-child,.markdown-body table td>:only-child,.markdown-body table th>:last-child,.markdown-body table th>:only-child{margin-bottom:0 !important}.markdown-body table:not(.plain) tr:nth-child(2n){background-color:var(--table-stripe, #fbfcfd)}.markdown-body .rdmd-table{display:block;position:relative}.markdown-body .rdmd-table-inner{box-sizing:content-box;min-width:100%;overflow:auto;width:100%}.markdown-body .rdmd-table table{border:1px solid var(--table-edges, #dfe2e5)}.markdown-body .rdmd-table table:only-child{margin:0 !important}.markdown-body .rdmd-table table:only-child thead th{background:inherit}.markdown-body .rdmd-table table:only-child td:last-child,.markdown-body .rdmd-table table:only-child th:last-child{border-right:none}.markdown-body .rdmd-table table:only-child thead tr,.markdown-body .rdmd-table table:only-child thead th:last-child{box-shadow:3px 0 0 var(--table-head)}.toc-list .glossary-tooltip{pointer-events:none}.markdown-body{--font-size: 90%}.markdown-body code,.markdown-body kbd,.markdown-body pre{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-family:var(--md-code-font, SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace);font-size:1em}.markdown-body code,.markdown-body pre{font-size:12px}.markdown-body pre{margin-bottom:0;margin-top:0}.markdown-body code{background-color:#f6f8fa;background-color:var(--md-code-background, #f6f8fa);border-radius:3px;color:var(--md-code-text);font-size:var(--font-size);margin:0;padding:.2em .4em}.markdown-body code>div[class*=cm-]{display:inherit}.markdown-body pre{word-wrap:normal}.markdown-body pre>code{background:0 0;border:0;font-size:100%;margin:0;padding:0;white-space:pre;word-break:normal}.markdown-body pre{background-color:#f6f8fa;background-color:var(--md-code-background, #f6f8fa);color:inherit;color:var(--md-code-text, inherit);border-radius:3px;border-radius:var(--markdown-radius, 3px);border-radius:var(--md-code-radius, var(--markdown-radius, 3px));font-size:var(--font-size);line-height:1.45;overflow:auto;padding:1em}.markdown-body pre code.theme-dark{background-color:#242e34;background-color:var(--md-code-background, #242e34)}.markdown-body pre code{background-color:rgba(0,0,0,0);border:0;display:inline;line-height:inherit;margin:0;max-width:auto;overflow:visible;padding:0;word-wrap:normal}.markdown-body kbd{background-color:#f6f8fa;background-color:var(--d-code-background, #f6f8fa);border:1px solid #d1d5da;border-bottom-color:#c6cbd1;border-radius:3px;box-shadow:inset 0 -1px 0 #c6cbd1;color:#444d56;display:inline-block;font-size:11px;line-height:10px;padding:3px 5px;vertical-align:middle}.markdown-body button.rdmd-code-copy{display:none !important}.markdown-body button.rdmd-code-copy{-webkit-appearance:unset;margin:.5em .6em 0 0;padding:.25em .7em;cursor:copy;font:inherit;color:inherit;color:var(--md-code-text, inherit);border:none;border-radius:3px;outline:none !important;background:inherit;background:var(--md-code-background, inherit);box-shadow:inset 0 0 0 1px rgba(170,170,170,.66),-1px 2px 6px -3px rgba(0,0,0,.1);transition:.15s ease-out}.markdown-body button.rdmd-code-copy:not(:hover):before,.markdown-body button.rdmd-code-copy:not(:hover):after{opacity:.66}.markdown-body button.rdmd-code-copy:hover:not(:active){box-shadow:inset 0 0 0 1px rgba(139,139,139,.75),-1px 2px 6px -3px rgba(0,0,0,.2)}.markdown-body button.rdmd-code-copy:active{box-shadow:inset 0 0 0 1px rgba(139,139,139,.5),inset 1px 4px 6px -2px rgba(0,0,0,.175)}.markdown-body button.rdmd-code-copy:active:before,.markdown-body button.rdmd-code-copy:active:after{opacity:.75}.markdown-body button.rdmd-code-copy:before,.markdown-body button.rdmd-code-copy:after{display:inline-block;font:normal normal normal 1em/1 "Font Awesome 5 Free","FontAwesome";text-rendering:auto;-webkit-font-smoothing:antialiased;line-height:2;font-family:"ReadMe-Icons";font-variant-ligatures:discretionary-ligatures;font-feature-settings:"liga"}.markdown-body button.rdmd-code-copy:before{content:"";font-weight:800;transition:.3s .15s ease}.markdown-body button.rdmd-code-copy:after{content:"" !important;font-weight:900 !important;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%) scale(0.33);opacity:0 !important;transition:.3s 0s ease}.markdown-body button.rdmd-code-copy_copied{pointer-events:none}.markdown-body button.rdmd-code-copy_copied,.markdown-body button.rdmd-code-copy_copied *{color:green !important;color:var(--md-code-text, green) !important;opacity:1}.markdown-body button.rdmd-code-copy_copied:before{transition:.3s 0s ease;transform:scale(0.33);opacity:0 !important}.markdown-body button.rdmd-code-copy_copied:after{transition:.3s .15s ease;transform:translate(-50%, -50%) scale(1);opacity:1 !important}.markdown-body pre{position:relative}.markdown-body pre>code{background:inherit}.markdown-body pre>code.theme-dark{color:#fff}.markdown-body pre button.rdmd-code-copy{display:inline-block !important;position:absolute;right:0;top:0}.markdown-body pre{overflow:hidden;padding:0}.markdown-body pre>code{display:block !important;overflow:auto;padding:1em;max-height:90vh}.markdown-body pre:hover button.rdmd-code-copy:not(:hover){transition-delay:.4s}.markdown-body pre:not(:hover) button.rdmd-code-copy:not(.rdmd-code-copy_copied){opacity:0 !important}.CodeTabs{color:#333;color:var(--md-code-text, #333);border-radius:var(--md-code-radius, var(--markdown-radius, 3px)) !important;overflow:hidden}.CodeTabs.theme-dark{color:#fff;color:var(--md-code-text, white)}.CodeTabs.theme-dark .CodeTabs-toolbar{background:#373737;background:var(--md-code-tabs, #373737)}.CodeTabs-toolbar{background:#ebedef;background:var(--md-code-tabs, #ebedef);display:flex;flex-flow:row nowrap;overflow:hidden;overflow-x:auto;-ms-overflow-style:none;-webkit-overflow-scrolling:touch}.CodeTabs-toolbar::-webkit-scrollbar{display:none}.CodeTabs-toolbar button{white-space:nowrap;transition:.123s ease;-webkit-appearance:none;appearance:none;display:inline-block;line-height:2;padding:.5em 1em;border:none;background:rgba(0,0,0,0);outline:none;color:inherit;font:inherit;font-size:.75em;cursor:pointer}.CodeTabs.CodeTabs_initial .CodeTabs-toolbar button:first-child,.CodeTabs-toolbar button.CodeTabs_active{background:#f6f8fa;background:var(--md-code-background, #F6F8FA);color:#000;color:var(--md-code-text, black);pointer-events:none}.CodeTabs.theme-dark.CodeTabs_initial .CodeTabs-toolbar button:first-child,.CodeTabs.theme-dark .CodeTabs-toolbar button.CodeTabs_active{background:#242e34;background:var(--md-code-background, #242E34);color:#fff;color:var(--md-code-text, white)}.CodeTabs-toolbar button:not(.CodeTabs_active):hover{background:rgba(0,0,0,.075)}.CodeTabs pre{border-radius:0 0 var(--md-code-radius, var(--markdown-radius, 3px)) var(--md-code-radius, var(--markdown-radius, 3px)) !important;background:#f6f8fa;background:var(--md-code-background, #F6F8FA);margin-bottom:0}.CodeTabs pre:not(.CodeTabs_active){display:none}.CodeTabs.theme-dark pre{background:#242e34;background:var(--md-code-background, #242E34)}.CodeTabs.CodeTabs_initial pre:first-child{display:block}.callout{--emoji: 1em;--icon-font: FontAwesome;border-top-right-radius:var(--markdown-radius);border-bottom-right-radius:var(--markdown-radius)}.callout.callout{--background: #f8f8f9;--border: #8b939c}.callout.callout{background:var(--background);border-color:var(--border);color:var(--text);padding:1.33rem}.callout.callout_info{--background: #e3edf2;--title: #46b8da;--border: #5bc0de}.callout.callout_warn,.callout.callout_warning{--background: #fcf8f2;--title: #eea236;--border: #f0ad4e}.callout.callout_ok,.callout.callout_okay,.callout.callout_success{--background: #f3f8f3;--title: #489e49;--border: #50af51}.callout.callout_err,.callout.callout_error{--background: #fdf7f7;--title: #d43f3a;--border: #d9534f}.callout.callout>*{margin-left:1.33rem;position:relative}.callout.callout ul,.callout.callout ol{padding-left:1.3em}.callout.callout a{color:inherit}.callout.callout hr{border-color:var(--border, var(--markdown-edge, #eee))}.callout.callout blockquote{color:var(--text);border-color:var(--border);border-width:3px;padding:0 0 0 .8em}.callout.callout .callout-heading{color:var(--title, --text);margin-bottom:calc(1.33rem*.5)}.callout.callout .callout-heading:only-child{margin-bottom:0}.callout.callout .callout-heading.empty{float:left;margin-top:calc(1.33rem*.5)}.callout.callout .callout-heading.empty .callout-icon{line-height:0}.callout.callout .callout-heading>*{color:inherit;margin:0}.callout.callout .callout-heading:before{position:absolute;right:100%;width:2.4em;text-align:center;font:normal normal normal 1em/1 FontAwesome}.callout.callout .callout-icon{float:left;margin-left:calc(-1.33rem - .5em);margin-right:-0.25rem}.callout-icon{font-size:var(--emoji, 0);color:var(--icon-color, inherit) !important}.callout-icon:before{content:var(--icon);font-family:var(--icon-font);font-size:var(--icon-size, 1rem);font-weight:var(--icon-weight, 400);position:absolute;top:50%;transform:translate(-50%, -50%);display:inline-block;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.rdmdCallouts--useIconFont .callout{--emoji: unset}.rdmdCallouts--useIconFont .callout_okay{--icon: ""}.rdmdCallouts--useIconFont .callout_info{--icon: ""}.rdmdCallouts--useIconFont .callout_warn{--icon: ""}.rdmdCallouts--useIconFont .callout_error{--icon: ""}.rdmdCallouts--useIconFont .callout_default{--emoji: 1rem}.heading.heading{display:flex;justify-content:flex-start;align-items:center;position:relative}.heading.heading .heading-text{flex:1 100%}.heading.heading .heading-anchor-deprecated{position:absolute;top:0}.heading.heading .heading-anchor{top:-1rem !important}.heading.heading .heading-anchor,.heading.heading .heading-anchor-icon{position:absolute !important;display:inline !important;order:-1;right:100%;top:unset !important;margin-right:-0.8rem;padding:.8rem .2rem .8rem 0 !important;font-size:.8rem !important;text-decoration:none;color:inherit;transform:translateX(-100%);transition:.2s ease}.heading.heading .heading-anchor:hover,.heading.heading .heading-anchor-icon:hover{opacity:1}.heading.heading:not(:hover) .heading-anchor-icon{opacity:0}.markdown-body .embed{padding:15px;color:var(--md-code-text, inherit);border-radius:var(--md-code-radius, var(--markdown-radius, 3px));border-radius:3px;background:rgba(0,0,0,0);box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);transition:.3s ease}.markdown-body .embed:hover{background:var(--md-code-background, #f6f8fa);box-shadow:inset 0 0 0 1px rgba(0,0,0,.1)}.markdown-body>.embed_hasImg:nth-of-type(odd){margin-right:30px;padding-right:0}.markdown-body>.embed_hasImg:nth-of-type(odd) .embed-link{flex-direction:row-reverse}.markdown-body>.embed_hasImg:nth-of-type(odd) .embed-img{margin-left:.88em;margin-right:-30px;box-shadow:-0.3em .3em .9em -0.3em rgba(0,0,0,.15)}.markdown-body>.embed_hasImg:nth-of-type(even){margin-left:30px;padding-left:0}.markdown-body>.embed_hasImg:nth-of-type(even) .embed-img{margin-left:-30px}.markdown-body .embed:empty{display:none}.markdown-body .embed-media{display:flex;justify-content:center}.markdown-body .embed-media>:only-child{flex:1;margin:-15px;border-radius:0 !important}.markdown-body .embed-link{display:flex;align-items:center;color:var(--markdown-text, #333);text-decoration:none !important}.markdown-body .embed-body{flex:1;line-height:1.3}.markdown-body .embed-body,.markdown-body .embed-body .embed-title{font-size:1.15em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.markdown-body .embed-body .embed-provider{display:block;text-decoration-color:rgba(0,0,0,0) !important;opacity:.88}.markdown-body .embed-body-url{opacity:.75}.markdown-body .embed-provider{font-size:.8em;line-height:1.6;transition:.2 ease}.markdown-body .embed-provider code:only-child{display:block;width:100%;font-size:1.15em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;background:rgba(0,0,0,0);margin:0;padding:0;font-size:inherit !important}.markdown-body .embed-provider code{opacity:.8}.markdown-body .embed-img{width:5em;max-width:5em;margin:0 .88em 0 0;padding:4px;background:#fff;border:1px solid rgba(0,0,0,.15);border-radius:3px;transition:inherit;box-shadow:.3em .3em .9em -0.3em rgba(0,0,0,.15)}.markdown-body .embed:not(:hover) .embed-img{box-shadow:0 .25em 1em -0.5em rgba(0,0,0,.133)}.markdown-body .embed:hover .embed-img{border:1px solid rgba(0,0,0,.2)}.markdown-body .embed-favicon{width:12px !important;height:12px !important;margin-top:4px;margin-right:6px;margin-bottom:12px}.GlossaryItem-trigger{border-bottom:1px solid #737c83;border-style:dotted;border-top:none;border-left:none;border-right:none;cursor:pointer}.GlossaryItem-tooltip-content{--Glossary-bg: var(--color-bg-page, var(--white));--Glossary-color: var(--color-text-default, var(--gray20));--Glossary-shadow: var( --box-shadow-menu-light, 0 5px 10px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.025), 0 1px 3px rgba(0, 0, 0, 0.025) );background-color:var(--Glossary-bg);border:1px solid var(--color-border-default, rgba(0, 0, 0, 0.1));border-radius:var(--border-radius);box-shadow:var(--Glossary-shadow);color:var(--Glossary-color);font-size:15px;font-weight:400;line-height:1.5;padding:15px;text-align:left;width:350px}[data-color-mode=dark] .GlossaryItem-tooltip-content{--Glossary-bg: var(--gray15);--Glossary-color: var(--color-text-default, var(--white));--Glossary-shadow: var( --box-shadow-menu-dark, 0 1px 3px rgba(0, 0, 0, 0.025), 0 2px 6px rgba(0, 0, 0, 0.025), 0 5px 10px rgba(0, 0, 0, 0.05) )}@media(prefers-color-scheme: dark){[data-color-mode=auto] .GlossaryItem-tooltip-content{--Glossary-bg: var(--Tooltip-bg, var(--gray0));--Glossary-color: var(--color-text-default, var(--white));--Glossary-shadow: var( --box-shadow-menu-dark, 0 1px 3px rgba(0, 0, 0, 0.025), 0 2px 6px rgba(0, 0, 0, 0.025), 0 5px 10px rgba(0, 0, 0, 0.05) )}}.GlossaryItem-term{font-style:italic}.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}:root{--markdown-text: inherit;--markdown-title: inherit;--markdown-title-font: inherit;--markdown-font: inherit;--markdown-font-size: inherit;--markdown-line-height: 1.5}.field-description,.markdown-body{color:var(--markdown-text);font-family:var(--markdown-font);line-height:var(--markdown-line-height);position:relative;text-size-adjust:100%;word-wrap:break-word;font-size:var(--markdown-font-size, 14px)}.field-description::before,.field-description::after,.markdown-body::before,.markdown-body::after{content:"";display:table}.field-description::after,.markdown-body::after{clear:both}.field-description ul,.markdown-body ul{list-style:initial}.field-description .anchor,.markdown-body .anchor{float:left;line-height:1;margin-left:-20px;padding-right:4px}.field-description .anchor:focus,.markdown-body .anchor:focus{outline:0}.field-description h1:hover .anchor,.field-description h2:hover .anchor,.field-description h3:hover .anchor,.field-description h4:hover .anchor,.field-description h5:hover .anchor,.field-description h6:hover .anchor,.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.field-description details,.markdown-body details{display:block}.field-description summary,.markdown-body summary{display:list-item}.field-description a,.markdown-body a{transition:.15s ease}.field-description a:hover,.markdown-body a:hover{text-decoration:underline}.field-description a:active,.field-description a:hover,.markdown-body a:active,.markdown-body a:hover{outline-width:0}.field-description a:not([href]),.markdown-body a:not([href]){color:inherit;text-decoration:none}.field-description strong,.markdown-body strong{font-weight:inherit;font-weight:bolder}.field-description h1,.markdown-body h1{font-size:2em;margin:.67em 0}.field-description hr,.markdown-body hr{background:rgba(0,0,0,0);border-bottom:1px solid var(--markdown-edge, #dfe2e5);border-width:0 0 1px;box-sizing:content-box;height:0;margin:15px 0;overflow:hidden}.field-description hr::before,.field-description hr::after,.markdown-body hr::before,.markdown-body hr::after{content:"";display:table}.field-description hr::after,.markdown-body hr::after{clear:both}.field-description input,.markdown-body input{font:inherit;margin:0}.field-description input,.markdown-body input{overflow:visible}.field-description [type=checkbox],.markdown-body [type=checkbox]{box-sizing:border-box;padding:0}.field-description *,.markdown-body *{box-sizing:border-box}.field-description input,.markdown-body input{font-family:inherit;font-size:inherit;line-height:inherit}.field-description strong,.markdown-body strong{font-weight:600}.field-description details summary,.markdown-body details summary{cursor:pointer}.field-description h1,.field-description h2,.field-description h3,.field-description h4,.field-description h5,.field-description h6,.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{color:var(--markdown-title);font-family:var(--markdown-title-font);font-size:var(--markdown-title-size);font-weight:var(--markdown-title-weight, 600);line-height:1.25;margin-bottom:var(--markdown-title-marginBottom, 1rem);margin-top:var(--markdown-title-marginTop, 1em)}.field-description h1,.markdown-body h1{font-size:1.75em;font-size:var(--markdown-title-size, 1.75em)}.field-description h2,.markdown-body h2{font-size:1.5em;font-size:var(--markdown-title-size, 1.5em)}.field-description h1,.markdown-body h1{font-weight:700;font-weight:var(--markdown-title-weight, 700)}.field-description h2,.markdown-body h2{font-weight:600;font-weight:var(--markdown-title-weight, 600)}.field-description h3,.field-description h4,.markdown-body h3,.markdown-body h4{font-weight:600;font-weight:var(--markdown-title-weight, 600)}.field-description h3,.markdown-body h3{font-size:1.25em;font-size:var(--markdown-title-size, 1.25em)}.field-description h4,.markdown-body h4{font-size:1em;font-size:var(--markdown-title-size, 1em)}.field-description h5,.field-description h6,.markdown-body h5,.markdown-body h6{font-weight:600;font-weight:var(--markdown-title-weight, 600)}.field-description h5,.markdown-body h5{font-size:.875em;font-size:var(--markdown-title-size, 0.875em)}.field-description h6,.markdown-body h6{color:var(--markdown-title, #6a737d);font-size:.85em;font-size:var(--markdown-title-size, 0.85em)}.field-description p,.field-description .p,.markdown-body p,.markdown-body .p{margin-bottom:10px;margin-top:0}.field-description blockquote,.markdown-body blockquote{margin:0}.field-description ol,.field-description ul,.markdown-body ol,.markdown-body ul{margin-bottom:0;margin-top:0;padding-left:0}.field-description ol ol,.field-description ul ol,.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.field-description ol ol ol,.field-description ol ul ol,.field-description ul ol ol,.field-description ul ul ol,.markdown-body ol ol ol,.markdown-body ol ul ol,.markdown-body ul ol ol,.markdown-body ul ul ol{list-style-type:lower-alpha}.field-description dd,.markdown-body dd{margin-left:0}.field-description input::-webkit-inner-spin-button,.field-description input::-webkit-outer-spin-button,.markdown-body input::-webkit-inner-spin-button,.markdown-body input::-webkit-outer-spin-button{appearance:none;appearance:none;margin:0}.field-description>:first-child,.markdown-body>:first-child{margin-top:0 !important}.field-description>:last-child,.markdown-body>:last-child{margin-bottom:0 !important}.field-description blockquote,.field-description dl,.field-description ol,.field-description p,.field-description pre,.field-description table,.field-description ul,.markdown-body blockquote,.markdown-body dl,.markdown-body ol,.markdown-body p,.markdown-body pre,.markdown-body table,.markdown-body ul{margin-bottom:15px;margin-top:0}.field-description blockquote,.markdown-body blockquote{border-left:.25em solid #dfe2e5;color:#6a737d;display:block;padding:0 1em}.field-description blockquote>:first-child,.markdown-body blockquote>:first-child{margin-top:0}.field-description blockquote>:last-child,.markdown-body blockquote>:last-child{margin-bottom:0}.field-description ol,.field-description ul,.markdown-body ol,.markdown-body ul{padding-left:2em}.field-description ol ol,.field-description ol ul,.field-description ul ol,.field-description ul ul,.markdown-body ol ol,.markdown-body ol ul,.markdown-body ul ol,.markdown-body ul ul{margin-bottom:0;margin-top:0}.field-description li,.markdown-body li{clear:both;word-wrap:break-all}.field-description li>p,.markdown-body li>p{margin-top:1em}.field-description li+li,.markdown-body li+li{margin-top:.25em}.field-description dl,.markdown-body dl{padding:0}.field-description dl dt,.markdown-body dl dt{font-size:1em;font-style:italic;font-weight:600;margin-top:1em;padding:0}.field-description dl dd,.markdown-body dl dd{margin-bottom:1em;padding:0 1em}.field-description :checked+.radio-label,.markdown-body :checked+.radio-label{border-color:var(--project-color-primary);position:relative;z-index:1}.field-description .task-list-item,.markdown-body .task-list-item{list-style-type:none}.field-description .task-list-item+.task-list-item,.markdown-body .task-list-item+.task-list-item{margin-top:3px}.field-description .task-list-item input,.markdown-body .task-list-item input{margin:0 .2em .25em -1.6em;vertical-align:middle}.field-description p.blank-line,.markdown-body p.blank-line{height:1.5em}.field-description h5,.field-description h6,.markdown-body h5,.markdown-body h6{font-size:.9em}.field-description blockquote h1:last-child,.field-description blockquote h2:last-child,.markdown-body blockquote h1:last-child,.markdown-body blockquote h2:last-child{border-bottom:0}.field-description>*,.markdown-body>*{margin-bottom:15px !important;margin-top:15px}.field-description .task-list-item input,.markdown-body .task-list-item input{margin:0 .5em .25em -1.25em}.field-description a[href],.field-description a:not([href=""]),.markdown-body a[href],.markdown-body a:not([href=""]){text-decoration:underline}
package/dist/main.js CHANGED
@@ -14398,8 +14398,9 @@ const extractScripts = (html = '') => {
14398
14398
  const cleaned = html.replace(MATCH_SCRIPT_TAGS, '');
14399
14399
  return [cleaned, () => scripts.map(js => window.eval(js))];
14400
14400
  };
14401
- const HTMLBlock = ({ children = '', runScripts = false, safeMode = false }) => {
14401
+ const HTMLBlock = ({ children = '', runScripts, safeMode = false }) => {
14402
14402
  let html = children;
14403
+ runScripts = typeof runScripts !== 'boolean' ? (runScripts === 'true' ? true : false) : runScripts;
14403
14404
  if (typeof html !== 'string')
14404
14405
  html = (0,server_browser/* renderToStaticMarkup */.qV)(html);
14405
14406
  const [cleanedHtml, exec] = extractScripts(html);
@@ -65576,29 +65577,121 @@ const injectComponents = (opts) => () => tree => {
65576
65577
  /* harmony default export */ const inject_components = (injectComponents);
65577
65578
 
65578
65579
  ;// CONCATENATED MODULE: ./processor/utils.ts
65580
+ /**
65581
+ * Formats the hProperties of a node as a string, so they can be compiled back into JSX/MDX.
65582
+ * This currently sets all the values to a string since we process/compile the MDX on the fly
65583
+ * through the editor, and it'll throw errors over malformed JSX. TODO: fix this.
65584
+ *
65585
+ * @template T
65586
+ * @param {Node} node
65587
+ * @returns {string} formatted hProperties as JSX attributes
65588
+ */
65579
65589
  const formatHProps = (node) => {
65580
65590
  const hProps = getHProps(node);
65581
65591
  const hPropKeys = getHPropKeys(node);
65582
65592
  return hPropKeys.map(key => `${key}="${hProps[key]}"`).join(' ');
65583
65593
  };
65594
+ /**
65595
+ * Returns the hProperties of a node.
65596
+ *
65597
+ * @template T
65598
+ * @param {Node} node
65599
+ * @returns {T} hProperties
65600
+ */
65584
65601
  const getHProps = (node) => {
65585
65602
  var _a;
65586
65603
  const hProps = ((_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties) || {};
65587
65604
  return hProps;
65588
65605
  };
65606
+ /**
65607
+ * Returns array of hProperty keys.
65608
+ *
65609
+ * @template T
65610
+ * @param {Node} node
65611
+ * @returns {Array} array of hProperty keys
65612
+ */
65589
65613
  const getHPropKeys = (node) => {
65590
65614
  const hProps = getHProps(node);
65591
65615
  return Object.keys(hProps) || [];
65592
65616
  };
65617
+ /**
65618
+ * Gets the attributes of an MDX element and returns them as an object of hProperties.
65619
+ *
65620
+ * @template T
65621
+ * @param {(MdxJsxFlowElement | MdxJsxTextElement)} jsx
65622
+ * @returns {T} object of hProperties
65623
+ */
65593
65624
  const getAttrs = (jsx) => jsx.attributes.reduce((memo, attr) => {
65594
65625
  if ('name' in attr) {
65595
65626
  memo[attr.name] = attr.value;
65596
65627
  }
65597
65628
  return memo;
65598
65629
  }, {});
65630
+ /**
65631
+ * Gets the children of an MDX element and returns them as an array of Text nodes.
65632
+ * Currently only being used by the HTML Block component, which only expects a single text node.
65633
+ *
65634
+ * @template T
65635
+ * @param {(MdxJsxFlowElement | MdxJsxTextElement)} jsx
65636
+ * @returns {Array} array of child text nodes
65637
+ */
65638
+ const getChildren = (jsx) => jsx.children.reduce((memo, child, i) => {
65639
+ memo[i] = {
65640
+ type: 'text',
65641
+ value: child.value,
65642
+ position: child.position,
65643
+ };
65644
+ return memo;
65645
+ }, []);
65646
+ /**
65647
+ * Tests if a node is an MDX element.
65648
+ * TODO: Make this more extensible to all types of nodes. isElement(node, 'type' or ['type1', 'type2']), say
65649
+ *
65650
+ * @param {Node} node
65651
+ * @returns {(node is MdxJsxFlowElement | MdxJsxTextElement)}
65652
+ */
65599
65653
  const isMDXElement = (node) => {
65600
65654
  return ['mdxJsxFlowElement', 'mdxJsxTextElement'].includes(node.type);
65601
65655
  };
65656
+ /**
65657
+ * Takes an HTML string and formats it for display in the editor. Removes leading/trailing newlines
65658
+ * and unindents the HTML.
65659
+ *
65660
+ * @param {string} html
65661
+ * @returns {string} formatted HTML
65662
+ */
65663
+ const formatHTML = (html) => {
65664
+ // Remove leading/trailing backticks if present, since they're used to keep the HTML
65665
+ // from being parsed prematurely
65666
+ if (html.startsWith('`') && html.endsWith('`')) {
65667
+ html = html.slice(1, -1);
65668
+ }
65669
+ // Removes the leading/trailing newlines
65670
+ const cleaned = html.replace(/^\s*\n|\n\s*$/g, '');
65671
+ // // Get the number of spaces in the first line to determine the tab size
65672
+ // const tab = cleaned.match(/^\s*/)[0].length;
65673
+ // // Remove the first indentation level from each line
65674
+ // const tabRegex = new RegExp(`^\\s{${tab}}`, 'gm');
65675
+ // const unindented = cleaned.replace(tabRegex, '');
65676
+ return cleaned;
65677
+ };
65678
+ /**
65679
+ * Reformat HTML for the markdown/mdx by adding an indentation to each line. This assures that the
65680
+ * HTML is indentend properly within the HTMLBlock component when rendered in the markdown/mdx.
65681
+ *
65682
+ * @param {string} html
65683
+ * @param {number} [indent=2]
65684
+ * @returns {string} re-formatted HTML
65685
+ */
65686
+ const reformatHTML = (html, indent = 2) => {
65687
+ // Remove leading/trailing newlines
65688
+ const cleaned = html.replace(/^\s*\n|\n\s*$/g, '');
65689
+ // // Create a tab/indent with the specified number of spaces
65690
+ // const tab = ' '.repeat(indent);
65691
+ // // Indent each line of the HTML (converts to an array, indents each line, then joins back)
65692
+ // const indented = cleaned.split('\n').map((line: string) => `${tab}${line}`).join('\n');
65693
+ return cleaned;
65694
+ };
65602
65695
 
65603
65696
  ;// CONCATENATED MODULE: ./processor/transform/readme-components.ts
65604
65697
 
@@ -65611,6 +65704,7 @@ const readme_components_types = {
65611
65704
  EmbedBlock: NodeTypes['embed-block'],
65612
65705
  Glossary: NodeTypes['glossary'],
65613
65706
  ImageBlock: NodeTypes['image-block'],
65707
+ HTMLBlock: NodeTypes.htmlBlock,
65614
65708
  Table: 'table',
65615
65709
  Variable: NodeTypes['variable'],
65616
65710
  td: 'tableCell',
@@ -65652,6 +65746,22 @@ const coerceJsxToMd = ({ components = {} } = {}) => (node, index, parent) => {
65652
65746
  };
65653
65747
  parent.children[index] = mdNode;
65654
65748
  }
65749
+ else if (node.name === 'HTMLBlock') {
65750
+ const { position } = node;
65751
+ const children = getChildren(node);
65752
+ const { runScripts } = getAttrs(node);
65753
+ const html = formatHTML(children.map(({ value }) => value).join(''));
65754
+ const mdNode = {
65755
+ position,
65756
+ children: [{ type: 'text', value: html }],
65757
+ type: NodeTypes.htmlBlock,
65758
+ data: {
65759
+ hName: 'html-block',
65760
+ hProperties: Object.assign(Object.assign({}, (runScripts && { runScripts })), { html }),
65761
+ },
65762
+ };
65763
+ parent.children[index] = mdNode;
65764
+ }
65655
65765
  else if (node.name === 'Table') {
65656
65766
  const { children, position } = node;
65657
65767
  const { align = [...new Array(node.children.length)].map(() => null) } = getAttrs(node);
@@ -93460,11 +93570,12 @@ const gemoji_gemoji = (node) => `:${node.name}:`;
93460
93570
  /* harmony default export */ const compile_gemoji = (gemoji_gemoji);
93461
93571
 
93462
93572
  ;// CONCATENATED MODULE: ./processor/compile/html-block.ts
93573
+
93463
93574
  const htmlBlock = (node) => {
93464
- var _a;
93465
- const html = node.data.hProperties.html;
93466
- const attributes = Object.keys((_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties).map(key => { var _a; return `${key}="${(_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties[key]}"`; }).join(' ');
93467
- return `<HTMLBlock${attributes && ' ' + attributes}>{\`${html}\`}</HTMLBlock>`;
93575
+ const { runScripts, html } = getHProps(node);
93576
+ return `<HTMLBlock${runScripts != null ? ` runScripts="${runScripts}"` : ''}>{\`
93577
+ ${reformatHTML(html)}
93578
+ \`}</HTMLBlock>`;
93468
93579
  };
93469
93580
  /* harmony default export */ const html_block = (htmlBlock);
93470
93581
 
@@ -94471,7 +94582,7 @@ const makeUseMDXComponents = (more = {}) => {
94471
94582
  map[`h${index + 1}`] = components_Heading((index + 1));
94472
94583
  return map;
94473
94584
  }, {});
94474
- const components = Object.assign(Object.assign(Object.assign(Object.assign({}, components_namespaceObject), { Variable: (variable_default()), code: components_Code, embed: components_Embed, img: components_Image, table: components_Table, 'code-tabs': components_CodeTabs, 'html-block': components_HTMLBlock, 'embed-block': components_Embed, 'image-block': components_Image, 'table-of-contents': components_TableOfContents }), headings), more);
94585
+ const components = Object.assign(Object.assign(Object.assign(Object.assign({}, components_namespaceObject), { Variable: (variable_default()), code: components_Code, embed: components_Embed, img: components_Image, table: components_Table, 'code-tabs': components_CodeTabs, 'embed-block': components_Embed, 'html-block': components_HTMLBlock, 'image-block': components_Image, 'table-of-contents': components_TableOfContents }), headings), more);
94475
94586
  return () => components;
94476
94587
  };
94477
94588
  const run_run = async (string, _opts = {}) => {
package/dist/main.node.js CHANGED
@@ -14288,8 +14288,9 @@ const extractScripts = (html = '') => {
14288
14288
  const cleaned = html.replace(MATCH_SCRIPT_TAGS, '');
14289
14289
  return [cleaned, () => scripts.map(js => window.eval(js))];
14290
14290
  };
14291
- const HTMLBlock = ({ children = '', runScripts = false, safeMode = false }) => {
14291
+ const HTMLBlock = ({ children = '', runScripts, safeMode = false }) => {
14292
14292
  let html = children;
14293
+ runScripts = typeof runScripts !== 'boolean' ? (runScripts === 'true' ? true : false) : runScripts;
14293
14294
  if (typeof html !== 'string')
14294
14295
  html = (0,server_namespaceObject.renderToStaticMarkup)(html);
14295
14296
  const [cleanedHtml, exec] = extractScripts(html);
@@ -67029,29 +67030,121 @@ const injectComponents = (opts) => () => tree => {
67029
67030
  /* harmony default export */ const inject_components = (injectComponents);
67030
67031
 
67031
67032
  ;// CONCATENATED MODULE: ./processor/utils.ts
67033
+ /**
67034
+ * Formats the hProperties of a node as a string, so they can be compiled back into JSX/MDX.
67035
+ * This currently sets all the values to a string since we process/compile the MDX on the fly
67036
+ * through the editor, and it'll throw errors over malformed JSX. TODO: fix this.
67037
+ *
67038
+ * @template T
67039
+ * @param {Node} node
67040
+ * @returns {string} formatted hProperties as JSX attributes
67041
+ */
67032
67042
  const formatHProps = (node) => {
67033
67043
  const hProps = getHProps(node);
67034
67044
  const hPropKeys = getHPropKeys(node);
67035
67045
  return hPropKeys.map(key => `${key}="${hProps[key]}"`).join(' ');
67036
67046
  };
67047
+ /**
67048
+ * Returns the hProperties of a node.
67049
+ *
67050
+ * @template T
67051
+ * @param {Node} node
67052
+ * @returns {T} hProperties
67053
+ */
67037
67054
  const getHProps = (node) => {
67038
67055
  var _a;
67039
67056
  const hProps = ((_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties) || {};
67040
67057
  return hProps;
67041
67058
  };
67059
+ /**
67060
+ * Returns array of hProperty keys.
67061
+ *
67062
+ * @template T
67063
+ * @param {Node} node
67064
+ * @returns {Array} array of hProperty keys
67065
+ */
67042
67066
  const getHPropKeys = (node) => {
67043
67067
  const hProps = getHProps(node);
67044
67068
  return Object.keys(hProps) || [];
67045
67069
  };
67070
+ /**
67071
+ * Gets the attributes of an MDX element and returns them as an object of hProperties.
67072
+ *
67073
+ * @template T
67074
+ * @param {(MdxJsxFlowElement | MdxJsxTextElement)} jsx
67075
+ * @returns {T} object of hProperties
67076
+ */
67046
67077
  const getAttrs = (jsx) => jsx.attributes.reduce((memo, attr) => {
67047
67078
  if ('name' in attr) {
67048
67079
  memo[attr.name] = attr.value;
67049
67080
  }
67050
67081
  return memo;
67051
67082
  }, {});
67083
+ /**
67084
+ * Gets the children of an MDX element and returns them as an array of Text nodes.
67085
+ * Currently only being used by the HTML Block component, which only expects a single text node.
67086
+ *
67087
+ * @template T
67088
+ * @param {(MdxJsxFlowElement | MdxJsxTextElement)} jsx
67089
+ * @returns {Array} array of child text nodes
67090
+ */
67091
+ const utils_getChildren = (jsx) => jsx.children.reduce((memo, child, i) => {
67092
+ memo[i] = {
67093
+ type: 'text',
67094
+ value: child.value,
67095
+ position: child.position,
67096
+ };
67097
+ return memo;
67098
+ }, []);
67099
+ /**
67100
+ * Tests if a node is an MDX element.
67101
+ * TODO: Make this more extensible to all types of nodes. isElement(node, 'type' or ['type1', 'type2']), say
67102
+ *
67103
+ * @param {Node} node
67104
+ * @returns {(node is MdxJsxFlowElement | MdxJsxTextElement)}
67105
+ */
67052
67106
  const isMDXElement = (node) => {
67053
67107
  return ['mdxJsxFlowElement', 'mdxJsxTextElement'].includes(node.type);
67054
67108
  };
67109
+ /**
67110
+ * Takes an HTML string and formats it for display in the editor. Removes leading/trailing newlines
67111
+ * and unindents the HTML.
67112
+ *
67113
+ * @param {string} html
67114
+ * @returns {string} formatted HTML
67115
+ */
67116
+ const formatHTML = (html) => {
67117
+ // Remove leading/trailing backticks if present, since they're used to keep the HTML
67118
+ // from being parsed prematurely
67119
+ if (html.startsWith('`') && html.endsWith('`')) {
67120
+ html = html.slice(1, -1);
67121
+ }
67122
+ // Removes the leading/trailing newlines
67123
+ const cleaned = html.replace(/^\s*\n|\n\s*$/g, '');
67124
+ // // Get the number of spaces in the first line to determine the tab size
67125
+ // const tab = cleaned.match(/^\s*/)[0].length;
67126
+ // // Remove the first indentation level from each line
67127
+ // const tabRegex = new RegExp(`^\\s{${tab}}`, 'gm');
67128
+ // const unindented = cleaned.replace(tabRegex, '');
67129
+ return cleaned;
67130
+ };
67131
+ /**
67132
+ * Reformat HTML for the markdown/mdx by adding an indentation to each line. This assures that the
67133
+ * HTML is indentend properly within the HTMLBlock component when rendered in the markdown/mdx.
67134
+ *
67135
+ * @param {string} html
67136
+ * @param {number} [indent=2]
67137
+ * @returns {string} re-formatted HTML
67138
+ */
67139
+ const reformatHTML = (html, indent = 2) => {
67140
+ // Remove leading/trailing newlines
67141
+ const cleaned = html.replace(/^\s*\n|\n\s*$/g, '');
67142
+ // // Create a tab/indent with the specified number of spaces
67143
+ // const tab = ' '.repeat(indent);
67144
+ // // Indent each line of the HTML (converts to an array, indents each line, then joins back)
67145
+ // const indented = cleaned.split('\n').map((line: string) => `${tab}${line}`).join('\n');
67146
+ return cleaned;
67147
+ };
67055
67148
 
67056
67149
  ;// CONCATENATED MODULE: ./processor/transform/readme-components.ts
67057
67150
 
@@ -67064,6 +67157,7 @@ const readme_components_types = {
67064
67157
  EmbedBlock: NodeTypes['embed-block'],
67065
67158
  Glossary: NodeTypes['glossary'],
67066
67159
  ImageBlock: NodeTypes['image-block'],
67160
+ HTMLBlock: NodeTypes.htmlBlock,
67067
67161
  Table: 'table',
67068
67162
  Variable: NodeTypes['variable'],
67069
67163
  td: 'tableCell',
@@ -67105,6 +67199,22 @@ const coerceJsxToMd = ({ components = {} } = {}) => (node, index, parent) => {
67105
67199
  };
67106
67200
  parent.children[index] = mdNode;
67107
67201
  }
67202
+ else if (node.name === 'HTMLBlock') {
67203
+ const { position } = node;
67204
+ const children = utils_getChildren(node);
67205
+ const { runScripts } = getAttrs(node);
67206
+ const html = formatHTML(children.map(({ value }) => value).join(''));
67207
+ const mdNode = {
67208
+ position,
67209
+ children: [{ type: 'text', value: html }],
67210
+ type: NodeTypes.htmlBlock,
67211
+ data: {
67212
+ hName: 'html-block',
67213
+ hProperties: Object.assign(Object.assign({}, (runScripts && { runScripts })), { html }),
67214
+ },
67215
+ };
67216
+ parent.children[index] = mdNode;
67217
+ }
67108
67218
  else if (node.name === 'Table') {
67109
67219
  const { children, position } = node;
67110
67220
  const { align = [...new Array(node.children.length)].map(() => null) } = getAttrs(node);
@@ -94913,11 +95023,12 @@ const gemoji_gemoji = (node) => `:${node.name}:`;
94913
95023
  /* harmony default export */ const compile_gemoji = (gemoji_gemoji);
94914
95024
 
94915
95025
  ;// CONCATENATED MODULE: ./processor/compile/html-block.ts
95026
+
94916
95027
  const htmlBlock = (node) => {
94917
- var _a;
94918
- const html = node.data.hProperties.html;
94919
- const attributes = Object.keys((_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties).map(key => { var _a; return `${key}="${(_a = node.data) === null || _a === void 0 ? void 0 : _a.hProperties[key]}"`; }).join(' ');
94920
- return `<HTMLBlock${attributes && ' ' + attributes}>{\`${html}\`}</HTMLBlock>`;
95028
+ const { runScripts, html } = getHProps(node);
95029
+ return `<HTMLBlock${runScripts != null ? ` runScripts="${runScripts}"` : ''}>{\`
95030
+ ${reformatHTML(html)}
95031
+ \`}</HTMLBlock>`;
94921
95032
  };
94922
95033
  /* harmony default export */ const html_block = (htmlBlock);
94923
95034
 
@@ -95924,7 +96035,7 @@ const makeUseMDXComponents = (more = {}) => {
95924
96035
  map[`h${index + 1}`] = components_Heading((index + 1));
95925
96036
  return map;
95926
96037
  }, {});
95927
- const components = Object.assign(Object.assign(Object.assign(Object.assign({}, components_namespaceObject), { Variable: (dist_default()), code: components_Code, embed: components_Embed, img: components_Image, table: components_Table, 'code-tabs': components_CodeTabs, 'html-block': components_HTMLBlock, 'embed-block': components_Embed, 'image-block': components_Image, 'table-of-contents': components_TableOfContents }), headings), more);
96038
+ const components = Object.assign(Object.assign(Object.assign(Object.assign({}, components_namespaceObject), { Variable: (dist_default()), code: components_Code, embed: components_Embed, img: components_Image, table: components_Table, 'code-tabs': components_CodeTabs, 'embed-block': components_Embed, 'html-block': components_HTMLBlock, 'image-block': components_Image, 'table-of-contents': components_TableOfContents }), headings), more);
95928
96039
  return () => components;
95929
96040
  };
95930
96041
  const run_run = async (string, _opts = {}) => {
@@ -1,7 +1,70 @@
1
1
  import { Node } from 'mdast';
2
2
  import { MdxJsxFlowElement, MdxJsxTextElement } from 'mdast-util-mdx';
3
- export declare const formatHProps: <T>(node: Node) => T;
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
+ * Returns the hProperties of a node.
15
+ *
16
+ * @template T
17
+ * @param {Node} node
18
+ * @returns {T} hProperties
19
+ */
4
20
  export declare const getHProps: <T>(node: Node) => T;
5
- export declare const getHPropKeys: <T>(node: Node) => string[] | T;
6
- export declare const getAttrs: <T>(jsx: MdxJsxFlowElement | MdxJsxTextElement) => T;
21
+ /**
22
+ * Returns array of hProperty keys.
23
+ *
24
+ * @template T
25
+ * @param {Node} node
26
+ * @returns {Array} array of hProperty keys
27
+ */
28
+ export declare const getHPropKeys: <T>(node: Node) => any;
29
+ /**
30
+ * Gets the attributes of an MDX element and returns them as an object of hProperties.
31
+ *
32
+ * @template T
33
+ * @param {(MdxJsxFlowElement | MdxJsxTextElement)} jsx
34
+ * @returns {T} object of hProperties
35
+ */
36
+ export declare const getAttrs: <T>(jsx: MdxJsxFlowElement | MdxJsxTextElement) => any;
37
+ /**
38
+ * Gets the children of an MDX element and returns them as an array of Text nodes.
39
+ * Currently only being used by the HTML Block component, which only expects a single text node.
40
+ *
41
+ * @template T
42
+ * @param {(MdxJsxFlowElement | MdxJsxTextElement)} jsx
43
+ * @returns {Array} array of child text nodes
44
+ */
45
+ export declare const getChildren: <T>(jsx: MdxJsxFlowElement | MdxJsxTextElement) => any;
46
+ /**
47
+ * Tests if a node is an MDX element.
48
+ * TODO: Make this more extensible to all types of nodes. isElement(node, 'type' or ['type1', 'type2']), say
49
+ *
50
+ * @param {Node} node
51
+ * @returns {(node is MdxJsxFlowElement | MdxJsxTextElement)}
52
+ */
7
53
  export declare const isMDXElement: (node: Node) => node is MdxJsxFlowElement | MdxJsxTextElement;
54
+ /**
55
+ * Takes an HTML string and formats it for display in the editor. Removes leading/trailing newlines
56
+ * and unindents the HTML.
57
+ *
58
+ * @param {string} html
59
+ * @returns {string} formatted HTML
60
+ */
61
+ export declare const formatHTML: (html: string) => string;
62
+ /**
63
+ * Reformat HTML for the markdown/mdx by adding an indentation to each line. This assures that the
64
+ * HTML is indentend properly within the HTMLBlock component when rendered in the markdown/mdx.
65
+ *
66
+ * @param {string} html
67
+ * @param {number} [indent=2]
68
+ * @returns {string} re-formatted HTML
69
+ */
70
+ export declare const reformatHTML: (html: string, indent?: number) => string;
package/package.json CHANGED
@@ -2,7 +2,7 @@
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.75.0-beta.59",
5
+ "version": "6.75.0-beta.61",
6
6
  "main": "dist/main.node.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "browser": "dist/main.js",