Class TJSContentEdit
Hierarchy
- SvelteComponent<
TJSContentEdit.Props,
TJSContentEdit.Events,
TJSContentEdit.Slots,
>- TJSContentEdit (View Summary)
Indexable
- [prop: string]: any
Index
Constructors
Methods
Constructors
constructor
Parameters
- options: ComponentConstructorOptions<TJSContentEdit.Props>
Returns TJSContentEdit
Methods
$destroy
Returns void
$on
Type Parameters
- K extends string
Parameters
- type: K
- callback: (e: TJSContentEdit.Events[K]) => void
Returns () => void
Provides a reactive wrapper for direct content editable elements. Allows editing Foundry document data or directly from content prop. Automatic HTML enrichment occurs for the content when saved.
Props
There are no required props, but the following are available to set:
content- Provides an initial content string; you can bind tocontentfrom a parent component to get reactive updates whencontentchanges. Two-way binding.enrichedContent- Provides the enriched content via TextEditor.enrichHTML whencontentchanges. You can bind toenrichedContentfrom a parent component to get reactive updates though it is not recommended to changeenrichedContentexternally. One-way binding.options- Defines the options object for this component. Please review all the options defined below TJSContentEditOptions.Events
There are five events fired when the editor is canceled, saved, and started:
editor:cancel- Fired when editing is canceled by a user action or reactive response to document changes.editor:document:deleted- Fired when the edited document is deleted. Access the document fromevent.detail.document.editor:enrichedContent- Fired when content is enriched. Access enriched content fromevent.detail.enrichedContent.editor:save- Fired when editing is saved. Access the content fromevent.detail.content.editor:start- Fired when editing is started.CSS Variables
The following CSS variables control the associated styles with the default values: