s-m-r-t
Open the s-m-r-t source on GitHub Switch to dark color scheme
← All UI components

Content · Components

ContentEditor

No summary has been written for ContentEditor. Everything below is generated from the declaration shipped in 0.57.40 and describes the real contract.

Public export

typescript
import { ContentEditor } from '@happyvertical/smrt-content/svelte';
Import path
@happyvertical/smrt-content/svelte
Props
18
Props described
18 of 18
Bindable state
0
Callback events
5
Verified release
0.57.40

Props

NameTypeRequiredDescription
apiBaseUrlstringNoBase URL for API requests to load and save content.
contentContentData | nullNoThe content object being edited, or null for new content.
contentIdstringNoIdentifier of the content, or 'new' if creating.
factAuditFactAuditStateData | nullNoCurrent fact audit state including claims and their support status.
saveDisabledbooleanNoDisable the save button and submission.
saveNoticestring | nullNoMessage displayed below the save button.
agentChatEnabledbooleanNoEnable the AI chat sidebar and assistant features.
agentChatNoticestring | nullNoMessage displayed to explain why AI chat is unavailable.
hideActionsbooleanNoHide the save and cancel action buttons.
hideChatbooleanNoHide the AI chat sidebar completely.
showBodyFormatPickerbooleanNoShow the body editor's "Save as" HTML/Markdown picker. Off by default: the storage format is a technical choice most editors should not face.
assistantFieldAllowListContentEditorAssistantFieldUpdateAllowListNoPolicy object defining which fields the assistant can modify.
onAssistantContextChangeContentEditorAssistantContextChangeNoFired when the assistant context changes (for session tracking).
onChange(data: ContentEditorSnapshot) => voidNoFired when the user edits content, with the current editor snapshot.
onFactAuditChange(state: FactAuditStateData | null) => voidNoFired when the fact audit state changes or is loaded.
onSave(data: ContentEditorSavePayload) => voidYesFired when the user submits the editor with the saved payload.
onCancel() => voidYesFired when the user cancels editing without saving.
modeContentFieldModeNo`full` (default) shows every field. `simple` is for everyday editors: Type, State and References are hidden, Metadata becomes a collapsed "Details" section, and optional fields say so.

Bindable state

This component has no bindable public state.

Callback events

  • onAssistantContextChangeContentEditorAssistantContextChange
  • onChange(data: ContentEditorSnapshot) => void
  • onFactAuditChange(state: FactAuditStateData | null) => void
  • onSave(data: ContentEditorSavePayload) => void
  • onCancel() => void

Examples and explanation