diff --git a/.flowconfig b/.flowconfig index 6d8e3988f5..936e631ab1 100644 --- a/.flowconfig +++ b/.flowconfig @@ -9,7 +9,10 @@ [options] 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 diff --git a/athena/queues/message-notification.js b/athena/queues/message-notification.js index 74a27e636f..a0cf4b67be 100644 --- a/athena/queues/message-notification.js +++ b/athena/queues/message-notification.js @@ -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, @@ -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, }, }, ], diff --git a/chronos/models/community.js b/chronos/models/community.js index d8d5e647d0..844185d275 100644 --- a/chronos/models/community.js +++ b/chronos/models/community.js @@ -2,7 +2,10 @@ const { db } = require('./db'); export const getCommunityById = (id: string): Promise => { - return db.table('communities').get(id).run(); + return db + .table('communities') + .get(id) + .run(); }; export const getTopCommunities = (amount: number): Array => { diff --git a/flow-typed/npm/draft-js-drag-n-drop-plugin_vx.x.x.js b/flow-typed/npm/draft-js-drag-n-drop-plugin_vx.x.x.js new file mode 100644 index 0000000000..aec0f97a7a --- /dev/null +++ b/flow-typed/npm/draft-js-drag-n-drop-plugin_vx.x.x.js @@ -0,0 +1,81 @@ +// flow-typed signature: f69f403c3f9e7e52c46f225a280964d1 +// flow-typed version: <>/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'>; +} diff --git a/flow-typed/npm/draft-js-focus-plugin_vx.x.x.js b/flow-typed/npm/draft-js-focus-plugin_vx.x.x.js new file mode 100644 index 0000000000..eeb73ee436 --- /dev/null +++ b/flow-typed/npm/draft-js-focus-plugin_vx.x.x.js @@ -0,0 +1,102 @@ +// flow-typed signature: ca3fc9f543ceddf725d7a1bd33e0bb39 +// flow-typed version: <>/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'>; +} diff --git a/flow-typed/npm/draft-js-image-plugin_vx.x.x.js b/flow-typed/npm/draft-js-image-plugin_vx.x.x.js new file mode 100644 index 0000000000..c554b5ec25 --- /dev/null +++ b/flow-typed/npm/draft-js-image-plugin_vx.x.x.js @@ -0,0 +1,60 @@ +// flow-typed signature: 1b6bfd1d8094619e9134e61f63e92a0f +// flow-typed version: <>/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'>; +} diff --git a/flow-typed/npm/draft-js-import-markdown_vx.x.x.js b/flow-typed/npm/draft-js-import-markdown_vx.x.x.js new file mode 100644 index 0000000000..66973d2153 --- /dev/null +++ b/flow-typed/npm/draft-js-import-markdown_vx.x.x.js @@ -0,0 +1,46 @@ +// flow-typed signature: 0ade55a84154638d6fb4ea8060bba647 +// flow-typed version: <>/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'>; +} diff --git a/flow-typed/npm/draft-js-markdown-plugin_vx.x.x.js b/flow-typed/npm/draft-js-markdown-plugin_vx.x.x.js new file mode 100644 index 0000000000..da284be9ca --- /dev/null +++ b/flow-typed/npm/draft-js-markdown-plugin_vx.x.x.js @@ -0,0 +1,179 @@ +// flow-typed signature: 0742145ed3de57321a3d9f8459ccf7ef +// flow-typed version: <>/draft-js-markdown-plugin_v^1.0.0/flow_v0.55.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'draft-js-markdown-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-markdown-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-markdown-plugin/lib/components/Image/index' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/components/Link/index' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/constants' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/decorators/image/imageStrategy' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/decorators/image/index' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/decorators/link/index' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/decorators/link/linkStrategy' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/index' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/modifiers/adjustBlockDepth' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/modifiers/changeCurrentBlockType' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/modifiers/changeCurrentInlineStyle' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/modifiers/handleBlockType' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/modifiers/handleImage' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/modifiers/handleInlineStyle' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/modifiers/handleLink' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/modifiers/handleNewCodeBlock' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/modifiers/insertEmptyBlock' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/modifiers/insertImage' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/modifiers/insertLink' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/modifiers/insertText' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/modifiers/leaveList' { + declare module.exports: any; +} + +declare module 'draft-js-markdown-plugin/lib/utils' { + declare module.exports: any; +} + +// Filename aliases +declare module 'draft-js-markdown-plugin/lib/components/Image/index.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/components/Image/index'>; +} +declare module 'draft-js-markdown-plugin/lib/components/Link/index.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/components/Link/index'>; +} +declare module 'draft-js-markdown-plugin/lib/constants.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/constants'>; +} +declare module 'draft-js-markdown-plugin/lib/decorators/image/imageStrategy.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/decorators/image/imageStrategy'>; +} +declare module 'draft-js-markdown-plugin/lib/decorators/image/index.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/decorators/image/index'>; +} +declare module 'draft-js-markdown-plugin/lib/decorators/link/index.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/decorators/link/index'>; +} +declare module 'draft-js-markdown-plugin/lib/decorators/link/linkStrategy.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/decorators/link/linkStrategy'>; +} +declare module 'draft-js-markdown-plugin/lib/index.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/index'>; +} +declare module 'draft-js-markdown-plugin/lib/modifiers/adjustBlockDepth.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/modifiers/adjustBlockDepth'>; +} +declare module 'draft-js-markdown-plugin/lib/modifiers/changeCurrentBlockType.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/modifiers/changeCurrentBlockType'>; +} +declare module 'draft-js-markdown-plugin/lib/modifiers/changeCurrentInlineStyle.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/modifiers/changeCurrentInlineStyle'>; +} +declare module 'draft-js-markdown-plugin/lib/modifiers/handleBlockType.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/modifiers/handleBlockType'>; +} +declare module 'draft-js-markdown-plugin/lib/modifiers/handleImage.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/modifiers/handleImage'>; +} +declare module 'draft-js-markdown-plugin/lib/modifiers/handleInlineStyle.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/modifiers/handleInlineStyle'>; +} +declare module 'draft-js-markdown-plugin/lib/modifiers/handleLink.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/modifiers/handleLink'>; +} +declare module 'draft-js-markdown-plugin/lib/modifiers/handleNewCodeBlock.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/modifiers/handleNewCodeBlock'>; +} +declare module 'draft-js-markdown-plugin/lib/modifiers/insertEmptyBlock.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/modifiers/insertEmptyBlock'>; +} +declare module 'draft-js-markdown-plugin/lib/modifiers/insertImage.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/modifiers/insertImage'>; +} +declare module 'draft-js-markdown-plugin/lib/modifiers/insertLink.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/modifiers/insertLink'>; +} +declare module 'draft-js-markdown-plugin/lib/modifiers/insertText.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/modifiers/insertText'>; +} +declare module 'draft-js-markdown-plugin/lib/modifiers/leaveList.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/modifiers/leaveList'>; +} +declare module 'draft-js-markdown-plugin/lib/utils.js' { + declare module.exports: $Exports<'draft-js-markdown-plugin/lib/utils'>; +} diff --git a/flow-typed/npm/draft-js-plugins-editor_vx.x.x.js b/flow-typed/npm/draft-js-plugins-editor_vx.x.x.js new file mode 100644 index 0000000000..4186a29f64 --- /dev/null +++ b/flow-typed/npm/draft-js-plugins-editor_vx.x.x.js @@ -0,0 +1,130 @@ +// flow-typed signature: 71a29656189a85cf204ea88894249805 +// flow-typed version: <>/draft-js-plugins-editor_v2.0.0-rc2/flow_v0.55.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'draft-js-plugins-editor' + * + * 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-plugins-editor' { + 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-plugins-editor/lib/Editor/__test__/index' { + declare module.exports: any; +} + +declare module 'draft-js-plugins-editor/lib/Editor/__test__/MultiDecorator' { + declare module.exports: any; +} + +declare module 'draft-js-plugins-editor/lib/Editor/createCompositeDecorator' { + declare module.exports: any; +} + +declare module 'draft-js-plugins-editor/lib/Editor/defaultKeyBindingPlugin' { + declare module.exports: any; +} + +declare module 'draft-js-plugins-editor/lib/Editor/index' { + declare module.exports: any; +} + +declare module 'draft-js-plugins-editor/lib/Editor/moveSelectionToEnd' { + declare module.exports: any; +} + +declare module 'draft-js-plugins-editor/lib/Editor/MultiDecorator' { + declare module.exports: any; +} + +declare module 'draft-js-plugins-editor/lib/Editor/proxies' { + declare module.exports: any; +} + +declare module 'draft-js-plugins-editor/lib/index' { + declare module.exports: any; +} + +declare module 'draft-js-plugins-editor/lib/modifiers/moveToEndOfSelectedBlock' { + declare module.exports: any; +} + +declare module 'draft-js-plugins-editor/lib/modifiers/moveToStartOfSelectedBlock' { + declare module.exports: any; +} + +declare module 'draft-js-plugins-editor/lib/utils/composeDecorators' { + declare module.exports: any; +} + +declare module 'draft-js-plugins-editor/lib/utils/createCompositeDecorator' { + declare module.exports: any; +} + +declare module 'draft-js-plugins-editor/lib/utils/createEditorStateWithText' { + declare module.exports: any; +} + +declare module 'draft-js-plugins-editor/lib/utils/moveSelectionToEnd' { + declare module.exports: any; +} + +// Filename aliases +declare module 'draft-js-plugins-editor/lib/Editor/__test__/index.js' { + declare module.exports: $Exports<'draft-js-plugins-editor/lib/Editor/__test__/index'>; +} +declare module 'draft-js-plugins-editor/lib/Editor/__test__/MultiDecorator.js' { + declare module.exports: $Exports<'draft-js-plugins-editor/lib/Editor/__test__/MultiDecorator'>; +} +declare module 'draft-js-plugins-editor/lib/Editor/createCompositeDecorator.js' { + declare module.exports: $Exports<'draft-js-plugins-editor/lib/Editor/createCompositeDecorator'>; +} +declare module 'draft-js-plugins-editor/lib/Editor/defaultKeyBindingPlugin.js' { + declare module.exports: $Exports<'draft-js-plugins-editor/lib/Editor/defaultKeyBindingPlugin'>; +} +declare module 'draft-js-plugins-editor/lib/Editor/index.js' { + declare module.exports: $Exports<'draft-js-plugins-editor/lib/Editor/index'>; +} +declare module 'draft-js-plugins-editor/lib/Editor/moveSelectionToEnd.js' { + declare module.exports: $Exports<'draft-js-plugins-editor/lib/Editor/moveSelectionToEnd'>; +} +declare module 'draft-js-plugins-editor/lib/Editor/MultiDecorator.js' { + declare module.exports: $Exports<'draft-js-plugins-editor/lib/Editor/MultiDecorator'>; +} +declare module 'draft-js-plugins-editor/lib/Editor/proxies.js' { + declare module.exports: $Exports<'draft-js-plugins-editor/lib/Editor/proxies'>; +} +declare module 'draft-js-plugins-editor/lib/index.js' { + declare module.exports: $Exports<'draft-js-plugins-editor/lib/index'>; +} +declare module 'draft-js-plugins-editor/lib/modifiers/moveToEndOfSelectedBlock.js' { + declare module.exports: $Exports<'draft-js-plugins-editor/lib/modifiers/moveToEndOfSelectedBlock'>; +} +declare module 'draft-js-plugins-editor/lib/modifiers/moveToStartOfSelectedBlock.js' { + declare module.exports: $Exports<'draft-js-plugins-editor/lib/modifiers/moveToStartOfSelectedBlock'>; +} +declare module 'draft-js-plugins-editor/lib/utils/composeDecorators.js' { + declare module.exports: $Exports<'draft-js-plugins-editor/lib/utils/composeDecorators'>; +} +declare module 'draft-js-plugins-editor/lib/utils/createCompositeDecorator.js' { + declare module.exports: $Exports<'draft-js-plugins-editor/lib/utils/createCompositeDecorator'>; +} +declare module 'draft-js-plugins-editor/lib/utils/createEditorStateWithText.js' { + declare module.exports: $Exports<'draft-js-plugins-editor/lib/utils/createEditorStateWithText'>; +} +declare module 'draft-js-plugins-editor/lib/utils/moveSelectionToEnd.js' { + declare module.exports: $Exports<'draft-js-plugins-editor/lib/utils/moveSelectionToEnd'>; +} diff --git a/flow-typed/npm/draft-js-prism-plugin_vx.x.x.js b/flow-typed/npm/draft-js-prism-plugin_vx.x.x.js new file mode 100644 index 0000000000..0302ea0f02 --- /dev/null +++ b/flow-typed/npm/draft-js-prism-plugin_vx.x.x.js @@ -0,0 +1,172 @@ +// flow-typed signature: cda5ecede2b0f032fb296bd71014c408 +// flow-typed version: <>/draft-js-prism-plugin_v0.1.1/flow_v0.55.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'draft-js-prism-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-prism-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-prism-plugin/dist/index' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-cli_vx.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-core_vx.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-eslint_vx.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-plugin-transform-runtime_vx.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-polyfill_vx.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-preset-env_vx.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-preset-es2015_vx.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-preset-flow_vx.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-preset-stage-2_vx.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/draft-js-prism_vx.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/eslint_vx.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/eslint-plugin-babel_vx.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/flow-bin_v0.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/husky_vx.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/jest_v19.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/lint-staged_vx.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/prettier_vx.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/flow-typed/npm/rimraf_vx.x.x' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/src/index' { + declare module.exports: any; +} + +declare module 'draft-js-prism-plugin/src/test/index.test' { + declare module.exports: any; +} + +// Filename aliases +declare module 'draft-js-prism-plugin/dist/index.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/dist/index'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-cli_vx.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/babel-cli_vx.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-core_vx.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/babel-core_vx.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-eslint_vx.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/babel-eslint_vx.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-plugin-transform-runtime_vx.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/babel-plugin-transform-runtime_vx.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-polyfill_vx.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/babel-polyfill_vx.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-preset-env_vx.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/babel-preset-env_vx.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-preset-es2015_vx.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/babel-preset-es2015_vx.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-preset-flow_vx.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/babel-preset-flow_vx.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/babel-preset-stage-2_vx.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/babel-preset-stage-2_vx.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/draft-js-prism_vx.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/draft-js-prism_vx.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/eslint_vx.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/eslint_vx.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/eslint-plugin-babel_vx.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/eslint-plugin-babel_vx.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/flow-bin_v0.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/flow-bin_v0.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/husky_vx.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/husky_vx.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/jest_v19.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/jest_v19.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/lint-staged_vx.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/lint-staged_vx.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/prettier_vx.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/prettier_vx.x.x'>; +} +declare module 'draft-js-prism-plugin/flow-typed/npm/rimraf_vx.x.x.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/flow-typed/npm/rimraf_vx.x.x'>; +} +declare module 'draft-js-prism-plugin/src/index.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/src/index'>; +} +declare module 'draft-js-prism-plugin/src/test/index.test.js' { + declare module.exports: $Exports<'draft-js-prism-plugin/src/test/index.test'>; +} diff --git a/flow-typed/npm/draft-js-single-line-plugin_vx.x.x.js b/flow-typed/npm/draft-js-single-line-plugin_vx.x.x.js new file mode 100644 index 0000000000..26b3ef6d50 --- /dev/null +++ b/flow-typed/npm/draft-js-single-line-plugin_vx.x.x.js @@ -0,0 +1,53 @@ +// flow-typed signature: 09d7e9659de8df545ddd929e1792d7f0 +// flow-typed version: <>/draft-js-single-line-plugin_v^2.0.1/flow_v0.55.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'draft-js-single-line-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-single-line-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-single-line-plugin/lib/index' { + declare module.exports: any; +} + +declare module 'draft-js-single-line-plugin/lib/utils' { + declare module.exports: any; +} + +declare module 'draft-js-single-line-plugin/test/fixtures/content' { + declare module.exports: any; +} + +declare module 'draft-js-single-line-plugin/test/index' { + declare module.exports: any; +} + +// Filename aliases +declare module 'draft-js-single-line-plugin/lib/index.js' { + declare module.exports: $Exports<'draft-js-single-line-plugin/lib/index'>; +} +declare module 'draft-js-single-line-plugin/lib/utils.js' { + declare module.exports: $Exports<'draft-js-single-line-plugin/lib/utils'>; +} +declare module 'draft-js-single-line-plugin/test/fixtures/content.js' { + declare module.exports: $Exports<'draft-js-single-line-plugin/test/fixtures/content'>; +} +declare module 'draft-js-single-line-plugin/test/index.js' { + declare module.exports: $Exports<'draft-js-single-line-plugin/test/index'>; +} diff --git a/flow-typed/npm/draftjs-to-markdown_vx.x.x.js b/flow-typed/npm/draftjs-to-markdown_vx.x.x.js new file mode 100644 index 0000000000..acfae7fc7b --- /dev/null +++ b/flow-typed/npm/draftjs-to-markdown_vx.x.x.js @@ -0,0 +1,32 @@ +// flow-typed signature: f3ff15cf91134e81c25cbad26151d901 +// flow-typed version: <>/draftjs-to-markdown_v^0.4.2/flow_v0.55.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'draftjs-to-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 'draftjs-to-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 'draftjs-to-markdown/lib/draftjs-to-markdown' { + declare module.exports: any; +} + +// Filename aliases +declare module 'draftjs-to-markdown/lib/draftjs-to-markdown.js' { + declare module.exports: $Exports<'draftjs-to-markdown/lib/draftjs-to-markdown'>; +} diff --git a/flow-typed/npm/prismjs_vx.x.x.js b/flow-typed/npm/prismjs_vx.x.x.js new file mode 100644 index 0000000000..3b1e79fe9c --- /dev/null +++ b/flow-typed/npm/prismjs_vx.x.x.js @@ -0,0 +1,2307 @@ +// flow-typed signature: 3b1ba7420dcdbc68c7f45da488fb0141 +// flow-typed version: <>/prismjs_v^1.8.1/flow_v0.55.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'prismjs' + * + * 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 'prismjs' { + 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 'prismjs/components' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-abap' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-abap.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-actionscript' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-actionscript.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-ada' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-ada.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-apacheconf' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-apacheconf.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-apl' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-apl.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-applescript' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-applescript.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-arduino' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-arduino.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-asciidoc' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-asciidoc.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-aspnet' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-aspnet.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-autohotkey' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-autohotkey.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-autoit' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-autoit.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-bash' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-bash.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-basic' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-basic.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-batch' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-batch.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-bison' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-bison.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-brainfuck' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-brainfuck.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-bro' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-bro.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-c' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-c.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-clike' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-clike.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-coffeescript' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-coffeescript.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-core' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-core.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-cpp' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-cpp.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-crystal' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-crystal.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-csharp' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-csharp.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-css-extras' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-css-extras.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-css' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-css.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-d' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-d.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-dart' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-dart.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-diff' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-diff.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-django' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-django.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-docker' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-docker.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-eiffel' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-eiffel.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-elixir' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-elixir.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-erlang' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-erlang.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-fortran' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-fortran.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-fsharp' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-fsharp.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-gherkin' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-gherkin.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-git' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-git.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-glsl' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-glsl.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-go' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-go.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-graphql' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-graphql.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-groovy' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-groovy.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-haml' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-haml.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-handlebars' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-handlebars.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-haskell' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-haskell.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-haxe' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-haxe.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-http' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-http.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-icon' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-icon.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-inform7' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-inform7.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-ini' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-ini.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-j' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-j.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-jade' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-jade.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-java' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-java.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-javascript' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-javascript.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-jolie' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-jolie.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-json' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-json.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-jsx' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-jsx.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-julia' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-julia.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-keyman' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-keyman.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-kotlin' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-kotlin.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-latex' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-latex.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-less' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-less.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-livescript' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-livescript.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-lolcode' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-lolcode.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-lua' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-lua.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-makefile' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-makefile.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-markdown' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-markdown.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-markup' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-markup.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-matlab' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-matlab.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-mel' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-mel.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-mizar' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-mizar.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-monkey' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-monkey.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-n4js' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-n4js.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-nasm' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-nasm.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-nginx' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-nginx.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-nim' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-nim.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-nix' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-nix.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-nsis' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-nsis.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-objectivec' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-objectivec.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-ocaml' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-ocaml.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-opencl' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-opencl.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-oz' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-oz.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-parigp' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-parigp.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-parser' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-parser.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-pascal' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-pascal.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-perl' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-perl.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-php-extras' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-php-extras.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-php' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-php.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-powershell' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-powershell.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-processing' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-processing.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-prolog' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-prolog.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-properties' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-properties.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-protobuf' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-protobuf.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-puppet' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-puppet.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-pure' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-pure.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-python' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-python.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-q' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-q.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-qore' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-qore.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-r' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-r.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-reason' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-reason.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-renpy' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-renpy.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-rest' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-rest.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-rip' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-rip.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-roboconf' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-roboconf.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-ruby' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-ruby.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-rust' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-rust.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-sas' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-sas.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-sass' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-sass.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-scala' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-scala.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-scheme' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-scheme.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-scss' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-scss.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-smalltalk' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-smalltalk.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-smarty' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-smarty.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-sql' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-sql.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-stylus' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-stylus.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-swift' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-swift.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-tcl' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-tcl.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-textile' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-textile.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-twig' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-twig.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-typescript' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-typescript.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-vbnet' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-vbnet.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-verilog' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-verilog.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-vhdl' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-vhdl.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-vim' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-vim.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-wiki' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-wiki.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-xojo' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-xojo.min' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-yaml' { + declare module.exports: any; +} + +declare module 'prismjs/components/prism-yaml.min' { + declare module.exports: any; +} + +declare module 'prismjs/examples' { + declare module.exports: any; +} + +declare module 'prismjs/gulpfile' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/autolinker/prism-autolinker' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/autolinker/prism-autolinker.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/autoloader/prism-autoloader' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/autoloader/prism-autoloader.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/command-line/prism-command-line' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/command-line/prism-command-line.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/custom-class/prism-custom-class' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/custom-class/prism-custom-class.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/data-uri-highlight/prism-data-uri-highlight' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/data-uri-highlight/prism-data-uri-highlight.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/file-highlight/prism-file-highlight' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/file-highlight/prism-file-highlight.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/highlight-keywords/prism-highlight-keywords' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/highlight-keywords/prism-highlight-keywords.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/jsonp-highlight/prism-jsonp-highlight' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/jsonp-highlight/prism-jsonp-highlight.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/keep-markup/prism-keep-markup' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/keep-markup/prism-keep-markup.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/line-highlight/prism-line-highlight' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/line-highlight/prism-line-highlight.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/line-numbers/prism-line-numbers' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/line-numbers/prism-line-numbers.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/normalize-whitespace/prism-normalize-whitespace' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/normalize-whitespace/prism-normalize-whitespace.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/previewer-angle/prism-previewer-angle' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/previewer-angle/prism-previewer-angle.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/previewer-base/prism-previewer-base' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/previewer-base/prism-previewer-base.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/previewer-color/prism-previewer-color' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/previewer-color/prism-previewer-color.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/previewer-easing/prism-previewer-easing' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/previewer-easing/prism-previewer-easing.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/previewer-gradient/prism-previewer-gradient' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/previewer-gradient/prism-previewer-gradient.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/previewer-time/prism-previewer-time' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/previewer-time/prism-previewer-time.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/remove-initial-line-feed/prism-remove-initial-line-feed' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/show-invisibles/prism-show-invisibles' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/show-invisibles/prism-show-invisibles.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/show-language/prism-show-language' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/show-language/prism-show-language.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/toolbar/prism-toolbar' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/toolbar/prism-toolbar.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/unescaped-markup/prism-unescaped-markup' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/unescaped-markup/prism-unescaped-markup.min' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/wpd/prism-wpd' { + declare module.exports: any; +} + +declare module 'prismjs/plugins/wpd/prism-wpd.min' { + declare module.exports: any; +} + +declare module 'prismjs/prism' { + declare module.exports: any; +} + +declare module 'prismjs/tests/helper/components' { + declare module.exports: any; +} + +declare module 'prismjs/tests/helper/prism-loader' { + declare module.exports: any; +} + +declare module 'prismjs/tests/helper/test-case' { + declare module.exports: any; +} + +declare module 'prismjs/tests/helper/test-discovery' { + declare module.exports: any; +} + +declare module 'prismjs/tests/helper/token-stream-transformer' { + declare module.exports: any; +} + +declare module 'prismjs/tests/languages/asciidoc/entity_feature' { + declare module.exports: any; +} + +declare module 'prismjs/tests/languages/groovy/issue1049' { + declare module.exports: any; +} + +declare module 'prismjs/tests/languages/groovy/string-interpolation_feature' { + declare module.exports: any; +} + +declare module 'prismjs/tests/languages/handlebars/handlebars_in_markup_feature' { + declare module.exports: any; +} + +declare module 'prismjs/tests/languages/markup/entity_feature' { + declare module.exports: any; +} + +declare module 'prismjs/tests/languages/markup+php/php_in_markup_feature' { + declare module.exports: any; +} + +declare module 'prismjs/tests/languages/smarty/smarty_in_markup_feature' { + declare module.exports: any; +} + +declare module 'prismjs/tests/run-child' { + declare module.exports: any; +} + +declare module 'prismjs/tests/run' { + declare module.exports: any; +} + +declare module 'prismjs/tests/testrunner-tests' { + declare module.exports: any; +} + +declare module 'prismjs/vendor/FileSaver.min' { + declare module.exports: any; +} + +declare module 'prismjs/vendor/jszip.min' { + declare module.exports: any; +} + +declare module 'prismjs/vendor/promise' { + declare module.exports: any; +} + +// Filename aliases +declare module 'prismjs/components.js' { + declare module.exports: $Exports<'prismjs/components'>; +} +declare module 'prismjs/components/prism-abap.js' { + declare module.exports: $Exports<'prismjs/components/prism-abap'>; +} +declare module 'prismjs/components/prism-abap.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-abap.min'>; +} +declare module 'prismjs/components/prism-actionscript.js' { + declare module.exports: $Exports<'prismjs/components/prism-actionscript'>; +} +declare module 'prismjs/components/prism-actionscript.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-actionscript.min'>; +} +declare module 'prismjs/components/prism-ada.js' { + declare module.exports: $Exports<'prismjs/components/prism-ada'>; +} +declare module 'prismjs/components/prism-ada.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-ada.min'>; +} +declare module 'prismjs/components/prism-apacheconf.js' { + declare module.exports: $Exports<'prismjs/components/prism-apacheconf'>; +} +declare module 'prismjs/components/prism-apacheconf.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-apacheconf.min'>; +} +declare module 'prismjs/components/prism-apl.js' { + declare module.exports: $Exports<'prismjs/components/prism-apl'>; +} +declare module 'prismjs/components/prism-apl.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-apl.min'>; +} +declare module 'prismjs/components/prism-applescript.js' { + declare module.exports: $Exports<'prismjs/components/prism-applescript'>; +} +declare module 'prismjs/components/prism-applescript.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-applescript.min'>; +} +declare module 'prismjs/components/prism-arduino.js' { + declare module.exports: $Exports<'prismjs/components/prism-arduino'>; +} +declare module 'prismjs/components/prism-arduino.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-arduino.min'>; +} +declare module 'prismjs/components/prism-asciidoc.js' { + declare module.exports: $Exports<'prismjs/components/prism-asciidoc'>; +} +declare module 'prismjs/components/prism-asciidoc.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-asciidoc.min'>; +} +declare module 'prismjs/components/prism-aspnet.js' { + declare module.exports: $Exports<'prismjs/components/prism-aspnet'>; +} +declare module 'prismjs/components/prism-aspnet.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-aspnet.min'>; +} +declare module 'prismjs/components/prism-autohotkey.js' { + declare module.exports: $Exports<'prismjs/components/prism-autohotkey'>; +} +declare module 'prismjs/components/prism-autohotkey.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-autohotkey.min'>; +} +declare module 'prismjs/components/prism-autoit.js' { + declare module.exports: $Exports<'prismjs/components/prism-autoit'>; +} +declare module 'prismjs/components/prism-autoit.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-autoit.min'>; +} +declare module 'prismjs/components/prism-bash.js' { + declare module.exports: $Exports<'prismjs/components/prism-bash'>; +} +declare module 'prismjs/components/prism-bash.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-bash.min'>; +} +declare module 'prismjs/components/prism-basic.js' { + declare module.exports: $Exports<'prismjs/components/prism-basic'>; +} +declare module 'prismjs/components/prism-basic.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-basic.min'>; +} +declare module 'prismjs/components/prism-batch.js' { + declare module.exports: $Exports<'prismjs/components/prism-batch'>; +} +declare module 'prismjs/components/prism-batch.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-batch.min'>; +} +declare module 'prismjs/components/prism-bison.js' { + declare module.exports: $Exports<'prismjs/components/prism-bison'>; +} +declare module 'prismjs/components/prism-bison.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-bison.min'>; +} +declare module 'prismjs/components/prism-brainfuck.js' { + declare module.exports: $Exports<'prismjs/components/prism-brainfuck'>; +} +declare module 'prismjs/components/prism-brainfuck.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-brainfuck.min'>; +} +declare module 'prismjs/components/prism-bro.js' { + declare module.exports: $Exports<'prismjs/components/prism-bro'>; +} +declare module 'prismjs/components/prism-bro.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-bro.min'>; +} +declare module 'prismjs/components/prism-c.js' { + declare module.exports: $Exports<'prismjs/components/prism-c'>; +} +declare module 'prismjs/components/prism-c.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-c.min'>; +} +declare module 'prismjs/components/prism-clike.js' { + declare module.exports: $Exports<'prismjs/components/prism-clike'>; +} +declare module 'prismjs/components/prism-clike.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-clike.min'>; +} +declare module 'prismjs/components/prism-coffeescript.js' { + declare module.exports: $Exports<'prismjs/components/prism-coffeescript'>; +} +declare module 'prismjs/components/prism-coffeescript.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-coffeescript.min'>; +} +declare module 'prismjs/components/prism-core.js' { + declare module.exports: $Exports<'prismjs/components/prism-core'>; +} +declare module 'prismjs/components/prism-core.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-core.min'>; +} +declare module 'prismjs/components/prism-cpp.js' { + declare module.exports: $Exports<'prismjs/components/prism-cpp'>; +} +declare module 'prismjs/components/prism-cpp.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-cpp.min'>; +} +declare module 'prismjs/components/prism-crystal.js' { + declare module.exports: $Exports<'prismjs/components/prism-crystal'>; +} +declare module 'prismjs/components/prism-crystal.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-crystal.min'>; +} +declare module 'prismjs/components/prism-csharp.js' { + declare module.exports: $Exports<'prismjs/components/prism-csharp'>; +} +declare module 'prismjs/components/prism-csharp.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-csharp.min'>; +} +declare module 'prismjs/components/prism-css-extras.js' { + declare module.exports: $Exports<'prismjs/components/prism-css-extras'>; +} +declare module 'prismjs/components/prism-css-extras.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-css-extras.min'>; +} +declare module 'prismjs/components/prism-css.js' { + declare module.exports: $Exports<'prismjs/components/prism-css'>; +} +declare module 'prismjs/components/prism-css.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-css.min'>; +} +declare module 'prismjs/components/prism-d.js' { + declare module.exports: $Exports<'prismjs/components/prism-d'>; +} +declare module 'prismjs/components/prism-d.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-d.min'>; +} +declare module 'prismjs/components/prism-dart.js' { + declare module.exports: $Exports<'prismjs/components/prism-dart'>; +} +declare module 'prismjs/components/prism-dart.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-dart.min'>; +} +declare module 'prismjs/components/prism-diff.js' { + declare module.exports: $Exports<'prismjs/components/prism-diff'>; +} +declare module 'prismjs/components/prism-diff.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-diff.min'>; +} +declare module 'prismjs/components/prism-django.js' { + declare module.exports: $Exports<'prismjs/components/prism-django'>; +} +declare module 'prismjs/components/prism-django.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-django.min'>; +} +declare module 'prismjs/components/prism-docker.js' { + declare module.exports: $Exports<'prismjs/components/prism-docker'>; +} +declare module 'prismjs/components/prism-docker.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-docker.min'>; +} +declare module 'prismjs/components/prism-eiffel.js' { + declare module.exports: $Exports<'prismjs/components/prism-eiffel'>; +} +declare module 'prismjs/components/prism-eiffel.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-eiffel.min'>; +} +declare module 'prismjs/components/prism-elixir.js' { + declare module.exports: $Exports<'prismjs/components/prism-elixir'>; +} +declare module 'prismjs/components/prism-elixir.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-elixir.min'>; +} +declare module 'prismjs/components/prism-erlang.js' { + declare module.exports: $Exports<'prismjs/components/prism-erlang'>; +} +declare module 'prismjs/components/prism-erlang.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-erlang.min'>; +} +declare module 'prismjs/components/prism-fortran.js' { + declare module.exports: $Exports<'prismjs/components/prism-fortran'>; +} +declare module 'prismjs/components/prism-fortran.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-fortran.min'>; +} +declare module 'prismjs/components/prism-fsharp.js' { + declare module.exports: $Exports<'prismjs/components/prism-fsharp'>; +} +declare module 'prismjs/components/prism-fsharp.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-fsharp.min'>; +} +declare module 'prismjs/components/prism-gherkin.js' { + declare module.exports: $Exports<'prismjs/components/prism-gherkin'>; +} +declare module 'prismjs/components/prism-gherkin.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-gherkin.min'>; +} +declare module 'prismjs/components/prism-git.js' { + declare module.exports: $Exports<'prismjs/components/prism-git'>; +} +declare module 'prismjs/components/prism-git.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-git.min'>; +} +declare module 'prismjs/components/prism-glsl.js' { + declare module.exports: $Exports<'prismjs/components/prism-glsl'>; +} +declare module 'prismjs/components/prism-glsl.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-glsl.min'>; +} +declare module 'prismjs/components/prism-go.js' { + declare module.exports: $Exports<'prismjs/components/prism-go'>; +} +declare module 'prismjs/components/prism-go.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-go.min'>; +} +declare module 'prismjs/components/prism-graphql.js' { + declare module.exports: $Exports<'prismjs/components/prism-graphql'>; +} +declare module 'prismjs/components/prism-graphql.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-graphql.min'>; +} +declare module 'prismjs/components/prism-groovy.js' { + declare module.exports: $Exports<'prismjs/components/prism-groovy'>; +} +declare module 'prismjs/components/prism-groovy.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-groovy.min'>; +} +declare module 'prismjs/components/prism-haml.js' { + declare module.exports: $Exports<'prismjs/components/prism-haml'>; +} +declare module 'prismjs/components/prism-haml.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-haml.min'>; +} +declare module 'prismjs/components/prism-handlebars.js' { + declare module.exports: $Exports<'prismjs/components/prism-handlebars'>; +} +declare module 'prismjs/components/prism-handlebars.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-handlebars.min'>; +} +declare module 'prismjs/components/prism-haskell.js' { + declare module.exports: $Exports<'prismjs/components/prism-haskell'>; +} +declare module 'prismjs/components/prism-haskell.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-haskell.min'>; +} +declare module 'prismjs/components/prism-haxe.js' { + declare module.exports: $Exports<'prismjs/components/prism-haxe'>; +} +declare module 'prismjs/components/prism-haxe.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-haxe.min'>; +} +declare module 'prismjs/components/prism-http.js' { + declare module.exports: $Exports<'prismjs/components/prism-http'>; +} +declare module 'prismjs/components/prism-http.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-http.min'>; +} +declare module 'prismjs/components/prism-icon.js' { + declare module.exports: $Exports<'prismjs/components/prism-icon'>; +} +declare module 'prismjs/components/prism-icon.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-icon.min'>; +} +declare module 'prismjs/components/prism-inform7.js' { + declare module.exports: $Exports<'prismjs/components/prism-inform7'>; +} +declare module 'prismjs/components/prism-inform7.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-inform7.min'>; +} +declare module 'prismjs/components/prism-ini.js' { + declare module.exports: $Exports<'prismjs/components/prism-ini'>; +} +declare module 'prismjs/components/prism-ini.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-ini.min'>; +} +declare module 'prismjs/components/prism-j.js' { + declare module.exports: $Exports<'prismjs/components/prism-j'>; +} +declare module 'prismjs/components/prism-j.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-j.min'>; +} +declare module 'prismjs/components/prism-jade.js' { + declare module.exports: $Exports<'prismjs/components/prism-jade'>; +} +declare module 'prismjs/components/prism-jade.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-jade.min'>; +} +declare module 'prismjs/components/prism-java.js' { + declare module.exports: $Exports<'prismjs/components/prism-java'>; +} +declare module 'prismjs/components/prism-java.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-java.min'>; +} +declare module 'prismjs/components/prism-javascript.js' { + declare module.exports: $Exports<'prismjs/components/prism-javascript'>; +} +declare module 'prismjs/components/prism-javascript.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-javascript.min'>; +} +declare module 'prismjs/components/prism-jolie.js' { + declare module.exports: $Exports<'prismjs/components/prism-jolie'>; +} +declare module 'prismjs/components/prism-jolie.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-jolie.min'>; +} +declare module 'prismjs/components/prism-json.js' { + declare module.exports: $Exports<'prismjs/components/prism-json'>; +} +declare module 'prismjs/components/prism-json.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-json.min'>; +} +declare module 'prismjs/components/prism-jsx.js' { + declare module.exports: $Exports<'prismjs/components/prism-jsx'>; +} +declare module 'prismjs/components/prism-jsx.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-jsx.min'>; +} +declare module 'prismjs/components/prism-julia.js' { + declare module.exports: $Exports<'prismjs/components/prism-julia'>; +} +declare module 'prismjs/components/prism-julia.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-julia.min'>; +} +declare module 'prismjs/components/prism-keyman.js' { + declare module.exports: $Exports<'prismjs/components/prism-keyman'>; +} +declare module 'prismjs/components/prism-keyman.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-keyman.min'>; +} +declare module 'prismjs/components/prism-kotlin.js' { + declare module.exports: $Exports<'prismjs/components/prism-kotlin'>; +} +declare module 'prismjs/components/prism-kotlin.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-kotlin.min'>; +} +declare module 'prismjs/components/prism-latex.js' { + declare module.exports: $Exports<'prismjs/components/prism-latex'>; +} +declare module 'prismjs/components/prism-latex.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-latex.min'>; +} +declare module 'prismjs/components/prism-less.js' { + declare module.exports: $Exports<'prismjs/components/prism-less'>; +} +declare module 'prismjs/components/prism-less.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-less.min'>; +} +declare module 'prismjs/components/prism-livescript.js' { + declare module.exports: $Exports<'prismjs/components/prism-livescript'>; +} +declare module 'prismjs/components/prism-livescript.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-livescript.min'>; +} +declare module 'prismjs/components/prism-lolcode.js' { + declare module.exports: $Exports<'prismjs/components/prism-lolcode'>; +} +declare module 'prismjs/components/prism-lolcode.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-lolcode.min'>; +} +declare module 'prismjs/components/prism-lua.js' { + declare module.exports: $Exports<'prismjs/components/prism-lua'>; +} +declare module 'prismjs/components/prism-lua.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-lua.min'>; +} +declare module 'prismjs/components/prism-makefile.js' { + declare module.exports: $Exports<'prismjs/components/prism-makefile'>; +} +declare module 'prismjs/components/prism-makefile.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-makefile.min'>; +} +declare module 'prismjs/components/prism-markdown.js' { + declare module.exports: $Exports<'prismjs/components/prism-markdown'>; +} +declare module 'prismjs/components/prism-markdown.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-markdown.min'>; +} +declare module 'prismjs/components/prism-markup.js' { + declare module.exports: $Exports<'prismjs/components/prism-markup'>; +} +declare module 'prismjs/components/prism-markup.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-markup.min'>; +} +declare module 'prismjs/components/prism-matlab.js' { + declare module.exports: $Exports<'prismjs/components/prism-matlab'>; +} +declare module 'prismjs/components/prism-matlab.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-matlab.min'>; +} +declare module 'prismjs/components/prism-mel.js' { + declare module.exports: $Exports<'prismjs/components/prism-mel'>; +} +declare module 'prismjs/components/prism-mel.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-mel.min'>; +} +declare module 'prismjs/components/prism-mizar.js' { + declare module.exports: $Exports<'prismjs/components/prism-mizar'>; +} +declare module 'prismjs/components/prism-mizar.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-mizar.min'>; +} +declare module 'prismjs/components/prism-monkey.js' { + declare module.exports: $Exports<'prismjs/components/prism-monkey'>; +} +declare module 'prismjs/components/prism-monkey.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-monkey.min'>; +} +declare module 'prismjs/components/prism-n4js.js' { + declare module.exports: $Exports<'prismjs/components/prism-n4js'>; +} +declare module 'prismjs/components/prism-n4js.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-n4js.min'>; +} +declare module 'prismjs/components/prism-nasm.js' { + declare module.exports: $Exports<'prismjs/components/prism-nasm'>; +} +declare module 'prismjs/components/prism-nasm.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-nasm.min'>; +} +declare module 'prismjs/components/prism-nginx.js' { + declare module.exports: $Exports<'prismjs/components/prism-nginx'>; +} +declare module 'prismjs/components/prism-nginx.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-nginx.min'>; +} +declare module 'prismjs/components/prism-nim.js' { + declare module.exports: $Exports<'prismjs/components/prism-nim'>; +} +declare module 'prismjs/components/prism-nim.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-nim.min'>; +} +declare module 'prismjs/components/prism-nix.js' { + declare module.exports: $Exports<'prismjs/components/prism-nix'>; +} +declare module 'prismjs/components/prism-nix.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-nix.min'>; +} +declare module 'prismjs/components/prism-nsis.js' { + declare module.exports: $Exports<'prismjs/components/prism-nsis'>; +} +declare module 'prismjs/components/prism-nsis.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-nsis.min'>; +} +declare module 'prismjs/components/prism-objectivec.js' { + declare module.exports: $Exports<'prismjs/components/prism-objectivec'>; +} +declare module 'prismjs/components/prism-objectivec.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-objectivec.min'>; +} +declare module 'prismjs/components/prism-ocaml.js' { + declare module.exports: $Exports<'prismjs/components/prism-ocaml'>; +} +declare module 'prismjs/components/prism-ocaml.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-ocaml.min'>; +} +declare module 'prismjs/components/prism-opencl.js' { + declare module.exports: $Exports<'prismjs/components/prism-opencl'>; +} +declare module 'prismjs/components/prism-opencl.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-opencl.min'>; +} +declare module 'prismjs/components/prism-oz.js' { + declare module.exports: $Exports<'prismjs/components/prism-oz'>; +} +declare module 'prismjs/components/prism-oz.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-oz.min'>; +} +declare module 'prismjs/components/prism-parigp.js' { + declare module.exports: $Exports<'prismjs/components/prism-parigp'>; +} +declare module 'prismjs/components/prism-parigp.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-parigp.min'>; +} +declare module 'prismjs/components/prism-parser.js' { + declare module.exports: $Exports<'prismjs/components/prism-parser'>; +} +declare module 'prismjs/components/prism-parser.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-parser.min'>; +} +declare module 'prismjs/components/prism-pascal.js' { + declare module.exports: $Exports<'prismjs/components/prism-pascal'>; +} +declare module 'prismjs/components/prism-pascal.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-pascal.min'>; +} +declare module 'prismjs/components/prism-perl.js' { + declare module.exports: $Exports<'prismjs/components/prism-perl'>; +} +declare module 'prismjs/components/prism-perl.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-perl.min'>; +} +declare module 'prismjs/components/prism-php-extras.js' { + declare module.exports: $Exports<'prismjs/components/prism-php-extras'>; +} +declare module 'prismjs/components/prism-php-extras.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-php-extras.min'>; +} +declare module 'prismjs/components/prism-php.js' { + declare module.exports: $Exports<'prismjs/components/prism-php'>; +} +declare module 'prismjs/components/prism-php.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-php.min'>; +} +declare module 'prismjs/components/prism-powershell.js' { + declare module.exports: $Exports<'prismjs/components/prism-powershell'>; +} +declare module 'prismjs/components/prism-powershell.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-powershell.min'>; +} +declare module 'prismjs/components/prism-processing.js' { + declare module.exports: $Exports<'prismjs/components/prism-processing'>; +} +declare module 'prismjs/components/prism-processing.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-processing.min'>; +} +declare module 'prismjs/components/prism-prolog.js' { + declare module.exports: $Exports<'prismjs/components/prism-prolog'>; +} +declare module 'prismjs/components/prism-prolog.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-prolog.min'>; +} +declare module 'prismjs/components/prism-properties.js' { + declare module.exports: $Exports<'prismjs/components/prism-properties'>; +} +declare module 'prismjs/components/prism-properties.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-properties.min'>; +} +declare module 'prismjs/components/prism-protobuf.js' { + declare module.exports: $Exports<'prismjs/components/prism-protobuf'>; +} +declare module 'prismjs/components/prism-protobuf.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-protobuf.min'>; +} +declare module 'prismjs/components/prism-puppet.js' { + declare module.exports: $Exports<'prismjs/components/prism-puppet'>; +} +declare module 'prismjs/components/prism-puppet.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-puppet.min'>; +} +declare module 'prismjs/components/prism-pure.js' { + declare module.exports: $Exports<'prismjs/components/prism-pure'>; +} +declare module 'prismjs/components/prism-pure.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-pure.min'>; +} +declare module 'prismjs/components/prism-python.js' { + declare module.exports: $Exports<'prismjs/components/prism-python'>; +} +declare module 'prismjs/components/prism-python.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-python.min'>; +} +declare module 'prismjs/components/prism-q.js' { + declare module.exports: $Exports<'prismjs/components/prism-q'>; +} +declare module 'prismjs/components/prism-q.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-q.min'>; +} +declare module 'prismjs/components/prism-qore.js' { + declare module.exports: $Exports<'prismjs/components/prism-qore'>; +} +declare module 'prismjs/components/prism-qore.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-qore.min'>; +} +declare module 'prismjs/components/prism-r.js' { + declare module.exports: $Exports<'prismjs/components/prism-r'>; +} +declare module 'prismjs/components/prism-r.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-r.min'>; +} +declare module 'prismjs/components/prism-reason.js' { + declare module.exports: $Exports<'prismjs/components/prism-reason'>; +} +declare module 'prismjs/components/prism-reason.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-reason.min'>; +} +declare module 'prismjs/components/prism-renpy.js' { + declare module.exports: $Exports<'prismjs/components/prism-renpy'>; +} +declare module 'prismjs/components/prism-renpy.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-renpy.min'>; +} +declare module 'prismjs/components/prism-rest.js' { + declare module.exports: $Exports<'prismjs/components/prism-rest'>; +} +declare module 'prismjs/components/prism-rest.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-rest.min'>; +} +declare module 'prismjs/components/prism-rip.js' { + declare module.exports: $Exports<'prismjs/components/prism-rip'>; +} +declare module 'prismjs/components/prism-rip.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-rip.min'>; +} +declare module 'prismjs/components/prism-roboconf.js' { + declare module.exports: $Exports<'prismjs/components/prism-roboconf'>; +} +declare module 'prismjs/components/prism-roboconf.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-roboconf.min'>; +} +declare module 'prismjs/components/prism-ruby.js' { + declare module.exports: $Exports<'prismjs/components/prism-ruby'>; +} +declare module 'prismjs/components/prism-ruby.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-ruby.min'>; +} +declare module 'prismjs/components/prism-rust.js' { + declare module.exports: $Exports<'prismjs/components/prism-rust'>; +} +declare module 'prismjs/components/prism-rust.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-rust.min'>; +} +declare module 'prismjs/components/prism-sas.js' { + declare module.exports: $Exports<'prismjs/components/prism-sas'>; +} +declare module 'prismjs/components/prism-sas.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-sas.min'>; +} +declare module 'prismjs/components/prism-sass.js' { + declare module.exports: $Exports<'prismjs/components/prism-sass'>; +} +declare module 'prismjs/components/prism-sass.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-sass.min'>; +} +declare module 'prismjs/components/prism-scala.js' { + declare module.exports: $Exports<'prismjs/components/prism-scala'>; +} +declare module 'prismjs/components/prism-scala.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-scala.min'>; +} +declare module 'prismjs/components/prism-scheme.js' { + declare module.exports: $Exports<'prismjs/components/prism-scheme'>; +} +declare module 'prismjs/components/prism-scheme.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-scheme.min'>; +} +declare module 'prismjs/components/prism-scss.js' { + declare module.exports: $Exports<'prismjs/components/prism-scss'>; +} +declare module 'prismjs/components/prism-scss.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-scss.min'>; +} +declare module 'prismjs/components/prism-smalltalk.js' { + declare module.exports: $Exports<'prismjs/components/prism-smalltalk'>; +} +declare module 'prismjs/components/prism-smalltalk.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-smalltalk.min'>; +} +declare module 'prismjs/components/prism-smarty.js' { + declare module.exports: $Exports<'prismjs/components/prism-smarty'>; +} +declare module 'prismjs/components/prism-smarty.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-smarty.min'>; +} +declare module 'prismjs/components/prism-sql.js' { + declare module.exports: $Exports<'prismjs/components/prism-sql'>; +} +declare module 'prismjs/components/prism-sql.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-sql.min'>; +} +declare module 'prismjs/components/prism-stylus.js' { + declare module.exports: $Exports<'prismjs/components/prism-stylus'>; +} +declare module 'prismjs/components/prism-stylus.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-stylus.min'>; +} +declare module 'prismjs/components/prism-swift.js' { + declare module.exports: $Exports<'prismjs/components/prism-swift'>; +} +declare module 'prismjs/components/prism-swift.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-swift.min'>; +} +declare module 'prismjs/components/prism-tcl.js' { + declare module.exports: $Exports<'prismjs/components/prism-tcl'>; +} +declare module 'prismjs/components/prism-tcl.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-tcl.min'>; +} +declare module 'prismjs/components/prism-textile.js' { + declare module.exports: $Exports<'prismjs/components/prism-textile'>; +} +declare module 'prismjs/components/prism-textile.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-textile.min'>; +} +declare module 'prismjs/components/prism-twig.js' { + declare module.exports: $Exports<'prismjs/components/prism-twig'>; +} +declare module 'prismjs/components/prism-twig.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-twig.min'>; +} +declare module 'prismjs/components/prism-typescript.js' { + declare module.exports: $Exports<'prismjs/components/prism-typescript'>; +} +declare module 'prismjs/components/prism-typescript.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-typescript.min'>; +} +declare module 'prismjs/components/prism-vbnet.js' { + declare module.exports: $Exports<'prismjs/components/prism-vbnet'>; +} +declare module 'prismjs/components/prism-vbnet.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-vbnet.min'>; +} +declare module 'prismjs/components/prism-verilog.js' { + declare module.exports: $Exports<'prismjs/components/prism-verilog'>; +} +declare module 'prismjs/components/prism-verilog.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-verilog.min'>; +} +declare module 'prismjs/components/prism-vhdl.js' { + declare module.exports: $Exports<'prismjs/components/prism-vhdl'>; +} +declare module 'prismjs/components/prism-vhdl.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-vhdl.min'>; +} +declare module 'prismjs/components/prism-vim.js' { + declare module.exports: $Exports<'prismjs/components/prism-vim'>; +} +declare module 'prismjs/components/prism-vim.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-vim.min'>; +} +declare module 'prismjs/components/prism-wiki.js' { + declare module.exports: $Exports<'prismjs/components/prism-wiki'>; +} +declare module 'prismjs/components/prism-wiki.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-wiki.min'>; +} +declare module 'prismjs/components/prism-xojo.js' { + declare module.exports: $Exports<'prismjs/components/prism-xojo'>; +} +declare module 'prismjs/components/prism-xojo.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-xojo.min'>; +} +declare module 'prismjs/components/prism-yaml.js' { + declare module.exports: $Exports<'prismjs/components/prism-yaml'>; +} +declare module 'prismjs/components/prism-yaml.min.js' { + declare module.exports: $Exports<'prismjs/components/prism-yaml.min'>; +} +declare module 'prismjs/examples.js' { + declare module.exports: $Exports<'prismjs/examples'>; +} +declare module 'prismjs/gulpfile.js' { + declare module.exports: $Exports<'prismjs/gulpfile'>; +} +declare module 'prismjs/plugins/autolinker/prism-autolinker.js' { + declare module.exports: $Exports<'prismjs/plugins/autolinker/prism-autolinker'>; +} +declare module 'prismjs/plugins/autolinker/prism-autolinker.min.js' { + declare module.exports: $Exports<'prismjs/plugins/autolinker/prism-autolinker.min'>; +} +declare module 'prismjs/plugins/autoloader/prism-autoloader.js' { + declare module.exports: $Exports<'prismjs/plugins/autoloader/prism-autoloader'>; +} +declare module 'prismjs/plugins/autoloader/prism-autoloader.min.js' { + declare module.exports: $Exports<'prismjs/plugins/autoloader/prism-autoloader.min'>; +} +declare module 'prismjs/plugins/command-line/prism-command-line.js' { + declare module.exports: $Exports<'prismjs/plugins/command-line/prism-command-line'>; +} +declare module 'prismjs/plugins/command-line/prism-command-line.min.js' { + declare module.exports: $Exports<'prismjs/plugins/command-line/prism-command-line.min'>; +} +declare module 'prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard.js' { + declare module.exports: $Exports<'prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard'>; +} +declare module 'prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js' { + declare module.exports: $Exports<'prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard.min'>; +} +declare module 'prismjs/plugins/custom-class/prism-custom-class.js' { + declare module.exports: $Exports<'prismjs/plugins/custom-class/prism-custom-class'>; +} +declare module 'prismjs/plugins/custom-class/prism-custom-class.min.js' { + declare module.exports: $Exports<'prismjs/plugins/custom-class/prism-custom-class.min'>; +} +declare module 'prismjs/plugins/data-uri-highlight/prism-data-uri-highlight.js' { + declare module.exports: $Exports<'prismjs/plugins/data-uri-highlight/prism-data-uri-highlight'>; +} +declare module 'prismjs/plugins/data-uri-highlight/prism-data-uri-highlight.min.js' { + declare module.exports: $Exports<'prismjs/plugins/data-uri-highlight/prism-data-uri-highlight.min'>; +} +declare module 'prismjs/plugins/file-highlight/prism-file-highlight.js' { + declare module.exports: $Exports<'prismjs/plugins/file-highlight/prism-file-highlight'>; +} +declare module 'prismjs/plugins/file-highlight/prism-file-highlight.min.js' { + declare module.exports: $Exports<'prismjs/plugins/file-highlight/prism-file-highlight.min'>; +} +declare module 'prismjs/plugins/highlight-keywords/prism-highlight-keywords.js' { + declare module.exports: $Exports<'prismjs/plugins/highlight-keywords/prism-highlight-keywords'>; +} +declare module 'prismjs/plugins/highlight-keywords/prism-highlight-keywords.min.js' { + declare module.exports: $Exports<'prismjs/plugins/highlight-keywords/prism-highlight-keywords.min'>; +} +declare module 'prismjs/plugins/jsonp-highlight/prism-jsonp-highlight.js' { + declare module.exports: $Exports<'prismjs/plugins/jsonp-highlight/prism-jsonp-highlight'>; +} +declare module 'prismjs/plugins/jsonp-highlight/prism-jsonp-highlight.min.js' { + declare module.exports: $Exports<'prismjs/plugins/jsonp-highlight/prism-jsonp-highlight.min'>; +} +declare module 'prismjs/plugins/keep-markup/prism-keep-markup.js' { + declare module.exports: $Exports<'prismjs/plugins/keep-markup/prism-keep-markup'>; +} +declare module 'prismjs/plugins/keep-markup/prism-keep-markup.min.js' { + declare module.exports: $Exports<'prismjs/plugins/keep-markup/prism-keep-markup.min'>; +} +declare module 'prismjs/plugins/line-highlight/prism-line-highlight.js' { + declare module.exports: $Exports<'prismjs/plugins/line-highlight/prism-line-highlight'>; +} +declare module 'prismjs/plugins/line-highlight/prism-line-highlight.min.js' { + declare module.exports: $Exports<'prismjs/plugins/line-highlight/prism-line-highlight.min'>; +} +declare module 'prismjs/plugins/line-numbers/prism-line-numbers.js' { + declare module.exports: $Exports<'prismjs/plugins/line-numbers/prism-line-numbers'>; +} +declare module 'prismjs/plugins/line-numbers/prism-line-numbers.min.js' { + declare module.exports: $Exports<'prismjs/plugins/line-numbers/prism-line-numbers.min'>; +} +declare module 'prismjs/plugins/normalize-whitespace/prism-normalize-whitespace.js' { + declare module.exports: $Exports<'prismjs/plugins/normalize-whitespace/prism-normalize-whitespace'>; +} +declare module 'prismjs/plugins/normalize-whitespace/prism-normalize-whitespace.min.js' { + declare module.exports: $Exports<'prismjs/plugins/normalize-whitespace/prism-normalize-whitespace.min'>; +} +declare module 'prismjs/plugins/previewer-angle/prism-previewer-angle.js' { + declare module.exports: $Exports<'prismjs/plugins/previewer-angle/prism-previewer-angle'>; +} +declare module 'prismjs/plugins/previewer-angle/prism-previewer-angle.min.js' { + declare module.exports: $Exports<'prismjs/plugins/previewer-angle/prism-previewer-angle.min'>; +} +declare module 'prismjs/plugins/previewer-base/prism-previewer-base.js' { + declare module.exports: $Exports<'prismjs/plugins/previewer-base/prism-previewer-base'>; +} +declare module 'prismjs/plugins/previewer-base/prism-previewer-base.min.js' { + declare module.exports: $Exports<'prismjs/plugins/previewer-base/prism-previewer-base.min'>; +} +declare module 'prismjs/plugins/previewer-color/prism-previewer-color.js' { + declare module.exports: $Exports<'prismjs/plugins/previewer-color/prism-previewer-color'>; +} +declare module 'prismjs/plugins/previewer-color/prism-previewer-color.min.js' { + declare module.exports: $Exports<'prismjs/plugins/previewer-color/prism-previewer-color.min'>; +} +declare module 'prismjs/plugins/previewer-easing/prism-previewer-easing.js' { + declare module.exports: $Exports<'prismjs/plugins/previewer-easing/prism-previewer-easing'>; +} +declare module 'prismjs/plugins/previewer-easing/prism-previewer-easing.min.js' { + declare module.exports: $Exports<'prismjs/plugins/previewer-easing/prism-previewer-easing.min'>; +} +declare module 'prismjs/plugins/previewer-gradient/prism-previewer-gradient.js' { + declare module.exports: $Exports<'prismjs/plugins/previewer-gradient/prism-previewer-gradient'>; +} +declare module 'prismjs/plugins/previewer-gradient/prism-previewer-gradient.min.js' { + declare module.exports: $Exports<'prismjs/plugins/previewer-gradient/prism-previewer-gradient.min'>; +} +declare module 'prismjs/plugins/previewer-time/prism-previewer-time.js' { + declare module.exports: $Exports<'prismjs/plugins/previewer-time/prism-previewer-time'>; +} +declare module 'prismjs/plugins/previewer-time/prism-previewer-time.min.js' { + declare module.exports: $Exports<'prismjs/plugins/previewer-time/prism-previewer-time.min'>; +} +declare module 'prismjs/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js' { + declare module.exports: $Exports<'prismjs/plugins/remove-initial-line-feed/prism-remove-initial-line-feed'>; +} +declare module 'prismjs/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.min.js' { + declare module.exports: $Exports<'prismjs/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.min'>; +} +declare module 'prismjs/plugins/show-invisibles/prism-show-invisibles.js' { + declare module.exports: $Exports<'prismjs/plugins/show-invisibles/prism-show-invisibles'>; +} +declare module 'prismjs/plugins/show-invisibles/prism-show-invisibles.min.js' { + declare module.exports: $Exports<'prismjs/plugins/show-invisibles/prism-show-invisibles.min'>; +} +declare module 'prismjs/plugins/show-language/prism-show-language.js' { + declare module.exports: $Exports<'prismjs/plugins/show-language/prism-show-language'>; +} +declare module 'prismjs/plugins/show-language/prism-show-language.min.js' { + declare module.exports: $Exports<'prismjs/plugins/show-language/prism-show-language.min'>; +} +declare module 'prismjs/plugins/toolbar/prism-toolbar.js' { + declare module.exports: $Exports<'prismjs/plugins/toolbar/prism-toolbar'>; +} +declare module 'prismjs/plugins/toolbar/prism-toolbar.min.js' { + declare module.exports: $Exports<'prismjs/plugins/toolbar/prism-toolbar.min'>; +} +declare module 'prismjs/plugins/unescaped-markup/prism-unescaped-markup.js' { + declare module.exports: $Exports<'prismjs/plugins/unescaped-markup/prism-unescaped-markup'>; +} +declare module 'prismjs/plugins/unescaped-markup/prism-unescaped-markup.min.js' { + declare module.exports: $Exports<'prismjs/plugins/unescaped-markup/prism-unescaped-markup.min'>; +} +declare module 'prismjs/plugins/wpd/prism-wpd.js' { + declare module.exports: $Exports<'prismjs/plugins/wpd/prism-wpd'>; +} +declare module 'prismjs/plugins/wpd/prism-wpd.min.js' { + declare module.exports: $Exports<'prismjs/plugins/wpd/prism-wpd.min'>; +} +declare module 'prismjs/prism.js' { + declare module.exports: $Exports<'prismjs/prism'>; +} +declare module 'prismjs/tests/helper/components.js' { + declare module.exports: $Exports<'prismjs/tests/helper/components'>; +} +declare module 'prismjs/tests/helper/prism-loader.js' { + declare module.exports: $Exports<'prismjs/tests/helper/prism-loader'>; +} +declare module 'prismjs/tests/helper/test-case.js' { + declare module.exports: $Exports<'prismjs/tests/helper/test-case'>; +} +declare module 'prismjs/tests/helper/test-discovery.js' { + declare module.exports: $Exports<'prismjs/tests/helper/test-discovery'>; +} +declare module 'prismjs/tests/helper/token-stream-transformer.js' { + declare module.exports: $Exports<'prismjs/tests/helper/token-stream-transformer'>; +} +declare module 'prismjs/tests/languages/asciidoc/entity_feature.js' { + declare module.exports: $Exports<'prismjs/tests/languages/asciidoc/entity_feature'>; +} +declare module 'prismjs/tests/languages/groovy/issue1049.js' { + declare module.exports: $Exports<'prismjs/tests/languages/groovy/issue1049'>; +} +declare module 'prismjs/tests/languages/groovy/string-interpolation_feature.js' { + declare module.exports: $Exports<'prismjs/tests/languages/groovy/string-interpolation_feature'>; +} +declare module 'prismjs/tests/languages/handlebars/handlebars_in_markup_feature.js' { + declare module.exports: $Exports<'prismjs/tests/languages/handlebars/handlebars_in_markup_feature'>; +} +declare module 'prismjs/tests/languages/markup/entity_feature.js' { + declare module.exports: $Exports<'prismjs/tests/languages/markup/entity_feature'>; +} +declare module 'prismjs/tests/languages/markup+php/php_in_markup_feature.js' { + declare module.exports: $Exports<'prismjs/tests/languages/markup+php/php_in_markup_feature'>; +} +declare module 'prismjs/tests/languages/smarty/smarty_in_markup_feature.js' { + declare module.exports: $Exports<'prismjs/tests/languages/smarty/smarty_in_markup_feature'>; +} +declare module 'prismjs/tests/run-child.js' { + declare module.exports: $Exports<'prismjs/tests/run-child'>; +} +declare module 'prismjs/tests/run.js' { + declare module.exports: $Exports<'prismjs/tests/run'>; +} +declare module 'prismjs/tests/testrunner-tests.js' { + declare module.exports: $Exports<'prismjs/tests/testrunner-tests'>; +} +declare module 'prismjs/vendor/FileSaver.min.js' { + declare module.exports: $Exports<'prismjs/vendor/FileSaver.min'>; +} +declare module 'prismjs/vendor/jszip.min.js' { + declare module.exports: $Exports<'prismjs/vendor/jszip.min'>; +} +declare module 'prismjs/vendor/promise.js' { + declare module.exports: $Exports<'prismjs/vendor/promise'>; +} diff --git a/flow-typed/npm/redraft_vx.x.x.js b/flow-typed/npm/redraft_vx.x.x.js new file mode 100644 index 0000000000..482c372b68 --- /dev/null +++ b/flow-typed/npm/redraft_vx.x.x.js @@ -0,0 +1,123 @@ +// flow-typed signature: d11d41223a90775d23a96362be51c936 +// flow-typed version: <>/redraft_v^0.8.0/flow_v0.55.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'redraft' + * + * 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 'redraft' { + 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 'redraft/lib/ContentNode' { + declare module.exports: any; +} + +declare module 'redraft/lib/createStyleRenderer' { + declare module.exports: any; +} + +declare module 'redraft/lib/defaultOptions' { + declare module.exports: any; +} + +declare module 'redraft/lib/helpers/arrayEqual' { + declare module.exports: any; +} + +declare module 'redraft/lib/helpers/checkCleanup' { + declare module.exports: any; +} + +declare module 'redraft/lib/helpers/checkJoin' { + declare module.exports: any; +} + +declare module 'redraft/lib/helpers/getKeyGenerator' { + declare module.exports: any; +} + +declare module 'redraft/lib/helpers/pushString' { + declare module.exports: any; +} + +declare module 'redraft/lib/helpers/stubContentBlock' { + declare module.exports: any; +} + +declare module 'redraft/lib/helpers/warn' { + declare module.exports: any; +} + +declare module 'redraft/lib/index' { + declare module.exports: any; +} + +declare module 'redraft/lib/RawParser' { + declare module.exports: any; +} + +declare module 'redraft/lib/render' { + declare module.exports: any; +} + +declare module 'redraft/lib/withDecorators' { + declare module.exports: any; +} + +// Filename aliases +declare module 'redraft/lib/ContentNode.js' { + declare module.exports: $Exports<'redraft/lib/ContentNode'>; +} +declare module 'redraft/lib/createStyleRenderer.js' { + declare module.exports: $Exports<'redraft/lib/createStyleRenderer'>; +} +declare module 'redraft/lib/defaultOptions.js' { + declare module.exports: $Exports<'redraft/lib/defaultOptions'>; +} +declare module 'redraft/lib/helpers/arrayEqual.js' { + declare module.exports: $Exports<'redraft/lib/helpers/arrayEqual'>; +} +declare module 'redraft/lib/helpers/checkCleanup.js' { + declare module.exports: $Exports<'redraft/lib/helpers/checkCleanup'>; +} +declare module 'redraft/lib/helpers/checkJoin.js' { + declare module.exports: $Exports<'redraft/lib/helpers/checkJoin'>; +} +declare module 'redraft/lib/helpers/getKeyGenerator.js' { + declare module.exports: $Exports<'redraft/lib/helpers/getKeyGenerator'>; +} +declare module 'redraft/lib/helpers/pushString.js' { + declare module.exports: $Exports<'redraft/lib/helpers/pushString'>; +} +declare module 'redraft/lib/helpers/stubContentBlock.js' { + declare module.exports: $Exports<'redraft/lib/helpers/stubContentBlock'>; +} +declare module 'redraft/lib/helpers/warn.js' { + declare module.exports: $Exports<'redraft/lib/helpers/warn'>; +} +declare module 'redraft/lib/index.js' { + declare module.exports: $Exports<'redraft/lib/index'>; +} +declare module 'redraft/lib/RawParser.js' { + declare module.exports: $Exports<'redraft/lib/RawParser'>; +} +declare module 'redraft/lib/render.js' { + declare module.exports: $Exports<'redraft/lib/render'>; +} +declare module 'redraft/lib/withDecorators.js' { + declare module.exports: $Exports<'redraft/lib/withDecorators'>; +} diff --git a/flow-typed/npm/sw-precache-webpack-plugin_vx.x.x.js b/flow-typed/npm/sw-precache-webpack-plugin_vx.x.x.js new file mode 100644 index 0000000000..3f33b353fb --- /dev/null +++ b/flow-typed/npm/sw-precache-webpack-plugin_vx.x.x.js @@ -0,0 +1,32 @@ +// flow-typed signature: 826072f240804002f9454a5f268a6857 +// flow-typed version: <>/sw-precache-webpack-plugin_v^0.11.4/flow_v0.55.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'sw-precache-webpack-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 'sw-precache-webpack-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 'sw-precache-webpack-plugin/lib/index' { + declare module.exports: any; +} + +// Filename aliases +declare module 'sw-precache-webpack-plugin/lib/index.js' { + declare module.exports: $Exports<'sw-precache-webpack-plugin/lib/index'>; +} diff --git a/iris/migrations/20170928143435-slate-to-draftjs.js.js b/iris/migrations/20170928143435-slate-to-draftjs.js.js new file mode 100644 index 0000000000..66060e3b46 --- /dev/null +++ b/iris/migrations/20170928143435-slate-to-draftjs.js.js @@ -0,0 +1,110 @@ +'use strict'; +const compose = require('redux/lib/compose').default; +const { convertToRaw, genKey } = require('draft-js'); +const { stateFromMarkdown } = require('draft-js-import-markdown'); +const isHtml = require('is-html'); +const cheerio = require('cheerio'); +const { toPlainText, toState } = require('../../shared/slate-utils'); + +const convertEmbeds = state => { + const entityMap = state.entityMap || {}; + const blocks = state.blocks.map(block => { + if (block.type !== 'unstyled') return block; + if (!isHtml(block.text)) return block; + + const $ = cheerio.load(block.text); + const iframe = $('iframe')[0]; + + if (!iframe) return block; + + const src = $(iframe).attr('src'); + const height = $(iframe).attr('height'); + const width = $(iframe).attr('width'); + + if (!src) return block; + + const keys = Object.keys(entityMap).map(key => parseInt(key, 10)); + const lastKey = keys.sort()[keys.length - 1]; + const newKey = lastKey === undefined ? 0 : lastKey + 1; + + entityMap[newKey] = { + data: { src, height, width }, + mutability: 'IMMUTABLE', + type: 'embed', + }; + + return { + data: {}, + depth: 0, + entityRanges: [ + { + key: newKey, + offset: 0, + length: 1, + }, + ], + inlineStyleRanges: [], + key: genKey(), + text: ' ', + type: 'atomic', + }; + }); + + return { + ...state, + entityMap, + blocks, + }; +}; + +const plainToDraft = compose( + JSON.stringify, + convertEmbeds, + convertToRaw, + stateFromMarkdown +); + +const slateToDraft = compose(plainToDraft, toPlainText, toState, JSON.parse); + +exports.up = function(r, conn) { + return ( + r + .table('threads') + .filter(thread => + r.not(thread.hasFields('type')).or(thread('type').ne('DRAFTJS')) + ) + .run(conn) + .then(cursor => cursor.toArray()) + // Transform slate state to draftjs state + .then(threads => + threads.map(thread => + Object.assign({}, thread, { + type: 'DRAFTJS', + content: Object.assign({}, thread.content, { + body: + thread.type === 'SLATE' + ? slateToDraft(thread.content.body) + : plainToDraft(thread.content.body), + }), + }) + ) + ) + // Store the transformed threads + .then(threads => + Promise.all( + threads.map(thread => + r + .table('threads') + .get(thread.id) + .update(thread) + .run(conn) + ) + ) + ) + ); +}; + +exports.down = function(r, conn) { + // Not spending any time undoing this + return Promise.resolve(); +}; diff --git a/iris/migrations/seed/index.js b/iris/migrations/seed/index.js index 861b2ece48..2dfbcd4231 100644 --- a/iris/migrations/seed/index.js +++ b/iris/migrations/seed/index.js @@ -173,19 +173,58 @@ console.log( direct_messages.length} messages, ${reactions.length} reactions, ${directMessageThreads.length} direct message threads, ${usersCommunities.length} usersCommunities objects, ${usersChannels.length} usersChannels objects, and ${usersDirectMessageThreads.length} usersDirectMessageThreads objects into the database... (this might take a while!)` ); Promise.all([ - db.table('communities').insert(communities).run(), - db.table('channels').insert(channels).run(), - db.table('threads').insert(threads).run(), - db.table('messages').insert(messages).run(), - db.table('users').insert(users).run(), - db.table('usersSettings').insert(usersSettings).run(), - db.table('reactions').insert(reactions).run(), - db.table('directMessageThreads').insert(directMessageThreads).run(), - db.table('messages').insert(direct_messages).run(), - db.table('usersCommunities').insert(usersCommunities).run(), - db.table('usersChannels').insert(usersChannels).run(), - db.table('usersDirectMessageThreads').insert(usersDirectMessageThreads).run(), - db.table('usersThreads').insert(usersThreads).run(), + db + .table('communities') + .insert(communities) + .run(), + db + .table('channels') + .insert(channels) + .run(), + db + .table('threads') + .insert(threads) + .run(), + db + .table('messages') + .insert(messages) + .run(), + db + .table('users') + .insert(users) + .run(), + db + .table('usersSettings') + .insert(usersSettings) + .run(), + db + .table('reactions') + .insert(reactions) + .run(), + db + .table('directMessageThreads') + .insert(directMessageThreads) + .run(), + db + .table('messages') + .insert(direct_messages) + .run(), + db + .table('usersCommunities') + .insert(usersCommunities) + .run(), + db + .table('usersChannels') + .insert(usersChannels) + .run(), + db + .table('usersDirectMessageThreads') + .insert(usersDirectMessageThreads) + .run(), + db + .table('usersThreads') + .insert(usersThreads) + .run(), ]) .then(() => { console.log('Finished seeding database! 🎉'); diff --git a/iris/mutations/message.js b/iris/mutations/message.js index 1000af2cc8..03db203f4c 100644 --- a/iris/mutations/message.js +++ b/iris/mutations/message.js @@ -33,7 +33,7 @@ module.exports = { } // all checks passed - if (message.messageType === 'text') { + if (message.messageType === 'text' || message.messageType === 'draftjs') { // send a normal text message return storeMessage(message, currentUser.id); } else if (message.messageType === 'media') { diff --git a/iris/mutations/thread.js b/iris/mutations/thread.js index b5f4649e76..3b121de841 100644 --- a/iris/mutations/thread.js +++ b/iris/mutations/thread.js @@ -134,33 +134,7 @@ module.exports = { }) .then(([newThread, urls]) => { // if no files were uploaded, return the new thread object - if (!urls) return newThread; - - // otherwise we need to update the slate object of the thread to replace the image nodes with markdown image text - const slateState = JSON.parse(newThread.content.body); - let fileIndex = 0; - const newSlateState = { - ...slateState, - nodes: slateState.nodes.map(node => { - if (node.type !== 'image') return node; - fileIndex++; - return { - kind: 'block', - type: 'paragraph', - nodes: [ - { - kind: 'text', - text: `![](${urls[fileIndex - 1]}?max-w=800)`, - }, - ], - }; - }), - }; - - return updateThreadWithImages( - newThread.id, - JSON.stringify(newSlateState) - ); + return newThread; }); }, editThread: (_, { input }, { user }) => { @@ -226,33 +200,7 @@ module.exports = { ]); }) .then(([editedThread, urls]) => { - if (!urls) return editedThread; - - // update the slate body with markdown images instead of image nodes - const slateState = JSON.parse(editedThread.content.body); - let fileIndex = 0; - const newSlateState = { - ...slateState, - nodes: slateState.nodes.map(node => { - if (node.type !== 'image') return node; - fileIndex++; - return { - kind: 'block', - type: 'paragraph', - nodes: [ - { - kind: 'text', - text: `![](${urls[fileIndex - 1]})`, - }, - ], - }; - }), - }; - - return updateThreadWithImages( - editedThread.id, - JSON.stringify(newSlateState) - ); + return editedThread; }); }, deleteThread: (_, { threadId }, { user }) => { diff --git a/iris/types/Message.js b/iris/types/Message.js index 3b4aaa1f39..d033087848 100644 --- a/iris/types/Message.js +++ b/iris/types/Message.js @@ -3,6 +3,7 @@ const Message = /* GraphQL */ ` enum MessageTypes { text media + draftjs } enum ThreadTypes { diff --git a/iris/types/Thread.js b/iris/types/Thread.js index 982f04e2f8..c9fdfcffa9 100644 --- a/iris/types/Thread.js +++ b/iris/types/Thread.js @@ -24,6 +24,7 @@ const Thread = /* GraphQL */ ` enum ThreadType { SLATE + DRAFTJS } type Attachment { diff --git a/package.json b/package.json index eb76bb3d1b..fc2faa049f 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,10 @@ "devDependencies": { "babel-cli": "^6.24.1", "babel-plugin-transform-class-properties": "^6.24.1", + "cheerio": "^1.0.0-rc.2", "cross-env": "^5.0.5", "flow-bin": "^0.55.0", + "is-html": "^1.1.0", "lint-staged": "^3.3.0", "micromatch": "^3.0.4", "newrelic": "^2.2.0", @@ -15,6 +17,7 @@ "raw-loader": "^0.5.1", "react-scripts": "^1.0.0", "rimraf": "^2.6.1", + "sw-precache-webpack-plugin": "^0.11.4", "uuid": "^3.0.1", "write-file-webpack-plugin": "^4.1.0" }, @@ -36,6 +39,17 @@ "cors": "^2.8.3", "dataloader": "^1.3.0", "debug": "^2.6.8", + "draft-js": "^0.10.2", + "draft-js-drag-n-drop-plugin": "2.0.0-rc2", + "draft-js-embed-plugin": "^1.2.0", + "draft-js-focus-plugin": "2.0.0-rc2", + "draft-js-image-plugin": "2.0.0-rc8", + "draft-js-import-markdown": "^1.2.0", + "draft-js-markdown-plugin": "^1.0.0", + "draft-js-plugins-editor": "2.0.0-rc2", + "draft-js-prism-plugin": "0.1.1", + "draft-js-single-line-plugin": "^2.0.1", + "draftjs-to-markdown": "^0.4.2", "emoji-regex": "^6.1.1", "express": "^4.15.2", "express-session": "^1.15.2", @@ -69,6 +83,7 @@ "passport-twitter": "^1.0.4", "postmark": "^1.4.1", "pre-commit": "^1.2.2", + "prismjs": "^1.8.1", "query-string": "^5.0.0", "raven": "^2.0.2", "raven-js": "^3.14.0", @@ -89,6 +104,7 @@ "react-transition-group": "^2.2.0", "react-trend": "^1.2.4", "recompose": "^0.23.1", + "redraft": "^0.8.0", "redux": "^3.6.0", "redux-thunk": "^2.2.0", "rethinkdb-migrate": "^1.1.0", @@ -147,7 +163,10 @@ "lint:staged": "lint-staged" }, "lint-staged": { - "*.js": ["prettier --write --single-quote --trailing-comma es5", "git add"] + "*.js": [ + "prettier --write --single-quote --trailing-comma es5", + "git add" + ] }, "pre-commit": "lint:staged" } diff --git a/public/reset.css b/public/reset.css index 463d6a2d3d..1937b4afc7 100644 --- a/public/reset.css +++ b/public/reset.css @@ -1,13 +1,3 @@ -html, -body { - height: 100%; - width: 100%; - box-sizing: border-box; - background: #f5f8fc; - overflow-y: scroll; - -webkit-overflow-scrolling: touch; -} - * { border: 0; box-sizing: inherit; @@ -22,6 +12,33 @@ body { -moz-appearance: none; } +html { + display: flex; + height: 100%; + width: 100%; + max-height: 100%; + max-width: 100%; + box-sizing: border-box; + font-size: 16px; + line-height: 1.5; + background-color: #ffffff; + color: #16171A; + padding: 0; + margin: 0; + -webkit-font-smoothing: antialiased; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, + sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; +} + +body { + display: flex; + box-sizing: border-box; + flex: auto; + align-self: stretch; + max-width: 100%; + max-height: 100%; +} + a { color: currentColor; text-decoration: none; @@ -35,7 +52,8 @@ textarea { resize: none; } -::-moz-selection { /* Code for Firefox */ +::-moz-selection { + /* Code for Firefox */ background: #3818e5; color: #ffffff; } @@ -45,22 +63,6 @@ textarea { color: #ffffff; } -body { - position: relative; - height: 100%; - max-height: 100%; - width: 100vw; - -webkit-font-smoothing: antialiased; - font-size: 16px; - line-height: 24px; - background: #fff; - color: #16171A; - padding: 0; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; - overflow-x: hidden; - -webkit-overflow-scrolling: touch; -} - ::-webkit-input-placeholder { /* WebKit, Blink, Edge */ color: #A3AFBF; } @@ -76,10 +78,6 @@ body { color: #A3AFBF; } -::-webkit-scrollbar { - display: none; -} - #root { display: flex; display: -webkit-box; @@ -130,7 +128,7 @@ body { .markdown img:hover { cursor: pointer; transition: all 0.2s; - box-shadow: 0 2px 8px rgba(0,0,0,0.15); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); } .markdown em { @@ -245,7 +243,7 @@ body { .markdown hr { width: 100%; height: 1px; - background: #DFE7EF; + background: #dfe7ef; display: block; margin: 32px 0; } @@ -253,7 +251,7 @@ body { .markdown h1 { font-size: 24px; line-height: 40px; - border-bottom: 1px solid #DFE7EF; + border-bottom: 1px solid #dfe7ef; font-weight: 800; margin-top: 1rem; margin-bottom: 8px; @@ -304,3 +302,70 @@ body { text-transform: lowercase; font-variant: small-caps; } + +.hljs { + display: block; + background: white; + padding: 0.5em; + color: #333333; + overflow-x: auto; +} + +.hljs-comment, +.hljs-meta { + color: #969896; +} + +.hljs-string, +.hljs-variable, +.hljs-template-variable, +.hljs-strong, +.hljs-emphasis, +.hljs-quote { + color: #df5000; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-type { + color: #a71d5d; +} + +.hljs-literal, +.hljs-symbol, +.hljs-bullet, +.hljs-attribute { + color: #0086b3; +} + +.hljs-section, +.hljs-name { + color: #63a35c; +} + +.hljs-tag { + color: #333333; +} + +.hljs-title, +.hljs-attr, +.hljs-selector-id, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #795da3; +} + +.hljs-addition { + color: #55a532; + background-color: #eaffea; +} + +.hljs-deletion { + color: #bd2c00; + background-color: #ffecec; +} + +.hljs-link { + text-decoration: underline; +} diff --git a/shared/bull/create-worker.js b/shared/bull/create-worker.js index 02db1354b6..565ed6e345 100644 --- a/shared/bull/create-worker.js +++ b/shared/bull/create-worker.js @@ -13,7 +13,7 @@ type QueueMap = { // e.g. [{ completed: 6 }, { completed: 2 }] => 8 const sumArr = ( input /*: Array */, - prop /*: string */ /*: number */ + prop /*: number */ /*: string */ ) => { return input.reduce((sum, item) => sum + item[prop], 0); }; diff --git a/shared/draft-utils.js b/shared/draft-utils.js new file mode 100644 index 0000000000..2198d881ae --- /dev/null +++ b/shared/draft-utils.js @@ -0,0 +1,65 @@ +// @flow +/** + * This file is shared between server and client. + * ⚠️ DON'T PUT ANY NODE.JS OR BROWSER-SPECIFIC CODE IN HERE ⚠️ + * + * Note: This uses Flow comment syntax so this whole file is actually valid JS without any transpilation + * The reason I did that is because create-react-app doesn't transpile files outside the source folder, + * so it chokes on the Flow syntax. + * More info: https://flow.org/en/docs/types/comments/ + */ +//$FlowIssue +var EditorState = require('draft-js/lib/EditorState'); +//$FlowIssue +var ContentState = require('draft-js/lib/ContentState'); +//$FlowIssue +var convertFromRaw = require('draft-js/lib/convertFromRawToDraftState'); +//$FlowIssue +var convertToRaw = require('draft-js/lib/convertFromDraftStateToRaw'); + +var toPlainText = function toPlainText( + editorState /*: typeof EditorState */ +) /*: string */ { + return editorState.getCurrentContent().getPlainText(); +}; + +// This is necessary for SSR, if you create an empty editor on the server and on the client they have to +// have matching keys, so just doing fromPlainText('') breaks checksum matching because the key +// of the block is randomly generated twice and thusly does't match +var emptyContentState = convertFromRaw({ + entityMap: {}, + blocks: [ + { + text: '', + key: 'foo', + type: 'unstyled', + entityRanges: [], + }, + ], +}); + +var fromPlainText = function fromPlainText( + text /*: string */ +) /*: typeof EditorState */ { + if (!text || text === '') + return EditorState.createWithContent(emptyContentState); + return EditorState.createWithContent(ContentState.createFromText(text)); +}; + +var toJSON = function toJSON( + editorState /*: typeof EditorState */ +) /*: Object */ { + return convertToRaw(editorState.getCurrentContent()); +}; + +var toState = function toState(json /*: Object */) /*: typeof EditorState */ { + return EditorState.createWithContent(convertFromRaw(json)); +}; + +module.exports = { + toJSON: toJSON, + toState: toState, + toPlainText: toPlainText, + fromPlainText: fromPlainText, + emptyContentState: emptyContentState, +}; diff --git a/shared/generate-meta-info.js b/shared/generate-meta-info.js index 8b4d41872d..db89533c50 100644 --- a/shared/generate-meta-info.js +++ b/shared/generate-meta-info.js @@ -7,7 +7,7 @@ * so it chokes on the Flow syntax. * More info: https://flow.org/en/docs/types/comments/ */ -var slate = require('./slate-utils'); +var draft = require('./draft-utils'); var truncate = require('./truncate'); var striptags = require('striptags'); @@ -100,9 +100,7 @@ function generateMetaInfo(input /*: Input */) /*: Meta */ { description: data && data.body && - (data.type === 'SLATE' - ? slate.toPlainText(slate.toState(JSON.parse(data.body))) - : data.body), + draft.toPlainText(draft.toState(JSON.parse(data.body))), }); } case 'user': { diff --git a/src/components/avatar/index.js b/src/components/avatar/index.js index 93dc34d72f..8fc54bf417 100644 --- a/src/components/avatar/index.js +++ b/src/components/avatar/index.js @@ -87,11 +87,9 @@ const AvatarWithFallback = ({ style, ...props }) => ( diff --git a/src/components/bubbles/index.js b/src/components/bubbles/index.js index d402b67649..e330e27817 100644 --- a/src/components/bubbles/index.js +++ b/src/components/bubbles/index.js @@ -31,8 +31,8 @@ export const Bubble = (props: BubbleProps) => { }; export const EmojiBubble = (props: BubbleProps) => { - const { me, message } = props; - return {message.body}; + const { me } = props; + return {props.children || props.message.body}; }; export const ImgBubble = (props: Object) => { diff --git a/src/components/bubbles/style.js b/src/components/bubbles/style.js index 35cb7076dc..00a6d883a4 100644 --- a/src/components/bubbles/style.js +++ b/src/components/bubbles/style.js @@ -91,7 +91,7 @@ export const ImageBubble = styled.img` align-self: ${props => (props.me ? `flex-end;` : `flex-start;`)}; opacity: ${props => (props.pending ? 0.5 : 1)}; transition: opacity 0.2s ease-out; - border: 1px solid #f6f7f8; + border: 1px solid ${props => props.theme.bg.wash}; margin-top: ${props => (props.hashed ? '4px' : '0')}; margin-bottom: ${props => (props.hashed ? '4px' : '0')}; box-shadow: ${props => diff --git a/src/components/buttons/index.js b/src/components/buttons/index.js index c66682e79f..df586bca98 100644 --- a/src/components/buttons/index.js +++ b/src/components/buttons/index.js @@ -41,12 +41,14 @@ type IconProps = { export const Button = (props: ButtonProps) => ( - {props.icon ? props.loading ? ( - - - - ) : ( - + {props.icon ? ( + props.loading ? ( + + + + ) : ( + + ) ) : ( '' )} @@ -59,12 +61,14 @@ export const Button = (props: ButtonProps) => ( export const OutlineButton = (props: ButtonProps) => ( - {props.icon ? props.loading ? ( - - - - ) : ( - + {props.icon ? ( + props.loading ? ( + + + + ) : ( + + ) ) : ( '' )} @@ -78,12 +82,14 @@ export const OutlineButton = (props: ButtonProps) => ( // looks like a button, but isn't a button so it won't submit forms export const FauxOutlineButton = (props: ButtonProps) => ( - {props.icon ? props.loading ? ( - - - - ) : ( - + {props.icon ? ( + props.loading ? ( + + + + ) : ( + + ) ) : ( '' )} @@ -96,12 +102,14 @@ export const FauxOutlineButton = (props: ButtonProps) => ( export const TextButton = (props: ButtonProps) => ( - {props.icon ? props.loading ? ( - - - - ) : ( - + {props.icon ? ( + props.loading ? ( + + + + ) : ( + + ) ) : ( '' )} diff --git a/src/components/chatInput/index.js b/src/components/chatInput/index.js index 34ad3d94ca..7e905f464e 100644 --- a/src/components/chatInput/index.js +++ b/src/components/chatInput/index.js @@ -11,7 +11,7 @@ import withHandlers from 'recompose/withHandlers'; import { connect } from 'react-redux'; import Icon from '../../components/icons'; import { track } from '../../helpers/events'; -import { toPlainText, fromPlainText } from '../../components/editor'; +import { toJSON, fromPlainText, toPlainText } from 'shared/draft-utils'; import { addToastWithTimeout } from '../../actions/toasts'; import { openModal } from '../../actions/modals'; import { @@ -58,7 +58,7 @@ class ChatInputWithMutation extends Component { }; submit = e => { - e.preventDefault(); + if (e) e.preventDefault(); const { state, @@ -85,8 +85,8 @@ class ChatInputWithMutation extends Component { // in views/directMessages/containers/newThread.js if (thread === 'newDirectMessageThread') { return createThread({ - messageBody: toPlainText(state), - messageType: 'text', + messageBody: JSON.stringify(toJSON(state)), + messageType: 'draftjs', }); } @@ -94,10 +94,10 @@ class ChatInputWithMutation extends Component { // or direct message thread sendMessage({ threadId: thread, - messageType: 'text', + messageType: 'draftjs', threadType, content: { - body: toPlainText(state), + body: JSON.stringify(toJSON(state)), }, }) .then(({ data: { addMessage } }) => { @@ -114,12 +114,6 @@ class ChatInputWithMutation extends Component { }); }; - handleEnter = e => { - //=> make the enter key send a message, not create a new line in the next autoexpanding textarea unless shift is pressed. - e.preventDefault(); //=> prevent linebreak - this.submit(e); //=> send the message instead - }; - sendMediaMessage = e => { let reader = new FileReader(); const file = e.target.files[0]; @@ -248,7 +242,7 @@ class ChatInputWithMutation extends Component { focus={isFocused} placeholder="Your message here..." state={state} - onEnter={this.handleEnter} + handleReturn={this.submit} onChange={onChange} markdown={false} onFocus={this.onFocus} @@ -257,6 +251,7 @@ class ChatInputWithMutation extends Component { images={false} editorRef={editor => (this.editor = editor)} innerRef={input => (this.chatInput = input)} + editorKey="chat-input" /> diff --git a/src/components/chatInput/style.js b/src/components/chatInput/style.js index 380effb992..e0b1ed8500 100644 --- a/src/components/chatInput/style.js +++ b/src/components/chatInput/style.js @@ -1,7 +1,7 @@ import styled from 'styled-components'; import { IconButton } from '../buttons'; import { FlexRow, Transition, zIndex } from '../globals'; -import Editor from '../../components/editor'; +import Editor from '../../components/draftjs-editor'; export const ChatInputWrapper = styled(FlexRow)` flex: none; @@ -43,9 +43,7 @@ export const EditorInput = styled(Editor)` max-width: 100%; padding: 8px 40px 8px 16px; border-radius: 24px; - border: 2px solid ${props => props.theme.text.placeholder}; - border-color: ${props => - props.focus ? props.theme.brand.default : props.theme.text.placeholder}; + border: 2px solid ${props => props.theme.bg.border}; transition: border 0.3s ease-out; color: ${props => props.theme.text.default}; overflow-y: scroll; diff --git a/src/components/chatMessages/index.js b/src/components/chatMessages/index.js index 959a262174..3327aecf6e 100644 --- a/src/components/chatMessages/index.js +++ b/src/components/chatMessages/index.js @@ -4,16 +4,20 @@ import { connect } from 'react-redux'; // $FlowFixMe import { Link } from 'react-router-dom'; import Icon from '../../components/icons'; +import redraft from 'redraft'; import { openGallery } from '../../actions/gallery'; import { convertTimestampToDate, convertTimestampToTime, onlyContainsEmoji, + draftOnlyContainsEmoji, } from '../../helpers/utils'; import { NullState } from '../upsell'; import { Bubble, EmojiBubble, ImgBubble } from '../bubbles'; +import { TextBubble as RawBubble } from '../bubbles/style'; import Badge from '../badges'; import Reaction from '../reaction'; +import { toState, toPlainText } from 'shared/draft-utils'; import { UserAvatar, @@ -183,15 +187,15 @@ class ChatMessages extends Component { (which has a typeof number) */} {!emojiOnly && - typeof message.id === 'string' && ( - - )} + typeof message.id === 'string' && ( + + )} ); } else if (message.messageType === 'media') { @@ -222,6 +226,42 @@ class ChatMessages extends Component { )} ); + } else if (message.messageType === 'draftjs') { + const body = JSON.parse(message.content.body); + const emojiOnly = draftOnlyContainsEmoji(body); + const TextBubble = emojiOnly ? EmojiBubble : RawBubble; + return ( + + + {redraft(body)} + + {/* + we check if typof equals a string to determine + if the message is coming from the server, or + generated via an optimistic response with apollo + (which has a typeof number) + */} + {typeof message.id === 'string' && ( + + )} + + ); } else { return
; } diff --git a/src/components/composer/index.js b/src/components/composer/index.js new file mode 100644 index 0000000000..b3a8d6d240 --- /dev/null +++ b/src/components/composer/index.js @@ -0,0 +1,660 @@ +import React, { Component } from 'react'; +// $FlowFixMe +import compose from 'recompose/compose'; +// $FlowFixMe +import pure from 'recompose/pure'; +// $FlowFixMe +import Textarea from 'react-textarea-autosize'; +// $FlowFixMe +import { withRouter } from 'react-router'; +// $FlowFixMe +import { connect } from 'react-redux'; + +import { track } from '../../helpers/events'; +import { openComposer, closeComposer } from '../../actions/composer'; +import { changeActiveThread } from '../../actions/dashboardFeed'; +import { addToastWithTimeout } from '../../actions/toasts'; +import Editor from '../draftjs-editor'; +import { toPlainText, fromPlainText, toJSON } from 'shared/draft-utils'; +import { getComposerCommunitiesAndChannels } from './queries'; +import { publishThread } from './mutations'; +import { getLinkPreviewFromUrl } from '../../helpers/utils'; +import { URLS } from '../../helpers/regexps'; +import { TextButton, Button } from '../buttons'; +import { FlexRow } from '../../components/globals'; +import { LoadingSelect } from '../loading'; +import Titlebar from '../../views/titlebar'; +import { + Container, + ThreadDescription, + ThreadTitle, + ThreadInputs, + Actions, + Dropdowns, + RequiredSelector, +} from './style'; + +const ENDS_IN_WHITESPACE = /(\s|\n)$/; + +class ComposerWithData extends Component { + // prop types + state: { + title: string, + body: Object, + availableCommunities: Array, + availableChannels: Array, + activeCommunity: ?string, + activeChannel: ?string, + isPublishing: boolean, + linkPreview: ?Object, + linkPreviewTrueUrl: ?string, + linkPreviewLength: number, + fetchingLinkPreview: boolean, + }; + + constructor(props) { + super(props); + + this.state = { + title: props.title || '', + body: props.body || fromPlainText(''), + availableCommunities: [], + availableChannels: [], + activeCommunity: '', + activeChannel: '', + isPublishing: false, + linkPreview: null, + linkPreviewTrueUrl: '', + linkPreviewLength: 0, + fetchingLinkPreview: false, + }; + } + + handleIncomingProps = props => { + /* + Create a new array of communities only containing the `node` data from + graphQL. Then filter the resulting channel to remove any communities + that don't have any channels yet + */ + + // if the user doesn't exist, bust outta here + if (!props.data.user || props.data.user === undefined) return; + const availableCommunities = props.data.user.communityConnection.edges + .map(edge => edge.node) + .filter( + community => + community.communityPermissions.isMember || + community.communityPermissions.isOwner + ) + .sort((a, b) => { + const bc = parseInt(b.communityPermissions.reputation, 10); + const ac = parseInt(a.communityPermissions.reputation, 10); + return bc <= ac ? -1 : 1; + }); + + /* + Iterate through each of our community nodes to construct a new array + of possible channels + + returns an array of array, where each parent array represents a community + and each child array represents the channels within that parent + community + */ + const availableChannels = props.data.user.channelConnection.edges + .map(edge => edge.node) + .filter( + channel => + channel.channelPermissions.isMember || + channel.channelPermissions.isOwner + ) + .filter(channel => { + if (!channel.isPrivate) return channel; + if (!channel.community.isPro) return null; + return channel; + }); + + /* + If a user is viewing a communit or channel, we use the url as a prop + to set a default activeCommunity and activeChannel + + If no defaults are set, we use the first available community, and then + find the first available channel within that available community + */ + const activeCommunityFromPropsOrState = + props.activeCommunity || this.state.activeCommunity; + + let activeCommunity = + availableCommunities && + (activeCommunityFromPropsOrState + ? availableCommunities.filter(community => { + return ( + community.slug.toLowerCase() === + activeCommunityFromPropsOrState.toLowerCase() + ); + }) + : availableCommunities); + + activeCommunity = + activeCommunity && activeCommunity.length > 0 + ? activeCommunity[0].id + : null; + + if (!activeCommunity) { + return props.data.refetch(); + } else { + this.setActiveStuff( + availableCommunities, + availableChannels, + activeCommunity + ); + } + }; + + setActiveStuff = ( + availableCommunities, + availableChannels, + activeCommunity + ) => { + const props = this.props; + + // get the channels for the proper community + const activeCommunityChannels = availableChannels.filter( + channel => channel.community.id === activeCommunity + ); + let activeChannel = []; + + // Get the active channel if there is one + if (props.activeChannel) { + activeChannel = activeCommunityChannels.filter( + channel => + channel.slug.toLowerCase() === props.activeChannel.toLowerCase() + ); + } else { + // Try and get the default channel for the active community + activeChannel = activeCommunityChannels.filter( + channel => channel.isDefault + ); + // If there is no default channel capitulate and take the first one + if (activeChannel.length === 0) { + activeChannel = activeCommunityChannels; + } else if (activeChannel.length > 1) { + const generalChannel = activeChannel.filter( + channel => channel.slug === 'general' + ); + if (generalChannel.length > 0) activeChannel = generalChannel; + } + } + + // ensure that if no items were found for some reason, we don't crash the app + // and instead just set null values on the composer + activeChannel = activeChannel.length > 0 ? activeChannel[0].id : null; + + this.setState({ + title: props.title || '', + body: props.body || fromPlainText(''), + availableCommunities, + availableChannels, + activeCommunity, + activeChannel, + isPublishing: false, + linkPreview: null, + linkPreviewTrueUrl: '', + linkPreviewLength: 0, + fetchingLinkPreview: false, + }); + }; + + componentDidMount() { + this.handleIncomingProps(this.props); + } + + componentWillUpdate(nextProps) { + const { isOpen } = nextProps; + if (isOpen) { + document.addEventListener('keydown', this.handleKeyPress, false); + } else { + document.removeEventListener('keydown', this.handleKeyPress, false); + } + } + + componentWillUnmount() { + document.removeEventListener('keydown', this.handleKeyPress, false); + } + + handleKeyPress = e => { + // if person taps esc, close the dialog + if (e.keyCode === 27) { + this.closeComposer(); + } + }; + + changeTitle = e => { + const title = e.target.value; + if (/\n$/g.test(title)) { + this.bodyEditor.focus(); + return; + } + this.setState({ + title, + }); + }; + + changeBody = body => { + this.listenForUrl(body); + this.setState({ + body, + }); + }; + + componentDidUpdate(prevProps) { + const { availableCommunities, availableChannels } = this.state; + let activeCommunity; + + if (!prevProps.data.user && this.props.data.user) { + this.handleIncomingProps(this.props); + } + + if (prevProps.activeCommunity !== this.props.activeCommunity) { + activeCommunity = this.props.activeCommunity + ? availableCommunities.filter(community => { + return community.slug === this.props.activeCommunity; + })[0].id + : availableCommunities[0].id; + + this.setState({ + activeCommunity, + }); + } + + if (prevProps.activeChannel !== this.props.activeChannel) { + const activeCommunityChannels = availableChannels.filter( + channel => channel.community.id === activeCommunity + ); + let activeChannel = []; + + // Get the active channel if there is one + if (this.props.activeChannel) { + activeChannel = activeCommunityChannels.filter( + channel => channel.slug === this.props.activeChannel + ); + } else { + // Try and get the default channel for the active community + activeChannel = activeCommunityChannels.filter( + channel => channel.isDefault + ); + // If there is no default channel capitulate and take the first one + if (activeChannel.length === 0) { + activeChannel = activeCommunityChannels; + // If there are more than one default ones, try and choose the "General" one if it exists + } else if (activeChannel.length > 1) { + const generalChannel = activeChannel.filter( + channel => channel.slug === 'general' + ); + if (generalChannel.length > 0) activeChannel = generalChannel; + } + } + + // ensure that if no items were found for some reason, we don't crash the app + // and instead just set null values on the composer + activeChannel = activeChannel.length > 0 ? activeChannel[0].id : null; + + this.setState({ + activeChannel, + }); + } + } + + handleOpenComposer = () => { + // strange construction here in order to guarantee that we focus the title + // input whenever the composer is opened + const isOpen = this.props.isOpen; + if (!isOpen) { + this.props.dispatch(openComposer()); + this.props.data.refetch().then(result => { + // we have to rebuild a new props object to pass to `this.handleIncomingProps` + // in order to retain all the previous props passed in from the parent + // component and the initial data functions provided by apollo + const newProps = Object.assign({}, this.props, { + ...this.props, + data: { + ...this.props.data, + user: { + ...this.props.data.user, + ...result.data.user, + }, + }, + }); + this.handleIncomingProps(newProps); + }); + this.refs.titleTextarea.focus(); + } + }; + + closeComposer = () => { + const { title, body } = this.state; + this.props.dispatch(closeComposer(title, body)); + }; + + setActiveCommunity = e => { + const newActiveCommunity = e.target.value; + const activeCommunityChannels = this.state.availableChannels.filter( + channel => channel.community.id === newActiveCommunity + ); + const newActiveCommunityData = this.state.availableCommunities.find( + community => community.id === newActiveCommunity + ); + const newActiveChannel = + activeCommunityChannels.find(channel => { + // If there is an active channel and we're switching back to the currently open community + // select that channel + if ( + this.props.activeChannel && + this.props.activeCommunity === newActiveCommunityData.slug + ) { + return channel.slug === this.props.activeChannel; + } + // Otherwise select the default one + return channel.isDefault; + // Default to the first channel if no default one can be found + }) || activeCommunityChannels[0]; + + this.setState({ + activeCommunity: newActiveCommunity, + activeChannel: newActiveChannel.id, + }); + }; + + setActiveChannel = e => { + const activeChannel = e.target.value; + + this.setState({ + activeChannel, + }); + }; + + publishThread = () => { + // if no title and no channel is set, don't allow a thread to be published + if (!this.state.title || !this.state.activeChannel) { + return; + } + + // isPublishing will change the publish button to a loading spinner + this.setState({ + isPublishing: true, + }); + + // define new constants in order to construct the proper shape of the + // input for the publishThread mutation + const { + activeChannel, + activeCommunity, + title, + body, + linkPreview, + linkPreviewTrueUrl, + } = this.state; + const channelId = activeChannel; + const communityId = activeCommunity; + const jsonBody = toJSON(body); + + const content = { + title, + body: JSON.stringify(jsonBody), + }; + + const attachments = []; + if (linkPreview) { + const attachmentData = JSON.stringify({ + ...linkPreview, + trueUrl: linkPreviewTrueUrl, + }); + attachments.push({ + attachmentType: 'linkPreview', + data: attachmentData, + }); + } + + // Get the images + const filesToUpload = Object.keys(jsonBody.entityMap) + .filter(key => jsonBody.entityMap[key].type === 'image') + .map(key => jsonBody.entityMap[key].data.file); + + // this.props.mutate comes from a higher order component defined at the + // bottom of this file + this.props + .mutate({ + variables: { + thread: { + channelId, + communityId, + type: 'DRAFTJS', + content, + attachments, + filesToUpload, + }, + }, + }) + // after the mutation occurs, it will either return an error or the new + // thread that was published + .then(({ data }) => { + // get the thread id to redirect the user + const id = data.publishThread.id; + + track('thread', 'published', null); + + // stop the loading spinner on the publish button + this.setState({ + isPublishing: false, + }); + + // redirect the user to the thread + // if they are in the inbox, select it + if (this.props.isInbox) { + this.props.dispatch(changeActiveThread(id)); + } else if (this.props.location.pathname === '/new/thread') { + this.props.history.replace(`/?thread=${id}`); + } else { + this.props.history.push(`?thread=${id}`); + } + + this.props.dispatch( + addToastWithTimeout('success', 'Thread published!') + ); + + this.props.dispatch(changeActiveThread(null)); + }) + .catch(err => { + this.setState({ + isPublishing: false, + }); + this.props.dispatch(addToastWithTimeout('error', err.message)); + }); + }; + + listenForUrl = state => { + const { linkPreview, linkPreviewLength } = this.state; + if (linkPreview !== null) return; + + const lastChangeType = state.getLastChangeType(); + if ( + lastChangeType !== 'backspace-character' && + lastChangeType !== 'insert-characters' + ) { + return; + } + + const text = toPlainText(state); + + if (!ENDS_IN_WHITESPACE.test(text)) return; + + const toCheck = text.match(URLS); + + if (toCheck) { + const len = toCheck.length; + if (linkPreviewLength === len) return; // no new links, don't recheck + + let urlToCheck = toCheck[len - 1].trim(); + + this.setState({ fetchingLinkPreview: true }); + + if (!/^https?:\/\//i.test(urlToCheck)) { + urlToCheck = 'https://' + urlToCheck; + } + + getLinkPreviewFromUrl(urlToCheck) + .then(data => { + // this.props.dispatch(stopLoading()); + + this.setState(prevState => ({ + linkPreview: data, + linkPreviewTrueUrl: urlToCheck, + linkPreviewLength: prevState.linkPreviewLength + 1, + fetchingLinkPreview: false, + error: null, + })); + + const linkPreview = {}; + linkPreview['data'] = data; + linkPreview['trueUrl'] = urlToCheck; + + // this.props.dispatch(addLinkPreview(linkPreview)); + }) + .catch(err => { + this.setState({ + error: + "Oops, that URL didn't seem to want to work. You can still publish your story anyways 👍", + fetchingLinkPreview: false, + }); + }); + } + }; + + removeLinkPreview = () => { + this.setState({ + linkPreview: null, + linkPreviewTrueUrl: null, + }); + }; + + render() { + const { + title, + availableChannels, + availableCommunities, + activeCommunity, + activeChannel, + isPublishing, + linkPreview, + linkPreviewTrueUrl, + fetchingLinkPreview, + } = this.state; + + const { data: { user } } = this.props; + const dataExists = user && availableCommunities && availableChannels; + + return ( + + + + To: + {!dataExists ? ( + + ) : ( + + {availableCommunities.map(community => { + return ( + + ); + })} + + )} + {!dataExists ? ( + + ) : ( + + {availableChannels + .filter(channel => channel.community.id === activeCommunity) + .map((channel, i) => { + return ( + + ); + })} + + )} + + +