@gtkx/react 0.1.22 → 0.1.24
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 +1 -1
- package/dist/codegen/jsx-generator.js +14 -5
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -231,9 +231,7 @@ ${widgetPropsContent}
|
|
|
231
231
|
const parentPropsName = this.getParentPropsName(widget);
|
|
232
232
|
const namedChildPropNames = new Set(metadata.namedChildSlots.map((s) => toCamelCase(s.propertyName)));
|
|
233
233
|
const lines = [];
|
|
234
|
-
|
|
235
|
-
lines.push(formatDoc(widget.doc).trimEnd());
|
|
236
|
-
}
|
|
234
|
+
lines.push(`/** Props for the {@link ${widgetName}} widget. */`);
|
|
237
235
|
lines.push(`export interface ${widgetName}Props extends ${parentPropsName} {`);
|
|
238
236
|
const requiredCtorParams = this.getRequiredConstructorParams(widget);
|
|
239
237
|
const seenProps = new Set();
|
|
@@ -478,6 +476,7 @@ ${widgetPropsContent}
|
|
|
478
476
|
isListWidget(widget.name) ||
|
|
479
477
|
isDropDownWidget(widget.name) ||
|
|
480
478
|
isGridWidget(widget.name);
|
|
479
|
+
const docComment = widget.doc ? formatDoc(widget.doc).trimEnd() : "";
|
|
481
480
|
if (hasMeaningfulSlots) {
|
|
482
481
|
const valueMembers = [
|
|
483
482
|
`Root: "${widgetName}.Root" as const`,
|
|
@@ -486,10 +485,20 @@ ${widgetPropsContent}
|
|
|
486
485
|
...(isDropDownWidget(widget.name) ? [`Item: "${widgetName}.Item" as const`] : []),
|
|
487
486
|
...(isGridWidget(widget.name) ? [`Child: "${widgetName}.Child" as const`] : []),
|
|
488
487
|
];
|
|
489
|
-
|
|
488
|
+
if (docComment) {
|
|
489
|
+
lines.push(`${docComment}\nexport const ${widgetName} = {\n\t${valueMembers.join(",\n\t")},\n};`);
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
lines.push(`export const ${widgetName} = {\n\t${valueMembers.join(",\n\t")},\n};`);
|
|
493
|
+
}
|
|
490
494
|
}
|
|
491
495
|
else {
|
|
492
|
-
|
|
496
|
+
if (docComment) {
|
|
497
|
+
lines.push(`${docComment}\nexport const ${widgetName} = "${widgetName}" as const;`);
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
lines.push(`export const ${widgetName} = "${widgetName}" as const;`);
|
|
501
|
+
}
|
|
493
502
|
}
|
|
494
503
|
}
|
|
495
504
|
return `${lines.join("\n")}\n`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtkx/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"description": "Build GTK4 desktop applications with React and TypeScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gtk",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"react-reconciler": "0.33.0",
|
|
43
|
-
"@gtkx/ffi": "0.1.
|
|
43
|
+
"@gtkx/ffi": "0.1.24"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@gtkx/gir": "0.1.
|
|
46
|
+
"@gtkx/gir": "0.1.24"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"react": "^19"
|