This file contains hidden or 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
import { PingPongChannelApi } from "ping-pong-view/dist/api"; | |
let pings = 0; | |
let pongs = 0; | |
export function PingPongViewsPage() { | |
const [lastPing, setLastPing] = useState<string>("-"); | |
const [lastPong, setLastPong] = useState<string>("-"); | |
const api: PingPongChannelApi = useMemo(() => { |
This file contains hidden or 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
export function TodoListViewPage() { | |
const todoListViewRef = useRef<TodoListApi>(null); | |
return ( | |
<Page> | |
<div className={"webapp--page-main-div"}> | |
<ActionsSidebar todoListViewRef={todoListViewRef} /> | |
<PageSection> | |
<EmbeddedTodoList | |
ref={todoListViewRef} |
This file contains hidden or 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
const editorEnvelopeLocator: EditorEnvelopeLocator = useMemo(() => { | |
return { | |
targetOrigin: window.location.origin, | |
mapping: new Map([ | |
[ | |
"bpmn", | |
{ | |
resourcesPathPrefix: "https://kiegroup.github.io/kogito-online/editors/0.7.0/bpmn", | |
envelopePath: "https://kiegroup.github.io/kogito-online/editors/0.7.0/envelope", | |
}, |
This file contains hidden or 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
import { EmbeddedEditor, useEditorRef } from "@kogito-tooling/editor/dist/embedded"; | |
export function DmnPage() { | |
// | |
const { editor, ref } = useEditorRef(); | |
return ( | |
<Page> | |
<div className={"webapp--page-main-div"}> |
This file contains hidden or 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
import { EditorEnvelopeLocator } from "@kogito-tooling/editor/dist/api"; | |
export function DmnPage() { | |
// ... | |
const editorEnvelopeLocator: EditorEnvelopeLocator = useMemo(() => { | |
return { | |
targetOrigin: window.location.origin, | |
mapping: new Map([ | |
[ |
This file contains hidden or 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
import { File } from "@kogito-tooling/editor/dist/embedded"; | |
export function DmnPage() { | |
const [file, setFile] = useState<File>({ | |
fileName: "new-file", | |
fileExtension: "dmn", | |
getFileContents: () => Promise.resolve(""), | |
isReadOnly: false, | |
}); |
This file contains hidden or 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
import { EditorEnvelopeLocator } from "@kogito-tooling/editor/dist/embedded"; | |
export function Base64PngPage() { | |
// ... | |
return ( | |
<Page> | |
<div className={"webapp--page-main-div"}> | |
<Base64PngGallery setFile={setFile} /> | |
<EmbeddedEditor |
This file contains hidden or 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
import { EditorEnvelopeLocator } from "@kogito-tooling/editor/dist/api"; | |
export function Base64PngPage() { | |
// ... | |
const editorEnvelopeLocator: EditorEnvelopeLocator = useMemo(() => { | |
return { | |
targetOrigin: window.location.origin, | |
mapping: new Map([ | |
[ |
This file contains hidden or 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
import { File } from "@kogito-tooling/editor/dist/embedded"; | |
export function Base64PngPage() { | |
const [file, setFile] = useState<File>({ | |
fileName: "new-file", | |
fileExtension: "base64png", | |
getFileContents: () => Promise.resolve(""), | |
isReadOnly: false, | |
}); | |
This file contains hidden or 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
import { EnvelopeBusMessage } from "@kogito-tooling/envelope-bus/dist/api"; | |
import { init } from "ping-pong-view/dist/envelope"; | |
import { PingPongReactImplFactory } from "ping-pong-view-react"; | |
init({ | |
container: document.getElementById("envelope-app")!, | |
bus: { | |
postMessage<D, Type>(message: EnvelopeBusMessage<D, Type>, targetOrigin?: string, transfer?: any) { | |
window.parent.postMessage(message, "*", transfer); | |
}, |