Visual text editor; Cards, FAQ and HTML blocks; block anchors
The text editor (Tiptap) only produces simple HTML: headings, bold, italic, strikethrough, links, lists, pull quotes, lines. Layouts that were hand-written HTML in text blocks get their own blocks (Cards with pictures or numbered steps, FAQ), one-offs and embeds go in an HTML block, and every block can have an anchor for #links. Text blocks get alignment and a small (footnote) size. Existing text blocks the editor can't represent become HTML blocks that render exactly as before (migration, and backup import for old files); text that is only centred becomes centred text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
This commit is contained in:
parent
72f8898925
commit
f86c2251dc
17 changed files with 532 additions and 72 deletions
14
packages/shared/src/blocks/HtmlBlock.svelte
Normal file
14
packages/shared/src/blocks/HtmlBlock.svelte
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<script lang="ts">
|
||||
import { scrollReveal } from '$shared/scrollReveal';
|
||||
|
||||
let { data } = $props<{ data: { html?: string } }>();
|
||||
</script>
|
||||
|
||||
<!-- Written by an admin as-is, for embeds and one-off layouts. Same frame and text styles as a
|
||||
Text block (old text blocks with layout HTML became HTML blocks and must look unchanged).
|
||||
Tailwind classes in it get no styles (only classes found in this repo are generated). -->
|
||||
<section use:scrollReveal class="reveal mx-auto max-w-3xl px-6 py-12 md:py-16">
|
||||
<div class="prose-wellness text-lg text-fg-body/85">
|
||||
{@html data.html || ''}
|
||||
</div>
|
||||
</section>
|
||||
Loading…
Add table
Add a link
Reference in a new issue