@gtkx/react 0.1.12 → 0.1.15
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 +6 -5
- package/dist/codegen/jsx-generator.js +13 -11
- package/dist/factory.js +2 -36
- package/dist/generated/jsx.d.ts +239 -239
- package/dist/index.js +2 -3
- package/dist/node.d.ts +17 -7
- package/dist/node.js +126 -1
- package/dist/nodes/dropdown.d.ts +23 -30
- package/dist/nodes/dropdown.js +31 -99
- package/dist/nodes/grid.d.ts +7 -24
- package/dist/nodes/grid.js +19 -72
- package/dist/nodes/list.d.ts +12 -31
- package/dist/nodes/list.js +30 -95
- package/dist/nodes/overlay.d.ts +3 -23
- package/dist/nodes/overlay.js +7 -85
- package/dist/nodes/slot.d.ts +5 -9
- package/dist/nodes/slot.js +13 -14
- package/dist/nodes/widget.d.ts +9 -12
- package/dist/nodes/widget.js +59 -79
- package/dist/portal.d.ts +1 -1
- package/dist/portal.js +2 -3
- package/dist/predicates.d.ts +13 -0
- package/dist/predicates.js +3 -0
- package/dist/reconciler.d.ts +7 -6
- package/dist/reconciler.js +24 -30
- package/dist/render.js +2 -1
- package/dist/types.d.ts +2 -2
- package/package.json +5 -4
- package/dist/nodes/action-bar.d.ts +0 -27
- package/dist/nodes/action-bar.js +0 -88
- package/dist/nodes/dialog.d.ts +0 -19
- package/dist/nodes/dialog.js +0 -87
- package/dist/nodes/notebook.d.ts +0 -25
- package/dist/nodes/notebook.js +0 -88
- package/dist/nodes/text.d.ts +0 -16
- package/dist/nodes/text.js +0 -31
- package/dist/signal-utils.d.ts +0 -4
- package/dist/signal-utils.js +0 -7
- package/dist/widget-capabilities.d.ts +0 -46
- package/dist/widget-capabilities.js +0 -32
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export const isAppendable = (widget) => "append" in widget && typeof widget.append === "function";
|
|
2
|
-
export const isSingleChild = (widget) => "setChild" in widget && typeof widget.setChild === "function";
|
|
3
|
-
export const isRemovable = (widget) => "remove" in widget && typeof widget.remove === "function";
|
|
4
|
-
export const isPresentable = (widget) => "present" in widget && typeof widget.present === "function";
|
|
5
|
-
export const isConnectable = (widget) => "connect" in widget && typeof widget.connect === "function";
|
|
6
|
-
export const isDefaultSizable = (widget) => "setDefaultSize" in widget && typeof widget.setDefaultSize === "function";
|
|
7
|
-
export const isModelSettable = (widget) => "setModel" in widget && typeof widget.setModel === "function";
|
|
8
|
-
export const isSelectable = (widget) => "getSelected" in widget && typeof widget.getSelected === "function";
|
|
9
|
-
export const isGridAttachable = (widget) => "attach" in widget && typeof widget.attach === "function";
|
|
10
|
-
export const isNotebookLike = (widget) => "appendPage" in widget &&
|
|
11
|
-
typeof widget.appendPage === "function" &&
|
|
12
|
-
"pageNum" in widget &&
|
|
13
|
-
typeof widget.pageNum === "function" &&
|
|
14
|
-
"removePage" in widget &&
|
|
15
|
-
typeof widget.removePage === "function";
|
|
16
|
-
export const appendChild = (parent, child) => {
|
|
17
|
-
if (isSingleChild(parent)) {
|
|
18
|
-
parent.setChild(child.ptr);
|
|
19
|
-
}
|
|
20
|
-
else if (isAppendable(parent)) {
|
|
21
|
-
parent.append(child.ptr);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
export const removeChild = (parent, child) => {
|
|
25
|
-
if (isRemovable(parent)) {
|
|
26
|
-
parent.remove(child.ptr);
|
|
27
|
-
}
|
|
28
|
-
else if (isSingleChild(parent)) {
|
|
29
|
-
parent.setChild(null);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
export { disconnectSignalHandlers } from "./signal-utils.js";
|