Class TJSContentEdit
Hierarchy
- SvelteComponent<TJSContentEdit.Props, TJSContentEdit.Events, TJSContentEdit.Slots>
- TJSContentEdit (view full)
Index
Constructors
Methods
Constructors
constructor
- new TJSContent
Edit (options): TJSContentEdit Parameters
- options: ComponentConstructorOptions<TJSContentEdit.Props>
Returns TJSContentEdit
Methods
$destroy
$on
- $on<K>(type, callback): (() => void)
Type Parameters
Parameters
- type: K
- callback: ((e: TJSContentEdit.Events[K]) => void)
- (e): void
Parameters
- e: TJSContentEdit.Events[K]
Returns void
Returns (() => void)
- (): void
Returns void
$set
- $set(props): void
Parameters
- props: Partial<TJSContentEdit.Props>
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 tocontent
from a parent component to get reactive updates whencontent
changes. Two-way binding.enrichedContent
- Provides the enriched content via TextEditor.enrichHTML whencontent
changes. You can bind toenrichedContent
from a parent component to get reactive updates though it is not recommended to changeenrichedContent
externally. 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: