Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Branch] EuiMarkdownEditor #3522

Merged
merged 58 commits into from
Aug 12, 2020
Merged

Conversation

miukimiu
Copy link
Contributor

@miukimiu miukimiu commented May 28, 2020

Markdown Editor Specification

The Markdown Editor Specification can be found here

Figma Prototype / Design

The Figma Prototype can be found in Figma

Build Preview (WIP)

The Build Preview can be found here

Sync Notes

The sync notes can be found here

Left todo

Future

  • ideas for syntax highlight/compression/etc

Changelog and PR's

As part of #3457

  • Created initial code structure for EuiMarkdownEditor.
  • Split the EuiMarkdownEditor unified plugins structure into two passes (parse, process/render) and used them as defaults

As part of #3479

  • Created a chart and a tooltip plugin

As part of #3493

  • Added a checkbox plugin

As part of #3506

  • Added the ability for UI buttons to trigger modals when creating or editing their markdown tags.

As part of #3525

  • Improved fonts styles and make sure text and preview areas use the Inter UI font.

As part of #3531

  • Re-enable default markdown list parsing

As part of #3602

  • Added onParse callback to provide stop-the-world error, info messages, and parse results to the consuming application.
  • Updated the sole markdown example to display this information until it is split up into multiple examples.

As part of #3534

  • Improved markdown format styles

As part of #3697

  • Added better styles and class names for the EuiMarkdownEditor

As part of #3703

  • Added and corrected types within the markdown editor and its dependencies.

As part of #3802

  • Fixed firefox textArea margin

As part of #3696

  • Separated EuiMarkdownFormat into it's own component.
  • Reworked plugin API to share a common set of plugins. Added documentation.

As part of #3748

  • Added proper drag&drop handling to the markdown editor.

As part of #3830

  • Sorted the supported file extensions when displaying in the drag&drop tooltip
  • Allowed consuming app to specify the editor's initial mode (editing vs preview)
  • Got the Props tab to render for EuiMarkdownEditor

As part of #3842

  • Moved the default parsing&processing plugin arrays behind a constructor function

As part of #3843

  • Implemented a default unknownHandler for plugin node processing, simplifying custom plugin setup

As part of #3867

  • Added license information for markdown tag formatting code
  • Added support for markdown insertion to be block-level (testable via the chart plugin example and drag&drop)
  • Corrected a documentation bug

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Firefox, Safari, and Edge
  • Props have proper autodocs
  • Added documentation examples
    - [ ] Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

i-a-n and others added 30 commits February 12, 2020 00:43
* Refactored EuiMarkdownEditor and EuiMarkdownFormat to prep for future work

* pr feedback
* chart & tooltip plugins

* Change tooltip markdown plugin markdown format

* Fixed error with empty tooltip tag
* Checkbox plugin

* Better checkbox interaction formatting

* Use monospace font in markdown editor
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3522/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3522/

Separates `EuiMarkdownFormat` into its own component. Adds documentation.
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3522/

chandlerprall and others added 2 commits July 28, 2020 14:47
* Initial markdown drag-n-drop api

* Properly insert multiple drag-and-drop results

* Update logic for markdown supported files message display

* disable upload interaction if no drop handlers are provided

* Upload error button styles

* pr feedback

* Only accept supported file types in the markdown file selection dialog

* Drag and drop animation

* small changes

* Add some cross-browser stability when dealing with unsupported drop files

Co-authored-by: miukimiu <elizabet.oliveira@elastic.co>
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3522/

* Sort drag&drop file extensions when displaying

* mark markdown components as new and in beta

* Get EuiMarkdownEditor Props to render

* Update markdown's plugin prop docs based on existing writeups
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3522/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3522/

* Add a default remark->rehype node handler to simplify plugin development

* Update documentation
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3522/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3522/

