livelike-chat

Properties

Property Attribute Type Default Description
avatarurl avatarurl null null Message avatar url
hidecomposer hidecomposer boolean false Show / hide the livelike-chat-composer
lang lang string "en-US" Language code of chat element
loaded boolean false If the element has loaded
reactionPack array The array of reactions
messageList array The array of chat messages
messagemenus messagemenus boolean false Show / hide the chat message menus
placeholder placeholder string "Add to the conversation" The placeholder of the chat input
roomid roomid string null Room Id of the chat room to load
showavatar showavatar boolean false Show / hide user profile message avatar
syncStrategy object null Custom syncStrategy for Spoiler Prevention
timestamps timestamps boolean false Show / hide message timestamps
timeformat timeformat object Object containing time formatting properties

Methods

Method Type Description
addMessageReaction ({messageId: string, reactionId: string}): Promise<void> Add reaction to message
removeMessageReaction ({messageId: string, reactionId: string}): Promise<void> Remove existing reaction from message

livelike-description

Renders option/choice description property. Can be overriden by setting description property.

Attributes

Attribute
correct
disabled
incorrect
selected

Properties

Property Attribute Type Default
choice object
correct correct boolean
description string
disabled disabled boolean
incorrect incorrect boolean
option object
selected selected boolean

Slots

Name Description
Default slot

livelike-dismiss-button

Renders a button that fires dissmiss-clicked event when clicked.

Properties

Property Attribute Type Default
disabled disabled boolean
dismissClicked () => CustomEvent<Object>

Events

Event Description
dismiss-clicked Renders a button that fires dissmiss-clicked event when clicked.

livelike-image

Renders an option/choice image_url. Can be overridden by setting src property.

Attributes

Attribute
correct
disabled
incorrect
selected

Properties

Property Attribute Type Default
alt alt string
choice object
correct correct boolean
disabled disabled boolean
height height string
incorrect incorrect boolean
option object
selected selected boolean
src src string
width width string

Slots

Name Description
Default slot

livelike-load-more-button

Can either be added as a child of livelike-widgets or added with a for attribute that matches a livelike-widgets id attribute. On click loads the next page of widgets and attaches them to livelike-widgets

Properties

Property Attribute Type Default
loaded boolean true

Methods

Method Type
loadPage (): void

Slots

Name Description
Default slot

livelike-option

Instantiated with option or choice object from widgetPayload options or choices array. On click, fires 'option-clicked' event.

Attributes

Attribute
correct
disabled
incorrect
selected

Properties

Property Attribute Type Default
choice object
correct correct boolen
disabled disabled boolean
incorrect incorrect boolean
option object
selected selected boolean

Events

Event Description
option-clicked

livelike-percentage

Child of livelike-option element. Calculates and renders vote count percentage

Attributes

Attribute
correct
disabled
incorrect
selected

Properties

Property Attribute Type Default Description
choice object
correct correct boolean
disabled disabled boolean
incorrect incorrect boolean
option object
selected selected boolean
value value number The value of the vote percentage

livelike-progress

Renders progress bar with width of vote percentage by default

Attributes

Attribute
correct
disabled
incorrect
selected

Properties

Property Attribute Type Default Description
choice object
correct correct boolean
disabled disabled boolean
incorrect incorrect boolean
option object
selected selected boolean
value value number The value of the vote percentage

livelike-select

Takes a template element as a child, and renders the template's children as a list of elements, one element per object in wigetPayload's options/choices property.

Attributes

Attribute
disabled

Properties

Property Attribute Type Default
choices array
disabled disabled boolean
options array

Slots

Name Description
Default slot

livelike-timer

Attributes

Attribute
disabled

Properties

Property Attribute Type Default Description
disabled disabled boolean
time time number Time duration in ms

livelike-title

Renders the widget's title or question property by default. Can override by setting title property.

Attributes

Attribute
disabled

Properties

Property Attribute Type Default
disabled disabled boolean
title title string

Slots

Name Description
Default slot

livelike-widget-body

Attributes

Attribute
disabled

Properties

Property Attribute Type Default
disabled disabled boolean

Slots

Name Description
Default slot

livelike-widget-footer

Attributes

Attribute
disabled

Properties

Property Attribute Type Default
disabled disabled boolean

livelike-widget-header

Attributes

Attribute
disabled

Properties

Property Attribute Type Default
disabled disabled boolean

Slots

Name Description
dismiss Slot for dismiss button element
title Slot for title element
Default slot

livelike-widget-root

Attributes

Attribute
disabled

Properties

Property Attribute Type Default
disabled disabled boolean

Slots

Name Description
header Slot for header container element
timer Slot for timer element
body Slot for body element
Default slot

livelike-widgets

Properties

Property Attribute Type Default Description
authors authors boolean false Enables widget author tag in timeline mode
customTemplateRenderer ({widgetPayload}) => HTMLTemplateElement Creates custom widget based on returned template element
lang lang string "en-US" Sets language code
loaded boolean false If the element has loaded
mode mode string "pop-up" The mode of the element set through regsiterWidgetMode
programid programid string null The id of the program to load
reactions reactions boolean false Show / hide reactions when not in 'ready' or 'interactive' phase
syncStrategy object null Custom syncStrategy for Spoiler Prevention
timestamps timestamps boolean false Show / hide widget timestamp in timeline mode
timeformat timeformat object Object containing time formatting properties

Methods

Method Type Description
attach (widgetEl: HTMLElement) => Promise<void> Attaches widget element to DOM
createSyncWidget ({id: string, kind: string}) => Promise<void> Creates widget from widget id and kind. Calls enqueueWidget
createWidgetElement ({id: string, kind: string}) => Promise<unknown> Creates and immediately displays widget
detach (widgetEl: HTMLElement) => Promise<void> Detaches widget element to DOM
enqueueWidget ({widgetPayload: Object}) => void Displays widget according to syncStrategy for Spoiler prevention
showWidget ({widgetPayload: Object}) => Promise<unknown> Immediately begins widget lifecycle and state transitions
registerWidgetMode (name: string, mode: ({widgetPayload})=> unknown) => void Registers widget lifecycle mode to be used as mode attribute