Class TJSTinyMCE
Hierarchy
- SvelteComponent<TJSTinyMCE.Props, TJSTinyMCE.Events, TJSTinyMCE.Slots>
- TJSTinyMCE (view full)
Index
Constructors
Methods
Constructors
constructor
- new TJSTinyMCE(options): TJSTinyMCE
Parameters
- options: ComponentConstructorOptions<TJSTinyMCE.Props>
Returns TJSTinyMCE
Methods
$destroy
$on
- $on<K>(type, callback): (() => void)
Type Parameters
Parameters
- type: K
- callback: ((e: TJSTinyMCE.Events[K]) => void)
- (e): void
Parameters
- e: TJSTinyMCE.Events[K]
Returns void
Returns (() => void)
- (): void
Returns void
$set
- $set(props): void
Parameters
- props: Partial<TJSTinyMCE.Props>
Returns void
Provides a reactive wrapper for Foundry TinyMCE editor support. 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 and passed on to the Foundry TinyMCE support. Please review all the options defined below TJSTinyMCEOptions.Notable options passed onto TinyMCE instance:
options.mceConfig
- [object] TinyMCE configuration object.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: