✨ (embed) Add new command setInputValue
This commit is contained in:
@@ -8,6 +8,7 @@ export type CommandData = {
|
||||
}
|
||||
| ShowMessageCommandData
|
||||
| SetPrefilledVariablesCommandData
|
||||
| SetInputValueCommandData
|
||||
)
|
||||
|
||||
export type ShowMessageCommandData = {
|
||||
@@ -19,3 +20,8 @@ export type SetPrefilledVariablesCommandData = {
|
||||
command: 'setPrefilledVariables'
|
||||
variables: Record<string, string | number | boolean>
|
||||
}
|
||||
|
||||
export type SetInputValueCommandData = {
|
||||
command: 'setInputValue'
|
||||
value: string
|
||||
}
|
||||
|
||||
@@ -4,3 +4,4 @@ export * from './open'
|
||||
export * from './setPrefilledVariables'
|
||||
export * from './showPreviewMessage'
|
||||
export * from './toggle'
|
||||
export * from './setInputValue'
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { CommandData } from '../types'
|
||||
|
||||
export const setInputValue = (value: string) => {
|
||||
const message: CommandData = {
|
||||
isFromTypebot: true,
|
||||
command: 'setInputValue',
|
||||
value,
|
||||
}
|
||||
window.postMessage(message)
|
||||
}
|
||||
Reference in New Issue
Block a user