@uiw/react-md-editor 3.19.4 → 3.19.6
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 +86 -652
- package/dist/mdeditor.min.js +1 -1
- package/esm/commands/preview.js +3 -0
- package/esm/commands/preview.js.map +4 -2
- package/esm/components/DragBar/index.js +30 -7
- package/esm/components/DragBar/index.js.map +9 -5
- package/esm/components/TextArea/Markdown.js +26 -25
- package/esm/components/TextArea/Markdown.js.map +6 -3
- package/lib/commands/preview.js +3 -0
- package/lib/commands/preview.js.map +4 -2
- package/lib/components/DragBar/index.js +30 -7
- package/lib/components/DragBar/index.js.map +11 -7
- package/lib/components/TextArea/Markdown.js +25 -24
- package/lib/components/TextArea/Markdown.js.map +6 -3
- package/package.json +1 -1
- package/src/commands/preview.tsx +3 -0
- package/src/components/DragBar/index.tsx +23 -9
- package/src/components/TextArea/Markdown.tsx +21 -22
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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/
|
|
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/
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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 =
|
|
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 =
|
|
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: [
|
|
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 =
|
|
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-
|
|
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 =
|
|
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 =
|
|
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-
|
|
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-
|
|
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-
|
|
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 =
|
|
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 =
|
|
28712
|
-
|
|
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 =
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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
|
-
|
|
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(/```(
|
|
63104
|
-
},[]);
|
|
62537
|
+
var _templateObject;function html2Escape(sHtml){return sHtml.replace(/```(\w+)?([\s\S]*?)(\s.+)?```/g,function(str){return str.replace(/[<&"]/g,function(c){return{'<':'<','>':'>','&':'&','"':'"'}[c];});}).replace(/[<&"]/g,function(c){return{'<':'<','>':'>','&':'&','"':'"'}[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>");console.log('markdown::',markdown);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) {
|
|
@@ -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
|
|
@@ -63331,8 +62765,8 @@ document.body.style.overflow=originalOverflow.current;}}},[fullscreen,originalOv
|
|
|
63331
62765
|
// extracted by mini-css-extract-plugin
|
|
63332
62766
|
/* harmony default export */ const DragBar = ({});
|
|
63333
62767
|
;// CONCATENATED MODULE: ./src/components/DragBar/index.tsx
|
|
63334
|
-
var DragBar_DragBar=function DragBar(props){var _ref=props||{},prefixCls=_ref.prefixCls,onChange=_ref.onChange;var dragRef=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();function handleMouseMove(event){if(dragRef.current){var newHeight=dragRef.current.height+
|
|
63335
|
-
},[]);var svg=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return/*#__PURE__*/(0,jsx_runtime.jsx)("svg",{viewBox:"0 0 512 512",height:"100%",children:/*#__PURE__*/(0,jsx_runtime.jsx)("path",{fill:"currentColor",d:"M304 256c0 26.5-21.5 48-48 48s-48-21.5-48-48 21.5-48 48-48 48 21.5 48 48zm120-48c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48zm-336 0c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z"})});},[]);return/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"".concat(prefixCls,"-bar"),
|
|
62768
|
+
var DragBar_DragBar=function DragBar(props){var _ref=props||{},prefixCls=_ref.prefixCls,onChange=_ref.onChange;var $dom=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);var dragRef=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();function handleMouseMove(event){if(dragRef.current){var _changedTouches$;var clientY=event.clientY||((_changedTouches$=event.changedTouches[0])===null||_changedTouches$===void 0?void 0:_changedTouches$.clientY);var newHeight=dragRef.current.height+clientY-dragRef.current.dragY;if(newHeight>=props.minHeight&&newHeight<=props.maxHeight){onChange&&onChange(dragRef.current.height+(clientY-dragRef.current.dragY));}}}function handleMouseUp(){var _$dom$current,_$dom$current2;dragRef.current=undefined;document.removeEventListener('mousemove',handleMouseMove);document.removeEventListener('mouseup',handleMouseUp);(_$dom$current=$dom.current)===null||_$dom$current===void 0?void 0:_$dom$current.removeEventListener('touchmove',handleMouseMove);(_$dom$current2=$dom.current)===null||_$dom$current2===void 0?void 0:_$dom$current2.removeEventListener('touchend',handleMouseUp);}function handleMouseDown(event){var _changedTouches$2,_$dom$current3,_$dom$current4;event.preventDefault();var clientY=event.clientY||((_changedTouches$2=event.changedTouches[0])===null||_changedTouches$2===void 0?void 0:_changedTouches$2.clientY);dragRef.current={height:props.height,dragY:clientY};document.addEventListener('mousemove',handleMouseMove);document.addEventListener('mouseup',handleMouseUp);(_$dom$current3=$dom.current)===null||_$dom$current3===void 0?void 0:_$dom$current3.addEventListener('touchmove',handleMouseMove,{passive:false});(_$dom$current4=$dom.current)===null||_$dom$current4===void 0?void 0:_$dom$current4.addEventListener('touchend',handleMouseUp,{passive:false});}(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){if(document){var _$dom$current5,_$dom$current6;(_$dom$current5=$dom.current)===null||_$dom$current5===void 0?void 0:_$dom$current5.addEventListener('touchstart',handleMouseDown,{passive:false});(_$dom$current6=$dom.current)===null||_$dom$current6===void 0?void 0:_$dom$current6.addEventListener('mousedown',handleMouseDown);}return function(){if(document){var _$dom$current7;(_$dom$current7=$dom.current)===null||_$dom$current7===void 0?void 0:_$dom$current7.removeEventListener('touchstart',handleMouseDown);document.removeEventListener('mousemove',handleMouseMove);}};// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62769
|
+
},[]);var svg=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return/*#__PURE__*/(0,jsx_runtime.jsx)("svg",{viewBox:"0 0 512 512",height:"100%",children:/*#__PURE__*/(0,jsx_runtime.jsx)("path",{fill:"currentColor",d:"M304 256c0 26.5-21.5 48-48 48s-48-21.5-48-48 21.5-48 48-48 48 21.5 48 48zm120-48c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48zm-336 0c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z"})});},[]);return/*#__PURE__*/(0,jsx_runtime.jsx)("div",{className:"".concat(prefixCls,"-bar"),ref:$dom,children:svg});};/* harmony default export */ const components_DragBar = (DragBar_DragBar);
|
|
63336
62770
|
;// CONCATENATED MODULE: ./src/index.less
|
|
63337
62771
|
// extracted by mini-css-extract-plugin
|
|
63338
62772
|
/* harmony default export */ const src = ({});
|