@bravostudioai/react 0.1.41 → 0.1.45

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.
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/components.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,MAAM,OAAO,CAAC;AA8sGf,QAAA,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAuDxD,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/components.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,MAAM,OAAO,CAAC;AAkvGf,QAAA,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAwDxD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const PACKAGE_VERSION = "0.1.41";
1
+ export declare const PACKAGE_VERSION = "0.1.45";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
- const o = "0.1.41";
1
+ const o = "0.1.45";
2
2
  export {
3
3
  o as PACKAGE_VERSION
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["export const PACKAGE_VERSION = \"0.1.41\";\n"],"names":["PACKAGE_VERSION"],"mappings":"AAAO,MAAMA,IAAkB;"}
1
+ {"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["export const PACKAGE_VERSION = \"0.1.45\";\n"],"names":["PACKAGE_VERSION"],"mappings":"AAAO,MAAMA,IAAkB;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bravostudioai/react",
3
- "version": "0.1.41",
3
+ "version": "0.1.45",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/src/index.d.ts",
@@ -145,6 +145,14 @@ const useEncoreStyle = (
145
145
  const containerHeight =
146
146
  containerContext.dimensions?.height ?? viewport.height;
147
147
 
148
+ // DEBUG: Trace GRID mode
149
+ if (style.layout?.mode === "GRID") {
150
+ console.log("[DEBUG] GRID MODE DETECTED", {
151
+ id: "unknown", // style object doesn't have ID context here easily without prop drill
152
+ layout: style.layout,
153
+ });
154
+ }
155
+
148
156
  // Check if this node has layout sizing directives (even if mode is null)
149
157
  const hasLayoutSizing =
150
158
  style.layout?.layoutSizingHorizontal || style.layout?.layoutSizingVertical;
@@ -285,8 +293,9 @@ const useEncoreStyle = (
285
293
  return mapping[figmaValue] || figmaValue.toLowerCase().replace(/_/g, "-");
286
294
  };
287
295
 
288
- if (style.layout.mode == "HORIZONTAL") {
296
+ if (style.layout.mode == "HORIZONTAL" || style.layout.mode == "GRID") {
289
297
  result.flexDirection = "row";
298
+
290
299
  if (style.layout.flexWrap) {
291
300
  result.flexWrap = style.layout.flexWrap;
292
301
  }
@@ -306,7 +315,12 @@ const useEncoreStyle = (
306
315
  // Set flexWrap: if wrap is explicitly "NO_WRAP", use "nowrap", otherwise default to "wrap" for layouts that need it
307
316
  // Set flexWrap: default to "nowrap" to match Figma's default behavior
308
317
  // Only wrap if explicitly requested
309
- if (style.layout.wrap === "WRAP" || style.layout.flexWrap === "wrap") {
318
+ // Only wrap if explicitly requested or if mode is GRID
319
+ if (
320
+ style.layout.wrap === "WRAP" ||
321
+ style.layout.flexWrap === "wrap" ||
322
+ style.layout.mode === "GRID"
323
+ ) {
310
324
  result.flexWrap = "wrap";
311
325
  } else if (style.layout.flexWrap) {
312
326
  result.flexWrap = style.layout.flexWrap;
@@ -368,7 +382,12 @@ const useEncoreStyle = (
368
382
  }
369
383
 
370
384
  if (style.layout?.layoutSizingHorizontal === "FILL") {
371
- result.width = "100%";
385
+ // Only set width 100% if NOT in a flex container.
386
+ // In a flex container, 'FILL' should be handled by flex-grow (Row) or align-self (Col).
387
+ // Setting width 100% explicitly forces it to take full width which breaks horizontal layouts.
388
+ if (!parentIsFlex) {
389
+ result.width = "100%";
390
+ }
372
391
  }
373
392
 
374
393
  if (style.layout?.layoutSizingHorizontal === "FIXED") {
@@ -1932,10 +1951,26 @@ const ContainerComponent = ({
1932
1951
  debug: false,
1933
1952
  });
1934
1953
 
1954
+ if (id === "01KF5PAFET1VY5E81B68GQ9BFQ") {
1955
+ console.log("[DEBUG] Embed Container Render", {
1956
+ id,
1957
+ style,
1958
+ computedStyle: style,
1959
+ layout: nodeData.style.layout,
1960
+ hasPositioning: !!nodeData.style.positioning,
1961
+ });
1962
+ // Force a simpler layout for debugging
1963
+ // style.position = 'relative';
1964
+ // style.zIndex = 1;
1965
+ }
1966
+
1935
1967
  const isFlex = !!nodeData.style.layout?.mode;
1936
1968
  // Determine flex direction for passing to children via context
1937
1969
  const flexDirection =
1938
- nodeData.style.layout?.mode === "HORIZONTAL" ? "row" : "column";
1970
+ nodeData.style.layout?.mode === "HORIZONTAL" ||
1971
+ nodeData.style.layout?.mode === "GRID"
1972
+ ? "row"
1973
+ : "column";
1939
1974
  // Only set default 100% if we don't have explicit dimensions from layout.size
1940
1975
  // Explicit dimensions are set by useEncoreStyle when layoutSizing is FIXED
1941
1976
  const hasExplicitWidth = style.width !== undefined;
@@ -3266,6 +3301,7 @@ const EmbedComponent: React.FC<ComponentProps> = ({
3266
3301
  flexDirection: "column",
3267
3302
  // Reset positioning if provided by wrapper
3268
3303
  position: "absolute",
3304
+ zIndex: 10,
3269
3305
  }}
3270
3306
  data-type="EmbedComponent"
3271
3307
  data-id={id}
@@ -3327,6 +3363,7 @@ const components: Record<string, React.ComponentType<any>> = {
3327
3363
  "component:stateful-compound": StatefulCompoundComponent,
3328
3364
  "component:slider": SliderComponent,
3329
3365
  "component:webview": WebViewComponent,
3366
+ "component:web-view": WebViewComponent,
3330
3367
  "component:video": VideoComponent,
3331
3368
  "component:lottie": LottieComponent,
3332
3369
  "component:email-input": EmailInputComponent,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = "0.1.41";
1
+ export const PACKAGE_VERSION = "0.1.45";