Skip to content

Commit

Permalink
Merge pull request #301 pm-0.17.x
Browse files Browse the repository at this point in the history
inline widgets & block editing modals
  • Loading branch information
Forrest Oliphant authored Jan 25, 2017
2 parents 2348ec1 + 052aba5 commit 89cf23a
Show file tree
Hide file tree
Showing 86 changed files with 3,443 additions and 2,756 deletions.
34 changes: 17 additions & 17 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{ "parser": "babel-eslint"
, "ecmaFeatures": { "modules": true }
, "env":
{ "browser": true
, "node": true
, "es6": true
}
, "rules":
{ "no-multiple-empty-lines": [2, {"max": 2, "maxEOF": 1}]
, "no-console": 2
, "comma-style": [2, "first"]
, "camelcase": 0
, "indent": 0
}
, "plugins": ["react"]
, "extends": ["standard", "plugin:react/recommended"]
}
{
"parser": "babel-eslint",
"ecmaFeatures": { "modules": true },
"env": {
"browser": true,
"node": true,
"es6": true
},
"rules": {
"no-multiple-empty-lines": [2, {"max": 2, "maxEOF": 1}],
"comma-dangle": [2, "always-multiline"],
"no-console": 2,
"camelcase": 0
},
"plugins": ["react"],
"extends": ["standard", "plugin:react/recommended"]
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ logs
node_modules
dist
.DS_Store

*.orig
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- 6.9
- 7.4
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
Expand Down
78 changes: 78 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,83 @@
### dev

# 2.0.0 - 2017-01-25

* Some style tweaks
* All of these:

#### 2.0.0-11 prerelease - 2017-01-24

* Merge `featureFlags` prop from 1.4.x
* ed.version (#306)
* Link input `type="url"` for mobile input keyboard
* Show attributions in inline view
* Show block type & link in inline view
* `hr` padding for easier selection

#### 2.0.0-10 prerelease - 2017-01-21

* Node v7.4.0

#### 2.0.0-9 prerelease - 2017-01-21

* Clarify link placeholder
* iframe widget name + drag handle
* Click to select simplification
* Delete block wording & close modal
* No text select draggable widgets
* Enter in text area to close modal and menu
* Modal style
* Fix bug where clicking "Edit" would select node and jump away from pointer
* Default `coverPrefs`
* Fix blur: prevents delete by backspace from "under" modal

#### 2.0.0-8 prerelease - 2017-01-19

* Merge v1 patch
* Fix bug that sometimes focused top of doc on clicking block "edit"

#### 2.0.0-7 prerelease - 2017-01-19

* Blur editable on modal open.
* Don't allow typing over node selection. Fixes bug that media view can be typed over and deleted after clicking "edit."

#### 2.0.0-6 prerelease - 2017-01-19

* Modal media block meta editing! :tada:
* Fixed menu hack _only_ on iOS

#### 2.0.0-5 prerelease - 2017-01-10

* Fix gh-pages widget serving (.nojekyll)
* Fix link menu form position
* Fix file drops: on both media blocks & text

#### 2.0.0-4 prerelease - 2017-01-10

* ProseMirror 0.17.0
* URL modal attached to menu
* URL pre-filled if selected text is link-like (#288)

#### 2.0.0-3 prerelease - 2017-01-05

* bump imgflo-url to ignore `blob:` URLs

#### 2.0.0-2 prerelease - 2017-01-05

* fix `menuBar: false`

#### 2.0.0-1 prerelease - 2017-01-05

* BREAKING -- `mountApp` is async because of a React change, and does not return `ed`
* `props.onMount` callback is called with `ed` instance

#### 2.0.0-0 prerelease - 2017-01-02

* ProseMirror 0.16.0 -- big refactor to get up to date
* Redo all plugins & everything we have built on PM
* Widgets are inline: major simplification
* h1-h3 empty block placeholders

### 1.4.2 - 2017-01-23

* `featureFlags: {edCta, edEmbed}` to match API
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ available to use like this:

``` js
var container = document.querySelector('#ed')
var ed = window.TheGridEd.mountApp(container, {
window.TheGridEd.mountApp(container, {
// REQUIRED -- Content array from post
initialContent: [],
// OPTIONAL (default true) enable or disable the default menu
Expand Down Expand Up @@ -94,8 +94,9 @@ available to use like this:
/* Once upload is complete, app hits ed.setCoverSrc */
},
// OPTIONAL
onMount: function () {
onMount: function (mounted) {
/* Called once PM and widgets are mounted */
window.ed = mounted
},
// OPTIONAL
onCommandsChanged: function (commands) {
Expand Down
95 changes: 47 additions & 48 deletions demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,31 @@ function setup (options) {
apiJSON.value = JSON.stringify(options.initialContent, null, 2)
}
const props =
{ initialContent: (options.initialContent || [])
, onChange: () => { console.log('change') }
, onMount: () => { console.log('mount') }
, onShareFile: onShareFileDemo
, onShareUrl: onShareUrlDemo
, onRequestCoverUpload: onRequestCoverUploadDemo
, onPlaceholderCancel: onPlaceholderCancelDemo
, onCommandsChanged: (commands) => {}
, onDropFiles: onDropFilesDemo
, onDropFileOnBlock: onDropFileOnBlockDemo
, imgfloConfig: null
, widgetPath: './node_modules/'
, coverPrefs: { filter: false }
, menuBar: true
, featureFlags:
{ edCta: false
, edEmbed: false
}
, ref:
function (mounted) {
ed = mounted
console.log(ed)
window.ed = ed
}
{ initialContent: (options.initialContent || []),
onChange: () => { console.log('onChange') },
onMount: function (mounted) {
ed = mounted
console.log(ed)
window.ed = ed
},
onShareFile: onShareFileDemo,
onShareUrl: onShareUrlDemo,
onRequestCoverUpload: onRequestCoverUploadDemo,
onPlaceholderCancel: onPlaceholderCancelDemo,
onCommandsChanged: function (commands) {
// console.log(commands)
},
onDropFiles: onDropFilesDemo,
onDropFileOnBlock: onDropFileOnBlockDemo,
imgfloConfig: null,
widgetPath: './node_modules/',
coverPrefs: { filter: false },
menuBar: true,
featureFlags: {
edCta: false,
edEmbed: false,
},
}

mountApp(container, props)

// Only for fixture demo
Expand Down Expand Up @@ -117,10 +116,10 @@ function filesUploadSim (index, files) {
const updatedBlocks = ids.map(function (id, index) {
ed.updateProgress(id, {progress: null})
return (
{ id
, type: 'image'
, metadata: {title: names[index]}
}
{ id,
type: 'image',
metadata: {title: names[index]},
}
)
})
ed.setContent(updatedBlocks)
Expand All @@ -146,29 +145,29 @@ function onShareUrlDemo (share) {
function () {
console.log('Share: mount block')
ed.setContent([
{ id: block
, type: 'article'
, metadata:
{ title: 'Shared article title'
, description: `Simulated share from ${url}`
}
}
{ id: block,
type: 'article',
metadata:
{ title: 'Shared article title',
description: `Simulated share from ${url}`,
},
},
])
window.setTimeout(function () {
console.log('Share: mount block + cover')
ed.setContent([
{ id: block
, type: 'article'
, metadata:
{ title: 'Shared article title + cover'
, description: `Simulated share from ${url}`
}
, cover:
{ src: 'http://meemoo.org/images/meemoo-illo-by-jyri-pieniniemi-400.png'
, width: 400
, height: 474
}
}
{ id: block,
type: 'article',
metadata:
{ title: 'Shared article title + cover',
description: `Simulated share from ${url}`,
},
cover:
{ src: 'http://meemoo.org/images/meemoo-illo-by-jyri-pieniniemi-400.png',
width: 400,
height: 474,
},
},
])
}, 1000)
}
Expand Down
Loading

0 comments on commit 89cf23a

Please sign in to comment.