@uiw/react-md-editor 3.19.7 → 3.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mdeditor.js CHANGED
@@ -908,73 +908,6 @@ module.exports = function extend() {
908
908
  };
909
909
 
910
910
 
911
- /***/ }),
912
-
913
- /***/ 449:
914
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
915
-
916
- const regex = __webpack_require__(969)
917
-
918
- module.exports = BananaSlug
919
-
920
- const own = Object.hasOwnProperty
921
-
922
- function BananaSlug () {
923
- const self = this
924
-
925
- if (!(self instanceof BananaSlug)) return new BananaSlug()
926
-
927
- self.reset()
928
- }
929
-
930
- /**
931
- * Generate a unique slug.
932
- * @param {string} value String of text to slugify
933
- * @param {boolean} [false] Keep the current case, otherwise make all lowercase
934
- * @return {string} A unique slug string
935
- */
936
- BananaSlug.prototype.slug = function (value, maintainCase) {
937
- const self = this
938
- let slug = slugger(value, maintainCase === true)
939
- const originalSlug = slug
940
-
941
- while (own.call(self.occurrences, slug)) {
942
- self.occurrences[originalSlug]++
943
- slug = originalSlug + '-' + self.occurrences[originalSlug]
944
- }
945
-
946
- self.occurrences[slug] = 0
947
-
948
- return slug
949
- }
950
-
951
- /**
952
- * Reset - Forget all previous slugs
953
- * @return void
954
- */
955
- BananaSlug.prototype.reset = function () {
956
- this.occurrences = Object.create(null)
957
- }
958
-
959
- function slugger (string, maintainCase) {
960
- if (typeof string !== 'string') return ''
961
- if (!maintainCase) string = string.toLowerCase()
962
- return string.replace(regex, '').replace(/ /g, '-')
963
- }
964
-
965
- BananaSlug.slug = slugger
966
-
967
-
968
- /***/ }),
969
-
970
- /***/ 969:
971
- /***/ ((module) => {
972
-
973
- // This module is generated by `script/`.
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\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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1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g
976
-
977
-
978
911
  /***/ }),
979
912
 
980
913
  /***/ 935:
@@ -9639,8 +9572,39 @@ __webpack_require__.d(commands_namespaceObject, {
9639
9572
  "unorderedListCommand": () => (unorderedListCommand)
9640
9573
  });
9641
9574
 
