-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
problem: create-react-app does not support compiling files outside 'src'. Building draft-js*-plugin everytime it changes in development is not a good flow, so holding this for now facebook/create-react-app#1107
- Loading branch information
1 parent
7b77110
commit ba879ac
Showing
28 changed files
with
156 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "dolphino-app", | ||
"version": "0.2.0", | ||
"private": true, | ||
"dependencies": { | ||
"draft-js": "^0.10.4", | ||
"draft-js-buttons": "^2.0.1", | ||
"draft-js-color-picker-plugin": "^0.2.0", | ||
"draft-js-markdown-plugin": "^1.1.0", | ||
"draft-js-plugins-editor": "^2.0.1", | ||
"draft-js-prism": "^1.0.5", | ||
"draft-js-prism-decorator-plugin": "^0.2.0", | ||
"draft-js-static-toolbar-plugin": "^2.0.1", | ||
"prismjs": "^1.8.4", | ||
"react": "^16.1.0", | ||
"react-dom": "^16.1.0", | ||
"react-scripts": "1.0.17" | ||
}, | ||
"devDependencies": { | ||
"prop-types": "^15.6.0" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test --env=jsdom", | ||
"eject": "react-scripts eject" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import App from './App' | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div') | ||
ReactDOM.render(<App />, div) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/dolphino-app/src/components/DolphinoEditor/plugins/highlightPlugin.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { RichUtils } from 'draft-js' | ||
|
||
const defaultStyle = { | ||
background: 'blue', | ||
padding: '0 .3em', | ||
color: '#fff', | ||
} | ||
|
||
export default (style = {}) => { | ||
return { | ||
customStyleMap: { | ||
HIGHLIGHT: { | ||
...defaultStyle, | ||
...style, | ||
}, | ||
}, | ||
keyBindingFn: e => { | ||
if (e.metaKey && e.key === 'k') { | ||
return 'highlight' | ||
} | ||
}, | ||
handleKeyCommand: (command, editorState, { setEditorState }) => { | ||
if (command === 'highlight') { | ||
setEditorState(RichUtils.toggleInlineStyle(editorState, 'HIGHLIGHT')) | ||
return 'handled' | ||
} | ||
}, | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import './index.css' | ||
import App from './App' | ||
import registerServiceWorker from './registerServiceWorker' | ||
|
||
ReactDOM.render(<App />, document.getElementById('root')) | ||
registerServiceWorker() |
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "draft-js-color-picker-plugin", | ||
"version": "0.2.0", | ||
"main": "src/index.js", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"draft-js": "^0.10.1", | ||
"react": "^15.5.0 || ^16.0.0-rc", | ||
"react-dom": "^15.5.0 || ^16.0.0-rc" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "draft-js-prism-decorator-plugin", | ||
"version": "0.2.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"draft-js": "^0.10.1", | ||
"react": "^15.5.0 || ^16.0.0-rc", | ||
"react-dom": "^15.5.0 || ^16.0.0-rc" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.