claritykit-svelte
Version:
A comprehensive Svelte component library focused on accessibility, ADHD-optimized design, developer experience, and full SSR compatibility
83 lines • 2.22 kB
TypeScript
import type { Editor, Extensions, Content } from '@tiptap/core';
export interface BlockEditorProps {
blockId?: string;
content?: Content;
editable?: boolean;
frameless?: boolean;
placeholder?: string;
extensions?: Extensions;
onContentChange?: (event: BlockContentChangeEvent) => void;
onBlockFocus?: (blockId: string) => void;
onBlockBlur?: (blockId: string) => void;
onBlockLink?: (event: BlockLinkEvent) => void;
onBlockTransclude?: (event: BlockTranscludeEvent) => void;
onSemanticTag?: (event: SemanticTagEvent) => void;
customExtensions?: Extensions;
draggable?: boolean;
class?: string;
style?: string;
[key: string]: any;
}
export interface BlockContentChangeEvent {
blockId: string;
content: string;
html: string;
json: any;
editor: Editor;
}
export interface BlockLinkEvent {
sourceBlockId: string;
targetBlockId: string;
linkText?: string;
editor: Editor;
}
export interface BlockTranscludeEvent {
sourceBlockId: string;
targetBlockId: string;
editor: Editor;
}
export interface SemanticTagEvent {
blockId: string;
concepts: string[];
editor: Editor;
}
export interface BlockData {
id: string;
content: Content;
metadata?: {
tags?: string[];
links?: string[];
transclusions?: string[];
created?: Date;
modified?: Date;
};
}
export interface BlockLinkOptions {
HTMLAttributes: Record<string, any>;
openOnClick: boolean;
linkOnPaste: boolean;
autolink: boolean;
}
export interface BlockTransclusionOptions {
HTMLAttributes: Record<string, any>;
renderTransclusion: (blockId: string) => Promise<string>;
}
export interface SemanticTagOptions {
HTMLAttributes: Record<string, any>;
tagSuggestions: (query: string) => Promise<string[]>;
onTagAdded: (tag: string, blockId: string) => void;
}
export interface BlockLinkAttrs {
blockId: string;
linkText?: string;
href?: string;
}
export interface BlockTransclusionAttrs {
blockId: string;
preview?: boolean;
}
export interface SemanticTagAttrs {
concept: string;
confidence?: number;
}
//# sourceMappingURL=types.d.ts.map