This repository has been archived by the owner on Oct 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4847 from withspectrum/2.8.4
2.8.4
- Loading branch information
Showing
38 changed files
with
510 additions
and
147 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
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
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 |
---|---|---|
|
@@ -8726,10 +8726,10 @@ [email protected]: | |
react "^0.14.0 || ^15.0.0" | ||
styled-components "^2.0.0" | ||
|
||
slate@^0.44.10: | ||
version "0.44.10" | ||
resolved "https://registry.yarnpkg.com/slate/-/slate-0.44.10.tgz#ac7c3e3cf85570a8723a64a8a7807c881ddbfa8a" | ||
integrity sha512-2jMPgOjExjeWfHrYUsYTMLo/ykbXjCwLUFwG3G34Q0vwRsmf4yOf3b0Zx5LoUaNlyvQDdBsOGsF1qi6yTx53DA== | ||
slate@^0.44.11: | ||
version "0.44.11" | ||
resolved "https://registry.yarnpkg.com/slate/-/slate-0.44.11.tgz#0cdf454726a6d45a6dbf3174ea3f6261ad1a0428" | ||
integrity sha512-ZtNCxHtGMuWXwUb6vmbrLR73MbHeEQ1LRJNIIyEpj1Kixk0Sd0T+zSKI+cBWCXlOOITqFEfBcJOWaSppiID+1A== | ||
dependencies: | ||
debug "^3.1.0" | ||
direction "^0.1.5" | ||
|
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// flow-typed signature: 8f063755e65f032485439ac4cefffded | ||
// flow-typed version: <<STUB>>/snarkdown_vx.x.x/flow_v0.66.0 | ||
|
||
/** | ||
* This is an autogenerated libdef stub for: | ||
* | ||
* 'snarkdown' | ||
* | ||
* Fill this stub out by replacing all the `any` types. | ||
* | ||
* Once filled out, we encourage you to share your work with the | ||
* community by sending a pull request to: | ||
* https://github.com/flowtype/flow-typed | ||
*/ | ||
|
||
declare module 'snarkdown' { | ||
declare module.exports: any; | ||
} | ||
|
||
/** | ||
* We include stubs for each file inside this npm package in case you need to | ||
* require those files directly. Feel free to delete any files that aren't | ||
* needed. | ||
*/ | ||
declare module 'snarkdown/dist/snarkdown.es' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module 'snarkdown/dist/snarkdown' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module 'snarkdown/dist/snarkdown.umd' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module 'snarkdown/src/index' { | ||
declare module.exports: any; | ||
} | ||
|
||
// Filename aliases | ||
declare module 'snarkdown/dist/snarkdown.es.js' { | ||
declare module.exports: $Exports<'snarkdown/dist/snarkdown.es'>; | ||
} | ||
declare module 'snarkdown/dist/snarkdown.js' { | ||
declare module.exports: $Exports<'snarkdown/dist/snarkdown'>; | ||
} | ||
declare module 'snarkdown/dist/snarkdown.umd.js' { | ||
declare module.exports: $Exports<'snarkdown/dist/snarkdown.umd'>; | ||
} | ||
declare module 'snarkdown/src/index.js' { | ||
declare module.exports: $Exports<'snarkdown/src/index'>; | ||
} |
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 |
---|---|---|
@@ -1,14 +1,9 @@ | ||
// @flow | ||
// Determine whether a DraftJS message is short | ||
import { toPlainText, toState } from '../../../draft-utils'; | ||
|
||
import type { RawDraftContentState } from 'draft-js'; | ||
import { toPlainText } from './plaintext'; | ||
import type { MessageInfoType } from '../../../graphql/fragments/message/messageInfo'; | ||
|
||
export const isShort = (message: MessageInfoType): boolean => { | ||
if (message.messageType === 'media') return false; | ||
const jsonBody = JSON.parse(message.content.body); | ||
return ( | ||
jsonBody.blocks.length <= 1 && toPlainText(toState(jsonBody)).length <= 170 | ||
); | ||
return jsonBody.blocks.length <= 1 && toPlainText(jsonBody).length <= 170; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// @flow | ||
import type { RawContentState } from 'draft-js'; | ||
|
||
export const toPlainText = (raw: RawContentState) => { | ||
return raw.blocks | ||
.filter(block => block.type === 'unstyled') | ||
.map(block => block.text) | ||
.join('\n'); | ||
}; |
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.