markdown-komponents 0.3.2 → 0.3.4
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/kotlin-kotlin-stdlib.mjs +1006 -922
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/markdown-komponents.mjs +1164 -607
- package/markdown-komponents.mjs.map +1 -1
- package/package.json +1 -1
package/markdown-komponents.mjs
CHANGED
|
@@ -4,23 +4,29 @@ import {
|
|
|
4
4
|
initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
|
|
5
5
|
THROW_CCE2g6jy02ryeudk as THROW_CCE,
|
|
6
6
|
initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
|
|
7
|
+
asList1pji8rwrhkggq as asList,
|
|
8
|
+
setOf45ia9pnfhe90 as setOf,
|
|
9
|
+
emptyList1g2z5xcrvp2zy as emptyList,
|
|
10
|
+
ArrayList3it5z8td81qkl as ArrayList,
|
|
11
|
+
addAll1k27qatfgp3k5 as addAll,
|
|
12
|
+
listOfvhqybd2zx248 as listOf,
|
|
13
|
+
charSequenceLength3278n89t01tmv as charSequenceLength,
|
|
7
14
|
toString30pk9tzaqopn as toString,
|
|
8
15
|
hashCodeq5arwsb9dgti as hashCode,
|
|
9
16
|
equals2au1ep9vhcato as equals,
|
|
10
17
|
ensureNotNull1e947j3ixpazm as ensureNotNull,
|
|
11
18
|
Regexxgw0gjiagf4z as Regex,
|
|
12
|
-
|
|
19
|
+
toList3jhuyej2anx2q as toList,
|
|
20
|
+
split2bvyvnrlcifjv as split,
|
|
21
|
+
checkIndexOverflow3frtmheghr0th as checkIndexOverflow,
|
|
13
22
|
to2cs3ny02qtbcb as to,
|
|
14
|
-
asList1pji8rwrhkggq as asList,
|
|
15
23
|
take9j4462mea726 as take,
|
|
16
|
-
split2bvyvnrlcifjv as split,
|
|
17
24
|
getOrNull1go7ef9ldk0df as getOrNull,
|
|
18
25
|
singleOrNullrknfaxokm1sl as singleOrNull,
|
|
19
26
|
isCharSequence1ju9jr1w86plq as isCharSequence,
|
|
20
27
|
trim11nh7r46at6sx as trim,
|
|
21
28
|
toString1pkumu07cwy4m as toString_0,
|
|
22
29
|
singleo93pzdgfc557 as single,
|
|
23
|
-
toList3jhuyej2anx2q as toList,
|
|
24
30
|
isInterface3d6p8outrmvmk as isInterface,
|
|
25
31
|
joinToString1cxrrlmo0chqs as joinToString,
|
|
26
32
|
until1jbpn0z3f8lbg as until,
|
|
@@ -31,8 +37,6 @@ import {
|
|
|
31
37
|
lastIndexOfpmd3ei5son2n as lastIndexOf,
|
|
32
38
|
substring3saq8ornu0luv as substring_0,
|
|
33
39
|
indexOf1xbs558u7wr52 as indexOf,
|
|
34
|
-
listOfvhqybd2zx248 as listOf,
|
|
35
|
-
ArrayList3it5z8td81qkl as ArrayList,
|
|
36
40
|
repeat2w4c6j8zoq09o as repeat,
|
|
37
41
|
trimIndent1qytc1wvt8suh as trimIndent,
|
|
38
42
|
trimStart5ewg8zf6cs5u as trimStart,
|
|
@@ -44,6 +48,7 @@ import {
|
|
|
44
48
|
drop3na99dw9feawf as drop,
|
|
45
49
|
RegexOption_MULTILINE_getInstance3caq4fchu5vfw as RegexOption_MULTILINE_getInstance,
|
|
46
50
|
startsWith26w8qjqapeeq6 as startsWith,
|
|
51
|
+
toIntOrNull3w2d066r9pvwm as toIntOrNull,
|
|
47
52
|
RegexOption_IGNORE_CASE_getInstance5ovr6gtmcmuu as RegexOption_IGNORE_CASE_getInstance,
|
|
48
53
|
Default_getInstance3u7accvuecmtb as Default_getInstance,
|
|
49
54
|
initMetadataForObject1cxne3s9w65el as initMetadataForObject,
|
|
@@ -56,25 +61,25 @@ var imul = Math.imul;
|
|
|
56
61
|
//endregion
|
|
57
62
|
//region block: pre-declaration
|
|
58
63
|
class BaseWebComponent extends HTMLElement {
|
|
59
|
-
|
|
64
|
+
cc() {
|
|
60
65
|
}
|
|
61
66
|
connectedCallback() {
|
|
62
|
-
return this.
|
|
67
|
+
return this.cc();
|
|
63
68
|
}
|
|
64
|
-
|
|
69
|
+
dc() {
|
|
65
70
|
}
|
|
66
71
|
disconnectedCallback() {
|
|
67
|
-
return this.
|
|
72
|
+
return this.dc();
|
|
68
73
|
}
|
|
69
|
-
|
|
74
|
+
ec() {
|
|
70
75
|
}
|
|
71
76
|
adoptedCallback() {
|
|
72
|
-
return this.
|
|
77
|
+
return this.ec();
|
|
73
78
|
}
|
|
74
|
-
|
|
79
|
+
fc(name, oldValue, newValue) {
|
|
75
80
|
}
|
|
76
81
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
77
|
-
return this.
|
|
82
|
+
return this.fc(name, oldValue, newValue);
|
|
78
83
|
}
|
|
79
84
|
upgradeProperty(name) {
|
|
80
85
|
// Inline function 'kotlin.js.asDynamic' call
|
|
@@ -98,18 +103,18 @@ class BoldToolbarButton extends BaseWebComponent {
|
|
|
98
103
|
var shadow = this.attachShadow(o);
|
|
99
104
|
var tmp = this;
|
|
100
105
|
var tmp_0 = element(shadow, 'toolbar-button', BoldToolbarButton$lambda);
|
|
101
|
-
tmp.
|
|
106
|
+
tmp.el_1 = tmp_0 instanceof ToolbarButton ? tmp_0 : THROW_CCE();
|
|
102
107
|
}
|
|
103
|
-
|
|
108
|
+
fl() {
|
|
104
109
|
return this.hasAttribute('highlighted');
|
|
105
110
|
}
|
|
106
|
-
|
|
111
|
+
fc(name, oldValue, newValue) {
|
|
107
112
|
if (name === 'highlighted') {
|
|
108
|
-
this.
|
|
113
|
+
this.el_1.hl(this.fl());
|
|
109
114
|
}
|
|
110
115
|
}
|
|
111
116
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
112
|
-
return this.
|
|
117
|
+
return this.fc(name, oldValue, newValue);
|
|
113
118
|
}
|
|
114
119
|
}
|
|
115
120
|
class DropdownElement extends BaseWebComponent {
|
|
@@ -145,19 +150,19 @@ class DropdownElements extends BaseWebComponent {
|
|
|
145
150
|
class EditorToolbar {}
|
|
146
151
|
class StashedSelection {
|
|
147
152
|
constructor(anchorNode, anchorOffset, focusNode, focusOffset) {
|
|
148
|
-
this.
|
|
149
|
-
this.
|
|
150
|
-
this.
|
|
151
|
-
this.
|
|
153
|
+
this.il_1 = anchorNode;
|
|
154
|
+
this.jl_1 = anchorOffset;
|
|
155
|
+
this.kl_1 = focusNode;
|
|
156
|
+
this.ll_1 = focusOffset;
|
|
152
157
|
}
|
|
153
158
|
toString() {
|
|
154
|
-
return 'StashedSelection(anchorNode=' + toString(this.
|
|
159
|
+
return 'StashedSelection(anchorNode=' + toString(this.il_1) + ', anchorOffset=' + this.jl_1 + ', focusNode=' + toString(this.kl_1) + ', focusOffset=' + this.ll_1 + ')';
|
|
155
160
|
}
|
|
156
161
|
hashCode() {
|
|
157
|
-
var result = this.
|
|
158
|
-
result = imul(result, 31) + this.hl_1 | 0;
|
|
159
|
-
result = imul(result, 31) + (this.il_1 == null ? 0 : hashCode(this.il_1)) | 0;
|
|
162
|
+
var result = this.il_1 == null ? 0 : hashCode(this.il_1);
|
|
160
163
|
result = imul(result, 31) + this.jl_1 | 0;
|
|
164
|
+
result = imul(result, 31) + (this.kl_1 == null ? 0 : hashCode(this.kl_1)) | 0;
|
|
165
|
+
result = imul(result, 31) + this.ll_1 | 0;
|
|
161
166
|
return result;
|
|
162
167
|
}
|
|
163
168
|
equals(other) {
|
|
@@ -165,91 +170,91 @@ class StashedSelection {
|
|
|
165
170
|
return true;
|
|
166
171
|
if (!(other instanceof StashedSelection))
|
|
167
172
|
return false;
|
|
168
|
-
if (!equals(this.gl_1, other.gl_1))
|
|
169
|
-
return false;
|
|
170
|
-
if (!(this.hl_1 === other.hl_1))
|
|
171
|
-
return false;
|
|
172
173
|
if (!equals(this.il_1, other.il_1))
|
|
173
174
|
return false;
|
|
174
175
|
if (!(this.jl_1 === other.jl_1))
|
|
175
176
|
return false;
|
|
177
|
+
if (!equals(this.kl_1, other.kl_1))
|
|
178
|
+
return false;
|
|
179
|
+
if (!(this.ll_1 === other.ll_1))
|
|
180
|
+
return false;
|
|
176
181
|
return true;
|
|
177
182
|
}
|
|
178
183
|
}
|
|
179
184
|
class BaseMarkdownDocument extends BaseWebComponent {
|
|
180
185
|
constructor() {
|
|
181
186
|
super();
|
|
182
|
-
this.
|
|
183
|
-
this.ll_1 = null;
|
|
184
|
-
this.ml_1 = document;
|
|
187
|
+
this.ml_1 = null;
|
|
185
188
|
this.nl_1 = null;
|
|
186
|
-
this.ol_1 =
|
|
189
|
+
this.ol_1 = document;
|
|
190
|
+
this.pl_1 = null;
|
|
191
|
+
this.ql_1 = true;
|
|
187
192
|
this.currentSelection = null;
|
|
188
193
|
this.editable = false;
|
|
189
|
-
this.pl_1 = null;
|
|
190
|
-
this.ql_1 = 0;
|
|
191
194
|
this.rl_1 = null;
|
|
192
|
-
this.sl_1 =
|
|
195
|
+
this.sl_1 = 0;
|
|
196
|
+
this.tl_1 = null;
|
|
197
|
+
this.ul_1 = false;
|
|
193
198
|
var tmp = this;
|
|
194
199
|
// Inline function 'kotlin.js.asDynamic' call
|
|
195
|
-
tmp.
|
|
200
|
+
tmp.vl_1 = window.chrome != null;
|
|
196
201
|
var tmp_0 = this;
|
|
197
|
-
tmp_0.
|
|
202
|
+
tmp_0.wl_1 = BaseMarkdownDocument$onMouseDown$lambda(this);
|
|
198
203
|
var tmp_1 = this;
|
|
199
|
-
tmp_1.
|
|
204
|
+
tmp_1.xl_1 = BaseMarkdownDocument$onMouseUp$lambda(this);
|
|
200
205
|
var tmp_2 = this;
|
|
201
|
-
tmp_2.
|
|
206
|
+
tmp_2.yl_1 = BaseMarkdownDocument$onSelectStart$lambda(this);
|
|
202
207
|
var tmp_3 = this;
|
|
203
|
-
tmp_3.
|
|
208
|
+
tmp_3.zl_1 = BaseMarkdownDocument$onSelectionChange$lambda(this);
|
|
204
209
|
this.upgradeProperty('parser');
|
|
205
210
|
this.upgradeProperty('markdown');
|
|
206
211
|
this.upgradeProperty('toolbar');
|
|
207
212
|
this.upgradeProperty('selectionRoot');
|
|
208
213
|
this.upgradeProperty('onLinkClick');
|
|
209
214
|
this.upgradeProperty('autoNormalize');
|
|
210
|
-
this.
|
|
211
|
-
}
|
|
212
|
-
im(value) {
|
|
213
|
-
this.kl_1 = value;
|
|
214
|
-
}
|
|
215
|
-
jm() {
|
|
216
|
-
var tmp0_elvis_lhs = this.kl_1;
|
|
217
|
-
return tmp0_elvis_lhs == null ? get_defaultParser() : tmp0_elvis_lhs;
|
|
215
|
+
this.am_1 = false;
|
|
218
216
|
}
|
|
219
217
|
km(value) {
|
|
220
|
-
|
|
218
|
+
this.ml_1 = value;
|
|
221
219
|
}
|
|
222
220
|
lm() {
|
|
223
|
-
|
|
221
|
+
var tmp0_elvis_lhs = this.ml_1;
|
|
222
|
+
return tmp0_elvis_lhs == null ? get_defaultParser() : tmp0_elvis_lhs;
|
|
224
223
|
}
|
|
225
224
|
mm(value) {
|
|
226
|
-
this
|
|
225
|
+
return renderMarkdown(this, value);
|
|
227
226
|
}
|
|
228
227
|
nm() {
|
|
229
|
-
return this.
|
|
228
|
+
return this.getMarkdown();
|
|
230
229
|
}
|
|
231
230
|
om(value) {
|
|
232
|
-
this.
|
|
231
|
+
this.nl_1 = value;
|
|
233
232
|
}
|
|
234
233
|
pm() {
|
|
235
|
-
return this.
|
|
234
|
+
return this.nl_1;
|
|
236
235
|
}
|
|
237
236
|
qm(value) {
|
|
238
|
-
this.
|
|
237
|
+
this.ol_1 = value;
|
|
239
238
|
}
|
|
240
239
|
rm() {
|
|
241
|
-
return this.
|
|
240
|
+
return this.ol_1;
|
|
242
241
|
}
|
|
243
242
|
sm(value) {
|
|
244
|
-
this.
|
|
243
|
+
this.pl_1 = value;
|
|
245
244
|
}
|
|
246
245
|
tm() {
|
|
247
|
-
return this.
|
|
246
|
+
return this.pl_1;
|
|
248
247
|
}
|
|
249
|
-
um() {
|
|
250
|
-
|
|
248
|
+
um(value) {
|
|
249
|
+
this.ql_1 = value;
|
|
251
250
|
}
|
|
252
251
|
vm() {
|
|
252
|
+
return this.ql_1;
|
|
253
|
+
}
|
|
254
|
+
wm() {
|
|
255
|
+
return this.currentSelection;
|
|
256
|
+
}
|
|
257
|
+
xm() {
|
|
253
258
|
return this.editable;
|
|
254
259
|
}
|
|
255
260
|
renderStandardShadow() {
|
|
@@ -264,36 +269,38 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
264
269
|
style(this_0, ":host {\n display: block;\n border: solid 1px gray;\n border-top: none;\n padding: 16px;\n /* inherited by descendants (including a shadow-DOM toolbar/headings), matching\n the original's separate styles/global-variables.ts stylesheet */\n --header1-font-size: 2em;\n --header2-font-size: 1.5em;\n --header3-font-size: 1.17em;\n --header4-font-size: 1em;\n --header5-font-size: 0.83em;\n --header6-font-size: 0.67em;\n}\n.toolbar {\n z-index: 3;\n top: 0px;\n position: fixed;\n right: 30%;\n background: white;\n}\n.toc {\n position: absolute;\n z-index: 3;\n top: 0px;\n right: 0%;\n}\n@media print {\n :host {\n border: none;\n }\n}");
|
|
265
270
|
element(this_0, 'div', BaseMarkdownDocument$renderStandardShadow$lambda);
|
|
266
271
|
}
|
|
267
|
-
|
|
268
|
-
super.
|
|
269
|
-
if (!this.
|
|
270
|
-
this.
|
|
272
|
+
cc() {
|
|
273
|
+
super.cc();
|
|
274
|
+
if (!this.am_1) {
|
|
275
|
+
this.am_1 = true;
|
|
271
276
|
firstUpdated(this);
|
|
272
277
|
}
|
|
273
278
|
this.setAttribute('contenteditable', this.getAttribute('readonly') === 'true' ? 'false' : 'true');
|
|
274
279
|
if (this.getAttribute('spellcheck') == null) {
|
|
275
280
|
this.setAttribute('spellcheck', 'false');
|
|
276
281
|
}
|
|
277
|
-
this.addEventListener('mousedown', this.
|
|
278
|
-
this.addEventListener('mouseup', this.
|
|
279
|
-
document.addEventListener('selectstart', this.
|
|
280
|
-
document.addEventListener('selectionchange', this.
|
|
282
|
+
this.addEventListener('mousedown', this.wl_1);
|
|
283
|
+
this.addEventListener('mouseup', this.xl_1);
|
|
284
|
+
document.addEventListener('selectstart', this.yl_1);
|
|
285
|
+
document.addEventListener('selectionchange', this.zl_1);
|
|
281
286
|
this.addEventListener('keydown', BaseMarkdownDocument$connectedCallback$lambda(this));
|
|
282
287
|
this.addEventListener('input', BaseMarkdownDocument$connectedCallback$lambda_0(this));
|
|
283
288
|
this.addEventListener('blur', BaseMarkdownDocument$connectedCallback$lambda_1(this));
|
|
284
289
|
this.addEventListener('drop', BaseMarkdownDocument$connectedCallback$lambda_2(this));
|
|
285
290
|
this.addEventListener('dragover', BaseMarkdownDocument$connectedCallback$lambda_3(this));
|
|
286
291
|
this.addEventListener('paste', BaseMarkdownDocument$connectedCallback$lambda_4(this));
|
|
292
|
+
this.addEventListener('copy', BaseMarkdownDocument$connectedCallback$lambda_5(this));
|
|
293
|
+
this.addEventListener('cut', BaseMarkdownDocument$connectedCallback$lambda_6(this));
|
|
287
294
|
}
|
|
288
295
|
connectedCallback() {
|
|
289
|
-
return this.
|
|
296
|
+
return this.cc();
|
|
290
297
|
}
|
|
291
|
-
|
|
292
|
-
document.removeEventListener('selectionchange', this.
|
|
293
|
-
document.removeEventListener('selectstart', this.
|
|
298
|
+
dc() {
|
|
299
|
+
document.removeEventListener('selectionchange', this.zl_1);
|
|
300
|
+
document.removeEventListener('selectstart', this.yl_1);
|
|
294
301
|
}
|
|
295
302
|
disconnectedCallback() {
|
|
296
|
-
return this.
|
|
303
|
+
return this.dc();
|
|
297
304
|
}
|
|
298
305
|
getSelection() {
|
|
299
306
|
return getSelection(this.selectionRoot);
|
|
@@ -305,9 +312,9 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
305
312
|
return 0;
|
|
306
313
|
var result = 0;
|
|
307
314
|
// Inline function 'kotlin.collections.forEach' call
|
|
308
|
-
var _iterator__ex2g4s = nodes.o1(0, indexOfChild).
|
|
309
|
-
while (_iterator__ex2g4s.
|
|
310
|
-
var element = _iterator__ex2g4s.
|
|
315
|
+
var _iterator__ex2g4s = nodes.o1(0, indexOfChild).r();
|
|
316
|
+
while (_iterator__ex2g4s.s()) {
|
|
317
|
+
var element = _iterator__ex2g4s.t();
|
|
311
318
|
if (element instanceof MarkdownComponent)
|
|
312
319
|
result = result + element.contentLength() | 0;
|
|
313
320
|
}
|
|
@@ -319,9 +326,9 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
319
326
|
contentLength() {
|
|
320
327
|
var result = 0;
|
|
321
328
|
// Inline function 'kotlin.collections.forEach' call
|
|
322
|
-
var _iterator__ex2g4s = asList(this.children).
|
|
323
|
-
while (_iterator__ex2g4s.
|
|
324
|
-
var element = _iterator__ex2g4s.
|
|
329
|
+
var _iterator__ex2g4s = asList(this.children).r();
|
|
330
|
+
while (_iterator__ex2g4s.s()) {
|
|
331
|
+
var element = _iterator__ex2g4s.t();
|
|
325
332
|
if (element instanceof MarkdownComponent)
|
|
326
333
|
result = result + element.contentLength() | 0;
|
|
327
334
|
}
|
|
@@ -332,7 +339,7 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
332
339
|
tmp.setTimeout(BaseMarkdownDocument$onChange$lambda(this), 0);
|
|
333
340
|
}
|
|
334
341
|
setToolbar(newToolbar) {
|
|
335
|
-
this.
|
|
342
|
+
this.om(newToolbar);
|
|
336
343
|
var tmp0_safe_receiver = newToolbar instanceof MarkdownToolbar ? newToolbar : null;
|
|
337
344
|
if (tmp0_safe_receiver == null)
|
|
338
345
|
null;
|
|
@@ -355,7 +362,7 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
355
362
|
return null;
|
|
356
363
|
}
|
|
357
364
|
getLastLeafBlock() {
|
|
358
|
-
var element = this.
|
|
365
|
+
var element = this.rl_1;
|
|
359
366
|
while (!(element == null) && !equals(element, document) && !equals(element, this)) {
|
|
360
367
|
if (element instanceof LeafElement)
|
|
361
368
|
return element;
|
|
@@ -598,7 +605,7 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
598
605
|
image.title = text;
|
|
599
606
|
}
|
|
600
607
|
if (!(url == null)) {
|
|
601
|
-
image.
|
|
608
|
+
image.cm(url);
|
|
602
609
|
}
|
|
603
610
|
var tmp2_safe_receiver = this.currentSelection;
|
|
604
611
|
var anchorOffset = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.anchorOffset;
|
|
@@ -617,7 +624,7 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
617
624
|
}
|
|
618
625
|
}
|
|
619
626
|
restoreStashedSelection() {
|
|
620
|
-
var tmp0_elvis_lhs = this.
|
|
627
|
+
var tmp0_elvis_lhs = this.tl_1;
|
|
621
628
|
var tmp;
|
|
622
629
|
if (tmp0_elvis_lhs == null) {
|
|
623
630
|
return Unit_instance;
|
|
@@ -626,8 +633,8 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
626
633
|
}
|
|
627
634
|
var stashed = tmp;
|
|
628
635
|
var range = document.createRange();
|
|
629
|
-
range.setStart(ensureNotNull(stashed.
|
|
630
|
-
range.setEnd(ensureNotNull(stashed.
|
|
636
|
+
range.setStart(ensureNotNull(stashed.il_1), stashed.jl_1);
|
|
637
|
+
range.setEnd(ensureNotNull(stashed.kl_1), stashed.ll_1);
|
|
631
638
|
var tmp1_safe_receiver = this.currentSelection;
|
|
632
639
|
if (tmp1_safe_receiver == null)
|
|
633
640
|
null;
|
|
@@ -657,7 +664,7 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
657
664
|
link.textContent = 'http://';
|
|
658
665
|
}
|
|
659
666
|
var tmp1_elvis_lhs = link.textContent;
|
|
660
|
-
link.
|
|
667
|
+
link.cm(tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs);
|
|
661
668
|
link.classList.add('fresh');
|
|
662
669
|
}
|
|
663
670
|
header1Element() {
|
|
@@ -726,40 +733,40 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
726
733
|
this.onChange();
|
|
727
734
|
}
|
|
728
735
|
get parser() {
|
|
729
|
-
return this.
|
|
736
|
+
return this.lm();
|
|
730
737
|
}
|
|
731
738
|
set parser(value) {
|
|
732
|
-
this.
|
|
739
|
+
this.km(value);
|
|
733
740
|
}
|
|
734
741
|
get markdown() {
|
|
735
|
-
return this.
|
|
742
|
+
return this.nm();
|
|
736
743
|
}
|
|
737
744
|
set markdown(value) {
|
|
738
|
-
this.
|
|
745
|
+
this.mm(value);
|
|
739
746
|
}
|
|
740
747
|
get toolbar() {
|
|
741
|
-
return this.
|
|
748
|
+
return this.pm();
|
|
742
749
|
}
|
|
743
750
|
set toolbar(value) {
|
|
744
|
-
this.
|
|
751
|
+
this.om(value);
|
|
745
752
|
}
|
|
746
753
|
get selectionRoot() {
|
|
747
|
-
return this.
|
|
754
|
+
return this.rm();
|
|
748
755
|
}
|
|
749
756
|
set selectionRoot(value) {
|
|
750
|
-
this.
|
|
757
|
+
this.qm(value);
|
|
751
758
|
}
|
|
752
759
|
get onLinkClick() {
|
|
753
|
-
return this.
|
|
760
|
+
return this.tm();
|
|
754
761
|
}
|
|
755
762
|
set onLinkClick(value) {
|
|
756
|
-
this.
|
|
763
|
+
this.sm(value);
|
|
757
764
|
}
|
|
758
765
|
get autoNormalize() {
|
|
759
|
-
return this.
|
|
766
|
+
return this.vm();
|
|
760
767
|
}
|
|
761
768
|
set autoNormalize(value) {
|
|
762
|
-
this.
|
|
769
|
+
this.um(value);
|
|
763
770
|
}
|
|
764
771
|
}
|
|
765
772
|
class MarkdownDocument extends BaseMarkdownDocument {
|
|
@@ -786,7 +793,7 @@ class MarkdownEditor extends BaseMarkdownDocument {
|
|
|
786
793
|
class MarkdownToolbar extends BaseWebComponent {
|
|
787
794
|
constructor() {
|
|
788
795
|
super();
|
|
789
|
-
this.
|
|
796
|
+
this.bn_1 = null;
|
|
790
797
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
791
798
|
// Inline function 'kotlin.js.asDynamic' call
|
|
792
799
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -794,11 +801,11 @@ class MarkdownToolbar extends BaseWebComponent {
|
|
|
794
801
|
var o = {};
|
|
795
802
|
o['mode'] = 'open';
|
|
796
803
|
var shadow = this.attachShadow(o);
|
|
797
|
-
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.
|
|
804
|
+
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}');
|
|
798
805
|
var toolbarRow = element(shadow, 'div', MarkdownToolbar$lambda);
|
|
799
806
|
var dropdown = element(toolbarRow, 'toolbar-dropdown');
|
|
800
807
|
var tmp = this;
|
|
801
|
-
tmp.
|
|
808
|
+
tmp.fn_1 = element(dropdown, 'span', MarkdownToolbar$lambda_0);
|
|
802
809
|
dropdown.appendChild(document.createTextNode(' \u25BE'));
|
|
803
810
|
var dropdownElements = element(dropdown, 'dropdown-elements', MarkdownToolbar$lambda_1);
|
|
804
811
|
headingOption(this, dropdownElements, 1, MarkdownToolbar$lambda_2(this));
|
|
@@ -810,11 +817,11 @@ class MarkdownToolbar extends BaseWebComponent {
|
|
|
810
817
|
paragraphOption(this, dropdownElements, MarkdownToolbar$lambda_8(this));
|
|
811
818
|
element(toolbarRow, 'toolbar-separator');
|
|
812
819
|
var tmp_0 = this;
|
|
813
|
-
tmp_0.
|
|
820
|
+
tmp_0.cn_1 = toggleButton(this, toolbarRow, 'bold', 'toggle bold', MarkdownToolbar$lambda_9(this));
|
|
814
821
|
var tmp_1 = this;
|
|
815
|
-
tmp_1.
|
|
822
|
+
tmp_1.dn_1 = toggleButton(this, toolbarRow, 'italic', 'toggle italic', MarkdownToolbar$lambda_10(this));
|
|
816
823
|
var tmp_2 = this;
|
|
817
|
-
tmp_2.
|
|
824
|
+
tmp_2.en_1 = toggleButton(this, toolbarRow, 'strikethrough', 'toggle strike', MarkdownToolbar$lambda_11(this));
|
|
818
825
|
element(toolbarRow, 'toolbar-separator');
|
|
819
826
|
actionButton(this, toolbarRow, 'list-bulleted', 'list', MarkdownToolbar$lambda_12(this));
|
|
820
827
|
actionButton(this, toolbarRow, 'list-numbered', 'numbered list', MarkdownToolbar$lambda_13(this));
|
|
@@ -830,48 +837,48 @@ class MarkdownToolbar extends BaseWebComponent {
|
|
|
830
837
|
slot(shadow);
|
|
831
838
|
this.upgradeProperty('markdownDocument');
|
|
832
839
|
}
|
|
833
|
-
|
|
834
|
-
this.
|
|
840
|
+
in(value) {
|
|
841
|
+
this.bn_1 = value;
|
|
835
842
|
}
|
|
836
|
-
|
|
837
|
-
return this.
|
|
843
|
+
jn() {
|
|
844
|
+
return this.bn_1;
|
|
838
845
|
}
|
|
839
|
-
|
|
840
|
-
super.
|
|
846
|
+
cc() {
|
|
847
|
+
super.cc();
|
|
841
848
|
this.addEventListener('mousedown', MarkdownToolbar$connectedCallback$lambda);
|
|
842
849
|
}
|
|
843
850
|
connectedCallback() {
|
|
844
|
-
return this.
|
|
851
|
+
return this.cc();
|
|
845
852
|
}
|
|
846
853
|
setMarkdownDocument(document) {
|
|
847
|
-
this.
|
|
854
|
+
this.in(document);
|
|
848
855
|
}
|
|
849
856
|
highlightBoldButton() {
|
|
850
|
-
this.
|
|
857
|
+
this.cn_1.hl(true);
|
|
851
858
|
}
|
|
852
859
|
removeBoldButtonHighlighting() {
|
|
853
|
-
this.
|
|
860
|
+
this.cn_1.hl(false);
|
|
854
861
|
}
|
|
855
862
|
highlightItalicButton() {
|
|
856
|
-
this.
|
|
863
|
+
this.dn_1.hl(true);
|
|
857
864
|
}
|
|
858
865
|
removeItalicButtonHighlighting() {
|
|
859
|
-
this.
|
|
866
|
+
this.dn_1.hl(false);
|
|
860
867
|
}
|
|
861
868
|
highlightStrikeButton() {
|
|
862
|
-
this.
|
|
869
|
+
this.en_1.hl(true);
|
|
863
870
|
}
|
|
864
871
|
removeStrikeButtonHighlighting() {
|
|
865
|
-
this.
|
|
872
|
+
this.en_1.hl(false);
|
|
866
873
|
}
|
|
867
874
|
setDropdownTitle(title) {
|
|
868
|
-
this.
|
|
875
|
+
this.fn_1.textContent = title;
|
|
869
876
|
}
|
|
870
877
|
get markdownDocument() {
|
|
871
|
-
return this.
|
|
878
|
+
return this.jn();
|
|
872
879
|
}
|
|
873
880
|
set markdownDocument(value) {
|
|
874
|
-
this.
|
|
881
|
+
this.in(value);
|
|
875
882
|
}
|
|
876
883
|
}
|
|
877
884
|
class ToggleToolbarButton extends BaseWebComponent {
|
|
@@ -886,12 +893,12 @@ class ToggleToolbarButton extends BaseWebComponent {
|
|
|
886
893
|
var shadow = this.attachShadow(o);
|
|
887
894
|
var tmp = this;
|
|
888
895
|
var tmp_0 = element(shadow, 'toolbar-button', ToggleToolbarButton$lambda);
|
|
889
|
-
tmp.
|
|
896
|
+
tmp.gn_1 = tmp_0 instanceof ToolbarButton ? tmp_0 : THROW_CCE();
|
|
890
897
|
var tmp_1 = this;
|
|
891
|
-
var tmp_2 = element(this.
|
|
892
|
-
tmp_1.
|
|
898
|
+
var tmp_2 = element(this.gn_1, 'toolbar-icon', ToggleToolbarButton$lambda_0);
|
|
899
|
+
tmp_1.hn_1 = tmp_2 instanceof ToolbarIcon ? tmp_2 : THROW_CCE();
|
|
893
900
|
}
|
|
894
|
-
|
|
901
|
+
hl(value) {
|
|
895
902
|
var tmp;
|
|
896
903
|
if (value) {
|
|
897
904
|
this.setAttribute('highlighted', '');
|
|
@@ -902,18 +909,18 @@ class ToggleToolbarButton extends BaseWebComponent {
|
|
|
902
909
|
}
|
|
903
910
|
return tmp;
|
|
904
911
|
}
|
|
905
|
-
|
|
912
|
+
fl() {
|
|
906
913
|
return this.hasAttribute('highlighted');
|
|
907
914
|
}
|
|
908
|
-
|
|
915
|
+
fc(name, oldValue, newValue) {
|
|
909
916
|
if (name === 'highlighted') {
|
|
910
|
-
this.
|
|
917
|
+
this.gn_1.hl(this.fl());
|
|
911
918
|
} else if (name === 'icon') {
|
|
912
|
-
this.
|
|
919
|
+
this.hn_1.ln(newValue == null ? '' : newValue);
|
|
913
920
|
}
|
|
914
921
|
}
|
|
915
922
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
916
|
-
return this.
|
|
923
|
+
return this.fc(name, oldValue, newValue);
|
|
917
924
|
}
|
|
918
925
|
}
|
|
919
926
|
class ToolbarButton extends BaseWebComponent {
|
|
@@ -928,9 +935,9 @@ class ToolbarButton extends BaseWebComponent {
|
|
|
928
935
|
var shadow = this.attachShadow(o);
|
|
929
936
|
style(shadow, 'button {\n padding: 0;\n margin: 0;\n border: none;\n background-color: transparent;\n vertical-align: center;\n height: 24px;\n}\nbutton:hover {\n background-color: lightblue;\n}\n.highlighted {\n background-color: gray;\n}');
|
|
930
937
|
var tmp = this;
|
|
931
|
-
tmp.
|
|
938
|
+
tmp.gl_1 = element(shadow, 'button', ToolbarButton$lambda);
|
|
932
939
|
}
|
|
933
|
-
|
|
940
|
+
hl(value) {
|
|
934
941
|
var tmp;
|
|
935
942
|
if (value) {
|
|
936
943
|
this.setAttribute('highlighted', '');
|
|
@@ -941,24 +948,24 @@ class ToolbarButton extends BaseWebComponent {
|
|
|
941
948
|
}
|
|
942
949
|
return tmp;
|
|
943
950
|
}
|
|
944
|
-
|
|
951
|
+
fc(name, oldValue, newValue) {
|
|
945
952
|
if (name === 'highlighted') {
|
|
946
953
|
if (!(newValue == null)) {
|
|
947
|
-
this.
|
|
954
|
+
this.gl_1.classList.add('highlighted');
|
|
948
955
|
} else {
|
|
949
|
-
this.
|
|
956
|
+
this.gl_1.classList.remove('highlighted');
|
|
950
957
|
}
|
|
951
958
|
}
|
|
952
959
|
}
|
|
953
960
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
954
|
-
return this.
|
|
961
|
+
return this.fc(name, oldValue, newValue);
|
|
955
962
|
}
|
|
956
963
|
}
|
|
957
964
|
class ToolbarDropdown extends BaseWebComponent {
|
|
958
965
|
constructor() {
|
|
959
966
|
super();
|
|
960
967
|
var tmp = this;
|
|
961
|
-
tmp.
|
|
968
|
+
tmp.nn_1 = ToolbarDropdown$hideOnOutsideMouseDown$lambda(this);
|
|
962
969
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
963
970
|
// Inline function 'kotlin.js.asDynamic' call
|
|
964
971
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -970,20 +977,20 @@ class ToolbarDropdown extends BaseWebComponent {
|
|
|
970
977
|
var button = element(shadow, 'toolbar-button', ToolbarDropdown$lambda);
|
|
971
978
|
button.addEventListener('mousedown', ToolbarDropdown$lambda_0(this));
|
|
972
979
|
var tmp_0 = this;
|
|
973
|
-
tmp_0.
|
|
980
|
+
tmp_0.mn_1 = element(shadow, 'slot', ToolbarDropdown$lambda_1);
|
|
974
981
|
}
|
|
975
|
-
|
|
976
|
-
super.
|
|
977
|
-
document.addEventListener('mousedown', this.
|
|
982
|
+
cc() {
|
|
983
|
+
super.cc();
|
|
984
|
+
document.addEventListener('mousedown', this.nn_1);
|
|
978
985
|
}
|
|
979
986
|
connectedCallback() {
|
|
980
|
-
return this.
|
|
987
|
+
return this.cc();
|
|
981
988
|
}
|
|
982
|
-
|
|
983
|
-
document.removeEventListener('mousedown', this.
|
|
989
|
+
dc() {
|
|
990
|
+
document.removeEventListener('mousedown', this.nn_1);
|
|
984
991
|
}
|
|
985
992
|
disconnectedCallback() {
|
|
986
|
-
return this.
|
|
993
|
+
return this.dc();
|
|
987
994
|
}
|
|
988
995
|
}
|
|
989
996
|
class ToolbarIcon extends BaseWebComponent {
|
|
@@ -997,18 +1004,18 @@ class ToolbarIcon extends BaseWebComponent {
|
|
|
997
1004
|
o['mode'] = 'open';
|
|
998
1005
|
var shadow = this.attachShadow(o);
|
|
999
1006
|
style(shadow, ':host {\n display: inline-flex;\n width: 24px;\n height: 24px;\n align-items: center;\n justify-content: center;\n color: inherit;\n}\nspan, svg {\n display: block;\n width: 100%;\n height: 100%;\n}');
|
|
1000
|
-
this.
|
|
1007
|
+
this.kn_1 = element(shadow, 'span');
|
|
1001
1008
|
}
|
|
1002
|
-
|
|
1009
|
+
ln(value) {
|
|
1003
1010
|
return this.setAttribute('icon', value);
|
|
1004
1011
|
}
|
|
1005
|
-
|
|
1012
|
+
fc(name, oldValue, newValue) {
|
|
1006
1013
|
if (name === 'icon') {
|
|
1007
|
-
this.
|
|
1014
|
+
this.kn_1.innerHTML = svgFor(this, newValue == null ? '' : newValue);
|
|
1008
1015
|
}
|
|
1009
1016
|
}
|
|
1010
1017
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
1011
|
-
return this.
|
|
1018
|
+
return this.fc(name, oldValue, newValue);
|
|
1012
1019
|
}
|
|
1013
1020
|
}
|
|
1014
1021
|
class ToolbarSeparator extends BaseWebComponent {
|
|
@@ -1050,13 +1057,13 @@ class MarkdownComponent extends BaseWebComponent {
|
|
|
1050
1057
|
var indexOfBreak = siblings.n1(content);
|
|
1051
1058
|
var elementsToMove = drop(siblings, indexOfBreak + 1 | 0);
|
|
1052
1059
|
var tmp_0;
|
|
1053
|
-
if (elementsToMove.
|
|
1060
|
+
if (elementsToMove.d1()) {
|
|
1054
1061
|
tmp_0 = this.newEmptyElementAfterBreak();
|
|
1055
1062
|
} else {
|
|
1056
1063
|
var tmp_1;
|
|
1057
|
-
if (elementsToMove.
|
|
1064
|
+
if (elementsToMove.u() === 1) {
|
|
1058
1065
|
// Inline function 'kotlin.let' call
|
|
1059
|
-
var it = elementsToMove.
|
|
1066
|
+
var it = elementsToMove.v(0);
|
|
1060
1067
|
var tmp_2;
|
|
1061
1068
|
if (it instanceof Text) {
|
|
1062
1069
|
tmp_2 = it.textContent === get_ZERO_WIDTH_SPACE();
|
|
@@ -1084,17 +1091,17 @@ class MarkdownComponent extends BaseWebComponent {
|
|
|
1084
1091
|
var rightElement = tmp_0;
|
|
1085
1092
|
if (!(rightElement == null)) {
|
|
1086
1093
|
// Inline function 'kotlin.collections.forEach' call
|
|
1087
|
-
var _iterator__ex2g4s = elementsToMove.
|
|
1088
|
-
while (_iterator__ex2g4s.
|
|
1089
|
-
var element = _iterator__ex2g4s.
|
|
1094
|
+
var _iterator__ex2g4s = elementsToMove.r();
|
|
1095
|
+
while (_iterator__ex2g4s.s()) {
|
|
1096
|
+
var element = _iterator__ex2g4s.t();
|
|
1090
1097
|
rightElement.append(element);
|
|
1091
1098
|
}
|
|
1092
1099
|
parent.insertBefore(rightElement, this.nextSibling);
|
|
1093
1100
|
} else {
|
|
1094
1101
|
// Inline function 'kotlin.collections.forEach' call
|
|
1095
|
-
var _iterator__ex2g4s_0 = elementsToMove.
|
|
1096
|
-
while (_iterator__ex2g4s_0.
|
|
1097
|
-
var element_0 = _iterator__ex2g4s_0.
|
|
1102
|
+
var _iterator__ex2g4s_0 = elementsToMove.r();
|
|
1103
|
+
while (_iterator__ex2g4s_0.s()) {
|
|
1104
|
+
var element_0 = _iterator__ex2g4s_0.t();
|
|
1098
1105
|
parent.insertBefore(element_0, this.nextSibling);
|
|
1099
1106
|
}
|
|
1100
1107
|
}
|
|
@@ -1159,9 +1166,9 @@ class MarkdownComponent extends BaseWebComponent {
|
|
|
1159
1166
|
contentLength() {
|
|
1160
1167
|
var result = 0;
|
|
1161
1168
|
// Inline function 'kotlin.collections.forEach' call
|
|
1162
|
-
var _iterator__ex2g4s = asList(this.childNodes).
|
|
1163
|
-
while (_iterator__ex2g4s.
|
|
1164
|
-
var element = _iterator__ex2g4s.
|
|
1169
|
+
var _iterator__ex2g4s = asList(this.childNodes).r();
|
|
1170
|
+
while (_iterator__ex2g4s.s()) {
|
|
1171
|
+
var element = _iterator__ex2g4s.t();
|
|
1165
1172
|
var tmp = result;
|
|
1166
1173
|
var tmp_0;
|
|
1167
1174
|
if (element instanceof MarkdownComponent) {
|
|
@@ -1186,9 +1193,9 @@ class MarkdownComponent extends BaseWebComponent {
|
|
|
1186
1193
|
var result = 0;
|
|
1187
1194
|
if (indexOfChild >= 0) {
|
|
1188
1195
|
// Inline function 'kotlin.collections.forEach' call
|
|
1189
|
-
var _iterator__ex2g4s = nodes.o1(0, indexOfChild).
|
|
1190
|
-
while (_iterator__ex2g4s.
|
|
1191
|
-
var element = _iterator__ex2g4s.
|
|
1196
|
+
var _iterator__ex2g4s = nodes.o1(0, indexOfChild).r();
|
|
1197
|
+
while (_iterator__ex2g4s.s()) {
|
|
1198
|
+
var element = _iterator__ex2g4s.t();
|
|
1192
1199
|
var tmp = result;
|
|
1193
1200
|
var tmp_0;
|
|
1194
1201
|
if (element instanceof MarkdownComponent) {
|
|
@@ -1216,12 +1223,12 @@ class MarkdownComponent extends BaseWebComponent {
|
|
|
1216
1223
|
}
|
|
1217
1224
|
getNodeAndOffsetFromContentOffsetAnchor(contentOffset) {
|
|
1218
1225
|
var nodes = asList(this.childNodes);
|
|
1219
|
-
if (nodes.
|
|
1226
|
+
if (nodes.d1())
|
|
1220
1227
|
return to(this, contentOffset);
|
|
1221
|
-
var resultNode = nodes.
|
|
1222
|
-
var _iterator__ex2g4s = nodes.
|
|
1223
|
-
$l$loop_0: while (_iterator__ex2g4s.
|
|
1224
|
-
var child = _iterator__ex2g4s.
|
|
1228
|
+
var resultNode = nodes.v(0);
|
|
1229
|
+
var _iterator__ex2g4s = nodes.r();
|
|
1230
|
+
$l$loop_0: while (_iterator__ex2g4s.s()) {
|
|
1231
|
+
var child = _iterator__ex2g4s.t();
|
|
1225
1232
|
var lengthUntilChild = this.contentLengthUntil(child);
|
|
1226
1233
|
if (contentOffset === lengthUntilChild) {
|
|
1227
1234
|
resultNode = child;
|
|
@@ -1241,13 +1248,13 @@ class MarkdownComponent extends BaseWebComponent {
|
|
|
1241
1248
|
}
|
|
1242
1249
|
getNodeAndOffsetFromContentOffset(contentOffset) {
|
|
1243
1250
|
var nodes = asList(this.childNodes);
|
|
1244
|
-
if (nodes.
|
|
1251
|
+
if (nodes.d1())
|
|
1245
1252
|
return to(this, contentOffset);
|
|
1246
|
-
var resultNode = nodes.
|
|
1253
|
+
var resultNode = nodes.v(0);
|
|
1247
1254
|
var previousNodeWasEol = false;
|
|
1248
|
-
var _iterator__ex2g4s = nodes.
|
|
1249
|
-
$l$loop_0: while (_iterator__ex2g4s.
|
|
1250
|
-
var child = _iterator__ex2g4s.
|
|
1255
|
+
var _iterator__ex2g4s = nodes.r();
|
|
1256
|
+
$l$loop_0: while (_iterator__ex2g4s.s()) {
|
|
1257
|
+
var child = _iterator__ex2g4s.t();
|
|
1251
1258
|
var lengthUntilChild = this.contentLengthUntil(child);
|
|
1252
1259
|
if (contentOffset === lengthUntilChild) {
|
|
1253
1260
|
if (previousNodeWasEol)
|
|
@@ -1278,21 +1285,21 @@ class MarkdownComponent extends BaseWebComponent {
|
|
|
1278
1285
|
return joinToString(tmp, '', VOID, VOID, VOID, VOID, MarkdownComponent$getMarkdown$lambda);
|
|
1279
1286
|
}
|
|
1280
1287
|
get mustBeDirectChildOfDocument() {
|
|
1281
|
-
return this.
|
|
1288
|
+
return this.on();
|
|
1282
1289
|
}
|
|
1283
1290
|
}
|
|
1284
1291
|
class BlockElement extends MarkdownComponent {
|
|
1285
1292
|
get mustBeDirectChildOfDocument() {
|
|
1286
|
-
return this.
|
|
1293
|
+
return this.on();
|
|
1287
1294
|
}
|
|
1288
1295
|
}
|
|
1289
1296
|
class ContainerElement extends MarkdownComponent {
|
|
1290
1297
|
contentLength() {
|
|
1291
1298
|
var result = 0;
|
|
1292
1299
|
// Inline function 'kotlin.collections.forEach' call
|
|
1293
|
-
var _iterator__ex2g4s = asList(this.childNodes).
|
|
1294
|
-
while (_iterator__ex2g4s.
|
|
1295
|
-
var element = _iterator__ex2g4s.
|
|
1300
|
+
var _iterator__ex2g4s = asList(this.childNodes).r();
|
|
1301
|
+
while (_iterator__ex2g4s.s()) {
|
|
1302
|
+
var element = _iterator__ex2g4s.t();
|
|
1296
1303
|
if (element instanceof MarkdownComponent)
|
|
1297
1304
|
result = result + element.contentLength() | 0;
|
|
1298
1305
|
}
|
|
@@ -1304,9 +1311,9 @@ class ContainerElement extends MarkdownComponent {
|
|
|
1304
1311
|
var result = 0;
|
|
1305
1312
|
if (indexOfChild >= 0) {
|
|
1306
1313
|
// Inline function 'kotlin.collections.forEach' call
|
|
1307
|
-
var _iterator__ex2g4s = nodes.o1(0, indexOfChild).
|
|
1308
|
-
while (_iterator__ex2g4s.
|
|
1309
|
-
var element = _iterator__ex2g4s.
|
|
1314
|
+
var _iterator__ex2g4s = nodes.o1(0, indexOfChild).r();
|
|
1315
|
+
while (_iterator__ex2g4s.s()) {
|
|
1316
|
+
var element = _iterator__ex2g4s.t();
|
|
1310
1317
|
if (element instanceof MarkdownComponent)
|
|
1311
1318
|
result = result + element.contentLength() | 0;
|
|
1312
1319
|
}
|
|
@@ -1317,7 +1324,7 @@ class ContainerElement extends MarkdownComponent {
|
|
|
1317
1324
|
return this.children.length > 0;
|
|
1318
1325
|
}
|
|
1319
1326
|
get mustBeDirectChildOfDocument() {
|
|
1320
|
-
return this.
|
|
1327
|
+
return this.on();
|
|
1321
1328
|
}
|
|
1322
1329
|
}
|
|
1323
1330
|
class LeafElement extends BlockElement {
|
|
@@ -1331,9 +1338,9 @@ class LeafElement extends BlockElement {
|
|
|
1331
1338
|
return true;
|
|
1332
1339
|
}
|
|
1333
1340
|
var sawBr = false;
|
|
1334
|
-
var _iterator__ex2g4s = asList(this.childNodes).
|
|
1335
|
-
$l$loop: while (_iterator__ex2g4s.
|
|
1336
|
-
var content = _iterator__ex2g4s.
|
|
1341
|
+
var _iterator__ex2g4s = asList(this.childNodes).r();
|
|
1342
|
+
$l$loop: while (_iterator__ex2g4s.s()) {
|
|
1343
|
+
var content = _iterator__ex2g4s.t();
|
|
1337
1344
|
if (content instanceof HTMLBRElement) {
|
|
1338
1345
|
if (sawBr) {
|
|
1339
1346
|
this.removeChild(content);
|
|
@@ -1343,9 +1350,9 @@ class LeafElement extends BlockElement {
|
|
|
1343
1350
|
}
|
|
1344
1351
|
}
|
|
1345
1352
|
// Inline function 'kotlin.collections.forEach' call
|
|
1346
|
-
var _iterator__ex2g4s_0 = asList(this.childNodes).
|
|
1347
|
-
while (_iterator__ex2g4s_0.
|
|
1348
|
-
var element = _iterator__ex2g4s_0.
|
|
1353
|
+
var _iterator__ex2g4s_0 = asList(this.childNodes).r();
|
|
1354
|
+
while (_iterator__ex2g4s_0.s()) {
|
|
1355
|
+
var element = _iterator__ex2g4s_0.t();
|
|
1349
1356
|
if (element instanceof HTMLBRElement) {
|
|
1350
1357
|
this.pushNodesAfterBreakToParent(element);
|
|
1351
1358
|
this.removeChild(element);
|
|
@@ -1387,9 +1394,9 @@ class LeafElement extends BlockElement {
|
|
|
1387
1394
|
other.setSelectionToEnd(currentSelection);
|
|
1388
1395
|
}
|
|
1389
1396
|
// Inline function 'kotlin.collections.forEach' call
|
|
1390
|
-
var _iterator__ex2g4s = toList(asList(this.childNodes)).
|
|
1391
|
-
while (_iterator__ex2g4s.
|
|
1392
|
-
var element = _iterator__ex2g4s.
|
|
1397
|
+
var _iterator__ex2g4s = toList(asList(this.childNodes)).r();
|
|
1398
|
+
while (_iterator__ex2g4s.s()) {
|
|
1399
|
+
var element = _iterator__ex2g4s.t();
|
|
1393
1400
|
other.appendChild(element);
|
|
1394
1401
|
}
|
|
1395
1402
|
this.remove();
|
|
@@ -1403,9 +1410,9 @@ class LeafElement extends BlockElement {
|
|
|
1403
1410
|
var next = this.nextElementSibling;
|
|
1404
1411
|
if (next instanceof LeafElement) {
|
|
1405
1412
|
// Inline function 'kotlin.collections.forEach' call
|
|
1406
|
-
var _iterator__ex2g4s = toList(asList(next.childNodes)).
|
|
1407
|
-
while (_iterator__ex2g4s.
|
|
1408
|
-
var element = _iterator__ex2g4s.
|
|
1413
|
+
var _iterator__ex2g4s = toList(asList(next.childNodes)).r();
|
|
1414
|
+
while (_iterator__ex2g4s.s()) {
|
|
1415
|
+
var element = _iterator__ex2g4s.t();
|
|
1409
1416
|
this.appendChild(element);
|
|
1410
1417
|
}
|
|
1411
1418
|
next.remove();
|
|
@@ -1429,16 +1436,16 @@ class LeafElement extends BlockElement {
|
|
|
1429
1436
|
return tmp;
|
|
1430
1437
|
}
|
|
1431
1438
|
get mustBeDirectChildOfDocument() {
|
|
1432
|
-
return this.
|
|
1439
|
+
return this.on();
|
|
1433
1440
|
}
|
|
1434
1441
|
}
|
|
1435
1442
|
class Heading extends LeafElement {
|
|
1436
1443
|
constructor() {
|
|
1437
1444
|
super();
|
|
1438
|
-
this.
|
|
1445
|
+
this.pn_1 = true;
|
|
1439
1446
|
}
|
|
1440
|
-
|
|
1441
|
-
return this.
|
|
1447
|
+
on() {
|
|
1448
|
+
return this.pn_1;
|
|
1442
1449
|
}
|
|
1443
1450
|
getMarkdown() {
|
|
1444
1451
|
return repeat('#', this.depth) + ' ' + getMarkdownWithTextForElement(this) + '\n';
|
|
@@ -1463,19 +1470,19 @@ class Heading extends LeafElement {
|
|
|
1463
1470
|
element(this_0, tmp, Heading$renderHeading$lambda);
|
|
1464
1471
|
}
|
|
1465
1472
|
get depth() {
|
|
1466
|
-
return this.
|
|
1473
|
+
return this.qn();
|
|
1467
1474
|
}
|
|
1468
1475
|
get mustBeDirectChildOfDocument() {
|
|
1469
|
-
return this.
|
|
1476
|
+
return this.on();
|
|
1470
1477
|
}
|
|
1471
1478
|
}
|
|
1472
1479
|
class InlineElement extends MarkdownComponent {
|
|
1473
1480
|
constructor() {
|
|
1474
1481
|
super();
|
|
1475
|
-
this.
|
|
1482
|
+
this.rn_1 = false;
|
|
1476
1483
|
}
|
|
1477
|
-
|
|
1478
|
-
return this.
|
|
1484
|
+
on() {
|
|
1485
|
+
return this.rn_1;
|
|
1479
1486
|
}
|
|
1480
1487
|
normalizeContent() {
|
|
1481
1488
|
var next = this.nextSibling;
|
|
@@ -1493,9 +1500,9 @@ class InlineElement extends MarkdownComponent {
|
|
|
1493
1500
|
}
|
|
1494
1501
|
if (tmp) {
|
|
1495
1502
|
// Inline function 'kotlin.collections.forEach' call
|
|
1496
|
-
var _iterator__ex2g4s = toList(asList(next.childNodes)).
|
|
1497
|
-
while (_iterator__ex2g4s.
|
|
1498
|
-
var element = _iterator__ex2g4s.
|
|
1503
|
+
var _iterator__ex2g4s = toList(asList(next.childNodes)).r();
|
|
1504
|
+
while (_iterator__ex2g4s.s()) {
|
|
1505
|
+
var element = _iterator__ex2g4s.t();
|
|
1499
1506
|
this.appendChild(element);
|
|
1500
1507
|
}
|
|
1501
1508
|
var tmp0_safe_receiver = this.parentNode;
|
|
@@ -1507,9 +1514,9 @@ class InlineElement extends MarkdownComponent {
|
|
|
1507
1514
|
return true;
|
|
1508
1515
|
}
|
|
1509
1516
|
// Inline function 'kotlin.collections.forEach' call
|
|
1510
|
-
var _iterator__ex2g4s_0 = asList(this.childNodes).
|
|
1511
|
-
while (_iterator__ex2g4s_0.
|
|
1512
|
-
var element_0 = _iterator__ex2g4s_0.
|
|
1517
|
+
var _iterator__ex2g4s_0 = asList(this.childNodes).r();
|
|
1518
|
+
while (_iterator__ex2g4s_0.s()) {
|
|
1519
|
+
var element_0 = _iterator__ex2g4s_0.t();
|
|
1513
1520
|
if (element_0 instanceof HTMLBRElement) {
|
|
1514
1521
|
this.pushBreakAndNodesAfterToParent(element_0);
|
|
1515
1522
|
return true;
|
|
@@ -1568,23 +1575,23 @@ class InlineElement extends MarkdownComponent {
|
|
|
1568
1575
|
}
|
|
1569
1576
|
}
|
|
1570
1577
|
get mustBeDirectChildOfDocument() {
|
|
1571
|
-
return this.
|
|
1578
|
+
return this.on();
|
|
1572
1579
|
}
|
|
1573
1580
|
}
|
|
1574
1581
|
class TerminalInlineElement extends MarkdownComponent {
|
|
1575
1582
|
get mustBeDirectChildOfDocument() {
|
|
1576
|
-
return this.
|
|
1583
|
+
return this.on();
|
|
1577
1584
|
}
|
|
1578
1585
|
}
|
|
1579
1586
|
class ListItem extends ContainerElement {
|
|
1580
1587
|
constructor() {
|
|
1581
1588
|
super();
|
|
1582
|
-
this.
|
|
1589
|
+
this.sn_1 = false;
|
|
1583
1590
|
}
|
|
1584
|
-
|
|
1585
|
-
return this.
|
|
1591
|
+
on() {
|
|
1592
|
+
return this.sn_1;
|
|
1586
1593
|
}
|
|
1587
|
-
|
|
1594
|
+
tn() {
|
|
1588
1595
|
var depth = 0;
|
|
1589
1596
|
var ancestor = this.parentNode;
|
|
1590
1597
|
$l$loop: while (true) {
|
|
@@ -1617,18 +1624,18 @@ class ListItem extends ContainerElement {
|
|
|
1617
1624
|
return depth;
|
|
1618
1625
|
}
|
|
1619
1626
|
getMarkdown() {
|
|
1620
|
-
return repeat(' ', this.
|
|
1627
|
+
return repeat(' ', this.tn()) + '- ' + this.un() + this.vn();
|
|
1621
1628
|
}
|
|
1622
|
-
|
|
1629
|
+
un() {
|
|
1623
1630
|
return '';
|
|
1624
1631
|
}
|
|
1625
|
-
|
|
1632
|
+
vn() {
|
|
1626
1633
|
var line = '';
|
|
1627
1634
|
var nestedBlocks = '';
|
|
1628
1635
|
// Inline function 'kotlin.collections.forEach' call
|
|
1629
|
-
var _iterator__ex2g4s = asList(this.childNodes).
|
|
1630
|
-
while (_iterator__ex2g4s.
|
|
1631
|
-
var element = _iterator__ex2g4s.
|
|
1636
|
+
var _iterator__ex2g4s = asList(this.childNodes).r();
|
|
1637
|
+
while (_iterator__ex2g4s.s()) {
|
|
1638
|
+
var element = _iterator__ex2g4s.t();
|
|
1632
1639
|
var markdownElement = asMarkdownElement(element);
|
|
1633
1640
|
var tmp;
|
|
1634
1641
|
if (isInterface(element, MarkdownElementWithLevel)) {
|
|
@@ -1665,9 +1672,9 @@ class ListItem extends ContainerElement {
|
|
|
1665
1672
|
return true;
|
|
1666
1673
|
}
|
|
1667
1674
|
// Inline function 'kotlin.collections.forEach' call
|
|
1668
|
-
var _iterator__ex2g4s = asList(this.childNodes).
|
|
1669
|
-
while (_iterator__ex2g4s.
|
|
1670
|
-
var element = _iterator__ex2g4s.
|
|
1675
|
+
var _iterator__ex2g4s = asList(this.childNodes).r();
|
|
1676
|
+
while (_iterator__ex2g4s.s()) {
|
|
1677
|
+
var element = _iterator__ex2g4s.t();
|
|
1671
1678
|
if (element instanceof HTMLBRElement) {
|
|
1672
1679
|
this.pushNodesAfterBreakToParent(element);
|
|
1673
1680
|
this.removeChild(element);
|
|
@@ -1698,9 +1705,9 @@ class ListItem extends ContainerElement {
|
|
|
1698
1705
|
contentLength() {
|
|
1699
1706
|
var result = 0;
|
|
1700
1707
|
// Inline function 'kotlin.collections.forEach' call
|
|
1701
|
-
var _iterator__ex2g4s = asList(this.childNodes).
|
|
1702
|
-
while (_iterator__ex2g4s.
|
|
1703
|
-
var element = _iterator__ex2g4s.
|
|
1708
|
+
var _iterator__ex2g4s = asList(this.childNodes).r();
|
|
1709
|
+
while (_iterator__ex2g4s.s()) {
|
|
1710
|
+
var element = _iterator__ex2g4s.t();
|
|
1704
1711
|
var tmp = result;
|
|
1705
1712
|
var tmp_0;
|
|
1706
1713
|
if (element instanceof MarkdownComponent) {
|
|
@@ -1725,9 +1732,9 @@ class ListItem extends ContainerElement {
|
|
|
1725
1732
|
var result = 0;
|
|
1726
1733
|
if (indexOfChild >= 0) {
|
|
1727
1734
|
// Inline function 'kotlin.collections.forEach' call
|
|
1728
|
-
var _iterator__ex2g4s = nodes.o1(0, indexOfChild).
|
|
1729
|
-
while (_iterator__ex2g4s.
|
|
1730
|
-
var element = _iterator__ex2g4s.
|
|
1735
|
+
var _iterator__ex2g4s = nodes.o1(0, indexOfChild).r();
|
|
1736
|
+
while (_iterator__ex2g4s.s()) {
|
|
1737
|
+
var element = _iterator__ex2g4s.t();
|
|
1731
1738
|
var tmp = result;
|
|
1732
1739
|
var tmp_0;
|
|
1733
1740
|
if (element instanceof MarkdownComponent) {
|
|
@@ -1754,9 +1761,9 @@ class ListItem extends ContainerElement {
|
|
|
1754
1761
|
previous.setSelectionToEnd(currentSelection);
|
|
1755
1762
|
}
|
|
1756
1763
|
// Inline function 'kotlin.collections.forEach' call
|
|
1757
|
-
var _iterator__ex2g4s = toList(asList(this.childNodes)).
|
|
1758
|
-
while (_iterator__ex2g4s.
|
|
1759
|
-
var element = _iterator__ex2g4s.
|
|
1764
|
+
var _iterator__ex2g4s = toList(asList(this.childNodes)).r();
|
|
1765
|
+
while (_iterator__ex2g4s.s()) {
|
|
1766
|
+
var element = _iterator__ex2g4s.t();
|
|
1760
1767
|
previous.appendChild(element);
|
|
1761
1768
|
}
|
|
1762
1769
|
this.remove();
|
|
@@ -1765,9 +1772,9 @@ class ListItem extends ContainerElement {
|
|
|
1765
1772
|
var tmp3_safe_receiver = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.childNodes;
|
|
1766
1773
|
if ((tmp3_safe_receiver == null ? null : tmp3_safe_receiver.length) === 1) {
|
|
1767
1774
|
// Inline function 'kotlin.collections.forEach' call
|
|
1768
|
-
var _iterator__ex2g4s_0 = toList(asList(this.childNodes)).
|
|
1769
|
-
while (_iterator__ex2g4s_0.
|
|
1770
|
-
var element_0 = _iterator__ex2g4s_0.
|
|
1775
|
+
var _iterator__ex2g4s_0 = toList(asList(this.childNodes)).r();
|
|
1776
|
+
while (_iterator__ex2g4s_0.s()) {
|
|
1777
|
+
var element_0 = _iterator__ex2g4s_0.t();
|
|
1771
1778
|
var tmp0_safe_receiver = this.parentElement;
|
|
1772
1779
|
if (tmp0_safe_receiver == null)
|
|
1773
1780
|
null;
|
|
@@ -1788,9 +1795,9 @@ class ListItem extends ContainerElement {
|
|
|
1788
1795
|
var next = this.nextElementSibling;
|
|
1789
1796
|
if (next instanceof ListItem) {
|
|
1790
1797
|
// Inline function 'kotlin.collections.forEach' call
|
|
1791
|
-
var _iterator__ex2g4s = toList(asList(next.childNodes)).
|
|
1792
|
-
while (_iterator__ex2g4s.
|
|
1793
|
-
var element = _iterator__ex2g4s.
|
|
1798
|
+
var _iterator__ex2g4s = toList(asList(next.childNodes)).r();
|
|
1799
|
+
while (_iterator__ex2g4s.s()) {
|
|
1800
|
+
var element = _iterator__ex2g4s.t();
|
|
1794
1801
|
this.appendChild(element);
|
|
1795
1802
|
}
|
|
1796
1803
|
next.remove();
|
|
@@ -1817,7 +1824,7 @@ class ListItem extends ContainerElement {
|
|
|
1817
1824
|
return true;
|
|
1818
1825
|
}
|
|
1819
1826
|
get mustBeDirectChildOfDocument() {
|
|
1820
|
-
return this.
|
|
1827
|
+
return this.on();
|
|
1821
1828
|
}
|
|
1822
1829
|
}
|
|
1823
1830
|
class MarkdownElementWithLevel {}
|
|
@@ -1825,12 +1832,12 @@ class MarkdownElementEscapeByBackspace {}
|
|
|
1825
1832
|
class TableCell extends ContainerElement {
|
|
1826
1833
|
constructor() {
|
|
1827
1834
|
super();
|
|
1828
|
-
this.
|
|
1835
|
+
this.wn_1 = false;
|
|
1829
1836
|
}
|
|
1830
|
-
|
|
1831
|
-
return this.
|
|
1837
|
+
on() {
|
|
1838
|
+
return this.wn_1;
|
|
1832
1839
|
}
|
|
1833
|
-
|
|
1840
|
+
xn(hostCss) {
|
|
1834
1841
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
1835
1842
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1836
1843
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -1850,13 +1857,13 @@ class TableCell extends ContainerElement {
|
|
|
1850
1857
|
return true;
|
|
1851
1858
|
}
|
|
1852
1859
|
get mustBeDirectChildOfDocument() {
|
|
1853
|
-
return this.
|
|
1860
|
+
return this.on();
|
|
1854
1861
|
}
|
|
1855
1862
|
}
|
|
1856
1863
|
class MarkdownBreak extends LeafElement {
|
|
1857
1864
|
constructor() {
|
|
1858
1865
|
super();
|
|
1859
|
-
this.
|
|
1866
|
+
this.yn_1 = true;
|
|
1860
1867
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
1861
1868
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1862
1869
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -1865,8 +1872,8 @@ class MarkdownBreak extends LeafElement {
|
|
|
1865
1872
|
o['mode'] = 'open';
|
|
1866
1873
|
element(this.attachShadow(o), 'hr');
|
|
1867
1874
|
}
|
|
1868
|
-
|
|
1869
|
-
return this.
|
|
1875
|
+
on() {
|
|
1876
|
+
return this.yn_1;
|
|
1870
1877
|
}
|
|
1871
1878
|
getMarkdown() {
|
|
1872
1879
|
return '-----------------------\n';
|
|
@@ -1878,13 +1885,13 @@ class MarkdownBreak extends LeafElement {
|
|
|
1878
1885
|
return true;
|
|
1879
1886
|
}
|
|
1880
1887
|
get mustBeDirectChildOfDocument() {
|
|
1881
|
-
return this.
|
|
1888
|
+
return this.on();
|
|
1882
1889
|
}
|
|
1883
1890
|
}
|
|
1884
1891
|
class MarkdownCode extends LeafElement {
|
|
1885
1892
|
constructor() {
|
|
1886
1893
|
super();
|
|
1887
|
-
this.
|
|
1894
|
+
this.zn_1 = true;
|
|
1888
1895
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
1889
1896
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1890
1897
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -1894,33 +1901,33 @@ class MarkdownCode extends LeafElement {
|
|
|
1894
1901
|
var tmp = element(this.attachShadow(o), 'pre');
|
|
1895
1902
|
element(tmp, 'code', MarkdownCode$lambda);
|
|
1896
1903
|
}
|
|
1897
|
-
|
|
1898
|
-
return this.
|
|
1904
|
+
on() {
|
|
1905
|
+
return this.zn_1;
|
|
1899
1906
|
}
|
|
1900
1907
|
getMarkdown() {
|
|
1901
1908
|
var lang = this.getAttribute('lang');
|
|
1902
1909
|
var id = this.getAttribute('id');
|
|
1903
1910
|
return !(id == null) ? '``` ' + lang + ' {' + id + '}\n' + this.textContent + '\n```\n' : '``` ' + lang + '\n' + this.textContent + '\n```\n';
|
|
1904
1911
|
}
|
|
1905
|
-
|
|
1906
|
-
super.
|
|
1912
|
+
cc() {
|
|
1913
|
+
super.cc();
|
|
1907
1914
|
highlight(this);
|
|
1908
1915
|
this.addEventListener('input', MarkdownCode$connectedCallback$lambda(this));
|
|
1909
1916
|
}
|
|
1910
1917
|
connectedCallback() {
|
|
1911
|
-
return this.
|
|
1918
|
+
return this.cc();
|
|
1912
1919
|
}
|
|
1913
1920
|
containsMarkdownTextContent() {
|
|
1914
1921
|
return true;
|
|
1915
1922
|
}
|
|
1916
1923
|
get mustBeDirectChildOfDocument() {
|
|
1917
|
-
return this.
|
|
1924
|
+
return this.on();
|
|
1918
1925
|
}
|
|
1919
1926
|
}
|
|
1920
1927
|
class MarkdownCodeSpan extends TerminalInlineElement {
|
|
1921
1928
|
constructor() {
|
|
1922
1929
|
super();
|
|
1923
|
-
this.
|
|
1930
|
+
this.ao_1 = false;
|
|
1924
1931
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
1925
1932
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1926
1933
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -1930,8 +1937,8 @@ class MarkdownCodeSpan extends TerminalInlineElement {
|
|
|
1930
1937
|
var tmp = this.attachShadow(o);
|
|
1931
1938
|
element(tmp, 'code', MarkdownCodeSpan$lambda);
|
|
1932
1939
|
}
|
|
1933
|
-
|
|
1934
|
-
return this.
|
|
1940
|
+
on() {
|
|
1941
|
+
return this.ao_1;
|
|
1935
1942
|
}
|
|
1936
1943
|
getMarkdown() {
|
|
1937
1944
|
return '`' + getMarkdownWithTextForElement(this) + '`';
|
|
@@ -1940,7 +1947,7 @@ class MarkdownCodeSpan extends TerminalInlineElement {
|
|
|
1940
1947
|
return true;
|
|
1941
1948
|
}
|
|
1942
1949
|
get mustBeDirectChildOfDocument() {
|
|
1943
|
-
return this.
|
|
1950
|
+
return this.on();
|
|
1944
1951
|
}
|
|
1945
1952
|
}
|
|
1946
1953
|
class MarkdownEmphasis extends InlineElement {
|
|
@@ -1965,67 +1972,67 @@ class MarkdownEmphasis extends InlineElement {
|
|
|
1965
1972
|
class MarkdownHeading1 extends Heading {
|
|
1966
1973
|
constructor() {
|
|
1967
1974
|
super();
|
|
1968
|
-
this.
|
|
1975
|
+
this.co_1 = 1;
|
|
1969
1976
|
this.renderHeading();
|
|
1970
1977
|
}
|
|
1971
|
-
|
|
1972
|
-
return this.
|
|
1978
|
+
qn() {
|
|
1979
|
+
return this.co_1;
|
|
1973
1980
|
}
|
|
1974
1981
|
}
|
|
1975
1982
|
class MarkdownHeading2 extends Heading {
|
|
1976
1983
|
constructor() {
|
|
1977
1984
|
super();
|
|
1978
|
-
this.
|
|
1985
|
+
this.eo_1 = 2;
|
|
1979
1986
|
this.renderHeading();
|
|
1980
1987
|
}
|
|
1981
|
-
|
|
1982
|
-
return this.
|
|
1988
|
+
qn() {
|
|
1989
|
+
return this.eo_1;
|
|
1983
1990
|
}
|
|
1984
1991
|
}
|
|
1985
1992
|
class MarkdownHeading3 extends Heading {
|
|
1986
1993
|
constructor() {
|
|
1987
1994
|
super();
|
|
1988
|
-
this.
|
|
1995
|
+
this.go_1 = 3;
|
|
1989
1996
|
this.renderHeading();
|
|
1990
1997
|
}
|
|
1991
|
-
|
|
1992
|
-
return this.
|
|
1998
|
+
qn() {
|
|
1999
|
+
return this.go_1;
|
|
1993
2000
|
}
|
|
1994
2001
|
}
|
|
1995
2002
|
class MarkdownHeading4 extends Heading {
|
|
1996
2003
|
constructor() {
|
|
1997
2004
|
super();
|
|
1998
|
-
this.
|
|
2005
|
+
this.io_1 = 4;
|
|
1999
2006
|
this.renderHeading();
|
|
2000
2007
|
}
|
|
2001
|
-
|
|
2002
|
-
return this.
|
|
2008
|
+
qn() {
|
|
2009
|
+
return this.io_1;
|
|
2003
2010
|
}
|
|
2004
2011
|
}
|
|
2005
2012
|
class MarkdownHeading5 extends Heading {
|
|
2006
2013
|
constructor() {
|
|
2007
2014
|
super();
|
|
2008
|
-
this.
|
|
2015
|
+
this.ko_1 = 5;
|
|
2009
2016
|
this.renderHeading();
|
|
2010
2017
|
}
|
|
2011
|
-
|
|
2012
|
-
return this.
|
|
2018
|
+
qn() {
|
|
2019
|
+
return this.ko_1;
|
|
2013
2020
|
}
|
|
2014
2021
|
}
|
|
2015
2022
|
class MarkdownHeading6 extends Heading {
|
|
2016
2023
|
constructor() {
|
|
2017
2024
|
super();
|
|
2018
|
-
this.
|
|
2025
|
+
this.mo_1 = 6;
|
|
2019
2026
|
this.renderHeading();
|
|
2020
2027
|
}
|
|
2021
|
-
|
|
2022
|
-
return this.
|
|
2028
|
+
qn() {
|
|
2029
|
+
return this.mo_1;
|
|
2023
2030
|
}
|
|
2024
2031
|
}
|
|
2025
2032
|
class MarkdownHtml extends LeafElement {
|
|
2026
2033
|
constructor() {
|
|
2027
2034
|
super();
|
|
2028
|
-
this.
|
|
2035
|
+
this.no_1 = false;
|
|
2029
2036
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2030
2037
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2031
2038
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2034,8 +2041,8 @@ class MarkdownHtml extends LeafElement {
|
|
|
2034
2041
|
o['mode'] = 'open';
|
|
2035
2042
|
slot(this.attachShadow(o));
|
|
2036
2043
|
}
|
|
2037
|
-
|
|
2038
|
-
return this.
|
|
2044
|
+
on() {
|
|
2045
|
+
return this.no_1;
|
|
2039
2046
|
}
|
|
2040
2047
|
isEditable() {
|
|
2041
2048
|
return false;
|
|
@@ -2049,13 +2056,13 @@ class MarkdownHtml extends LeafElement {
|
|
|
2049
2056
|
return true;
|
|
2050
2057
|
}
|
|
2051
2058
|
get mustBeDirectChildOfDocument() {
|
|
2052
|
-
return this.
|
|
2059
|
+
return this.on();
|
|
2053
2060
|
}
|
|
2054
2061
|
}
|
|
2055
2062
|
class MarkdownImage extends TerminalInlineElement {
|
|
2056
2063
|
constructor() {
|
|
2057
2064
|
super();
|
|
2058
|
-
this.
|
|
2065
|
+
this.bm_1 = false;
|
|
2059
2066
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2060
2067
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2061
2068
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2063,7 +2070,7 @@ class MarkdownImage extends TerminalInlineElement {
|
|
|
2063
2070
|
var o = {};
|
|
2064
2071
|
o['mode'] = 'open';
|
|
2065
2072
|
var shadow = this.attachShadow(o);
|
|
2066
|
-
style(shadow, ':host([destination]) .upload {\n display: none;\n}\n.upload {\n border: #c7c7c7 1px dashed;\n padding: 10px;\n}');
|
|
2073
|
+
style(shadow, ':host {\n position: relative;\n display: inline-block;\n}\n:host([destination]) .upload {\n display: none;\n}\n.upload {\n border: #c7c7c7 1px dashed;\n padding: 10px;\n}\n.delete {\n user-select: none;\n position: absolute;\n top: -8px;\n right: -8px;\n width: 16px;\n height: 16px;\n line-height: 16px;\n text-align: center;\n border-radius: 50%;\n background: white;\n border: 1px solid #c7c7c7;\n cursor: pointer;\n opacity: 0.0;\n transition: opacity 0.2s ease-in-out;\n}\n:host(:hover) .delete {\n opacity: 1.0;\n}');
|
|
2067
2074
|
var tmp = this;
|
|
2068
2075
|
var tmp_0 = element(shadow, 'input', MarkdownImage$lambda);
|
|
2069
2076
|
tmp.uploadInput = tmp_0 instanceof HTMLInputElement ? tmp_0 : THROW_CCE();
|
|
@@ -2073,38 +2080,40 @@ class MarkdownImage extends TerminalInlineElement {
|
|
|
2073
2080
|
tmp_1.img = tmp_2 instanceof HTMLImageElement ? tmp_2 : THROW_CCE();
|
|
2074
2081
|
this.img.addEventListener('error', MarkdownImage$lambda_2(this));
|
|
2075
2082
|
element(shadow, 'slot', MarkdownImage$lambda_3);
|
|
2083
|
+
var deleteButton = element(shadow, 'span', MarkdownImage$lambda_4);
|
|
2084
|
+
deleteButton.addEventListener('click', MarkdownImage$lambda_5(this));
|
|
2076
2085
|
this.upgradeProperty('destination');
|
|
2077
2086
|
}
|
|
2078
|
-
|
|
2079
|
-
return this.
|
|
2087
|
+
on() {
|
|
2088
|
+
return this.bm_1;
|
|
2080
2089
|
}
|
|
2081
|
-
|
|
2090
|
+
oo() {
|
|
2082
2091
|
return this.img;
|
|
2083
2092
|
}
|
|
2084
|
-
|
|
2093
|
+
po() {
|
|
2085
2094
|
return this.uploadInput;
|
|
2086
2095
|
}
|
|
2087
|
-
|
|
2096
|
+
cm(value) {
|
|
2088
2097
|
return this.setAttribute('destination', value);
|
|
2089
2098
|
}
|
|
2090
|
-
|
|
2099
|
+
qo() {
|
|
2091
2100
|
var tmp0_elvis_lhs = this.getAttribute('destination');
|
|
2092
2101
|
return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
2093
2102
|
}
|
|
2094
|
-
|
|
2095
|
-
super.
|
|
2103
|
+
cc() {
|
|
2104
|
+
super.cc();
|
|
2096
2105
|
this.render();
|
|
2097
2106
|
}
|
|
2098
2107
|
connectedCallback() {
|
|
2099
|
-
return this.
|
|
2108
|
+
return this.cc();
|
|
2100
2109
|
}
|
|
2101
|
-
|
|
2110
|
+
fc(name, oldValue, newValue) {
|
|
2102
2111
|
if (name === 'destination' || name === 'title') {
|
|
2103
2112
|
this.render();
|
|
2104
2113
|
}
|
|
2105
2114
|
}
|
|
2106
2115
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
2107
|
-
return this.
|
|
2116
|
+
return this.fc(name, oldValue, newValue);
|
|
2108
2117
|
}
|
|
2109
2118
|
render() {
|
|
2110
2119
|
this.img.src = this.destination;
|
|
@@ -2124,19 +2133,19 @@ class MarkdownImage extends TerminalInlineElement {
|
|
|
2124
2133
|
return true;
|
|
2125
2134
|
}
|
|
2126
2135
|
get mustBeDirectChildOfDocument() {
|
|
2127
|
-
return this.
|
|
2136
|
+
return this.on();
|
|
2128
2137
|
}
|
|
2129
2138
|
get destination() {
|
|
2130
|
-
return this.
|
|
2139
|
+
return this.qo();
|
|
2131
2140
|
}
|
|
2132
2141
|
set destination(value) {
|
|
2133
|
-
this.
|
|
2142
|
+
this.cm(value);
|
|
2134
2143
|
}
|
|
2135
2144
|
}
|
|
2136
2145
|
class MarkdownLink extends TerminalInlineElement {
|
|
2137
2146
|
constructor() {
|
|
2138
2147
|
super();
|
|
2139
|
-
this.
|
|
2148
|
+
this.ym_1 = false;
|
|
2140
2149
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2141
2150
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2142
2151
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2150,42 +2159,42 @@ class MarkdownLink extends TerminalInlineElement {
|
|
|
2150
2159
|
// Inline function 'kotlin.also' call
|
|
2151
2160
|
var this_0 = tmp_0 instanceof HTMLAnchorElement ? tmp_0 : THROW_CCE();
|
|
2152
2161
|
slot(this_0);
|
|
2153
|
-
tmp.
|
|
2162
|
+
tmp.zm_1 = this_0;
|
|
2154
2163
|
var showLink = element(shadow, 'span', MarkdownLink$lambda_0);
|
|
2155
2164
|
showLink.addEventListener('click', MarkdownLink$lambda_1(this));
|
|
2156
2165
|
var tmp_1 = this;
|
|
2157
2166
|
var tmp_2 = element(shadow, 'input', MarkdownLink$lambda_2);
|
|
2158
|
-
tmp_1.
|
|
2159
|
-
this.
|
|
2160
|
-
this.
|
|
2161
|
-
this.
|
|
2167
|
+
tmp_1.an_1 = tmp_2 instanceof HTMLInputElement ? tmp_2 : THROW_CCE();
|
|
2168
|
+
this.an_1.addEventListener('input', MarkdownLink$lambda_3(this));
|
|
2169
|
+
this.an_1.addEventListener('blur', MarkdownLink$lambda_4(this));
|
|
2170
|
+
this.an_1.addEventListener('keydown', MarkdownLink$lambda_5(this));
|
|
2162
2171
|
}
|
|
2163
|
-
|
|
2164
|
-
return this.
|
|
2172
|
+
on() {
|
|
2173
|
+
return this.ym_1;
|
|
2165
2174
|
}
|
|
2166
|
-
|
|
2175
|
+
cm(value) {
|
|
2167
2176
|
return this.setAttribute('destination', value);
|
|
2168
2177
|
}
|
|
2169
|
-
|
|
2178
|
+
qo() {
|
|
2170
2179
|
var tmp0_elvis_lhs = this.getAttribute('destination');
|
|
2171
2180
|
return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
2172
2181
|
}
|
|
2173
|
-
|
|
2174
|
-
super.
|
|
2182
|
+
cc() {
|
|
2183
|
+
super.cc();
|
|
2175
2184
|
var tmp = window;
|
|
2176
2185
|
tmp.setTimeout(MarkdownLink$connectedCallback$lambda(this), 5000);
|
|
2177
2186
|
updateLinkTarget(this);
|
|
2178
2187
|
}
|
|
2179
2188
|
connectedCallback() {
|
|
2180
|
-
return this.
|
|
2189
|
+
return this.cc();
|
|
2181
2190
|
}
|
|
2182
|
-
|
|
2191
|
+
fc(name, oldValue, newValue) {
|
|
2183
2192
|
if (name === 'destination' || name === 'title') {
|
|
2184
2193
|
updateLinkTarget(this);
|
|
2185
2194
|
}
|
|
2186
2195
|
}
|
|
2187
2196
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
2188
|
-
return this.
|
|
2197
|
+
return this.fc(name, oldValue, newValue);
|
|
2189
2198
|
}
|
|
2190
2199
|
newEmptyElementNameAfterBreak() {
|
|
2191
2200
|
return null;
|
|
@@ -2195,9 +2204,9 @@ class MarkdownLink extends TerminalInlineElement {
|
|
|
2195
2204
|
// Inline function 'kotlin.text.isNotEmpty' call
|
|
2196
2205
|
var this_0 = this.title;
|
|
2197
2206
|
if (charSequenceLength(this_0) > 0) {
|
|
2198
|
-
tmp = '[' + this.innerText + '](' + this.
|
|
2207
|
+
tmp = '[' + this.innerText + '](' + this.qo() + ' "' + this.title + '")';
|
|
2199
2208
|
} else {
|
|
2200
|
-
tmp = '[' + this.innerText + '](' + this.
|
|
2209
|
+
tmp = '[' + this.innerText + '](' + this.qo() + ')';
|
|
2201
2210
|
}
|
|
2202
2211
|
return tmp;
|
|
2203
2212
|
}
|
|
@@ -2205,13 +2214,13 @@ class MarkdownLink extends TerminalInlineElement {
|
|
|
2205
2214
|
return true;
|
|
2206
2215
|
}
|
|
2207
2216
|
get mustBeDirectChildOfDocument() {
|
|
2208
|
-
return this.
|
|
2217
|
+
return this.on();
|
|
2209
2218
|
}
|
|
2210
2219
|
}
|
|
2211
2220
|
class MarkdownList extends ContainerElement {
|
|
2212
2221
|
constructor() {
|
|
2213
2222
|
super();
|
|
2214
|
-
this.
|
|
2223
|
+
this.ro_1 = false;
|
|
2215
2224
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2216
2225
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2217
2226
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2223,8 +2232,14 @@ class MarkdownList extends ContainerElement {
|
|
|
2223
2232
|
style(this_0, ":host {\n counter-reset: section;\n}\n:host ::slotted(*) {\n display: list-item;\n}\n:host([ordered='true']) ::slotted(*) {\n list-style-type: decimal;\n}");
|
|
2224
2233
|
slot(this_0);
|
|
2225
2234
|
}
|
|
2226
|
-
|
|
2227
|
-
return this.
|
|
2235
|
+
on() {
|
|
2236
|
+
return this.ro_1;
|
|
2237
|
+
}
|
|
2238
|
+
so(value) {
|
|
2239
|
+
return this.setAttribute('ordered', value.toString());
|
|
2240
|
+
}
|
|
2241
|
+
to() {
|
|
2242
|
+
return this.getAttribute('ordered') === 'true';
|
|
2228
2243
|
}
|
|
2229
2244
|
getMarkdown() {
|
|
2230
2245
|
return super.getMarkdown() + '\n';
|
|
@@ -2232,7 +2247,7 @@ class MarkdownList extends ContainerElement {
|
|
|
2232
2247
|
containsMarkdownTextContent() {
|
|
2233
2248
|
return false;
|
|
2234
2249
|
}
|
|
2235
|
-
|
|
2250
|
+
im(child) {
|
|
2236
2251
|
if (child == null)
|
|
2237
2252
|
return Unit_instance;
|
|
2238
2253
|
var list = document.createElement('markdown-list');
|
|
@@ -2242,7 +2257,7 @@ class MarkdownList extends ContainerElement {
|
|
|
2242
2257
|
child.innerHTML = ' ';
|
|
2243
2258
|
child.appendChild(list);
|
|
2244
2259
|
}
|
|
2245
|
-
|
|
2260
|
+
jm(child) {
|
|
2246
2261
|
if (child == null)
|
|
2247
2262
|
return Unit_instance;
|
|
2248
2263
|
var tmp0_safe_receiver = this.parentElement;
|
|
@@ -2257,14 +2272,46 @@ class MarkdownList extends ContainerElement {
|
|
|
2257
2272
|
var nodes = asList(this.childNodes);
|
|
2258
2273
|
var indexOfChild = nodes.n1(child);
|
|
2259
2274
|
// Inline function 'kotlin.collections.forEach' call
|
|
2260
|
-
var _iterator__ex2g4s = drop(nodes, indexOfChild).
|
|
2261
|
-
while (_iterator__ex2g4s.
|
|
2262
|
-
var element = _iterator__ex2g4s.
|
|
2275
|
+
var _iterator__ex2g4s = drop(nodes, indexOfChild).r();
|
|
2276
|
+
while (_iterator__ex2g4s.s()) {
|
|
2277
|
+
var element = _iterator__ex2g4s.t();
|
|
2263
2278
|
nextUp.after(element);
|
|
2264
2279
|
}
|
|
2265
2280
|
}
|
|
2281
|
+
hm(child) {
|
|
2282
|
+
if (child == null)
|
|
2283
|
+
return Unit_instance;
|
|
2284
|
+
var nodes = asList(this.childNodes);
|
|
2285
|
+
var indexOfChild = nodes.n1(child);
|
|
2286
|
+
if (indexOfChild < 0)
|
|
2287
|
+
return Unit_instance;
|
|
2288
|
+
var paragraph = document.createElement('markdown-paragraph');
|
|
2289
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
2290
|
+
var _iterator__ex2g4s = toList(asList(child.childNodes)).r();
|
|
2291
|
+
while (_iterator__ex2g4s.s()) {
|
|
2292
|
+
var element = _iterator__ex2g4s.t();
|
|
2293
|
+
paragraph.appendChild(element);
|
|
2294
|
+
}
|
|
2295
|
+
if (indexOfChild < (nodes.u() - 1 | 0)) {
|
|
2296
|
+
var tmp = document.createElement('markdown-list');
|
|
2297
|
+
var rest = tmp instanceof MarkdownList ? tmp : THROW_CCE();
|
|
2298
|
+
rest.so(this.to());
|
|
2299
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
2300
|
+
var _iterator__ex2g4s_0 = drop(nodes, indexOfChild + 1 | 0).r();
|
|
2301
|
+
while (_iterator__ex2g4s_0.s()) {
|
|
2302
|
+
var element_0 = _iterator__ex2g4s_0.t();
|
|
2303
|
+
rest.appendChild(element_0);
|
|
2304
|
+
}
|
|
2305
|
+
this.after(rest);
|
|
2306
|
+
}
|
|
2307
|
+
this.after(paragraph);
|
|
2308
|
+
child.remove();
|
|
2309
|
+
if (this.childNodes.length === 0) {
|
|
2310
|
+
this.remove();
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2266
2313
|
get mustBeDirectChildOfDocument() {
|
|
2267
|
-
return this.
|
|
2314
|
+
return this.on();
|
|
2268
2315
|
}
|
|
2269
2316
|
}
|
|
2270
2317
|
class MarkdownListItem extends ListItem {
|
|
@@ -2285,7 +2332,7 @@ class MarkdownListItem extends ListItem {
|
|
|
2285
2332
|
class MarkdownNumericList extends ContainerElement {
|
|
2286
2333
|
constructor() {
|
|
2287
2334
|
super();
|
|
2288
|
-
this.
|
|
2335
|
+
this.uo_1 = false;
|
|
2289
2336
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2290
2337
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2291
2338
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2297,8 +2344,29 @@ class MarkdownNumericList extends ContainerElement {
|
|
|
2297
2344
|
style(this_0, ":host {\n /* fallback for browsers without ::marker { content } support */\n list-style-type: decimal;\n /* a real <ol> gets a fresh counter scope per nesting level for free (it's baked\n into the UA stylesheet); a custom element doesn't, so this does it explicitly \u2014\n without it, nested lists just continue the outer count instead of showing 1.1 */\n counter-reset: numbered-item;\n}");
|
|
2298
2345
|
slot(this_0);
|
|
2299
2346
|
}
|
|
2300
|
-
|
|
2301
|
-
return this.
|
|
2347
|
+
on() {
|
|
2348
|
+
return this.uo_1;
|
|
2349
|
+
}
|
|
2350
|
+
so(value) {
|
|
2351
|
+
return this.setAttribute('ordered', value.toString());
|
|
2352
|
+
}
|
|
2353
|
+
to() {
|
|
2354
|
+
return this.getAttribute('ordered') === 'true';
|
|
2355
|
+
}
|
|
2356
|
+
vo(value) {
|
|
2357
|
+
var tmp;
|
|
2358
|
+
if (value == null) {
|
|
2359
|
+
this.removeAttribute('start');
|
|
2360
|
+
tmp = Unit_instance;
|
|
2361
|
+
} else {
|
|
2362
|
+
this.setAttribute('start', value.toString());
|
|
2363
|
+
tmp = Unit_instance;
|
|
2364
|
+
}
|
|
2365
|
+
return tmp;
|
|
2366
|
+
}
|
|
2367
|
+
s8() {
|
|
2368
|
+
var tmp0_safe_receiver = this.getAttribute('start');
|
|
2369
|
+
return tmp0_safe_receiver == null ? null : toIntOrNull(tmp0_safe_receiver);
|
|
2302
2370
|
}
|
|
2303
2371
|
getMarkdown() {
|
|
2304
2372
|
return super.getMarkdown() + '\n';
|
|
@@ -2306,7 +2374,7 @@ class MarkdownNumericList extends ContainerElement {
|
|
|
2306
2374
|
containsMarkdownTextContent() {
|
|
2307
2375
|
return false;
|
|
2308
2376
|
}
|
|
2309
|
-
|
|
2377
|
+
im(child) {
|
|
2310
2378
|
if (child == null)
|
|
2311
2379
|
return Unit_instance;
|
|
2312
2380
|
var list = document.createElement('markdown-numeric-list');
|
|
@@ -2316,7 +2384,7 @@ class MarkdownNumericList extends ContainerElement {
|
|
|
2316
2384
|
child.innerHTML = ' ';
|
|
2317
2385
|
child.appendChild(list);
|
|
2318
2386
|
}
|
|
2319
|
-
|
|
2387
|
+
jm(child) {
|
|
2320
2388
|
if (child == null)
|
|
2321
2389
|
return Unit_instance;
|
|
2322
2390
|
var tmp0_safe_receiver = this.parentElement;
|
|
@@ -2331,14 +2399,48 @@ class MarkdownNumericList extends ContainerElement {
|
|
|
2331
2399
|
var nodes = asList(this.childNodes);
|
|
2332
2400
|
var indexOfChild = nodes.n1(child);
|
|
2333
2401
|
// Inline function 'kotlin.collections.forEach' call
|
|
2334
|
-
var _iterator__ex2g4s = drop(nodes, indexOfChild).
|
|
2335
|
-
while (_iterator__ex2g4s.
|
|
2336
|
-
var element = _iterator__ex2g4s.
|
|
2402
|
+
var _iterator__ex2g4s = drop(nodes, indexOfChild).r();
|
|
2403
|
+
while (_iterator__ex2g4s.s()) {
|
|
2404
|
+
var element = _iterator__ex2g4s.t();
|
|
2337
2405
|
nextUp.after(element);
|
|
2338
2406
|
}
|
|
2339
2407
|
}
|
|
2408
|
+
hm(child) {
|
|
2409
|
+
if (child == null)
|
|
2410
|
+
return Unit_instance;
|
|
2411
|
+
var nodes = asList(this.childNodes);
|
|
2412
|
+
var indexOfChild = nodes.n1(child);
|
|
2413
|
+
if (indexOfChild < 0)
|
|
2414
|
+
return Unit_instance;
|
|
2415
|
+
var paragraph = document.createElement('markdown-paragraph');
|
|
2416
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
2417
|
+
var _iterator__ex2g4s = toList(asList(child.childNodes)).r();
|
|
2418
|
+
while (_iterator__ex2g4s.s()) {
|
|
2419
|
+
var element = _iterator__ex2g4s.t();
|
|
2420
|
+
paragraph.appendChild(element);
|
|
2421
|
+
}
|
|
2422
|
+
if (indexOfChild < (nodes.u() - 1 | 0)) {
|
|
2423
|
+
var tmp = document.createElement('markdown-numeric-list');
|
|
2424
|
+
var rest = tmp instanceof MarkdownNumericList ? tmp : THROW_CCE();
|
|
2425
|
+
rest.so(this.to());
|
|
2426
|
+
var tmp0_elvis_lhs = this.s8();
|
|
2427
|
+
rest.vo(((tmp0_elvis_lhs == null ? 1 : tmp0_elvis_lhs) + indexOfChild | 0) + 1 | 0);
|
|
2428
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
2429
|
+
var _iterator__ex2g4s_0 = drop(nodes, indexOfChild + 1 | 0).r();
|
|
2430
|
+
while (_iterator__ex2g4s_0.s()) {
|
|
2431
|
+
var element_0 = _iterator__ex2g4s_0.t();
|
|
2432
|
+
rest.appendChild(element_0);
|
|
2433
|
+
}
|
|
2434
|
+
this.after(rest);
|
|
2435
|
+
}
|
|
2436
|
+
this.after(paragraph);
|
|
2437
|
+
child.remove();
|
|
2438
|
+
if (this.childNodes.length === 0) {
|
|
2439
|
+
this.remove();
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2340
2442
|
get mustBeDirectChildOfDocument() {
|
|
2341
|
-
return this.
|
|
2443
|
+
return this.on();
|
|
2342
2444
|
}
|
|
2343
2445
|
}
|
|
2344
2446
|
class MarkdownNumericListItem extends ListItem {
|
|
@@ -2359,7 +2461,7 @@ class MarkdownNumericListItem extends ListItem {
|
|
|
2359
2461
|
class MarkdownParagraph extends LeafElement {
|
|
2360
2462
|
constructor() {
|
|
2361
2463
|
super();
|
|
2362
|
-
this.
|
|
2464
|
+
this.wo_1 = true;
|
|
2363
2465
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2364
2466
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2365
2467
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2371,8 +2473,8 @@ class MarkdownParagraph extends LeafElement {
|
|
|
2371
2473
|
style(this_0, ':host {\n position: relative;\n display: block;\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n}');
|
|
2372
2474
|
slot(this_0);
|
|
2373
2475
|
}
|
|
2374
|
-
|
|
2375
|
-
return this.
|
|
2476
|
+
on() {
|
|
2477
|
+
return this.wo_1;
|
|
2376
2478
|
}
|
|
2377
2479
|
getMarkdown() {
|
|
2378
2480
|
var tmp = asList(this.childNodes);
|
|
@@ -2397,13 +2499,13 @@ class MarkdownParagraph extends LeafElement {
|
|
|
2397
2499
|
return this.getMarkdown() === '\n\n';
|
|
2398
2500
|
}
|
|
2399
2501
|
get mustBeDirectChildOfDocument() {
|
|
2400
|
-
return this.
|
|
2502
|
+
return this.on();
|
|
2401
2503
|
}
|
|
2402
2504
|
}
|
|
2403
2505
|
class MarkdownQuote extends ContainerElement {
|
|
2404
2506
|
constructor() {
|
|
2405
2507
|
super();
|
|
2406
|
-
this.
|
|
2508
|
+
this.xo_1 = true;
|
|
2407
2509
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2408
2510
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2409
2511
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2415,8 +2517,8 @@ class MarkdownQuote extends ContainerElement {
|
|
|
2415
2517
|
style(this_0, ":host {\n position: relative;\n}\nblockquote::before {\n position: absolute;\n width: 3px;\n height: 100%;\n left: 20px;\n background-color: lightgray;\n content: '';\n}");
|
|
2416
2518
|
element(this_0, 'blockquote', MarkdownQuote$lambda);
|
|
2417
2519
|
}
|
|
2418
|
-
|
|
2419
|
-
return this.
|
|
2520
|
+
on() {
|
|
2521
|
+
return this.xo_1;
|
|
2420
2522
|
}
|
|
2421
2523
|
getMarkdown() {
|
|
2422
2524
|
var tmp = asList(this.childNodes);
|
|
@@ -2434,24 +2536,24 @@ class MarkdownQuote extends ContainerElement {
|
|
|
2434
2536
|
this.before(tmp0_safe_receiver);
|
|
2435
2537
|
}
|
|
2436
2538
|
}
|
|
2437
|
-
|
|
2539
|
+
im(child) {
|
|
2438
2540
|
if (!(child == null)) {
|
|
2439
2541
|
var quote = document.createElement('markdown-quote');
|
|
2440
2542
|
child.replaceWith(quote);
|
|
2441
2543
|
quote.append(child);
|
|
2442
2544
|
}
|
|
2443
2545
|
}
|
|
2444
|
-
|
|
2546
|
+
jm(child) {
|
|
2445
2547
|
if (!(child == null) && this.childNodes.length > 1) {
|
|
2446
2548
|
var nodes = asList(this.childNodes);
|
|
2447
2549
|
var indexOfChild = nodes.n1(child);
|
|
2448
|
-
if (indexOfChild < (nodes.
|
|
2550
|
+
if (indexOfChild < (nodes.u() - 1 | 0)) {
|
|
2449
2551
|
var quote = document.createElement('markdown-quote');
|
|
2450
2552
|
this.after(quote);
|
|
2451
2553
|
// Inline function 'kotlin.collections.forEach' call
|
|
2452
|
-
var _iterator__ex2g4s = drop(nodes, indexOfChild + 1 | 0).
|
|
2453
|
-
while (_iterator__ex2g4s.
|
|
2454
|
-
var element = _iterator__ex2g4s.
|
|
2554
|
+
var _iterator__ex2g4s = drop(nodes, indexOfChild + 1 | 0).r();
|
|
2555
|
+
while (_iterator__ex2g4s.s()) {
|
|
2556
|
+
var element = _iterator__ex2g4s.t();
|
|
2455
2557
|
quote.append(element);
|
|
2456
2558
|
}
|
|
2457
2559
|
}
|
|
@@ -2465,19 +2567,19 @@ class MarkdownQuote extends ContainerElement {
|
|
|
2465
2567
|
}
|
|
2466
2568
|
} else {
|
|
2467
2569
|
// Inline function 'kotlin.collections.forEach' call
|
|
2468
|
-
var _iterator__ex2g4s_0 = toList(asList(this.childNodes)).
|
|
2469
|
-
while (_iterator__ex2g4s_0.
|
|
2470
|
-
var element_0 = _iterator__ex2g4s_0.
|
|
2570
|
+
var _iterator__ex2g4s_0 = toList(asList(this.childNodes)).r();
|
|
2571
|
+
while (_iterator__ex2g4s_0.s()) {
|
|
2572
|
+
var element_0 = _iterator__ex2g4s_0.t();
|
|
2471
2573
|
this.before(element_0);
|
|
2472
2574
|
}
|
|
2473
2575
|
this.remove();
|
|
2474
2576
|
}
|
|
2475
2577
|
}
|
|
2476
|
-
|
|
2477
|
-
this.
|
|
2578
|
+
hm(child) {
|
|
2579
|
+
this.jm(child);
|
|
2478
2580
|
}
|
|
2479
2581
|
get mustBeDirectChildOfDocument() {
|
|
2480
|
-
return this.
|
|
2582
|
+
return this.on();
|
|
2481
2583
|
}
|
|
2482
2584
|
}
|
|
2483
2585
|
class MarkdownStrike extends InlineElement {
|
|
@@ -2526,7 +2628,7 @@ class MarkdownStrong extends InlineElement {
|
|
|
2526
2628
|
class MarkdownTable extends ContainerElement {
|
|
2527
2629
|
constructor() {
|
|
2528
2630
|
super();
|
|
2529
|
-
this.
|
|
2631
|
+
this.yo_1 = true;
|
|
2530
2632
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2531
2633
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2532
2634
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2538,8 +2640,8 @@ class MarkdownTable extends ContainerElement {
|
|
|
2538
2640
|
style(this_0, ':host {\n display: table;\n border-collapse: collapse;\n}');
|
|
2539
2641
|
slot(this_0);
|
|
2540
2642
|
}
|
|
2541
|
-
|
|
2542
|
-
return this.
|
|
2643
|
+
on() {
|
|
2644
|
+
return this.yo_1;
|
|
2543
2645
|
}
|
|
2544
2646
|
getMarkdown() {
|
|
2545
2647
|
var tmp = asList(this.children);
|
|
@@ -2549,25 +2651,25 @@ class MarkdownTable extends ContainerElement {
|
|
|
2549
2651
|
return false;
|
|
2550
2652
|
}
|
|
2551
2653
|
get mustBeDirectChildOfDocument() {
|
|
2552
|
-
return this.
|
|
2654
|
+
return this.on();
|
|
2553
2655
|
}
|
|
2554
2656
|
}
|
|
2555
2657
|
class MarkdownTableCell extends TableCell {
|
|
2556
2658
|
constructor() {
|
|
2557
2659
|
super();
|
|
2558
|
-
this.
|
|
2660
|
+
this.xn('display: table-cell; border: lightgrey 1px solid;');
|
|
2559
2661
|
}
|
|
2560
2662
|
}
|
|
2561
2663
|
class MarkdownTableHeaderCell extends TableCell {
|
|
2562
2664
|
constructor() {
|
|
2563
2665
|
super();
|
|
2564
|
-
this.
|
|
2666
|
+
this.xn('display: table-cell; border: lightgrey 1px solid; background-color: lightgray;');
|
|
2565
2667
|
}
|
|
2566
2668
|
}
|
|
2567
2669
|
class MarkdownTableRow extends ContainerElement {
|
|
2568
2670
|
constructor() {
|
|
2569
2671
|
super();
|
|
2570
|
-
this.
|
|
2672
|
+
this.zo_1 = false;
|
|
2571
2673
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2572
2674
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2573
2675
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2579,8 +2681,8 @@ class MarkdownTableRow extends ContainerElement {
|
|
|
2579
2681
|
style(this_0, ':host {\n display: table-row;\n border: lightgrey 1px solid;\n}');
|
|
2580
2682
|
slot(this_0);
|
|
2581
2683
|
}
|
|
2582
|
-
|
|
2583
|
-
return this.
|
|
2684
|
+
on() {
|
|
2685
|
+
return this.zo_1;
|
|
2584
2686
|
}
|
|
2585
2687
|
getMarkdown() {
|
|
2586
2688
|
var tmp = asList(this.children);
|
|
@@ -2590,7 +2692,7 @@ class MarkdownTableRow extends ContainerElement {
|
|
|
2590
2692
|
return false;
|
|
2591
2693
|
}
|
|
2592
2694
|
get mustBeDirectChildOfDocument() {
|
|
2593
|
-
return this.
|
|
2695
|
+
return this.on();
|
|
2594
2696
|
}
|
|
2595
2697
|
}
|
|
2596
2698
|
class MarkdownTableHeaderRow extends MarkdownTableRow {
|
|
@@ -2612,31 +2714,31 @@ class MarkdownTaskListItem extends ListItem {
|
|
|
2612
2714
|
var container = element(shadow, 'div', MarkdownTaskListItem$lambda);
|
|
2613
2715
|
var tmp = this;
|
|
2614
2716
|
var tmp_0 = element(container, 'input', MarkdownTaskListItem$lambda_0);
|
|
2615
|
-
tmp.
|
|
2616
|
-
this.
|
|
2717
|
+
tmp.bp_1 = tmp_0 instanceof HTMLInputElement ? tmp_0 : THROW_CCE();
|
|
2718
|
+
this.bp_1.addEventListener('change', MarkdownTaskListItem$lambda_1(this));
|
|
2617
2719
|
element(container, 'div', MarkdownTaskListItem$lambda_2);
|
|
2618
2720
|
}
|
|
2619
|
-
|
|
2721
|
+
cp() {
|
|
2620
2722
|
return this.getAttribute('checked') === 'true';
|
|
2621
2723
|
}
|
|
2622
|
-
|
|
2724
|
+
fc(name, oldValue, newValue) {
|
|
2623
2725
|
if (name === 'checked') {
|
|
2624
|
-
this.
|
|
2726
|
+
this.bp_1.checked = this.cp();
|
|
2625
2727
|
}
|
|
2626
2728
|
}
|
|
2627
2729
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
2628
|
-
return this.
|
|
2730
|
+
return this.fc(name, oldValue, newValue);
|
|
2629
2731
|
}
|
|
2630
|
-
|
|
2631
|
-
return '[' + (this.
|
|
2732
|
+
un() {
|
|
2733
|
+
return '[' + (this.cp() ? 'x' : ' ') + '] ';
|
|
2632
2734
|
}
|
|
2633
2735
|
}
|
|
2634
2736
|
class MarkdownToc extends BaseWebComponent {
|
|
2635
2737
|
constructor() {
|
|
2636
2738
|
super();
|
|
2637
|
-
this.
|
|
2638
|
-
this.
|
|
2639
|
-
this.
|
|
2739
|
+
this.dm_1 = false;
|
|
2740
|
+
this.em_1 = null;
|
|
2741
|
+
this.fm_1 = null;
|
|
2640
2742
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2641
2743
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2642
2744
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2646,29 +2748,29 @@ class MarkdownToc extends BaseWebComponent {
|
|
|
2646
2748
|
style(this.attachShadow(o), ':host {\n display: block;\n}\n@media screen {\n :host(.floating) {\n position: absolute;\n right: 0px;\n top: 0px;\n }\n :host(.floating) .level-2 {\n height: 0px;\n visibility: collapse;\n }\n :host(.floating:hover) .level-2 {\n height: auto;\n visibility: visible;\n }\n}\n.level {\n padding-left: 10px;\n font-size: 0.9em;\n}\n.level a {\n display: block;\n}\ndiv {\n display: flex;\n flex-direction: column;\n}');
|
|
2647
2749
|
this.upgradeProperty('markdownDocument');
|
|
2648
2750
|
}
|
|
2649
|
-
|
|
2650
|
-
return this.
|
|
2751
|
+
on() {
|
|
2752
|
+
return this.dm_1;
|
|
2651
2753
|
}
|
|
2652
|
-
|
|
2653
|
-
this.
|
|
2754
|
+
gm(value) {
|
|
2755
|
+
this.fm_1 = value;
|
|
2654
2756
|
this.refresh();
|
|
2655
2757
|
}
|
|
2656
|
-
|
|
2657
|
-
return this.
|
|
2758
|
+
jn() {
|
|
2759
|
+
return this.fm_1;
|
|
2658
2760
|
}
|
|
2659
|
-
|
|
2660
|
-
super.
|
|
2661
|
-
if (this.
|
|
2662
|
-
this.
|
|
2761
|
+
cc() {
|
|
2762
|
+
super.cc();
|
|
2763
|
+
if (this.fm_1 == null) {
|
|
2764
|
+
this.gm(this.closest('markdown-document'));
|
|
2663
2765
|
var tmp = window;
|
|
2664
2766
|
tmp.setTimeout(MarkdownToc$connectedCallback$lambda(this), 1000);
|
|
2665
2767
|
}
|
|
2666
2768
|
}
|
|
2667
2769
|
connectedCallback() {
|
|
2668
|
-
return this.
|
|
2770
|
+
return this.cc();
|
|
2669
2771
|
}
|
|
2670
2772
|
refresh() {
|
|
2671
|
-
var tmp0_elvis_lhs = this.
|
|
2773
|
+
var tmp0_elvis_lhs = this.fm_1;
|
|
2672
2774
|
var tmp;
|
|
2673
2775
|
if (tmp0_elvis_lhs == null) {
|
|
2674
2776
|
return Unit_instance;
|
|
@@ -2684,7 +2786,7 @@ class MarkdownToc extends BaseWebComponent {
|
|
|
2684
2786
|
tmp_0 = tmp1_elvis_lhs;
|
|
2685
2787
|
}
|
|
2686
2788
|
var shadow = tmp_0;
|
|
2687
|
-
var tmp2_safe_receiver = this.
|
|
2789
|
+
var tmp2_safe_receiver = this.em_1;
|
|
2688
2790
|
if (tmp2_safe_receiver == null)
|
|
2689
2791
|
null;
|
|
2690
2792
|
else {
|
|
@@ -2692,24 +2794,24 @@ class MarkdownToc extends BaseWebComponent {
|
|
|
2692
2794
|
}
|
|
2693
2795
|
var currentDepth = 1;
|
|
2694
2796
|
var currentList = document.createElement('div');
|
|
2695
|
-
this.
|
|
2797
|
+
this.em_1 = currentList;
|
|
2696
2798
|
shadow.appendChild(currentList);
|
|
2697
2799
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
2698
2800
|
var tmp0 = asList(root.querySelectorAll('*'));
|
|
2699
2801
|
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
2700
|
-
var destination = ArrayList.
|
|
2701
|
-
var _iterator__ex2g4s = tmp0.
|
|
2702
|
-
while (_iterator__ex2g4s.
|
|
2703
|
-
var element = _iterator__ex2g4s.
|
|
2802
|
+
var destination = ArrayList.z();
|
|
2803
|
+
var _iterator__ex2g4s = tmp0.r();
|
|
2804
|
+
while (_iterator__ex2g4s.s()) {
|
|
2805
|
+
var element = _iterator__ex2g4s.t();
|
|
2704
2806
|
if (element instanceof Heading) {
|
|
2705
|
-
destination.
|
|
2807
|
+
destination.n(element);
|
|
2706
2808
|
}
|
|
2707
2809
|
}
|
|
2708
2810
|
var headings = destination;
|
|
2709
2811
|
// Inline function 'kotlin.collections.forEach' call
|
|
2710
|
-
var _iterator__ex2g4s_0 = headings.
|
|
2711
|
-
while (_iterator__ex2g4s_0.
|
|
2712
|
-
var element_0 = _iterator__ex2g4s_0.
|
|
2812
|
+
var _iterator__ex2g4s_0 = headings.r();
|
|
2813
|
+
while (_iterator__ex2g4s_0.s()) {
|
|
2814
|
+
var element_0 = _iterator__ex2g4s_0.t();
|
|
2713
2815
|
var tmp_1 = document.createElement('a');
|
|
2714
2816
|
var a = tmp_1 instanceof HTMLAnchorElement ? tmp_1 : THROW_CCE();
|
|
2715
2817
|
a.href = '#' + element_0.id;
|
|
@@ -2734,44 +2836,44 @@ class MarkdownToc extends BaseWebComponent {
|
|
|
2734
2836
|
return '${toc}';
|
|
2735
2837
|
}
|
|
2736
2838
|
get mustBeDirectChildOfDocument() {
|
|
2737
|
-
return this.
|
|
2839
|
+
return this.on();
|
|
2738
2840
|
}
|
|
2739
2841
|
get markdownDocument() {
|
|
2740
|
-
return this.
|
|
2842
|
+
return this.jn();
|
|
2741
2843
|
}
|
|
2742
2844
|
set markdownDocument(value) {
|
|
2743
|
-
this.
|
|
2845
|
+
this.gm(value);
|
|
2744
2846
|
}
|
|
2745
2847
|
}
|
|
2746
2848
|
class HeadingAnchors {
|
|
2747
2849
|
constructor() {
|
|
2748
2850
|
HeadingAnchors_instance = this;
|
|
2749
|
-
this.
|
|
2750
|
-
this.
|
|
2851
|
+
this.dp_1 = Regex.l8('\\s*\\{([^}]+)\\}$');
|
|
2852
|
+
this.ep_1 = Regex.k8('[^\\w\u0430-\u044F\u0456\u0457\u0454]+', RegexOption_IGNORE_CASE_getInstance());
|
|
2751
2853
|
}
|
|
2752
|
-
|
|
2753
|
-
var match = this.
|
|
2854
|
+
fp(idPrefixForDefault, text, useTextInId) {
|
|
2855
|
+
var match = this.dp_1.o8(text);
|
|
2754
2856
|
var tmp;
|
|
2755
2857
|
if (!(match == null)) {
|
|
2756
|
-
tmp = to(match.
|
|
2858
|
+
tmp = to(match.m9().v(1), substring(text, 0, match.r8().wa_1));
|
|
2757
2859
|
} else {
|
|
2758
2860
|
var tmp_0;
|
|
2759
2861
|
if (useTextInId) {
|
|
2760
|
-
tmp_0 = idPrefixForDefault + this.
|
|
2862
|
+
tmp_0 = idPrefixForDefault + this.gp(text);
|
|
2761
2863
|
} else {
|
|
2762
|
-
tmp_0 = idPrefixForDefault + ((new Date()).getTime() + Default_getInstance().
|
|
2864
|
+
tmp_0 = idPrefixForDefault + ((new Date()).getTime() + Default_getInstance().ma());
|
|
2763
2865
|
}
|
|
2764
2866
|
var id = tmp_0;
|
|
2765
2867
|
tmp = to(id, text);
|
|
2766
2868
|
}
|
|
2767
2869
|
return tmp;
|
|
2768
2870
|
}
|
|
2769
|
-
|
|
2871
|
+
gp(text) {
|
|
2770
2872
|
// Inline function 'kotlin.text.lowercase' call
|
|
2771
2873
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2772
2874
|
var tmp0 = text.toLowerCase();
|
|
2773
2875
|
// Inline function 'kotlin.text.replace' call
|
|
2774
|
-
return this.
|
|
2876
|
+
return this.ep_1.p8(tmp0, '-');
|
|
2775
2877
|
}
|
|
2776
2878
|
}
|
|
2777
2879
|
class MarkdownRenderer {}
|
|
@@ -2887,19 +2989,19 @@ class TsStackMarkdownRenderer extends logic_tools_markdown_komponents_tsstack_Ts
|
|
|
2887
2989
|
constructor(delegate) {
|
|
2888
2990
|
delegate = delegate === VOID ? new MarkdownComponentsRenderer() : delegate;
|
|
2889
2991
|
super();
|
|
2890
|
-
this.
|
|
2891
|
-
this.
|
|
2992
|
+
this.hp_1 = delegate;
|
|
2993
|
+
this.ip_1 = false;
|
|
2892
2994
|
}
|
|
2893
|
-
|
|
2894
|
-
return this.
|
|
2995
|
+
jp() {
|
|
2996
|
+
return this.hp_1;
|
|
2895
2997
|
}
|
|
2896
|
-
|
|
2998
|
+
kp(code, lang, escaped, meta) {
|
|
2897
2999
|
var tmp;
|
|
2898
3000
|
// Inline function 'kotlin.text.isNullOrEmpty' call
|
|
2899
3001
|
if (!(meta == null || charSequenceLength(meta) === 0)) {
|
|
2900
|
-
var _destruct__k2r9zo = HeadingAnchors_getInstance().
|
|
2901
|
-
var id = _destruct__k2r9zo.
|
|
2902
|
-
var newLang = _destruct__k2r9zo.
|
|
3002
|
+
var _destruct__k2r9zo = HeadingAnchors_getInstance().fp('code-', meta, false);
|
|
3003
|
+
var id = _destruct__k2r9zo.ob();
|
|
3004
|
+
var newLang = _destruct__k2r9zo.pb();
|
|
2903
3005
|
tmp = this.codeWithAnchor(code, newLang, id, escaped);
|
|
2904
3006
|
} else {
|
|
2905
3007
|
tmp = this.codeWithAnchor(code, lang, null, escaped);
|
|
@@ -2907,9 +3009,9 @@ class TsStackMarkdownRenderer extends logic_tools_markdown_komponents_tsstack_Ts
|
|
|
2907
3009
|
return tmp;
|
|
2908
3010
|
}
|
|
2909
3011
|
code(code, lang, escaped, meta) {
|
|
2910
|
-
return this.
|
|
3012
|
+
return this.kp(code, lang, escaped, meta);
|
|
2911
3013
|
}
|
|
2912
|
-
|
|
3014
|
+
lp(code, lang, id, escaped) {
|
|
2913
3015
|
var tmp;
|
|
2914
3016
|
if (!(escaped === true)) {
|
|
2915
3017
|
var tmp0_safe_receiver = this.options.escape;
|
|
@@ -2919,119 +3021,119 @@ class TsStackMarkdownRenderer extends logic_tools_markdown_komponents_tsstack_Ts
|
|
|
2919
3021
|
tmp = code;
|
|
2920
3022
|
}
|
|
2921
3023
|
var codeText = tmp;
|
|
2922
|
-
return this.
|
|
3024
|
+
return this.hp_1.code(codeText, lang, id);
|
|
2923
3025
|
}
|
|
2924
3026
|
codeWithAnchor(code, lang, id, escaped, $super) {
|
|
2925
3027
|
escaped = escaped === VOID ? null : escaped;
|
|
2926
|
-
return $super === VOID ? this.
|
|
3028
|
+
return $super === VOID ? this.lp(code, lang, id, escaped) : $super.lp.call(this, code, lang, id, escaped);
|
|
2927
3029
|
}
|
|
2928
|
-
|
|
2929
|
-
return this.
|
|
3030
|
+
mp(quote) {
|
|
3031
|
+
return this.hp_1.blockquote(quote);
|
|
2930
3032
|
}
|
|
2931
3033
|
blockquote(quote) {
|
|
2932
|
-
return this.
|
|
3034
|
+
return this.mp(quote);
|
|
2933
3035
|
}
|
|
2934
|
-
|
|
2935
|
-
return this.
|
|
3036
|
+
np(html) {
|
|
3037
|
+
return this.hp_1.html(html);
|
|
2936
3038
|
}
|
|
2937
3039
|
html(html) {
|
|
2938
|
-
return this.
|
|
3040
|
+
return this.np(html);
|
|
2939
3041
|
}
|
|
2940
|
-
|
|
2941
|
-
var _destruct__k2r9zo = HeadingAnchors_getInstance().
|
|
2942
|
-
var id = _destruct__k2r9zo.
|
|
2943
|
-
var newText = _destruct__k2r9zo.
|
|
2944
|
-
return this.
|
|
3042
|
+
op(text, level, raw) {
|
|
3043
|
+
var _destruct__k2r9zo = HeadingAnchors_getInstance().fp('heading-', text, true);
|
|
3044
|
+
var id = _destruct__k2r9zo.ob();
|
|
3045
|
+
var newText = _destruct__k2r9zo.pb();
|
|
3046
|
+
return this.hp_1.heading(newText, level, id);
|
|
2945
3047
|
}
|
|
2946
3048
|
heading(text, level, raw) {
|
|
2947
|
-
return this.
|
|
3049
|
+
return this.op(text, level, raw);
|
|
2948
3050
|
}
|
|
2949
|
-
|
|
2950
|
-
return this.
|
|
3051
|
+
pp() {
|
|
3052
|
+
return this.hp_1.hr();
|
|
2951
3053
|
}
|
|
2952
3054
|
hr() {
|
|
2953
|
-
return this.
|
|
3055
|
+
return this.pp();
|
|
2954
3056
|
}
|
|
2955
|
-
|
|
2956
|
-
return this.
|
|
3057
|
+
qp(body, ordered) {
|
|
3058
|
+
return this.hp_1.list(body, ordered === true);
|
|
2957
3059
|
}
|
|
2958
3060
|
list(body, ordered) {
|
|
2959
|
-
return this.
|
|
3061
|
+
return this.qp(body, ordered);
|
|
2960
3062
|
}
|
|
2961
|
-
|
|
2962
|
-
return startsWith(text, '<markdown-paragraph>[ ] ') ? this.
|
|
3063
|
+
rp(text) {
|
|
3064
|
+
return startsWith(text, '<markdown-paragraph>[ ] ') ? this.hp_1.taskListItem(replacePrefixOnce(text, '<markdown-paragraph>[ ] ', '<markdown-paragraph>'), false) : startsWith(text, '<markdown-paragraph>[x] ') ? this.hp_1.taskListItem(replacePrefixOnce(text, '<markdown-paragraph>[x] ', '<markdown-paragraph>'), true) : startsWith(text, '[ ] ') ? this.hp_1.taskListItem(removePrefix(text, '[ ] '), false) : startsWith(text, '[x] ') ? this.hp_1.taskListItem(removePrefix(text, '[x] '), true) : this.hp_1.listItem(text);
|
|
2963
3065
|
}
|
|
2964
3066
|
listitem(text) {
|
|
2965
|
-
return this.
|
|
3067
|
+
return this.rp(text);
|
|
2966
3068
|
}
|
|
2967
|
-
|
|
2968
|
-
return this.
|
|
3069
|
+
sp(text) {
|
|
3070
|
+
return this.hp_1.paragraph(text);
|
|
2969
3071
|
}
|
|
2970
3072
|
paragraph(text) {
|
|
2971
|
-
return this.
|
|
3073
|
+
return this.sp(text);
|
|
2972
3074
|
}
|
|
2973
|
-
|
|
2974
|
-
return this.
|
|
3075
|
+
tp(header, body) {
|
|
3076
|
+
return this.hp_1.table(header, body);
|
|
2975
3077
|
}
|
|
2976
3078
|
table(header, body) {
|
|
2977
|
-
return this.
|
|
3079
|
+
return this.tp(header, body);
|
|
2978
3080
|
}
|
|
2979
|
-
|
|
2980
|
-
var isHeaderRow = this.
|
|
2981
|
-
this.
|
|
2982
|
-
return isHeaderRow ? this.
|
|
3081
|
+
up(content) {
|
|
3082
|
+
var isHeaderRow = this.ip_1;
|
|
3083
|
+
this.ip_1 = false;
|
|
3084
|
+
return isHeaderRow ? this.hp_1.tableHeaderRow(content) : this.hp_1.tableRow(content);
|
|
2983
3085
|
}
|
|
2984
3086
|
tablerow(content) {
|
|
2985
|
-
return this.
|
|
3087
|
+
return this.up(content);
|
|
2986
3088
|
}
|
|
2987
|
-
|
|
3089
|
+
vp(content, flags) {
|
|
2988
3090
|
var tmp;
|
|
2989
3091
|
if (flags.header == true) {
|
|
2990
|
-
this.
|
|
2991
|
-
tmp = this.
|
|
3092
|
+
this.ip_1 = true;
|
|
3093
|
+
tmp = this.hp_1.tableHeaderCell(content);
|
|
2992
3094
|
} else {
|
|
2993
|
-
tmp = this.
|
|
3095
|
+
tmp = this.hp_1.tableCell(content);
|
|
2994
3096
|
}
|
|
2995
3097
|
return tmp;
|
|
2996
3098
|
}
|
|
2997
3099
|
tablecell(content, flags) {
|
|
2998
|
-
return this.
|
|
3100
|
+
return this.vp(content, flags);
|
|
2999
3101
|
}
|
|
3000
|
-
|
|
3001
|
-
return this.
|
|
3102
|
+
wp(text) {
|
|
3103
|
+
return this.hp_1.strong(text);
|
|
3002
3104
|
}
|
|
3003
3105
|
strong(text) {
|
|
3004
|
-
return this.
|
|
3106
|
+
return this.wp(text);
|
|
3005
3107
|
}
|
|
3006
|
-
|
|
3007
|
-
return this.
|
|
3108
|
+
xp(text) {
|
|
3109
|
+
return this.hp_1.emphasis(text);
|
|
3008
3110
|
}
|
|
3009
3111
|
em(text) {
|
|
3010
|
-
return this.
|
|
3112
|
+
return this.xp(text);
|
|
3011
3113
|
}
|
|
3012
|
-
|
|
3013
|
-
return this.
|
|
3114
|
+
yp(text) {
|
|
3115
|
+
return this.hp_1.codeSpan(text);
|
|
3014
3116
|
}
|
|
3015
3117
|
codespan(text) {
|
|
3016
|
-
return this.
|
|
3118
|
+
return this.yp(text);
|
|
3017
3119
|
}
|
|
3018
|
-
|
|
3019
|
-
return this.
|
|
3120
|
+
zp(text) {
|
|
3121
|
+
return this.hp_1.strikethrough(text);
|
|
3020
3122
|
}
|
|
3021
3123
|
del(text) {
|
|
3022
|
-
return this.
|
|
3124
|
+
return this.zp(text);
|
|
3023
3125
|
}
|
|
3024
|
-
|
|
3025
|
-
return this.
|
|
3126
|
+
aq(href, title, text) {
|
|
3127
|
+
return this.hp_1.link(href, title, text);
|
|
3026
3128
|
}
|
|
3027
3129
|
link(href, title, text) {
|
|
3028
|
-
return this.
|
|
3130
|
+
return this.aq(href, title, text);
|
|
3029
3131
|
}
|
|
3030
|
-
|
|
3031
|
-
return this.
|
|
3132
|
+
bq(href, title, text) {
|
|
3133
|
+
return this.hp_1.image(href, title, text);
|
|
3032
3134
|
}
|
|
3033
3135
|
image(href, title, text) {
|
|
3034
|
-
return this.
|
|
3136
|
+
return this.bq(href, title, text);
|
|
3035
3137
|
}
|
|
3036
3138
|
}
|
|
3037
3139
|
//endregion
|
|
@@ -3150,6 +3252,177 @@ function DropdownElement$lambda($this$element) {
|
|
|
3150
3252
|
slot($this$element);
|
|
3151
3253
|
return Unit_instance;
|
|
3152
3254
|
}
|
|
3255
|
+
function htmlToMarkdownFragment(html) {
|
|
3256
|
+
var container = document.createElement('div');
|
|
3257
|
+
container.innerHTML = html;
|
|
3258
|
+
var fragment = document.createDocumentFragment();
|
|
3259
|
+
var currentParagraph = {_v: document.createElement('markdown-paragraph')};
|
|
3260
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
3261
|
+
var _iterator__ex2g4s = asList(container.childNodes).r();
|
|
3262
|
+
while (_iterator__ex2g4s.s()) {
|
|
3263
|
+
var element = _iterator__ex2g4s.t();
|
|
3264
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
3265
|
+
var _iterator__ex2g4s_0 = convertInlineNode(element).r();
|
|
3266
|
+
while (_iterator__ex2g4s_0.s()) {
|
|
3267
|
+
var element_0 = _iterator__ex2g4s_0.t();
|
|
3268
|
+
currentParagraph._v.appendChild(element_0);
|
|
3269
|
+
}
|
|
3270
|
+
var tmp;
|
|
3271
|
+
if (element instanceof Element) {
|
|
3272
|
+
var tmp_0 = setOf(['p', 'div']);
|
|
3273
|
+
// Inline function 'kotlin.text.lowercase' call
|
|
3274
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
3275
|
+
var tmp$ret$4 = element.tagName.toLowerCase();
|
|
3276
|
+
tmp = tmp_0.m1(tmp$ret$4);
|
|
3277
|
+
} else {
|
|
3278
|
+
tmp = false;
|
|
3279
|
+
}
|
|
3280
|
+
if (tmp) {
|
|
3281
|
+
htmlToMarkdownFragment$flushParagraphIfNonEmpty(currentParagraph, fragment);
|
|
3282
|
+
}
|
|
3283
|
+
}
|
|
3284
|
+
htmlToMarkdownFragment$flushParagraphIfNonEmpty(currentParagraph, fragment);
|
|
3285
|
+
return fragment;
|
|
3286
|
+
}
|
|
3287
|
+
function convertInlineNode(node) {
|
|
3288
|
+
var tmp;
|
|
3289
|
+
if (node instanceof Text) {
|
|
3290
|
+
var tmp_0 = document;
|
|
3291
|
+
var tmp0_elvis_lhs = node.textContent;
|
|
3292
|
+
tmp = listOf(tmp_0.createTextNode(tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs));
|
|
3293
|
+
} else {
|
|
3294
|
+
if (node instanceof Element) {
|
|
3295
|
+
// Inline function 'kotlin.collections.flatMap' call
|
|
3296
|
+
var tmp0 = asList(node.childNodes);
|
|
3297
|
+
// Inline function 'kotlin.collections.flatMapTo' call
|
|
3298
|
+
var destination = ArrayList.z();
|
|
3299
|
+
var _iterator__ex2g4s = tmp0.r();
|
|
3300
|
+
while (_iterator__ex2g4s.s()) {
|
|
3301
|
+
var element = _iterator__ex2g4s.t();
|
|
3302
|
+
var list = convertInlineNode(element);
|
|
3303
|
+
addAll(destination, list);
|
|
3304
|
+
}
|
|
3305
|
+
var children = destination;
|
|
3306
|
+
// Inline function 'kotlin.text.lowercase' call
|
|
3307
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
3308
|
+
var tmp_1;
|
|
3309
|
+
switch (node.tagName.toLowerCase()) {
|
|
3310
|
+
case 'b':
|
|
3311
|
+
case 'strong':
|
|
3312
|
+
tmp_1 = children.d1() ? children : listOf(wrapChildren('markdown-strong', children));
|
|
3313
|
+
break;
|
|
3314
|
+
case 'i':
|
|
3315
|
+
case 'em':
|
|
3316
|
+
tmp_1 = children.d1() ? children : listOf(wrapChildren('markdown-emphasis', children));
|
|
3317
|
+
break;
|
|
3318
|
+
case 'a':
|
|
3319
|
+
var tmp2_safe_receiver = node.getAttribute('href');
|
|
3320
|
+
var tmp_2;
|
|
3321
|
+
if (tmp2_safe_receiver == null) {
|
|
3322
|
+
tmp_2 = null;
|
|
3323
|
+
} else {
|
|
3324
|
+
// Inline function 'kotlin.takeIf' call
|
|
3325
|
+
var tmp_3;
|
|
3326
|
+
// Inline function 'kotlin.text.isNotEmpty' call
|
|
3327
|
+
if (charSequenceLength(tmp2_safe_receiver) > 0) {
|
|
3328
|
+
tmp_3 = tmp2_safe_receiver;
|
|
3329
|
+
} else {
|
|
3330
|
+
tmp_3 = null;
|
|
3331
|
+
}
|
|
3332
|
+
tmp_2 = tmp_3;
|
|
3333
|
+
}
|
|
3334
|
+
|
|
3335
|
+
var tmp3_safe_receiver = tmp_2;
|
|
3336
|
+
var tmp_4;
|
|
3337
|
+
if (tmp3_safe_receiver == null) {
|
|
3338
|
+
tmp_4 = null;
|
|
3339
|
+
} else {
|
|
3340
|
+
// Inline function 'kotlin.let' call
|
|
3341
|
+
// Inline function 'kotlin.apply' call
|
|
3342
|
+
var this_0 = wrapChildren('markdown-link', children);
|
|
3343
|
+
this_0.setAttribute('destination', tmp3_safe_receiver);
|
|
3344
|
+
tmp_4 = listOf(this_0);
|
|
3345
|
+
}
|
|
3346
|
+
|
|
3347
|
+
var tmp4_elvis_lhs = tmp_4;
|
|
3348
|
+
tmp_1 = tmp4_elvis_lhs == null ? children : tmp4_elvis_lhs;
|
|
3349
|
+
break;
|
|
3350
|
+
case 'img':
|
|
3351
|
+
var tmp5_safe_receiver = node.getAttribute('src');
|
|
3352
|
+
var tmp_5;
|
|
3353
|
+
if (tmp5_safe_receiver == null) {
|
|
3354
|
+
tmp_5 = null;
|
|
3355
|
+
} else {
|
|
3356
|
+
// Inline function 'kotlin.takeIf' call
|
|
3357
|
+
var tmp_6;
|
|
3358
|
+
// Inline function 'kotlin.text.isNotEmpty' call
|
|
3359
|
+
if (charSequenceLength(tmp5_safe_receiver) > 0) {
|
|
3360
|
+
tmp_6 = tmp5_safe_receiver;
|
|
3361
|
+
} else {
|
|
3362
|
+
tmp_6 = null;
|
|
3363
|
+
}
|
|
3364
|
+
tmp_5 = tmp_6;
|
|
3365
|
+
}
|
|
3366
|
+
|
|
3367
|
+
var tmp6_safe_receiver = tmp_5;
|
|
3368
|
+
var tmp_7;
|
|
3369
|
+
if (tmp6_safe_receiver == null) {
|
|
3370
|
+
tmp_7 = null;
|
|
3371
|
+
} else {
|
|
3372
|
+
// Inline function 'kotlin.let' call
|
|
3373
|
+
// Inline function 'kotlin.apply' call
|
|
3374
|
+
var this_1 = document.createElement('markdown-image');
|
|
3375
|
+
this_1.setAttribute('destination', tmp6_safe_receiver);
|
|
3376
|
+
var tmp0_safe_receiver = node.getAttribute('title');
|
|
3377
|
+
if (tmp0_safe_receiver == null)
|
|
3378
|
+
null;
|
|
3379
|
+
else {
|
|
3380
|
+
// Inline function 'kotlin.let' call
|
|
3381
|
+
this_1.setAttribute('title', tmp0_safe_receiver);
|
|
3382
|
+
}
|
|
3383
|
+
var tmp1_elvis_lhs = node.getAttribute('alt');
|
|
3384
|
+
this_1.textContent = tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
|
|
3385
|
+
tmp_7 = listOf(this_1);
|
|
3386
|
+
}
|
|
3387
|
+
|
|
3388
|
+
var tmp7_elvis_lhs = tmp_7;
|
|
3389
|
+
tmp_1 = tmp7_elvis_lhs == null ? emptyList() : tmp7_elvis_lhs;
|
|
3390
|
+
break;
|
|
3391
|
+
case 'br':
|
|
3392
|
+
tmp_1 = listOf(document.createElement('br'));
|
|
3393
|
+
break;
|
|
3394
|
+
case 'script':
|
|
3395
|
+
case 'style':
|
|
3396
|
+
tmp_1 = emptyList();
|
|
3397
|
+
break;
|
|
3398
|
+
default:
|
|
3399
|
+
tmp_1 = children;
|
|
3400
|
+
break;
|
|
3401
|
+
}
|
|
3402
|
+
tmp = tmp_1;
|
|
3403
|
+
} else {
|
|
3404
|
+
tmp = emptyList();
|
|
3405
|
+
}
|
|
3406
|
+
}
|
|
3407
|
+
return tmp;
|
|
3408
|
+
}
|
|
3409
|
+
function wrapChildren(tagName, children) {
|
|
3410
|
+
// Inline function 'kotlin.apply' call
|
|
3411
|
+
var this_0 = document.createElement(tagName);
|
|
3412
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
3413
|
+
var _iterator__ex2g4s = children.r();
|
|
3414
|
+
while (_iterator__ex2g4s.s()) {
|
|
3415
|
+
var element = _iterator__ex2g4s.t();
|
|
3416
|
+
this_0.appendChild(element);
|
|
3417
|
+
}
|
|
3418
|
+
return this_0;
|
|
3419
|
+
}
|
|
3420
|
+
function htmlToMarkdownFragment$flushParagraphIfNonEmpty(currentParagraph, fragment) {
|
|
3421
|
+
if (currentParagraph._v.hasChildNodes()) {
|
|
3422
|
+
fragment.appendChild(currentParagraph._v);
|
|
3423
|
+
}
|
|
3424
|
+
currentParagraph._v = document.createElement('markdown-paragraph');
|
|
3425
|
+
}
|
|
3153
3426
|
function get_defaultParser() {
|
|
3154
3427
|
_init_properties_MarkdownDocument_kt__r41r2i();
|
|
3155
3428
|
return defaultParser;
|
|
@@ -3198,7 +3471,7 @@ function onDrop($this, event) {
|
|
|
3198
3471
|
var file = ensureNotNull(files.item(0));
|
|
3199
3472
|
var tmp0 = file.type;
|
|
3200
3473
|
// Inline function 'kotlin.text.matches' call
|
|
3201
|
-
if (Regex.
|
|
3474
|
+
if (Regex.l8('image.*').m8(tmp0)) {
|
|
3202
3475
|
event.stopPropagation();
|
|
3203
3476
|
event.preventDefault();
|
|
3204
3477
|
var reader = new FileReader();
|
|
@@ -3245,59 +3518,153 @@ function onDragOver($this, event) {
|
|
|
3245
3518
|
event.preventDefault();
|
|
3246
3519
|
}
|
|
3247
3520
|
function onPaste($this, event) {
|
|
3248
|
-
var
|
|
3249
|
-
var
|
|
3521
|
+
var clipboardData = event.clipboardData;
|
|
3522
|
+
var tmp1_safe_receiver = clipboardData == null ? null : clipboardData.getData('text/markdown');
|
|
3523
|
+
var tmp;
|
|
3524
|
+
if (tmp1_safe_receiver == null) {
|
|
3525
|
+
tmp = null;
|
|
3526
|
+
} else {
|
|
3527
|
+
// Inline function 'kotlin.takeIf' call
|
|
3528
|
+
var tmp_0;
|
|
3529
|
+
// Inline function 'kotlin.text.isNotEmpty' call
|
|
3530
|
+
if (charSequenceLength(tmp1_safe_receiver) > 0) {
|
|
3531
|
+
tmp_0 = tmp1_safe_receiver;
|
|
3532
|
+
} else {
|
|
3533
|
+
tmp_0 = null;
|
|
3534
|
+
}
|
|
3535
|
+
tmp = tmp_0;
|
|
3536
|
+
}
|
|
3537
|
+
var markdownFromClipboard = tmp;
|
|
3250
3538
|
// Inline function 'kotlin.text.isNullOrEmpty' call
|
|
3251
|
-
if (!(
|
|
3252
|
-
|
|
3253
|
-
|
|
3539
|
+
if (!(markdownFromClipboard == null || charSequenceLength(markdownFromClipboard) === 0)) {
|
|
3540
|
+
insertMarkdownAtSelection($this, markdownFromClipboard);
|
|
3541
|
+
event.preventDefault();
|
|
3542
|
+
$this.onChange();
|
|
3543
|
+
return Unit_instance;
|
|
3544
|
+
}
|
|
3545
|
+
var tmp3_safe_receiver = clipboardData == null ? null : clipboardData.getData('text/html');
|
|
3546
|
+
var tmp_1;
|
|
3547
|
+
if (tmp3_safe_receiver == null) {
|
|
3548
|
+
tmp_1 = null;
|
|
3549
|
+
} else {
|
|
3550
|
+
// Inline function 'kotlin.takeIf' call
|
|
3551
|
+
var tmp_2;
|
|
3552
|
+
// Inline function 'kotlin.text.isNotEmpty' call
|
|
3553
|
+
if (charSequenceLength(tmp3_safe_receiver) > 0) {
|
|
3554
|
+
tmp_2 = tmp3_safe_receiver;
|
|
3555
|
+
} else {
|
|
3556
|
+
tmp_2 = null;
|
|
3557
|
+
}
|
|
3558
|
+
tmp_1 = tmp_2;
|
|
3559
|
+
}
|
|
3560
|
+
var html = tmp_1;
|
|
3561
|
+
var tmp_3;
|
|
3562
|
+
if (html == null) {
|
|
3563
|
+
tmp_3 = null;
|
|
3564
|
+
} else {
|
|
3565
|
+
// Inline function 'kotlin.let' call
|
|
3566
|
+
tmp_3 = htmlToMarkdownFragment(html);
|
|
3567
|
+
}
|
|
3568
|
+
var htmlFragment = tmp_3;
|
|
3569
|
+
if (!(htmlFragment == null) && htmlFragment.hasChildNodes()) {
|
|
3570
|
+
var tmp5_safe_receiver = $this.getSelection();
|
|
3571
|
+
if (tmp5_safe_receiver == null)
|
|
3254
3572
|
null;
|
|
3255
3573
|
else {
|
|
3256
|
-
|
|
3574
|
+
tmp5_safe_receiver.deleteFromDocument();
|
|
3257
3575
|
}
|
|
3258
|
-
var
|
|
3259
|
-
var
|
|
3260
|
-
|
|
3261
|
-
|
|
3576
|
+
var tmp6_safe_receiver = $this.getSelection();
|
|
3577
|
+
var range = tmp6_safe_receiver == null ? null : tmp6_safe_receiver.getRangeAt(0);
|
|
3578
|
+
if (!(range == null)) {
|
|
3579
|
+
insertFragmentAtSelection($this, range, htmlFragment);
|
|
3580
|
+
event.preventDefault();
|
|
3581
|
+
$this.onChange();
|
|
3262
3582
|
return Unit_instance;
|
|
3263
|
-
} else {
|
|
3264
|
-
tmp = tmp3_elvis_lhs;
|
|
3265
3583
|
}
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3584
|
+
}
|
|
3585
|
+
var plainText = clipboardData == null ? null : clipboardData.getData('text/plain');
|
|
3586
|
+
// Inline function 'kotlin.text.isNullOrEmpty' call
|
|
3587
|
+
if (!(plainText == null || charSequenceLength(plainText) === 0)) {
|
|
3588
|
+
insertPlainTextAtSelection($this, plainText);
|
|
3589
|
+
event.preventDefault();
|
|
3590
|
+
$this.onChange();
|
|
3591
|
+
}
|
|
3592
|
+
}
|
|
3593
|
+
function insertMarkdownAtSelection($this, markdown) {
|
|
3594
|
+
var tmp0_safe_receiver = $this.getSelection();
|
|
3595
|
+
if (tmp0_safe_receiver == null)
|
|
3596
|
+
null;
|
|
3597
|
+
else {
|
|
3598
|
+
tmp0_safe_receiver.deleteFromDocument();
|
|
3599
|
+
}
|
|
3600
|
+
var tmp1_safe_receiver = $this.getSelection();
|
|
3601
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.getRangeAt(0);
|
|
3602
|
+
var tmp;
|
|
3603
|
+
if (tmp2_elvis_lhs == null) {
|
|
3604
|
+
return Unit_instance;
|
|
3605
|
+
} else {
|
|
3606
|
+
tmp = tmp2_elvis_lhs;
|
|
3607
|
+
}
|
|
3608
|
+
var range = tmp;
|
|
3609
|
+
insertFragmentAtSelection($this, range, range.createContextualFragment($this.parser(markdown)));
|
|
3610
|
+
}
|
|
3611
|
+
function insertFragmentAtSelection($this, range, pastedNode) {
|
|
3612
|
+
var firstChild = pastedNode.firstChild;
|
|
3613
|
+
var tmp;
|
|
3614
|
+
var tmp_0;
|
|
3615
|
+
if (pastedNode.childNodes.length === 1) {
|
|
3616
|
+
tmp_0 = firstChild instanceof MarkdownParagraph;
|
|
3617
|
+
} else {
|
|
3618
|
+
tmp_0 = false;
|
|
3619
|
+
}
|
|
3620
|
+
if (tmp_0) {
|
|
3621
|
+
var tmp_1 = $this.getCurrentLeafBlock();
|
|
3622
|
+
tmp = tmp_1 instanceof MarkdownParagraph;
|
|
3623
|
+
} else {
|
|
3624
|
+
tmp = false;
|
|
3625
|
+
}
|
|
3626
|
+
if (tmp) {
|
|
3627
|
+
var inlineContent = document.createDocumentFragment();
|
|
3628
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
3629
|
+
var _iterator__ex2g4s = toList(asList(firstChild.childNodes)).r();
|
|
3630
|
+
while (_iterator__ex2g4s.s()) {
|
|
3631
|
+
var element = _iterator__ex2g4s.t();
|
|
3632
|
+
inlineContent.appendChild(element);
|
|
3633
|
+
}
|
|
3634
|
+
range.insertNode(inlineContent);
|
|
3635
|
+
} else {
|
|
3271
3636
|
var tmp_2;
|
|
3637
|
+
var tmp_3;
|
|
3638
|
+
var tmp_4;
|
|
3272
3639
|
if (pastedNode.childNodes.length === 1) {
|
|
3273
|
-
|
|
3640
|
+
tmp_4 = firstChild instanceof MarkdownComponent;
|
|
3274
3641
|
} else {
|
|
3275
|
-
|
|
3642
|
+
tmp_4 = false;
|
|
3276
3643
|
}
|
|
3277
|
-
if (
|
|
3278
|
-
|
|
3644
|
+
if (tmp_4) {
|
|
3645
|
+
tmp_3 = firstChild.mustBeDirectChildOfDocument;
|
|
3279
3646
|
} else {
|
|
3280
|
-
|
|
3647
|
+
tmp_3 = false;
|
|
3281
3648
|
}
|
|
3282
|
-
if (
|
|
3283
|
-
var
|
|
3284
|
-
|
|
3649
|
+
if (tmp_3) {
|
|
3650
|
+
var tmp5_safe_receiver = $this.getSelection();
|
|
3651
|
+
tmp_2 = !equals(tmp5_safe_receiver == null ? null : tmp5_safe_receiver.anchorNode, $this);
|
|
3285
3652
|
} else {
|
|
3286
|
-
|
|
3653
|
+
tmp_2 = false;
|
|
3287
3654
|
}
|
|
3288
|
-
if (
|
|
3289
|
-
var
|
|
3290
|
-
var documentChild =
|
|
3655
|
+
if (tmp_2) {
|
|
3656
|
+
var tmp0_safe_receiver = $this.getSelection();
|
|
3657
|
+
var documentChild = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.anchorNode;
|
|
3291
3658
|
while (!(documentChild == null) && !equals(documentChild.parentElement, $this)) {
|
|
3292
3659
|
documentChild = documentChild.parentElement;
|
|
3293
3660
|
}
|
|
3294
3661
|
if (documentChild instanceof Element) {
|
|
3295
|
-
var
|
|
3296
|
-
var offset =
|
|
3297
|
-
var
|
|
3298
|
-
var
|
|
3299
|
-
var
|
|
3300
|
-
var length =
|
|
3662
|
+
var tmp1_safe_receiver = $this.getSelection();
|
|
3663
|
+
var offset = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.anchorOffset;
|
|
3664
|
+
var tmp2_safe_receiver = $this.getSelection();
|
|
3665
|
+
var tmp3_safe_receiver = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.anchorNode;
|
|
3666
|
+
var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : tmp3_safe_receiver.textContent;
|
|
3667
|
+
var length = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.length;
|
|
3301
3668
|
if (!(offset == null) && !(length == null) && offset > (length / 2 | 0)) {
|
|
3302
3669
|
documentChild.after(pastedNode);
|
|
3303
3670
|
} else {
|
|
@@ -3309,28 +3676,125 @@ function onPaste($this, event) {
|
|
|
3309
3676
|
} else {
|
|
3310
3677
|
range.insertNode(pastedNode);
|
|
3311
3678
|
}
|
|
3312
|
-
|
|
3679
|
+
}
|
|
3680
|
+
}
|
|
3681
|
+
function insertPlainTextAtSelection($this, text) {
|
|
3682
|
+
var tmp0_safe_receiver = $this.getSelection();
|
|
3683
|
+
if (tmp0_safe_receiver == null)
|
|
3684
|
+
null;
|
|
3685
|
+
else {
|
|
3686
|
+
tmp0_safe_receiver.deleteFromDocument();
|
|
3687
|
+
}
|
|
3688
|
+
var tmp1_safe_receiver = $this.getSelection();
|
|
3689
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.getRangeAt(0);
|
|
3690
|
+
var tmp;
|
|
3691
|
+
if (tmp2_elvis_lhs == null) {
|
|
3692
|
+
return Unit_instance;
|
|
3693
|
+
} else {
|
|
3694
|
+
tmp = tmp2_elvis_lhs;
|
|
3695
|
+
}
|
|
3696
|
+
var range = tmp;
|
|
3697
|
+
var fragment = document.createDocumentFragment();
|
|
3698
|
+
var lastNode = null;
|
|
3699
|
+
// Inline function 'kotlin.collections.forEachIndexed' call
|
|
3700
|
+
var index = 0;
|
|
3701
|
+
var _iterator__ex2g4s = split(text, ['\n']).r();
|
|
3702
|
+
while (_iterator__ex2g4s.s()) {
|
|
3703
|
+
var item = _iterator__ex2g4s.t();
|
|
3704
|
+
var _unary__edvuaz = index;
|
|
3705
|
+
index = _unary__edvuaz + 1 | 0;
|
|
3706
|
+
if (checkIndexOverflow(_unary__edvuaz) > 0) {
|
|
3707
|
+
fragment.appendChild(document.createElement('br'));
|
|
3708
|
+
}
|
|
3709
|
+
var textNode = document.createTextNode(item);
|
|
3710
|
+
fragment.appendChild(textNode);
|
|
3711
|
+
lastNode = textNode;
|
|
3712
|
+
}
|
|
3713
|
+
range.insertNode(fragment);
|
|
3714
|
+
var tmp3_safe_receiver = lastNode;
|
|
3715
|
+
if (tmp3_safe_receiver == null)
|
|
3716
|
+
null;
|
|
3717
|
+
else {
|
|
3718
|
+
// Inline function 'kotlin.let' call
|
|
3719
|
+
var newRange = document.createRange();
|
|
3720
|
+
var tmp0_safe_receiver_0 = tmp3_safe_receiver.textContent;
|
|
3721
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.length;
|
|
3722
|
+
newRange.setStart(tmp3_safe_receiver, tmp1_elvis_lhs == null ? 0 : tmp1_elvis_lhs);
|
|
3723
|
+
newRange.collapse(true);
|
|
3724
|
+
var tmp2_safe_receiver = $this.getSelection();
|
|
3725
|
+
if (tmp2_safe_receiver == null)
|
|
3726
|
+
null;
|
|
3727
|
+
else {
|
|
3728
|
+
tmp2_safe_receiver.removeAllRanges();
|
|
3729
|
+
}
|
|
3730
|
+
var tmp3_safe_receiver_0 = $this.getSelection();
|
|
3731
|
+
var tmp_0;
|
|
3732
|
+
if (tmp3_safe_receiver_0 == null) {
|
|
3733
|
+
tmp_0 = null;
|
|
3734
|
+
} else {
|
|
3735
|
+
tmp3_safe_receiver_0.addRange(newRange);
|
|
3736
|
+
tmp_0 = Unit_instance;
|
|
3737
|
+
}
|
|
3738
|
+
}
|
|
3739
|
+
}
|
|
3740
|
+
function onCopy($this, event) {
|
|
3741
|
+
var tmp0_elvis_lhs = $this.getSelection();
|
|
3742
|
+
var tmp;
|
|
3743
|
+
if (tmp0_elvis_lhs == null) {
|
|
3744
|
+
return Unit_instance;
|
|
3745
|
+
} else {
|
|
3746
|
+
tmp = tmp0_elvis_lhs;
|
|
3747
|
+
}
|
|
3748
|
+
var selection = tmp;
|
|
3749
|
+
if (selection.isCollapsed || selection.rangeCount === 0)
|
|
3750
|
+
return Unit_instance;
|
|
3751
|
+
var fragment = selection.getRangeAt(0).cloneContents();
|
|
3752
|
+
var tmp1_safe_receiver = event.clipboardData;
|
|
3753
|
+
if (tmp1_safe_receiver == null)
|
|
3754
|
+
null;
|
|
3755
|
+
else {
|
|
3756
|
+
var tmp2_elvis_lhs = fragment.textContent;
|
|
3757
|
+
tmp1_safe_receiver.setData('text/plain', tmp2_elvis_lhs == null ? '' : tmp2_elvis_lhs);
|
|
3758
|
+
}
|
|
3759
|
+
var tmp3_safe_receiver = event.clipboardData;
|
|
3760
|
+
if (tmp3_safe_receiver == null)
|
|
3761
|
+
null;
|
|
3762
|
+
else {
|
|
3763
|
+
tmp3_safe_receiver.setData('text/markdown', getMarkdownWithTextForElement(fragment));
|
|
3764
|
+
}
|
|
3765
|
+
event.preventDefault();
|
|
3766
|
+
}
|
|
3767
|
+
function onCut($this, event) {
|
|
3768
|
+
onCopy($this, event);
|
|
3769
|
+
if (event.defaultPrevented) {
|
|
3770
|
+
var tmp0_safe_receiver = $this.getSelection();
|
|
3771
|
+
if (tmp0_safe_receiver == null)
|
|
3772
|
+
null;
|
|
3773
|
+
else {
|
|
3774
|
+
tmp0_safe_receiver.deleteFromDocument();
|
|
3775
|
+
}
|
|
3776
|
+
$this.normalizeContent();
|
|
3313
3777
|
$this.onChange();
|
|
3314
3778
|
}
|
|
3315
3779
|
}
|
|
3316
3780
|
function onMouseSelection($this) {
|
|
3317
|
-
if ($this.
|
|
3781
|
+
if ($this.vl_1 && $this.getAttribute('contenteditable') === 'true') {
|
|
3318
3782
|
$this.setAttribute('contenteditable', 'false');
|
|
3319
3783
|
}
|
|
3320
3784
|
}
|
|
3321
3785
|
function onEndMouseSelection($this) {
|
|
3322
|
-
if ($this.
|
|
3786
|
+
if ($this.vl_1 && $this.getAttribute('contenteditable') === 'false') {
|
|
3323
3787
|
$this.setAttribute('contenteditable', $this.getAttribute('readonly') === 'true' ? 'false' : 'true');
|
|
3324
3788
|
$this.focus();
|
|
3325
3789
|
}
|
|
3326
3790
|
}
|
|
3327
3791
|
function mousedown($this, event) {
|
|
3328
3792
|
if ((event.buttons % 2 | 0) === 1) {
|
|
3329
|
-
$this.
|
|
3793
|
+
$this.ul_1 = true;
|
|
3330
3794
|
}
|
|
3331
3795
|
}
|
|
3332
3796
|
function mouseup($this) {
|
|
3333
|
-
$this.
|
|
3797
|
+
$this.ul_1 = false;
|
|
3334
3798
|
onEndMouseSelection($this);
|
|
3335
3799
|
}
|
|
3336
3800
|
function selectstart($this) {
|
|
@@ -3359,7 +3823,7 @@ function selectionchange($this) {
|
|
|
3359
3823
|
tmp_0 = false;
|
|
3360
3824
|
}
|
|
3361
3825
|
if (tmp_0) {
|
|
3362
|
-
if ($this.
|
|
3826
|
+
if ($this.ul_1) {
|
|
3363
3827
|
onMouseSelection($this);
|
|
3364
3828
|
}
|
|
3365
3829
|
enableEditable($this);
|
|
@@ -3367,9 +3831,9 @@ function selectionchange($this) {
|
|
|
3367
3831
|
disableEditable($this);
|
|
3368
3832
|
}
|
|
3369
3833
|
$this.currentSelection = selection;
|
|
3370
|
-
$this.
|
|
3371
|
-
$this.
|
|
3372
|
-
$this.
|
|
3834
|
+
$this.rl_1 = anchorNode;
|
|
3835
|
+
$this.sl_1 = selection.anchorOffset;
|
|
3836
|
+
$this.tl_1 = new StashedSelection(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
|
|
3373
3837
|
affectToolbar($this);
|
|
3374
3838
|
} else {
|
|
3375
3839
|
disableEditable($this);
|
|
@@ -3497,7 +3961,7 @@ function selectionNodeAndOffsetToContentOffset($this, node, offset) {
|
|
|
3497
3961
|
var tmp0_safe_receiver = node.textContent;
|
|
3498
3962
|
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : take(tmp0_safe_receiver, offset);
|
|
3499
3963
|
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : split(tmp1_safe_receiver, [get_ZERO_WIDTH_SPACE()]);
|
|
3500
|
-
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.
|
|
3964
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.u();
|
|
3501
3965
|
var numberOfSpecialChars = (tmp3_elvis_lhs == null ? 1 : tmp3_elvis_lhs) - 1 | 0;
|
|
3502
3966
|
tmp_2 = (parentOffset_0 + offset | 0) - numberOfSpecialChars | 0;
|
|
3503
3967
|
}
|
|
@@ -3509,11 +3973,11 @@ function selectionNodeAndOffsetToContentOffset($this, node, offset) {
|
|
|
3509
3973
|
}
|
|
3510
3974
|
function setSelectionToContentRange($this, range) {
|
|
3511
3975
|
var _destruct__k2r9zo = getNodeAndOffsetFromContentOffsetAnchor($this, range.first);
|
|
3512
|
-
var anchorNode = _destruct__k2r9zo.
|
|
3513
|
-
var anchorOffset = _destruct__k2r9zo.
|
|
3976
|
+
var anchorNode = _destruct__k2r9zo.ob();
|
|
3977
|
+
var anchorOffset = _destruct__k2r9zo.pb();
|
|
3514
3978
|
var _destruct__k2r9zo_0 = getNodeAndOffsetFromContentOffset($this, range.second);
|
|
3515
|
-
var focusNode = _destruct__k2r9zo_0.
|
|
3516
|
-
var focusOffset = _destruct__k2r9zo_0.
|
|
3979
|
+
var focusNode = _destruct__k2r9zo_0.ob();
|
|
3980
|
+
var focusOffset = _destruct__k2r9zo_0.pb();
|
|
3517
3981
|
var domRange = document.createRange();
|
|
3518
3982
|
domRange.setStart(anchorNode, anchorOffset);
|
|
3519
3983
|
domRange.setEnd(focusNode, focusOffset);
|
|
@@ -3532,12 +3996,12 @@ function setSelectionToContentRange($this, range) {
|
|
|
3532
3996
|
}
|
|
3533
3997
|
function getNodeAndOffsetFromContentOffsetAnchor($this, contentOffset) {
|
|
3534
3998
|
var elements = asList($this.children);
|
|
3535
|
-
if (elements.
|
|
3999
|
+
if (elements.d1())
|
|
3536
4000
|
return to($this, contentOffset);
|
|
3537
|
-
var resultNode = elements.
|
|
3538
|
-
var _iterator__ex2g4s = elements.
|
|
3539
|
-
$l$loop_0: while (_iterator__ex2g4s.
|
|
3540
|
-
var child = _iterator__ex2g4s.
|
|
4001
|
+
var resultNode = elements.v(0);
|
|
4002
|
+
var _iterator__ex2g4s = elements.r();
|
|
4003
|
+
$l$loop_0: while (_iterator__ex2g4s.s()) {
|
|
4004
|
+
var child = _iterator__ex2g4s.t();
|
|
3541
4005
|
var lengthUntilChild = $this.contentLengthUntil(child);
|
|
3542
4006
|
if (contentOffset === lengthUntilChild) {
|
|
3543
4007
|
resultNode = child;
|
|
@@ -3557,13 +4021,13 @@ function getNodeAndOffsetFromContentOffsetAnchor($this, contentOffset) {
|
|
|
3557
4021
|
}
|
|
3558
4022
|
function getNodeAndOffsetFromContentOffset($this, contentOffset) {
|
|
3559
4023
|
var elements = asList($this.children);
|
|
3560
|
-
if (elements.
|
|
4024
|
+
if (elements.d1())
|
|
3561
4025
|
return to($this, contentOffset);
|
|
3562
|
-
var resultNode = elements.
|
|
4026
|
+
var resultNode = elements.v(0);
|
|
3563
4027
|
var previousNodeWasEol = false;
|
|
3564
|
-
var _iterator__ex2g4s = elements.
|
|
3565
|
-
$l$loop_0: while (_iterator__ex2g4s.
|
|
3566
|
-
var child = _iterator__ex2g4s.
|
|
4028
|
+
var _iterator__ex2g4s = elements.r();
|
|
4029
|
+
$l$loop_0: while (_iterator__ex2g4s.s()) {
|
|
4030
|
+
var child = _iterator__ex2g4s.t();
|
|
3567
4031
|
var lengthUntilChild = $this.contentLengthUntil(child);
|
|
3568
4032
|
if (contentOffset === lengthUntilChild) {
|
|
3569
4033
|
if (previousNodeWasEol)
|
|
@@ -3599,9 +4063,9 @@ function domModificationOperation($this, operation) {
|
|
|
3599
4063
|
affectToolbar($this);
|
|
3600
4064
|
}
|
|
3601
4065
|
function normalizeDOM($this) {
|
|
3602
|
-
var _iterator__ex2g4s = asList($this.childNodes).
|
|
3603
|
-
while (_iterator__ex2g4s.
|
|
3604
|
-
var child = _iterator__ex2g4s.
|
|
4066
|
+
var _iterator__ex2g4s = asList($this.childNodes).r();
|
|
4067
|
+
while (_iterator__ex2g4s.s()) {
|
|
4068
|
+
var child = _iterator__ex2g4s.t();
|
|
3605
4069
|
if (child instanceof MarkdownComponent) {
|
|
3606
4070
|
if (child.normalizeContent()) {
|
|
3607
4071
|
normalizeDOM($this);
|
|
@@ -3610,9 +4074,9 @@ function normalizeDOM($this) {
|
|
|
3610
4074
|
} else {
|
|
3611
4075
|
if (child instanceof HTMLDivElement) {
|
|
3612
4076
|
// Inline function 'kotlin.collections.forEach' call
|
|
3613
|
-
var _iterator__ex2g4s_0 = toList(asList(child.childNodes)).
|
|
3614
|
-
while (_iterator__ex2g4s_0.
|
|
3615
|
-
var element = _iterator__ex2g4s_0.
|
|
4077
|
+
var _iterator__ex2g4s_0 = toList(asList(child.childNodes)).r();
|
|
4078
|
+
while (_iterator__ex2g4s_0.s()) {
|
|
4079
|
+
var element = _iterator__ex2g4s_0.t();
|
|
3616
4080
|
$this.append(element);
|
|
3617
4081
|
}
|
|
3618
4082
|
child.remove();
|
|
@@ -3626,14 +4090,14 @@ function normalizeDOM($this) {
|
|
|
3626
4090
|
null;
|
|
3627
4091
|
else {
|
|
3628
4092
|
// Inline function 'kotlin.let' call
|
|
3629
|
-
img.
|
|
4093
|
+
img.cm(tmp0_safe_receiver);
|
|
3630
4094
|
}
|
|
3631
4095
|
var tmp1_safe_receiver = child.getAttribute('title');
|
|
3632
4096
|
if (tmp1_safe_receiver == null)
|
|
3633
4097
|
null;
|
|
3634
4098
|
else {
|
|
3635
4099
|
// Inline function 'kotlin.let' call
|
|
3636
|
-
img.
|
|
4100
|
+
img.cm(tmp1_safe_receiver);
|
|
3637
4101
|
}
|
|
3638
4102
|
var tmp2_safe_receiver = child.getAttribute('alt');
|
|
3639
4103
|
if (tmp2_safe_receiver == null)
|
|
@@ -3729,7 +4193,7 @@ function firstUpdated($this) {
|
|
|
3729
4193
|
var tmp = document.createElement('markdown-toc');
|
|
3730
4194
|
var toc = tmp instanceof MarkdownToc ? tmp : THROW_CCE();
|
|
3731
4195
|
toc.classList.add('floating');
|
|
3732
|
-
toc.
|
|
4196
|
+
toc.gm($this);
|
|
3733
4197
|
var tmp0_safe_receiver = $this.shadowRoot;
|
|
3734
4198
|
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.querySelector('.toc');
|
|
3735
4199
|
if (tmp1_safe_receiver == null)
|
|
@@ -3752,6 +4216,64 @@ function renderMarkdown($this, newMarkdown) {
|
|
|
3752
4216
|
$this.innerHTML = $this.parser(newMarkdown);
|
|
3753
4217
|
$this.normalizeContent();
|
|
3754
4218
|
}
|
|
4219
|
+
function deletableComponentAdjacentToCaret($this, before) {
|
|
4220
|
+
var selection = $this.currentSelection;
|
|
4221
|
+
if (!((selection == null ? null : selection.isCollapsed) === true))
|
|
4222
|
+
return null;
|
|
4223
|
+
var tmp1_elvis_lhs = selection.anchorNode;
|
|
4224
|
+
var tmp;
|
|
4225
|
+
if (tmp1_elvis_lhs == null) {
|
|
4226
|
+
return null;
|
|
4227
|
+
} else {
|
|
4228
|
+
tmp = tmp1_elvis_lhs;
|
|
4229
|
+
}
|
|
4230
|
+
var anchor = tmp;
|
|
4231
|
+
var offset = selection.anchorOffset;
|
|
4232
|
+
var tmp_0;
|
|
4233
|
+
if (anchor instanceof Text) {
|
|
4234
|
+
var tmp_1;
|
|
4235
|
+
if (before) {
|
|
4236
|
+
// Inline function 'kotlin.takeIf' call
|
|
4237
|
+
var tmp_2;
|
|
4238
|
+
if (offset === 0) {
|
|
4239
|
+
tmp_2 = anchor;
|
|
4240
|
+
} else {
|
|
4241
|
+
tmp_2 = null;
|
|
4242
|
+
}
|
|
4243
|
+
var tmp2_safe_receiver = tmp_2;
|
|
4244
|
+
tmp_1 = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.previousSibling;
|
|
4245
|
+
} else {
|
|
4246
|
+
// Inline function 'kotlin.takeIf' call
|
|
4247
|
+
var tmp_3;
|
|
4248
|
+
if (offset === anchor.length) {
|
|
4249
|
+
tmp_3 = anchor;
|
|
4250
|
+
} else {
|
|
4251
|
+
tmp_3 = null;
|
|
4252
|
+
}
|
|
4253
|
+
var tmp3_safe_receiver = tmp_3;
|
|
4254
|
+
tmp_1 = tmp3_safe_receiver == null ? null : tmp3_safe_receiver.nextSibling;
|
|
4255
|
+
}
|
|
4256
|
+
tmp_0 = tmp_1;
|
|
4257
|
+
} else {
|
|
4258
|
+
tmp_0 = getOrNull(asList(anchor.childNodes), before ? offset - 1 | 0 : offset);
|
|
4259
|
+
}
|
|
4260
|
+
var candidate = tmp_0;
|
|
4261
|
+
var tmp4_safe_receiver = candidate instanceof MarkdownComponent ? candidate : null;
|
|
4262
|
+
var tmp_4;
|
|
4263
|
+
if (tmp4_safe_receiver == null) {
|
|
4264
|
+
tmp_4 = null;
|
|
4265
|
+
} else {
|
|
4266
|
+
// Inline function 'kotlin.takeIf' call
|
|
4267
|
+
var tmp_5;
|
|
4268
|
+
if (tmp4_safe_receiver.isDeletableAsAWhole()) {
|
|
4269
|
+
tmp_5 = tmp4_safe_receiver;
|
|
4270
|
+
} else {
|
|
4271
|
+
tmp_5 = null;
|
|
4272
|
+
}
|
|
4273
|
+
tmp_4 = tmp_5;
|
|
4274
|
+
}
|
|
4275
|
+
return tmp_4;
|
|
4276
|
+
}
|
|
3755
4277
|
function handleBackspaceKeyDown($this, event) {
|
|
3756
4278
|
var tmp0_safe_receiver = $this.currentSelection;
|
|
3757
4279
|
var anchorOffset = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.anchorOffset;
|
|
@@ -3763,6 +4285,7 @@ function handleBackspaceKeyDown($this, event) {
|
|
|
3763
4285
|
var tmp4_safe_receiver = $this.currentSelection;
|
|
3764
4286
|
var tmp5_safe_receiver = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.anchorNode;
|
|
3765
4287
|
var sibling = tmp5_safe_receiver == null ? null : tmp5_safe_receiver.previousSibling;
|
|
4288
|
+
var deletableBefore = deletableComponentAdjacentToCaret($this, true);
|
|
3766
4289
|
var tmp;
|
|
3767
4290
|
var tmp_0;
|
|
3768
4291
|
if (!(parent == null) && anchorOffset === 0 && focusOffset === 0) {
|
|
@@ -3779,26 +4302,14 @@ function handleBackspaceKeyDown($this, event) {
|
|
|
3779
4302
|
event.preventDefault();
|
|
3780
4303
|
var grandparent = parent.parentElement;
|
|
3781
4304
|
if (!(grandparent == null) ? isInterface(grandparent, MarkdownElementEscapeByBackspace) : false) {
|
|
3782
|
-
grandparent.
|
|
4305
|
+
grandparent.hm(parent);
|
|
3783
4306
|
} else {
|
|
3784
4307
|
parent.mergeWithPrevious($this.currentSelection);
|
|
3785
4308
|
}
|
|
3786
4309
|
} else {
|
|
3787
|
-
|
|
3788
|
-
var tmp_2;
|
|
3789
|
-
if (!(sibling == null) && anchorOffset === 0 && focusOffset === 0) {
|
|
3790
|
-
tmp_2 = sibling instanceof MarkdownComponent;
|
|
3791
|
-
} else {
|
|
3792
|
-
tmp_2 = false;
|
|
3793
|
-
}
|
|
3794
|
-
if (tmp_2) {
|
|
3795
|
-
tmp_1 = sibling.isDeletableAsAWhole();
|
|
3796
|
-
} else {
|
|
3797
|
-
tmp_1 = false;
|
|
3798
|
-
}
|
|
3799
|
-
if (tmp_1) {
|
|
4310
|
+
if (!(deletableBefore == null)) {
|
|
3800
4311
|
event.preventDefault();
|
|
3801
|
-
|
|
4312
|
+
deletableBefore.remove();
|
|
3802
4313
|
}
|
|
3803
4314
|
}
|
|
3804
4315
|
}
|
|
@@ -3810,6 +4321,7 @@ function handleDeleteKeyDown($this, event) {
|
|
|
3810
4321
|
var tmp2_safe_receiver = $this.currentSelection;
|
|
3811
4322
|
var focusOffset = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.focusOffset;
|
|
3812
4323
|
var parent = anchor == null ? null : anchor.parentElement;
|
|
4324
|
+
var deletableAfter = deletableComponentAdjacentToCaret($this, false);
|
|
3813
4325
|
var tmp;
|
|
3814
4326
|
var tmp_0;
|
|
3815
4327
|
var tmp_1;
|
|
@@ -3843,6 +4355,11 @@ function handleDeleteKeyDown($this, event) {
|
|
|
3843
4355
|
if (tmp) {
|
|
3844
4356
|
event.preventDefault();
|
|
3845
4357
|
parent.mergeNextIn();
|
|
4358
|
+
} else {
|
|
4359
|
+
if (!(deletableAfter == null)) {
|
|
4360
|
+
event.preventDefault();
|
|
4361
|
+
deletableAfter.remove();
|
|
4362
|
+
}
|
|
3846
4363
|
}
|
|
3847
4364
|
}
|
|
3848
4365
|
function handleTabKeyDown($this, shift) {
|
|
@@ -3865,9 +4382,9 @@ function handleTabKeyDown($this, shift) {
|
|
|
3865
4382
|
}
|
|
3866
4383
|
if (!(parent == null) ? isInterface(parent, MarkdownElementWithLevel) : false) {
|
|
3867
4384
|
if (shift) {
|
|
3868
|
-
parent.
|
|
4385
|
+
parent.jm(child);
|
|
3869
4386
|
} else {
|
|
3870
|
-
parent.
|
|
4387
|
+
parent.im(child);
|
|
3871
4388
|
}
|
|
3872
4389
|
$this.onChange();
|
|
3873
4390
|
}
|
|
@@ -4079,13 +4596,25 @@ function BaseMarkdownDocument$connectedCallback$lambda_4(this$0) {
|
|
|
4079
4596
|
return Unit_instance;
|
|
4080
4597
|
};
|
|
4081
4598
|
}
|
|
4599
|
+
function BaseMarkdownDocument$connectedCallback$lambda_5(this$0) {
|
|
4600
|
+
return (event) => {
|
|
4601
|
+
onCopy(this$0, event instanceof ClipboardEvent ? event : THROW_CCE());
|
|
4602
|
+
return Unit_instance;
|
|
4603
|
+
};
|
|
4604
|
+
}
|
|
4605
|
+
function BaseMarkdownDocument$connectedCallback$lambda_6(this$0) {
|
|
4606
|
+
return (event) => {
|
|
4607
|
+
onCut(this$0, event instanceof ClipboardEvent ? event : THROW_CCE());
|
|
4608
|
+
return Unit_instance;
|
|
4609
|
+
};
|
|
4610
|
+
}
|
|
4082
4611
|
function BaseMarkdownDocument$onDrop$lambda($reader, this$0, $event) {
|
|
4083
4612
|
return (it) => {
|
|
4084
4613
|
var tmp = $reader.result;
|
|
4085
4614
|
var dataUri = (!(tmp == null) ? typeof tmp === 'string' : false) ? tmp : THROW_CCE();
|
|
4086
4615
|
var tmp_0 = document.createElement('markdown-image');
|
|
4087
4616
|
var img = tmp_0 instanceof MarkdownImage ? tmp_0 : THROW_CCE();
|
|
4088
|
-
img.
|
|
4617
|
+
img.cm(dataUri);
|
|
4089
4618
|
var pos = this$0.selectionRoot.caretPositionFromPoint($event.clientX, $event.clientY);
|
|
4090
4619
|
var tmp_1;
|
|
4091
4620
|
if (!(pos == null)) {
|
|
@@ -4356,7 +4885,7 @@ function getAllTextNodesForRange(range) {
|
|
|
4356
4885
|
if (container instanceof Text)
|
|
4357
4886
|
return listOf(container);
|
|
4358
4887
|
// Inline function 'kotlin.collections.mutableListOf' call
|
|
4359
|
-
var result = ArrayList.
|
|
4888
|
+
var result = ArrayList.z();
|
|
4360
4889
|
var walker = document.createTreeWalker(container, NodeFilter.SHOW_TEXT, null);
|
|
4361
4890
|
var node = walker.nextNode();
|
|
4362
4891
|
while (!(node == null)) {
|
|
@@ -4373,7 +4902,7 @@ function getAllTextNodesForRange(range) {
|
|
|
4373
4902
|
tmp_3 = false;
|
|
4374
4903
|
}
|
|
4375
4904
|
if (tmp_3) {
|
|
4376
|
-
result.
|
|
4905
|
+
result.n(node);
|
|
4377
4906
|
}
|
|
4378
4907
|
node = walker.nextNode();
|
|
4379
4908
|
}
|
|
@@ -4402,9 +4931,9 @@ function surroundRangeIfNotYet(tagName, range) {
|
|
|
4402
4931
|
return Unit_instance;
|
|
4403
4932
|
}
|
|
4404
4933
|
// Inline function 'kotlin.collections.forEach' call
|
|
4405
|
-
var _iterator__ex2g4s = getAllTextNodesForRange(range).
|
|
4406
|
-
while (_iterator__ex2g4s.
|
|
4407
|
-
var element = _iterator__ex2g4s.
|
|
4934
|
+
var _iterator__ex2g4s = getAllTextNodesForRange(range).r();
|
|
4935
|
+
while (_iterator__ex2g4s.s()) {
|
|
4936
|
+
var element = _iterator__ex2g4s.t();
|
|
4408
4937
|
var tmp0_safe_receiver = element.parentElement;
|
|
4409
4938
|
if ((tmp0_safe_receiver == null ? null : tmp0_safe_receiver.closest(tagName)) == null) {
|
|
4410
4939
|
var replaceLevel = element;
|
|
@@ -4427,9 +4956,9 @@ function dispatchToChildren(element) {
|
|
|
4427
4956
|
var parent = element.parentElement;
|
|
4428
4957
|
element.remove();
|
|
4429
4958
|
// Inline function 'kotlin.collections.forEach' call
|
|
4430
|
-
var _iterator__ex2g4s = toList(asList(element.childNodes)).
|
|
4431
|
-
while (_iterator__ex2g4s.
|
|
4432
|
-
var element_0 = _iterator__ex2g4s.
|
|
4959
|
+
var _iterator__ex2g4s = toList(asList(element.childNodes)).r();
|
|
4960
|
+
while (_iterator__ex2g4s.s()) {
|
|
4961
|
+
var element_0 = _iterator__ex2g4s.t();
|
|
4433
4962
|
var tmp = element.cloneNode(false);
|
|
4434
4963
|
var clone = tmp instanceof Element ? tmp : THROW_CCE();
|
|
4435
4964
|
clone.appendChild(element_0);
|
|
@@ -4453,9 +4982,9 @@ function unsurroundRange(tagName, range) {
|
|
|
4453
4982
|
do {
|
|
4454
4983
|
surrounded = false;
|
|
4455
4984
|
// Inline function 'kotlin.collections.forEach' call
|
|
4456
|
-
var _iterator__ex2g4s = allTexts.
|
|
4457
|
-
while (_iterator__ex2g4s.
|
|
4458
|
-
var element = _iterator__ex2g4s.
|
|
4985
|
+
var _iterator__ex2g4s = allTexts.r();
|
|
4986
|
+
while (_iterator__ex2g4s.s()) {
|
|
4987
|
+
var element = _iterator__ex2g4s.t();
|
|
4459
4988
|
var tmp0_safe_receiver = element.parentElement;
|
|
4460
4989
|
var enclosing = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.closest(tagName);
|
|
4461
4990
|
if (!(enclosing == null)) {
|
|
@@ -4481,12 +5010,12 @@ function unsurroundRange(tagName, range) {
|
|
|
4481
5010
|
} else {
|
|
4482
5011
|
var tmp4_safe_receiver = element.parentElement;
|
|
4483
5012
|
enclosing = ensureNotNull(tmp4_safe_receiver == null ? null : tmp4_safe_receiver.closest(tagName));
|
|
4484
|
-
var child = asList(enclosing.childNodes).
|
|
5013
|
+
var child = asList(enclosing.childNodes).v(0);
|
|
4485
5014
|
enclosing.replaceWith(child);
|
|
4486
5015
|
// Inline function 'kotlin.collections.forEach' call
|
|
4487
|
-
var _iterator__ex2g4s_0 = toList(asList(child.childNodes)).
|
|
4488
|
-
while (_iterator__ex2g4s_0.
|
|
4489
|
-
var element_0 = _iterator__ex2g4s_0.
|
|
5016
|
+
var _iterator__ex2g4s_0 = toList(asList(child.childNodes)).r();
|
|
5017
|
+
while (_iterator__ex2g4s_0.s()) {
|
|
5018
|
+
var element_0 = _iterator__ex2g4s_0.t();
|
|
4490
5019
|
child.removeChild(element_0);
|
|
4491
5020
|
enclosing.appendChild(element_0);
|
|
4492
5021
|
}
|
|
@@ -4531,7 +5060,7 @@ function paragraphOption($this, parent, onClick) {
|
|
|
4531
5060
|
item.addEventListener('mousedown', MarkdownToolbar$paragraphOption$lambda_0(onClick));
|
|
4532
5061
|
}
|
|
4533
5062
|
function onBoldClick($this) {
|
|
4534
|
-
if ($this.
|
|
5063
|
+
if ($this.cn_1.fl()) {
|
|
4535
5064
|
var tmp0_safe_receiver = $this.markdownDocument;
|
|
4536
5065
|
if (tmp0_safe_receiver == null)
|
|
4537
5066
|
null;
|
|
@@ -4548,7 +5077,7 @@ function onBoldClick($this) {
|
|
|
4548
5077
|
}
|
|
4549
5078
|
}
|
|
4550
5079
|
function onItalicClick($this) {
|
|
4551
|
-
if ($this.
|
|
5080
|
+
if ($this.dn_1.fl()) {
|
|
4552
5081
|
var tmp0_safe_receiver = $this.markdownDocument;
|
|
4553
5082
|
if (tmp0_safe_receiver == null)
|
|
4554
5083
|
null;
|
|
@@ -4565,7 +5094,7 @@ function onItalicClick($this) {
|
|
|
4565
5094
|
}
|
|
4566
5095
|
}
|
|
4567
5096
|
function onStrikeClick($this) {
|
|
4568
|
-
if ($this.
|
|
5097
|
+
if ($this.en_1.fl()) {
|
|
4569
5098
|
var tmp0_safe_receiver = $this.markdownDocument;
|
|
4570
5099
|
if (tmp0_safe_receiver == null)
|
|
4571
5100
|
null;
|
|
@@ -4888,11 +5417,11 @@ function ToolbarButton$lambda($this$element) {
|
|
|
4888
5417
|
}
|
|
4889
5418
|
function showDropdown($this, event) {
|
|
4890
5419
|
event.stopPropagation();
|
|
4891
|
-
var tmp = $this.
|
|
5420
|
+
var tmp = $this.mn_1;
|
|
4892
5421
|
(tmp instanceof HTMLElement ? tmp : THROW_CCE()).style.display = 'block';
|
|
4893
5422
|
}
|
|
4894
5423
|
function hideDropdown($this) {
|
|
4895
|
-
var tmp = $this.
|
|
5424
|
+
var tmp = $this.mn_1;
|
|
4896
5425
|
(tmp instanceof HTMLElement ? tmp : THROW_CCE()).style.display = 'none';
|
|
4897
5426
|
}
|
|
4898
5427
|
function ToolbarDropdown$hideOnOutsideMouseDown$lambda(this$0) {
|
|
@@ -4990,9 +5519,9 @@ function getMarkdownWithTextForElement$lambda(child) {
|
|
|
4990
5519
|
}
|
|
4991
5520
|
function normalizeContent(element) {
|
|
4992
5521
|
// Inline function 'kotlin.collections.forEach' call
|
|
4993
|
-
var _iterator__ex2g4s = asList(element.childNodes).
|
|
4994
|
-
while (_iterator__ex2g4s.
|
|
4995
|
-
var element_0 = _iterator__ex2g4s.
|
|
5522
|
+
var _iterator__ex2g4s = asList(element.childNodes).r();
|
|
5523
|
+
while (_iterator__ex2g4s.s()) {
|
|
5524
|
+
var element_0 = _iterator__ex2g4s.t();
|
|
4996
5525
|
if (element_0 instanceof MarkdownComponent) {
|
|
4997
5526
|
if (element_0.normalizeContent())
|
|
4998
5527
|
return normalizeContent(element);
|
|
@@ -5055,7 +5584,7 @@ function TableCell$getMarkdown$lambda(child) {
|
|
|
5055
5584
|
tmp_0 = null;
|
|
5056
5585
|
} else {
|
|
5057
5586
|
// Inline function 'kotlin.text.replace' call
|
|
5058
|
-
tmp_0 = Regex.
|
|
5587
|
+
tmp_0 = Regex.l8('\\s').p8(tmp0_safe_receiver, '');
|
|
5059
5588
|
}
|
|
5060
5589
|
var tmp1_safe_receiver = tmp_0;
|
|
5061
5590
|
var tmp_1;
|
|
@@ -5074,7 +5603,7 @@ function TableCell$getMarkdown$lambda(child) {
|
|
|
5074
5603
|
tmp_2 = null;
|
|
5075
5604
|
} else {
|
|
5076
5605
|
// Inline function 'kotlin.text.replace' call
|
|
5077
|
-
tmp_2 = Regex.
|
|
5606
|
+
tmp_2 = Regex.k8('^\\s+', RegexOption_MULTILINE_getInstance()).p8(tmp2_safe_receiver, ' ');
|
|
5078
5607
|
}
|
|
5079
5608
|
var tmp3_elvis_lhs = tmp_2;
|
|
5080
5609
|
tmp = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs;
|
|
@@ -5131,6 +5660,21 @@ function upload($this) {
|
|
|
5131
5660
|
reader.onload = MarkdownImage$upload$lambda($this, reader);
|
|
5132
5661
|
reader.readAsDataURL(file);
|
|
5133
5662
|
}
|
|
5663
|
+
function deleteImage($this) {
|
|
5664
|
+
var parent = $this.parentElement;
|
|
5665
|
+
$this.remove();
|
|
5666
|
+
if (parent == null)
|
|
5667
|
+
null;
|
|
5668
|
+
else {
|
|
5669
|
+
// Inline function 'org.w3c.dom.CustomEventInit' call
|
|
5670
|
+
var o = {};
|
|
5671
|
+
o['detail'] = null;
|
|
5672
|
+
o['bubbles'] = true;
|
|
5673
|
+
o['cancelable'] = false;
|
|
5674
|
+
o['composed'] = false;
|
|
5675
|
+
parent.dispatchEvent(new CustomEvent('input', o));
|
|
5676
|
+
}
|
|
5677
|
+
}
|
|
5134
5678
|
function MarkdownImage$lambda($this$element) {
|
|
5135
5679
|
$this$element.className = 'upload';
|
|
5136
5680
|
$this$element.setAttribute('type', 'file');
|
|
@@ -5157,6 +5701,19 @@ function MarkdownImage$lambda_3($this$element) {
|
|
|
5157
5701
|
$this$element.setAttribute('style', 'display:none;');
|
|
5158
5702
|
return Unit_instance;
|
|
5159
5703
|
}
|
|
5704
|
+
function MarkdownImage$lambda_4($this$element) {
|
|
5705
|
+
$this$element.className = 'delete';
|
|
5706
|
+
$this$element.setAttribute('part', 'delete');
|
|
5707
|
+
$this$element.textContent = '\u2715';
|
|
5708
|
+
return Unit_instance;
|
|
5709
|
+
}
|
|
5710
|
+
function MarkdownImage$lambda_5(this$0) {
|
|
5711
|
+
return (event) => {
|
|
5712
|
+
event.stopPropagation();
|
|
5713
|
+
deleteImage(this$0);
|
|
5714
|
+
return Unit_instance;
|
|
5715
|
+
};
|
|
5716
|
+
}
|
|
5160
5717
|
function MarkdownImage$upload$lambda(this$0, $reader) {
|
|
5161
5718
|
return (it) => {
|
|
5162
5719
|
var tmp = $reader.result;
|
|
@@ -5165,23 +5722,23 @@ function MarkdownImage$upload$lambda(this$0, $reader) {
|
|
|
5165
5722
|
};
|
|
5166
5723
|
}
|
|
5167
5724
|
function updateLinkTarget($this) {
|
|
5168
|
-
$this.
|
|
5169
|
-
$this.
|
|
5170
|
-
$this.
|
|
5171
|
-
$this.
|
|
5725
|
+
$this.zm_1.href = $this.qo();
|
|
5726
|
+
$this.zm_1.title = $this.title;
|
|
5727
|
+
$this.zm_1.target = startsWith($this.qo(), '#') ? '_self' : '_blank';
|
|
5728
|
+
$this.zm_1.onclick = MarkdownLink$updateLinkTarget$lambda($this);
|
|
5172
5729
|
}
|
|
5173
5730
|
function onDestinationInput($this) {
|
|
5174
|
-
$this.
|
|
5731
|
+
$this.cm($this.an_1.value);
|
|
5175
5732
|
updateLinkTarget($this);
|
|
5176
5733
|
}
|
|
5177
5734
|
function hideDestinationInput($this) {
|
|
5178
5735
|
$this.classList.remove('fresh');
|
|
5179
|
-
$this.
|
|
5736
|
+
$this.an_1.classList.remove('visible');
|
|
5180
5737
|
}
|
|
5181
5738
|
function showDestinationInput($this) {
|
|
5182
|
-
$this.
|
|
5183
|
-
$this.
|
|
5184
|
-
$this.
|
|
5739
|
+
$this.an_1.classList.add('visible');
|
|
5740
|
+
$this.an_1.focus();
|
|
5741
|
+
$this.an_1.setSelectionRange($this.an_1.value.length, $this.an_1.value.length);
|
|
5185
5742
|
}
|
|
5186
5743
|
function onDestinationKey($this, event) {
|
|
5187
5744
|
if (event.key === 'Enter') {
|
|
@@ -5241,7 +5798,7 @@ function MarkdownLink$connectedCallback$lambda(this$0) {
|
|
|
5241
5798
|
function MarkdownLink$updateLinkTarget$lambda(this$0) {
|
|
5242
5799
|
return (event) => {
|
|
5243
5800
|
// Inline function 'org.w3c.dom.CustomEventInit' call
|
|
5244
|
-
var detail = this$0.
|
|
5801
|
+
var detail = this$0.qo();
|
|
5245
5802
|
var o = {};
|
|
5246
5803
|
o['detail'] = detail;
|
|
5247
5804
|
o['bubbles'] = true;
|
|
@@ -5278,7 +5835,7 @@ function MarkdownParagraph$getMarkdown$lambda(child) {
|
|
|
5278
5835
|
tmp_0 = null;
|
|
5279
5836
|
} else {
|
|
5280
5837
|
// Inline function 'kotlin.text.replace' call
|
|
5281
|
-
tmp_0 = Regex.
|
|
5838
|
+
tmp_0 = Regex.k8('^\\s+', RegexOption_MULTILINE_getInstance()).p8(tmp0_safe_receiver, ' ');
|
|
5282
5839
|
}
|
|
5283
5840
|
var tmp1_elvis_lhs = tmp_0;
|
|
5284
5841
|
tmp = tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
|
|
@@ -5329,7 +5886,7 @@ function MarkdownTaskListItem$lambda_0($this$element) {
|
|
|
5329
5886
|
}
|
|
5330
5887
|
function MarkdownTaskListItem$lambda_1(this$0) {
|
|
5331
5888
|
return (it) => {
|
|
5332
|
-
this$0.setAttribute('checked', this$0.
|
|
5889
|
+
this$0.setAttribute('checked', this$0.bp_1.checked.toString());
|
|
5333
5890
|
return Unit_instance;
|
|
5334
5891
|
};
|
|
5335
5892
|
}
|
|
@@ -5445,7 +6002,7 @@ function parseMarkdown$lambda($renderer) {
|
|
|
5445
6002
|
function parseMarkdown$lambda_0($renderer) {
|
|
5446
6003
|
return (execArr) => {
|
|
5447
6004
|
var groups = ensureNotNull(execArr);
|
|
5448
|
-
return $renderer.
|
|
6005
|
+
return $renderer.hp_1.custom(ensureNotNull(groups[1]), parseMarkdownWithTsStackRenderer(ensureNotNull(groups[2]), $renderer));
|
|
5449
6006
|
};
|
|
5450
6007
|
}
|
|
5451
6008
|
var properties_initialized_TsStackMarkdownRenderer_kt_6onrsl;
|
|
@@ -5497,9 +6054,9 @@ initMetadataForClass(MarkdownHeading6, 'MarkdownHeading6', MarkdownHeading6);
|
|
|
5497
6054
|
initMetadataForClass(MarkdownHtml, 'MarkdownHtml', MarkdownHtml);
|
|
5498
6055
|
initMetadataForClass(MarkdownImage, 'MarkdownImage', MarkdownImage);
|
|
5499
6056
|
initMetadataForClass(MarkdownLink, 'MarkdownLink', MarkdownLink);
|
|
5500
|
-
initMetadataForClass(MarkdownList, 'MarkdownList', MarkdownList, VOID, [MarkdownElementWithLevel]);
|
|
6057
|
+
initMetadataForClass(MarkdownList, 'MarkdownList', MarkdownList, VOID, [MarkdownElementWithLevel, MarkdownElementEscapeByBackspace]);
|
|
5501
6058
|
initMetadataForClass(MarkdownListItem, 'MarkdownListItem', MarkdownListItem);
|
|
5502
|
-
initMetadataForClass(MarkdownNumericList, 'MarkdownNumericList', MarkdownNumericList, VOID, [MarkdownElementWithLevel]);
|
|
6059
|
+
initMetadataForClass(MarkdownNumericList, 'MarkdownNumericList', MarkdownNumericList, VOID, [MarkdownElementWithLevel, MarkdownElementEscapeByBackspace]);
|
|
5503
6060
|
initMetadataForClass(MarkdownNumericListItem, 'MarkdownNumericListItem', MarkdownNumericListItem);
|
|
5504
6061
|
initMetadataForClass(MarkdownParagraph, 'MarkdownParagraph', MarkdownParagraph);
|
|
5505
6062
|
initMetadataForClass(MarkdownQuote, 'MarkdownQuote', MarkdownQuote, VOID, [MarkdownElementWithLevel, MarkdownElementEscapeByBackspace]);
|