@myasonik
Copy link
Contributor

  • Trying to attach a file with an unsupported file type is never read out (the button has an aria-label on it that's never updated or removed)

  • The example of providing more errors under the textarea using EuiFromRow isn't wired up to associate the errors with the textare

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3522/

* Support aria-describedby to link errors. Include file support message in upload button's aria-label

* Change markdown footer element to a div
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3522/

@chandlerprall chandlerprall merged commit 81f22fe into master Aug 12, 2020
@chandlerprall chandlerprall deleted the feature/markdown-editor branch August 12, 2020 19:32
nyurik pushed a commit that referenced this pull request Aug 18, 2020
* WIP: Add markdown_editor component

* WIP: commit auto-added i18n tokens

* Adding button toggle for previewing

* Adding toolbar component

* Adding file picker initial structure

* Adding text area component

* Buttons order

* Moving markdown editor to docs form section

* Improving file picker

* Adding dropZone component and preview styles

* Fixing height issue while resizing textarea

* Small UI fix

* Improving markdown example

* remove showdown, since it wasn't being used

* Adding code highlight

* Better coding highlight

* Replacing UglifyJsPlugin with TerserPlugin

* Adding button enter key and buttons tooltips

* More code highlight fixes

* Markdown editor plugins (#3457)

* Refactored EuiMarkdownEditor and EuiMarkdownFormat to prep for future work

* pr feedback

* [markdown] chart & tooltip plugins (#3479)

* chart & tooltip plugins

* Change tooltip markdown plugin markdown format

* Fixed error with empty tooltip tag

* [Markdown] Checkbox plugin (#3493)

* Checkbox plugin

* Better checkbox interaction formatting

* Use monospace font in markdown editor

* [EuiMarkdownEditor] Improve markdown editor font (#3525)

* Improving font family and text area font styles

* Text color and text babckground

* Adding eui font family

* euiFormControlText

* Small fix

* Refactoring some styles

* Removing unecessary padding

* Re-enable default markdown list parsing (#3531)

* [Markdown] Allow toolbar buttons to present modals to create/edit tags (#3506)

* Allow EuiMarkdownEditor's ui buttons trigger interactive modals for creating & editing tags

* export two internal markdown types that are needed externally when generating eui.d.ts

* Re-enable the default markdown list parsing/display, but keep EUI's checkbox override

* Give EuiMarkdownEditorTextArea a displayName

* Enable undo/redo for markdown editor, apart from firefox (#3582)

* Enable undo/redo for markdown editor, apart from firefox

* Add test-and-retry logic to insertText to account for ability to focus the text area before brute forcing

* Added AST & info/fail message reporting to application; added info messages to tooltip plugin and fail message to chart configuration parsing (#3602)

* Add an imperative ref to EuiMarkdownEditor (#3622)

* Add an imperative ref to EuiMarkdownEditor, exposing the textarea element and replaceNode method

* Remove textareaRef from two hook dependency arrays

* eslint errors

* Add a markdown help modal, move tooltip & checkbox plugins into src (#3636)

* Move checkbox and tooltip markdown plugins into eui src, add helpText to ui plugins

* Adding footer initial styles

* Adding error popover

* Fixing uploading files icon

* wire up errors

* modal help text

* better modal text

* blerg, react color

* toggle button for editor ast

* Ignoring ts errors and fixing sass lint errors

* Displaying always error info

* Adding checkmark button

* fix markdown test

* Added aria-label and aria-labelledby props to markdown editor

* Fix i18n token name for markdown errors title

* Reverting displaying errors

Co-authored-by: miukimiu <elizabet.oliveira@elastic.co>
Co-authored-by: Dave Snider <dave.snider@gmail.com>

* [EuiMarkdownEditor] Improving markdown format styles (#3534)

* Improving markdown format styles

* Transforming px to em

* Renaming variable

* Adding descriptions and alpha values

* hr more similar to EuiHorizontalRule

* [EuiMarkdownEditor] Better styles and class names (#3697)

* Better styles and classnames

* md footer height

* snapshot

* preventing the text area of loosing focus when clicking on an action button

* Add types to markdown editor (#3703)

* Plugin types

* Rehype / hast / unist node types

* Make typescript happy with markdown editor and dependencies

* Types for markdown AST nodes and errors

* Don't scan any .d.ts file for internationalization strings

* Adding missing types and dependency

* Fixing firefox text area margin (#3802)

* Markdown Format / Editor documentation + features (#3696)

Separates `EuiMarkdownFormat` into its own component. Adds documentation.

* [Markdown editor] drag and drop api, functionality (#3748)

* Initial markdown drag-n-drop api

* Properly insert multiple drag-and-drop results

* Update logic for markdown supported files message display

* disable upload interaction if no drop handlers are provided

* Upload error button styles

* pr feedback

* Only accept supported file types in the markdown file selection dialog

* Drag and drop animation

* small changes

* Add some cross-browser stability when dealing with unsupported drop files

Co-authored-by: miukimiu <elizabet.oliveira@elastic.co>

* Feature/markdown editor cleanup (#3830)

* Sort drag&drop file extensions when displaying

* mark markdown components as new and in beta

* Get EuiMarkdownEditor Props to render

* Update markdown's plugin prop docs based on existing writeups

* Prevent markdown plugin extensions from interacting with each other (#3842)

* Simplify the markdown editor's plugin API (#3843)

* Add a default remark->rehype node handler to simplify plugin development

* Update documentation

* Add license info around markdown tag processing; Support block-level tag insertions (#3867)

* changelog

* Improved, and proper, types for the markdown editor's usage in downstream apps (#3893)

* Fixes some ARIA issues in EuiMarkdownEditor (#3899)

* Support aria-describedby to link errors. Include file support message in upload button's aria-label

* Change markdown footer element to a div

Co-authored-by: i-a-n <ian@union.io>
Co-authored-by: Dave Snider <dave.snider@gmail.com>
Co-authored-by: Chandler Prall <chandler.prall@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants