@gtkx/react 0.8.0 → 0.9.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/dist/{container-interfaces.d.ts → containers.d.ts} +10 -37
- package/dist/containers.js +1 -0
- package/dist/factory.d.ts +1 -1
- package/dist/factory.js +3 -3
- package/dist/{reconciler/host-config.d.ts → host-config.d.ts} +2 -2
- package/dist/{reconciler/host-config.js → host-config.js} +2 -2
- package/dist/node.d.ts +5 -6
- package/dist/node.js +54 -72
- package/dist/nodes/about-dialog.d.ts +2 -3
- package/dist/nodes/about-dialog.js +6 -4
- package/dist/nodes/column-view.d.ts +6 -7
- package/dist/nodes/column-view.js +29 -32
- package/dist/nodes/grid.d.ts +4 -1
- package/dist/nodes/grid.js +39 -1
- package/dist/nodes/header-bar.d.ts +15 -14
- package/dist/nodes/header-bar.js +79 -39
- package/dist/nodes/indexed-child-container.d.ts +1 -1
- package/dist/nodes/list-view.d.ts +1 -2
- package/dist/nodes/list-view.js +2 -2
- package/dist/nodes/menu.d.ts +27 -11
- package/dist/nodes/menu.js +59 -32
- package/dist/nodes/notebook.d.ts +4 -1
- package/dist/nodes/notebook.js +45 -1
- package/dist/nodes/overlay.d.ts +1 -1
- package/dist/nodes/paged-stack.d.ts +7 -3
- package/dist/nodes/paged-stack.js +47 -2
- package/dist/nodes/root.d.ts +1 -1
- package/dist/nodes/root.js +2 -2
- package/dist/nodes/selectable-list.d.ts +7 -3
- package/dist/nodes/selectable-list.js +34 -2
- package/dist/nodes/slot.d.ts +3 -4
- package/dist/nodes/slot.js +11 -10
- package/dist/nodes/stack-page-props.d.ts +1 -1
- package/dist/nodes/stack.d.ts +1 -1
- package/dist/nodes/stack.js +1 -1
- package/dist/nodes/string-list-container.d.ts +4 -11
- package/dist/nodes/string-list-container.js +32 -4
- package/dist/nodes/string-list-item.d.ts +10 -6
- package/dist/nodes/string-list-item.js +19 -17
- package/dist/nodes/toggle-button.d.ts +0 -3
- package/dist/nodes/toggle-button.js +0 -28
- package/dist/nodes/toolbar-view.d.ts +2 -3
- package/dist/nodes/toolbar-view.js +10 -9
- package/dist/nodes/view-stack.d.ts +1 -1
- package/dist/nodes/virtual-item.d.ts +9 -5
- package/dist/nodes/virtual-item.js +16 -20
- package/dist/nodes/virtual-slot.d.ts +4 -4
- package/dist/nodes/virtual-slot.js +12 -26
- package/dist/nodes/window.d.ts +2 -1
- package/dist/nodes/window.js +7 -3
- package/dist/predicates.d.ts +9 -18
- package/dist/predicates.js +31 -18
- package/dist/reconciler.d.ts +1 -1
- package/dist/reconciler.js +1 -1
- package/package.json +4 -4
- package/dist/container-interfaces.js +0 -26
package/dist/predicates.js
CHANGED
|
@@ -1,24 +1,37 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type guard that checks if a GTK widget supports appending children via an append method.
|
|
3
|
-
*/
|
|
4
1
|
export const isAppendable = (widget) => "append" in widget && typeof widget.append === "function";
|
|
5
|
-
/**
|
|
6
|
-
* Type guard that checks if a GTK widget supports adding children via an add method.
|
|
7
|
-
*/
|
|
8
2
|
export const isAddable = (widget) => "add" in widget && typeof widget.add === "function";
|
|
9
|
-
/**
|
|
10
|
-
* Type guard that checks if a GTK widget supports a single child via setChild method.
|
|
11
|
-
*/
|
|
12
3
|
export const isSingleChild = (widget) => "setChild" in widget && typeof widget.setChild === "function";
|
|
13
|
-
/**
|
|
14
|
-
* Type guard that checks if a GTK widget supports removing children via a remove method.
|
|
15
|
-
*/
|
|
16
4
|
export const isRemovable = (widget) => "remove" in widget && typeof widget.remove === "function";
|
|
17
|
-
/**
|
|
18
|
-
* Type guard that checks if a GTK widget is a FlowBoxChild.
|
|
19
|
-
*/
|
|
20
5
|
export const isFlowBoxChild = (widget) => "getIndex" in widget && "getChild" in widget && typeof widget.getIndex === "function";
|
|
21
|
-
/**
|
|
22
|
-
* Type guard that checks if a GTK widget is a ListBoxRow.
|
|
23
|
-
*/
|
|
24
6
|
export const isListBoxRow = (widget) => "getIndex" in widget && "isSelected" in widget && typeof widget.getIndex === "function";
|
|
7
|
+
const createContainerGuard = (requiredMethods) => (node) => requiredMethods.every((method) => method in node);
|
|
8
|
+
export const isChildContainer = createContainerGuard([
|
|
9
|
+
"attachChild",
|
|
10
|
+
"detachChild",
|
|
11
|
+
"insertChildBefore",
|
|
12
|
+
]);
|
|
13
|
+
export const isPageContainer = createContainerGuard([
|
|
14
|
+
"addPage",
|
|
15
|
+
"removePage",
|
|
16
|
+
"insertPageBefore",
|
|
17
|
+
"updatePageLabel",
|
|
18
|
+
]);
|
|
19
|
+
export const isStackPageContainer = createContainerGuard([
|
|
20
|
+
"addStackPage",
|
|
21
|
+
"removeStackPage",
|
|
22
|
+
"updateStackPageProps",
|
|
23
|
+
]);
|
|
24
|
+
export const isGridContainer = createContainerGuard(["attachToGrid", "removeFromGrid"]);
|
|
25
|
+
export const isItemContainer = createContainerGuard([
|
|
26
|
+
"addItem",
|
|
27
|
+
"insertItemBefore",
|
|
28
|
+
"removeItem",
|
|
29
|
+
"updateItem",
|
|
30
|
+
]);
|
|
31
|
+
export const isPackContainer = createContainerGuard(["packStart", "packEnd", "removeFromPack"]);
|
|
32
|
+
export const isStringListContainer = createContainerGuard([
|
|
33
|
+
"addStringListItem",
|
|
34
|
+
"insertStringListItemBefore",
|
|
35
|
+
"removeStringListItem",
|
|
36
|
+
"updateStringListItem",
|
|
37
|
+
]);
|
package/dist/reconciler.d.ts
CHANGED
package/dist/reconciler.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ReactReconciler from "react-reconciler";
|
|
2
2
|
import packageJson from "../package.json" with { type: "json" };
|
|
3
3
|
import { createNode } from "./factory.js";
|
|
4
|
-
import { createHostConfig } from "./
|
|
4
|
+
import { createHostConfig } from "./host-config.js";
|
|
5
5
|
class Reconciler {
|
|
6
6
|
instance;
|
|
7
7
|
constructor() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtkx/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Build GTK4 desktop applications with React and TypeScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gtk",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"react-reconciler": "^0.33.0",
|
|
39
|
-
"@gtkx/ffi": "0.
|
|
39
|
+
"@gtkx/ffi": "0.9.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@gtkx/
|
|
43
|
-
"@gtkx/
|
|
42
|
+
"@gtkx/native": "0.9.0",
|
|
43
|
+
"@gtkx/gir": "0.9.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": "^19"
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const createContainerGuard = (requiredMethods) => (node) => requiredMethods.every((method) => method in node);
|
|
2
|
-
export const isChildContainer = createContainerGuard([
|
|
3
|
-
"attachChild",
|
|
4
|
-
"detachChild",
|
|
5
|
-
"insertChildBefore",
|
|
6
|
-
]);
|
|
7
|
-
export const isPageContainer = createContainerGuard([
|
|
8
|
-
"addPage",
|
|
9
|
-
"removePage",
|
|
10
|
-
"insertPageBefore",
|
|
11
|
-
"updatePageLabel",
|
|
12
|
-
]);
|
|
13
|
-
export const isStackPageContainer = createContainerGuard([
|
|
14
|
-
"addStackPage",
|
|
15
|
-
"removeStackPage",
|
|
16
|
-
"updateStackPageProps",
|
|
17
|
-
]);
|
|
18
|
-
export const isGridContainer = createContainerGuard(["attachToGrid", "removeFromGrid"]);
|
|
19
|
-
export const isItemContainer = createContainerGuard([
|
|
20
|
-
"addItem",
|
|
21
|
-
"insertItemBefore",
|
|
22
|
-
"removeItem",
|
|
23
|
-
"updateItem",
|
|
24
|
-
]);
|
|
25
|
-
export const isColumnContainer = createContainerGuard(["addColumn", "removeColumn", "getItems"]);
|
|
26
|
-
export const isPackContainer = createContainerGuard(["packStart", "packEnd", "removeFromPack"]);
|