-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Isolate the core of Imjoy into a stand-alone library (#211)
* wrap imjoy as a library * use minibus instead of Vue * add window manager * add deployment script for imjoy-lib * export joy * support url * merge build-lib and build-libdev * update deploy script * Enable allow-same-origin from lib.imjoy.io * support pwa for imjoy-lib.html * fix format * fix branch name * add plugin service worker * add dist to git ignore * merge build command * cache plugin requirements * move api from imjoy.vue to pluginManager * add plugin menu to imjoy-lib * fix lib.imjoy url * bump version * fix requirements typo * move requirements caching to iframe * fix plugin sw * fix scope * support offline using service worker * fix lib.imjoy.io strategy * support file cache * activate service worker immediately * fix log * Remove log * add imjoy lite * improve lite page * set welcome plugin as default * load welcome plugin if no plugin installed * add docs for offline cache * clean up allow-same-origin * fix allow-same-origin * set default plugin for imjoy-lite * control permissions * add permissions to docs * use minified imjoy-lib in lite.html
- Loading branch information
Showing
43 changed files
with
2,005 additions
and
1,064 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -192,7 +192,8 @@ Defines the general properties of a plugin with several fields. | |
"inputs": null, | ||
"outputs": null, | ||
"env": null, | ||
"requirements": null, | ||
"permissions": [], | ||
"requirements": [], | ||
"dependencies": [] | ||
} | ||
``` | ||
|
@@ -374,6 +375,22 @@ used to create an environment to run the plugin. | |
|
||
For more details see the dedicated [section](development?id=virtual-environments) | ||
|
||
#### permissions | ||
For `window` plugins, the following permissions can be decleared: | ||
* same-origin | ||
* camera | ||
* midi | ||
* geolocation | ||
* microphone | ||
* encrypted-media | ||
* full-screen | ||
* payment-request | ||
|
||
For example, if your window plugin requires webcam access, add the following permission: | ||
``` | ||
"permissions": ["camera"], | ||
``` | ||
|
||
#### requirements | ||
Defines the plugin requirements. | ||
|
||
|
@@ -495,6 +512,12 @@ If the url does not end with `.js`, you need to add `js:` before it, for example | |
"requirements": ["js:https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]"] | ||
``` | ||
|
||
For offline access, Javascript and CSS files will be automatically cached if added to `requirements`, | ||
if you want add additional files to the offline cache, please use the `cache:` prefix. For example: | ||
```json | ||
"requirements": ["cache:https://use.fontawesome.com/releases/v5.8.2/webfonts/fa-solid-900.woff2"] | ||
``` | ||
|
||
### Web Python | ||
Requirements are specified as a list of strings specifying the required python modules. For instance, | ||
|
||
|
@@ -807,7 +830,7 @@ Therefore, we provide several different ways to handle loading/saving files for | |
with or without the plugin engine. | ||
|
||
* If the **Plugin Engine** is running, there are three api functions for **all** types of | ||
plugins to access the local file system: `api.showFileDialog`, `api.getFileUrl`, `api.getFilePath`. | ||
plugins to access the local file system: `api.showFileDialog`, `api.getFileUrl`, `api.requestUploadUrl`. | ||
Specifically for **Python plugins** running on the plugin engine, files can be directly | ||
loaded and written to the file system with standard python file operations. | ||
|
||
|
Binary file not shown.
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 |
---|---|---|
|
@@ -33,7 +33,7 @@ git config user.name "Travis CI" | |
git config user.email "[email protected]" | ||
|
||
# Remove all existing files | ||
rm -rf ./* | ||
ls -A1 | xargs rm -rf | ||
|
||
# Copy dirs and files and that we want to update. | ||
cp -Rf ../web/dist/* ./ | ||
|
Oops, something went wrong.