Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

DraftJS Editor #1256

Merged
merged 83 commits into from
Oct 4, 2017
Merged
Show file tree
Hide file tree
Changes from 81 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
b76b531
WIP
mxstbr Jul 19, 2017
272f801
Improve editor
mxstbr Jul 19, 2017
6fe3b1c
Add support for dropping images
mxstbr Jul 19, 2017
d2d004f
Fix link previews in thread composer
mxstbr Jul 19, 2017
8d365ea
Fix some stuff
mxstbr Jul 20, 2017
9852511
Add comment
mxstbr Jul 20, 2017
948445d
Trigger new build
mxstbr Jul 20, 2017
143bcd9
Add single line mode to draftjs editor
mxstbr Jul 20, 2017
6ed129e
Switch chat input to new editor
mxstbr Jul 20, 2017
fd2ff97
Save thread body as draftjs state
mxstbr Jul 20, 2017
b6e092c
Store messages as draft js state
mxstbr Jul 20, 2017
668dfed
WIP first rendering of DraftJS content
mxstbr Jul 21, 2017
54d4932
Make rendering work
mxstbr Jul 21, 2017
ca5aa61
Remove Slate editor component
mxstbr Jul 21, 2017
c62c492
WIP: Slate -> Draft
mxstbr Jul 21, 2017
b4c1bf7
Finish slate => draft migration script
mxstbr Jul 22, 2017
4268dd4
Update draft-js-import-markdown
mxstbr Jul 22, 2017
03193d4
WIP convert plain text threads
mxstbr Jul 23, 2017
da2859b
Finish migration script from plain text to draftjs
mxstbr Jul 23, 2017
1901dc7
Move migration
mxstbr Jul 25, 2017
3866ec7
Implement editing
mxstbr Jul 25, 2017
376c7d4
Merge branch 'master' into ablaze
mxstbr Jul 25, 2017
2c21ad8
Fix styling on thread composer
mxstbr Aug 7, 2017
b3c425a
Resolve conflicts
mxstbr Aug 14, 2017
37d07d1
Move migration to end
mxstbr Aug 14, 2017
2c7bb17
Fix image uploads with externally handled state
mxstbr Aug 14, 2017
a6a56cd
Add commented-out file uploading code
mxstbr Aug 14, 2017
ba56921
Fix some dependency madness
mxstbr Aug 15, 2017
5efd44c
Add code highlighting to threads
mxstbr Aug 15, 2017
8515f11
Merge branch 'master' into ablaze
mxstbr Sep 15, 2017
c242691
Move migration
mxstbr Sep 16, 2017
226489e
Update draftjs-import
mxstbr Sep 16, 2017
c5fea1c
Upgrade draft-js-image-plugin
mxstbr Sep 16, 2017
83a5677
Fix image uploads
mxstbr Sep 16, 2017
8b60b05
Fix image uploads when editing
mxstbr Sep 16, 2017
2f782b8
Fix Drafts global CSS file when SSRing
mxstbr Sep 18, 2017
09c7904
Fix SSR rehydration issue
mxstbr Sep 18, 2017
dda7e3e
Upgrade to fixed version of draft-js-import-markdown
mxstbr Sep 19, 2017
74e83bf
Merge branch 'master' into ablaze
mxstbr Sep 19, 2017
ecd5745
Fix clicking on images
mxstbr Sep 20, 2017
418ad52
Fix link previews
mxstbr Sep 20, 2017
1882c6a
Remove unnecessary onKeyDown
mxstbr Sep 21, 2017
289d70d
Use draft-js-prism-plugin for syntax highlighting
mxstbr Sep 21, 2017
df2896a
Merge branch 'master' into ablaze
mxstbr Sep 21, 2017
d869c5f
Fix chatInput
mxstbr Sep 21, 2017
620fa2c
Fuck styling
mxstbr Sep 21, 2017
12b0eff
Fixed
mxstbr Sep 21, 2017
bf49de0
fork markdown-shortcuts-plugin, fixes blockquote issue
mxstbr Sep 21, 2017
cde4132
Update the draftjs image plugin
mxstbr Sep 21, 2017
baa7c1b
I dun goofed
mxstbr Sep 21, 2017
4871977
Upgrade markdown plugin
mxstbr Sep 22, 2017
479777e
Fix thread description meta tag, add draft utils
mxstbr Sep 22, 2017
1887a01
Use editorKey prop for SSR
mxstbr Sep 22, 2017
6cdb919
Fix new message notification emails
mxstbr Sep 22, 2017
44163f8
Merge branch 'master' into ablaze
superbryntendo Sep 22, 2017
13395ee
merge conflicts
superbryntendo Sep 22, 2017
7222f0c
merge conflicts
superbryntendo Sep 22, 2017
7a765b3
Fix SSR
mxstbr Sep 24, 2017
5a4f947
working on adjusting markup for new composer. includes a few variable…
superbryntendo Sep 26, 2017
e8baabf
Merge branch 'master' into ablaze
mxstbr Sep 26, 2017
0624cb9
Fix focus issue
mxstbr Sep 26, 2017
c2b8053
reset cleanup
superbryntendo Sep 26, 2017
bd3abd1
Merge branch 'ablaze' of github.com:withspectrum/spectrum into ablaze
superbryntendo Sep 26, 2017
10ec8dc
Merge branch 'master' into ablaze
mxstbr Sep 27, 2017
4c8f2a9
Fix flow errors
mxstbr Sep 27, 2017
2310b8b
Add $FlowIssue suppress comment
mxstbr Sep 27, 2017
05ce953
Add flow-typed files for new dependencies
mxstbr Sep 27, 2017
f6fcc8f
still *slightly* broken on iOS Safari, but working great everywhere else
superbryntendo Sep 28, 2017
b8ea895
Merge branch 'ablaze' of github.com:withspectrum/spectrum into ablaze
superbryntendo Sep 28, 2017
6a09dc2
Fix imports from shared
mxstbr Sep 28, 2017
da4a91d
Disable flow for composer temporarily
mxstbr Sep 28, 2017
c8ad8fc
fixes the titlebar a little bit.
superbryntendo Sep 29, 2017
1edce94
publish button now pushes users to their inbox on desktop.
superbryntendo Sep 29, 2017
d31ca59
Merge branch 'master' into ablaze
superbryntendo Sep 29, 2017
0e1043e
Merge branch 'ablaze' of github.com:withspectrum/spectrum into ablaze
superbryntendo Sep 29, 2017
99feb93
Move migration to end
mxstbr Sep 28, 2017
d2af62e
Fix mobile publish redirect
mxstbr Sep 29, 2017
01f968f
Remove rogue console.logs
mxstbr Sep 29, 2017
c9b7496
Merge branch 'master' into ablaze
superbryntendo Oct 2, 2017
c93c92f
Merge branch 'master' into ablaze
mxstbr Oct 3, 2017
9fefd4f
Migrate iframes manually
mxstbr Oct 3, 2017
7300bc2
Merge branch 'master' into ablaze
brianlovin Oct 3, 2017
390aa3f
Merge branch 'master' into ablaze
mxstbr Oct 4, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
suppress_comment=.*\\$FlowFixMe
suppress_comment=.*\\$FlowIssue
esproposal.class_instance_fields=enable
module.system.node.resolve_dirname=node_modules
module.system.node.resolve_dirname=spectrum

