mobiledoc-kit
Advanced tools
Comparing version 0.9.3 to 0.9.4-beta.1
@@ -122,6 +122,11 @@ 'use strict'; | ||
var node = nodes[j]; | ||
var renderNode = this._findSectionRenderNodeFromNode(node); | ||
var renderNode = this._findRenderNodeFromNode(node); | ||
if (renderNode) { | ||
if (renderNode.reparsesMutationOfChildNode(node)) { | ||
sections.add(renderNode.postNode); | ||
var section = this._findSectionFromRenderNode(renderNode); | ||
if (section) { | ||
sections.add(section); | ||
} else { | ||
reparsePost = true; | ||
} | ||
} | ||
@@ -175,2 +180,13 @@ } else { | ||
} | ||
}, { | ||
key: '_findRenderNodeFromNode', | ||
value: function _findRenderNodeFromNode(node) { | ||
return this.renderTree.findRenderNodeFromElement(node); | ||
} | ||
}, { | ||
key: '_findSectionFromRenderNode', | ||
value: function _findSectionFromRenderNode(renderNode) { | ||
var sectionRenderNode = this._findSectionRenderNodeFromNode(renderNode.element); | ||
return sectionRenderNode && sectionRenderNode.postNode; | ||
} | ||
}]); | ||
@@ -177,0 +193,0 @@ |
@@ -818,4 +818,3 @@ 'use strict'; | ||
if (!section) { | ||
// The section may be undefined if the user used the embed intent | ||
// ("+" icon) to insert a new "ul" section in a blank post | ||
// FIXME should a falsy section be a valid argument? | ||
this.insertSectionBefore(this.editor.post.sections, newSection, null); | ||
@@ -822,0 +821,0 @@ } else { |
@@ -86,2 +86,4 @@ 'use strict'; | ||
return !(0, _utilsDomUtils.containsNode)(this.cardNode.element, node); | ||
} else if (this.postNode.isAtom) { | ||
return !(0, _utilsDomUtils.containsNode)(this.atomNode.element, node); | ||
} | ||
@@ -88,0 +90,0 @@ return true; |
@@ -497,2 +497,7 @@ 'use strict'; | ||
// If an atom throws during render we may end up later destroying a renderNode | ||
// that has not rendered yet, so exit early here if so. | ||
if (!renderNode.isRendered) { | ||
return; | ||
} | ||
var markupElement = renderNode.markupElement; | ||
@@ -499,0 +504,0 @@ |
@@ -140,2 +140,3 @@ 'use strict'; | ||
value: function selectedText() { | ||
// FIXME remove this | ||
return this.selection.toString(); | ||
@@ -142,0 +143,0 @@ } |
'use strict'; | ||
exports['default'] = '0.9.3'; | ||
exports['default'] = '0.9.4-beta.1'; |
{ | ||
"name": "mobiledoc-kit", | ||
"version": "0.9.3", | ||
"version": "0.9.4-beta.1", | ||
"description": "A toolkit for building WYSIWYG editors with Mobiledoc", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/bustlelabs/mobiledoc-kit", |
@@ -15,4 +15,12 @@ ## Mobiledoc Kit | ||
**Try a demo at [bustlelabs.github.io/mobiledoc-kit/demo](https://bustlelabs.github.io/mobiledoc-kit/demo/)**. | ||
## Demo | ||
Try a demo at [bustlelabs.github.io/mobiledoc-kit/demo](https://bustlelabs.github.io/mobiledoc-kit/demo/). | ||
## API Documentation | ||
API Documentation is [available online](http://bustlelabs.github.io/mobiledoc-kit/demo/docs/). | ||
## Intro to Mobiledoc Kit | ||
* Posts are serialized to a JSON format called **Mobiledoc** instead of to | ||
@@ -300,3 +308,3 @@ HTML. Mobiledoc can be rendered for the web, mobile web, or in theory on any | ||
* update version constant in `src/js/version.js` | ||
* update version in `src/js/version.js` | ||
* Update version in `package.json` | ||
@@ -303,0 +311,0 @@ * `npm run update-changelog` |
@@ -96,6 +96,11 @@ import Set from 'mobiledoc-kit/utils/set'; | ||
let node = nodes[j]; | ||
let renderNode = this._findSectionRenderNodeFromNode(node); | ||
let renderNode = this._findRenderNodeFromNode(node); | ||
if (renderNode) { | ||
if (renderNode.reparsesMutationOfChildNode(node)) { | ||
sections.add(renderNode.postNode); | ||
let section = this._findSectionFromRenderNode(renderNode); | ||
if (section) { | ||
sections.add(section); | ||
} else { | ||
reparsePost = true; | ||
} | ||
} | ||
@@ -144,2 +149,11 @@ } else { | ||
_findRenderNodeFromNode(node) { | ||
return this.renderTree.findRenderNodeFromElement(node); | ||
} | ||
_findSectionFromRenderNode(renderNode) { | ||
let sectionRenderNode = this._findSectionRenderNodeFromNode(renderNode.element); | ||
return sectionRenderNode && sectionRenderNode.postNode; | ||
} | ||
} |
@@ -700,4 +700,3 @@ import Position from '../utils/cursor/position'; | ||
if (!section) { | ||
// The section may be undefined if the user used the embed intent | ||
// ("+" icon) to insert a new "ul" section in a blank post | ||
// FIXME should a falsy section be a valid argument? | ||
this.insertSectionBefore(this.editor.post.sections, newSection, null); | ||
@@ -704,0 +703,0 @@ } else { |
@@ -80,2 +80,4 @@ import LinkedItem from 'mobiledoc-kit/utils/linked-item'; | ||
return !containsNode(this.cardNode.element, node); | ||
} else if (this.postNode.isAtom) { | ||
return !containsNode(this.atomNode.element, node); | ||
} | ||
@@ -82,0 +84,0 @@ return true; |
@@ -476,2 +476,7 @@ import CardNode from 'mobiledoc-kit/models/card-node'; | ||
// If an atom throws during render we may end up later destroying a renderNode | ||
// that has not rendered yet, so exit early here if so. | ||
if (!renderNode.isRendered) { | ||
return; | ||
} | ||
let { markupElement } = renderNode; | ||
@@ -478,0 +483,0 @@ |
@@ -126,2 +126,3 @@ import { | ||
selectedText() { | ||
// FIXME remove this | ||
return this.selection.toString(); | ||
@@ -128,0 +129,0 @@ } |
@@ -1,1 +0,1 @@ | ||
export default '0.9.3'; | ||
export default '0.9.4-beta.1'; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2883480
41470
327