Build radio widget entries from choice type metadata so variants display their icons (#4408)

* Build radio widget entries from choice type metadata so variants display their icons

* Route the node properties enum radio through the shared choice type entry builder
This commit is contained in:
Keavon Chambers
2026-08-04 21:16:14 -07:00
committed by Dennis Kobert
parent ed82c52d8e
commit d19c299f40
12 changed files with 90 additions and 105 deletions

View File

@@ -19,6 +19,10 @@ import Empty12px from "/../branding/assets/icon-12px-solid/empty-12px.svg";
import Failure from "/../branding/assets/icon-12px-solid/failure.svg";
import FullscreenEnter from "/../branding/assets/icon-12px-solid/fullscreen-enter.svg";
import FullscreenExit from "/../branding/assets/icon-12px-solid/fullscreen-exit.svg";
import GradientSpreadClear from "/../branding/assets/icon-12px-solid/gradient-spread-clear.svg";
import GradientSpreadPad from "/../branding/assets/icon-12px-solid/gradient-spread-pad.svg";
import GradientSpreadReflect from "/../branding/assets/icon-12px-solid/gradient-spread-reflect.svg";
import GradientSpreadRepeat from "/../branding/assets/icon-12px-solid/gradient-spread-repeat.svg";
import GridDotted from "/../branding/assets/icon-12px-solid/grid-dotted.svg";
import Grid from "/../branding/assets/icon-12px-solid/grid.svg";
import Info from "/../branding/assets/icon-12px-solid/info.svg";
@@ -67,6 +71,10 @@ const SOLID_12PX = {
Failure: { svg: Failure, size: 12 },
FullscreenEnter: { svg: FullscreenEnter, size: 12 },
FullscreenExit: { svg: FullscreenExit, size: 12 },
GradientSpreadClear: { svg: GradientSpreadClear, size: 12 },
GradientSpreadPad: { svg: GradientSpreadPad, size: 12 },
GradientSpreadReflect: { svg: GradientSpreadReflect, size: 12 },
GradientSpreadRepeat: { svg: GradientSpreadRepeat, size: 12 },
Grid: { svg: Grid, size: 12 },
GridDotted: { svg: GridDotted, size: 12 },
Info: { svg: Info, size: 12 },

View File

@@ -89,7 +89,13 @@ export function destroyTooltipStore() {
// Listen for mouse movements onto tooltip-bearing HTML elements to track the future target of a tooltip
function onMouseOver(e: MouseEvent) {
const element = (e.target instanceof Element && e.target.closest("[data-tooltip-label], [data-tooltip-description], [data-tooltip-shortcut]")) || undefined;
const target = (e.target instanceof Element && e.target) || undefined;
let element = target?.closest("[data-tooltip-label], [data-tooltip-description], [data-tooltip-shortcut]") || undefined;
// A floating menu renders within the DOM of the widget that spawned it, so a match beyond the menu's own content
// is the spawner's tooltip rather than one belonging to whatever the cursor is actually over
const floatingMenuContent = target?.closest("[data-floating-menu-content]");
if (element && floatingMenuContent && !floatingMenuContent.contains(element)) element = undefined;
update((state) => {
state.visible = false;