markdown-komponents 0.3.1 → 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 +103 -3
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/markdown-komponents.mjs +63 -56
- package/markdown-komponents.mjs.map +1 -1
- package/package.json +1 -1
package/index.html
CHANGED
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
<markdown-paragraph>Start typing here.</markdown-paragraph>
|
|
16
16
|
</markdown-document>
|
|
17
17
|
|
|
18
|
+
<h2>Markdown output (doc.getMarkdown())</h2>
|
|
19
|
+
<pre id="markdown-output" style="border: solid 1px gray; padding: 16px; white-space: pre-wrap;"></pre>
|
|
20
|
+
|
|
18
21
|
<script src="markdown-komponents.js"></script>
|
|
19
22
|
<script>
|
|
20
23
|
var doc = document.querySelector('markdown-document');
|
|
@@ -23,6 +26,13 @@
|
|
|
23
26
|
doc.autoNormalize = !doc.autoNormalize;
|
|
24
27
|
toggle.textContent = 'Auto-normalize: ' + (doc.autoNormalize ? 'ON' : 'OFF');
|
|
25
28
|
});
|
|
29
|
+
|
|
30
|
+
var output = document.getElementById('markdown-output');
|
|
31
|
+
function refreshMarkdownOutput() {
|
|
32
|
+
output.textContent = doc.getMarkdown();
|
|
33
|
+
}
|
|
34
|
+
doc.addEventListener('change', refreshMarkdownOutput);
|
|
35
|
+
refreshMarkdownOutput();
|
|
26
36
|
</script>
|
|
27
37
|
</body>
|
|
28
38
|
</html>
|
package/kotlin-kotlin-stdlib.mjs
CHANGED
|
@@ -48,6 +48,17 @@ if (typeof Math.clz32 === 'undefined') {
|
|
|
48
48
|
};
|
|
49
49
|
}(Math.log, Math.LN2);
|
|
50
50
|
}
|
|
51
|
+
if (typeof String.prototype.endsWith === 'undefined') {
|
|
52
|
+
Object.defineProperty(String.prototype, 'endsWith', {value: function (searchString, position) {
|
|
53
|
+
var subjectString = this.toString();
|
|
54
|
+
if (position === undefined || position > subjectString.length) {
|
|
55
|
+
position = subjectString.length;
|
|
56
|
+
}
|
|
57
|
+
position -= searchString.length;
|
|
58
|
+
var lastIndex = subjectString.indexOf(searchString, position);
|
|
59
|
+
return lastIndex !== -1 && lastIndex === position;
|
|
60
|
+
}});
|
|
61
|
+
}
|
|
51
62
|
if (typeof String.prototype.startsWith === 'undefined') {
|
|
52
63
|
Object.defineProperty(String.prototype, 'startsWith', {value: function (searchString, position) {
|
|
53
64
|
position = position || 0;
|
|
@@ -2290,6 +2301,15 @@ function slice(_this__u8e3s4, indices) {
|
|
|
2290
2301
|
return '';
|
|
2291
2302
|
return substring_2(_this__u8e3s4, indices);
|
|
2292
2303
|
}
|
|
2304
|
+
function takeLast(_this__u8e3s4, n) {
|
|
2305
|
+
// Inline function 'kotlin.require' call
|
|
2306
|
+
if (!(n >= 0)) {
|
|
2307
|
+
var message = 'Requested character count ' + n + ' is less than zero.';
|
|
2308
|
+
throw IllegalArgumentException.k(toString_1(message));
|
|
2309
|
+
}
|
|
2310
|
+
var length = _this__u8e3s4.length;
|
|
2311
|
+
return substring_0(_this__u8e3s4, length - coerceAtMost(n, length) | 0);
|
|
2312
|
+
}
|
|
2293
2313
|
function drop_0(_this__u8e3s4, n) {
|
|
2294
2314
|
// Inline function 'kotlin.require' call
|
|
2295
2315
|
if (!(n >= 0)) {
|
|
@@ -4101,6 +4121,15 @@ function regionMatches(_this__u8e3s4, thisOffset, other, otherOffset, length, ig
|
|
|
4101
4121
|
ignoreCase = ignoreCase === VOID ? false : ignoreCase;
|
|
4102
4122
|
return regionMatchesImpl(_this__u8e3s4, thisOffset, other, otherOffset, length, ignoreCase);
|
|
4103
4123
|
}
|
|
4124
|
+
function endsWith(_this__u8e3s4, suffix, ignoreCase) {
|
|
4125
|
+
ignoreCase = ignoreCase === VOID ? false : ignoreCase;
|
|
4126
|
+
if (!ignoreCase) {
|
|
4127
|
+
// Inline function 'kotlin.text.nativeEndsWith' call
|
|
4128
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
4129
|
+
return _this__u8e3s4.endsWith(suffix);
|
|
4130
|
+
} else
|
|
4131
|
+
return regionMatches(_this__u8e3s4, _this__u8e3s4.length - suffix.length | 0, suffix, 0, suffix.length, ignoreCase);
|
|
4132
|
+
}
|
|
4104
4133
|
function AbstractCollection$toString$lambda(this$0) {
|
|
4105
4134
|
return (it) => it === this$0 ? '(this Collection)' : toString_0(it);
|
|
4106
4135
|
}
|
|
@@ -4542,6 +4571,12 @@ function indexOf_1(_this__u8e3s4, string, startIndex, ignoreCase) {
|
|
|
4542
4571
|
}
|
|
4543
4572
|
return tmp;
|
|
4544
4573
|
}
|
|
4574
|
+
function removeSuffix(_this__u8e3s4, suffix) {
|
|
4575
|
+
if (endsWith_0(_this__u8e3s4, suffix)) {
|
|
4576
|
+
return substring(_this__u8e3s4, 0, _this__u8e3s4.length - charSequenceLength(suffix) | 0);
|
|
4577
|
+
}
|
|
4578
|
+
return _this__u8e3s4;
|
|
4579
|
+
}
|
|
4545
4580
|
function removePrefix(_this__u8e3s4, prefix) {
|
|
4546
4581
|
if (startsWith_0(_this__u8e3s4, prefix)) {
|
|
4547
4582
|
return substring_0(_this__u8e3s4, charSequenceLength(prefix));
|
|
@@ -4722,6 +4757,47 @@ function indexOfAny(_this__u8e3s4, chars, startIndex, ignoreCase) {
|
|
|
4722
4757
|
while (!(index === last));
|
|
4723
4758
|
return -1;
|
|
4724
4759
|
}
|
|
4760
|
+
function trimStart(_this__u8e3s4) {
|
|
4761
|
+
var tmp$ret$0;
|
|
4762
|
+
$l$block: {
|
|
4763
|
+
// Inline function 'kotlin.text.trimStart' call
|
|
4764
|
+
var inductionVariable = 0;
|
|
4765
|
+
var last = charSequenceLength(_this__u8e3s4) - 1 | 0;
|
|
4766
|
+
if (inductionVariable <= last)
|
|
4767
|
+
do {
|
|
4768
|
+
var index = inductionVariable;
|
|
4769
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
4770
|
+
var p0 = charSequenceGet(_this__u8e3s4, index);
|
|
4771
|
+
if (!isWhitespace(p0)) {
|
|
4772
|
+
tmp$ret$0 = charSequenceSubSequence(_this__u8e3s4, index, charSequenceLength(_this__u8e3s4));
|
|
4773
|
+
break $l$block;
|
|
4774
|
+
}
|
|
4775
|
+
}
|
|
4776
|
+
while (inductionVariable <= last);
|
|
4777
|
+
tmp$ret$0 = '';
|
|
4778
|
+
}
|
|
4779
|
+
return tmp$ret$0;
|
|
4780
|
+
}
|
|
4781
|
+
function trimEnd(_this__u8e3s4) {
|
|
4782
|
+
var tmp$ret$0;
|
|
4783
|
+
$l$block: {
|
|
4784
|
+
// Inline function 'kotlin.text.trimEnd' call
|
|
4785
|
+
var inductionVariable = charSequenceLength(_this__u8e3s4) - 1 | 0;
|
|
4786
|
+
if (0 <= inductionVariable)
|
|
4787
|
+
do {
|
|
4788
|
+
var index = inductionVariable;
|
|
4789
|
+
inductionVariable = inductionVariable + -1 | 0;
|
|
4790
|
+
var p0 = charSequenceGet(_this__u8e3s4, index);
|
|
4791
|
+
if (!isWhitespace(p0)) {
|
|
4792
|
+
tmp$ret$0 = charSequenceSubSequence(_this__u8e3s4, 0, index + 1 | 0);
|
|
4793
|
+
break $l$block;
|
|
4794
|
+
}
|
|
4795
|
+
}
|
|
4796
|
+
while (0 <= inductionVariable);
|
|
4797
|
+
tmp$ret$0 = '';
|
|
4798
|
+
}
|
|
4799
|
+
return tmp$ret$0;
|
|
4800
|
+
}
|
|
4725
4801
|
function indexOf_2(_this__u8e3s4, other, startIndex, endIndex, ignoreCase, last) {
|
|
4726
4802
|
last = last === VOID ? false : last;
|
|
4727
4803
|
var indices = !last ? numberRangeToNumber(coerceAtLeast(startIndex, 0), coerceAtMost(endIndex, charSequenceLength(_this__u8e3s4))) : downTo(coerceAtMost(startIndex, get_lastIndex_0(_this__u8e3s4)), coerceAtLeast(endIndex, 0));
|
|
@@ -4758,6 +4834,26 @@ function indexOf_2(_this__u8e3s4, other, startIndex, endIndex, ignoreCase, last)
|
|
|
4758
4834
|
}
|
|
4759
4835
|
return -1;
|
|
4760
4836
|
}
|
|
4837
|
+
function endsWith_0(_this__u8e3s4, suffix, ignoreCase) {
|
|
4838
|
+
ignoreCase = ignoreCase === VOID ? false : ignoreCase;
|
|
4839
|
+
var tmp;
|
|
4840
|
+
var tmp_0;
|
|
4841
|
+
if (!ignoreCase) {
|
|
4842
|
+
tmp_0 = typeof _this__u8e3s4 === 'string';
|
|
4843
|
+
} else {
|
|
4844
|
+
tmp_0 = false;
|
|
4845
|
+
}
|
|
4846
|
+
if (tmp_0) {
|
|
4847
|
+
tmp = typeof suffix === 'string';
|
|
4848
|
+
} else {
|
|
4849
|
+
tmp = false;
|
|
4850
|
+
}
|
|
4851
|
+
if (tmp)
|
|
4852
|
+
return endsWith(_this__u8e3s4, suffix);
|
|
4853
|
+
else {
|
|
4854
|
+
return regionMatchesImpl(_this__u8e3s4, charSequenceLength(_this__u8e3s4) - charSequenceLength(suffix) | 0, suffix, 0, charSequenceLength(suffix), ignoreCase);
|
|
4855
|
+
}
|
|
4856
|
+
}
|
|
4761
4857
|
function startsWith_0(_this__u8e3s4, prefix, ignoreCase) {
|
|
4762
4858
|
ignoreCase = ignoreCase === VOID ? false : ignoreCase;
|
|
4763
4859
|
var tmp;
|
|
@@ -4978,10 +5074,10 @@ initMetadataForClass(ListIteratorImpl, 'ListIteratorImpl');
|
|
|
4978
5074
|
initMetadataForClass(AbstractMutableList, 'AbstractMutableList', VOID, VOID, [Collection, KtList]);
|
|
4979
5075
|
initMetadataForInterface(RandomAccess, 'RandomAccess');
|
|
4980
5076
|
initMetadataForClass(SubList, 'SubList', VOID, VOID, [RandomAccess]);
|
|
4981
|
-
initMetadataForClass(AbstractMutableSet, 'AbstractMutableSet', VOID, VOID, [
|
|
5077
|
+
initMetadataForClass(AbstractMutableSet, 'AbstractMutableSet', VOID, VOID, [KtSet, Collection]);
|
|
4982
5078
|
initMetadataForCompanion(Companion_1);
|
|
4983
5079
|
initMetadataForClass(ArrayList, 'ArrayList', ArrayList.x, VOID, [Collection, KtList, RandomAccess]);
|
|
4984
|
-
initMetadataForClass(HashSet, 'HashSet', HashSet.m4, VOID, [
|
|
5080
|
+
initMetadataForClass(HashSet, 'HashSet', HashSet.m4, VOID, [KtSet, Collection]);
|
|
4985
5081
|
initMetadataForCompanion(Companion_2);
|
|
4986
5082
|
initMetadataForClass(Itr, 'Itr');
|
|
4987
5083
|
initMetadataForClass(KeysItr, 'KeysItr');
|
|
@@ -4990,7 +5086,7 @@ initMetadataForClass(EntryRef, 'EntryRef', VOID, VOID, [Entry]);
|
|
|
4990
5086
|
initMetadataForInterface(InternalMap, 'InternalMap');
|
|
4991
5087
|
protoOf(InternalHashMap).q5 = containsAllEntries;
|
|
4992
5088
|
initMetadataForClass(InternalHashMap, 'InternalHashMap', InternalHashMap.x4, VOID, [InternalMap]);
|
|
4993
|
-
initMetadataForClass(LinkedHashSet, 'LinkedHashSet', LinkedHashSet.c1, VOID, [
|
|
5089
|
+
initMetadataForClass(LinkedHashSet, 'LinkedHashSet', LinkedHashSet.c1, VOID, [KtSet, Collection]);
|
|
4994
5090
|
initMetadataForClass(Exception, 'Exception', Exception.c7);
|
|
4995
5091
|
initMetadataForClass(RuntimeException, 'RuntimeException', RuntimeException.w6);
|
|
4996
5092
|
initMetadataForClass(UnsupportedOperationException, 'UnsupportedOperationException', UnsupportedOperationException.j4);
|
|
@@ -5088,6 +5184,7 @@ export {
|
|
|
5088
5184
|
indexOf_0 as indexOf1xbs558u7wr52,
|
|
5089
5185
|
lastIndexOf as lastIndexOfpmd3ei5son2n,
|
|
5090
5186
|
removePrefix as removePrefix279df90bhrqqg,
|
|
5187
|
+
removeSuffix as removeSuffix3d61x5lsuvuho,
|
|
5091
5188
|
repeat as repeat2w4c6j8zoq09o,
|
|
5092
5189
|
replace as replace3le3ie7l9k8aq,
|
|
5093
5190
|
slice as slice18he6c86ndeu7,
|
|
@@ -5095,8 +5192,11 @@ export {
|
|
|
5095
5192
|
startsWith as startsWith26w8qjqapeeq6,
|
|
5096
5193
|
substring_0 as substring3saq8ornu0luv,
|
|
5097
5194
|
substring as substringiqarkczpya5m,
|
|
5195
|
+
takeLast as takeLast2r8kr8e6g6hi7,
|
|
5098
5196
|
take as take9j4462mea726,
|
|
5197
|
+
trimEnd as trimEnd17pt8cbotbalj,
|
|
5099
5198
|
trimIndent as trimIndent1qytc1wvt8suh,
|
|
5199
|
+
trimStart as trimStart5ewg8zf6cs5u,
|
|
5100
5200
|
trim as trim11nh7r46at6sx,
|
|
5101
5201
|
THROW_CCE as THROW_CCE2g6jy02ryeudk,
|
|
5102
5202
|
ensureNotNull as ensureNotNull1e947j3ixpazm,
|