ember-mobiledoc-dom-renderer
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -10,11 +10,11 @@ import Ember from 'ember'; | ||
run: { join }, | ||
uuid, | ||
$ | ||
uuid | ||
} = Ember; | ||
const ADD_CARD_HOOK = 'addComponentCard'; | ||
const REMOVE_CARD_HOOK = 'removeComponentCard'; | ||
const ADD_ATOM_HOOK = 'addComponentAtom'; | ||
const REMOVE_ATOM_HOOK = 'removeComponentAtom'; | ||
const ADD_CARD_HOOK = 'addComponentCard'; | ||
const REMOVE_CARD_HOOK = 'removeComponentCard'; | ||
const ADD_ATOM_HOOK = 'addComponentAtom'; | ||
const REMOVE_ATOM_HOOK = 'removeComponentAtom'; | ||
const CARD_TAG_NAME = 'div'; | ||
const ATOM_TAG_NAME = 'span'; | ||
const UUID_PREFIX = '__rendered-mobiledoc-entity-'; | ||
@@ -117,9 +117,5 @@ export const CARD_ELEMENT_CLASS = '__rendered-mobiledoc-card'; | ||
[ADD_CARD_HOOK]: ({env, options, payload}) => { | ||
let { name: cardName } = env; | ||
let uuid = this.generateUuid(); | ||
let element = $("<div></div>") | ||
.attr('id', uuid) | ||
.addClass(CARD_ELEMENT_CLASS) | ||
.addClass(CARD_ELEMENT_CLASS + '-' + cardName)[0]; | ||
let { name: cardName, dom } = env; | ||
let classNames = [CARD_ELEMENT_CLASS, `${CARD_ELEMENT_CLASS}-${cardName}`]; | ||
let element = this._createElement(dom, CARD_TAG_NAME, classNames); | ||
let componentName = this.cardNameToComponentName(cardName); | ||
@@ -129,3 +125,3 @@ | ||
componentName, | ||
destinationElementId: uuid, | ||
destinationElementId: element.getAttribute('id'), | ||
payload | ||
@@ -137,9 +133,5 @@ }; | ||
[ADD_ATOM_HOOK]: ({env, options, value, payload}) => { | ||
let { name: atomName } = env; | ||
let uuid = this.generateUuid(); | ||
let element = $("<span></span>") | ||
.attr('id', uuid) | ||
.addClass(ATOM_ELEMENT_CLASS) | ||
.addClass(ATOM_ELEMENT_CLASS + '-' + atomName)[0]; | ||
let { name: atomName, dom } = env; | ||
let classNames = [ATOM_ELEMENT_CLASS, `${ATOM_ELEMENT_CLASS}-${atomName}`]; | ||
let element = this._createElement(dom, ATOM_TAG_NAME, classNames); | ||
let componentName = this.atomNameToComponentName(atomName); | ||
@@ -149,3 +141,3 @@ | ||
componentName, | ||
destinationElementId: uuid, | ||
destinationElementId: element.getAttribute('id'), | ||
payload, | ||
@@ -211,3 +203,10 @@ value | ||
return `${UUID_PREFIX}${uuid()}`; | ||
}, | ||
_createElement(dom, tagName, classNames=[]) { | ||
let el = dom.createElement(tagName); | ||
el.setAttribute('id', this.generateUuid()); | ||
el.setAttribute('class', classNames.join(' ')); | ||
return el; | ||
} | ||
}); |
{ | ||
"name": "ember-mobiledoc-dom-renderer", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "provides mobiledoc-dom-renderer to ember apps", | ||
@@ -12,3 +12,4 @@ "directories": { | ||
"start": "ember server", | ||
"test": "ember try:testall" | ||
"test": "ember try:testall", | ||
"update-changelog": "conventional-changelog -i CHANGELOG.md -r 0 -s" | ||
}, | ||
@@ -23,2 +24,4 @@ "repository": "https://github.com/bustlelabs/ember-mobiledoc-dom-renderer", | ||
"broccoli-asset-rev": "^2.1.2", | ||
"conventional-changelog": "^1.1.0", | ||
"conventional-changelog-cli": "^1.1.1", | ||
"ember-cli": "1.13.8", | ||
@@ -48,3 +51,3 @@ "ember-cli-app-version": "0.5.0", | ||
"ember-wormhole": "^0.3.4", | ||
"mobiledoc-dom-renderer": "^0.4.0" | ||
"mobiledoc-dom-renderer": "^0.5.1" | ||
}, | ||
@@ -51,0 +54,0 @@ "ember-addon": { |
@@ -59,1 +59,13 @@ # ember-mobiledoc-dom-renderer | ||
`import DOMRenderer from 'ember-mobiledoc-dom-renderer'`; | ||
#### Release process | ||
To release a new version: | ||
* update version in `package.json` | ||
* run `npm run update-changelog` | ||
* `git commit -am "v<version>"` | ||
* `git tag v<version>` | ||
* push code and tag to github | ||
* `npm publish` |
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
17430
13
225
71
17
+ Addedmobiledoc-dom-renderer@0.5.4(transitive)
- Removedmobiledoc-dom-renderer@0.4.1(transitive)