@bravostudioai/react 0.1.3 → 0.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bravostudioai/react",
3
- "version": "0.1.3",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/src/index.d.ts",
@@ -1,20 +1,18 @@
1
-
2
-
3
1
  import { writeFile, mkdir } from "fs/promises";
4
2
  import { join } from "path";
5
3
  import { existsSync } from "fs";
6
4
  import dotenv from "dotenv";
7
- import { CONST_APPS_SERVICE_URL, CONST_COMPONENTS_CDN_URL } from "../../../constants";
5
+ import {
6
+ CONST_APPS_SERVICE_URL,
7
+ CONST_COMPONENTS_CDN_URL,
8
+ } from "../../../constants";
8
9
 
9
10
  dotenv.config();
10
11
 
11
12
  // Default apps service URL (can be overridden with APPS_SERVICE_URL env var)
12
13
  const APPS_SERVICE_URL =
13
- process.env.VITE_APPS_SERVICE_URL ||
14
- CONST_APPS_SERVICE_URL ||
15
- "https://apps-service-dev.bravostudio.app";
16
- const COMPONENTS_CDN_URL =
17
- CONST_COMPONENTS_CDN_URL || "https://apps-public-dev.bravostudio.app";
14
+ process.env.VITE_APPS_SERVICE_URL || CONST_APPS_SERVICE_URL;
15
+ const COMPONENTS_CDN_URL = CONST_COMPONENTS_CDN_URL;
18
16
 
19
17
  interface DownloadOptions {
20
18
  appId: string;
@@ -100,7 +98,7 @@ Arguments:
100
98
  targetPath Path where files should be saved
101
99
 
102
100
  Environment variables:
103
- APPS_SERVICE_URL Base URL for the apps service (default: https://apps-service-dev.bravostudio.app)
101
+ APPS_SERVICE_URL Base URL for the apps service
104
102
 
105
103
  Example:
106
104
  download-bravo.ts my-app-id my-page-id ./bravo-files
@@ -108,7 +106,6 @@ Example:
108
106
  `);
109
107
  }
110
108
 
111
-
112
109
  export async function runDownload(args: string[]) {
113
110
  if (args.length < 3 || args.includes("--help") || args.includes("-h")) {
114
111
  printUsage();
@@ -130,4 +127,3 @@ export async function runDownload(args: string[]) {
130
127
  process.exit(1);
131
128
  }
132
129
  }
133
-
@@ -27,11 +27,9 @@ dotenv.config();
27
27
  const APPS_SERVICE_URL =
28
28
  process.env.APPS_SERVICE_URL ||
29
29
  process.env.VITE_APPS_SERVICE_URL ||
30
- CONST_APPS_SERVICE_URL ||
31
- "https://apps-service-dev.bravostudio.app";
30
+ CONST_APPS_SERVICE_URL;
32
31
  console.log(`Using APPS_SERVICE_URL: ${APPS_SERVICE_URL}`);
33
- const COMPONENTS_CDN_URL =
34
- CONST_COMPONENTS_CDN_URL || "https://apps-public-dev.bravostudio.app";
32
+ const COMPONENTS_CDN_URL = CONST_COMPONENTS_CDN_URL;
35
33
 
36
34
  async function downloadFile(
37
35
  url: string,
@@ -60,7 +60,6 @@ type Props = {
60
60
  // Control input groups - maps group name to active element name
61
61
  inputGroups?: Record<string, string>;
62
62
  // Base URL for the Encore service API (e.g., "https://api.example.com")
63
- // If not provided, defaults to "https://apps-service-dev.bravostudio.app"
64
63
  baseURL?: string;
65
64
  appDefinition?: any;
66
65
  pageDefinition?: any;
@@ -193,6 +192,7 @@ const EncoreApp = ({
193
192
  type EncoreFont = {
194
193
  id?: string;
195
194
  url?: string;
195
+ broken?: boolean;
196
196
  fontName?: { family?: string; postScriptName?: string };
197
197
  };
198
198
  type AppDataWithFonts = { app?: { fonts?: EncoreFont[] } };
@@ -207,6 +207,14 @@ const EncoreApp = ({
207
207
  const postScriptName = f?.fontName?.postScriptName;
208
208
  if (!family || !url) return;
209
209
 
210
+ if (f.broken) {
211
+ console.warn(
212
+ `[EncoreApp] Font "${
213
+ postScriptName || family
214
+ }" is marked as broken in the database. URL: ${url}`
215
+ );
216
+ }
217
+
210
218
  // Infer font weight from postScriptName if available
211
219
  // This ensures the browser uses the correct font-face variant
212
220
  let weight: string | number | undefined = undefined;
@@ -242,11 +250,16 @@ const EncoreApp = ({
242
250
  .then((ff) => {
243
251
  document.fonts.add(ff);
244
252
  })
245
- .catch(() => {
246
- // Ignore font load failures to avoid disrupting rendering
253
+ .catch((err) => {
254
+ console.warn(
255
+ `[EncoreApp] Failed to load font "${
256
+ postScriptName || family
257
+ }" from ${url}`,
258
+ err
259
+ );
247
260
  });
248
- } catch {
249
- // Best-effort; ignore
261
+ } catch (err) {
262
+ console.warn(`[EncoreApp] Error processing font:`, err);
250
263
  }
251
264
  });
252
265
  }, [app?.data]);
@@ -34,10 +34,9 @@ const useEncoreState = create<EncoreState>((set) => ({
34
34
  app: undefined,
35
35
  baseURL:
36
36
  (typeof import.meta !== "undefined" &&
37
- import.meta.env &&
38
- import.meta.env.VITE_APPS_SERVICE_URL) ||
39
- CONST_APPS_SERVICE_URL ||
40
- "https://apps-service-dev.bravostudio.app",
37
+ (import.meta as any).env &&
38
+ (import.meta as any).env.VITE_APPS_SERVICE_URL) ||
39
+ CONST_APPS_SERVICE_URL,
41
40
 
42
41
  accessToken: undefined,
43
42
  appId: undefined,