@uiw/react-md-editor 3.20.8 → 3.20.9

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
@@ -17406,7 +17406,7 @@ __webpack_require__.d(__webpack_exports__, {
17406
17406
  "unorderedListCommand": () => (/* reexport */ unorderedListCommand)
17407
17407
  });
17408
17408
 
17409
- // NAMESPACE OBJECT: ../node_modules/micromark/lib/constructs.js
17409
+ // NAMESPACE OBJECT: ../node_modules/react-markdown/node_modules/micromark/lib/constructs.js
17410
17410
  var constructs_namespaceObject = {};
17411
17411
  __webpack_require__.r(constructs_namespaceObject);
17412
17412
  __webpack_require__.d(constructs_namespaceObject, {
@@ -17659,7 +17659,7 @@ function _extends() {
17659
17659
  }
17660
17660
  // EXTERNAL MODULE: ../node_modules/is-buffer/index.js
17661
17661
  var is_buffer = __webpack_require__(5372);
17662
- ;// CONCATENATED MODULE: ../node_modules/unist-util-stringify-position/lib/index.js
17662
+ ;// CONCATENATED MODULE: ../node_modules/vfile-message/node_modules/unist-util-stringify-position/lib/index.js
17663
17663
  /**
17664
17664
  * @typedef {import('unist').Node} Node
17665
17665
  * @typedef {import('unist').Point} Point
@@ -19836,7 +19836,7 @@ function looksLikeAVFileValue(value) {
19836
19836
  return typeof value === 'string' || is_buffer(value)
19837
19837
  }
19838
19838
 
19839
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-string/lib/index.js
19839
+ ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/mdast-util-to-string/lib/index.js
19840
19840
  /**
19841
19841
  * @typedef {import('mdast').Root|import('mdast').Content} Node
19842
19842
  *
@@ -20390,7 +20390,7 @@ function factorySpace(effects, ok, type, max) {
20390
20390
  }
20391
20391
  }
20392
20392
 
20393
- ;// CONCATENATED MODULE: ../node_modules/micromark/lib/initialize/content.js
20393
+ ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/initialize/content.js
20394
20394
  /**
20395
20395
  * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
20396
20396
  * @typedef {import('micromark-util-types').Initializer} Initializer
@@ -20471,7 +20471,7 @@ function initializeContent(effects) {
20471
20471
  }
20472
20472
  }
20473
20473
 
20474
- ;// CONCATENATED MODULE: ../node_modules/micromark/lib/initialize/document.js
20474
+ ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/initialize/document.js
20475
20475
  /**
20476
20476
  * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
20477
20477
  * @typedef {import('micromark-util-types').Initializer} Initializer
@@ -21246,7 +21246,7 @@ function tokenizeContinuation(effects, ok, nok) {
21246
21246
  }
21247
21247
  }
21248
21248
 
21249
- ;// CONCATENATED MODULE: ../node_modules/micromark/lib/initialize/flow.js
21249
+ ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/initialize/flow.js
21250
21250
  /**
21251
21251
  * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
21252
21252
  * @typedef {import('micromark-util-types').Initializer} Initializer
@@ -21313,7 +21313,7 @@ function initializeFlow(effects) {
21313
21313
  }
21314
21314
  }
21315
21315
 
21316
- ;// CONCATENATED MODULE: ../node_modules/micromark/lib/initialize/text.js
21316
+ ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/initialize/text.js
21317
21317
  /**
21318
21318
  * @typedef {import('micromark-util-types').Resolver} Resolver
21319
21319
  * @typedef {import('micromark-util-types').Initializer} Initializer
@@ -21565,7 +21565,7 @@ function resolveAll(constructs, events, context) {
21565
21565
  return events
21566
21566
  }
21567
21567
 
21568
- ;// CONCATENATED MODULE: ../node_modules/micromark/lib/create-tokenizer.js
21568
+ ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/create-tokenizer.js
21569
21569
  /**
21570
21570
  * @typedef {import('micromark-util-types').Code} Code
21571
21571
  * @typedef {import('micromark-util-types').Chunk} Chunk
@@ -26170,7 +26170,7 @@ function tokenizeCodeText(effects, ok, nok) {
26170
26170
  }
26171
26171
  }
26172
26172
 
26173
- ;// CONCATENATED MODULE: ../node_modules/micromark/lib/constructs.js
26173
+ ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/constructs.js
26174
26174
  /**
26175
26175
  * @typedef {import('micromark-util-types').Extension} Extension
26176
26176
  */
@@ -26256,7 +26256,7 @@ const disable = {
26256
26256
  null: []
26257
26257
  }
26258
26258
 
26259
- ;// CONCATENATED MODULE: ../node_modules/micromark/lib/parse.js
26259
+ ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/parse.js
26260
26260
  /**
26261
26261
  * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
26262
26262
  * @typedef {import('micromark-util-types').FullNormalizedExtension} FullNormalizedExtension
@@ -26310,7 +26310,7 @@ function parse_parse(options = {}) {
26310
26310
  }
26311
26311
  }
26312
26312
 
26313
- ;// CONCATENATED MODULE: ../node_modules/micromark/lib/preprocess.js
26313
+ ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/preprocess.js
26314
26314
  /**
26315
26315
  * @typedef {import('micromark-util-types').Encoding} Encoding
26316
26316
  * @typedef {import('micromark-util-types').Value} Value
@@ -26441,7 +26441,7 @@ function preprocess() {
26441
26441
  }
26442
26442
  }
26443
26443
 
26444
- ;// CONCATENATED MODULE: ../node_modules/micromark/lib/postprocess.js
26444
+ ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/postprocess.js
26445
26445
  /**
26446
26446
  * @typedef {import('micromark-util-types').Event} Event
26447
26447
  */
@@ -26533,7 +26533,93 @@ function decode($0, $1, $2) {
26533
26533
  return decodeNamedCharacterReference($2) || $0
26534
26534
  }
26535
26535
 
26536
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-from-markdown/lib/index.js
26536
+ ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/unist-util-stringify-position/lib/index.js
26537
+ /**
26538
+ * @typedef {import('unist').Node} Node
26539
+ * @typedef {import('unist').Point} Point
26540
+ * @typedef {import('unist').Position} Position
26541
+ */
26542
+
26543
+ /**
26544
+ * @typedef NodeLike
26545
+ * @property {string} type
26546
+ * @property {PositionLike | null | undefined} [position]
26547
+ *
26548
+ * @typedef PositionLike
26549
+ * @property {PointLike | null | undefined} [start]
26550
+ * @property {PointLike | null | undefined} [end]
26551
+ *
26552
+ * @typedef PointLike
26553
+ * @property {number | null | undefined} [line]
26554
+ * @property {number | null | undefined} [column]
26555
+ * @property {number | null | undefined} [offset]
26556
+ */
26557
+
26558
+ /**
26559
+ * Serialize the positional info of a point, position (start and end points),
26560
+ * or node.
26561
+ *
26562
+ * @param {Node | NodeLike | Position | PositionLike | Point | PointLike | null | undefined} [value]
26563
+ * Node, position, or point.
26564
+ * @returns {string}
26565
+ * Pretty printed positional info of a node (`string`).
26566
+ *
26567
+ * In the format of a range `ls:cs-le:ce` (when given `node` or `position`)
26568
+ * or a point `l:c` (when given `point`), where `l` stands for line, `c` for
26569
+ * column, `s` for `start`, and `e` for end.
26570
+ * An empty string (`''`) is returned if the given value is neither `node`,
26571
+ * `position`, nor `point`.
26572
+ */
26573
+ function lib_stringifyPosition(value) {
26574
+ // Nothing.
26575
+ if (!value || typeof value !== 'object') {
26576
+ return ''
26577
+ }
26578
+
26579
+ // Node.
26580
+ if ('position' in value || 'type' in value) {
26581
+ return lib_position(value.position)
26582
+ }
26583
+
26584
+ // Position.
26585
+ if ('start' in value || 'end' in value) {
26586
+ return lib_position(value)
26587
+ }
26588
+
26589
+ // Point.
26590
+ if ('line' in value || 'column' in value) {
26591
+ return lib_point(value)
26592
+ }
26593
+
26594
+ // ?
26595
+ return ''
26596
+ }
26597
+
26598
+ /**
26599
+ * @param {Point | PointLike | null | undefined} point
26600
+ * @returns {string}
26601
+ */
26602
+ function lib_point(point) {
26603
+ return lib_index(point && point.line) + ':' + lib_index(point && point.column)
26604
+ }
26605
+
26606
+ /**
26607
+ * @param {Position | PositionLike | null | undefined} pos
26608
+ * @returns {string}
26609
+ */
26610
+ function lib_position(pos) {
26611
+ return lib_point(pos && pos.start) + '-' + lib_point(pos && pos.end)
26612
+ }
26613
+
26614
+ /**
26615
+ * @param {number | null | undefined} value
26616
+ * @returns {number}
26617
+ */
26618
+ function lib_index(value) {
26619
+ return value && typeof value === 'number' ? value : 1
26620
+ }
26621
+
26622
+ ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/mdast-util-from-markdown/lib/index.js
26537
26623
  /**
26538
26624
  * @typedef {import('micromark-util-types').Encoding} Encoding
26539
26625
  * @typedef {import('micromark-util-types').Event} Event
@@ -26907,7 +26993,7 @@ function compiler(options) {
26907
26993
 
26908
26994
  // Figure out `root` position.
26909
26995
  tree.position = {
26910
- start: lib_point(
26996
+ start: mdast_util_from_markdown_lib_point(
26911
26997
  events.length > 0
26912
26998
  ? events[0][1].start
26913
26999
  : {
@@ -26916,7 +27002,7 @@ function compiler(options) {
26916
27002
  offset: 0
26917
27003
  }
26918
27004
  ),
26919
- end: lib_point(
27005
+ end: mdast_util_from_markdown_lib_point(
26920
27006
  events.length > 0
26921
27007
  ? events[events.length - 2][1].end
26922
27008
  : {
@@ -27154,7 +27240,7 @@ function compiler(options) {
27154
27240
  this.tokenStack.push([token, errorHandler])
27155
27241
  // @ts-expect-error: `end` will be patched later.
27156
27242
  node.position = {
27157
- start: lib_point(token.start)
27243
+ start: mdast_util_from_markdown_lib_point(token.start)
27158
27244
  }
27159
27245
  return node
27160
27246
  }
@@ -27199,7 +27285,7 @@ function compiler(options) {
27199
27285
  'Cannot close `' +
27200
27286
  token.type +
27201
27287
  '` (' +
27202
- stringifyPosition({
27288
+ lib_stringifyPosition({
27203
27289
  start: token.start,
27204
27290
  end: token.end
27205
27291
  }) +
@@ -27213,7 +27299,7 @@ function compiler(options) {
27213
27299
  handler.call(this, token, open[0])
27214
27300
  }
27215
27301
  }
27216
- node.position.end = lib_point(token.end)
27302
+ node.position.end = mdast_util_from_markdown_lib_point(token.end)
27217
27303
  return node
27218
27304
  }
27219
27305
 
@@ -27384,7 +27470,7 @@ function compiler(options) {
27384
27470
  tail = text()
27385
27471
  // @ts-expect-error: we’ll add `end` later.
27386
27472
  tail.position = {
27387
- start: lib_point(token.start)
27473
+ start: mdast_util_from_markdown_lib_point(token.start)
27388
27474
  }
27389
27475
  // @ts-expect-error: Assume `parent` accepts `text`.
27390
27476
  node.children.push(tail)
@@ -27400,7 +27486,7 @@ function compiler(options) {
27400
27486
  function onexitdata(token) {
27401
27487
  const tail = this.stack.pop()
27402
27488
  tail.value += this.sliceSerialize(token)
27403
- tail.position.end = lib_point(token.end)
27489
+ tail.position.end = mdast_util_from_markdown_lib_point(token.end)
27404
27490
  }
27405
27491
 
27406
27492
  /**
@@ -27413,7 +27499,7 @@ function compiler(options) {
27413
27499
  // If we’re at a hard break, include the line ending in there.
27414
27500
  if (getData('atHardBreak')) {
27415
27501
  const tail = context.children[context.children.length - 1]
27416
- tail.position.end = lib_point(token.end)
27502
+ tail.position.end = mdast_util_from_markdown_lib_point(token.end)
27417
27503
  setData('atHardBreak')
27418
27504
  return
27419
27505
  }
@@ -27650,7 +27736,7 @@ function compiler(options) {
27650
27736
  }
27651
27737
  const tail = this.stack.pop()
27652
27738
  tail.value += value
27653
- tail.position.end = lib_point(token.end)
27739
+ tail.position.end = mdast_util_from_markdown_lib_point(token.end)
27654
27740
  }
27655
27741
 
27656
27742
  /**
@@ -27836,7 +27922,7 @@ function compiler(options) {
27836
27922
  * @returns {Point}
27837
27923
  * unist point.
27838
27924
  */
27839
- function lib_point(d) {
27925
+ function mdast_util_from_markdown_lib_point(d) {
27840
27926
  return {
27841
27927
  line: d.line,
27842
27928
  column: d.column,
@@ -27898,14 +27984,14 @@ function defaultOnError(left, right) {
27898
27984
  'Cannot close `' +
27899
27985
  left.type +
27900
27986
  '` (' +
27901
- stringifyPosition({
27987
+ lib_stringifyPosition({
27902
27988
  start: left.start,
27903
27989
  end: left.end
27904
27990
  }) +
27905
27991
  '): a different token (`' +
27906
27992
  right.type +
27907
27993
  '`, ' +
27908
- stringifyPosition({
27994
+ lib_stringifyPosition({
27909
27995
  start: right.start,
27910
27996
  end: right.end
27911
27997
  }) +
@@ -27916,7 +28002,7 @@ function defaultOnError(left, right) {
27916
28002
  'Cannot close document, a token (`' +
27917
28003
  right.type +
27918
28004
  '`, ' +
27919
- stringifyPosition({
28005
+ lib_stringifyPosition({
27920
28006
  start: right.start,
27921
28007
  end: right.end
27922
28008
  }) +
@@ -27925,7 +28011,7 @@ function defaultOnError(left, right) {
27925
28011
  }
27926
28012
  }
27927
28013
 
27928
- ;// CONCATENATED MODULE: ../node_modules/remark-parse/lib/index.js
28014
+ ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/remark-parse/lib/index.js
27929
28015
  /**
27930
28016
  * @typedef {import('mdast').Root} Root
27931
28017
  * @typedef {import('mdast-util-from-markdown').Options} Options
@@ -27955,7 +28041,7 @@ function remarkParse(options) {
27955
28041
  Object.assign(this, {Parser: parser})
27956
28042
  }
27957
28043
 
27958
- ;// CONCATENATED MODULE: ../node_modules/remark-parse/index.js
28044
+ ;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/remark-parse/index.js
27959
28045
 
27960
28046
 
27961
28047
  /* harmony default export */ const remark_parse = (remarkParse);
@@ -28992,7 +29078,7 @@ const pointEnd = unist_util_position_lib_point('end')
28992
29078
  * @returns {Position}
28993
29079
  * Position.
28994
29080
  */
28995
- function lib_position(node) {
29081
+ function unist_util_position_lib_position(node) {
28996
29082
  return {start: pointStart(node), end: pointEnd(node)}
28997
29083
  }
28998
29084
 
@@ -30719,7 +30805,7 @@ function createState(tree, options) {
30719
30805
  * Nothing.
30720
30806
  */
30721
30807
  function patch(from, to) {
30722
- if (from.position) to.position = lib_position(from)
30808
+ if (from.position) to.position = unist_util_position_lib_position(from)
30723
30809
  }
30724
30810
 
30725
30811
  /**
@@ -36130,7 +36216,7 @@ function lib_previous(match, email) {
36130
36216
  )
36131
36217
  }
36132
36218
 
36133
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/association.js
36219
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/association.js
36134
36220
  /**
36135
36221
  * @typedef {import('../types.js').AssociationId} AssociationId
36136
36222
  */
@@ -36165,7 +36251,7 @@ function association(node) {
36165
36251
  return decodeString(node.identifier)
36166
36252
  }
36167
36253
 
36168
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/container-flow.js
36254
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/container-flow.js
36169
36255
  /**
36170
36256
  * @typedef {import('../types.js').FlowContent} FlowContent
36171
36257
  * @typedef {import('../types.js').Node} Node
@@ -36254,7 +36340,7 @@ function between(left, right, parent, state) {
36254
36340
  return '\n\n'
36255
36341
  }
36256
36342
 
36257
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/indent-lines.js
36343
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js
36258
36344
  /**
36259
36345
  * @typedef {import('../types.js').IndentLines} IndentLines
36260
36346
  */
@@ -36291,7 +36377,7 @@ function indentLines(value, map) {
36291
36377
  }
36292
36378
  }
36293
36379
 
36294
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js
36380
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js
36295
36381
  /**
36296
36382
  * @typedef {import('../types.js').Unsafe} Unsafe
36297
36383
  */
@@ -36318,7 +36404,7 @@ function patternCompile(pattern) {
36318
36404
  return pattern._compiled
36319
36405
  }
36320
36406
 
36321
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
36407
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
36322
36408
  /**
36323
36409
  * @typedef {import('../types.js').Unsafe} Unsafe
36324
36410
  * @typedef {import('../types.js').ConstructName} ConstructName
@@ -36362,7 +36448,7 @@ function listInScope(stack, list, none) {
36362
36448
  return false
36363
36449
  }
36364
36450
 
36365
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/safe.js
36451
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/safe.js
36366
36452
  /**
36367
36453
  * @typedef {import('../types.js').State} State
36368
36454
  * @typedef {import('../types.js').SafeConfig} SafeConfig
@@ -36541,7 +36627,7 @@ function escapeBackslashes(value, after) {
36541
36627
  return results.join('')
36542
36628
  }
36543
36629
 
36544
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/track.js
36630
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/track.js
36545
36631
  /**
36546
36632
  * @typedef {import('../types.js').CreateTracker} CreateTracker
36547
36633
  * @typedef {import('../types.js').TrackCurrent} TrackCurrent
@@ -36810,7 +36896,7 @@ function map(line, index, blank) {
36810
36896
  return (blank ? '' : ' ') + line
36811
36897
  }
36812
36898
 
36813
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
36899
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-strikethrough/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
36814
36900
  /**
36815
36901
  * @typedef {import('../types.js').Handle} Handle
36816
36902
  * @typedef {import('../types.js').Info} Info
@@ -36909,6 +36995,66 @@ function containerPhrasing(parent, state, info) {
36909
36995
  return results.join('')
36910
36996
  }
36911
36997
 
36998
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-strikethrough/node_modules/mdast-util-to-markdown/lib/util/track.js
36999
+ /**
37000
+ * @typedef {import('../types.js').CreateTracker} CreateTracker
37001
+ * @typedef {import('../types.js').TrackCurrent} TrackCurrent
37002
+ * @typedef {import('../types.js').TrackMove} TrackMove
37003
+ * @typedef {import('../types.js').TrackShift} TrackShift
37004
+ */
37005
+
37006
+ /**
37007
+ * Track positional info in the output.
37008
+ *
37009
+ * @type {CreateTracker}
37010
+ */
37011
+ function track_track(config) {
37012
+ // Defaults are used to prevent crashes when older utilities somehow activate
37013
+ // this code.
37014
+ /* c8 ignore next 5 */
37015
+ const options = config || {}
37016
+ const now = options.now || {}
37017
+ let lineShift = options.lineShift || 0
37018
+ let line = now.line || 1
37019
+ let column = now.column || 1
37020
+
37021
+ return {move, current, shift}
37022
+
37023
+ /**
37024
+ * Get the current tracked info.
37025
+ *
37026
+ * @type {TrackCurrent}
37027
+ */
37028
+ function current() {
37029
+ return {now: {line, column}, lineShift}
37030
+ }
37031
+
37032
+ /**
37033
+ * Define an increased line shift (the typical indent for lines).
37034
+ *
37035
+ * @type {TrackShift}
37036
+ */
37037
+ function shift(value) {
37038
+ lineShift += value
37039
+ }
37040
+
37041
+ /**
37042
+ * Move past some generated markdown.
37043
+ *
37044
+ * @type {TrackMove}
37045
+ */
37046
+ function move(input) {
37047
+ // eslint-disable-next-line unicorn/prefer-default-parameters
37048
+ const value = input || ''
37049
+ const chunks = value.split(/\r?\n|\r/g)
37050
+ const tail = chunks[chunks.length - 1]
37051
+ line += chunks.length - 1
37052
+ column =
37053
+ chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift
37054
+ return value
37055
+ }
37056
+ }
37057
+
36912
37058
  ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-strikethrough/lib/index.js
36913
37059
  /**
36914
37060
  * @typedef {import('mdast').Delete} Delete
@@ -36997,7 +37143,7 @@ function exitStrikethrough(token) {
36997
37143
  * @param {Delete} node
36998
37144
  */
36999
37145
  function handleDelete(node, _, context, safeOptions) {
37000
- const tracker = track(safeOptions)
37146
+ const tracker = track_track(safeOptions)
37001
37147
  const exit = context.enter('strikethrough')
37002
37148
  let value = tracker.move('~~')
37003
37149
  value += containerPhrasing(node, context, {
@@ -37015,7 +37161,133 @@ function peekDelete() {
37015
37161
  return '~'
37016
37162
  }
37017
37163
 
37018
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
37164
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-table/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
37165
+ /**
37166
+ * @typedef {import('../types.js').Handle} Handle
37167
+ * @typedef {import('../types.js').Info} Info
37168
+ * @typedef {import('../types.js').Parent} Parent
37169
+ * @typedef {import('../types.js').PhrasingContent} PhrasingContent
37170
+ * @typedef {import('../types.js').State} State
37171
+ */
37172
+
37173
+ /**
37174
+ * Serialize the children of a parent that contains phrasing children.
37175
+ *
37176
+ * These children will be joined flush together.
37177
+ *
37178
+ * @param {Parent & {children: Array<PhrasingContent>}} parent
37179
+ * Parent of flow nodes.
37180
+ * @param {State} state
37181
+ * Info passed around about the current state.
37182
+ * @param {Info} info
37183
+ * Info on where we are in the document we are generating.
37184
+ * @returns {string}
37185
+ * Serialized children, joined together.
37186
+ */
37187
+ function container_phrasing_containerPhrasing(parent, state, info) {
37188
+ const indexStack = state.indexStack
37189
+ const children = parent.children || []
37190
+ /** @type {Array<string>} */
37191
+ const results = []
37192
+ let index = -1
37193
+ let before = info.before
37194
+
37195
+ indexStack.push(-1)
37196
+ let tracker = state.createTracker(info)
37197
+
37198
+ while (++index < children.length) {
37199
+ const child = children[index]
37200
+ /** @type {string} */
37201
+ let after
37202
+
37203
+ indexStack[indexStack.length - 1] = index
37204
+
37205
+ if (index + 1 < children.length) {
37206
+ /** @type {Handle} */
37207
+ // @ts-expect-error: hush, it’s actually a `zwitch`.
37208
+ let handle = state.handle.handlers[children[index + 1].type]
37209
+ /** @type {Handle} */
37210
+ // @ts-expect-error: hush, it’s actually a `zwitch`.
37211
+ if (handle && handle.peek) handle = handle.peek
37212
+ after = handle
37213
+ ? handle(children[index + 1], parent, state, {
37214
+ before: '',
37215
+ after: '',
37216
+ ...tracker.current()
37217
+ }).charAt(0)
37218
+ : ''
37219
+ } else {
37220
+ after = info.after
37221
+ }
37222
+
37223
+ // In some cases, html (text) can be found in phrasing right after an eol.
37224
+ // When we’d serialize that, in most cases that would be seen as html
37225
+ // (flow).
37226
+ // As we can’t escape or so to prevent it from happening, we take a somewhat
37227
+ // reasonable approach: replace that eol with a space.
37228
+ // See: <https://github.com/syntax-tree/mdast-util-to-markdown/issues/15>
37229
+ if (
37230
+ results.length > 0 &&
37231
+ (before === '\r' || before === '\n') &&
37232
+ child.type === 'html'
37233
+ ) {
37234
+ results[results.length - 1] = results[results.length - 1].replace(
37235
+ /(\r?\n|\r)$/,
37236
+ ' '
37237
+ )
37238
+ before = ' '
37239
+
37240
+ // To do: does this work to reset tracker?
37241
+ tracker = state.createTracker(info)
37242
+ tracker.move(results.join(''))
37243
+ }
37244
+
37245
+ results.push(
37246
+ tracker.move(
37247
+ state.handle(child, parent, state, {
37248
+ ...tracker.current(),
37249
+ before,
37250
+ after
37251
+ })
37252
+ )
37253
+ )
37254
+
37255
+ before = results[results.length - 1].slice(-1)
37256
+ }
37257
+
37258
+ indexStack.pop()
37259
+
37260
+ return results.join('')
37261
+ }
37262
+
37263
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-table/node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js
37264
+ /**
37265
+ * @typedef {import('../types.js').Unsafe} Unsafe
37266
+ */
37267
+
37268
+ /**
37269
+ * @param {Unsafe} pattern
37270
+ * @returns {RegExp}
37271
+ */
37272
+ function pattern_compile_patternCompile(pattern) {
37273
+ if (!pattern._compiled) {
37274
+ const before =
37275
+ (pattern.atBreak ? '[\\r\\n][\\t ]*' : '') +
37276
+ (pattern.before ? '(?:' + pattern.before + ')' : '')
37277
+
37278
+ pattern._compiled = new RegExp(
37279
+ (before ? '(' + before + ')' : '') +
37280
+ (/[|\\{}()[\]^$+*?.-]/.test(pattern.character) ? '\\' : '') +
37281
+ pattern.character +
37282
+ (pattern.after ? '(?:' + pattern.after + ')' : ''),
37283
+ 'g'
37284
+ )
37285
+ }
37286
+
37287
+ return pattern._compiled
37288
+ }
37289
+
37290
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-table/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
37019
37291
  /**
37020
37292
  * @typedef {import('mdast').InlineCode} InlineCode
37021
37293
  * @typedef {import('../types.js').Parent} Parent
@@ -37062,7 +37334,7 @@ function inline_code_inlineCode(node, _, state) {
37062
37334
  // them out.
37063
37335
  while (++index < state.unsafe.length) {
37064
37336
  const pattern = state.unsafe[index]
37065
- const expression = patternCompile(pattern)
37337
+ const expression = pattern_compile_patternCompile(pattern)
37066
37338
  /** @type {RegExpExecArray | null} */
37067
37339
  let match
37068
37340
 
@@ -37694,7 +37966,7 @@ function gfmTableToMarkdown(options) {
37694
37966
  function handleTableCell(node, _, context, safeOptions) {
37695
37967
  const exit = context.enter('tableCell')
37696
37968
  const subexit = context.enter('phrasing')
37697
- const value = containerPhrasing(node, context, {
37969
+ const value = container_phrasing_containerPhrasing(node, context, {
37698
37970
  ...safeOptions,
37699
37971
  before: around,
37700
37972
  after: around
@@ -37789,7 +38061,7 @@ function gfmTableToMarkdown(options) {
37789
38061
  }
37790
38062
  }
37791
38063
 
37792
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
38064
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
37793
38065
  /**
37794
38066
  * @typedef {import('../types.js').State} State
37795
38067
  * @typedef {import('../types.js').Options} Options
@@ -37813,7 +38085,7 @@ function checkBullet(state) {
37813
38085
  return marker
37814
38086
  }
37815
38087
 
37816
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
38088
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
37817
38089
  /**
37818
38090
  * @typedef {import('../types.js').State} State
37819
38091
  * @typedef {import('../types.js').Options} Options
@@ -37843,7 +38115,7 @@ function checkListItemIndent(state) {
37843
38115
  return style
37844
38116
  }
37845
38117
 
37846
- ;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/handle/list-item.js
38118
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown/lib/handle/list-item.js
37847
38119
  /**
37848
38120
  * @typedef {import('mdast').ListItem} ListItem
37849
38121
  * @typedef {import('../types.js').Map} Map
@@ -37910,6 +38182,66 @@ function list_item_listItem(node, parent, state, info) {
37910
38182
  }
37911
38183
  }
37912
38184
 
38185
+ ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown/lib/util/track.js
38186
+ /**
38187
+ * @typedef {import('../types.js').CreateTracker} CreateTracker
38188
+ * @typedef {import('../types.js').TrackCurrent} TrackCurrent
38189
+ * @typedef {import('../types.js').TrackMove} TrackMove
38190
+ * @typedef {import('../types.js').TrackShift} TrackShift
38191
+ */
38192
+
38193
+ /**
38194
+ * Track positional info in the output.
38195
+ *
38196
+ * @type {CreateTracker}
38197
+ */
38198
+ function util_track_track(config) {
38199
+ // Defaults are used to prevent crashes when older utilities somehow activate
38200
+ // this code.
38201
+ /* c8 ignore next 5 */
38202
+ const options = config || {}
38203
+ const now = options.now || {}
38204
+ let lineShift = options.lineShift || 0
38205
+ let line = now.line || 1
38206
+ let column = now.column || 1
38207
+
38208
+ return {move, current, shift}
38209
+
38210
+ /**
38211
+ * Get the current tracked info.
38212
+ *
38213
+ * @type {TrackCurrent}
38214
+ */
38215
+ function current() {
38216
+ return {now: {line, column}, lineShift}
38217
+ }
38218
+
38219
+ /**
38220
+ * Define an increased line shift (the typical indent for lines).
38221
+ *
38222
+ * @type {TrackShift}
38223
+ */
38224
+ function shift(value) {
38225
+ lineShift += value
38226
+ }
38227
+
38228
+ /**
38229
+ * Move past some generated markdown.
38230
+ *
38231
+ * @type {TrackMove}
38232
+ */
38233
+ function move(input) {
38234
+ // eslint-disable-next-line unicorn/prefer-default-parameters
38235
+ const value = input || ''
38236
+ const chunks = value.split(/\r?\n|\r/g)
38237
+ const tail = chunks[chunks.length - 1]
38238
+ line += chunks.length - 1
38239
+ column =
38240
+ chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift
38241
+ return value
38242
+ }
38243
+ }
38244
+
37913
38245
  ;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/lib/index.js
37914
38246
  /**
37915
38247
  * @typedef {import('mdast').Content} Content
@@ -38029,7 +38361,7 @@ function listItemWithTaskListItem(node, parent, context, safeOptions) {
38029
38361
  const checkable =
38030
38362
  typeof node.checked === 'boolean' && head && head.type === 'paragraph'
38031
38363
  const checkbox = '[' + (node.checked ? 'x' : ' ') + '] '
38032
- const tracker = track(safeOptions)
38364
+ const tracker = util_track_track(safeOptions)
38033
38365
 
38034
38366
  if (checkable) {
38035
38367
  tracker.move(checkbox)
@@ -45602,7 +45934,7 @@ function vbnet(Prism) {
45602
45934
  })
45603
45935
  }
45604
45936
 
45605
- ;// CONCATENATED MODULE: ../node_modules/character-entities-legacy/index.js
45937
+ ;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/character-entities-legacy/index.js
45606
45938
  /**
45607
45939
  * List of legacy HTML named character references that don’t need a trailing semicolon.
45608
45940
  *
@@ -45717,7 +46049,7 @@ const characterEntitiesLegacy = [
45717
46049
  'yuml'
45718
46050
  ]
45719
46051
 
45720
- ;// CONCATENATED MODULE: ../node_modules/character-reference-invalid/index.js
46052
+ ;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/character-reference-invalid/index.js
45721
46053
  /**
45722
46054
  * Map of invalid numeric character references to their replacements, according to HTML.
45723
46055
  *
@@ -45754,7 +46086,7 @@ const characterReferenceInvalid = {
45754
46086
  159: 'Ÿ'
45755
46087
  }
45756
46088
 
45757
- ;// CONCATENATED MODULE: ../node_modules/is-decimal/index.js
46089
+ ;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/is-decimal/index.js
45758
46090
  /**
45759
46091
  * Check if the given character code, or the character code at the first
45760
46092
  * character, is decimal.
@@ -45769,7 +46101,7 @@ function isDecimal(character) {
45769
46101
  return code >= 48 && code <= 57 /* 0-9 */
45770
46102
  }
45771
46103
 
45772
- ;// CONCATENATED MODULE: ../node_modules/is-hexadecimal/index.js
46104
+ ;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/is-hexadecimal/index.js
45773
46105
  /**
45774
46106
  * Check if the given character code, or the character code at the first
45775
46107
  * character, is hexadecimal.
@@ -45788,7 +46120,7 @@ function isHexadecimal(character) {
45788
46120
  )
45789
46121
  }
45790
46122
 
45791
- ;// CONCATENATED MODULE: ../node_modules/is-alphabetical/index.js
46123
+ ;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/is-alphabetical/index.js
45792
46124
  /**
45793
46125
  * Check if the given character code, or the character code at the first
45794
46126
  * character, is alphabetical.
@@ -45806,7 +46138,7 @@ function isAlphabetical(character) {
45806
46138
  )
45807
46139
  }
45808
46140
 
45809
- ;// CONCATENATED MODULE: ../node_modules/is-alphanumerical/index.js
46141
+ ;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/is-alphanumerical/index.js
45810
46142
 
45811
46143
 
45812
46144
 
@@ -45821,7 +46153,7 @@ function isAlphanumerical(character) {
45821
46153
  return isAlphabetical(character) || isDecimal(character)
45822
46154
  }
45823
46155
 
45824
- ;// CONCATENATED MODULE: ../node_modules/parse-entities/lib/index.js
46156
+ ;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/parse-entities/lib/index.js
45825
46157
  /**
45826
46158
  * @typedef {import('unist').Point} Point
45827
46159
  * @typedef {import('unist').Position} Position
@@ -70245,7 +70577,6 @@ var octiconLink = {
70245
70577
  }
70246
70578
  }]
70247
70579
  };
70248
-
70249
70580
  ;// CONCATENATED MODULE: ../node_modules/@uiw/react-markdown-preview/esm/nodes/copy.js
70250
70581
  function copyElement(str) {
70251
70582
  if (str === void 0) {
@@ -70309,34 +70640,45 @@ function copyElement(str) {
70309
70640
  }]
70310
70641
  };
70311
70642
  }
70312
-
70313
70643
  // EXTERNAL MODULE: ../node_modules/@uiw/copy-to-clipboard/dist/copy-to-clipboard.umd.js
70314
70644
  var copy_to_clipboard_umd = __webpack_require__(7071);
70315
70645
  var copy_to_clipboard_umd_default = /*#__PURE__*/__webpack_require__.n(copy_to_clipboard_umd);
70316
70646
  ;// CONCATENATED MODULE: ../node_modules/@uiw/react-markdown-preview/esm/plugins/useCopied.js
70317
70647
 
70318
70648
 
70649
+ function getParentElement(target) {
70650
+ if (!target) return null;
70651
+ var dom = target;
70652
+ if (dom.dataset.code && dom.classList.contains('copied')) {
70653
+ return dom;
70654
+ }
70655
+ if (dom.parentElement) {
70656
+ return getParentElement(dom.parentElement);
70657
+ }
70658
+ return null;
70659
+ }
70319
70660
  function useCopied(container) {
70320
- var handle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(event => {
70321
- var target = event.currentTarget || event.target;
70661
+ var handle = event => {
70662
+ var target = getParentElement(event.target);
70663
+ if (!target) return;
70322
70664
  target.classList.add('active');
70323
70665
  copy_to_clipboard_umd_default()(target.dataset.code, function () {
70324
70666
  setTimeout(() => {
70325
70667
  target.classList.remove('active');
70326
70668
  }, 2000);
70327
70669
  });
70328
- }, []);
70670
+ };
70329
70671
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
70330
- var _container$current;
70331
- var btns = (_container$current = container.current) == null ? void 0 : _container$current.querySelectorAll('pre code + div.copied');
70332
- btns && Array.from(btns).forEach(elm => elm.addEventListener('click', handle, false));
70672
+ var _container$current, _container$current2;
70673
+ (_container$current = container.current) == null ? void 0 : _container$current.removeEventListener('click', handle, false);
70674
+ (_container$current2 = container.current) == null ? void 0 : _container$current2.addEventListener('click', handle, false);
70333
70675
  return () => {
70334
- btns && Array.from(btns).forEach(elm => elm.removeEventListener('click', handle, false));
70676
+ var _container$current3;
70677
+ (_container$current3 = container.current) == null ? void 0 : _container$current3.removeEventListener('click', handle, false);
70335
70678
  };
70336
70679
  // eslint-disable-next-line react-hooks/exhaustive-deps
70337
70680
  }, [container]);
70338
70681
  }
70339
-
70340
70682
  ;// CONCATENATED MODULE: ../node_modules/@uiw/react-markdown-preview/esm/styles/markdown.css
70341
70683
  // extracted by mini-css-extract-plugin
70342
70684
  /* harmony default export */ const styles_markdown = ({});
@@ -70357,7 +70699,6 @@ var reservedMeta = function reservedMeta(options) {
70357
70699
  });
70358
70700
  };
70359
70701
  };
70360
-
70361
70702
  // EXTERNAL MODULE: ../node_modules/react/jsx-runtime.js
70362
70703
  var jsx_runtime = __webpack_require__(3605);
70363
70704
  ;// CONCATENATED MODULE: ../node_modules/@uiw/react-markdown-preview/esm/index.js
@@ -70453,7 +70794,6 @@ var _excluded = ["prefixCls", "className", "source", "style", "disableCopy", "sk
70453
70794
  }))
70454
70795
  }));
70455
70796
  }));
70456
-
70457
70797
  ;// CONCATENATED MODULE: ./src/Context.tsx
70458
70798
  function reducer(state,action){return _objectSpread2(_objectSpread2({},state),action);}var EditorContext=/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext({markdown:''});
70459
70799
  ;// CONCATENATED MODULE: ./src/components/TextArea/shortcuts.ts
@@ -71000,6 +71340,121 @@ function toDecimal(code, next, omit) {
71000
71340
  : value + ';'
71001
71341
  }
71002
71342
 
71343
+ ;// CONCATENATED MODULE: ../node_modules/stringify-entities/node_modules/character-entities-legacy/index.js
71344
+ /**
71345
+ * List of legacy HTML named character references that don’t need a trailing semicolon.
71346
+ *
71347
+ * @type {Array<string>}
71348
+ */
71349
+ const character_entities_legacy_characterEntitiesLegacy = [
71350
+ 'AElig',
71351
+ 'AMP',
71352
+ 'Aacute',
71353
+ 'Acirc',
71354
+ 'Agrave',
71355
+ 'Aring',
71356
+ 'Atilde',
71357
+ 'Auml',
71358
+ 'COPY',
71359
+ 'Ccedil',
71360
+ 'ETH',
71361
+ 'Eacute',
71362
+ 'Ecirc',
71363
+ 'Egrave',
71364
+ 'Euml',
71365
+ 'GT',
71366
+ 'Iacute',
71367
+ 'Icirc',
71368
+ 'Igrave',
71369
+ 'Iuml',
71370
+ 'LT',
71371
+ 'Ntilde',
71372
+ 'Oacute',
71373
+ 'Ocirc',
71374
+ 'Ograve',
71375
+ 'Oslash',
71376
+ 'Otilde',
71377
+ 'Ouml',
71378
+ 'QUOT',
71379
+ 'REG',
71380
+ 'THORN',
71381
+ 'Uacute',
71382
+ 'Ucirc',
71383
+ 'Ugrave',
71384
+ 'Uuml',
71385
+ 'Yacute',
71386
+ 'aacute',
71387
+ 'acirc',
71388
+ 'acute',
71389
+ 'aelig',
71390
+ 'agrave',
71391
+ 'amp',
71392
+ 'aring',
71393
+ 'atilde',
71394
+ 'auml',
71395
+ 'brvbar',
71396
+ 'ccedil',
71397
+ 'cedil',
71398
+ 'cent',
71399
+ 'copy',
71400
+ 'curren',
71401
+ 'deg',
71402
+ 'divide',
71403
+ 'eacute',
71404
+ 'ecirc',
71405
+ 'egrave',
71406
+ 'eth',
71407
+ 'euml',
71408
+ 'frac12',
71409
+ 'frac14',
71410
+ 'frac34',
71411
+ 'gt',
71412
+ 'iacute',
71413
+ 'icirc',
71414
+ 'iexcl',
71415
+ 'igrave',
71416
+ 'iquest',
71417
+ 'iuml',
71418
+ 'laquo',
71419
+ 'lt',
71420
+ 'macr',
71421
+ 'micro',
71422
+ 'middot',
71423
+ 'nbsp',
71424
+ 'not',
71425
+ 'ntilde',
71426
+ 'oacute',
71427
+ 'ocirc',
71428
+ 'ograve',
71429
+ 'ordf',
71430
+ 'ordm',
71431
+ 'oslash',
71432
+ 'otilde',
71433
+ 'ouml',
71434
+ 'para',
71435
+ 'plusmn',
71436
+ 'pound',
71437
+ 'quot',
71438
+ 'raquo',
71439
+ 'reg',
71440
+ 'sect',
71441
+ 'shy',
71442
+ 'sup1',
71443
+ 'sup2',
71444
+ 'sup3',
71445
+ 'szlig',
71446
+ 'thorn',
71447
+ 'times',
71448
+ 'uacute',
71449
+ 'ucirc',
71450
+ 'ugrave',
71451
+ 'uml',
71452
+ 'uuml',
71453
+ 'yacute',
71454
+ 'yen',
71455
+ 'yuml'
71456
+ ]
71457
+
71003
71458
  ;// CONCATENATED MODULE: ../node_modules/character-entities-html4/index.js
71004
71459
  /**
71005
71460
  * Map of named character references from HTML 4.
@@ -71320,7 +71775,7 @@ function toNamed(code, next, omit, attribute) {
71320
71775
 
71321
71776
  if (
71322
71777
  omit &&
71323
- characterEntitiesLegacy.includes(name) &&
71778
+ character_entities_legacy_characterEntitiesLegacy.includes(name) &&
71324
71779
  !dangerous.includes(name) &&
71325
71780
  (!attribute ||
71326
71781
  (next &&