@nectary/components 5.31.2 → 5.31.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.js +11 -7
- package/package.json +1 -1
- package/rich-textarea/utils.js +1 -6
- package/tooltip/index.js +9 -0
- package/utils/markdown.js +1 -1
package/bundle.js
CHANGED
|
@@ -1418,7 +1418,7 @@ class RichTextareaChip extends NectaryElement {
|
|
|
1418
1418
|
};
|
|
1419
1419
|
}
|
|
1420
1420
|
defineCustomElement("sinch-rich-textarea-chip", RichTextareaChip);
|
|
1421
|
-
const regLinebreak = /(?:<br>\n|<br
|
|
1421
|
+
const regLinebreak = /(?:<br>\n|<br>| {2,}\n|\n)/;
|
|
1422
1422
|
const regParagraph = /\n{2,}/;
|
|
1423
1423
|
const regEm3Star = new RegExp("(?<!\\\\)\\*\\*\\*(?<em3>.+?)(?<!\\\\)\\*\\*\\*");
|
|
1424
1424
|
const regEm2Star = new RegExp("(?<!\\\\)\\*\\*(?<em2>.+?)(?<!\\\\)\\*\\*");
|
|
@@ -4059,6 +4059,7 @@ class Tooltip extends NectaryElement {
|
|
|
4059
4059
|
this.#schedulePlacement();
|
|
4060
4060
|
});
|
|
4061
4061
|
this.#resizeObserver.observe(this.#$content);
|
|
4062
|
+
window.addEventListener("resize", this.#onWindowResize, options);
|
|
4062
4063
|
updateAttribute(this.#$pop, "orientation", getPopOrientation$1(this.orientation));
|
|
4063
4064
|
updateBooleanAttribute(this.#$pop, "hide-outside-viewport", !this.showOutsideViewport);
|
|
4064
4065
|
updateBooleanAttribute(this.#$pop, "disable-focus-restore", true);
|
|
@@ -4524,6 +4525,14 @@ class Tooltip extends NectaryElement {
|
|
|
4524
4525
|
this.#$pop.style.removeProperty("--sinch-pop-offset-x");
|
|
4525
4526
|
this.#$pop.style.removeProperty("--sinch-pop-offset-y");
|
|
4526
4527
|
}
|
|
4528
|
+
#onWindowResize = () => {
|
|
4529
|
+
if (!this.#isOpen()) {
|
|
4530
|
+
return;
|
|
4531
|
+
}
|
|
4532
|
+
requestAnimationFrame(() => {
|
|
4533
|
+
this.#schedulePlacement();
|
|
4534
|
+
});
|
|
4535
|
+
};
|
|
4527
4536
|
#schedulePlacement(resetZeroDimensionRetries = true) {
|
|
4528
4537
|
if (!this.#isOpen() || this.#placementScheduled) {
|
|
4529
4538
|
return;
|
|
@@ -11357,7 +11366,6 @@ const MD_EM1_STAR_TOKEN = "*";
|
|
|
11357
11366
|
const MD_EM3_UNDERSCORE_TOKEN = "___";
|
|
11358
11367
|
const MD_EM2_UNDERSCORE_TOKEN = "__";
|
|
11359
11368
|
const MD_EM1_UNDERSCORE_TOKEN = "_";
|
|
11360
|
-
const MD_LINEBREAK_TOKEN = " \n";
|
|
11361
11369
|
const MD_CODETAG_TOKEN = "`";
|
|
11362
11370
|
const MD_ULISTITEM_TOKEN = "*";
|
|
11363
11371
|
const MD_OLISTITEM_TOKEN = "1.";
|
|
@@ -11484,11 +11492,7 @@ const serializeRoot = ($root, range) => {
|
|
|
11484
11492
|
};
|
|
11485
11493
|
const flushParagraphChunks = () => {
|
|
11486
11494
|
if (paragraphChunks.length > 0) {
|
|
11487
|
-
chunks.push(
|
|
11488
|
-
paragraphChunks.reduce((a, b) => {
|
|
11489
|
-
return b.length > 0 ? a.concat(MD_LINEBREAK_TOKEN, b) : a.concat("<br>");
|
|
11490
|
-
})
|
|
11491
|
-
);
|
|
11495
|
+
chunks.push(...paragraphChunks);
|
|
11492
11496
|
paragraphChunks.length = 0;
|
|
11493
11497
|
}
|
|
11494
11498
|
};
|
package/package.json
CHANGED
package/rich-textarea/utils.js
CHANGED
|
@@ -1571,7 +1571,6 @@ const MD_EM1_STAR_TOKEN = "*";
|
|
|
1571
1571
|
const MD_EM3_UNDERSCORE_TOKEN = "___";
|
|
1572
1572
|
const MD_EM2_UNDERSCORE_TOKEN = "__";
|
|
1573
1573
|
const MD_EM1_UNDERSCORE_TOKEN = "_";
|
|
1574
|
-
const MD_LINEBREAK_TOKEN = " \n";
|
|
1575
1574
|
const MD_CODETAG_TOKEN = "`";
|
|
1576
1575
|
const MD_ULISTITEM_TOKEN = "*";
|
|
1577
1576
|
const MD_OLISTITEM_TOKEN = "1.";
|
|
@@ -1698,11 +1697,7 @@ const serializeRoot = ($root, range) => {
|
|
|
1698
1697
|
};
|
|
1699
1698
|
const flushParagraphChunks = () => {
|
|
1700
1699
|
if (paragraphChunks.length > 0) {
|
|
1701
|
-
chunks.push(
|
|
1702
|
-
paragraphChunks.reduce((a, b) => {
|
|
1703
|
-
return b.length > 0 ? a.concat(MD_LINEBREAK_TOKEN, b) : a.concat("<br>");
|
|
1704
|
-
})
|
|
1705
|
-
);
|
|
1700
|
+
chunks.push(...paragraphChunks);
|
|
1706
1701
|
paragraphChunks.length = 0;
|
|
1707
1702
|
}
|
|
1708
1703
|
};
|
package/tooltip/index.js
CHANGED
|
@@ -83,6 +83,7 @@ class Tooltip extends NectaryElement {
|
|
|
83
83
|
this.#schedulePlacement();
|
|
84
84
|
});
|
|
85
85
|
this.#resizeObserver.observe(this.#$content);
|
|
86
|
+
window.addEventListener("resize", this.#onWindowResize, options);
|
|
86
87
|
updateAttribute(this.#$pop, "orientation", getPopOrientation(this.orientation));
|
|
87
88
|
updateBooleanAttribute(this.#$pop, "hide-outside-viewport", !this.showOutsideViewport);
|
|
88
89
|
updateBooleanAttribute(this.#$pop, "disable-focus-restore", true);
|
|
@@ -548,6 +549,14 @@ class Tooltip extends NectaryElement {
|
|
|
548
549
|
this.#$pop.style.removeProperty("--sinch-pop-offset-x");
|
|
549
550
|
this.#$pop.style.removeProperty("--sinch-pop-offset-y");
|
|
550
551
|
}
|
|
552
|
+
#onWindowResize = () => {
|
|
553
|
+
if (!this.#isOpen()) {
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
requestAnimationFrame(() => {
|
|
557
|
+
this.#schedulePlacement();
|
|
558
|
+
});
|
|
559
|
+
};
|
|
551
560
|
#schedulePlacement(resetZeroDimensionRetries = true) {
|
|
552
561
|
if (!this.#isOpen() || this.#placementScheduled) {
|
|
553
562
|
return;
|
package/utils/markdown.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const regLinebreak = /(?:<br>\n|<br
|
|
1
|
+
const regLinebreak = /(?:<br>\n|<br>| {2,}\n|\n)/;
|
|
2
2
|
const regParagraph = /\n{2,}/;
|
|
3
3
|
const regEm3Star = new RegExp("(?<!\\\\)\\*\\*\\*(?<em3>.+?)(?<!\\\\)\\*\\*\\*");
|
|
4
4
|
const regEm2Star = new RegExp("(?<!\\\\)\\*\\*(?<em2>.+?)(?<!\\\\)\\*\\*");
|