@gtkx/react 0.18.1 → 0.18.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.
- package/dist/errors.d.ts +1 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +1 -0
- package/dist/errors.js.map +1 -0
- package/dist/factory.d.ts +1 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +1 -0
- package/dist/factory.js.map +1 -0
- package/dist/fiber-root.d.ts +1 -0
- package/dist/fiber-root.d.ts.map +1 -0
- package/dist/fiber-root.js +1 -0
- package/dist/fiber-root.js.map +1 -0
- package/dist/generated/internal.d.ts +1 -0
- package/dist/generated/internal.d.ts.map +1 -0
- package/dist/generated/internal.js +1 -0
- package/dist/generated/internal.js.map +1 -0
- package/dist/generated/jsx.d.ts +1 -0
- package/dist/generated/jsx.d.ts.map +1 -0
- package/dist/generated/jsx.js +1 -0
- package/dist/generated/jsx.js.map +1 -0
- package/dist/generated/registry.d.ts +1 -0
- package/dist/generated/registry.d.ts.map +1 -0
- package/dist/generated/registry.js +1 -0
- package/dist/generated/registry.js.map +1 -0
- package/dist/host-config.d.ts +1 -0
- package/dist/host-config.d.ts.map +1 -0
- package/dist/host-config.js +1 -0
- package/dist/host-config.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx.d.ts +1 -0
- package/dist/jsx.d.ts.map +1 -0
- package/dist/jsx.js +1 -0
- package/dist/jsx.js.map +1 -0
- package/dist/metadata.d.ts +1 -0
- package/dist/metadata.d.ts.map +1 -0
- package/dist/metadata.js +1 -0
- package/dist/metadata.js.map +1 -0
- package/dist/node.d.ts +1 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +1 -0
- package/dist/node.js.map +1 -0
- package/dist/nodes/adjustable.d.ts +1 -0
- package/dist/nodes/adjustable.d.ts.map +1 -0
- package/dist/nodes/adjustable.js +1 -0
- package/dist/nodes/adjustable.js.map +1 -0
- package/dist/nodes/alert-dialog-response.d.ts +1 -0
- package/dist/nodes/alert-dialog-response.d.ts.map +1 -0
- package/dist/nodes/alert-dialog-response.js +1 -0
- package/dist/nodes/alert-dialog-response.js.map +1 -0
- package/dist/nodes/animation.d.ts +1 -0
- package/dist/nodes/animation.d.ts.map +1 -0
- package/dist/nodes/animation.js +1 -0
- package/dist/nodes/animation.js.map +1 -0
- package/dist/nodes/application.d.ts +1 -0
- package/dist/nodes/application.d.ts.map +1 -0
- package/dist/nodes/application.js +1 -0
- package/dist/nodes/application.js.map +1 -0
- package/dist/nodes/calendar.d.ts +1 -0
- package/dist/nodes/calendar.d.ts.map +1 -0
- package/dist/nodes/calendar.js +1 -0
- package/dist/nodes/calendar.js.map +1 -0
- package/dist/nodes/color-dialog-button.d.ts +1 -0
- package/dist/nodes/color-dialog-button.d.ts.map +1 -0
- package/dist/nodes/color-dialog-button.js +1 -0
- package/dist/nodes/color-dialog-button.js.map +1 -0
- package/dist/nodes/column-view-column.d.ts +1 -0
- package/dist/nodes/column-view-column.d.ts.map +1 -0
- package/dist/nodes/column-view-column.js +1 -0
- package/dist/nodes/column-view-column.js.map +1 -0
- package/dist/nodes/column-view.d.ts +1 -0
- package/dist/nodes/column-view.d.ts.map +1 -0
- package/dist/nodes/column-view.js +1 -0
- package/dist/nodes/column-view.js.map +1 -0
- package/dist/nodes/container-slot.d.ts +1 -0
- package/dist/nodes/container-slot.d.ts.map +1 -0
- package/dist/nodes/container-slot.js +1 -0
- package/dist/nodes/container-slot.js.map +1 -0
- package/dist/nodes/dialog.d.ts +1 -0
- package/dist/nodes/dialog.d.ts.map +1 -0
- package/dist/nodes/dialog.js +1 -0
- package/dist/nodes/dialog.js.map +1 -0
- package/dist/nodes/drawing-area.d.ts +1 -0
- package/dist/nodes/drawing-area.d.ts.map +1 -0
- package/dist/nodes/drawing-area.js +1 -0
- package/dist/nodes/drawing-area.js.map +1 -0
- package/dist/nodes/drop-down.d.ts +1 -0
- package/dist/nodes/drop-down.d.ts.map +1 -0
- package/dist/nodes/drop-down.js +1 -0
- package/dist/nodes/drop-down.js.map +1 -0
- package/dist/nodes/event-controller.d.ts +1 -0
- package/dist/nodes/event-controller.d.ts.map +1 -0
- package/dist/nodes/event-controller.js +1 -0
- package/dist/nodes/event-controller.js.map +1 -0
- package/dist/nodes/fixed-child.d.ts +1 -0
- package/dist/nodes/fixed-child.d.ts.map +1 -0
- package/dist/nodes/fixed-child.js +1 -0
- package/dist/nodes/fixed-child.js.map +1 -0
- package/dist/nodes/font-dialog-button.d.ts +1 -0
- package/dist/nodes/font-dialog-button.d.ts.map +1 -0
- package/dist/nodes/font-dialog-button.js +1 -0
- package/dist/nodes/font-dialog-button.js.map +1 -0
- package/dist/nodes/grid-child.d.ts +1 -0
- package/dist/nodes/grid-child.d.ts.map +1 -0
- package/dist/nodes/grid-child.js +1 -0
- package/dist/nodes/grid-child.js.map +1 -0
- package/dist/nodes/grid-view.d.ts +1 -0
- package/dist/nodes/grid-view.d.ts.map +1 -0
- package/dist/nodes/grid-view.js +1 -0
- package/dist/nodes/grid-view.js.map +1 -0
- package/dist/nodes/internal/base-item-renderer.d.ts +1 -0
- package/dist/nodes/internal/base-item-renderer.d.ts.map +1 -0
- package/dist/nodes/internal/base-item-renderer.js +1 -0
- package/dist/nodes/internal/base-item-renderer.js.map +1 -0
- package/dist/nodes/internal/grid-item-renderer.d.ts +1 -0
- package/dist/nodes/internal/grid-item-renderer.d.ts.map +1 -0
- package/dist/nodes/internal/grid-item-renderer.js +1 -0
- package/dist/nodes/internal/grid-item-renderer.js.map +1 -0
- package/dist/nodes/internal/list-item-renderer.d.ts +1 -0
- package/dist/nodes/internal/list-item-renderer.d.ts.map +1 -0
- package/dist/nodes/internal/list-item-renderer.js +1 -0
- package/dist/nodes/internal/list-item-renderer.js.map +1 -0
- package/dist/nodes/internal/list-store.d.ts +1 -0
- package/dist/nodes/internal/list-store.d.ts.map +1 -0
- package/dist/nodes/internal/list-store.js +1 -0
- package/dist/nodes/internal/list-store.js.map +1 -0
- package/dist/nodes/internal/predicates.d.ts +1 -0
- package/dist/nodes/internal/predicates.d.ts.map +1 -0
- package/dist/nodes/internal/predicates.js +1 -0
- package/dist/nodes/internal/predicates.js.map +1 -0
- package/dist/nodes/internal/props.d.ts +1 -0
- package/dist/nodes/internal/props.d.ts.map +1 -0
- package/dist/nodes/internal/props.js +1 -0
- package/dist/nodes/internal/props.js.map +1 -0
- package/dist/nodes/internal/selection-model-controller.d.ts +1 -0
- package/dist/nodes/internal/selection-model-controller.d.ts.map +1 -0
- package/dist/nodes/internal/selection-model-controller.js +1 -0
- package/dist/nodes/internal/selection-model-controller.js.map +1 -0
- package/dist/nodes/internal/signal-store.d.ts +1 -0
- package/dist/nodes/internal/signal-store.d.ts.map +1 -0
- package/dist/nodes/internal/signal-store.js +1 -0
- package/dist/nodes/internal/signal-store.js.map +1 -0
- package/dist/nodes/internal/simple-list-store.d.ts +1 -0
- package/dist/nodes/internal/simple-list-store.d.ts.map +1 -0
- package/dist/nodes/internal/simple-list-store.js +1 -0
- package/dist/nodes/internal/simple-list-store.js.map +1 -0
- package/dist/nodes/internal/text-buffer-controller.d.ts +1 -0
- package/dist/nodes/internal/text-buffer-controller.d.ts.map +1 -0
- package/dist/nodes/internal/text-buffer-controller.js +1 -0
- package/dist/nodes/internal/text-buffer-controller.js.map +1 -0
- package/dist/nodes/internal/tree-store.d.ts +1 -0
- package/dist/nodes/internal/tree-store.d.ts.map +1 -0
- package/dist/nodes/internal/tree-store.js +1 -0
- package/dist/nodes/internal/tree-store.js.map +1 -0
- package/dist/nodes/internal/widget.d.ts +1 -0
- package/dist/nodes/internal/widget.d.ts.map +1 -0
- package/dist/nodes/internal/widget.js +1 -0
- package/dist/nodes/internal/widget.js.map +1 -0
- package/dist/nodes/level-bar.d.ts +1 -0
- package/dist/nodes/level-bar.d.ts.map +1 -0
- package/dist/nodes/level-bar.js +1 -0
- package/dist/nodes/level-bar.js.map +1 -0
- package/dist/nodes/list-item.d.ts +1 -0
- package/dist/nodes/list-item.d.ts.map +1 -0
- package/dist/nodes/list-item.js +1 -0
- package/dist/nodes/list-item.js.map +1 -0
- package/dist/nodes/list-view.d.ts +1 -0
- package/dist/nodes/list-view.d.ts.map +1 -0
- package/dist/nodes/list-view.js +1 -0
- package/dist/nodes/list-view.js.map +1 -0
- package/dist/nodes/menu.d.ts +1 -0
- package/dist/nodes/menu.d.ts.map +1 -0
- package/dist/nodes/menu.js +1 -0
- package/dist/nodes/menu.js.map +1 -0
- package/dist/nodes/models/grid.d.ts +1 -0
- package/dist/nodes/models/grid.d.ts.map +1 -0
- package/dist/nodes/models/grid.js +1 -0
- package/dist/nodes/models/grid.js.map +1 -0
- package/dist/nodes/models/list.d.ts +1 -0
- package/dist/nodes/models/list.d.ts.map +1 -0
- package/dist/nodes/models/list.js +1 -0
- package/dist/nodes/models/list.js.map +1 -0
- package/dist/nodes/models/menu.d.ts +1 -0
- package/dist/nodes/models/menu.d.ts.map +1 -0
- package/dist/nodes/models/menu.js +1 -0
- package/dist/nodes/models/menu.js.map +1 -0
- package/dist/nodes/navigation-page.d.ts +1 -0
- package/dist/nodes/navigation-page.d.ts.map +1 -0
- package/dist/nodes/navigation-page.js +1 -0
- package/dist/nodes/navigation-page.js.map +1 -0
- package/dist/nodes/navigation-view.d.ts +1 -0
- package/dist/nodes/navigation-view.d.ts.map +1 -0
- package/dist/nodes/navigation-view.js +1 -0
- package/dist/nodes/navigation-view.js.map +1 -0
- package/dist/nodes/notebook-page-tab.d.ts +1 -0
- package/dist/nodes/notebook-page-tab.d.ts.map +1 -0
- package/dist/nodes/notebook-page-tab.js +1 -0
- package/dist/nodes/notebook-page-tab.js.map +1 -0
- package/dist/nodes/notebook-page.d.ts +1 -0
- package/dist/nodes/notebook-page.d.ts.map +1 -0
- package/dist/nodes/notebook-page.js +1 -0
- package/dist/nodes/notebook-page.js.map +1 -0
- package/dist/nodes/notebook.d.ts +1 -0
- package/dist/nodes/notebook.d.ts.map +1 -0
- package/dist/nodes/notebook.js +1 -0
- package/dist/nodes/notebook.js.map +1 -0
- package/dist/nodes/overlay-child.d.ts +1 -0
- package/dist/nodes/overlay-child.d.ts.map +1 -0
- package/dist/nodes/overlay-child.js +1 -0
- package/dist/nodes/overlay-child.js.map +1 -0
- package/dist/nodes/popover-menu.d.ts +1 -0
- package/dist/nodes/popover-menu.d.ts.map +1 -0
- package/dist/nodes/popover-menu.js +1 -0
- package/dist/nodes/popover-menu.js.map +1 -0
- package/dist/nodes/scale.d.ts +1 -0
- package/dist/nodes/scale.d.ts.map +1 -0
- package/dist/nodes/scale.js +1 -0
- package/dist/nodes/scale.js.map +1 -0
- package/dist/nodes/scrolled-window.d.ts +1 -0
- package/dist/nodes/scrolled-window.d.ts.map +1 -0
- package/dist/nodes/scrolled-window.js +1 -0
- package/dist/nodes/scrolled-window.js.map +1 -0
- package/dist/nodes/search-bar.d.ts +1 -0
- package/dist/nodes/search-bar.d.ts.map +1 -0
- package/dist/nodes/search-bar.js +1 -0
- package/dist/nodes/search-bar.js.map +1 -0
- package/dist/nodes/shortcut-controller.d.ts +1 -0
- package/dist/nodes/shortcut-controller.d.ts.map +1 -0
- package/dist/nodes/shortcut-controller.js +1 -0
- package/dist/nodes/shortcut-controller.js.map +1 -0
- package/dist/nodes/shortcut.d.ts +1 -0
- package/dist/nodes/shortcut.d.ts.map +1 -0
- package/dist/nodes/shortcut.js +1 -0
- package/dist/nodes/shortcut.js.map +1 -0
- package/dist/nodes/slot.d.ts +1 -0
- package/dist/nodes/slot.d.ts.map +1 -0
- package/dist/nodes/slot.js +1 -0
- package/dist/nodes/slot.js.map +1 -0
- package/dist/nodes/source-view.d.ts +1 -0
- package/dist/nodes/source-view.d.ts.map +1 -0
- package/dist/nodes/source-view.js +1 -0
- package/dist/nodes/source-view.js.map +1 -0
- package/dist/nodes/stack-page.d.ts +1 -0
- package/dist/nodes/stack-page.d.ts.map +1 -0
- package/dist/nodes/stack-page.js +1 -0
- package/dist/nodes/stack-page.js.map +1 -0
- package/dist/nodes/stack.d.ts +1 -0
- package/dist/nodes/stack.d.ts.map +1 -0
- package/dist/nodes/stack.js +1 -0
- package/dist/nodes/stack.js.map +1 -0
- package/dist/nodes/text-anchor.d.ts +1 -0
- package/dist/nodes/text-anchor.d.ts.map +1 -0
- package/dist/nodes/text-anchor.js +1 -0
- package/dist/nodes/text-anchor.js.map +1 -0
- package/dist/nodes/text-content.d.ts +1 -0
- package/dist/nodes/text-content.d.ts.map +1 -0
- package/dist/nodes/text-content.js +1 -0
- package/dist/nodes/text-content.js.map +1 -0
- package/dist/nodes/text-paintable.d.ts +1 -0
- package/dist/nodes/text-paintable.d.ts.map +1 -0
- package/dist/nodes/text-paintable.js +1 -0
- package/dist/nodes/text-paintable.js.map +1 -0
- package/dist/nodes/text-segment.d.ts +1 -0
- package/dist/nodes/text-segment.d.ts.map +1 -0
- package/dist/nodes/text-segment.js +1 -0
- package/dist/nodes/text-segment.js.map +1 -0
- package/dist/nodes/text-tag.d.ts +1 -0
- package/dist/nodes/text-tag.d.ts.map +1 -0
- package/dist/nodes/text-tag.js +1 -0
- package/dist/nodes/text-tag.js.map +1 -0
- package/dist/nodes/text-view.d.ts +1 -0
- package/dist/nodes/text-view.d.ts.map +1 -0
- package/dist/nodes/text-view.js +1 -0
- package/dist/nodes/text-view.js.map +1 -0
- package/dist/nodes/toggle-group.d.ts +1 -0
- package/dist/nodes/toggle-group.d.ts.map +1 -0
- package/dist/nodes/toggle-group.js +1 -0
- package/dist/nodes/toggle-group.js.map +1 -0
- package/dist/nodes/toggle.d.ts +1 -0
- package/dist/nodes/toggle.d.ts.map +1 -0
- package/dist/nodes/toggle.js +1 -0
- package/dist/nodes/toggle.js.map +1 -0
- package/dist/nodes/virtual.d.ts +1 -0
- package/dist/nodes/virtual.d.ts.map +1 -0
- package/dist/nodes/virtual.js +1 -0
- package/dist/nodes/virtual.js.map +1 -0
- package/dist/nodes/web-view.d.ts +1 -0
- package/dist/nodes/web-view.d.ts.map +1 -0
- package/dist/nodes/web-view.js +1 -0
- package/dist/nodes/web-view.js.map +1 -0
- package/dist/nodes/widget.d.ts +1 -0
- package/dist/nodes/widget.d.ts.map +1 -0
- package/dist/nodes/widget.js +1 -0
- package/dist/nodes/widget.js.map +1 -0
- package/dist/nodes/window.d.ts +1 -0
- package/dist/nodes/window.d.ts.map +1 -0
- package/dist/nodes/window.js +1 -0
- package/dist/nodes/window.js.map +1 -0
- package/dist/portal.d.ts +1 -0
- package/dist/portal.d.ts.map +1 -0
- package/dist/portal.js +1 -0
- package/dist/portal.js.map +1 -0
- package/dist/reconciler.d.ts +1 -0
- package/dist/reconciler.d.ts.map +1 -0
- package/dist/reconciler.js +1 -0
- package/dist/reconciler.js.map +1 -0
- package/dist/registry.d.ts +1 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +1 -0
- package/dist/registry.js.map +1 -0
- package/dist/render.d.ts +1 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +1 -0
- package/dist/render.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -0
- package/package.json +6 -4
- package/src/errors.ts +52 -0
- package/src/factory.ts +62 -0
- package/src/fiber-root.ts +20 -0
- package/src/generated/internal.ts +2134 -0
- package/src/generated/jsx.ts +20068 -0
- package/src/generated/registry.ts +16 -0
- package/src/host-config.ts +186 -0
- package/src/index.ts +11 -0
- package/src/jsx.ts +1294 -0
- package/src/metadata.ts +36 -0
- package/src/node.ts +109 -0
- package/src/nodes/adjustable.ts +68 -0
- package/src/nodes/alert-dialog-response.ts +78 -0
- package/src/nodes/animation.ts +402 -0
- package/src/nodes/application.ts +56 -0
- package/src/nodes/calendar.ts +38 -0
- package/src/nodes/color-dialog-button.ts +69 -0
- package/src/nodes/column-view-column.ts +84 -0
- package/src/nodes/column-view.ts +192 -0
- package/src/nodes/container-slot.ts +87 -0
- package/src/nodes/dialog.ts +25 -0
- package/src/nodes/drawing-area.ts +51 -0
- package/src/nodes/drop-down.ts +92 -0
- package/src/nodes/event-controller.ts +100 -0
- package/src/nodes/fixed-child.ts +108 -0
- package/src/nodes/font-dialog-button.ts +97 -0
- package/src/nodes/grid-child.ts +103 -0
- package/src/nodes/grid-view.ts +96 -0
- package/src/nodes/internal/base-item-renderer.ts +108 -0
- package/src/nodes/internal/grid-item-renderer.ts +71 -0
- package/src/nodes/internal/list-item-renderer.ts +155 -0
- package/src/nodes/internal/list-store.ts +105 -0
- package/src/nodes/internal/predicates.ts +80 -0
- package/src/nodes/internal/props.ts +51 -0
- package/src/nodes/internal/selection-model-controller.ts +115 -0
- package/src/nodes/internal/signal-store.ts +141 -0
- package/src/nodes/internal/simple-list-store.ts +99 -0
- package/src/nodes/internal/text-buffer-controller.ts +374 -0
- package/src/nodes/internal/tree-store.ts +237 -0
- package/src/nodes/internal/widget.ts +78 -0
- package/src/nodes/level-bar.ts +36 -0
- package/src/nodes/list-item.ts +107 -0
- package/src/nodes/list-view.ts +97 -0
- package/src/nodes/menu.ts +27 -0
- package/src/nodes/models/grid.ts +105 -0
- package/src/nodes/models/list.ts +140 -0
- package/src/nodes/models/menu.ts +310 -0
- package/src/nodes/navigation-page.ts +154 -0
- package/src/nodes/navigation-view.ts +58 -0
- package/src/nodes/notebook-page-tab.ts +55 -0
- package/src/nodes/notebook-page.ts +185 -0
- package/src/nodes/notebook.ts +28 -0
- package/src/nodes/overlay-child.ts +109 -0
- package/src/nodes/popover-menu.ts +59 -0
- package/src/nodes/scale.ts +28 -0
- package/src/nodes/scrolled-window.ts +23 -0
- package/src/nodes/search-bar.ts +27 -0
- package/src/nodes/shortcut-controller.ts +27 -0
- package/src/nodes/shortcut.ts +69 -0
- package/src/nodes/slot.ts +138 -0
- package/src/nodes/source-view.ts +130 -0
- package/src/nodes/stack-page.ts +170 -0
- package/src/nodes/stack.ts +35 -0
- package/src/nodes/text-anchor.ts +74 -0
- package/src/nodes/text-content.ts +14 -0
- package/src/nodes/text-paintable.ts +51 -0
- package/src/nodes/text-segment.ts +55 -0
- package/src/nodes/text-tag.ts +287 -0
- package/src/nodes/text-view.ts +93 -0
- package/src/nodes/toggle-group.ts +27 -0
- package/src/nodes/toggle.ts +72 -0
- package/src/nodes/virtual.ts +16 -0
- package/src/nodes/web-view.ts +22 -0
- package/src/nodes/widget.ts +398 -0
- package/src/nodes/window.ts +159 -0
- package/src/portal.ts +37 -0
- package/src/reconciler.ts +52 -0
- package/src/registry.ts +123 -0
- package/src/render.tsx +192 -0
- package/src/types.ts +7 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Generated namespace registry for widget class resolution. */
|
|
2
|
+
import * as Adw from "@gtkx/ffi/adw";
|
|
3
|
+
import * as Gtk from "@gtkx/ffi/gtk";
|
|
4
|
+
import * as GtkSource from "@gtkx/ffi/gtksource";
|
|
5
|
+
import * as Vte from "@gtkx/ffi/vte";
|
|
6
|
+
import * as WebKit from "@gtkx/ffi/webkit";
|
|
7
|
+
|
|
8
|
+
type Namespace = Record<string, unknown>;
|
|
9
|
+
|
|
10
|
+
export const NAMESPACE_REGISTRY: [string, Namespace][] = [
|
|
11
|
+
["GtkSource", GtkSource],
|
|
12
|
+
["WebKit", WebKit],
|
|
13
|
+
["Adw", Adw],
|
|
14
|
+
["Gtk", Gtk],
|
|
15
|
+
["Vte", Vte],
|
|
16
|
+
];
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import type * as Gtk from "@gtkx/ffi/gtk";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type ReactReconciler from "react-reconciler";
|
|
4
|
+
import { createNode, resolveContainerClass } from "./factory.js";
|
|
5
|
+
import type { Node } from "./node.js";
|
|
6
|
+
import { isBuffered } from "./nodes/internal/predicates.js";
|
|
7
|
+
import type { Container, ContainerClass, Props } from "./types.js";
|
|
8
|
+
|
|
9
|
+
declare global {
|
|
10
|
+
var __GTKX_CONTAINER_NODE_CACHE__: WeakMap<Container, Node> | undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (!globalThis.__GTKX_CONTAINER_NODE_CACHE__) {
|
|
14
|
+
globalThis.__GTKX_CONTAINER_NODE_CACHE__ = new WeakMap<Container, Node>();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const containerNodeCache = globalThis.__GTKX_CONTAINER_NODE_CACHE__ as WeakMap<Container, Node>;
|
|
18
|
+
|
|
19
|
+
type TextInstance = Node;
|
|
20
|
+
type SuspenseInstance = never;
|
|
21
|
+
type HydratableInstance = never;
|
|
22
|
+
type PublicInstance = Gtk.Widget | Gtk.Application;
|
|
23
|
+
type HostContext = {
|
|
24
|
+
insideTextBuffer?: boolean;
|
|
25
|
+
};
|
|
26
|
+
type ChildSet = never;
|
|
27
|
+
type TimeoutHandle = number;
|
|
28
|
+
type NoTimeout = -1;
|
|
29
|
+
type TransitionStatus = number;
|
|
30
|
+
type FormInstance = never;
|
|
31
|
+
|
|
32
|
+
type HostConfig = ReactReconciler.HostConfig<
|
|
33
|
+
string,
|
|
34
|
+
Props,
|
|
35
|
+
Container,
|
|
36
|
+
Node,
|
|
37
|
+
TextInstance,
|
|
38
|
+
SuspenseInstance,
|
|
39
|
+
HydratableInstance,
|
|
40
|
+
FormInstance,
|
|
41
|
+
PublicInstance,
|
|
42
|
+
HostContext,
|
|
43
|
+
ChildSet,
|
|
44
|
+
TimeoutHandle,
|
|
45
|
+
NoTimeout,
|
|
46
|
+
TransitionStatus
|
|
47
|
+
>;
|
|
48
|
+
|
|
49
|
+
export type ReconcilerInstance = ReactReconciler.Reconciler<
|
|
50
|
+
Container,
|
|
51
|
+
Node,
|
|
52
|
+
TextInstance,
|
|
53
|
+
SuspenseInstance,
|
|
54
|
+
FormInstance,
|
|
55
|
+
PublicInstance
|
|
56
|
+
>;
|
|
57
|
+
|
|
58
|
+
const getOrCreateContainerNode = (container: Container): Node => {
|
|
59
|
+
let node = containerNodeCache.get(container);
|
|
60
|
+
|
|
61
|
+
if (!node) {
|
|
62
|
+
const type = (container.constructor as ContainerClass).glibTypeName;
|
|
63
|
+
node = createNode(type, {}, container, container);
|
|
64
|
+
containerNodeCache.set(container, node);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return node;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export function createHostConfig(): HostConfig {
|
|
71
|
+
return {
|
|
72
|
+
supportsMutation: true,
|
|
73
|
+
supportsPersistence: false,
|
|
74
|
+
supportsHydration: false,
|
|
75
|
+
isPrimaryRenderer: true,
|
|
76
|
+
noTimeout: -1,
|
|
77
|
+
getRootHostContext: () => ({}),
|
|
78
|
+
getChildHostContext: (parentHostContext, type) => {
|
|
79
|
+
const containerClass = resolveContainerClass(type);
|
|
80
|
+
if ((containerClass && isBuffered(containerClass.prototype)) || type === "TextTag") {
|
|
81
|
+
return { insideTextBuffer: true };
|
|
82
|
+
}
|
|
83
|
+
if (parentHostContext.insideTextBuffer) {
|
|
84
|
+
return {};
|
|
85
|
+
}
|
|
86
|
+
return parentHostContext;
|
|
87
|
+
},
|
|
88
|
+
shouldSetTextContent: () => false,
|
|
89
|
+
createInstance: (type, props, rootContainer) => {
|
|
90
|
+
return createNode(type, props, undefined, rootContainer);
|
|
91
|
+
},
|
|
92
|
+
createTextInstance: (text, rootContainer, hostContext) => {
|
|
93
|
+
if (hostContext.insideTextBuffer) {
|
|
94
|
+
const props = { text };
|
|
95
|
+
const node = createNode("TextSegment", props, undefined, rootContainer);
|
|
96
|
+
node.commitUpdate(null, props);
|
|
97
|
+
return node;
|
|
98
|
+
}
|
|
99
|
+
const props = { label: text };
|
|
100
|
+
const node = createNode("GtkLabel", props, undefined, rootContainer);
|
|
101
|
+
node.commitUpdate(null, props);
|
|
102
|
+
return node;
|
|
103
|
+
},
|
|
104
|
+
appendInitialChild: (parent, child) => {
|
|
105
|
+
parent.appendInitialChild(child);
|
|
106
|
+
},
|
|
107
|
+
finalizeInitialChildren: (instance, _type, props) => {
|
|
108
|
+
return instance.finalizeInitialChildren(props);
|
|
109
|
+
},
|
|
110
|
+
commitUpdate: (instance, _type, oldProps, newProps) => {
|
|
111
|
+
instance.commitUpdate(oldProps, newProps);
|
|
112
|
+
},
|
|
113
|
+
commitMount: (instance) => {
|
|
114
|
+
instance.commitMount();
|
|
115
|
+
},
|
|
116
|
+
appendChild: (parent, child) => {
|
|
117
|
+
parent.appendChild(child);
|
|
118
|
+
},
|
|
119
|
+
removeChild: (parent, child) => {
|
|
120
|
+
parent.removeChild(child);
|
|
121
|
+
},
|
|
122
|
+
insertBefore: (parent, child, beforeChild) => {
|
|
123
|
+
parent.insertBefore(child, beforeChild);
|
|
124
|
+
},
|
|
125
|
+
removeChildFromContainer: (container, child) => {
|
|
126
|
+
const parent = getOrCreateContainerNode(container);
|
|
127
|
+
parent.removeChild(child);
|
|
128
|
+
},
|
|
129
|
+
appendChildToContainer: (container, child) => {
|
|
130
|
+
const parent = getOrCreateContainerNode(container);
|
|
131
|
+
parent.appendChild(child);
|
|
132
|
+
},
|
|
133
|
+
insertInContainerBefore: (container, child, beforeChild) => {
|
|
134
|
+
const parent = getOrCreateContainerNode(container);
|
|
135
|
+
parent.insertBefore(child, beforeChild);
|
|
136
|
+
},
|
|
137
|
+
prepareForCommit: () => {
|
|
138
|
+
return null;
|
|
139
|
+
},
|
|
140
|
+
resetAfterCommit: () => {},
|
|
141
|
+
commitTextUpdate: (textInstance, oldText, newText) => {
|
|
142
|
+
if (textInstance.typeName === "TextSegment") {
|
|
143
|
+
textInstance.commitUpdate({ text: oldText }, { text: newText });
|
|
144
|
+
} else {
|
|
145
|
+
textInstance.commitUpdate({ label: oldText }, { label: newText });
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
clearContainer: () => {},
|
|
149
|
+
preparePortalMount: () => {},
|
|
150
|
+
scheduleTimeout: (fn, delay) => {
|
|
151
|
+
const timeoutId = setTimeout(fn, delay ?? 0);
|
|
152
|
+
return typeof timeoutId === "number" ? timeoutId : Number(timeoutId);
|
|
153
|
+
},
|
|
154
|
+
cancelTimeout: (id) => {
|
|
155
|
+
clearTimeout(id);
|
|
156
|
+
},
|
|
157
|
+
getPublicInstance: (instance) => instance.container as PublicInstance,
|
|
158
|
+
getCurrentUpdatePriority: () => 2,
|
|
159
|
+
setCurrentUpdatePriority: () => {},
|
|
160
|
+
resolveUpdatePriority: () => 2,
|
|
161
|
+
NotPendingTransition: null,
|
|
162
|
+
HostTransitionContext: createReconcilerContext(0),
|
|
163
|
+
getInstanceFromNode: () => null,
|
|
164
|
+
beforeActiveInstanceBlur: () => {},
|
|
165
|
+
afterActiveInstanceBlur: () => {},
|
|
166
|
+
prepareScopeUpdate: () => {},
|
|
167
|
+
getInstanceFromScope: () => null,
|
|
168
|
+
detachDeletedInstance: (instance) => instance.detachDeletedInstance(),
|
|
169
|
+
resetFormInstance: () => {},
|
|
170
|
+
requestPostPaintCallback: () => {},
|
|
171
|
+
shouldAttemptEagerTransition: () => false,
|
|
172
|
+
trackSchedulerEvent: () => {},
|
|
173
|
+
resolveEventType: () => null,
|
|
174
|
+
resolveEventTimeStamp: () => Date.now(),
|
|
175
|
+
maySuspendCommit: () => false,
|
|
176
|
+
preloadInstance: () => false,
|
|
177
|
+
startSuspendingCommit: () => {},
|
|
178
|
+
suspendInstance: () => {},
|
|
179
|
+
waitForCommitToBeReady: () => null,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function createReconcilerContext(value: TransitionStatus): ReactReconciler.ReactContext<TransitionStatus> {
|
|
184
|
+
const context = React.createContext<TransitionStatus>(value);
|
|
185
|
+
return context as unknown as ReactReconciler.ReactContext<TransitionStatus>;
|
|
186
|
+
}
|
package/src/index.ts
ADDED