-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4cddfea
commit 5289b4a
Showing
58 changed files
with
643 additions
and
378 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
- ? How can I list all plugins that are active | ||
- ? How can I deactivate a plugin | ||
- ? we should pass the PluginContext with seperate `{engine?: ImglyEngine, editor?: ImglyEditor, ui?: ImglyUI` | ||
|
||
- `feature.isEnabled` should be feature.isEnabledFor(blockId) -> test for multiple blockIds at once | ||
- [ ] How can I list all plugins that are active | ||
- [ ] How can I deactivate a plugin later completely? `enableFeatures`, but this must be per "command". A plugin might contribute multiple features? | ||
- [ ] we should pass the PluginContext with separate `imgly: {engine?: ImglyEngine, editor?: ImglyEditor, ui?: ImglyUI` | ||
- [ ] We can already establish the name 'imgly" for the PLUGINS | ||
- [ ] `unstable_getCanvasMenuOrder` should maybe be called `unstable_getCanvasMenuEntries` | ||
- [ ] `unstable_setCanvasMenuOrder` should maybe be called `unstable_setCanvasMenuEntries` | ||
- [ ] `unstable_enableFeatures` what is it used for. the button is not displayed when I check it internally | ||
- [ ] `unstable_enableFeatures` should get the blocks it should evaluate it for. It's not always the selected ones in every scenario. | ||
- [ ] `enable_features` could probably better be named `enableFeatureInContext()` | ||
- [ ] What is the intention of the `builder.Button` first parameter, where is the id used later? | ||
- [ ] (Exkurs) How can I change the type of a block to another. E.g. Change a Graphic Block into a Group Block for Vectorizer and the ID should stay the same and all properties that are relevant. "Turn into" | ||
- [ ] The separation of ui and engine is sometimes too hard to use. I propose not to make it dependent on initUI and init. But more like lifecycles in general and always pass {ui?, engine, editor} | ||
- [ ] `upload` should maybe be part of the asset sources and/or part of engine |
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 @@ | ||
TBD |
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,40 @@ | ||
# IMG.LY CE.SDK Plugin Vectorizer | ||
|
||
This plugin introduces a vectorizer for the CE.SDK editor. | ||
|
||
## Installation | ||
|
||
You can install the plugin via npm or yarn. Use the following commands to install the package: | ||
|
||
``` | ||
yarn add @imgly/plugin-vectorizer-web | ||
npm install @imgly/plugin-vectorizer-web | ||
``` | ||
|
||
## Usage | ||
|
||
Adding the plugin to CE.SDK will automatically add a vectorizer | ||
canvas menu entry for every block with an image fill. | ||
|
||
```typescript | ||
import CreativeEditorSDK from '@cesdk/cesdk-js'; | ||
import VectorizerPlugin from '@imgly/plugin-vectorizer-web'; | ||
|
||
const config = { | ||
license: '<your-license-here>', | ||
callbacks: { | ||
// Please note that the vectorizer plugin depends on an correctly | ||
// configured upload. 'local' will work for local testing, but in | ||
// production you will need something stable. Please take a look at: | ||
// https://img.ly/docs/cesdk/ui/guides/upload-images/ | ||
onUpload: 'local' | ||
} | ||
}; | ||
|
||
const cesdk = await CreativeEditorSDK.create(container, config); | ||
await cesdk.addDefaultAssetSources(), | ||
await cesdk.addDemoAssetSources({ sceneMode: 'Design' }), | ||
await cesdk.unstable_addPlugin(VectorizerPlugin()); | ||
|
||
await cesdk.createDesignScene(); | ||
``` |
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 @@ | ||
<!-- https://nextjs.org/docs/getting-started/project-structure --> |
File renamed without changes.
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,58 @@ | ||
import chalk from 'chalk'; | ||
import { readFile } from 'fs/promises'; | ||
|
||
// import packageJson from '../package.json' assert { type: 'json' }; | ||
// Avoid the Experimental Feature warning when using the above. | ||
const packageJson = JSON.parse( | ||
await readFile(new URL('../package.json', import.meta.url)) | ||
); | ||
|
||
|
||
const dependencies = Object.keys(packageJson.dependencies) | ||
const peerDependencies = Object.keys(packageJson.peerDependencies) | ||
const externals = [...dependencies, ...peerDependencies] | ||
|
||
console.log( | ||
chalk.yellow('Building version: '), | ||
chalk.green(packageJson.version) | ||
); | ||
|
||
const configs = [ | ||
{ | ||
entryPoints: ['src/index.ts', "src/worker.ts"], | ||
define: { | ||
PLUGIN_VERSION: `"${packageJson.version}"` | ||
}, | ||
minify: true, | ||
bundle: true, | ||
sourcemap: true, | ||
external: externals, | ||
platform: 'node', | ||
format: 'esm', | ||
outdir: 'dist', | ||
outExtension: { '.js': '.mjs' }, | ||
plugins: [ | ||
{ | ||
name: 'reporter', | ||
setup(build) { | ||
build.onEnd((result) => { | ||
console.log( | ||
`[${new Date().toLocaleTimeString(undefined, { | ||
hour: 'numeric', | ||
minute: '2-digit', | ||
second: '2-digit', | ||
hour12: false | ||
})}] Build ${ | ||
result.errors.length | ||
? chalk.red('failed') | ||
: chalk.green('succeeded') | ||
}` | ||
); | ||
}); | ||
} | ||
} | ||
] | ||
} | ||
]; | ||
|
||
export default configs; |
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,3 @@ | ||
// These constants here are added by the base esbuild config | ||
|
||
declare const PLUGIN_VERSION: string; |
Oops, something went wrong.