-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(public-upload-api): allow to switch activity to the cloud image …
…editor with predefined file opened
- Loading branch information
Showing
9 changed files
with
117 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { UploadCtxProvider } from '../../index.js'; | ||
|
||
const instance = new UploadCtxProvider(); | ||
const api = instance.getAPI(); | ||
|
||
api.addFileFromUrl('https://example.com/image.png'); | ||
|
||
api.setCurrentActivity('camera'); | ||
api.setCurrentActivity('cloud-image-edit', { internalId: 'id' }); | ||
api.setCurrentActivity('external', { | ||
externalSourceType: 'type', | ||
}); | ||
|
||
// @ts-expect-error - should not allow to set activity without params | ||
api.setCurrentActivity('cloud-image-edit'); | ||
// @ts-expect-error - should not allow to set activity without params | ||
api.setCurrentActivity('external'); | ||
|
||
// @ts-expect-error - should not allow to set activity with invalid params | ||
api.setCurrentActivity('camera', { | ||
invalidParam: 'value', | ||
}); | ||
api.setCurrentActivity('cloud-image-edit', { | ||
// @ts-expect-error - should not allow to set activity with invalid params | ||
invalidParam: 'value', | ||
}); | ||
api.setCurrentActivity('external', { | ||
// @ts-expect-error - should not allow to set activity with invalid params | ||
invalidParam: 'value', | ||
}); | ||
|
||
// should allow to set some custom activity | ||
api.setCurrentActivity('my-custom-activity'); | ||
api.setCurrentActivity('my-custom-activity', { myCustomParam: 'value' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters