mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
Merge branch 'feat-profiles' into add-domain-callbacks
This commit is contained in:
7 files changed
+386
-16
No files matched your search
+18
-3
@@ -11,7 +11,10 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover" data-loading="true">
|
||||
<body
|
||||
data-sveltekit-preload-data="hover"
|
||||
data-loading="true"
|
||||
data-profile="%sveltekit.env.PUBLIC_CONSOLE_PROFILE%">
|
||||
<script src="%sveltekit.assets%/js/theme-loader.js"></script>
|
||||
<div id="svelte">%sveltekit.body%</div>
|
||||
<div class="page-loader">
|
||||
@@ -25,13 +28,25 @@
|
||||
src="%sveltekit.assets%/images/appwrite-logo-light.svg"
|
||||
width="120"
|
||||
height="22"
|
||||
class="logo-light"
|
||||
class="console-logo-light"
|
||||
alt="Appwrite Logo" />
|
||||
<img
|
||||
src="%sveltekit.assets%/images/appwrite-logo-dark.svg"
|
||||
width="120"
|
||||
height="22"
|
||||
class="logo-dark"
|
||||
class="console-logo-dark"
|
||||
alt="Appwrite Logo" />
|
||||
<img
|
||||
src="%sveltekit.assets%/images/imagine-logo-light.svg"
|
||||
width="120"
|
||||
height="22"
|
||||
class="studio-logo-light"
|
||||
alt="Appwrite Logo" />
|
||||
<img
|
||||
src="%sveltekit.assets%/images/imagine-logo-dark.svg"
|
||||
width="120"
|
||||
height="22"
|
||||
class="studio-logo-dark"
|
||||
alt="Appwrite Logo" />
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { resolve } from '$app/paths';
|
||||
import { asset, resolve } from '$app/paths';
|
||||
import type { ResolvedPathname } from '$app/types';
|
||||
import { PUBLIC_CONSOLE_PROFILE } from '$env/static/public';
|
||||
|
||||
@@ -44,8 +44,8 @@ export const base: Profile = {
|
||||
platform: 'Appwrite',
|
||||
logo: {
|
||||
src: {
|
||||
dark: 'https://appwrite.io/images/logos/logo.svg',
|
||||
light: 'https://appwrite.io/images/logos/logo.svg'
|
||||
dark: asset('/images/appwrite-logo-dark.svg'),
|
||||
light: asset('/images/appwrite-logo-light.svg')
|
||||
},
|
||||
alt: 'Logo Appwrite'
|
||||
},
|
||||
@@ -81,8 +81,8 @@ export const studio: Profile = {
|
||||
platform: 'Imagine',
|
||||
logo: {
|
||||
src: {
|
||||
dark: 'https://imagine-console.up.railway.app/images/imagine-logo-dark.svg',
|
||||
light: 'https://imagine-console.up.railway.app/images/imagine-logo-light.svg'
|
||||
dark: asset('/images/imagine-logo-dark.svg'),
|
||||
light: asset('/images/imagine-logo-light.svg')
|
||||
},
|
||||
alt: 'Imagine Appwrite'
|
||||
},
|
||||
|
||||
@@ -11,9 +11,11 @@ const STYLE_ATTRIBUTE = 'data-appwrite-studio-style';
|
||||
const BLOCK_START_BASE_OFFSET = 48;
|
||||
const INLINE_START_BASE_OFFSET = 8;
|
||||
const CACHE_BUSTER = new Date().getTime();
|
||||
const CDN_URL =
|
||||
export const CDN_URL =
|
||||
'https://esm.sh/@imagine.dev/web-components@0/web-components?bundle=false&deps=react@19.1.0,react-dom@19.1.0&cache=' +
|
||||
CACHE_BUSTER;
|
||||
export const CDN_CSS_URL =
|
||||
'https://esm.sh/@imagine.dev/web-components@0/imagine-web-components.css?cache=' + CACHE_BUSTER;
|
||||
const DEV_OVERRIDE_WEB_COMPONENTS = env?.PUBLIC_AI_OVERRIDE_WEB_COMPONENTS === 'true';
|
||||
|
||||
let component: HTMLElement | null = null;
|
||||
@@ -158,6 +160,9 @@ export function ensureStudioComponent(): HTMLElement | null {
|
||||
}
|
||||
|
||||
const created = document.createElement('imagine-web-components-wrapper');
|
||||
created.addEventListener('click', (event) => {
|
||||
event.stopPropagation();
|
||||
});
|
||||
created.dataset.appwriteStudio = 'true';
|
||||
ensureBaseStyles(created);
|
||||
document.body.appendChild(created);
|
||||
@@ -287,7 +292,7 @@ export async function initImagine(
|
||||
{
|
||||
AI_SERVICE_ENDPOINT: PUBLIC_AI_SERVICE_BASE_URL,
|
||||
APPWRITE_ENDPOINT: PUBLIC_APPWRITE_ENDPOINT,
|
||||
APPWRITE_SITES_BASE_URL: 'https://stage.appwrite.network'
|
||||
APPWRITE_SITES_BASE_URL: ''
|
||||
},
|
||||
{
|
||||
initialTheme: get(app).themeInUse,
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
import { isSmallViewport, updateViewport } from '$lib/stores/viewport';
|
||||
import { feedback } from '$lib/stores/feedback';
|
||||
import { ProfileMode, resolvedProfile } from '$lib/profiles/index.svelte';
|
||||
import { CDN_CSS_URL, CDN_URL } from '$lib/studio/studio-widget';
|
||||
|
||||
function resolveTheme(theme: AppStore['themeInUse']) {
|
||||
switch (theme) {
|
||||
@@ -185,6 +186,11 @@
|
||||
{/if}
|
||||
|
||||
<link rel="stylesheet" href={`${base}/css/profiles/${resolvedProfile.id}.css`} />
|
||||
|
||||
{#if resolvedProfile.id === ProfileMode.STUDIO}
|
||||
<link rel="preload" as="style" type="text/css" href={CDN_CSS_URL} />
|
||||
<link rel="preload" as="script" type="text/javascript" href={CDN_URL} />
|
||||
{/if}
|
||||
</svelte:head>
|
||||
|
||||
<Root theme={resolveTheme($app.themeInUse)}>
|
||||
|
||||
Reference in new issue
Block a user