[lints]
all=warn
Expand Down
6 changes: 5 additions & 1 deletion athena/queues/message-notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { getThreadNotificationUsers } from '../models/usersThreads';
import { getDirectMessageThreadMembers } from '../models/usersDirectMessageThreads';
import sentencify from '../utils/sentencify';
import bufferNotificationEmail from './buffer-message-notification-email';
import { toPlainText, toState } from 'shared/draft-utils';

const formatAndBufferNotificationEmail = (
recipient,
Expand Down Expand Up @@ -45,7 +46,10 @@ const formatAndBufferNotificationEmail = (
name: user.name,
},
content: {
body: message.content.body,
body:
message.messageType === 'draftjs'
? toPlainText(toState(JSON.parse(message.content.body)))
: message.content.body,
},
},
],
Expand Down
5 changes: 4 additions & 1 deletion chronos/models/community.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
const { db } = require('./db');

export const getCommunityById = (id: string): Promise<Object> => {
return db.table('communities').get(id).run();
return db
.table('communities')
.get(id)
.run();
};

export const getTopCommunities = (amount: number): Array<Object> => {
Expand Down
81 changes: 81 additions & 0 deletions flow-typed/npm/draft-js-drag-n-drop-plugin_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// flow-typed signature: f69f403c3f9e7e52c46f225a280964d1
// flow-typed version: <<STUB>>/draft-js-drag-n-drop-plugin_v2.0.0-rc2/flow_v0.55.0

/**
* This is an autogenerated libdef stub for:
*
* 'draft-js-drag-n-drop-plugin'
*
* 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 'draft-js-drag-n-drop-plugin' {
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 'draft-js-drag-n-drop-plugin/lib/constants/index' {
declare module.exports: any;
}

declare module 'draft-js-drag-n-drop-plugin/lib/createDecorator' {
declare module.exports: any;
}

declare module 'draft-js-drag-n-drop-plugin/lib/handleDrop' {
declare module.exports: any;
}

declare module 'draft-js-drag-n-drop-plugin/lib/index' {
declare module.exports: any;
}

declare module 'draft-js-drag-n-drop-plugin/lib/modifiers/addBlock' {
declare module.exports: any;
}

declare module 'draft-js-drag-n-drop-plugin/lib/modifiers/removeBlock' {
declare module.exports: any;
}

declare module 'draft-js-drag-n-drop-plugin/postcss.config' {
declare module.exports: any;
}

declare module 'draft-js-drag-n-drop-plugin/webpack.config' {
declare module.exports: any;
}

// Filename aliases
declare module 'draft-js-drag-n-drop-plugin/lib/constants/index.js' {
declare module.exports: $Exports<'draft-js-drag-n-drop-plugin/lib/constants/index'>;
}
declare module 'draft-js-drag-n-drop-plugin/lib/createDecorator.js' {
declare module.exports: $Exports<'draft-js-drag-n-drop-plugin/lib/createDecorator'>;
}
declare module 'draft-js-drag-n-drop-plugin/lib/handleDrop.js' {
declare module.exports: $Exports<'draft-js-drag-n-drop-plugin/lib/handleDrop'>;
}
declare module 'draft-js-drag-n-drop-plugin/lib/index.js' {
declare module.exports: $Exports<'draft-js-drag-n-drop-plugin/lib/index'>;
}
declare module 'draft-js-drag-n-drop-plugin/lib/modifiers/addBlock.js' {
declare module.exports: $Exports<'draft-js-drag-n-drop-plugin/lib/modifiers/addBlock'>;
}
declare module 'draft-js-drag-n-drop-plugin/lib/modifiers/removeBlock.js' {
declare module.exports: $Exports<'draft-js-drag-n-drop-plugin/lib/modifiers/removeBlock'>;
}
declare module 'draft-js-drag-n-drop-plugin/postcss.config.js' {
declare module.exports: $Exports<'draft-js-drag-n-drop-plugin/postcss.config'>;
}
declare module 'draft-js-drag-n-drop-plugin/webpack.config.js' {
declare module.exports: $Exports<'draft-js-drag-n-drop-plugin/webpack.config'>;
}
102 changes: 102 additions & 0 deletions flow-typed/npm/draft-js-focus-plugin_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// flow-typed signature: ca3fc9f543ceddf725d7a1bd33e0bb39
// flow-typed version: <<STUB>>/draft-js-focus-plugin_v2.0.0-rc2/flow_v0.55.0

/**
* This is an autogenerated libdef stub for:
*
* 'draft-js-focus-plugin'
*
* 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 'draft-js-focus-plugin' {
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 'draft-js-focus-plugin/lib/createDecorator' {
declare module.exports: any;
}

declare module 'draft-js-focus-plugin/lib/index' {
declare module.exports: any;
}

declare module 'draft-js-focus-plugin/lib/modifiers/removeBlock' {
declare module.exports: any;
}

declare module 'draft-js-focus-plugin/lib/modifiers/setSelection' {
declare module.exports: any;
}

declare module 'draft-js-focus-plugin/lib/modifiers/setSelectionToBlock' {
declare module.exports: any;
}

declare module 'draft-js-focus-plugin/lib/utils/blockInSelection' {
declare module.exports: any;
}

declare module 'draft-js-focus-plugin/lib/utils/createBlockKeyStore' {
declare module.exports: any;
}

declare module 'draft-js-focus-plugin/lib/utils/getBlockMapKeys' {
declare module.exports: any;
}

declare module 'draft-js-focus-plugin/lib/utils/getSelectedBlocksMapKeys' {
declare module.exports: any;
}

declare module 'draft-js-focus-plugin/postcss.config' {
declare module.exports: any;
}

declare module 'draft-js-focus-plugin/webpack.config' {
declare module.exports: any;
}

// Filename aliases
declare module 'draft-js-focus-plugin/lib/createDecorator.js' {
declare module.exports: $Exports<'draft-js-focus-plugin/lib/createDecorator'>;
}
declare module 'draft-js-focus-plugin/lib/index.js' {
declare module.exports: $Exports<'draft-js-focus-plugin/lib/index'>;
}
declare module 'draft-js-focus-plugin/lib/modifiers/removeBlock.js' {
declare module.exports: $Exports<'draft-js-focus-plugin/lib/modifiers/removeBlock'>;
}
declare module 'draft-js-focus-plugin/lib/modifiers/setSelection.js' {
declare module.exports: $Exports<'draft-js-focus-plugin/lib/modifiers/setSelection'>;
}
declare module 'draft-js-focus-plugin/lib/modifiers/setSelectionToBlock.js' {
declare module.exports: $Exports<'draft-js-focus-plugin/lib/modifiers/setSelectionToBlock'>;
}
declare module 'draft-js-focus-plugin/lib/utils/blockInSelection.js' {
declare module.exports: $Exports<'draft-js-focus-plugin/lib/utils/blockInSelection'>;
}
declare module 'draft-js-focus-plugin/lib/utils/createBlockKeyStore.js' {
declare module.exports: $Exports<'draft-js-focus-plugin/lib/utils/createBlockKeyStore'>;
}
declare module 'draft-js-focus-plugin/lib/utils/getBlockMapKeys.js' {
declare module.exports: $Exports<'draft-js-focus-plugin/lib/utils/getBlockMapKeys'>;
}
declare module 'draft-js-focus-plugin/lib/utils/getSelectedBlocksMapKeys.js' {
declare module.exports: $Exports<'draft-js-focus-plugin/lib/utils/getSelectedBlocksMapKeys'>;
}
declare module 'draft-js-focus-plugin/postcss.config.js' {
declare module.exports: $Exports<'draft-js-focus-plugin/postcss.config'>;
}
declare module 'draft-js-focus-plugin/webpack.config.js' {
declare module.exports: $Exports<'draft-js-focus-plugin/webpack.config'>;
}
60 changes: 60 additions & 0 deletions flow-typed/npm/draft-js-image-plugin_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// flow-typed signature: 1b6bfd1d8094619e9134e61f63e92a0f
// flow-typed version: <<STUB>>/draft-js-image-plugin_v2.0.0-rc8/flow_v0.55.0

/**
* This is an autogenerated libdef stub for:
*
* 'draft-js-image-plugin'
*
* 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 'draft-js-image-plugin' {
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 'draft-js-image-plugin/lib/Image/index' {
declare module.exports: any;
}

declare module 'draft-js-image-plugin/lib/index' {
declare module.exports: any;
}

declare module 'draft-js-image-plugin/lib/modifiers/addImage' {
declare module.exports: any;
}

declare module 'draft-js-image-plugin/postcss.config' {
declare module.exports: any;
}

declare module 'draft-js-image-plugin/webpack.config' {
declare module.exports: any;
}

// Filename aliases
declare module 'draft-js-image-plugin/lib/Image/index.js' {
declare module.exports: $Exports<'draft-js-image-plugin/lib/Image/index'>;
}
declare module 'draft-js-image-plugin/lib/index.js' {
declare module.exports: $Exports<'draft-js-image-plugin/lib/index'>;
}
declare module 'draft-js-image-plugin/lib/modifiers/addImage.js' {
declare module.exports: $Exports<'draft-js-image-plugin/lib/modifiers/addImage'>;
}
declare module 'draft-js-image-plugin/postcss.config.js' {
declare module.exports: $Exports<'draft-js-image-plugin/postcss.config'>;
}
declare module 'draft-js-image-plugin/webpack.config.js' {
declare module.exports: $Exports<'draft-js-image-plugin/webpack.config'>;
}
46 changes: 46 additions & 0 deletions flow-typed/npm/draft-js-import-markdown_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// flow-typed signature: 0ade55a84154638d6fb4ea8060bba647
// flow-typed version: <<STUB>>/draft-js-import-markdown_v^1.2.0/flow_v0.55.0

/**
* This is an autogenerated libdef stub for:
*
* 'draft-js-import-markdown'
*
* 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 'draft-js-import-markdown' {
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 'draft-js-import-markdown/lib/main' {
declare module.exports: any;
}

declare module 'draft-js-import-markdown/lib/MarkdownParser' {
declare module.exports: any;
}

declare module 'draft-js-import-markdown/lib/stateFromMarkdown' {
declare module.exports: any;
}

// Filename aliases
declare module 'draft-js-import-markdown/lib/main.js' {
declare module.exports: $Exports<'draft-js-import-markdown/lib/main'>;
}
declare module 'draft-js-import-markdown/lib/MarkdownParser.js' {
declare module.exports: $Exports<'draft-js-import-markdown/lib/MarkdownParser'>;
}
declare module 'draft-js-import-markdown/lib/stateFromMarkdown.js' {
declare module.exports: $Exports<'draft-js-import-markdown/lib/stateFromMarkdown'>;
}
Loading