finos / messageml-utils

MessageML is a markup language used by the Symphony Agent API for representing messages, including formatting (bold, italic, numbered and unnumbered lists etc.) and entity data representing structured objects.
https://docs.developers.symphony.com
Apache License 2.0
12 stars 28 forks source link

Adding new UIAction tag in MessageML #261

Closed symphony-mariacristina closed 3 years ago

symphony-mariacristina commented 3 years ago

Tag

The UIAction will be represented by the following tag <ui-action>.

MessageML Attributes

Attribute Type Optional Default Description
trigger click true click The trigger of the action, For now only click is supported.
action open-im false   The action to be executed on trigger For now the only possible value is going to be open-im. The possible values may grow in the future.

Open chat action attributes

Attribute Type Optional Maxlength Default Description
user-ids int [] exclusive with streamId 15 - Creates a new mim with the provided userIds
stream-id string exclusive with userIds   - Opens if found the streamId be it IM/MIM/ROOM
side-by-side boolean true   true If set to false the current chat will be replaced by the new one, by default open in a new chat module and keeps the parent one open side by side

Note : for now UIAction can only have UIAction or button as a child

PresentationML Attributes

Attribute Optional
data-trigger false
data-action false

The rest of attributes will be present by convention as data-attributename validated MML level depending on the selected action.

Example

MessageML

<ui-action trigger="click" action="open-im" stream-id="UUzhhBMMC+PTHBj0SuoQrn///onSQszYdA==">
  <button>Open by stream ID</button>
</ui-action>

PresentationML

<div class="ui-action" data-trigger="click" data-action="open-im" data-stream id="UUzhhBMMC+PTHBj0SuoQrn///onSQszYdA==">
  <button>Open by stream ID</button>
</div>