@fleetbase/fleetops-engine 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import 'leaflet-contextmenu';
|
|
2
1
|
import Component from '@glimmer/component';
|
|
3
2
|
import { tracked } from '@glimmer/tracking';
|
|
4
3
|
import { inject as service } from '@ember/service';
|
|
@@ -132,6 +131,7 @@ export default class LiveMapComponent extends Component {
|
|
|
132
131
|
}
|
|
133
132
|
|
|
134
133
|
const { contextmenu } = map;
|
|
134
|
+
console.log('map.contextmenu', contextmenu);
|
|
135
135
|
const contextMenuItems = this.buildContextMenuItems();
|
|
136
136
|
|
|
137
137
|
contextMenuItems.forEach((options) => contextmenu.addItem(options));
|
package/index.js
CHANGED
|
@@ -3,9 +3,7 @@ const Funnel = require('broccoli-funnel');
|
|
|
3
3
|
const MergeTrees = require('broccoli-merge-trees');
|
|
4
4
|
const { buildEngine } = require('ember-engines/lib/engine-addon');
|
|
5
5
|
const { name } = require('./package');
|
|
6
|
-
const
|
|
7
|
-
// const fs = require('fs-extra');
|
|
8
|
-
// const path = require('path');
|
|
6
|
+
const path = require('path');
|
|
9
7
|
|
|
10
8
|
module.exports = buildEngine({
|
|
11
9
|
name,
|
|
@@ -14,42 +12,35 @@ module.exports = buildEngine({
|
|
|
14
12
|
enabled: true,
|
|
15
13
|
},
|
|
16
14
|
|
|
17
|
-
_concatStyles: () => {},
|
|
18
|
-
|
|
19
15
|
included: function (app) {
|
|
20
16
|
this._super.included.apply(this, arguments);
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// leaflet-contextmenu js
|
|
28
|
-
this.import(`${packagePrefix}/leaflet-contextmenu/dist/leaflet.contextmenu.js`, {
|
|
29
|
-
using: [{ transformation: 'es6', as: 'leaflet-contextmenu' }],
|
|
30
|
-
});
|
|
18
|
+
const importJs = (module, file, options) => {
|
|
19
|
+
const modulePath = path.dirname(require.resolve(module));
|
|
20
|
+
this.import(`${modulePath}/${file}`, options);
|
|
21
|
+
};
|
|
31
22
|
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
importJs('leaflet-rotatedmarker', 'leaflet.rotatedMarker.js');
|
|
24
|
+
importJs('leaflet-draw', 'leaflet.draw-src.js');
|
|
25
|
+
importJs('leaflet-contextmenu', 'leaflet.contextmenu.js');
|
|
34
26
|
|
|
35
|
-
//
|
|
36
|
-
this.import(
|
|
37
|
-
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// leaflet-draw css
|
|
41
|
-
this.import(`${packagePrefix}/leaflet-draw/dist/leaflet.draw.css`);
|
|
27
|
+
// import stylesheets
|
|
28
|
+
this.import('node_modules/leaflet-contextmenu/dist/leaflet.contextmenu.css');
|
|
29
|
+
this.import('node_modules/leaflet-draw/dist/leaflet.draw.css');
|
|
42
30
|
},
|
|
43
31
|
|
|
44
32
|
treeForPublic: function () {
|
|
45
33
|
const publicTree = this._super.treeForPublic.apply(this, arguments);
|
|
46
34
|
|
|
47
35
|
// Use a Funnel assets
|
|
36
|
+
const leafletPath = path.dirname(require.resolve('leaflet'));
|
|
37
|
+
const leafletImagesPath = path.join(leafletPath, 'images');
|
|
48
38
|
const addonTree = [
|
|
49
39
|
new Funnel(`node_modules/${name}/assets`, {
|
|
50
40
|
destDir: '/',
|
|
51
41
|
}),
|
|
52
|
-
new Funnel(
|
|
42
|
+
new Funnel(leafletImagesPath, {
|
|
43
|
+
srcDir: '/',
|
|
53
44
|
destDir: '/leaflet-images',
|
|
54
45
|
}),
|
|
55
46
|
];
|
|
@@ -58,14 +49,7 @@ module.exports = buildEngine({
|
|
|
58
49
|
return publicTree ? new MergeTrees([publicTree, ...addonTree], { overwrite: true }) : new MergeTrees([...addonTree], { overwrite: true });
|
|
59
50
|
},
|
|
60
51
|
|
|
61
|
-
|
|
62
|
-
// const src = path.join(result.directory, 'assets', 'leaflet-images');
|
|
63
|
-
// const dest = path.join(result.directory, '..', '..', 'public', 'fleet-ops', 'assets', 'images');
|
|
64
|
-
|
|
65
|
-
// if (fs.existsSync(src)) {
|
|
66
|
-
// fs.copySync(src, dest);
|
|
67
|
-
// }
|
|
68
|
-
// },
|
|
52
|
+
_concatStyles: () => {},
|
|
69
53
|
|
|
70
54
|
isDevelopingAddon() {
|
|
71
55
|
return true;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fleetbase/fleetops-engine",
|
|
3
3
|
"extension": "Fleet Ops",
|
|
4
4
|
"icon": "route",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.2",
|
|
6
6
|
"priority": 0,
|
|
7
7
|
"description": "Fleetbase Fleet-Ops extension provides a fleet management and last mile delivery operations system module.",
|
|
8
8
|
"keywords": [
|