neo.mjs 6.43.0 → 6.44.0

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.
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='6.43.0'
23
+ * @member {String} version='6.44.0'
24
24
  */
25
- version: '6.43.0'
25
+ version: '6.44.0'
26
26
  }
27
27
 
28
28
  /**
@@ -34,12 +34,19 @@ class ViewportController extends Controller {
34
34
  * @param {String} name The name of the reference
35
35
  */
36
36
  async createBrowserWindow(name) {
37
- let me = this,
38
- {windowId} = me,
39
- {windowConfigs} = Neo,
40
- firstWindowId = parseInt(Object.keys(windowConfigs)[0]),
41
- {basePath} = windowConfigs[firstWindowId],
42
- url = `${basePath}apps/colors/childapps/widget/index.html?name=${name}`;
37
+ let me = this,
38
+ {windowId} = me,
39
+ {config, windowConfigs} = Neo,
40
+ {environment} = config,
41
+ firstWindowId = parseInt(Object.keys(windowConfigs)[0]),
42
+ {basePath} = windowConfigs[firstWindowId],
43
+ url;
44
+
45
+ if (environment !== 'development') {
46
+ basePath = `${basePath + environment}/`
47
+ }
48
+
49
+ url = `${basePath}apps/colors/childapps/widget/index.html?name=${name}`;
43
50
 
44
51
  if (me.getModel().getData('openWidgetsAsPopups')) {
45
52
  let widget = me.getReference(name),
@@ -6,6 +6,7 @@
6
6
  "remotesApiUrl" : "remotes-api.json",
7
7
  "themes" : ["neo-theme-neo-light", "neo-theme-light", "neo-theme-dark"],
8
8
  "useSharedWorkers": true,
9
+ "useServiceWorker": "dist/production",
9
10
 
10
11
  "mainThreadAddons": [
11
12
  "AmCharts",
@@ -25,7 +25,7 @@ class How extends FeatureSection {
25
25
  items : [{
26
26
  cls : 'neo-worker-setup',
27
27
  tag : 'element-loader',
28
- vdom: {src: '../../resources/images/workers-focus.svg'}
28
+ vdom: {src: './resources/images/workers-focus.svg'}
29
29
  }]
30
30
  }],
31
31
  /**
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='6.43.0'
23
+ * @member {String} version='6.44.0'
24
24
  */
25
- version: '6.43.0'
25
+ version: '6.44.0'
26
26
  }
27
27
 
28
28
  /**
@@ -22,16 +22,21 @@ class ViewportController extends Controller {
22
22
  *
23
23
  */
24
24
  async createPopupWindow() {
25
- let me = this,
26
- {windowId} = me,
27
- {windowConfigs} = Neo,
28
- firstWindowId = parseInt(Object.keys(windowConfigs)[0]),
29
- {basePath} = windowConfigs[firstWindowId],
30
- widget = me.getReference('controls-panel'),
31
- winData = await Neo.Main.getWindowData({windowId}),
32
- rect = await me.component.getDomRect(widget.id),
25
+ let me = this,
26
+ {windowId} = me,
27
+ {config, windowConfigs} = Neo,
28
+ {environment} = config,
29
+ firstWindowId = parseInt(Object.keys(windowConfigs)[0]),
30
+ {basePath} = windowConfigs[firstWindowId],
31
+ widget = me.getReference('controls-panel'),
32
+ winData = await Neo.Main.getWindowData({windowId}),
33
+ rect = await me.component.getDomRect(widget.id),
33
34
  {height, left, top, width} = rect;
34
35
 
36
+ if (environment !== 'development') {
37
+ basePath = `${basePath + environment}/`
38
+ }
39
+
35
40
  height -= 62; // popup header in Chrome
36
41
  left += (width + winData.screenLeft);
37
42
  top += (winData.outerHeight - winData.innerHeight + winData.screenTop);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "6.43.0",
3
+ "version": "6.44.0",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -219,10 +219,12 @@ const DefaultConfig = {
219
219
  /**
220
220
  * True will add the ServiceWorker main thread addon to support caching of assets (PWA)
221
221
  * See: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
222
+ *
223
+ * You can also use a string to specify the target environment => 'dist/production'
222
224
  * @default false
223
225
  * @memberOf! module:Neo
224
226
  * @name config.useServiceWorker
225
- * @type Boolean
227
+ * @type Boolean|String
226
228
  */
227
229
  useServiceWorker: false,
228
230
  /**
@@ -260,12 +262,12 @@ const DefaultConfig = {
260
262
  useVdomWorker: true,
261
263
  /**
262
264
  * buildScripts/injectPackageVersion.mjs will update this value
263
- * @default '6.43.0'
265
+ * @default '6.44.0'
264
266
  * @memberOf! module:Neo
265
267
  * @name config.version
266
268
  * @type String
267
269
  */
268
- version: '6.43.0'
270
+ version: '6.44.0'
269
271
  };
270
272
 
271
273
  Object.assign(DefaultConfig, {
package/src/Main.mjs CHANGED
@@ -254,7 +254,12 @@ class Main extends core.Base {
254
254
  mainThreadAddons.push('AnalyticsByGoogle')
255
255
  }
256
256
 
257
- if (config.useServiceWorker && !mainThreadAddons.includes('ServiceWorker')) {
257
+ if ((
258
+ config.useServiceWorker === true ||
259
+ config.useServiceWorker === config.environment
260
+ ) &&
261
+ !mainThreadAddons.includes('ServiceWorker')
262
+ ) {
258
263
  mainThreadAddons.push('ServiceWorker')
259
264
  }
260
265