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.
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/colors/view/ViewportController.mjs +13 -6
- package/apps/portal/neo-config.json +1 -0
- package/apps/portal/view/home/parts/How.mjs +1 -1
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/component/multiWindowHelix/ViewportController.mjs +13 -8
- package/package.json +1 -1
- package/src/DefaultConfig.mjs +5 -3
- package/src/Main.mjs +6 -1
package/apps/ServiceWorker.mjs
CHANGED
@@ -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
|
38
|
-
{windowId}
|
39
|
-
{windowConfigs} = Neo,
|
40
|
-
|
41
|
-
|
42
|
-
|
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),
|
@@ -22,16 +22,21 @@ class ViewportController extends Controller {
|
|
22
22
|
*
|
23
23
|
*/
|
24
24
|
async createPopupWindow() {
|
25
|
-
let me
|
26
|
-
{windowId}
|
27
|
-
{windowConfigs}
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
package/src/DefaultConfig.mjs
CHANGED
@@ -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.
|
265
|
+
* @default '6.44.0'
|
264
266
|
* @memberOf! module:Neo
|
265
267
|
* @name config.version
|
266
268
|
* @type String
|
267
269
|
*/
|
268
|
-
version: '6.
|
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 (
|
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
|
|