Open ecureuill opened 4 years ago
@juantenesaca this in progress, but with you desire you can start on the first section
Ok, firstly I am fixing the navigation buttons.
This Feature is ready to be implemented.
This feature have been implemented and is ready for Funcional Test. Please, test the feature.
:warning: Wire-frames and live-demos are just for example purpose. They don't meet entirely this requirement.
:pencil2: Pencil icon marks specs that are waiting for definition
As the text editor is used by students and teachers, it's important to create an accessible widget.
Also, as the content created in this widget is going to be accessed by students, it's important to deliver an accessible content
Suggested framework: http://draftjs.org
Table Of Content
General
Widget
Text editor widget is composed by
Toolbar component
role=toolbar
aria-label
provide a label that identifies the purpose ( meet #136 #16 )Toggle buttons
role=button
aria-pressed=true|false
: when the the text editor cursor is positioned in a word, thearia-pressed
state should be determined for each button, For instance, in a paragraph with the text "Hello, world!" if cursor is positioned betweenw
ando
the buttons [Paragraph] and [B] should be set toaria-pressed=true
and remaining buttons asaria-pressed=false
1.Label and Accessible Namearia-pressed
state: when the the text editor cursor is positioned in a word, buttons should present with a visual indication of its state related to the word.role="image"
in font icon (meet #76 )<span class="icon icon-star-bg" role="img" aria-label="Favorite"></span>
Text area
1.Label and Accessible Name
<label for=
oraria-labelledby
aria-label
oraria-labelledby
Dialogs
role="dialog"
aria-modal=true
aria-describedby=
Form
role="image"
in font icon (meet #76 )<span class="icon icon-star-bg" role="img" aria-label="Favorite"></span>
1.Label and Accessible Name<label for=
oraria-labelledby
; AND/ORaria-label
For customs components
role=
Text Editor features
For each block of text, user can apply one block type. Nesting block types can nest one or more block types. For each character, word or phrase, user can apply one or more text-level types.
The accessibility of the content depends on the correct use of this features. User has the responsibility to use the correct markup and system has the responsibility to instruction and help user.
Block types
Those types identifies the purpose or structure of the content.
General rules Block types. Some block type has specific rules, if none is cited in it respective section, just follow this general rule.
[ ] When user press Enter, a new block of the current block type will be created.
[ ] Given two lines of different block type, Line 1 and Line 2. When user press Return or Del causing that the content of Line 2, is moved to Line 1 and thus only Line 1 exist now and it keeps the same block type
When user toggle a block type button
Example for DEACTIVATE and SWITCH scenarios![image](https://user-images.githubusercontent.com/993369/80848935-797c8300-8beb-11ea-9788-525cedfb7bfb.png)
When user toggle a HEADER block type button
If cursor is in Use Case - components and there is no text selected, the Header block is switched to Paragraph block
If cursor is in Use Case - components and "Case" is selected. the selection is switched to Paragraph block
If cursor is in Video/Audio device line and no text is selected, entire line is switched to Header block
If cursor is in Video/Audio device line Device is selected, only the selected text is switched for Header block
If the selection is of multiple block type contents. For instance "Components" till "Notification"
Paragraph
Represents a paragraph.
Headers
Represents introductory content, a heading section.
Note: the top-level header must be defined taking in account the page where it's going to be rendered. For instance, in Authoring Tool, it's probably a
h3
becauseh1
is reserved to be used with the "topic name" andh2
for the "table of content"<h4>
, then the levels<h2>
and<h3>
should not be provided to user.Preformatted (:question: better name?)
Represents a block of preformatted tex content, in which structure is represented by typographic conventions rather than by elements.
For instance, some contemporary poem with meaningful/unusual whitespace.
Ordered List
Represents an ordered list of items, rendered as a numbered list.
Unordered List
Represents an unordered list of items, rendered as a bulleted list. In ordered list, the order of elements is mealiness
Description List
Represents a description list. The element encloses a list of groups of terms (specified using the
<dt>
element) and descriptions (provided by<dd>
elements). Meets #122Example of key-value
Description List dialog
<input type='text'>
<3input type='text'>
For each TERM field Component:
<select>
Its value must be a valid BCP 47 language tagFor each DEFINITION field Component:
<select>
Its value must be a valid BCP 47 language tagFor each TERM field Component:
<button>
Component:
<button>
Component:
<button>
Component:
<button>
Component:
<button>
<input type='submit'>
<button>
Nest-Block types
Nest-block types can nest one or more block types.
Blockquote
Indicates that the enclosed text is an extended quotation.
When creating or editing a blockquote
cite=
attribute should be inserted<footer>
tag should be inserted<footer>[AUTHOR]</footer>
<footer><cite>[TITLE OF DOCUMENT]</cite></footer>
When editing in Text Area
<footer>...</footer>
must be removedExample of move the AUTHOR and TITLE OF DOCUMENT
Example of new lines
Example of new Paragraph block (cursor between AUTHOR and comma)
Example of new Paragraph block (cursor at end of AUTHOR's line)
Blockquote dialog
<input type='url'>
<input type='text'>
<input type='text'>
<input type='submit'>
<button>
Caption
Represents self-contained content with an caption. The self-contained could be diagram, code snippet, poems, etc. The caption could be inserted above or bellow the content.
Example of a Caption added to a Blokquote content
Example of a Caption deactivated
Example of move the CAPTION
Caption dialog
<input type='text'>
<input type='radio'>
<input type='submit'>
<button>
Inline-Semantics types
Define the meaning, structure, or style of a word, line, or any arbitrary piece of text. This types can be applied to any Block type content. meets #76 #136
Strong
Indicates that its contents have strong importance, seriousness, or urgency. Browsers typically render the contents in bold type.
Emphasis
Set content that have a Stressed emphasis
Mark
Set content marked or highlighted for reference or notation purposes
Abbreviation
Set content as an abbreviation or acronym meets #123
Edition on Text Area
Abbreviation dialog
<input type='text'>
<input type='text'>
<input type='submit'>
<button>
<button>
Definition
Used to indicate the term being defined within the context of a definition phrase or sentence. meets #122
When user toggle the Definition button and cursor is in an active Abbreviation
When user toggle the Definition button and cursor is not in an active Abbreviation
Abbreviation deactivated
<input type='text'>
<input type='text'>
<input type='submit'>
<button>
<button>
Quote
A short inline quotation. This element is intended for short quotations that don't require paragraph breaks; for long quotations should use the Blockquote.
Content inside a q element must be quoted from another source, whose address, if it has one, may be cited in the cite attribute. The source may be fictional, as when quoting characters in a novel or screenplay.
Quote dialog
<input type='text'>
<input type='url'>
<input type='submit'>
<button>
<button>
Cite
Describe a reference to a cited creative work, and must include the title of that work. This can be a work that is being quoted or referenced in detail (i.e. a citation), or it can just be a work that is mentioned in passing.
Note: Cite is note a quote; Cite is not for name of authors
Code
Indicate that the text is a short fragment of computer code.
Var
Represents the name of a variable in a mathematical expression or a programming context
Example
<var>E</var> = <var>m</var> <var>c</var><sup>2</sup>
E = m c2Output
Represents sample or quoted output from another program or computing system.
Example
Subscript and Superscript
These elements must be used only to mark up typographical conventions with specific meanings, not for typographical presentation for presentation's sake. In certain languages, superscripts are part of the typographical conventions for some abbreviations. The Superscript can be used inside a Var, for variables that have subscripts. Mathematical expressions often use subscripts and superscripts.
Lang
Indicating word or an idiomatic phrase from another language. meets #121
Lang dialog
<select>
Its value must be a valid BCP 47 language tag<input type='text'>
<input type='submit'>
<button>
<button>
Link
Set content or create content as a anchor
Link dialog
<select>
<input type='submit'>
<button>
<button>
If ORIGIN_LINK==definition
<select>
If ORIGIN_LINK==URL
<input type='url'>
<input type='text'>
Example of link to definition
Visual styles
Color, fonts, text-alignment and many others settings are decoration style, with no meaning. If user wants to give meaning for a text, he/she can achieve this by a combination of the above block and text-level types.
But, if is intend to provide such feature, it's important to assegure the accessibility
Paste
On copy and paste rich-text contents from outside sources (e.g web pages and word processors), the original format is retained and inaccessible formats could be used. For instance, a link with no text description or a text with low contrast color.
Glossary
Present a glossary with the terms that was defined with the Definition inline-semantic type. Use
<dl title="Glossary">
Accessibility Validations
General Validations
Feedback
Labels
Instructions
Help button ("More details")
A button on toolbar with an help icon
150 (meets #134)
Description Lists
Term-description groups may be names and definitions, questions and answers, categories and topics, or any other groups of term-description pairs. The order of term-description groups within a dl element, and the order of terms and descriptions within each group, may be significant.
Example 1 In this example a dl is used to represent a simple list of names and descriptions:
Example 2 In this example a dl element represents a set of terms, each of which has multiple descriptions:
Example 3 In this example a dl is used to show a set of instructions, where the order of the instructions is important:
### Guided Help meets #134 any scenario :question: ### Error identification meets #131 - [ ] Provide an error message as specific as possible. (meet #131) - [ ] Indicate the error (meet #131) - [ ] use color, shape, text (meet #78 #900 ) - [ ] use semantic markup (meet #76 ) - [ ] use aria-[state] (meet #131) - See wire-frames for example of error indication on Text Area [SUGGESTION] - Errors on entire blocks could be indicated by inserting a border (shape) - Errors on Text could be marked with ` - Use css to set the presentation with **text-decoration-style**, **text-decoration-line** and **text-decoration-color**. For instance: `.typeOfError { text-decoration: wavy underline overline;}` - avoid `text-decoration: solid underline` because it could be confised with links). - For error indication for inputs, use the AccessibilityHelp - See #48 ### Error suggestions meets #133 - [ ] **Required Fields**. "[Field_Name] is required. Please complete it" - [ ] **Invalid content**. "[Field_Name] is invalid. Please inform a [content] that is [rule]" - [ ] **Empty block-types**. "Seems that you left some empty line. Empty lines are not allowed" - [ ] **Orphaned term validation**. "Seems that a description list is incomplete. Every term should have at least one description and every description should have at least one term." - [ ] **Orphaned description validation**. "Seems that a description list is incomplete. Every description should have at least one term." - [ ] **Header Validation**: "Headers must be structured hierarchically. For example, try to follow nested content under an h2 heading with h3 before you use h4." - [ ] set accessibility to false - [ ] **Broken Definition's link**. "A term definition that you had linked in other part of the content have been deactivated. Check the terms without a definition and if necessary add a definition. Unusual terms could be difficult to understand and thus not accessible." - [ ] set accessibility to false Only if decorative styles are allowed - [ ] **Text color and highlight Validation**: "Seems that you styled a text but add no semantic meaning to it. Pure decorative styles is not encourage. If you wants to give meaning for a text, for instance an importante phrase, you should use some of the of the semantic options" - [ ] set accessibility to false - [ ] **Text alignment Validation**: - [ ] "Justified or Centered text are not accessible. Align text just for one side, either left or right". - [ ] "Mixing text alignments is not accessible. Align text just for one side, either left or right". - [ ] set accessibility to false # Usage - [ ] Text Editor component should be build to be a Dynamic component. Thus, it should be adaptable for different usage context ## Authoring Tool - [ ] **Text Component - Text Section**: - full version of Text Editor - Top-level header: `h3` - [ ] **Image Component - Long Description (image's caption)** - include all Block types, except for Headers - include all Inline-Semantic Types - [ ] **Video Component - Transcription** - include Paragraph - include Description List - include strong - include emphasis - include abbreviation - include definition - lang - [ ] **Audio Component - Transcription** - include Paragraph - include Description List - include strong - include emphasis - include abbreviation - include definition - lang - [ ] **Link - Text Description**: a `input type='text'` - [ ] **Activity Component - Instructions**: - full version of Text Editor, except for Headers ## Course - [ ] **Activity Component - Text**: - full version of Text Editor - header top-level `h2` ## StoryTelling - [ ] Description (Transcription) - include Paragraph - include Description List - include strong - include emphasis - include abbreviation - include definition - lang ## Forum - [ ] Full component # Wireframes ## Toolbar ![image](https://user-images.githubusercontent.com/993369/81084945-e7b39500-8ecc-11ea-8364-6da7611e84ee.png) ![image](https://user-images.githubusercontent.com/993369/81084983-f4d08400-8ecc-11ea-9bd3-86462f0cd459.png) ![image](https://user-images.githubusercontent.com/993369/81096348-98756080-8edc-11ea-96cc-0030070e166e.png) ![image](https://user-images.githubusercontent.com/993369/81096282-84316380-8edc-11ea-884b-2f2554033316.png) ### Link dialog ![image](https://user-images.githubusercontent.com/993369/81023603-4e8e6b00-8e47-11ea-9236-07f0fb9f6203.png) ### Lang dialog ![image](https://user-images.githubusercontent.com/993369/80461062-18169480-890b-11ea-8226-bbf327a593c9.png) ### Abbr dialog ![image](https://user-images.githubusercontent.com/993369/80461194-4a27f680-890b-11ea-8e10-1ac613b859d3.png) ### Definition dialog ![image](https://user-images.githubusercontent.com/993369/80461232-56ac4f00-890b-11ea-83ce-6f27dbe00564.png) ### Description List dialog ![image](https://user-images.githubusercontent.com/993369/81219408-26714a00-8fb6-11ea-91d5-2478b6785990.png) ## Text Area **Initial state / no focus** ![image](https://user-images.githubusercontent.com/993369/80177222-71ac5580-85d1-11ea-898f-f501fd84ef5a.png) **Focused** ![image](https://user-images.githubusercontent.com/993369/80177756-f9469400-85d2-11ea-981c-f74530c441d8.png) **Focused** ![image](https://user-images.githubusercontent.com/993369/80178648-2300ba80-85d5-11ea-97ed-687ad5363f4e.png) **No focus** ![image](https://user-images.githubusercontent.com/993369/80178666-2b58f580-85d5-11ea-8b2e-5bc864d12fdb.png) ## Header Validation ![image](https://user-images.githubusercontent.com/993369/80742385-ac425080-8af1-11ea-8bed-2384d637db63.png) # References [HTML5 specs](https://www.w3.org/TR/html50/Overview.html#contents) https://openinclusion.com/blog/presenting-abbreviations-acronyms-for-screen-reader-users/