@rogieking/figui3 4.4.0 → 4.4.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/components.css +5 -0
- package/dist/base.css +1 -1
- package/dist/components.css +1 -1
- package/dist/fig.css +1 -1
- package/dist/fig.js +65 -85
- package/fig.js +10 -3
- package/package.json +1 -1
package/fig.js
CHANGED
|
@@ -14727,8 +14727,6 @@ class FigMenu extends HTMLElement {
|
|
|
14727
14727
|
}
|
|
14728
14728
|
|
|
14729
14729
|
connectedCallback() {
|
|
14730
|
-
this.style.display = "contents";
|
|
14731
|
-
|
|
14732
14730
|
this.#detectTrigger();
|
|
14733
14731
|
this.#createPopup();
|
|
14734
14732
|
this.#moveItemsToPopup();
|
|
@@ -14850,12 +14848,21 @@ class FigMenu extends HTMLElement {
|
|
|
14850
14848
|
this.#observer = new MutationObserver((mutations) => {
|
|
14851
14849
|
for (const mutation of mutations) {
|
|
14852
14850
|
for (const node of mutation.addedNodes) {
|
|
14851
|
+
if (node.nodeType !== 1 || node === this.#popup) continue;
|
|
14853
14852
|
if (
|
|
14854
|
-
node.nodeType === 1 &&
|
|
14855
14853
|
(node.tagName === "FIG-MENU-ITEM" || node.tagName === "FIG-MENU-SEPARATOR") &&
|
|
14856
14854
|
node.parentElement === this
|
|
14857
14855
|
) {
|
|
14858
14856
|
this.#popup.appendChild(node);
|
|
14857
|
+
} else if (!this.#trigger && node.parentElement === this) {
|
|
14858
|
+
this.#detectTrigger();
|
|
14859
|
+
if (this.#trigger) {
|
|
14860
|
+
this.#trigger.addEventListener("click", this.#boundTriggerClick);
|
|
14861
|
+
this.#trigger.setAttribute("aria-haspopup", "menu");
|
|
14862
|
+
this.#trigger.setAttribute("aria-expanded", "false");
|
|
14863
|
+
this.#popup.anchor = this.#trigger;
|
|
14864
|
+
this.#syncDisabled();
|
|
14865
|
+
}
|
|
14859
14866
|
}
|
|
14860
14867
|
}
|
|
14861
14868
|
}
|
package/package.json
CHANGED