@uiw/react-md-editor 3.19.5 → 3.19.7

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
@@ -9565,7 +9565,7 @@ __webpack_require__.d(__webpack_exports__, {
9565
9565
  "unorderedListCommand": () => (/* reexport */ unorderedListCommand)
9566
9566
  });
9567
9567
 
9568
- // NAMESPACE OBJECT: ../node_modules/react-markdown/node_modules/micromark/lib/constructs.js
9568
+ // NAMESPACE OBJECT: ../node_modules/micromark/lib/constructs.js
9569
9569
  var constructs_namespaceObject = {};
9570
9570
  __webpack_require__.r(constructs_namespaceObject);
9571
9571
  __webpack_require__.d(constructs_namespaceObject, {
@@ -9785,7 +9785,7 @@ function _extends() {
9785
9785
  }
9786
9786
  // EXTERNAL MODULE: ../node_modules/is-buffer/index.js
9787
9787
  var is_buffer = __webpack_require__(372);
9788
- ;// CONCATENATED MODULE: ../node_modules/vfile-message/node_modules/unist-util-stringify-position/index.js
9788
+ ;// CONCATENATED MODULE: ../node_modules/unist-util-stringify-position/index.js
9789
9789
  /**
9790
9790
  * @typedef {import('unist').Point} Point
9791
9791
  * @typedef {import('unist').Node} Node
@@ -11729,7 +11729,7 @@ function looksLikeAVFileValue(value) {
11729
11729
  return typeof value === 'string' || is_buffer(value)
11730
11730
  }
11731
11731
 
11732
- ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/mdast-util-to-string/index.js
11732
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-string/index.js
11733
11733
  /**
11734
11734
  * @typedef Options
11735
11735
  * @property {boolean} [includeImageAlt=true]
@@ -12230,7 +12230,7 @@ function factorySpace(effects, ok, type, max) {
12230
12230
  }
12231
12231
  }
12232
12232
 
12233
- ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/initialize/content.js
12233
+ ;// CONCATENATED MODULE: ../node_modules/micromark/lib/initialize/content.js
12234
12234
  /**
12235
12235
  * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
12236
12236
  * @typedef {import('micromark-util-types').Initializer} Initializer
@@ -12311,7 +12311,7 @@ function initializeContent(effects) {
12311
12311
  }
12312
12312
  }
12313
12313
 
12314
- ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/initialize/document.js
12314
+ ;// CONCATENATED MODULE: ../node_modules/micromark/lib/initialize/document.js
12315
12315
  /**
12316
12316
  * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
12317
12317
  * @typedef {import('micromark-util-types').Initializer} Initializer
@@ -13086,7 +13086,7 @@ function tokenizeContinuation(effects, ok, nok) {
13086
13086
  }
13087
13087
  }
13088
13088
 
13089
- ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/initialize/flow.js
13089
+ ;// CONCATENATED MODULE: ../node_modules/micromark/lib/initialize/flow.js
13090
13090
  /**
13091
13091
  * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
13092
13092
  * @typedef {import('micromark-util-types').Initializer} Initializer
@@ -13153,7 +13153,7 @@ function initializeFlow(effects) {
13153
13153
  }
13154
13154
  }
13155
13155
 
13156
- ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/initialize/text.js
13156
+ ;// CONCATENATED MODULE: ../node_modules/micromark/lib/initialize/text.js
13157
13157
  /**
13158
13158
  * @typedef {import('micromark-util-types').Resolver} Resolver
13159
13159
  * @typedef {import('micromark-util-types').Initializer} Initializer
@@ -13405,7 +13405,7 @@ function resolveAll(constructs, events, context) {
13405
13405
  return events
13406
13406
  }
13407
13407
 
13408
- ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/create-tokenizer.js
13408
+ ;// CONCATENATED MODULE: ../node_modules/micromark/lib/create-tokenizer.js
13409
13409
  /**
13410
13410
  * @typedef {import('micromark-util-types').Code} Code
13411
13411
  * @typedef {import('micromark-util-types').Chunk} Chunk
@@ -18010,7 +18010,7 @@ function tokenizeCodeText(effects, ok, nok) {
18010
18010
  }
18011
18011
  }
18012
18012
 
18013
- ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/constructs.js
18013
+ ;// CONCATENATED MODULE: ../node_modules/micromark/lib/constructs.js
18014
18014
  /**
18015
18015
  * @typedef {import('micromark-util-types').Extension} Extension
18016
18016
  */
@@ -18096,7 +18096,7 @@ const disable = {
18096
18096
  null: []
18097
18097
  }
18098
18098
 
18099
- ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/parse.js
18099
+ ;// CONCATENATED MODULE: ../node_modules/micromark/lib/parse.js
18100
18100
  /**
18101
18101
  * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
18102
18102
  * @typedef {import('micromark-util-types').FullNormalizedExtension} FullNormalizedExtension
@@ -18150,7 +18150,7 @@ function parse_parse(options = {}) {
18150
18150
  }
18151
18151
  }
18152
18152
 
18153
- ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/preprocess.js
18153
+ ;// CONCATENATED MODULE: ../node_modules/micromark/lib/preprocess.js
18154
18154
  /**
18155
18155
  * @typedef {import('micromark-util-types').Encoding} Encoding
18156
18156
  * @typedef {import('micromark-util-types').Value} Value
@@ -18281,7 +18281,7 @@ function preprocess() {
18281
18281
  }
18282
18282
  }
18283
18283
 
18284
- ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/postprocess.js
18284
+ ;// CONCATENATED MODULE: ../node_modules/micromark/lib/postprocess.js
18285
18285
  /**
18286
18286
  * @typedef {import('micromark-util-types').Event} Event
18287
18287
  */
@@ -18373,71 +18373,7 @@ function decode($0, $1, $2) {
18373
18373
  return decodeNamedCharacterReference($2) || $0
18374
18374
  }
18375
18375
 
18376
- ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/unist-util-stringify-position/index.js
18377
- /**
18378
- * @typedef {import('unist').Point} Point
18379
- * @typedef {import('unist').Node} Node
18380
- * @typedef {import('unist').Position} Position
18381
- * @typedef {object & {type: string, position?: Position|undefined}} NodeLike
18382
- */
18383
-
18384
- /**
18385
- * Stringify one point, a position (start and end points), or a node’s
18386
- * positional information.
18387
- *
18388
- * @param {Node|NodeLike|Position|Point|null} [value]
18389
- * @returns {string}
18390
- */
18391
- function unist_util_stringify_position_stringifyPosition(value) {
18392
- // Nothing.
18393
- if (!value || typeof value !== 'object') {
18394
- return ''
18395
- }
18396
-
18397
- // Node.
18398
- if ('position' in value || 'type' in value) {
18399
- return unist_util_stringify_position_position(value.position)
18400
- }
18401
-
18402
- // Position.
18403
- if ('start' in value || 'end' in value) {
18404
- return unist_util_stringify_position_position(value)
18405
- }
18406
-
18407
- // Point.
18408
- if ('line' in value || 'column' in value) {
18409
- return unist_util_stringify_position_point(value)
18410
- }
18411
-
18412
- // ?
18413
- return ''
18414
- }
18415
-
18416
- /**
18417
- * @param {Point|undefined} point
18418
- * @returns {string}
18419
- */
18420
- function unist_util_stringify_position_point(point) {
18421
- return unist_util_stringify_position_index(point && point.line) + ':' + unist_util_stringify_position_index(point && point.column)
18422
- }
18423
-
18424
- /**
18425
- * @param {Position|undefined} pos
18426
- * @returns {string}
18427
- */
18428
- function unist_util_stringify_position_position(pos) {
18429
- return unist_util_stringify_position_point(pos && pos.start) + '-' + unist_util_stringify_position_point(pos && pos.end)
18430
- }
18431
-
18432
- /**
18433
- * @param {number|undefined} value
18434
- * @returns {number}
18435
- */
18436
- function unist_util_stringify_position_index(value) {
18437
- return value && typeof value === 'number' ? value : 1
18438
- }
18439
-
18440
- ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/mdast-util-from-markdown/lib/index.js
18376
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-from-markdown/lib/index.js
18441
18377
  /**
18442
18378
  * @typedef {import('micromark-util-types').Encoding} Encoding
18443
18379
  * @typedef {import('micromark-util-types').Event} Event
@@ -19042,7 +18978,7 @@ function compiler(options = {}) {
19042
18978
  'Cannot close `' +
19043
18979
  token.type +
19044
18980
  '` (' +
19045
- unist_util_stringify_position_stringifyPosition({
18981
+ stringifyPosition({
19046
18982
  start: token.start,
19047
18983
  end: token.end
19048
18984
  }) +
@@ -19655,14 +19591,14 @@ function defaultOnError(left, right) {
19655
19591
  'Cannot close `' +
19656
19592
  left.type +
19657
19593
  '` (' +
19658
- unist_util_stringify_position_stringifyPosition({
19594
+ stringifyPosition({
19659
19595
  start: left.start,
19660
19596
  end: left.end
19661
19597
  }) +
19662
19598
  '): a different token (`' +
19663
19599
  right.type +
19664
19600
  '`, ' +
19665
- unist_util_stringify_position_stringifyPosition({
19601
+ stringifyPosition({
19666
19602
  start: right.start,
19667
19603
  end: right.end
19668
19604
  }) +
@@ -19673,7 +19609,7 @@ function defaultOnError(left, right) {
19673
19609
  'Cannot close document, a token (`' +
19674
19610
  right.type +
19675
19611
  '`, ' +
19676
- unist_util_stringify_position_stringifyPosition({
19612
+ stringifyPosition({
19677
19613
  start: right.start,
19678
19614
  end: right.end
19679
19615
  }) +
@@ -19682,7 +19618,7 @@ function defaultOnError(left, right) {
19682
19618
  }
19683
19619
  }
19684
19620
 
19685
- ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/remark-parse/lib/index.js
19621
+ ;// CONCATENATED MODULE: ../node_modules/remark-parse/lib/index.js
19686
19622
  /**
19687
19623
  * @typedef {import('mdast').Root} Root
19688
19624
  * @typedef {import('mdast-util-from-markdown').Options} Options
@@ -19712,7 +19648,7 @@ function remarkParse(options) {
19712
19648
  Object.assign(this, {Parser: parser})
19713
19649
  }
19714
19650
 
19715
- ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/remark-parse/index.js
19651
+ ;// CONCATENATED MODULE: ../node_modules/remark-parse/index.js
19716
19652
 
19717
19653
 
19718
19654
  /* harmony default export */ const remark_parse = (remarkParse);
@@ -26691,7 +26627,7 @@ function mdast_util_gfm_autolink_literal_previous(match, email) {
26691
26627
  )
26692
26628
  }
26693
26629
 
26694
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/association.js
26630
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/association.js
26695
26631
  /**
26696
26632
  * @typedef {import('mdast').Association} Association
26697
26633
  */
@@ -26721,7 +26657,7 @@ function association(node) {
26721
26657
  return decodeString(node.identifier)
26722
26658
  }
26723
26659
 
26724
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/track.js
26660
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/track.js
26725
26661
  /**
26726
26662
  * @typedef {import('unist').Point} Point
26727
26663
  * @typedef {import('../types.js').TrackFields} TrackFields
@@ -26780,7 +26716,7 @@ function track(options_) {
26780
26716
  }
26781
26717
  }
26782
26718
 
26783
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/container-flow.js
26719
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/container-flow.js
26784
26720
  /**
26785
26721
  * @typedef {import('../types.js').Node} Node
26786
26722
  * @typedef {import('../types.js').Parent} Parent
@@ -26863,7 +26799,7 @@ function containerFlow(parent, context, safeOptions) {
26863
26799
  }
26864
26800
  }
26865
26801
 
26866
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js
26802
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/indent-lines.js
26867
26803
  /**
26868
26804
  * @callback Map
26869
26805
  * @param {string} value
@@ -26906,7 +26842,7 @@ function indentLines(value, map) {
26906
26842
  }
26907
26843
  }
26908
26844
 
26909
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js
26845
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js
26910
26846
  /**
26911
26847
  * @typedef {import('../types.js').Unsafe} Unsafe
26912
26848
  */
@@ -26933,7 +26869,7 @@ function patternCompile(pattern) {
26933
26869
  return pattern._compiled
26934
26870
  }
26935
26871
 
26936
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
26872
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
26937
26873
  /**
26938
26874
  * @typedef {import('../types.js').Unsafe} Unsafe
26939
26875
  */
@@ -26976,7 +26912,7 @@ function listInScope(stack, list, none) {
26976
26912
  return false
26977
26913
  }
26978
26914
 
26979
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/safe.js
26915
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/safe.js
26980
26916
  /**
26981
26917
  * @typedef {import('../types.js').Context} Context
26982
26918
  * @typedef {import('../types.js').SafeOptions} SafeOptions
@@ -27309,66 +27245,7 @@ function gfmFootnoteToMarkdown() {
27309
27245
  }
27310
27246
  }
27311
27247
 
27312
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-strikethrough/node_modules/mdast-util-to-markdown/lib/util/track.js
27313
- /**
27314
- * @typedef {import('unist').Point} Point
27315
- * @typedef {import('../types.js').TrackFields} TrackFields
27316
- */
27317
-
27318
- /**
27319
- * Functions to track output positions.
27320
- * This info isn’t used yet but suchs functionality allows line wrapping,
27321
- * and theoretically source maps (though, is there practical use in that?).
27322
- *
27323
- * @param {TrackFields} options_
27324
- */
27325
- function track_track(options_) {
27326
- // Defaults are used to prevent crashes when older utilities somehow activate
27327
- // this code.
27328
- /* c8 ignore next 5 */
27329
- const options = options_ || {}
27330
- const now = options.now || {}
27331
- let lineShift = options.lineShift || 0
27332
- let line = now.line || 1
27333
- let column = now.column || 1
27334
-
27335
- return {move, current, shift}
27336
-
27337
- /**
27338
- * Get the current tracked info.
27339
- *
27340
- * @returns {{now: Point, lineShift: number}}
27341
- */
27342
- function current() {
27343
- return {now: {line, column}, lineShift}
27344
- }
27345
-
27346
- /**
27347
- * Define an increased line shift (the typical indent for lines).
27348
- *
27349
- * @param {number} value
27350
- */
27351
- function shift(value) {
27352
- lineShift += value
27353
- }
27354
-
27355
- /**
27356
- * Move past a string.
27357
- *
27358
- * @param {string} value
27359
- * @returns {string}
27360
- */
27361
- function move(value = '') {
27362
- const chunks = value.split(/\r?\n|\r/g)
27363
- const tail = chunks[chunks.length - 1]
27364
- line += chunks.length - 1
27365
- column =
27366
- chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift
27367
- return value
27368
- }
27369
- }
27370
-
27371
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-strikethrough/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
27248
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
27372
27249
  /**
27373
27250
  * @typedef {import('../types.js').Node} Node
27374
27251
  * @typedef {import('../types.js').Parent} Parent
@@ -27393,7 +27270,7 @@ function containerPhrasing(parent, context, safeOptions) {
27393
27270
  let before = safeOptions.before
27394
27271
 
27395
27272
  indexStack.push(-1)
27396
- let tracker = track_track(safeOptions)
27273
+ let tracker = track(safeOptions)
27397
27274
 
27398
27275
  while (++index < children.length) {
27399
27276
  const child = children[index]
@@ -27435,7 +27312,7 @@ function containerPhrasing(parent, context, safeOptions) {
27435
27312
  before = ' '
27436
27313
 
27437
27314
  // To do: does this work to reset tracker?
27438
- tracker = track_track(safeOptions)
27315
+ tracker = track(safeOptions)
27439
27316
  tracker.move(results.join(''))
27440
27317
  }
27441
27318
 
@@ -27476,9 +27353,30 @@ const gfmStrikethroughFromMarkdown = {
27476
27353
  exit: {strikethrough: exitStrikethrough}
27477
27354
  }
27478
27355
 
27356
+ /**
27357
+ * List of constructs that occur in phrasing (paragraphs, headings), but cannot
27358
+ * contain strikethroughs. So they sort of cancel each other out.
27359
+ *
27360
+ * Note: keep in sync with: <https://github.com/syntax-tree/mdast-util-to-markdown/blob/c47743b/lib/unsafe.js#L11>
27361
+ */
27362
+ const constructsWithoutStrikethrough = [
27363
+ 'autolink',
27364
+ 'destinationLiteral',
27365
+ 'destinationRaw',
27366
+ 'reference',
27367
+ 'titleQuote',
27368
+ 'titleApostrophe'
27369
+ ]
27370
+
27479
27371
  /** @type {ToMarkdownExtension} */
27480
27372
  const gfmStrikethroughToMarkdown = {
27481
- unsafe: [{character: '~', inConstruct: 'phrasing'}],
27373
+ unsafe: [
27374
+ {
27375
+ character: '~',
27376
+ inConstruct: 'phrasing',
27377
+ notInConstruct: constructsWithoutStrikethrough
27378
+ }
27379
+ ],
27482
27380
  handlers: {delete: handleDelete}
27483
27381
  }
27484
27382
 
@@ -27499,7 +27397,7 @@ function exitStrikethrough(token) {
27499
27397
  * @param {Delete} node
27500
27398
  */
27501
27399
  function handleDelete(node, _, context, safeOptions) {
27502
- const tracker = track_track(safeOptions)
27400
+ const tracker = track(safeOptions)
27503
27401
  const exit = context.enter('emphasis')
27504
27402
  let value = tracker.move('~~')
27505
27403
  value += containerPhrasing(node, context, {
@@ -27517,182 +27415,7 @@ function peekDelete() {
27517
27415
  return '~'
27518
27416
  }
27519
27417
 
27520
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-table/node_modules/mdast-util-to-markdown/lib/util/track.js
27521
- /**
27522
- * @typedef {import('unist').Point} Point
27523
- * @typedef {import('../types.js').TrackFields} TrackFields
27524
- */
27525
-
27526
- /**
27527
- * Functions to track output positions.
27528
- * This info isn’t used yet but suchs functionality allows line wrapping,
27529
- * and theoretically source maps (though, is there practical use in that?).
27530
- *
27531
- * @param {TrackFields} options_
27532
- */
27533
- function util_track_track(options_) {
27534
- // Defaults are used to prevent crashes when older utilities somehow activate
27535
- // this code.
27536
- /* c8 ignore next 5 */
27537
- const options = options_ || {}
27538
- const now = options.now || {}
27539
- let lineShift = options.lineShift || 0
27540
- let line = now.line || 1
27541
- let column = now.column || 1
27542
-
27543
- return {move, current, shift}
27544
-
27545
- /**
27546
- * Get the current tracked info.
27547
- *
27548
- * @returns {{now: Point, lineShift: number}}
27549
- */
27550
- function current() {
27551
- return {now: {line, column}, lineShift}
27552
- }
27553
-
27554
- /**
27555
- * Define an increased line shift (the typical indent for lines).
27556
- *
27557
- * @param {number} value
27558
- */
27559
- function shift(value) {
27560
- lineShift += value
27561
- }
27562
-
27563
- /**
27564
- * Move past a string.
27565
- *
27566
- * @param {string} value
27567
- * @returns {string}
27568
- */
27569
- function move(value = '') {
27570
- const chunks = value.split(/\r?\n|\r/g)
27571
- const tail = chunks[chunks.length - 1]
27572
- line += chunks.length - 1
27573
- column =
27574
- chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift
27575
- return value
27576
- }
27577
- }
27578
-
27579
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-table/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
27580
- /**
27581
- * @typedef {import('../types.js').Node} Node
27582
- * @typedef {import('../types.js').Parent} Parent
27583
- * @typedef {import('../types.js').SafeOptions} SafeOptions
27584
- * @typedef {import('../types.js').Context} Context
27585
- */
27586
-
27587
-
27588
-
27589
- /**
27590
- * @param {Parent} parent
27591
- * @param {Context} context
27592
- * @param {SafeOptions} safeOptions
27593
- * @returns {string}
27594
- */
27595
- function container_phrasing_containerPhrasing(parent, context, safeOptions) {
27596
- const indexStack = context.indexStack
27597
- const children = parent.children || []
27598
- /** @type {Array<string>} */
27599
- const results = []
27600
- let index = -1
27601
- let before = safeOptions.before
27602
-
27603
- indexStack.push(-1)
27604
- let tracker = util_track_track(safeOptions)
27605
-
27606
- while (++index < children.length) {
27607
- const child = children[index]
27608
- /** @type {string} */
27609
- let after
27610
-
27611
- indexStack[indexStack.length - 1] = index
27612
-
27613
- if (index + 1 < children.length) {
27614
- // @ts-expect-error: hush, it’s actually a `zwitch`.
27615
- let handle = context.handle.handlers[children[index + 1].type]
27616
- if (handle && handle.peek) handle = handle.peek
27617
- after = handle
27618
- ? handle(children[index + 1], parent, context, {
27619
- before: '',
27620
- after: '',
27621
- ...tracker.current()
27622
- }).charAt(0)
27623
- : ''
27624
- } else {
27625
- after = safeOptions.after
27626
- }
27627
-
27628
- // In some cases, html (text) can be found in phrasing right after an eol.
27629
- // When we’d serialize that, in most cases that would be seen as html
27630
- // (flow).
27631
- // As we can’t escape or so to prevent it from happening, we take a somewhat
27632
- // reasonable approach: replace that eol with a space.
27633
- // See: <https://github.com/syntax-tree/mdast-util-to-markdown/issues/15>
27634
- if (
27635
- results.length > 0 &&
27636
- (before === '\r' || before === '\n') &&
27637
- child.type === 'html'
27638
- ) {
27639
- results[results.length - 1] = results[results.length - 1].replace(
27640
- /(\r?\n|\r)$/,
27641
- ' '
27642
- )
27643
- before = ' '
27644
-
27645
- // To do: does this work to reset tracker?
27646
- tracker = util_track_track(safeOptions)
27647
- tracker.move(results.join(''))
27648
- }
27649
-
27650
- results.push(
27651
- tracker.move(
27652
- context.handle(child, parent, context, {
27653
- ...tracker.current(),
27654
- before,
27655
- after
27656
- })
27657
- )
27658
- )
27659
-
27660
- before = results[results.length - 1].slice(-1)
27661
- }
27662
-
27663
- indexStack.pop()
27664
-
27665
- return results.join('')
27666
- }
27667
-
27668
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-table/node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js
27669
- /**
27670
- * @typedef {import('../types.js').Unsafe} Unsafe
27671
- */
27672
-
27673
- /**
27674
- * @param {Unsafe} pattern
27675
- * @returns {RegExp}
27676
- */
27677
- function pattern_compile_patternCompile(pattern) {
27678
- if (!pattern._compiled) {
27679
- const before =
27680
- (pattern.atBreak ? '[\\r\\n][\\t ]*' : '') +
27681
- (pattern.before ? '(?:' + pattern.before + ')' : '')
27682
-
27683
- pattern._compiled = new RegExp(
27684
- (before ? '(' + before + ')' : '') +
27685
- (/[|\\{}()[\]^$+*?.-]/.test(pattern.character) ? '\\' : '') +
27686
- pattern.character +
27687
- (pattern.after ? '(?:' + pattern.after + ')' : ''),
27688
- 'g'
27689
- )
27690
- }
27691
-
27692
- return pattern._compiled
27693
- }
27694
-
27695
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-table/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
27418
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
27696
27419
  /**
27697
27420
  * @typedef {import('mdast').InlineCode} InlineCode
27698
27421
  * @typedef {import('../types.js').Handle} Handle
@@ -27736,7 +27459,7 @@ function inline_code_inlineCode(node, _, context) {
27736
27459
  // them out.
27737
27460
  while (++index < context.unsafe.length) {
27738
27461
  const pattern = context.unsafe[index]
27739
- const expression = pattern_compile_patternCompile(pattern)
27462
+ const expression = patternCompile(pattern)
27740
27463
  /** @type {RegExpExecArray|null} */
27741
27464
  let match
27742
27465
 
@@ -28328,7 +28051,7 @@ function gfmTableToMarkdown(options) {
28328
28051
  function handleTableCell(node, _, context, safeOptions) {
28329
28052
  const exit = context.enter('tableCell')
28330
28053
  const subexit = context.enter('phrasing')
28331
- const value = container_phrasing_containerPhrasing(node, context, {
28054
+ const value = containerPhrasing(node, context, {
28332
28055
  ...safeOptions,
28333
28056
  before: around,
28334
28057
  after: around
@@ -28420,7 +28143,7 @@ function gfmTableToMarkdown(options) {
28420
28143
  }
28421
28144
  }
28422
28145
 
28423
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
28146
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
28424
28147
  /**
28425
28148
  * @typedef {import('../types.js').Context} Context
28426
28149
  * @typedef {import('../types.js').Options} Options
@@ -28444,7 +28167,7 @@ function checkBullet(context) {
28444
28167
  return marker
28445
28168
  }
28446
28169
 
28447
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
28170
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
28448
28171
  /**
28449
28172
  * @typedef {import('../types.js').Context} Context
28450
28173
  * @typedef {import('../types.js').Options} Options
@@ -28474,192 +28197,7 @@ function checkListItemIndent(context) {
28474
28197
  return style
28475
28198
  }
28476
28199
 
28477
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown/lib/util/track.js
28478
- /**
28479
- * @typedef {import('unist').Point} Point
28480
- * @typedef {import('../types.js').TrackFields} TrackFields
28481
- */
28482
-
28483
- /**
28484
- * Functions to track output positions.
28485
- * This info isn’t used yet but suchs functionality allows line wrapping,
28486
- * and theoretically source maps (though, is there practical use in that?).
28487
- *
28488
- * @param {TrackFields} options_
28489
- */
28490
- function lib_util_track_track(options_) {
28491
- // Defaults are used to prevent crashes when older utilities somehow activate
28492
- // this code.
28493
- /* c8 ignore next 5 */
28494
- const options = options_ || {}
28495
- const now = options.now || {}
28496
- let lineShift = options.lineShift || 0
28497
- let line = now.line || 1
28498
- let column = now.column || 1
28499
-
28500
- return {move, current, shift}
28501
-
28502
- /**
28503
- * Get the current tracked info.
28504
- *
28505
- * @returns {{now: Point, lineShift: number}}
28506
- */
28507
- function current() {
28508
- return {now: {line, column}, lineShift}
28509
- }
28510
-
28511
- /**
28512
- * Define an increased line shift (the typical indent for lines).
28513
- *
28514
- * @param {number} value
28515
- */
28516
- function shift(value) {
28517
- lineShift += value
28518
- }
28519
-
28520
- /**
28521
- * Move past a string.
28522
- *
28523
- * @param {string} value
28524
- * @returns {string}
28525
- */
28526
- function move(value = '') {
28527
- const chunks = value.split(/\r?\n|\r/g)
28528
- const tail = chunks[chunks.length - 1]
28529
- line += chunks.length - 1
28530
- column =
28531
- chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift
28532
- return value
28533
- }
28534
- }
28535
-
28536
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown/lib/util/container-flow.js
28537
- /**
28538
- * @typedef {import('../types.js').Node} Node
28539
- * @typedef {import('../types.js').Parent} Parent
28540
- * @typedef {import('../types.js').Join} Join
28541
- * @typedef {import('../types.js').Context} Context
28542
- * @typedef {import('../types.js').TrackFields} TrackFields
28543
- */
28544
-
28545
-
28546
-
28547
- /**
28548
- * @param {Parent} parent
28549
- * @param {Context} context
28550
- * @param {TrackFields} safeOptions
28551
- * @returns {string}
28552
- */
28553
- function container_flow_containerFlow(parent, context, safeOptions) {
28554
- const indexStack = context.indexStack
28555
- const children = parent.children || []
28556
- const tracker = lib_util_track_track(safeOptions)
28557
- /** @type {Array<string>} */
28558
- const results = []
28559
- let index = -1
28560
-
28561
- indexStack.push(-1)
28562
-
28563
- while (++index < children.length) {
28564
- const child = children[index]
28565
-
28566
- indexStack[indexStack.length - 1] = index
28567
-
28568
- results.push(
28569
- tracker.move(
28570
- context.handle(child, parent, context, {
28571
- before: '\n',
28572
- after: '\n',
28573
- ...tracker.current()
28574
- })
28575
- )
28576
- )
28577
-
28578
- if (child.type !== 'list') {
28579
- context.bulletLastUsed = undefined
28580
- }
28581
-
28582
- if (index < children.length - 1) {
28583
- results.push(tracker.move(between(child, children[index + 1])))
28584
- }
28585
- }
28586
-
28587
- indexStack.pop()
28588
-
28589
- return results.join('')
28590
-
28591
- /**
28592
- * @param {Node} left
28593
- * @param {Node} right
28594
- * @returns {string}
28595
- */
28596
- function between(left, right) {
28597
- let index = context.join.length
28598
-
28599
- while (index--) {
28600
- const result = context.join[index](left, right, parent, context)
28601
-
28602
- if (result === true || result === 1) {
28603
- break
28604
- }
28605
-
28606
- if (typeof result === 'number') {
28607
- return '\n'.repeat(1 + result)
28608
- }
28609
-
28610
- if (result === false) {
28611
- return '\n\n<!---->\n\n'
28612
- }
28613
- }
28614
-
28615
- return '\n\n'
28616
- }
28617
- }
28618
-
28619
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js
28620
- /**
28621
- * @callback Map
28622
- * @param {string} value
28623
- * @param {number} line
28624
- * @param {boolean} blank
28625
- * @returns {string}
28626
- */
28627
-
28628
- const indent_lines_eol = /\r?\n|\r/g
28629
-
28630
- /**
28631
- * @param {string} value
28632
- * @param {Map} map
28633
- * @returns {string}
28634
- */
28635
- function indent_lines_indentLines(value, map) {
28636
- /** @type {Array<string>} */
28637
- const result = []
28638
- let start = 0
28639
- let line = 0
28640
- /** @type {RegExpExecArray|null} */
28641
- let match
28642
-
28643
- while ((match = indent_lines_eol.exec(value))) {
28644
- one(value.slice(start, match.index))
28645
- result.push(match[0])
28646
- start = match.index + match[0].length
28647
- line++
28648
- }
28649
-
28650
- one(value.slice(start))
28651
-
28652
- return result.join('')
28653
-
28654
- /**
28655
- * @param {string} value
28656
- */
28657
- function one(value) {
28658
- result.push(map(value, line, !value))
28659
- }
28660
- }
28661
-
28662
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown/lib/handle/list-item.js
28200
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/handle/list-item.js
28663
28201
  /**
28664
28202
  * @typedef {import('mdast').ListItem} ListItem
28665
28203
  * @typedef {import('mdast').List} List
@@ -28704,12 +28242,12 @@ function list_item_listItem(node, parent, context, safeOptions) {
28704
28242
  size = Math.ceil(size / 4) * 4
28705
28243
  }
28706
28244
 
28707
- const tracker = lib_util_track_track(safeOptions)
28245
+ const tracker = track(safeOptions)
28708
28246
  tracker.move(bullet + ' '.repeat(size - bullet.length))
28709
28247
  tracker.shift(size)
28710
28248
  const exit = context.enter('listItem')
28711
- const value = indent_lines_indentLines(
28712
- container_flow_containerFlow(node, context, tracker.current()),
28249
+ const value = indentLines(
28250
+ containerFlow(node, context, tracker.current()),
28713
28251
  map
28714
28252
  )
28715
28253
  exit()
@@ -28818,7 +28356,7 @@ function listItemWithTaskListItem(node, parent, context, safeOptions) {
28818
28356
  const checkable =
28819
28357
  typeof node.checked === 'boolean' && head && head.type === 'paragraph'
28820
28358
  const checkbox = '[' + (node.checked ? 'x' : ' ') + '] '
28821
- const tracker = lib_util_track_track(safeOptions)
28359
+ const tracker = track(safeOptions)
28822
28360
 
28823
28361
  if (checkable) {
28824
28362
  tracker.move(checkbox)
@@ -36281,7 +35819,7 @@ function vbnet(Prism) {
36281
35819
  })
36282
35820
  }
36283
35821
 
36284
- ;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/character-entities-legacy/index.js
35822
+ ;// CONCATENATED MODULE: ../node_modules/character-entities-legacy/index.js
36285
35823
  /**
36286
35824
  * List of legacy HTML named character references that don’t need a trailing semicolon.
36287
35825
  *
@@ -36396,7 +35934,7 @@ const characterEntitiesLegacy = [
36396
35934
  'yuml'
36397
35935
  ]
36398
35936
 
36399
- ;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/character-reference-invalid/index.js
35937
+ ;// CONCATENATED MODULE: ../node_modules/character-reference-invalid/index.js
36400
35938
  /**
36401
35939
  * Map of invalid numeric character references to their replacements, according to HTML.
36402
35940
  *
@@ -36433,7 +35971,7 @@ const characterReferenceInvalid = {
36433
35971
  159: 'Ÿ'
36434
35972
  }
36435
35973
 
36436
- ;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/is-decimal/index.js
35974
+ ;// CONCATENATED MODULE: ../node_modules/is-decimal/index.js
36437
35975
  /**
36438
35976
  * Check if the given character code, or the character code at the first
36439
35977
  * character, is decimal.
@@ -36448,7 +35986,7 @@ function isDecimal(character) {
36448
35986
  return code >= 48 && code <= 57 /* 0-9 */
36449
35987
  }
36450
35988
 
36451
- ;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/is-hexadecimal/index.js
35989
+ ;// CONCATENATED MODULE: ../node_modules/is-hexadecimal/index.js
36452
35990
  /**
36453
35991
  * Check if the given character code, or the character code at the first
36454
35992
  * character, is hexadecimal.
@@ -36467,7 +36005,7 @@ function isHexadecimal(character) {
36467
36005
  )
36468
36006
  }
36469
36007
 
36470
- ;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/is-alphabetical/index.js
36008
+ ;// CONCATENATED MODULE: ../node_modules/is-alphabetical/index.js
36471
36009
  /**
36472
36010
  * Check if the given character code, or the character code at the first
36473
36011
  * character, is alphabetical.
@@ -36485,7 +36023,7 @@ function isAlphabetical(character) {
36485
36023
  )
36486
36024
  }
36487
36025
 
36488
- ;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/is-alphanumerical/index.js
36026
+ ;// CONCATENATED MODULE: ../node_modules/is-alphanumerical/index.js
36489
36027
 
36490
36028
 
36491
36029
 
@@ -36500,7 +36038,7 @@ function isAlphanumerical(character) {
36500
36038
  return isAlphabetical(character) || isDecimal(character)
36501
36039
  }
36502
36040
 
36503
- ;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/parse-entities/lib/index.js
36041
+ ;// CONCATENATED MODULE: ../node_modules/parse-entities/lib/index.js
36504
36042
  /**
36505
36043
  * @typedef {import('unist').Point} Point
36506
36044
  * @typedef {import('unist').Position} Position
@@ -61053,6 +60591,17 @@ var _excluded = ["prefixCls", "className", "source", "style", "disableCopy", "sk
61053
60591
  function reducer(state,action){return _objectSpread2(_objectSpread2({},state),action);}var EditorContext=/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext({markdown:''});
61054
60592
  ;// CONCATENATED MODULE: ./src/components/TextArea/shortcuts.ts
61055
60593
  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;}}
60594
+ ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js
60595
+ function _taggedTemplateLiteral(strings, raw) {
60596
+ if (!raw) {
60597
+ raw = strings.slice(0);
60598
+ }
60599
+ return Object.freeze(Object.defineProperties(strings, {
60600
+ raw: {
60601
+ value: Object.freeze(raw)
60602
+ }
60603
+ }));
60604
+ }
61056
60605
  ;// CONCATENATED MODULE: ../node_modules/rehype-parse/lib/errors.js
61057
60606
  const errors = {
61058
60607
  abandonedHeadElementChild: {
@@ -62049,121 +61598,6 @@ function toDecimal(code, next, omit) {
62049
61598
  : value + ';'
62050
61599
  }
62051
61600
 
62052
- ;// CONCATENATED MODULE: ../node_modules/stringify-entities/node_modules/character-entities-legacy/index.js
62053
- /**
62054
- * List of legacy HTML named character references that don’t need a trailing semicolon.
62055
- *
62056
- * @type {Array<string>}
62057
- */
62058
- const character_entities_legacy_characterEntitiesLegacy = [
62059
- 'AElig',
62060
- 'AMP',
62061
- 'Aacute',
62062
- 'Acirc',
62063
- 'Agrave',
62064
- 'Aring',
62065
- 'Atilde',
62066
- 'Auml',
62067
- 'COPY',
62068
- 'Ccedil',
62069
- 'ETH',
62070
- 'Eacute',
62071
- 'Ecirc',
62072
- 'Egrave',
62073
- 'Euml',
62074
- 'GT',
62075
- 'Iacute',
62076
- 'Icirc',
62077
- 'Igrave',
62078
- 'Iuml',
62079
- 'LT',
62080
- 'Ntilde',
62081
- 'Oacute',
62082
- 'Ocirc',
62083
- 'Ograve',
62084
- 'Oslash',
62085
- 'Otilde',
62086
- 'Ouml',
62087
- 'QUOT',
62088
- 'REG',
62089
- 'THORN',
62090
- 'Uacute',
62091
- 'Ucirc',
62092
- 'Ugrave',
62093
- 'Uuml',
62094
- 'Yacute',
62095
- 'aacute',
62096
- 'acirc',
62097
- 'acute',
62098
- 'aelig',
62099
- 'agrave',
62100
- 'amp',
62101
- 'aring',
62102
- 'atilde',
62103
- 'auml',
62104
- 'brvbar',
62105
- 'ccedil',
62106
- 'cedil',
62107
- 'cent',
62108
- 'copy',
62109
- 'curren',
62110
- 'deg',
62111
- 'divide',
62112
- 'eacute',
62113
- 'ecirc',
62114
- 'egrave',
62115
- 'eth',
62116
- 'euml',
62117
- 'frac12',
62118
- 'frac14',
62119
- 'frac34',
62120
- 'gt',
62121
- 'iacute',
62122
- 'icirc',
62123
- 'iexcl',
62124
- 'igrave',
62125
- 'iquest',
62126
- 'iuml',
62127
- 'laquo',
62128
- 'lt',
62129
- 'macr',
62130
- 'micro',
62131
- 'middot',
62132
- 'nbsp',
62133
- 'not',
62134
- 'ntilde',
62135
- 'oacute',
62136
- 'ocirc',
62137
- 'ograve',
62138
- 'ordf',
62139
- 'ordm',
62140
- 'oslash',
62141
- 'otilde',
62142
- 'ouml',
62143
- 'para',
62144
- 'plusmn',
62145
- 'pound',
62146
- 'quot',
62147
- 'raquo',
62148
- 'reg',
62149
- 'sect',
62150
- 'shy',
62151
- 'sup1',
62152
- 'sup2',
62153
- 'sup3',
62154
- 'szlig',
62155
- 'thorn',
62156
- 'times',
62157
- 'uacute',
62158
- 'ucirc',
62159
- 'ugrave',
62160
- 'uml',
62161
- 'uuml',
62162
- 'yacute',
62163
- 'yen',
62164
- 'yuml'
62165
- ]
62166
-
62167
61601
  ;// CONCATENATED MODULE: ../node_modules/character-entities-html4/index.js
62168
61602
  /**
62169
61603
  * Map of named character references from HTML 4.
@@ -62484,7 +61918,7 @@ function toNamed(code, next, omit, attribute) {
62484
61918
 
62485
61919
  if (
62486
61920
  omit &&
62487
- character_entities_legacy_characterEntitiesLegacy.includes(name) &&
61921
+ characterEntitiesLegacy.includes(name) &&
62488
61922
  !dangerous.includes(name) &&
62489
61923
  (!attribute ||
62490
61924
  (next &&
@@ -63100,8 +62534,8 @@ function rehypeStringify(config) {
63100
62534
  const rehype = unified().use(rehypeParse).use(rehypeStringify).freeze()
63101
62535
 
63102
62536
  ;// CONCATENATED MODULE: ./src/components/TextArea/Markdown.tsx
63103
- function html2Escape(sHtml){return sHtml.replace(/```(tsx?|jsx?|html|xml)(.*)\s+([\s\S]*?)(\s.+)?```/g,function(str){return str.replace(/[<&"]/g,function(c){return{'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c];});}).replace(/[<&"]/g,function(c){return{'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c];});}function Markdown(props){var prefixCls=props.prefixCls;var _useContext=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(EditorContext),_useContext$markdown=_useContext.markdown,markdown=_useContext$markdown===void 0?'':_useContext$markdown,highlightEnable=_useContext.highlightEnable,dispatch=_useContext.dispatch;var preRef=/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){if(preRef.current&&dispatch){dispatch({textareaPre:preRef.current});}// eslint-disable-next-line react-hooks/exhaustive-deps
63104
- },[]);return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){if(!markdown){return/*#__PURE__*/(0,jsx_runtime.jsx)("pre",{ref:preRef,className:"".concat(prefixCls,"-text-pre wmde-markdown-color")});}var mdStr="<pre class=\"language-markdown ".concat(prefixCls,"-text-pre wmde-markdown-color\"><code class=\"language-markdown\">").concat(html2Escape(markdown),"\n</code></pre>");if(highlightEnable){try{mdStr=rehype().data('settings',{fragment:true}).use(m,{ignoreMissing:true}).processSync(mdStr).toString();}catch(error){}}return/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement('div',{className:'wmde-markdown-color',dangerouslySetInnerHTML:{__html:mdStr||''}});},[markdown,preRef,prefixCls]);}
62537
+ var _templateObject;function html2Escape(sHtml){return sHtml.replace(/```(\w+)?([\s\S]*?)(\s.+)?```/g,function(str){return str.replace(/[<&"]/g,function(c){return{'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c];});}).replace(/[<&"]/g,function(c){return{'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c];});}function Markdown(props){var prefixCls=props.prefixCls;var _useContext=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(EditorContext),_useContext$markdown=_useContext.markdown,markdown=_useContext$markdown===void 0?'':_useContext$markdown,highlightEnable=_useContext.highlightEnable,dispatch=_useContext.dispatch;var preRef=/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){if(preRef.current&&dispatch){dispatch({textareaPre:preRef.current});}// eslint-disable-next-line react-hooks/exhaustive-deps
62538
+ },[]);if(!markdown){return/*#__PURE__*/(0,jsx_runtime.jsx)("pre",{ref:preRef,className:"".concat(prefixCls,"-text-pre wmde-markdown-color")});}var mdStr="<pre class=\"language-markdown ".concat(prefixCls,"-text-pre wmde-markdown-color\"><code class=\"language-markdown\">").concat(html2Escape(String.raw(_templateObject||(_templateObject=_taggedTemplateLiteral(["",""])),markdown)),"\n</code></pre>");if(highlightEnable){try{mdStr=rehype().data('settings',{fragment:true}).use(m,{ignoreMissing:true}).processSync(mdStr).toString();}catch(error){}}return/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement('div',{className:'wmde-markdown-color',dangerouslySetInnerHTML:{__html:mdStr||''}});}
63105
62539
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
63106
62540
 
63107
62541
  function _arrayWithoutHoles(arr) {
@@ -63209,10 +62643,10 @@ var end=text.length;// iterate to the left
63209
62643
  for(var i=position;i-1>-1;i--){if(isWordDelimiter(text[i-1])){start=i;break;}}// iterate to the right
63210
62644
  for(var _i=position;_i<text.length;_i++){if(isWordDelimiter(text[_i])){end=_i;break;}}return{start:start,end:end};}
63211
62645
  ;// CONCATENATED MODULE: ./src/commands/bold.tsx
63212
- var bold={name:'bold',keyCommand:'bold',shortcuts:'ctrlcmd+b',value:'**',buttonProps:{'aria-label':'Add bold text (ctrl + b)',title:'Add bold text (ctrl + b)'},icon:/*#__PURE__*/(0,jsx_runtime.jsx)("svg",{role:"img",width:"12",height:"12",viewBox:"0 0 384 512",children:/*#__PURE__*/(0,jsx_runtime.jsx)("path",{fill:"currentColor",d:"M304.793 243.891c33.639-18.537 53.657-54.16 53.657-95.693 0-48.236-26.25-87.626-68.626-104.179C265.138 34.01 240.849 32 209.661 32H24c-8.837 0-16 7.163-16 16v33.049c0 8.837 7.163 16 16 16h33.113v318.53H24c-8.837 0-16 7.163-16 16V464c0 8.837 7.163 16 16 16h195.69c24.203 0 44.834-1.289 66.866-7.584C337.52 457.193 376 410.647 376 350.014c0-52.168-26.573-91.684-71.207-106.123zM142.217 100.809h67.444c16.294 0 27.536 2.019 37.525 6.717 15.828 8.479 24.906 26.502 24.906 49.446 0 35.029-20.32 56.79-53.029 56.79h-76.846V100.809zm112.642 305.475c-10.14 4.056-22.677 4.907-31.409 4.907h-81.233V281.943h84.367c39.645 0 63.057 25.38 63.057 63.057.001 28.425-13.66 52.483-34.782 61.284z"})}),execute:function execute(state,api){// Adjust the selection to encompass the whole word if the caret is inside one
62646
+ var bold={name:'bold',keyCommand:'bold',shortcuts:'ctrlcmd+b',value:'**',buttonProps:{'aria-label':'Add bold text (ctrl + b)',title:'Add bold text (ctrl + b)'},icon:/*#__PURE__*/(0,jsx_runtime.jsx)("svg",{role:"img",width:"12",height:"12",viewBox:"0 0 384 512",children:/*#__PURE__*/(0,jsx_runtime.jsx)("path",{fill:"currentColor",d:"M304.793 243.891c33.639-18.537 53.657-54.16 53.657-95.693 0-48.236-26.25-87.626-68.626-104.179C265.138 34.01 240.849 32 209.661 32H24c-8.837 0-16 7.163-16 16v33.049c0 8.837 7.163 16 16 16h33.113v318.53H24c-8.837 0-16 7.163-16 16V464c0 8.837 7.163 16 16 16h195.69c24.203 0 44.834-1.289 66.866-7.584C337.52 457.193 376 410.647 376 350.014c0-52.168-26.573-91.684-71.207-106.123zM142.217 100.809h67.444c16.294 0 27.536 2.019 37.525 6.717 15.828 8.479 24.906 26.502 24.906 49.446 0 35.029-20.32 56.79-53.029 56.79h-76.846V100.809zm112.642 305.475c-10.14 4.056-22.677 4.907-31.409 4.907h-81.233V281.943h84.367c39.645 0 63.057 25.38 63.057 63.057.001 28.425-13.66 52.483-34.782 61.284z"})}),execute:function execute(state,api){var _state1$selectedText;// Adjust the selection to encompass the whole word if the caret is inside one
63213
62647
  var newSelectionRange=selectWord({text:state.text,selection:state.selection});var state1=api.setSelectionRange(newSelectionRange);// Replaces the current selection with the bold mark up
63214
62648
  var state2=api.replaceSelection("**".concat(state1.selectedText,"**"));// Adjust the selection to not contain the **
63215
- api.setSelectionRange({start:state2.selection.end-2-state1.selectedText.length,end:state2.selection.end-2});}};
62649
+ api.setSelectionRange({start:state2.selection.end-2-((_state1$selectedText=state1.selectedText)===null||_state1$selectedText===void 0?void 0:_state1$selectedText.length),end:state2.selection.end-2});}};
63216
62650
  ;// CONCATENATED MODULE: ./src/commands/code.tsx
63217
62651
  var code_code={name:'code',keyCommand:'code',shortcuts:'ctrlcmd+j',value:'``',buttonProps:{'aria-label':'Insert code (ctrl + j)',title:'Insert code (ctrl + j)'},icon:/*#__PURE__*/(0,jsx_runtime.jsx)("svg",{width:"14",height:"14",role:"img",viewBox:"0 0 640 512",children:/*#__PURE__*/(0,jsx_runtime.jsx)("path",{fill:"currentColor",d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"})}),execute:function execute(tate,api){// Adjust the selection to encompass the whole word if the caret is inside one
63218
62652
  var newSelectionRange=selectWord({text:tate.text,selection:tate.selection});var state1=api.setSelectionRange(newSelectionRange);// when there's no breaking line
@@ -63259,7 +62693,7 @@ var newSelectionRange=selectWord({text:state.text,selection:state.selection});va
63259
62693
  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 **
63260
62694
  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"- [ ] ";});}};
63261
62695
  ;// CONCATENATED MODULE: ./src/commands/preview.tsx
63262
- 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'});}}};
62696
+ 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){api.textArea.focus();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){api.textArea.focus();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){api.textArea.focus();if(shortcuts&&dispatch&&executeCommandState){dispatch({preview:'live'});}}};
63263
62697
  ;// CONCATENATED MODULE: ./src/commands/quote.tsx
63264
62698
  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
63265
62699
  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
@@ -63284,7 +62718,7 @@ var title5={name:'title5',keyCommand:'title5',shortcuts:'ctrlcmd+5',value:'title
63284
62718
  ;// CONCATENATED MODULE: ./src/commands/title6.tsx
63285
62719
  var title6={name:'title6',keyCommand:'title6',shortcuts:'ctrlcmd+6',value:'title6',buttonProps:{'aria-label':'Insert title6 (ctrl + 6)',title:'Insert title6 (ctrl + 6)'},icon:/*#__PURE__*/(0,jsx_runtime.jsx)("div",{style:{fontSize:12,textAlign:'left'},children:"Title 6"}),execute:function execute(state,api){if(state.selection.start===0||/\n$/.test(state.text)){api.replaceSelection('###### ');}else{insertAtLineStart('###### ',state.selection.start,api.textArea);}}};
63286
62720
  ;// CONCATENATED MODULE: ./src/commands/index.ts
63287
- var commands_getCommands=function getCommands(){return[bold,italic,strikeThrough_strikethrough,hr,group([title1,title2,title3,title4,title5,title6],{name:'title',groupName:'title',buttonProps:{'aria-label':'Insert title',title:'Insert title'}}),divider,commands_link_link,quote,code_code,codeBlock,commands_comment_comment,commands_image_image,divider,unorderedListCommand,orderedListCommand,checkedListCommand];};var getExtraCommands=function getExtraCommands(){return[codeEdit,codeLive,codePreview,divider,fullscreen];};function getStateFromTextArea(textArea){return{selection:{start:textArea.selectionStart,end:textArea.selectionEnd},text:textArea.value,selectedText:textArea.value.slice(textArea.selectionStart,textArea.selectionEnd)};}var TextAreaTextApi=/*#__PURE__*/function(){function TextAreaTextApi(textArea){_classCallCheck(this,TextAreaTextApi);this.textArea=void 0;this.textArea=textArea;}/**
62721
+ var commands_getCommands=function getCommands(){return[bold,italic,strikeThrough_strikethrough,hr,group([title1,title2,title3,title4,title5,title6],{name:'title',groupName:'title',buttonProps:{'aria-label':'Insert title',title:'Insert title'}}),divider,commands_link_link,quote,code_code,codeBlock,commands_comment_comment,commands_image_image,divider,unorderedListCommand,orderedListCommand,checkedListCommand];};var getExtraCommands=function getExtraCommands(){return[codeEdit,codeLive,codePreview,divider,fullscreen];};function getStateFromTextArea(textArea){var _textArea$value;return{selection:{start:textArea.selectionStart,end:textArea.selectionEnd},text:textArea.value,selectedText:(_textArea$value=textArea.value)===null||_textArea$value===void 0?void 0:_textArea$value.slice(textArea.selectionStart,textArea.selectionEnd)};}var TextAreaTextApi=/*#__PURE__*/function(){function TextAreaTextApi(textArea){_classCallCheck(this,TextAreaTextApi);this.textArea=void 0;this.textArea=textArea;}/**
63288
62722
  * Replaces the current selection with the new text. This will make the new selectedText to be empty, the
63289
62723
  * selection start and selection end will be the same and will both point to the end
63290
62724
  * @param text Text that should replace the current selection