description |
---|
CushyApps can be started form both context menu. this page shows how your custom app can support that |
Contextual apps allow you start any app (workflow) from an existing image ( image-comtext-menu.md) or selection (unified-canvas)
- Add canStartFromImage
app({
...
canStartFromImage: true,
})
- update your
run
handler to take a third param
// 馃憞馃憞馃憞馃憞馃憞
run: async (run, ui, startImg) => {
once your CushyApp is start-from-image enabled, you can just create new drafts of your app.
Every draft will show as a new menu entry
Supporting both is easy.
run: async (run, ui, startImg) => {
// if startImg is null, it will take ui.startImage instead
let img = startImg ?? ui.startImage
}
look at the library/quick-actions/*
- library/built-in/quick-actions/quick-dispace.ts
- library/built-in/quick-actions/quick-refine.ts
- ...