9575
+ ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/typeof.js
9576
+ function _typeof(obj) {
9577
+ "@babel/helpers - typeof";
9578
+
9579
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
9580
+ return typeof obj;
9581
+ } : function (obj) {
9582
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
9583
+ }, _typeof(obj);
9584
+ }
9585
+ ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
9586
+
9587
+ function _toPrimitive(input, hint) {
9588
+ if (_typeof(input) !== "object" || input === null) return input;
9589
+ var prim = input[Symbol.toPrimitive];
9590
+ if (prim !== undefined) {
9591
+ var res = prim.call(input, hint || "default");
9592
+ if (_typeof(res) !== "object") return res;
9593
+ throw new TypeError("@@toPrimitive must return a primitive value.");
9594
+ }
9595
+ return (hint === "string" ? String : Number)(input);
9596
+ }
9597
+ ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
9598
+
9599
+
9600
+ function _toPropertyKey(arg) {
9601
+ var key = _toPrimitive(arg, "string");
9602
+ return _typeof(key) === "symbol" ? key : String(key);
9603
+ }
9642
9604
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/defineProperty.js
9605
+
9643
9606
  function _defineProperty(obj, key, value) {
9607
+ key = _toPropertyKey(key);
9644
9608
  if (key in obj) {
9645
9609
  Object.defineProperty(obj, key, {
9646
9610
  value: value,
@@ -9682,28 +9646,33 @@ function _arrayWithHoles(arr) {
9682
9646
  }
9683
9647
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
9684
9648
  function _iterableToArrayLimit(arr, i) {
9685
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
9686
- if (_i == null) return;
9687
- var _arr = [];
9688
- var _n = true;
9689
- var _d = false;
9690
- var _s, _e;
9691
- try {
9692
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
9693
- _arr.push(_s.value);
9694
- if (i && _arr.length === i) break;
9695
- }
9696
- } catch (err) {
9697
- _d = true;
9698
- _e = err;
9699
- } finally {
9649
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
9650
+ if (null != _i) {
9651
+ var _s,
9652
+ _e,
9653
+ _x,
9654
+ _r,
9655
+ _arr = [],
9656
+ _n = !0,
9657
+ _d = !1;
9700
9658
  try {
9701
- if (!_n && _i["return"] != null) _i["return"]();
9659
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
9660
+ if (Object(_i) !== _i) return;
9661
+ _n = !1;
9662
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
9663
+ ;
9664
+ }
9665
+ } catch (err) {
9666
+ _d = !0, _e = err;
9702
9667
  } finally {
9703
- if (_d) throw _e;
9668
+ try {
9669
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
9670
+ } finally {
9671
+ if (_d) throw _e;
9672
+ }
9704
9673
  }
9674
+ return _arr;
9705
9675
  }
9706
- return _arr;
9707
9676
  }
9708
9677
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
9709
9678
  function _arrayLikeToArray(arr, len) {
@@ -9861,12 +9830,17 @@ function index(value) {
9861
9830
 
9862
9831
  class VFileMessage extends Error {
9863
9832
  /**
9864
- * Constructor of a message for `reason` at `place` from `origin`.
9865
- * When an error is passed in as `reason`, copies the `stack`.
9833
+ * Create a message for `reason` at `place` from `origin`.
9834
+ *
9835
+ * When an error is passed in as `reason`, the `stack` is copied.
9866
9836
  *
9867
- * @param {string|Error} reason Reason for message (`string` or `Error`). Uses the stack and message of the error if given.
9868
- * @param {Node|NodeLike|Position|Point} [place] Place at which the message occurred in a file (`Node`, `Position`, or `Point`, optional).
9869
- * @param {string} [origin] Place in code the message originates from (`string`, optional).
9837
+ * @param {string|Error|VFileMessage} reason
9838
+ * Reason for message.
9839
+ * Uses the stack and message of the error if given.
9840
+ * @param {Node|NodeLike|Position|Point} [place]
9841
+ * Place at which the message occurred in a file.
9842
+ * @param {string} [origin]
9843
+ * Place in code the message originates from (example `'my-package:my-rule-name'`)
9870
9844
  */
9871
9845
  constructor(reason, place, origin) {
9872
9846
  /** @type {[string|null, string|null]} */
@@ -9901,11 +9875,13 @@ class VFileMessage extends Error {
9901
9875
  // Node.
9902
9876
  if ('type' in place || 'position' in place) {
9903
9877
  if (place.position) {
9878
+ // @ts-expect-error: looks like a position.
9904
9879
  position = place.position
9905
9880
  }
9906
9881
  }
9907
9882
  // Position.
9908
9883
  else if ('start' in place || 'end' in place) {
9884
+ // @ts-expect-error: looks like a position.
9909
9885
  position = place
9910
9886
  }
9911
9887
  // Point.
@@ -9916,76 +9892,109 @@ class VFileMessage extends Error {
9916
9892
 
9917
9893
  // Fields from `Error`
9918
9894
  this.name = stringifyPosition(place) || '1:1'
9895
+ /** @type {string} */
9919
9896
  this.message = typeof reason === 'object' ? reason.message : reason
9920
- this.stack = typeof reason === 'object' ? reason.stack : ''
9897
+ /** @type {string} */
9898
+ this.stack = ''
9899
+
9900
+ if (typeof reason === 'object' && reason.stack) {
9901
+ this.stack = reason.stack
9902
+ }
9921
9903
 
9922
9904
  /**
9923
9905
  * Reason for message.
9906
+ *
9924
9907
  * @type {string}
9925
9908
  */
9926
9909
  this.reason = this.message
9910
+
9911
+ /* eslint-disable no-unused-expressions */
9927
9912
  /**
9928
- * If true, marks associated file as no longer processable.
9913
+ * Whether this is a fatal problem that marks an associated file as no
9914
+ * longer processable.
9915
+ * If `true`, marks associated file as no longer processable.
9916
+ * If `false`, necessitates a (potential) change.
9917
+ * The value can also be `null` or `undefined`, for things that might not
9918
+ * need changing.
9919
+ *
9929
9920
  * @type {boolean?}
9930
9921
  */
9931
- // eslint-disable-next-line no-unused-expressions
9932
9922
  this.fatal
9923
+
9933
9924
  /**
9934
9925
  * Starting line of error.
9926
+ *
9935
9927
  * @type {number?}
9936
9928
  */
9937
9929
  this.line = position.start.line
9930
+
9938
9931
  /**
9939
9932
  * Starting column of error.
9933
+ *
9940
9934
  * @type {number?}
9941
9935
  */
9942
9936
  this.column = position.start.column
9937
+
9943
9938
  /**
9944
- * Namespace of warning.
9939
+ * Full range information, when available.
9940
+ * Has `start` and `end` fields, both set to an object with `line` and
9941
+ * `column`, set to `number?`.
9942
+ *
9943
+ * @type {Position?}
9944
+ */
9945
+ this.position = position
9946
+
9947
+ /**
9948
+ * Namespace of warning (example: `'my-package'`).
9949
+ *
9945
9950
  * @type {string?}
9946
9951
  */
9947
9952
  this.source = parts[0]
9953
+
9948
9954
  /**
9949
- * Category of message.
9955
+ * Category of message (example: `'my-rule-name'`).
9956
+ *
9950
9957
  * @type {string?}
9951
9958
  */
9952
9959
  this.ruleId = parts[1]
9960
+
9953
9961
  /**
9954
- * Full range information, when available.
9955
- * Has start and end properties, both set to an object with line and column, set to number?.
9956
- * @type {Position?}
9962
+ * Path of a file (used throughout the VFile ecosystem).
9963
+ *
9964
+ * @type {string?}
9957
9965
  */
9958
- this.position = position
9966
+ this.file
9959
9967
 
9960
9968
  // The following fields are “well known”.
9961
9969
  // Not standard.
9962
9970
  // Feel free to add other non-standard fields to your messages.
9963
9971
 
9964
- /* eslint-disable no-unused-expressions */
9965
9972
  /**
9966
- * You can use this to specify the source value that’s being reported, which
9967
- * is deemed incorrect.
9973
+ * Specify the source value that’s being reported, which is deemed
9974
+ * incorrect.
9975
+ *
9968
9976
  * @type {string?}
9969
9977
  */
9970
9978
  this.actual
9979
+
9971
9980
  /**
9972
- * You can use this to suggest values that should be used instead of
9973
- * `actual`, one or more values that are deemed as acceptable.
9981
+ * Suggest values that should be used instead of `actual`, one or more
9982
+ * values that are deemed as acceptable.
9983
+ *
9974
9984
  * @type {Array<string>?}
9975
9985
  */
9976
9986
  this.expected
9987
+
9977
9988
  /**
9978
- * You may add a file property with a path of a file (used throughout the VFile ecosystem).
9979
- * @type {string?}
9980
- */
9981
- this.file
9982
- /**
9983
- * You may add a url property with a link to documentation for the message.
9989
+ * Link to documentation for the message.
9990
+ *
9984
9991
  * @type {string?}
9985
9992
  */
9986
9993
  this.url
9994
+
9987
9995
  /**
9988
- * You may add a note property with a long form description of the message (supported by vfile-reporter).
9996
+ * Long form description of the message (supported by `vfile-reporter`).
9997
+ *
9989
9998
  * @type {string?}
9990
9999
  */
9991
10000
  this.note
@@ -10830,7 +10839,7 @@ class VFile {
10830
10839
  * associates it with the file by adding it to `vfile.messages` and setting
10831
10840
  * `message.file` to the current filepath.
10832
10841
  *
10833
- * @param {string|Error} reason
10842
+ * @param {string|Error|VFileMessage} reason
10834
10843
  * Human readable reason for the message, uses the stack and message of the error if given.
10835
10844
  * @param {Node|NodeLike|Position|Point} [place]
10836
10845
  * Place where the message occurred in the file.
@@ -10858,7 +10867,7 @@ class VFile {
10858
10867
  * Like `VFile#message()`, but associates an informational message where
10859
10868
  * `fatal` is set to `null`.
10860
10869
  *
10861
- * @param {string|Error} reason
10870
+ * @param {string|Error|VFileMessage} reason
10862
10871
  * Human readable reason for the message, uses the stack and message of the error if given.
10863
10872
  * @param {Node|NodeLike|Position|Point} [place]
10864
10873
  * Place where the message occurred in the file.
@@ -10881,7 +10890,7 @@ class VFile {
10881
10890
  *
10882
10891
  * > 👉 **Note**: a fatal error means that a file is no longer processable.
10883
10892
  *
10884
- * @param {string|Error} reason
10893
+ * @param {string|Error|VFileMessage} reason
10885
10894
  * Human readable reason for the message, uses the stack and message of the error if given.
10886
10895
  * @param {Node|NodeLike|Position|Point} [place]
10887
10896
  * Place where the message occurred in the file.
@@ -22367,6 +22376,7 @@ const html_html = create({
22367
22376
  onAbort: null,
22368
22377
  onAfterPrint: null,
22369
22378
  onAuxClick: null,
22379
+ onBeforeMatch: null,
22370
22380
  onBeforePrint: null,
22371
22381
  onBeforeUnload: null,
22372
22382
  onBlur: null,
@@ -22433,6 +22443,7 @@ const html_html = create({
22433
22443
  onReset: null,
22434
22444
  onResize: null,
22435
22445
  onScroll: null,
22446
+ onScrollEnd: null,
22436
22447
  onSecurityPolicyViolation: null,
22437
22448
  onSeeked: null,
22438
22449
  onSeeking: null,
@@ -23351,6 +23362,15 @@ function camelcase($0) {
23351
23362
  }
23352
23363
 
23353
23364
  ;// CONCATENATED MODULE: ../node_modules/property-information/lib/hast-to-react.js
23365
+ /**
23366
+ * `hast` is close to `React`, but differs in a couple of cases.
23367
+ *
23368
+ * To get a React property from a hast property, check if it is in
23369
+ * `hastToReact`, if it is, then use the corresponding value,
23370
+ * otherwise, use the hast property.
23371
+ *
23372
+ * @type {Record<string, string>}
23373
+ */
23354
23374
  const hastToReact = {
23355
23375
  classId: 'classID',
23356
23376
  dataType: 'datatype',
@@ -23373,10 +23393,12 @@ const hastToReact = {
23373
23393
 
23374
23394
  ;// CONCATENATED MODULE: ../node_modules/space-separated-tokens/index.js
23375
23395
  /**
23376
- * Parse space separated tokens to an array of strings.
23396
+ * Parse space-separated tokens to an array of strings.
23377
23397
  *
23378
- * @param {string} value Space separated tokens
23379
- * @returns {Array.<string>} Tokens
23398
+ * @param {string} value
23399
+ * Space-separated tokens.
23400
+ * @returns {Array<string>}
23401
+ * List of tokens.
23380
23402
  */
23381
23403
  function space_separated_tokens_parse(value) {
23382
23404
  const input = String(value || '').trim()
@@ -23384,10 +23406,12 @@ function space_separated_tokens_parse(value) {
23384
23406
  }
23385
23407
 
23386
23408
  /**
23387
- * Serialize an array of strings as space separated tokens.
23409
+ * Serialize an array of strings as space separated-tokens.
23388
23410
  *
23389
- * @param {Array.<string|number>} values Tokens
23390
- * @returns {string} Space separated tokens
23411
+ * @param {Array<string|number>} values
23412
+ * List of tokens.
23413
+ * @returns {string}
23414
+ * Space-separated tokens.
23391
23415
  */
23392
23416
  function stringify(values) {
23393
23417
  return values.join(' ').trim()
@@ -23395,27 +23419,35 @@ function stringify(values) {
23395
23419
 
23396
23420
  ;// CONCATENATED MODULE: ../node_modules/comma-separated-tokens/index.js
23397
23421
  /**
23398
- * @typedef {Object} StringifyOptions
23399
- * @property {boolean} [padLeft=true] Whether to pad a space before a token (`boolean`, default: `true`).
23400
- * @property {boolean} [padRight=false] Whether to pad a space after a token (`boolean`, default: `false`).
23422
+ * @typedef Options
23423
+ * Configuration for `stringify`.
23424
+ * @property {boolean} [padLeft=true]
23425
+ * Whether to pad a space before a token.
23426
+ * @property {boolean} [padRight=false]
23427
+ * Whether to pad a space after a token.
23401
23428
  */
23402
23429
 
23403
23430
  /**
23404
- * Parse comma separated tokens to an array.
23431
+ * @typedef {Options} StringifyOptions
23432
+ * Please use `StringifyOptions` instead.
23433
+ */
23434
+
23435
+ /**
23436
+ * Parse comma-separated tokens to an array.
23405
23437
  *
23406
23438
  * @param {string} value
23407
- * @returns {Array.<string>}
23439
+ * Comma-separated tokens.
23440
+ * @returns {Array<string>}
23441
+ * List of tokens.
23408
23442
  */
23409
23443
  function comma_separated_tokens_parse(value) {
23410
- /** @type {Array.<string>} */
23411
- var tokens = []
23412
- var input = String(value || '')
23413
- var index = input.indexOf(',')
23414
- var start = 0
23444
+ /** @type {Array<string>} */
23445
+ const tokens = []
23446
+ const input = String(value || '')
23447
+ let index = input.indexOf(',')
23448
+ let start = 0
23415
23449
  /** @type {boolean} */
23416
- var end
23417
- /** @type {string} */
23418
- var token
23450
+ let end = false
23419
23451
 
23420
23452
  while (!end) {
23421
23453
  if (index === -1) {
@@ -23423,7 +23455,7 @@ function comma_separated_tokens_parse(value) {
23423
23455
  end = true
23424
23456
  }
23425
23457
 
23426
- token = input.slice(start, index).trim()
23458
+ const token = input.slice(start, index).trim()
23427
23459
 
23428
23460
  if (token || !end) {
23429
23461
  tokens.push(token)
@@ -23437,21 +23469,22 @@ function comma_separated_tokens_parse(value) {
23437
23469
  }
23438
23470
 
23439
23471
  /**
23440
- * Serialize an array of strings to comma separated tokens.
23472
+ * Serialize an array of strings or numbers to comma-separated tokens.
23441
23473
  *
23442
- * @param {Array.<string|number>} values
23443
- * @param {StringifyOptions} [options]
23474
+ * @param {Array<string|number>} values
23475
+ * List of tokens.
23476
+ * @param {Options} [options]
23477
+ * Configuration for `stringify` (optional).
23444
23478
  * @returns {string}
23479
+ * Comma-separated tokens.
23445
23480
  */
23446
23481
  function comma_separated_tokens_stringify(values, options) {
23447
- var settings = options || {}
23482
+ const settings = options || {}
23448
23483
 
23449
23484
  // Ensure the last empty entry is seen.
23450
- if (values[values.length - 1] === '') {
23451
- values = values.concat('')
23452
- }
23485
+ const input = values[values.length - 1] === '' ? [...values, ''] : values
23453
23486
 
23454
- return values
23487
+ return input
23455
23488
  .join(
23456
23489
  (settings.padRight ? ' ' : '') +
23457
23490
  ',' +
@@ -23523,7 +23556,8 @@ var style_to_object = __webpack_require__(13);
23523
23556
  * @typedef {ComponentPropsWithoutRef<'h1'> & ReactMarkdownProps & {level: number}} HeadingProps
23524
23557
  * @typedef {ComponentPropsWithoutRef<'li'> & ReactMarkdownProps & {checked: boolean|null, index: number, ordered: boolean}} LiProps
23525
23558
  * @typedef {ComponentPropsWithoutRef<'ol'> & ReactMarkdownProps & {depth: number, ordered: true}} OrderedListProps
23526
- * @typedef {ComponentPropsWithoutRef<'table'> & ReactMarkdownProps & {style?: Record<string, unknown>, isHeader: boolean}} TableCellProps
23559
+ * @typedef {ComponentPropsWithoutRef<'td'> & ReactMarkdownProps & {style?: Record<string, unknown>, isHeader: false}} TableDataCellProps
23560
+ * @typedef {ComponentPropsWithoutRef<'th'> & ReactMarkdownProps & {style?: Record<string, unknown>, isHeader: true}} TableHeaderCellProps
23527
23561
  * @typedef {ComponentPropsWithoutRef<'tr'> & ReactMarkdownProps & {isHeader: boolean}} TableRowProps
23528
23562
  * @typedef {ComponentPropsWithoutRef<'ul'> & ReactMarkdownProps & {depth: number, ordered: false}} UnorderedListProps
23529
23563
  *
@@ -23531,7 +23565,8 @@ var style_to_object = __webpack_require__(13);
23531
23565
  * @typedef {ComponentType<HeadingProps>} HeadingComponent
23532
23566
  * @typedef {ComponentType<LiProps>} LiComponent
23533
23567
  * @typedef {ComponentType<OrderedListProps>} OrderedListComponent
23534
- * @typedef {ComponentType<TableCellProps>} TableCellComponent
23568
+ * @typedef {ComponentType<TableDataCellProps>} TableDataCellComponent
23569
+ * @typedef {ComponentType<TableHeaderCellProps>} TableHeaderCellComponent
23535
23570
  * @typedef {ComponentType<TableRowProps>} TableRowComponent
23536
23571
  * @typedef {ComponentType<UnorderedListProps>} UnorderedListComponent
23537
23572
  *
@@ -23545,8 +23580,8 @@ var style_to_object = __webpack_require__(13);
23545
23580
  * @property {HeadingComponent|ReactMarkdownNames} h6
23546
23581
  * @property {LiComponent|ReactMarkdownNames} li
23547
23582
  * @property {OrderedListComponent|ReactMarkdownNames} ol
23548
- * @property {TableCellComponent|ReactMarkdownNames} td
23549
- * @property {TableCellComponent|ReactMarkdownNames} th
23583
+ * @property {TableDataCellComponent|ReactMarkdownNames} td
23584
+ * @property {TableHeaderCellComponent|ReactMarkdownNames} th
23550
23585
  * @property {TableRowComponent|ReactMarkdownNames} tr
23551
23586
  * @property {UnorderedListComponent|ReactMarkdownNames} ul
23552
23587
  *
@@ -23909,7 +23944,7 @@ function flattenPosition(pos) {
23909
23944
  ':',
23910
23945
  pos.end.column
23911
23946
  ]
23912
- .map((d) => String(d))
23947
+ .map(String)
23913
23948
  .join('')
23914
23949
  }
23915
23950
 
@@ -27247,9 +27282,9 @@ function gfmFootnoteToMarkdown() {
27247
27282
 
27248
27283
  ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
27249
27284
  /**
27250
- * @typedef {import('../types.js').Node} Node
27251
27285
  * @typedef {import('../types.js').Parent} Parent
27252
27286
  * @typedef {import('../types.js').SafeOptions} SafeOptions
27287
+ * @typedef {import('../types.js').Handle} Handle
27253
27288
  * @typedef {import('../types.js').Context} Context
27254
27289
  */
27255
27290
 
@@ -27280,8 +27315,11 @@ function containerPhrasing(parent, context, safeOptions) {
27280
27315
  indexStack[indexStack.length - 1] = index
27281
27316
 
27282
27317
  if (index + 1 < children.length) {
27318
+ /** @type {Handle} */
27283
27319
  // @ts-expect-error: hush, it’s actually a `zwitch`.
27284
27320
  let handle = context.handle.handlers[children[index + 1].type]
27321
+ /** @type {Handle} */
27322
+ // @ts-expect-error: hush, it’s actually a `zwitch`.
27285
27323
  if (handle && handle.peek) handle = handle.peek
27286
27324
  after = handle
27287
27325
  ? handle(children[index + 1], parent, context, {
@@ -27418,7 +27456,11 @@ function peekDelete() {
27418
27456
  ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
27419
27457
  /**
27420
27458
  * @typedef {import('mdast').InlineCode} InlineCode
27421
- * @typedef {import('../types.js').Handle} Handle
27459
+ * @typedef {import('mdast').Root} Root
27460
+ * @typedef {import('mdast').Content} Content
27461
+ * @typedef {Root|Content} Node
27462
+ * @typedef {Extract<Node, import('mdast').Parent>} Parent
27463
+ * @typedef {import('../types.js').Context} Context
27422
27464
  */
27423
27465
 
27424
27466
 
@@ -27426,8 +27468,10 @@ function peekDelete() {
27426
27468
  inline_code_inlineCode.peek = inlineCodePeek
27427
27469
 
27428
27470
  /**
27429
- * @type {Handle}
27430
27471
  * @param {InlineCode} node
27472
+ * @param {Parent|undefined} _
27473
+ * @param {Context} context
27474
+ * @returns {string}
27431
27475
  */
27432
27476
  function inline_code_inlineCode(node, _, context) {
27433
27477
  let value = node.value || ''
@@ -27487,7 +27531,7 @@ function inline_code_inlineCode(node, _, context) {
27487
27531
  }
27488
27532
 
27489
27533
  /**
27490
- * @type {Handle}
27534
+ * @returns {string}
27491
27535
  */
27492
27536
  function inlineCodePeek() {
27493
27537
  return '`'
@@ -27497,7 +27541,7 @@ function inlineCodePeek() {
27497
27541
  /**
27498
27542
  * @typedef Options
27499
27543
  * Configuration (optional).
27500
- * @property {string|null|Array<string|null|undefined>} [align]
27544
+ * @property {string|null|ReadonlyArray<string|null|undefined>} [align]
27501
27545
  * One style for all columns, or styles for their respective columns.
27502
27546
  * Each style is either `'l'` (left), `'r'` (right), or `'c'` (center).
27503
27547
  * Other values are treated as `''`, which doesn’t place the colon in the
@@ -27642,7 +27686,7 @@ function inlineCodePeek() {
27642
27686
  /**
27643
27687
  * Generate a markdown ([GFM](https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables)) table..
27644
27688
  *
27645
- * @param {Array<Array<string|null|undefined>>} table
27689
+ * @param {ReadonlyArray<ReadonlyArray<string|null|undefined>>} table
27646
27690
  * Table data (matrix of strings).
27647
27691
  * @param {Options} [options]
27648
27692
  * Configuration (optional).
@@ -28200,10 +28244,13 @@ function checkListItemIndent(context) {
28200
28244
  ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/handle/list-item.js
28201
28245
  /**
28202
28246
  * @typedef {import('mdast').ListItem} ListItem
28203
- * @typedef {import('mdast').List} List
28204
28247
  * @typedef {import('../util/indent-lines.js').Map} Map
28205
- * @typedef {import('../types.js').Options} Options
28206
- * @typedef {import('../types.js').Handle} Handle
28248
+ * @typedef {import('mdast').Root} Root
28249
+ * @typedef {import('mdast').Content} Content
28250
+ * @typedef {Root|Content} Node
28251
+ * @typedef {Extract<Node, import('mdast').Parent>} Parent
28252
+ * @typedef {import('../types.js').Context} Context
28253
+ * @typedef {import('../types.js').SafeOptions} SafeOptions
28207
28254
  */
28208
28255
 
28209
28256
 
@@ -28213,8 +28260,11 @@ function checkListItemIndent(context) {
28213
28260
 
28214
28261
 
28215
28262
  /**
28216
- * @type {Handle}
28217
28263
  * @param {ListItem} node
28264
+ * @param {Parent|undefined} parent
28265
+ * @param {Context} context
28266
+ * @param {SafeOptions} safeOptions
28267
+ * @returns {string}
28218
28268
  */
28219
28269
  function list_item_listItem(node, parent, context, safeOptions) {
28220
28270
  const listItemIndent = checkListItemIndent(context)
@@ -29684,32 +29734,75 @@ function hast_to_hyperscript_parseStyle(value, tagName) {
29684
29734
  }
29685
29735
 
29686
29736
  ;// CONCATENATED MODULE: ../node_modules/zwitch/index.js
29687
- var zwitch_own = {}.hasOwnProperty
29688
-
29689
29737
  /**
29690
29738
  * @callback Handler
29691
- * @param {...unknown} value
29692
- * @return {unknown}
29693
- *
29694
- * @typedef {Record<string, Handler>} Handlers
29695
- *
29696
- * @typedef {Object} Options
29697
- * @property {Handler} [unknown]
29698
- * @property {Handler} [invalid]
29739
+ * Handle a value, with a certain ID field set to a certain value.
29740
+ * The ID field is passed to `zwitch`, and it’s value is this function’s
29741
+ * place on the `handlers` record.
29742
+ * @param {...any} parameters
29743
+ * Arbitrary parameters passed to the zwitch.
29744
+ * The first will be an object with a certain ID field set to a certain value.
29745
+ * @returns {any}
29746
+ * Anything!
29747
+ */
29748
+
29749
+ /**
29750
+ * @callback UnknownHandler
29751
+ * Handle values that do have a certain ID field, but it’s set to a value
29752
+ * that is not listed in the `handlers` record.
29753
+ * @param {unknown} value
29754
+ * An object with a certain ID field set to an unknown value.
29755
+ * @param {...any} rest
29756
+ * Arbitrary parameters passed to the zwitch.
29757
+ * @returns {any}
29758
+ * Anything!
29759
+ */
29760
+
29761
+ /**
29762
+ * @callback InvalidHandler
29763
+ * Handle values that do not have a certain ID field.
29764
+ * @param {unknown} value
29765
+ * Any unknown value.
29766
+ * @param {...any} rest
29767
+ * Arbitrary parameters passed to the zwitch.
29768
+ * @returns {void|null|undefined|never}
29769
+ * This should crash or return nothing.
29770
+ */
29771
+
29772
+ /**
29773
+ * @template {InvalidHandler} [Invalid=InvalidHandler]
29774
+ * @template {UnknownHandler} [Unknown=UnknownHandler]
29775
+ * @template {Record<string, Handler>} [Handlers=Record<string, Handler>]
29776
+ * @typedef Options
29777
+ * Configuration (required).
29778
+ * @property {Invalid} [invalid]
29779
+ * Handler to use for invalid values.
29780
+ * @property {Unknown} [unknown]
29781
+ * Handler to use for unknown values.
29699
29782
  * @property {Handlers} [handlers]
29783
+ * Handlers to use.
29700
29784
  */
29701
29785
 
29786
+ const zwitch_own = {}.hasOwnProperty
29787
+
29702
29788
  /**
29703
- * Handle values based on a property.
29789
+ * Handle values based on a field.
29704
29790
  *
29791
+ * @template {InvalidHandler} [Invalid=InvalidHandler]
29792
+ * @template {UnknownHandler} [Unknown=UnknownHandler]
29793
+ * @template {Record<string, Handler>} [Handlers=Record<string, Handler>]
29705
29794
  * @param {string} key
29706
- * @param {Options} [options]
29795
+ * Field to switch on.
29796
+ * @param {Options<Invalid, Unknown, Handlers>} [options]
29797
+ * Configuration (required).
29798
+ * @returns {{unknown: Unknown, invalid: Invalid, handlers: Handlers, (...parameters: Parameters<Handlers[keyof Handlers]>): ReturnType<Handlers[keyof Handlers]>, (...parameters: Parameters<Unknown>): ReturnType<Unknown>}}
29707
29799
  */
29708
29800
  function zwitch(key, options) {
29709
- var settings = options || {}
29801
+ const settings = options || {}
29710
29802
 
29711
29803
  /**
29712
29804
  * Handle one value.
29805
+ *
29713
29806
  * Based on the bound `key`, a respective handler will be called.
29714
29807
  * If `value` is not an object, or doesn’t have a `key` property, the special
29715
29808
  * “invalid” handler will be called.
@@ -29719,23 +29812,36 @@ function zwitch(key, options) {
29719
29812
  * All arguments, and the context object, are passed through to the handler,
29720
29813
  * and it’s result is returned.
29721
29814
  *
29722
- * @param {...unknown} [value]
29723
29815
  * @this {unknown}
29724
- * @returns {unknown}
29816
+ * Any context object.
29817
+ * @param {unknown} [value]
29818
+ * Any value.
29819
+ * @param {...unknown} parameters
29820
+ * Arbitrary parameters passed to the zwitch.
29725
29821
  * @property {Handler} invalid
29822
+ * Handle for values that do not have a certain ID field.
29726
29823
  * @property {Handler} unknown
29824
+ * Handle values that do have a certain ID field, but it’s set to a value
29825
+ * that is not listed in the `handlers` record.
29727
29826
  * @property {Handlers} handlers
29827
+ * Record of handlers.
29828
+ * @returns {unknown}
29829
+ * Anything.
29728
29830
  */
29729
- function one(value) {
29730
- var fn = one.invalid
29731
- var handlers = one.handlers
29831
+ function one(value, ...parameters) {
29832
+ /** @type {Handler|undefined} */
29833
+ let fn = one.invalid
29834
+ const handlers = one.handlers
29732
29835
 
29733
29836
  if (value && zwitch_own.call(value, key)) {
29734
- fn = zwitch_own.call(handlers, value[key]) ? handlers[value[key]] : one.unknown
29837
+ // @ts-expect-error Indexable.
29838
+ const id = String(value[key])
29839
+ // @ts-expect-error Indexable.
29840
+ fn = zwitch_own.call(handlers, id) ? handlers[id] : one.unknown
29735
29841
  }
29736
29842
 
29737
29843
  if (fn) {
29738
- return fn.apply(this, arguments)
29844
+ return fn.call(this, value, ...parameters)
29739
29845
  }
29740
29846
  }
29741
29847
 
@@ -29743,6 +29849,7 @@ function zwitch(key, options) {
29743
29849
  one.invalid = settings.invalid
29744
29850
  one.unknown = settings.unknown
29745
29851
 
29852
+ // @ts-expect-error: matches!
29746
29853
  return one
29747
29854
  }
29748
29855
 
@@ -30155,7 +30262,6 @@ const raw =
30155
30262
  let index = -1
30156
30263
  const parser = new lib_parser(parseOptions)
30157
30264
  const one = zwitch('type', {
30158
- // @ts-expect-error: hush.
30159
30265
  handlers: {root, element, text, comment, doctype, raw: handleRaw},
30160
30266
  // @ts-expect-error: hush.
30161
30267
  unknown: lib_unknown
@@ -30307,13 +30413,13 @@ const raw =
30307
30413
  */
30308
30414
  function element(node) {
30309
30415
  resetTokenizer()
30310
- parser._processToken(startTag(node), webNamespaces.html)
30416
+ parser._processInputToken(startTag(node))
30311
30417
 
30312
30418
  all(node.children)
30313
30419
 
30314
30420
  if (!htmlVoidElements.includes(node.tagName)) {
30315
30421
  resetTokenizer()
30316
- parser._processToken(endTag(node))
30422
+ parser._processInputToken(endTag(node))
30317
30423
  }
30318
30424
  }
30319
30425
 
@@ -30323,7 +30429,7 @@ const raw =
30323
30429
  */
30324
30430
  function text(node) {
30325
30431
  resetTokenizer()
30326
- parser._processToken({
30432
+ parser._processInputToken({
30327
30433
  type: characterToken,
30328
30434
  chars: node.value,
30329
30435
  location: createParse5Location(node)
@@ -30336,7 +30442,7 @@ const raw =
30336
30442
  */
30337
30443
  function doctype(node) {
30338
30444
  resetTokenizer()
30339
- parser._processToken({
30445
+ parser._processInputToken({
30340
30446
  type: doctypeToken,
30341
30447
  name: 'html',
30342
30448
  forceQuirks: false,
@@ -30352,7 +30458,7 @@ const raw =
30352
30458
  */
30353
30459
  function comment(node) {
30354
30460
  resetTokenizer()
30355
- parser._processToken({
30461
+ parser._processInputToken({
30356
30462
  type: commentToken,
30357
30463
  data: node.value,
30358
30464
  location: createParse5Location(node)
@@ -30464,7 +30570,7 @@ const raw =
30464
30570
  token.location.endLine = posTracker.line
30465
30571
  token.location.endCol = posTracker.col + 1
30466
30572
  token.location.endOffset = posTracker.offset + 1
30467
- parser._processToken(token)
30573
+ parser._processInputToken(token)
30468
30574
  }
30469
30575
 
30470
30576
  // Reset tokenizer:
@@ -30610,8 +30716,90 @@ function rehypeRaw(options = {}) {
30610
30716
  }
30611
30717
  }
30612
30718
 
30613
- // EXTERNAL MODULE: ../node_modules/github-slugger/index.js
30614
- var github_slugger = __webpack_require__(449);
30719
+ ;// CONCATENATED MODULE: ../node_modules/github-slugger/regex.js
30720
+ // This module is generated by `script/`.
30721
+ /* eslint-disable no-control-regex, no-misleading-character-class, no-useless-escape */
30722
+ const regex = /[\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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[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g
30723
+
30724
+ ;// CONCATENATED MODULE: ../node_modules/github-slugger/index.js
30725
+
30726
+
30727
+ const github_slugger_own = Object.hasOwnProperty
30728
+
30729
+ /**
30730
+ * Slugger.
30731
+ */
30732
+ class BananaSlug {
30733
+ /**
30734
+ * Create a new slug class.
30735
+ */
30736
+ constructor () {
30737
+ /** @type {Record<string, number>} */
30738
+ // eslint-disable-next-line no-unused-expressions
30739
+ this.occurrences
30740
+
30741
+ this.reset()
30742
+ }
30743
+
30744
+ /**
30745
+ * Generate a unique slug.
30746
+ *
30747
+ * Tracks previously generated slugs: repeated calls with the same value
30748
+ * will result in different slugs.
30749
+ * Use the `slug` function to get same slugs.
30750
+ *
30751
+ * @param {string} value
30752
+ * String of text to slugify
30753
+ * @param {boolean} [maintainCase=false]
30754
+ * Keep the current case, otherwise make all lowercase
30755
+ * @return {string}
30756
+ * A unique slug string
30757
+ */
30758
+ slug (value, maintainCase) {
30759
+ const self = this
30760
+ let result = slug(value, maintainCase === true)
30761
+ const originalSlug = result
30762
+
30763
+ while (github_slugger_own.call(self.occurrences, result)) {
30764
+ self.occurrences[originalSlug]++
30765
+ result = originalSlug + '-' + self.occurrences[originalSlug]
30766
+ }
30767
+
30768
+ self.occurrences[result] = 0
30769
+
30770
+ return result
30771
+ }
30772
+
30773
+ /**
30774
+ * Reset - Forget all previous slugs
30775
+ *
30776
+ * @return void
30777
+ */
30778
+ reset () {
30779
+ this.occurrences = Object.create(null)
30780
+ }
30781
+ }
30782
+
30783
+ /**
30784
+ * Generate a slug.
30785
+ *
30786
+ * Does not track previously generated slugs: repeated calls with the same value
30787
+ * will result in the exact same slug.
30788
+ * Use the `GithubSlugger` class to get unique slugs.
30789
+ *
30790
+ * @param {string} value
30791
+ * String of text to slugify
30792
+ * @param {boolean} [maintainCase=false]
30793
+ * Keep the current case, otherwise make all lowercase
30794
+ * @return {string}
30795
+ * A unique slug string
30796
+ */
30797
+ function slug (value, maintainCase) {
30798
+ if (typeof value !== 'string') return ''
30799
+ if (!maintainCase) value = value.toLowerCase()
30800
+ return value.replace(regex, '').replace(/ /g, '-')
30801
+ }
30802
+
30615
30803
  ;// CONCATENATED MODULE: ../node_modules/hast-util-has-property/index.js
30616
30804
  var hast_util_has_property_own = {}.hasOwnProperty
30617
30805
 
@@ -30743,26 +30931,35 @@ function hast_util_to_string_all(node) {
30743
30931
  * @typedef {import('hast').Root} Root
30744
30932
  */
30745
30933
 
30934
+ /**
30935
+ * @typedef Options
30936
+ * Configuration (optional).
30937
+ * @property {string} [prefix='']
30938
+ * Prefix to add in front of `id`s.
30939
+ */
30940
+
30746
30941
 
30747
30942
 
30748
30943
 
30749
30944
 
30750
30945
 
30751
30946
 
30752
- const slugs = new github_slugger()
30947
+ const slugs = new BananaSlug()
30753
30948
 
30754
30949
  /**
30755
30950
  * Plugin to add `id`s to headings.
30756
30951
  *
30757
- * @type {import('unified').Plugin<Array<void>, Root>}
30952
+ * @type {import('unified').Plugin<[Options?]|Array<void>, Root>}
30758
30953
  */
30759
- function rehypeSlug() {
30954
+ function rehypeSlug(options = {}) {
30955
+ const prefix = options.prefix || ''
30956
+
30760
30957
  return (tree) => {
30761
30958
  slugs.reset()
30762
30959
 
30763
30960
  visit(tree, 'element', (node) => {
30764
30961
  if (headingRank(node) && node.properties && !hasProperty(node, 'id')) {
30765
- node.properties.id = slugs.slug(hast_util_to_string_toString(node))
30962
+ node.properties.id = prefix + slugs.slug(hast_util_to_string_toString(node))
30766
30963
  }
30767
30964
  })
30768
30965
  }
@@ -31205,7 +31402,7 @@ const prevChild = (data = [], index) => {
31205
31402
  }
31206
31403
  return;
31207
31404
  };
31208
- const nextChild = (data = [], index, tagName) => {
31405
+ const nextChild = (data = [], index, tagName, codeBlockParames) => {
31209
31406
  let i = index;
31210
31407
  while (i < data.length) {
31211
31408
  i++;
@@ -31217,15 +31414,26 @@ const nextChild = (data = [], index, tagName) => {
31217
31414
  }
31218
31415
  else {
31219
31416
  const element = data[i];
31220
- if (!element || (element.type !== 'text' && element.type !== 'comment') || (element.type === 'text' && element.value.replace(/(\n|\s)/g, '') !== ''))
31417
+ if (!element || element.type === 'element')
31221
31418
  return;
31222
- if (element.type === 'comment') {
31223
- if (!/^rehype:/.test(element.value))
31224
- return;
31225
- const nextNode = nextChild(data, i, 'pre');
31226
- if (nextNode)
31419
+ if (element.type === 'text' && element.value.replace(/(\n|\s)/g, '') !== '')
31420
+ return;
31421
+ if (/^(comment|raw)$/ig.test(element?.type)) {
31422
+ if (!/^rehype:/.test(element.value?.replace(/^(\s+)?<!--(.*?)-->/, '$2') || '')) {
31227
31423
  return;
31228
- return element;
31424
+ }
31425
+ ;
31426
+ if (codeBlockParames) {
31427
+ const nextNode = nextChild(data, i, 'pre', codeBlockParames);
31428
+ if (nextNode)
31429
+ return;
31430
+ element.value = element.value?.replace(/^(\n|\s)+/, '');
31431
+ return element;
31432
+ }
31433
+ else {
31434
+ element.value = element.value?.replace(/^(\n|\s)+/, '');
31435
+ return element;
31436
+ }
31229
31437
  }
31230
31438
  }
31231
31439
  }
@@ -31238,7 +31446,7 @@ const nextChild = (data = [], index, tagName) => {
31238
31446
  * @returns 返回 当前参数数据 Object,`{}`
31239
31447
  */
31240
31448
  const getCommentObject = ({ value = '' }) => {
31241
- const param = getURLParameters(value.replace(/^rehype:/, ''));
31449
+ const param = getURLParameters(value.replace(/^<!--(.*?)-->/, '$1').replace(/^rehype:/, ''));
31242
31450
  Object.keys(param).forEach((keyName) => {
31243
31451
  if (param[keyName] === 'true') {
31244
31452
  param[keyName] = true;
@@ -31265,14 +31473,11 @@ const propertiesHandle = (defaultAttrs, attrs, type) => {
31265
31473
  ;// CONCATENATED MODULE: ../node_modules/rehype-attr/lib/index.js
31266
31474
 
31267
31475
 
31268
- const defaultOptions = {
31269
- properties: 'data',
31270
- };
31271
- const rehypeAttrs = (options) => {
31272
- const opts = { ...defaultOptions, ...options };
31476
+ const rehypeAttrs = (options = {}) => {
31477
+ const { properties = 'data', codeBlockParames = true } = options;
31273
31478
  return (tree) => {
31274
31479
  visit(tree, 'element', (node, index, parent) => {
31275
- if (node.tagName === 'pre' && node && Array.isArray(node.children) && parent && Array.isArray(parent.children) && parent.children.length > 1) {
31480
+ if (codeBlockParames && node.tagName === 'pre' && node && Array.isArray(node.children) && parent && Array.isArray(parent.children) && parent.children.length > 1) {
31276
31481
  const firstChild = node.children[0];
31277
31482
  if (firstChild && firstChild.tagName === 'code' && typeof index === 'number') {
31278
31483
  const child = prevChild(parent.children, index);
@@ -31280,17 +31485,17 @@ const rehypeAttrs = (options) => {
31280
31485
  const attr = getCommentObject(child);
31281
31486
  if (Object.keys(attr).length > 0) {
31282
31487
  node.properties = { ...node.properties, ...{ 'data-type': 'rehyp' } };
31283
- firstChild.properties = propertiesHandle(firstChild.properties, attr, opts.properties);
31488
+ firstChild.properties = propertiesHandle(firstChild.properties, attr, properties);
31284
31489
  }
31285
31490
  }
31286
31491
  }
31287
31492
  }
31288
31493
  if (/^(em|strong|b|a|i|p|pre|kbd|blockquote|h(1|2|3|4|5|6)|code|table|img|del|ul|ol)$/.test(node.tagName) && parent && Array.isArray(parent.children) && typeof index === 'number') {
31289
- const child = nextChild(parent.children, index);
31494
+ const child = nextChild(parent.children, index, '', codeBlockParames);
31290
31495
  if (child) {
31291
31496
  const attr = getCommentObject(child);
31292
31497
  if (Object.keys(attr).length > 0) {
31293
- node.properties = propertiesHandle(node.properties, attr, opts.properties);
31498
+ node.properties = propertiesHandle(node.properties, attr, properties);
31294
31499
  }
31295
31500
  }
31296
31501
  }
@@ -33058,11 +33263,11 @@ function java(Prism) {
33058
33263
 
33059
33264
  ;// CONCATENATED MODULE: ../node_modules/refractor/lang/regex.js
33060
33265
  // @ts-nocheck
33061
- regex.displayName = 'regex'
33062
- regex.aliases = []
33266
+ regex_regex.displayName = 'regex'
33267
+ regex_regex.aliases = []
33063
33268
 
33064
33269
  /** @type {import('../core.js').Syntax} */
33065
- function regex(Prism) {
33270
+ function regex_regex(Prism) {
33066
33271
  ;(function (Prism) {
33067
33272
  var specialEscape = {
33068
33273
  pattern: /\\[\\(){}[\]^$+*?|.]/,
@@ -37606,7 +37811,7 @@ refractor.register(diff)
37606
37811
  refractor.register(go)
37607
37812
  refractor.register(ini)
37608
37813
  refractor.register(java)
37609
- refractor.register(regex)
37814
+ refractor.register(regex_regex)
37610
37815
  refractor.register(javascript)
37611
37816
  refractor.register(json)
37612
37817
  refractor.register(kotlin)
@@ -57904,7 +58109,7 @@ function zig(Prism) {
57904
58109
  refractor.register(markup)
57905
58110
  refractor.register(css)
57906
58111
  refractor.register(clike)
57907
- refractor.register(regex)
58112
+ refractor.register(regex_regex)
57908
58113
  refractor.register(javascript)
57909
58114
  refractor.register(abap)
57910
58115
  refractor.register(abnf)
@@ -58633,47 +58838,74 @@ function indexedSearch(query, parent, state, from, firstElementOnly) {
58633
58838
  ;// CONCATENATED MODULE: ../node_modules/bcp-47-match/index.js
58634
58839
  /**
58635
58840
  * See <https://tools.ietf.org/html/rfc4647#section-3.1>
58636
- * for more information on the algorithms.
58841
+ * for more info on the algorithms.
58637
58842
  */
58638
58843
 
58639
58844
  /**
58640
58845
  * @typedef {string} Tag
58846
+ * BCP-47 tag.
58641
58847
  * @typedef {Array<Tag>} Tags
58848
+ * List of BCP-47 tags.
58642
58849
  * @typedef {string} Range
58850
+ * RFC 4647 range.
58643
58851
  * @typedef {Array<Range>} Ranges
58852
+ * List of RFC 4647 range.
58644
58853
  *
58645
58854
  * @callback Check
58855
+ * An internal check.
58646
58856
  * @param {Tag} tag
58857
+ * BCP-47 tag.
58647
58858
  * @param {Range} range
58859
+ * RFC 4647 range.
58648
58860
  * @returns {boolean}
58861
+ * Whether the range matches the tag.
58649
58862
  *
58650
58863
  * @typedef {FilterOrLookup<true>} Filter
58864
+ * Filter: yields all tags that match a range.
58651
58865
  * @typedef {FilterOrLookup<false>} Lookup
58866
+ * Lookup: yields the best tag that matches a range.
58652
58867
  */
58653
58868
 
58654
58869
  /**
58655
58870
  * @template {boolean} IsFilter
58871
+ * Whether to filter or perform a lookup.
58656
58872
  * @callback FilterOrLookup
58873
+ * A check.
58657
58874
  * @param {Tag|Tags} tags
58658
- * @param {Range|Ranges} [ranges='*']
58875
+ * One or more BCP-47 tags.
58876
+ * @param {Range|Ranges|undefined} [ranges='*']
58877
+ * One or more RFC 4647 ranges.
58659
58878
  * @returns {IsFilter extends true ? Tags : Tag|undefined}
58879
+ * Result.
58660
58880
  */
58661
58881
 
58662
58882
  /**
58663
58883
  * Factory to perform a filter or a lookup.
58884
+ *
58664
58885
  * This factory creates a function that accepts a list of tags and a list of
58665
58886
  * ranges, and contains logic to exit early for lookups.
58666
58887
  * `check` just has to deal with one tag and one range.
58667
58888
  * This match function iterates over ranges, and for each range,
58668
- * iterates over tags. That way, earlier ranges matching any tag have
58669
- * precedence over later ranges.
58889
+ * iterates over tags.
58890
+ * That way, earlier ranges matching any tag have precedence over later ranges.
58670
58891
  *
58671
58892
  * @template {boolean} IsFilter
58672
58893
  * @param {Check} check
58894
+ * A check.
58673
58895
  * @param {IsFilter} filter
58896
+ * Whether to filter or perform a lookup.
58674
58897
  * @returns {FilterOrLookup<IsFilter>}
58898
+ * Filter or lookup.
58675
58899
  */
58676
58900
  function bcp_47_match_factory(check, filter) {
58901
+ /**
58902
+ * @param {Tag|Tags} tags
58903
+ * One or more BCP-47 tags.
58904
+ * @param {Range|Ranges|undefined} [ranges='*']
58905
+ * One or more RFC 4647 ranges.
58906
+ * @returns {IsFilter extends true ? Tags : Tag|undefined}
58907
+ * Result.
58908
+ */
58677
58909
  return function (tags, ranges) {
58678
58910
  let left = cast(tags, 'tag')
58679
58911
  const right = cast(
@@ -58723,6 +58955,13 @@ function bcp_47_match_factory(check, filter) {
58723
58955
  /**
58724
58956
  * Basic Filtering (Section 3.3.1) matches a language priority list consisting
58725
58957
  * of basic language ranges (Section 2.1) to sets of language tags.
58958
+ *
58959
+ * @param {Tag|Tags} tags
58960
+ * One or more BCP-47 tags.
58961
+ * @param {Range|Ranges|undefined} [ranges='*']
58962
+ * One or more RFC 4647 ranges.
58963
+ * @returns {Tags}
58964
+ * List of BCP-47 tags.
58726
58965
  */
58727
58966
  const basicFilter = bcp_47_match_factory(function (tag, range) {
58728
58967
  return range === '*' || tag === range || tag.includes(range + '-')
@@ -58732,6 +58971,13 @@ const basicFilter = bcp_47_match_factory(function (tag, range) {
58732
58971
  * Extended Filtering (Section 3.3.2) matches a language priority list
58733
58972
  * consisting of extended language ranges (Section 2.2) to sets of language
58734
58973
  * tags.
58974
+ *
58975
+ * @param {Tag|Tags} tags
58976
+ * One or more BCP-47 tags.
58977
+ * @param {Range|Ranges|undefined} [ranges='*']
58978
+ * One or more RFC 4647 ranges.
58979
+ * @returns {Tags}
58980
+ * List of BCP-47 tags.
58735
58981
  */
58736
58982
  const extendedFilter = bcp_47_match_factory(function (tag, range) {
58737
58983
  // 3.3.2.1
@@ -58781,6 +59027,13 @@ const extendedFilter = bcp_47_match_factory(function (tag, range) {
58781
59027
  * Lookup (Section 3.4) matches a language priority list consisting of basic
58782
59028
  * language ranges to sets of language tags to find the one exact language tag
58783
59029
  * that best matches the range.
59030
+ *
59031
+ * @param {Tag|Tags} tags
59032
+ * One or more BCP-47 tags.
59033
+ * @param {Range|Ranges|undefined} [ranges='*']
59034
+ * One or more RFC 4647 ranges.
59035
+ * @returns {Tag|undefined}
59036
+ * BCP-47 tag.
58784
59037
  */
58785
59038
  const lookup = bcp_47_match_factory(function (tag, range) {
58786
59039
  let right = range
@@ -62564,13 +62817,14 @@ function _classCallCheck(instance, Constructor) {
62564
62817
  }
62565
62818
  }
62566
62819
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/createClass.js
62820
+
62567
62821
  function _defineProperties(target, props) {
62568
62822
  for (var i = 0; i < props.length; i++) {
62569
62823
  var descriptor = props[i];
62570
62824
  descriptor.enumerable = descriptor.enumerable || false;
62571
62825
  descriptor.configurable = true;
62572
62826
  if ("value" in descriptor) descriptor.writable = true;
62573
- Object.defineProperty(target, descriptor.key, descriptor);
62827
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
62574
62828
  }
62575
62829
  }
62576
62830
  function _createClass(Constructor, protoProps, staticProps) {
@@ -62732,7 +62986,7 @@ var commands_getCommands=function getCommands(){return[bold,italic,strikeThrough
62732
62986
  * - `9` - `Tab`
62733
62987
  */function stopPropagation(e){e.stopPropagation();e.preventDefault();}function handleKeyDown(e){var tabSize=arguments.length>1&&arguments[1]!==undefined?arguments[1]:2;var defaultTabEnable=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var target=e.target;var starVal=target.value.substr(0,target.selectionStart);var valArr=starVal.split('\n');var currentLineStr=valArr[valArr.length-1];var textArea=new TextAreaTextApi(target);/**
62734
62988
  * `9` - `Tab`
62735
- */if(!defaultTabEnable&&e.code&&e.code.toLowerCase()==='tab'){stopPropagation(e);var space=new Array(tabSize+1).join(' ');if(target.selectionStart!==target.selectionEnd){var _star=target.value.substring(0,target.selectionStart).split('\n');var _end=target.value.substring(0,target.selectionEnd).split('\n');var modifiedTextLine=[];_end.forEach(function(item,idx){if(item!==_star[idx]){modifiedTextLine.push(item);}});var modifiedText=modifiedTextLine.join('\n');var oldSelectText=target.value.substring(target.selectionStart,target.selectionEnd);var newStarNum=target.value.substring(0,target.selectionStart).length;textArea.setSelectionRange({start:target.value.indexOf(modifiedText),end:target.selectionEnd});var modifiedTextObj=insertBeforeEachLine(modifiedText,e.shiftKey?'':space);var text=modifiedTextObj.modifiedText;if(e.shiftKey){text=text.split('\n').map(function(item){return item.replace(new RegExp("^".concat(space)),'');}).join('\n');}textArea.replaceSelection(text);var startTabSize=e.shiftKey?-tabSize:tabSize;var endTabSize=e.shiftKey?-modifiedTextLine.length*tabSize:modifiedTextLine.length*tabSize;textArea.setSelectionRange({start:newStarNum+startTabSize,end:newStarNum+oldSelectText.length+endTabSize});}else{return insertTextAtPosition(target,space);}}else if(e.code&&e.code.toLowerCase()==='enter'&&(/^(-|\*)\s/.test(currentLineStr)||/^\d+.\s/.test(currentLineStr))){/**
62989
+ */if(!defaultTabEnable&&e.code&&e.code.toLowerCase()==='tab'){stopPropagation(e);var space=new Array(tabSize+1).join(' ');if(target.selectionStart!==target.selectionEnd){var _star=target.value.substring(0,target.selectionStart).split('\n');var _end=target.value.substring(0,target.selectionEnd).split('\n');var modifiedTextLine=[];_end.forEach(function(item,idx){if(item!==_star[idx]){modifiedTextLine.push(item);}});var modifiedText=modifiedTextLine.join('\n');var oldSelectText=target.value.substring(target.selectionStart,target.selectionEnd);var newStarNum=target.value.substring(0,target.selectionStart).length;textArea.setSelectionRange({start:target.value.indexOf(modifiedText),end:target.selectionEnd});var modifiedTextObj=insertBeforeEachLine(modifiedText,e.shiftKey?'':space);var text=modifiedTextObj.modifiedText;if(e.shiftKey){text=text.split('\n').map(function(item){return item.replace(new RegExp("^".concat(space)),'');}).join('\n');}textArea.replaceSelection(text);var startTabSize=e.shiftKey?-tabSize:tabSize;var endTabSize=e.shiftKey?-modifiedTextLine.length*tabSize:modifiedTextLine.length*tabSize;textArea.setSelectionRange({start:newStarNum+startTabSize,end:newStarNum+oldSelectText.length+endTabSize});}else{return insertTextAtPosition(target,space);}}else if(e.keyCode===13&&e.code.toLowerCase()==='enter'&&(/^(-|\*)\s/.test(currentLineStr)||/^\d+.\s/.test(currentLineStr))){/**
62736
62990
  * `13` - `Enter`
62737
62991
  */stopPropagation(e);var startStr='\n- ';if(currentLineStr.startsWith('*')){startStr='\n* ';}if(currentLineStr.startsWith('- [ ]')){startStr='\n- [ ] ';}else if(currentLineStr.startsWith('- [X]')){startStr='\n- [X] ';}if(/^\d+.\s/.test(currentLineStr)){startStr="\n".concat(parseInt(currentLineStr)+1,". ");}return insertTextAtPosition(target,startStr);}}
62738
62992
  ;// CONCATENATED MODULE: ./src/components/TextArea/index.less
@@ -62771,8 +63025,8 @@ var DragBar_DragBar=function DragBar(props){var _ref=props||{},prefixCls=_ref.pr
62771
63025
  // extracted by mini-css-extract-plugin
62772
63026
  /* harmony default export */ const src = ({});
62773
63027
  ;// CONCATENATED MODULE: ./src/Editor.tsx
62774
- var Editor_excluded=["prefixCls","className","value","commands","commandsFilter","extraCommands","height","enableScroll","visibleDragbar","highlightEnable","preview","fullscreen","overflow","previewOptions","textareaProps","maxHeight","minHeight","autoFocus","tabSize","defaultTabEnable","onChange","onHeightChange","hideToolbar","toolbarBottom","components","renderTextarea"];function setGroupPopFalse(){var data=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.keys(data).forEach(function(keyname){data[keyname]=false;});return data;}var InternalMDEditor=function InternalMDEditor(props,ref){var _ref=props||{},_ref$prefixCls=_ref.prefixCls,prefixCls=_ref$prefixCls===void 0?'w-md-editor':_ref$prefixCls,className=_ref.className,propsValue=_ref.value,_ref$commands=_ref.commands,commands=_ref$commands===void 0?commands_getCommands():_ref$commands,commandsFilter=_ref.commandsFilter,_ref$extraCommands=_ref.extraCommands,extraCommands=_ref$extraCommands===void 0?getExtraCommands():_ref$extraCommands,_ref$height=_ref.height,height=_ref$height===void 0?200:_ref$height,_ref$enableScroll=_ref.enableScroll,enableScroll=_ref$enableScroll===void 0?true:_ref$enableScroll,_ref$visibleDragbar=_ref.visibleDragbar,visibleDragbar=_ref$visibleDragbar===void 0?typeof props.visiableDragbar==='boolean'?props.visiableDragbar:true:_ref$visibleDragbar,_ref$highlightEnable=_ref.highlightEnable,highlightEnable=_ref$highlightEnable===void 0?true:_ref$highlightEnable,_ref$preview=_ref.preview,previewType=_ref$preview===void 0?'live':_ref$preview,_ref$fullscreen=_ref.fullscreen,fullscreen=_ref$fullscreen===void 0?false:_ref$fullscreen,_ref$overflow=_ref.overflow,overflow=_ref$overflow===void 0?true:_ref$overflow,_ref$previewOptions=_ref.previewOptions,previewOptions=_ref$previewOptions===void 0?{}:_ref$previewOptions,textareaProps=_ref.textareaProps,_ref$maxHeight=_ref.maxHeight,maxHeight=_ref$maxHeight===void 0?1200:_ref$maxHeight,_ref$minHeight=_ref.minHeight,minHeight=_ref$minHeight===void 0?100:_ref$minHeight,autoFocus=_ref.autoFocus,_ref$tabSize=_ref.tabSize,tabSize=_ref$tabSize===void 0?2:_ref$tabSize,_ref$defaultTabEnable=_ref.defaultTabEnable,defaultTabEnable=_ref$defaultTabEnable===void 0?false:_ref$defaultTabEnable,_onChange=_ref.onChange,onHeightChange=_ref.onHeightChange,hideToolbar=_ref.hideToolbar,_ref$toolbarBottom=_ref.toolbarBottom,toolbarBottom=_ref$toolbarBottom===void 0?false:_ref$toolbarBottom,components=_ref.components,renderTextarea=_ref.renderTextarea,other=_objectWithoutProperties(_ref,Editor_excluded);var cmds=commands.map(function(item){return commandsFilter?commandsFilter(item,false):item;}).filter(Boolean);var extraCmds=extraCommands.map(function(item){return commandsFilter?commandsFilter(item,true):item;}).filter(Boolean);var _useReducer=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useReducer)(reducer,{markdown:propsValue,preview:previewType,components:components,height:height,highlightEnable:highlightEnable,tabSize:tabSize,defaultTabEnable:defaultTabEnable,scrollTop:0,scrollTopPreview:0,commands:cmds,extraCommands:extraCmds,fullscreen:fullscreen,barPopup:{}}),_useReducer2=_slicedToArray(_useReducer,2),state=_useReducer2[0],dispatch=_useReducer2[1];var container=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);var previewRef=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);var enableScrollRef=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(enableScroll);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref,function(){return _objectSpread2({},state);});(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return enableScrollRef.current=enableScroll;},[enableScroll]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){var stateInit={};if(container.current){stateInit.container=container.current||undefined;}stateInit.markdown=propsValue||'';stateInit.barPopup={};if(dispatch){dispatch(_objectSpread2(_objectSpread2({},state),stateInit));}// eslint-disable-next-line react-hooks/exhaustive-deps
62775
- },[]);var cls=[className,'wmde-markdown-var',prefixCls,state.preview?"".concat(prefixCls,"-show-").concat(state.preview):null,state.fullscreen?"".concat(prefixCls,"-fullscreen"):null].filter(Boolean).join(' ').trim();(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return propsValue!==state.markdown&&dispatch({markdown:propsValue||''});},[propsValue,state.markdown]);// eslint-disable-next-line react-hooks/exhaustive-deps
63028
+ var Editor_excluded=["prefixCls","className","value","commands","commandsFilter","direction","extraCommands","height","enableScroll","visibleDragbar","highlightEnable","preview","fullscreen","overflow","previewOptions","textareaProps","maxHeight","minHeight","autoFocus","tabSize","defaultTabEnable","onChange","onHeightChange","hideToolbar","toolbarBottom","components","renderTextarea"];function setGroupPopFalse(){var data=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.keys(data).forEach(function(keyname){data[keyname]=false;});return data;}var InternalMDEditor=function InternalMDEditor(props,ref){var _ref=props||{},_ref$prefixCls=_ref.prefixCls,prefixCls=_ref$prefixCls===void 0?'w-md-editor':_ref$prefixCls,className=_ref.className,propsValue=_ref.value,_ref$commands=_ref.commands,commands=_ref$commands===void 0?commands_getCommands():_ref$commands,commandsFilter=_ref.commandsFilter,direction=_ref.direction,_ref$extraCommands=_ref.extraCommands,extraCommands=_ref$extraCommands===void 0?getExtraCommands():_ref$extraCommands,_ref$height=_ref.height,height=_ref$height===void 0?200:_ref$height,_ref$enableScroll=_ref.enableScroll,enableScroll=_ref$enableScroll===void 0?true:_ref$enableScroll,_ref$visibleDragbar=_ref.visibleDragbar,visibleDragbar=_ref$visibleDragbar===void 0?typeof props.visiableDragbar==='boolean'?props.visiableDragbar:true:_ref$visibleDragbar,_ref$highlightEnable=_ref.highlightEnable,highlightEnable=_ref$highlightEnable===void 0?true:_ref$highlightEnable,_ref$preview=_ref.preview,previewType=_ref$preview===void 0?'live':_ref$preview,_ref$fullscreen=_ref.fullscreen,fullscreen=_ref$fullscreen===void 0?false:_ref$fullscreen,_ref$overflow=_ref.overflow,overflow=_ref$overflow===void 0?true:_ref$overflow,_ref$previewOptions=_ref.previewOptions,previewOptions=_ref$previewOptions===void 0?{}:_ref$previewOptions,textareaProps=_ref.textareaProps,_ref$maxHeight=_ref.maxHeight,maxHeight=_ref$maxHeight===void 0?1200:_ref$maxHeight,_ref$minHeight=_ref.minHeight,minHeight=_ref$minHeight===void 0?100:_ref$minHeight,autoFocus=_ref.autoFocus,_ref$tabSize=_ref.tabSize,tabSize=_ref$tabSize===void 0?2:_ref$tabSize,_ref$defaultTabEnable=_ref.defaultTabEnable,defaultTabEnable=_ref$defaultTabEnable===void 0?false:_ref$defaultTabEnable,_onChange=_ref.onChange,onHeightChange=_ref.onHeightChange,hideToolbar=_ref.hideToolbar,_ref$toolbarBottom=_ref.toolbarBottom,toolbarBottom=_ref$toolbarBottom===void 0?false:_ref$toolbarBottom,components=_ref.components,renderTextarea=_ref.renderTextarea,other=_objectWithoutProperties(_ref,Editor_excluded);var cmds=commands.map(function(item){return commandsFilter?commandsFilter(item,false):item;}).filter(Boolean);var extraCmds=extraCommands.map(function(item){return commandsFilter?commandsFilter(item,true):item;}).filter(Boolean);var _useReducer=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useReducer)(reducer,{markdown:propsValue,preview:previewType,components:components,height:height,highlightEnable:highlightEnable,tabSize:tabSize,defaultTabEnable:defaultTabEnable,scrollTop:0,scrollTopPreview:0,commands:cmds,extraCommands:extraCmds,fullscreen:fullscreen,barPopup:{}}),_useReducer2=_slicedToArray(_useReducer,2),state=_useReducer2[0],dispatch=_useReducer2[1];var container=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);var previewRef=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);var enableScrollRef=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(enableScroll);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref,function(){return _objectSpread2({},state);});(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return enableScrollRef.current=enableScroll;},[enableScroll]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){var stateInit={};if(container.current){stateInit.container=container.current||undefined;}stateInit.markdown=propsValue||'';stateInit.barPopup={};if(dispatch){dispatch(_objectSpread2(_objectSpread2({},state),stateInit));}// eslint-disable-next-line react-hooks/exhaustive-deps
63029
+ },[]);var cls=[className,'wmde-markdown-var',direction?"".concat(prefixCls,"-").concat(direction):null,prefixCls,state.preview?"".concat(prefixCls,"-show-").concat(state.preview):null,state.fullscreen?"".concat(prefixCls,"-fullscreen"):null].filter(Boolean).join(' ').trim();(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return propsValue!==state.markdown&&dispatch({markdown:propsValue||''});},[propsValue,state.markdown]);// eslint-disable-next-line react-hooks/exhaustive-deps
62776
63030
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return previewType!==state.preview&&dispatch({preview:previewType});},[previewType]);// eslint-disable-next-line react-hooks/exhaustive-deps
62777
63031
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return tabSize!==state.tabSize&&dispatch({tabSize:tabSize});},[tabSize]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return highlightEnable!==state.highlightEnable&&dispatch({highlightEnable:highlightEnable});},// eslint-disable-next-line react-hooks/exhaustive-deps
62778
63032
  [highlightEnable]);// eslint-disable-next-line react-hooks/exhaustive-deps