@bravostudioai/react 0.1.15 → 0.1.16
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/cli/commands/generate.js +90 -85
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/codegen/generator.js +218 -212
- package/dist/codegen/generator.js.map +1 -1
- package/dist/components/EncoreApp.js +34 -22
- package/dist/components/EncoreApp.js.map +1 -1
- package/dist/src/cli/commands/generate.d.ts.map +1 -1
- package/dist/src/codegen/generator.d.ts +5 -1
- package/dist/src/codegen/generator.d.ts.map +1 -1
- package/dist/src/components/EncoreApp.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cli/commands/generate.ts +9 -1
- package/src/codegen/generator.ts +12 -1
- package/src/components/EncoreApp.tsx +9 -1
|
@@ -271,7 +271,15 @@ async function generateWrapper({
|
|
|
271
271
|
forms,
|
|
272
272
|
selectInputs,
|
|
273
273
|
actionButtons,
|
|
274
|
-
!!isProduction
|
|
274
|
+
!!isProduction,
|
|
275
|
+
{
|
|
276
|
+
width: pageData.style?.width,
|
|
277
|
+
height: pageData.style?.height,
|
|
278
|
+
aspectRatio:
|
|
279
|
+
pageData.style?.width && pageData.style?.height
|
|
280
|
+
? pageData.style.width / pageData.style.height
|
|
281
|
+
: undefined,
|
|
282
|
+
}
|
|
275
283
|
);
|
|
276
284
|
|
|
277
285
|
const readmeContent = generateReadme(
|
package/src/codegen/generator.ts
CHANGED
|
@@ -28,7 +28,12 @@ export function generateComponentCode(
|
|
|
28
28
|
forms: FormInfo[],
|
|
29
29
|
selectInputs: SelectInputInfo[],
|
|
30
30
|
actionButtons: ActionButtonInfo[],
|
|
31
|
-
isProduction: boolean = false
|
|
31
|
+
isProduction: boolean = false,
|
|
32
|
+
pageMeta?: {
|
|
33
|
+
width?: number;
|
|
34
|
+
height?: number;
|
|
35
|
+
aspectRatio?: number;
|
|
36
|
+
}
|
|
32
37
|
): string {
|
|
33
38
|
// Generate prop types
|
|
34
39
|
const propTypes: string[] = [];
|
|
@@ -439,6 +444,12 @@ ${dataMapping.join("\n")}
|
|
|
439
444
|
}
|
|
440
445
|
|
|
441
446
|
export default ${componentName};
|
|
447
|
+
|
|
448
|
+
export const PageMeta = {
|
|
449
|
+
width: ${pageMeta?.width ?? "undefined"},
|
|
450
|
+
height: ${pageMeta?.height ?? "undefined"},
|
|
451
|
+
aspectRatio: ${pageMeta?.aspectRatio ?? "undefined"},
|
|
452
|
+
};
|
|
442
453
|
`;
|
|
443
454
|
}
|
|
444
455
|
|
|
@@ -828,7 +828,15 @@ const EncoreApp = ({
|
|
|
828
828
|
overflow: "hidden",
|
|
829
829
|
}}
|
|
830
830
|
>
|
|
831
|
-
<div
|
|
831
|
+
<div
|
|
832
|
+
ref={contentWrapperRef}
|
|
833
|
+
style={{
|
|
834
|
+
width: "100%",
|
|
835
|
+
height: "100%",
|
|
836
|
+
display: "flex",
|
|
837
|
+
flexDirection: "column",
|
|
838
|
+
}}
|
|
839
|
+
>
|
|
832
840
|
<Suspense fallback={fallback || <div />}>
|
|
833
841
|
<EncoreComponentIdContext.Provider value={{ componentId }}>
|
|
834
842
|
<EncoreActionContext.Provider value={{ onAction }}>
|