- Implements API methods through right click - Refactor events - Refactor usage of setHistory and setHistoryCurrentStep into a single function - Update ContainerOperations documentations - Added AddContainers in order to add multiple containers + refactor AddContainer to use it - Fix regression - Fix AddContainer at index
22 lines
428 B
JavaScript
22 lines
428 B
JavaScript
onmessage = (e) => {
|
|
const data = JSON.stringify(e.data.editorState, getCircularReplacer(), e.data.spaces);
|
|
postMessage(data);
|
|
};
|
|
|
|
const getCircularReplacer = () => {
|
|
return (key, value) => {
|
|
if (key === 'parent') {
|
|
return;
|
|
}
|
|
|
|
if (key === 'symbols') {
|
|
return Array.from(value.entries());
|
|
}
|
|
|
|
if (key === 'linkedContainers') {
|
|
return Array.from(value);
|
|
}
|
|
|
|
return value;
|
|
};
|
|
};
|