@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.
@@ -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(
@@ -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 ref={contentWrapperRef} style={{ width: "100%", minHeight: "100%" }}>
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 }}>