@gtkx/react 0.10.0 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  import { beginBatch, endBatch, getObjectId } from "@gtkx/ffi";
2
2
  import React from "react";
3
3
  import { createNode } from "./factory.js";
4
+ import { clearFiredSignals } from "./nodes/internal/signal-store.js";
4
5
  import { flushAfterCommit } from "./scheduler.js";
5
6
  if (!globalThis.__GTKX_CONTAINER_NODE_CACHE__) {
6
7
  globalThis.__GTKX_CONTAINER_NODE_CACHE__ = new Map();
@@ -78,6 +79,7 @@ export function createHostConfig() {
78
79
  },
79
80
  resetAfterCommit: () => {
80
81
  endBatch();
82
+ clearFiredSignals();
81
83
  flushAfterCommit();
82
84
  committing = false;
83
85
  },
package/dist/jsx.d.ts CHANGED
@@ -710,10 +710,5 @@ declare global {
710
710
  export * from "./generated/jsx.js";
711
711
  declare module "./generated/jsx.js" {
712
712
  interface WidgetProps extends EventControllerProps {
713
- /**
714
- * Called when any property on this widget changes.
715
- * @param propName - The name of the property that changed
716
- */
717
- onNotify?: (propName: string) => void;
718
713
  }
719
714
  }
@@ -47,7 +47,10 @@ export class ActionRowChild extends VirtualNode {
47
47
  }
48
48
  scheduleAfterCommit(() => {
49
49
  if (parent) {
50
- parent.remove(widget);
50
+ const currentParent = widget.getParent();
51
+ if (currentParent?.equals(parent)) {
52
+ parent.remove(widget);
53
+ }
51
54
  }
52
55
  });
53
56
  }
@@ -57,7 +60,10 @@ export class ActionRowChild extends VirtualNode {
57
60
  if (parent && childrenToRemove.length > 0) {
58
61
  scheduleAfterCommit(() => {
59
62
  for (const widget of childrenToRemove) {
60
- parent.remove(widget);
63
+ const currentParent = widget.getParent();
64
+ if (currentParent?.equals(parent)) {
65
+ parent.remove(widget);
66
+ }
61
67
  }
62
68
  });
63
69
  }
@@ -1,3 +1,4 @@
1
+ import { batch } from "@gtkx/ffi";
1
2
  import { registerNodeClass } from "../registry.js";
2
3
  import { SlotNode } from "./slot.js";
3
4
  class FixedChildNode extends SlotNode {
@@ -25,17 +26,22 @@ class FixedChildNode extends SlotNode {
25
26
  const y = this.props.y ?? 0;
26
27
  if (this.child) {
27
28
  const child = this.child;
28
- const currentParent = child.getParent();
29
- if (currentParent?.equals(fixed)) {
30
- fixed.remove(child);
31
- }
32
- fixed.put(child, x, y);
29
+ batch(() => {
30
+ const currentParent = child.getParent();
31
+ if (currentParent?.equals(fixed)) {
32
+ fixed.remove(child);
33
+ }
34
+ fixed.put(child, x, y);
35
+ });
33
36
  }
34
37
  }
35
38
  onChildChange(oldChild) {
36
39
  const fixed = this.getFixed();
37
40
  if (oldChild) {
38
- fixed.remove(oldChild);
41
+ const parent = oldChild.getParent();
42
+ if (parent?.equals(fixed)) {
43
+ fixed.remove(oldChild);
44
+ }
39
45
  }
40
46
  if (this.child) {
41
47
  this.positionChild();
@@ -1,3 +1,4 @@
1
+ import { batch } from "@gtkx/ffi";
1
2
  import { registerNodeClass } from "../registry.js";
2
3
  import { SlotNode } from "./slot.js";
3
4
  class GridChildNode extends SlotNode {
@@ -29,22 +30,27 @@ class GridChildNode extends SlotNode {
29
30
  const row = this.props.row ?? 0;
30
31
  const columnSpan = this.props.columnSpan ?? 1;
31
32
  const rowSpan = this.props.rowSpan ?? 1;
32
- const existingChild = grid.getChildAt(column, row);
33
- if (existingChild && !existingChild.equals(this.child)) {
34
- grid.remove(existingChild);
35
- }
36
- if (this.child) {
37
- const currentParent = this.child.getParent();
38
- if (currentParent?.equals(grid)) {
39
- grid.remove(this.child);
33
+ batch(() => {
34
+ const existingChild = grid.getChildAt(column, row);
35
+ if (existingChild && !existingChild.equals(this.child)) {
36
+ grid.remove(existingChild);
40
37
  }
41
- grid.attach(this.child, column, row, columnSpan, rowSpan);
42
- }
38
+ if (this.child) {
39
+ const currentParent = this.child.getParent();
40
+ if (currentParent?.equals(grid)) {
41
+ grid.remove(this.child);
42
+ }
43
+ grid.attach(this.child, column, row, columnSpan, rowSpan);
44
+ }
45
+ });
43
46
  }
44
47
  onChildChange(oldChild) {
45
48
  const grid = this.getGrid();
46
49
  if (oldChild) {
47
- grid.remove(oldChild);
50
+ const parent = oldChild.getParent();
51
+ if (parent?.equals(grid)) {
52
+ grid.remove(oldChild);
53
+ }
48
54
  }
49
55
  if (this.child) {
50
56
  this.attachChild();
@@ -9,8 +9,6 @@ import "./grid-child.js";
9
9
  import "./list-item.js";
10
10
  import "./list-view.js";
11
11
  import "./menu.js";
12
- import "./navigation-page.js";
13
- import "./navigation-view.js";
14
12
  import "./notebook-page-tab.js";
15
13
  import "./notebook-page.js";
16
14
  import "./notebook.js";
@@ -26,7 +24,6 @@ import "./stack.js";
26
24
  import "./toast-overlay.js";
27
25
  import "./toast.js";
28
26
  import "./toolbar-child.js";
29
- import "./toolbar.js";
30
27
  import "./tree-list-item.js";
31
28
  import "./tree-list-view.js";
32
29
  import "./virtual.js";
@@ -9,8 +9,6 @@ import "./grid-child.js";
9
9
  import "./list-item.js";
10
10
  import "./list-view.js";
11
11
  import "./menu.js";
12
- import "./navigation-page.js";
13
- import "./navigation-view.js";
14
12
  import "./notebook-page-tab.js";
15
13
  import "./notebook-page.js";
16
14
  import "./notebook.js";
@@ -26,7 +24,6 @@ import "./stack.js";
26
24
  import "./toast-overlay.js";
27
25
  import "./toast.js";
28
26
  import "./toolbar-child.js";
29
- import "./toolbar.js";
30
27
  import "./tree-list-item.js";
31
28
  import "./tree-list-view.js";
32
29
  import "./virtual.js";
@@ -5,6 +5,9 @@ export declare const isAppendable: (obj: unknown) => obj is Gtk.Widget & {
5
5
  export declare const isAddable: (obj: unknown) => obj is Gtk.Widget & {
6
6
  add: (child: Gtk.Widget) => void;
7
7
  };
8
+ export declare const hasSingleContent: (obj: unknown) => obj is Gtk.Widget & {
9
+ setContent: (content: Gtk.Widget | undefined) => void;
10
+ };
8
11
  export declare const isSingleChild: (obj: unknown) => obj is Gtk.Widget & {
9
12
  setChild: (child: Gtk.Widget | null) => void;
10
13
  };
@@ -5,6 +5,9 @@ export const isAppendable = (obj) => {
5
5
  export const isAddable = (obj) => {
6
6
  return obj instanceof Gtk.Widget && "add" in obj && typeof obj.add === "function";
7
7
  };
8
+ export const hasSingleContent = (obj) => {
9
+ return obj instanceof Gtk.Widget && "setContent" in obj && typeof obj.setContent === "function";
10
+ };
8
11
  export const isSingleChild = (obj) => {
9
12
  return obj instanceof Gtk.Widget && "setChild" in obj && typeof obj.setChild === "function";
10
13
  };
@@ -1,5 +1,6 @@
1
1
  import * as GObject from "@gtkx/ffi/gobject";
2
2
  export type SignalHandler = (...args: any[]) => any;
3
+ export declare const clearFiredSignals: () => void;
3
4
  export declare class SignalStore {
4
5
  private signalHandlers;
5
6
  private disconnect;
@@ -16,6 +16,10 @@ const LIFECYCLE_SIGNALS = new Set([
16
16
  "unbind",
17
17
  "teardown",
18
18
  ]);
19
+ const firedThisCommit = new Set();
20
+ export const clearFiredSignals = () => {
21
+ firedThisCommit.clear();
22
+ };
19
23
  export class SignalStore {
20
24
  signalHandlers = new Map();
21
25
  disconnect(obj, signal) {
@@ -31,8 +35,14 @@ export class SignalStore {
31
35
  const objectId = getObjectId(obj.id);
32
36
  const key = `${objectId}:${signal}`;
33
37
  const wrappedHandler = (...args) => {
34
- if (isCommitting() && !LIFECYCLE_SIGNALS.has(signal)) {
35
- return;
38
+ if (LIFECYCLE_SIGNALS.has(signal)) {
39
+ return handler(...args);
40
+ }
41
+ if (isCommitting()) {
42
+ if (firedThisCommit.has(key)) {
43
+ return;
44
+ }
45
+ firedThisCommit.add(key);
36
46
  }
37
47
  return handler(...args);
38
48
  };
@@ -30,12 +30,9 @@ export class NotebookPageTabNode extends SlotNode {
30
30
  }
31
31
  const notebook = this.getNotebook();
32
32
  const page = this.getPage();
33
- // Only call setTabLabel if the page is actually in the notebook
34
- // (pageNum returns -1 if not found)
35
33
  if (notebook.pageNum(page) === -1) {
36
34
  return;
37
35
  }
38
- // setTabLabel accepts undefined to reset to default
39
36
  notebook.setTabLabel(page, this.child);
40
37
  }
41
38
  }
@@ -54,7 +54,6 @@ export class NotebookPageNode extends SlotNode {
54
54
  this.tabNode = undefined;
55
55
  return;
56
56
  }
57
- // For content widget, use SlotNode's removeChild logic
58
57
  super.removeChild();
59
58
  }
60
59
  unmount() {
@@ -63,7 +62,6 @@ export class NotebookPageNode extends SlotNode {
63
62
  }
64
63
  updateProps(oldProps, newProps) {
65
64
  if (!oldProps || oldProps.label !== newProps.label) {
66
- // Only update if using text label (no custom tab node)
67
65
  if (this.child && this.parent && !this.tabNode?.child) {
68
66
  const tabLabel = this.getNotebook().getTabLabel(this.child);
69
67
  tabLabel.setLabel(newProps.label ?? "");
@@ -73,7 +71,6 @@ export class NotebookPageNode extends SlotNode {
73
71
  attachPage() {
74
72
  const child = this.getChild();
75
73
  const notebook = this.getNotebook();
76
- // Use custom tab widget if provided, otherwise create a Label
77
74
  let tabLabel;
78
75
  if (this.tabNode?.child) {
79
76
  tabLabel = this.tabNode.child;
@@ -14,7 +14,10 @@ class OverlayChildNode extends SlotNode {
14
14
  onChildChange(oldChild) {
15
15
  const overlay = this.getOverlay();
16
16
  if (oldChild) {
17
- overlay.removeOverlay(oldChild);
17
+ const parent = oldChild.getParent();
18
+ if (parent?.equals(overlay)) {
19
+ overlay.removeOverlay(oldChild);
20
+ }
18
21
  }
19
22
  if (this.child) {
20
23
  overlay.addOverlay(this.child);
@@ -21,7 +21,10 @@ export class PackChild extends VirtualNode {
21
21
  if (parent && childrenToRemove.length > 0) {
22
22
  scheduleAfterCommit(() => {
23
23
  for (const widget of childrenToRemove) {
24
- parent.remove(widget);
24
+ const currentParent = widget.getParent();
25
+ if (currentParent?.equals(parent)) {
26
+ parent.remove(widget);
27
+ }
25
28
  }
26
29
  });
27
30
  }
@@ -54,13 +57,17 @@ export class PackChild extends VirtualNode {
54
57
  throw new Error(`Cannot remove '${child.typeName}' from '${this.typeName}': expected Widget`);
55
58
  }
56
59
  const widget = child.container;
60
+ const parent = this.parent;
57
61
  const index = this.children.indexOf(widget);
58
62
  if (index !== -1) {
59
63
  this.children.splice(index, 1);
60
64
  }
61
65
  scheduleAfterCommit(() => {
62
- if (this.parent) {
63
- this.parent.remove(widget);
66
+ if (parent) {
67
+ const currentParent = widget.getParent();
68
+ if (currentParent?.equals(parent)) {
69
+ parent.remove(widget);
70
+ }
64
71
  }
65
72
  });
66
73
  }
@@ -68,7 +68,10 @@ class StackPageNode extends SlotNode {
68
68
  if (!oldChild) {
69
69
  return;
70
70
  }
71
- parent.remove(oldChild);
71
+ const currentParent = oldChild.getParent();
72
+ if (currentParent?.equals(parent)) {
73
+ parent.remove(oldChild);
74
+ }
72
75
  }
73
76
  onChildChange(oldChild) {
74
77
  this.removePage(oldChild);
@@ -1,9 +1 @@
1
- import type * as Gtk from "@gtkx/ffi/gtk";
2
- import { SlotNode } from "./slot.js";
3
- export declare class ToolbarChildNode extends SlotNode {
4
- static priority: number;
5
- static matches(type: string): boolean;
6
- private getToolbar;
7
- private getPosition;
8
- protected onChildChange(oldChild: Gtk.Widget | undefined): void;
9
- }
1
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { registerNodeClass } from "../registry.js";
2
2
  import { SlotNode } from "./slot.js";
3
- export class ToolbarChildNode extends SlotNode {
3
+ class ToolbarChildNode extends SlotNode {
4
4
  static priority = 1;
5
5
  static matches(type) {
6
6
  return type === "Toolbar.Top" || type === "Toolbar.Bottom";
@@ -17,7 +17,10 @@ export class ToolbarChildNode extends SlotNode {
17
17
  onChildChange(oldChild) {
18
18
  const toolbar = this.getToolbar();
19
19
  if (oldChild) {
20
- toolbar.remove(oldChild);
20
+ const parent = oldChild.getParent();
21
+ if (parent?.equals(toolbar)) {
22
+ toolbar.remove(oldChild);
23
+ }
21
24
  }
22
25
  if (this.child) {
23
26
  const position = this.getPosition();
@@ -3,7 +3,7 @@ import * as Gtk from "@gtkx/ffi/gtk";
3
3
  import { CONSTRUCTOR_PROPS, PROPS, SIGNALS } from "../generated/internal.js";
4
4
  import { Node } from "../node.js";
5
5
  import { registerNodeClass } from "../registry.js";
6
- import { isAddable, isAppendable, isEditable, isInsertable, isRemovable, isReorderable, isSingleChild, } from "./internal/predicates.js";
6
+ import { hasSingleContent, isAddable, isAppendable, isEditable, isInsertable, isRemovable, isReorderable, isSingleChild, } from "./internal/predicates.js";
7
7
  import { filterProps, isContainerType } from "./internal/utils.js";
8
8
  import { SlotNode } from "./slot.js";
9
9
  const EVENT_CONTROLLER_PROPS = new Set([
@@ -58,6 +58,9 @@ export class WidgetNode extends Node {
58
58
  }
59
59
  this.container.add(child.container);
60
60
  }
61
+ else if (hasSingleContent(this.container)) {
62
+ this.container.setContent(child.container);
63
+ }
61
64
  else if (isSingleChild(this.container)) {
62
65
  this.container.setChild(child.container);
63
66
  }
@@ -80,6 +83,9 @@ export class WidgetNode extends Node {
80
83
  if (isRemovable(this.container)) {
81
84
  this.container.remove(child.container);
82
85
  }
86
+ else if (hasSingleContent(this.container)) {
87
+ this.container.setContent(undefined);
88
+ }
83
89
  else if (isSingleChild(this.container)) {
84
90
  this.container.setChild(null);
85
91
  }
@@ -217,8 +223,8 @@ export class WidgetNode extends Node {
217
223
  }
218
224
  case "onNotify": {
219
225
  const wrappedHandler = handler
220
- ? (_obj, pspec) => {
221
- handler(pspec.getName());
226
+ ? (obj, pspec) => {
227
+ handler(obj, pspec.getName());
222
228
  }
223
229
  : undefined;
224
230
  this.signalStore.set(this.container, "notify", wrappedHandler);
@@ -37,11 +37,6 @@ class WindowNode extends WidgetNode {
37
37
  return;
38
38
  }
39
39
  this.menu.appendChild(child);
40
- if (child instanceof WidgetNode &&
41
- (this.container instanceof Adw.ApplicationWindow || this.container instanceof Adw.Window)) {
42
- this.container.setContent(child.container);
43
- return;
44
- }
45
40
  super.appendChild(child);
46
41
  }
47
42
  removeChild(child) {
@@ -50,11 +45,6 @@ class WindowNode extends WidgetNode {
50
45
  return;
51
46
  }
52
47
  this.menu.removeChild(child);
53
- if (child instanceof WidgetNode &&
54
- (this.container instanceof Adw.ApplicationWindow || this.container instanceof Adw.Window)) {
55
- this.container.setContent(undefined);
56
- return;
57
- }
58
48
  super.removeChild(child);
59
49
  }
60
50
  insertBefore(child, before) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtkx/react",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "description": "Build GTK4 desktop applications with React and TypeScript",
5
5
  "keywords": [
6
6
  "gtk",
@@ -36,8 +36,8 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "react-reconciler": "^0.33.0",
39
- "@gtkx/ffi": "0.10.0",
40
- "@gtkx/gir": "0.10.0"
39
+ "@gtkx/ffi": "0.10.2",
40
+ "@gtkx/gir": "0.10.2"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/react-reconciler": "^0.32.3",
@@ -1,21 +0,0 @@
1
- import * as Adw from "@gtkx/ffi/adw";
2
- import type { AdwNavigationPageProps } from "../jsx.js";
3
- import type { Node } from "../node.js";
4
- import { VirtualNode } from "./virtual.js";
5
- type Props = Partial<AdwNavigationPageProps>;
6
- export declare class NavigationPageNode extends VirtualNode<Props> {
7
- static priority: number;
8
- private parent?;
9
- private child?;
10
- private page?;
11
- static matches(type: string): boolean;
12
- setParent(parent?: Adw.NavigationView): void;
13
- appendChild(child: Node): void;
14
- removeChild(): void;
15
- unmount(): void;
16
- updateProps(oldProps: Props | null, newProps: Props): void;
17
- private onChildChange;
18
- private addPage;
19
- private removePage;
20
- }
21
- export {};
@@ -1,95 +0,0 @@
1
- import * as Adw from "@gtkx/ffi/adw";
2
- import { registerNodeClass } from "../registry.js";
3
- import { scheduleAfterCommit } from "../scheduler.js";
4
- import { VirtualNode } from "./virtual.js";
5
- import { WidgetNode } from "./widget.js";
6
- export class NavigationPageNode extends VirtualNode {
7
- static priority = -1;
8
- parent;
9
- child;
10
- page;
11
- static matches(type) {
12
- return type === "AdwNavigationPage";
13
- }
14
- setParent(parent) {
15
- this.parent = parent;
16
- }
17
- appendChild(child) {
18
- if (!(child instanceof WidgetNode)) {
19
- throw new Error(`Cannot append '${child.typeName}' to 'NavigationPage': expected Widget`);
20
- }
21
- const oldChild = this.child;
22
- this.child = child.container;
23
- scheduleAfterCommit(() => {
24
- if (this.parent) {
25
- this.onChildChange(oldChild);
26
- }
27
- });
28
- }
29
- removeChild() {
30
- const oldChild = this.child;
31
- scheduleAfterCommit(() => {
32
- if (oldChild === this.child) {
33
- this.child = undefined;
34
- }
35
- if (this.parent) {
36
- this.onChildChange(oldChild);
37
- }
38
- });
39
- }
40
- unmount() {
41
- if (this.parent && this.child) {
42
- const oldChild = this.child;
43
- this.child = undefined;
44
- this.onChildChange(oldChild);
45
- }
46
- this.parent = undefined;
47
- super.unmount();
48
- }
49
- updateProps(oldProps, newProps) {
50
- super.updateProps(oldProps, newProps);
51
- if (!this.page) {
52
- return;
53
- }
54
- if (newProps.title && (!oldProps || oldProps.title !== newProps.title)) {
55
- this.page.setTitle(newProps.title);
56
- }
57
- if (!oldProps || oldProps.tag !== newProps.tag) {
58
- this.page.setTag(newProps.tag);
59
- }
60
- if (!oldProps || oldProps.canPop !== newProps.canPop) {
61
- this.page.setCanPop(newProps.canPop ?? true);
62
- }
63
- }
64
- onChildChange(oldChild) {
65
- if (oldChild) {
66
- this.removePage();
67
- }
68
- if (this.child) {
69
- this.addPage();
70
- }
71
- }
72
- addPage() {
73
- if (!this.child || !this.parent) {
74
- return;
75
- }
76
- let page;
77
- if (this.props.tag) {
78
- page = Adw.NavigationPage.pageNewWithTag(this.child, this.props.title ?? "", this.props.tag);
79
- }
80
- else {
81
- page = new Adw.NavigationPage(this.child, this.props.title ?? "");
82
- }
83
- this.page = page;
84
- this.parent.add(page);
85
- this.updateProps(null, this.props);
86
- }
87
- removePage() {
88
- if (!this.page || !this.parent) {
89
- return;
90
- }
91
- this.parent.remove(this.page);
92
- this.page = undefined;
93
- }
94
- }
95
- registerNodeClass(NavigationPageNode);
@@ -1 +0,0 @@
1
- export {};
@@ -1,29 +0,0 @@
1
- import * as Adw from "@gtkx/ffi/adw";
2
- import { registerNodeClass } from "../registry.js";
3
- import { isContainerType } from "./internal/utils.js";
4
- import { NavigationPageNode } from "./navigation-page.js";
5
- import { WidgetNode } from "./widget.js";
6
- class NavigationViewNode extends WidgetNode {
7
- static priority = -1;
8
- static matches(_type, containerOrClass) {
9
- return isContainerType(Adw.NavigationView, containerOrClass);
10
- }
11
- appendChild(child) {
12
- if (child instanceof NavigationPageNode) {
13
- child.setParent(this.container);
14
- return;
15
- }
16
- super.appendChild(child);
17
- }
18
- insertBefore(child, _before) {
19
- this.appendChild(child);
20
- }
21
- removeChild(child) {
22
- if (child instanceof NavigationPageNode) {
23
- child.unmount();
24
- return;
25
- }
26
- super.removeChild(child);
27
- }
28
- }
29
- registerNodeClass(NavigationViewNode);
@@ -1 +0,0 @@
1
- export {};
@@ -1,42 +0,0 @@
1
- import * as Adw from "@gtkx/ffi/adw";
2
- import { registerNodeClass } from "../registry.js";
3
- import { isContainerType } from "./internal/utils.js";
4
- import { ToolbarChildNode } from "./toolbar-child.js";
5
- import { WidgetNode } from "./widget.js";
6
- class ToolbarNode extends WidgetNode {
7
- static priority = 0;
8
- static matches(_type, containerOrClass) {
9
- return isContainerType(Adw.ToolbarView, containerOrClass);
10
- }
11
- appendChild(child) {
12
- if (child instanceof ToolbarChildNode) {
13
- child.setParent(this.container);
14
- return;
15
- }
16
- if (!(child instanceof WidgetNode)) {
17
- throw new Error(`Cannot append '${child.typeName}' to 'ToolbarView': expected Widget`);
18
- }
19
- this.container.setContent(child.container);
20
- }
21
- insertBefore(child) {
22
- if (child instanceof ToolbarChildNode) {
23
- child.setParent(this.container);
24
- return;
25
- }
26
- if (!(child instanceof WidgetNode)) {
27
- throw new Error(`Cannot insert '${child.typeName}' to 'ToolbarView': expected Widget`);
28
- }
29
- this.container.setContent(child.container);
30
- }
31
- removeChild(child) {
32
- if (child instanceof ToolbarChildNode) {
33
- child.unmount();
34
- return;
35
- }
36
- if (!(child instanceof WidgetNode)) {
37
- throw new Error(`Cannot remove '${child.typeName}' from 'ToolbarView': expected Widget`);
38
- }
39
- this.container.setContent(undefined);
40
- }
41
- }
42
- registerNodeClass(ToolbarNode);