@domternal/vanilla 1.0.2 → 1.1.0
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/README.md +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/package.json +10 -12
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Lit, Web Components, or plain HTML - anywhere without a framework runtime.
|
|
|
22
22
|
pnpm add @domternal/core @domternal/theme @domternal/vanilla
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
`@domternal/core` (>=1.
|
|
25
|
+
`@domternal/core` (>=1.1.0 <2.0.0) is a peer dependency. `@domternal/theme` supplies the editor
|
|
26
26
|
styles (import it once in your app).
|
|
27
27
|
|
|
28
28
|
## Usage
|
package/dist/index.js
CHANGED
|
@@ -698,7 +698,7 @@ var DomternalToolbar = class extends EventTarget {
|
|
|
698
698
|
btn.setAttribute("role", "menuitem");
|
|
699
699
|
btn.tabIndex = -1;
|
|
700
700
|
btn.setAttribute("aria-label", sub.label);
|
|
701
|
-
btn.title = sub
|
|
701
|
+
btn.title = getTooltip(sub);
|
|
702
702
|
btn.style.backgroundColor = sub.color;
|
|
703
703
|
btn.addEventListener("mousedown", (e) => {
|
|
704
704
|
e.preventDefault();
|
|
@@ -714,6 +714,7 @@ var DomternalToolbar = class extends EventTarget {
|
|
|
714
714
|
btn.setAttribute("role", "menuitem");
|
|
715
715
|
btn.tabIndex = -1;
|
|
716
716
|
btn.setAttribute("aria-label", sub.label);
|
|
717
|
+
btn.title = getTooltip(sub);
|
|
717
718
|
btn.innerHTML = this.#iconCache.getItemContent(sub.icon, sub.label);
|
|
718
719
|
btn.addEventListener("mousedown", (e) => {
|
|
719
720
|
e.preventDefault();
|
|
@@ -738,7 +739,7 @@ var DomternalToolbar = class extends EventTarget {
|
|
|
738
739
|
btn.setAttribute("role", "menuitem");
|
|
739
740
|
btn.tabIndex = -1;
|
|
740
741
|
btn.setAttribute("aria-label", sub.label);
|
|
741
|
-
btn.title = sub
|
|
742
|
+
btn.title = getTooltip(sub);
|
|
742
743
|
btn.innerHTML = this.#iconCache.getItemContent(sub.icon, sub.label, dd.displayMode);
|
|
743
744
|
if (sub.style) btn.setAttribute("style", sub.style);
|
|
744
745
|
btn.addEventListener("mousedown", (e) => {
|
|
@@ -1746,7 +1747,18 @@ var DomternalFloatingMenu = class extends EventTarget {
|
|
|
1746
1747
|
const labelSpan = document.createElement("span");
|
|
1747
1748
|
labelSpan.className = "dm-floating-menu-item-label";
|
|
1748
1749
|
labelSpan.textContent = item.label;
|
|
1749
|
-
|
|
1750
|
+
if (item.description) {
|
|
1751
|
+
const textSpan = document.createElement("span");
|
|
1752
|
+
textSpan.className = "dm-floating-menu-item-text";
|
|
1753
|
+
textSpan.appendChild(labelSpan);
|
|
1754
|
+
const descriptionSpan = document.createElement("span");
|
|
1755
|
+
descriptionSpan.className = "dm-floating-menu-item-description";
|
|
1756
|
+
descriptionSpan.textContent = item.description;
|
|
1757
|
+
textSpan.appendChild(descriptionSpan);
|
|
1758
|
+
btn.appendChild(textSpan);
|
|
1759
|
+
} else {
|
|
1760
|
+
btn.appendChild(labelSpan);
|
|
1761
|
+
}
|
|
1750
1762
|
if (item.shortcut) {
|
|
1751
1763
|
const shortcutSpan = document.createElement("span");
|
|
1752
1764
|
shortcutSpan.className = "dm-floating-menu-item-shortcut";
|