diff --git a/ui/src/GameSpace/ConfigMenu/WalsControls.svelte b/ui/src/GameSpace/ConfigMenu/WalsControls.svelte index 3eef3b1..630e4eb 100644 --- a/ui/src/GameSpace/ConfigMenu/WalsControls.svelte +++ b/ui/src/GameSpace/ConfigMenu/WalsControls.svelte @@ -37,7 +37,10 @@ {@const wal = weaveUrlToWAL(attachment)}
{#await store.weaveClient.assets.assetInfo(wal)} -
+
...
{:then data} diff --git a/ui/src/GameSpace/Element/Element.svelte b/ui/src/GameSpace/Element/Element.svelte index f2c4473..5fcd15c 100644 --- a/ui/src/GameSpace/Element/Element.svelte +++ b/ui/src/GameSpace/Element/Element.svelte @@ -190,7 +190,7 @@ class="absolute z-100 -inset-1 pointer-events-none bg-blue-5/10 b b-dashed b-blue-5/40 rounded-md" >
{/if} - {#if el.wals.length > 0} + {#if el.wals.length > 0 && el.type !== 'EmbedWal'}
{/if} - + {#if !asAsset} + + {/if}
{#if !$permissions.isArchived} - // import { type EmbedWalElement } from './type'; + import Checkbox from '~/GameSpace/ui/Checkbox.svelte'; + + import { type EmbedWalElement } from './type'; // import Input from '../../ui/Input.svelte'; - // export let el: EmbedWalElement; - // export let onUpdate: (el: Partial) => void; + export let el: EmbedWalElement; + export let onUpdate: (el: Partial) => void; $$restProps; // This prevents Svelte warnings from unused props
- + onUpdate({ uuid: el.uuid, preview })} + />
diff --git a/ui/src/GameSpace/elements/EmbedWal/Element.svelte b/ui/src/GameSpace/elements/EmbedWal/Element.svelte index b2a60b1..c56c38e 100644 --- a/ui/src/GameSpace/elements/EmbedWal/Element.svelte +++ b/ui/src/GameSpace/elements/EmbedWal/Element.svelte @@ -1,12 +1,14 @@ -
- {#if el.url} - - {:else if firstValidAssetSrc} - - {:else} -
📎
- {/if} -
- +
+
+
+ {#if displayAsset} + + {:else} + No asset selected + {/if} +
+
+ {#if el.preview} + {#if displayAsset} + + {:else} +
📎
+ {/if} + {/if}
diff --git a/ui/src/GameSpace/elements/EmbedWal/config.ts b/ui/src/GameSpace/elements/EmbedWal/config.ts index 87fae30..450c343 100644 --- a/ui/src/GameSpace/elements/EmbedWal/config.ts +++ b/ui/src/GameSpace/elements/EmbedWal/config.ts @@ -1,14 +1,16 @@ -import { type EmbedWalElement } from './type'; +import { type EmbedWalElement, VERSION } from './type'; const config = { type: 'EmbedWal', - version: 1, + version: VERSION, label: 'Embed', icon: '📎', build: (): Partial => ({ height: 200, width: 200, url: '', + preview: true, + storedHeight: 200, }), }; diff --git a/ui/src/GameSpace/elements/EmbedWal/type.ts b/ui/src/GameSpace/elements/EmbedWal/type.ts index d089aa8..02ac3f8 100644 --- a/ui/src/GameSpace/elements/EmbedWal/type.ts +++ b/ui/src/GameSpace/elements/EmbedWal/type.ts @@ -1,7 +1,11 @@ import { type GElementBase } from '~/store'; +export const VERSION = 2; + export type EmbedWalElement = GElementBase & { type: 'EmbedWal'; - version: number; + version: typeof VERSION; url: string; + preview: boolean; + storedHeight: number; };