@gtkx/react 0.1.18 → 0.1.19
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/codegen/jsx-generator.js +7 -4
- package/dist/factory.d.ts +2 -1
- package/dist/factory.js +2 -2
- package/dist/generated/jsx.d.ts +219 -216
- package/dist/generated/jsx.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/node.d.ts +4 -4
- package/dist/node.js +9 -11
- package/dist/nodes/dropdown.d.ts +2 -2
- package/dist/nodes/dropdown.js +4 -4
- package/dist/nodes/grid.d.ts +1 -1
- package/dist/nodes/grid.js +2 -2
- package/dist/nodes/list.d.ts +3 -3
- package/dist/nodes/list.js +6 -6
- package/dist/nodes/slot.d.ts +2 -1
- package/dist/nodes/slot.js +2 -2
- package/dist/nodes/widget.d.ts +3 -3
- package/dist/nodes/widget.js +6 -8
- package/dist/portal.d.ts +0 -1
- package/dist/portal.js +2 -2
- package/dist/reconciler.d.ts +14 -13
- package/dist/reconciler.js +29 -26
- package/dist/render.js +7 -7
- package/package.json +8 -5
|
@@ -108,6 +108,7 @@ export class JsxGenerator {
|
|
|
108
108
|
.sort()
|
|
109
109
|
.map((ns) => `import type * as ${ns} from "@gtkx/ffi/${ns.toLowerCase()}";`);
|
|
110
110
|
return [
|
|
111
|
+
`import "react";`,
|
|
111
112
|
`import type { ReactNode, Ref } from "react";`,
|
|
112
113
|
...externalImports,
|
|
113
114
|
`import type * as Gtk from "@gtkx/ffi/gtk";`,
|
|
@@ -528,10 +529,12 @@ ${widgetPropsContent}
|
|
|
528
529
|
}
|
|
529
530
|
}
|
|
530
531
|
return `
|
|
531
|
-
declare
|
|
532
|
-
\tnamespace
|
|
533
|
-
\t\
|
|
534
|
-
\t\t\
|
|
532
|
+
declare global {
|
|
533
|
+
\tnamespace React {
|
|
534
|
+
\t\tnamespace JSX {
|
|
535
|
+
\t\t\tinterface IntrinsicElements {
|
|
536
|
+
\t\t\t\t${elements.join("\n\t\t\t\t")}
|
|
537
|
+
\t\t\t}
|
|
535
538
|
\t\t}
|
|
536
539
|
\t}
|
|
537
540
|
}
|
package/dist/factory.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as Gtk from "@gtkx/ffi/gtk";
|
|
1
2
|
import type { Node } from "./node.js";
|
|
2
3
|
export type Props = Record<string, unknown>;
|
|
3
|
-
export declare const createNode: (type: string, props: Props,
|
|
4
|
+
export declare const createNode: (type: string, props: Props, app: Gtk.Application) => Node;
|
package/dist/factory.js
CHANGED
|
@@ -15,10 +15,10 @@ const NODE_CLASSES = [
|
|
|
15
15
|
ListViewNode,
|
|
16
16
|
WidgetNode,
|
|
17
17
|
];
|
|
18
|
-
export const createNode = (type, props,
|
|
18
|
+
export const createNode = (type, props, app) => {
|
|
19
19
|
for (const NodeClass of NODE_CLASSES) {
|
|
20
20
|
if (NodeClass.matches(type)) {
|
|
21
|
-
return new NodeClass(type, props,
|
|
21
|
+
return new NodeClass(type, props, app);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
throw new Error(`No matching node class for type: ${type}`);
|