diff --git a/lib/Viewer.js b/lib/Viewer.js index a4462fb3..c36d7eca 100644 --- a/lib/Viewer.js +++ b/lib/Viewer.js @@ -258,7 +258,6 @@ Viewer.prototype.on = function(event, handler) { // modules the viewer is composed of Viewer.prototype._modules = [ require('./core'), - require('./draw'), require('diagram-js/lib/features/selection'), require('diagram-js/lib/features/overlays') ]; diff --git a/lib/core/index.js b/lib/core/index.js index df77e2a3..9b964e93 100644 --- a/lib/core/index.js +++ b/lib/core/index.js @@ -1,3 +1,6 @@ module.exports = { - bpmnImporter: [ 'type', require('./BpmnImporter') ] + __depends__: [ + require('../draw'), + require('../import') + ] }; \ No newline at end of file diff --git a/lib/draw/index.js b/lib/draw/index.js index f0a99dec..e1d2b1f6 100644 --- a/lib/draw/index.js +++ b/lib/draw/index.js @@ -1,5 +1,4 @@ module.exports = { - __depends__: [ require('../core') ], renderer: [ 'type', require('./BpmnRenderer') ], pathMap: [ 'type', require('./PathMap') ] }; \ No newline at end of file diff --git a/lib/features/label-editing/index.js b/lib/features/label-editing/index.js index 303e05c0..db24f9b0 100644 --- a/lib/features/label-editing/index.js +++ b/lib/features/label-editing/index.js @@ -1,6 +1,5 @@ module.exports = { __depends__: [ - require('../../core'), require('diagram-js/lib/command'), require('diagram-js/lib/features/change-support'), require('diagram-js-direct-editing') diff --git a/lib/features/modeling/index.js b/lib/features/modeling/index.js index d6f593bb..0845fb21 100644 --- a/lib/features/modeling/index.js +++ b/lib/features/modeling/index.js @@ -1,7 +1,6 @@ module.exports = { __init__: [ 'modeling', 'bpmnUpdater', 'labelSupport' ], __depends__: [ - require('../../core'), require('../label-editing'), require('diagram-js/lib/command'), require('diagram-js/lib/features/change-support') diff --git a/lib/core/BpmnImporter.js b/lib/import/BpmnImporter.js similarity index 100% rename from lib/core/BpmnImporter.js rename to lib/import/BpmnImporter.js diff --git a/lib/import/index.js b/lib/import/index.js new file mode 100644 index 00000000..df77e2a3 --- /dev/null +++ b/lib/import/index.js @@ -0,0 +1,3 @@ +module.exports = { + bpmnImporter: [ 'type', require('./BpmnImporter') ] +}; \ No newline at end of file diff --git a/test/spec/features/context-pad/ContextPadProviderSpec.js b/test/spec/features/context-pad/ContextPadProviderSpec.js index 5ad10266..6a760ded 100644 --- a/test/spec/features/context-pad/ContextPadProviderSpec.js +++ b/test/spec/features/context-pad/ContextPadProviderSpec.js @@ -9,7 +9,7 @@ var Matchers = require('../../../Matchers'), var fs = require('fs'); var contextPadModule = require('../../../../lib/features/context-pad'), - bpmnModule = require('../../../../lib/draw'); + bpmnModule = require('../../../../lib/core'); describe('features - context-pad', function() { diff --git a/test/spec/features/label-editing/LabelEditingProviderSpec.js b/test/spec/features/label-editing/LabelEditingProviderSpec.js index 30a05136..8e54e644 100644 --- a/test/spec/features/label-editing/LabelEditingProviderSpec.js +++ b/test/spec/features/label-editing/LabelEditingProviderSpec.js @@ -12,7 +12,7 @@ var $ = require('jquery'); var labelEditingModule = require('../../../../lib/features/label-editing'), - bpmnModule = require('../../../../lib/draw'); + coreModule = require('../../../../lib/core'); var LabelUtil = require('../../../../lib/features/label-editing/LabelUtil'); @@ -24,7 +24,7 @@ describe('features - label-editing', function() { var diagramXML = fs.readFileSync('test/fixtures/bpmn/features/label-editing/labels.bpmn', 'utf-8'); - var testModules = [ labelEditingModule, bpmnModule ]; + var testModules = [ labelEditingModule, coreModule ]; beforeEach(bootstrapViewer(diagramXML, { modules: testModules })); diff --git a/test/spec/features/label-editing/TouchIntegrationSpec.js b/test/spec/features/label-editing/TouchIntegrationSpec.js index dc327748..50cd6311 100644 --- a/test/spec/features/label-editing/TouchIntegrationSpec.js +++ b/test/spec/features/label-editing/TouchIntegrationSpec.js @@ -1,24 +1,16 @@ 'use strict'; -var Matchers = require('../../../Matchers'), - TestHelper = require('../../../TestHelper'); +var TestHelper = require('../../../TestHelper'); -/* global bootstrapViewer, inject */ + +var Modeler = require('../../../../lib/Modeler'); var fs = require('fs'); -var Modeler = require('../../../../lib/Modeler'); - -var labelEditingModule = require('../../../../lib/features/label-editing'), - touchModule = require('diagram-js/lib/features/touch'); - describe('direct editing - touch integration', function() { - beforeEach(Matchers.addDeepEquals); - - var container; beforeEach(function() { @@ -41,15 +33,9 @@ describe('direct editing - touch integration', function() { }); - describe('event integration', function() { - - var diagramXML = fs.readFileSync('test/fixtures/bpmn/features/label-editing/labels.bpmn', 'utf-8'); - - var testModules = [ labelEditingModule, touchModule ]; - - beforeEach(bootstrapViewer(diagramXML, { modules: testModules })); - - it('should work via dbltap (manual test)', function() { }); + it('should edit labels via double tap (manual test)', function(done) { + var xml = fs.readFileSync('test/fixtures/bpmn/features/label-editing/labels.bpmn', 'utf8'); + createModeler(xml, done); }); }); \ No newline at end of file diff --git a/test/spec/features/modeling/AppendShapeSpec.js b/test/spec/features/modeling/AppendShapeSpec.js index 1c31fdba..c7e6f845 100644 --- a/test/spec/features/modeling/AppendShapeSpec.js +++ b/test/spec/features/modeling/AppendShapeSpec.js @@ -10,7 +10,7 @@ var _ = require('lodash'); var fs = require('fs'); var modelingModule = require('../../../../lib/features/modeling'), - drawModule = require('../../../../lib/draw'); + coreModule = require('../../../../lib/core'); var LabelUtil = require('../../../../lib/util/Label'); @@ -23,7 +23,7 @@ describe('features/modeling - append shape', function() { var diagramXML = fs.readFileSync('test/fixtures/bpmn/simple.bpmn', 'utf-8'); - var testModules = [ drawModule, modelingModule ]; + var testModules = [ coreModule, modelingModule ]; beforeEach(bootstrapModeler(diagramXML, { modules: testModules })); diff --git a/test/spec/features/modeling/BpmnFactorySpec.js b/test/spec/features/modeling/BpmnFactorySpec.js index 6c8a4f3f..699df4e4 100644 --- a/test/spec/features/modeling/BpmnFactorySpec.js +++ b/test/spec/features/modeling/BpmnFactorySpec.js @@ -8,7 +8,8 @@ var Matchers = require('../../../Matchers'), var fs = require('fs'); -var modelingModule = require('../../../../lib/features/modeling'); +var modelingModule = require('../../../../lib/features/modeling'), + coreModule = require('../../../../lib/core'); describe('features - bpmn-factory', function() { @@ -18,7 +19,7 @@ describe('features - bpmn-factory', function() { var diagramXML = fs.readFileSync('test/fixtures/bpmn/simple.bpmn', 'utf-8'); - var testModules = [ modelingModule ]; + var testModules = [ modelingModule, coreModule ]; beforeEach(bootstrapModeler(diagramXML, { modules: testModules })); diff --git a/test/spec/features/modeling/CreateConnectionSpec.js b/test/spec/features/modeling/CreateConnectionSpec.js index b8e25260..2e549ee4 100644 --- a/test/spec/features/modeling/CreateConnectionSpec.js +++ b/test/spec/features/modeling/CreateConnectionSpec.js @@ -10,7 +10,7 @@ var _ = require('lodash'); var fs = require('fs'); var modelingModule = require('../../../../lib/features/modeling'), - drawModule = require('../../../../lib/draw'); + coreModule = require('../../../../lib/core'); describe('features/modeling - create connection', function() { @@ -20,7 +20,7 @@ describe('features/modeling - create connection', function() { var diagramXML = fs.readFileSync('test/fixtures/bpmn/sequence-flows.bpmn', 'utf-8'); - var testModules = [ drawModule, modelingModule ]; + var testModules = [ coreModule, modelingModule ]; beforeEach(bootstrapModeler(diagramXML, { modules: testModules })); diff --git a/test/spec/features/modeling/DeleteConnectionSpec.js b/test/spec/features/modeling/DeleteConnectionSpec.js index e6c73a48..7e40989e 100644 --- a/test/spec/features/modeling/DeleteConnectionSpec.js +++ b/test/spec/features/modeling/DeleteConnectionSpec.js @@ -10,7 +10,7 @@ var _ = require('lodash'); var fs = require('fs'); var modelingModule = require('../../../../lib/features/modeling'), - drawModule = require('../../../../lib/draw'); + coreModule = require('../../../../lib/core'); describe('features/modeling - #removeConnection', function() { @@ -20,7 +20,7 @@ describe('features/modeling - #removeConnection', function() { var diagramXML = fs.readFileSync('test/fixtures/bpmn/sequence-flows.bpmn', 'utf-8'); - var testModules = [ drawModule, modelingModule ]; + var testModules = [ coreModule, modelingModule ]; beforeEach(bootstrapModeler(diagramXML, { modules: testModules })); diff --git a/test/spec/features/modeling/DeleteShapeSpec.js b/test/spec/features/modeling/DeleteShapeSpec.js index b353d36d..f9ea7c6f 100644 --- a/test/spec/features/modeling/DeleteShapeSpec.js +++ b/test/spec/features/modeling/DeleteShapeSpec.js @@ -10,7 +10,7 @@ var _ = require('lodash'); var fs = require('fs'); var modelingModule = require('../../../../lib/features/modeling'), - drawModule = require('../../../../lib/draw'); + coreModule = require('../../../../lib/core'); describe('features/modeling - #removeShape', function() { @@ -20,7 +20,7 @@ describe('features/modeling - #removeShape', function() { var diagramXML = fs.readFileSync('test/fixtures/bpmn/sequence-flows.bpmn', 'utf-8'); - var testModules = [ drawModule, modelingModule ]; + var testModules = [ coreModule, modelingModule ]; beforeEach(bootstrapModeler(diagramXML, { modules: testModules })); diff --git a/test/spec/features/modeling/LayoutConnectionSpec.js b/test/spec/features/modeling/LayoutConnectionSpec.js index bb5a350b..25f5cf1d 100644 --- a/test/spec/features/modeling/LayoutConnectionSpec.js +++ b/test/spec/features/modeling/LayoutConnectionSpec.js @@ -10,7 +10,7 @@ var _ = require('lodash'); var fs = require('fs'); var modelingModule = require('../../../../lib/features/modeling'), - drawModule = require('../../../../lib/draw'); + coreModule = require('../../../../lib/core'); describe('features/modeling - layout connection', function() { @@ -20,7 +20,7 @@ describe('features/modeling - layout connection', function() { var diagramXML = fs.readFileSync('test/fixtures/bpmn/sequence-flows.bpmn', 'utf-8'); - var testModules = [ drawModule, modelingModule ]; + var testModules = [ coreModule, modelingModule ]; beforeEach(bootstrapModeler(diagramXML, { modules: testModules })); diff --git a/test/spec/features/modeling/MoveConnectionSpec.js b/test/spec/features/modeling/MoveConnectionSpec.js index a4d5974f..c16e48bc 100644 --- a/test/spec/features/modeling/MoveConnectionSpec.js +++ b/test/spec/features/modeling/MoveConnectionSpec.js @@ -10,7 +10,7 @@ var _ = require('lodash'); var fs = require('fs'); var modelingModule = require('../../../../lib/features/modeling'), - drawModule = require('../../../../lib/draw'); + coreModule = require('../../../../lib/core'); describe('features/modeling - move connection', function() { @@ -20,7 +20,7 @@ describe('features/modeling - move connection', function() { var diagramXML = fs.readFileSync('test/fixtures/bpmn/sequence-flows.bpmn', 'utf-8'); - var testModules = [ drawModule, modelingModule ]; + var testModules = [ coreModule, modelingModule ]; beforeEach(bootstrapModeler(diagramXML, { modules: testModules })); diff --git a/test/spec/features/modeling/MoveShapeSpec.js b/test/spec/features/modeling/MoveShapeSpec.js index ec946391..1ecdbdf4 100644 --- a/test/spec/features/modeling/MoveShapeSpec.js +++ b/test/spec/features/modeling/MoveShapeSpec.js @@ -10,7 +10,7 @@ var _ = require('lodash'); var fs = require('fs'); var modelingModule = require('../../../../lib/features/modeling'), - drawModule = require('../../../../lib/draw'); + coreModule = require('../../../../lib/core'); describe('features/modeling - move shape', function() { @@ -20,7 +20,7 @@ describe('features/modeling - move shape', function() { var diagramXML = fs.readFileSync('test/fixtures/bpmn/simple.bpmn', 'utf-8'); - var testModules = [ drawModule, modelingModule ]; + var testModules = [ coreModule, modelingModule ]; beforeEach(bootstrapModeler(diagramXML, { modules: testModules })); diff --git a/test/spec/import/ImporterSpec.js b/test/spec/import/ImporterSpec.js index b0ee7bd0..9d94fbab 100644 --- a/test/spec/import/ImporterSpec.js +++ b/test/spec/import/ImporterSpec.js @@ -1,7 +1,6 @@ 'use strict'; -var Matchers = require('../../Matchers'), - TestHelper = require('../../TestHelper'); +var TestHelper = require('../../TestHelper'); var fs = require('fs'); @@ -20,8 +19,6 @@ describe('import - importer', function() { return moddle.fromXML(xml, 'bpmn:Definitions', opts, callback); } - beforeEach(Matchers.addDeepEquals); - var container;