From b2e720c5271fbe8a42cecf9d10e945c55f0d20ed Mon Sep 17 00:00:00 2001 From: ROBdk97 Date: Tue, 16 Jun 2026 22:42:43 +0200 Subject: [PATCH] fix: include mouse-axis bindings in dial dropdown (fix #7) Show mouseaxis bindings as Mouse in function details, keep generated PI assets in sync, bump selected PluginCore dependency patch versions, and document v1.2.4.0 changelog updates. --- CHANGELOG.md | 11 +++++++++ PluginCore/PluginCore.csproj | 10 ++++---- .../PropertyInspector/js/pi-dial-action.js | 2 +- .../PropertyInspector/js/sc-components.js | 2 +- .../js/src/pi-dial-action.js | 22 +++++++++--------- .../PropertyInspector/js/src/sc-common.js | 23 +++++++++++-------- 6 files changed, 42 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd30c46..169fcbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,17 @@ Notes: --- +## v1.2.4.0 - Patch Release + +### Bug Fixes + +- Fixed issue #7 where some mouse wheel/mouse-axis actions (for example `Mining Increase Laser Power`) were missing from the `Adaptive Dial` function dropdown. +- Fixed function details in the Property Inspector so mouse-axis bindings are shown under `Mouse` instead of incorrectly appearing as `Unbound`. + +### Internal / Refactor + +- Updated selected `PluginCore` NuGet dependencies to newer patch versions (`Microsoft.CodeAnalysis.NetAnalyzers`, `Microsoft.Extensions.DependencyInjection`, `Microsoft.Extensions.DependencyInjection.Abstractions`, `Microsoft.Win32.SystemEvents`, and `System.Drawing.Common`). + ## v1.2.3.0 - Minor Release ### Features / Improvements diff --git a/PluginCore/PluginCore.csproj b/PluginCore/PluginCore.csproj index 647af62..bb4bf48 100644 --- a/PluginCore/PluginCore.csproj +++ b/PluginCore/PluginCore.csproj @@ -45,18 +45,18 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + - + diff --git a/PluginCore/PropertyInspector/js/pi-dial-action.js b/PluginCore/PropertyInspector/js/pi-dial-action.js index c62bf6c..58b9741 100644 --- a/PluginCore/PropertyInspector/js/pi-dial-action.js +++ b/PluginCore/PropertyInspector/js/pi-dial-action.js @@ -1,2 +1,2 @@ /* generated: pi-dial-action.js */ -(function(){function e(n,t=true){if(typeof n=="boolean")return n;if(typeof n=="string"){const t=n.trim().toLowerCase();if(t==="false"||t==="0"||t==="off"||t==="no")return!1;if(t==="true"||t==="1"||t==="on"||t==="yes")return!0}return t}function l(t){const i=n?.functionPicker?.flattenFunctionsData;return typeof i!="function"?[]:i(t,{requireToggleCandidates:!1,excludeBindingTypes:["mouseaxis","joystick","gamepad"]})}function a(n){u=l(n);t.forEach(n=>{n.dropdown?.setItems?.(u),n.dropdown?.setSelectedValue?.(n.currentValue,{rerender:!1}),n.currentValue&&o(n.settingsKey,n.currentValue)})}function o(n,i){const e=t.find(t=>t.settingsKey===n);if(e){e.currentValue=i||"";const f=u.find(n=>n.value===i||n.legacyValue===i);if(!f){i||r(e,null);return}const o=f.legacyValue===i&&f.value!==i;s(n,f,{persist:o})}}function s(n,i,u={}){const e=t.find(t=>t.settingsKey===n);if(e){const o=u.persist!==!1;f=!0;e.currentValue=i.value;e.dropdown?.setSelectedValue?.(i.value,{rerender:!0});r(e,i);o&&e.setValue(i.value);setTimeout(()=>{f=!1},200)}}function r(t,i){if(t&&t.idPrefix){const u=n?.functionPicker?.updateFunctionDetails;if(typeof u=="function"){const r=t.idPrefix,f=n?.i18n?.t(t.slotLabelKey,t.slotLabelFallback)||t.slotLabelFallback;u({containerEl:document.getElementById(`${r}-details-container`),titleEl:document.getElementById(`${r}-details-title`),descriptionEl:document.getElementById(`${r}-description`),bindingElements:{keyboard:document.getElementById(`${r}-binding-keyboard`),mouse:document.getElementById(`${r}-binding-mouse`),gamepad:document.getElementById(`${r}-binding-gamepad`),joystick:document.getElementById(`${r}-binding-joystick`)},hideContainerWhenEmpty:!0,showContainerWhenFilled:!0,slotLabel:f,selectedOption:i})}}}const n=globalThis.SCPI;n?.i18n?.init?.();n?.i18n?.apply?.();n?.bus?.start?.();n?.theme?.initThemeDropdown?.();let u=[],f=!1;const t=[{rootId:"rotateLeftDropdown",settingsKey:"rotateLeftFunction",slotLabelKey:"PropertyInspector.DialAction.RotateLeftLabel",slotLabelFallback:"Rotate Left",placeholderKey:"PropertyInspector.DialAction.RotateLeftPlaceholder",placeholderFallback:"Select rotate-left function...",idPrefix:"rotateLeft"},{rootId:"rotateRightDropdown",settingsKey:"rotateRightFunction",slotLabelKey:"PropertyInspector.DialAction.RotateRightLabel",slotLabelFallback:"Rotate Right",placeholderKey:"PropertyInspector.DialAction.RotateRightPlaceholder",placeholderFallback:"Select rotate-right function...",idPrefix:"rotateRight"},{rootId:"pressDropdown",settingsKey:"pressFunction",slotLabelKey:"PropertyInspector.DialAction.PushLabel",slotLabelFallback:"Push",placeholderKey:"PropertyInspector.DialAction.PushPlaceholder",placeholderFallback:"Select push function...",idPrefix:"press"}].map(t=>{const i=n?.ui?.dropdown?.initDropdown?.({rootId:t.rootId,placeholder:{key:t.placeholderKey,fallback:t.placeholderFallback},searchEnabled:!0,minLoadingMs:0,successFlashMs:100,emptyText:{key:"PropertyInspector.Common.Dropdown.NoMatchingFunctionsFound",fallback:"No matching functions found"},maxResults:50,getText:n=>String(n?.text??""),getValue:n=>String(n?.value??""),getGroup:n=>String(n?.group??""),isDisabled:n=>!!n?.disabled,onSelect:n=>s(t.settingsKey,n,{persist:!0})});i?.setLoading?.(!0,{key:"PropertyInspector.Common.Status.LoadingFunctions",fallback:"Loading functions"});const[r,u]=globalThis.SDPIComponents.useSettings(t.settingsKey,n=>{f||o(t.settingsKey,n)});return{...t,dropdown:i,getValue:r,setValue:u,currentValue:""}});n?.ui?.filePicker?.createFilePicker?.({rootId:"audioFilePicker",placeholderText:{key:"PropertyInspector.Common.FilePicker.NoFileSelected",fallback:"No file selected"},buttonText:{key:"PropertyInspector.Common.FilePicker.Button",fallback:"FILE"},selectTitle:{key:"PropertyInspector.Common.Audio.SelectTitle",fallback:"Select audio file"},clearTitle:{key:"PropertyInspector.Common.Audio.ClearTitle",fallback:"Clear audio file"},settingsKey:"clickSoundPath"});const i=document.getElementById("showTouchTextToggle");const[h,c]=globalThis.SDPIComponents.useSettings("showTouchText",n=>{i&&(i.checked=e(n,!0))});i?.addEventListener("change",()=>{c(i.checked)});n?.bus?.on?.(n=>{const i=n?.functionsLoaded;i===!0&&(t.forEach(n=>{n.dropdown?.setLoading?.(!1),document.getElementById(n.rootId)?.classList.remove("pi-dropdown--error")}),a(n.functions||[]));i===!1&&t.forEach(n=>{document.getElementById(n.rootId)?.classList.add("pi-dropdown--error"),n.dropdown?.setLoading?.(!0,{key:"PropertyInspector.Common.Status.NoInstallationDetected",fallback:"No installation detected. Set custom path."}),n.dropdown?.setItems?.([]),r(n,null)})});n?.i18n?.onChange?.(()=>{t.forEach(n=>{const t=u.find(t=>t.value===n.currentValue||t.legacyValue===n.currentValue)||null;r(n,t)})});n?.util?.onDocumentReady?.(()=>{if(i){const n=h();i.checked=e(n,!0)}t.forEach(n=>{const t=n.getValue();n.currentValue=t||"";n.dropdown?.setSelectedValue?.(n.currentValue,{rerender:!1});r(n,null)});n?.bus?.sendOnce?.("pi.connected","propertyInspectorConnected")})})() +(function(){function e(n,t=true){if(typeof n=="boolean")return n;if(typeof n=="string"){const t=n.trim().toLowerCase();if(t==="false"||t==="0"||t==="off"||t==="no")return!1;if(t==="true"||t==="1"||t==="on"||t==="yes")return!0}return t}function l(t){const i=n?.functionPicker?.flattenFunctionsData;return typeof i!="function"?[]:i(t,{requireToggleCandidates:!1,excludeBindingTypes:["joystick","gamepad"]})}function a(n){u=l(n);t.forEach(n=>{n.dropdown?.setItems?.(u),n.dropdown?.setSelectedValue?.(n.currentValue,{rerender:!1}),n.currentValue&&o(n.settingsKey,n.currentValue)})}function o(n,i){const e=t.find(t=>t.settingsKey===n);if(e){e.currentValue=i||"";const f=u.find(n=>n.value===i||n.legacyValue===i);if(!f){i||r(e,null);return}const o=f.legacyValue===i&&f.value!==i;s(n,f,{persist:o})}}function s(n,i,u={}){const e=t.find(t=>t.settingsKey===n);if(e){const o=u.persist!==!1;f=!0;e.currentValue=i.value;e.dropdown?.setSelectedValue?.(i.value,{rerender:!0});r(e,i);o&&e.setValue(i.value);setTimeout(()=>{f=!1},200)}}function r(t,i){if(t&&t.idPrefix){const u=n?.functionPicker?.updateFunctionDetails;if(typeof u=="function"){const r=t.idPrefix,f=n?.i18n?.t(t.slotLabelKey,t.slotLabelFallback)||t.slotLabelFallback;u({containerEl:document.getElementById(`${r}-details-container`),titleEl:document.getElementById(`${r}-details-title`),descriptionEl:document.getElementById(`${r}-description`),bindingElements:{keyboard:document.getElementById(`${r}-binding-keyboard`),mouse:document.getElementById(`${r}-binding-mouse`),gamepad:document.getElementById(`${r}-binding-gamepad`),joystick:document.getElementById(`${r}-binding-joystick`)},hideContainerWhenEmpty:!0,showContainerWhenFilled:!0,slotLabel:f,selectedOption:i})}}}const n=globalThis.SCPI;n?.i18n?.init?.();n?.i18n?.apply?.();n?.bus?.start?.();n?.theme?.initThemeDropdown?.();let u=[],f=!1;const t=[{rootId:"rotateLeftDropdown",settingsKey:"rotateLeftFunction",slotLabelKey:"PropertyInspector.DialAction.RotateLeftLabel",slotLabelFallback:"Rotate Left",placeholderKey:"PropertyInspector.DialAction.RotateLeftPlaceholder",placeholderFallback:"Select rotate-left function...",idPrefix:"rotateLeft"},{rootId:"rotateRightDropdown",settingsKey:"rotateRightFunction",slotLabelKey:"PropertyInspector.DialAction.RotateRightLabel",slotLabelFallback:"Rotate Right",placeholderKey:"PropertyInspector.DialAction.RotateRightPlaceholder",placeholderFallback:"Select rotate-right function...",idPrefix:"rotateRight"},{rootId:"pressDropdown",settingsKey:"pressFunction",slotLabelKey:"PropertyInspector.DialAction.PushLabel",slotLabelFallback:"Push",placeholderKey:"PropertyInspector.DialAction.PushPlaceholder",placeholderFallback:"Select push function...",idPrefix:"press"}].map(t=>{const i=n?.ui?.dropdown?.initDropdown?.({rootId:t.rootId,placeholder:{key:t.placeholderKey,fallback:t.placeholderFallback},searchEnabled:!0,minLoadingMs:0,successFlashMs:100,emptyText:{key:"PropertyInspector.Common.Dropdown.NoMatchingFunctionsFound",fallback:"No matching functions found"},maxResults:50,getText:n=>String(n?.text??""),getValue:n=>String(n?.value??""),getGroup:n=>String(n?.group??""),isDisabled:n=>!!n?.disabled,onSelect:n=>s(t.settingsKey,n,{persist:!0})});i?.setLoading?.(!0,{key:"PropertyInspector.Common.Status.LoadingFunctions",fallback:"Loading functions"});const[r,u]=globalThis.SDPIComponents.useSettings(t.settingsKey,n=>{f||o(t.settingsKey,n)});return{...t,dropdown:i,getValue:r,setValue:u,currentValue:""}});n?.ui?.filePicker?.createFilePicker?.({rootId:"audioFilePicker",placeholderText:{key:"PropertyInspector.Common.FilePicker.NoFileSelected",fallback:"No file selected"},buttonText:{key:"PropertyInspector.Common.FilePicker.Button",fallback:"FILE"},selectTitle:{key:"PropertyInspector.Common.Audio.SelectTitle",fallback:"Select audio file"},clearTitle:{key:"PropertyInspector.Common.Audio.ClearTitle",fallback:"Clear audio file"},settingsKey:"clickSoundPath"});const i=document.getElementById("showTouchTextToggle");const[h,c]=globalThis.SDPIComponents.useSettings("showTouchText",n=>{i&&(i.checked=e(n,!0))});i?.addEventListener("change",()=>{c(i.checked)});n?.bus?.on?.(n=>{const i=n?.functionsLoaded;i===!0&&(t.forEach(n=>{n.dropdown?.setLoading?.(!1),document.getElementById(n.rootId)?.classList.remove("pi-dropdown--error")}),a(n.functions||[]));i===!1&&t.forEach(n=>{document.getElementById(n.rootId)?.classList.add("pi-dropdown--error"),n.dropdown?.setLoading?.(!0,{key:"PropertyInspector.Common.Status.NoInstallationDetected",fallback:"No installation detected. Set custom path."}),n.dropdown?.setItems?.([]),r(n,null)})});n?.i18n?.onChange?.(()=>{t.forEach(n=>{const t=u.find(t=>t.value===n.currentValue||t.legacyValue===n.currentValue)||null;r(n,t)})});n?.util?.onDocumentReady?.(()=>{if(i){const n=h();i.checked=e(n,!0)}t.forEach(n=>{const t=n.getValue();n.currentValue=t||"";n.dropdown?.setSelectedValue?.(n.currentValue,{rerender:!1});r(n,null)});n?.bus?.sendOnce?.("pi.connected","propertyInspectorConnected")})})() diff --git a/PluginCore/PropertyInspector/js/sc-components.js b/PluginCore/PropertyInspector/js/sc-components.js index bca7889..de76f5e 100644 --- a/PluginCore/PropertyInspector/js/sc-components.js +++ b/PluginCore/PropertyInspector/js/sc-components.js @@ -1,2 +1,2 @@ /* generated: sc-components.js */ -(function(){function r(n,t){let i;return function(...r){const u=()=>{clearTimeout(i),n(...r)};clearTimeout(i);i=setTimeout(u,t)}}function u(n){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n):n()}function f(t,i={}){try{if(!n.SDPIComponents?.streamDeckClient?.send){console.warn("[sc-common] SDPIComponents.streamDeckClient.send not available");return}n.SDPIComponents.streamDeckClient.send("sendToPlugin",{event:t,...i})}catch(r){console.error("[sc-common] sendToPlugin failed",r)}}const n=globalThis,i=n.SCPI=n.SCPI||{},t=i.util=i.util||{};t.debounce=r;t.onDocumentReady=u;t.sendToPlugin=f;typeof n.debounce!="function"&&(n.debounce=r);typeof n.onDocumentReady!="function"&&(n.onDocumentReady=u);typeof n.sendToPlugin!="function"&&(n.sendToPlugin=f)})(),function(){function u(n){if(typeof n!="string"||n.trim().length===0)return null;const t=n.trim().replace(/_/g,"-").toLowerCase();if(b.has(t))return t;const[i]=t.split("-",1);return b.has(i)?i:null}function y(n){const t=o.location?.href||document.baseURI;try{return typeof n=="string"&&n.trim().length>0?new URL(n,t).href:new URL("../../",t).href}catch(i){return""}}function t(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function f(n,i){if(!t(n))return t(i)?f({},i):i;const r={...n};return t(i)?(Object.entries(i).forEach(([n,i])=>{if(t(i)&&t(r[n])){r[n]=f(r[n],i);return}r[n]=t(i)?f({},i):i}),r):r}function ft(n,t){return!n||typeof t!="string"||t.trim().length===0?undefined:t.split(".").reduce((n,t)=>n===null||n===undefined?undefined:n[t],n)}function et(n,t){const i=typeof n=="string"?n:"";return!t||typeof t!="object"?i:i.replace(/\{([^}]+)\}/g,(n,i)=>{const r=t[i];return r===undefined||r===null?n:String(r)})}async function nt(n){const i=u(n)||"en";if(a.has(i))return a.get(i);const r=(async()=>{const n=h||y(),r=o.location?.href||document.baseURI;try{const u=await fetch(new URL(`${i}.json`,n||r).href,{cache:"no-store"});if(!u.ok)throw new Error(`HTTP ${u.status}`);const f=await u.json();return t(f?.Localization)?f.Localization:{}}catch(u){return console.warn(`[sc-i18n] Failed to load locale "${i}"`,u),{}}})();return a.set(i,r),r}function e(n,t){const i=n.getAttribute(`data-i18n-${t}-fallback`);if(i!==null)return i;switch(t){case"text":return n.textContent||"";case"title":return n.getAttribute("title")||"";case"placeholder":return n.getAttribute("placeholder")||"";case"aria-label":return n.getAttribute("aria-label")||"";case"value":return n.value||"";default:return""}}function ot(n){if(n&&typeof n.getAttribute=="function"){const t=n.getAttribute("data-i18n-text");t&&(n.textContent=r(t,e(n,"text")));const i=n.getAttribute("data-i18n-title");i&&n.setAttribute("title",r(i,e(n,"title")));const u=n.getAttribute("data-i18n-placeholder");u&&n.setAttribute("placeholder",r(u,e(n,"placeholder")));const f=n.getAttribute("data-i18n-aria-label");f&&n.setAttribute("aria-label",r(f,e(n,"aria-label")));const o=n.getAttribute("data-i18n-value");o&&"value"in n&&(n.value=r(o,e(n,"value")))}}function p(n=document){if(n){const t=[];typeof n.getAttribute=="function"&&t.push(n);typeof n.querySelectorAll=="function"&&t.push(...n.querySelectorAll(ut));t.forEach(n=>ot(n))}}function tt(){const t={...i,effective:n};l.forEach(n=>{try{n(t)}catch(i){console.error("[sc-i18n] listener failed",i)}})}async function it(t){const i=u(t)||"en",r=++g;if(v&&i===n)return document.documentElement.lang=n,p(document),tt(),n;const[e,o]=await Promise.all([nt("en"),i==="en"?Promise.resolve({}):nt(i)]);return r!==g?n:(d=f(f({},e),o),n=i,v=!0,document.documentElement.lang=n,p(document),tt(),n)}function st(n){const t=n?.pluginLocale||n?.controlPanel?.pluginLocale||null;return!t||typeof t!="object"?null:{mode:String(t.mode||"auto"),override:t.override??null,detected:t.detected??null,effective:u(t.effective)||"en"}}function w(){if(!s){const n=()=>{if(!s){if(typeof c.bus?.on!="function"){setTimeout(n,0);return}s=!0;c.bus.on(n=>{const t=st(n);t&&rt(t)})}};n()}}function ht(t={}){return(typeof t.localeRootUrl=="string"&&t.localeRootUrl.trim().length>0?h=y(t.localeRootUrl):h||(h=y()),!k)?(k=!0,w(),it(n)):(s||w(),Promise.resolve(n))}function r(n,t="",i=null){const r=ft(d,n),u=typeof r=="string"?r:String(t??"");return et(u,i)}function ct(n,i=""){return typeof n=="string"?n:t(n)?r(n.key||"",n.fallback??i,n.replacements??null):String(i??"")}function rt(n){const t=typeof n=="string"?{mode:"auto",override:null,detected:null,effective:u(n)||"en"}:{mode:String(n?.mode||i.mode||"auto"),override:n?.override??i.override??null,detected:n?.detected??i.detected??null,effective:u(n?.effective)||"en"};return i=t,it(t.effective)}function lt(t){return typeof t!="function"?()=>{}:(l.add(t),v&&t({...i,effective:n}),()=>l.delete(t))}const o=globalThis,c=o.SCPI=o.SCPI||{},l=new Set,b=new Set(["en","de","fr","es"]),a=new Map,ut="[data-i18n-text],[data-i18n-title],[data-i18n-placeholder],[data-i18n-aria-label],[data-i18n-value]";let k=!1,s=!1,h="",n="en",d={},i={mode:"auto",override:null,detected:null,effective:"en"},v=!1,g=0;c.i18n={init:ht,bindBus:w,onChange:lt,t:r,apply:p,normalizeLocale:u,resolveSpec:ct,setLocaleInfo:rt,getLocaleInfo:()=>({...i,effective:n})}}(),function(){function r(n,t={}){const i=[],r=t.requireToggleCandidates===!0,u=new Set((t.excludeBindingTypes||[]).map(n=>String(n||"").toLowerCase()));return Array.isArray(n)?(n.forEach(n=>{const t=n?.label||"Other",f=Array.isArray(n?.options)?n.options:[];f.forEach(n=>{const f=String(n?.bindingType||"").toLowerCase();if(r){const t=n&&n.details&&n.details.isToggleCandidate===!0;if(!t)return}if(!u.has(f)){const o=String(n?.disabledReason||""),e=f==="unbound",s=!!n?.disabled&&!e;i.push({value:n?.value,legacyValue:n?.legacyValue,text:n?.text,group:t,details:n?.details,bindingType:f,disabledReason:o,unbound:e,disabled:s})}})}),i):i}function u(t={}){const i=t.containerEl||null,r=t.titleEl||null,u=t.descriptionEl||null,o=t.bindingElements||{},a=t.hideContainerWhenEmpty===!0,v=t.showContainerWhenFilled===!0,f=t.selectedOption||null,s=String(t.slotLabel||"").trim(),h=n?.i18n,c=["keyboard","mouse","gamepad","joystick"];if(!f||!f.details){a&&i&&(i.style.display="none");r&&(r.textContent="");u&&(u.textContent="");c.forEach(n=>{const t=o[n]||null;t&&(t.textContent="")});return}v&&i&&(i.style.display="block");const e=f.details,l=String(e.label||f.text||""),y=String(e.description||""),p=Array.isArray(e.devices)?e.devices:[],w=h?.t("PropertyInspector.Common.State.Unbound","Unbound")||"Unbound",b=h?.t("PropertyInspector.Common.State.NoDescription","No description available.")||"No description available.";r&&(r.textContent=s.length>0?`${s}: ${l}`:l);c.forEach(n=>{const t=p.find(t=>t.device&&t.device.toLowerCase()===n),i=o[n]||null;let r=w;if(t&&Array.isArray(t.bindings)&&t.bindings.length>0){const n=t.bindings.map(n=>String(n.display||n.raw||"")).filter(n=>n);n.length>0&&(r=n.join(", "))}i&&(i.textContent=r)});u&&(u.textContent=y||b)}const t=globalThis,n=t.SCPI=t.SCPI||{},i=n.functionPicker=n.functionPicker||{};i.flattenFunctionsData=r;i.updateFunctionDetails=u}(),function(){function e(){return n.SDPIComponents?.streamDeckClient||null}function i(n,t={}){const i=e();if(!i?.send){console.warn("[sc-bus] SDPI streamDeckClient.send not available");return}i.send("sendToPlugin",{event:n,...t})}function s(n,t,u={}){const f=String(n||"").trim();if(!f){i(t,u);return}r.has(f)||(r.add(f),i(t,u))}function h(n){return typeof n!="function"?()=>{}:(t.add(n),()=>t.delete(n))}function c(){if(!u){u=!0;const n=()=>{if(!f){const i=e(),r=i?.sendToPropertyInspector?.subscribe;if(typeof r!="function"){setTimeout(n,0);return}f=!0;i.sendToPropertyInspector.subscribe(n=>{if(n?.event==="sendToPropertyInspector"&&n.payload)for(const i of Array.from(t))try{i(n.payload,n)}catch(r){console.error("[sc-bus] listener failed",r)}})}};n()}}const n=globalThis,o=n.SCPI=n.SCPI||{},t=new Set,r=new Set;let u=!1,f=!1;o.bus={start:c,on:h,send:i,sendOnce:s}}(),function(){function n(n,i=""){const r=t.SCPI?.i18n?.resolveSpec;return typeof r=="function"?r(n,i):typeof n=="string"?n:String(i??"")}function r(){const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("class","pi-dropdown__arrow");n.setAttribute("fill","none");n.setAttribute("height","20");n.setAttribute("width","20");n.setAttribute("xmlns","http://www.w3.org/2000/svg");const t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d","m5 7.5 5 5 5-5"),t.setAttribute("stroke","var(--color-primary)"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.setAttribute("stroke-width","2"),n.appendChild(t),n}function u(t,i={}){const h=!!t.querySelector(".pi-dropdown__search"),c=!!t.querySelector(".pi-dropdown__toggle"),l=!!t.querySelector(".pi-dropdown__menu");if(!h||!c||!l){const a=i.placeholder!==undefined?i.placeholder:t.getAttribute("data-placeholder")||"",v=n(a,t.getAttribute("data-placeholder")||""),u=document.createElement("div");u.className="pi-dropdown__input-row";const e=document.createElement("div");e.className="pi-dropdown__input-wrapper";const f=document.createElement("input");f.className="pi-dropdown__search";f.type="text";f.placeholder=v;e.appendChild(f);const o=document.createElement("div");o.className="pi-dropdown__toggle";o.appendChild(r());u.appendChild(e);u.appendChild(o);const s=document.createElement("div");s.className="pi-dropdown__menu";t.replaceChildren(u,s)}}function f(i={}){function yt(){r.placeholder=n(gt,f.getAttribute("data-placeholder")||"")}function a(){return f.classList.contains("pi-dropdown--open")}function pt(n){tt&&(n?tt.classList.add("pi-dropdown__arrow--open"):tt.classList.remove("pi-dropdown__arrow--open"))}function p(t){if(v.textContent="",!Array.isArray(t)||t.length===0){const t=document.createElement("div");t.className="pi-dropdown__empty-state";t.textContent=n(ni,"No items found");v.appendChild(t);return}if(ht){const n=new Map;for(const i of t){const t=String(ht(i)??"");n.has(t)||n.set(t,[]);n.get(t).push(i)}for(const[t,i]of n.entries()){if(t){const n=document.createElement("div");n.className="pi-dropdown__group-header";n.textContent=t;v.appendChild(n)}for(const n of i)v.appendChild(wt(n))}}else for(const n of t)v.appendChild(wt(n))}function wt(t){const i=document.createElement("div");i.className="pi-dropdown__option";const f=!!t?.unbound,u=dt(t);u&&i.classList.add("disabled");const r=document.createElement("span");if(r.className="pi-dropdown__option-label",r.textContent=k(t),i.appendChild(r),f){const t=document.createElement("span");t.className="pi-dropdown__option-badge pi-dropdown__option-badge--warn";t.textContent="!";t.title=n(ti,"Unbound");i.appendChild(t)}return i.addEventListener("mousedown",()=>{rt=!0}),i.addEventListener("click",()=>{u||ei(t)}),i}function ut(n){const i=(n||"").toLowerCase().trim();let t=h.filter(n=>k(n).toLowerCase().includes(i));return t.length>ot&&(t=t.slice(0,ot)),t}function nt(){if(!s)if(f.classList.add("pi-dropdown--open"),pt(!0),o){const n=(r.value||"").trim();p(n?ut(n):h)}else p(h)}function w(){f.classList.remove("pi-dropdown--open");pt(!1)}function bt(){s||(a()?w():nt())}function ui(n){h=Array.isArray(n)?n:[];a()&&nt()}function fi(n,t={}){if(it=typeof n=="string"?n:"",at){const n=h.find(n=>st(n)===it);r.value=n?k(n):""}t.rerender&&a()&&nt()}function ei(n){s||(it=st(n),at&&(r.value=k(n)),o&&(r.value=""),w(),ct&&ct(n),setTimeout(()=>{rt=!1},200))}function kt(n){if(o&&!s){const t=n?.target?.value??"";p(ut(t));!a()&&String(t).trim()&&nt()}}function oi(){o&&(rt||(a()&&w(),r.value=""))}function si(n){o||s||(n?.stopPropagation?.(),bt())}function li(){if(yt(),e&&s&&(e.textContent=n(c,"Loading")),e&&f.classList.contains("pi-dropdown--success")){const t=n(lt,"");t.trim().length>0&&(e.textContent=t)}if(a())if(o){const n=(r.value||"").trim();p(n?ut(n):h)}else p(h)}function ai(t,i={key:"PropertyInspector.Common.Status.Loading",fallback:"Loading"}){const u=!!t;if(u===s){c=i===undefined?c:i;s&&e&&(e.textContent=n(c,"Loading"));return}if(d+=1,y&&(clearTimeout(y),y=null),u){c=i===undefined?c:i;s=!0;vt=Date.now();w();f.classList.remove("pi-dropdown--success");f.classList.add("pi-dropdown--loading");r.readOnly=!0;r.setAttribute("readonly","");r.blur?.();b.setAttribute("aria-disabled","true");e&&(e.textContent=n(c,"Loading"));return}const o=d,h=Date.now()-vt,l=Math.max(0,ii-h);y=setTimeout(()=>{if(o===d){f.classList.remove("pi-dropdown--loading");f.classList.add("pi-dropdown--success");const t=n(lt,"");e&&t.trim().length>0&&(e.textContent=t);y=setTimeout(()=>{o===d&&(f.classList.remove("pi-dropdown--success"),b.removeAttribute("aria-disabled"),r.readOnly=hi,ci?r.setAttribute("readonly",""):r.removeAttribute("readonly"),s=!1,y=null)},ri)}},l)}const ft=i.rootId;if(!ft)return null;const f=document.getElementById(ft);if(!f)return null;u(f,{placeholder:i.placeholder});const r=f.querySelector(".pi-dropdown__search"),b=f.querySelector(".pi-dropdown__toggle"),tt=f.querySelector(".pi-dropdown__arrow"),v=f.querySelector(".pi-dropdown__menu"),et=f.querySelector(".pi-dropdown__input-wrapper");if(!r||!b||!v)return null;const o=i.searchEnabled!==!1,ot=typeof i.maxResults=="number"?i.maxResults:50,k=typeof i.getText=="function"?i.getText:n=>String(n?.text??""),st=typeof i.getValue=="function"?i.getValue:n=>String(n?.value??""),ht=typeof i.getGroup=="function"?i.getGroup:null,dt=typeof i.isDisabled=="function"?i.isDisabled:n=>!!n?.disabled,ct=typeof i.onSelect=="function"?i.onSelect:null,gt=i.placeholder!==undefined?i.placeholder:f.getAttribute("data-placeholder")||"",ni=i.emptyText!==undefined?i.emptyText:{key:"PropertyInspector.Common.Dropdown.NoItemsFound",fallback:"No items found"},lt=i.successText!==undefined?i.successText:"",ti=i.unboundTitle!==undefined?i.unboundTitle:{key:"PropertyInspector.Common.State.Unbound",fallback:"Unbound"},at=i.displaySelectedInInput!==undefined?!!i.displaySelectedInInput:!o,ii=typeof i.minLoadingMs=="number"?i.minLoadingMs:500,ri=typeof i.successFlashMs=="number"?i.successFlashMs:220;let h=[],it="",rt=!1,s=!1,vt=0,d=0,y=null,c={key:"PropertyInspector.Common.Status.Loading",fallback:"Loading"},l=null,e=null,g=null;if(et){l=document.createElement("div");l.className="pi-dropdown__loading";l.setAttribute("aria-hidden","true");const n=document.createElement("span");n.className="pi-spinner";n.setAttribute("aria-hidden","true");e=document.createElement("span");e.className="pi-dropdown__loading-label";g=document.createElement("span");g.className="pi-dropdown__loading-dots";for(let n=0;n<3;n+=1){const n=document.createElement("span");n.className="pi-dropdown__loading-dot";n.textContent=".";g.appendChild(n)}l.appendChild(e);l.appendChild(g);l.appendChild(n);et.appendChild(l)}o||(r.readOnly=!0,r.setAttribute("readonly",""));const hi=r.readOnly,ci=r.hasAttribute("readonly");yt();t.SCPI?.i18n?.onChange?.(()=>{li()});if(o){const n=t.SCPI?.util?.debounce||t.debounce,i=typeof n=="function"?n(kt,150):kt;r.addEventListener("input",i);r.addEventListener("blur",oi)}else r.addEventListener("click",si);return b.addEventListener("click",n=>{n.stopPropagation(),bt()}),document.addEventListener("click",n=>{f.contains(n.target)||(a()&&w(),o&&(r.value=""))},!0),{setItems:ui,setSelectedValue:fi,setLoading:ai}}const t=globalThis;const i=t.SCPI=t.SCPI||{};i.ui=i.ui||{};i.ui.dropdown={initDropdown:f};t.SCDropdown=t.SCDropdown||i.ui.dropdown}(),function(){function t(t,i=""){const r=n.SCPI?.i18n?.resolveSpec;return typeof r=="function"?r(t,i):typeof t=="string"?t:String(i??"")}function o(n){try{return decodeURIComponent(n)}catch(t){return n}}function r(n){return typeof n!="string"?"":o(String(n).replace(/^C:\\fakepath\\/i,""))}function u(n){return typeof n!="string"||n.length===0?"":n.split("\\").pop().split("/").pop()}function s(n,i={}){const l=n.querySelector(".file-picker-container");if(!l){const c=typeof i.accept=="string"?i.accept:n.getAttribute("data-accept")||"",a=t(i.placeholderText!==undefined?i.placeholderText:n.getAttribute("data-placeholder")||"","No file selected"),v=t(i.buttonText!==undefined?i.buttonText:n.getAttribute("data-button-text")||"","FILE"),y=t(i.selectTitle!==undefined?i.selectTitle:n.getAttribute("data-select-title")||"","Select file"),p=t(i.clearTitle!==undefined?i.clearTitle:n.getAttribute("data-clear-title")||"","Clear"),r=document.createElement("div");r.className="file-picker-container";const e=document.createElement("input");e.type="file";e.style.display="none";c&&e.setAttribute("accept",c);const o=document.createElement("div");o.className="file-picker-display";const s=document.createElement("span");s.className="filename-text";s.textContent=a;o.appendChild(s);const f=document.createElement("button");f.className="file-picker-button";f.type="button";f.title=y;const h=document.createElement("span");h.className="button-icon";h.textContent=v;f.appendChild(h);const u=document.createElement("button");u.className="file-picker-clear";u.type="button";u.title=p;u.disabled=!0;u.textContent="X";r.appendChild(e);r.appendChild(o);r.appendChild(f);r.appendChild(u);n.replaceChildren(r)}}function f(i={}){function ht(){return t(ut,"No file selected")}function nt(){const u=t(ft,"FILE"),n=t(et,"Select file"),i=t(ot,"Clear");o.title=n;o.setAttribute("aria-label",n);h.title=i;h.setAttribute("aria-label",i);const r=o.querySelector(".button-icon");r&&(r.textContent=u);c||a("")}function a(n){const t=typeof n=="string"&&n.length>0,i=t?st==="full"?n:u(n):ht();p.textContent=i;p.title=t?n:"";h.disabled=!t}function e(n,t={}){const r=t.persist!==!1,u=!!t.silent,i=typeof n=="string"?n:"";if(c=i,a(c),!u&&d)try{d(c)}catch(f){}if(r&&b){w=!0;try{b(i.length>0?i:null)}finally{setTimeout(()=>{w=!1},50)}}}function it(){l.value="";e("",{persist:!0})}const k=i.rootId,f=k?document.getElementById(k):null;if(!f)return null;s(f,i);const rt=i.filenameSelector||".filename-text",ut=i.placeholderText!==undefined?i.placeholderText:{key:"PropertyInspector.Common.FilePicker.NoFileSelected",fallback:"No file selected"},ft=i.buttonText!==undefined?i.buttonText:{key:"PropertyInspector.Common.FilePicker.Button",fallback:"FILE"},et=i.selectTitle!==undefined?i.selectTitle:{key:"PropertyInspector.Common.FilePicker.SelectFile",fallback:"Select file"},ot=i.clearTitle!==undefined?i.clearTitle:{key:"PropertyInspector.Common.FilePicker.Clear",fallback:"Clear"},v=i.settingsKey,st=i.displayMode||"basename",d=typeof i.onValueChanged=="function"?i.onValueChanged:null,g=typeof i.initialValue=="string"?i.initialValue:"",l=f.querySelector('input[type="file"]'),o=f.querySelector(".file-picker-button"),h=f.querySelector(".file-picker-clear"),y=f.querySelector(".file-picker-display"),p=y?y.querySelector(rt):null;if(!l||!o||!h||!y||!p)return null;let c="",w=!1,b=null,tt=null;o.addEventListener("click",()=>{l.click()});l.addEventListener("change",n=>{const t=n?.target?.files?.[0],u=n?.target?.value||"",f=r(u),i=t?.path||f;if(i){e(i,{persist:!0});return}t?.name&&a(t.name)});h.addEventListener("click",()=>{it()});typeof v=="string"&&v.length>0&&n.SDPIComponents?.useSettings&&([tt,b]=n.SDPIComponents.useSettings(v,n=>{w||e(typeof n=="string"?n:"",{persist:!1})}),Promise.resolve(tt()).then(n=>{e(typeof n=="string"?n:"",{persist:!1})}).catch(()=>{}));a("");nt();n.SCPI?.i18n?.onChange?.(()=>{nt()});return g&&e(g,{persist:!1,silent:!0}),{setValue:e,clear:it,getValue:()=>c}}function e(i={}){function p(n){const i=typeof n=="string"&&n.length>0,r=i?ot==="full"?n:u(n):t(et,"No file selected");a.textContent=r;a.title=i?n:"";l.disabled=!i}function e(n,t={}){const r=t.persist!==!1,u=!!t.silent,i=typeof n=="string"?n:"";if(h=i,p(h),!u&&w)try{w(h)}catch(f){}if(r&&y){v=!0;try{y(i.length>0?i:null)}finally{setTimeout(()=>{v=!1},50)}}}function nt(){o.value="";e("",{persist:!0})}if(typeof i.rootId=="string"&&i.rootId.length>0)return f(i);const tt=i.inputId,it=i.buttonId,rt=i.clearId,ut=i.displayId,ft=i.filenameSelector||".filename-text",et=i.placeholderText!==undefined?i.placeholderText:{key:"PropertyInspector.Common.FilePicker.NoFileSelected",fallback:"No file selected"},c=i.settingsKey,ot=i.displayMode||"basename",w=typeof i.onValueChanged=="function"?i.onValueChanged:null,b=typeof i.initialValue=="string"?i.initialValue:"",o=document.getElementById(tt),k=document.getElementById(it),l=document.getElementById(rt),s=document.getElementById(ut),a=s?s.querySelector(ft):null;if(!o||!k||!l||!s||!a)return null;const st=document.createElement("div"),d=s.closest(".file-picker-container");d&&st.appendChild(d.cloneNode(!0));let h="",v=!1,y=null,g=null;return k.addEventListener("click",()=>{o.click()}),o.addEventListener("change",n=>{const t=n?.target?.files?.[0],u=n?.target?.value||"",f=r(u),i=t?.path||f;if(i){e(i,{persist:!0});return}t?.name&&p(t.name)}),l.addEventListener("click",()=>{nt()}),typeof c=="string"&&c.length>0&&n.SDPIComponents?.useSettings&&([g,y]=n.SDPIComponents.useSettings(c,n=>{v||e(typeof n=="string"?n:"",{persist:!1})}),Promise.resolve(g()).then(n=>{e(typeof n=="string"?n:"",{persist:!1})}).catch(()=>{})),p(""),b&&e(b,{persist:!1,silent:!0}),{setValue:e,clear:nt,getValue:()=>h}}const n=globalThis;const i=n.SCPI=n.SCPI||{};i.ui=i.ui||{};i.ui.filePicker={createFilePicker:f,initFilePicker:e};n.SCFilePicker=n.SCFilePicker||{initFilePicker:e}}(),function(){function i(n,t){if(n&&typeof n=="string"){t&&(t.href=`../css/themes/${n}`);try{localStorage.setItem(r,n)}catch(i){}}}function u(r={}){const o=r.rootId||"themeDropdown",s=r.linkId||"pi-theme-styles",u=document.getElementById(s);if(u){let e=[];n.bus?.start?.();const f=n.ui?.dropdown?.initDropdown?.({rootId:o,searchEnabled:!1,displaySelectedInInput:!0,minLoadingMs:500,successFlashMs:220,placeholder:{key:"PropertyInspector.ControlPanel.ThemePlaceholder",fallback:"Selected theme"},emptyText:{key:"PropertyInspector.Common.Dropdown.NoThemesFound",fallback:"No themes found"},getText:n=>String(n?.name??""),getValue:n=>String(n?.file??""),onSelect:r=>{const f=String(r?.file??"");f&&(i(f,u),(n.bus?.send||n.util?.sendToPlugin||t.sendToPlugin)?.("setTheme",{themeFile:f}))}});f?.setLoading?.(!0,{key:"PropertyInspector.Common.Status.LoadingThemes",fallback:"Loading themes"});n.bus?.on?.(n=>{if(n&&(n.themesLoaded&&(e=n.themes||[],f?.setItems?.(e),f?.setLoading?.(!1)),typeof n.selectedTheme=="string"&&n.selectedTheme.length>0)){const t=n.selectedTheme;i(t,u);f?.setSelectedValue?.(t,{rerender:!0})}});try{const t=u.getAttribute("href")||"",n=t.split("/").pop().split("?")[0];n&&(i(n,u),f?.setSelectedValue?.(n,{rerender:!0}))}catch(h){}}}const t=globalThis,n=t.SCPI=t.SCPI||{},r="scsd.selectedTheme";n.theme={initThemeDropdown:u};t.SCTheme=t.SCTheme||n.theme}() +(function(){function r(n,t){let i;return function(...r){const u=()=>{clearTimeout(i),n(...r)};clearTimeout(i);i=setTimeout(u,t)}}function u(n){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n):n()}function f(t,i={}){try{if(!n.SDPIComponents?.streamDeckClient?.send){console.warn("[sc-common] SDPIComponents.streamDeckClient.send not available");return}n.SDPIComponents.streamDeckClient.send("sendToPlugin",{event:t,...i})}catch(r){console.error("[sc-common] sendToPlugin failed",r)}}const n=globalThis,i=n.SCPI=n.SCPI||{},t=i.util=i.util||{};t.debounce=r;t.onDocumentReady=u;t.sendToPlugin=f;typeof n.debounce!="function"&&(n.debounce=r);typeof n.onDocumentReady!="function"&&(n.onDocumentReady=u);typeof n.sendToPlugin!="function"&&(n.sendToPlugin=f)})(),function(){function u(n){if(typeof n!="string"||n.trim().length===0)return null;const t=n.trim().replace(/_/g,"-").toLowerCase();if(b.has(t))return t;const[i]=t.split("-",1);return b.has(i)?i:null}function y(n){const t=o.location?.href||document.baseURI;try{return typeof n=="string"&&n.trim().length>0?new URL(n,t).href:new URL("../../",t).href}catch(i){return""}}function t(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function f(n,i){if(!t(n))return t(i)?f({},i):i;const r={...n};return t(i)?(Object.entries(i).forEach(([n,i])=>{if(t(i)&&t(r[n])){r[n]=f(r[n],i);return}r[n]=t(i)?f({},i):i}),r):r}function ft(n,t){return!n||typeof t!="string"||t.trim().length===0?undefined:t.split(".").reduce((n,t)=>n===null||n===undefined?undefined:n[t],n)}function et(n,t){const i=typeof n=="string"?n:"";return!t||typeof t!="object"?i:i.replace(/\{([^}]+)\}/g,(n,i)=>{const r=t[i];return r===undefined||r===null?n:String(r)})}async function nt(n){const i=u(n)||"en";if(a.has(i))return a.get(i);const r=(async()=>{const n=h||y(),r=o.location?.href||document.baseURI;try{const u=await fetch(new URL(`${i}.json`,n||r).href,{cache:"no-store"});if(!u.ok)throw new Error(`HTTP ${u.status}`);const f=await u.json();return t(f?.Localization)?f.Localization:{}}catch(u){return console.warn(`[sc-i18n] Failed to load locale "${i}"`,u),{}}})();return a.set(i,r),r}function e(n,t){const i=n.getAttribute(`data-i18n-${t}-fallback`);if(i!==null)return i;switch(t){case"text":return n.textContent||"";case"title":return n.getAttribute("title")||"";case"placeholder":return n.getAttribute("placeholder")||"";case"aria-label":return n.getAttribute("aria-label")||"";case"value":return n.value||"";default:return""}}function ot(n){if(n&&typeof n.getAttribute=="function"){const t=n.getAttribute("data-i18n-text");t&&(n.textContent=r(t,e(n,"text")));const i=n.getAttribute("data-i18n-title");i&&n.setAttribute("title",r(i,e(n,"title")));const u=n.getAttribute("data-i18n-placeholder");u&&n.setAttribute("placeholder",r(u,e(n,"placeholder")));const f=n.getAttribute("data-i18n-aria-label");f&&n.setAttribute("aria-label",r(f,e(n,"aria-label")));const o=n.getAttribute("data-i18n-value");o&&"value"in n&&(n.value=r(o,e(n,"value")))}}function p(n=document){if(n){const t=[];typeof n.getAttribute=="function"&&t.push(n);typeof n.querySelectorAll=="function"&&t.push(...n.querySelectorAll(ut));t.forEach(n=>ot(n))}}function tt(){const t={...i,effective:n};l.forEach(n=>{try{n(t)}catch(i){console.error("[sc-i18n] listener failed",i)}})}async function it(t){const i=u(t)||"en",r=++g;if(v&&i===n)return document.documentElement.lang=n,p(document),tt(),n;const[e,o]=await Promise.all([nt("en"),i==="en"?Promise.resolve({}):nt(i)]);return r!==g?n:(d=f(f({},e),o),n=i,v=!0,document.documentElement.lang=n,p(document),tt(),n)}function st(n){const t=n?.pluginLocale||n?.controlPanel?.pluginLocale||null;return!t||typeof t!="object"?null:{mode:String(t.mode||"auto"),override:t.override??null,detected:t.detected??null,effective:u(t.effective)||"en"}}function w(){if(!s){const n=()=>{if(!s){if(typeof c.bus?.on!="function"){setTimeout(n,0);return}s=!0;c.bus.on(n=>{const t=st(n);t&&rt(t)})}};n()}}function ht(t={}){return(typeof t.localeRootUrl=="string"&&t.localeRootUrl.trim().length>0?h=y(t.localeRootUrl):h||(h=y()),!k)?(k=!0,w(),it(n)):(s||w(),Promise.resolve(n))}function r(n,t="",i=null){const r=ft(d,n),u=typeof r=="string"?r:String(t??"");return et(u,i)}function ct(n,i=""){return typeof n=="string"?n:t(n)?r(n.key||"",n.fallback??i,n.replacements??null):String(i??"")}function rt(n){const t=typeof n=="string"?{mode:"auto",override:null,detected:null,effective:u(n)||"en"}:{mode:String(n?.mode||i.mode||"auto"),override:n?.override??i.override??null,detected:n?.detected??i.detected??null,effective:u(n?.effective)||"en"};return i=t,it(t.effective)}function lt(t){return typeof t!="function"?()=>{}:(l.add(t),v&&t({...i,effective:n}),()=>l.delete(t))}const o=globalThis,c=o.SCPI=o.SCPI||{},l=new Set,b=new Set(["en","de","fr","es"]),a=new Map,ut="[data-i18n-text],[data-i18n-title],[data-i18n-placeholder],[data-i18n-aria-label],[data-i18n-value]";let k=!1,s=!1,h="",n="en",d={},i={mode:"auto",override:null,detected:null,effective:"en"},v=!1,g=0;c.i18n={init:ht,bindBus:w,onChange:lt,t:r,apply:p,normalizeLocale:u,resolveSpec:ct,setLocaleInfo:rt,getLocaleInfo:()=>({...i,effective:n})}}(),function(){function r(n,t={}){const i=[],r=t.requireToggleCandidates===!0,u=new Set((t.excludeBindingTypes||[]).map(n=>String(n||"").toLowerCase()));return Array.isArray(n)?(n.forEach(n=>{const t=n?.label||"Other",f=Array.isArray(n?.options)?n.options:[];f.forEach(n=>{const f=String(n?.bindingType||"").toLowerCase();if(r){const t=n&&n.details&&n.details.isToggleCandidate===!0;if(!t)return}if(!u.has(f)){const o=String(n?.disabledReason||""),e=f==="unbound",s=!!n?.disabled&&!e;i.push({value:n?.value,legacyValue:n?.legacyValue,text:n?.text,group:t,details:n?.details,bindingType:f,disabledReason:o,unbound:e,disabled:s})}})}),i):i}function u(t={}){const i=t.containerEl||null,r=t.titleEl||null,u=t.descriptionEl||null,o=t.bindingElements||{},a=t.hideContainerWhenEmpty===!0,v=t.showContainerWhenFilled===!0,f=t.selectedOption||null,s=String(t.slotLabel||"").trim(),h=n?.i18n,c=["keyboard","mouse","gamepad","joystick"];if(!f||!f.details){a&&i&&(i.style.display="none");r&&(r.textContent="");u&&(u.textContent="");c.forEach(n=>{const t=o[n]||null;t&&(t.textContent="")});return}v&&i&&(i.style.display="block");const e=f.details,l=String(e.label||f.text||""),y=String(e.description||""),p=Array.isArray(e.devices)?e.devices:[],w=h?.t("PropertyInspector.Common.State.Unbound","Unbound")||"Unbound",b=h?.t("PropertyInspector.Common.State.NoDescription","No description available.")||"No description available.";r&&(r.textContent=s.length>0?`${s}: ${l}`:l);const k={mouse:["mouse","mouseaxis"]};c.forEach(n=>{const t=o[n]||null,r=k[n]||[n],i=p.filter(n=>n.device&&r.includes(n.device.toLowerCase())).flatMap(n=>Array.isArray(n.bindings)?n.bindings:[]).map(n=>String(n.display||n.raw||"")).filter(Boolean),u=i.length>0?i.join(", "):w;t&&(t.textContent=u)});u&&(u.textContent=y||b)}const t=globalThis,n=t.SCPI=t.SCPI||{},i=n.functionPicker=n.functionPicker||{};i.flattenFunctionsData=r;i.updateFunctionDetails=u}(),function(){function e(){return n.SDPIComponents?.streamDeckClient||null}function i(n,t={}){const i=e();if(!i?.send){console.warn("[sc-bus] SDPI streamDeckClient.send not available");return}i.send("sendToPlugin",{event:n,...t})}function s(n,t,u={}){const f=String(n||"").trim();if(!f){i(t,u);return}r.has(f)||(r.add(f),i(t,u))}function h(n){return typeof n!="function"?()=>{}:(t.add(n),()=>t.delete(n))}function c(){if(!u){u=!0;const n=()=>{if(!f){const i=e(),r=i?.sendToPropertyInspector?.subscribe;if(typeof r!="function"){setTimeout(n,0);return}f=!0;i.sendToPropertyInspector.subscribe(n=>{if(n?.event==="sendToPropertyInspector"&&n.payload)for(const i of Array.from(t))try{i(n.payload,n)}catch(r){console.error("[sc-bus] listener failed",r)}})}};n()}}const n=globalThis,o=n.SCPI=n.SCPI||{},t=new Set,r=new Set;let u=!1,f=!1;o.bus={start:c,on:h,send:i,sendOnce:s}}(),function(){function n(n,i=""){const r=t.SCPI?.i18n?.resolveSpec;return typeof r=="function"?r(n,i):typeof n=="string"?n:String(i??"")}function r(){const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("class","pi-dropdown__arrow");n.setAttribute("fill","none");n.setAttribute("height","20");n.setAttribute("width","20");n.setAttribute("xmlns","http://www.w3.org/2000/svg");const t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d","m5 7.5 5 5 5-5"),t.setAttribute("stroke","var(--color-primary)"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.setAttribute("stroke-width","2"),n.appendChild(t),n}function u(t,i={}){const h=!!t.querySelector(".pi-dropdown__search"),c=!!t.querySelector(".pi-dropdown__toggle"),l=!!t.querySelector(".pi-dropdown__menu");if(!h||!c||!l){const a=i.placeholder!==undefined?i.placeholder:t.getAttribute("data-placeholder")||"",v=n(a,t.getAttribute("data-placeholder")||""),u=document.createElement("div");u.className="pi-dropdown__input-row";const e=document.createElement("div");e.className="pi-dropdown__input-wrapper";const f=document.createElement("input");f.className="pi-dropdown__search";f.type="text";f.placeholder=v;e.appendChild(f);const o=document.createElement("div");o.className="pi-dropdown__toggle";o.appendChild(r());u.appendChild(e);u.appendChild(o);const s=document.createElement("div");s.className="pi-dropdown__menu";t.replaceChildren(u,s)}}function f(i={}){function yt(){r.placeholder=n(gt,f.getAttribute("data-placeholder")||"")}function a(){return f.classList.contains("pi-dropdown--open")}function pt(n){tt&&(n?tt.classList.add("pi-dropdown__arrow--open"):tt.classList.remove("pi-dropdown__arrow--open"))}function p(t){if(v.textContent="",!Array.isArray(t)||t.length===0){const t=document.createElement("div");t.className="pi-dropdown__empty-state";t.textContent=n(ni,"No items found");v.appendChild(t);return}if(ht){const n=new Map;for(const i of t){const t=String(ht(i)??"");n.has(t)||n.set(t,[]);n.get(t).push(i)}for(const[t,i]of n.entries()){if(t){const n=document.createElement("div");n.className="pi-dropdown__group-header";n.textContent=t;v.appendChild(n)}for(const n of i)v.appendChild(wt(n))}}else for(const n of t)v.appendChild(wt(n))}function wt(t){const i=document.createElement("div");i.className="pi-dropdown__option";const f=!!t?.unbound,u=dt(t);u&&i.classList.add("disabled");const r=document.createElement("span");if(r.className="pi-dropdown__option-label",r.textContent=k(t),i.appendChild(r),f){const t=document.createElement("span");t.className="pi-dropdown__option-badge pi-dropdown__option-badge--warn";t.textContent="!";t.title=n(ti,"Unbound");i.appendChild(t)}return i.addEventListener("mousedown",()=>{rt=!0}),i.addEventListener("click",()=>{u||ei(t)}),i}function ut(n){const i=(n||"").toLowerCase().trim();let t=h.filter(n=>k(n).toLowerCase().includes(i));return t.length>ot&&(t=t.slice(0,ot)),t}function nt(){if(!s)if(f.classList.add("pi-dropdown--open"),pt(!0),o){const n=(r.value||"").trim();p(n?ut(n):h)}else p(h)}function w(){f.classList.remove("pi-dropdown--open");pt(!1)}function bt(){s||(a()?w():nt())}function ui(n){h=Array.isArray(n)?n:[];a()&&nt()}function fi(n,t={}){if(it=typeof n=="string"?n:"",at){const n=h.find(n=>st(n)===it);r.value=n?k(n):""}t.rerender&&a()&&nt()}function ei(n){s||(it=st(n),at&&(r.value=k(n)),o&&(r.value=""),w(),ct&&ct(n),setTimeout(()=>{rt=!1},200))}function kt(n){if(o&&!s){const t=n?.target?.value??"";p(ut(t));!a()&&String(t).trim()&&nt()}}function oi(){o&&(rt||(a()&&w(),r.value=""))}function si(n){o||s||(n?.stopPropagation?.(),bt())}function li(){if(yt(),e&&s&&(e.textContent=n(c,"Loading")),e&&f.classList.contains("pi-dropdown--success")){const t=n(lt,"");t.trim().length>0&&(e.textContent=t)}if(a())if(o){const n=(r.value||"").trim();p(n?ut(n):h)}else p(h)}function ai(t,i={key:"PropertyInspector.Common.Status.Loading",fallback:"Loading"}){const u=!!t;if(u===s){c=i===undefined?c:i;s&&e&&(e.textContent=n(c,"Loading"));return}if(d+=1,y&&(clearTimeout(y),y=null),u){c=i===undefined?c:i;s=!0;vt=Date.now();w();f.classList.remove("pi-dropdown--success");f.classList.add("pi-dropdown--loading");r.readOnly=!0;r.setAttribute("readonly","");r.blur?.();b.setAttribute("aria-disabled","true");e&&(e.textContent=n(c,"Loading"));return}const o=d,h=Date.now()-vt,l=Math.max(0,ii-h);y=setTimeout(()=>{if(o===d){f.classList.remove("pi-dropdown--loading");f.classList.add("pi-dropdown--success");const t=n(lt,"");e&&t.trim().length>0&&(e.textContent=t);y=setTimeout(()=>{o===d&&(f.classList.remove("pi-dropdown--success"),b.removeAttribute("aria-disabled"),r.readOnly=hi,ci?r.setAttribute("readonly",""):r.removeAttribute("readonly"),s=!1,y=null)},ri)}},l)}const ft=i.rootId;if(!ft)return null;const f=document.getElementById(ft);if(!f)return null;u(f,{placeholder:i.placeholder});const r=f.querySelector(".pi-dropdown__search"),b=f.querySelector(".pi-dropdown__toggle"),tt=f.querySelector(".pi-dropdown__arrow"),v=f.querySelector(".pi-dropdown__menu"),et=f.querySelector(".pi-dropdown__input-wrapper");if(!r||!b||!v)return null;const o=i.searchEnabled!==!1,ot=typeof i.maxResults=="number"?i.maxResults:50,k=typeof i.getText=="function"?i.getText:n=>String(n?.text??""),st=typeof i.getValue=="function"?i.getValue:n=>String(n?.value??""),ht=typeof i.getGroup=="function"?i.getGroup:null,dt=typeof i.isDisabled=="function"?i.isDisabled:n=>!!n?.disabled,ct=typeof i.onSelect=="function"?i.onSelect:null,gt=i.placeholder!==undefined?i.placeholder:f.getAttribute("data-placeholder")||"",ni=i.emptyText!==undefined?i.emptyText:{key:"PropertyInspector.Common.Dropdown.NoItemsFound",fallback:"No items found"},lt=i.successText!==undefined?i.successText:"",ti=i.unboundTitle!==undefined?i.unboundTitle:{key:"PropertyInspector.Common.State.Unbound",fallback:"Unbound"},at=i.displaySelectedInInput!==undefined?!!i.displaySelectedInInput:!o,ii=typeof i.minLoadingMs=="number"?i.minLoadingMs:500,ri=typeof i.successFlashMs=="number"?i.successFlashMs:220;let h=[],it="",rt=!1,s=!1,vt=0,d=0,y=null,c={key:"PropertyInspector.Common.Status.Loading",fallback:"Loading"},l=null,e=null,g=null;if(et){l=document.createElement("div");l.className="pi-dropdown__loading";l.setAttribute("aria-hidden","true");const n=document.createElement("span");n.className="pi-spinner";n.setAttribute("aria-hidden","true");e=document.createElement("span");e.className="pi-dropdown__loading-label";g=document.createElement("span");g.className="pi-dropdown__loading-dots";for(let n=0;n<3;n+=1){const n=document.createElement("span");n.className="pi-dropdown__loading-dot";n.textContent=".";g.appendChild(n)}l.appendChild(e);l.appendChild(g);l.appendChild(n);et.appendChild(l)}o||(r.readOnly=!0,r.setAttribute("readonly",""));const hi=r.readOnly,ci=r.hasAttribute("readonly");yt();t.SCPI?.i18n?.onChange?.(()=>{li()});if(o){const n=t.SCPI?.util?.debounce||t.debounce,i=typeof n=="function"?n(kt,150):kt;r.addEventListener("input",i);r.addEventListener("blur",oi)}else r.addEventListener("click",si);return b.addEventListener("click",n=>{n.stopPropagation(),bt()}),document.addEventListener("click",n=>{f.contains(n.target)||(a()&&w(),o&&(r.value=""))},!0),{setItems:ui,setSelectedValue:fi,setLoading:ai}}const t=globalThis;const i=t.SCPI=t.SCPI||{};i.ui=i.ui||{};i.ui.dropdown={initDropdown:f};t.SCDropdown=t.SCDropdown||i.ui.dropdown}(),function(){function t(t,i=""){const r=n.SCPI?.i18n?.resolveSpec;return typeof r=="function"?r(t,i):typeof t=="string"?t:String(i??"")}function o(n){try{return decodeURIComponent(n)}catch(t){return n}}function r(n){return typeof n!="string"?"":o(String(n).replace(/^C:\\fakepath\\/i,""))}function u(n){return typeof n!="string"||n.length===0?"":n.split("\\").pop().split("/").pop()}function s(n,i={}){const l=n.querySelector(".file-picker-container");if(!l){const c=typeof i.accept=="string"?i.accept:n.getAttribute("data-accept")||"",a=t(i.placeholderText!==undefined?i.placeholderText:n.getAttribute("data-placeholder")||"","No file selected"),v=t(i.buttonText!==undefined?i.buttonText:n.getAttribute("data-button-text")||"","FILE"),y=t(i.selectTitle!==undefined?i.selectTitle:n.getAttribute("data-select-title")||"","Select file"),p=t(i.clearTitle!==undefined?i.clearTitle:n.getAttribute("data-clear-title")||"","Clear"),r=document.createElement("div");r.className="file-picker-container";const e=document.createElement("input");e.type="file";e.style.display="none";c&&e.setAttribute("accept",c);const o=document.createElement("div");o.className="file-picker-display";const s=document.createElement("span");s.className="filename-text";s.textContent=a;o.appendChild(s);const f=document.createElement("button");f.className="file-picker-button";f.type="button";f.title=y;const h=document.createElement("span");h.className="button-icon";h.textContent=v;f.appendChild(h);const u=document.createElement("button");u.className="file-picker-clear";u.type="button";u.title=p;u.disabled=!0;u.textContent="X";r.appendChild(e);r.appendChild(o);r.appendChild(f);r.appendChild(u);n.replaceChildren(r)}}function f(i={}){function ht(){return t(ut,"No file selected")}function nt(){const u=t(ft,"FILE"),n=t(et,"Select file"),i=t(ot,"Clear");o.title=n;o.setAttribute("aria-label",n);h.title=i;h.setAttribute("aria-label",i);const r=o.querySelector(".button-icon");r&&(r.textContent=u);c||a("")}function a(n){const t=typeof n=="string"&&n.length>0,i=t?st==="full"?n:u(n):ht();p.textContent=i;p.title=t?n:"";h.disabled=!t}function e(n,t={}){const r=t.persist!==!1,u=!!t.silent,i=typeof n=="string"?n:"";if(c=i,a(c),!u&&d)try{d(c)}catch(f){}if(r&&b){w=!0;try{b(i.length>0?i:null)}finally{setTimeout(()=>{w=!1},50)}}}function it(){l.value="";e("",{persist:!0})}const k=i.rootId,f=k?document.getElementById(k):null;if(!f)return null;s(f,i);const rt=i.filenameSelector||".filename-text",ut=i.placeholderText!==undefined?i.placeholderText:{key:"PropertyInspector.Common.FilePicker.NoFileSelected",fallback:"No file selected"},ft=i.buttonText!==undefined?i.buttonText:{key:"PropertyInspector.Common.FilePicker.Button",fallback:"FILE"},et=i.selectTitle!==undefined?i.selectTitle:{key:"PropertyInspector.Common.FilePicker.SelectFile",fallback:"Select file"},ot=i.clearTitle!==undefined?i.clearTitle:{key:"PropertyInspector.Common.FilePicker.Clear",fallback:"Clear"},v=i.settingsKey,st=i.displayMode||"basename",d=typeof i.onValueChanged=="function"?i.onValueChanged:null,g=typeof i.initialValue=="string"?i.initialValue:"",l=f.querySelector('input[type="file"]'),o=f.querySelector(".file-picker-button"),h=f.querySelector(".file-picker-clear"),y=f.querySelector(".file-picker-display"),p=y?y.querySelector(rt):null;if(!l||!o||!h||!y||!p)return null;let c="",w=!1,b=null,tt=null;o.addEventListener("click",()=>{l.click()});l.addEventListener("change",n=>{const t=n?.target?.files?.[0],u=n?.target?.value||"",f=r(u),i=t?.path||f;if(i){e(i,{persist:!0});return}t?.name&&a(t.name)});h.addEventListener("click",()=>{it()});typeof v=="string"&&v.length>0&&n.SDPIComponents?.useSettings&&([tt,b]=n.SDPIComponents.useSettings(v,n=>{w||e(typeof n=="string"?n:"",{persist:!1})}),Promise.resolve(tt()).then(n=>{e(typeof n=="string"?n:"",{persist:!1})}).catch(()=>{}));a("");nt();n.SCPI?.i18n?.onChange?.(()=>{nt()});return g&&e(g,{persist:!1,silent:!0}),{setValue:e,clear:it,getValue:()=>c}}function e(i={}){function p(n){const i=typeof n=="string"&&n.length>0,r=i?ot==="full"?n:u(n):t(et,"No file selected");a.textContent=r;a.title=i?n:"";l.disabled=!i}function e(n,t={}){const r=t.persist!==!1,u=!!t.silent,i=typeof n=="string"?n:"";if(h=i,p(h),!u&&w)try{w(h)}catch(f){}if(r&&y){v=!0;try{y(i.length>0?i:null)}finally{setTimeout(()=>{v=!1},50)}}}function nt(){o.value="";e("",{persist:!0})}if(typeof i.rootId=="string"&&i.rootId.length>0)return f(i);const tt=i.inputId,it=i.buttonId,rt=i.clearId,ut=i.displayId,ft=i.filenameSelector||".filename-text",et=i.placeholderText!==undefined?i.placeholderText:{key:"PropertyInspector.Common.FilePicker.NoFileSelected",fallback:"No file selected"},c=i.settingsKey,ot=i.displayMode||"basename",w=typeof i.onValueChanged=="function"?i.onValueChanged:null,b=typeof i.initialValue=="string"?i.initialValue:"",o=document.getElementById(tt),k=document.getElementById(it),l=document.getElementById(rt),s=document.getElementById(ut),a=s?s.querySelector(ft):null;if(!o||!k||!l||!s||!a)return null;const st=document.createElement("div"),d=s.closest(".file-picker-container");d&&st.appendChild(d.cloneNode(!0));let h="",v=!1,y=null,g=null;return k.addEventListener("click",()=>{o.click()}),o.addEventListener("change",n=>{const t=n?.target?.files?.[0],u=n?.target?.value||"",f=r(u),i=t?.path||f;if(i){e(i,{persist:!0});return}t?.name&&p(t.name)}),l.addEventListener("click",()=>{nt()}),typeof c=="string"&&c.length>0&&n.SDPIComponents?.useSettings&&([g,y]=n.SDPIComponents.useSettings(c,n=>{v||e(typeof n=="string"?n:"",{persist:!1})}),Promise.resolve(g()).then(n=>{e(typeof n=="string"?n:"",{persist:!1})}).catch(()=>{})),p(""),b&&e(b,{persist:!1,silent:!0}),{setValue:e,clear:nt,getValue:()=>h}}const n=globalThis;const i=n.SCPI=n.SCPI||{};i.ui=i.ui||{};i.ui.filePicker={createFilePicker:f,initFilePicker:e};n.SCFilePicker=n.SCFilePicker||{initFilePicker:e}}(),function(){function i(n,t){if(n&&typeof n=="string"){t&&(t.href=`../css/themes/${n}`);try{localStorage.setItem(r,n)}catch(i){}}}function u(r={}){const o=r.rootId||"themeDropdown",s=r.linkId||"pi-theme-styles",u=document.getElementById(s);if(u){let e=[];n.bus?.start?.();const f=n.ui?.dropdown?.initDropdown?.({rootId:o,searchEnabled:!1,displaySelectedInInput:!0,minLoadingMs:500,successFlashMs:220,placeholder:{key:"PropertyInspector.ControlPanel.ThemePlaceholder",fallback:"Selected theme"},emptyText:{key:"PropertyInspector.Common.Dropdown.NoThemesFound",fallback:"No themes found"},getText:n=>String(n?.name??""),getValue:n=>String(n?.file??""),onSelect:r=>{const f=String(r?.file??"");f&&(i(f,u),(n.bus?.send||n.util?.sendToPlugin||t.sendToPlugin)?.("setTheme",{themeFile:f}))}});f?.setLoading?.(!0,{key:"PropertyInspector.Common.Status.LoadingThemes",fallback:"Loading themes"});n.bus?.on?.(n=>{if(n&&(n.themesLoaded&&(e=n.themes||[],f?.setItems?.(e),f?.setLoading?.(!1)),typeof n.selectedTheme=="string"&&n.selectedTheme.length>0)){const t=n.selectedTheme;i(t,u);f?.setSelectedValue?.(t,{rerender:!0})}});try{const t=u.getAttribute("href")||"",n=t.split("/").pop().split("?")[0];n&&(i(n,u),f?.setSelectedValue?.(n,{rerender:!0}))}catch(h){}}}const t=globalThis,n=t.SCPI=t.SCPI||{},r="scsd.selectedTheme";n.theme={initThemeDropdown:u};t.SCTheme=t.SCTheme||n.theme}() diff --git a/PluginCore/PropertyInspector/js/src/pi-dial-action.js b/PluginCore/PropertyInspector/js/src/pi-dial-action.js index d18c392..2e07d08 100644 --- a/PluginCore/PropertyInspector/js/src/pi-dial-action.js +++ b/PluginCore/PropertyInspector/js/src/pi-dial-action.js @@ -41,7 +41,7 @@ const slotStates = slotConfigs.map((config) => { const dropdown = SCPI?.ui?.dropdown?.initDropdown?.({ rootId: config.rootId, - placeholder: {key: config.placeholderKey, fallback: config.placeholderFallback}, + placeholder: { key: config.placeholderKey, fallback: config.placeholderFallback }, searchEnabled: true, minLoadingMs: 0, successFlashMs: 100, @@ -54,7 +54,7 @@ getValue: (opt) => String(opt?.value ?? ''), getGroup: (opt) => String(opt?.group ?? ''), isDisabled: (opt) => !!opt?.disabled, - onSelect: (opt) => selectOption(config.settingsKey, opt, {persist: true}) + onSelect: (opt) => selectOption(config.settingsKey, opt, { persist: true }) }); dropdown?.setLoading?.(true, { @@ -82,10 +82,10 @@ SCPI?.ui?.filePicker?.createFilePicker?.({ rootId: 'audioFilePicker', - placeholderText: {key: 'PropertyInspector.Common.FilePicker.NoFileSelected', fallback: 'No file selected'}, - buttonText: {key: 'PropertyInspector.Common.FilePicker.Button', fallback: 'FILE'}, - selectTitle: {key: 'PropertyInspector.Common.Audio.SelectTitle', fallback: 'Select audio file'}, - clearTitle: {key: 'PropertyInspector.Common.Audio.ClearTitle', fallback: 'Clear audio file'}, + placeholderText: { key: 'PropertyInspector.Common.FilePicker.NoFileSelected', fallback: 'No file selected' }, + buttonText: { key: 'PropertyInspector.Common.FilePicker.Button', fallback: 'FILE' }, + selectTitle: { key: 'PropertyInspector.Common.Audio.SelectTitle', fallback: 'Select audio file' }, + clearTitle: { key: 'PropertyInspector.Common.Audio.ClearTitle', fallback: 'Clear audio file' }, settingsKey: 'clickSoundPath' }); @@ -130,7 +130,7 @@ return flatten(groups, { requireToggleCandidates: false, - excludeBindingTypes: ['mouseaxis', 'joystick', 'gamepad'] + excludeBindingTypes: ['joystick', 'gamepad'] }); } @@ -139,7 +139,7 @@ slotStates.forEach((slot) => { slot.dropdown?.setItems?.(allOptions); - slot.dropdown?.setSelectedValue?.(slot.currentValue, {rerender: false}); + slot.dropdown?.setSelectedValue?.(slot.currentValue, { rerender: false }); if (slot.currentValue) { syncSelection(slot.settingsKey, slot.currentValue); @@ -164,7 +164,7 @@ } const isLegacyMatch = opt.legacyValue === value && opt.value !== value; - selectOption(settingsKey, opt, {persist: isLegacyMatch}); + selectOption(settingsKey, opt, { persist: isLegacyMatch }); } function selectOption(settingsKey, opt, opts = {}) { @@ -177,7 +177,7 @@ isSelectingOption = true; slot.currentValue = opt.value; - slot.dropdown?.setSelectedValue?.(opt.value, {rerender: true}); + slot.dropdown?.setSelectedValue?.(opt.value, { rerender: true }); updateFunctionDetails(slot, opt); if (persist) { @@ -259,7 +259,7 @@ slotStates.forEach((slot) => { const savedValue = slot.getValue(); slot.currentValue = savedValue || ''; - slot.dropdown?.setSelectedValue?.(slot.currentValue, {rerender: false}); + slot.dropdown?.setSelectedValue?.(slot.currentValue, { rerender: false }); updateFunctionDetails(slot, null); }); diff --git a/PluginCore/PropertyInspector/js/src/sc-common.js b/PluginCore/PropertyInspector/js/src/sc-common.js index 26a3a4e..ee25d47 100644 --- a/PluginCore/PropertyInspector/js/src/sc-common.js +++ b/PluginCore/PropertyInspector/js/src/sc-common.js @@ -528,20 +528,23 @@ titleEl.textContent = slotLabel.length > 0 ? `${slotLabel}: ${title}` : title; } + const deviceAliases = { + mouse: ['mouse', 'mouseaxis'] + }; + devices.forEach((deviceType) => { - const deviceData = detailDevices.find((d) => d.device && d.device.toLowerCase() === deviceType); const bindingEl = bindingElements[deviceType] || null; + const matches = deviceAliases[deviceType] || [deviceType]; - let bindingValue = unboundText; - if (deviceData && Array.isArray(deviceData.bindings) && deviceData.bindings.length > 0) { - const bindingLines = deviceData.bindings - .map((binding) => String(binding.display || binding.raw || '')) - .filter((text) => text); + const bindingLines = detailDevices + .filter((d) => d.device && matches.includes(d.device.toLowerCase())) + .flatMap((d) => Array.isArray(d.bindings) ? d.bindings : []) + .map((binding) => String(binding.display || binding.raw || '')) + .filter(Boolean); - if (bindingLines.length > 0) { - bindingValue = bindingLines.join(', '); - } - } + const bindingValue = bindingLines.length > 0 + ? bindingLines.join(', ') + : unboundText; if (bindingEl) { bindingEl.textContent = bindingValue;