markdown-komponents 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.html +10 -0
- package/kotlin-kotlin-stdlib.mjs +105 -5
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/markdown-komponents.mjs +487 -401
- package/markdown-komponents.mjs.map +1 -1
- package/package.json +1 -1
package/markdown-komponents.mjs
CHANGED
|
@@ -35,8 +35,12 @@ import {
|
|
|
35
35
|
ArrayList3it5z8td81qkl as ArrayList,
|
|
36
36
|
repeat2w4c6j8zoq09o as repeat,
|
|
37
37
|
trimIndent1qytc1wvt8suh as trimIndent,
|
|
38
|
+
trimStart5ewg8zf6cs5u as trimStart,
|
|
39
|
+
trimEnd17pt8cbotbalj as trimEnd,
|
|
40
|
+
takeLast2r8kr8e6g6hi7 as takeLast,
|
|
38
41
|
indexOfwa4w6635jewi as indexOf_0,
|
|
39
42
|
replace3le3ie7l9k8aq as replace,
|
|
43
|
+
removeSuffix3d61x5lsuvuho as removeSuffix,
|
|
40
44
|
drop3na99dw9feawf as drop,
|
|
41
45
|
RegexOption_MULTILINE_getInstance3caq4fchu5vfw as RegexOption_MULTILINE_getInstance,
|
|
42
46
|
startsWith26w8qjqapeeq6 as startsWith,
|
|
@@ -72,6 +76,15 @@ class BaseWebComponent extends HTMLElement {
|
|
|
72
76
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
73
77
|
return this.dc(name, oldValue, newValue);
|
|
74
78
|
}
|
|
79
|
+
upgradeProperty(name) {
|
|
80
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
81
|
+
var self_0 = this;
|
|
82
|
+
if (hasOwnProperty(self_0, name)) {
|
|
83
|
+
var value = self_0[name];
|
|
84
|
+
deleteOwnProperty(self_0, name);
|
|
85
|
+
self_0[name] = value;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
75
88
|
}
|
|
76
89
|
class BoldToolbarButton extends BaseWebComponent {
|
|
77
90
|
constructor() {
|
|
@@ -166,71 +179,77 @@ class StashedSelection {
|
|
|
166
179
|
class BaseMarkdownDocument extends BaseWebComponent {
|
|
167
180
|
constructor() {
|
|
168
181
|
super();
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
this.
|
|
172
|
-
this.
|
|
173
|
-
this.
|
|
174
|
-
this.autoNormalize = true;
|
|
182
|
+
this.kl_1 = null;
|
|
183
|
+
this.ll_1 = null;
|
|
184
|
+
this.ml_1 = document;
|
|
185
|
+
this.nl_1 = null;
|
|
186
|
+
this.ol_1 = true;
|
|
175
187
|
this.currentSelection = null;
|
|
176
188
|
this.editable = false;
|
|
177
|
-
this.
|
|
178
|
-
this.
|
|
179
|
-
this.
|
|
180
|
-
this.
|
|
181
|
-
var
|
|
189
|
+
this.pl_1 = null;
|
|
190
|
+
this.ql_1 = 0;
|
|
191
|
+
this.rl_1 = null;
|
|
192
|
+
this.sl_1 = false;
|
|
193
|
+
var tmp = this;
|
|
182
194
|
// Inline function 'kotlin.js.asDynamic' call
|
|
183
|
-
|
|
195
|
+
tmp.tl_1 = window.chrome != null;
|
|
196
|
+
var tmp_0 = this;
|
|
197
|
+
tmp_0.ul_1 = BaseMarkdownDocument$onMouseDown$lambda(this);
|
|
184
198
|
var tmp_1 = this;
|
|
185
|
-
tmp_1.
|
|
199
|
+
tmp_1.vl_1 = BaseMarkdownDocument$onMouseUp$lambda(this);
|
|
186
200
|
var tmp_2 = this;
|
|
187
|
-
tmp_2.
|
|
201
|
+
tmp_2.wl_1 = BaseMarkdownDocument$onSelectStart$lambda(this);
|
|
188
202
|
var tmp_3 = this;
|
|
189
|
-
tmp_3.
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
this.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
this.
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
203
|
+
tmp_3.xl_1 = BaseMarkdownDocument$onSelectionChange$lambda(this);
|
|
204
|
+
this.upgradeProperty('parser');
|
|
205
|
+
this.upgradeProperty('markdown');
|
|
206
|
+
this.upgradeProperty('toolbar');
|
|
207
|
+
this.upgradeProperty('selectionRoot');
|
|
208
|
+
this.upgradeProperty('onLinkClick');
|
|
209
|
+
this.upgradeProperty('autoNormalize');
|
|
210
|
+
this.yl_1 = false;
|
|
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;
|
|
218
|
+
}
|
|
219
|
+
km(value) {
|
|
201
220
|
return renderMarkdown(this, value);
|
|
202
221
|
}
|
|
203
|
-
|
|
222
|
+
lm() {
|
|
204
223
|
return this.getMarkdown();
|
|
205
224
|
}
|
|
206
|
-
|
|
207
|
-
this.
|
|
225
|
+
mm(value) {
|
|
226
|
+
this.ll_1 = value;
|
|
208
227
|
}
|
|
209
|
-
|
|
210
|
-
return this.
|
|
228
|
+
nm() {
|
|
229
|
+
return this.ll_1;
|
|
211
230
|
}
|
|
212
|
-
|
|
213
|
-
this.
|
|
231
|
+
om(value) {
|
|
232
|
+
this.ml_1 = value;
|
|
214
233
|
}
|
|
215
|
-
|
|
216
|
-
return this.
|
|
234
|
+
pm() {
|
|
235
|
+
return this.ml_1;
|
|
217
236
|
}
|
|
218
|
-
|
|
219
|
-
this.
|
|
237
|
+
qm(value) {
|
|
238
|
+
this.nl_1 = value;
|
|
220
239
|
}
|
|
221
|
-
|
|
222
|
-
return this.
|
|
240
|
+
rm() {
|
|
241
|
+
return this.nl_1;
|
|
223
242
|
}
|
|
224
|
-
|
|
225
|
-
this.
|
|
243
|
+
sm(value) {
|
|
244
|
+
this.ol_1 = value;
|
|
226
245
|
}
|
|
227
|
-
|
|
228
|
-
return this.
|
|
246
|
+
tm() {
|
|
247
|
+
return this.ol_1;
|
|
229
248
|
}
|
|
230
|
-
|
|
249
|
+
um() {
|
|
231
250
|
return this.currentSelection;
|
|
232
251
|
}
|
|
233
|
-
|
|
252
|
+
vm() {
|
|
234
253
|
return this.editable;
|
|
235
254
|
}
|
|
236
255
|
renderStandardShadow() {
|
|
@@ -247,18 +266,18 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
247
266
|
}
|
|
248
267
|
ac() {
|
|
249
268
|
super.ac();
|
|
250
|
-
if (!this.
|
|
251
|
-
this.
|
|
269
|
+
if (!this.yl_1) {
|
|
270
|
+
this.yl_1 = true;
|
|
252
271
|
firstUpdated(this);
|
|
253
272
|
}
|
|
254
273
|
this.setAttribute('contenteditable', this.getAttribute('readonly') === 'true' ? 'false' : 'true');
|
|
255
274
|
if (this.getAttribute('spellcheck') == null) {
|
|
256
275
|
this.setAttribute('spellcheck', 'false');
|
|
257
276
|
}
|
|
258
|
-
this.addEventListener('mousedown', this.
|
|
259
|
-
this.addEventListener('mouseup', this.
|
|
260
|
-
document.addEventListener('selectstart', this.
|
|
261
|
-
document.addEventListener('selectionchange', this.
|
|
277
|
+
this.addEventListener('mousedown', this.ul_1);
|
|
278
|
+
this.addEventListener('mouseup', this.vl_1);
|
|
279
|
+
document.addEventListener('selectstart', this.wl_1);
|
|
280
|
+
document.addEventListener('selectionchange', this.xl_1);
|
|
262
281
|
this.addEventListener('keydown', BaseMarkdownDocument$connectedCallback$lambda(this));
|
|
263
282
|
this.addEventListener('input', BaseMarkdownDocument$connectedCallback$lambda_0(this));
|
|
264
283
|
this.addEventListener('blur', BaseMarkdownDocument$connectedCallback$lambda_1(this));
|
|
@@ -270,8 +289,8 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
270
289
|
return this.ac();
|
|
271
290
|
}
|
|
272
291
|
bc() {
|
|
273
|
-
document.removeEventListener('selectionchange', this.
|
|
274
|
-
document.removeEventListener('selectstart', this.
|
|
292
|
+
document.removeEventListener('selectionchange', this.xl_1);
|
|
293
|
+
document.removeEventListener('selectstart', this.wl_1);
|
|
275
294
|
}
|
|
276
295
|
disconnectedCallback() {
|
|
277
296
|
return this.bc();
|
|
@@ -313,7 +332,7 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
313
332
|
tmp.setTimeout(BaseMarkdownDocument$onChange$lambda(this), 0);
|
|
314
333
|
}
|
|
315
334
|
setToolbar(newToolbar) {
|
|
316
|
-
this.
|
|
335
|
+
this.mm(newToolbar);
|
|
317
336
|
var tmp0_safe_receiver = newToolbar instanceof MarkdownToolbar ? newToolbar : null;
|
|
318
337
|
if (tmp0_safe_receiver == null)
|
|
319
338
|
null;
|
|
@@ -336,7 +355,7 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
336
355
|
return null;
|
|
337
356
|
}
|
|
338
357
|
getLastLeafBlock() {
|
|
339
|
-
var element = this.
|
|
358
|
+
var element = this.pl_1;
|
|
340
359
|
while (!(element == null) && !equals(element, document) && !equals(element, this)) {
|
|
341
360
|
if (element instanceof LeafElement)
|
|
342
361
|
return element;
|
|
@@ -579,7 +598,7 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
579
598
|
image.title = text;
|
|
580
599
|
}
|
|
581
600
|
if (!(url == null)) {
|
|
582
|
-
image.
|
|
601
|
+
image.am(url);
|
|
583
602
|
}
|
|
584
603
|
var tmp2_safe_receiver = this.currentSelection;
|
|
585
604
|
var anchorOffset = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.anchorOffset;
|
|
@@ -598,7 +617,7 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
598
617
|
}
|
|
599
618
|
}
|
|
600
619
|
restoreStashedSelection() {
|
|
601
|
-
var tmp0_elvis_lhs = this.
|
|
620
|
+
var tmp0_elvis_lhs = this.rl_1;
|
|
602
621
|
var tmp;
|
|
603
622
|
if (tmp0_elvis_lhs == null) {
|
|
604
623
|
return Unit_instance;
|
|
@@ -638,7 +657,7 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
638
657
|
link.textContent = 'http://';
|
|
639
658
|
}
|
|
640
659
|
var tmp1_elvis_lhs = link.textContent;
|
|
641
|
-
link.
|
|
660
|
+
link.am(tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs);
|
|
642
661
|
link.classList.add('fresh');
|
|
643
662
|
}
|
|
644
663
|
header1Element() {
|
|
@@ -706,11 +725,41 @@ class BaseMarkdownDocument extends BaseWebComponent {
|
|
|
706
725
|
this.dispatchEvent(new CustomEvent('markdown-inserted', o));
|
|
707
726
|
this.onChange();
|
|
708
727
|
}
|
|
728
|
+
get parser() {
|
|
729
|
+
return this.jm();
|
|
730
|
+
}
|
|
731
|
+
set parser(value) {
|
|
732
|
+
this.im(value);
|
|
733
|
+
}
|
|
709
734
|
get markdown() {
|
|
710
|
-
return this.
|
|
735
|
+
return this.lm();
|
|
711
736
|
}
|
|
712
737
|
set markdown(value) {
|
|
713
|
-
this.
|
|
738
|
+
this.km(value);
|
|
739
|
+
}
|
|
740
|
+
get toolbar() {
|
|
741
|
+
return this.nm();
|
|
742
|
+
}
|
|
743
|
+
set toolbar(value) {
|
|
744
|
+
this.mm(value);
|
|
745
|
+
}
|
|
746
|
+
get selectionRoot() {
|
|
747
|
+
return this.pm();
|
|
748
|
+
}
|
|
749
|
+
set selectionRoot(value) {
|
|
750
|
+
this.om(value);
|
|
751
|
+
}
|
|
752
|
+
get onLinkClick() {
|
|
753
|
+
return this.rm();
|
|
754
|
+
}
|
|
755
|
+
set onLinkClick(value) {
|
|
756
|
+
this.qm(value);
|
|
757
|
+
}
|
|
758
|
+
get autoNormalize() {
|
|
759
|
+
return this.tm();
|
|
760
|
+
}
|
|
761
|
+
set autoNormalize(value) {
|
|
762
|
+
this.sm(value);
|
|
714
763
|
}
|
|
715
764
|
}
|
|
716
765
|
class MarkdownDocument extends BaseMarkdownDocument {
|
|
@@ -737,7 +786,7 @@ class MarkdownEditor extends BaseMarkdownDocument {
|
|
|
737
786
|
class MarkdownToolbar extends BaseWebComponent {
|
|
738
787
|
constructor() {
|
|
739
788
|
super();
|
|
740
|
-
this.
|
|
789
|
+
this.zm_1 = null;
|
|
741
790
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
742
791
|
// Inline function 'kotlin.js.asDynamic' call
|
|
743
792
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -749,7 +798,7 @@ class MarkdownToolbar extends BaseWebComponent {
|
|
|
749
798
|
var toolbarRow = element(shadow, 'div', MarkdownToolbar$lambda);
|
|
750
799
|
var dropdown = element(toolbarRow, 'toolbar-dropdown');
|
|
751
800
|
var tmp = this;
|
|
752
|
-
tmp.
|
|
801
|
+
tmp.dn_1 = element(dropdown, 'span', MarkdownToolbar$lambda_0);
|
|
753
802
|
dropdown.appendChild(document.createTextNode(' \u25BE'));
|
|
754
803
|
var dropdownElements = element(dropdown, 'dropdown-elements', MarkdownToolbar$lambda_1);
|
|
755
804
|
headingOption(this, dropdownElements, 1, MarkdownToolbar$lambda_2(this));
|
|
@@ -761,11 +810,11 @@ class MarkdownToolbar extends BaseWebComponent {
|
|
|
761
810
|
paragraphOption(this, dropdownElements, MarkdownToolbar$lambda_8(this));
|
|
762
811
|
element(toolbarRow, 'toolbar-separator');
|
|
763
812
|
var tmp_0 = this;
|
|
764
|
-
tmp_0.
|
|
813
|
+
tmp_0.an_1 = toggleButton(this, toolbarRow, 'bold', 'toggle bold', MarkdownToolbar$lambda_9(this));
|
|
765
814
|
var tmp_1 = this;
|
|
766
|
-
tmp_1.
|
|
815
|
+
tmp_1.bn_1 = toggleButton(this, toolbarRow, 'italic', 'toggle italic', MarkdownToolbar$lambda_10(this));
|
|
767
816
|
var tmp_2 = this;
|
|
768
|
-
tmp_2.
|
|
817
|
+
tmp_2.cn_1 = toggleButton(this, toolbarRow, 'strikethrough', 'toggle strike', MarkdownToolbar$lambda_11(this));
|
|
769
818
|
element(toolbarRow, 'toolbar-separator');
|
|
770
819
|
actionButton(this, toolbarRow, 'list-bulleted', 'list', MarkdownToolbar$lambda_12(this));
|
|
771
820
|
actionButton(this, toolbarRow, 'list-numbered', 'numbered list', MarkdownToolbar$lambda_13(this));
|
|
@@ -779,12 +828,13 @@ class MarkdownToolbar extends BaseWebComponent {
|
|
|
779
828
|
element(toolbarRow, 'toolbar-separator');
|
|
780
829
|
element(toolbarRow, 'slot', MarkdownToolbar$lambda_20);
|
|
781
830
|
slot(shadow);
|
|
831
|
+
this.upgradeProperty('markdownDocument');
|
|
782
832
|
}
|
|
783
|
-
|
|
784
|
-
this.
|
|
833
|
+
gn(value) {
|
|
834
|
+
this.zm_1 = value;
|
|
785
835
|
}
|
|
786
|
-
|
|
787
|
-
return this.
|
|
836
|
+
hn() {
|
|
837
|
+
return this.zm_1;
|
|
788
838
|
}
|
|
789
839
|
ac() {
|
|
790
840
|
super.ac();
|
|
@@ -794,28 +844,34 @@ class MarkdownToolbar extends BaseWebComponent {
|
|
|
794
844
|
return this.ac();
|
|
795
845
|
}
|
|
796
846
|
setMarkdownDocument(document) {
|
|
797
|
-
this.
|
|
847
|
+
this.gn(document);
|
|
798
848
|
}
|
|
799
849
|
highlightBoldButton() {
|
|
800
|
-
this.
|
|
850
|
+
this.an_1.fl(true);
|
|
801
851
|
}
|
|
802
852
|
removeBoldButtonHighlighting() {
|
|
803
|
-
this.
|
|
853
|
+
this.an_1.fl(false);
|
|
804
854
|
}
|
|
805
855
|
highlightItalicButton() {
|
|
806
|
-
this.
|
|
856
|
+
this.bn_1.fl(true);
|
|
807
857
|
}
|
|
808
858
|
removeItalicButtonHighlighting() {
|
|
809
|
-
this.
|
|
859
|
+
this.bn_1.fl(false);
|
|
810
860
|
}
|
|
811
861
|
highlightStrikeButton() {
|
|
812
|
-
this.
|
|
862
|
+
this.cn_1.fl(true);
|
|
813
863
|
}
|
|
814
864
|
removeStrikeButtonHighlighting() {
|
|
815
|
-
this.
|
|
865
|
+
this.cn_1.fl(false);
|
|
816
866
|
}
|
|
817
867
|
setDropdownTitle(title) {
|
|
818
|
-
this.
|
|
868
|
+
this.dn_1.textContent = title;
|
|
869
|
+
}
|
|
870
|
+
get markdownDocument() {
|
|
871
|
+
return this.hn();
|
|
872
|
+
}
|
|
873
|
+
set markdownDocument(value) {
|
|
874
|
+
this.gn(value);
|
|
819
875
|
}
|
|
820
876
|
}
|
|
821
877
|
class ToggleToolbarButton extends BaseWebComponent {
|
|
@@ -830,10 +886,10 @@ class ToggleToolbarButton extends BaseWebComponent {
|
|
|
830
886
|
var shadow = this.attachShadow(o);
|
|
831
887
|
var tmp = this;
|
|
832
888
|
var tmp_0 = element(shadow, 'toolbar-button', ToggleToolbarButton$lambda);
|
|
833
|
-
tmp.
|
|
889
|
+
tmp.en_1 = tmp_0 instanceof ToolbarButton ? tmp_0 : THROW_CCE();
|
|
834
890
|
var tmp_1 = this;
|
|
835
|
-
var tmp_2 = element(this.
|
|
836
|
-
tmp_1.
|
|
891
|
+
var tmp_2 = element(this.en_1, 'toolbar-icon', ToggleToolbarButton$lambda_0);
|
|
892
|
+
tmp_1.fn_1 = tmp_2 instanceof ToolbarIcon ? tmp_2 : THROW_CCE();
|
|
837
893
|
}
|
|
838
894
|
fl(value) {
|
|
839
895
|
var tmp;
|
|
@@ -851,9 +907,9 @@ class ToggleToolbarButton extends BaseWebComponent {
|
|
|
851
907
|
}
|
|
852
908
|
dc(name, oldValue, newValue) {
|
|
853
909
|
if (name === 'highlighted') {
|
|
854
|
-
this.
|
|
910
|
+
this.en_1.fl(this.dl());
|
|
855
911
|
} else if (name === 'icon') {
|
|
856
|
-
this.
|
|
912
|
+
this.fn_1.jn(newValue == null ? '' : newValue);
|
|
857
913
|
}
|
|
858
914
|
}
|
|
859
915
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
@@ -902,7 +958,7 @@ class ToolbarDropdown extends BaseWebComponent {
|
|
|
902
958
|
constructor() {
|
|
903
959
|
super();
|
|
904
960
|
var tmp = this;
|
|
905
|
-
tmp.
|
|
961
|
+
tmp.ln_1 = ToolbarDropdown$hideOnOutsideMouseDown$lambda(this);
|
|
906
962
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
907
963
|
// Inline function 'kotlin.js.asDynamic' call
|
|
908
964
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -914,17 +970,17 @@ class ToolbarDropdown extends BaseWebComponent {
|
|
|
914
970
|
var button = element(shadow, 'toolbar-button', ToolbarDropdown$lambda);
|
|
915
971
|
button.addEventListener('mousedown', ToolbarDropdown$lambda_0(this));
|
|
916
972
|
var tmp_0 = this;
|
|
917
|
-
tmp_0.
|
|
973
|
+
tmp_0.kn_1 = element(shadow, 'slot', ToolbarDropdown$lambda_1);
|
|
918
974
|
}
|
|
919
975
|
ac() {
|
|
920
976
|
super.ac();
|
|
921
|
-
document.addEventListener('mousedown', this.
|
|
977
|
+
document.addEventListener('mousedown', this.ln_1);
|
|
922
978
|
}
|
|
923
979
|
connectedCallback() {
|
|
924
980
|
return this.ac();
|
|
925
981
|
}
|
|
926
982
|
bc() {
|
|
927
|
-
document.removeEventListener('mousedown', this.
|
|
983
|
+
document.removeEventListener('mousedown', this.ln_1);
|
|
928
984
|
}
|
|
929
985
|
disconnectedCallback() {
|
|
930
986
|
return this.bc();
|
|
@@ -941,14 +997,14 @@ class ToolbarIcon extends BaseWebComponent {
|
|
|
941
997
|
o['mode'] = 'open';
|
|
942
998
|
var shadow = this.attachShadow(o);
|
|
943
999
|
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}');
|
|
944
|
-
this.
|
|
1000
|
+
this.in_1 = element(shadow, 'span');
|
|
945
1001
|
}
|
|
946
|
-
|
|
1002
|
+
jn(value) {
|
|
947
1003
|
return this.setAttribute('icon', value);
|
|
948
1004
|
}
|
|
949
1005
|
dc(name, oldValue, newValue) {
|
|
950
1006
|
if (name === 'icon') {
|
|
951
|
-
this.
|
|
1007
|
+
this.in_1.innerHTML = svgFor(this, newValue == null ? '' : newValue);
|
|
952
1008
|
}
|
|
953
1009
|
}
|
|
954
1010
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
@@ -1222,12 +1278,12 @@ class MarkdownComponent extends BaseWebComponent {
|
|
|
1222
1278
|
return joinToString(tmp, '', VOID, VOID, VOID, VOID, MarkdownComponent$getMarkdown$lambda);
|
|
1223
1279
|
}
|
|
1224
1280
|
get mustBeDirectChildOfDocument() {
|
|
1225
|
-
return this.
|
|
1281
|
+
return this.mn();
|
|
1226
1282
|
}
|
|
1227
1283
|
}
|
|
1228
1284
|
class BlockElement extends MarkdownComponent {
|
|
1229
1285
|
get mustBeDirectChildOfDocument() {
|
|
1230
|
-
return this.
|
|
1286
|
+
return this.mn();
|
|
1231
1287
|
}
|
|
1232
1288
|
}
|
|
1233
1289
|
class ContainerElement extends MarkdownComponent {
|
|
@@ -1261,7 +1317,7 @@ class ContainerElement extends MarkdownComponent {
|
|
|
1261
1317
|
return this.children.length > 0;
|
|
1262
1318
|
}
|
|
1263
1319
|
get mustBeDirectChildOfDocument() {
|
|
1264
|
-
return this.
|
|
1320
|
+
return this.mn();
|
|
1265
1321
|
}
|
|
1266
1322
|
}
|
|
1267
1323
|
class LeafElement extends BlockElement {
|
|
@@ -1373,16 +1429,16 @@ class LeafElement extends BlockElement {
|
|
|
1373
1429
|
return tmp;
|
|
1374
1430
|
}
|
|
1375
1431
|
get mustBeDirectChildOfDocument() {
|
|
1376
|
-
return this.
|
|
1432
|
+
return this.mn();
|
|
1377
1433
|
}
|
|
1378
1434
|
}
|
|
1379
1435
|
class Heading extends LeafElement {
|
|
1380
1436
|
constructor() {
|
|
1381
1437
|
super();
|
|
1382
|
-
this.
|
|
1438
|
+
this.nn_1 = true;
|
|
1383
1439
|
}
|
|
1384
|
-
|
|
1385
|
-
return this.
|
|
1440
|
+
mn() {
|
|
1441
|
+
return this.nn_1;
|
|
1386
1442
|
}
|
|
1387
1443
|
getMarkdown() {
|
|
1388
1444
|
return repeat('#', this.depth) + ' ' + getMarkdownWithTextForElement(this) + '\n';
|
|
@@ -1407,19 +1463,19 @@ class Heading extends LeafElement {
|
|
|
1407
1463
|
element(this_0, tmp, Heading$renderHeading$lambda);
|
|
1408
1464
|
}
|
|
1409
1465
|
get depth() {
|
|
1410
|
-
return this.
|
|
1466
|
+
return this.on();
|
|
1411
1467
|
}
|
|
1412
1468
|
get mustBeDirectChildOfDocument() {
|
|
1413
|
-
return this.
|
|
1469
|
+
return this.mn();
|
|
1414
1470
|
}
|
|
1415
1471
|
}
|
|
1416
1472
|
class InlineElement extends MarkdownComponent {
|
|
1417
1473
|
constructor() {
|
|
1418
1474
|
super();
|
|
1419
|
-
this.
|
|
1475
|
+
this.pn_1 = false;
|
|
1420
1476
|
}
|
|
1421
|
-
|
|
1422
|
-
return this.
|
|
1477
|
+
mn() {
|
|
1478
|
+
return this.pn_1;
|
|
1423
1479
|
}
|
|
1424
1480
|
normalizeContent() {
|
|
1425
1481
|
var next = this.nextSibling;
|
|
@@ -1476,6 +1532,23 @@ class InlineElement extends MarkdownComponent {
|
|
|
1476
1532
|
getMarkdown() {
|
|
1477
1533
|
return getMarkdownWithTextForElement(this);
|
|
1478
1534
|
}
|
|
1535
|
+
wrapMarkdownContentIn(marker) {
|
|
1536
|
+
var content = getMarkdownWithTextForElement(this);
|
|
1537
|
+
// Inline function 'kotlin.text.trim' call
|
|
1538
|
+
var trimmed = toString_0(trim(isCharSequence(content) ? content : THROW_CCE()));
|
|
1539
|
+
// Inline function 'kotlin.text.isEmpty' call
|
|
1540
|
+
if (charSequenceLength(trimmed) === 0)
|
|
1541
|
+
return marker + marker;
|
|
1542
|
+
var tmp = content.length;
|
|
1543
|
+
// Inline function 'kotlin.text.trimStart' call
|
|
1544
|
+
var tmp$ret$2 = toString_0(trimStart(isCharSequence(content) ? content : THROW_CCE()));
|
|
1545
|
+
var leading = take(content, tmp - tmp$ret$2.length | 0);
|
|
1546
|
+
var tmp_0 = content.length;
|
|
1547
|
+
// Inline function 'kotlin.text.trimEnd' call
|
|
1548
|
+
var tmp$ret$3 = toString_0(trimEnd(isCharSequence(content) ? content : THROW_CCE()));
|
|
1549
|
+
var trailing = takeLast(content, tmp_0 - tmp$ret$3.length | 0);
|
|
1550
|
+
return leading + marker + trimmed + marker + trailing;
|
|
1551
|
+
}
|
|
1479
1552
|
mergeWithPrevious(currentSelection) {
|
|
1480
1553
|
var tmp = this.parentNode;
|
|
1481
1554
|
var tmp0_safe_receiver = tmp instanceof MarkdownComponent ? tmp : null;
|
|
@@ -1495,23 +1568,23 @@ class InlineElement extends MarkdownComponent {
|
|
|
1495
1568
|
}
|
|
1496
1569
|
}
|
|
1497
1570
|
get mustBeDirectChildOfDocument() {
|
|
1498
|
-
return this.
|
|
1571
|
+
return this.mn();
|
|
1499
1572
|
}
|
|
1500
1573
|
}
|
|
1501
1574
|
class TerminalInlineElement extends MarkdownComponent {
|
|
1502
1575
|
get mustBeDirectChildOfDocument() {
|
|
1503
|
-
return this.
|
|
1576
|
+
return this.mn();
|
|
1504
1577
|
}
|
|
1505
1578
|
}
|
|
1506
1579
|
class ListItem extends ContainerElement {
|
|
1507
1580
|
constructor() {
|
|
1508
1581
|
super();
|
|
1509
|
-
this.
|
|
1582
|
+
this.qn_1 = false;
|
|
1510
1583
|
}
|
|
1511
|
-
|
|
1512
|
-
return this.
|
|
1584
|
+
mn() {
|
|
1585
|
+
return this.qn_1;
|
|
1513
1586
|
}
|
|
1514
|
-
|
|
1587
|
+
rn() {
|
|
1515
1588
|
var depth = 0;
|
|
1516
1589
|
var ancestor = this.parentNode;
|
|
1517
1590
|
$l$loop: while (true) {
|
|
@@ -1544,14 +1617,46 @@ class ListItem extends ContainerElement {
|
|
|
1544
1617
|
return depth;
|
|
1545
1618
|
}
|
|
1546
1619
|
getMarkdown() {
|
|
1547
|
-
return repeat(' ', this.
|
|
1620
|
+
return repeat(' ', this.rn()) + '- ' + this.sn() + this.tn();
|
|
1548
1621
|
}
|
|
1549
|
-
|
|
1622
|
+
sn() {
|
|
1550
1623
|
return '';
|
|
1551
1624
|
}
|
|
1552
|
-
|
|
1553
|
-
var
|
|
1554
|
-
|
|
1625
|
+
tn() {
|
|
1626
|
+
var line = '';
|
|
1627
|
+
var nestedBlocks = '';
|
|
1628
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
1629
|
+
var _iterator__ex2g4s = asList(this.childNodes).p();
|
|
1630
|
+
while (_iterator__ex2g4s.q()) {
|
|
1631
|
+
var element = _iterator__ex2g4s.r();
|
|
1632
|
+
var markdownElement = asMarkdownElement(element);
|
|
1633
|
+
var tmp;
|
|
1634
|
+
if (isInterface(element, MarkdownElementWithLevel)) {
|
|
1635
|
+
tmp = !(markdownElement == null);
|
|
1636
|
+
} else {
|
|
1637
|
+
tmp = false;
|
|
1638
|
+
}
|
|
1639
|
+
if (tmp)
|
|
1640
|
+
nestedBlocks = nestedBlocks + removeSuffix(markdownElement.getMarkdown(), '\n');
|
|
1641
|
+
else {
|
|
1642
|
+
if (!(markdownElement == null))
|
|
1643
|
+
line = line + markdownElement.getMarkdown();
|
|
1644
|
+
else {
|
|
1645
|
+
var tmp_0 = line;
|
|
1646
|
+
var tmp0_safe_receiver = element.textContent;
|
|
1647
|
+
var tmp_1;
|
|
1648
|
+
if (tmp0_safe_receiver == null) {
|
|
1649
|
+
tmp_1 = null;
|
|
1650
|
+
} else {
|
|
1651
|
+
// Inline function 'kotlin.text.trim' call
|
|
1652
|
+
tmp_1 = toString_0(trim(isCharSequence(tmp0_safe_receiver) ? tmp0_safe_receiver : THROW_CCE()));
|
|
1653
|
+
}
|
|
1654
|
+
var tmp1_elvis_lhs = tmp_1;
|
|
1655
|
+
line = tmp_0 + (tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs);
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
return line + '\n' + nestedBlocks;
|
|
1555
1660
|
}
|
|
1556
1661
|
normalizeContent() {
|
|
1557
1662
|
this.normalize();
|
|
@@ -1712,7 +1817,7 @@ class ListItem extends ContainerElement {
|
|
|
1712
1817
|
return true;
|
|
1713
1818
|
}
|
|
1714
1819
|
get mustBeDirectChildOfDocument() {
|
|
1715
|
-
return this.
|
|
1820
|
+
return this.mn();
|
|
1716
1821
|
}
|
|
1717
1822
|
}
|
|
1718
1823
|
class MarkdownElementWithLevel {}
|
|
@@ -1720,12 +1825,12 @@ class MarkdownElementEscapeByBackspace {}
|
|
|
1720
1825
|
class TableCell extends ContainerElement {
|
|
1721
1826
|
constructor() {
|
|
1722
1827
|
super();
|
|
1723
|
-
this.
|
|
1828
|
+
this.un_1 = false;
|
|
1724
1829
|
}
|
|
1725
|
-
|
|
1726
|
-
return this.
|
|
1830
|
+
mn() {
|
|
1831
|
+
return this.un_1;
|
|
1727
1832
|
}
|
|
1728
|
-
|
|
1833
|
+
vn(hostCss) {
|
|
1729
1834
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
1730
1835
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1731
1836
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -1745,13 +1850,13 @@ class TableCell extends ContainerElement {
|
|
|
1745
1850
|
return true;
|
|
1746
1851
|
}
|
|
1747
1852
|
get mustBeDirectChildOfDocument() {
|
|
1748
|
-
return this.
|
|
1853
|
+
return this.mn();
|
|
1749
1854
|
}
|
|
1750
1855
|
}
|
|
1751
1856
|
class MarkdownBreak extends LeafElement {
|
|
1752
1857
|
constructor() {
|
|
1753
1858
|
super();
|
|
1754
|
-
this.
|
|
1859
|
+
this.wn_1 = true;
|
|
1755
1860
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
1756
1861
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1757
1862
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -1760,8 +1865,8 @@ class MarkdownBreak extends LeafElement {
|
|
|
1760
1865
|
o['mode'] = 'open';
|
|
1761
1866
|
element(this.attachShadow(o), 'hr');
|
|
1762
1867
|
}
|
|
1763
|
-
|
|
1764
|
-
return this.
|
|
1868
|
+
mn() {
|
|
1869
|
+
return this.wn_1;
|
|
1765
1870
|
}
|
|
1766
1871
|
getMarkdown() {
|
|
1767
1872
|
return '-----------------------\n';
|
|
@@ -1773,13 +1878,13 @@ class MarkdownBreak extends LeafElement {
|
|
|
1773
1878
|
return true;
|
|
1774
1879
|
}
|
|
1775
1880
|
get mustBeDirectChildOfDocument() {
|
|
1776
|
-
return this.
|
|
1881
|
+
return this.mn();
|
|
1777
1882
|
}
|
|
1778
1883
|
}
|
|
1779
1884
|
class MarkdownCode extends LeafElement {
|
|
1780
1885
|
constructor() {
|
|
1781
1886
|
super();
|
|
1782
|
-
this.
|
|
1887
|
+
this.xn_1 = true;
|
|
1783
1888
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
1784
1889
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1785
1890
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -1789,8 +1894,8 @@ class MarkdownCode extends LeafElement {
|
|
|
1789
1894
|
var tmp = element(this.attachShadow(o), 'pre');
|
|
1790
1895
|
element(tmp, 'code', MarkdownCode$lambda);
|
|
1791
1896
|
}
|
|
1792
|
-
|
|
1793
|
-
return this.
|
|
1897
|
+
mn() {
|
|
1898
|
+
return this.xn_1;
|
|
1794
1899
|
}
|
|
1795
1900
|
getMarkdown() {
|
|
1796
1901
|
var lang = this.getAttribute('lang');
|
|
@@ -1809,13 +1914,13 @@ class MarkdownCode extends LeafElement {
|
|
|
1809
1914
|
return true;
|
|
1810
1915
|
}
|
|
1811
1916
|
get mustBeDirectChildOfDocument() {
|
|
1812
|
-
return this.
|
|
1917
|
+
return this.mn();
|
|
1813
1918
|
}
|
|
1814
1919
|
}
|
|
1815
1920
|
class MarkdownCodeSpan extends TerminalInlineElement {
|
|
1816
1921
|
constructor() {
|
|
1817
1922
|
super();
|
|
1818
|
-
this.
|
|
1923
|
+
this.yn_1 = false;
|
|
1819
1924
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
1820
1925
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1821
1926
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -1825,8 +1930,8 @@ class MarkdownCodeSpan extends TerminalInlineElement {
|
|
|
1825
1930
|
var tmp = this.attachShadow(o);
|
|
1826
1931
|
element(tmp, 'code', MarkdownCodeSpan$lambda);
|
|
1827
1932
|
}
|
|
1828
|
-
|
|
1829
|
-
return this.
|
|
1933
|
+
mn() {
|
|
1934
|
+
return this.yn_1;
|
|
1830
1935
|
}
|
|
1831
1936
|
getMarkdown() {
|
|
1832
1937
|
return '`' + getMarkdownWithTextForElement(this) + '`';
|
|
@@ -1835,7 +1940,7 @@ class MarkdownCodeSpan extends TerminalInlineElement {
|
|
|
1835
1940
|
return true;
|
|
1836
1941
|
}
|
|
1837
1942
|
get mustBeDirectChildOfDocument() {
|
|
1838
|
-
return this.
|
|
1943
|
+
return this.mn();
|
|
1839
1944
|
}
|
|
1840
1945
|
}
|
|
1841
1946
|
class MarkdownEmphasis extends InlineElement {
|
|
@@ -1851,9 +1956,7 @@ class MarkdownEmphasis extends InlineElement {
|
|
|
1851
1956
|
element(tmp, 'i', MarkdownEmphasis$lambda);
|
|
1852
1957
|
}
|
|
1853
1958
|
getMarkdown() {
|
|
1854
|
-
|
|
1855
|
-
var this_0 = super.getMarkdown();
|
|
1856
|
-
return '*' + toString_0(trim(isCharSequence(this_0) ? this_0 : THROW_CCE())) + '*';
|
|
1959
|
+
return this.wrapMarkdownContentIn('*');
|
|
1857
1960
|
}
|
|
1858
1961
|
containsMarkdownTextContent() {
|
|
1859
1962
|
return true;
|
|
@@ -1862,67 +1965,67 @@ class MarkdownEmphasis extends InlineElement {
|
|
|
1862
1965
|
class MarkdownHeading1 extends Heading {
|
|
1863
1966
|
constructor() {
|
|
1864
1967
|
super();
|
|
1865
|
-
this.
|
|
1968
|
+
this.ao_1 = 1;
|
|
1866
1969
|
this.renderHeading();
|
|
1867
1970
|
}
|
|
1868
|
-
|
|
1869
|
-
return this.
|
|
1971
|
+
on() {
|
|
1972
|
+
return this.ao_1;
|
|
1870
1973
|
}
|
|
1871
1974
|
}
|
|
1872
1975
|
class MarkdownHeading2 extends Heading {
|
|
1873
1976
|
constructor() {
|
|
1874
1977
|
super();
|
|
1875
|
-
this.
|
|
1978
|
+
this.co_1 = 2;
|
|
1876
1979
|
this.renderHeading();
|
|
1877
1980
|
}
|
|
1878
|
-
|
|
1879
|
-
return this.
|
|
1981
|
+
on() {
|
|
1982
|
+
return this.co_1;
|
|
1880
1983
|
}
|
|
1881
1984
|
}
|
|
1882
1985
|
class MarkdownHeading3 extends Heading {
|
|
1883
1986
|
constructor() {
|
|
1884
1987
|
super();
|
|
1885
|
-
this.
|
|
1988
|
+
this.eo_1 = 3;
|
|
1886
1989
|
this.renderHeading();
|
|
1887
1990
|
}
|
|
1888
|
-
|
|
1889
|
-
return this.
|
|
1991
|
+
on() {
|
|
1992
|
+
return this.eo_1;
|
|
1890
1993
|
}
|
|
1891
1994
|
}
|
|
1892
1995
|
class MarkdownHeading4 extends Heading {
|
|
1893
1996
|
constructor() {
|
|
1894
1997
|
super();
|
|
1895
|
-
this.
|
|
1998
|
+
this.go_1 = 4;
|
|
1896
1999
|
this.renderHeading();
|
|
1897
2000
|
}
|
|
1898
|
-
|
|
1899
|
-
return this.
|
|
2001
|
+
on() {
|
|
2002
|
+
return this.go_1;
|
|
1900
2003
|
}
|
|
1901
2004
|
}
|
|
1902
2005
|
class MarkdownHeading5 extends Heading {
|
|
1903
2006
|
constructor() {
|
|
1904
2007
|
super();
|
|
1905
|
-
this.
|
|
2008
|
+
this.io_1 = 5;
|
|
1906
2009
|
this.renderHeading();
|
|
1907
2010
|
}
|
|
1908
|
-
|
|
1909
|
-
return this.
|
|
2011
|
+
on() {
|
|
2012
|
+
return this.io_1;
|
|
1910
2013
|
}
|
|
1911
2014
|
}
|
|
1912
2015
|
class MarkdownHeading6 extends Heading {
|
|
1913
2016
|
constructor() {
|
|
1914
2017
|
super();
|
|
1915
|
-
this.
|
|
2018
|
+
this.ko_1 = 6;
|
|
1916
2019
|
this.renderHeading();
|
|
1917
2020
|
}
|
|
1918
|
-
|
|
1919
|
-
return this.
|
|
2021
|
+
on() {
|
|
2022
|
+
return this.ko_1;
|
|
1920
2023
|
}
|
|
1921
2024
|
}
|
|
1922
2025
|
class MarkdownHtml extends LeafElement {
|
|
1923
2026
|
constructor() {
|
|
1924
2027
|
super();
|
|
1925
|
-
this.
|
|
2028
|
+
this.lo_1 = false;
|
|
1926
2029
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
1927
2030
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1928
2031
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -1931,8 +2034,8 @@ class MarkdownHtml extends LeafElement {
|
|
|
1931
2034
|
o['mode'] = 'open';
|
|
1932
2035
|
slot(this.attachShadow(o));
|
|
1933
2036
|
}
|
|
1934
|
-
|
|
1935
|
-
return this.
|
|
2037
|
+
mn() {
|
|
2038
|
+
return this.lo_1;
|
|
1936
2039
|
}
|
|
1937
2040
|
isEditable() {
|
|
1938
2041
|
return false;
|
|
@@ -1946,13 +2049,13 @@ class MarkdownHtml extends LeafElement {
|
|
|
1946
2049
|
return true;
|
|
1947
2050
|
}
|
|
1948
2051
|
get mustBeDirectChildOfDocument() {
|
|
1949
|
-
return this.
|
|
2052
|
+
return this.mn();
|
|
1950
2053
|
}
|
|
1951
2054
|
}
|
|
1952
2055
|
class MarkdownImage extends TerminalInlineElement {
|
|
1953
2056
|
constructor() {
|
|
1954
2057
|
super();
|
|
1955
|
-
this.
|
|
2058
|
+
this.zl_1 = false;
|
|
1956
2059
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
1957
2060
|
// Inline function 'kotlin.js.asDynamic' call
|
|
1958
2061
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -1970,20 +2073,21 @@ class MarkdownImage extends TerminalInlineElement {
|
|
|
1970
2073
|
tmp_1.img = tmp_2 instanceof HTMLImageElement ? tmp_2 : THROW_CCE();
|
|
1971
2074
|
this.img.addEventListener('error', MarkdownImage$lambda_2(this));
|
|
1972
2075
|
element(shadow, 'slot', MarkdownImage$lambda_3);
|
|
2076
|
+
this.upgradeProperty('destination');
|
|
1973
2077
|
}
|
|
1974
|
-
|
|
1975
|
-
return this.
|
|
2078
|
+
mn() {
|
|
2079
|
+
return this.zl_1;
|
|
1976
2080
|
}
|
|
1977
|
-
|
|
2081
|
+
mo() {
|
|
1978
2082
|
return this.img;
|
|
1979
2083
|
}
|
|
1980
|
-
|
|
2084
|
+
no() {
|
|
1981
2085
|
return this.uploadInput;
|
|
1982
2086
|
}
|
|
1983
|
-
|
|
2087
|
+
am(value) {
|
|
1984
2088
|
return this.setAttribute('destination', value);
|
|
1985
2089
|
}
|
|
1986
|
-
|
|
2090
|
+
oo() {
|
|
1987
2091
|
var tmp0_elvis_lhs = this.getAttribute('destination');
|
|
1988
2092
|
return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
1989
2093
|
}
|
|
@@ -2020,19 +2124,19 @@ class MarkdownImage extends TerminalInlineElement {
|
|
|
2020
2124
|
return true;
|
|
2021
2125
|
}
|
|
2022
2126
|
get mustBeDirectChildOfDocument() {
|
|
2023
|
-
return this.
|
|
2127
|
+
return this.mn();
|
|
2024
2128
|
}
|
|
2025
2129
|
get destination() {
|
|
2026
|
-
return this.
|
|
2130
|
+
return this.oo();
|
|
2027
2131
|
}
|
|
2028
2132
|
set destination(value) {
|
|
2029
|
-
this.
|
|
2133
|
+
this.am(value);
|
|
2030
2134
|
}
|
|
2031
2135
|
}
|
|
2032
2136
|
class MarkdownLink extends TerminalInlineElement {
|
|
2033
2137
|
constructor() {
|
|
2034
2138
|
super();
|
|
2035
|
-
this.
|
|
2139
|
+
this.wm_1 = false;
|
|
2036
2140
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2037
2141
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2038
2142
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2046,23 +2150,23 @@ class MarkdownLink extends TerminalInlineElement {
|
|
|
2046
2150
|
// Inline function 'kotlin.also' call
|
|
2047
2151
|
var this_0 = tmp_0 instanceof HTMLAnchorElement ? tmp_0 : THROW_CCE();
|
|
2048
2152
|
slot(this_0);
|
|
2049
|
-
tmp.
|
|
2153
|
+
tmp.xm_1 = this_0;
|
|
2050
2154
|
var showLink = element(shadow, 'span', MarkdownLink$lambda_0);
|
|
2051
2155
|
showLink.addEventListener('click', MarkdownLink$lambda_1(this));
|
|
2052
2156
|
var tmp_1 = this;
|
|
2053
2157
|
var tmp_2 = element(shadow, 'input', MarkdownLink$lambda_2);
|
|
2054
|
-
tmp_1.
|
|
2055
|
-
this.
|
|
2056
|
-
this.
|
|
2057
|
-
this.
|
|
2158
|
+
tmp_1.ym_1 = tmp_2 instanceof HTMLInputElement ? tmp_2 : THROW_CCE();
|
|
2159
|
+
this.ym_1.addEventListener('input', MarkdownLink$lambda_3(this));
|
|
2160
|
+
this.ym_1.addEventListener('blur', MarkdownLink$lambda_4(this));
|
|
2161
|
+
this.ym_1.addEventListener('keydown', MarkdownLink$lambda_5(this));
|
|
2058
2162
|
}
|
|
2059
|
-
|
|
2060
|
-
return this.
|
|
2163
|
+
mn() {
|
|
2164
|
+
return this.wm_1;
|
|
2061
2165
|
}
|
|
2062
|
-
|
|
2166
|
+
am(value) {
|
|
2063
2167
|
return this.setAttribute('destination', value);
|
|
2064
2168
|
}
|
|
2065
|
-
|
|
2169
|
+
oo() {
|
|
2066
2170
|
var tmp0_elvis_lhs = this.getAttribute('destination');
|
|
2067
2171
|
return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
|
|
2068
2172
|
}
|
|
@@ -2091,9 +2195,9 @@ class MarkdownLink extends TerminalInlineElement {
|
|
|
2091
2195
|
// Inline function 'kotlin.text.isNotEmpty' call
|
|
2092
2196
|
var this_0 = this.title;
|
|
2093
2197
|
if (charSequenceLength(this_0) > 0) {
|
|
2094
|
-
tmp = '[' + this.innerText + '](' + this.
|
|
2198
|
+
tmp = '[' + this.innerText + '](' + this.oo() + ' "' + this.title + '")';
|
|
2095
2199
|
} else {
|
|
2096
|
-
tmp = '[' + this.innerText + '](' + this.
|
|
2200
|
+
tmp = '[' + this.innerText + '](' + this.oo() + ')';
|
|
2097
2201
|
}
|
|
2098
2202
|
return tmp;
|
|
2099
2203
|
}
|
|
@@ -2101,13 +2205,13 @@ class MarkdownLink extends TerminalInlineElement {
|
|
|
2101
2205
|
return true;
|
|
2102
2206
|
}
|
|
2103
2207
|
get mustBeDirectChildOfDocument() {
|
|
2104
|
-
return this.
|
|
2208
|
+
return this.mn();
|
|
2105
2209
|
}
|
|
2106
2210
|
}
|
|
2107
2211
|
class MarkdownList extends ContainerElement {
|
|
2108
2212
|
constructor() {
|
|
2109
2213
|
super();
|
|
2110
|
-
this.
|
|
2214
|
+
this.po_1 = false;
|
|
2111
2215
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2112
2216
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2113
2217
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2119,8 +2223,8 @@ class MarkdownList extends ContainerElement {
|
|
|
2119
2223
|
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}");
|
|
2120
2224
|
slot(this_0);
|
|
2121
2225
|
}
|
|
2122
|
-
|
|
2123
|
-
return this.
|
|
2226
|
+
mn() {
|
|
2227
|
+
return this.po_1;
|
|
2124
2228
|
}
|
|
2125
2229
|
getMarkdown() {
|
|
2126
2230
|
return super.getMarkdown() + '\n';
|
|
@@ -2128,7 +2232,7 @@ class MarkdownList extends ContainerElement {
|
|
|
2128
2232
|
containsMarkdownTextContent() {
|
|
2129
2233
|
return false;
|
|
2130
2234
|
}
|
|
2131
|
-
|
|
2235
|
+
gm(child) {
|
|
2132
2236
|
if (child == null)
|
|
2133
2237
|
return Unit_instance;
|
|
2134
2238
|
var list = document.createElement('markdown-list');
|
|
@@ -2138,7 +2242,7 @@ class MarkdownList extends ContainerElement {
|
|
|
2138
2242
|
child.innerHTML = ' ';
|
|
2139
2243
|
child.appendChild(list);
|
|
2140
2244
|
}
|
|
2141
|
-
|
|
2245
|
+
hm(child) {
|
|
2142
2246
|
if (child == null)
|
|
2143
2247
|
return Unit_instance;
|
|
2144
2248
|
var tmp0_safe_receiver = this.parentElement;
|
|
@@ -2160,7 +2264,7 @@ class MarkdownList extends ContainerElement {
|
|
|
2160
2264
|
}
|
|
2161
2265
|
}
|
|
2162
2266
|
get mustBeDirectChildOfDocument() {
|
|
2163
|
-
return this.
|
|
2267
|
+
return this.mn();
|
|
2164
2268
|
}
|
|
2165
2269
|
}
|
|
2166
2270
|
class MarkdownListItem extends ListItem {
|
|
@@ -2181,7 +2285,7 @@ class MarkdownListItem extends ListItem {
|
|
|
2181
2285
|
class MarkdownNumericList extends ContainerElement {
|
|
2182
2286
|
constructor() {
|
|
2183
2287
|
super();
|
|
2184
|
-
this.
|
|
2288
|
+
this.qo_1 = false;
|
|
2185
2289
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2186
2290
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2187
2291
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2193,8 +2297,8 @@ class MarkdownNumericList extends ContainerElement {
|
|
|
2193
2297
|
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}");
|
|
2194
2298
|
slot(this_0);
|
|
2195
2299
|
}
|
|
2196
|
-
|
|
2197
|
-
return this.
|
|
2300
|
+
mn() {
|
|
2301
|
+
return this.qo_1;
|
|
2198
2302
|
}
|
|
2199
2303
|
getMarkdown() {
|
|
2200
2304
|
return super.getMarkdown() + '\n';
|
|
@@ -2202,7 +2306,7 @@ class MarkdownNumericList extends ContainerElement {
|
|
|
2202
2306
|
containsMarkdownTextContent() {
|
|
2203
2307
|
return false;
|
|
2204
2308
|
}
|
|
2205
|
-
|
|
2309
|
+
gm(child) {
|
|
2206
2310
|
if (child == null)
|
|
2207
2311
|
return Unit_instance;
|
|
2208
2312
|
var list = document.createElement('markdown-numeric-list');
|
|
@@ -2212,7 +2316,7 @@ class MarkdownNumericList extends ContainerElement {
|
|
|
2212
2316
|
child.innerHTML = ' ';
|
|
2213
2317
|
child.appendChild(list);
|
|
2214
2318
|
}
|
|
2215
|
-
|
|
2319
|
+
hm(child) {
|
|
2216
2320
|
if (child == null)
|
|
2217
2321
|
return Unit_instance;
|
|
2218
2322
|
var tmp0_safe_receiver = this.parentElement;
|
|
@@ -2234,7 +2338,7 @@ class MarkdownNumericList extends ContainerElement {
|
|
|
2234
2338
|
}
|
|
2235
2339
|
}
|
|
2236
2340
|
get mustBeDirectChildOfDocument() {
|
|
2237
|
-
return this.
|
|
2341
|
+
return this.mn();
|
|
2238
2342
|
}
|
|
2239
2343
|
}
|
|
2240
2344
|
class MarkdownNumericListItem extends ListItem {
|
|
@@ -2255,7 +2359,7 @@ class MarkdownNumericListItem extends ListItem {
|
|
|
2255
2359
|
class MarkdownParagraph extends LeafElement {
|
|
2256
2360
|
constructor() {
|
|
2257
2361
|
super();
|
|
2258
|
-
this.
|
|
2362
|
+
this.ro_1 = true;
|
|
2259
2363
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2260
2364
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2261
2365
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2267,8 +2371,8 @@ class MarkdownParagraph extends LeafElement {
|
|
|
2267
2371
|
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}');
|
|
2268
2372
|
slot(this_0);
|
|
2269
2373
|
}
|
|
2270
|
-
|
|
2271
|
-
return this.
|
|
2374
|
+
mn() {
|
|
2375
|
+
return this.ro_1;
|
|
2272
2376
|
}
|
|
2273
2377
|
getMarkdown() {
|
|
2274
2378
|
var tmp = asList(this.childNodes);
|
|
@@ -2293,13 +2397,13 @@ class MarkdownParagraph extends LeafElement {
|
|
|
2293
2397
|
return this.getMarkdown() === '\n\n';
|
|
2294
2398
|
}
|
|
2295
2399
|
get mustBeDirectChildOfDocument() {
|
|
2296
|
-
return this.
|
|
2400
|
+
return this.mn();
|
|
2297
2401
|
}
|
|
2298
2402
|
}
|
|
2299
2403
|
class MarkdownQuote extends ContainerElement {
|
|
2300
2404
|
constructor() {
|
|
2301
2405
|
super();
|
|
2302
|
-
this.
|
|
2406
|
+
this.so_1 = true;
|
|
2303
2407
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2304
2408
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2305
2409
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2311,8 +2415,8 @@ class MarkdownQuote extends ContainerElement {
|
|
|
2311
2415
|
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}");
|
|
2312
2416
|
element(this_0, 'blockquote', MarkdownQuote$lambda);
|
|
2313
2417
|
}
|
|
2314
|
-
|
|
2315
|
-
return this.
|
|
2418
|
+
mn() {
|
|
2419
|
+
return this.so_1;
|
|
2316
2420
|
}
|
|
2317
2421
|
getMarkdown() {
|
|
2318
2422
|
var tmp = asList(this.childNodes);
|
|
@@ -2330,14 +2434,14 @@ class MarkdownQuote extends ContainerElement {
|
|
|
2330
2434
|
this.before(tmp0_safe_receiver);
|
|
2331
2435
|
}
|
|
2332
2436
|
}
|
|
2333
|
-
|
|
2437
|
+
gm(child) {
|
|
2334
2438
|
if (!(child == null)) {
|
|
2335
2439
|
var quote = document.createElement('markdown-quote');
|
|
2336
2440
|
child.replaceWith(quote);
|
|
2337
2441
|
quote.append(child);
|
|
2338
2442
|
}
|
|
2339
2443
|
}
|
|
2340
|
-
|
|
2444
|
+
hm(child) {
|
|
2341
2445
|
if (!(child == null) && this.childNodes.length > 1) {
|
|
2342
2446
|
var nodes = asList(this.childNodes);
|
|
2343
2447
|
var indexOfChild = nodes.n1(child);
|
|
@@ -2369,11 +2473,11 @@ class MarkdownQuote extends ContainerElement {
|
|
|
2369
2473
|
this.remove();
|
|
2370
2474
|
}
|
|
2371
2475
|
}
|
|
2372
|
-
|
|
2373
|
-
this.
|
|
2476
|
+
fm(child) {
|
|
2477
|
+
this.hm(child);
|
|
2374
2478
|
}
|
|
2375
2479
|
get mustBeDirectChildOfDocument() {
|
|
2376
|
-
return this.
|
|
2480
|
+
return this.mn();
|
|
2377
2481
|
}
|
|
2378
2482
|
}
|
|
2379
2483
|
class MarkdownStrike extends InlineElement {
|
|
@@ -2389,9 +2493,7 @@ class MarkdownStrike extends InlineElement {
|
|
|
2389
2493
|
element(tmp, 'del', MarkdownStrike$lambda);
|
|
2390
2494
|
}
|
|
2391
2495
|
getMarkdown() {
|
|
2392
|
-
|
|
2393
|
-
var this_0 = super.getMarkdown();
|
|
2394
|
-
return '~~' + toString_0(trim(isCharSequence(this_0) ? this_0 : THROW_CCE())) + '~~';
|
|
2496
|
+
return this.wrapMarkdownContentIn('~~');
|
|
2395
2497
|
}
|
|
2396
2498
|
containsMarkdownTextContent() {
|
|
2397
2499
|
return true;
|
|
@@ -2412,9 +2514,7 @@ class MarkdownStrong extends InlineElement {
|
|
|
2412
2514
|
slot(this_0);
|
|
2413
2515
|
}
|
|
2414
2516
|
getMarkdown() {
|
|
2415
|
-
|
|
2416
|
-
var this_0 = super.getMarkdown();
|
|
2417
|
-
return '**' + toString_0(trim(isCharSequence(this_0) ? this_0 : THROW_CCE())) + '**';
|
|
2517
|
+
return this.wrapMarkdownContentIn('**');
|
|
2418
2518
|
}
|
|
2419
2519
|
mergeSameSiblings() {
|
|
2420
2520
|
return true;
|
|
@@ -2426,7 +2526,7 @@ class MarkdownStrong extends InlineElement {
|
|
|
2426
2526
|
class MarkdownTable extends ContainerElement {
|
|
2427
2527
|
constructor() {
|
|
2428
2528
|
super();
|
|
2429
|
-
this.
|
|
2529
|
+
this.to_1 = true;
|
|
2430
2530
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2431
2531
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2432
2532
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2438,8 +2538,8 @@ class MarkdownTable extends ContainerElement {
|
|
|
2438
2538
|
style(this_0, ':host {\n display: table;\n border-collapse: collapse;\n}');
|
|
2439
2539
|
slot(this_0);
|
|
2440
2540
|
}
|
|
2441
|
-
|
|
2442
|
-
return this.
|
|
2541
|
+
mn() {
|
|
2542
|
+
return this.to_1;
|
|
2443
2543
|
}
|
|
2444
2544
|
getMarkdown() {
|
|
2445
2545
|
var tmp = asList(this.children);
|
|
@@ -2449,25 +2549,25 @@ class MarkdownTable extends ContainerElement {
|
|
|
2449
2549
|
return false;
|
|
2450
2550
|
}
|
|
2451
2551
|
get mustBeDirectChildOfDocument() {
|
|
2452
|
-
return this.
|
|
2552
|
+
return this.mn();
|
|
2453
2553
|
}
|
|
2454
2554
|
}
|
|
2455
2555
|
class MarkdownTableCell extends TableCell {
|
|
2456
2556
|
constructor() {
|
|
2457
2557
|
super();
|
|
2458
|
-
this.
|
|
2558
|
+
this.vn('display: table-cell; border: lightgrey 1px solid;');
|
|
2459
2559
|
}
|
|
2460
2560
|
}
|
|
2461
2561
|
class MarkdownTableHeaderCell extends TableCell {
|
|
2462
2562
|
constructor() {
|
|
2463
2563
|
super();
|
|
2464
|
-
this.
|
|
2564
|
+
this.vn('display: table-cell; border: lightgrey 1px solid; background-color: lightgray;');
|
|
2465
2565
|
}
|
|
2466
2566
|
}
|
|
2467
2567
|
class MarkdownTableRow extends ContainerElement {
|
|
2468
2568
|
constructor() {
|
|
2469
2569
|
super();
|
|
2470
|
-
this.
|
|
2570
|
+
this.uo_1 = false;
|
|
2471
2571
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2472
2572
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2473
2573
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2479,8 +2579,8 @@ class MarkdownTableRow extends ContainerElement {
|
|
|
2479
2579
|
style(this_0, ':host {\n display: table-row;\n border: lightgrey 1px solid;\n}');
|
|
2480
2580
|
slot(this_0);
|
|
2481
2581
|
}
|
|
2482
|
-
|
|
2483
|
-
return this.
|
|
2582
|
+
mn() {
|
|
2583
|
+
return this.uo_1;
|
|
2484
2584
|
}
|
|
2485
2585
|
getMarkdown() {
|
|
2486
2586
|
var tmp = asList(this.children);
|
|
@@ -2490,7 +2590,7 @@ class MarkdownTableRow extends ContainerElement {
|
|
|
2490
2590
|
return false;
|
|
2491
2591
|
}
|
|
2492
2592
|
get mustBeDirectChildOfDocument() {
|
|
2493
|
-
return this.
|
|
2593
|
+
return this.mn();
|
|
2494
2594
|
}
|
|
2495
2595
|
}
|
|
2496
2596
|
class MarkdownTableHeaderRow extends MarkdownTableRow {
|
|
@@ -2512,31 +2612,31 @@ class MarkdownTaskListItem extends ListItem {
|
|
|
2512
2612
|
var container = element(shadow, 'div', MarkdownTaskListItem$lambda);
|
|
2513
2613
|
var tmp = this;
|
|
2514
2614
|
var tmp_0 = element(container, 'input', MarkdownTaskListItem$lambda_0);
|
|
2515
|
-
tmp.
|
|
2516
|
-
this.
|
|
2615
|
+
tmp.wo_1 = tmp_0 instanceof HTMLInputElement ? tmp_0 : THROW_CCE();
|
|
2616
|
+
this.wo_1.addEventListener('change', MarkdownTaskListItem$lambda_1(this));
|
|
2517
2617
|
element(container, 'div', MarkdownTaskListItem$lambda_2);
|
|
2518
2618
|
}
|
|
2519
|
-
|
|
2619
|
+
xo() {
|
|
2520
2620
|
return this.getAttribute('checked') === 'true';
|
|
2521
2621
|
}
|
|
2522
2622
|
dc(name, oldValue, newValue) {
|
|
2523
2623
|
if (name === 'checked') {
|
|
2524
|
-
this.
|
|
2624
|
+
this.wo_1.checked = this.xo();
|
|
2525
2625
|
}
|
|
2526
2626
|
}
|
|
2527
2627
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
2528
2628
|
return this.dc(name, oldValue, newValue);
|
|
2529
2629
|
}
|
|
2530
|
-
|
|
2531
|
-
return '[' + (this.
|
|
2630
|
+
sn() {
|
|
2631
|
+
return '[' + (this.xo() ? 'x' : ' ') + '] ';
|
|
2532
2632
|
}
|
|
2533
2633
|
}
|
|
2534
2634
|
class MarkdownToc extends BaseWebComponent {
|
|
2535
2635
|
constructor() {
|
|
2536
2636
|
super();
|
|
2537
|
-
this.
|
|
2538
|
-
this.
|
|
2539
|
-
this.
|
|
2637
|
+
this.bm_1 = false;
|
|
2638
|
+
this.cm_1 = null;
|
|
2639
|
+
this.dm_1 = null;
|
|
2540
2640
|
// Inline function 'org.w3c.dom.OPEN' call
|
|
2541
2641
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2542
2642
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
@@ -2544,21 +2644,22 @@ class MarkdownToc extends BaseWebComponent {
|
|
|
2544
2644
|
var o = {};
|
|
2545
2645
|
o['mode'] = 'open';
|
|
2546
2646
|
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
|
+
this.upgradeProperty('markdownDocument');
|
|
2547
2648
|
}
|
|
2548
|
-
|
|
2549
|
-
return this.
|
|
2649
|
+
mn() {
|
|
2650
|
+
return this.bm_1;
|
|
2550
2651
|
}
|
|
2551
|
-
|
|
2552
|
-
this.
|
|
2652
|
+
em(value) {
|
|
2653
|
+
this.dm_1 = value;
|
|
2553
2654
|
this.refresh();
|
|
2554
2655
|
}
|
|
2555
|
-
|
|
2556
|
-
return this.
|
|
2656
|
+
hn() {
|
|
2657
|
+
return this.dm_1;
|
|
2557
2658
|
}
|
|
2558
2659
|
ac() {
|
|
2559
2660
|
super.ac();
|
|
2560
|
-
if (this.
|
|
2561
|
-
this.
|
|
2661
|
+
if (this.dm_1 == null) {
|
|
2662
|
+
this.em(this.closest('markdown-document'));
|
|
2562
2663
|
var tmp = window;
|
|
2563
2664
|
tmp.setTimeout(MarkdownToc$connectedCallback$lambda(this), 1000);
|
|
2564
2665
|
}
|
|
@@ -2567,7 +2668,7 @@ class MarkdownToc extends BaseWebComponent {
|
|
|
2567
2668
|
return this.ac();
|
|
2568
2669
|
}
|
|
2569
2670
|
refresh() {
|
|
2570
|
-
var tmp0_elvis_lhs = this.
|
|
2671
|
+
var tmp0_elvis_lhs = this.dm_1;
|
|
2571
2672
|
var tmp;
|
|
2572
2673
|
if (tmp0_elvis_lhs == null) {
|
|
2573
2674
|
return Unit_instance;
|
|
@@ -2583,7 +2684,7 @@ class MarkdownToc extends BaseWebComponent {
|
|
|
2583
2684
|
tmp_0 = tmp1_elvis_lhs;
|
|
2584
2685
|
}
|
|
2585
2686
|
var shadow = tmp_0;
|
|
2586
|
-
var tmp2_safe_receiver = this.
|
|
2687
|
+
var tmp2_safe_receiver = this.cm_1;
|
|
2587
2688
|
if (tmp2_safe_receiver == null)
|
|
2588
2689
|
null;
|
|
2589
2690
|
else {
|
|
@@ -2591,7 +2692,7 @@ class MarkdownToc extends BaseWebComponent {
|
|
|
2591
2692
|
}
|
|
2592
2693
|
var currentDepth = 1;
|
|
2593
2694
|
var currentList = document.createElement('div');
|
|
2594
|
-
this.
|
|
2695
|
+
this.cm_1 = currentList;
|
|
2595
2696
|
shadow.appendChild(currentList);
|
|
2596
2697
|
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
2597
2698
|
var tmp0 = asList(root.querySelectorAll('*'));
|
|
@@ -2633,30 +2734,30 @@ class MarkdownToc extends BaseWebComponent {
|
|
|
2633
2734
|
return '${toc}';
|
|
2634
2735
|
}
|
|
2635
2736
|
get mustBeDirectChildOfDocument() {
|
|
2636
|
-
return this.
|
|
2737
|
+
return this.mn();
|
|
2637
2738
|
}
|
|
2638
2739
|
get markdownDocument() {
|
|
2639
|
-
return this.
|
|
2740
|
+
return this.hn();
|
|
2640
2741
|
}
|
|
2641
2742
|
set markdownDocument(value) {
|
|
2642
|
-
this.
|
|
2743
|
+
this.em(value);
|
|
2643
2744
|
}
|
|
2644
2745
|
}
|
|
2645
2746
|
class HeadingAnchors {
|
|
2646
2747
|
constructor() {
|
|
2647
2748
|
HeadingAnchors_instance = this;
|
|
2648
|
-
this.
|
|
2649
|
-
this.
|
|
2749
|
+
this.yo_1 = Regex.k8('\\s*\\{([^}]+)\\}$');
|
|
2750
|
+
this.zo_1 = Regex.j8('[^\\w\u0430-\u044F\u0456\u0457\u0454]+', RegexOption_IGNORE_CASE_getInstance());
|
|
2650
2751
|
}
|
|
2651
|
-
|
|
2652
|
-
var match = this.
|
|
2752
|
+
ap(idPrefixForDefault, text, useTextInId) {
|
|
2753
|
+
var match = this.yo_1.n8(text);
|
|
2653
2754
|
var tmp;
|
|
2654
2755
|
if (!(match == null)) {
|
|
2655
2756
|
tmp = to(match.l9().s(1), substring(text, 0, match.q8().ua_1));
|
|
2656
2757
|
} else {
|
|
2657
2758
|
var tmp_0;
|
|
2658
2759
|
if (useTextInId) {
|
|
2659
|
-
tmp_0 = idPrefixForDefault + this.
|
|
2760
|
+
tmp_0 = idPrefixForDefault + this.bp(text);
|
|
2660
2761
|
} else {
|
|
2661
2762
|
tmp_0 = idPrefixForDefault + ((new Date()).getTime() + Default_getInstance().ka());
|
|
2662
2763
|
}
|
|
@@ -2665,12 +2766,12 @@ class HeadingAnchors {
|
|
|
2665
2766
|
}
|
|
2666
2767
|
return tmp;
|
|
2667
2768
|
}
|
|
2668
|
-
|
|
2769
|
+
bp(text) {
|
|
2669
2770
|
// Inline function 'kotlin.text.lowercase' call
|
|
2670
2771
|
// Inline function 'kotlin.js.asDynamic' call
|
|
2671
2772
|
var tmp0 = text.toLowerCase();
|
|
2672
2773
|
// Inline function 'kotlin.text.replace' call
|
|
2673
|
-
return this.
|
|
2774
|
+
return this.zo_1.o8(tmp0, '-');
|
|
2674
2775
|
}
|
|
2675
2776
|
}
|
|
2676
2777
|
class MarkdownRenderer {}
|
|
@@ -2786,17 +2887,17 @@ class TsStackMarkdownRenderer extends logic_tools_markdown_komponents_tsstack_Ts
|
|
|
2786
2887
|
constructor(delegate) {
|
|
2787
2888
|
delegate = delegate === VOID ? new MarkdownComponentsRenderer() : delegate;
|
|
2788
2889
|
super();
|
|
2789
|
-
this.
|
|
2790
|
-
this.
|
|
2890
|
+
this.cp_1 = delegate;
|
|
2891
|
+
this.dp_1 = false;
|
|
2791
2892
|
}
|
|
2792
|
-
|
|
2793
|
-
return this.
|
|
2893
|
+
ep() {
|
|
2894
|
+
return this.cp_1;
|
|
2794
2895
|
}
|
|
2795
|
-
|
|
2896
|
+
fp(code, lang, escaped, meta) {
|
|
2796
2897
|
var tmp;
|
|
2797
2898
|
// Inline function 'kotlin.text.isNullOrEmpty' call
|
|
2798
2899
|
if (!(meta == null || charSequenceLength(meta) === 0)) {
|
|
2799
|
-
var _destruct__k2r9zo = HeadingAnchors_getInstance().
|
|
2900
|
+
var _destruct__k2r9zo = HeadingAnchors_getInstance().ap('code-', meta, false);
|
|
2800
2901
|
var id = _destruct__k2r9zo.mb();
|
|
2801
2902
|
var newLang = _destruct__k2r9zo.nb();
|
|
2802
2903
|
tmp = this.codeWithAnchor(code, newLang, id, escaped);
|
|
@@ -2806,9 +2907,9 @@ class TsStackMarkdownRenderer extends logic_tools_markdown_komponents_tsstack_Ts
|
|
|
2806
2907
|
return tmp;
|
|
2807
2908
|
}
|
|
2808
2909
|
code(code, lang, escaped, meta) {
|
|
2809
|
-
return this.
|
|
2910
|
+
return this.fp(code, lang, escaped, meta);
|
|
2810
2911
|
}
|
|
2811
|
-
|
|
2912
|
+
gp(code, lang, id, escaped) {
|
|
2812
2913
|
var tmp;
|
|
2813
2914
|
if (!(escaped === true)) {
|
|
2814
2915
|
var tmp0_safe_receiver = this.options.escape;
|
|
@@ -2818,119 +2919,119 @@ class TsStackMarkdownRenderer extends logic_tools_markdown_komponents_tsstack_Ts
|
|
|
2818
2919
|
tmp = code;
|
|
2819
2920
|
}
|
|
2820
2921
|
var codeText = tmp;
|
|
2821
|
-
return this.
|
|
2922
|
+
return this.cp_1.code(codeText, lang, id);
|
|
2822
2923
|
}
|
|
2823
2924
|
codeWithAnchor(code, lang, id, escaped, $super) {
|
|
2824
2925
|
escaped = escaped === VOID ? null : escaped;
|
|
2825
|
-
return $super === VOID ? this.
|
|
2926
|
+
return $super === VOID ? this.gp(code, lang, id, escaped) : $super.gp.call(this, code, lang, id, escaped);
|
|
2826
2927
|
}
|
|
2827
|
-
|
|
2828
|
-
return this.
|
|
2928
|
+
hp(quote) {
|
|
2929
|
+
return this.cp_1.blockquote(quote);
|
|
2829
2930
|
}
|
|
2830
2931
|
blockquote(quote) {
|
|
2831
|
-
return this.
|
|
2932
|
+
return this.hp(quote);
|
|
2832
2933
|
}
|
|
2833
|
-
|
|
2834
|
-
return this.
|
|
2934
|
+
ip(html) {
|
|
2935
|
+
return this.cp_1.html(html);
|
|
2835
2936
|
}
|
|
2836
2937
|
html(html) {
|
|
2837
|
-
return this.
|
|
2938
|
+
return this.ip(html);
|
|
2838
2939
|
}
|
|
2839
|
-
|
|
2840
|
-
var _destruct__k2r9zo = HeadingAnchors_getInstance().
|
|
2940
|
+
jp(text, level, raw) {
|
|
2941
|
+
var _destruct__k2r9zo = HeadingAnchors_getInstance().ap('heading-', text, true);
|
|
2841
2942
|
var id = _destruct__k2r9zo.mb();
|
|
2842
2943
|
var newText = _destruct__k2r9zo.nb();
|
|
2843
|
-
return this.
|
|
2944
|
+
return this.cp_1.heading(newText, level, id);
|
|
2844
2945
|
}
|
|
2845
2946
|
heading(text, level, raw) {
|
|
2846
|
-
return this.
|
|
2947
|
+
return this.jp(text, level, raw);
|
|
2847
2948
|
}
|
|
2848
|
-
|
|
2849
|
-
return this.
|
|
2949
|
+
kp() {
|
|
2950
|
+
return this.cp_1.hr();
|
|
2850
2951
|
}
|
|
2851
2952
|
hr() {
|
|
2852
|
-
return this.
|
|
2953
|
+
return this.kp();
|
|
2853
2954
|
}
|
|
2854
|
-
|
|
2855
|
-
return this.
|
|
2955
|
+
lp(body, ordered) {
|
|
2956
|
+
return this.cp_1.list(body, ordered === true);
|
|
2856
2957
|
}
|
|
2857
2958
|
list(body, ordered) {
|
|
2858
|
-
return this.
|
|
2959
|
+
return this.lp(body, ordered);
|
|
2859
2960
|
}
|
|
2860
|
-
|
|
2861
|
-
return startsWith(text, '<markdown-paragraph>[ ] ') ? this.
|
|
2961
|
+
mp(text) {
|
|
2962
|
+
return startsWith(text, '<markdown-paragraph>[ ] ') ? this.cp_1.taskListItem(replacePrefixOnce(text, '<markdown-paragraph>[ ] ', '<markdown-paragraph>'), false) : startsWith(text, '<markdown-paragraph>[x] ') ? this.cp_1.taskListItem(replacePrefixOnce(text, '<markdown-paragraph>[x] ', '<markdown-paragraph>'), true) : startsWith(text, '[ ] ') ? this.cp_1.taskListItem(removePrefix(text, '[ ] '), false) : startsWith(text, '[x] ') ? this.cp_1.taskListItem(removePrefix(text, '[x] '), true) : this.cp_1.listItem(text);
|
|
2862
2963
|
}
|
|
2863
2964
|
listitem(text) {
|
|
2864
|
-
return this.
|
|
2965
|
+
return this.mp(text);
|
|
2865
2966
|
}
|
|
2866
|
-
|
|
2867
|
-
return this.
|
|
2967
|
+
np(text) {
|
|
2968
|
+
return this.cp_1.paragraph(text);
|
|
2868
2969
|
}
|
|
2869
2970
|
paragraph(text) {
|
|
2870
|
-
return this.
|
|
2971
|
+
return this.np(text);
|
|
2871
2972
|
}
|
|
2872
|
-
|
|
2873
|
-
return this.
|
|
2973
|
+
op(header, body) {
|
|
2974
|
+
return this.cp_1.table(header, body);
|
|
2874
2975
|
}
|
|
2875
2976
|
table(header, body) {
|
|
2876
|
-
return this.
|
|
2977
|
+
return this.op(header, body);
|
|
2877
2978
|
}
|
|
2878
|
-
|
|
2879
|
-
var isHeaderRow = this.
|
|
2880
|
-
this.
|
|
2881
|
-
return isHeaderRow ? this.
|
|
2979
|
+
pp(content) {
|
|
2980
|
+
var isHeaderRow = this.dp_1;
|
|
2981
|
+
this.dp_1 = false;
|
|
2982
|
+
return isHeaderRow ? this.cp_1.tableHeaderRow(content) : this.cp_1.tableRow(content);
|
|
2882
2983
|
}
|
|
2883
2984
|
tablerow(content) {
|
|
2884
|
-
return this.
|
|
2985
|
+
return this.pp(content);
|
|
2885
2986
|
}
|
|
2886
|
-
|
|
2987
|
+
qp(content, flags) {
|
|
2887
2988
|
var tmp;
|
|
2888
2989
|
if (flags.header == true) {
|
|
2889
|
-
this.
|
|
2890
|
-
tmp = this.
|
|
2990
|
+
this.dp_1 = true;
|
|
2991
|
+
tmp = this.cp_1.tableHeaderCell(content);
|
|
2891
2992
|
} else {
|
|
2892
|
-
tmp = this.
|
|
2993
|
+
tmp = this.cp_1.tableCell(content);
|
|
2893
2994
|
}
|
|
2894
2995
|
return tmp;
|
|
2895
2996
|
}
|
|
2896
2997
|
tablecell(content, flags) {
|
|
2897
|
-
return this.
|
|
2998
|
+
return this.qp(content, flags);
|
|
2898
2999
|
}
|
|
2899
|
-
|
|
2900
|
-
return this.
|
|
3000
|
+
rp(text) {
|
|
3001
|
+
return this.cp_1.strong(text);
|
|
2901
3002
|
}
|
|
2902
3003
|
strong(text) {
|
|
2903
|
-
return this.
|
|
3004
|
+
return this.rp(text);
|
|
2904
3005
|
}
|
|
2905
|
-
|
|
2906
|
-
return this.
|
|
3006
|
+
sp(text) {
|
|
3007
|
+
return this.cp_1.emphasis(text);
|
|
2907
3008
|
}
|
|
2908
3009
|
em(text) {
|
|
2909
|
-
return this.
|
|
3010
|
+
return this.sp(text);
|
|
2910
3011
|
}
|
|
2911
|
-
|
|
2912
|
-
return this.
|
|
3012
|
+
tp(text) {
|
|
3013
|
+
return this.cp_1.codeSpan(text);
|
|
2913
3014
|
}
|
|
2914
3015
|
codespan(text) {
|
|
2915
|
-
return this.
|
|
3016
|
+
return this.tp(text);
|
|
2916
3017
|
}
|
|
2917
|
-
|
|
2918
|
-
return this.
|
|
3018
|
+
up(text) {
|
|
3019
|
+
return this.cp_1.strikethrough(text);
|
|
2919
3020
|
}
|
|
2920
3021
|
del(text) {
|
|
2921
|
-
return this.
|
|
3022
|
+
return this.up(text);
|
|
2922
3023
|
}
|
|
2923
|
-
|
|
2924
|
-
return this.
|
|
3024
|
+
vp(href, title, text) {
|
|
3025
|
+
return this.cp_1.link(href, title, text);
|
|
2925
3026
|
}
|
|
2926
3027
|
link(href, title, text) {
|
|
2927
|
-
return this.
|
|
3028
|
+
return this.vp(href, title, text);
|
|
2928
3029
|
}
|
|
2929
|
-
|
|
2930
|
-
return this.
|
|
3030
|
+
wp(href, title, text) {
|
|
3031
|
+
return this.cp_1.image(href, title, text);
|
|
2931
3032
|
}
|
|
2932
3033
|
image(href, title, text) {
|
|
2933
|
-
return this.
|
|
3034
|
+
return this.wp(href, title, text);
|
|
2934
3035
|
}
|
|
2935
3036
|
}
|
|
2936
3037
|
//endregion
|
|
@@ -3010,6 +3111,13 @@ function caretRangeFromPoint(_this__u8e3s4, x, y) {
|
|
|
3010
3111
|
// Inline function 'kotlin.js.asDynamic' call
|
|
3011
3112
|
return _this__u8e3s4.caretRangeFromPoint(x, y);
|
|
3012
3113
|
}
|
|
3114
|
+
function hasOwnProperty(obj, key) {
|
|
3115
|
+
var tmp = Object.prototype.hasOwnProperty.call(obj, key);
|
|
3116
|
+
return (!(tmp == null) ? typeof tmp === 'boolean' : false) ? tmp : THROW_CCE();
|
|
3117
|
+
}
|
|
3118
|
+
function deleteOwnProperty(obj, key) {
|
|
3119
|
+
delete obj[key];
|
|
3120
|
+
}
|
|
3013
3121
|
function define_0(_this__u8e3s4, name, elementClass, observedAttributes) {
|
|
3014
3122
|
var tmp;
|
|
3015
3123
|
if (observedAttributes === VOID) {
|
|
@@ -3042,6 +3150,11 @@ function DropdownElement$lambda($this$element) {
|
|
|
3042
3150
|
slot($this$element);
|
|
3043
3151
|
return Unit_instance;
|
|
3044
3152
|
}
|
|
3153
|
+
function get_defaultParser() {
|
|
3154
|
+
_init_properties_MarkdownDocument_kt__r41r2i();
|
|
3155
|
+
return defaultParser;
|
|
3156
|
+
}
|
|
3157
|
+
var defaultParser;
|
|
3045
3158
|
function onKeyDown($this, event) {
|
|
3046
3159
|
if ($this.editable) {
|
|
3047
3160
|
switch (event.code) {
|
|
@@ -3201,23 +3314,23 @@ function onPaste($this, event) {
|
|
|
3201
3314
|
}
|
|
3202
3315
|
}
|
|
3203
3316
|
function onMouseSelection($this) {
|
|
3204
|
-
if ($this.
|
|
3317
|
+
if ($this.tl_1 && $this.getAttribute('contenteditable') === 'true') {
|
|
3205
3318
|
$this.setAttribute('contenteditable', 'false');
|
|
3206
3319
|
}
|
|
3207
3320
|
}
|
|
3208
3321
|
function onEndMouseSelection($this) {
|
|
3209
|
-
if ($this.
|
|
3322
|
+
if ($this.tl_1 && $this.getAttribute('contenteditable') === 'false') {
|
|
3210
3323
|
$this.setAttribute('contenteditable', $this.getAttribute('readonly') === 'true' ? 'false' : 'true');
|
|
3211
3324
|
$this.focus();
|
|
3212
3325
|
}
|
|
3213
3326
|
}
|
|
3214
3327
|
function mousedown($this, event) {
|
|
3215
3328
|
if ((event.buttons % 2 | 0) === 1) {
|
|
3216
|
-
$this.
|
|
3329
|
+
$this.sl_1 = true;
|
|
3217
3330
|
}
|
|
3218
3331
|
}
|
|
3219
3332
|
function mouseup($this) {
|
|
3220
|
-
$this.
|
|
3333
|
+
$this.sl_1 = false;
|
|
3221
3334
|
onEndMouseSelection($this);
|
|
3222
3335
|
}
|
|
3223
3336
|
function selectstart($this) {
|
|
@@ -3246,7 +3359,7 @@ function selectionchange($this) {
|
|
|
3246
3359
|
tmp_0 = false;
|
|
3247
3360
|
}
|
|
3248
3361
|
if (tmp_0) {
|
|
3249
|
-
if ($this.
|
|
3362
|
+
if ($this.sl_1) {
|
|
3250
3363
|
onMouseSelection($this);
|
|
3251
3364
|
}
|
|
3252
3365
|
enableEditable($this);
|
|
@@ -3254,9 +3367,9 @@ function selectionchange($this) {
|
|
|
3254
3367
|
disableEditable($this);
|
|
3255
3368
|
}
|
|
3256
3369
|
$this.currentSelection = selection;
|
|
3257
|
-
$this.
|
|
3258
|
-
$this.
|
|
3259
|
-
$this.
|
|
3370
|
+
$this.pl_1 = anchorNode;
|
|
3371
|
+
$this.ql_1 = selection.anchorOffset;
|
|
3372
|
+
$this.rl_1 = new StashedSelection(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
|
|
3260
3373
|
affectToolbar($this);
|
|
3261
3374
|
} else {
|
|
3262
3375
|
disableEditable($this);
|
|
@@ -3513,14 +3626,14 @@ function normalizeDOM($this) {
|
|
|
3513
3626
|
null;
|
|
3514
3627
|
else {
|
|
3515
3628
|
// Inline function 'kotlin.let' call
|
|
3516
|
-
img.
|
|
3629
|
+
img.am(tmp0_safe_receiver);
|
|
3517
3630
|
}
|
|
3518
3631
|
var tmp1_safe_receiver = child.getAttribute('title');
|
|
3519
3632
|
if (tmp1_safe_receiver == null)
|
|
3520
3633
|
null;
|
|
3521
3634
|
else {
|
|
3522
3635
|
// Inline function 'kotlin.let' call
|
|
3523
|
-
img.
|
|
3636
|
+
img.am(tmp1_safe_receiver);
|
|
3524
3637
|
}
|
|
3525
3638
|
var tmp2_safe_receiver = child.getAttribute('alt');
|
|
3526
3639
|
if (tmp2_safe_receiver == null)
|
|
@@ -3578,9 +3691,11 @@ function normalizeDOM($this) {
|
|
|
3578
3691
|
child.replaceWith(p);
|
|
3579
3692
|
(p instanceof MarkdownComponent ? p : THROW_CCE()).normalizeContent();
|
|
3580
3693
|
} else {
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3694
|
+
if (asMarkdownElement(child) == null) {
|
|
3695
|
+
var html = document.createElement('markdown-html');
|
|
3696
|
+
(!(child == null) ? child : THROW_CCE()).replaceWith(html);
|
|
3697
|
+
html.appendChild(child);
|
|
3698
|
+
}
|
|
3584
3699
|
}
|
|
3585
3700
|
}
|
|
3586
3701
|
}
|
|
@@ -3614,7 +3729,7 @@ function firstUpdated($this) {
|
|
|
3614
3729
|
var tmp = document.createElement('markdown-toc');
|
|
3615
3730
|
var toc = tmp instanceof MarkdownToc ? tmp : THROW_CCE();
|
|
3616
3731
|
toc.classList.add('floating');
|
|
3617
|
-
toc.
|
|
3732
|
+
toc.em($this);
|
|
3618
3733
|
var tmp0_safe_receiver = $this.shadowRoot;
|
|
3619
3734
|
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.querySelector('.toc');
|
|
3620
3735
|
if (tmp1_safe_receiver == null)
|
|
@@ -3664,7 +3779,7 @@ function handleBackspaceKeyDown($this, event) {
|
|
|
3664
3779
|
event.preventDefault();
|
|
3665
3780
|
var grandparent = parent.parentElement;
|
|
3666
3781
|
if (!(grandparent == null) ? isInterface(grandparent, MarkdownElementEscapeByBackspace) : false) {
|
|
3667
|
-
grandparent.
|
|
3782
|
+
grandparent.fm(parent);
|
|
3668
3783
|
} else {
|
|
3669
3784
|
parent.mergeWithPrevious($this.currentSelection);
|
|
3670
3785
|
}
|
|
@@ -3750,9 +3865,9 @@ function handleTabKeyDown($this, shift) {
|
|
|
3750
3865
|
}
|
|
3751
3866
|
if (!(parent == null) ? isInterface(parent, MarkdownElementWithLevel) : false) {
|
|
3752
3867
|
if (shift) {
|
|
3753
|
-
parent.
|
|
3868
|
+
parent.hm(child);
|
|
3754
3869
|
} else {
|
|
3755
|
-
parent.
|
|
3870
|
+
parent.gm(child);
|
|
3756
3871
|
}
|
|
3757
3872
|
$this.onChange();
|
|
3758
3873
|
}
|
|
@@ -3880,9 +3995,6 @@ function replaceCurrentLeafBlockWith($this, tagName) {
|
|
|
3880
3995
|
oldElement.replaceWith(element);
|
|
3881
3996
|
$this.onChange();
|
|
3882
3997
|
}
|
|
3883
|
-
function BaseMarkdownDocument$parser$lambda(md) {
|
|
3884
|
-
return '<markdown-paragraph>' + md + '<\/markdown-paragraph>';
|
|
3885
|
-
}
|
|
3886
3998
|
function BaseMarkdownDocument$onMouseDown$lambda(this$0) {
|
|
3887
3999
|
return (event) => {
|
|
3888
4000
|
mousedown(this$0, event instanceof MouseEvent ? event : THROW_CCE());
|
|
@@ -3973,7 +4085,7 @@ function BaseMarkdownDocument$onDrop$lambda($reader, this$0, $event) {
|
|
|
3973
4085
|
var dataUri = (!(tmp == null) ? typeof tmp === 'string' : false) ? tmp : THROW_CCE();
|
|
3974
4086
|
var tmp_0 = document.createElement('markdown-image');
|
|
3975
4087
|
var img = tmp_0 instanceof MarkdownImage ? tmp_0 : THROW_CCE();
|
|
3976
|
-
img.
|
|
4088
|
+
img.am(dataUri);
|
|
3977
4089
|
var pos = this$0.selectionRoot.caretPositionFromPoint($event.clientX, $event.clientY);
|
|
3978
4090
|
var tmp_1;
|
|
3979
4091
|
if (!(pos == null)) {
|
|
@@ -4014,13 +4126,9 @@ function BaseMarkdownDocument$onChange$lambda(this$0) {
|
|
|
4014
4126
|
return () => this$0.dispatchEvent(new CustomEvent('change'));
|
|
4015
4127
|
}
|
|
4016
4128
|
function BaseMarkdownDocument$getMarkdown$lambda(it) {
|
|
4017
|
-
var
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
} else {
|
|
4021
|
-
tmp = '';
|
|
4022
|
-
}
|
|
4023
|
-
return tmp;
|
|
4129
|
+
var tmp0_safe_receiver = asMarkdownElement(it);
|
|
4130
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.getMarkdown();
|
|
4131
|
+
return tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
|
|
4024
4132
|
}
|
|
4025
4133
|
function BaseMarkdownDocument$makeBold$lambda(this$0) {
|
|
4026
4134
|
return () => {
|
|
@@ -4128,6 +4236,7 @@ function BaseMarkdownDocument$makeCodeInline$lambda(this$0) {
|
|
|
4128
4236
|
};
|
|
4129
4237
|
}
|
|
4130
4238
|
function getWord(range) {
|
|
4239
|
+
_init_properties_MarkdownDocument_kt__r41r2i();
|
|
4131
4240
|
var container = range.commonAncestorContainer;
|
|
4132
4241
|
var tmp;
|
|
4133
4242
|
if (range.collapsed) {
|
|
@@ -4152,6 +4261,7 @@ function getWord(range) {
|
|
|
4152
4261
|
return null;
|
|
4153
4262
|
}
|
|
4154
4263
|
function allRangeUnderInline_0(tagName, range) {
|
|
4264
|
+
_init_properties_MarkdownDocument_kt__r41r2i();
|
|
4155
4265
|
var container = range.commonAncestorContainer;
|
|
4156
4266
|
if (container instanceof Text) {
|
|
4157
4267
|
var tmp0_safe_receiver = container.parentElement;
|
|
@@ -4194,6 +4304,7 @@ function allRangeUnderInline_0(tagName, range) {
|
|
|
4194
4304
|
return result;
|
|
4195
4305
|
}
|
|
4196
4306
|
function getAllTextNodesForRange(range) {
|
|
4307
|
+
_init_properties_MarkdownDocument_kt__r41r2i();
|
|
4197
4308
|
var startNode = range.startContainer;
|
|
4198
4309
|
var endNode = range.endContainer;
|
|
4199
4310
|
var startOffset = range.startOffset;
|
|
@@ -4269,6 +4380,7 @@ function getAllTextNodesForRange(range) {
|
|
|
4269
4380
|
return result;
|
|
4270
4381
|
}
|
|
4271
4382
|
function isMarkdownContentTextNode(node) {
|
|
4383
|
+
_init_properties_MarkdownDocument_kt__r41r2i();
|
|
4272
4384
|
var parent = node.parentNode;
|
|
4273
4385
|
var tmp;
|
|
4274
4386
|
if (parent instanceof MarkdownComponent) {
|
|
@@ -4279,6 +4391,7 @@ function isMarkdownContentTextNode(node) {
|
|
|
4279
4391
|
return tmp;
|
|
4280
4392
|
}
|
|
4281
4393
|
function surroundRangeIfNotYet(tagName, range) {
|
|
4394
|
+
_init_properties_MarkdownDocument_kt__r41r2i();
|
|
4282
4395
|
if (range.collapsed) {
|
|
4283
4396
|
var wordRange = getWord(range);
|
|
4284
4397
|
if (!(wordRange == null)) {
|
|
@@ -4309,6 +4422,7 @@ function surroundRangeIfNotYet(tagName, range) {
|
|
|
4309
4422
|
}
|
|
4310
4423
|
}
|
|
4311
4424
|
function dispatchToChildren(element) {
|
|
4425
|
+
_init_properties_MarkdownDocument_kt__r41r2i();
|
|
4312
4426
|
var sibling = element.nextSibling;
|
|
4313
4427
|
var parent = element.parentElement;
|
|
4314
4428
|
element.remove();
|
|
@@ -4326,6 +4440,7 @@ function dispatchToChildren(element) {
|
|
|
4326
4440
|
}
|
|
4327
4441
|
}
|
|
4328
4442
|
function unsurroundRange(tagName, range) {
|
|
4443
|
+
_init_properties_MarkdownDocument_kt__r41r2i();
|
|
4329
4444
|
if (range.collapsed) {
|
|
4330
4445
|
var wordRange = getWord(range);
|
|
4331
4446
|
if (!(wordRange == null)) {
|
|
@@ -4382,6 +4497,17 @@ function unsurroundRange(tagName, range) {
|
|
|
4382
4497
|
}
|
|
4383
4498
|
while (surrounded);
|
|
4384
4499
|
}
|
|
4500
|
+
function defaultParser$lambda(md) {
|
|
4501
|
+
_init_properties_MarkdownDocument_kt__r41r2i();
|
|
4502
|
+
return '<markdown-paragraph>' + md + '<\/markdown-paragraph>';
|
|
4503
|
+
}
|
|
4504
|
+
var properties_initialized_MarkdownDocument_kt_5xdlqs;
|
|
4505
|
+
function _init_properties_MarkdownDocument_kt__r41r2i() {
|
|
4506
|
+
if (!properties_initialized_MarkdownDocument_kt_5xdlqs) {
|
|
4507
|
+
properties_initialized_MarkdownDocument_kt_5xdlqs = true;
|
|
4508
|
+
defaultParser = defaultParser$lambda;
|
|
4509
|
+
}
|
|
4510
|
+
}
|
|
4385
4511
|
function actionButton($this, parent, icon, titleText, onClick) {
|
|
4386
4512
|
var button = element(parent, 'toolbar-button', MarkdownToolbar$actionButton$lambda(titleText));
|
|
4387
4513
|
element(button, 'toolbar-icon', MarkdownToolbar$actionButton$lambda_0(icon));
|
|
@@ -4405,7 +4531,7 @@ function paragraphOption($this, parent, onClick) {
|
|
|
4405
4531
|
item.addEventListener('mousedown', MarkdownToolbar$paragraphOption$lambda_0(onClick));
|
|
4406
4532
|
}
|
|
4407
4533
|
function onBoldClick($this) {
|
|
4408
|
-
if ($this.
|
|
4534
|
+
if ($this.an_1.dl()) {
|
|
4409
4535
|
var tmp0_safe_receiver = $this.markdownDocument;
|
|
4410
4536
|
if (tmp0_safe_receiver == null)
|
|
4411
4537
|
null;
|
|
@@ -4422,7 +4548,7 @@ function onBoldClick($this) {
|
|
|
4422
4548
|
}
|
|
4423
4549
|
}
|
|
4424
4550
|
function onItalicClick($this) {
|
|
4425
|
-
if ($this.
|
|
4551
|
+
if ($this.bn_1.dl()) {
|
|
4426
4552
|
var tmp0_safe_receiver = $this.markdownDocument;
|
|
4427
4553
|
if (tmp0_safe_receiver == null)
|
|
4428
4554
|
null;
|
|
@@ -4439,7 +4565,7 @@ function onItalicClick($this) {
|
|
|
4439
4565
|
}
|
|
4440
4566
|
}
|
|
4441
4567
|
function onStrikeClick($this) {
|
|
4442
|
-
if ($this.
|
|
4568
|
+
if ($this.cn_1.dl()) {
|
|
4443
4569
|
var tmp0_safe_receiver = $this.markdownDocument;
|
|
4444
4570
|
if (tmp0_safe_receiver == null)
|
|
4445
4571
|
null;
|
|
@@ -4762,11 +4888,11 @@ function ToolbarButton$lambda($this$element) {
|
|
|
4762
4888
|
}
|
|
4763
4889
|
function showDropdown($this, event) {
|
|
4764
4890
|
event.stopPropagation();
|
|
4765
|
-
var tmp = $this.
|
|
4891
|
+
var tmp = $this.kn_1;
|
|
4766
4892
|
(tmp instanceof HTMLElement ? tmp : THROW_CCE()).style.display = 'block';
|
|
4767
4893
|
}
|
|
4768
4894
|
function hideDropdown($this) {
|
|
4769
|
-
var tmp = $this.
|
|
4895
|
+
var tmp = $this.kn_1;
|
|
4770
4896
|
(tmp instanceof HTMLElement ? tmp : THROW_CCE()).style.display = 'none';
|
|
4771
4897
|
}
|
|
4772
4898
|
function ToolbarDropdown$hideOnOutsideMouseDown$lambda(this$0) {
|
|
@@ -4806,9 +4932,9 @@ function svgFor($this, icon) {
|
|
|
4806
4932
|
case 'break':
|
|
4807
4933
|
return '<svg viewBox="0 0 24 24" fill="currentColor" stroke="none">\n <rect x="3" y="11" width="18" height="2.5"/>\n <\/svg>';
|
|
4808
4934
|
case 'insert-photo':
|
|
4809
|
-
return '<svg viewBox="0
|
|
4935
|
+
return '<svg viewBox="0 -960 960 960" fill="currentColor" stroke="none">\n <path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"/>\n <\/svg>';
|
|
4810
4936
|
case 'insert-link':
|
|
4811
|
-
return '<svg viewBox="0
|
|
4937
|
+
return '<svg viewBox="0 -960 960 960" fill="currentColor" stroke="none">\n <path d="M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"/>\n <\/svg>';
|
|
4812
4938
|
case 'code-block':
|
|
4813
4939
|
return '<svg viewBox="0 0 24 24" fill="currentColor" stroke="none">\n <text x="12" y="17" text-anchor="middle" font-size="12" font-family="monospace"></><\/text>\n <\/svg>';
|
|
4814
4940
|
case 'quote':
|
|
@@ -4825,26 +4951,6 @@ function Heading$renderHeading$lambda($this$element) {
|
|
|
4825
4951
|
slot($this$element);
|
|
4826
4952
|
return Unit_instance;
|
|
4827
4953
|
}
|
|
4828
|
-
function ListItem$getMarkdownWithTextForElement$lambda(child) {
|
|
4829
|
-
var tmp0_safe_receiver = asMarkdownElement(child);
|
|
4830
|
-
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.getMarkdown();
|
|
4831
|
-
var tmp;
|
|
4832
|
-
if (tmp1_elvis_lhs == null) {
|
|
4833
|
-
var tmp2_safe_receiver = child.textContent;
|
|
4834
|
-
var tmp_0;
|
|
4835
|
-
if (tmp2_safe_receiver == null) {
|
|
4836
|
-
tmp_0 = null;
|
|
4837
|
-
} else {
|
|
4838
|
-
// Inline function 'kotlin.text.trim' call
|
|
4839
|
-
tmp_0 = toString_0(trim(isCharSequence(tmp2_safe_receiver) ? tmp2_safe_receiver : THROW_CCE()));
|
|
4840
|
-
}
|
|
4841
|
-
var tmp3_elvis_lhs = tmp_0;
|
|
4842
|
-
tmp = (tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs) + '\n';
|
|
4843
|
-
} else {
|
|
4844
|
-
tmp = tmp1_elvis_lhs;
|
|
4845
|
-
}
|
|
4846
|
-
return tmp;
|
|
4847
|
-
}
|
|
4848
4954
|
function MarkdownComponent$getMarkdown$lambda(child) {
|
|
4849
4955
|
var tmp0_safe_receiver = asMarkdownElement(child);
|
|
4850
4956
|
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.getMarkdown();
|
|
@@ -5059,23 +5165,23 @@ function MarkdownImage$upload$lambda(this$0, $reader) {
|
|
|
5059
5165
|
};
|
|
5060
5166
|
}
|
|
5061
5167
|
function updateLinkTarget($this) {
|
|
5062
|
-
$this.
|
|
5063
|
-
$this.
|
|
5064
|
-
$this.
|
|
5065
|
-
$this.
|
|
5168
|
+
$this.xm_1.href = $this.oo();
|
|
5169
|
+
$this.xm_1.title = $this.title;
|
|
5170
|
+
$this.xm_1.target = startsWith($this.oo(), '#') ? '_self' : '_blank';
|
|
5171
|
+
$this.xm_1.onclick = MarkdownLink$updateLinkTarget$lambda($this);
|
|
5066
5172
|
}
|
|
5067
5173
|
function onDestinationInput($this) {
|
|
5068
|
-
$this.
|
|
5174
|
+
$this.am($this.ym_1.value);
|
|
5069
5175
|
updateLinkTarget($this);
|
|
5070
5176
|
}
|
|
5071
5177
|
function hideDestinationInput($this) {
|
|
5072
5178
|
$this.classList.remove('fresh');
|
|
5073
|
-
$this.
|
|
5179
|
+
$this.ym_1.classList.remove('visible');
|
|
5074
5180
|
}
|
|
5075
5181
|
function showDestinationInput($this) {
|
|
5076
|
-
$this.
|
|
5077
|
-
$this.
|
|
5078
|
-
$this.
|
|
5182
|
+
$this.ym_1.classList.add('visible');
|
|
5183
|
+
$this.ym_1.focus();
|
|
5184
|
+
$this.ym_1.setSelectionRange($this.ym_1.value.length, $this.ym_1.value.length);
|
|
5079
5185
|
}
|
|
5080
5186
|
function onDestinationKey($this, event) {
|
|
5081
5187
|
if (event.key === 'Enter') {
|
|
@@ -5135,7 +5241,7 @@ function MarkdownLink$connectedCallback$lambda(this$0) {
|
|
|
5135
5241
|
function MarkdownLink$updateLinkTarget$lambda(this$0) {
|
|
5136
5242
|
return (event) => {
|
|
5137
5243
|
// Inline function 'org.w3c.dom.CustomEventInit' call
|
|
5138
|
-
var detail = this$0.
|
|
5244
|
+
var detail = this$0.oo();
|
|
5139
5245
|
var o = {};
|
|
5140
5246
|
o['detail'] = detail;
|
|
5141
5247
|
o['bubbles'] = true;
|
|
@@ -5172,30 +5278,10 @@ function MarkdownParagraph$getMarkdown$lambda(child) {
|
|
|
5172
5278
|
tmp_0 = null;
|
|
5173
5279
|
} else {
|
|
5174
5280
|
// Inline function 'kotlin.text.replace' call
|
|
5175
|
-
tmp_0 = Regex.
|
|
5176
|
-
}
|
|
5177
|
-
var tmp1_safe_receiver = tmp_0;
|
|
5178
|
-
var tmp_1;
|
|
5179
|
-
if (tmp1_safe_receiver == null) {
|
|
5180
|
-
tmp_1 = null;
|
|
5181
|
-
} else {
|
|
5182
|
-
// Inline function 'kotlin.text.isEmpty' call
|
|
5183
|
-
tmp_1 = charSequenceLength(tmp1_safe_receiver) === 0;
|
|
5184
|
-
}
|
|
5185
|
-
if (tmp_1 === true) {
|
|
5186
|
-
tmp = '';
|
|
5187
|
-
} else {
|
|
5188
|
-
var tmp2_safe_receiver = child.textContent;
|
|
5189
|
-
var tmp_2;
|
|
5190
|
-
if (tmp2_safe_receiver == null) {
|
|
5191
|
-
tmp_2 = null;
|
|
5192
|
-
} else {
|
|
5193
|
-
// Inline function 'kotlin.text.replace' call
|
|
5194
|
-
tmp_2 = Regex.j8('^\\s+', RegexOption_MULTILINE_getInstance()).o8(tmp2_safe_receiver, ' ');
|
|
5195
|
-
}
|
|
5196
|
-
var tmp3_elvis_lhs = tmp_2;
|
|
5197
|
-
tmp = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs;
|
|
5281
|
+
tmp_0 = Regex.j8('^\\s+', RegexOption_MULTILINE_getInstance()).o8(tmp0_safe_receiver, ' ');
|
|
5198
5282
|
}
|
|
5283
|
+
var tmp1_elvis_lhs = tmp_0;
|
|
5284
|
+
tmp = tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
|
|
5199
5285
|
}
|
|
5200
5286
|
return tmp;
|
|
5201
5287
|
}
|
|
@@ -5243,7 +5329,7 @@ function MarkdownTaskListItem$lambda_0($this$element) {
|
|
|
5243
5329
|
}
|
|
5244
5330
|
function MarkdownTaskListItem$lambda_1(this$0) {
|
|
5245
5331
|
return (it) => {
|
|
5246
|
-
this$0.setAttribute('checked', this$0.
|
|
5332
|
+
this$0.setAttribute('checked', this$0.wo_1.checked.toString());
|
|
5247
5333
|
return Unit_instance;
|
|
5248
5334
|
};
|
|
5249
5335
|
}
|
|
@@ -5359,7 +5445,7 @@ function parseMarkdown$lambda($renderer) {
|
|
|
5359
5445
|
function parseMarkdown$lambda_0($renderer) {
|
|
5360
5446
|
return (execArr) => {
|
|
5361
5447
|
var groups = ensureNotNull(execArr);
|
|
5362
|
-
return $renderer.
|
|
5448
|
+
return $renderer.cp_1.custom(ensureNotNull(groups[1]), parseMarkdownWithTsStackRenderer(ensureNotNull(groups[2]), $renderer));
|
|
5363
5449
|
};
|
|
5364
5450
|
}
|
|
5365
5451
|
var properties_initialized_TsStackMarkdownRenderer_kt_6onrsl;
|