File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,4 +7,5 @@ PUBLIC_STRIPE_KEY=
77PUBLIC_GROWTH_ENDPOINT =
88PUBLIC_CONSOLE_EMAIL_VERIFICATION = false
99PUBLIC_CONSOLE_MOCK_AI_SUGGESTIONS = true
10- PUBLIC_AI_SERVICE_BASE_URL =
10+ PUBLIC_AI_SERVICE_BASE_URL =
11+ PUBLIC_IMAGINE_CDN_URL =
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ ADD ./vite.config.ts /app/vite.config.ts
2020ADD ./src /app/src
2121ADD ./static /app/static
2222
23+ ARG PUBLIC_IMAGINE_CDN_URL
2324ARG PUBLIC_CONSOLE_MODE
2425ARG PUBLIC_CONSOLE_PROFILE
2526ARG PUBLIC_AI_SERVICE_BASE_URL
@@ -45,6 +46,7 @@ ENV PUBLIC_CONSOLE_MOCK_AI_SUGGESTIONS=$PUBLIC_CONSOLE_MOCK_AI_SUGGESTIONS
4546ENV PUBLIC_STRIPE_KEY=$PUBLIC_STRIPE_KEY
4647ENV SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN
4748ENV SENTRY_RELEASE=$SENTRY_RELEASE
49+ ENV PUBLIC_IMAGINE_CDN_URL=$PUBLIC_IMAGINE_CDN_URL
4850ENV NODE_OPTIONS=--max_old_space_size=8192
4951
5052RUN pnpm run build
Original file line number Diff line number Diff line change @@ -10,12 +10,8 @@ const COMPONENT_SELECTOR = 'imagine-web-components-wrapper[data-appwrite-studio]
1010const STYLE_ATTRIBUTE = 'data-appwrite-studio-style' ;
1111const BLOCK_START_BASE_OFFSET = 48 ;
1212const INLINE_START_BASE_OFFSET = 8 ;
13- const CACHE_BUSTER = new Date ( ) . getTime ( ) ;
14- export const CDN_URL =
15- 'https://esm.sh/@imagine.dev/web-components@0/web-components?bundle=false&deps=react@19.1.0,react-dom@19.1.0&cache=' +
16- CACHE_BUSTER ;
17- export const CDN_CSS_URL =
18- 'https://esm.sh/@imagine.dev/web-components@0/imagine-web-components.css?cache=' + CACHE_BUSTER ;
13+ export const CDN_URL = env ?. PUBLIC_IMAGINE_CDN_URL + '/web-components.js' ;
14+ export const CDN_CSS_URL = env ?. PUBLIC_IMAGINE_CDN_URL + '/web-components.css' ;
1915const DEV_OVERRIDE_WEB_COMPONENTS = env ?. PUBLIC_AI_OVERRIDE_WEB_COMPONENTS === 'true' ;
2016
2117let component : HTMLElement | null = null ;
@@ -93,10 +89,7 @@ function injectStyles(node: HTMLElement, attempt = 0) {
9389
9490 const link = document . createElement ( 'link' ) ;
9591 link . rel = 'stylesheet' ;
96- link . href = DEV_OVERRIDE_WEB_COMPONENTS
97- ? DEV_CSS_URL
98- : 'https://esm.sh/@imagine.dev/web-components@0/imagine-web-components.css?cache=' +
99- CACHE_BUSTER ;
92+ link . href = DEV_OVERRIDE_WEB_COMPONENTS ? DEV_CSS_URL : CDN_CSS_URL ;
10093 link . setAttribute ( STYLE_ATTRIBUTE , 'true' ) ;
10194 shadow . prepend ( link ) ;
10295 } )
You can’t perform that action at this time.
0 commit comments