@uiw/react-md-editor 3.19.0 → 3.19.2
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/dist/mdeditor.css +2 -0
- package/dist/mdeditor.js +834 -834
- package/dist/mdeditor.min.css +1 -1
- package/dist/mdeditor.min.js +1 -1
- package/esm/Context.js.map +1 -1
- package/esm/Editor.js +43 -67
- package/esm/Editor.js.map +1 -1
- package/esm/commands/bold.js +4 -4
- package/esm/commands/bold.js.map +1 -1
- package/esm/commands/code.js +4 -6
- package/esm/commands/code.js.map +1 -1
- package/esm/commands/comment.js +4 -4
- package/esm/commands/comment.js.map +1 -1
- package/esm/commands/divider.js.map +1 -1
- package/esm/commands/fullscreen.js +3 -4
- package/esm/commands/fullscreen.js.map +2 -2
- package/esm/commands/group.js +2 -4
- package/esm/commands/group.js.map +1 -1
- package/esm/commands/hr.js.map +1 -1
- package/esm/commands/image.js +4 -4
- package/esm/commands/image.js.map +1 -1
- package/esm/commands/index.d.ts +2 -2
- package/esm/commands/index.js +6 -17
- package/esm/commands/index.js.map +3 -2
- package/esm/commands/italic.js +4 -4
- package/esm/commands/italic.js.map +1 -1
- package/esm/commands/link.js +4 -4
- package/esm/commands/link.js.map +1 -1
- package/esm/commands/list.js +4 -4
- package/esm/commands/list.js.map +1 -1
- package/esm/commands/preview.js +21 -3
- package/esm/commands/preview.js.map +7 -2
- package/esm/commands/quote.js +2 -1
- package/esm/commands/quote.js.map +1 -1
- package/esm/commands/strikeThrough.js +4 -4
- package/esm/commands/strikeThrough.js.map +1 -1
- package/esm/commands/title.js.map +1 -1
- package/esm/commands/title1.js.map +1 -1
- package/esm/commands/title2.js.map +1 -1
- package/esm/commands/title3.js.map +1 -1
- package/esm/commands/title4.js.map +1 -1
- package/esm/commands/title5.js.map +1 -1
- package/esm/commands/title6.js.map +1 -1
- package/esm/components/DragBar/index.js +2 -9
- package/esm/components/DragBar/index.js.map +1 -1
- package/esm/components/TextArea/Markdown.js +2 -7
- package/esm/components/TextArea/Markdown.js.map +1 -1
- package/esm/components/TextArea/Textarea.js +8 -11
- package/esm/components/TextArea/Textarea.js.map +1 -1
- package/esm/components/TextArea/handleKeyDown.js +2 -16
- package/esm/components/TextArea/handleKeyDown.js.map +1 -1
- package/esm/components/TextArea/index.js +11 -15
- package/esm/components/TextArea/index.js.map +1 -1
- package/esm/components/TextArea/shortcuts.js +1 -17
- package/esm/components/TextArea/shortcuts.js.map +2 -2
- package/esm/components/Toolbar/Child.js +2 -1
- package/esm/components/Toolbar/Child.js.map +1 -1
- package/esm/components/Toolbar/index.js +2 -12
- package/esm/components/Toolbar/index.js.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/utils/InsertTextAtPosition.js +28 -34
- package/esm/utils/InsertTextAtPosition.js.map +1 -1
- package/esm/utils/markdownUtils.js +14 -23
- package/esm/utils/markdownUtils.js.map +1 -1
- package/lib/Context.js +0 -6
- package/lib/Context.js.map +1 -1
- package/lib/Editor.js +74 -114
- package/lib/Editor.js.map +1 -1
- package/lib/commands/bold.js +4 -9
- package/lib/commands/bold.js.map +1 -1
- package/lib/commands/code.js +4 -11
- package/lib/commands/code.js.map +1 -1
- package/lib/commands/comment.js +4 -7
- package/lib/commands/comment.js.map +1 -1
- package/lib/commands/divider.js.map +1 -1
- package/lib/commands/fullscreen.js +3 -8
- package/lib/commands/fullscreen.js.map +2 -2
- package/lib/commands/group.js +2 -10
- package/lib/commands/group.js.map +1 -1
- package/lib/commands/hr.js +0 -4
- package/lib/commands/hr.js.map +1 -1
- package/lib/commands/image.js +4 -9
- package/lib/commands/image.js.map +1 -1
- package/lib/commands/index.d.ts +2 -2
- package/lib/commands/index.js +4 -41
- package/lib/commands/index.js.map +3 -2
- package/lib/commands/italic.js +4 -9
- package/lib/commands/italic.js.map +1 -1
- package/lib/commands/link.js +4 -9
- package/lib/commands/link.js.map +1 -1
- package/lib/commands/list.js +4 -10
- package/lib/commands/list.js.map +1 -1
- package/lib/commands/preview.js +21 -7
- package/lib/commands/preview.js.map +7 -2
- package/lib/commands/quote.js +2 -6
- package/lib/commands/quote.js.map +1 -1
- package/lib/commands/strikeThrough.js +4 -9
- package/lib/commands/strikeThrough.js.map +1 -1
- package/lib/commands/title.js +0 -6
- package/lib/commands/title.js.map +1 -1
- package/lib/commands/title1.js +0 -5
- package/lib/commands/title1.js.map +1 -1
- package/lib/commands/title2.js +0 -5
- package/lib/commands/title2.js.map +1 -1
- package/lib/commands/title3.js +0 -5
- package/lib/commands/title3.js.map +1 -1
- package/lib/commands/title4.js +0 -5
- package/lib/commands/title4.js.map +1 -1
- package/lib/commands/title5.js +0 -5
- package/lib/commands/title5.js.map +1 -1
- package/lib/commands/title6.js +0 -5
- package/lib/commands/title6.js.map +1 -1
- package/lib/components/DragBar/index.js +4 -15
- package/lib/components/DragBar/index.js.map +1 -1
- package/lib/components/TextArea/Markdown.js +6 -22
- package/lib/components/TextArea/Markdown.js.map +1 -1
- package/lib/components/TextArea/Textarea.js +15 -36
- package/lib/components/TextArea/Textarea.js.map +1 -1
- package/lib/components/TextArea/handleKeyDown.js +1 -18
- package/lib/components/TextArea/handleKeyDown.js.map +1 -1
- package/lib/components/TextArea/index.js +15 -37
- package/lib/components/TextArea/index.js.map +1 -1
- package/lib/components/TextArea/shortcuts.js +1 -17
- package/lib/components/TextArea/shortcuts.js.map +2 -2
- package/lib/components/Toolbar/Child.js +8 -18
- package/lib/components/Toolbar/Child.js.map +1 -1
- package/lib/components/Toolbar/index.js +14 -36
- package/lib/components/Toolbar/index.js.map +1 -1
- package/lib/index.js +0 -9
- package/lib/index.js.map +1 -1
- package/lib/utils/InsertTextAtPosition.js +28 -37
- package/lib/utils/InsertTextAtPosition.js.map +1 -1
- package/lib/utils/markdownUtils.js +17 -28
- package/lib/utils/markdownUtils.js.map +1 -1
- package/package.json +2 -2
- package/src/commands/fullscreen.tsx +3 -2
- package/src/commands/index.ts +3 -1
- package/src/commands/preview.tsx +35 -4
- package/src/components/TextArea/shortcuts.ts +2 -2
package/dist/mdeditor.js
CHANGED
|
@@ -972,7 +972,7 @@ BananaSlug.slug = slugger
|
|
|
972
972
|
|
|
973
973
|
// This module is generated by `script/`.
|
|
974
974
|
/* eslint-disable no-control-regex, no-misleading-character-class, no-useless-escape */
|
|
975
|
-
module.exports = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\
|
|
975
|
+
module.exports = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g
|
|
976
976
|
|
|
977
977
|
|
|
978
978
|
/***/ }),
|
|
@@ -9651,25 +9651,20 @@ function _defineProperty(obj, key, value) {
|
|
|
9651
9651
|
} else {
|
|
9652
9652
|
obj[key] = value;
|
|
9653
9653
|
}
|
|
9654
|
-
|
|
9655
9654
|
return obj;
|
|
9656
9655
|
}
|
|
9657
9656
|
;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
9658
9657
|
|
|
9659
|
-
|
|
9660
9658
|
function ownKeys(object, enumerableOnly) {
|
|
9661
9659
|
var keys = Object.keys(object);
|
|
9662
|
-
|
|
9663
9660
|
if (Object.getOwnPropertySymbols) {
|
|
9664
9661
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
9665
9662
|
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
9666
9663
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
9667
9664
|
})), keys.push.apply(keys, symbols);
|
|
9668
9665
|
}
|
|
9669
|
-
|
|
9670
9666
|
return keys;
|
|
9671
9667
|
}
|
|
9672
|
-
|
|
9673
9668
|
function _objectSpread2(target) {
|
|
9674
9669
|
for (var i = 1; i < arguments.length; i++) {
|
|
9675
9670
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
@@ -9679,7 +9674,6 @@ function _objectSpread2(target) {
|
|
|
9679
9674
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
9680
9675
|
});
|
|
9681
9676
|
}
|
|
9682
|
-
|
|
9683
9677
|
return target;
|
|
9684
9678
|
}
|
|
9685
9679
|
;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
|
@@ -9689,18 +9683,14 @@ function _arrayWithHoles(arr) {
|
|
|
9689
9683
|
;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
|
9690
9684
|
function _iterableToArrayLimit(arr, i) {
|
|
9691
9685
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
9692
|
-
|
|
9693
9686
|
if (_i == null) return;
|
|
9694
9687
|
var _arr = [];
|
|
9695
9688
|
var _n = true;
|
|
9696
9689
|
var _d = false;
|
|
9697
|
-
|
|
9698
9690
|
var _s, _e;
|
|
9699
|
-
|
|
9700
9691
|
try {
|
|
9701
9692
|
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
9702
9693
|
_arr.push(_s.value);
|
|
9703
|
-
|
|
9704
9694
|
if (i && _arr.length === i) break;
|
|
9705
9695
|
}
|
|
9706
9696
|
} catch (err) {
|
|
@@ -9713,17 +9703,14 @@ function _iterableToArrayLimit(arr, i) {
|
|
|
9713
9703
|
if (_d) throw _e;
|
|
9714
9704
|
}
|
|
9715
9705
|
}
|
|
9716
|
-
|
|
9717
9706
|
return _arr;
|
|
9718
9707
|
}
|
|
9719
9708
|
;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
|
9720
9709
|
function _arrayLikeToArray(arr, len) {
|
|
9721
9710
|
if (len == null || len > arr.length) len = arr.length;
|
|
9722
|
-
|
|
9723
9711
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
9724
9712
|
arr2[i] = arr[i];
|
|
9725
9713
|
}
|
|
9726
|
-
|
|
9727
9714
|
return arr2;
|
|
9728
9715
|
}
|
|
9729
9716
|
;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
|
@@ -9754,13 +9741,11 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
9754
9741
|
var target = {};
|
|
9755
9742
|
var sourceKeys = Object.keys(source);
|
|
9756
9743
|
var key, i;
|
|
9757
|
-
|
|
9758
9744
|
for (i = 0; i < sourceKeys.length; i++) {
|
|
9759
9745
|
key = sourceKeys[i];
|
|
9760
9746
|
if (excluded.indexOf(key) >= 0) continue;
|
|
9761
9747
|
target[key] = source[key];
|
|
9762
9748
|
}
|
|
9763
|
-
|
|
9764
9749
|
return target;
|
|
9765
9750
|
}
|
|
9766
9751
|
;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
@@ -9769,10 +9754,8 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
9769
9754
|
if (source == null) return {};
|
|
9770
9755
|
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
9771
9756
|
var key, i;
|
|
9772
|
-
|
|
9773
9757
|
if (Object.getOwnPropertySymbols) {
|
|
9774
9758
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
9775
|
-
|
|
9776
9759
|
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
9777
9760
|
key = sourceSymbolKeys[i];
|
|
9778
9761
|
if (excluded.indexOf(key) >= 0) continue;
|
|
@@ -9780,7 +9763,6 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
9780
9763
|
target[key] = source[key];
|
|
9781
9764
|
}
|
|
9782
9765
|
}
|
|
9783
|
-
|
|
9784
9766
|
return target;
|
|
9785
9767
|
}
|
|
9786
9768
|
// EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
|
|
@@ -9791,14 +9773,12 @@ function _extends() {
|
|
|
9791
9773
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
9792
9774
|
for (var i = 1; i < arguments.length; i++) {
|
|
9793
9775
|
var source = arguments[i];
|
|
9794
|
-
|
|
9795
9776
|
for (var key in source) {
|
|
9796
9777
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9797
9778
|
target[key] = source[key];
|
|
9798
9779
|
}
|
|
9799
9780
|
}
|
|
9800
9781
|
}
|
|
9801
|
-
|
|
9802
9782
|
return target;
|
|
9803
9783
|
};
|
|
9804
9784
|
return _extends.apply(this, arguments);
|
|
@@ -28460,585 +28440,6 @@ function remarkGfm(options = {}) {
|
|
|
28460
28440
|
}
|
|
28461
28441
|
}
|
|
28462
28442
|
|
|
28463
|
-
// EXTERNAL MODULE: ../node_modules/github-slugger/index.js
|
|
28464
|
-
var github_slugger = __webpack_require__(449);
|
|
28465
|
-
;// CONCATENATED MODULE: ../node_modules/hast-util-has-property/index.js
|
|
28466
|
-
var hast_util_has_property_own = {}.hasOwnProperty
|
|
28467
|
-
|
|
28468
|
-
/**
|
|
28469
|
-
* Check if `node` has a set `name` property.
|
|
28470
|
-
*
|
|
28471
|
-
* @param {unknown} node
|
|
28472
|
-
* @param {string} name
|
|
28473
|
-
* @returns {boolean}
|
|
28474
|
-
*/
|
|
28475
|
-
function hasProperty(node, name) {
|
|
28476
|
-
/** @type {unknown} */
|
|
28477
|
-
var value =
|
|
28478
|
-
name &&
|
|
28479
|
-
node &&
|
|
28480
|
-
typeof node === 'object' &&
|
|
28481
|
-
// @ts-ignore Looks like a node.
|
|
28482
|
-
node.type === 'element' &&
|
|
28483
|
-
// @ts-ignore Looks like an element.
|
|
28484
|
-
node.properties &&
|
|
28485
|
-
// @ts-ignore Looks like an element.
|
|
28486
|
-
hast_util_has_property_own.call(node.properties, name) &&
|
|
28487
|
-
// @ts-ignore Looks like an element.
|
|
28488
|
-
node.properties[name]
|
|
28489
|
-
|
|
28490
|
-
return value !== null && value !== undefined && value !== false
|
|
28491
|
-
}
|
|
28492
|
-
|
|
28493
|
-
;// CONCATENATED MODULE: ../node_modules/hast-util-heading-rank/index.js
|
|
28494
|
-
/**
|
|
28495
|
-
* @typedef {import('hast').Parent} Parent
|
|
28496
|
-
* @typedef {import('hast').Root} Root
|
|
28497
|
-
* @typedef {Root|Parent['children'][number]} Node
|
|
28498
|
-
*/
|
|
28499
|
-
|
|
28500
|
-
/**
|
|
28501
|
-
* Rank of a heading: H1 -> 1, H2 -> 2, etc.
|
|
28502
|
-
*
|
|
28503
|
-
* @param {Node} node
|
|
28504
|
-
* @returns {number|null}
|
|
28505
|
-
*/
|
|
28506
|
-
function headingRank(node) {
|
|
28507
|
-
var name =
|
|
28508
|
-
(node && node.type === 'element' && node.tagName.toLowerCase()) || ''
|
|
28509
|
-
var code =
|
|
28510
|
-
name.length === 2 && name.charCodeAt(0) === 104 /* `h` */
|
|
28511
|
-
? name.charCodeAt(1)
|
|
28512
|
-
: 0
|
|
28513
|
-
return code > 48 /* `0` */ && code < 55 /* `7` */ ? code - 48 /* `0` */ : null
|
|
28514
|
-
}
|
|
28515
|
-
|
|
28516
|
-
;// CONCATENATED MODULE: ../node_modules/hast-util-to-string/index.js
|
|
28517
|
-
/**
|
|
28518
|
-
* @fileoverview
|
|
28519
|
-
* Get the plain-text value of a hast node.
|
|
28520
|
-
* @longdescription
|
|
28521
|
-
* ## Use
|
|
28522
|
-
*
|
|
28523
|
-
* ```js
|
|
28524
|
-
* import {h} from 'hastscript'
|
|
28525
|
-
* import {toString} from 'hast-util-to-string'
|
|
28526
|
-
*
|
|
28527
|
-
* toString(h('p', 'Alpha'))
|
|
28528
|
-
* //=> 'Alpha'
|
|
28529
|
-
* toString(h('div', [h('b', 'Bold'), ' and ', h('i', 'italic'), '.']))
|
|
28530
|
-
* //=> 'Bold and italic.'
|
|
28531
|
-
* ```
|
|
28532
|
-
*
|
|
28533
|
-
* ## API
|
|
28534
|
-
*
|
|
28535
|
-
* ### `toString(node)`
|
|
28536
|
-
*
|
|
28537
|
-
* Transform a node to a string.
|
|
28538
|
-
*/
|
|
28539
|
-
|
|
28540
|
-
/**
|
|
28541
|
-
* @typedef {import('hast').Root} Root
|
|
28542
|
-
* @typedef {import('hast').Element} Element
|
|
28543
|
-
* @typedef {Root|Root['children'][number]} Node
|
|
28544
|
-
*/
|
|
28545
|
-
|
|
28546
|
-
/**
|
|
28547
|
-
* Get the plain-text value of a hast node.
|
|
28548
|
-
*
|
|
28549
|
-
* @param {Node} node
|
|
28550
|
-
* @returns {string}
|
|
28551
|
-
*/
|
|
28552
|
-
function hast_util_to_string_toString(node) {
|
|
28553
|
-
// “The concatenation of data of all the Text node descendants of the context
|
|
28554
|
-
// object, in tree order.”
|
|
28555
|
-
if ('children' in node) {
|
|
28556
|
-
return hast_util_to_string_all(node)
|
|
28557
|
-
}
|
|
28558
|
-
|
|
28559
|
-
// “Context object’s data.”
|
|
28560
|
-
return 'value' in node ? node.value : ''
|
|
28561
|
-
}
|
|
28562
|
-
|
|
28563
|
-
/**
|
|
28564
|
-
* @param {Node} node
|
|
28565
|
-
* @returns {string}
|
|
28566
|
-
*/
|
|
28567
|
-
function hast_util_to_string_one(node) {
|
|
28568
|
-
if (node.type === 'text') {
|
|
28569
|
-
return node.value
|
|
28570
|
-
}
|
|
28571
|
-
|
|
28572
|
-
return 'children' in node ? hast_util_to_string_all(node) : ''
|
|
28573
|
-
}
|
|
28574
|
-
|
|
28575
|
-
/**
|
|
28576
|
-
* @param {Root|Element} node
|
|
28577
|
-
* @returns {string}
|
|
28578
|
-
*/
|
|
28579
|
-
function hast_util_to_string_all(node) {
|
|
28580
|
-
let index = -1
|
|
28581
|
-
/** @type {string[]} */
|
|
28582
|
-
const result = []
|
|
28583
|
-
|
|
28584
|
-
while (++index < node.children.length) {
|
|
28585
|
-
result[index] = hast_util_to_string_one(node.children[index])
|
|
28586
|
-
}
|
|
28587
|
-
|
|
28588
|
-
return result.join('')
|
|
28589
|
-
}
|
|
28590
|
-
|
|
28591
|
-
;// CONCATENATED MODULE: ../node_modules/rehype-slug/index.js
|
|
28592
|
-
/**
|
|
28593
|
-
* @typedef {import('hast').Root} Root
|
|
28594
|
-
*/
|
|
28595
|
-
|
|
28596
|
-
|
|
28597
|
-
|
|
28598
|
-
|
|
28599
|
-
|
|
28600
|
-
|
|
28601
|
-
|
|
28602
|
-
const slugs = new github_slugger()
|
|
28603
|
-
|
|
28604
|
-
/**
|
|
28605
|
-
* Plugin to add `id`s to headings.
|
|
28606
|
-
*
|
|
28607
|
-
* @type {import('unified').Plugin<Array<void>, Root>}
|
|
28608
|
-
*/
|
|
28609
|
-
function rehypeSlug() {
|
|
28610
|
-
return (tree) => {
|
|
28611
|
-
slugs.reset()
|
|
28612
|
-
|
|
28613
|
-
visit(tree, 'element', (node) => {
|
|
28614
|
-
if (headingRank(node) && node.properties && !hasProperty(node, 'id')) {
|
|
28615
|
-
node.properties.id = slugs.slug(hast_util_to_string_toString(node))
|
|
28616
|
-
}
|
|
28617
|
-
})
|
|
28618
|
-
}
|
|
28619
|
-
}
|
|
28620
|
-
|
|
28621
|
-
;// CONCATENATED MODULE: ../node_modules/hast-util-is-element/index.js
|
|
28622
|
-
/**
|
|
28623
|
-
* @typedef {import('unist').Node} Node
|
|
28624
|
-
* @typedef {import('unist').Parent} Parent
|
|
28625
|
-
* @typedef {import('hast').Element} Element
|
|
28626
|
-
*
|
|
28627
|
-
* @typedef {string} TagName
|
|
28628
|
-
* @typedef {null|undefined|TagName|TestFunctionAnything|Array.<TagName|TestFunctionAnything>} Test
|
|
28629
|
-
*/
|
|
28630
|
-
|
|
28631
|
-
/**
|
|
28632
|
-
* @template {Element} T
|
|
28633
|
-
* @typedef {null|undefined|T['tagName']|TestFunctionPredicate<T>|Array.<T['tagName']|TestFunctionPredicate<T>>} PredicateTest
|
|
28634
|
-
*/
|
|
28635
|
-
|
|
28636
|
-
/**
|
|
28637
|
-
* Check if an element passes a test
|
|
28638
|
-
*
|
|
28639
|
-
* @callback TestFunctionAnything
|
|
28640
|
-
* @param {Element} element
|
|
28641
|
-
* @param {number|null|undefined} [index]
|
|
28642
|
-
* @param {Parent|null|undefined} [parent]
|
|
28643
|
-
* @returns {boolean|void}
|
|
28644
|
-
*/
|
|
28645
|
-
|
|
28646
|
-
/**
|
|
28647
|
-
* Check if an element passes a certain node test
|
|
28648
|
-
*
|
|
28649
|
-
* @template {Element} X
|
|
28650
|
-
* @callback TestFunctionPredicate
|
|
28651
|
-
* @param {Element} element
|
|
28652
|
-
* @param {number|null|undefined} [index]
|
|
28653
|
-
* @param {Parent|null|undefined} [parent]
|
|
28654
|
-
* @returns {element is X}
|
|
28655
|
-
*/
|
|
28656
|
-
|
|
28657
|
-
/**
|
|
28658
|
-
* Check if a node is an element and passes a certain node test
|
|
28659
|
-
*
|
|
28660
|
-
* @callback AssertAnything
|
|
28661
|
-
* @param {unknown} [node]
|
|
28662
|
-
* @param {number|null|undefined} [index]
|
|
28663
|
-
* @param {Parent|null|undefined} [parent]
|
|
28664
|
-
* @returns {boolean}
|
|
28665
|
-
*/
|
|
28666
|
-
|
|
28667
|
-
/**
|
|
28668
|
-
* Check if a node is an element and passes a certain node test
|
|
28669
|
-
*
|
|
28670
|
-
* @template {Element} Y
|
|
28671
|
-
* @callback AssertPredicate
|
|
28672
|
-
* @param {unknown} [node]
|
|
28673
|
-
* @param {number|null|undefined} [index]
|
|
28674
|
-
* @param {Parent|null|undefined} [parent]
|
|
28675
|
-
* @returns {node is Y}
|
|
28676
|
-
*/
|
|
28677
|
-
|
|
28678
|
-
// Check if `node` is an `element` and whether it passes the given test.
|
|
28679
|
-
const isElement =
|
|
28680
|
-
/**
|
|
28681
|
-
* Check if a node is an element and passes a test.
|
|
28682
|
-
* When a `parent` node is known the `index` of node should also be given.
|
|
28683
|
-
*
|
|
28684
|
-
* @type {(
|
|
28685
|
-
* (() => false) &
|
|
28686
|
-
* (<T extends Element = Element>(node: unknown, test?: PredicateTest<T>, index?: number, parent?: Parent, context?: unknown) => node is T) &
|
|
28687
|
-
* ((node: unknown, test: Test, index?: number, parent?: Parent, context?: unknown) => boolean)
|
|
28688
|
-
* )}
|
|
28689
|
-
*/
|
|
28690
|
-
(
|
|
28691
|
-
/**
|
|
28692
|
-
* Check if a node passes a test.
|
|
28693
|
-
* When a `parent` node is known the `index` of node should also be given.
|
|
28694
|
-
*
|
|
28695
|
-
* @param {unknown} [node] Node to check
|
|
28696
|
-
* @param {Test} [test] When nullish, checks if `node` is a `Node`.
|
|
28697
|
-
* When `string`, works like passing `function (node) {return node.type === test}`.
|
|
28698
|
-
* When `function` checks if function passed the node is true.
|
|
28699
|
-
* When `array`, checks any one of the subtests pass.
|
|
28700
|
-
* @param {number} [index] Position of `node` in `parent`
|
|
28701
|
-
* @param {Parent} [parent] Parent of `node`
|
|
28702
|
-
* @param {unknown} [context] Context object to invoke `test` with
|
|
28703
|
-
* @returns {boolean} Whether test passed and `node` is an `Element` (object with `type` set to `element` and `tagName` set to a non-empty string).
|
|
28704
|
-
*/
|
|
28705
|
-
// eslint-disable-next-line max-params
|
|
28706
|
-
function (node, test, index, parent, context) {
|
|
28707
|
-
const check = convertElement(test)
|
|
28708
|
-
|
|
28709
|
-
if (
|
|
28710
|
-
index !== undefined &&
|
|
28711
|
-
index !== null &&
|
|
28712
|
-
(typeof index !== 'number' ||
|
|
28713
|
-
index < 0 ||
|
|
28714
|
-
index === Number.POSITIVE_INFINITY)
|
|
28715
|
-
) {
|
|
28716
|
-
throw new Error('Expected positive finite index for child node')
|
|
28717
|
-
}
|
|
28718
|
-
|
|
28719
|
-
if (
|
|
28720
|
-
parent !== undefined &&
|
|
28721
|
-
parent !== null &&
|
|
28722
|
-
(!parent.type || !parent.children)
|
|
28723
|
-
) {
|
|
28724
|
-
throw new Error('Expected parent node')
|
|
28725
|
-
}
|
|
28726
|
-
|
|
28727
|
-
// @ts-expect-error Looks like a node.
|
|
28728
|
-
if (!node || !node.type || typeof node.type !== 'string') {
|
|
28729
|
-
return false
|
|
28730
|
-
}
|
|
28731
|
-
|
|
28732
|
-
if (
|
|
28733
|
-
(parent === undefined || parent === null) !==
|
|
28734
|
-
(index === undefined || index === null)
|
|
28735
|
-
) {
|
|
28736
|
-
throw new Error('Expected both parent and index')
|
|
28737
|
-
}
|
|
28738
|
-
|
|
28739
|
-
return check.call(context, node, index, parent)
|
|
28740
|
-
}
|
|
28741
|
-
)
|
|
28742
|
-
|
|
28743
|
-
const convertElement =
|
|
28744
|
-
/**
|
|
28745
|
-
* @type {(
|
|
28746
|
-
* (<T extends Element>(test: T['tagName']|TestFunctionPredicate<T>) => AssertPredicate<T>) &
|
|
28747
|
-
* ((test?: Test) => AssertAnything)
|
|
28748
|
-
* )}
|
|
28749
|
-
*/
|
|
28750
|
-
(
|
|
28751
|
-
/**
|
|
28752
|
-
* Generate an assertion from a check.
|
|
28753
|
-
* @param {Test} [test]
|
|
28754
|
-
* When nullish, checks if `node` is a `Node`.
|
|
28755
|
-
* When `string`, works like passing `function (node) {return node.type === test}`.
|
|
28756
|
-
* When `function` checks if function passed the node is true.
|
|
28757
|
-
* When `object`, checks that all keys in test are in node, and that they have (strictly) equal values.
|
|
28758
|
-
* When `array`, checks any one of the subtests pass.
|
|
28759
|
-
* @returns {AssertAnything}
|
|
28760
|
-
*/
|
|
28761
|
-
function (test) {
|
|
28762
|
-
if (test === undefined || test === null) {
|
|
28763
|
-
return hast_util_is_element_element
|
|
28764
|
-
}
|
|
28765
|
-
|
|
28766
|
-
if (typeof test === 'string') {
|
|
28767
|
-
return tagNameFactory(test)
|
|
28768
|
-
}
|
|
28769
|
-
|
|
28770
|
-
if (typeof test === 'object') {
|
|
28771
|
-
return hast_util_is_element_anyFactory(test)
|
|
28772
|
-
}
|
|
28773
|
-
|
|
28774
|
-
if (typeof test === 'function') {
|
|
28775
|
-
return hast_util_is_element_castFactory(test)
|
|
28776
|
-
}
|
|
28777
|
-
|
|
28778
|
-
throw new Error('Expected function, string, or array as test')
|
|
28779
|
-
}
|
|
28780
|
-
)
|
|
28781
|
-
|
|
28782
|
-
/**
|
|
28783
|
-
* @param {Array.<TagName|TestFunctionAnything>} tests
|
|
28784
|
-
* @returns {AssertAnything}
|
|
28785
|
-
*/
|
|
28786
|
-
function hast_util_is_element_anyFactory(tests) {
|
|
28787
|
-
/** @type {Array.<AssertAnything>} */
|
|
28788
|
-
const checks = []
|
|
28789
|
-
let index = -1
|
|
28790
|
-
|
|
28791
|
-
while (++index < tests.length) {
|
|
28792
|
-
checks[index] = convertElement(tests[index])
|
|
28793
|
-
}
|
|
28794
|
-
|
|
28795
|
-
return hast_util_is_element_castFactory(any)
|
|
28796
|
-
|
|
28797
|
-
/**
|
|
28798
|
-
* @this {unknown}
|
|
28799
|
-
* @param {unknown[]} parameters
|
|
28800
|
-
* @returns {boolean}
|
|
28801
|
-
*/
|
|
28802
|
-
function any(...parameters) {
|
|
28803
|
-
let index = -1
|
|
28804
|
-
|
|
28805
|
-
while (++index < checks.length) {
|
|
28806
|
-
if (checks[index].call(this, ...parameters)) {
|
|
28807
|
-
return true
|
|
28808
|
-
}
|
|
28809
|
-
}
|
|
28810
|
-
|
|
28811
|
-
return false
|
|
28812
|
-
}
|
|
28813
|
-
}
|
|
28814
|
-
|
|
28815
|
-
/**
|
|
28816
|
-
* Utility to convert a string into a function which checks a given node’s tag
|
|
28817
|
-
* name for said string.
|
|
28818
|
-
*
|
|
28819
|
-
* @param {TagName} check
|
|
28820
|
-
* @returns {AssertAnything}
|
|
28821
|
-
*/
|
|
28822
|
-
function tagNameFactory(check) {
|
|
28823
|
-
return tagName
|
|
28824
|
-
|
|
28825
|
-
/**
|
|
28826
|
-
* @param {unknown} node
|
|
28827
|
-
* @returns {boolean}
|
|
28828
|
-
*/
|
|
28829
|
-
function tagName(node) {
|
|
28830
|
-
return hast_util_is_element_element(node) && node.tagName === check
|
|
28831
|
-
}
|
|
28832
|
-
}
|
|
28833
|
-
|
|
28834
|
-
/**
|
|
28835
|
-
* @param {TestFunctionAnything} check
|
|
28836
|
-
* @returns {AssertAnything}
|
|
28837
|
-
*/
|
|
28838
|
-
function hast_util_is_element_castFactory(check) {
|
|
28839
|
-
return assertion
|
|
28840
|
-
|
|
28841
|
-
/**
|
|
28842
|
-
* @this {unknown}
|
|
28843
|
-
* @param {unknown} node
|
|
28844
|
-
* @param {Array.<unknown>} parameters
|
|
28845
|
-
* @returns {boolean}
|
|
28846
|
-
*/
|
|
28847
|
-
function assertion(node, ...parameters) {
|
|
28848
|
-
// @ts-expect-error: fine.
|
|
28849
|
-
return hast_util_is_element_element(node) && Boolean(check.call(this, node, ...parameters))
|
|
28850
|
-
}
|
|
28851
|
-
}
|
|
28852
|
-
|
|
28853
|
-
/**
|
|
28854
|
-
* Utility to return true if this is an element.
|
|
28855
|
-
* @param {unknown} node
|
|
28856
|
-
* @returns {node is Element}
|
|
28857
|
-
*/
|
|
28858
|
-
function hast_util_is_element_element(node) {
|
|
28859
|
-
return Boolean(
|
|
28860
|
-
node &&
|
|
28861
|
-
typeof node === 'object' &&
|
|
28862
|
-
// @ts-expect-error Looks like a node.
|
|
28863
|
-
node.type === 'element' &&
|
|
28864
|
-
// @ts-expect-error Looks like an element.
|
|
28865
|
-
typeof node.tagName === 'string'
|
|
28866
|
-
)
|
|
28867
|
-
}
|
|
28868
|
-
|
|
28869
|
-
;// CONCATENATED MODULE: ../node_modules/rehype-autolink-headings/lib/index.js
|
|
28870
|
-
/**
|
|
28871
|
-
* @typedef {import('hast').Root} Root
|
|
28872
|
-
* @typedef {import('hast').Parent} Parent
|
|
28873
|
-
* @typedef {import('hast').Element} Element
|
|
28874
|
-
* @typedef {Element['children'][number]} ElementChild
|
|
28875
|
-
* @typedef {import('hast').Properties} Properties
|
|
28876
|
-
* @typedef {import('hast-util-is-element').Test} Test
|
|
28877
|
-
*
|
|
28878
|
-
* @typedef {'prepend'|'append'|'wrap'|'before'|'after'} Behavior
|
|
28879
|
-
*
|
|
28880
|
-
* @callback Build
|
|
28881
|
-
* @param {Element} node
|
|
28882
|
-
* @returns {ElementChild|ElementChild[]}
|
|
28883
|
-
*
|
|
28884
|
-
* @typedef Options
|
|
28885
|
-
* Configuration.
|
|
28886
|
-
* @property {Behavior} [behavior='prepend']
|
|
28887
|
-
* How to create links.
|
|
28888
|
-
* @property {Behavior} [behaviour]
|
|
28889
|
-
* Please use `behavior` instead
|
|
28890
|
-
* @property {Properties} [properties]
|
|
28891
|
-
* Extra properties to set on the link when injecting.
|
|
28892
|
-
* Defaults to `{ariaHidden: true, tabIndex: -1}` when `'prepend'` or
|
|
28893
|
-
* `'append'`.
|
|
28894
|
-
* @property {ElementChild|ElementChild[]|Build} [content={type: 'element', tagName: 'span', properties: {className: ['icon', 'icon-link']}, children: []}]
|
|
28895
|
-
* hast nodes to insert in the link.
|
|
28896
|
-
* @property {ElementChild|ElementChild[]|Build} [group]
|
|
28897
|
-
* hast node to wrap the heading and link with, if `behavior` is `'before'` or
|
|
28898
|
-
* `'after'`.
|
|
28899
|
-
* There is no default.
|
|
28900
|
-
* @property {Test} [test]
|
|
28901
|
-
* Test to define which heading elements are linked.
|
|
28902
|
-
* Any test that can be given to `hast-util-is-element` is supported.
|
|
28903
|
-
* The default (no test) is to link all headings.
|
|
28904
|
-
* Can be used to link only h1-h3, or for example all except h1.
|
|
28905
|
-
*/
|
|
28906
|
-
|
|
28907
|
-
|
|
28908
|
-
|
|
28909
|
-
|
|
28910
|
-
|
|
28911
|
-
|
|
28912
|
-
|
|
28913
|
-
/** @type {Element} */
|
|
28914
|
-
const contentDefaults = {
|
|
28915
|
-
type: 'element',
|
|
28916
|
-
tagName: 'span',
|
|
28917
|
-
properties: {className: ['icon', 'icon-link']},
|
|
28918
|
-
children: []
|
|
28919
|
-
}
|
|
28920
|
-
|
|
28921
|
-
/**
|
|
28922
|
-
* Plugin to automatically add links to headings (h1-h6).
|
|
28923
|
-
*
|
|
28924
|
-
* @type {import('unified').Plugin<[Options?]|void[], Root>}
|
|
28925
|
-
*/
|
|
28926
|
-
function rehypeAutolinkHeadings(options = {}) {
|
|
28927
|
-
let props = options.properties
|
|
28928
|
-
const behavior = options.behaviour || options.behavior || 'prepend'
|
|
28929
|
-
const content = options.content || contentDefaults
|
|
28930
|
-
const group = options.group
|
|
28931
|
-
const is = convertElement(options.test)
|
|
28932
|
-
|
|
28933
|
-
/** @type {import('unist-util-visit/complex-types').Visitor<Element>} */
|
|
28934
|
-
let method
|
|
28935
|
-
|
|
28936
|
-
if (behavior === 'wrap') {
|
|
28937
|
-
method = wrap
|
|
28938
|
-
} else if (behavior === 'before' || behavior === 'after') {
|
|
28939
|
-
method = around
|
|
28940
|
-
} else {
|
|
28941
|
-
if (!props) {
|
|
28942
|
-
props = {ariaHidden: 'true', tabIndex: -1}
|
|
28943
|
-
}
|
|
28944
|
-
|
|
28945
|
-
method = inject
|
|
28946
|
-
}
|
|
28947
|
-
|
|
28948
|
-
return (tree) => {
|
|
28949
|
-
visit(tree, 'element', (node, index, parent) => {
|
|
28950
|
-
if (
|
|
28951
|
-
headingRank(node) &&
|
|
28952
|
-
hasProperty(node, 'id') &&
|
|
28953
|
-
is(node, index, parent)
|
|
28954
|
-
) {
|
|
28955
|
-
return method(node, index, parent)
|
|
28956
|
-
}
|
|
28957
|
-
})
|
|
28958
|
-
}
|
|
28959
|
-
|
|
28960
|
-
/** @type {import('unist-util-visit/complex-types').Visitor<Element>} */
|
|
28961
|
-
function inject(node) {
|
|
28962
|
-
node.children[behavior === 'prepend' ? 'unshift' : 'push'](
|
|
28963
|
-
create(node, extend(true, {}, props), toChildren(content, node))
|
|
28964
|
-
)
|
|
28965
|
-
|
|
28966
|
-
return [SKIP]
|
|
28967
|
-
}
|
|
28968
|
-
|
|
28969
|
-
/** @type {import('unist-util-visit/complex-types').Visitor<Element>} */
|
|
28970
|
-
function around(node, index, parent) {
|
|
28971
|
-
// Uncommon.
|
|
28972
|
-
/* c8 ignore next */
|
|
28973
|
-
if (typeof index !== 'number' || !parent) return
|
|
28974
|
-
|
|
28975
|
-
const link = create(
|
|
28976
|
-
node,
|
|
28977
|
-
extend(true, {}, props),
|
|
28978
|
-
toChildren(content, node)
|
|
28979
|
-
)
|
|
28980
|
-
let nodes = behavior === 'before' ? [link, node] : [node, link]
|
|
28981
|
-
|
|
28982
|
-
if (group) {
|
|
28983
|
-
const grouping = toNode(group, node)
|
|
28984
|
-
|
|
28985
|
-
if (grouping && !Array.isArray(grouping) && grouping.type === 'element') {
|
|
28986
|
-
grouping.children = nodes
|
|
28987
|
-
nodes = [grouping]
|
|
28988
|
-
}
|
|
28989
|
-
}
|
|
28990
|
-
|
|
28991
|
-
parent.children.splice(index, 1, ...nodes)
|
|
28992
|
-
|
|
28993
|
-
return [SKIP, index + nodes.length]
|
|
28994
|
-
}
|
|
28995
|
-
|
|
28996
|
-
/** @type {import('unist-util-visit/complex-types').Visitor<Element>} */
|
|
28997
|
-
function wrap(node) {
|
|
28998
|
-
node.children = [create(node, extend(true, {}, props), node.children)]
|
|
28999
|
-
return [SKIP]
|
|
29000
|
-
}
|
|
29001
|
-
|
|
29002
|
-
/**
|
|
29003
|
-
* @param {ElementChild|ElementChild[]|Build} value
|
|
29004
|
-
* @param {Element} node
|
|
29005
|
-
* @returns {ElementChild[]}
|
|
29006
|
-
*/
|
|
29007
|
-
function toChildren(value, node) {
|
|
29008
|
-
const result = toNode(value, node)
|
|
29009
|
-
return Array.isArray(result) ? result : [result]
|
|
29010
|
-
}
|
|
29011
|
-
|
|
29012
|
-
/**
|
|
29013
|
-
* @param {ElementChild|ElementChild[]|Build} value
|
|
29014
|
-
* @param {Element} node
|
|
29015
|
-
* @returns {ElementChild|ElementChild[]}
|
|
29016
|
-
*/
|
|
29017
|
-
function toNode(value, node) {
|
|
29018
|
-
if (typeof value === 'function') return value(node)
|
|
29019
|
-
return extend(true, Array.isArray(value) ? [] : {}, value)
|
|
29020
|
-
}
|
|
29021
|
-
|
|
29022
|
-
/**
|
|
29023
|
-
* @param {Element} node
|
|
29024
|
-
* @param {Properties} props
|
|
29025
|
-
* @param {ElementChild[]} children
|
|
29026
|
-
* @returns {Element}
|
|
29027
|
-
*/
|
|
29028
|
-
function create(node, props, children) {
|
|
29029
|
-
return {
|
|
29030
|
-
type: 'element',
|
|
29031
|
-
tagName: 'a',
|
|
29032
|
-
properties: Object.assign({}, props, {
|
|
29033
|
-
// Fix hast types and make them required.
|
|
29034
|
-
/* c8 ignore next */
|
|
29035
|
-
href: '#' + (node.properties || {}).id
|
|
29036
|
-
}),
|
|
29037
|
-
children
|
|
29038
|
-
}
|
|
29039
|
-
}
|
|
29040
|
-
}
|
|
29041
|
-
|
|
29042
28443
|
// EXTERNAL MODULE: ../node_modules/parse5/lib/parser/index.js
|
|
29043
28444
|
var lib_parser = __webpack_require__(695);
|
|
29044
28445
|
;// CONCATENATED MODULE: ../node_modules/hast-util-parse-selector/index.js
|
|
@@ -29128,15 +28529,17 @@ const parseSelector =
|
|
|
29128
28529
|
*
|
|
29129
28530
|
* @typedef {Root|Element} HResult
|
|
29130
28531
|
* @typedef {string|number} HStyleValue
|
|
29131
|
-
* @typedef {
|
|
28532
|
+
* @typedef {Record<string, HStyleValue>} HStyle
|
|
29132
28533
|
* @typedef {string|number|boolean|null|undefined} HPrimitiveValue
|
|
29133
|
-
* @typedef {Array
|
|
28534
|
+
* @typedef {Array<string|number>} HArrayValue
|
|
29134
28535
|
* @typedef {HPrimitiveValue|HArrayValue} HPropertyValue
|
|
29135
28536
|
* @typedef {{[property: string]: HPropertyValue|HStyle}} HProperties
|
|
28537
|
+
* Acceptable properties value.
|
|
29136
28538
|
*
|
|
29137
28539
|
* @typedef {string|number|null|undefined} HPrimitiveChild
|
|
29138
|
-
* @typedef {Array
|
|
28540
|
+
* @typedef {Array<Node|HPrimitiveChild>} HArrayChild
|
|
29139
28541
|
* @typedef {Node|HPrimitiveChild|HArrayChild} HChild
|
|
28542
|
+
* Acceptable child value
|
|
29140
28543
|
*/
|
|
29141
28544
|
|
|
29142
28545
|
|
|
@@ -29151,7 +28554,7 @@ const core_own = {}.hasOwnProperty
|
|
|
29151
28554
|
/**
|
|
29152
28555
|
* @param {Schema} schema
|
|
29153
28556
|
* @param {string} defaultTagName
|
|
29154
|
-
* @param {Array
|
|
28557
|
+
* @param {Array<string>} [caseSensitive]
|
|
29155
28558
|
*/
|
|
29156
28559
|
function core_core(schema, defaultTagName, caseSensitive) {
|
|
29157
28560
|
const adjust = caseSensitive && createAdjustMap(caseSensitive)
|
|
@@ -29160,9 +28563,9 @@ function core_core(schema, defaultTagName, caseSensitive) {
|
|
|
29160
28563
|
/**
|
|
29161
28564
|
* @type {{
|
|
29162
28565
|
* (): Root
|
|
29163
|
-
* (selector: null|undefined, ...children: HChild
|
|
29164
|
-
* (selector: string, properties?: HProperties, ...children: HChild
|
|
29165
|
-
* (selector: string, ...children: HChild
|
|
28566
|
+
* (selector: null|undefined, ...children: Array<HChild>): Root
|
|
28567
|
+
* (selector: string, properties?: HProperties, ...children: Array<HChild>): Element
|
|
28568
|
+
* (selector: string, ...children: Array<HChild>): Element
|
|
29166
28569
|
* }}
|
|
29167
28570
|
*/
|
|
29168
28571
|
(
|
|
@@ -29171,7 +28574,7 @@ function core_core(schema, defaultTagName, caseSensitive) {
|
|
|
29171
28574
|
*
|
|
29172
28575
|
* @param {string|null} [selector]
|
|
29173
28576
|
* @param {HProperties|HChild} [properties]
|
|
29174
|
-
* @param {HChild
|
|
28577
|
+
* @param {Array<HChild>} children
|
|
29175
28578
|
* @returns {HResult}
|
|
29176
28579
|
*/
|
|
29177
28580
|
function (selector, properties, ...children) {
|
|
@@ -29298,7 +28701,7 @@ function core_addProperty(schema, properties, key, value) {
|
|
|
29298
28701
|
}
|
|
29299
28702
|
|
|
29300
28703
|
if (Array.isArray(result)) {
|
|
29301
|
-
/** @type {Array
|
|
28704
|
+
/** @type {Array<string|number>} */
|
|
29302
28705
|
const finalResult = []
|
|
29303
28706
|
|
|
29304
28707
|
while (++index < result.length) {
|
|
@@ -29319,7 +28722,7 @@ function core_addProperty(schema, properties, key, value) {
|
|
|
29319
28722
|
}
|
|
29320
28723
|
|
|
29321
28724
|
/**
|
|
29322
|
-
* @param {Array
|
|
28725
|
+
* @param {Array<Child>} nodes
|
|
29323
28726
|
* @param {HChild} value
|
|
29324
28727
|
* @returns {void}
|
|
29325
28728
|
*/
|
|
@@ -29375,7 +28778,7 @@ function parsePrimitive(info, name, value) {
|
|
|
29375
28778
|
* @returns {string}
|
|
29376
28779
|
*/
|
|
29377
28780
|
function style(value) {
|
|
29378
|
-
/** @type {Array
|
|
28781
|
+
/** @type {Array<string>} */
|
|
29379
28782
|
const result = []
|
|
29380
28783
|
/** @type {string} */
|
|
29381
28784
|
let key
|
|
@@ -29390,11 +28793,11 @@ function style(value) {
|
|
|
29390
28793
|
}
|
|
29391
28794
|
|
|
29392
28795
|
/**
|
|
29393
|
-
* @param {Array
|
|
29394
|
-
* @returns {
|
|
28796
|
+
* @param {Array<string>} values
|
|
28797
|
+
* @returns {Record<string, string>}
|
|
29395
28798
|
*/
|
|
29396
28799
|
function createAdjustMap(values) {
|
|
29397
|
-
/** @type {
|
|
28800
|
+
/** @type {Record<string, string>} */
|
|
29398
28801
|
const result = {}
|
|
29399
28802
|
let index = -1
|
|
29400
28803
|
|
|
@@ -29450,8 +28853,8 @@ const svgCaseSensitiveTagNames = [
|
|
|
29450
28853
|
|
|
29451
28854
|
;// CONCATENATED MODULE: ../node_modules/hastscript/lib/svg.js
|
|
29452
28855
|
/**
|
|
29453
|
-
* @typedef {import('./core.js').HChild} Child
|
|
29454
|
-
* @typedef {import('./core.js').HProperties} Properties
|
|
28856
|
+
* @typedef {import('./core.js').HChild} Child
|
|
28857
|
+
* @typedef {import('./core.js').HProperties} Properties
|
|
29455
28858
|
*
|
|
29456
28859
|
* @typedef {import('./jsx-classic').Element} s.JSX.Element
|
|
29457
28860
|
* @typedef {import('./jsx-classic').IntrinsicAttributes} s.JSX.IntrinsicAttributes
|
|
@@ -30971,218 +30374,797 @@ const raw =
|
|
|
30971
30374
|
posTracker.col = 1
|
|
30972
30375
|
posTracker.line = line
|
|
30973
30376
|
|
|
30974
|
-
// Reset location tracker:
|
|
30975
|
-
// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/extensions/location-info/tokenizer-mixin.js>.
|
|
30976
|
-
locationTracker.currentAttrLocation = undefined
|
|
30977
|
-
locationTracker.ctLoc = createParse5Location(node)
|
|
30377
|
+
// Reset location tracker:
|
|
30378
|
+
// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/extensions/location-info/tokenizer-mixin.js>.
|
|
30379
|
+
locationTracker.currentAttrLocation = undefined
|
|
30380
|
+
locationTracker.ctLoc = createParse5Location(node)
|
|
30381
|
+
|
|
30382
|
+
// See the code for `parse` and `parseFragment`:
|
|
30383
|
+
// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/parser/index.js#L371>.
|
|
30384
|
+
tokenizer.write(node.value)
|
|
30385
|
+
parser._runParsingLoop(null)
|
|
30386
|
+
|
|
30387
|
+
// Character references hang, so if we ended there, we need to flush
|
|
30388
|
+
// those too.
|
|
30389
|
+
// We reset the preprocessor as if the document ends here.
|
|
30390
|
+
// Then one single call to the relevant state does the trick, parse5
|
|
30391
|
+
// consumes the whole token.
|
|
30392
|
+
if (
|
|
30393
|
+
tokenizer.state === 'NAMED_CHARACTER_REFERENCE_STATE' ||
|
|
30394
|
+
tokenizer.state === 'NUMERIC_CHARACTER_REFERENCE_END_STATE'
|
|
30395
|
+
) {
|
|
30396
|
+
preprocessor.lastChunkWritten = true
|
|
30397
|
+
tokenizer[tokenizer.state](tokenizer._consume())
|
|
30398
|
+
}
|
|
30399
|
+
}
|
|
30400
|
+
|
|
30401
|
+
/**
|
|
30402
|
+
* @param {Node} node
|
|
30403
|
+
*/
|
|
30404
|
+
function stitch(node) {
|
|
30405
|
+
stitches = true
|
|
30406
|
+
|
|
30407
|
+
/** @type {Node} */
|
|
30408
|
+
let clone
|
|
30409
|
+
|
|
30410
|
+
// Recurse, because to somewhat handle `[<x>]</x>` (where `[]` denotes the
|
|
30411
|
+
// passed through node).
|
|
30412
|
+
if ('children' in node) {
|
|
30413
|
+
clone = {
|
|
30414
|
+
...node,
|
|
30415
|
+
children: raw(
|
|
30416
|
+
{type: 'root', children: node.children},
|
|
30417
|
+
file,
|
|
30418
|
+
options
|
|
30419
|
+
// @ts-expect-error Assume a given parent yields a parent.
|
|
30420
|
+
).children
|
|
30421
|
+
}
|
|
30422
|
+
} else {
|
|
30423
|
+
clone = {...node}
|
|
30424
|
+
}
|
|
30425
|
+
|
|
30426
|
+
// Hack: `value` is supposed to be a string, but as none of the tools
|
|
30427
|
+
// (`parse5` or `hast-util-from-parse5`) looks at it, we can pass nodes
|
|
30428
|
+
// through.
|
|
30429
|
+
comment({type: 'comment', value: {stitch: clone}})
|
|
30430
|
+
}
|
|
30431
|
+
|
|
30432
|
+
function resetTokenizer() {
|
|
30433
|
+
/* c8 ignore next 2 */
|
|
30434
|
+
if (!tokenizer) throw new Error('Expected `tokenizer`')
|
|
30435
|
+
if (!posTracker) throw new Error('Expected `posTracker`')
|
|
30436
|
+
|
|
30437
|
+
// Process final characters if they’re still there after hibernating.
|
|
30438
|
+
// Similar to:
|
|
30439
|
+
// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/extensions/location-info/tokenizer-mixin.js#L95>.
|
|
30440
|
+
const token = tokenizer.currentCharacterToken
|
|
30441
|
+
|
|
30442
|
+
if (token) {
|
|
30443
|
+
token.location.endLine = posTracker.line
|
|
30444
|
+
token.location.endCol = posTracker.col + 1
|
|
30445
|
+
token.location.endOffset = posTracker.offset + 1
|
|
30446
|
+
parser._processToken(token)
|
|
30447
|
+
}
|
|
30448
|
+
|
|
30449
|
+
// Reset tokenizer:
|
|
30450
|
+
// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/tokenizer/index.js#L218-L234>.
|
|
30451
|
+
// Especially putting it back in the `data` state is useful: some elements,
|
|
30452
|
+
// like textareas and iframes, change the state.
|
|
30453
|
+
// See GH-7.
|
|
30454
|
+
// But also if broken HTML is in `raw`, and then a correct element is given.
|
|
30455
|
+
// See GH-11.
|
|
30456
|
+
tokenizer.tokenQueue = []
|
|
30457
|
+
tokenizer.state = dataState
|
|
30458
|
+
tokenizer.returnState = ''
|
|
30459
|
+
tokenizer.charRefCode = -1
|
|
30460
|
+
tokenizer.tempBuff = []
|
|
30461
|
+
tokenizer.lastStartTagName = ''
|
|
30462
|
+
tokenizer.consumedAfterSnapshot = -1
|
|
30463
|
+
tokenizer.active = false
|
|
30464
|
+
tokenizer.currentCharacterToken = undefined
|
|
30465
|
+
tokenizer.currentToken = undefined
|
|
30466
|
+
tokenizer.currentAttr = undefined
|
|
30467
|
+
}
|
|
30468
|
+
}
|
|
30469
|
+
)
|
|
30470
|
+
/**
|
|
30471
|
+
* @param {Element} node
|
|
30472
|
+
* @returns {HiddenToken}
|
|
30473
|
+
*/
|
|
30474
|
+
function startTag(node) {
|
|
30475
|
+
/** @type {P5Location} */
|
|
30476
|
+
const location = Object.assign(createParse5Location(node))
|
|
30477
|
+
// @ts-expect-error extra positional info.
|
|
30478
|
+
location.startTag = Object.assign({}, location)
|
|
30479
|
+
|
|
30480
|
+
// Untyped token.
|
|
30481
|
+
return {
|
|
30482
|
+
type: startTagToken,
|
|
30483
|
+
tagName: node.tagName,
|
|
30484
|
+
selfClosing: false,
|
|
30485
|
+
attrs: attributes(node),
|
|
30486
|
+
location
|
|
30487
|
+
}
|
|
30488
|
+
}
|
|
30489
|
+
|
|
30490
|
+
/**
|
|
30491
|
+
* @param {Element} node
|
|
30492
|
+
* @returns {Array<P5Attribute>}
|
|
30493
|
+
*/
|
|
30494
|
+
function attributes(node) {
|
|
30495
|
+
return toParse5({
|
|
30496
|
+
tagName: node.tagName,
|
|
30497
|
+
type: 'element',
|
|
30498
|
+
properties: node.properties,
|
|
30499
|
+
children: []
|
|
30500
|
+
// @ts-expect-error Assume element.
|
|
30501
|
+
}).attrs
|
|
30502
|
+
}
|
|
30503
|
+
|
|
30504
|
+
/**
|
|
30505
|
+
* @param {Element} node
|
|
30506
|
+
* @returns {HiddenToken}
|
|
30507
|
+
*/
|
|
30508
|
+
function endTag(node) {
|
|
30509
|
+
/** @type {P5Location} */
|
|
30510
|
+
const location = Object.assign(createParse5Location(node))
|
|
30511
|
+
// @ts-expect-error extra positional info.
|
|
30512
|
+
location.startTag = Object.assign({}, location)
|
|
30513
|
+
|
|
30514
|
+
// Untyped token.
|
|
30515
|
+
return {
|
|
30516
|
+
type: endTagToken,
|
|
30517
|
+
tagName: node.tagName,
|
|
30518
|
+
attrs: [],
|
|
30519
|
+
location
|
|
30520
|
+
}
|
|
30521
|
+
}
|
|
30522
|
+
|
|
30523
|
+
/**
|
|
30524
|
+
* @param {Node} node
|
|
30525
|
+
*/
|
|
30526
|
+
function lib_unknown(node) {
|
|
30527
|
+
throw new Error('Cannot compile `' + node.type + '` node')
|
|
30528
|
+
}
|
|
30529
|
+
|
|
30530
|
+
/**
|
|
30531
|
+
* @param {Node} node
|
|
30532
|
+
* @returns {boolean}
|
|
30533
|
+
*/
|
|
30534
|
+
function documentMode(node) {
|
|
30535
|
+
const head = node.type === 'root' ? node.children[0] : node
|
|
30536
|
+
return Boolean(
|
|
30537
|
+
head &&
|
|
30538
|
+
(head.type === 'doctype' ||
|
|
30539
|
+
(head.type === 'element' && head.tagName === 'html'))
|
|
30540
|
+
)
|
|
30541
|
+
}
|
|
30542
|
+
|
|
30543
|
+
/**
|
|
30544
|
+
* @param {Node|Stitch} node
|
|
30545
|
+
* @returns {P5Location}
|
|
30546
|
+
*/
|
|
30547
|
+
function createParse5Location(node) {
|
|
30548
|
+
const start = pointStart(node)
|
|
30549
|
+
const end = pointEnd(node)
|
|
30550
|
+
|
|
30551
|
+
return {
|
|
30552
|
+
startLine: start.line,
|
|
30553
|
+
startCol: start.column,
|
|
30554
|
+
startOffset: start.offset,
|
|
30555
|
+
endLine: end.line,
|
|
30556
|
+
endCol: end.column,
|
|
30557
|
+
endOffset: end.offset
|
|
30558
|
+
}
|
|
30559
|
+
}
|
|
30560
|
+
|
|
30561
|
+
/**
|
|
30562
|
+
* @param {VFile|Options|undefined} value
|
|
30563
|
+
* @return {value is Options}
|
|
30564
|
+
*/
|
|
30565
|
+
function isOptions(value) {
|
|
30566
|
+
return Boolean(value && !('message' in value && 'messages' in value))
|
|
30567
|
+
}
|
|
30568
|
+
|
|
30569
|
+
;// CONCATENATED MODULE: ../node_modules/rehype-raw/index.js
|
|
30570
|
+
/**
|
|
30571
|
+
* @typedef {import('hast').Root} Root
|
|
30572
|
+
* @typedef {import('hast-util-raw').Options} Options
|
|
30573
|
+
* @typedef {import('hast-util-raw')} DoNotTouchAsThisImportIncludesRawInTree
|
|
30574
|
+
*/
|
|
30575
|
+
|
|
30576
|
+
|
|
30577
|
+
|
|
30578
|
+
/**
|
|
30579
|
+
* Plugin to parse the tree again (and raw nodes).
|
|
30580
|
+
* Keeping positional info OK. 🙌
|
|
30581
|
+
*
|
|
30582
|
+
* @type {import('unified').Plugin<[Options?] | Array<void>, Root>}
|
|
30583
|
+
*/
|
|
30584
|
+
function rehypeRaw(options = {}) {
|
|
30585
|
+
return (tree, file) => {
|
|
30586
|
+
// Assume that when a root was given, it’s also returned.
|
|
30587
|
+
const result = /** @type {Root} */ (raw(tree, file, options))
|
|
30588
|
+
return result
|
|
30589
|
+
}
|
|
30590
|
+
}
|
|
30591
|
+
|
|
30592
|
+
// EXTERNAL MODULE: ../node_modules/github-slugger/index.js
|
|
30593
|
+
var github_slugger = __webpack_require__(449);
|
|
30594
|
+
;// CONCATENATED MODULE: ../node_modules/hast-util-has-property/index.js
|
|
30595
|
+
var hast_util_has_property_own = {}.hasOwnProperty
|
|
30596
|
+
|
|
30597
|
+
/**
|
|
30598
|
+
* Check if `node` has a set `name` property.
|
|
30599
|
+
*
|
|
30600
|
+
* @param {unknown} node
|
|
30601
|
+
* @param {string} name
|
|
30602
|
+
* @returns {boolean}
|
|
30603
|
+
*/
|
|
30604
|
+
function hasProperty(node, name) {
|
|
30605
|
+
/** @type {unknown} */
|
|
30606
|
+
var value =
|
|
30607
|
+
name &&
|
|
30608
|
+
node &&
|
|
30609
|
+
typeof node === 'object' &&
|
|
30610
|
+
// @ts-ignore Looks like a node.
|
|
30611
|
+
node.type === 'element' &&
|
|
30612
|
+
// @ts-ignore Looks like an element.
|
|
30613
|
+
node.properties &&
|
|
30614
|
+
// @ts-ignore Looks like an element.
|
|
30615
|
+
hast_util_has_property_own.call(node.properties, name) &&
|
|
30616
|
+
// @ts-ignore Looks like an element.
|
|
30617
|
+
node.properties[name]
|
|
30618
|
+
|
|
30619
|
+
return value !== null && value !== undefined && value !== false
|
|
30620
|
+
}
|
|
30621
|
+
|
|
30622
|
+
;// CONCATENATED MODULE: ../node_modules/hast-util-heading-rank/index.js
|
|
30623
|
+
/**
|
|
30624
|
+
* @typedef {import('hast').Parent} Parent
|
|
30625
|
+
* @typedef {import('hast').Root} Root
|
|
30626
|
+
* @typedef {Root|Parent['children'][number]} Node
|
|
30627
|
+
*/
|
|
30628
|
+
|
|
30629
|
+
/**
|
|
30630
|
+
* Rank of a heading: H1 -> 1, H2 -> 2, etc.
|
|
30631
|
+
*
|
|
30632
|
+
* @param {Node} node
|
|
30633
|
+
* @returns {number|null}
|
|
30634
|
+
*/
|
|
30635
|
+
function headingRank(node) {
|
|
30636
|
+
var name =
|
|
30637
|
+
(node && node.type === 'element' && node.tagName.toLowerCase()) || ''
|
|
30638
|
+
var code =
|
|
30639
|
+
name.length === 2 && name.charCodeAt(0) === 104 /* `h` */
|
|
30640
|
+
? name.charCodeAt(1)
|
|
30641
|
+
: 0
|
|
30642
|
+
return code > 48 /* `0` */ && code < 55 /* `7` */ ? code - 48 /* `0` */ : null
|
|
30643
|
+
}
|
|
30644
|
+
|
|
30645
|
+
;// CONCATENATED MODULE: ../node_modules/hast-util-to-string/index.js
|
|
30646
|
+
/**
|
|
30647
|
+
* @fileoverview
|
|
30648
|
+
* Get the plain-text value of a hast node.
|
|
30649
|
+
* @longdescription
|
|
30650
|
+
* ## Use
|
|
30651
|
+
*
|
|
30652
|
+
* ```js
|
|
30653
|
+
* import {h} from 'hastscript'
|
|
30654
|
+
* import {toString} from 'hast-util-to-string'
|
|
30655
|
+
*
|
|
30656
|
+
* toString(h('p', 'Alpha'))
|
|
30657
|
+
* //=> 'Alpha'
|
|
30658
|
+
* toString(h('div', [h('b', 'Bold'), ' and ', h('i', 'italic'), '.']))
|
|
30659
|
+
* //=> 'Bold and italic.'
|
|
30660
|
+
* ```
|
|
30661
|
+
*
|
|
30662
|
+
* ## API
|
|
30663
|
+
*
|
|
30664
|
+
* ### `toString(node)`
|
|
30665
|
+
*
|
|
30666
|
+
* Transform a node to a string.
|
|
30667
|
+
*/
|
|
30668
|
+
|
|
30669
|
+
/**
|
|
30670
|
+
* @typedef {import('hast').Root} Root
|
|
30671
|
+
* @typedef {import('hast').Element} Element
|
|
30672
|
+
* @typedef {Root|Root['children'][number]} Node
|
|
30673
|
+
*/
|
|
30674
|
+
|
|
30675
|
+
/**
|
|
30676
|
+
* Get the plain-text value of a hast node.
|
|
30677
|
+
*
|
|
30678
|
+
* @param {Node} node
|
|
30679
|
+
* @returns {string}
|
|
30680
|
+
*/
|
|
30681
|
+
function hast_util_to_string_toString(node) {
|
|
30682
|
+
// “The concatenation of data of all the Text node descendants of the context
|
|
30683
|
+
// object, in tree order.”
|
|
30684
|
+
if ('children' in node) {
|
|
30685
|
+
return hast_util_to_string_all(node)
|
|
30686
|
+
}
|
|
30687
|
+
|
|
30688
|
+
// “Context object’s data.”
|
|
30689
|
+
return 'value' in node ? node.value : ''
|
|
30690
|
+
}
|
|
30691
|
+
|
|
30692
|
+
/**
|
|
30693
|
+
* @param {Node} node
|
|
30694
|
+
* @returns {string}
|
|
30695
|
+
*/
|
|
30696
|
+
function hast_util_to_string_one(node) {
|
|
30697
|
+
if (node.type === 'text') {
|
|
30698
|
+
return node.value
|
|
30699
|
+
}
|
|
30700
|
+
|
|
30701
|
+
return 'children' in node ? hast_util_to_string_all(node) : ''
|
|
30702
|
+
}
|
|
30703
|
+
|
|
30704
|
+
/**
|
|
30705
|
+
* @param {Root|Element} node
|
|
30706
|
+
* @returns {string}
|
|
30707
|
+
*/
|
|
30708
|
+
function hast_util_to_string_all(node) {
|
|
30709
|
+
let index = -1
|
|
30710
|
+
/** @type {string[]} */
|
|
30711
|
+
const result = []
|
|
30712
|
+
|
|
30713
|
+
while (++index < node.children.length) {
|
|
30714
|
+
result[index] = hast_util_to_string_one(node.children[index])
|
|
30715
|
+
}
|
|
30716
|
+
|
|
30717
|
+
return result.join('')
|
|
30718
|
+
}
|
|
30719
|
+
|
|
30720
|
+
;// CONCATENATED MODULE: ../node_modules/rehype-slug/index.js
|
|
30721
|
+
/**
|
|
30722
|
+
* @typedef {import('hast').Root} Root
|
|
30723
|
+
*/
|
|
30724
|
+
|
|
30725
|
+
|
|
30726
|
+
|
|
30727
|
+
|
|
30728
|
+
|
|
30729
|
+
|
|
30730
|
+
|
|
30731
|
+
const slugs = new github_slugger()
|
|
30732
|
+
|
|
30733
|
+
/**
|
|
30734
|
+
* Plugin to add `id`s to headings.
|
|
30735
|
+
*
|
|
30736
|
+
* @type {import('unified').Plugin<Array<void>, Root>}
|
|
30737
|
+
*/
|
|
30738
|
+
function rehypeSlug() {
|
|
30739
|
+
return (tree) => {
|
|
30740
|
+
slugs.reset()
|
|
30741
|
+
|
|
30742
|
+
visit(tree, 'element', (node) => {
|
|
30743
|
+
if (headingRank(node) && node.properties && !hasProperty(node, 'id')) {
|
|
30744
|
+
node.properties.id = slugs.slug(hast_util_to_string_toString(node))
|
|
30745
|
+
}
|
|
30746
|
+
})
|
|
30747
|
+
}
|
|
30748
|
+
}
|
|
30749
|
+
|
|
30750
|
+
;// CONCATENATED MODULE: ../node_modules/hast-util-is-element/index.js
|
|
30751
|
+
/**
|
|
30752
|
+
* @typedef {import('unist').Node} Node
|
|
30753
|
+
* @typedef {import('unist').Parent} Parent
|
|
30754
|
+
* @typedef {import('hast').Element} Element
|
|
30755
|
+
*
|
|
30756
|
+
* @typedef {string} TagName
|
|
30757
|
+
* @typedef {null|undefined|TagName|TestFunctionAnything|Array.<TagName|TestFunctionAnything>} Test
|
|
30758
|
+
*/
|
|
30759
|
+
|
|
30760
|
+
/**
|
|
30761
|
+
* @template {Element} T
|
|
30762
|
+
* @typedef {null|undefined|T['tagName']|TestFunctionPredicate<T>|Array.<T['tagName']|TestFunctionPredicate<T>>} PredicateTest
|
|
30763
|
+
*/
|
|
30764
|
+
|
|
30765
|
+
/**
|
|
30766
|
+
* Check if an element passes a test
|
|
30767
|
+
*
|
|
30768
|
+
* @callback TestFunctionAnything
|
|
30769
|
+
* @param {Element} element
|
|
30770
|
+
* @param {number|null|undefined} [index]
|
|
30771
|
+
* @param {Parent|null|undefined} [parent]
|
|
30772
|
+
* @returns {boolean|void}
|
|
30773
|
+
*/
|
|
30774
|
+
|
|
30775
|
+
/**
|
|
30776
|
+
* Check if an element passes a certain node test
|
|
30777
|
+
*
|
|
30778
|
+
* @template {Element} X
|
|
30779
|
+
* @callback TestFunctionPredicate
|
|
30780
|
+
* @param {Element} element
|
|
30781
|
+
* @param {number|null|undefined} [index]
|
|
30782
|
+
* @param {Parent|null|undefined} [parent]
|
|
30783
|
+
* @returns {element is X}
|
|
30784
|
+
*/
|
|
30785
|
+
|
|
30786
|
+
/**
|
|
30787
|
+
* Check if a node is an element and passes a certain node test
|
|
30788
|
+
*
|
|
30789
|
+
* @callback AssertAnything
|
|
30790
|
+
* @param {unknown} [node]
|
|
30791
|
+
* @param {number|null|undefined} [index]
|
|
30792
|
+
* @param {Parent|null|undefined} [parent]
|
|
30793
|
+
* @returns {boolean}
|
|
30794
|
+
*/
|
|
30795
|
+
|
|
30796
|
+
/**
|
|
30797
|
+
* Check if a node is an element and passes a certain node test
|
|
30798
|
+
*
|
|
30799
|
+
* @template {Element} Y
|
|
30800
|
+
* @callback AssertPredicate
|
|
30801
|
+
* @param {unknown} [node]
|
|
30802
|
+
* @param {number|null|undefined} [index]
|
|
30803
|
+
* @param {Parent|null|undefined} [parent]
|
|
30804
|
+
* @returns {node is Y}
|
|
30805
|
+
*/
|
|
30806
|
+
|
|
30807
|
+
// Check if `node` is an `element` and whether it passes the given test.
|
|
30808
|
+
const isElement =
|
|
30809
|
+
/**
|
|
30810
|
+
* Check if a node is an element and passes a test.
|
|
30811
|
+
* When a `parent` node is known the `index` of node should also be given.
|
|
30812
|
+
*
|
|
30813
|
+
* @type {(
|
|
30814
|
+
* (() => false) &
|
|
30815
|
+
* (<T extends Element = Element>(node: unknown, test?: PredicateTest<T>, index?: number, parent?: Parent, context?: unknown) => node is T) &
|
|
30816
|
+
* ((node: unknown, test: Test, index?: number, parent?: Parent, context?: unknown) => boolean)
|
|
30817
|
+
* )}
|
|
30818
|
+
*/
|
|
30819
|
+
(
|
|
30820
|
+
/**
|
|
30821
|
+
* Check if a node passes a test.
|
|
30822
|
+
* When a `parent` node is known the `index` of node should also be given.
|
|
30823
|
+
*
|
|
30824
|
+
* @param {unknown} [node] Node to check
|
|
30825
|
+
* @param {Test} [test] When nullish, checks if `node` is a `Node`.
|
|
30826
|
+
* When `string`, works like passing `function (node) {return node.type === test}`.
|
|
30827
|
+
* When `function` checks if function passed the node is true.
|
|
30828
|
+
* When `array`, checks any one of the subtests pass.
|
|
30829
|
+
* @param {number} [index] Position of `node` in `parent`
|
|
30830
|
+
* @param {Parent} [parent] Parent of `node`
|
|
30831
|
+
* @param {unknown} [context] Context object to invoke `test` with
|
|
30832
|
+
* @returns {boolean} Whether test passed and `node` is an `Element` (object with `type` set to `element` and `tagName` set to a non-empty string).
|
|
30833
|
+
*/
|
|
30834
|
+
// eslint-disable-next-line max-params
|
|
30835
|
+
function (node, test, index, parent, context) {
|
|
30836
|
+
const check = convertElement(test)
|
|
30978
30837
|
|
|
30979
|
-
|
|
30980
|
-
|
|
30981
|
-
|
|
30982
|
-
|
|
30838
|
+
if (
|
|
30839
|
+
index !== undefined &&
|
|
30840
|
+
index !== null &&
|
|
30841
|
+
(typeof index !== 'number' ||
|
|
30842
|
+
index < 0 ||
|
|
30843
|
+
index === Number.POSITIVE_INFINITY)
|
|
30844
|
+
) {
|
|
30845
|
+
throw new Error('Expected positive finite index for child node')
|
|
30846
|
+
}
|
|
30983
30847
|
|
|
30984
|
-
|
|
30985
|
-
|
|
30986
|
-
|
|
30987
|
-
|
|
30988
|
-
|
|
30989
|
-
|
|
30990
|
-
tokenizer.state === 'NAMED_CHARACTER_REFERENCE_STATE' ||
|
|
30991
|
-
tokenizer.state === 'NUMERIC_CHARACTER_REFERENCE_END_STATE'
|
|
30992
|
-
) {
|
|
30993
|
-
preprocessor.lastChunkWritten = true
|
|
30994
|
-
tokenizer[tokenizer.state](tokenizer._consume())
|
|
30995
|
-
}
|
|
30848
|
+
if (
|
|
30849
|
+
parent !== undefined &&
|
|
30850
|
+
parent !== null &&
|
|
30851
|
+
(!parent.type || !parent.children)
|
|
30852
|
+
) {
|
|
30853
|
+
throw new Error('Expected parent node')
|
|
30996
30854
|
}
|
|
30997
30855
|
|
|
30998
|
-
|
|
30999
|
-
|
|
31000
|
-
|
|
31001
|
-
|
|
31002
|
-
stitches = true
|
|
30856
|
+
// @ts-expect-error Looks like a node.
|
|
30857
|
+
if (!node || !node.type || typeof node.type !== 'string') {
|
|
30858
|
+
return false
|
|
30859
|
+
}
|
|
31003
30860
|
|
|
31004
|
-
|
|
31005
|
-
|
|
30861
|
+
if (
|
|
30862
|
+
(parent === undefined || parent === null) !==
|
|
30863
|
+
(index === undefined || index === null)
|
|
30864
|
+
) {
|
|
30865
|
+
throw new Error('Expected both parent and index')
|
|
30866
|
+
}
|
|
31006
30867
|
|
|
31007
|
-
|
|
31008
|
-
|
|
31009
|
-
|
|
31010
|
-
clone = {
|
|
31011
|
-
...node,
|
|
31012
|
-
children: raw(
|
|
31013
|
-
{type: 'root', children: node.children},
|
|
31014
|
-
file,
|
|
31015
|
-
options
|
|
31016
|
-
// @ts-expect-error Assume a given parent yields a parent.
|
|
31017
|
-
).children
|
|
31018
|
-
}
|
|
31019
|
-
} else {
|
|
31020
|
-
clone = {...node}
|
|
31021
|
-
}
|
|
30868
|
+
return check.call(context, node, index, parent)
|
|
30869
|
+
}
|
|
30870
|
+
)
|
|
31022
30871
|
|
|
31023
|
-
|
|
31024
|
-
|
|
31025
|
-
|
|
31026
|
-
|
|
30872
|
+
const convertElement =
|
|
30873
|
+
/**
|
|
30874
|
+
* @type {(
|
|
30875
|
+
* (<T extends Element>(test: T['tagName']|TestFunctionPredicate<T>) => AssertPredicate<T>) &
|
|
30876
|
+
* ((test?: Test) => AssertAnything)
|
|
30877
|
+
* )}
|
|
30878
|
+
*/
|
|
30879
|
+
(
|
|
30880
|
+
/**
|
|
30881
|
+
* Generate an assertion from a check.
|
|
30882
|
+
* @param {Test} [test]
|
|
30883
|
+
* When nullish, checks if `node` is a `Node`.
|
|
30884
|
+
* When `string`, works like passing `function (node) {return node.type === test}`.
|
|
30885
|
+
* When `function` checks if function passed the node is true.
|
|
30886
|
+
* When `object`, checks that all keys in test are in node, and that they have (strictly) equal values.
|
|
30887
|
+
* When `array`, checks any one of the subtests pass.
|
|
30888
|
+
* @returns {AssertAnything}
|
|
30889
|
+
*/
|
|
30890
|
+
function (test) {
|
|
30891
|
+
if (test === undefined || test === null) {
|
|
30892
|
+
return hast_util_is_element_element
|
|
31027
30893
|
}
|
|
31028
30894
|
|
|
31029
|
-
|
|
31030
|
-
|
|
31031
|
-
|
|
31032
|
-
if (!posTracker) throw new Error('Expected `posTracker`')
|
|
31033
|
-
|
|
31034
|
-
// Process final characters if they’re still there after hibernating.
|
|
31035
|
-
// Similar to:
|
|
31036
|
-
// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/extensions/location-info/tokenizer-mixin.js#L95>.
|
|
31037
|
-
const token = tokenizer.currentCharacterToken
|
|
30895
|
+
if (typeof test === 'string') {
|
|
30896
|
+
return tagNameFactory(test)
|
|
30897
|
+
}
|
|
31038
30898
|
|
|
31039
|
-
|
|
31040
|
-
|
|
31041
|
-
|
|
31042
|
-
token.location.endOffset = posTracker.offset + 1
|
|
31043
|
-
parser._processToken(token)
|
|
31044
|
-
}
|
|
30899
|
+
if (typeof test === 'object') {
|
|
30900
|
+
return hast_util_is_element_anyFactory(test)
|
|
30901
|
+
}
|
|
31045
30902
|
|
|
31046
|
-
|
|
31047
|
-
|
|
31048
|
-
// Especially putting it back in the `data` state is useful: some elements,
|
|
31049
|
-
// like textareas and iframes, change the state.
|
|
31050
|
-
// See GH-7.
|
|
31051
|
-
// But also if broken HTML is in `raw`, and then a correct element is given.
|
|
31052
|
-
// See GH-11.
|
|
31053
|
-
tokenizer.tokenQueue = []
|
|
31054
|
-
tokenizer.state = dataState
|
|
31055
|
-
tokenizer.returnState = ''
|
|
31056
|
-
tokenizer.charRefCode = -1
|
|
31057
|
-
tokenizer.tempBuff = []
|
|
31058
|
-
tokenizer.lastStartTagName = ''
|
|
31059
|
-
tokenizer.consumedAfterSnapshot = -1
|
|
31060
|
-
tokenizer.active = false
|
|
31061
|
-
tokenizer.currentCharacterToken = undefined
|
|
31062
|
-
tokenizer.currentToken = undefined
|
|
31063
|
-
tokenizer.currentAttr = undefined
|
|
30903
|
+
if (typeof test === 'function') {
|
|
30904
|
+
return hast_util_is_element_castFactory(test)
|
|
31064
30905
|
}
|
|
30906
|
+
|
|
30907
|
+
throw new Error('Expected function, string, or array as test')
|
|
31065
30908
|
}
|
|
31066
30909
|
)
|
|
30910
|
+
|
|
31067
30911
|
/**
|
|
31068
|
-
* @param {
|
|
31069
|
-
* @returns {
|
|
30912
|
+
* @param {Array.<TagName|TestFunctionAnything>} tests
|
|
30913
|
+
* @returns {AssertAnything}
|
|
31070
30914
|
*/
|
|
31071
|
-
function
|
|
31072
|
-
/** @type {
|
|
31073
|
-
const
|
|
31074
|
-
|
|
31075
|
-
location.startTag = Object.assign({}, location)
|
|
30915
|
+
function hast_util_is_element_anyFactory(tests) {
|
|
30916
|
+
/** @type {Array.<AssertAnything>} */
|
|
30917
|
+
const checks = []
|
|
30918
|
+
let index = -1
|
|
31076
30919
|
|
|
31077
|
-
|
|
31078
|
-
|
|
31079
|
-
type: startTagToken,
|
|
31080
|
-
tagName: node.tagName,
|
|
31081
|
-
selfClosing: false,
|
|
31082
|
-
attrs: attributes(node),
|
|
31083
|
-
location
|
|
30920
|
+
while (++index < tests.length) {
|
|
30921
|
+
checks[index] = convertElement(tests[index])
|
|
31084
30922
|
}
|
|
31085
|
-
}
|
|
31086
30923
|
|
|
31087
|
-
|
|
31088
|
-
* @param {Element} node
|
|
31089
|
-
* @returns {Array<P5Attribute>}
|
|
31090
|
-
*/
|
|
31091
|
-
function attributes(node) {
|
|
31092
|
-
return toParse5({
|
|
31093
|
-
tagName: node.tagName,
|
|
31094
|
-
type: 'element',
|
|
31095
|
-
properties: node.properties,
|
|
31096
|
-
children: []
|
|
31097
|
-
// @ts-expect-error Assume element.
|
|
31098
|
-
}).attrs
|
|
31099
|
-
}
|
|
30924
|
+
return hast_util_is_element_castFactory(any)
|
|
31100
30925
|
|
|
31101
|
-
/**
|
|
31102
|
-
|
|
31103
|
-
|
|
31104
|
-
|
|
31105
|
-
|
|
31106
|
-
|
|
31107
|
-
|
|
31108
|
-
// @ts-expect-error extra positional info.
|
|
31109
|
-
location.startTag = Object.assign({}, location)
|
|
30926
|
+
/**
|
|
30927
|
+
* @this {unknown}
|
|
30928
|
+
* @param {unknown[]} parameters
|
|
30929
|
+
* @returns {boolean}
|
|
30930
|
+
*/
|
|
30931
|
+
function any(...parameters) {
|
|
30932
|
+
let index = -1
|
|
31110
30933
|
|
|
31111
|
-
|
|
31112
|
-
|
|
31113
|
-
|
|
31114
|
-
|
|
31115
|
-
|
|
31116
|
-
|
|
30934
|
+
while (++index < checks.length) {
|
|
30935
|
+
if (checks[index].call(this, ...parameters)) {
|
|
30936
|
+
return true
|
|
30937
|
+
}
|
|
30938
|
+
}
|
|
30939
|
+
|
|
30940
|
+
return false
|
|
31117
30941
|
}
|
|
31118
30942
|
}
|
|
31119
30943
|
|
|
31120
30944
|
/**
|
|
31121
|
-
*
|
|
30945
|
+
* Utility to convert a string into a function which checks a given node’s tag
|
|
30946
|
+
* name for said string.
|
|
30947
|
+
*
|
|
30948
|
+
* @param {TagName} check
|
|
30949
|
+
* @returns {AssertAnything}
|
|
31122
30950
|
*/
|
|
31123
|
-
function
|
|
31124
|
-
|
|
31125
|
-
}
|
|
30951
|
+
function tagNameFactory(check) {
|
|
30952
|
+
return tagName
|
|
31126
30953
|
|
|
31127
|
-
/**
|
|
31128
|
-
|
|
31129
|
-
|
|
31130
|
-
|
|
31131
|
-
function
|
|
31132
|
-
|
|
31133
|
-
|
|
31134
|
-
head &&
|
|
31135
|
-
(head.type === 'doctype' ||
|
|
31136
|
-
(head.type === 'element' && head.tagName === 'html'))
|
|
31137
|
-
)
|
|
30954
|
+
/**
|
|
30955
|
+
* @param {unknown} node
|
|
30956
|
+
* @returns {boolean}
|
|
30957
|
+
*/
|
|
30958
|
+
function tagName(node) {
|
|
30959
|
+
return hast_util_is_element_element(node) && node.tagName === check
|
|
30960
|
+
}
|
|
31138
30961
|
}
|
|
31139
30962
|
|
|
31140
30963
|
/**
|
|
31141
|
-
* @param {
|
|
31142
|
-
* @returns {
|
|
30964
|
+
* @param {TestFunctionAnything} check
|
|
30965
|
+
* @returns {AssertAnything}
|
|
31143
30966
|
*/
|
|
31144
|
-
function
|
|
31145
|
-
|
|
31146
|
-
const end = pointEnd(node)
|
|
30967
|
+
function hast_util_is_element_castFactory(check) {
|
|
30968
|
+
return assertion
|
|
31147
30969
|
|
|
31148
|
-
|
|
31149
|
-
|
|
31150
|
-
|
|
31151
|
-
|
|
31152
|
-
|
|
31153
|
-
|
|
31154
|
-
|
|
30970
|
+
/**
|
|
30971
|
+
* @this {unknown}
|
|
30972
|
+
* @param {unknown} node
|
|
30973
|
+
* @param {Array.<unknown>} parameters
|
|
30974
|
+
* @returns {boolean}
|
|
30975
|
+
*/
|
|
30976
|
+
function assertion(node, ...parameters) {
|
|
30977
|
+
// @ts-expect-error: fine.
|
|
30978
|
+
return hast_util_is_element_element(node) && Boolean(check.call(this, node, ...parameters))
|
|
31155
30979
|
}
|
|
31156
30980
|
}
|
|
31157
30981
|
|
|
31158
30982
|
/**
|
|
31159
|
-
*
|
|
31160
|
-
* @
|
|
30983
|
+
* Utility to return true if this is an element.
|
|
30984
|
+
* @param {unknown} node
|
|
30985
|
+
* @returns {node is Element}
|
|
31161
30986
|
*/
|
|
31162
|
-
function
|
|
31163
|
-
return Boolean(
|
|
30987
|
+
function hast_util_is_element_element(node) {
|
|
30988
|
+
return Boolean(
|
|
30989
|
+
node &&
|
|
30990
|
+
typeof node === 'object' &&
|
|
30991
|
+
// @ts-expect-error Looks like a node.
|
|
30992
|
+
node.type === 'element' &&
|
|
30993
|
+
// @ts-expect-error Looks like an element.
|
|
30994
|
+
typeof node.tagName === 'string'
|
|
30995
|
+
)
|
|
31164
30996
|
}
|
|
31165
30997
|
|
|
31166
|
-
;// CONCATENATED MODULE: ../node_modules/rehype-
|
|
30998
|
+
;// CONCATENATED MODULE: ../node_modules/rehype-autolink-headings/lib/index.js
|
|
31167
30999
|
/**
|
|
31168
31000
|
* @typedef {import('hast').Root} Root
|
|
31169
|
-
* @typedef {import('hast
|
|
31170
|
-
* @typedef {import('hast
|
|
31001
|
+
* @typedef {import('hast').Parent} Parent
|
|
31002
|
+
* @typedef {import('hast').Element} Element
|
|
31003
|
+
* @typedef {Element['children'][number]} ElementChild
|
|
31004
|
+
* @typedef {import('hast').Properties} Properties
|
|
31005
|
+
* @typedef {import('hast-util-is-element').Test} Test
|
|
31006
|
+
*
|
|
31007
|
+
* @typedef {'prepend'|'append'|'wrap'|'before'|'after'} Behavior
|
|
31008
|
+
*
|
|
31009
|
+
* @callback Build
|
|
31010
|
+
* @param {Element} node
|
|
31011
|
+
* @returns {ElementChild|ElementChild[]}
|
|
31012
|
+
*
|
|
31013
|
+
* @typedef Options
|
|
31014
|
+
* Configuration.
|
|
31015
|
+
* @property {Behavior} [behavior='prepend']
|
|
31016
|
+
* How to create links.
|
|
31017
|
+
* @property {Behavior} [behaviour]
|
|
31018
|
+
* Please use `behavior` instead
|
|
31019
|
+
* @property {Properties} [properties]
|
|
31020
|
+
* Extra properties to set on the link when injecting.
|
|
31021
|
+
* Defaults to `{ariaHidden: true, tabIndex: -1}` when `'prepend'` or
|
|
31022
|
+
* `'append'`.
|
|
31023
|
+
* @property {ElementChild|ElementChild[]|Build} [content={type: 'element', tagName: 'span', properties: {className: ['icon', 'icon-link']}, children: []}]
|
|
31024
|
+
* hast nodes to insert in the link.
|
|
31025
|
+
* @property {ElementChild|ElementChild[]|Build} [group]
|
|
31026
|
+
* hast node to wrap the heading and link with, if `behavior` is `'before'` or
|
|
31027
|
+
* `'after'`.
|
|
31028
|
+
* There is no default.
|
|
31029
|
+
* @property {Test} [test]
|
|
31030
|
+
* Test to define which heading elements are linked.
|
|
31031
|
+
* Any test that can be given to `hast-util-is-element` is supported.
|
|
31032
|
+
* The default (no test) is to link all headings.
|
|
31033
|
+
* Can be used to link only h1-h3, or for example all except h1.
|
|
31171
31034
|
*/
|
|
31172
31035
|
|
|
31173
31036
|
|
|
31174
31037
|
|
|
31038
|
+
|
|
31039
|
+
|
|
31040
|
+
|
|
31041
|
+
|
|
31042
|
+
/** @type {Element} */
|
|
31043
|
+
const contentDefaults = {
|
|
31044
|
+
type: 'element',
|
|
31045
|
+
tagName: 'span',
|
|
31046
|
+
properties: {className: ['icon', 'icon-link']},
|
|
31047
|
+
children: []
|
|
31048
|
+
}
|
|
31049
|
+
|
|
31175
31050
|
/**
|
|
31176
|
-
* Plugin to
|
|
31177
|
-
* Keeping positional info OK. 🙌
|
|
31051
|
+
* Plugin to automatically add links to headings (h1-h6).
|
|
31178
31052
|
*
|
|
31179
|
-
* @type {import('unified').Plugin<[Options?]
|
|
31053
|
+
* @type {import('unified').Plugin<[Options?]|void[], Root>}
|
|
31180
31054
|
*/
|
|
31181
|
-
function
|
|
31182
|
-
|
|
31183
|
-
|
|
31184
|
-
|
|
31185
|
-
|
|
31055
|
+
function rehypeAutolinkHeadings(options = {}) {
|
|
31056
|
+
let props = options.properties
|
|
31057
|
+
const behavior = options.behaviour || options.behavior || 'prepend'
|
|
31058
|
+
const content = options.content || contentDefaults
|
|
31059
|
+
const group = options.group
|
|
31060
|
+
const is = convertElement(options.test)
|
|
31061
|
+
|
|
31062
|
+
/** @type {import('unist-util-visit/complex-types').Visitor<Element>} */
|
|
31063
|
+
let method
|
|
31064
|
+
|
|
31065
|
+
if (behavior === 'wrap') {
|
|
31066
|
+
method = wrap
|
|
31067
|
+
} else if (behavior === 'before' || behavior === 'after') {
|
|
31068
|
+
method = around
|
|
31069
|
+
} else {
|
|
31070
|
+
if (!props) {
|
|
31071
|
+
props = {ariaHidden: 'true', tabIndex: -1}
|
|
31072
|
+
}
|
|
31073
|
+
|
|
31074
|
+
method = inject
|
|
31075
|
+
}
|
|
31076
|
+
|
|
31077
|
+
return (tree) => {
|
|
31078
|
+
visit(tree, 'element', (node, index, parent) => {
|
|
31079
|
+
if (
|
|
31080
|
+
headingRank(node) &&
|
|
31081
|
+
hasProperty(node, 'id') &&
|
|
31082
|
+
is(node, index, parent)
|
|
31083
|
+
) {
|
|
31084
|
+
return method(node, index, parent)
|
|
31085
|
+
}
|
|
31086
|
+
})
|
|
31087
|
+
}
|
|
31088
|
+
|
|
31089
|
+
/** @type {import('unist-util-visit/complex-types').Visitor<Element>} */
|
|
31090
|
+
function inject(node) {
|
|
31091
|
+
node.children[behavior === 'prepend' ? 'unshift' : 'push'](
|
|
31092
|
+
create(node, extend(true, {}, props), toChildren(content, node))
|
|
31093
|
+
)
|
|
31094
|
+
|
|
31095
|
+
return [SKIP]
|
|
31096
|
+
}
|
|
31097
|
+
|
|
31098
|
+
/** @type {import('unist-util-visit/complex-types').Visitor<Element>} */
|
|
31099
|
+
function around(node, index, parent) {
|
|
31100
|
+
// Uncommon.
|
|
31101
|
+
/* c8 ignore next */
|
|
31102
|
+
if (typeof index !== 'number' || !parent) return
|
|
31103
|
+
|
|
31104
|
+
const link = create(
|
|
31105
|
+
node,
|
|
31106
|
+
extend(true, {}, props),
|
|
31107
|
+
toChildren(content, node)
|
|
31108
|
+
)
|
|
31109
|
+
let nodes = behavior === 'before' ? [link, node] : [node, link]
|
|
31110
|
+
|
|
31111
|
+
if (group) {
|
|
31112
|
+
const grouping = toNode(group, node)
|
|
31113
|
+
|
|
31114
|
+
if (grouping && !Array.isArray(grouping) && grouping.type === 'element') {
|
|
31115
|
+
grouping.children = nodes
|
|
31116
|
+
nodes = [grouping]
|
|
31117
|
+
}
|
|
31118
|
+
}
|
|
31119
|
+
|
|
31120
|
+
parent.children.splice(index, 1, ...nodes)
|
|
31121
|
+
|
|
31122
|
+
return [SKIP, index + nodes.length]
|
|
31123
|
+
}
|
|
31124
|
+
|
|
31125
|
+
/** @type {import('unist-util-visit/complex-types').Visitor<Element>} */
|
|
31126
|
+
function wrap(node) {
|
|
31127
|
+
node.children = [create(node, extend(true, {}, props), node.children)]
|
|
31128
|
+
return [SKIP]
|
|
31129
|
+
}
|
|
31130
|
+
|
|
31131
|
+
/**
|
|
31132
|
+
* @param {ElementChild|ElementChild[]|Build} value
|
|
31133
|
+
* @param {Element} node
|
|
31134
|
+
* @returns {ElementChild[]}
|
|
31135
|
+
*/
|
|
31136
|
+
function toChildren(value, node) {
|
|
31137
|
+
const result = toNode(value, node)
|
|
31138
|
+
return Array.isArray(result) ? result : [result]
|
|
31139
|
+
}
|
|
31140
|
+
|
|
31141
|
+
/**
|
|
31142
|
+
* @param {ElementChild|ElementChild[]|Build} value
|
|
31143
|
+
* @param {Element} node
|
|
31144
|
+
* @returns {ElementChild|ElementChild[]}
|
|
31145
|
+
*/
|
|
31146
|
+
function toNode(value, node) {
|
|
31147
|
+
if (typeof value === 'function') return value(node)
|
|
31148
|
+
return extend(true, Array.isArray(value) ? [] : {}, value)
|
|
31149
|
+
}
|
|
31150
|
+
|
|
31151
|
+
/**
|
|
31152
|
+
* @param {Element} node
|
|
31153
|
+
* @param {Properties} props
|
|
31154
|
+
* @param {ElementChild[]} children
|
|
31155
|
+
* @returns {Element}
|
|
31156
|
+
*/
|
|
31157
|
+
function create(node, props, children) {
|
|
31158
|
+
return {
|
|
31159
|
+
type: 'element',
|
|
31160
|
+
tagName: 'a',
|
|
31161
|
+
properties: Object.assign({}, props, {
|
|
31162
|
+
// Fix hast types and make them required.
|
|
31163
|
+
/* c8 ignore next */
|
|
31164
|
+
href: '#' + (node.properties || {}).id
|
|
31165
|
+
}),
|
|
31166
|
+
children
|
|
31167
|
+
}
|
|
31186
31168
|
}
|
|
31187
31169
|
}
|
|
31188
31170
|
|
|
@@ -31310,13 +31292,17 @@ const rehypeIgnore = (options = {}) => {
|
|
|
31310
31292
|
// }
|
|
31311
31293
|
let start = false;
|
|
31312
31294
|
node.children = node.children.filter((item) => {
|
|
31313
|
-
if (item.type === '
|
|
31314
|
-
|
|
31315
|
-
|
|
31316
|
-
|
|
31317
|
-
|
|
31318
|
-
|
|
31319
|
-
|
|
31295
|
+
if (item.type === 'raw' || item.type === 'comment') {
|
|
31296
|
+
let str = item.value?.trim();
|
|
31297
|
+
str = str.replace(/^<!--(.*?)-->/, '$1');
|
|
31298
|
+
if (str === openDelimiter) {
|
|
31299
|
+
start = true;
|
|
31300
|
+
return false;
|
|
31301
|
+
}
|
|
31302
|
+
if (str === closeDelimiter) {
|
|
31303
|
+
start = false;
|
|
31304
|
+
return false;
|
|
31305
|
+
}
|
|
31320
31306
|
}
|
|
31321
31307
|
return !start;
|
|
31322
31308
|
});
|
|
@@ -60374,32 +60360,17 @@ var octiconLink = {
|
|
|
60374
60360
|
}]
|
|
60375
60361
|
};
|
|
60376
60362
|
|
|
60377
|
-
// EXTERNAL MODULE: ../node_modules/@uiw/copy-to-clipboard/dist/copy-to-clipboard.umd.js
|
|
60378
|
-
var copy_to_clipboard_umd = __webpack_require__(71);
|
|
60379
|
-
var copy_to_clipboard_umd_default = /*#__PURE__*/__webpack_require__.n(copy_to_clipboard_umd);
|
|
60380
60363
|
;// CONCATENATED MODULE: ../node_modules/@uiw/react-markdown-preview/esm/nodes/copy.js
|
|
60381
|
-
|
|
60382
60364
|
function copyElement(str) {
|
|
60383
60365
|
if (str === void 0) {
|
|
60384
60366
|
str = '';
|
|
60385
60367
|
}
|
|
60386
|
-
|
|
60387
60368
|
return {
|
|
60388
60369
|
type: 'element',
|
|
60389
60370
|
tagName: 'div',
|
|
60390
60371
|
properties: {
|
|
60391
|
-
|
|
60392
|
-
|
|
60393
|
-
var target = event.currentTarget || event.target;
|
|
60394
|
-
target.classList.add('active');
|
|
60395
|
-
copy_to_clipboard_umd_default()(target.dataset.code, function () {
|
|
60396
|
-
setTimeout(() => {
|
|
60397
|
-
target.classList.remove('active');
|
|
60398
|
-
}, 2000);
|
|
60399
|
-
});
|
|
60400
|
-
},
|
|
60401
|
-
'data-code': str,
|
|
60402
|
-
class: 'copied'
|
|
60372
|
+
class: 'copied',
|
|
60373
|
+
'data-code': str
|
|
60403
60374
|
},
|
|
60404
60375
|
children: [{
|
|
60405
60376
|
type: 'element',
|
|
@@ -60453,6 +60424,33 @@ function copyElement(str) {
|
|
|
60453
60424
|
};
|
|
60454
60425
|
}
|
|
60455
60426
|
|
|
60427
|
+
// EXTERNAL MODULE: ../node_modules/@uiw/copy-to-clipboard/dist/copy-to-clipboard.umd.js
|
|
60428
|
+
var copy_to_clipboard_umd = __webpack_require__(71);
|
|
60429
|
+
var copy_to_clipboard_umd_default = /*#__PURE__*/__webpack_require__.n(copy_to_clipboard_umd);
|
|
60430
|
+
;// CONCATENATED MODULE: ../node_modules/@uiw/react-markdown-preview/esm/plugins/useCopied.js
|
|
60431
|
+
|
|
60432
|
+
|
|
60433
|
+
function useCopied(container) {
|
|
60434
|
+
var handle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(event => {
|
|
60435
|
+
var target = event.currentTarget || event.target;
|
|
60436
|
+
target.classList.add('active');
|
|
60437
|
+
copy_to_clipboard_umd_default()(target.dataset.code, function () {
|
|
60438
|
+
setTimeout(() => {
|
|
60439
|
+
target.classList.remove('active');
|
|
60440
|
+
}, 2000);
|
|
60441
|
+
});
|
|
60442
|
+
}, []);
|
|
60443
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
|
60444
|
+
var _container$current;
|
|
60445
|
+
var btns = (_container$current = container.current) == null ? void 0 : _container$current.querySelectorAll('pre code + div.copied');
|
|
60446
|
+
btns && Array.from(btns).forEach(elm => elm.addEventListener('click', handle, false));
|
|
60447
|
+
return () => {
|
|
60448
|
+
btns && Array.from(btns).forEach(elm => elm.removeEventListener('click', handle, false));
|
|
60449
|
+
};
|
|
60450
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
60451
|
+
}, [container]);
|
|
60452
|
+
}
|
|
60453
|
+
|
|
60456
60454
|
;// CONCATENATED MODULE: ../node_modules/@uiw/react-markdown-preview/esm/styles/markdown.css
|
|
60457
60455
|
// extracted by mini-css-extract-plugin
|
|
60458
60456
|
/* harmony default export */ const styles_markdown = ({});
|
|
@@ -60463,7 +60461,6 @@ var reservedMeta = function reservedMeta(options) {
|
|
|
60463
60461
|
if (options === void 0) {
|
|
60464
60462
|
options = {};
|
|
60465
60463
|
}
|
|
60466
|
-
|
|
60467
60464
|
return tree => {
|
|
60468
60465
|
visit(tree, node => {
|
|
60469
60466
|
if (node.type === 'element' && node.tagName === 'code' && node.data && node.data.meta) {
|
|
@@ -60480,7 +60477,8 @@ var jsx_runtime = __webpack_require__(605);
|
|
|
60480
60477
|
;// CONCATENATED MODULE: ../node_modules/@uiw/react-markdown-preview/esm/index.js
|
|
60481
60478
|
|
|
60482
60479
|
|
|
60483
|
-
var _excluded = ["prefixCls", "className", "source", "style", "disableCopy", "onScroll", "onMouseOver", "pluginsFilter", "rehypeRewrite", "warpperElement"];
|
|
60480
|
+
var _excluded = ["prefixCls", "className", "source", "style", "disableCopy", "skipHtml", "onScroll", "onMouseOver", "pluginsFilter", "rehypeRewrite", "warpperElement"];
|
|
60481
|
+
|
|
60484
60482
|
|
|
60485
60483
|
|
|
60486
60484
|
|
|
@@ -60498,29 +60496,28 @@ var _excluded = ["prefixCls", "className", "source", "style", "disableCopy", "on
|
|
|
60498
60496
|
|
|
60499
60497
|
/* harmony default export */ const esm = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
|
|
60500
60498
|
var {
|
|
60501
|
-
|
|
60502
|
-
|
|
60503
|
-
|
|
60504
|
-
|
|
60505
|
-
|
|
60506
|
-
|
|
60507
|
-
|
|
60508
|
-
|
|
60509
|
-
|
|
60510
|
-
|
|
60511
|
-
|
|
60512
|
-
|
|
60513
|
-
|
|
60514
|
-
var mdp =
|
|
60499
|
+
prefixCls = 'wmde-markdown wmde-markdown-color',
|
|
60500
|
+
className,
|
|
60501
|
+
source,
|
|
60502
|
+
style,
|
|
60503
|
+
disableCopy = false,
|
|
60504
|
+
skipHtml = true,
|
|
60505
|
+
onScroll,
|
|
60506
|
+
onMouseOver,
|
|
60507
|
+
pluginsFilter,
|
|
60508
|
+
rehypeRewrite: rewrite,
|
|
60509
|
+
warpperElement = {}
|
|
60510
|
+
} = props,
|
|
60511
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
60512
|
+
var mdp = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
|
|
60515
60513
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, () => _extends({}, props, {
|
|
60516
60514
|
mdp
|
|
60517
60515
|
}), [mdp, props]);
|
|
60518
60516
|
var cls = (prefixCls || '') + " " + (className || '');
|
|
60519
|
-
|
|
60517
|
+
useCopied(mdp);
|
|
60520
60518
|
var rehypeRewriteHandle = (node, index, parent) => {
|
|
60521
60519
|
if (node.type === 'element' && parent && parent.type === 'root' && /h(1|2|3|4|5|6)/.test(node.tagName)) {
|
|
60522
60520
|
var child = node.children && node.children[0];
|
|
60523
|
-
|
|
60524
60521
|
if (child && child.properties && child.properties.ariaHidden === 'true') {
|
|
60525
60522
|
child.properties = _extends({
|
|
60526
60523
|
class: 'anchor'
|
|
@@ -60528,18 +60525,15 @@ var _excluded = ["prefixCls", "className", "source", "style", "disableCopy", "on
|
|
|
60528
60525
|
child.children = [octiconLink];
|
|
60529
60526
|
}
|
|
60530
60527
|
}
|
|
60531
|
-
|
|
60532
60528
|
if (node.type === 'element' && node.tagName === 'pre' && !disableCopy) {
|
|
60533
60529
|
var code = getCodeString(node.children);
|
|
60534
60530
|
node.children.push(copyElement(code));
|
|
60535
60531
|
}
|
|
60536
|
-
|
|
60537
60532
|
rewrite && rewrite(node, index, parent);
|
|
60538
60533
|
};
|
|
60539
|
-
|
|
60540
60534
|
var rehypePlugins = [reservedMeta, [m, {
|
|
60541
60535
|
ignoreMissing: true
|
|
60542
|
-
}],
|
|
60536
|
+
}], rehypeSlug, rehypeAutolinkHeadings, rehype_ignore_lib, [rehype_rewrite_lib, {
|
|
60543
60537
|
rewrite: rehypeRewriteHandle
|
|
60544
60538
|
}], [rehype_attr_lib, {
|
|
60545
60539
|
properties: 'attr'
|
|
@@ -60549,10 +60543,12 @@ var _excluded = ["prefixCls", "className", "source", "style", "disableCopy", "on
|
|
|
60549
60543
|
if (other.allowElement) {
|
|
60550
60544
|
return other.allowElement(element, index, parent);
|
|
60551
60545
|
}
|
|
60552
|
-
|
|
60553
60546
|
return /^[A-Za-z0-9]+$/.test(element.tagName);
|
|
60554
60547
|
}
|
|
60555
60548
|
};
|
|
60549
|
+
if (skipHtml) {
|
|
60550
|
+
rehypePlugins.push(rehypeRaw);
|
|
60551
|
+
}
|
|
60556
60552
|
var remarkPlugins = [...(other.remarkPlugins || []), remarkGfm];
|
|
60557
60553
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", _extends({
|
|
60558
60554
|
ref: mdp,
|
|
@@ -60561,7 +60557,8 @@ var _excluded = ["prefixCls", "className", "source", "style", "disableCopy", "on
|
|
|
60561
60557
|
}, warpperElement, {
|
|
60562
60558
|
className: cls,
|
|
60563
60559
|
style: style,
|
|
60564
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ReactMarkdown, _extends({},
|
|
60560
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ReactMarkdown, _extends({}, customProps, other, {
|
|
60561
|
+
skipHtml: skipHtml,
|
|
60565
60562
|
rehypePlugins: pluginsFilter ? pluginsFilter('rehype', rehypePlugins) : rehypePlugins,
|
|
60566
60563
|
remarkPlugins: pluginsFilter ? pluginsFilter('remark', remarkPlugins) : remarkPlugins,
|
|
60567
60564
|
children: source || ''
|
|
@@ -60572,7 +60569,7 @@ var _excluded = ["prefixCls", "className", "source", "style", "disableCopy", "on
|
|
|
60572
60569
|
;// CONCATENATED MODULE: ./src/Context.tsx
|
|
60573
60570
|
function reducer(state,action){return _objectSpread2(_objectSpread2({},state),action);}var EditorContext=/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext({markdown:''});
|
|
60574
60571
|
;// CONCATENATED MODULE: ./src/components/TextArea/shortcuts.ts
|
|
60575
|
-
function getCommands(){var data=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var resulte=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};data.forEach(function(item){if(item.children&&Array.isArray(item.children)){resulte=_objectSpread2(_objectSpread2({},resulte),getCommands(item.children||[]));}else if(item.keyCommand&&item.shortcuts&&item.execute){resulte[item.shortcuts.toLocaleLowerCase()]=item;}});return resulte;}function shortcutsHandle(e){var commands=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var commandOrchestrator=arguments.length>2?arguments[2]:undefined;var dispatch=arguments.length>3?arguments[3]:undefined;var state=arguments.length>4?arguments[4]:undefined;var data=getCommands(commands||[]);var shortcuts=[];if(e.altKey){shortcuts.push('alt');}if(e.shiftKey){shortcuts.push('shift');}if(e.metaKey){shortcuts.push('cmd');}if(e.ctrlKey){shortcuts.push('ctrl');}if(shortcuts.length>0&&!/(control|alt|meta|shift)/.test(e.key.toLocaleLowerCase())){shortcuts.push(e.key.toLocaleLowerCase());}if(/escape/.test(e.key.toLocaleLowerCase())){shortcuts.push('escape');}if(shortcuts.length<1){return;}var equal=!!data[shortcuts.join('+')];var command=equal?data[shortcuts.join('+')]:undefined;Object.keys(data).forEach(function(item){var isequal=item.split('+').every(function(v){if(/ctrlcmd/.test(v)){return shortcuts.includes('ctrl')||shortcuts.includes('cmd');}return shortcuts.includes(v);});if(isequal){command=data[item];}});if(command&&commandOrchestrator){e.stopPropagation();e.preventDefault();commandOrchestrator.executeCommand(command,dispatch,state);return;}}
|
|
60572
|
+
function getCommands(){var data=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var resulte=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};data.forEach(function(item){if(item.children&&Array.isArray(item.children)){resulte=_objectSpread2(_objectSpread2({},resulte),getCommands(item.children||[]));}else if(item.keyCommand&&item.shortcuts&&item.execute){resulte[item.shortcuts.toLocaleLowerCase()]=item;}});return resulte;}function shortcutsHandle(e){var commands=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var commandOrchestrator=arguments.length>2?arguments[2]:undefined;var dispatch=arguments.length>3?arguments[3]:undefined;var state=arguments.length>4?arguments[4]:undefined;var data=getCommands(commands||[]);var shortcuts=[];if(e.altKey){shortcuts.push('alt');}if(e.shiftKey){shortcuts.push('shift');}if(e.metaKey){shortcuts.push('cmd');}if(e.ctrlKey){shortcuts.push('ctrl');}if(shortcuts.length>0&&!/(control|alt|meta|shift)/.test(e.key.toLocaleLowerCase())){shortcuts.push(e.key.toLocaleLowerCase());}if(/escape/.test(e.key.toLocaleLowerCase())){shortcuts.push('escape');}if(shortcuts.length<1){return;}var equal=!!data[shortcuts.join('+')];var command=equal?data[shortcuts.join('+')]:undefined;Object.keys(data).forEach(function(item){var isequal=item.split('+').every(function(v){if(/ctrlcmd/.test(v)){return shortcuts.includes('ctrl')||shortcuts.includes('cmd');}return shortcuts.includes(v);});if(isequal){command=data[item];}});if(command&&commandOrchestrator){e.stopPropagation();e.preventDefault();commandOrchestrator.executeCommand(command,dispatch,state,shortcuts);return;}}
|
|
60576
60573
|
;// CONCATENATED MODULE: ../node_modules/rehype-parse/lib/errors.js
|
|
60577
60574
|
const errors = {
|
|
60578
60575
|
abandonedHeadElementChild: {
|
|
@@ -62544,7 +62541,6 @@ function _defineProperties(target, props) {
|
|
|
62544
62541
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
62545
62542
|
}
|
|
62546
62543
|
}
|
|
62547
|
-
|
|
62548
62544
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
62549
62545
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
62550
62546
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
@@ -62633,9 +62629,13 @@ api.setSelectionRange({start:state2.selection.end-4-state1.selectedText.length,e
|
|
|
62633
62629
|
;// CONCATENATED MODULE: ./src/commands/divider.tsx
|
|
62634
62630
|
var divider={keyCommand:'divider'};
|
|
62635
62631
|
;// CONCATENATED MODULE: ./src/commands/fullscreen.tsx
|
|
62636
|
-
var fullscreen={name:'fullscreen',keyCommand:'fullscreen',shortcuts:'ctrlcmd+0',value:'fullscreen',buttonProps:{'aria-label':'Toggle fullscreen (ctrl + 0)',title:'Toggle fullscreen (ctrl+ 0)'},icon:/*#__PURE__*/(0,jsx_runtime.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:/*#__PURE__*/(0,jsx_runtime.jsx)("path",{fill:"currentColor",d:"M118 171.133334L118 342.200271C118 353.766938 126.675 365.333605 141.133333 365.333605L382.634614 365.333605C394.201281 365.333605 405.767948 356.658605 405.767948 342.200271L405.767948 171.133334C405.767948 159.566667 397.092948 148 382.634614 148L141.133333 148C126.674999 148 117.999999 156.675 118 171.133334zM465.353591 413.444444L370 413.444444 370 471.222222 474.0221 471.222222C500.027624 471.222222 520.254143 451 520.254143 425L520.254143 321 462.464089 321 462.464089 413.444444 465.353591 413.444444zM471.0221 43L367 43 367 100.777778 462.353591 100.777778 462.353591 196.111111 520.143647 196.111111 520.143647 89.2222219C517.254144 63.2222219 497.027624 43 471.0221 43zM57.7900547 100.777778L153.143646 100.777778 153.143646 43 46.2320439 43C20.2265191 43 0 63.2222219 0 89.2222219L0 193.222222 57.7900547 193.222222 57.7900547 100.777778zM57.7900547 321L0 321 0 425C0 451 20.2265191 471.222222 46.2320439 471.222223L150.254143 471.222223 150.254143 413.444445 57.7900547 413.444445 57.7900547 321z"})}),execute:function execute(state,api,dispatch,executeCommandState){api.textArea.focus();if(dispatch&&executeCommandState
|
|
62632
|
+
var fullscreen={name:'fullscreen',keyCommand:'fullscreen',shortcuts:'ctrlcmd+0',value:'fullscreen',buttonProps:{'aria-label':'Toggle fullscreen (ctrl + 0)',title:'Toggle fullscreen (ctrl+ 0)'},icon:/*#__PURE__*/(0,jsx_runtime.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:/*#__PURE__*/(0,jsx_runtime.jsx)("path",{fill:"currentColor",d:"M118 171.133334L118 342.200271C118 353.766938 126.675 365.333605 141.133333 365.333605L382.634614 365.333605C394.201281 365.333605 405.767948 356.658605 405.767948 342.200271L405.767948 171.133334C405.767948 159.566667 397.092948 148 382.634614 148L141.133333 148C126.674999 148 117.999999 156.675 118 171.133334zM465.353591 413.444444L370 413.444444 370 471.222222 474.0221 471.222222C500.027624 471.222222 520.254143 451 520.254143 425L520.254143 321 462.464089 321 462.464089 413.444444 465.353591 413.444444zM471.0221 43L367 43 367 100.777778 462.353591 100.777778 462.353591 196.111111 520.143647 196.111111 520.143647 89.2222219C517.254144 63.2222219 497.027624 43 471.0221 43zM57.7900547 100.777778L153.143646 100.777778 153.143646 43 46.2320439 43C20.2265191 43 0 63.2222219 0 89.2222219L0 193.222222 57.7900547 193.222222 57.7900547 100.777778zM57.7900547 321L0 321 0 425C0 451 20.2265191 471.222222 46.2320439 471.222223L150.254143 471.222223 150.254143 413.444445 57.7900547 413.444445 57.7900547 321z"})}),execute:function execute(state,api,dispatch,executeCommandState,shortcuts){api.textArea.focus();if(shortcuts&&dispatch&&executeCommandState){dispatch({fullscreen:!executeCommandState.fullscreen});}}};
|
|
62633
|
+
;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js
|
|
62634
|
+
function _objectDestructuringEmpty(obj) {
|
|
62635
|
+
if (obj == null) throw new TypeError("Cannot destructure " + obj);
|
|
62636
|
+
}
|
|
62637
62637
|
;// CONCATENATED MODULE: ./src/commands/group.tsx
|
|
62638
|
-
var group=function group(arr,options){var data=_objectSpread2(_objectSpread2({children:arr,icon:/*#__PURE__*/(0,jsx_runtime.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:/*#__PURE__*/(0,jsx_runtime.jsx)("path",{fill:"currentColor",d:"M15.7083333,468 C7.03242448,468 0,462.030833 0,454.666667 L0,421.333333 C0,413.969167 7.03242448,408 15.7083333,408 L361.291667,408 C369.967576,408 377,413.969167 377,421.333333 L377,454.666667 C377,462.030833 369.967576,468 361.291667,468 L15.7083333,468 Z M21.6666667,366 C9.69989583,366 0,359.831861 0,352.222222 L0,317.777778 C0,310.168139 9.69989583,304 21.6666667,304 L498.333333,304 C510.300104,304 520,310.168139 520,317.777778 L520,352.222222 C520,359.831861 510.300104,366 498.333333,366 L21.6666667,366 Z M136.835938,64 L136.835937,126 L107.25,126 L107.25,251 L40.75,251 L40.75,126 L-5.68434189e-14,126 L-5.68434189e-14,64 L136.835938,64 Z M212,64 L212,251 L161.648438,251 L161.648438,64 L212,64 Z M378,64 L378,126 L343.25,126 L343.25,251 L281.75,251 L281.75,126 L238,126 L238,64 L378,64 Z M449.047619,189.550781 L520,189.550781 L520,251 L405,251 L405,64 L449.047619,64 L449.047619,189.550781 Z"})}),execute:function execute(){}},options),{},{keyCommand:'group'});if(Array.isArray(data.children)){data.children=data.children.map(function(_ref){var item=Object.assign({},_ref);item.parent=data;return _objectSpread2({},item);});}return data;};
|
|
62638
|
+
var group=function group(arr,options){var data=_objectSpread2(_objectSpread2({children:arr,icon:/*#__PURE__*/(0,jsx_runtime.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:/*#__PURE__*/(0,jsx_runtime.jsx)("path",{fill:"currentColor",d:"M15.7083333,468 C7.03242448,468 0,462.030833 0,454.666667 L0,421.333333 C0,413.969167 7.03242448,408 15.7083333,408 L361.291667,408 C369.967576,408 377,413.969167 377,421.333333 L377,454.666667 C377,462.030833 369.967576,468 361.291667,468 L15.7083333,468 Z M21.6666667,366 C9.69989583,366 0,359.831861 0,352.222222 L0,317.777778 C0,310.168139 9.69989583,304 21.6666667,304 L498.333333,304 C510.300104,304 520,310.168139 520,317.777778 L520,352.222222 C520,359.831861 510.300104,366 498.333333,366 L21.6666667,366 Z M136.835938,64 L136.835937,126 L107.25,126 L107.25,251 L40.75,251 L40.75,126 L-5.68434189e-14,126 L-5.68434189e-14,64 L136.835938,64 Z M212,64 L212,251 L161.648438,251 L161.648438,64 L212,64 Z M378,64 L378,126 L343.25,126 L343.25,251 L281.75,251 L281.75,126 L238,126 L238,64 L378,64 Z M449.047619,189.550781 L520,189.550781 L520,251 L405,251 L405,64 L449.047619,64 L449.047619,189.550781 Z"})}),execute:function execute(){}},options),{},{keyCommand:'group'});if(Array.isArray(data.children)){data.children=data.children.map(function(_ref){var item=Object.assign({},(_objectDestructuringEmpty(_ref),_ref));item.parent=data;return _objectSpread2({},item);});}return data;};
|
|
62639
62639
|
;// CONCATENATED MODULE: ./src/commands/hr.tsx
|
|
62640
62640
|
var hr={name:'hr',keyCommand:'hr',shortcuts:'ctrlcmd+h',value:'----------',buttonProps:{'aria-label':'Insert HR (ctrl + h)',title:'Insert HR (ctrl + h)'},icon:/*#__PURE__*/(0,jsx_runtime.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 175 175",children:/*#__PURE__*/(0,jsx_runtime.jsx)("path",{fill:"currentColor",d:"M0,129 L175,129 L175,154 L0,154 L0,129 Z M3,9 L28.2158203,9 L28.2158203,47.9824219 L55.7695313,47.9824219 L55.7695313,9 L81.0966797,9 L81.0966797,107.185547 L55.7695313,107.185547 L55.7695313,68.0214844 L28.2158203,68.0214844 L28.2158203,107.185547 L3,107.185547 L3,9 Z M93.1855469,100.603516 L93.1855469,19 L135.211914,19 C143.004922,19 148.960917,19.6679621 153.080078,21.0039063 C157.199239,22.3398504 160.520495,24.8168764 163.043945,28.4350586 C165.567395,32.0532407 166.829102,36.459935 166.829102,41.6552734 C166.829102,46.1826398 165.864267,50.0883625 163.93457,53.3725586 C162.004873,56.6567547 159.351579,59.3193257 155.974609,61.3603516 C153.822255,62.6591862 150.872089,63.7353473 147.124023,64.5888672 C150.129898,65.5908253 152.319329,66.5927684 153.692383,67.5947266 C154.620122,68.2626987 155.965323,69.6913953 157.728027,71.8808594 C159.490731,74.0703234 160.668942,75.7587831 161.262695,76.9462891 L173,100.603516 L144.953125,100.603516 L131.482422,75.6660156 C129.775382,72.4374839 128.253913,70.3408251 126.917969,69.3759766 C125.0996,68.1142515 123.040051,67.4833984 120.739258,67.4833984 L118.512695,67.4833984 L118.512695,100.603516 L93.1855469,100.603516 Z M118.512695,52.0644531 L129.144531,52.0644531 C130.294928,52.0644531 132.521468,51.6933631 135.824219,50.9511719 C137.494149,50.6171858 138.857905,49.7636787 139.915527,48.390625 C140.97315,47.0175713 141.501953,45.4404386 141.501953,43.6591797 C141.501953,41.0244009 140.667001,39.0019602 138.99707,37.5917969 C137.32714,36.1816336 134.191429,35.4765625 129.589844,35.4765625 L117.512695,35.4765625 L118.512695,52.0644531 Z",transform:"translate(0 9)"})}),execute:function execute(state,api){api.replaceSelection("".concat(state.selectedText,"\n\n----------\n\n"));}};
|
|
62641
62641
|
;// CONCATENATED MODULE: ./src/commands/image.tsx
|
|
@@ -62661,7 +62661,7 @@ var newSelectionRange=selectWord({text:state.text,selection:state.selection});va
|
|
|
62661
62661
|
var oneLinerOffset=state1.selectedText.indexOf('\n')===-1?modifiedText.insertionLength:0;var selectionStart=state1.selection.start+breaksBeforeCount+oneLinerOffset;var selectionEnd=selectionStart+modifiedText.modifiedText.length-oneLinerOffset;// Adjust the selection to not contain the **
|
|
62662
62662
|
api.setSelectionRange({start:selectionStart,end:selectionEnd});};var unorderedListCommand={name:'unordered-list',keyCommand:'list',shortcuts:'ctrl+shift+u',value:'- ',buttonProps:{'aria-label':'Add unordered list (ctrl + shift + u)',title:'Add unordered list (ctrl + shift + u)'},icon:/*#__PURE__*/(0,jsx_runtime.jsx)("svg",{"data-name":"unordered-list",width:"12",height:"12",viewBox:"0 0 512 512",children:/*#__PURE__*/(0,jsx_runtime.jsx)("path",{fill:"currentColor",d:"M96 96c0 26.51-21.49 48-48 48S0 122.51 0 96s21.49-48 48-48 48 21.49 48 48zM48 208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm0 160c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm96-236h352c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h352c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h352c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"})}),execute:function execute(state,api){makeList(state,api,'- ');}};var orderedListCommand={name:'ordered-list',keyCommand:'list',shortcuts:'ctrl+shift+o',value:'1. ',buttonProps:{'aria-label':'Add ordered list (ctrl + shift + o)',title:'Add ordered list (ctrl + shift + o)'},icon:/*#__PURE__*/(0,jsx_runtime.jsx)("svg",{"data-name":"ordered-list",width:"12",height:"12",role:"img",viewBox:"0 0 512 512",children:/*#__PURE__*/(0,jsx_runtime.jsx)("path",{fill:"currentColor",d:"M3.263 139.527c0-7.477 3.917-11.572 11.573-11.572h15.131V88.078c0-5.163.534-10.503.534-10.503h-.356s-1.779 2.67-2.848 3.738c-4.451 4.273-10.504 4.451-15.666-1.068l-5.518-6.231c-5.342-5.341-4.984-11.216.534-16.379l21.72-19.938C32.815 33.602 36.732 32 42.785 32H54.89c7.656 0 11.749 3.916 11.749 11.572v84.384h15.488c7.655 0 11.572 4.094 11.572 11.572v8.901c0 7.477-3.917 11.572-11.572 11.572H14.836c-7.656 0-11.573-4.095-11.573-11.572v-8.902zM2.211 304.591c0-47.278 50.955-56.383 50.955-69.165 0-7.18-5.954-8.755-9.28-8.755-3.153 0-6.479 1.051-9.455 3.852-5.079 4.903-10.507 7.004-16.111 2.451l-8.579-6.829c-5.779-4.553-7.18-9.805-2.803-15.409C13.592 201.981 26.025 192 47.387 192c19.437 0 44.476 10.506 44.476 39.573 0 38.347-46.753 46.402-48.679 56.909h39.049c7.529 0 11.557 4.027 11.557 11.382v8.755c0 7.354-4.028 11.382-11.557 11.382h-67.94c-7.005 0-12.083-4.028-12.083-11.382v-4.028zM5.654 454.61l5.603-9.28c3.853-6.654 9.105-7.004 15.584-3.152 4.903 2.101 9.63 3.152 14.359 3.152 10.155 0 14.358-3.502 14.358-8.23 0-6.654-5.604-9.106-15.934-9.106h-4.728c-5.954 0-9.28-2.101-12.258-7.88l-1.05-1.926c-2.451-4.728-1.226-9.806 2.801-14.884l5.604-7.004c6.829-8.405 12.257-13.483 12.257-13.483v-.35s-4.203 1.051-12.608 1.051H16.685c-7.53 0-11.383-4.028-11.383-11.382v-8.755c0-7.53 3.853-11.382 11.383-11.382h58.484c7.529 0 11.382 4.027 11.382 11.382v3.327c0 5.778-1.401 9.806-5.079 14.183l-17.509 20.137c19.611 5.078 28.716 20.487 28.716 34.845 0 21.363-14.358 44.126-48.503 44.126-16.636 0-28.192-4.728-35.896-9.455-5.779-4.202-6.304-9.805-2.626-15.934zM144 132h352c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h352c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h352c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"})}),execute:function execute(state,api){makeList(state,api,function(item,index){return"".concat(index+1,". ");});}};var checkedListCommand={name:'checked-list',keyCommand:'list',shortcuts:'ctrl+shift+c',value:'- [x] ',buttonProps:{'aria-label':'Add checked list (ctrl + shift + c)',title:'Add checked list (ctrl + shift + c)'},icon:/*#__PURE__*/(0,jsx_runtime.jsx)("svg",{"data-name":"checked-list",width:"12",height:"12",role:"img",viewBox:"0 0 512 512",children:/*#__PURE__*/(0,jsx_runtime.jsx)("path",{fill:"currentColor",d:"M208 132h288c8.8 0 16-7.2 16-16V76c0-8.8-7.2-16-16-16H208c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16zm0 160h288c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16H208c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16zm0 160h288c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16H208c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16zM64 368c-26.5 0-48.6 21.5-48.6 48s22.1 48 48.6 48 48-21.5 48-48-21.5-48-48-48zm92.5-299l-72.2 72.2-15.6 15.6c-4.7 4.7-12.9 4.7-17.6 0L3.5 109.4c-4.7-4.7-4.7-12.3 0-17l15.7-15.7c4.7-4.7 12.3-4.7 17 0l22.7 22.1 63.7-63.3c4.7-4.7 12.3-4.7 17 0l17 16.5c4.6 4.7 4.6 12.3-.1 17zm0 159.6l-72.2 72.2-15.7 15.7c-4.7 4.7-12.9 4.7-17.6 0L3.5 269c-4.7-4.7-4.7-12.3 0-17l15.7-15.7c4.7-4.7 12.3-4.7 17 0l22.7 22.1 63.7-63.7c4.7-4.7 12.3-4.7 17 0l17 17c4.6 4.6 4.6 12.2-.1 16.9z"})}),execute:function execute(state,api){makeList(state,api,function(item,index){return"- [ ] ";});}};
|
|
62663
62663
|
;// CONCATENATED MODULE: ./src/commands/preview.tsx
|
|
62664
|
-
var codePreview={name:'preview',keyCommand:'preview',value:'preview',shortcuts:'ctrlcmd+9',buttonProps:{'aria-label':'Preview code (ctrl + 9)',title:'Preview code (ctrl + 9)'},icon:/*#__PURE__*/(0,jsx_runtime.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:[/*#__PURE__*/(0,jsx_runtime.jsx)("polygon",{fill:"currentColor",points:"0 71.293 0 122 38.023 123 38.023 398 0 397 0 449.707 91.023 450.413 91.023 72.293"}),/*#__PURE__*/(0,jsx_runtime.jsx)("polygon",{fill:"currentColor",points:"148.023 72.293 520 71.293 520 122 200.023 124 200.023 397 520 396 520 449.707 148.023 450.413"})]}),execute:function execute(){}};var codeEdit={name:'edit',keyCommand:'preview',value:'edit',shortcuts:'ctrlcmd+7',buttonProps:{'aria-label':'Edit code (ctrl + 7)',title:'Edit code (ctrl + 7)'},icon:/*#__PURE__*/(0,jsx_runtime.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:[/*#__PURE__*/(0,jsx_runtime.jsx)("polygon",{fill:"currentColor",points:"0 71.293 0 122 319 122 319 397 0 397 0 449.707 372 449.413 372 71.293"}),/*#__PURE__*/(0,jsx_runtime.jsx)("polygon",{fill:"currentColor",points:"429 71.293 520 71.293 520 122 481 123 481 396 520 396 520 449.707 429 449.413"})]}),execute:function execute(){}};var codeLive={name:'live',keyCommand:'preview',value:'live',shortcuts:'ctrlcmd+8',buttonProps:{'aria-label':'Live code (ctrl + 8)',title:'Live code (ctrl + 8)'},icon:/*#__PURE__*/(0,jsx_runtime.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:[/*#__PURE__*/(0,jsx_runtime.jsx)("polygon",{fill:"currentColor",points:"0 71.293 0 122 179 122 179 397 0 397 0 449.707 232 449.413 232 71.293"}),/*#__PURE__*/(0,jsx_runtime.jsx)("polygon",{fill:"currentColor",points:"289 71.293 520 71.293 520 122 341 123 341 396 520 396 520 449.707 289 449.413"})]}),execute:function execute(){}};
|
|
62664
|
+
var codePreview={name:'preview',keyCommand:'preview',value:'preview',shortcuts:'ctrlcmd+9',buttonProps:{'aria-label':'Preview code (ctrl + 9)',title:'Preview code (ctrl + 9)'},icon:/*#__PURE__*/(0,jsx_runtime.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:[/*#__PURE__*/(0,jsx_runtime.jsx)("polygon",{fill:"currentColor",points:"0 71.293 0 122 38.023 123 38.023 398 0 397 0 449.707 91.023 450.413 91.023 72.293"}),/*#__PURE__*/(0,jsx_runtime.jsx)("polygon",{fill:"currentColor",points:"148.023 72.293 520 71.293 520 122 200.023 124 200.023 397 520 396 520 449.707 148.023 450.413"})]}),execute:function execute(state,api,dispatch,executeCommandState,shortcuts){if(shortcuts&&dispatch&&executeCommandState){dispatch({preview:'preview'});}}};var codeEdit={name:'edit',keyCommand:'preview',value:'edit',shortcuts:'ctrlcmd+7',buttonProps:{'aria-label':'Edit code (ctrl + 7)',title:'Edit code (ctrl + 7)'},icon:/*#__PURE__*/(0,jsx_runtime.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:[/*#__PURE__*/(0,jsx_runtime.jsx)("polygon",{fill:"currentColor",points:"0 71.293 0 122 319 122 319 397 0 397 0 449.707 372 449.413 372 71.293"}),/*#__PURE__*/(0,jsx_runtime.jsx)("polygon",{fill:"currentColor",points:"429 71.293 520 71.293 520 122 481 123 481 396 520 396 520 449.707 429 449.413"})]}),execute:function execute(state,api,dispatch,executeCommandState,shortcuts){if(shortcuts&&dispatch&&executeCommandState){dispatch({preview:'edit'});}}};var codeLive={name:'live',keyCommand:'preview',value:'live',shortcuts:'ctrlcmd+8',buttonProps:{'aria-label':'Live code (ctrl + 8)',title:'Live code (ctrl + 8)'},icon:/*#__PURE__*/(0,jsx_runtime.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:[/*#__PURE__*/(0,jsx_runtime.jsx)("polygon",{fill:"currentColor",points:"0 71.293 0 122 179 122 179 397 0 397 0 449.707 232 449.413 232 71.293"}),/*#__PURE__*/(0,jsx_runtime.jsx)("polygon",{fill:"currentColor",points:"289 71.293 520 71.293 520 122 341 123 341 396 520 396 520 449.707 289 449.413"})]}),execute:function execute(state,api,dispatch,executeCommandState,shortcuts){if(shortcuts&&dispatch&&executeCommandState){dispatch({preview:'live'});}}};
|
|
62665
62665
|
;// CONCATENATED MODULE: ./src/commands/quote.tsx
|
|
62666
62666
|
var quote={name:'quote',keyCommand:'quote',shortcuts:'ctrlcmd+q',buttonProps:{'aria-label':'Insert a quote (ctrl + q)',title:'Insert a quote (ctrl + q)'},icon:/*#__PURE__*/(0,jsx_runtime.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 520 520",children:/*#__PURE__*/(0,jsx_runtime.jsx)("path",{fill:"currentColor",d:"M520,95.75 L520,225.75 C520,364.908906 457.127578,437.050625 325.040469,472.443125 C309.577578,476.586875 294.396016,464.889922 294.396016,448.881641 L294.396016,414.457031 C294.396016,404.242891 300.721328,395.025078 310.328125,391.554687 C377.356328,367.342187 414.375,349.711094 414.375,274.5 L341.25,274.5 C314.325781,274.5 292.5,252.674219 292.5,225.75 L292.5,95.75 C292.5,68.8257812 314.325781,47 341.25,47 L471.25,47 C498.174219,47 520,68.8257812 520,95.75 Z M178.75,47 L48.75,47 C21.8257813,47 0,68.8257812 0,95.75 L0,225.75 C0,252.674219 21.8257813,274.5 48.75,274.5 L121.875,274.5 C121.875,349.711094 84.8563281,367.342187 17.828125,391.554687 C8.22132813,395.025078 1.89601563,404.242891 1.89601563,414.457031 L1.89601563,448.881641 C1.89601563,464.889922 17.0775781,476.586875 32.5404687,472.443125 C164.627578,437.050625 227.5,364.908906 227.5,225.75 L227.5,95.75 C227.5,68.8257812 205.674219,47 178.75,47 Z"})}),execute:function execute(state,api){// Adjust the selection to encompass the whole word if the caret is inside one
|
|
62667
62667
|
var newSelectionRange=selectWord({text:state.text,selection:state.selection});var state1=api.setSelectionRange(newSelectionRange);var breaksBeforeCount=getBreaksNeededForEmptyLineBefore(state1.text,state1.selection.start);var breaksBefore=Array(breaksBeforeCount+1).join('\n');var breaksAfterCount=getBreaksNeededForEmptyLineAfter(state1.text,state1.selection.end);var breaksAfter=Array(breaksAfterCount+1).join('\n');// Replaces the current selection with the quote mark up
|
|
@@ -62693,7 +62693,7 @@ var commands_getCommands=function getCommands(){return[bold,italic,strikeThrough
|
|
|
62693
62693
|
*/_createClass(TextAreaTextApi,[{key:"replaceSelection",value:function replaceSelection(text){insertTextAtPosition(this.textArea,text);return getStateFromTextArea(this.textArea);}/**
|
|
62694
62694
|
* Selects the specified text range
|
|
62695
62695
|
* @param selection
|
|
62696
|
-
*/},{key:"setSelectionRange",value:function setSelectionRange(selection){this.textArea.focus();this.textArea.selectionStart=selection.start;this.textArea.selectionEnd=selection.end;return getStateFromTextArea(this.textArea);}}]);return TextAreaTextApi;}();var TextAreaCommandOrchestrator=/*#__PURE__*/function(){function TextAreaCommandOrchestrator(textArea){_classCallCheck(this,TextAreaCommandOrchestrator);this.textArea=void 0;this.textApi=void 0;this.textArea=textArea;this.textApi=new TextAreaTextApi(textArea);}_createClass(TextAreaCommandOrchestrator,[{key:"getState",value:function getState(){if(!this.textArea)return false;return getStateFromTextArea(this.textArea);}},{key:"executeCommand",value:function executeCommand(command,dispatch,state){command.execute&&command.execute(getStateFromTextArea(this.textArea),this.textApi,dispatch,state);}}]);return TextAreaCommandOrchestrator;}();
|
|
62696
|
+
*/},{key:"setSelectionRange",value:function setSelectionRange(selection){this.textArea.focus();this.textArea.selectionStart=selection.start;this.textArea.selectionEnd=selection.end;return getStateFromTextArea(this.textArea);}}]);return TextAreaTextApi;}();var TextAreaCommandOrchestrator=/*#__PURE__*/function(){function TextAreaCommandOrchestrator(textArea){_classCallCheck(this,TextAreaCommandOrchestrator);this.textArea=void 0;this.textApi=void 0;this.textArea=textArea;this.textApi=new TextAreaTextApi(textArea);}_createClass(TextAreaCommandOrchestrator,[{key:"getState",value:function getState(){if(!this.textArea)return false;return getStateFromTextArea(this.textArea);}},{key:"executeCommand",value:function executeCommand(command,dispatch,state,shortcuts){command.execute&&command.execute(getStateFromTextArea(this.textArea),this.textApi,dispatch,state,shortcuts);}}]);return TextAreaCommandOrchestrator;}();
|
|
62697
62697
|
;// CONCATENATED MODULE: ./src/components/TextArea/handleKeyDown.tsx
|
|
62698
62698
|
/**
|
|
62699
62699
|
* - `13` - `Enter`
|