Track changes target format for Wax 2
@christos is working on the next version of the Wax editor for Editoria, and it will include some changes to the way certain elements are coded. We had laid out the current format of TCs in #162 (closed); going forward, this issue will serve as the reference for the expected target format.
Rather than using a <track-change>
element, track changes will be a <span>
tag with a class describing the specific type of change:
<span class="insertion">
<span class="deletion">
<span class="format-change">
Track change elements will have the following attributes:
-
data-id
: A unique identifier string. There is no specific requirement for the format, just that something's passed in. -
data-user
: A unique identifier string for the user. There is no specific format required, but something does need to be passed in. Down the line, this is going to change todata-userid
. -
data-username
: When changes are made within the editor, this will be the user's username. We won't have access to usernames since we're coming from Word, so pass in the author name as-is. -
data-date
: the date of the change, in the format ____ -
data-group
: what part of the content the change happened in. Either "main" or else "____"
For formatting track changes, these two additional attributes will apply:
-
data-before
: The format before the change. As a starting point, there is no need to pass in anything here and it's fine to omit the tag altogether. -
data-after
: The formatting change that has been made. More important than thedata-before
attribute.
If data-id
and data-group
are both omitted, then the right-hand side track change pane won't show the change (see attached screenshot), and the change will only appear inline. This would be fine as a starting point.
Example:
<p class="paragraph">
<strong>
<span class="format-change"
data-id="9b863ae5-a1ba-4714-93e9-3674b3ef3edf"
data-user="1234"
data-username="demo"
data-date="5316364"
data-before="[]"
data-after="["strong"]"
data-group="main">
this
</span>
</strong>
is a paragraph.
</p>
@christos, here are some questions I have:
- Is this correct, that TCs will be a
<span>
rather than a<p>
tag? - What format does the date need to be in?
- What are the possible values for
data-group
?main
and what? Do we need to include this in what we pass in? - Can I get a check about when the side callout won't be available? Are the two relevant fields
data-id
anddata-group
? Do both need to be missing before the side callout won't show up, or just one? If I'm wrong, can you correct what I wrote above by the screenshot? - We're going to have the
data-before
data. Is there any reason not to include it if we already have it?