your personal website on atproto - mirror blento.app
at main 39 lines 908 B view raw
1import type { CardDefinition } from '../types'; 2import EditingTextCard from './EditingTextCard.svelte'; 3import TextCard from './TextCard.svelte'; 4import TextCardSettings from './TextCardSettings.svelte'; 5 6export const TextCardDefinition = { 7 type: 'text', 8 contentComponent: TextCard, 9 editingContentComponent: EditingTextCard, 10 createNew: (card) => { 11 card.cardType = 'text'; 12 card.cardData = { 13 text: 'hello world' 14 }; 15 }, 16 17 settingsComponent: TextCardSettings 18} as CardDefinition & { type: 'text' }; 19 20export const textAlignClasses: Record<string, string> = { 21 left: '', 22 center: 'text-center justify-center', 23 right: 'text-end justify-end' 24}; 25 26export const verticalAlignClasses: Record<string, string> = { 27 top: 'items-stretch', 28 center: 'items-center-safe', 29 bottom: 'items-end-safe' 30}; 31 32export const textSizeClasses = [ 33 'text-lg', 34 'text-xl', 35 'text-2xl', 36 'text-3xl', 37 'text-4xl', 38 'text-5xl' 39];