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

reference editor component #58

Open
joshdmiller opened this issue Sep 5, 2016 · 2 comments
Open

reference editor component #58

joshdmiller opened this issue Sep 5, 2016 · 2 comments
Assignees

Comments

@joshdmiller
Copy link

joshdmiller commented Sep 5, 2016

Overview

Create an editor component that wraps the Editor component (#57), providing management of plugins related to character and element references.

Component Props

type Props = {
  // Suggestion callbacks
  onSearchChange: ?( value: string ) => void,
  searchSuggestions: Array<Suggestion>,

  // Props to pass unaltered to Editor
  content: RawDraftObject,
  onEditStart: ?() => void,
  onEditEnd: ?() => void,
  onChange: ?( content: DraftObject ) => void,
  readOnly: ?boolean,
};

type Suggestion = {
  type: SuggestionType,
  _id: string,
  name: string,
  link: string,
  avatar: string,
};

type SuggestionType = 'character' | 'element';

Lifecycle

The component manages an instance of the DraftJS mention plugin, triggered by @.

The component receives suggestions, as well as a callback, via props. The callback is fired when the completion string changes. In the parent component, this is used to filter and provide new suggestions.

The component also manages the undo plugin and linkify plugin.

Style

The character and element mentions/references should reflect the uxpin design, rather than the default mention styles.

The suggestions should render a material list item with an avatar and the name of the character or title of the element.

Changelog

  • 201609212354PST(joshdmiller): revised to combine characters and elements into a single suggestion list
@joshdmiller joshdmiller changed the title [wip] reference editor component reference editor component Sep 6, 2016
@goshacmd
Copy link
Member

The character and element mentions should reflect the uxpin design, rather than the default mention styles.

This refers to the blue/green text color after inserted, the suggestions popup still stays the same, correct?

@sethmerrick
Copy link
Contributor

Correct. The text should be blue hyperlink for characters and green hyperlink for elements, as in the uxpin design, with the popup styling staying the same, using either the Character Avatar or Element Cover Image; or placeholders if those images do not exist for a given entity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants