@rogieking/figui3 6.16.0 → 6.17.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 +4 -0
- package/components.css +45 -2
- package/dist/components.css +1 -1
- package/dist/fig-editor.css +1 -1
- package/dist/fig-lab.css +1 -1
- package/dist/fig-lab.js +86 -14
- package/dist/fig.css +1 -1
- package/dist/fig.js +22 -22
- package/fig-lab.css +273 -7
- package/fig-lab.js +951 -11
- package/fig.js +36 -1
- package/package.json +1 -1
package/fig.js
CHANGED
|
@@ -2845,10 +2845,16 @@ class FigPopup extends HTMLDialogElement {
|
|
|
2845
2845
|
if (closedby === "none" || closedby === "closerequest") return;
|
|
2846
2846
|
const target = event.target;
|
|
2847
2847
|
if (!(target instanceof Node)) return;
|
|
2848
|
+
|
|
2849
|
+
// Prefer composedPath so slotted light-DOM content (e.g. fig-select options)
|
|
2850
|
+
// counts as inside — Node.contains() is false for slotted nodes.
|
|
2851
|
+
const path =
|
|
2852
|
+
typeof event.composedPath === "function" ? event.composedPath() : [];
|
|
2853
|
+
if (path.includes(this)) return;
|
|
2848
2854
|
if (this.contains(target)) return;
|
|
2849
2855
|
|
|
2850
2856
|
const anchor = this.resolveAnchor();
|
|
2851
|
-
if (anchor
|
|
2857
|
+
if (anchor && (path.includes(anchor) || anchor.contains?.(target))) return;
|
|
2852
2858
|
|
|
2853
2859
|
if (this.isInsideDescendantPopup(target)) return;
|
|
2854
2860
|
|
|
@@ -17186,11 +17192,40 @@ class FigMenuItem extends HTMLElement {
|
|
|
17186
17192
|
}
|
|
17187
17193
|
customElements.define("fig-menu-item", FigMenuItem);
|
|
17188
17194
|
|
|
17195
|
+
/**
|
|
17196
|
+
* Visual divider between menu item groups.
|
|
17197
|
+
* @attr {string} label - Optional group label shown in secondary text under the line.
|
|
17198
|
+
*/
|
|
17189
17199
|
class FigMenuSeparator extends HTMLElement {
|
|
17200
|
+
static get observedAttributes() {
|
|
17201
|
+
return ["label"];
|
|
17202
|
+
}
|
|
17203
|
+
|
|
17204
|
+
get label() {
|
|
17205
|
+
return this.getAttribute("label") ?? "";
|
|
17206
|
+
}
|
|
17207
|
+
|
|
17208
|
+
set label(value) {
|
|
17209
|
+
if (value == null || value === "") this.removeAttribute("label");
|
|
17210
|
+
else this.setAttribute("label", String(value));
|
|
17211
|
+
}
|
|
17212
|
+
|
|
17190
17213
|
connectedCallback() {
|
|
17214
|
+
this.#sync();
|
|
17215
|
+
}
|
|
17216
|
+
|
|
17217
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
17218
|
+
if (oldValue === newValue) return;
|
|
17219
|
+
this.#sync();
|
|
17220
|
+
}
|
|
17221
|
+
|
|
17222
|
+
#sync() {
|
|
17191
17223
|
if (!this.hasAttribute("role")) {
|
|
17192
17224
|
this.setAttribute("role", "separator");
|
|
17193
17225
|
}
|
|
17226
|
+
const label = this.label.trim();
|
|
17227
|
+
if (label) this.setAttribute("aria-label", label);
|
|
17228
|
+
else this.removeAttribute("aria-label");
|
|
17194
17229
|
}
|
|
17195
17230
|
}
|
|
17196
17231
|
customElements.define("fig-menu-separator", FigMenuSeparator);
|
package/package.json
CHANGED