Skip to content

Commit

Permalink
fix fill height for deployed apps
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Aug 8, 2024
1 parent 832df26 commit 71d23db
Show file tree
Hide file tree
Showing 5 changed files with 278 additions and 9 deletions.
248 changes: 248 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"typescript": "^5.1.3",
"vite": "^5",
"vite-plugin-circular-dependency": "^0.2.1",
"vite-plugin-mkcert": "^1.17.5",
"yootils": "^0.3.1"
},
"overrides": {
Expand Down
32 changes: 25 additions & 7 deletions frontend/src/lib/components/apps/editor/AppPreview.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@
author: policy.on_behalf_of_email
}
function hashchange(e: HashChangeEvent) {
ncontext.hash = e.newURL.split('#')[1]
ncontext = ncontext
}
function resizeWindow() {
!isEditor && ($breakpoint = window.innerWidth < 769 ? 'sm' : 'lg')
}
Expand All @@ -84,8 +79,31 @@
let parentContext = getContext<AppViewerContext>('AppViewerContext')
let worldStore = buildWorld(ncontext)
$: onContextChange(context)
function onContextChange(context: any) {
Object.assign(ncontext, context)
ncontext = ncontext
worldStore.update((x) => {
Object.entries(context).forEach(([key, value]) => {
x.outputsById?.['ctx']?.[key].set(value, true)
})
return x
})
}
function hashchange(e: HashChangeEvent) {
ncontext.hash = e.newURL.split('#')[1]
ncontext = ncontext
worldStore.update((x) => {
x.outputsById?.['ctx']?.['hash'].set(ncontext.hash, true)
return x
})
}
setContext<AppViewerContext>('AppViewerContext', {
worldStore: buildWorld(ncontext),
worldStore: worldStore,
initialized: writable({ initialized: false, initializedComponents: [] }),
app: appStore,
summary: writable(summary),
Expand Down Expand Up @@ -196,7 +214,7 @@

<svelte:window on:hashchange={hashchange} on:resize={resizeWindow} />

<div class="relative h-full" bind:clientHeight={appHeight}>
<div class="relative h-full grow" bind:clientHeight={appHeight}>
<div id="app-editor-top-level-drawer" />
<div id="app-editor-select" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{#key app}
<div
class={twMerge(
'min-h-screen h-full w-full',
'min-h-screen h-full w-full flex flex-col',
app?.value.css?.['app']?.['viewer']?.class,
'wm-app-viewer'
)}
Expand Down
Loading

0 comments on commit 71d23db

Please sign in to comment.