Comments (5)
... hopefully getting the names and codes isn’t a pain ...
It shouldn't be if you know where to look.
from shortcuts-js.
Hey @gcordalis, sounds like a great idea!
My only suggestion would be have an options
object, rather than an shortcutIcon
object, as in the future we might want to add additional configurable options (import questions, input types, etc).
Maybe then, your example could be as follows:
exports.buildShortcutTemplate = (actions = [], options) => ({
WFWorkflowClientVersion: '724',
WFWorkflowClientRelease: '2.1',
WFWorkflowIcon: {
WFWorkflowIconStartColor: options.icon.color,
WFWorkflowIconGlyphNumber: options.icon.glyph,
},
// ...
};
The other thing to consider is how the user will actually select their icon/colour. We'll likely need to store the values of the different available colours / glyphs, to make it easy for the user to select.
Maybe we could have something like:
import {
buildShortcut,
ICON,
} from '@joshfarrant/shortcuts-js';
buildShortcut([], {
icon: {
color: ICON.COLORS.ORANGE,
glyph: ICON.GLYPHS.ROCKET,
},
});
Or, we could pull in the icon info from elsewhere:
import {
buildShortcut,
} from '@joshfarrant/shortcuts-js';
import {
ICON,
} from '@joshfarrant/shortcuts-js/meta';
buildShortcut([], {
icon: {
color: ICON.COLORS.ORANGE,
glyph: ICON.GLYPHS.ROCKET,
},
});
The later method gives us more flexibility down the road when it comes to things like WFWorkflowInputContentItemClasses
and WFWorkflowTypes
(see here).
Input on this would be great, but feel free to crack on with it in the meantime! And if you'd like any help with the TS side of things just let me know 😃.
from shortcuts-js.
Options sounds great and definitely adds flexibility down the road.
I’ve got all the colours stored, working on glyphs today (hopefully getting the names and codes isn’t a pain) then I’ll have a crack at the TS side again.
from shortcuts-js.
It shouldn't be if you know where to look.
Fantastic! 🎉
from shortcuts-js.
Closing this as the main feature discussed here has been implemented. Further discussion can either be done in its own issue, or in #45 if relevant. 🙂
from shortcuts-js.
Related Issues (20)
- iOS 13 Beta does not support Shortcut imports through AirDrop HOT 16
- Color and glyphs are not available HOT 3
- Add Bear actions
- Is it possible to port the "shortcuts" app to Android? Parsing the file format and Implement the action. HOT 1
- Speak Text HOT 3
- Better Contribution flow
- Add Replace Text Action
- Add Change Case Action
- Error in REDME
- Hacktoberfest Opt-in HOT 1
- Shortcut parser needs to support both binary bplist and xml plist
- Creating ShortCut URL in iCloud
- How do I get started? HOT 1
- Add getFile Action
- Looking for new maintainers 💖 HOT 21
- Json shortcut
- Getting Shortcuts to "tap" items on the screen HOT 1
- Chrome warns about usage of navigator.userAgent, navigator.appVersion, and navigator.platform HOT 1
- Shortcut for iOS setting?
- Jump/Go to Bottom of Page Request
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shortcuts-js.