ember-mobiledoc-editor
Advanced tools
Comparing version 0.3.2-beta.2 to 0.3.2-beta.4
@@ -5,2 +5,8 @@ const RENDER_TYPE = 'dom'; | ||
function renderFallback() { | ||
let element = document.createElement('div'); | ||
element.innerHTML = '[placeholder for Ember component card]'; | ||
return element; | ||
} | ||
export default function createComponentCard(name) { | ||
@@ -13,2 +19,6 @@ | ||
let {env, options} = cardArg; | ||
if (!options[ADD_HOOK]) { | ||
return renderFallback(); | ||
} | ||
let { card, element } = options[ADD_HOOK](cardArg); | ||
@@ -23,2 +33,6 @@ let { onTeardown } = env; | ||
let {env, options} = cardArg; | ||
if (!options[ADD_HOOK]) { | ||
return renderFallback(); | ||
} | ||
let isEditing = true; | ||
@@ -25,0 +39,0 @@ let { card, element } = options[ADD_HOOK](cardArg, isEditing); |
36
index.js
/* jshint node: true */ | ||
'use strict'; | ||
var MergeTrees = require('broccoli-merge-trees'); | ||
var Funnel = require('broccoli-funnel'); | ||
var path = require('path'); | ||
function distDirFor(packageName) { | ||
var resolved = require.resolve(packageName + '/package.json'); | ||
if (resolved) { | ||
return path.join(path.dirname(resolved), 'dist'); | ||
} else { | ||
return null; | ||
} | ||
} | ||
module.exports = { | ||
@@ -10,8 +20,5 @@ name: 'ember-mobiledoc-editor', | ||
treeForVendor: function() { | ||
var distDir = path.join( | ||
path.dirname(require.resolve('mobiledoc-kit/package.json')), | ||
'dist' | ||
); | ||
var files = []; | ||
var files = new Funnel(distDir, { | ||
files.push(new Funnel(distDirFor('mobiledoc-kit'), { | ||
files: [ | ||
@@ -23,4 +30,15 @@ 'css/mobiledoc-kit.css', | ||
destDir: 'mobiledoc-kit' | ||
}); | ||
return files; | ||
})); | ||
var rendererDir = distDirFor('mobiledoc-dom-renderer'); | ||
if (rendererDir) { | ||
files.push(new Funnel(rendererDir, { | ||
files: [ | ||
'global/mobiledoc-dom-renderer.js' | ||
], | ||
destDir: 'mobiledoc-dom-renderer' | ||
})); | ||
} | ||
return new MergeTrees(files); | ||
}, | ||
@@ -31,3 +49,7 @@ | ||
app.import('vendor/mobiledoc-kit/global/mobiledoc-kit.js'); | ||
var rendererDir = distDirFor('mobiledoc-dom-renderer'); | ||
if (rendererDir) { | ||
app.import('vendor/mobiledoc-dom-renderer/global/mobiledoc-dom-renderer.js'); | ||
} | ||
} | ||
}; |
{ | ||
"name": "ember-mobiledoc-editor", | ||
"version": "0.3.2-beta.2", | ||
"version": "0.3.2-beta.4", | ||
"description": "A Mobiledoc editor for Ember.js apps", | ||
@@ -38,3 +38,4 @@ "directories": { | ||
"ember-export-application-global": "^1.0.3", | ||
"ember-try": "0.0.6" | ||
"ember-try": "0.0.6", | ||
"mobiledoc-dom-renderer": "^0.3.0-beta3" | ||
}, | ||
@@ -48,6 +49,7 @@ "keywords": [ | ||
"broccoli-funnel": "^0.2.8", | ||
"mobiledoc-kit": "^0.8.0-beta.3", | ||
"broccoli-merge-trees": "^1.1.1", | ||
"ember-cli-babel": "^5.1.3", | ||
"ember-cli-htmlbars": "^1.0.0", | ||
"ember-wormhole": "^0.3.4" | ||
"ember-wormhole": "^0.3.4", | ||
"mobiledoc-kit": "^0.8.0-beta.3" | ||
}, | ||
@@ -54,0 +56,0 @@ "ember-addon": { |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
45123
526
6
18
2
+ Addedbroccoli-merge-trees@^1.1.1
+ Addeddunder-proto@1.0.0(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedjson-stable-stringify@1.1.1(transitive)
+ Addedmath-intrinsics@1.0.0(transitive)
+ Addedresolve@1.22.8(transitive)
- Removedcall-bound@1.0.3(transitive)
- Removeddunder-proto@1.0.1(transitive)
- Removedis-core-module@2.16.0(transitive)
- Removedjson-stable-stringify@1.2.0(transitive)
- Removedmath-intrinsics@1.1.0(transitive)
- Removedresolve@1.22.10(transitive)