@domternal/vanilla 1.0.3 → 1.1.1

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 CHANGED
@@ -22,9 +22,12 @@ 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.0.0 <2.0.0) is a peer dependency. `@domternal/theme` supplies the editor
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
+ This package is part of the coordinated Domternal 1.1.1 release.
29
+ Upgrade installed `@domternal/*` packages together.
30
+
28
31
  ## Usage
29
32
 
30
33
  ```ts
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.label;
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.label;
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
- btn.appendChild(labelSpan);
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";