-
Notifications
You must be signed in to change notification settings - Fork 576
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Next major: Upgrade substyle & make cut/copy & paste generally availa…
…ble (#393) * chore: upgrade substyle, prettify, fixed some problematic props passing * BREAKING CHANGE: if you use react-mentions together with local versions of substyle, substyle-jss or substyle-glamor, you need to upgrade to these packages to their latest versions (substyle@9, substyle-jss@4, substyle-glamor@4) * BREAKING CHANGE: inline style passed to the textarea/input element are no longer forwarded to the highlighter element * feat: generally enable cut/copy & paste BREAKING CHANGE: cut/copy & paste is now enabled by default, the prop `EXPERIMENTAL_cutCopyPaste` is no longer supported and must be removed from `<MentionsInput >` * chore: fix example after the breaking change about forwarding input props * fix: use more sensible default styles bring some order into the example styles * upgrade to substyle 9 and adjust API * chore: fix emoji example styles * chore: upgrade to fixed version of substyle
- Loading branch information
Showing
32 changed files
with
615 additions
and
452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ const emailRegex = /(([^\s@]+@[^\s@]+\.[^\s@]+))$/ | |
const defaultValue = | ||
"Hi @[John Doe](user:johndoe), \n\nlet's add @[[email protected]](email:[email protected]) and @[John Doe](user:johndoe) to this conversation... " | ||
|
||
function ExperimentalCutCopyPaste({ data }) { | ||
function CutCopyPaste({ data }) { | ||
const [sourceValue, onSourceChange, onSourceAdd] = useExampleValue( | ||
defaultValue | ||
) | ||
|
@@ -20,11 +20,7 @@ function ExperimentalCutCopyPaste({ data }) { | |
|
||
return ( | ||
<div className="multiple-triggers"> | ||
<h3>EXPERIMENTAL: Copy and paste mentions between mention components</h3> | ||
<p> | ||
In order to activate this functionality you need to set the | ||
EXPERIMENTAL__cutCopyPaste flag on a MentionsInput to true . | ||
</p> | ||
<h3>Copy and paste mentions between mention components</h3> | ||
<p>This functionality is not supported in Internet Explorer.</p> | ||
|
||
<div style={{ display: 'flex' }}> | ||
|
@@ -54,7 +50,7 @@ function ExperimentalCutCopyPaste({ data }) { | |
<textarea | ||
style={{ width: '100%', height: 80 }} | ||
value={plainTextValue} | ||
onChange={event => setPlainTextValue(event.target.value)} | ||
onChange={(event) => setPlainTextValue(event.target.value)} | ||
/> | ||
</div> | ||
</div> | ||
|
@@ -65,7 +61,6 @@ function ExperimentalCutCopyPaste({ data }) { | |
|
||
const MultiMention = ({ value, data, onChange, onAdd }) => ( | ||
<MentionsInput | ||
EXPERIMENTAL_cutCopyPaste | ||
value={value} | ||
onChange={onChange} | ||
style={defaultStyle} | ||
|
@@ -93,11 +88,11 @@ const MultiMention = ({ value, data, onChange, onAdd }) => ( | |
<Mention | ||
markup="@[__display__](email:__id__)" | ||
trigger={emailRegex} | ||
data={search => [{ id: search, display: search }]} | ||
data={(search) => [{ id: search, display: search }]} | ||
onAdd={onAdd} | ||
style={{ backgroundColor: '#d1c4e9' }} | ||
/> | ||
</MentionsInput> | ||
) | ||
|
||
export default ExperimentalCutCopyPaste | ||
export default CutCopyPaste |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
111c89d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to following URLs: