@uiw/react-md-editor 3.14.4 → 3.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +119 -3
- package/dist/mdeditor.css +1 -6
- package/dist/mdeditor.js +818 -350
- package/dist/mdeditor.min.css +1 -1
- package/dist/mdeditor.min.js +1 -1
- package/esm/Context.d.ts +2 -2
- package/esm/Context.js.map +1 -1
- package/esm/Editor.d.ts +4 -3
- package/esm/Editor.js +2 -2
- package/esm/Editor.js.map +2 -3
- package/esm/commands/group.d.ts +1 -1
- package/esm/commands/index.d.ts +2 -0
- package/esm/commands/index.js.map +2 -2
- package/esm/components/Toolbar/index.js +1 -1
- package/esm/components/Toolbar/index.js.map +3 -2
- package/esm/index.css +1 -0
- package/esm/index.less +1 -0
- package/lib/Context.d.ts +2 -2
- package/lib/Context.js.map +1 -1
- package/lib/Editor.d.ts +4 -3
- package/lib/Editor.js +2 -2
- package/lib/Editor.js.map +2 -3
- package/lib/commands/group.d.ts +1 -1
- package/lib/commands/index.d.ts +2 -0
- package/lib/commands/index.js.map +2 -2
- package/lib/components/Toolbar/index.js +1 -1
- package/lib/components/Toolbar/index.js.map +3 -2
- package/lib/index.less +1 -0
- package/markdown-editor.css +1 -0
- package/package.json +2 -2
- package/src/Context.tsx +1 -1
- package/src/Editor.tsx +6 -6
- package/src/commands/index.ts +7 -0
- package/src/components/Toolbar/index.tsx +4 -2
- package/src/index.less +1 -0
package/dist/mdeditor.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
return /******/ (() => { // webpackBootstrap
|
|
12
12
|
/******/ var __webpack_modules__ = ({
|
|
13
13
|
|
|
14
|
-
/***/
|
|
14
|
+
/***/ 71:
|
|
15
15
|
/***/ (function(module) {
|
|
16
16
|
|
|
17
17
|
/*!
|
|
@@ -9671,7 +9671,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
9671
9671
|
"unorderedListCommand": () => (/* reexport */ unorderedListCommand)
|
|
9672
9672
|
});
|
|
9673
9673
|
|
|
9674
|
-
// NAMESPACE OBJECT: ../node_modules/micromark/lib/constructs.js
|
|
9674
|
+
// NAMESPACE OBJECT: ../node_modules/react-markdown/node_modules/micromark/lib/constructs.js
|
|
9675
9675
|
var constructs_namespaceObject = {};
|
|
9676
9676
|
__webpack_require__.r(constructs_namespaceObject);
|
|
9677
9677
|
__webpack_require__.d(constructs_namespaceObject, {
|
|
@@ -9911,7 +9911,7 @@ function _extends() {
|
|
|
9911
9911
|
}
|
|
9912
9912
|
// EXTERNAL MODULE: ../node_modules/is-buffer/index.js
|
|
9913
9913
|
var is_buffer = __webpack_require__(372);
|
|
9914
|
-
;// CONCATENATED MODULE: ../node_modules/unist-util-stringify-position/index.js
|
|
9914
|
+
;// CONCATENATED MODULE: ../node_modules/vfile-message/node_modules/unist-util-stringify-position/index.js
|
|
9915
9915
|
/**
|
|
9916
9916
|
* @typedef {import('unist').Point} Point
|
|
9917
9917
|
* @typedef {import('unist').Node} Node
|
|
@@ -11084,12 +11084,12 @@ function bail(error) {
|
|
|
11084
11084
|
var extend = __webpack_require__(112);
|
|
11085
11085
|
;// CONCATENATED MODULE: ../node_modules/unified/node_modules/is-plain-obj/index.js
|
|
11086
11086
|
function isPlainObject(value) {
|
|
11087
|
-
if (
|
|
11087
|
+
if (typeof value !== 'object' || value === null) {
|
|
11088
11088
|
return false;
|
|
11089
11089
|
}
|
|
11090
11090
|
|
|
11091
11091
|
const prototype = Object.getPrototypeOf(value);
|
|
11092
|
-
return prototype === null || prototype === Object.prototype;
|
|
11092
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
|
|
11093
11093
|
}
|
|
11094
11094
|
|
|
11095
11095
|
;// CONCATENATED MODULE: ../node_modules/trough/index.js
|
|
@@ -11855,7 +11855,7 @@ function looksLikeAVFileValue(value) {
|
|
|
11855
11855
|
return typeof value === 'string' || is_buffer(value)
|
|
11856
11856
|
}
|
|
11857
11857
|
|
|
11858
|
-
;// CONCATENATED MODULE: ../node_modules/mdast-util-to-string/index.js
|
|
11858
|
+
;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/mdast-util-to-string/index.js
|
|
11859
11859
|
/**
|
|
11860
11860
|
* @typedef Options
|
|
11861
11861
|
* @property {boolean} [includeImageAlt=true]
|
|
@@ -12356,7 +12356,7 @@ function factorySpace(effects, ok, type, max) {
|
|
|
12356
12356
|
}
|
|
12357
12357
|
}
|
|
12358
12358
|
|
|
12359
|
-
;// CONCATENATED MODULE: ../node_modules/micromark/lib/initialize/content.js
|
|
12359
|
+
;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/initialize/content.js
|
|
12360
12360
|
/**
|
|
12361
12361
|
* @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
|
|
12362
12362
|
* @typedef {import('micromark-util-types').Initializer} Initializer
|
|
@@ -12437,7 +12437,7 @@ function initializeContent(effects) {
|
|
|
12437
12437
|
}
|
|
12438
12438
|
}
|
|
12439
12439
|
|
|
12440
|
-
;// CONCATENATED MODULE: ../node_modules/micromark/lib/initialize/document.js
|
|
12440
|
+
;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/initialize/document.js
|
|
12441
12441
|
/**
|
|
12442
12442
|
* @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
|
|
12443
12443
|
* @typedef {import('micromark-util-types').Initializer} Initializer
|
|
@@ -13212,7 +13212,7 @@ function tokenizeContinuation(effects, ok, nok) {
|
|
|
13212
13212
|
}
|
|
13213
13213
|
}
|
|
13214
13214
|
|
|
13215
|
-
;// CONCATENATED MODULE: ../node_modules/micromark/lib/initialize/flow.js
|
|
13215
|
+
;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/initialize/flow.js
|
|
13216
13216
|
/**
|
|
13217
13217
|
* @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
|
|
13218
13218
|
* @typedef {import('micromark-util-types').Initializer} Initializer
|
|
@@ -13279,7 +13279,7 @@ function initializeFlow(effects) {
|
|
|
13279
13279
|
}
|
|
13280
13280
|
}
|
|
13281
13281
|
|
|
13282
|
-
;// CONCATENATED MODULE: ../node_modules/micromark/lib/initialize/text.js
|
|
13282
|
+
;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/initialize/text.js
|
|
13283
13283
|
/**
|
|
13284
13284
|
* @typedef {import('micromark-util-types').Resolver} Resolver
|
|
13285
13285
|
* @typedef {import('micromark-util-types').Initializer} Initializer
|
|
@@ -13531,7 +13531,7 @@ function resolveAll(constructs, events, context) {
|
|
|
13531
13531
|
return events
|
|
13532
13532
|
}
|
|
13533
13533
|
|
|
13534
|
-
;// CONCATENATED MODULE: ../node_modules/micromark/lib/create-tokenizer.js
|
|
13534
|
+
;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/create-tokenizer.js
|
|
13535
13535
|
/**
|
|
13536
13536
|
* @typedef {import('micromark-util-types').Code} Code
|
|
13537
13537
|
* @typedef {import('micromark-util-types').Chunk} Chunk
|
|
@@ -18136,7 +18136,7 @@ function tokenizeCodeText(effects, ok, nok) {
|
|
|
18136
18136
|
}
|
|
18137
18137
|
}
|
|
18138
18138
|
|
|
18139
|
-
;// CONCATENATED MODULE: ../node_modules/micromark/lib/constructs.js
|
|
18139
|
+
;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/constructs.js
|
|
18140
18140
|
/**
|
|
18141
18141
|
* @typedef {import('micromark-util-types').Extension} Extension
|
|
18142
18142
|
*/
|
|
@@ -18222,7 +18222,7 @@ const disable = {
|
|
|
18222
18222
|
null: []
|
|
18223
18223
|
}
|
|
18224
18224
|
|
|
18225
|
-
;// CONCATENATED MODULE: ../node_modules/micromark/lib/parse.js
|
|
18225
|
+
;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/parse.js
|
|
18226
18226
|
/**
|
|
18227
18227
|
* @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
|
|
18228
18228
|
* @typedef {import('micromark-util-types').FullNormalizedExtension} FullNormalizedExtension
|
|
@@ -18276,7 +18276,7 @@ function parse_parse(options = {}) {
|
|
|
18276
18276
|
}
|
|
18277
18277
|
}
|
|
18278
18278
|
|
|
18279
|
-
;// CONCATENATED MODULE: ../node_modules/micromark/lib/preprocess.js
|
|
18279
|
+
;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/preprocess.js
|
|
18280
18280
|
/**
|
|
18281
18281
|
* @typedef {import('micromark-util-types').Encoding} Encoding
|
|
18282
18282
|
* @typedef {import('micromark-util-types').Value} Value
|
|
@@ -18407,7 +18407,7 @@ function preprocess() {
|
|
|
18407
18407
|
}
|
|
18408
18408
|
}
|
|
18409
18409
|
|
|
18410
|
-
;// CONCATENATED MODULE: ../node_modules/micromark/lib/postprocess.js
|
|
18410
|
+
;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/micromark/lib/postprocess.js
|
|
18411
18411
|
/**
|
|
18412
18412
|
* @typedef {import('micromark-util-types').Event} Event
|
|
18413
18413
|
*/
|
|
@@ -18499,7 +18499,71 @@ function decode($0, $1, $2) {
|
|
|
18499
18499
|
return decodeNamedCharacterReference($2) || $0
|
|
18500
18500
|
}
|
|
18501
18501
|
|
|
18502
|
-
;// CONCATENATED MODULE: ../node_modules/
|
|
18502
|
+
;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/unist-util-stringify-position/index.js
|
|
18503
|
+
/**
|
|
18504
|
+
* @typedef {import('unist').Point} Point
|
|
18505
|
+
* @typedef {import('unist').Node} Node
|
|
18506
|
+
* @typedef {import('unist').Position} Position
|
|
18507
|
+
* @typedef {object & {type: string, position?: Position|undefined}} NodeLike
|
|
18508
|
+
*/
|
|
18509
|
+
|
|
18510
|
+
/**
|
|
18511
|
+
* Stringify one point, a position (start and end points), or a node’s
|
|
18512
|
+
* positional information.
|
|
18513
|
+
*
|
|
18514
|
+
* @param {Node|NodeLike|Position|Point|null} [value]
|
|
18515
|
+
* @returns {string}
|
|
18516
|
+
*/
|
|
18517
|
+
function unist_util_stringify_position_stringifyPosition(value) {
|
|
18518
|
+
// Nothing.
|
|
18519
|
+
if (!value || typeof value !== 'object') {
|
|
18520
|
+
return ''
|
|
18521
|
+
}
|
|
18522
|
+
|
|
18523
|
+
// Node.
|
|
18524
|
+
if ('position' in value || 'type' in value) {
|
|
18525
|
+
return unist_util_stringify_position_position(value.position)
|
|
18526
|
+
}
|
|
18527
|
+
|
|
18528
|
+
// Position.
|
|
18529
|
+
if ('start' in value || 'end' in value) {
|
|
18530
|
+
return unist_util_stringify_position_position(value)
|
|
18531
|
+
}
|
|
18532
|
+
|
|
18533
|
+
// Point.
|
|
18534
|
+
if ('line' in value || 'column' in value) {
|
|
18535
|
+
return unist_util_stringify_position_point(value)
|
|
18536
|
+
}
|
|
18537
|
+
|
|
18538
|
+
// ?
|
|
18539
|
+
return ''
|
|
18540
|
+
}
|
|
18541
|
+
|
|
18542
|
+
/**
|
|
18543
|
+
* @param {Point|undefined} point
|
|
18544
|
+
* @returns {string}
|
|
18545
|
+
*/
|
|
18546
|
+
function unist_util_stringify_position_point(point) {
|
|
18547
|
+
return unist_util_stringify_position_index(point && point.line) + ':' + unist_util_stringify_position_index(point && point.column)
|
|
18548
|
+
}
|
|
18549
|
+
|
|
18550
|
+
/**
|
|
18551
|
+
* @param {Position|undefined} pos
|
|
18552
|
+
* @returns {string}
|
|
18553
|
+
*/
|
|
18554
|
+
function unist_util_stringify_position_position(pos) {
|
|
18555
|
+
return unist_util_stringify_position_point(pos && pos.start) + '-' + unist_util_stringify_position_point(pos && pos.end)
|
|
18556
|
+
}
|
|
18557
|
+
|
|
18558
|
+
/**
|
|
18559
|
+
* @param {number|undefined} value
|
|
18560
|
+
* @returns {number}
|
|
18561
|
+
*/
|
|
18562
|
+
function unist_util_stringify_position_index(value) {
|
|
18563
|
+
return value && typeof value === 'number' ? value : 1
|
|
18564
|
+
}
|
|
18565
|
+
|
|
18566
|
+
;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/mdast-util-from-markdown/lib/index.js
|
|
18503
18567
|
/**
|
|
18504
18568
|
* @typedef {import('micromark-util-types').Encoding} Encoding
|
|
18505
18569
|
* @typedef {import('micromark-util-types').Event} Event
|
|
@@ -19104,7 +19168,7 @@ function compiler(options = {}) {
|
|
|
19104
19168
|
'Cannot close `' +
|
|
19105
19169
|
token.type +
|
|
19106
19170
|
'` (' +
|
|
19107
|
-
|
|
19171
|
+
unist_util_stringify_position_stringifyPosition({
|
|
19108
19172
|
start: token.start,
|
|
19109
19173
|
end: token.end
|
|
19110
19174
|
}) +
|
|
@@ -19717,14 +19781,14 @@ function defaultOnError(left, right) {
|
|
|
19717
19781
|
'Cannot close `' +
|
|
19718
19782
|
left.type +
|
|
19719
19783
|
'` (' +
|
|
19720
|
-
|
|
19784
|
+
unist_util_stringify_position_stringifyPosition({
|
|
19721
19785
|
start: left.start,
|
|
19722
19786
|
end: left.end
|
|
19723
19787
|
}) +
|
|
19724
19788
|
'): a different token (`' +
|
|
19725
19789
|
right.type +
|
|
19726
19790
|
'`, ' +
|
|
19727
|
-
|
|
19791
|
+
unist_util_stringify_position_stringifyPosition({
|
|
19728
19792
|
start: right.start,
|
|
19729
19793
|
end: right.end
|
|
19730
19794
|
}) +
|
|
@@ -19735,7 +19799,7 @@ function defaultOnError(left, right) {
|
|
|
19735
19799
|
'Cannot close document, a token (`' +
|
|
19736
19800
|
right.type +
|
|
19737
19801
|
'`, ' +
|
|
19738
|
-
|
|
19802
|
+
unist_util_stringify_position_stringifyPosition({
|
|
19739
19803
|
start: right.start,
|
|
19740
19804
|
end: right.end
|
|
19741
19805
|
}) +
|
|
@@ -19744,7 +19808,7 @@ function defaultOnError(left, right) {
|
|
|
19744
19808
|
}
|
|
19745
19809
|
}
|
|
19746
19810
|
|
|
19747
|
-
;// CONCATENATED MODULE: ../node_modules/remark-parse/lib/index.js
|
|
19811
|
+
;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/remark-parse/lib/index.js
|
|
19748
19812
|
/**
|
|
19749
19813
|
* @typedef {import('mdast').Root} Root
|
|
19750
19814
|
* @typedef {import('mdast-util-from-markdown').Options} Options
|
|
@@ -19774,7 +19838,7 @@ function remarkParse(options) {
|
|
|
19774
19838
|
Object.assign(this, {Parser: parser})
|
|
19775
19839
|
}
|
|
19776
19840
|
|
|
19777
|
-
;// CONCATENATED MODULE: ../node_modules/remark-parse/index.js
|
|
19841
|
+
;// CONCATENATED MODULE: ../node_modules/react-markdown/node_modules/remark-parse/index.js
|
|
19778
19842
|
|
|
19779
19843
|
|
|
19780
19844
|
/* harmony default export */ const remark_parse = (remarkParse);
|
|
@@ -20388,258 +20452,10 @@ function generated(node) {
|
|
|
20388
20452
|
)
|
|
20389
20453
|
}
|
|
20390
20454
|
|
|
20391
|
-
;// CONCATENATED MODULE: ../node_modules/mdast-util-definitions/node_modules/unist-util-visit-parents/color.browser.js
|
|
20392
|
-
/**
|
|
20393
|
-
* @param {string} d
|
|
20394
|
-
* @returns {string}
|
|
20395
|
-
*/
|
|
20396
|
-
function color_browser_color(d) {
|
|
20397
|
-
return d
|
|
20398
|
-
}
|
|
20399
|
-
|
|
20400
|
-
;// CONCATENATED MODULE: ../node_modules/mdast-util-definitions/node_modules/unist-util-visit-parents/index.js
|
|
20401
|
-
/**
|
|
20402
|
-
* @typedef {import('unist').Node} Node
|
|
20403
|
-
* @typedef {import('unist').Parent} Parent
|
|
20404
|
-
* @typedef {import('unist-util-is').Test} Test
|
|
20405
|
-
*/
|
|
20406
|
-
|
|
20407
|
-
/**
|
|
20408
|
-
* @typedef {CONTINUE|SKIP|EXIT} Action Union of the action types
|
|
20409
|
-
* @typedef {number} Index Move to the sibling at index next (after node itself is completely traversed). Useful if mutating the tree, such as removing the node the visitor is currently on, or any of its previous siblings (or next siblings, in case of reverse) Results less than 0 or greater than or equal to children.length stop traversing the parent
|
|
20410
|
-
* @typedef {[(Action|null|undefined|void)?, (Index|null|undefined)?]} ActionTuple List with one or two values, the first an action, the second an index.
|
|
20411
|
-
* @typedef {null|undefined|Action|Index|ActionTuple|void} VisitorResult Any value that can be returned from a visitor
|
|
20412
|
-
*/
|
|
20413
|
-
|
|
20414
|
-
/**
|
|
20415
|
-
* Invoked when a node (matching test, if given) is found.
|
|
20416
|
-
* Visitors are free to transform node.
|
|
20417
|
-
* They can also transform the parent of node (the last of ancestors).
|
|
20418
|
-
* Replacing node itself, if `SKIP` is not returned, still causes its descendants to be visited.
|
|
20419
|
-
* If adding or removing previous siblings (or next siblings, in case of reverse) of node,
|
|
20420
|
-
* visitor should return a new index (number) to specify the sibling to traverse after node is traversed.
|
|
20421
|
-
* Adding or removing next siblings of node (or previous siblings, in case of reverse)
|
|
20422
|
-
* is handled as expected without needing to return a new index.
|
|
20423
|
-
* Removing the children property of an ancestor still results in them being traversed.
|
|
20424
|
-
*
|
|
20425
|
-
* @template {Node} V
|
|
20426
|
-
* @callback Visitor
|
|
20427
|
-
* @param {V} node Found node
|
|
20428
|
-
* @param {Array.<Parent>} ancestors Ancestors of node
|
|
20429
|
-
* @returns {VisitorResult}
|
|
20430
|
-
*/
|
|
20431
|
-
|
|
20432
|
-
|
|
20433
|
-
|
|
20434
|
-
|
|
20435
|
-
/**
|
|
20436
|
-
* Continue traversing as normal
|
|
20437
|
-
*/
|
|
20438
|
-
const unist_util_visit_parents_CONTINUE = true
|
|
20439
|
-
/**
|
|
20440
|
-
* Do not traverse this node’s children
|
|
20441
|
-
*/
|
|
20442
|
-
const unist_util_visit_parents_SKIP = 'skip'
|
|
20443
|
-
/**
|
|
20444
|
-
* Stop traversing immediately
|
|
20445
|
-
*/
|
|
20446
|
-
const unist_util_visit_parents_EXIT = false
|
|
20447
|
-
|
|
20448
|
-
const unist_util_visit_parents_visitParents =
|
|
20449
|
-
/**
|
|
20450
|
-
* @type {(
|
|
20451
|
-
* (<T extends Node>(tree: Node, test: T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>|Array.<T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>>, visitor: Visitor<T>, reverse?: boolean) => void) &
|
|
20452
|
-
* ((tree: Node, test: Test, visitor: Visitor<Node>, reverse?: boolean) => void) &
|
|
20453
|
-
* ((tree: Node, visitor: Visitor<Node>, reverse?: boolean) => void)
|
|
20454
|
-
* )}
|
|
20455
|
-
*/
|
|
20456
|
-
(
|
|
20457
|
-
/**
|
|
20458
|
-
* Visit children of tree which pass a test
|
|
20459
|
-
*
|
|
20460
|
-
* @param {Node} tree Abstract syntax tree to walk
|
|
20461
|
-
* @param {Test} test test Test node
|
|
20462
|
-
* @param {Visitor<Node>} visitor Function to run for each node
|
|
20463
|
-
* @param {boolean} [reverse] Fisit the tree in reverse, defaults to false
|
|
20464
|
-
*/
|
|
20465
|
-
function (tree, test, visitor, reverse) {
|
|
20466
|
-
if (typeof test === 'function' && typeof visitor !== 'function') {
|
|
20467
|
-
reverse = visitor
|
|
20468
|
-
// @ts-ignore no visitor given, so `visitor` is test.
|
|
20469
|
-
visitor = test
|
|
20470
|
-
test = null
|
|
20471
|
-
}
|
|
20472
|
-
|
|
20473
|
-
var is = convert(test)
|
|
20474
|
-
var step = reverse ? -1 : 1
|
|
20475
|
-
|
|
20476
|
-
factory(tree, null, [])()
|
|
20477
|
-
|
|
20478
|
-
/**
|
|
20479
|
-
* @param {Node} node
|
|
20480
|
-
* @param {number?} index
|
|
20481
|
-
* @param {Array.<Parent>} parents
|
|
20482
|
-
*/
|
|
20483
|
-
function factory(node, index, parents) {
|
|
20484
|
-
/** @type {Object.<string, unknown>} */
|
|
20485
|
-
var value = typeof node === 'object' && node !== null ? node : {}
|
|
20486
|
-
/** @type {string} */
|
|
20487
|
-
var name
|
|
20488
|
-
|
|
20489
|
-
if (typeof value.type === 'string') {
|
|
20490
|
-
name =
|
|
20491
|
-
typeof value.tagName === 'string'
|
|
20492
|
-
? value.tagName
|
|
20493
|
-
: typeof value.name === 'string'
|
|
20494
|
-
? value.name
|
|
20495
|
-
: undefined
|
|
20496
|
-
|
|
20497
|
-
Object.defineProperty(visit, 'name', {
|
|
20498
|
-
value:
|
|
20499
|
-
'node (' +
|
|
20500
|
-
color_browser_color(value.type + (name ? '<' + name + '>' : '')) +
|
|
20501
|
-
')'
|
|
20502
|
-
})
|
|
20503
|
-
}
|
|
20504
|
-
|
|
20505
|
-
return visit
|
|
20506
|
-
|
|
20507
|
-
function visit() {
|
|
20508
|
-
/** @type {ActionTuple} */
|
|
20509
|
-
var result = []
|
|
20510
|
-
/** @type {ActionTuple} */
|
|
20511
|
-
var subresult
|
|
20512
|
-
/** @type {number} */
|
|
20513
|
-
var offset
|
|
20514
|
-
/** @type {Array.<Parent>} */
|
|
20515
|
-
var grandparents
|
|
20516
|
-
|
|
20517
|
-
if (!test || is(node, index, parents[parents.length - 1] || null)) {
|
|
20518
|
-
result = unist_util_visit_parents_toResult(visitor(node, parents))
|
|
20519
|
-
|
|
20520
|
-
if (result[0] === unist_util_visit_parents_EXIT) {
|
|
20521
|
-
return result
|
|
20522
|
-
}
|
|
20523
|
-
}
|
|
20524
|
-
|
|
20525
|
-
if (node.children && result[0] !== unist_util_visit_parents_SKIP) {
|
|
20526
|
-
// @ts-ignore looks like a parent.
|
|
20527
|
-
offset = (reverse ? node.children.length : -1) + step
|
|
20528
|
-
// @ts-ignore looks like a parent.
|
|
20529
|
-
grandparents = parents.concat(node)
|
|
20530
|
-
|
|
20531
|
-
// @ts-ignore looks like a parent.
|
|
20532
|
-
while (offset > -1 && offset < node.children.length) {
|
|
20533
|
-
subresult = factory(node.children[offset], offset, grandparents)()
|
|
20534
|
-
|
|
20535
|
-
if (subresult[0] === unist_util_visit_parents_EXIT) {
|
|
20536
|
-
return subresult
|
|
20537
|
-
}
|
|
20538
|
-
|
|
20539
|
-
offset =
|
|
20540
|
-
typeof subresult[1] === 'number' ? subresult[1] : offset + step
|
|
20541
|
-
}
|
|
20542
|
-
}
|
|
20543
|
-
|
|
20544
|
-
return result
|
|
20545
|
-
}
|
|
20546
|
-
}
|
|
20547
|
-
}
|
|
20548
|
-
)
|
|
20549
|
-
|
|
20550
|
-
/**
|
|
20551
|
-
* @param {VisitorResult} value
|
|
20552
|
-
* @returns {ActionTuple}
|
|
20553
|
-
*/
|
|
20554
|
-
function unist_util_visit_parents_toResult(value) {
|
|
20555
|
-
if (Array.isArray(value)) {
|
|
20556
|
-
return value
|
|
20557
|
-
}
|
|
20558
|
-
|
|
20559
|
-
if (typeof value === 'number') {
|
|
20560
|
-
return [unist_util_visit_parents_CONTINUE, value]
|
|
20561
|
-
}
|
|
20562
|
-
|
|
20563
|
-
return [value]
|
|
20564
|
-
}
|
|
20565
|
-
|
|
20566
|
-
;// CONCATENATED MODULE: ../node_modules/mdast-util-definitions/node_modules/unist-util-visit/index.js
|
|
20567
|
-
/**
|
|
20568
|
-
* @typedef {import('unist').Node} Node
|
|
20569
|
-
* @typedef {import('unist').Parent} Parent
|
|
20570
|
-
* @typedef {import('unist-util-is').Test} Test
|
|
20571
|
-
* @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult
|
|
20572
|
-
*/
|
|
20573
|
-
|
|
20574
|
-
/**
|
|
20575
|
-
* Invoked when a node (matching test, if given) is found.
|
|
20576
|
-
* Visitors are free to transform node.
|
|
20577
|
-
* They can also transform the parent of node (the last of ancestors).
|
|
20578
|
-
* Replacing node itself, if `SKIP` is not returned, still causes its descendants to be visited.
|
|
20579
|
-
* If adding or removing previous siblings (or next siblings, in case of reverse) of node,
|
|
20580
|
-
* visitor should return a new index (number) to specify the sibling to traverse after node is traversed.
|
|
20581
|
-
* Adding or removing next siblings of node (or previous siblings, in case of reverse)
|
|
20582
|
-
* is handled as expected without needing to return a new index.
|
|
20583
|
-
* Removing the children property of an ancestor still results in them being traversed.
|
|
20584
|
-
*
|
|
20585
|
-
* @template {Node} V
|
|
20586
|
-
* @callback Visitor
|
|
20587
|
-
* @param {V} node Found node
|
|
20588
|
-
* @param {number|null} index Position of `node` in `parent`
|
|
20589
|
-
* @param {Parent|null} parent Parent of `node`
|
|
20590
|
-
* @returns {VisitorResult}
|
|
20591
|
-
*/
|
|
20592
|
-
|
|
20593
|
-
|
|
20594
|
-
|
|
20595
|
-
|
|
20596
|
-
|
|
20597
|
-
const unist_util_visit_visit =
|
|
20598
|
-
/**
|
|
20599
|
-
* @type {(
|
|
20600
|
-
* (<T extends Node>(tree: Node, test: T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>|Array.<T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>>, visitor: Visitor<T>, reverse?: boolean) => void) &
|
|
20601
|
-
* ((tree: Node, test: Test, visitor: Visitor<Node>, reverse?: boolean) => void) &
|
|
20602
|
-
* ((tree: Node, visitor: Visitor<Node>, reverse?: boolean) => void)
|
|
20603
|
-
* )}
|
|
20604
|
-
*/
|
|
20605
|
-
(
|
|
20606
|
-
/**
|
|
20607
|
-
* Visit children of tree which pass a test
|
|
20608
|
-
*
|
|
20609
|
-
* @param {Node} tree Abstract syntax tree to walk
|
|
20610
|
-
* @param {Test} test test Test node
|
|
20611
|
-
* @param {Visitor<Node>} visitor Function to run for each node
|
|
20612
|
-
* @param {boolean} [reverse] Fisit the tree in reverse, defaults to false
|
|
20613
|
-
*/
|
|
20614
|
-
function (tree, test, visitor, reverse) {
|
|
20615
|
-
if (typeof test === 'function' && typeof visitor !== 'function') {
|
|
20616
|
-
reverse = visitor
|
|
20617
|
-
visitor = test
|
|
20618
|
-
test = null
|
|
20619
|
-
}
|
|
20620
|
-
|
|
20621
|
-
unist_util_visit_parents_visitParents(tree, test, overload, reverse)
|
|
20622
|
-
|
|
20623
|
-
/**
|
|
20624
|
-
* @param {Node} node
|
|
20625
|
-
* @param {Array.<Parent>} parents
|
|
20626
|
-
*/
|
|
20627
|
-
function overload(node, parents) {
|
|
20628
|
-
var parent = parents[parents.length - 1]
|
|
20629
|
-
return visitor(
|
|
20630
|
-
node,
|
|
20631
|
-
parent ? parent.children.indexOf(node) : null,
|
|
20632
|
-
parent
|
|
20633
|
-
)
|
|
20634
|
-
}
|
|
20635
|
-
}
|
|
20636
|
-
)
|
|
20637
|
-
|
|
20638
20455
|
;// CONCATENATED MODULE: ../node_modules/mdast-util-definitions/index.js
|
|
20639
20456
|
/**
|
|
20640
20457
|
* @typedef {import('mdast').Root|import('mdast').Content} Node
|
|
20641
20458
|
* @typedef {import('mdast').Definition} Definition
|
|
20642
|
-
* @typedef {import('unist-util-visit').Visitor<Definition>} DefinitionVisitor
|
|
20643
20459
|
*/
|
|
20644
20460
|
|
|
20645
20461
|
|
|
@@ -20647,36 +20463,36 @@ const unist_util_visit_visit =
|
|
|
20647
20463
|
const mdast_util_definitions_own = {}.hasOwnProperty
|
|
20648
20464
|
|
|
20649
20465
|
/**
|
|
20466
|
+
* Find definitions in `node`.
|
|
20467
|
+
* Uses CommonMark precedence, which means that earlier definitions are
|
|
20468
|
+
* preferred over duplicate later definitions.
|
|
20650
20469
|
*
|
|
20651
20470
|
* @param {Node} node
|
|
20652
20471
|
*/
|
|
20653
20472
|
function definitions(node) {
|
|
20654
|
-
/** @type {
|
|
20473
|
+
/** @type {Record<string, Definition>} */
|
|
20655
20474
|
const cache = Object.create(null)
|
|
20656
20475
|
|
|
20657
20476
|
if (!node || !node.type) {
|
|
20658
20477
|
throw new Error('mdast-util-definitions expected node')
|
|
20659
20478
|
}
|
|
20660
20479
|
|
|
20661
|
-
|
|
20662
|
-
|
|
20663
|
-
return getDefinition
|
|
20664
|
-
|
|
20665
|
-
/** @type {DefinitionVisitor} */
|
|
20666
|
-
function ondefinition(definition) {
|
|
20480
|
+
visit(node, 'definition', (definition) => {
|
|
20667
20481
|
const id = clean(definition.identifier)
|
|
20668
20482
|
if (id && !mdast_util_definitions_own.call(cache, id)) {
|
|
20669
20483
|
cache[id] = definition
|
|
20670
20484
|
}
|
|
20671
|
-
}
|
|
20485
|
+
})
|
|
20486
|
+
|
|
20487
|
+
return definition
|
|
20672
20488
|
|
|
20673
20489
|
/**
|
|
20674
|
-
* Get a node from the bound definition
|
|
20490
|
+
* Get a node from the bound definition cache.
|
|
20675
20491
|
*
|
|
20676
20492
|
* @param {string} identifier
|
|
20677
20493
|
* @returns {Definition|null}
|
|
20678
20494
|
*/
|
|
20679
|
-
function
|
|
20495
|
+
function definition(identifier) {
|
|
20680
20496
|
const id = clean(identifier)
|
|
20681
20497
|
return id && mdast_util_definitions_own.call(cache, id) ? cache[id] : null
|
|
20682
20498
|
}
|
|
@@ -21790,6 +21606,77 @@ function table(h, node) {
|
|
|
21790
21606
|
)
|
|
21791
21607
|
}
|
|
21792
21608
|
|
|
21609
|
+
;// CONCATENATED MODULE: ../node_modules/trim-lines/index.js
|
|
21610
|
+
const tab = 9 /* `\t` */
|
|
21611
|
+
const space = 32 /* ` ` */
|
|
21612
|
+
|
|
21613
|
+
/**
|
|
21614
|
+
* Remove initial and final spaces and tabs at the line breaks in `value`.
|
|
21615
|
+
* Does not trim initial and final spaces and tabs of the value itself.
|
|
21616
|
+
*
|
|
21617
|
+
* @param {string} value
|
|
21618
|
+
* Value to trim.
|
|
21619
|
+
* @returns {string}
|
|
21620
|
+
* Trimmed value.
|
|
21621
|
+
*/
|
|
21622
|
+
function trimLines(value) {
|
|
21623
|
+
const source = String(value)
|
|
21624
|
+
const search = /\r?\n|\r/g
|
|
21625
|
+
let match = search.exec(source)
|
|
21626
|
+
let last = 0
|
|
21627
|
+
/** @type {Array<string>} */
|
|
21628
|
+
const lines = []
|
|
21629
|
+
|
|
21630
|
+
while (match) {
|
|
21631
|
+
lines.push(
|
|
21632
|
+
trimLine(source.slice(last, match.index), last > 0, true),
|
|
21633
|
+
match[0]
|
|
21634
|
+
)
|
|
21635
|
+
|
|
21636
|
+
last = match.index + match[0].length
|
|
21637
|
+
match = search.exec(source)
|
|
21638
|
+
}
|
|
21639
|
+
|
|
21640
|
+
lines.push(trimLine(source.slice(last), last > 0, false))
|
|
21641
|
+
|
|
21642
|
+
return lines.join('')
|
|
21643
|
+
}
|
|
21644
|
+
|
|
21645
|
+
/**
|
|
21646
|
+
* @param {string} value
|
|
21647
|
+
* Line to trim.
|
|
21648
|
+
* @param {boolean} start
|
|
21649
|
+
* Whether to trim the start of the line.
|
|
21650
|
+
* @param {boolean} end
|
|
21651
|
+
* Whether to trim the end of the line.
|
|
21652
|
+
* @returns {string}
|
|
21653
|
+
* Trimmed line.
|
|
21654
|
+
*/
|
|
21655
|
+
function trimLine(value, start, end) {
|
|
21656
|
+
let startIndex = 0
|
|
21657
|
+
let endIndex = value.length
|
|
21658
|
+
|
|
21659
|
+
if (start) {
|
|
21660
|
+
let code = value.codePointAt(startIndex)
|
|
21661
|
+
|
|
21662
|
+
while (code === tab || code === space) {
|
|
21663
|
+
startIndex++
|
|
21664
|
+
code = value.codePointAt(startIndex)
|
|
21665
|
+
}
|
|
21666
|
+
}
|
|
21667
|
+
|
|
21668
|
+
if (end) {
|
|
21669
|
+
let code = value.codePointAt(endIndex - 1)
|
|
21670
|
+
|
|
21671
|
+
while (code === tab || code === space) {
|
|
21672
|
+
endIndex--
|
|
21673
|
+
code = value.codePointAt(endIndex - 1)
|
|
21674
|
+
}
|
|
21675
|
+
}
|
|
21676
|
+
|
|
21677
|
+
return endIndex > startIndex ? value.slice(startIndex, endIndex) : ''
|
|
21678
|
+
}
|
|
21679
|
+
|
|
21793
21680
|
;// CONCATENATED MODULE: ../node_modules/mdast-util-to-hast/lib/handlers/text.js
|
|
21794
21681
|
/**
|
|
21795
21682
|
* @typedef {import('mdast').Text} Text
|
|
@@ -21798,15 +21685,13 @@ function table(h, node) {
|
|
|
21798
21685
|
|
|
21799
21686
|
|
|
21800
21687
|
|
|
21688
|
+
|
|
21801
21689
|
/**
|
|
21802
21690
|
* @type {Handler}
|
|
21803
21691
|
* @param {Text} node
|
|
21804
21692
|
*/
|
|
21805
21693
|
function handlers_text_text(h, node) {
|
|
21806
|
-
return h.augment(
|
|
21807
|
-
node,
|
|
21808
|
-
u('text', String(node.value).replace(/[ \t]*(\r?\n|\r)[ \t]*/g, '$1'))
|
|
21809
|
-
)
|
|
21694
|
+
return h.augment(node, u('text', trimLines(String(node.value))))
|
|
21810
21695
|
}
|
|
21811
21696
|
|
|
21812
21697
|
;// CONCATENATED MODULE: ../node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js
|
|
@@ -22068,6 +21953,7 @@ function factory(tree, options) {
|
|
|
22068
21953
|
const ctx = 'type' in left ? left : {position: left}
|
|
22069
21954
|
|
|
22070
21955
|
if (!generated(ctx)) {
|
|
21956
|
+
// @ts-expect-error: fine.
|
|
22071
21957
|
right.position = {start: pointStart(ctx), end: pointEnd(ctx)}
|
|
22072
21958
|
}
|
|
22073
21959
|
}
|
|
@@ -26543,6 +26429,7 @@ const findAndReplace =
|
|
|
26543
26429
|
let start = 0
|
|
26544
26430
|
// @ts-expect-error: TS is wrong, some of these children can be text.
|
|
26545
26431
|
const index = parent.children.indexOf(node)
|
|
26432
|
+
let change = false
|
|
26546
26433
|
/** @type {Array<PhrasingContent>} */
|
|
26547
26434
|
let nodes = []
|
|
26548
26435
|
/** @type {number|undefined} */
|
|
@@ -26566,9 +26453,7 @@ const findAndReplace =
|
|
|
26566
26453
|
value = value.length > 0 ? {type: 'text', value} : undefined
|
|
26567
26454
|
}
|
|
26568
26455
|
|
|
26569
|
-
if (value
|
|
26570
|
-
position = undefined
|
|
26571
|
-
} else {
|
|
26456
|
+
if (value !== false) {
|
|
26572
26457
|
if (start !== position) {
|
|
26573
26458
|
nodes.push({
|
|
26574
26459
|
type: 'text',
|
|
@@ -26583,6 +26468,7 @@ const findAndReplace =
|
|
|
26583
26468
|
}
|
|
26584
26469
|
|
|
26585
26470
|
start = position + match[0].length
|
|
26471
|
+
change = true
|
|
26586
26472
|
}
|
|
26587
26473
|
|
|
26588
26474
|
if (!find.global) {
|
|
@@ -26592,14 +26478,14 @@ const findAndReplace =
|
|
|
26592
26478
|
match = find.exec(node.value)
|
|
26593
26479
|
}
|
|
26594
26480
|
|
|
26595
|
-
if (
|
|
26596
|
-
nodes = [node]
|
|
26597
|
-
} else {
|
|
26481
|
+
if (change) {
|
|
26598
26482
|
if (start < node.value.length) {
|
|
26599
26483
|
nodes.push({type: 'text', value: node.value.slice(start)})
|
|
26600
26484
|
}
|
|
26601
26485
|
|
|
26602
26486
|
parent.children.splice(index, 1, ...nodes)
|
|
26487
|
+
} else {
|
|
26488
|
+
nodes = [node]
|
|
26603
26489
|
}
|
|
26604
26490
|
|
|
26605
26491
|
return index + nodes.length
|
|
@@ -26902,7 +26788,7 @@ function mdast_util_gfm_autolink_literal_previous(match, email) {
|
|
|
26902
26788
|
)
|
|
26903
26789
|
}
|
|
26904
26790
|
|
|
26905
|
-
;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/association.js
|
|
26791
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/association.js
|
|
26906
26792
|
/**
|
|
26907
26793
|
* @typedef {import('mdast').Association} Association
|
|
26908
26794
|
*/
|
|
@@ -26932,7 +26818,7 @@ function association(node) {
|
|
|
26932
26818
|
return decodeString(node.identifier)
|
|
26933
26819
|
}
|
|
26934
26820
|
|
|
26935
|
-
;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/track.js
|
|
26821
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/track.js
|
|
26936
26822
|
/**
|
|
26937
26823
|
* @typedef {import('unist').Point} Point
|
|
26938
26824
|
* @typedef {import('../types.js').TrackFields} TrackFields
|
|
@@ -26991,7 +26877,7 @@ function track(options_) {
|
|
|
26991
26877
|
}
|
|
26992
26878
|
}
|
|
26993
26879
|
|
|
26994
|
-
;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/container-flow.js
|
|
26880
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/container-flow.js
|
|
26995
26881
|
/**
|
|
26996
26882
|
* @typedef {import('../types.js').Node} Node
|
|
26997
26883
|
* @typedef {import('../types.js').Parent} Parent
|
|
@@ -27074,7 +26960,7 @@ function containerFlow(parent, context, safeOptions) {
|
|
|
27074
26960
|
}
|
|
27075
26961
|
}
|
|
27076
26962
|
|
|
27077
|
-
;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/indent-lines.js
|
|
26963
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js
|
|
27078
26964
|
/**
|
|
27079
26965
|
* @callback Map
|
|
27080
26966
|
* @param {string} value
|
|
@@ -27117,7 +27003,7 @@ function indentLines(value, map) {
|
|
|
27117
27003
|
}
|
|
27118
27004
|
}
|
|
27119
27005
|
|
|
27120
|
-
;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js
|
|
27006
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js
|
|
27121
27007
|
/**
|
|
27122
27008
|
* @typedef {import('../types.js').Unsafe} Unsafe
|
|
27123
27009
|
*/
|
|
@@ -27144,7 +27030,7 @@ function patternCompile(pattern) {
|
|
|
27144
27030
|
return pattern._compiled
|
|
27145
27031
|
}
|
|
27146
27032
|
|
|
27147
|
-
;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
|
|
27033
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
|
|
27148
27034
|
/**
|
|
27149
27035
|
* @typedef {import('../types.js').Unsafe} Unsafe
|
|
27150
27036
|
*/
|
|
@@ -27187,7 +27073,7 @@ function listInScope(stack, list, none) {
|
|
|
27187
27073
|
return false
|
|
27188
27074
|
}
|
|
27189
27075
|
|
|
27190
|
-
;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/safe.js
|
|
27076
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown/lib/util/safe.js
|
|
27191
27077
|
/**
|
|
27192
27078
|
* @typedef {import('../types.js').Context} Context
|
|
27193
27079
|
* @typedef {import('../types.js').SafeOptions} SafeOptions
|
|
@@ -27520,7 +27406,66 @@ function gfmFootnoteToMarkdown() {
|
|
|
27520
27406
|
}
|
|
27521
27407
|
}
|
|
27522
27408
|
|
|
27523
|
-
;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/
|
|
27409
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-strikethrough/node_modules/mdast-util-to-markdown/lib/util/track.js
|
|
27410
|
+
/**
|
|
27411
|
+
* @typedef {import('unist').Point} Point
|
|
27412
|
+
* @typedef {import('../types.js').TrackFields} TrackFields
|
|
27413
|
+
*/
|
|
27414
|
+
|
|
27415
|
+
/**
|
|
27416
|
+
* Functions to track output positions.
|
|
27417
|
+
* This info isn’t used yet but suchs functionality allows line wrapping,
|
|
27418
|
+
* and theoretically source maps (though, is there practical use in that?).
|
|
27419
|
+
*
|
|
27420
|
+
* @param {TrackFields} options_
|
|
27421
|
+
*/
|
|
27422
|
+
function track_track(options_) {
|
|
27423
|
+
// Defaults are used to prevent crashes when older utilities somehow activate
|
|
27424
|
+
// this code.
|
|
27425
|
+
/* c8 ignore next 5 */
|
|
27426
|
+
const options = options_ || {}
|
|
27427
|
+
const now = options.now || {}
|
|
27428
|
+
let lineShift = options.lineShift || 0
|
|
27429
|
+
let line = now.line || 1
|
|
27430
|
+
let column = now.column || 1
|
|
27431
|
+
|
|
27432
|
+
return {move, current, shift}
|
|
27433
|
+
|
|
27434
|
+
/**
|
|
27435
|
+
* Get the current tracked info.
|
|
27436
|
+
*
|
|
27437
|
+
* @returns {{now: Point, lineShift: number}}
|
|
27438
|
+
*/
|
|
27439
|
+
function current() {
|
|
27440
|
+
return {now: {line, column}, lineShift}
|
|
27441
|
+
}
|
|
27442
|
+
|
|
27443
|
+
/**
|
|
27444
|
+
* Define an increased line shift (the typical indent for lines).
|
|
27445
|
+
*
|
|
27446
|
+
* @param {number} value
|
|
27447
|
+
*/
|
|
27448
|
+
function shift(value) {
|
|
27449
|
+
lineShift += value
|
|
27450
|
+
}
|
|
27451
|
+
|
|
27452
|
+
/**
|
|
27453
|
+
* Move past a string.
|
|
27454
|
+
*
|
|
27455
|
+
* @param {string} value
|
|
27456
|
+
* @returns {string}
|
|
27457
|
+
*/
|
|
27458
|
+
function move(value = '') {
|
|
27459
|
+
const chunks = value.split(/\r?\n|\r/g)
|
|
27460
|
+
const tail = chunks[chunks.length - 1]
|
|
27461
|
+
line += chunks.length - 1
|
|
27462
|
+
column =
|
|
27463
|
+
chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift
|
|
27464
|
+
return value
|
|
27465
|
+
}
|
|
27466
|
+
}
|
|
27467
|
+
|
|
27468
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-strikethrough/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
|
|
27524
27469
|
/**
|
|
27525
27470
|
* @typedef {import('../types.js').Node} Node
|
|
27526
27471
|
* @typedef {import('../types.js').Parent} Parent
|
|
@@ -27545,7 +27490,7 @@ function containerPhrasing(parent, context, safeOptions) {
|
|
|
27545
27490
|
let before = safeOptions.before
|
|
27546
27491
|
|
|
27547
27492
|
indexStack.push(-1)
|
|
27548
|
-
let tracker =
|
|
27493
|
+
let tracker = track_track(safeOptions)
|
|
27549
27494
|
|
|
27550
27495
|
while (++index < children.length) {
|
|
27551
27496
|
const child = children[index]
|
|
@@ -27587,7 +27532,7 @@ function containerPhrasing(parent, context, safeOptions) {
|
|
|
27587
27532
|
before = ' '
|
|
27588
27533
|
|
|
27589
27534
|
// To do: does this work to reset tracker?
|
|
27590
|
-
tracker =
|
|
27535
|
+
tracker = track_track(safeOptions)
|
|
27591
27536
|
tracker.move(results.join(''))
|
|
27592
27537
|
}
|
|
27593
27538
|
|
|
@@ -27651,7 +27596,7 @@ function exitStrikethrough(token) {
|
|
|
27651
27596
|
* @param {Delete} node
|
|
27652
27597
|
*/
|
|
27653
27598
|
function handleDelete(node, _, context, safeOptions) {
|
|
27654
|
-
const tracker =
|
|
27599
|
+
const tracker = track_track(safeOptions)
|
|
27655
27600
|
const exit = context.enter('emphasis')
|
|
27656
27601
|
let value = tracker.move('~~')
|
|
27657
27602
|
value += containerPhrasing(node, context, {
|
|
@@ -27669,7 +27614,182 @@ function peekDelete() {
|
|
|
27669
27614
|
return '~'
|
|
27670
27615
|
}
|
|
27671
27616
|
|
|
27672
|
-
;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/
|
|
27617
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-table/node_modules/mdast-util-to-markdown/lib/util/track.js
|
|
27618
|
+
/**
|
|
27619
|
+
* @typedef {import('unist').Point} Point
|
|
27620
|
+
* @typedef {import('../types.js').TrackFields} TrackFields
|
|
27621
|
+
*/
|
|
27622
|
+
|
|
27623
|
+
/**
|
|
27624
|
+
* Functions to track output positions.
|
|
27625
|
+
* This info isn’t used yet but suchs functionality allows line wrapping,
|
|
27626
|
+
* and theoretically source maps (though, is there practical use in that?).
|
|
27627
|
+
*
|
|
27628
|
+
* @param {TrackFields} options_
|
|
27629
|
+
*/
|
|
27630
|
+
function util_track_track(options_) {
|
|
27631
|
+
// Defaults are used to prevent crashes when older utilities somehow activate
|
|
27632
|
+
// this code.
|
|
27633
|
+
/* c8 ignore next 5 */
|
|
27634
|
+
const options = options_ || {}
|
|
27635
|
+
const now = options.now || {}
|
|
27636
|
+
let lineShift = options.lineShift || 0
|
|
27637
|
+
let line = now.line || 1
|
|
27638
|
+
let column = now.column || 1
|
|
27639
|
+
|
|
27640
|
+
return {move, current, shift}
|
|
27641
|
+
|
|
27642
|
+
/**
|
|
27643
|
+
* Get the current tracked info.
|
|
27644
|
+
*
|
|
27645
|
+
* @returns {{now: Point, lineShift: number}}
|
|
27646
|
+
*/
|
|
27647
|
+
function current() {
|
|
27648
|
+
return {now: {line, column}, lineShift}
|
|
27649
|
+
}
|
|
27650
|
+
|
|
27651
|
+
/**
|
|
27652
|
+
* Define an increased line shift (the typical indent for lines).
|
|
27653
|
+
*
|
|
27654
|
+
* @param {number} value
|
|
27655
|
+
*/
|
|
27656
|
+
function shift(value) {
|
|
27657
|
+
lineShift += value
|
|
27658
|
+
}
|
|
27659
|
+
|
|
27660
|
+
/**
|
|
27661
|
+
* Move past a string.
|
|
27662
|
+
*
|
|
27663
|
+
* @param {string} value
|
|
27664
|
+
* @returns {string}
|
|
27665
|
+
*/
|
|
27666
|
+
function move(value = '') {
|
|
27667
|
+
const chunks = value.split(/\r?\n|\r/g)
|
|
27668
|
+
const tail = chunks[chunks.length - 1]
|
|
27669
|
+
line += chunks.length - 1
|
|
27670
|
+
column =
|
|
27671
|
+
chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift
|
|
27672
|
+
return value
|
|
27673
|
+
}
|
|
27674
|
+
}
|
|
27675
|
+
|
|
27676
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-table/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
|
|
27677
|
+
/**
|
|
27678
|
+
* @typedef {import('../types.js').Node} Node
|
|
27679
|
+
* @typedef {import('../types.js').Parent} Parent
|
|
27680
|
+
* @typedef {import('../types.js').SafeOptions} SafeOptions
|
|
27681
|
+
* @typedef {import('../types.js').Context} Context
|
|
27682
|
+
*/
|
|
27683
|
+
|
|
27684
|
+
|
|
27685
|
+
|
|
27686
|
+
/**
|
|
27687
|
+
* @param {Parent} parent
|
|
27688
|
+
* @param {Context} context
|
|
27689
|
+
* @param {SafeOptions} safeOptions
|
|
27690
|
+
* @returns {string}
|
|
27691
|
+
*/
|
|
27692
|
+
function container_phrasing_containerPhrasing(parent, context, safeOptions) {
|
|
27693
|
+
const indexStack = context.indexStack
|
|
27694
|
+
const children = parent.children || []
|
|
27695
|
+
/** @type {Array<string>} */
|
|
27696
|
+
const results = []
|
|
27697
|
+
let index = -1
|
|
27698
|
+
let before = safeOptions.before
|
|
27699
|
+
|
|
27700
|
+
indexStack.push(-1)
|
|
27701
|
+
let tracker = util_track_track(safeOptions)
|
|
27702
|
+
|
|
27703
|
+
while (++index < children.length) {
|
|
27704
|
+
const child = children[index]
|
|
27705
|
+
/** @type {string} */
|
|
27706
|
+
let after
|
|
27707
|
+
|
|
27708
|
+
indexStack[indexStack.length - 1] = index
|
|
27709
|
+
|
|
27710
|
+
if (index + 1 < children.length) {
|
|
27711
|
+
// @ts-expect-error: hush, it’s actually a `zwitch`.
|
|
27712
|
+
let handle = context.handle.handlers[children[index + 1].type]
|
|
27713
|
+
if (handle && handle.peek) handle = handle.peek
|
|
27714
|
+
after = handle
|
|
27715
|
+
? handle(children[index + 1], parent, context, {
|
|
27716
|
+
before: '',
|
|
27717
|
+
after: '',
|
|
27718
|
+
...tracker.current()
|
|
27719
|
+
}).charAt(0)
|
|
27720
|
+
: ''
|
|
27721
|
+
} else {
|
|
27722
|
+
after = safeOptions.after
|
|
27723
|
+
}
|
|
27724
|
+
|
|
27725
|
+
// In some cases, html (text) can be found in phrasing right after an eol.
|
|
27726
|
+
// When we’d serialize that, in most cases that would be seen as html
|
|
27727
|
+
// (flow).
|
|
27728
|
+
// As we can’t escape or so to prevent it from happening, we take a somewhat
|
|
27729
|
+
// reasonable approach: replace that eol with a space.
|
|
27730
|
+
// See: <https://github.com/syntax-tree/mdast-util-to-markdown/issues/15>
|
|
27731
|
+
if (
|
|
27732
|
+
results.length > 0 &&
|
|
27733
|
+
(before === '\r' || before === '\n') &&
|
|
27734
|
+
child.type === 'html'
|
|
27735
|
+
) {
|
|
27736
|
+
results[results.length - 1] = results[results.length - 1].replace(
|
|
27737
|
+
/(\r?\n|\r)$/,
|
|
27738
|
+
' '
|
|
27739
|
+
)
|
|
27740
|
+
before = ' '
|
|
27741
|
+
|
|
27742
|
+
// To do: does this work to reset tracker?
|
|
27743
|
+
tracker = util_track_track(safeOptions)
|
|
27744
|
+
tracker.move(results.join(''))
|
|
27745
|
+
}
|
|
27746
|
+
|
|
27747
|
+
results.push(
|
|
27748
|
+
tracker.move(
|
|
27749
|
+
context.handle(child, parent, context, {
|
|
27750
|
+
...tracker.current(),
|
|
27751
|
+
before,
|
|
27752
|
+
after
|
|
27753
|
+
})
|
|
27754
|
+
)
|
|
27755
|
+
)
|
|
27756
|
+
|
|
27757
|
+
before = results[results.length - 1].slice(-1)
|
|
27758
|
+
}
|
|
27759
|
+
|
|
27760
|
+
indexStack.pop()
|
|
27761
|
+
|
|
27762
|
+
return results.join('')
|
|
27763
|
+
}
|
|
27764
|
+
|
|
27765
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-table/node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js
|
|
27766
|
+
/**
|
|
27767
|
+
* @typedef {import('../types.js').Unsafe} Unsafe
|
|
27768
|
+
*/
|
|
27769
|
+
|
|
27770
|
+
/**
|
|
27771
|
+
* @param {Unsafe} pattern
|
|
27772
|
+
* @returns {RegExp}
|
|
27773
|
+
*/
|
|
27774
|
+
function pattern_compile_patternCompile(pattern) {
|
|
27775
|
+
if (!pattern._compiled) {
|
|
27776
|
+
const before =
|
|
27777
|
+
(pattern.atBreak ? '[\\r\\n][\\t ]*' : '') +
|
|
27778
|
+
(pattern.before ? '(?:' + pattern.before + ')' : '')
|
|
27779
|
+
|
|
27780
|
+
pattern._compiled = new RegExp(
|
|
27781
|
+
(before ? '(' + before + ')' : '') +
|
|
27782
|
+
(/[|\\{}()[\]^$+*?.-]/.test(pattern.character) ? '\\' : '') +
|
|
27783
|
+
pattern.character +
|
|
27784
|
+
(pattern.after ? '(?:' + pattern.after + ')' : ''),
|
|
27785
|
+
'g'
|
|
27786
|
+
)
|
|
27787
|
+
}
|
|
27788
|
+
|
|
27789
|
+
return pattern._compiled
|
|
27790
|
+
}
|
|
27791
|
+
|
|
27792
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-table/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
|
|
27673
27793
|
/**
|
|
27674
27794
|
* @typedef {import('mdast').InlineCode} InlineCode
|
|
27675
27795
|
* @typedef {import('../types.js').Handle} Handle
|
|
@@ -27713,7 +27833,7 @@ function inline_code_inlineCode(node, _, context) {
|
|
|
27713
27833
|
// them out.
|
|
27714
27834
|
while (++index < context.unsafe.length) {
|
|
27715
27835
|
const pattern = context.unsafe[index]
|
|
27716
|
-
const expression =
|
|
27836
|
+
const expression = pattern_compile_patternCompile(pattern)
|
|
27717
27837
|
/** @type {RegExpExecArray|null} */
|
|
27718
27838
|
let match
|
|
27719
27839
|
|
|
@@ -28305,7 +28425,7 @@ function gfmTableToMarkdown(options) {
|
|
|
28305
28425
|
function handleTableCell(node, _, context, safeOptions) {
|
|
28306
28426
|
const exit = context.enter('tableCell')
|
|
28307
28427
|
const subexit = context.enter('phrasing')
|
|
28308
|
-
const value =
|
|
28428
|
+
const value = container_phrasing_containerPhrasing(node, context, {
|
|
28309
28429
|
...safeOptions,
|
|
28310
28430
|
before: around,
|
|
28311
28431
|
after: around
|
|
@@ -28397,7 +28517,7 @@ function gfmTableToMarkdown(options) {
|
|
|
28397
28517
|
}
|
|
28398
28518
|
}
|
|
28399
28519
|
|
|
28400
|
-
;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
|
|
28520
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
|
|
28401
28521
|
/**
|
|
28402
28522
|
* @typedef {import('../types.js').Context} Context
|
|
28403
28523
|
* @typedef {import('../types.js').Options} Options
|
|
@@ -28421,7 +28541,7 @@ function checkBullet(context) {
|
|
|
28421
28541
|
return marker
|
|
28422
28542
|
}
|
|
28423
28543
|
|
|
28424
|
-
;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
|
|
28544
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
|
|
28425
28545
|
/**
|
|
28426
28546
|
* @typedef {import('../types.js').Context} Context
|
|
28427
28547
|
* @typedef {import('../types.js').Options} Options
|
|
@@ -28451,7 +28571,192 @@ function checkListItemIndent(context) {
|
|
|
28451
28571
|
return style
|
|
28452
28572
|
}
|
|
28453
28573
|
|
|
28454
|
-
;// CONCATENATED MODULE: ../node_modules/mdast-util-to-markdown/lib/
|
|
28574
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown/lib/util/track.js
|
|
28575
|
+
/**
|
|
28576
|
+
* @typedef {import('unist').Point} Point
|
|
28577
|
+
* @typedef {import('../types.js').TrackFields} TrackFields
|
|
28578
|
+
*/
|
|
28579
|
+
|
|
28580
|
+
/**
|
|
28581
|
+
* Functions to track output positions.
|
|
28582
|
+
* This info isn’t used yet but suchs functionality allows line wrapping,
|
|
28583
|
+
* and theoretically source maps (though, is there practical use in that?).
|
|
28584
|
+
*
|
|
28585
|
+
* @param {TrackFields} options_
|
|
28586
|
+
*/
|
|
28587
|
+
function lib_util_track_track(options_) {
|
|
28588
|
+
// Defaults are used to prevent crashes when older utilities somehow activate
|
|
28589
|
+
// this code.
|
|
28590
|
+
/* c8 ignore next 5 */
|
|
28591
|
+
const options = options_ || {}
|
|
28592
|
+
const now = options.now || {}
|
|
28593
|
+
let lineShift = options.lineShift || 0
|
|
28594
|
+
let line = now.line || 1
|
|
28595
|
+
let column = now.column || 1
|
|
28596
|
+
|
|
28597
|
+
return {move, current, shift}
|
|
28598
|
+
|
|
28599
|
+
/**
|
|
28600
|
+
* Get the current tracked info.
|
|
28601
|
+
*
|
|
28602
|
+
* @returns {{now: Point, lineShift: number}}
|
|
28603
|
+
*/
|
|
28604
|
+
function current() {
|
|
28605
|
+
return {now: {line, column}, lineShift}
|
|
28606
|
+
}
|
|
28607
|
+
|
|
28608
|
+
/**
|
|
28609
|
+
* Define an increased line shift (the typical indent for lines).
|
|
28610
|
+
*
|
|
28611
|
+
* @param {number} value
|
|
28612
|
+
*/
|
|
28613
|
+
function shift(value) {
|
|
28614
|
+
lineShift += value
|
|
28615
|
+
}
|
|
28616
|
+
|
|
28617
|
+
/**
|
|
28618
|
+
* Move past a string.
|
|
28619
|
+
*
|
|
28620
|
+
* @param {string} value
|
|
28621
|
+
* @returns {string}
|
|
28622
|
+
*/
|
|
28623
|
+
function move(value = '') {
|
|
28624
|
+
const chunks = value.split(/\r?\n|\r/g)
|
|
28625
|
+
const tail = chunks[chunks.length - 1]
|
|
28626
|
+
line += chunks.length - 1
|
|
28627
|
+
column =
|
|
28628
|
+
chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift
|
|
28629
|
+
return value
|
|
28630
|
+
}
|
|
28631
|
+
}
|
|
28632
|
+
|
|
28633
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown/lib/util/container-flow.js
|
|
28634
|
+
/**
|
|
28635
|
+
* @typedef {import('../types.js').Node} Node
|
|
28636
|
+
* @typedef {import('../types.js').Parent} Parent
|
|
28637
|
+
* @typedef {import('../types.js').Join} Join
|
|
28638
|
+
* @typedef {import('../types.js').Context} Context
|
|
28639
|
+
* @typedef {import('../types.js').TrackFields} TrackFields
|
|
28640
|
+
*/
|
|
28641
|
+
|
|
28642
|
+
|
|
28643
|
+
|
|
28644
|
+
/**
|
|
28645
|
+
* @param {Parent} parent
|
|
28646
|
+
* @param {Context} context
|
|
28647
|
+
* @param {TrackFields} safeOptions
|
|
28648
|
+
* @returns {string}
|
|
28649
|
+
*/
|
|
28650
|
+
function container_flow_containerFlow(parent, context, safeOptions) {
|
|
28651
|
+
const indexStack = context.indexStack
|
|
28652
|
+
const children = parent.children || []
|
|
28653
|
+
const tracker = lib_util_track_track(safeOptions)
|
|
28654
|
+
/** @type {Array<string>} */
|
|
28655
|
+
const results = []
|
|
28656
|
+
let index = -1
|
|
28657
|
+
|
|
28658
|
+
indexStack.push(-1)
|
|
28659
|
+
|
|
28660
|
+
while (++index < children.length) {
|
|
28661
|
+
const child = children[index]
|
|
28662
|
+
|
|
28663
|
+
indexStack[indexStack.length - 1] = index
|
|
28664
|
+
|
|
28665
|
+
results.push(
|
|
28666
|
+
tracker.move(
|
|
28667
|
+
context.handle(child, parent, context, {
|
|
28668
|
+
before: '\n',
|
|
28669
|
+
after: '\n',
|
|
28670
|
+
...tracker.current()
|
|
28671
|
+
})
|
|
28672
|
+
)
|
|
28673
|
+
)
|
|
28674
|
+
|
|
28675
|
+
if (child.type !== 'list') {
|
|
28676
|
+
context.bulletLastUsed = undefined
|
|
28677
|
+
}
|
|
28678
|
+
|
|
28679
|
+
if (index < children.length - 1) {
|
|
28680
|
+
results.push(tracker.move(between(child, children[index + 1])))
|
|
28681
|
+
}
|
|
28682
|
+
}
|
|
28683
|
+
|
|
28684
|
+
indexStack.pop()
|
|
28685
|
+
|
|
28686
|
+
return results.join('')
|
|
28687
|
+
|
|
28688
|
+
/**
|
|
28689
|
+
* @param {Node} left
|
|
28690
|
+
* @param {Node} right
|
|
28691
|
+
* @returns {string}
|
|
28692
|
+
*/
|
|
28693
|
+
function between(left, right) {
|
|
28694
|
+
let index = context.join.length
|
|
28695
|
+
|
|
28696
|
+
while (index--) {
|
|
28697
|
+
const result = context.join[index](left, right, parent, context)
|
|
28698
|
+
|
|
28699
|
+
if (result === true || result === 1) {
|
|
28700
|
+
break
|
|
28701
|
+
}
|
|
28702
|
+
|
|
28703
|
+
if (typeof result === 'number') {
|
|
28704
|
+
return '\n'.repeat(1 + result)
|
|
28705
|
+
}
|
|
28706
|
+
|
|
28707
|
+
if (result === false) {
|
|
28708
|
+
return '\n\n<!---->\n\n'
|
|
28709
|
+
}
|
|
28710
|
+
}
|
|
28711
|
+
|
|
28712
|
+
return '\n\n'
|
|
28713
|
+
}
|
|
28714
|
+
}
|
|
28715
|
+
|
|
28716
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js
|
|
28717
|
+
/**
|
|
28718
|
+
* @callback Map
|
|
28719
|
+
* @param {string} value
|
|
28720
|
+
* @param {number} line
|
|
28721
|
+
* @param {boolean} blank
|
|
28722
|
+
* @returns {string}
|
|
28723
|
+
*/
|
|
28724
|
+
|
|
28725
|
+
const indent_lines_eol = /\r?\n|\r/g
|
|
28726
|
+
|
|
28727
|
+
/**
|
|
28728
|
+
* @param {string} value
|
|
28729
|
+
* @param {Map} map
|
|
28730
|
+
* @returns {string}
|
|
28731
|
+
*/
|
|
28732
|
+
function indent_lines_indentLines(value, map) {
|
|
28733
|
+
/** @type {Array<string>} */
|
|
28734
|
+
const result = []
|
|
28735
|
+
let start = 0
|
|
28736
|
+
let line = 0
|
|
28737
|
+
/** @type {RegExpExecArray|null} */
|
|
28738
|
+
let match
|
|
28739
|
+
|
|
28740
|
+
while ((match = indent_lines_eol.exec(value))) {
|
|
28741
|
+
one(value.slice(start, match.index))
|
|
28742
|
+
result.push(match[0])
|
|
28743
|
+
start = match.index + match[0].length
|
|
28744
|
+
line++
|
|
28745
|
+
}
|
|
28746
|
+
|
|
28747
|
+
one(value.slice(start))
|
|
28748
|
+
|
|
28749
|
+
return result.join('')
|
|
28750
|
+
|
|
28751
|
+
/**
|
|
28752
|
+
* @param {string} value
|
|
28753
|
+
*/
|
|
28754
|
+
function one(value) {
|
|
28755
|
+
result.push(map(value, line, !value))
|
|
28756
|
+
}
|
|
28757
|
+
}
|
|
28758
|
+
|
|
28759
|
+
;// CONCATENATED MODULE: ../node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown/lib/handle/list-item.js
|
|
28455
28760
|
/**
|
|
28456
28761
|
* @typedef {import('mdast').ListItem} ListItem
|
|
28457
28762
|
* @typedef {import('mdast').List} List
|
|
@@ -28496,12 +28801,12 @@ function list_item_listItem(node, parent, context, safeOptions) {
|
|
|
28496
28801
|
size = Math.ceil(size / 4) * 4
|
|
28497
28802
|
}
|
|
28498
28803
|
|
|
28499
|
-
const tracker =
|
|
28804
|
+
const tracker = lib_util_track_track(safeOptions)
|
|
28500
28805
|
tracker.move(bullet + ' '.repeat(size - bullet.length))
|
|
28501
28806
|
tracker.shift(size)
|
|
28502
28807
|
const exit = context.enter('listItem')
|
|
28503
|
-
const value =
|
|
28504
|
-
|
|
28808
|
+
const value = indent_lines_indentLines(
|
|
28809
|
+
container_flow_containerFlow(node, context, tracker.current()),
|
|
28505
28810
|
map
|
|
28506
28811
|
)
|
|
28507
28812
|
exit()
|
|
@@ -28610,7 +28915,7 @@ function listItemWithTaskListItem(node, parent, context, safeOptions) {
|
|
|
28610
28915
|
const checkable =
|
|
28611
28916
|
typeof node.checked === 'boolean' && head && head.type === 'paragraph'
|
|
28612
28917
|
const checkbox = '[' + (node.checked ? 'x' : ' ') + '] '
|
|
28613
|
-
const tracker =
|
|
28918
|
+
const tracker = lib_util_track_track(safeOptions)
|
|
28614
28919
|
|
|
28615
28920
|
if (checkable) {
|
|
28616
28921
|
tracker.move(checkbox)
|
|
@@ -30885,22 +31190,22 @@ const htmlVoidElements = [
|
|
|
30885
31190
|
* @typedef {Omit<Comment, 'value'> & {value: {stitch: Node}}} Stitch
|
|
30886
31191
|
*
|
|
30887
31192
|
* @typedef Options
|
|
30888
|
-
* @property {Array
|
|
31193
|
+
* @property {Array<string>} [passThrough]
|
|
30889
31194
|
* List of custom hast node types to pass through (keep) in hast.
|
|
30890
31195
|
* If the passed through nodes have children, those children are expected to
|
|
30891
31196
|
* be hast and will be handled.
|
|
30892
31197
|
*
|
|
30893
31198
|
* @typedef HiddenTokenizer
|
|
30894
|
-
* @property {Array
|
|
31199
|
+
* @property {Array<HiddenLocationTracker>} __mixins
|
|
30895
31200
|
* Way too simple, but works for us.
|
|
30896
31201
|
* @property {HiddenPreprocessor} preprocessor
|
|
30897
31202
|
* @property {(value: string) => void} write
|
|
30898
31203
|
* @property {() => number} _consume
|
|
30899
|
-
* @property {Array
|
|
31204
|
+
* @property {Array<HiddenToken>} tokenQueue
|
|
30900
31205
|
* @property {string} state
|
|
30901
31206
|
* @property {string} returnState
|
|
30902
31207
|
* @property {number} charRefCode
|
|
30903
|
-
* @property {Array
|
|
31208
|
+
* @property {Array<number>} tempBuff
|
|
30904
31209
|
* @property {Function} _flushCodePointsConsumedAsCharacterReference
|
|
30905
31210
|
* @property {string} lastStartTagName
|
|
30906
31211
|
* @property {number} consumedAfterSnapshot
|
|
@@ -30911,14 +31216,14 @@ const htmlVoidElements = [
|
|
|
30911
31216
|
* @property {Function} NAMED_CHARACTER_REFERENCE_STATE
|
|
30912
31217
|
* @property {Function} NUMERIC_CHARACTER_REFERENCE_END_STATE
|
|
30913
31218
|
*
|
|
30914
|
-
* @typedef {
|
|
31219
|
+
* @typedef {Record<string, unknown> & {location: P5Location}} HiddenToken
|
|
30915
31220
|
*
|
|
30916
31221
|
* @typedef HiddenPreprocessor
|
|
30917
31222
|
* @property {string|undefined} html
|
|
30918
31223
|
* @property {number} pos
|
|
30919
31224
|
* @property {number} lastGapPos
|
|
30920
31225
|
* @property {number} lastCharPos
|
|
30921
|
-
* @property {Array
|
|
31226
|
+
* @property {Array<number>} gapStack
|
|
30922
31227
|
* @property {boolean} skipNextNewLine
|
|
30923
31228
|
* @property {boolean} lastChunkWritten
|
|
30924
31229
|
* @property {boolean} endOfChunkHit
|
|
@@ -31080,6 +31385,8 @@ const raw =
|
|
|
31080
31385
|
|
|
31081
31386
|
one(tree)
|
|
31082
31387
|
|
|
31388
|
+
resetTokenizer()
|
|
31389
|
+
|
|
31083
31390
|
parser._adoptNodes(mock.childNodes[0], doc)
|
|
31084
31391
|
|
|
31085
31392
|
return doc
|
|
@@ -31102,11 +31409,13 @@ const raw =
|
|
|
31102
31409
|
|
|
31103
31410
|
one(tree)
|
|
31104
31411
|
|
|
31412
|
+
resetTokenizer()
|
|
31413
|
+
|
|
31105
31414
|
return doc
|
|
31106
31415
|
}
|
|
31107
31416
|
|
|
31108
31417
|
/**
|
|
31109
|
-
* @param {Content
|
|
31418
|
+
* @param {Array<Content>} nodes
|
|
31110
31419
|
* @returns {void}
|
|
31111
31420
|
*/
|
|
31112
31421
|
function all(nodes) {
|
|
@@ -31203,7 +31512,7 @@ const raw =
|
|
|
31203
31512
|
if (!locationTracker) throw new Error('Expected `locationTracker`')
|
|
31204
31513
|
|
|
31205
31514
|
// Reset preprocessor:
|
|
31206
|
-
// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/tokenizer/preprocessor.js>.
|
|
31515
|
+
// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/tokenizer/preprocessor.js#L17>.
|
|
31207
31516
|
preprocessor.html = undefined
|
|
31208
31517
|
preprocessor.pos = -1
|
|
31209
31518
|
preprocessor.lastGapPos = -1
|
|
@@ -31244,18 +31553,6 @@ const raw =
|
|
|
31244
31553
|
preprocessor.lastChunkWritten = true
|
|
31245
31554
|
tokenizer[tokenizer.state](tokenizer._consume())
|
|
31246
31555
|
}
|
|
31247
|
-
|
|
31248
|
-
// Process final characters if they’re still there after hibernating.
|
|
31249
|
-
// Similar to:
|
|
31250
|
-
// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/extensions/location-info/tokenizer-mixin.js#L95>.
|
|
31251
|
-
const token = tokenizer.currentCharacterToken
|
|
31252
|
-
|
|
31253
|
-
if (token) {
|
|
31254
|
-
token.location.endLine = posTracker.line
|
|
31255
|
-
token.location.endCol = posTracker.col + 1
|
|
31256
|
-
token.location.endOffset = posTracker.offset + 1
|
|
31257
|
-
parser._processToken(token)
|
|
31258
|
-
}
|
|
31259
31556
|
}
|
|
31260
31557
|
|
|
31261
31558
|
/**
|
|
@@ -31290,8 +31587,21 @@ const raw =
|
|
|
31290
31587
|
}
|
|
31291
31588
|
|
|
31292
31589
|
function resetTokenizer() {
|
|
31293
|
-
/* c8 ignore next */
|
|
31590
|
+
/* c8 ignore next 2 */
|
|
31294
31591
|
if (!tokenizer) throw new Error('Expected `tokenizer`')
|
|
31592
|
+
if (!posTracker) throw new Error('Expected `posTracker`')
|
|
31593
|
+
|
|
31594
|
+
// Process final characters if they’re still there after hibernating.
|
|
31595
|
+
// Similar to:
|
|
31596
|
+
// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/extensions/location-info/tokenizer-mixin.js#L95>.
|
|
31597
|
+
const token = tokenizer.currentCharacterToken
|
|
31598
|
+
|
|
31599
|
+
if (token) {
|
|
31600
|
+
token.location.endLine = posTracker.line
|
|
31601
|
+
token.location.endCol = posTracker.col + 1
|
|
31602
|
+
token.location.endOffset = posTracker.offset + 1
|
|
31603
|
+
parser._processToken(token)
|
|
31604
|
+
}
|
|
31295
31605
|
|
|
31296
31606
|
// Reset tokenizer:
|
|
31297
31607
|
// See: <https://github.com/inikulin/parse5/blob/9c683e1/packages/parse5/lib/tokenizer/index.js#L218-L234>.
|
|
@@ -31336,7 +31646,7 @@ function startTag(node) {
|
|
|
31336
31646
|
|
|
31337
31647
|
/**
|
|
31338
31648
|
* @param {Element} node
|
|
31339
|
-
* @returns {Array
|
|
31649
|
+
* @returns {Array<P5Attribute>}
|
|
31340
31650
|
*/
|
|
31341
31651
|
function attributes(node) {
|
|
31342
31652
|
return toParse5({
|
|
@@ -31546,6 +31856,36 @@ const rehypeAttrs = (options) => {
|
|
|
31546
31856
|
};
|
|
31547
31857
|
/* harmony default export */ const rehype_attr_lib = (rehypeAttrs);
|
|
31548
31858
|
|
|
31859
|
+
;// CONCATENATED MODULE: ../node_modules/rehype-ignore/lib/index.js
|
|
31860
|
+
|
|
31861
|
+
const rehypeIgnore = (options = {}) => {
|
|
31862
|
+
const { openDelimiter = 'rehype:ignore:start', closeDelimiter = 'rehype:ignore:end' } = options;
|
|
31863
|
+
return (tree) => {
|
|
31864
|
+
visit(tree, (node, index, parent) => {
|
|
31865
|
+
if (node.type === 'element' || node.type === 'root') {
|
|
31866
|
+
// const start = node.children.findIndex((item) => item.type === 'comment' && item.value === openDelimiter);
|
|
31867
|
+
// const end = node.children.findIndex((item) => item.type === 'comment' && item.value === closeDelimiter);
|
|
31868
|
+
// if (start > -1 && end > -1) {
|
|
31869
|
+
// node.children = node.children.filter((_, idx) => idx < start || idx > end);
|
|
31870
|
+
// }
|
|
31871
|
+
let start = false;
|
|
31872
|
+
node.children = node.children.filter((item) => {
|
|
31873
|
+
if (item.type === 'comment' && item.value.trim() === openDelimiter) {
|
|
31874
|
+
start = true;
|
|
31875
|
+
return false;
|
|
31876
|
+
}
|
|
31877
|
+
if (item.type === 'comment' && item.value.trim() === closeDelimiter) {
|
|
31878
|
+
start = false;
|
|
31879
|
+
return false;
|
|
31880
|
+
}
|
|
31881
|
+
return !start;
|
|
31882
|
+
});
|
|
31883
|
+
}
|
|
31884
|
+
});
|
|
31885
|
+
};
|
|
31886
|
+
};
|
|
31887
|
+
/* harmony default export */ const rehype_ignore_lib = (rehypeIgnore);
|
|
31888
|
+
|
|
31549
31889
|
;// CONCATENATED MODULE: ../node_modules/unist-util-filter/index.js
|
|
31550
31890
|
/**
|
|
31551
31891
|
* @typedef {import('unist').Node} Node
|
|
@@ -35922,7 +36262,7 @@ function vbnet(Prism) {
|
|
|
35922
36262
|
})
|
|
35923
36263
|
}
|
|
35924
36264
|
|
|
35925
|
-
;// CONCATENATED MODULE: ../node_modules/character-entities-legacy/index.js
|
|
36265
|
+
;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/character-entities-legacy/index.js
|
|
35926
36266
|
/**
|
|
35927
36267
|
* List of legacy HTML named character references that don’t need a trailing semicolon.
|
|
35928
36268
|
*
|
|
@@ -36037,7 +36377,7 @@ const characterEntitiesLegacy = [
|
|
|
36037
36377
|
'yuml'
|
|
36038
36378
|
]
|
|
36039
36379
|
|
|
36040
|
-
;// CONCATENATED MODULE: ../node_modules/character-reference-invalid/index.js
|
|
36380
|
+
;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/character-reference-invalid/index.js
|
|
36041
36381
|
/**
|
|
36042
36382
|
* Map of invalid numeric character references to their replacements, according to HTML.
|
|
36043
36383
|
*
|
|
@@ -36074,7 +36414,7 @@ const characterReferenceInvalid = {
|
|
|
36074
36414
|
159: 'Ÿ'
|
|
36075
36415
|
}
|
|
36076
36416
|
|
|
36077
|
-
;// CONCATENATED MODULE: ../node_modules/is-decimal/index.js
|
|
36417
|
+
;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/is-decimal/index.js
|
|
36078
36418
|
/**
|
|
36079
36419
|
* Check if the given character code, or the character code at the first
|
|
36080
36420
|
* character, is decimal.
|
|
@@ -36089,7 +36429,7 @@ function isDecimal(character) {
|
|
|
36089
36429
|
return code >= 48 && code <= 57 /* 0-9 */
|
|
36090
36430
|
}
|
|
36091
36431
|
|
|
36092
|
-
;// CONCATENATED MODULE: ../node_modules/is-hexadecimal/index.js
|
|
36432
|
+
;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/is-hexadecimal/index.js
|
|
36093
36433
|
/**
|
|
36094
36434
|
* Check if the given character code, or the character code at the first
|
|
36095
36435
|
* character, is hexadecimal.
|
|
@@ -36108,7 +36448,7 @@ function isHexadecimal(character) {
|
|
|
36108
36448
|
)
|
|
36109
36449
|
}
|
|
36110
36450
|
|
|
36111
|
-
;// CONCATENATED MODULE: ../node_modules/is-alphabetical/index.js
|
|
36451
|
+
;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/is-alphabetical/index.js
|
|
36112
36452
|
/**
|
|
36113
36453
|
* Check if the given character code, or the character code at the first
|
|
36114
36454
|
* character, is alphabetical.
|
|
@@ -36126,7 +36466,7 @@ function isAlphabetical(character) {
|
|
|
36126
36466
|
)
|
|
36127
36467
|
}
|
|
36128
36468
|
|
|
36129
|
-
;// CONCATENATED MODULE: ../node_modules/is-alphanumerical/index.js
|
|
36469
|
+
;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/is-alphanumerical/index.js
|
|
36130
36470
|
|
|
36131
36471
|
|
|
36132
36472
|
|
|
@@ -36141,7 +36481,7 @@ function isAlphanumerical(character) {
|
|
|
36141
36481
|
return isAlphabetical(character) || isDecimal(character)
|
|
36142
36482
|
}
|
|
36143
36483
|
|
|
36144
|
-
;// CONCATENATED MODULE: ../node_modules/parse-entities/lib/index.js
|
|
36484
|
+
;// CONCATENATED MODULE: ../node_modules/refractor/node_modules/parse-entities/lib/index.js
|
|
36145
36485
|
/**
|
|
36146
36486
|
* @typedef {import('unist').Point} Point
|
|
36147
36487
|
* @typedef {import('unist').Position} Position
|
|
@@ -57594,7 +57934,7 @@ refractor.register(zig)
|
|
|
57594
57934
|
|
|
57595
57935
|
|
|
57596
57936
|
;// CONCATENATED MODULE: ../node_modules/rehype-prism-plus/dist/rehype-prism-plus.es.js
|
|
57597
|
-
function a(){a=function(e,r){return new t(e,void 0,r)};var e=RegExp.prototype,r=new WeakMap;function t(e,n,i){var o=new RegExp(e,n);return r.set(o,i||r.get(e)),l(o,t.prototype)}function n(e,t){var n=r.get(t);return Object.keys(n).reduce(function(r,t){return r[t]=e[n[t]],r},Object.create(null))}return rehype_prism_plus_es_s(t,RegExp),t.prototype.exec=function(r){var t=e.exec.call(this,r);return t&&(t.groups=n(t,this)),t},t.prototype[Symbol.replace]=function(t,i){if("string"==typeof i){var o=r.get(this);return e[Symbol.replace].call(this,t,i.replace(/\$<([^>]+)>/g,function(e,r){return"$"+o[r]}))}if("function"==typeof i){var a=this;return e[Symbol.replace].call(this,t,function(){var e=arguments;return"object"!=typeof e[e.length-1]&&(e=[].slice.call(e)).push(n(e,a)),i.apply(this,e)})}return e[Symbol.replace].call(this,t,i)},a.apply(this,arguments)}function rehype_prism_plus_es_s(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&l(e,r)}function l(e,r){return l=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},l(e,r)}function rehype_prism_plus_es_u(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function rehype_prism_plus_es_c(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return rehype_prism_plus_es_u(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?rehype_prism_plus_es_u(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var p=function
|
|
57937
|
+
function a(){a=function(e,r){return new t(e,void 0,r)};var e=RegExp.prototype,r=new WeakMap;function t(e,n,i){var o=new RegExp(e,n);return r.set(o,i||r.get(e)),l(o,t.prototype)}function n(e,t){var n=r.get(t);return Object.keys(n).reduce(function(r,t){return r[t]=e[n[t]],r},Object.create(null))}return rehype_prism_plus_es_s(t,RegExp),t.prototype.exec=function(r){var t=e.exec.call(this,r);return t&&(t.groups=n(t,this)),t},t.prototype[Symbol.replace]=function(t,i){if("string"==typeof i){var o=r.get(this);return e[Symbol.replace].call(this,t,i.replace(/\$<([^>]+)>/g,function(e,r){return"$"+o[r]}))}if("function"==typeof i){var a=this;return e[Symbol.replace].call(this,t,function(){var e=arguments;return"object"!=typeof e[e.length-1]&&(e=[].slice.call(e)).push(n(e,a)),i.apply(this,e)})}return e[Symbol.replace].call(this,t,i)},a.apply(this,arguments)}function rehype_prism_plus_es_s(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&l(e,r)}function l(e,r){return l=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},l(e,r)}function rehype_prism_plus_es_u(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function rehype_prism_plus_es_c(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return rehype_prism_plus_es_u(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?rehype_prism_plus_es_u(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var p=function(i){return function(o){return void 0===o&&(o={}),function(r){visit(r,"element",s)};function s(e,s,l){if(l&&"pre"===l.tagName&&"code"===e.tagName){var u=e.data&&e.data.meta?e.data.meta:"";e.properties.className?"boolean"==typeof e.properties.className?e.properties.className=[]:Array.isArray(e.properties.className)||(e.properties.className=[e.properties.className]):e.properties.className=[],e.properties.className.push("code-highlight");var p,f,m=function(e){for(var r,t=rehype_prism_plus_es_c(e.properties.className);!(r=t()).done;){var n=r.value;if("language-"===n.slice(0,9))return n.slice(9).toLowerCase()}return null}(e);if(m)try{p=i.highlight(hast_util_to_string_toString(e),m),l.properties.className=(l.properties.className||[]).concat("language-"+m)}catch(r){if(!o.ignoreMissing||!/Unknown language/.test(r.message))throw r;p=e}else p=e;p.children=(f=1,function e(r){return r.reduce(function(r,t){if("text"===t.type){var n=t.value,i=(n.match(/\n/g)||"").length;if(0===i)t.position={start:{line:f,column:0},end:{line:f,column:0}},r.push(t);else for(var o,a=n.split("\n"),s=rehype_prism_plus_es_c(a.entries());!(o=s()).done;){var l=o.value,u=l[0],p=l[1];r.push({type:"text",value:u===a.length-1?p:p+"\n",position:{start:{line:f+u},end:{line:f+u}}})}return f+=i,r}if(Object.prototype.hasOwnProperty.call(t,"children")){var m=f;return t.children=e(t.children),r.push(t),t.position={start:{line:m,column:0},end:{line:f,column:0}},r}return r.push(t),r},[])})(p.children),p.position=p.children.length>0?{start:{line:p.children[0].position.start.line,column:0},end:{line:p.children[p.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var h,d=function(e){var r=/{([\d,-]+)}/,t=e.split(",").map(function(e){return e.trim()}).join();if(r.test(t)){var i=r.exec(t)[1],o=parse_numeric_range(i);return function(e){return o.includes(e+1)}}return function(){return!1}}(u),g=function(e){var r=/*#__PURE__*/a(/showLineNumbers=([0-9]+)/i,{lines:1});if(r.test(e)){var t=r.exec(e);return Number(t.groups.lines)}return 1}(u),y=function(e){for(var r=new Array(e),t=0;t<e;t++)r[t]={type:"element",tagName:"span",properties:{className:[]},children:[]};return r}(p.position.end.line),v=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],b=function(){var e=h.value,n=e[0],i=e[1];i.properties.className=["code-line"];var a=filter(p,function(e){return e.position.start.line<=n+1&&e.position.end.line>=n+1});i.children=a.children,!u.toLowerCase().includes("showLineNumbers".toLowerCase())&&!o.showLineNumbers||v.some(function(e){return u.toLowerCase().includes(e)})||(i.properties.line=[(n+g).toString()],i.properties.className.push("line-number")),d(n)&&i.properties.className.push("highlight-line"),"diff"===m&&"-"===hast_util_to_string_toString(i).substring(0,1)?i.properties.className.push("deleted"):"diff"===m&&"+"===hast_util_to_string_toString(i).substring(0,1)&&i.properties.className.push("inserted")},w=rehype_prism_plus_es_c(y.entries());!(h=w()).done;)b();y.length>0&&""===hast_util_to_string_toString(y[y.length-1]).trim()&&y.pop(),e.children=y}}}},f=p(refractor),m=p(refractor);
|
|
57598
57938
|
//# sourceMappingURL=rehype-prism-plus.es.js.map
|
|
57599
57939
|
|
|
57600
57940
|
;// CONCATENATED MODULE: ../node_modules/direction/index.js
|
|
@@ -59774,7 +60114,7 @@ var octiconLink = {
|
|
|
59774
60114
|
};
|
|
59775
60115
|
|
|
59776
60116
|
// EXTERNAL MODULE: ../node_modules/@uiw/copy-to-clipboard/dist/copy-to-clipboard.umd.js
|
|
59777
|
-
var copy_to_clipboard_umd = __webpack_require__(
|
|
60117
|
+
var copy_to_clipboard_umd = __webpack_require__(71);
|
|
59778
60118
|
var copy_to_clipboard_umd_default = /*#__PURE__*/__webpack_require__.n(copy_to_clipboard_umd);
|
|
59779
60119
|
;// CONCATENATED MODULE: ../node_modules/@uiw/react-markdown-preview/esm/nodes/copy.js
|
|
59780
60120
|
|
|
@@ -59879,7 +60219,8 @@ var jsx_runtime = __webpack_require__(605);
|
|
|
59879
60219
|
;// CONCATENATED MODULE: ../node_modules/@uiw/react-markdown-preview/esm/index.js
|
|
59880
60220
|
|
|
59881
60221
|
|
|
59882
|
-
var _excluded = ["prefixCls", "className", "source", "style", "disableCopy", "onScroll", "onMouseOver", "pluginsFilter", "warpperElement"];
|
|
60222
|
+
var _excluded = ["prefixCls", "className", "source", "style", "disableCopy", "onScroll", "onMouseOver", "pluginsFilter", "rehypeRewrite", "warpperElement"];
|
|
60223
|
+
|
|
59883
60224
|
|
|
59884
60225
|
|
|
59885
60226
|
|
|
@@ -59904,6 +60245,7 @@ var _excluded = ["prefixCls", "className", "source", "style", "disableCopy", "on
|
|
|
59904
60245
|
onScroll,
|
|
59905
60246
|
onMouseOver,
|
|
59906
60247
|
pluginsFilter,
|
|
60248
|
+
rehypeRewrite: rewrite,
|
|
59907
60249
|
warpperElement = {}
|
|
59908
60250
|
} = props,
|
|
59909
60251
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -59930,15 +60272,26 @@ var _excluded = ["prefixCls", "className", "source", "style", "disableCopy", "on
|
|
|
59930
60272
|
var code = getCodeString(node.children);
|
|
59931
60273
|
node.children.push(copyElement(code));
|
|
59932
60274
|
}
|
|
60275
|
+
|
|
60276
|
+
rewrite && rewrite(node, index, parent);
|
|
59933
60277
|
};
|
|
59934
60278
|
|
|
59935
|
-
var rehypePlugins = [reservedMeta, [
|
|
60279
|
+
var rehypePlugins = [reservedMeta, [m, {
|
|
59936
60280
|
ignoreMissing: true
|
|
59937
|
-
}], rehypeRaw, rehypeSlug, rehypeAutolinkHeadings, [rehype_rewrite_lib, {
|
|
60281
|
+
}], rehypeRaw, rehypeSlug, rehypeAutolinkHeadings, rehype_ignore_lib, [rehype_rewrite_lib, {
|
|
59938
60282
|
rewrite: rehypeRewriteHandle
|
|
59939
60283
|
}], [rehype_attr_lib, {
|
|
59940
60284
|
properties: 'attr'
|
|
59941
60285
|
}], ...(other.rehypePlugins || [])];
|
|
60286
|
+
var customProps = {
|
|
60287
|
+
allowElement: (element, index, parent) => {
|
|
60288
|
+
if (other.allowElement) {
|
|
60289
|
+
return other.allowElement(element, index, parent);
|
|
60290
|
+
}
|
|
60291
|
+
|
|
60292
|
+
return /^[A-Za-z0-9]+$/.test(element.tagName);
|
|
60293
|
+
}
|
|
60294
|
+
};
|
|
59942
60295
|
var remarkPlugins = [...(other.remarkPlugins || []), remarkGfm];
|
|
59943
60296
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", _extends({
|
|
59944
60297
|
ref: mdp,
|
|
@@ -59947,7 +60300,7 @@ var _excluded = ["prefixCls", "className", "source", "style", "disableCopy", "on
|
|
|
59947
60300
|
}, warpperElement, {
|
|
59948
60301
|
className: cls,
|
|
59949
60302
|
style: style,
|
|
59950
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ReactMarkdown, _extends({}, other, {
|
|
60303
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ReactMarkdown, _extends({}, other, customProps, {
|
|
59951
60304
|
rehypePlugins: pluginsFilter ? pluginsFilter('rehype', rehypePlugins) : rehypePlugins,
|
|
59952
60305
|
remarkPlugins: pluginsFilter ? pluginsFilter('remark', remarkPlugins) : remarkPlugins,
|
|
59953
60306
|
children: source || ''
|
|
@@ -60955,6 +61308,121 @@ function toDecimal(code, next, omit) {
|
|
|
60955
61308
|
: value + ';'
|
|
60956
61309
|
}
|
|
60957
61310
|
|
|
61311
|
+
;// CONCATENATED MODULE: ../node_modules/stringify-entities/node_modules/character-entities-legacy/index.js
|
|
61312
|
+
/**
|
|
61313
|
+
* List of legacy HTML named character references that don’t need a trailing semicolon.
|
|
61314
|
+
*
|
|
61315
|
+
* @type {Array<string>}
|
|
61316
|
+
*/
|
|
61317
|
+
const character_entities_legacy_characterEntitiesLegacy = [
|
|
61318
|
+
'AElig',
|
|
61319
|
+
'AMP',
|
|
61320
|
+
'Aacute',
|
|
61321
|
+
'Acirc',
|
|
61322
|
+
'Agrave',
|
|
61323
|
+
'Aring',
|
|
61324
|
+
'Atilde',
|
|
61325
|
+
'Auml',
|
|
61326
|
+
'COPY',
|
|
61327
|
+
'Ccedil',
|
|
61328
|
+
'ETH',
|
|
61329
|
+
'Eacute',
|
|
61330
|
+
'Ecirc',
|
|
61331
|
+
'Egrave',
|
|
61332
|
+
'Euml',
|
|
61333
|
+
'GT',
|
|
61334
|
+
'Iacute',
|
|
61335
|
+
'Icirc',
|
|
61336
|
+
'Igrave',
|
|
61337
|
+
'Iuml',
|
|
61338
|
+
'LT',
|
|
61339
|
+
'Ntilde',
|
|
61340
|
+
'Oacute',
|
|
61341
|
+
'Ocirc',
|
|
61342
|
+
'Ograve',
|
|
61343
|
+
'Oslash',
|
|
61344
|
+
'Otilde',
|
|
61345
|
+
'Ouml',
|
|
61346
|
+
'QUOT',
|
|
61347
|
+
'REG',
|
|
61348
|
+
'THORN',
|
|
61349
|
+
'Uacute',
|
|
61350
|
+
'Ucirc',
|
|
61351
|
+
'Ugrave',
|
|
61352
|
+
'Uuml',
|
|
61353
|
+
'Yacute',
|
|
61354
|
+
'aacute',
|
|
61355
|
+
'acirc',
|
|
61356
|
+
'acute',
|
|
61357
|
+
'aelig',
|
|
61358
|
+
'agrave',
|
|
61359
|
+
'amp',
|
|
61360
|
+
'aring',
|
|
61361
|
+
'atilde',
|
|
61362
|
+
'auml',
|
|
61363
|
+
'brvbar',
|
|
61364
|
+
'ccedil',
|
|
61365
|
+
'cedil',
|
|
61366
|
+
'cent',
|
|
61367
|
+
'copy',
|
|
61368
|
+
'curren',
|
|
61369
|
+
'deg',
|
|
61370
|
+
'divide',
|
|
61371
|
+
'eacute',
|
|
61372
|
+
'ecirc',
|
|
61373
|
+
'egrave',
|
|
61374
|
+
'eth',
|
|
61375
|
+
'euml',
|
|
61376
|
+
'frac12',
|
|
61377
|
+
'frac14',
|
|
61378
|
+
'frac34',
|
|
61379
|
+
'gt',
|
|
61380
|
+
'iacute',
|
|
61381
|
+
'icirc',
|
|
61382
|
+
'iexcl',
|
|
61383
|
+
'igrave',
|
|
61384
|
+
'iquest',
|
|
61385
|
+
'iuml',
|
|
61386
|
+
'laquo',
|
|
61387
|
+
'lt',
|
|
61388
|
+
'macr',
|
|
61389
|
+
'micro',
|
|
61390
|
+
'middot',
|
|
61391
|
+
'nbsp',
|
|
61392
|
+
'not',
|
|
61393
|
+
'ntilde',
|
|
61394
|
+
'oacute',
|
|
61395
|
+
'ocirc',
|
|
61396
|
+
'ograve',
|
|
61397
|
+
'ordf',
|
|
61398
|
+
'ordm',
|
|
61399
|
+
'oslash',
|
|
61400
|
+
'otilde',
|
|
61401
|
+
'ouml',
|
|
61402
|
+
'para',
|
|
61403
|
+
'plusmn',
|
|
61404
|
+
'pound',
|
|
61405
|
+
'quot',
|
|
61406
|
+
'raquo',
|
|
61407
|
+
'reg',
|
|
61408
|
+
'sect',
|
|
61409
|
+
'shy',
|
|
61410
|
+
'sup1',
|
|
61411
|
+
'sup2',
|
|
61412
|
+
'sup3',
|
|
61413
|
+
'szlig',
|
|
61414
|
+
'thorn',
|
|
61415
|
+
'times',
|
|
61416
|
+
'uacute',
|
|
61417
|
+
'ucirc',
|
|
61418
|
+
'ugrave',
|
|
61419
|
+
'uml',
|
|
61420
|
+
'uuml',
|
|
61421
|
+
'yacute',
|
|
61422
|
+
'yen',
|
|
61423
|
+
'yuml'
|
|
61424
|
+
]
|
|
61425
|
+
|
|
60958
61426
|
;// CONCATENATED MODULE: ../node_modules/character-entities-html4/index.js
|
|
60959
61427
|
/**
|
|
60960
61428
|
* Map of named character references from HTML 4.
|
|
@@ -61275,7 +61743,7 @@ function toNamed(code, next, omit, attribute) {
|
|
|
61275
61743
|
|
|
61276
61744
|
if (
|
|
61277
61745
|
omit &&
|
|
61278
|
-
|
|
61746
|
+
character_entities_legacy_characterEntitiesLegacy.includes(name) &&
|
|
61279
61747
|
!dangerous.includes(name) &&
|
|
61280
61748
|
(!attribute ||
|
|
61281
61749
|
(next &&
|
|
@@ -61892,7 +62360,7 @@ const rehype = unified().use(rehypeParse).use(rehypeStringify).freeze()
|
|
|
61892
62360
|
|
|
61893
62361
|
;// CONCATENATED MODULE: ./src/components/TextArea/Markdown.tsx
|
|
61894
62362
|
function html2Escape(sHtml){return sHtml.replace(/```(tsx?|jsx?|html|xml)(.*)\s+([\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
|
|
61895
|
-
},[]);return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){if(!markdown){return/*#__PURE__*/(0,jsx_runtime.jsx)("pre",{ref:preRef,className:"".concat(prefixCls,"-text-pre wmde-markdown-color")});}var mdStr="<pre class=\"language-markdown ".concat(prefixCls,"-text-pre wmde-markdown-color\"><code class=\"language-markdown\">").concat(html2Escape(markdown),"\n</code></pre>");if(highlightEnable){try{mdStr=rehype().data('settings',{fragment:true}).use(
|
|
62363
|
+
},[]);return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){if(!markdown){return/*#__PURE__*/(0,jsx_runtime.jsx)("pre",{ref:preRef,className:"".concat(prefixCls,"-text-pre wmde-markdown-color")});}var mdStr="<pre class=\"language-markdown ".concat(prefixCls,"-text-pre wmde-markdown-color\"><code class=\"language-markdown\">").concat(html2Escape(markdown),"\n</code></pre>");if(highlightEnable){try{mdStr=rehype().data('settings',{fragment:true}).use(m,{ignoreMissing:true}).processSync(mdStr).toString();}catch(error){}}return/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement('div',{className:'wmde-markdown-color',dangerouslySetInnerHTML:{__html:mdStr||''}});},[markdown,preRef,prefixCls]);}
|
|
61896
62364
|
;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
|
61897
62365
|
|
|
61898
62366
|
function _arrayWithoutHoles(arr) {
|
|
@@ -62114,7 +62582,7 @@ function Child_Child(props){var _ref=props||{},prefixCls=_ref.prefixCls,groupNam
|
|
|
62114
62582
|
function ToolbarItems(props){var prefixCls=props.prefixCls,overflow=props.overflow;var _useContext=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(EditorContext),fullscreen=_useContext.fullscreen,preview=_useContext.preview,_useContext$barPopup=_useContext.barPopup,barPopup=_useContext$barPopup===void 0?{}:_useContext$barPopup,commandOrchestrator=_useContext.commandOrchestrator,dispatch=_useContext.dispatch;var originalOverflow=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)('');function handleClick(command,name){if(!dispatch)return;var state={barPopup:_objectSpread2({},barPopup)};if(command.keyCommand==='preview'){state.preview=command.value;}if(command.keyCommand==='fullscreen'){state.fullscreen=!fullscreen;}if(props.commands&&command.keyCommand==='group'){props.commands.forEach(function(item){if(name===item.groupName){state.barPopup[name]=true;}else if(item.keyCommand){state.barPopup[item.groupName]=false;}});}else if(name||command.parent){Object.keys(state.barPopup||{}).forEach(function(keyName){state.barPopup[keyName]=false;});}if(Object.keys(state).length){dispatch(_objectSpread2({},state));}commandOrchestrator&&commandOrchestrator.executeCommand(command);}(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){if(document&&overflow){if(fullscreen){// prevent scroll on fullscreen
|
|
62115
62583
|
document.body.style.overflow='hidden';}else{// get the original overflow only the first time
|
|
62116
62584
|
if(!originalOverflow.current){originalOverflow.current=window.getComputedStyle(document.body,null).overflow;}// reset to the original overflow
|
|
62117
|
-
document.body.style.overflow=originalOverflow.current;}}},[fullscreen,originalOverflow,overflow]);return/*#__PURE__*/(0,jsx_runtime.jsx)("ul",{children:(props.commands||[]).map(function(item,idx){if(item.keyCommand==='divider'){return/*#__PURE__*/(0,jsx_runtime.jsx)("li",_objectSpread2(_objectSpread2({},item.liProps),{},{className:"".concat(prefixCls,"-toolbar-divider")}),idx);}if(!item.keyCommand)return/*#__PURE__*/(0,jsx_runtime.jsx)(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment,{},idx);var activeBtn=fullscreen&&item.keyCommand==='fullscreen'||item.keyCommand==='preview'&&preview===item.value;var childNode=item.children&&typeof item.children==='function'?item.children({getState:function getState(){return commandOrchestrator.getState();},textApi:commandOrchestrator?commandOrchestrator.textApi:undefined,close:function close(){return handleClick({},item.groupName);},execute:function execute(){return handleClick({execute:item.execute});}}):undefined;var disabled=barPopup&&preview&&preview==='preview'&&!/(preview|fullscreen)/.test(item.keyCommand);return/*#__PURE__*/(0,jsx_runtime.jsxs)("li",_objectSpread2(_objectSpread2({},item.liProps),{},{className:activeBtn?"active":'',children:[
|
|
62585
|
+
document.body.style.overflow=originalOverflow.current;}}},[fullscreen,originalOverflow,overflow]);return/*#__PURE__*/(0,jsx_runtime.jsx)("ul",{children:(props.commands||[]).map(function(item,idx){if(item.keyCommand==='divider'){return/*#__PURE__*/(0,jsx_runtime.jsx)("li",_objectSpread2(_objectSpread2({},item.liProps),{},{className:"".concat(prefixCls,"-toolbar-divider")}),idx);}if(!item.keyCommand)return/*#__PURE__*/(0,jsx_runtime.jsx)(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment,{},idx);var activeBtn=fullscreen&&item.keyCommand==='fullscreen'||item.keyCommand==='preview'&&preview===item.value;var childNode=item.children&&typeof item.children==='function'?item.children({getState:function getState(){return commandOrchestrator.getState();},textApi:commandOrchestrator?commandOrchestrator.textApi:undefined,close:function close(){return handleClick({},item.groupName);},execute:function execute(){return handleClick({execute:item.execute});}}):undefined;var disabled=barPopup&&preview&&preview==='preview'&&!/(preview|fullscreen)/.test(item.keyCommand);return/*#__PURE__*/(0,jsx_runtime.jsxs)("li",_objectSpread2(_objectSpread2({},item.liProps),{},{className:activeBtn?"active":'',children:[item.render&&typeof item.render==='function'&&item.render(item,!!disabled,handleClick,idx),!item.render&&!item.buttonProps&&item.icon,!item.render&&item.buttonProps&&/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement('button',_objectSpread2(_objectSpread2({type:'button',key:idx,disabled:disabled,'data-name':item.name},item.buttonProps),{},{onClick:function onClick(evn){evn.stopPropagation();handleClick(item,item.groupName);}}),item.icon),item.children&&/*#__PURE__*/(0,jsx_runtime.jsx)(Child_Child,{overflow:overflow,groupName:item.groupName,prefixCls:prefixCls,children:childNode,commands:Array.isArray(item.children)?item.children:undefined})]}),idx);})});}function Toolbar_Toolbar(){var props=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var prefixCls=props.prefixCls,_props$height=props.height,height=_props$height===void 0?29:_props$height,toolbarBottom=props.toolbarBottom,isChild=props.isChild;var _useContext2=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(EditorContext),commands=_useContext2.commands,extraCommands=_useContext2.extraCommands;var bottomClassName=toolbarBottom?'bottom':'';return/*#__PURE__*/(0,jsx_runtime.jsxs)("div",{className:"".concat(prefixCls,"-toolbar ").concat(bottomClassName),style:{height:height},children:[/*#__PURE__*/(0,jsx_runtime.jsx)(ToolbarItems,_objectSpread2(_objectSpread2({},props),{},{commands:props.commands||commands||[]})),!isChild&&/*#__PURE__*/(0,jsx_runtime.jsx)(ToolbarItems,_objectSpread2(_objectSpread2({},props),{},{commands:extraCommands||[]}))]});}
|
|
62118
62586
|
;// CONCATENATED MODULE: ./src/components/DragBar/index.less
|
|
62119
62587
|
// extracted by mini-css-extract-plugin
|
|
62120
62588
|
/* harmony default export */ const DragBar = ({});
|
|
@@ -62132,7 +62600,7 @@ var Editor_excluded=["prefixCls","className","value","commands","commandsFilter"
|
|
|
62132
62600
|
[highlightEnable]);// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62133
62601
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return autoFocus!==state.autoFocus&&dispatch({autoFocus:autoFocus});},[autoFocus]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return fullscreen!==state.fullscreen&&dispatch({fullscreen:fullscreen});},// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62134
62602
|
[fullscreen]);// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62135
|
-
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return height!==state.height&&dispatch({height:height});},[height]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return height!==state.height&&onHeightChange&&onHeightChange(state.height,height,state);},[height,onHeightChange,state]);var textareaDomRef=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();var active=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)('preview');var initScroll=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){textareaDomRef.current=state.textareaWarp;if(state.textareaWarp){state.textareaWarp.addEventListener('mouseover',function(){active.current='text';});state.textareaWarp.addEventListener('mouseleave',function(){active.current='preview';});}},[state.textareaWarp]);var handleScroll=function handleScroll(e,type){if(!enableScrollRef.current)return;var textareaDom=textareaDomRef.current;var previewDom=previewRef.current?previewRef.current.mdp.current:undefined;if(!initScroll.current){active.current=type;initScroll.current=true;}if(textareaDom&&previewDom){var scale=(textareaDom.scrollHeight-textareaDom.offsetHeight)/(previewDom.scrollHeight-previewDom.offsetHeight);if(e.target===textareaDom&&active.current==='text'){previewDom.scrollTop=textareaDom.scrollTop/scale;}if(e.target===previewDom&&active.current==='preview'){textareaDom.scrollTop=previewDom.scrollTop*scale;}var scrollTop=0;if(active.current==='text'){scrollTop=textareaDom.scrollTop||0;}else if(active.current==='preview'){scrollTop=previewDom.scrollTop||0;}dispatch({scrollTop:scrollTop});}};var mdPreview=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return/*#__PURE__*/(0,jsx_runtime.jsx)(esm,_objectSpread2(_objectSpread2({},previewOptions),{},{onScroll:function onScroll(e){return handleScroll(e,'preview');},ref:previewRef,source:state.markdown||'',className:"".concat(prefixCls,"-preview ").concat(previewOptions.className||'')}));},[prefixCls,previewOptions,state.markdown]);return/*#__PURE__*/(0,jsx_runtime.jsx)(EditorContext.Provider,{value:_objectSpread2(_objectSpread2({},state),{},{dispatch:dispatch}),children:/*#__PURE__*/(0,jsx_runtime.jsxs)("div",_objectSpread2(_objectSpread2({ref:container,className:cls},other),{},{onClick:function onClick(){dispatch({barPopup:_objectSpread2({},setGroupPopFalse(state.barPopup))});},style:_objectSpread2(_objectSpread2({},other.style),{},{height:state.
|
|
62603
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return height!==state.height&&dispatch({height:height});},[height]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return height!==state.height&&onHeightChange&&onHeightChange(state.height,height,state);},[height,onHeightChange,state]);var textareaDomRef=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();var active=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)('preview');var initScroll=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){textareaDomRef.current=state.textareaWarp;if(state.textareaWarp){state.textareaWarp.addEventListener('mouseover',function(){active.current='text';});state.textareaWarp.addEventListener('mouseleave',function(){active.current='preview';});}},[state.textareaWarp]);var handleScroll=function handleScroll(e,type){if(!enableScrollRef.current)return;var textareaDom=textareaDomRef.current;var previewDom=previewRef.current?previewRef.current.mdp.current:undefined;if(!initScroll.current){active.current=type;initScroll.current=true;}if(textareaDom&&previewDom){var scale=(textareaDom.scrollHeight-textareaDom.offsetHeight)/(previewDom.scrollHeight-previewDom.offsetHeight);if(e.target===textareaDom&&active.current==='text'){previewDom.scrollTop=textareaDom.scrollTop/scale;}if(e.target===previewDom&&active.current==='preview'){textareaDom.scrollTop=previewDom.scrollTop*scale;}var scrollTop=0;if(active.current==='text'){scrollTop=textareaDom.scrollTop||0;}else if(active.current==='preview'){scrollTop=previewDom.scrollTop||0;}dispatch({scrollTop:scrollTop});}};var mdPreview=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){return/*#__PURE__*/(0,jsx_runtime.jsx)(esm,_objectSpread2(_objectSpread2({},previewOptions),{},{onScroll:function onScroll(e){return handleScroll(e,'preview');},ref:previewRef,source:state.markdown||'',className:"".concat(prefixCls,"-preview ").concat(previewOptions.className||'')}));},[prefixCls,previewOptions,state.markdown]);return/*#__PURE__*/(0,jsx_runtime.jsx)(EditorContext.Provider,{value:_objectSpread2(_objectSpread2({},state),{},{dispatch:dispatch}),children:/*#__PURE__*/(0,jsx_runtime.jsxs)("div",_objectSpread2(_objectSpread2({ref:container,className:cls},other),{},{onClick:function onClick(){dispatch({barPopup:_objectSpread2({},setGroupPopFalse(state.barPopup))});},style:_objectSpread2(_objectSpread2({},other.style),{},{height:state.height||'100%'}),children:[!hideToolbar&&!toolbarBottom&&/*#__PURE__*/(0,jsx_runtime.jsx)(Toolbar_Toolbar,{prefixCls:prefixCls,height:toolbarHeight,overflow:overflow,toolbarBottom:toolbarBottom}),/*#__PURE__*/(0,jsx_runtime.jsxs)("div",{className:"".concat(prefixCls,"-content"),style:{height:"calc(100% - ".concat(toolbarHeight,"px)")},children:[/(edit|live)/.test(state.preview||'')&&/*#__PURE__*/(0,jsx_runtime.jsx)(TextArea_TextArea,_objectSpread2(_objectSpread2({className:"".concat(prefixCls,"-input"),prefixCls:prefixCls,autoFocus:autoFocus},textareaProps),{},{onChange:function onChange(evn){_onChange&&_onChange(evn.target.value,evn,state);if(textareaProps&&textareaProps.onChange){textareaProps.onChange(evn);}},renderTextarea:renderTextarea,onScroll:function onScroll(e){return handleScroll(e,'text');}})),/(live|preview)/.test(state.preview||'')&&mdPreview]}),visibleDragbar&&!state.fullscreen&&/*#__PURE__*/(0,jsx_runtime.jsx)(components_DragBar,{prefixCls:prefixCls,height:state.height,maxHeight:maxHeight,minHeight:minHeight,onChange:function onChange(newHeight){dispatch({height:newHeight});}}),!hideToolbar&&toolbarBottom&&/*#__PURE__*/(0,jsx_runtime.jsx)(Toolbar_Toolbar,{prefixCls:prefixCls,height:toolbarHeight,overflow:overflow,toolbarBottom:toolbarBottom})]}))});};var mdEditor=/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(InternalMDEditor);mdEditor.Markdown=esm;/* harmony default export */ const Editor = (mdEditor);
|
|
62136
62604
|
;// CONCATENATED MODULE: ./src/index.tsx
|
|
62137
62605
|
/* harmony default export */ const src_0 = (Editor);
|
|
62138
62606
|
})();
|