import React, { useState } from 'react'; import { fileUrl } from './file-links.mjs'; export { fileUrl } from './file-links.mjs'; const theme = { text: { primary: 'var(--text)', secondary: 'var(--muted)', tertiary: 'var(--subtle)' }, bg: { elevated: 'var(--surface)' }, fill: { secondary: 'var(--selected)' }, stroke: { primary: 'var(--line)', secondary: 'var(--line)' }, accent: { primary: 'var(--accent)' }, }; export const useHostTheme = () => theme; export function useCanvasState(key: string, initial: string) { const [value, setValue] = useState(() => { try { return localStorage.getItem(key) ?? initial; } catch { return initial; } }); return [value, (next: string) => { setValue(next); try { localStorage.setItem(key, next); } catch {} }] as const; } export const useCanvasAction = () => (action: any) => { if (action.type === 'openFile') window.location.assign(fileUrl(action.path, action.selection?.startLineNumber)); }; export function Stack({ gap = 12, style, ...props }: any) { return
; } export function Row({ gap = 12, justify, align = 'center', wrap, style, ...props }: any) { return ; } export function Grid({ columns, gap = 12, style, ...props }: any) { return ; } export const H1 = (props: any) => ; export const H2 = (props: any) => ; export const H3 = (props: any) => ; export const Text = ({ size, tone, weight, style, ...props }: any) => ; export const Pill = ({ active, onClick, ...props }: any) => onClick ? : ; export const Button = (props: any) => ; export const Divider = () =>| {h} | )}
|---|
| {cell} | )}