Skip to content

Instantly share code, notes, and snippets.

@ljmotta
Created October 13, 2020 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ljmotta/022dc63bf2b4980455b3f6219cfd9202 to your computer and use it in GitHub Desktop.
Save ljmotta/022dc63bf2b4980455b3f6219cfd9202 to your computer and use it in GitHub Desktop.
Base64Png Chrome Extension
import { init } from "@kogito-tooling/editor/dist/envelope";
import { EnvelopeBusMessage } from "@kogito-tooling/envelope-bus/dist/api";
import { ChannelType, getOperatingSystem } from "@kogito-tooling/channel-common-api";
import { Base64PngEditorFactory } from "base64png-editor";
init({
container: document.getElementById("envelope-app")!,
bus: {
postMessage<D, T>(message: EnvelopeBusMessage<D, T>, targetOrigin?: string, _?: any) {
window.parent.postMessage(message, targetOrigin!, _);
},
},
editorFactory: new Base64PngEditorFactory(),
editorContext: { channel: ChannelType.GITHUB, operatingSystem: getOperatingSystem() },
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment