Inline code-block while component is loading (#8293)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina 2025-03-20 10:54:25 +04:00 committed by GitHub
parent 97c884a30e
commit 09f69b8555
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,6 +16,7 @@
import diffview from '@hcengineering/diffview'
import { MarkupNode } from '@hcengineering/text'
import { Component } from '@hcengineering/ui'
import type { SvelteComponent } from 'svelte'
export let node: MarkupNode
export let preview = false
@ -28,8 +29,11 @@
$: margin = preview ? '0' : null
$: props = { value, language }
let innerRef: SvelteComponent | undefined
</script>
{#if node}
<pre class="proseCodeBlock" style:margin><code><Component {is} {props} /></code></pre>
<pre class="proseCodeBlock" style:margin><code
><Component {is} {props} showLoading={false} bind:innerRef />{#if !innerRef}{value}{/if}</code
></pre>
{/if}