mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
Merge remote-tracking branch 'origin/mgn-dv' into feat/ai-service
This commit is contained in:
commit
f1d1b88159
26 files changed
+613
-149
No files matched your search
@@ -15,7 +15,6 @@
|
||||
import { currentPlan, newOrgModal } from '$lib/stores/organization';
|
||||
import { Click, trackEvent } from '$lib/actions/analytics';
|
||||
import { page } from '$app/stores';
|
||||
import type { Artifact } from '$lib/sdk/imagine';
|
||||
|
||||
type Project = {
|
||||
name: string;
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
<script lang="ts">
|
||||
import { melt, createContextMenu, type TreeView } from '@melt-ui/svelte';
|
||||
import { melt, type TreeView } from '@melt-ui/svelte';
|
||||
import { getContext } from 'svelte';
|
||||
import { Icon } from '@appwrite.io/pink-svelte';
|
||||
import { icons, type TreeItem } from '.';
|
||||
import Tree from './tree.svelte';
|
||||
import FileActionMenu from '$routes/(console)/project-[region]-[project]/studio/artifact-[artifact]/fileActionMenu.svelte';
|
||||
|
||||
export let items: TreeItem[];
|
||||
export let level = 1;
|
||||
|
||||
const {
|
||||
elements: { trigger: cmTrigger, menu: cmMenu, item: cmItem, separator }
|
||||
} = createContextMenu();
|
||||
|
||||
const {
|
||||
elements: { item, group },
|
||||
helpers: { isExpanded, isSelected }
|
||||
@@ -21,57 +19,38 @@
|
||||
{@const isFolder = children !== undefined}
|
||||
{@const isRoot = level === 1}
|
||||
|
||||
<li use:melt={$cmTrigger} style:margin-inline-start={isRoot ? '' : '1rem'}>
|
||||
<button
|
||||
data-file={!isFolder}
|
||||
class:selected={$isSelected(path)}
|
||||
use:melt={$item({
|
||||
id: path,
|
||||
hasChildren: isFolder
|
||||
})}>
|
||||
{#if icon === 'folder' && isFolder && $isExpanded(path)}
|
||||
<div class="menuitem" class:not-active={!$isSelected(path)}>
|
||||
<Icon icon={icons['folderOpen']} />
|
||||
</div>
|
||||
{:else}
|
||||
<div class="menuitem" class:not-active={!$isSelected(path)}>
|
||||
<Icon icon={icons[icon]} />
|
||||
</div>
|
||||
{/if}
|
||||
<li style:margin-inline-start={isRoot ? '' : '1rem'} style:position="relative">
|
||||
<div class="file-button">
|
||||
<button
|
||||
data-file={!isFolder}
|
||||
class:selected={$isSelected(path)}
|
||||
use:melt={$item({
|
||||
id: path,
|
||||
hasChildren: isFolder
|
||||
})}
|
||||
class="item-button">
|
||||
{#if icon === 'folder' && isFolder && $isExpanded(path)}
|
||||
<div class="menuitem" class:not-active={!$isSelected(path)}>
|
||||
<Icon icon={icons['folderOpen']} />
|
||||
</div>
|
||||
{:else}
|
||||
<div class="menuitem" class:not-active={!$isSelected(path)}>
|
||||
<Icon icon={icons[icon]} />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<span>{title}</span>
|
||||
</button>
|
||||
<span class="label">{title}</span>
|
||||
</button>
|
||||
<span class="menu">
|
||||
<FileActionMenu />
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{#if children}
|
||||
<ul use:melt={$group({ id: path })}>
|
||||
<svelte:self items={children} level={level + 1} />
|
||||
<Tree items={children} level={level + 1} />
|
||||
</ul>
|
||||
{/if}
|
||||
|
||||
<div class=" menu" use:melt={$cmMenu}>
|
||||
<button
|
||||
class="item"
|
||||
use:melt={$cmItem}
|
||||
onclick={(e) => {
|
||||
e.preventDefault();
|
||||
alert('Create clicked');
|
||||
}}>Create</button>
|
||||
<button
|
||||
class="item"
|
||||
use:melt={$cmItem}
|
||||
onclick={(e) => {
|
||||
e.preventDefault();
|
||||
alert('Rename clicked');
|
||||
}}>Rename</button>
|
||||
<div use:melt={$separator}></div>
|
||||
<button
|
||||
class="item"
|
||||
use:melt={$cmItem}
|
||||
onclick={(e) => {
|
||||
e.preventDefault();
|
||||
alert('Delete clicked');
|
||||
}}>Delete</button>
|
||||
</div>
|
||||
</li>
|
||||
{/each}
|
||||
|
||||
@@ -83,7 +62,7 @@
|
||||
padding-block-end: var(--space-1);
|
||||
}
|
||||
}
|
||||
button {
|
||||
.item-button {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 2rem;
|
||||
@@ -93,16 +72,12 @@
|
||||
user-select: none;
|
||||
padding: var(--space-3) var(--space-4);
|
||||
cursor: pointer;
|
||||
border-radius: var(--border-radius-s);
|
||||
color: var(--fgcolor-neutral-secondary);
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
&.selected {
|
||||
background: var(--bgcolor-neutral-tertiary);
|
||||
}
|
||||
&:hover:not(.selected) {
|
||||
background: var(--bgcolor-neutral-secondary);
|
||||
}
|
||||
&:focus-visible {
|
||||
outline: 2px solid #007aff;
|
||||
outline-offset: -2px;
|
||||
@@ -115,6 +90,42 @@
|
||||
}
|
||||
}
|
||||
|
||||
.file-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-radius: var(--border-radius-s);
|
||||
overflow: hidden;
|
||||
|
||||
&:focus-within > .item-button {
|
||||
background: var(--bgcolor-neutral-tertiary);
|
||||
}
|
||||
|
||||
&:has(.selected),
|
||||
&:focus-within {
|
||||
background: var(--bgcolor-neutral-tertiary);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: var(--bgcolor-neutral-tertiary);
|
||||
}
|
||||
.menu {
|
||||
opacity: 0;
|
||||
margin-right: 0;
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.file-button:hover > .menu,
|
||||
.file-button:focus-within > .menu,
|
||||
.file-button:has(.selected) > .menu {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.context-trigger {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
}
|
||||
|
||||
.menuitem {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
};
|
||||
|
||||
$effect(() => {
|
||||
monaco.editor.setTheme($app.themeInUse === 'light' ? 'imagine-light' : 'imagine-dark');
|
||||
monaco.editor.setTheme('imagine-dark');
|
||||
});
|
||||
$effect(() => {
|
||||
const readOnly = studio.streaming;
|
||||
|
||||
@@ -57,8 +57,6 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$inspect('items', items);
|
||||
</script>
|
||||
|
||||
<ul {...$tree}>
|
||||
|
||||
@@ -13,7 +13,7 @@ export const imagineDark = {
|
||||
},
|
||||
{
|
||||
token: 'string',
|
||||
foreground: '#6edf0'
|
||||
foreground: '#6edf00'
|
||||
},
|
||||
{
|
||||
token: 'number',
|
||||
@@ -25,11 +25,11 @@ export const imagineDark = {
|
||||
},
|
||||
{
|
||||
token: 'function',
|
||||
foreground: '#b840ff'
|
||||
foreground: '#ff00ff'
|
||||
},
|
||||
{
|
||||
token: 'variable',
|
||||
foreground: '#6edf0'
|
||||
foreground: '#6edf00'
|
||||
},
|
||||
{
|
||||
token: 'constant',
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { studio } from '../studio.svelte';
|
||||
import UpgradePrompt from '$routes/(console)/project-[region]-[project]/studio/artifact-[artifact]/upgradePrompt.svelte';
|
||||
|
||||
type Props = {
|
||||
width: number;
|
||||
@@ -40,6 +41,7 @@
|
||||
};
|
||||
const onsubmit: EventHandler<SubmitEvent, HTMLFormElement> = (event) => {
|
||||
event.preventDefault();
|
||||
tokens = tokens - 1;
|
||||
if (studio.streaming) controller.abort();
|
||||
else createMessage();
|
||||
};
|
||||
@@ -120,6 +122,10 @@
|
||||
studio.streaming = false;
|
||||
}
|
||||
}
|
||||
|
||||
let tokens = $state(2);
|
||||
|
||||
let isBlocked = $derived(tokens === 0);
|
||||
</script>
|
||||
|
||||
<section
|
||||
@@ -155,6 +161,21 @@
|
||||
</div>
|
||||
|
||||
<Conversation {parser} thinking={!firstByteReceived} />
|
||||
|
||||
{#if tokens < 2}
|
||||
<UpgradePrompt>
|
||||
{#if !isBlocked}
|
||||
<Typography.Text>
|
||||
<a href="#upgrade" class="callout">Upgrade</a>
|
||||
to increase your message limits.</Typography.Text>
|
||||
{:else}
|
||||
<Typography.Text>
|
||||
You're out of free messages.
|
||||
<a href="#upgrade" class="callout">Upgrade now.</a>
|
||||
</Typography.Text>
|
||||
{/if}
|
||||
</UpgradePrompt>
|
||||
{/if}
|
||||
{/if}
|
||||
<form {onsubmit} class="input" class:minimize-chat={minimizeChat}>
|
||||
<Layout.Stack
|
||||
@@ -166,6 +187,7 @@
|
||||
bind:value={message}
|
||||
name="conversation"
|
||||
placeholder="Chat with Imagine..."
|
||||
disabled={isBlocked}
|
||||
onfocus={() => {
|
||||
minimizeChat = false;
|
||||
}}></textarea>
|
||||
@@ -288,11 +310,16 @@
|
||||
border: 1px solid var(--border-neutral);
|
||||
border-radius: var(--border-radius-m);
|
||||
padding: var(--space-6);
|
||||
background-color: var(--bgcolor-neutral-primary);
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
|
||||
textarea {
|
||||
width: 100%;
|
||||
min-height: 100px;
|
||||
resize: none;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
@@ -303,6 +330,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
.callout {
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 2px;
|
||||
color: var(--fgcolor-accent-neutral);
|
||||
text-decoration-color: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
.input.minimize-chat {
|
||||
border: 0;
|
||||
padding: var(--space-6);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<script lang="ts">
|
||||
import 'highlight.js/styles/atom-one-light.css';
|
||||
import type { ParsedItem } from './parser';
|
||||
import { Card, Layout, ShimmerText, Spinner, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { Card, Layout, ShimmerText, Spinner, Typography, Icon } from '@appwrite.io/pink-svelte';
|
||||
import { IconCheckCircle } from '@appwrite.io/pink-icons-svelte';
|
||||
import Markdown, { type Plugin } from 'svelte-exmarkdown';
|
||||
import Li from './(markdown)/Li.svelte';
|
||||
import H1 from './(markdown)/H1.svelte';
|
||||
@@ -129,7 +130,7 @@
|
||||
{#key message.content}
|
||||
{#if message.type === 'actions'}
|
||||
<Card.Base variant="primary" padding="none">
|
||||
<Card.Base variant="secondary" padding="xs">
|
||||
<Card.Base variant="secondary" padding="xs" class="title">
|
||||
<Layout.Stack
|
||||
direction="row"
|
||||
alignItems="center"
|
||||
@@ -141,6 +142,7 @@
|
||||
</Layout.Stack>
|
||||
</Card.Base>
|
||||
<div class="actions">
|
||||
<div class="grid-line"></div>
|
||||
{#each message.actions as action}
|
||||
{@const actionInQueue = queue.lists[action.group]?.find(
|
||||
(n) => n.data.id === action.id
|
||||
@@ -151,7 +153,18 @@
|
||||
alignItems="center"
|
||||
justifyContent="space-between">
|
||||
{#if action.type === 'file'}
|
||||
<Typography.Code size="s">{action.src}</Typography.Code>
|
||||
<Typography.Code size="s" class="file">
|
||||
<span class="icon">
|
||||
{#if actionInQueue.status === 'done'}
|
||||
<Icon
|
||||
size="s"
|
||||
--icon-size-s="12px"
|
||||
icon={IconCheckCircle} />
|
||||
{:else}
|
||||
<Spinner size="s" --icon-size-s="12px" />
|
||||
{/if}
|
||||
</span>
|
||||
{action.src}</Typography.Code>
|
||||
<Typography.Code size="s">
|
||||
{#if actionInQueue.status === 'waiting'}
|
||||
Waiting
|
||||
@@ -164,7 +177,18 @@
|
||||
{/if}
|
||||
</Typography.Code>
|
||||
{:else if action.type === 'shell'}
|
||||
<Typography.Code size="s">{action.content}</Typography.Code>
|
||||
<Typography.Code class="file" size="s">
|
||||
<span class="icon">
|
||||
{#if actionInQueue.status === 'done'}
|
||||
<Icon
|
||||
size="s"
|
||||
--icon-size-s="12px"
|
||||
icon={IconCheckCircle} />
|
||||
{:else}
|
||||
<Spinner size="s" --icon-size-s="12px" />
|
||||
{/if}
|
||||
</span>
|
||||
{action.content}</Typography.Code>
|
||||
<Typography.Code size="s">
|
||||
{#if actionInQueue.status === 'waiting'}
|
||||
Waiting
|
||||
@@ -225,8 +249,46 @@
|
||||
0px 1.022px 4.089px -1.022px rgba(55, 59, 77, 0.1);
|
||||
}
|
||||
|
||||
:global(.title) {
|
||||
margin-top: -2px;
|
||||
margin-left: -1px;
|
||||
width: calc(100% + 2px) !important;
|
||||
}
|
||||
|
||||
.actions {
|
||||
padding: var(--space-6);
|
||||
position: relative;
|
||||
margin-left: var(--space-6);
|
||||
|
||||
:global(.file) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: -18px;
|
||||
margin-right: 4px;
|
||||
background-color: var(--bgcolor-neutral-primary);
|
||||
flex: 0 0;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
}
|
||||
|
||||
.grid-line {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 1px;
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
transparent 0%,
|
||||
var(--border-neutral) 25%,
|
||||
var(--border-neutral) 75%,
|
||||
transparent 100%
|
||||
);
|
||||
}
|
||||
|
||||
:global(pre) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
disableBodySelect,
|
||||
enabledBodySelect,
|
||||
getChatWidthFromPrefs,
|
||||
saveImaginePrefs
|
||||
saveImagineProjectPrefs
|
||||
} from '$lib/helpers/studioLayout.js';
|
||||
import { createStreamParser } from '$lib/components/studio/chat/parser.js';
|
||||
import { sdk } from '$lib/stores/sdk.js';
|
||||
@@ -25,7 +25,9 @@
|
||||
|
||||
let resizer = $state(null);
|
||||
let resizerLeftPosition = $state(
|
||||
page.data?.subNavigation ? getChatWidthFromPrefs() + 24 : getChatWidthFromPrefs()
|
||||
page.data?.subNavigation
|
||||
? getChatWidthFromPrefs(page.data?.project.$id) + 24
|
||||
: getChatWidthFromPrefs(page.data?.project.$id)
|
||||
);
|
||||
let resizerLeftOffset = $state(page.data?.subNavigation ? 52 : 9);
|
||||
let chatWidth = $derived(resizerLeftPosition - resizerLeftOffset);
|
||||
@@ -78,7 +80,7 @@
|
||||
resizerLeftPosition = 500;
|
||||
}
|
||||
const saveWidth = page.data?.subNavigation ? resizerLeftPosition - 24 : resizerLeftPosition;
|
||||
saveImaginePrefs('studioChatWidth', saveWidth);
|
||||
saveImagineProjectPrefs(page.data?.project.$id, 'studioChatWidth', saveWidth);
|
||||
|
||||
isResizing = false;
|
||||
window.removeEventListener('mousemove', resize);
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<script lang="ts">
|
||||
import { getHasSurveyedFromPrefs, saveHasSurveyed } from '$lib/helpers/studioLayout';
|
||||
import { Button, Layout, Tag } from '@appwrite.io/pink-svelte';
|
||||
import Modal from '../modal.svelte';
|
||||
|
||||
let show = $derived(getHasSurveyedFromPrefs() ? true : false);
|
||||
|
||||
const roles = [
|
||||
'Developer',
|
||||
'Product Manager',
|
||||
'Founder',
|
||||
'Content Creator',
|
||||
'Designer',
|
||||
'Marketer',
|
||||
'Student',
|
||||
'Educator',
|
||||
'Hobbyist/Personal Use',
|
||||
'Other'
|
||||
] as const;
|
||||
|
||||
let role = $state<(typeof roles)[number]>('Developer');
|
||||
|
||||
const handleSubmit = () => {
|
||||
alert(`role is ${role}`);
|
||||
saveHasSurveyed();
|
||||
show = false;
|
||||
};
|
||||
</script>
|
||||
|
||||
<Modal bind:show title="What is your role?">
|
||||
<Layout.Stack direction="row" gap="m" wrap="wrap">
|
||||
{#each roles as r}
|
||||
{@const isActive = role === r}
|
||||
<Tag
|
||||
onclick={() => (role = r)}
|
||||
class={isActive ? 'active' : ''}
|
||||
variant="default"
|
||||
selected={isActive}>
|
||||
{r}
|
||||
</Tag>
|
||||
{/each}
|
||||
</Layout.Stack>
|
||||
|
||||
<Button.Button onclick={handleSubmit}>Submit</Button.Button>
|
||||
</Modal>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -60,6 +60,8 @@
|
||||
left: 0;
|
||||
top: 48px;
|
||||
width: 200px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
transform: translateX(-200px);
|
||||
height: calc(100vh - 48px);
|
||||
padding: var(--space-4) var(--space-8) var(--space-8) var(--space-8);
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
<script lang="ts">
|
||||
import { Layout, ActionMenu, Icon, Divider, Tooltip } from '@appwrite.io/pink-svelte';
|
||||
import { Layout, ActionMenu, Divider, Tooltip } from '@appwrite.io/pink-svelte';
|
||||
import {
|
||||
IconAnnotation,
|
||||
IconCog,
|
||||
IconDatabase,
|
||||
IconFolder,
|
||||
IconSparkles,
|
||||
IconTemplate,
|
||||
IconUserGroup,
|
||||
IconViewGrid
|
||||
IconUserGroup
|
||||
} from '@appwrite.io/pink-icons-svelte';
|
||||
import { base } from '$app/paths';
|
||||
import { isSmallViewport, isTabletViewport } from '$lib/stores/viewport';
|
||||
import { isSmallViewport } from '$lib/stores/viewport';
|
||||
import type { ComponentType } from 'svelte';
|
||||
import { page } from '$app/state';
|
||||
|
||||
|
||||
@@ -50,6 +50,16 @@ class Studio {
|
||||
this.activeTerminal = symbol;
|
||||
}
|
||||
|
||||
removeTerminal(terminalSymbol: symbol) {
|
||||
this.terminals.delete(terminalSymbol);
|
||||
if (this.activeTerminal === terminalSymbol) {
|
||||
this.activeTerminal =
|
||||
this.terminals.size > 0
|
||||
? Array.from(this.terminals.keys())[0]
|
||||
: this.mainTerminalId;
|
||||
}
|
||||
}
|
||||
|
||||
#resetTerminals() {
|
||||
this.activeTerminal = this.mainTerminalId;
|
||||
this.terminals.clear();
|
||||
|
||||
@@ -5,68 +5,108 @@ import { page } from '$app/state';
|
||||
|
||||
const userPreferences = () => get(user)?.prefs;
|
||||
|
||||
const getImaginePrefs = () => {
|
||||
const currentPrefs = userPreferences();
|
||||
return currentPrefs?.imagine;
|
||||
type ProjectPrefs = {
|
||||
studioView?: 'editor' | 'preview';
|
||||
studioChatWidth?: string;
|
||||
studioTerminalHeight?: string;
|
||||
studioTerminalOpen?: boolean;
|
||||
};
|
||||
|
||||
export function getChatWidthFromPrefs(): number {
|
||||
const imaginePrefs = getImaginePrefs();
|
||||
if (imaginePrefs?.studioChatWidth) {
|
||||
type ImaginePrefs = {
|
||||
[projectId: string]: ProjectPrefs;
|
||||
};
|
||||
|
||||
const getProjectPrefs = (projectId: string): ProjectPrefs => {
|
||||
console.log(get(user));
|
||||
const currentPrefs = userPreferences();
|
||||
const imaginePrefs = currentPrefs?.imagine;
|
||||
const projectPrefs = imaginePrefs?.[projectId] ?? ({} as ProjectPrefs);
|
||||
|
||||
return projectPrefs;
|
||||
};
|
||||
|
||||
export function getChatWidthFromPrefs(projectId: string): number {
|
||||
const projectPrefs = getProjectPrefs(projectId);
|
||||
|
||||
console.log(projectPrefs);
|
||||
if (projectPrefs?.studioChatWidth) {
|
||||
if (window) {
|
||||
const maxSize = page.data?.subNavigation
|
||||
? window.innerWidth - 660
|
||||
: window.innerWidth - 460;
|
||||
|
||||
if (parseInt(imaginePrefs.studioChatWidth) > maxSize) {
|
||||
if (parseInt(projectPrefs.studioChatWidth) > maxSize) {
|
||||
return maxSize;
|
||||
}
|
||||
}
|
||||
return parseInt(imaginePrefs.studioChatWidth);
|
||||
return parseInt(projectPrefs.studioChatWidth);
|
||||
}
|
||||
return 500;
|
||||
}
|
||||
|
||||
export function getTerminalHeightFromPrefs(): number {
|
||||
const imaginePrefs = getImaginePrefs();
|
||||
if (imaginePrefs?.studioTerminalHeight) {
|
||||
export function getTerminalHeightFromPrefs(projectId: string): number {
|
||||
const projectPrefs = getProjectPrefs(projectId);
|
||||
if (projectPrefs?.studioTerminalHeight) {
|
||||
if (window) {
|
||||
const maxSize = window.innerHeight - 400;
|
||||
|
||||
if (parseInt(imaginePrefs.studioTerminalHeight) > maxSize) {
|
||||
if (parseInt(projectPrefs.studioTerminalHeight) > maxSize) {
|
||||
return maxSize;
|
||||
}
|
||||
}
|
||||
return parseInt(imaginePrefs.studioTerminalHeight);
|
||||
return parseInt(projectPrefs.studioTerminalHeight);
|
||||
}
|
||||
return 350;
|
||||
}
|
||||
|
||||
export function getStudioView() {
|
||||
const imaginePrefs = getImaginePrefs();
|
||||
return imaginePrefs?.studioView as 'editor' | 'preview' | null;
|
||||
export function getStudioView(projectId: string) {
|
||||
const projectPrefs = getProjectPrefs(projectId);
|
||||
return projectPrefs?.studioView as 'editor' | 'preview' | null;
|
||||
}
|
||||
|
||||
export function saveImaginePrefs(key: string, value: string | number | boolean): void {
|
||||
export const saveHasSurveyed = () => {
|
||||
const currentPrefs = userPreferences();
|
||||
const imaginePrefs = getImaginePrefs();
|
||||
const updatedPrefs = {
|
||||
...currentPrefs,
|
||||
hasSurveyed: true
|
||||
};
|
||||
|
||||
sdk.forConsole.account.updatePrefs(updatedPrefs);
|
||||
};
|
||||
|
||||
export function saveImagineProjectPrefs(
|
||||
projectId: string,
|
||||
key: string,
|
||||
value: string | number | boolean
|
||||
): void {
|
||||
const currentPrefs = userPreferences();
|
||||
const imaginePrefs = currentPrefs?.imagine as unknown as ImaginePrefs;
|
||||
const projectPrefs = getProjectPrefs(projectId);
|
||||
|
||||
const newPrefs = {
|
||||
...currentPrefs,
|
||||
imagine: {
|
||||
...imaginePrefs,
|
||||
[key]: value
|
||||
[projectId]: {
|
||||
...projectPrefs,
|
||||
[key]: value
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
sdk.forConsole.account.updatePrefs(newPrefs);
|
||||
}
|
||||
|
||||
export function getTerminalOpenFromPrefs(): boolean {
|
||||
const imaginePrefs = getImaginePrefs();
|
||||
return imaginePrefs?.studioTerminalOpen as unknown as boolean;
|
||||
export function getTerminalOpenFromPrefs(projectId: string): boolean {
|
||||
const projectPrefs = getProjectPrefs(projectId);
|
||||
return projectPrefs?.studioTerminalOpen as unknown as boolean;
|
||||
}
|
||||
|
||||
export const getHasSurveyedFromPrefs = () => {
|
||||
const currentPrefs = userPreferences();
|
||||
return !!currentPrefs?.hasSurveyed || false;
|
||||
};
|
||||
|
||||
export function disableBodySelect(direction: 'row' | 'column' = 'column') {
|
||||
document.body.style.userSelect = 'none';
|
||||
document.body.style.webkitUserSelect = 'none';
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 141 KiB |
@@ -29,7 +29,7 @@
|
||||
{#if (nestedLevel === 6 && paramCount === 2) || nestedLevel === 7}
|
||||
<a href="../" style:display="flex" style:margin-inline-end="-8px"
|
||||
><Icon icon={IconChevronLeft} /></a>
|
||||
{:else if paramCount >= 2}
|
||||
{:else if paramCount >= 3}
|
||||
<a href="./" style:display="flex" style:margin-inline-end="-8px"
|
||||
><Icon icon={IconChevronLeft} /></a>
|
||||
{/if}
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
<script lang="ts">
|
||||
import DesktopLight from '../../routes/(public)/(guest)/login/assets/desktop-light.png';
|
||||
import { Card, Divider, Layout, Typography, Icon } from '@appwrite.io/pink-svelte';
|
||||
import DesktopLight from '../../routes/(public)/(guest)/login/assets/desktop-light.webp';
|
||||
import DesktopDark from '../../routes/(public)/(guest)/login/assets/desktop-dark.webp';
|
||||
import { Card, Layout, Typography } from '@appwrite.io/pink-svelte';
|
||||
import { default as IconImagine } from '$routes/(console)/project-[region]-[project]/studio/assets/icon-imagine.svelte';
|
||||
import type { Snippet } from 'svelte';
|
||||
import { app } from '$lib/stores/app';
|
||||
|
||||
let { title }: { title: string } = $props();
|
||||
let { title, children }: { title: string; children: Snippet } = $props();
|
||||
|
||||
const images = {
|
||||
dark: DesktopDark,
|
||||
light: DesktopLight
|
||||
};
|
||||
</script>
|
||||
|
||||
<main class="full-page-signup">
|
||||
@@ -12,18 +20,18 @@
|
||||
<Layout.Stack direction="column" gap="xl">
|
||||
<Layout.Stack direction="row" justifyContent="center">
|
||||
<div class="icon-container">
|
||||
<svelte:component this={IconImagine}></svelte:component>
|
||||
<IconImagine />
|
||||
</div>
|
||||
</Layout.Stack>
|
||||
<Layout.Stack direction="row" justifyContent="center">
|
||||
<Typography.Title size="m">{title}</Typography.Title>
|
||||
</Layout.Stack>
|
||||
<slot />
|
||||
{@render children()}
|
||||
</Layout.Stack>
|
||||
</Card.Base>
|
||||
</div>
|
||||
</main>
|
||||
<div class="overlay-image" style:background-image={`url('${DesktopLight}');`}></div>
|
||||
<div class="overlay-image" style:background-image={`url('${images[$app.themeInUse]}');`}></div>
|
||||
<div class="overlay-color"></div>
|
||||
|
||||
<style lang="scss">
|
||||
@@ -66,6 +74,6 @@
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: rgba(25, 25, 28, 0.8);
|
||||
background: hsla(var(--bgcolor-neutral-primary) / 0.2);
|
||||
}
|
||||
</style>
|
||||
@@ -34,7 +34,7 @@
|
||||
import { openMigrationWizard } from './(migration-wizard)';
|
||||
import { project } from './project-[region]-[project]/store';
|
||||
import { feedback } from '$lib/stores/feedback';
|
||||
import { consoleProfile, hasStripePublicKey, isCloud, isStudio, VARS } from '$lib/system';
|
||||
import { consoleProfile, hasStripePublicKey, isCloud, VARS } from '$lib/system';
|
||||
import { stripe } from '$lib/stores/stripe';
|
||||
import MobileSupportModal from './wizard/support/mobileSupportModal.svelte';
|
||||
import { showSupportModal } from './wizard/support/store';
|
||||
|
||||
@@ -7,7 +7,7 @@ import { redirect } from '@sveltejs/kit';
|
||||
import { base } from '$app/paths';
|
||||
|
||||
export const load: PageLoad = async ({ params, url, route, depends, parent }) => {
|
||||
const { scopes } = await parent();
|
||||
const { scopes, account } = await parent();
|
||||
depends(Dependencies.ORGANIZATION);
|
||||
const page = getPage(url);
|
||||
const limit = getLimit(url, route, CARD_LIMIT);
|
||||
@@ -23,6 +23,22 @@ export const load: PageLoad = async ({ params, url, route, depends, parent }) =>
|
||||
Query.orderDesc('')
|
||||
]);
|
||||
|
||||
const lastUpdatedProject = projects.projects.reduce((latest, project) => {
|
||||
return new Date(project.$updatedAt) > new Date(latest.$updatedAt) ? project : latest;
|
||||
});
|
||||
|
||||
const isInternalLink = url.pathname.startsWith('/console/organization-');
|
||||
|
||||
const accessedAt = new Date(account.accessedAt).getTime();
|
||||
const accessedYesterday = new Date().getTime() - accessedAt > 30 * 60 * 1000;
|
||||
|
||||
if (lastUpdatedProject && accessedYesterday && !isInternalLink) {
|
||||
redirect(
|
||||
303,
|
||||
`${base}/project-${lastUpdatedProject.region}-${lastUpdatedProject.$id}/studio`
|
||||
);
|
||||
}
|
||||
|
||||
// set `default` if no region!
|
||||
for (const project of projects.projects) {
|
||||
project.region ??= 'default';
|
||||
|
||||
+83
-26
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { Layout, Divider, Icon, Button, Status } from '@appwrite.io/pink-svelte';
|
||||
import { Layout, Divider, Icon, Button } from '@appwrite.io/pink-svelte';
|
||||
import { page } from '$app/state';
|
||||
import { ActionDropdown, Tab, Tabs, Terminal } from '$lib/components';
|
||||
import { base } from '$app/paths';
|
||||
@@ -9,7 +9,8 @@
|
||||
IconChevronDoubleUp,
|
||||
IconPlusSm,
|
||||
IconTerminal,
|
||||
IconPlus
|
||||
IconPlus,
|
||||
IconX
|
||||
} from '@appwrite.io/pink-icons-svelte';
|
||||
import { previewFrameRef } from '$routes/(console)/project-[region]-[project]/store';
|
||||
import {
|
||||
@@ -18,7 +19,7 @@
|
||||
getStudioView,
|
||||
getTerminalHeightFromPrefs,
|
||||
getTerminalOpenFromPrefs,
|
||||
saveImaginePrefs
|
||||
saveImagineProjectPrefs
|
||||
} from '$lib/helpers/studioLayout';
|
||||
import { showChat } from '$lib/stores/chat';
|
||||
import { default as IconChatLayout } from '$routes/(console)/project-[region]-[project]/studio/assets/chat-layout.svelte';
|
||||
@@ -29,16 +30,17 @@
|
||||
import { untrack } from 'svelte';
|
||||
import Debug from './debug.svelte';
|
||||
import ArtifactActionMenu from './artifactActionMenu.svelte';
|
||||
import RoleSurvey from '$lib/components/studio/roleSurvey.svelte';
|
||||
|
||||
const { children, data } = $props();
|
||||
|
||||
let view: 'preview' | 'editor' = $state(getStudioView() ?? 'preview');
|
||||
let view: 'preview' | 'editor' = $state(getStudioView(data.project.$id) ?? 'preview');
|
||||
|
||||
let debug = $state(false);
|
||||
|
||||
function changeView(newView: 'preview' | 'editor') {
|
||||
view = newView;
|
||||
saveImaginePrefs('studioView', newView);
|
||||
saveImagineProjectPrefs(data.project.$id, 'studioView', newView);
|
||||
}
|
||||
|
||||
$effect(() => {
|
||||
@@ -46,11 +48,11 @@
|
||||
untrack(() => studio.selectArtifact(artifact));
|
||||
});
|
||||
|
||||
let terminalOpen = $state(getTerminalOpenFromPrefs());
|
||||
let terminalOpen = $state(getTerminalOpenFromPrefs(data.project.$id));
|
||||
let isResizing = false;
|
||||
|
||||
const minHeight = 150;
|
||||
let resizerTopPosition = $state(getTerminalHeightFromPrefs() ?? minHeight);
|
||||
let resizerTopPosition = $state(getTerminalHeightFromPrefs(data.project.$id) ?? minHeight);
|
||||
const terminalTabsHeight = 50;
|
||||
let layoutElement = $state<HTMLDivElement | null>(null);
|
||||
|
||||
@@ -61,7 +63,7 @@
|
||||
|
||||
$effect(() => {
|
||||
if (terminalOpen !== undefined) {
|
||||
saveImaginePrefs('studioTerminalOpen', terminalOpen);
|
||||
saveImagineProjectPrefs(data.project.$id, 'studioTerminalOpen', terminalOpen);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -105,7 +107,7 @@
|
||||
|
||||
function stopResize() {
|
||||
isResizing = false;
|
||||
saveImaginePrefs('studioTerminalHeight', resizerTopPosition);
|
||||
saveImagineProjectPrefs(data.project.$id, 'studioTerminalHeight', resizerTopPosition);
|
||||
window.removeEventListener('mousemove', resize);
|
||||
window.removeEventListener('mouseup', stopResize);
|
||||
window.removeEventListener('touchmove', resize);
|
||||
@@ -123,6 +125,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
function removeTerminal(symbol: symbol) {
|
||||
studio.removeTerminal(symbol);
|
||||
if (studio.terminals.size > 1) {
|
||||
terminalOpen = true;
|
||||
}
|
||||
}
|
||||
|
||||
const artifacts = $derived.by(() => {
|
||||
const mappedArtifacts = data.artifacts?.artifacts
|
||||
? data.artifacts.artifacts.map((artifact) => {
|
||||
@@ -166,7 +175,8 @@
|
||||
{/if}
|
||||
{/snippet}
|
||||
|
||||
<svelte:window on:resize={onViewportResize} />
|
||||
<RoleSurvey />
|
||||
<svelte:window onresize={onViewportResize} />
|
||||
<div bind:this={layoutElement} class="layout">
|
||||
<Layout.Stack
|
||||
direction="column"
|
||||
@@ -264,27 +274,48 @@
|
||||
<Icon icon={IconImagine} />
|
||||
Imagine
|
||||
</Tab>
|
||||
{#each studio.terminals as [symbol] (symbol)}
|
||||
<Tab
|
||||
{root}
|
||||
on:click={() => (studio.activeTerminal = symbol)}
|
||||
selected={studio.activeTerminal === symbol}>
|
||||
<Icon icon={IconTerminal} />
|
||||
Terminal
|
||||
</Tab>
|
||||
{#each studio.terminals as [symbol], i (symbol)}
|
||||
<div class="terminal-group">
|
||||
<Tab
|
||||
{root}
|
||||
on:click={() =>
|
||||
(studio.activeTerminal = symbol)}
|
||||
selected={studio.activeTerminal === symbol}>
|
||||
<Icon icon={IconTerminal} />
|
||||
<span class="label">Terminal</span>
|
||||
</Tab>
|
||||
|
||||
{#if i !== 0}
|
||||
<Button.Button
|
||||
variant="text"
|
||||
size="xs"
|
||||
class="terminal-close"
|
||||
onclick={(event) => {
|
||||
event.preventDefault();
|
||||
removeTerminal(symbol);
|
||||
}}
|
||||
icon>
|
||||
<Icon
|
||||
icon={IconX}
|
||||
--icon-size-s="12px"
|
||||
size="s"
|
||||
color="--fgcolor-neutral-tertiary" />
|
||||
</Button.Button>
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
</Tabs>
|
||||
<Button.Button
|
||||
variant="text"
|
||||
size="s"
|
||||
on:click={(event) => {
|
||||
onclick={(event) => {
|
||||
event.preventDefault();
|
||||
createTerminal();
|
||||
}}
|
||||
icon>
|
||||
<Icon
|
||||
icon={IconPlusSm}
|
||||
size="m"
|
||||
size="s"
|
||||
color="--fgcolor-neutral-tertiary" />
|
||||
</Button.Button>
|
||||
</Layout.Stack>
|
||||
@@ -396,6 +427,32 @@
|
||||
width: calc(100%);
|
||||
}
|
||||
|
||||
.terminal-group {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.terminal-group:hover > :global(.terminal-close) {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
:global(.terminal-close) {
|
||||
position: absolute;
|
||||
right: 2px;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: hsla(var(--bgcolor-neutral-primary) / 95) !important;
|
||||
border: 0 !important;
|
||||
backdrop-filter: blur(2px);
|
||||
opacity: 0;
|
||||
transition: opacity 150ms ease-in-out;
|
||||
}
|
||||
|
||||
.divider-wrapper-artifacts {
|
||||
margin-block-start: 8px;
|
||||
margin-block-end: 8px;
|
||||
@@ -422,10 +479,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
.hide-mobile {
|
||||
display: none;
|
||||
@media (min-width: 768px) {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
// .hide-mobile {
|
||||
// display: none;
|
||||
// @media (min-width: 768px) {
|
||||
// display: block;
|
||||
// }
|
||||
// }
|
||||
</style>
|
||||
+17
-1
@@ -1,6 +1,8 @@
|
||||
<script lang="ts">
|
||||
import InputText from '../../../../../lib/elements/forms/inputText.svelte';
|
||||
import {
|
||||
IconChevronLeft,
|
||||
IconChevronRight,
|
||||
IconDeviceMobile,
|
||||
IconExternalLink,
|
||||
IconRefresh
|
||||
@@ -47,6 +49,20 @@
|
||||
<Layout.Stack direction="column" gap="s">
|
||||
<form {onsubmit}>
|
||||
<Layout.Stack direction="row" alignItems="center">
|
||||
<Button.Button
|
||||
variant="extra-compact"
|
||||
type="button"
|
||||
size="s"
|
||||
onclick={() => alert('back button clicked')}>
|
||||
<Icon icon={IconChevronLeft} color="--fgcolor-neutral-tertiary" />
|
||||
</Button.Button>
|
||||
<Button.Button
|
||||
variant="extra-compact"
|
||||
type="button"
|
||||
size="s"
|
||||
onclick={() => alert('forward button clicked')}>
|
||||
<Icon icon={IconChevronRight} color="--fgcolor-neutral-tertiary" />
|
||||
</Button.Button>
|
||||
<Button.Button
|
||||
variant="extra-compact"
|
||||
type="button"
|
||||
@@ -68,7 +84,7 @@
|
||||
type="button"
|
||||
href={previewUrl.toString()}
|
||||
size="s"
|
||||
external={true}
|
||||
target="_blank"
|
||||
><Icon icon={IconExternalLink} color="--fgcolor-neutral-tertiary" />
|
||||
</Button.Anchor>
|
||||
</Layout.Stack>
|
||||
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
<script lang="ts">
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { ActionMenu, Icon, Popover } from '@appwrite.io/pink-svelte';
|
||||
import { IconDotsHorizontal } from '@appwrite.io/pink-icons-svelte';
|
||||
</script>
|
||||
|
||||
<Popover padding="none" placement="bottom-end" let:toggle --action-menu-root-width="100px">
|
||||
<Button
|
||||
text
|
||||
icon
|
||||
size="s"
|
||||
class="file-action-menu-button"
|
||||
on:click={(e) => {
|
||||
e.preventDefault();
|
||||
toggle(e);
|
||||
}}>
|
||||
<Icon size="s" icon={IconDotsHorizontal} />
|
||||
</Button>
|
||||
<svelte:fragment slot="tooltip" let:toggle>
|
||||
<ActionMenu.Root>
|
||||
<ActionMenu.Item.Button
|
||||
on:click={(e) => {
|
||||
e.preventDefault();
|
||||
// Dummy handler
|
||||
alert('Rename clicked');
|
||||
toggle(e);
|
||||
}}>
|
||||
Rename
|
||||
</ActionMenu.Item.Button>
|
||||
<ActionMenu.Item.Button
|
||||
on:click={(e) => {
|
||||
e.preventDefault();
|
||||
// Dummy handler
|
||||
alert('Duplicate clicked');
|
||||
toggle(e);
|
||||
}}>
|
||||
Duplicate
|
||||
</ActionMenu.Item.Button>
|
||||
<ActionMenu.Item.Button
|
||||
on:click={(e) => {
|
||||
e.preventDefault();
|
||||
// Dummy handler
|
||||
alert('Delete clicked');
|
||||
toggle(e);
|
||||
}}>
|
||||
Delete
|
||||
</ActionMenu.Item.Button>
|
||||
</ActionMenu.Root>
|
||||
</svelte:fragment>
|
||||
</Popover>
|
||||
|
||||
<style>
|
||||
:global(.file-action-menu-button) {
|
||||
background-color: transparent !important;
|
||||
outline: none !important;
|
||||
border: 0 !important;
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
</style>
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
<script lang="ts">
|
||||
import ImagineBg from '$lib/images/login/imagine-bg.webp';
|
||||
import type { Snippet } from 'svelte';
|
||||
|
||||
type Props = {
|
||||
children: Snippet;
|
||||
};
|
||||
|
||||
const { children }: Props = $props();
|
||||
</script>
|
||||
|
||||
<div class="upgrade-prompt">
|
||||
{@render children()}
|
||||
|
||||
<img src={ImagineBg} alt="Imagine background" class="background" />
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.upgrade-prompt {
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: calc(100% + 2 * var(--space-4));
|
||||
margin-inline-start: calc(-1 * var(--space-4));
|
||||
margin-block-end: calc(-1 * var(--space-2));
|
||||
background-color: #000;
|
||||
border-radius: var(--border-radius-s) var(--border-radius-s) 0 0;
|
||||
padding: var(--space-2) var(--space-6) var(--space-4);
|
||||
animation: enter 0.2s ease-in-out;
|
||||
animation-fill-mode: forwards;
|
||||
overflow: hidden;
|
||||
|
||||
.background {
|
||||
width: 50%;
|
||||
position: absolute;
|
||||
object-fit: cover;
|
||||
right: 0;
|
||||
z-index: -1;
|
||||
mask-image: linear-gradient(to right, transparent, black);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes enter {
|
||||
from {
|
||||
transform: translateY(8px);
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
@@ -9,6 +9,8 @@
|
||||
import { onMount } from 'svelte';
|
||||
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
|
||||
import { Layout, Link, Typography, Alert } from '@appwrite.io/pink-svelte';
|
||||
import { consoleProfile } from '$lib/system';
|
||||
import UnauthenticatedStudio from '$lib/layout/unauthenticatedStudio.svelte';
|
||||
|
||||
let teamId: string, membershipId: string, userId: string, secret: string;
|
||||
let terms = false;
|
||||
@@ -43,15 +45,8 @@
|
||||
<title>Accept invite - Appwrite</title>
|
||||
</svelte:head>
|
||||
|
||||
<Unauthenticated>
|
||||
<svelte:fragment slot="title">
|
||||
{#if !userId || !secret || !membershipId || !teamId}
|
||||
Invalid invite
|
||||
{:else}
|
||||
Invite
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
<svelte:fragment>
|
||||
{#if consoleProfile.hasFullPageSignup}
|
||||
<UnauthenticatedStudio title="Invite members">
|
||||
{#if !userId || !secret || !membershipId || !teamId}
|
||||
<Layout.Stack>
|
||||
<Alert.Inline status="warning" title="The invite link is not valid">
|
||||
@@ -94,5 +89,59 @@
|
||||
</Form>
|
||||
</Layout.Stack>
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
</Unauthenticated>
|
||||
</UnauthenticatedStudio>
|
||||
{:else}
|
||||
<Unauthenticated>
|
||||
<svelte:fragment slot="title">
|
||||
{#if !userId || !secret || !membershipId || !teamId}
|
||||
Invalid invite
|
||||
{:else}
|
||||
Invite
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
<svelte:fragment>
|
||||
{#if !userId || !secret || !membershipId || !teamId}
|
||||
<Layout.Stack>
|
||||
<Alert.Inline status="warning" title="The invite link is not valid">
|
||||
Please ask the project owner to send you a new invite.
|
||||
</Alert.Inline>
|
||||
<div>
|
||||
<Button href={`${base}/register`}>Sign up to Appwrite</Button>
|
||||
</div>
|
||||
</Layout.Stack>
|
||||
{:else}
|
||||
<Layout.Stack>
|
||||
<Typography.Text>
|
||||
You have been invited to join an organization on Appwrite
|
||||
</Typography.Text>
|
||||
<Form onSubmit={acceptInvite}>
|
||||
<Layout.Stack>
|
||||
<InputChoice
|
||||
required
|
||||
bind:value={terms}
|
||||
id="terms"
|
||||
label="terms"
|
||||
showLabel={false}>
|
||||
By accepting the invitation, you agree to the <Link.Anchor
|
||||
href="https://appwrite.io/terms"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer">Terms and Conditions</Link.Anchor>
|
||||
and
|
||||
<Link.Anchor
|
||||
href="https://appwrite.io/privacy"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer">
|
||||
Privacy Policy</Link.Anchor
|
||||
>.</InputChoice>
|
||||
|
||||
<Layout.Stack direction="row">
|
||||
<Button secondary href={`${base}/login`}>Cancel</Button>
|
||||
<Button submit disabled={!terms}>Accept</Button>
|
||||
</Layout.Stack>
|
||||
</Layout.Stack>
|
||||
</Form>
|
||||
</Layout.Stack>
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
</Unauthenticated>
|
||||
{/if}
|
||||
@@ -64,7 +64,7 @@
|
||||
<title>Recover - Appwrite</title>
|
||||
</svelte:head>
|
||||
{#if consoleProfile.hasFullPageSignup}
|
||||
<UnauthenticatedStudio title="Password recovery">
|
||||
<UnauthenticatedStudio title="Recover password">
|
||||
{#if userId && secret}
|
||||
<Form onSubmit={setPassword}>
|
||||
<Layout.Stack>
|
||||
@@ -96,7 +96,7 @@
|
||||
required={true}
|
||||
bind:value={email} />
|
||||
|
||||
<Button fullWidth submit>Recover</Button>
|
||||
<Button fullWidth submit secondary>Recover</Button>
|
||||
<div></div>
|
||||
<Layout.Stack direction="row" justifyContent="center">
|
||||
<a href={`${base}/login`}
|
||||
|
||||
Reference in new issue
Block a user