markdown-komponents 0.3.1 → 0.3.3
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/index.html +10 -0
- package/kotlin-kotlin-stdlib.mjs +106 -5
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/markdown-komponents.mjs +247 -146
- package/markdown-komponents.mjs.map +1 -1
- package/package.json +1 -1
package/markdown-komponents.mjs
CHANGED
|
@@ -35,11 +35,16 @@ import {
|
|
|
35
35
|
ArrayList3it5z8td81qkl as ArrayList,
|
|
36
36
|
repeat2w4c6j8zoq09o as repeat,
|
|
37
37
|
trimIndent1qytc1wvt8suh as trimIndent,
|
|
38
|
+
trimStart5ewg8zf6cs5u as trimStart,
|
|
39
|
+
trimEnd17pt8cbotbalj as trimEnd,
|
|
40
|
+
takeLast2r8kr8e6g6hi7 as takeLast,
|
|
38
41
|
indexOfwa4w6635jewi as indexOf_0,
|
|
39
42
|
replace3le3ie7l9k8aq as replace,
|
|
43
|
+
removeSuffix3d61x5lsuvuho as removeSuffix,
|
|
40
44
|
drop3na99dw9feawf as drop,
|
|
41
45
|
RegexOption_MULTILINE_getInstance3caq4fchu5vfw as RegexOption_MULTILINE_getInstance,
|
|
42
46
|
startsWith26w8qjqapeeq6 as startsWith,
|
|
47
|
+
toIntOrNull3w2d066r9pvwm as toIntOrNull,
|
|
43
48
|
RegexOption_IGNORE_CASE_getInstance5ovr6gtmcmuu as RegexOption_IGNORE_CASE_getInstance,
|
|
44
49
|
Default_getInstance3u7accvuecmtb as Default_getInstance,
|
|
45
50
|
initMetadataForObject1cxne3s9w65el as initMetadataForObject,
|
|
@@ -790,7 +795,7 @@ class MarkdownToolbar extends BaseWebComponent {
|
|
|
790
795
|
var o = {};
|
|
791
796
|
o['mode'] = 'open';
|
|
792
797
|
var shadow = this.attachShadow(o);
|
|
793
|
-
style(shadow, ':host(.focus-disabled:hover) {\n opacity: 1.0;\n}\n:host {\n display: block;\n border: solid 1px gray;\n padding: 5px;\n}\n:host(.focus-disabled) {\n opacity: 0.
|
|
798
|
+
style(shadow, ':host(.focus-disabled:hover) {\n opacity: 1.0;\n}\n:host {\n display: block;\n border: solid 1px gray;\n padding: 5px;\n}\n:host(.focus-disabled) {\n opacity: 0.25;\n}\n.toolbar {\n height: 24px;\n display: flex;\n}\n.looks-like-header1 { font-size: var(--header1-font-size); font-weight: bold; }\n.looks-like-header2 { font-size: var(--header2-font-size); font-weight: bold; }\n.looks-like-header3 { font-size: var(--header3-font-size); font-weight: bold; }\n.looks-like-header4 { font-size: var(--header4-font-size); font-weight: bold; }\n.looks-like-header5 { font-size: var(--header5-font-size); font-weight: bold; }\n.looks-like-header6 { font-size: var(--header6-font-size); font-weight: bold; }\n@media print {\n :host {\n display: none;\n }\n}');
|
|
794
799
|
var toolbarRow = element(shadow, 'div', MarkdownToolbar$lambda);
|
|
795
800
|
var dropdown = element(toolbarRow, 'toolbar-dropdown');
|
|
796
801
|
var tmp = this;
|
|
@@ -1528,6 +1533,23 @@ class InlineElement extends MarkdownComponent {
|
|
|
1528
1533
|
getMarkdown() {
|
|
1529
1534
|
return getMarkdownWithTextForElement(this);
|
|
1530
1535
|
}
|
|
1536
|
+
wrapMarkdownContentIn(marker) {
|
|
1537
|
+
var content = getMarkdownWithTextForElement(this);
|
|
1538
|
+
// Inline function 'kotlin.text.trim' call
|
|
1539
|
+
var trimmed = toString_0(trim(isCharSequence(content) ? content : THROW_CCE()));
|
|
1540
|
+
// Inline function 'kotlin.text.isEmpty' call
|
|
1541
|
+
if (charSequenceLength(trimmed) === 0)
|
|
1542
|
+
return marker + marker;
|
|
1543
|
+
var tmp = content.length;
|
|
1544
|
+
// Inline function 'kotlin.text.trimStart' call
|
|
1545
|
+
var tmp$ret$2 = toString_0(trimStart(isCharSequence(content) ? content : THROW_CCE()));
|
|
1546
|
+
var leading = take(content, tmp - tmp$ret$2.length | 0);
|
|
1547
|
+
var tmp_0 = content.length;
|
|
1548
|
+
// Inline function 'kotlin.text.trimEnd' call
|
|
1549
|
+
var tmp$ret$3 = toString_0(trimEnd(isCharSequence(content) ? content : THROW_CCE()));
|
|
1550
|
+
var trailing = takeLast(content, tmp_0 - tmp$ret$3.length | 0);
|
|
1551
|
+
return leading + marker + trimmed + marker + trailing;
|
|
1552
|
+
}
|
|
1531
1553
|
mergeWithPrevious(currentSelection) {
|
|
1532
1554
|
var tmp = this.parentNode;
|
|
1533
1555
|
var tmp0_safe_receiver = tmp instanceof MarkdownComponent ? tmp : null;
|
|
@@ -1602,8 +1624,40 @@ class ListItem extends ContainerElement {
|
|
|
1602
1624
|
return '';
|
|
1603
1625
|
}
|
|
1604
1626
|
tn() {
|
|
1605
|
-
var
|
|
1606
|
-
|
|
1627
|
+
var line = '';
|
|
1628
|
+
var nestedBlocks = '';
|
|
1629
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
1630
|
+
var _iterator__ex2g4s = asList(this.childNodes).p();
|
|
1631
|
+
while (_iterator__ex2g4s.q()) {
|
|
1632
|
+
var element = _iterator__ex2g4s.r();
|
|
1633
|
+
var markdownElement = asMarkdownElement(element);
|
|
1634
|
+
var tmp;
|
|
1635
|
+
if (isInterface(element, MarkdownElementWithLevel)) {
|
|
1636
|
+
tmp = !(markdownElement == null);
|
|
1637
|
+
} else {
|
|
1638
|
+
tmp = false;
|
|
1639
|
+
}
|
|
1640
|
+
if (tmp)
|
|
1641
|
+
nestedBlocks = nestedBlocks + removeSuffix(markdownElement.getMarkdown(), '\n');
|
|
1642
|
+
else {
|
|
1643
|
+
if (!(markdownElement == null))
|
|
1644
|
+
line = line + markdownElement.getMarkdown();
|
|
1645
|
+
else {
|
|
1646
|
+
var tmp_0 = line;
|
|
1647
|
+
var tmp0_safe_receiver = element.textContent;
|
|
1648
|
+
var tmp_1;
|
|
1649
|
+
if (tmp0_safe_receiver == null) {
|
|
1650
|
+
tmp_1 = null;
|
|
1651
|
+
} else {
|
|
1652
|
+
// Inline function 'kotlin.text.trim' call
|
|
1653
|
+
tmp_1 = toString_0(trim(isCharSequence(tmp0_safe_receiver) ? tmp0_safe_receiver : THROW_CCE()));
|
|
1654
|
+
}
|
|
1655
|
+
var tmp1_elvis_lhs = tmp_1;
|
|
1656
|
+
line = tmp_0 + (tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs);
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
return line + '\n' + nestedBlocks;
|
|
1607
1661
|
}
|
|
1608
1662
|
normalizeContent() {
|
|
1609
1663
|
this.normalize();
|
|
@@ -1903,9 +1957,7 @@ class MarkdownEmphasis extends InlineElement {
|
|
|
1903
1957
|
element(tmp, 'i', MarkdownEmphasis$lambda);
|
|
1904
1958
|
}
|
|
1905
1959
|
getMarkdown() {
|
|
1906
|
-
|
|
1907
|
-
var this_0 = super.getMarkdown();
|
|
1908
|
-
return '*' + toString_0(trim(isCharSequence(this_0) ? this_0 : THROW_CCE())) + '*';
|
|
1960
|
+
return this.wrapMarkdownContentIn('*');
|
|
1909
1961
|
}
|
|
1910
1962
|
containsMarkdownTextContent() {
|
|
1911
1963
|
return true;
|
|
@@ -2175,6 +2227,12 @@ class MarkdownList extends ContainerElement {
|
|
|
2175
2227
|
mn() {
|
|
2176
2228
|
return this.po_1;
|
|
2177
2229
|
}
|
|
2230
|
+
qo(value) {
|
|
2231
|
+
return this.setAttribute('ordered', value.toString());
|
|
2232
|
+
}
|
|
2233
|
+
ro() {
|
|
2234
|
+
return this.getAttribute('ordered') === 'true';
|
|
2235
|
+
}
|
|
2178
2236
|
getMarkdown() {
|
|
2179
2237
|
return super.getMarkdown() + '\n';
|
|
2180
2238
|
}
|
|
@@ -2212,6 +2270,38 @@ class MarkdownList extends ContainerElement {
|
|
|
2212
2270
|
nextUp.after(element);
|
|
2213
2271
|
}
|
|
2214
2272
|
}
|
|
2273
|
+
fm(child) {
|
|
2274
|
+
if (child == null)
|
|
2275
|
+
return Unit_instance;
|
|
2276
|
+
var nodes = asList(this.childNodes);
|
|
2277
|
+
var indexOfChild = nodes.n1(child);
|
|
2278
|
+
if (indexOfChild < 0)
|
|
2279
|
+
return Unit_instance;
|
|
2280
|
+
var paragraph = document.createElement('markdown-paragraph');
|
|
2281
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
2282
|
+
var _iterator__ex2g4s = toList(asList(child.childNodes)).p();
|
|
2283
|
+
while (_iterator__ex2g4s.q()) {
|
|
2284
|
+
var element = _iterator__ex2g4s.r();
|
|
2285
|
+
paragraph.appendChild(element);
|
|
2286
|
+
}
|
|
2287
|
+
if (indexOfChild < (nodes.t() - 1 | 0)) {
|
|
2288
|
+
var tmp = document.createElement('markdown-list');
|
|
2289
|
+
var rest = tmp instanceof MarkdownList ? tmp : THROW_CCE();
|
|
2290
|
+
rest.qo(this.ro());
|
|
2291
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
2292
|
+
var _iterator__ex2g4s_0 = drop(nodes, indexOfChild + 1 | 0).p();
|
|
2293
|
+
while (_iterator__ex2g4s_0.q()) {
|
|
2294
|
+
var element_0 = _iterator__ex2g4s_0.r();
|
|
2295
|
+
rest.appendChild(element_0);
|
|
2296
|
+
}
|
|
2297
|
+
this.after(rest);
|
|
2298
|
+
}
|
|
2299
|
+
this.after(paragraph);
|
|
2300
|
+
child.remove();
|
|
2301
|
+
if (this.childNodes.length === 0) {
|
|
2302
|
+
this.remove();
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2215
2305
|
get mustBeDirectChildOfDocument() {
|
|
2216
2306
|
return this.mn();
|
|
2217
2307
|
}
|
|
@@ -2234,7 +2324,7 @@ class MarkdownListItem extends ListItem {
|
|
|
2234
2324
|
class MarkdownNumericList extends ContainerElement {
|
|
2235
2325
|
constructor() {
|
|
2236
2326
|
super();
|
|
2237
|
-
this.
|
|
2327
|
+
this.so_1 = false;
|
|
2238
2328
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2239
2329
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2240
2330
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2247,7 +2337,28 @@ class MarkdownNumericList extends ContainerElement {
|
|
|
2247
2337
|
slot(this_0);
|
|
2248
2338
|
}
|
|
2249
2339
|
mn() {
|
|
2250
|
-
return this.
|
|
2340
|
+
return this.so_1;
|
|
2341
|
+
}
|
|
2342
|
+
qo(value) {
|
|
2343
|
+
return this.setAttribute('ordered', value.toString());
|
|
2344
|
+
}
|
|
2345
|
+
ro() {
|
|
2346
|
+
return this.getAttribute('ordered') === 'true';
|
|
2347
|
+
}
|
|
2348
|
+
to(value) {
|
|
2349
|
+
var tmp;
|
|
2350
|
+
if (value == null) {
|
|
2351
|
+
this.removeAttribute('start');
|
|
2352
|
+
tmp = Unit_instance;
|
|
2353
|
+
} else {
|
|
2354
|
+
this.setAttribute('start', value.toString());
|
|
2355
|
+
tmp = Unit_instance;
|
|
2356
|
+
}
|
|
2357
|
+
return tmp;
|
|
2358
|
+
}
|
|
2359
|
+
r8() {
|
|
2360
|
+
var tmp0_safe_receiver = this.getAttribute('start');
|
|
2361
|
+
return tmp0_safe_receiver == null ? null : toIntOrNull(tmp0_safe_receiver);
|
|
2251
2362
|
}
|
|
2252
2363
|
getMarkdown() {
|
|
2253
2364
|
return super.getMarkdown() + '\n';
|
|
@@ -2286,6 +2397,40 @@ class MarkdownNumericList extends ContainerElement {
|
|
|
2286
2397
|
nextUp.after(element);
|
|
2287
2398
|
}
|
|
2288
2399
|
}
|
|
2400
|
+
fm(child) {
|
|
2401
|
+
if (child == null)
|
|
2402
|
+
return Unit_instance;
|
|
2403
|
+
var nodes = asList(this.childNodes);
|
|
2404
|
+
var indexOfChild = nodes.n1(child);
|
|
2405
|
+
if (indexOfChild < 0)
|
|
2406
|
+
return Unit_instance;
|
|
2407
|
+
var paragraph = document.createElement('markdown-paragraph');
|
|
2408
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
2409
|
+
var _iterator__ex2g4s = toList(asList(child.childNodes)).p();
|
|
2410
|
+
while (_iterator__ex2g4s.q()) {
|
|
2411
|
+
var element = _iterator__ex2g4s.r();
|
|
2412
|
+
paragraph.appendChild(element);
|
|
2413
|
+
}
|
|
2414
|
+
if (indexOfChild < (nodes.t() - 1 | 0)) {
|
|
2415
|
+
var tmp = document.createElement('markdown-numeric-list');
|
|
2416
|
+
var rest = tmp instanceof MarkdownNumericList ? tmp : THROW_CCE();
|
|
2417
|
+
rest.qo(this.ro());
|
|
2418
|
+
var tmp0_elvis_lhs = this.r8();
|
|
2419
|
+
rest.to(((tmp0_elvis_lhs == null ? 1 : tmp0_elvis_lhs) + indexOfChild | 0) + 1 | 0);
|
|
2420
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
2421
|
+
var _iterator__ex2g4s_0 = drop(nodes, indexOfChild + 1 | 0).p();
|
|
2422
|
+
while (_iterator__ex2g4s_0.q()) {
|
|
2423
|
+
var element_0 = _iterator__ex2g4s_0.r();
|
|
2424
|
+
rest.appendChild(element_0);
|
|
2425
|
+
}
|
|
2426
|
+
this.after(rest);
|
|
2427
|
+
}
|
|
2428
|
+
this.after(paragraph);
|
|
2429
|
+
child.remove();
|
|
2430
|
+
if (this.childNodes.length === 0) {
|
|
2431
|
+
this.remove();
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2289
2434
|
get mustBeDirectChildOfDocument() {
|
|
2290
2435
|
return this.mn();
|
|
2291
2436
|
}
|
|
@@ -2308,7 +2453,7 @@ class MarkdownNumericListItem extends ListItem {
|
|
|
2308
2453
|
class MarkdownParagraph extends LeafElement {
|
|
2309
2454
|
constructor() {
|
|
2310
2455
|
super();
|
|
2311
|
-
this.
|
|
2456
|
+
this.uo_1 = true;
|
|
2312
2457
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2313
2458
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2314
2459
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2321,7 +2466,7 @@ class MarkdownParagraph extends LeafElement {
|
|
|
2321
2466
|
slot(this_0);
|
|
2322
2467
|
}
|
|
2323
2468
|
mn() {
|
|
2324
|
-
return this.
|
|
2469
|
+
return this.uo_1;
|
|
2325
2470
|
}
|
|
2326
2471
|
getMarkdown() {
|
|
2327
2472
|
var tmp = asList(this.childNodes);
|
|
@@ -2352,7 +2497,7 @@ class MarkdownParagraph extends LeafElement {
|
|
|
2352
2497
|
class MarkdownQuote extends ContainerElement {
|
|
2353
2498
|
constructor() {
|
|
2354
2499
|
super();
|
|
2355
|
-
this.
|
|
2500
|
+
this.vo_1 = true;
|
|
2356
2501
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2357
2502
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2358
2503
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2365,7 +2510,7 @@ class MarkdownQuote extends ContainerElement {
|
|
|
2365
2510
|
element(this_0, 'blockquote', MarkdownQuote$lambda);
|
|
2366
2511
|
}
|
|
2367
2512
|
mn() {
|
|
2368
|
-
return this.
|
|
2513
|
+
return this.vo_1;
|
|
2369
2514
|
}
|
|
2370
2515
|
getMarkdown() {
|
|
2371
2516
|
var tmp = asList(this.childNodes);
|
|
@@ -2442,9 +2587,7 @@ class MarkdownStrike extends InlineElement {
|
|
|
2442
2587
|
element(tmp, 'del', MarkdownStrike$lambda);
|
|
2443
2588
|
}
|
|
2444
2589
|
getMarkdown() {
|
|
2445
|
-
|
|
2446
|
-
var this_0 = super.getMarkdown();
|
|
2447
|
-
return '~~' + toString_0(trim(isCharSequence(this_0) ? this_0 : THROW_CCE())) + '~~';
|
|
2590
|
+
return this.wrapMarkdownContentIn('~~');
|
|
2448
2591
|
}
|
|
2449
2592
|
containsMarkdownTextContent() {
|
|
2450
2593
|
return true;
|
|
@@ -2465,9 +2608,7 @@ class MarkdownStrong extends InlineElement {
|
|
|
2465
2608
|
slot(this_0);
|
|
2466
2609
|
}
|
|
2467
2610
|
getMarkdown() {
|
|
2468
|
-
|
|
2469
|
-
var this_0 = super.getMarkdown();
|
|
2470
|
-
return '**' + toString_0(trim(isCharSequence(this_0) ? this_0 : THROW_CCE())) + '**';
|
|
2611
|
+
return this.wrapMarkdownContentIn('**');
|
|
2471
2612
|
}
|
|
2472
2613
|
mergeSameSiblings() {
|
|
2473
2614
|
return true;
|
|
@@ -2479,7 +2620,7 @@ class MarkdownStrong extends InlineElement {
|
|
|
2479
2620
|
class MarkdownTable extends ContainerElement {
|
|
2480
2621
|
constructor() {
|
|
2481
2622
|
super();
|
|
2482
|
-
this.
|
|
2623
|
+
this.wo_1 = true;
|
|
2483
2624
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2484
2625
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2485
2626
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2492,7 +2633,7 @@ class MarkdownTable extends ContainerElement {
|
|
|
2492
2633
|
slot(this_0);
|
|
2493
2634
|
}
|
|
2494
2635
|
mn() {
|
|
2495
|
-
return this.
|
|
2636
|
+
return this.wo_1;
|
|
2496
2637
|
}
|
|
2497
2638
|
getMarkdown() {
|
|
2498
2639
|
var tmp = asList(this.children);
|
|
@@ -2520,7 +2661,7 @@ class MarkdownTableHeaderCell extends TableCell {
|
|
|
2520
2661
|
class MarkdownTableRow extends ContainerElement {
|
|
2521
2662
|
constructor() {
|
|
2522
2663
|
super();
|
|
2523
|
-
this.
|
|
2664
|
+
this.xo_1 = false;
|
|
2524
2665
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2525
2666
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2526
2667
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2533,7 +2674,7 @@ class MarkdownTableRow extends ContainerElement {
|
|
|
2533
2674
|
slot(this_0);
|
|
2534
2675
|
}
|
|
2535
2676
|
mn() {
|
|
2536
|
-
return this.
|
|
2677
|
+
return this.xo_1;
|
|
2537
2678
|
}
|
|
2538
2679
|
getMarkdown() {
|
|
2539
2680
|
var tmp = asList(this.children);
|
|
@@ -2565,23 +2706,23 @@ class MarkdownTaskListItem extends ListItem {
|
|
|
2565
2706
|
var container = element(shadow, 'div', MarkdownTaskListItem$lambda);
|
|
2566
2707
|
var tmp = this;
|
|
2567
2708
|
var tmp_0 = element(container, 'input', MarkdownTaskListItem$lambda_0);
|
|
2568
|
-
tmp.
|
|
2569
|
-
this.
|
|
2709
|
+
tmp.zo_1 = tmp_0 instanceof HTMLInputElement ? tmp_0 : THROW_CCE();
|
|
2710
|
+
this.zo_1.addEventListener('change', MarkdownTaskListItem$lambda_1(this));
|
|
2570
2711
|
element(container, 'div', MarkdownTaskListItem$lambda_2);
|
|
2571
2712
|
}
|
|
2572
|
-
|
|
2713
|
+
ap() {
|
|
2573
2714
|
return this.getAttribute('checked') === 'true';
|
|
2574
2715
|
}
|
|
2575
2716
|
dc(name, oldValue, newValue) {
|
|
2576
2717
|
if (name === 'checked') {
|
|
2577
|
-
this.
|
|
2718
|
+
this.zo_1.checked = this.ap();
|
|
2578
2719
|
}
|
|
2579
2720
|
}
|
|
2580
2721
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
2581
2722
|
return this.dc(name, oldValue, newValue);
|
|
2582
2723
|
}
|
|
2583
2724
|
sn() {
|
|
2584
|
-
return '[' + (this.
|
|
2725
|
+
return '[' + (this.ap() ? 'x' : ' ') + '] ';
|
|
2585
2726
|
}
|
|
2586
2727
|
}
|
|
2587
2728
|
class MarkdownToc extends BaseWebComponent {
|
|
@@ -2699,18 +2840,18 @@ class MarkdownToc extends BaseWebComponent {
|
|
|
2699
2840
|
class HeadingAnchors {
|
|
2700
2841
|
constructor() {
|
|
2701
2842
|
HeadingAnchors_instance = this;
|
|
2702
|
-
this.
|
|
2703
|
-
this.
|
|
2843
|
+
this.bp_1 = Regex.k8('\\s*\\{([^}]+)\\}$');
|
|
2844
|
+
this.cp_1 = Regex.j8('[^\\w\u0430-\u044F\u0456\u0457\u0454]+', RegexOption_IGNORE_CASE_getInstance());
|
|
2704
2845
|
}
|
|
2705
|
-
|
|
2706
|
-
var match = this.
|
|
2846
|
+
dp(idPrefixForDefault, text, useTextInId) {
|
|
2847
|
+
var match = this.bp_1.n8(text);
|
|
2707
2848
|
var tmp;
|
|
2708
2849
|
if (!(match == null)) {
|
|
2709
2850
|
tmp = to(match.l9().s(1), substring(text, 0, match.q8().ua_1));
|
|
2710
2851
|
} else {
|
|
2711
2852
|
var tmp_0;
|
|
2712
2853
|
if (useTextInId) {
|
|
2713
|
-
tmp_0 = idPrefixForDefault + this.
|
|
2854
|
+
tmp_0 = idPrefixForDefault + this.ep(text);
|
|
2714
2855
|
} else {
|
|
2715
2856
|
tmp_0 = idPrefixForDefault + ((new Date()).getTime() + Default_getInstance().ka());
|
|
2716
2857
|
}
|
|
@@ -2719,12 +2860,12 @@ class HeadingAnchors {
|
|
|
2719
2860
|
}
|
|
2720
2861
|
return tmp;
|
|
2721
2862
|
}
|
|
2722
|
-
|
|
2863
|
+
ep(text) {
|
|
2723
2864
|
// Inline function 'kotlin.text.lowercase' call
|
|
2724
2865
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2725
2866
|
var tmp0 = text.toLowerCase();
|
|
2726
2867
|
// Inline function 'kotlin.text.replace' call
|
|
2727
|
-
return this.
|
|
2868
|
+
return this.cp_1.o8(tmp0, '-');
|
|
2728
2869
|
}
|
|
2729
2870
|
}
|
|
2730
2871
|
class MarkdownRenderer {}
|
|
@@ -2840,17 +2981,17 @@ class TsStackMarkdownRenderer extends logic_tools_markdown_komponents_tsstack_Ts
|
|
|
2840
2981
|
constructor(delegate) {
|
|
2841
2982
|
delegate = delegate === VOID ? new MarkdownComponentsRenderer() : delegate;
|
|
2842
2983
|
super();
|
|
2843
|
-
this.
|
|
2844
|
-
this.
|
|
2984
|
+
this.fp_1 = delegate;
|
|
2985
|
+
this.gp_1 = false;
|
|
2845
2986
|
}
|
|
2846
|
-
|
|
2847
|
-
return this.
|
|
2987
|
+
hp() {
|
|
2988
|
+
return this.fp_1;
|
|
2848
2989
|
}
|
|
2849
|
-
|
|
2990
|
+
ip(code, lang, escaped, meta) {
|
|
2850
2991
|
var tmp;
|
|
2851
2992
|
// Inline function 'kotlin.text.isNullOrEmpty' call
|
|
2852
2993
|
if (!(meta == null || charSequenceLength(meta) === 0)) {
|
|
2853
|
-
var _destruct__k2r9zo = HeadingAnchors_getInstance().
|
|
2994
|
+
var _destruct__k2r9zo = HeadingAnchors_getInstance().dp('code-', meta, false);
|
|
2854
2995
|
var id = _destruct__k2r9zo.mb();
|
|
2855
2996
|
var newLang = _destruct__k2r9zo.nb();
|
|
2856
2997
|
tmp = this.codeWithAnchor(code, newLang, id, escaped);
|
|
@@ -2860,9 +3001,9 @@ class TsStackMarkdownRenderer extends logic_tools_markdown_komponents_tsstack_Ts
|
|
|
2860
3001
|
return tmp;
|
|
2861
3002
|
}
|
|
2862
3003
|
code(code, lang, escaped, meta) {
|
|
2863
|
-
return this.
|
|
3004
|
+
return this.ip(code, lang, escaped, meta);
|
|
2864
3005
|
}
|
|
2865
|
-
|
|
3006
|
+
jp(code, lang, id, escaped) {
|
|
2866
3007
|
var tmp;
|
|
2867
3008
|
if (!(escaped === true)) {
|
|
2868
3009
|
var tmp0_safe_receiver = this.options.escape;
|
|
@@ -2872,119 +3013,119 @@ class TsStackMarkdownRenderer extends logic_tools_markdown_komponents_tsstack_Ts
|
|
|
2872
3013
|
tmp = code;
|
|
2873
3014
|
}
|
|
2874
3015
|
var codeText = tmp;
|
|
2875
|
-
return this.
|
|
3016
|
+
return this.fp_1.code(codeText, lang, id);
|
|
2876
3017
|
}
|
|
2877
3018
|
codeWithAnchor(code, lang, id, escaped, $super) {
|
|
2878
3019
|
escaped = escaped === VOID ? null : escaped;
|
|
2879
|
-
return $super === VOID ? this.
|
|
3020
|
+
return $super === VOID ? this.jp(code, lang, id, escaped) : $super.jp.call(this, code, lang, id, escaped);
|
|
2880
3021
|
}
|
|
2881
|
-
|
|
2882
|
-
return this.
|
|
3022
|
+
kp(quote) {
|
|
3023
|
+
return this.fp_1.blockquote(quote);
|
|
2883
3024
|
}
|
|
2884
3025
|
blockquote(quote) {
|
|
2885
|
-
return this.
|
|
3026
|
+
return this.kp(quote);
|
|
2886
3027
|
}
|
|
2887
|
-
|
|
2888
|
-
return this.
|
|
3028
|
+
lp(html) {
|
|
3029
|
+
return this.fp_1.html(html);
|
|
2889
3030
|
}
|
|
2890
3031
|
html(html) {
|
|
2891
|
-
return this.
|
|
3032
|
+
return this.lp(html);
|
|
2892
3033
|
}
|
|
2893
|
-
|
|
2894
|
-
var _destruct__k2r9zo = HeadingAnchors_getInstance().
|
|
3034
|
+
mp(text, level, raw) {
|
|
3035
|
+
var _destruct__k2r9zo = HeadingAnchors_getInstance().dp('heading-', text, true);
|
|
2895
3036
|
var id = _destruct__k2r9zo.mb();
|
|
2896
3037
|
var newText = _destruct__k2r9zo.nb();
|
|
2897
|
-
return this.
|
|
3038
|
+
return this.fp_1.heading(newText, level, id);
|
|
2898
3039
|
}
|
|
2899
3040
|
heading(text, level, raw) {
|
|
2900
|
-
return this.
|
|
3041
|
+
return this.mp(text, level, raw);
|
|
2901
3042
|
}
|
|
2902
|
-
|
|
2903
|
-
return this.
|
|
3043
|
+
np() {
|
|
3044
|
+
return this.fp_1.hr();
|
|
2904
3045
|
}
|
|
2905
3046
|
hr() {
|
|
2906
|
-
return this.
|
|
3047
|
+
return this.np();
|
|
2907
3048
|
}
|
|
2908
|
-
|
|
2909
|
-
return this.
|
|
3049
|
+
op(body, ordered) {
|
|
3050
|
+
return this.fp_1.list(body, ordered === true);
|
|
2910
3051
|
}
|
|
2911
3052
|
list(body, ordered) {
|
|
2912
|
-
return this.
|
|
3053
|
+
return this.op(body, ordered);
|
|
2913
3054
|
}
|
|
2914
|
-
|
|
2915
|
-
return startsWith(text, '<markdown-paragraph>[ ] ') ? this.
|
|
3055
|
+
pp(text) {
|
|
3056
|
+
return startsWith(text, '<markdown-paragraph>[ ] ') ? this.fp_1.taskListItem(replacePrefixOnce(text, '<markdown-paragraph>[ ] ', '<markdown-paragraph>'), false) : startsWith(text, '<markdown-paragraph>[x] ') ? this.fp_1.taskListItem(replacePrefixOnce(text, '<markdown-paragraph>[x] ', '<markdown-paragraph>'), true) : startsWith(text, '[ ] ') ? this.fp_1.taskListItem(removePrefix(text, '[ ] '), false) : startsWith(text, '[x] ') ? this.fp_1.taskListItem(removePrefix(text, '[x] '), true) : this.fp_1.listItem(text);
|
|
2916
3057
|
}
|
|
2917
3058
|
listitem(text) {
|
|
2918
|
-
return this.
|
|
3059
|
+
return this.pp(text);
|
|
2919
3060
|
}
|
|
2920
|
-
|
|
2921
|
-
return this.
|
|
3061
|
+
qp(text) {
|
|
3062
|
+
return this.fp_1.paragraph(text);
|
|
2922
3063
|
}
|
|
2923
3064
|
paragraph(text) {
|
|
2924
|
-
return this.
|
|
3065
|
+
return this.qp(text);
|
|
2925
3066
|
}
|
|
2926
|
-
|
|
2927
|
-
return this.
|
|
3067
|
+
rp(header, body) {
|
|
3068
|
+
return this.fp_1.table(header, body);
|
|
2928
3069
|
}
|
|
2929
3070
|
table(header, body) {
|
|
2930
|
-
return this.
|
|
3071
|
+
return this.rp(header, body);
|
|
2931
3072
|
}
|
|
2932
|
-
|
|
2933
|
-
var isHeaderRow = this.
|
|
2934
|
-
this.
|
|
2935
|
-
return isHeaderRow ? this.
|
|
3073
|
+
sp(content) {
|
|
3074
|
+
var isHeaderRow = this.gp_1;
|
|
3075
|
+
this.gp_1 = false;
|
|
3076
|
+
return isHeaderRow ? this.fp_1.tableHeaderRow(content) : this.fp_1.tableRow(content);
|
|
2936
3077
|
}
|
|
2937
3078
|
tablerow(content) {
|
|
2938
|
-
return this.
|
|
3079
|
+
return this.sp(content);
|
|
2939
3080
|
}
|
|
2940
|
-
|
|
3081
|
+
tp(content, flags) {
|
|
2941
3082
|
var tmp;
|
|
2942
3083
|
if (flags.header == true) {
|
|
2943
|
-
this.
|
|
2944
|
-
tmp = this.
|
|
3084
|
+
this.gp_1 = true;
|
|
3085
|
+
tmp = this.fp_1.tableHeaderCell(content);
|
|
2945
3086
|
} else {
|
|
2946
|
-
tmp = this.
|
|
3087
|
+
tmp = this.fp_1.tableCell(content);
|
|
2947
3088
|
}
|
|
2948
3089
|
return tmp;
|
|
2949
3090
|
}
|
|
2950
3091
|
tablecell(content, flags) {
|
|
2951
|
-
return this.
|
|
3092
|
+
return this.tp(content, flags);
|
|
2952
3093
|
}
|
|
2953
|
-
|
|
2954
|
-
return this.
|
|
3094
|
+
up(text) {
|
|
3095
|
+
return this.fp_1.strong(text);
|
|
2955
3096
|
}
|
|
2956
3097
|
strong(text) {
|
|
2957
|
-
return this.
|
|
3098
|
+
return this.up(text);
|
|
2958
3099
|
}
|
|
2959
|
-
|
|
2960
|
-
return this.
|
|
3100
|
+
vp(text) {
|
|
3101
|
+
return this.fp_1.emphasis(text);
|
|
2961
3102
|
}
|
|
2962
3103
|
em(text) {
|
|
2963
|
-
return this.
|
|
3104
|
+
return this.vp(text);
|
|
2964
3105
|
}
|
|
2965
|
-
|
|
2966
|
-
return this.
|
|
3106
|
+
wp(text) {
|
|
3107
|
+
return this.fp_1.codeSpan(text);
|
|
2967
3108
|
}
|
|
2968
3109
|
codespan(text) {
|
|
2969
|
-
return this.
|
|
3110
|
+
return this.wp(text);
|
|
2970
3111
|
}
|
|
2971
|
-
|
|
2972
|
-
return this.
|
|
3112
|
+
xp(text) {
|
|
3113
|
+
return this.fp_1.strikethrough(text);
|
|
2973
3114
|
}
|
|
2974
3115
|
del(text) {
|
|
2975
|
-
return this.
|
|
3116
|
+
return this.xp(text);
|
|
2976
3117
|
}
|
|
2977
|
-
|
|
2978
|
-
return this.
|
|
3118
|
+
yp(href, title, text) {
|
|
3119
|
+
return this.fp_1.link(href, title, text);
|
|
2979
3120
|
}
|
|
2980
3121
|
link(href, title, text) {
|
|
2981
|
-
return this.
|
|
3122
|
+
return this.yp(href, title, text);
|
|
2982
3123
|
}
|
|
2983
|
-
|
|
2984
|
-
return this.
|
|
3124
|
+
zp(href, title, text) {
|
|
3125
|
+
return this.fp_1.image(href, title, text);
|
|
2985
3126
|
}
|
|
2986
3127
|
image(href, title, text) {
|
|
2987
|
-
return this.
|
|
3128
|
+
return this.zp(href, title, text);
|
|
2988
3129
|
}
|
|
2989
3130
|
}
|
|
2990
3131
|
//endregion
|
|
@@ -4885,9 +5026,9 @@ function svgFor($this, icon) {
|
|
|
4885
5026
|
case 'break':
|
|
4886
5027
|
return '<svg viewBox="0 0 24 24" fill="currentColor" stroke="none">\n <rect x="3" y="11" width="18" height="2.5"/>\n <\/svg>';
|
|
4887
5028
|
case 'insert-photo':
|
|
4888
|
-
return '<svg viewBox="0
|
|
5029
|
+
return '<svg viewBox="0 -960 960 960" fill="currentColor" stroke="none">\n <path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"/>\n <\/svg>';
|
|
4889
5030
|
case 'insert-link':
|
|
4890
|
-
return '<svg viewBox="0
|
|
5031
|
+
return '<svg viewBox="0 -960 960 960" fill="currentColor" stroke="none">\n <path d="M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"/>\n <\/svg>';
|
|
4891
5032
|
case 'code-block':
|
|
4892
5033
|
return '<svg viewBox="0 0 24 24" fill="currentColor" stroke="none">\n <text x="12" y="17" text-anchor="middle" font-size="12" font-family="monospace"></><\/text>\n <\/svg>';
|
|
4893
5034
|
case 'quote':
|
|
@@ -4904,26 +5045,6 @@ function Heading$renderHeading$lambda($this$element) {
|
|
|
4904
5045
|
slot($this$element);
|
|
4905
5046
|
return Unit_instance;
|
|
4906
5047
|
}
|
|
4907
|
-
function ListItem$getMarkdownWithTextForElement$lambda(child) {
|
|
4908
|
-
var tmp0_safe_receiver = asMarkdownElement(child);
|
|
4909
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.getMarkdown();
|
|
4910
|
-
var tmp;
|
|
4911
|
-
if (tmp1_elvis_lhs == null) {
|
|
4912
|
-
var tmp2_safe_receiver = child.textContent;
|
|
4913
|
-
var tmp_0;
|
|
4914
|
-
if (tmp2_safe_receiver == null) {
|
|
4915
|
-
tmp_0 = null;
|
|
4916
|
-
} else {
|
|
4917
|
-
// Inline function 'kotlin.text.trim' call
|
|
4918
|
-
tmp_0 = toString_0(trim(isCharSequence(tmp2_safe_receiver) ? tmp2_safe_receiver : THROW_CCE()));
|
|
4919
|
-
}
|
|
4920
|
-
var tmp3_elvis_lhs = tmp_0;
|
|
4921
|
-
tmp = (tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs) + '\n';
|
|
4922
|
-
} else {
|
|
4923
|
-
tmp = tmp1_elvis_lhs;
|
|
4924
|
-
}
|
|
4925
|
-
return tmp;
|
|
4926
|
-
}
|
|
4927
5048
|
function MarkdownComponent$getMarkdown$lambda(child) {
|
|
4928
5049
|
var tmp0_safe_receiver = asMarkdownElement(child);
|
|
4929
5050
|
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.getMarkdown();
|
|
@@ -5251,30 +5372,10 @@ function MarkdownParagraph$getMarkdown$lambda(child) {
|
|
|
5251
5372
|
tmp_0 = null;
|
|
5252
5373
|
} else {
|
|
5253
5374
|
// Inline function 'kotlin.text.replace' call
|
|
5254
|
-
tmp_0 = Regex.
|
|
5255
|
-
}
|
|
5256
|
-
var tmp1_safe_receiver = tmp_0;
|
|
5257
|
-
var tmp_1;
|
|
5258
|
-
if (tmp1_safe_receiver == null) {
|
|
5259
|
-
tmp_1 = null;
|
|
5260
|
-
} else {
|
|
5261
|
-
// Inline function 'kotlin.text.isEmpty' call
|
|
5262
|
-
tmp_1 = charSequenceLength(tmp1_safe_receiver) === 0;
|
|
5263
|
-
}
|
|
5264
|
-
if (tmp_1 === true) {
|
|
5265
|
-
tmp = '';
|
|
5266
|
-
} else {
|
|
5267
|
-
var tmp2_safe_receiver = child.textContent;
|
|
5268
|
-
var tmp_2;
|
|
5269
|
-
if (tmp2_safe_receiver == null) {
|
|
5270
|
-
tmp_2 = null;
|
|
5271
|
-
} else {
|
|
5272
|
-
// Inline function 'kotlin.text.replace' call
|
|
5273
|
-
tmp_2 = Regex.j8('^\\s+', RegexOption_MULTILINE_getInstance()).o8(tmp2_safe_receiver, ' ');
|
|
5274
|
-
}
|
|
5275
|
-
var tmp3_elvis_lhs = tmp_2;
|
|
5276
|
-
tmp = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs;
|
|
5375
|
+
tmp_0 = Regex.j8('^\\s+', RegexOption_MULTILINE_getInstance()).o8(tmp0_safe_receiver, ' ');
|
|
5277
5376
|
}
|
|
5377
|
+
var tmp1_elvis_lhs = tmp_0;
|
|
5378
|
+
tmp = tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
|
|
5278
5379
|
}
|
|
5279
5380
|
return tmp;
|
|
5280
5381
|
}
|
|
@@ -5322,7 +5423,7 @@ function MarkdownTaskListItem$lambda_0($this$element) {
|
|
|
5322
5423
|
}
|
|
5323
5424
|
function MarkdownTaskListItem$lambda_1(this$0) {
|
|
5324
5425
|
return (it) => {
|
|
5325
|
-
this$0.setAttribute('checked', this$0.
|
|
5426
|
+
this$0.setAttribute('checked', this$0.zo_1.checked.toString());
|
|
5326
5427
|
return Unit_instance;
|
|
5327
5428
|
};
|
|
5328
5429
|
}
|
|
@@ -5438,7 +5539,7 @@ function parseMarkdown$lambda($renderer) {
|
|
|
5438
5539
|
function parseMarkdown$lambda_0($renderer) {
|
|
5439
5540
|
return (execArr) => {
|
|
5440
5541
|
var groups = ensureNotNull(execArr);
|
|
5441
|
-
return $renderer.
|
|
5542
|
+
return $renderer.fp_1.custom(ensureNotNull(groups[1]), parseMarkdownWithTsStackRenderer(ensureNotNull(groups[2]), $renderer));
|
|
5442
5543
|
};
|
|
5443
5544
|
}
|
|
5444
5545
|
var properties_initialized_TsStackMarkdownRenderer_kt_6onrsl;
|
|
@@ -5490,9 +5591,9 @@ initMetadataForClass(MarkdownHeading6, 'MarkdownHeading6', MarkdownHeading6);
|
|
|
5490
5591
|
initMetadataForClass(MarkdownHtml, 'MarkdownHtml', MarkdownHtml);
|
|
5491
5592
|
initMetadataForClass(MarkdownImage, 'MarkdownImage', MarkdownImage);
|
|
5492
5593
|
initMetadataForClass(MarkdownLink, 'MarkdownLink', MarkdownLink);
|
|
5493
|
-
initMetadataForClass(MarkdownList, 'MarkdownList', MarkdownList, VOID, [MarkdownElementWithLevel]);
|
|
5594
|
+
initMetadataForClass(MarkdownList, 'MarkdownList', MarkdownList, VOID, [MarkdownElementWithLevel, MarkdownElementEscapeByBackspace]);
|
|
5494
5595
|
initMetadataForClass(MarkdownListItem, 'MarkdownListItem', MarkdownListItem);
|
|
5495
|
-
initMetadataForClass(MarkdownNumericList, 'MarkdownNumericList', MarkdownNumericList, VOID, [MarkdownElementWithLevel]);
|
|
5596
|
+
initMetadataForClass(MarkdownNumericList, 'MarkdownNumericList', MarkdownNumericList, VOID, [MarkdownElementWithLevel, MarkdownElementEscapeByBackspace]);
|
|
5496
5597
|
initMetadataForClass(MarkdownNumericListItem, 'MarkdownNumericListItem', MarkdownNumericListItem);
|
|
5497
5598
|
initMetadataForClass(MarkdownParagraph, 'MarkdownParagraph', MarkdownParagraph);
|
|
5498
5599
|
initMetadataForClass(MarkdownQuote, 'MarkdownQuote', MarkdownQuote, VOID, [MarkdownElementWithLevel, MarkdownElementEscapeByBackspace]);
|