EntitiesOption
type EntitiesOption = { onClick?: (entity: Entity) => void; onRequestPreview?: (entity: Entity) => Promise<{ preview: BasicRoot | null; }>; onTagSearch?: (query: string) => Promise<Entity[]>; showComposerMenu?: boolean;};Properties
Section titled “Properties”onClick()?
Section titled “onClick()?”optional onClick: (entity: Entity) => void;Called when a rendered entity is clicked.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”void
onRequestPreview()?
Section titled “onRequestPreview()?”optional onRequestPreview: (entity: Entity) => Promise<{ preview: | BasicRoot | null;}>;Use the Widget Studio (https://widget-studio.vercel.app/) to design previews and copy the generated JSON into your integration.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”Promise<{
preview: | BasicRoot
| null;
}>
onTagSearch()?
Section titled “onTagSearch()?”optional onTagSearch: (query: string) => Promise<Entity[]>;Returns a list of entities for the input query. Powers tag autocomplete within the composer.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”Promise<Entity[]>
showComposerMenu?
Section titled “showComposerMenu?”optional showComposerMenu: boolean;Whether to render a composer button that inserts ”@” into the textarea and triggers a tag search on click. Only renders when EntitiesOption.onTagSearch is provided.
Default
Section titled “Default”false;