- NPM repo now contains missing theme source files, and not just theme build files
- Marks npm repo as public rather than private
- Restructures npm repo for more direct access to components and themes
- The MIME Type Attribute
node-id
is no longer used in Message parts. As a result, all Message Response Integrations will need to be redeployed/updated. - Mixin Names for customizing
<layer-message-item-sent />
<layer-message-item-received />
and<layer-message-item-status />
have changed:messageRowHeader
has been replaced withmessageSentHeader
: Header for messages sent by the current usermessageReceivedHeader
: Header for messages received by the current usermessageStatusHeader
: Header for status messages
messageRowFooter
has been replaced withmessageSentFooter
: Footer for messages sent by the current usermessageReceivedFooter
: Footer for messages received by the current usermessageStatusFooter
: Header for status messages
messageRowRight
has been replaced withmessageSentRight
: Customize area to the right of the messages sent by the current usermessageReceivedRight
: Customize area to the right of the messages received by the current usermessageStatusRight
: Customize area to the right of the status messages
messageRowLeft
has been replaced withmessageSentLeft
: Customize area to the left of the messages sent by the current usermessageReceivedLeft
: Customize area to the left of the messages received by the current usermessageStatusLeft
: Customize area to the left of the status messages
- Furthermore, Layer.UI.UIUtils.ReplacableSnippets has been added with simple strings that can be used as standard values for the above Replaceable Content fields
- API Reference is now published at https://preview-docs.layer.com/xdk/webxdk/introduction
<layer-status-message />
can now be configured with properties without having to completely rewrite theonRender
method for each customization- UI Component Lifecycle Changes:
onRerender()
is always called afteronRender()
, any calls you make to it fromonRender()
methods are now redundant- Root implementations of UI Component lifecycle methods are no longer blocked via
registerComponent.MODES.OVERWRITE
message.parts
is now represented as Set rather than an Array. To simplify working with the javascript Set object,Layer.Core.Message
provides the following methods:filterParts
: Standard filter returns an array of matching partsmapParts
: Standard map returns an array from the setfindPart
: Finds a single part matching the callbackgetRootPart
: Returns the Root Message Part (main part)getPartsMatchingAttribute
: Searches parts for one with the specified MIME Type attributes
- Response Messages now contain only a Status Message Type Model, and no longer can contain a Text Message Type Model
- Image Message sizing is tweaked
- Image Messages now use
<img />
not<canvas />
- Using
npm
toimport
no longer imports all Message Type Models, nor all UI Components. Import only those UI Components you require (they will import their dependencies). Example:import '@layerhq/web-xdk/ui/adapters/react';
import '@layerhq/web-xdk/ui/messages/status/layer-status-message-view';
import '@layerhq/web-xdk/ui/messages/receipt/layer-receipt-message-view';
import '@layerhq/web-xdk/ui/components/layer-avatar';
- Using Persistence requires you to import the db-manager:
import '@layerhq/web-xdk/core/db-manager';
- Adds
multiple
property to FileUploadWidget - Message Type Model now has a
getParticipantResponse()
method for extracting participant responses to a Model. - Adds
message.createModel()
to get the Message Type Model representing theLayer.Core.Message
instance - Adds
part.createModel()
to get the Message Type Model representing theLayer.Core.MessagePart
instance - Adds
message.getRootPart()
to get the root MessagePart for the Message - Adds
model.getParentModel()
to get the Parent Model of the current Model (ornull
if its already the root model)
- Fixes bug in rendering of a carousel of images when generated by FileUploadWidget
Layer.Core.Query.ConversationQuery
renamed toLayer.Core.Query.ConversationsQuery
Layer.Core.Query.ConversationQuery
and other queries can now be explicitly accessed to modify theMaxPageSize
static property- Renamed ReceiptModel property
shippingAddressModel
=>shippingAddress
andbillingAddressModel
=>billingAddress
- Renamed:
<layer-standard-display-container />
to<layer-standard-message-view-container />
<layer-titled-display-container />
to<layer-titled-message-view-container />
- All Message Types are renamed with the following pattern:
<layer-xxx-view />
to<layer-xxx-message-view />
- Removed support for putting a
selectedAnswer
in the constructor for a Choice Model. Instead use thepreselectedChoice
property.
- Registered Message Action handlers are no longer called with
<layer-message-viewer />
as context, and instead receive inputs of({data, model, rootModel, messageViewer})
where model and rootModel represent the model the event was triggered upon and any root Message Model (Carousel for example) that contains the model. - Triggering an action now first triggers a DOM level event with the name of the action. A call to
evt.preventDefault()
will prevent the Registered Message Action Handler from being called, and will let your event handler alone handle it. layer-send-message
event now passes a Layer.Core.MessageTypeModel instead of an array of Layer.Core.MessagePart objects<layer-compose-bar />
has updated its public API around creating/sending messages. Most apps should not be using this, but handy for custom widgets being embedded into the Compose Bar.<layer-file-upload-button />
events have all been redefined<layer-conversation-view />
onSendMessage
andlayer-send-message
event properties have changed, Message is no longer a property of this event, insteadmodel
is provided, andmodel.message
can be used if Message access is required.autoFocusConversation
now takes Contstants rather than Strings as inputs
layer-composer-change-value
andonComposerChangeValue
events are nowlayer-compose-bar-change-event
andonComposeBarChangeValue
;evt.detail.value
is nowevt.detail.newValue
deleteConversationEnabled
has been removed from<layer-conversation-list />
and<layer-conversation-item />
<layer-conversation-list />
sortBy
property now requires values ofLayer.UI.Constants.CONVERSATIONS_SORT.LAST_MESSAGE
orLayer.UI.Constants.CONVERSATIONS_SORT.CREATED_AT
; prior values are no longer valid<layer-identity-item />
propertyselected
renamed toisSelected
- Choice Model now has a
selectedChoice
property (Readonly, single-select only) to get the Choice object that is currently selected - Message Type Models no longer emit a
change
event, and now intsead emit amessage-type-model:change
event. - Message Type Models now emit a
message-type-model:customization
event to allow for customization of behaviors - Layer.Core.LayerEvent (i.e. any event triggered by non-UI-components) now supports
evt.preventDefault()
: Can be called on any event whereevt.cancelable
istrue
to prevent a default behavior (very few uses of this at the moment)evt.returnValue()
: Can be called on any event that is providing an opportunity for you to provide an alternate value for it to use. Currently used by somemessage-type-model:customization
events
- Layer.UI.Menu
options
property is now anitems
property - CSS Class
layer-root-card
renamed tolayer-root-viewer
- Twemoji emojis can be disabled using
Layer.init({useEmojiImages: false})
- List Item no longer provide an
addClass
removeClass
andtoggleClass
method (toggleClass
is now a part of all UI Components) Layer.UI.registerMessageComponent
is removed, useLayer.UI.registerComponent
followed byLayer.UI.handlers.message.register
instead. Note that use of this technique is deprecated.Layer.UI.registerMessageHandlers
moved toLayer.UI.handlers.message.register
Layer.UI.registerTextHandler
moved toLayer.UI.handlers.text.register
Layer.UI.isInBackground
moved toLayer.UI.Utils.isInBackground
Layer.UI.showFullScreen
moved toLayer.UI.Utils.showFullScreen
Layer.UI.createItemSeparator
moved toLayer.UI.UIUtils.createItemSeparator
Layer.UI.addAdapter
moved toLayer.UI.adapters.register
Layer.UI.registerMessageActionHandler
moved toLayer.UI.MessageActions.register
Layer.Core.Message.getText()
is removed<layer-message-viewer />
setupMessage()
method is now_setupMessage()
Layer.Util
moved toLayer.Utils
; folder paths similarly changed.Layer.UI.animatedScrollTo
andLayer.UI.animatedScrollLeftTo
moved toLayer.UI.UIUtils
- Everything in
Layer.UI.utils
renamed toLayer.UI.UIUtils
Layer.UI.UIUtils.registerStatusModel(ModelClass)
is now used to register a Message as a Status Message rather thanLayer.UI.statusMimeTypes.push(mimeType)
Layer.Core.MessageTypeModel
now has agetModelsByRole
method, and no longergetModelsForPart
andgetModelForPart
methodsLayer.Core.MessageTypeModel
now has achildModels
property with all Child Models initialized automatically.Layer.Core.Identity.sessionOwner
has been renamed toLayer.Core.Identity.isMine
. Most common use of this:message.sender.isMine
tells you if the sender of the message is the user of this client.<layer-choice-button />
and<layer-choice-message-view />
both provideonChoiceSelect
which lets Mixins customize selection behavior
- Fixes handling of react adaptor on receiving empty values
- Adds a Feedback Message Type
- Adds an Expanded Message Viewer/dialog
- Adds better test for Message Part to see if its < 2KB
- Adds a destroy method to all UI Components that can be called to destroy a Components
<layer-conversation-view />
Now has alayer-conversation-panel-change
event- Adds sample app code for making app fit and titles/composer not slide out of view
- General Cleanup
- Fixes bug in Message Grouping where Status Messages are treated as part of the grouping
- Adds a
filter
callback toLayer.Core.Query
and aqueryFilter
property to theConversationView
:
render() {
return <ConversationView
queryFilter={(message) => return isAcceptableMessage(message)} />
}
- Adds Message Tests for all message types
- Adds
customResponseData
per choice item for the Choice Model (experimental/risky feature)
- Adds
Layer.UI.statusMimeTypes.push(MyCustomModel.MIMEType)
as the way to register a Message Type to be rendered as a Status Message instead of a Sent or Received Message.
- Adds
<layer-conversation-item-date />
added to simplify Conversation Item Date customizations
- Adds
enabledFor
to Choice Model - Some refactoring of enabled detection for Choice Models
- Adds CSS class name
layer-message-item-${Message View Class Name}
to the<layer-message-item-sent />
,<layer-message-item-received />
and<layer-message-item-status />
elements;layer-message-item-layer-text-view
- Adds a Status Message Type
- Adds a
Layer.UI.statusMimeTypes
array of mime types that are treated as Status Messages
- Test Framework
- Bug fixes
- React Sample App
- Fixes
nodeId
property which was missing from the prototype, and breaking attempts to setparentNodeId
- Updates React adapter's getInitialProps method to work with new class definitions
- Updates reauthentication to not reauthenticate based on no-longer-used session tokens
- Fixes error in static client property
QUERIED_CACHE_PURGE_INTERVAL
which should have beenCACHE_PURGE_INTERVAL
, causing new messages to be instantly destroyed
- Updates React adapter for React 16
- Removes old nodejs support code; runs in browser only for now
- Fixes package.json
main
- Fixes folder references
- Prerelease of the Web XDK merges the WebSDK and Layer UI for Web into a single project and evolves the concept of Messaging Experiences beyond slapping a message onto a page.