Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 0257eaf

Browse files
committed
fixes
1 parent 869fdb1 commit 0257eaf

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

packages/core/src/JWPlugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export class JWPlugin<T extends JWPluginConfig = {}> {
3333
async stop(): Promise<void> {
3434
// This is where plugins can do asynchronous work when the editor is
3535
// stopping (e.g. save on a server, close connections, etc).
36+
this.dependencies.clear();
37+
this.editor = null;
3638
}
3739
}
3840
export interface JWPlugin {

packages/plugin-dom-editable/src/DomEditable.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export class DomEditable<T extends JWPluginConfig = JWPluginConfig> extends JWPl
3737
async stop(): Promise<void> {
3838
this.eventNormalizer.destroy();
3939
window.removeEventListener('keydown', this._processKeydown);
40+
return super.stop();
4041
}
4142

4243
/**

packages/plugin-renderer/src/Renderer.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ export class Renderer<T extends JWPluginConfig = JWPluginConfig> extends JWPlugi
1515
};
1616
engines: Record<RenderingIdentifier, RenderingEngine> = {};
1717

18+
/**
19+
* @override
20+
*/
21+
stop(): Promise<void> {
22+
this.engines = {};
23+
return super.stop();
24+
}
25+
1826
/**
1927
* Render the VNode and return the rendering.
2028
*

packages/plugin-template/src/Template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ export class Template<T extends TemplateConfig = TemplateConfig> extends JWPlugi
127127
const filledZone = new Set<ZoneIdentifier>();
128128
for (const templateName of templateToSelect) {
129129
const config = templateConfigurations[templateName];
130-
await layout.clear(config.zoneId);
131130
if (!filledZone.has(config.thumbnailZoneId)) {
131+
await layout.clear(config.zoneId);
132132
filledZone.add(config.thumbnailZoneId);
133133
await layout.prepend(
134134
'TemplateThumbnailSelector-' + config.thumbnailZoneId,

packages/plugin-theme/src/Theme.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { ThemeNode } from './ThemeNode';
1111
import { ZoneNode } from '../../plugin-layout/src/ZoneNode';
1212
import { ActionableGroupNode } from '../../plugin-layout/src/ActionableGroupNode';
1313
import { ActionableNode } from '../../plugin-layout/src/ActionableNode';
14-
import { DomLayoutEngine } from '../../plugin-dom-layout/src/DomLayoutEngine';
1514
import { VElement } from '../../core/src/VNodes/VElement';
1615

1716
interface ThemeComponent extends ComponentDefinition {
@@ -103,10 +102,6 @@ export class Theme<T extends ThemeConfig = ThemeConfig> extends JWPlugin<T> {
103102
const ancestor = this.editor.selection.anchor.ancestor(ThemeNode);
104103
if (ancestor) {
105104
ancestor.themeName = params.theme;
106-
107-
// TODO: remove this redraw when memory send the nodes to redraw into domLayout
108-
const domEngine = this.editor.plugins.get(Layout).engines.dom as DomLayoutEngine;
109-
await domEngine.redraw(ancestor);
110105
}
111106
}
112107
}

0 commit comments

Comments
 (0)