@gtkx/react 0.17.2 → 0.18.0
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/README.md +7 -7
- package/dist/factory.d.ts +0 -1
- package/dist/factory.js +21 -8
- package/dist/generated/internal.d.ts +4 -51
- package/dist/generated/internal.js +626 -412
- package/dist/generated/jsx.d.ts +453 -958
- package/dist/host-config.d.ts +1 -1
- package/dist/host-config.js +18 -23
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/jsx.d.ts +579 -302
- package/dist/jsx.js +37 -179
- package/dist/metadata.d.ts +3 -0
- package/dist/metadata.js +26 -0
- package/dist/node.d.ts +20 -12
- package/dist/node.js +72 -17
- package/dist/nodes/adjustable.d.ts +3 -16
- package/dist/nodes/adjustable.js +5 -22
- package/dist/nodes/alert-dialog-response.d.ts +14 -1
- package/dist/nodes/alert-dialog-response.js +36 -62
- package/dist/nodes/animation.d.ts +37 -1
- package/dist/nodes/animation.js +162 -105
- package/dist/nodes/application.d.ts +11 -1
- package/dist/nodes/application.js +17 -38
- package/dist/nodes/calendar.d.ts +13 -0
- package/dist/nodes/calendar.js +10 -16
- package/dist/nodes/color-dialog-button.d.ts +13 -0
- package/dist/nodes/color-dialog-button.js +10 -38
- package/dist/nodes/column-view-column.d.ts +13 -11
- package/dist/nodes/column-view-column.js +27 -23
- package/dist/nodes/column-view.d.ts +31 -0
- package/dist/nodes/column-view.js +44 -44
- package/dist/nodes/container-slot.d.ts +15 -0
- package/dist/nodes/container-slot.js +68 -0
- package/dist/nodes/dialog.d.ts +6 -8
- package/dist/nodes/dialog.js +12 -13
- package/dist/nodes/drawing-area.d.ts +12 -0
- package/dist/nodes/drawing-area.js +24 -24
- package/dist/nodes/drop-down.d.ts +22 -0
- package/dist/nodes/drop-down.js +72 -0
- package/dist/nodes/event-controller.d.ts +8 -17
- package/dist/nodes/event-controller.js +20 -42
- package/dist/nodes/fixed-child.d.ts +18 -1
- package/dist/nodes/fixed-child.js +52 -36
- package/dist/nodes/font-dialog-button.d.ts +13 -0
- package/dist/nodes/font-dialog-button.js +12 -35
- package/dist/nodes/grid-child.d.ts +17 -1
- package/dist/nodes/grid-child.js +57 -37
- package/dist/nodes/grid-view.d.ts +24 -0
- package/dist/nodes/grid-view.js +73 -0
- package/dist/nodes/internal/base-item-renderer.d.ts +7 -9
- package/dist/nodes/internal/base-item-renderer.js +15 -18
- package/dist/nodes/internal/grid-item-renderer.d.ts +17 -0
- package/dist/nodes/internal/grid-item-renderer.js +59 -0
- package/dist/nodes/internal/list-item-renderer.d.ts +14 -9
- package/dist/nodes/internal/list-item-renderer.js +96 -35
- package/dist/nodes/internal/list-store.d.ts +5 -0
- package/dist/nodes/internal/list-store.js +39 -9
- package/dist/nodes/internal/predicates.d.ts +4 -19
- package/dist/nodes/internal/predicates.js +1 -20
- package/dist/nodes/internal/props.d.ts +5 -0
- package/dist/nodes/internal/props.js +42 -0
- package/dist/nodes/internal/{selection-model.d.ts → selection-model-controller.d.ts} +4 -9
- package/dist/nodes/internal/{selection-model.js → selection-model-controller.js} +6 -15
- package/dist/nodes/internal/signal-store.js +12 -5
- package/dist/nodes/internal/simple-list-store.d.ts +5 -0
- package/dist/nodes/internal/simple-list-store.js +42 -13
- package/dist/nodes/internal/text-buffer-controller.d.ts +4 -12
- package/dist/nodes/internal/text-buffer-controller.js +32 -33
- package/dist/nodes/internal/tree-store.d.ts +7 -0
- package/dist/nodes/internal/tree-store.js +75 -18
- package/dist/nodes/internal/widget.d.ts +7 -0
- package/dist/nodes/internal/widget.js +68 -0
- package/dist/nodes/level-bar.d.ts +10 -0
- package/dist/nodes/level-bar.js +11 -22
- package/dist/nodes/list-item.d.ts +17 -9
- package/dist/nodes/list-item.js +67 -12
- package/dist/nodes/list-view.d.ts +23 -0
- package/dist/nodes/list-view.js +27 -31
- package/dist/nodes/menu.d.ts +2 -4
- package/dist/nodes/menu.js +0 -6
- package/dist/nodes/models/grid.d.ts +27 -0
- package/dist/nodes/models/grid.js +68 -0
- package/dist/nodes/models/list.d.ts +15 -13
- package/dist/nodes/models/list.js +48 -26
- package/dist/nodes/models/menu.d.ts +15 -16
- package/dist/nodes/models/menu.js +63 -93
- package/dist/nodes/navigation-page.d.ts +16 -10
- package/dist/nodes/navigation-page.js +108 -31
- package/dist/nodes/navigation-view.d.ts +15 -0
- package/dist/nodes/navigation-view.js +15 -65
- package/dist/nodes/notebook-page-tab.d.ts +10 -12
- package/dist/nodes/notebook-page-tab.js +24 -27
- package/dist/nodes/notebook-page.d.ts +19 -16
- package/dist/nodes/notebook-page.js +75 -56
- package/dist/nodes/notebook.d.ts +10 -1
- package/dist/nodes/notebook.js +10 -22
- package/dist/nodes/overlay-child.d.ts +17 -1
- package/dist/nodes/overlay-child.js +53 -75
- package/dist/nodes/popover-menu.d.ts +15 -0
- package/dist/nodes/popover-menu.js +13 -26
- package/dist/nodes/scale.d.ts +8 -0
- package/dist/nodes/scale.js +2 -11
- package/dist/nodes/scrolled-window.d.ts +9 -0
- package/dist/nodes/scrolled-window.js +5 -11
- package/dist/nodes/search-bar.d.ts +9 -0
- package/dist/nodes/search-bar.js +8 -33
- package/dist/nodes/shortcut-controller.d.ts +9 -1
- package/dist/nodes/shortcut-controller.js +12 -25
- package/dist/nodes/shortcut.d.ts +11 -33
- package/dist/nodes/shortcut.js +19 -15
- package/dist/nodes/slot.d.ts +16 -15
- package/dist/nodes/slot.js +63 -57
- package/dist/nodes/source-view.d.ts +16 -0
- package/dist/nodes/source-view.js +44 -44
- package/dist/nodes/stack-page.d.ts +21 -1
- package/dist/nodes/stack-page.js +68 -17
- package/dist/nodes/stack.d.ts +11 -0
- package/dist/nodes/stack.js +8 -26
- package/dist/nodes/text-anchor.d.ts +11 -30
- package/dist/nodes/text-anchor.js +20 -22
- package/dist/nodes/text-content.d.ts +1 -0
- package/dist/nodes/text-content.js +1 -1
- package/dist/nodes/text-paintable.d.ts +10 -15
- package/dist/nodes/text-paintable.js +16 -9
- package/dist/nodes/text-segment.d.ts +12 -10
- package/dist/nodes/text-segment.js +19 -11
- package/dist/nodes/text-tag.d.ts +20 -119
- package/dist/nodes/text-tag.js +153 -119
- package/dist/nodes/text-view.d.ts +13 -18
- package/dist/nodes/text-view.js +17 -17
- package/dist/nodes/toggle-group.d.ts +9 -0
- package/dist/nodes/toggle-group.js +8 -33
- package/dist/nodes/toggle.d.ts +15 -1
- package/dist/nodes/toggle.js +34 -52
- package/dist/nodes/virtual.d.ts +3 -10
- package/dist/nodes/virtual.js +1 -14
- package/dist/nodes/web-view.d.ts +9 -0
- package/dist/nodes/web-view.js +10 -24
- package/dist/nodes/widget.d.ts +17 -13
- package/dist/nodes/widget.js +185 -112
- package/dist/nodes/window.d.ts +20 -21
- package/dist/nodes/window.js +54 -35
- package/dist/registry.d.ts +17 -6
- package/dist/registry.js +104 -5
- package/dist/render.d.ts +1 -10
- package/dist/render.js +1 -13
- package/package.json +6 -6
- package/dist/animation/css-builder.d.ts +0 -3
- package/dist/animation/css-builder.js +0 -53
- package/dist/animation/types.d.ts +0 -120
- package/dist/animation/types.js +0 -1
- package/dist/nodes/abstract/positional-child.d.ts +0 -9
- package/dist/nodes/abstract/positional-child.js +0 -29
- package/dist/nodes/abstract/virtual-container.d.ts +0 -21
- package/dist/nodes/abstract/virtual-container.js +0 -68
- package/dist/nodes/abstract/virtual-single-child.d.ts +0 -18
- package/dist/nodes/abstract/virtual-single-child.js +0 -55
- package/dist/nodes/action-row-child.d.ts +0 -1
- package/dist/nodes/action-row-child.js +0 -30
- package/dist/nodes/autowrapped.d.ts +0 -1
- package/dist/nodes/autowrapped.js +0 -115
- package/dist/nodes/expander-row-child.d.ts +0 -1
- package/dist/nodes/expander-row-child.js +0 -30
- package/dist/nodes/grid.d.ts +0 -1
- package/dist/nodes/grid.js +0 -41
- package/dist/nodes/index.d.ts +0 -56
- package/dist/nodes/index.js +0 -56
- package/dist/nodes/internal/child-attachment.d.ts +0 -26
- package/dist/nodes/internal/child-attachment.js +0 -48
- package/dist/nodes/internal/deferred-action.d.ts +0 -9
- package/dist/nodes/internal/deferred-action.js +0 -22
- package/dist/nodes/internal/text-tag-styles.d.ts +0 -43
- package/dist/nodes/internal/text-tag-styles.js +0 -52
- package/dist/nodes/internal/tree-list-item-renderer.d.ts +0 -26
- package/dist/nodes/internal/tree-list-item-renderer.js +0 -134
- package/dist/nodes/internal/utils.d.ts +0 -12
- package/dist/nodes/internal/utils.js +0 -92
- package/dist/nodes/models/tree-list.d.ts +0 -28
- package/dist/nodes/models/tree-list.js +0 -113
- package/dist/nodes/pack-child.d.ts +0 -1
- package/dist/nodes/pack-child.js +0 -30
- package/dist/nodes/simple-list-item.d.ts +0 -9
- package/dist/nodes/simple-list-item.js +0 -9
- package/dist/nodes/simple-list-view.d.ts +0 -1
- package/dist/nodes/simple-list-view.js +0 -74
- package/dist/nodes/toolbar-child.d.ts +0 -1
- package/dist/nodes/toolbar-child.js +0 -30
- package/dist/nodes/tree-list-item.d.ts +0 -22
- package/dist/nodes/tree-list-item.js +0 -90
- package/dist/nodes/tree-list-view.d.ts +0 -1
- package/dist/nodes/tree-list-view.js +0 -77
- package/dist/scheduler.d.ts +0 -26
- package/dist/scheduler.js +0 -42
package/dist/host-config.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type ReactReconciler from "react-reconciler";
|
|
|
3
3
|
import type { Node } from "./node.js";
|
|
4
4
|
import type { Container, Props } from "./types.js";
|
|
5
5
|
declare global {
|
|
6
|
-
var __GTKX_CONTAINER_NODE_CACHE__:
|
|
6
|
+
var __GTKX_CONTAINER_NODE_CACHE__: WeakMap<Container, Node> | undefined;
|
|
7
7
|
}
|
|
8
8
|
type TextInstance = Node;
|
|
9
9
|
type SuspenseInstance = never;
|
package/dist/host-config.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import { getNativeId } from "@gtkx/ffi";
|
|
2
1
|
import React from "react";
|
|
3
|
-
import { createNode } from "./factory.js";
|
|
4
|
-
import {
|
|
5
|
-
import { flushAfterCommit } from "./scheduler.js";
|
|
2
|
+
import { createNode, resolveContainerClass } from "./factory.js";
|
|
3
|
+
import { isBuffered } from "./nodes/internal/predicates.js";
|
|
6
4
|
if (!globalThis.__GTKX_CONTAINER_NODE_CACHE__) {
|
|
7
|
-
globalThis.__GTKX_CONTAINER_NODE_CACHE__ = new
|
|
5
|
+
globalThis.__GTKX_CONTAINER_NODE_CACHE__ = new WeakMap();
|
|
8
6
|
}
|
|
9
7
|
const containerNodeCache = globalThis.__GTKX_CONTAINER_NODE_CACHE__;
|
|
10
8
|
const getOrCreateContainerNode = (container) => {
|
|
11
|
-
|
|
12
|
-
let node = containerNodeCache.get(id);
|
|
9
|
+
let node = containerNodeCache.get(container);
|
|
13
10
|
if (!node) {
|
|
14
11
|
const type = container.constructor.glibTypeName;
|
|
15
12
|
node = createNode(type, {}, container, container);
|
|
16
|
-
containerNodeCache.set(
|
|
13
|
+
containerNodeCache.set(container, node);
|
|
17
14
|
}
|
|
18
15
|
return node;
|
|
19
16
|
};
|
|
@@ -26,7 +23,8 @@ export function createHostConfig() {
|
|
|
26
23
|
noTimeout: -1,
|
|
27
24
|
getRootHostContext: () => ({}),
|
|
28
25
|
getChildHostContext: (parentHostContext, type) => {
|
|
29
|
-
|
|
26
|
+
const containerClass = resolveContainerClass(type);
|
|
27
|
+
if ((containerClass && isBuffered(containerClass.prototype)) || type === "TextTag") {
|
|
30
28
|
return { insideTextBuffer: true };
|
|
31
29
|
}
|
|
32
30
|
if (parentHostContext.insideTextBuffer) {
|
|
@@ -42,26 +40,25 @@ export function createHostConfig() {
|
|
|
42
40
|
if (hostContext.insideTextBuffer) {
|
|
43
41
|
const props = { text };
|
|
44
42
|
const node = createNode("TextSegment", props, undefined, rootContainer);
|
|
45
|
-
node.
|
|
43
|
+
node.commitUpdate(null, props);
|
|
46
44
|
return node;
|
|
47
45
|
}
|
|
48
46
|
const props = { label: text };
|
|
49
47
|
const node = createNode("GtkLabel", props, undefined, rootContainer);
|
|
50
|
-
node.
|
|
48
|
+
node.commitUpdate(null, props);
|
|
51
49
|
return node;
|
|
52
50
|
},
|
|
53
51
|
appendInitialChild: (parent, child) => {
|
|
54
|
-
parent.
|
|
52
|
+
parent.appendInitialChild(child);
|
|
55
53
|
},
|
|
56
54
|
finalizeInitialChildren: (instance, _type, props) => {
|
|
57
|
-
instance.
|
|
58
|
-
return true;
|
|
55
|
+
return instance.finalizeInitialChildren(props);
|
|
59
56
|
},
|
|
60
57
|
commitUpdate: (instance, _type, oldProps, newProps) => {
|
|
61
|
-
instance.
|
|
58
|
+
instance.commitUpdate(oldProps, newProps);
|
|
62
59
|
},
|
|
63
|
-
commitMount: (instance
|
|
64
|
-
instance.
|
|
60
|
+
commitMount: (instance) => {
|
|
61
|
+
instance.commitMount();
|
|
65
62
|
},
|
|
66
63
|
appendChild: (parent, child) => {
|
|
67
64
|
parent.appendChild(child);
|
|
@@ -87,15 +84,13 @@ export function createHostConfig() {
|
|
|
87
84
|
prepareForCommit: () => {
|
|
88
85
|
return null;
|
|
89
86
|
},
|
|
90
|
-
resetAfterCommit: () => {
|
|
91
|
-
flushAfterCommit();
|
|
92
|
-
},
|
|
87
|
+
resetAfterCommit: () => { },
|
|
93
88
|
commitTextUpdate: (textInstance, oldText, newText) => {
|
|
94
89
|
if (textInstance.typeName === "TextSegment") {
|
|
95
|
-
textInstance.
|
|
90
|
+
textInstance.commitUpdate({ text: oldText }, { text: newText });
|
|
96
91
|
}
|
|
97
92
|
else {
|
|
98
|
-
textInstance.
|
|
93
|
+
textInstance.commitUpdate({ label: oldText }, { label: newText });
|
|
99
94
|
}
|
|
100
95
|
},
|
|
101
96
|
clearContainer: () => { },
|
|
@@ -118,7 +113,7 @@ export function createHostConfig() {
|
|
|
118
113
|
afterActiveInstanceBlur: () => { },
|
|
119
114
|
prepareScopeUpdate: () => { },
|
|
120
115
|
getInstanceFromScope: () => null,
|
|
121
|
-
detachDeletedInstance: (instance) => instance.
|
|
116
|
+
detachDeletedInstance: (instance) => instance.detachDeletedInstance(),
|
|
122
117
|
resetFormInstance: () => { },
|
|
123
118
|
requestPostPaintCallback: () => { },
|
|
124
119
|
shouldAttemptEagerTransition: () => false,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from "./jsx.js";
|
|
2
2
|
export { createPortal } from "./portal.js";
|
|
3
3
|
export { reconciler } from "./reconciler.js";
|
|
4
|
-
export { ApplicationContext,
|
|
4
|
+
export { ApplicationContext, quit, render, setHotReloading, update, useApplication, } from "./render.js";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from "./jsx.js";
|
|
2
2
|
export { createPortal } from "./portal.js";
|
|
3
3
|
export { reconciler } from "./reconciler.js";
|
|
4
|
-
export { ApplicationContext,
|
|
4
|
+
export { ApplicationContext, quit, render, setHotReloading, update, useApplication, } from "./render.js";
|