@subiz/widget-v4 4.1.1 → 4.1.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/compiled_src/chatbox/ChatButton.js +25 -0
- package/compiled_src/lib.js +18 -3
- package/compiled_src/store/api.js +116 -108
- package/compiled_src/store/api_fake.js +4 -5
- package/compiled_src/store/store.js +51 -36
- package/compiled_src/util/common.js +1 -1
- package/dist/132.js +30 -1
- package/dist/185588facf6.132.js +1 -0
- package/dist/{184d8eee275.178.js → 185588facf6.178.js} +0 -0
- package/dist/{184d8eee275.213.js → 185588facf6.213.js} +0 -0
- package/dist/{184d8eee275.335.js → 185588facf6.335.js} +0 -0
- package/dist/{184d8eee275.362.js → 185588facf6.362.js} +0 -0
- package/dist/185588facf6.441.js +1 -0
- package/dist/{184d8eee275.605.js → 185588facf6.605.js} +0 -0
- package/dist/{184d8eee275.678.js → 185588facf6.678.js} +0 -0
- package/dist/{184d8eee275.782.js → 185588facf6.782.js} +0 -0
- package/dist/185588facf6.app.js +1 -0
- package/dist/{184d8eee275.index.html → 185588facf6.index.html} +1 -1
- package/dist/{184d8eee275.library.html → 185588facf6.library.html} +1 -1
- package/dist/185588facf6.library.js +1 -0
- package/dist/{184d8eee275.preview.html → 185588facf6.preview.html} +1 -1
- package/dist/185588facf6.preview.js +1 -0
- package/dist/185588facf6.screenshoot.js +1 -0
- package/dist/185588facf6.webview.js +1 -0
- package/dist/441.js +51 -36
- package/dist/HASH +1 -1
- package/dist/screenshoot.html +1 -1
- package/dist/screenshoot.js +230 -195
- package/inject.js +2 -6
- package/package.json +9 -8
- package/src/chatbox/ChatButton.js +30 -0
- package/src/lib.js +23 -3
- package/src/store/api.js +139 -114
- package/src/store/api_fake.js +1 -2
- package/src/store/store.js +54 -45
- package/src/util/common.js +1 -1
- package/webpack.dev.js +1 -0
- package/webpack.prod.js +1 -0
- package/webview.js +43 -0
- package/dist/184d8eee275.132.js +0 -1
- package/dist/184d8eee275.441.js +0 -1
- package/dist/184d8eee275.app.js +0 -1
- package/dist/184d8eee275.library.js +0 -1
- package/dist/184d8eee275.preview.js +0 -1
- package/dist/184d8eee275.screenshoot.js +0 -1
package/dist/441.js
CHANGED
|
@@ -485,11 +485,14 @@ class Tokenizer {
|
|
|
485
485
|
const cap = this.rules.block.blockquote.exec(src);
|
|
486
486
|
if (cap) {
|
|
487
487
|
const text = cap[0].replace(/^ *>[ \t]?/gm, '');
|
|
488
|
-
|
|
488
|
+
const top = this.lexer.state.top;
|
|
489
|
+
this.lexer.state.top = true;
|
|
490
|
+
const tokens = this.lexer.blockTokens(text);
|
|
491
|
+
this.lexer.state.top = top;
|
|
489
492
|
return {
|
|
490
493
|
type: 'blockquote',
|
|
491
494
|
raw: cap[0],
|
|
492
|
-
tokens
|
|
495
|
+
tokens,
|
|
493
496
|
text
|
|
494
497
|
};
|
|
495
498
|
}
|
|
@@ -536,7 +539,7 @@ class Tokenizer {
|
|
|
536
539
|
raw = cap[0];
|
|
537
540
|
src = src.substring(raw.length);
|
|
538
541
|
|
|
539
|
-
line = cap[2].split('\n', 1)[0];
|
|
542
|
+
line = cap[2].split('\n', 1)[0].replace(/^\t+/, (t) => ' '.repeat(3 * t.length));
|
|
540
543
|
nextLine = src.split('\n', 1)[0];
|
|
541
544
|
|
|
542
545
|
if (this.options.pedantic) {
|
|
@@ -558,7 +561,7 @@ class Tokenizer {
|
|
|
558
561
|
}
|
|
559
562
|
|
|
560
563
|
if (!endEarly) {
|
|
561
|
-
const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`);
|
|
564
|
+
const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`);
|
|
562
565
|
const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);
|
|
563
566
|
const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`);
|
|
564
567
|
const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);
|
|
@@ -566,25 +569,25 @@ class Tokenizer {
|
|
|
566
569
|
// Check if following lines should be included in List Item
|
|
567
570
|
while (src) {
|
|
568
571
|
rawLine = src.split('\n', 1)[0];
|
|
569
|
-
|
|
572
|
+
nextLine = rawLine;
|
|
570
573
|
|
|
571
574
|
// Re-align to follow commonmark nesting rules
|
|
572
575
|
if (this.options.pedantic) {
|
|
573
|
-
|
|
576
|
+
nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');
|
|
574
577
|
}
|
|
575
578
|
|
|
576
579
|
// End list item if found code fences
|
|
577
|
-
if (fencesBeginRegex.test(
|
|
580
|
+
if (fencesBeginRegex.test(nextLine)) {
|
|
578
581
|
break;
|
|
579
582
|
}
|
|
580
583
|
|
|
581
584
|
// End list item if found start of new heading
|
|
582
|
-
if (headingBeginRegex.test(
|
|
585
|
+
if (headingBeginRegex.test(nextLine)) {
|
|
583
586
|
break;
|
|
584
587
|
}
|
|
585
588
|
|
|
586
589
|
// End list item if found start of new bullet
|
|
587
|
-
if (nextBulletRegex.test(
|
|
590
|
+
if (nextBulletRegex.test(nextLine)) {
|
|
588
591
|
break;
|
|
589
592
|
}
|
|
590
593
|
|
|
@@ -593,20 +596,38 @@ class Tokenizer {
|
|
|
593
596
|
break;
|
|
594
597
|
}
|
|
595
598
|
|
|
596
|
-
if (
|
|
597
|
-
itemContents += '\n' +
|
|
598
|
-
} else
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
599
|
+
if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible
|
|
600
|
+
itemContents += '\n' + nextLine.slice(indent);
|
|
601
|
+
} else {
|
|
602
|
+
// not enough indentation
|
|
603
|
+
if (blankLine) {
|
|
604
|
+
break;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
// paragraph continuation unless last line was a different block level element
|
|
608
|
+
if (line.search(/[^ ]/) >= 4) { // indented code block
|
|
609
|
+
break;
|
|
610
|
+
}
|
|
611
|
+
if (fencesBeginRegex.test(line)) {
|
|
612
|
+
break;
|
|
613
|
+
}
|
|
614
|
+
if (headingBeginRegex.test(line)) {
|
|
615
|
+
break;
|
|
616
|
+
}
|
|
617
|
+
if (hrRegex.test(line)) {
|
|
618
|
+
break;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
itemContents += '\n' + nextLine;
|
|
602
622
|
}
|
|
603
623
|
|
|
604
|
-
if (!blankLine && !
|
|
624
|
+
if (!blankLine && !nextLine.trim()) { // Check if current line is blank
|
|
605
625
|
blankLine = true;
|
|
606
626
|
}
|
|
607
627
|
|
|
608
628
|
raw += rawLine + '\n';
|
|
609
629
|
src = src.substring(rawLine.length + 1);
|
|
630
|
+
line = nextLine.slice(indent);
|
|
610
631
|
}
|
|
611
632
|
}
|
|
612
633
|
|
|
@@ -651,25 +672,19 @@ class Tokenizer {
|
|
|
651
672
|
for (i = 0; i < l; i++) {
|
|
652
673
|
this.lexer.state.top = false;
|
|
653
674
|
list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);
|
|
654
|
-
const spacers = list.items[i].tokens.filter(t => t.type === 'space');
|
|
655
|
-
const hasMultipleLineBreaks = spacers.every(t => {
|
|
656
|
-
const chars = t.raw.split('');
|
|
657
|
-
let lineBreaks = 0;
|
|
658
|
-
for (const char of chars) {
|
|
659
|
-
if (char === '\n') {
|
|
660
|
-
lineBreaks += 1;
|
|
661
|
-
}
|
|
662
|
-
if (lineBreaks > 1) {
|
|
663
|
-
return true;
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
675
|
|
|
667
|
-
|
|
668
|
-
|
|
676
|
+
if (!list.loose) {
|
|
677
|
+
// Check if list should be loose
|
|
678
|
+
const spacers = list.items[i].tokens.filter(t => t.type === 'space');
|
|
679
|
+
const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\n.*\n/.test(t.raw));
|
|
669
680
|
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
681
|
+
list.loose = hasMultipleLineBreaks;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
// Set all items to loose if list is loose
|
|
686
|
+
if (list.loose) {
|
|
687
|
+
for (i = 0; i < l; i++) {
|
|
673
688
|
list.items[i].loose = true;
|
|
674
689
|
}
|
|
675
690
|
}
|
|
@@ -1075,9 +1090,9 @@ class Tokenizer {
|
|
|
1075
1090
|
} while (prevCapZero !== cap[0]);
|
|
1076
1091
|
text = escape(cap[0]);
|
|
1077
1092
|
if (cap[1] === 'www.') {
|
|
1078
|
-
href = 'http://' +
|
|
1093
|
+
href = 'http://' + cap[0];
|
|
1079
1094
|
} else {
|
|
1080
|
-
href =
|
|
1095
|
+
href = cap[0];
|
|
1081
1096
|
}
|
|
1082
1097
|
}
|
|
1083
1098
|
return {
|
|
@@ -1394,7 +1409,7 @@ inline.gfm = merge({}, inline.normal, {
|
|
|
1394
1409
|
escape: edit(inline.escape).replace('])', '~|])').getRegex(),
|
|
1395
1410
|
_extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
|
|
1396
1411
|
url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
|
|
1397
|
-
_backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,
|
|
1412
|
+
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
1398
1413
|
del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
|
|
1399
1414
|
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
|
|
1400
1415
|
});
|
package/dist/HASH
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
185588facf6
|
package/dist/screenshoot.html
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
}
|
|
5
5
|
body {
|
|
6
6
|
background: #ddd;
|
|
7
|
-
}</style></head><body><script defer="defer" src="https://vcdn.subiz-cdn.com/widget-v4/public/
|
|
7
|
+
}</style></head><body><script defer="defer" src="https://vcdn.subiz-cdn.com/widget-v4/public/185588facf6.screenshoot.js"></script></body></html>
|