@bravostudioai/react 0.1.36 → 0.1.41
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/generator.js +48 -48
- package/dist/codegen/generator.js.map +1 -1
- package/dist/codegen/parser.js +72 -59
- package/dist/codegen/parser.js.map +1 -1
- package/dist/components.js +513 -513
- package/dist/components.js.map +1 -1
- package/dist/lib/logger.js.map +1 -1
- package/dist/src/codegen/generator.d.ts.map +1 -1
- package/dist/src/codegen/parser.d.ts.map +1 -1
- package/dist/src/components.d.ts.map +1 -1
- package/dist/src/lib/logger.d.ts.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/src/codegen/generator.ts +8 -2
- package/src/codegen/parser.ts +35 -6
- package/src/components.tsx +35 -20
- package/src/lib/logger.ts +9 -7
- package/src/version.ts +1 -1
package/dist/lib/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sources":["../../src/lib/logger.ts"],"sourcesContent":["/**\n * Centralized logging utility for encore-lib\n *\n * Provides conditional logging based on environment.\n * Debug logs only appear in development mode.\n */\n\nconst isDev
|
|
1
|
+
{"version":3,"file":"logger.js","sources":["../../src/lib/logger.ts"],"sourcesContent":["/**\n * Centralized logging utility for encore-lib\n *\n * Provides conditional logging based on environment.\n * Debug logs only appear in development mode.\n */\n\nconst isDev =\n typeof import.meta !== \"undefined\"\n ? (import.meta as any).env?.DEV ||\n (import.meta as any).env?.MODE === \"development\"\n : process.env.NODE_ENV === \"development\";\n\n/**\n * Logger instance with environment-aware methods\n */\nexport const logger = {\n /**\n * Debug-level logging (only in development)\n * Use for detailed diagnostic information\n */\n debug: (...args: any[]) => {\n if (isDev) {\n console.debug(\"[encore-lib]\", ...args);\n }\n },\n\n /**\n * Info-level logging (only in development)\n * Use for general informational messages\n */\n info: (...args: any[]) => {\n if (isDev) {\n console.info(\"[encore-lib]\", ...args);\n }\n },\n\n /**\n * Warning-level logging (always shown)\n * Use for recoverable issues that need attention\n */\n warn: (...args: any[]) => {\n console.warn(\"[encore-lib]\", ...args);\n },\n\n /**\n * Error-level logging (always shown)\n * Use for errors and exceptions\n */\n error: (...args: any[]) => {\n console.error(\"[encore-lib]\", ...args);\n },\n};\n\nexport default logger;\n"],"names":["isDev","logger","args"],"mappings":"AAOA,MAAMA,IACJ,OAAO,cAAgB,MAElB,KACD,QAAQ,IAAI,aAAa,eAKlBC,IAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAKpB,OAAO,IAAIC,MAAgB;AACzB,IAAIF,KACF,QAAQ,MAAM,gBAAgB,GAAGE,CAAI;AAAA,EAEzC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,IAAIA,MAAgB;AACxB,IAAIF,KACF,QAAQ,KAAK,gBAAgB,GAAGE,CAAI;AAAA,EAExC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,IAAIA,MAAgB;AACxB,YAAQ,KAAK,gBAAgB,GAAGA,CAAI;AAAA,EACtC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO,IAAIA,MAAgB;AACzB,YAAQ,MAAM,gBAAgB,GAAGA,CAAI;AAAA,EACvC;AACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../src/codegen/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,UAAU,EACV,cAAc,EACd,QAAQ,EACR,eAAe,EACf,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAOjB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,yBAAyB;IACzB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,kCAAkC;IAClC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;;;;;;;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G,aAAa,EAAE,CA8GvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,GAAG,GAAG,cAAc,EAAE,CA0D/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,CAkJnD;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,GAAG,EACb,KAAK,EAAE,QAAQ,EAAE,GAChB,eAAe,EAAE,CAqEnB;AASD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,GAAG,GAAG,gBAAgB,EAAE,CAuGnE;AASD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAIzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/components.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,MAAM,OAAO,CAAC;
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/lib/logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/lib/logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH;;GAEG;AACH,eAAO,MAAM,MAAM;IACjB;;;OAGG;qBACc,GAAG,EAAE;IAMtB;;;OAGG;oBACa,GAAG,EAAE;IAMrB;;;OAGG;oBACa,GAAG,EAAE;IAIrB;;;OAGG;qBACc,GAAG,EAAE;CAGvB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "0.1.
|
|
1
|
+
export declare const PACKAGE_VERSION = "0.1.41";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["export const PACKAGE_VERSION = \"0.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;"}
|
package/package.json
CHANGED
package/src/codegen/generator.ts
CHANGED
|
@@ -208,7 +208,10 @@ ${itemProps}
|
|
|
208
208
|
// Add standalone component mappings
|
|
209
209
|
standaloneComponents.forEach((comp) => {
|
|
210
210
|
const propKey = getComponentPropName(comp.type);
|
|
211
|
-
if (
|
|
211
|
+
if (
|
|
212
|
+
comp.type === "component:webview" ||
|
|
213
|
+
comp.type === "component:web-view"
|
|
214
|
+
) {
|
|
212
215
|
dataMapping.push(` // ${comp.name}
|
|
213
216
|
...(props.${comp.propName} !== undefined && { "${comp.id}": { params: { url: props.${comp.propName} } } as any }),`);
|
|
214
217
|
} else if (comp.type === "component:embed") {
|
|
@@ -237,7 +240,10 @@ ${itemProps}
|
|
|
237
240
|
const itemMapping = container.components
|
|
238
241
|
.map((comp) => {
|
|
239
242
|
const propKey = getComponentPropName(comp.type);
|
|
240
|
-
if (
|
|
243
|
+
if (
|
|
244
|
+
comp.type === "component:webview" ||
|
|
245
|
+
comp.type === "component:web-view"
|
|
246
|
+
) {
|
|
241
247
|
return ` // ${comp.name}
|
|
242
248
|
"${comp.id}": {
|
|
243
249
|
params: { url: item.${comp.propName} },
|
package/src/codegen/parser.ts
CHANGED
|
@@ -181,7 +181,10 @@ export function getComponentPropType(
|
|
|
181
181
|
}
|
|
182
182
|
return "string"; // text inputs, email, password, etc.
|
|
183
183
|
}
|
|
184
|
-
if (
|
|
184
|
+
if (
|
|
185
|
+
componentType === "component:webview" ||
|
|
186
|
+
componentType === "component:web-view"
|
|
187
|
+
) {
|
|
185
188
|
return "string"; // url
|
|
186
189
|
}
|
|
187
190
|
if (componentType === "component:video") {
|
|
@@ -204,7 +207,10 @@ export function getComponentPropName(componentType: string): string {
|
|
|
204
207
|
if (componentType === "component:text") {
|
|
205
208
|
return "text";
|
|
206
209
|
}
|
|
207
|
-
if (
|
|
210
|
+
if (
|
|
211
|
+
componentType === "component:webview" ||
|
|
212
|
+
componentType === "component:web-view"
|
|
213
|
+
) {
|
|
208
214
|
return "url";
|
|
209
215
|
}
|
|
210
216
|
if (componentType === "component:video") {
|
|
@@ -491,11 +497,11 @@ export function findStandaloneComponents(pageData: any): ComponentInfo[] {
|
|
|
491
497
|
|
|
492
498
|
if (
|
|
493
499
|
node.type === "component:embed" ||
|
|
500
|
+
node.type === "component:webview" ||
|
|
501
|
+
node.type === "component:web-view" ||
|
|
502
|
+
node.type === "component:video" ||
|
|
494
503
|
(hasDataTag &&
|
|
495
|
-
(node.type === "component:text" ||
|
|
496
|
-
node.type === "component:image" ||
|
|
497
|
-
node.type === "component:webview" ||
|
|
498
|
-
node.type === "component:video"))
|
|
504
|
+
(node.type === "component:text" || node.type === "component:image"))
|
|
499
505
|
) {
|
|
500
506
|
const basePropName = sanitizePropName(node.name || "item");
|
|
501
507
|
const propType = getComponentPropType(node.type, node.name);
|
|
@@ -882,9 +888,26 @@ function qualifySelectInputs(selectInputs: SelectInputInfo[]): void {
|
|
|
882
888
|
export function findActionButtons(pageData: any): ActionButtonInfo[] {
|
|
883
889
|
const buttons: ActionButtonInfo[] = [];
|
|
884
890
|
|
|
891
|
+
console.log(
|
|
892
|
+
"[DEBUG] local encore-lib findActionButtons running via alias. Check node.actions support."
|
|
893
|
+
);
|
|
894
|
+
|
|
885
895
|
function traverse(node: any, parentPath: string[] = []): void {
|
|
886
896
|
if (!node || typeof node !== "object") return;
|
|
887
897
|
|
|
898
|
+
// Log nodes with potentially interesting properties for debugging
|
|
899
|
+
if (
|
|
900
|
+
node.id === "01KF5PAFFVFSKY6QJZXQTC99P5" ||
|
|
901
|
+
(node.tags && node.tags.some((t: string) => t.includes("action")))
|
|
902
|
+
) {
|
|
903
|
+
console.log(`[DEBUG] traverse node ${node.name} (${node.id})`, {
|
|
904
|
+
type: node.type,
|
|
905
|
+
tags: node.tags,
|
|
906
|
+
hasActions: !!node.actions,
|
|
907
|
+
actionsKeys: node.actions ? Object.keys(node.actions) : [],
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
|
|
888
911
|
// Check if this component has an action tag or actions defined
|
|
889
912
|
const hasActionTag =
|
|
890
913
|
Array.isArray(node.tags) &&
|
|
@@ -906,6 +929,12 @@ export function findActionButtons(pageData: any): ActionButtonInfo[] {
|
|
|
906
929
|
actionType = node.actions.tap.action;
|
|
907
930
|
}
|
|
908
931
|
|
|
932
|
+
console.log(`[DEBUG] Found action button: ${node.name} (${node.id})`, {
|
|
933
|
+
actionType,
|
|
934
|
+
hasActionTag,
|
|
935
|
+
hasActions,
|
|
936
|
+
});
|
|
937
|
+
|
|
909
938
|
const basePropName = sanitizePropName(node.name || "button");
|
|
910
939
|
buttons.push({
|
|
911
940
|
id: node.id,
|
package/src/components.tsx
CHANGED
|
@@ -434,11 +434,13 @@ const useEncoreStyle = (
|
|
|
434
434
|
}
|
|
435
435
|
|
|
436
436
|
if (style.opacity) result.opacity = style.opacity * 0.01;
|
|
437
|
-
|
|
438
|
-
|
|
437
|
+
// Font Family Resolution
|
|
438
|
+
const resolvedFontFamily =
|
|
439
|
+
(style.fontId ? fontIdToFamily[style.fontId] : undefined) ||
|
|
440
|
+
style.fontFamily ||
|
|
441
|
+
undefined;
|
|
439
442
|
|
|
440
|
-
|
|
441
|
-
// These need to be unquoted for the browser to recognize them as keywords rather than custom font names
|
|
443
|
+
if (resolvedFontFamily) {
|
|
442
444
|
const genericFamilies = [
|
|
443
445
|
"sans-serif",
|
|
444
446
|
"serif",
|
|
@@ -451,19 +453,27 @@ const useEncoreStyle = (
|
|
|
451
453
|
"ui-monospace",
|
|
452
454
|
"ui-rounded",
|
|
453
455
|
];
|
|
454
|
-
|
|
455
|
-
|
|
456
|
+
|
|
457
|
+
if (genericFamilies.includes(resolvedFontFamily.toLowerCase())) {
|
|
458
|
+
result.fontFamily = resolvedFontFamily;
|
|
456
459
|
} else {
|
|
457
460
|
// Ensure font family name is quoted for names with spaces/special characters
|
|
458
|
-
|
|
461
|
+
// AND append sans-serif fallback
|
|
462
|
+
result.fontFamily = `"${resolvedFontFamily}", sans-serif`;
|
|
459
463
|
}
|
|
460
464
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
465
|
+
// Keep debug log
|
|
466
|
+
if (opts.debug || style.fontId) {
|
|
467
|
+
console.log(`[AG_DEBUG] [useEncoreStyle] Font Resolution:`, {
|
|
468
|
+
fontId: style.fontId,
|
|
469
|
+
resolvedFamily: resolvedFontFamily,
|
|
470
|
+
styleFontFamily: style.fontFamily,
|
|
471
|
+
finalStyle: result.fontFamily,
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
} else {
|
|
475
|
+
// Fallback if no font is specified at all: prevent browser default Serif
|
|
476
|
+
result.fontFamily = "sans-serif";
|
|
467
477
|
}
|
|
468
478
|
if (style.borderRadius) {
|
|
469
479
|
result.borderRadius = percentOfParentWidthToPx(style.borderRadius);
|
|
@@ -1069,7 +1079,8 @@ const EncoreLinkActionWrapper: React.FC<{
|
|
|
1069
1079
|
};
|
|
1070
1080
|
|
|
1071
1081
|
const WebViewComponent: React.FC<ComponentProps> = ({ id, name, nodeData }) => {
|
|
1072
|
-
const
|
|
1082
|
+
const { patchedNodeData } = useEncoreBinding({ id, nodeData });
|
|
1083
|
+
const style = useEncoreStyle(patchedNodeData.style, {
|
|
1073
1084
|
debug: false,
|
|
1074
1085
|
});
|
|
1075
1086
|
|
|
@@ -1079,7 +1090,11 @@ const WebViewComponent: React.FC<ComponentProps> = ({ id, name, nodeData }) => {
|
|
|
1079
1090
|
data-name={name}
|
|
1080
1091
|
data-type="WebViewComponent"
|
|
1081
1092
|
style={{ border: "none", ...style }}
|
|
1082
|
-
src={
|
|
1093
|
+
src={
|
|
1094
|
+
patchedNodeData.data?.params?.url ||
|
|
1095
|
+
patchedNodeData.data?.url ||
|
|
1096
|
+
patchedNodeData.encoreData?.url
|
|
1097
|
+
}
|
|
1083
1098
|
/>
|
|
1084
1099
|
);
|
|
1085
1100
|
};
|
|
@@ -2964,8 +2979,8 @@ const PageComponent = ({ id, name, nodeData, children }) => {
|
|
|
2964
2979
|
// Get parent container dimensions as fallback (more accurate than viewport)
|
|
2965
2980
|
const parentContainerContext = useContext(EncoreContainerContext);
|
|
2966
2981
|
|
|
2967
|
-
const originalWidth = nodeData.style.originalSize?.[0] ||
|
|
2968
|
-
const originalHeight = nodeData.style.originalSize?.[1] ||
|
|
2982
|
+
const originalWidth = nodeData.style.originalSize?.[0] || 375;
|
|
2983
|
+
const originalHeight = nodeData.style.originalSize?.[1] || 812;
|
|
2969
2984
|
|
|
2970
2985
|
// Prefer measured dimensions, then parent container dimensions, then viewport
|
|
2971
2986
|
// BUT: If parent container has a fixed width that's much smaller than viewport,
|
|
@@ -3022,9 +3037,9 @@ const PageComponent = ({ id, name, nodeData, children }) => {
|
|
|
3022
3037
|
}
|
|
3023
3038
|
|
|
3024
3039
|
// Calculate scale factor using the effective (constrained) width
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3040
|
+
// Use width-based scaling (Fit Width) instead of Contain (Math.min)
|
|
3041
|
+
// This ensures scrollable pages are not shrunk to fit the viewport height
|
|
3042
|
+
const fitScale = effectiveWidth / originalWidth || 1;
|
|
3028
3043
|
const context = { scaleFactor: fitScale };
|
|
3029
3044
|
|
|
3030
3045
|
// If componentId is specified, render only that child without page container
|
package/src/lib/logger.ts
CHANGED
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* Debug logs only appear in development mode.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
const isDev =
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const isDev =
|
|
9
|
+
typeof import.meta !== "undefined"
|
|
10
|
+
? (import.meta as any).env?.DEV ||
|
|
11
|
+
(import.meta as any).env?.MODE === "development"
|
|
12
|
+
: process.env.NODE_ENV === "development";
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Logger instance with environment-aware methods
|
|
@@ -19,7 +21,7 @@ export const logger = {
|
|
|
19
21
|
*/
|
|
20
22
|
debug: (...args: any[]) => {
|
|
21
23
|
if (isDev) {
|
|
22
|
-
console.debug(
|
|
24
|
+
console.debug("[encore-lib]", ...args);
|
|
23
25
|
}
|
|
24
26
|
},
|
|
25
27
|
|
|
@@ -29,7 +31,7 @@ export const logger = {
|
|
|
29
31
|
*/
|
|
30
32
|
info: (...args: any[]) => {
|
|
31
33
|
if (isDev) {
|
|
32
|
-
console.info(
|
|
34
|
+
console.info("[encore-lib]", ...args);
|
|
33
35
|
}
|
|
34
36
|
},
|
|
35
37
|
|
|
@@ -38,7 +40,7 @@ export const logger = {
|
|
|
38
40
|
* Use for recoverable issues that need attention
|
|
39
41
|
*/
|
|
40
42
|
warn: (...args: any[]) => {
|
|
41
|
-
console.warn(
|
|
43
|
+
console.warn("[encore-lib]", ...args);
|
|
42
44
|
},
|
|
43
45
|
|
|
44
46
|
/**
|
|
@@ -46,7 +48,7 @@ export const logger = {
|
|
|
46
48
|
* Use for errors and exceptions
|
|
47
49
|
*/
|
|
48
50
|
error: (...args: any[]) => {
|
|
49
|
-
console.error(
|
|
51
|
+
console.error("[encore-lib]", ...args);
|
|
50
52
|
},
|
|
51
53
|
};
|
|
52
54
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PACKAGE_VERSION = "0.1.
|
|
1
|
+
export const PACKAGE_VERSION = "0.1.41";
|