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

Create a new element `dialog` #279

Closed symphony-elias closed 3 years ago

symphony-elias commented 3 years ago

Tag Name dialog

MessageML

Attribute name Optional Type Max length Attribute description
id false String default Unique ID of the Dialog. The ID value must: not contain any space characters; not be empty; be compliant with the syntax defined by the W3C: https://www.w3.org/TR/2011/WD-html5-20110525/elements.html#the-id-attribute
width true, default value: medium String default Value must be among: small, medium, large, full-width
state true, default value: close String default Value must be among: open, close

Accepted children tags

A dialog cannot have any other child tag/ All permissible child tags do not have any attribute and can contain any non-interactive fields (except dialog and form)

PresentationML

Attribute name Optional Type Max length Attribute description
id false String default Unique ID of the Dialog. The ID value must: not contain any space characters; not be empty; be compliant with the syntax defined by the W3C: https://www.w3.org/TR/2011/WD-html5-20110525/elements.html#the-id-attribute
width true, default value: medium String default Value must be among: small, medium, large, full-width
state true, default value: close String default Value must be among: open, close

MML / PML conversion

Examples

MessageML

<!-- MessageML -->
<messageML>   
  <dialog id="dialog-id" width="small" state="open">
    <title>
      <h2>A title</h2>
    </title>
    <body>Some text </body>
    <footer>Some footer</footer>
  </dialog>
</messageML>

PresentationML

<!-- PresentationML -->
<div data-format="PresentationML" data-version="2.0"> 
  <dialog open id="akcyz784-dialog-id" data-width="small" data-state="open">
    <div class="dialog-title">
      <h2>A title</h2>
    </div>
    <div class="dialog-body">Some text</div>
    <div class="dialog-footer">Some footer</div>
  </dialog>
</div>