geekyeggo / sdpi-components Goto Github PK
View Code? Open in Web Editor NEWWeb components for your Stream Deck plugin; take the hassle out of the property inspector.
Home Page: https://sdpi-components.dev
License: MIT License
Web components for your Stream Deck plugin; take the hassle out of the property inspector.
Home Page: https://sdpi-components.dev
License: MIT License
sdpi-password should support placeholder
and required
, similar to sdpi-textfield.
I was perusing this as a potential overhaul for my PI, but I currently use the onchange="funcXYZ(this.value)"
to react to changes when a new selection is made.
I can't seem to get it to work?
To set the stage: I'm currently working on a StreamDeck plugin for Firebot, a Twitch chatbot. Firebot has something called preset effect lists, that can be controlled via API. Effect lists can have variables that you can pass on execution. I'd love to essentially have a group of sdpi-textfields that are controlled by a data source (array of label strings) that output into an object as it would greatly simplify my end of things with the plugin.
@GeekyEggo Would you be okay with having a component like this? If so, I'll have a look at implementing and contributing it.
The Stream Deck SDK provides support for localization in the form of multiple manifest files suffixed with locale codes, e.g. manifest.de.json
; official, Stream Deck offers support for the following languages:
For content rendered as part of sdpi-components, it should be possible to offer a means of displaying translated content. This should be achievable in a centralized way that reduces duplication of both resources, and changes as part of sdpi-components.
A new top-level object-instance will be added to the SDPIComponents
namespace on the window, named i18n
. This new object will enable interaction with translations, including specifying available resources. It will be up to the consumer to provide resources, and interact with this object to specify the available languages and their resources. An example of this interaction is:
SDPIComponents.i18n.locales = {
en: {
greeting: 'Hello'
},
es: {
greeting: 'Hola'
},
fr: {
greeting: 'Salut'
}
};
When discovering a localization, the following hierarchy is used:
info.language
.__MSG_hello__
.Given the following translations, and property inspector HTML.
SDPIComponents.i18n.locales = {
en: {
fav_color: "Favourite Color",
please_choose_color: "Please choose a color",
red: "Red",
green: "Green",
blue: "Blue",
},
...
};
<sdpi-item label="__fav_color__">
<sdpi-select setting="color" placeholder="__MSG_please_choose_color__">
<optgroup label="__MSG_primary_colors__">
<option value="#ff0000">__MSG_red__</option>
<option value="#00ff00">__MSG_green__</option>
<option value="#0000ff">__MSG_blue__</option>
</optgroup>
</sdpi-select>
</sdpi-item>
When the language is en
, the element will render as follows:
<sdpi-item label="Favourite Color">
<sdpi-select setting="color" placeholder="Please choose a color">
<optgroup label="Primary Colors">
<option value="#ff0000">Red</option>
<option value="#00ff00">Green</option>
<option value="#0000ff">Blue</option>
</optgroup>
</sdpi-select>
</sdpi-item>
To accommodate translations, the following initial changes will need to be made.
sdpi-i18n
element that provides a way of rendering content from a resource.sdpi-item
sdpi-checkbox
sdpi-checkbox-list
1sdpi-radio
1sdpi-select
1sdpi-select
sdpi-textfield
1 Translations will be applied to dynamic data sources.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.