neo.mjs 6.16.4 → 6.17.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.
@@ -73,10 +73,10 @@ class List extends BaseList {
73
73
 
74
74
  const vdomCn = [
75
75
  {cls: ['content'], cn: [
76
- {cls: ['neo-full-size', 'preview-image'], style: {
77
- backgroundImage: `url('${basePath}/blog/${record.image}'), linear-gradient(#777, #333)`}
78
- },
79
76
  {cls: ['neo-relative'], cn: [
77
+ {cls: ['neo-full-size', 'preview-image'], style: {
78
+ backgroundImage: `url('${basePath}/blog/${record.image}'), linear-gradient(#777, #333)`}
79
+ },
80
80
  {cls: ['neo-absolute', 'neo-item-bottom-position'], cn: [
81
81
  {tag: 'a', cls: ['neo-title'], href: record.url, target: '_blank', cn: [
82
82
  {flag: 'name', html: record.name.replace(List.nameRegEx, "$1")}
@@ -103,7 +103,7 @@ class List extends BaseList {
103
103
  }
104
104
 
105
105
  if (record.selectedInto.length > 0) {
106
- vdomCn[0].cn[1].cn.unshift(
106
+ vdomCn[0].cn[0].cn.splice(1, 0,
107
107
  {cls: ['neo-absolute', 'neo-item-top-position'], cn: [
108
108
  {html: `Officially selected by ${record.provider} into`},
109
109
  {cls: ['neo-bold'], html: record.selectedInto.join('</br>')}
@@ -73,10 +73,10 @@ class List extends BaseList {
73
73
 
74
74
  const vdomCn = [
75
75
  {cls: ['content'], cn: [
76
- {cls: ['neo-full-size', 'preview-image'], style: {
77
- backgroundImage: `url('${basePath}/blog/${record.image}'), linear-gradient(#777, #333)`}
78
- },
79
76
  {cls: ['neo-relative'], cn: [
77
+ {cls: ['neo-full-size', 'preview-image'], style: {
78
+ backgroundImage: `url('${basePath}/blog/${record.image}'), linear-gradient(#777, #333)`}
79
+ },
80
80
  {cls: ['neo-absolute', 'neo-item-bottom-position'], cn: [
81
81
  {tag: 'a', cls: ['neo-title'], href: record.url, target: '_blank', cn: [
82
82
  {flag: 'name', html: record.name.replace(List.nameRegEx, "$1")}
@@ -103,7 +103,7 @@ class List extends BaseList {
103
103
  }
104
104
 
105
105
  if (record.selectedInto.length > 0) {
106
- vdomCn[0].cn[1].cn.unshift(
106
+ vdomCn[0].cn[0].cn.splice(1, 0,
107
107
  {cls: ['neo-absolute', 'neo-item-top-position'], cn: [
108
108
  {html: `Officially selected by ${record.provider} into`},
109
109
  {cls: ['neo-bold'], html: record.selectedInto.join('</br>')}
@@ -59,16 +59,22 @@ class MainContainer extends Viewport {
59
59
  }
60
60
  }]
61
61
  }, {
62
- ntype : 'panel',
63
- layout: {ntype: 'vbox',align: 'stretch'},
64
- style : {backgroundColor: '#2b2b2b'},
65
- width : 250,
62
+ ntype : 'panel',
63
+ layout : {ntype: 'vbox', align: 'stretch'},
64
+ reference: 'controls-panel',
65
+ style : {backgroundColor: '#2b2b2b'},
66
+ width : 250,
66
67
 
67
68
  containerConfig: {
68
69
  flex : null,
69
70
  style: {overflowY: 'scroll'}
70
71
  },
71
72
 
73
+ headers: [{
74
+ dock: 'top',
75
+ text: 'Helix Controls'
76
+ }],
77
+
72
78
  itemDefaults: {
73
79
  ntype : 'rangefield',
74
80
  flex : '0 1 auto',
@@ -86,11 +92,6 @@ class MainContainer extends Viewport {
86
92
  }
87
93
  },
88
94
 
89
- headers: [{
90
- dock: 'top',
91
- text: 'Helix Controls'
92
- }],
93
-
94
95
  items: [{
95
96
  labelText: 'Translate X',
96
97
  maxValue : 2000,
@@ -0,0 +1,41 @@
1
+ import MainContainer from '../helix/MainContainer.mjs';
2
+ import ViewportController from './ViewportController.mjs';
3
+
4
+ /**
5
+ * @class Neo.examples.component.multiWindowHelix.Viewport
6
+ * @extends Neo.examples.component.helix.MainContainer
7
+ */
8
+ class Viewport extends MainContainer {
9
+ static config = {
10
+ className: 'Neo.examples.component.multiWindowHelix.Viewport',
11
+ /**
12
+ * @member {Neo.controller.Component} controller=ViewportController
13
+ */
14
+ controller: ViewportController
15
+ }
16
+
17
+ /**
18
+ * @param {Object} config
19
+ */
20
+ construct(config) {
21
+ super.construct(config);
22
+
23
+ this.getItem('controls-panel').headers = [{
24
+ dock : 'top',
25
+ reference: 'header-toolbar',
26
+
27
+ items: [{
28
+ ntype: 'label',
29
+ cls : ['neo-panel-header-text', 'neo-label'],
30
+ text : 'Helix Controls'
31
+ }, '->', {
32
+ handler: 'onMaximiseButtonClick',
33
+ iconCls: 'far fa-window-maximize'
34
+ }]
35
+ }];
36
+ }
37
+ }
38
+
39
+ Neo.setupClass(Viewport);
40
+
41
+ export default Viewport;
@@ -0,0 +1,113 @@
1
+ import Component from '../../../src/controller/Component.mjs';
2
+
3
+ /**
4
+ * @class Neo.examples.component.multiWindowHelix.ViewportController
5
+ * @extends Neo.controller.Component
6
+ */
7
+ class ViewportController extends Component {
8
+ static config = {
9
+ /**
10
+ * @member {String} className='Neo.examples.component.multiWindowHelix.ViewportController'
11
+ * @protected
12
+ */
13
+ className: 'Neo.examples.component.multiWindowHelix.ViewportController'
14
+ }
15
+
16
+ /**
17
+ * @member {String[]} connectedApps=[]
18
+ */
19
+ connectedApps = []
20
+
21
+ /**
22
+ *
23
+ */
24
+ async createPopupWindow() {
25
+ let me = this,
26
+ widget = me.getReference('controls-panel'),
27
+ winData = await Neo.Main.getWindowData(),
28
+ rect = await me.component.getDomRect(widget.id),
29
+ {height, left, top, width} = rect;
30
+
31
+ height -= 62; // popup header in Chrome
32
+ left += (width + winData.screenLeft);
33
+ top += (winData.outerHeight - winData.innerHeight + winData.screenTop);
34
+
35
+ await Neo.Main.windowOpen({
36
+ url : './childapp/index.html',
37
+ windowFeatures: `height=${height},left=${left},top=${top},width=${width}`,
38
+ windowName : 'HelixControls'
39
+ })
40
+ }
41
+
42
+ /**
43
+ * @param {Object} data
44
+ * @param {String} data.appName
45
+ * @param {Number} data.windowId
46
+ */
47
+ async onAppConnect(data) {
48
+ let me = this,
49
+ {appName} = data;
50
+
51
+ if (appName === 'HelixControls') {
52
+ let controlsPanel = me.getReference('controls-panel'),
53
+ {mainView} = Neo.apps[appName];
54
+
55
+ me.connectedApps.push(appName);
56
+
57
+ controlsPanel.parent.remove(controlsPanel, false);
58
+
59
+ this.getReference('header-toolbar').hidden = true;
60
+
61
+ mainView.add(controlsPanel)
62
+ }
63
+ }
64
+
65
+ /**
66
+ * @param {Object} data
67
+ * @param {String} data.appName
68
+ * @param {Number} data.windowId
69
+ */
70
+ async onAppDisconnect(data) {
71
+ let me = this,
72
+ {appName, windowId} = data;
73
+
74
+ if (appName === 'HelixControls') {
75
+ let controlsPanel = me.getReference('controls-panel');
76
+
77
+ controlsPanel.parent.remove(controlsPanel, false);
78
+
79
+ me.getReference('header-toolbar').hidden = false;
80
+
81
+ me.component.add(controlsPanel)
82
+ }
83
+ // Close popup windows when closing or reloading the main window
84
+ else {
85
+ Neo.Main.windowClose({names: me.connectedApps, windowId})
86
+ }
87
+ }
88
+ /**
89
+ *
90
+ */
91
+ onConstructed() {
92
+ super.onConstructed();
93
+
94
+ let me = this;
95
+
96
+ Neo.currentWorker.on({
97
+ connect : me.onAppConnect,
98
+ disconnect: me.onAppDisconnect,
99
+ scope : me
100
+ })
101
+ }
102
+
103
+ /**
104
+ * @param {Object} data
105
+ */
106
+ async onMaximiseButtonClick(data) {
107
+ await this.createPopupWindow()
108
+ }
109
+ }
110
+
111
+ Neo.setupClass(ViewportController);
112
+
113
+ export default ViewportController;
@@ -0,0 +1,6 @@
1
+ import Viewport from './Viewport.mjs';
2
+
3
+ export const onStart = () => Neo.app({
4
+ mainView: Viewport,
5
+ name : 'Neo.examples.component.multiWindowHelix'
6
+ });
@@ -0,0 +1,23 @@
1
+ import BaseViewport from '../../../../src/container/Viewport.mjs';
2
+
3
+ /**
4
+ * @class Neo.examples.component.multiWindowHelix.childapp.Viewport
5
+ * @extends Neo.container.Viewport
6
+ */
7
+ class Viewport extends BaseViewport {
8
+ static config = {
9
+ /**
10
+ * @member {String} className='Neo.examples.component.multiWindowHelix.childapp.Viewport'
11
+ * @protected
12
+ */
13
+ className: 'Neo.examples.component.multiWindowHelix.childapp.Viewport',
14
+ /**
15
+ * @member {Object} layout={ntype:'fit'}
16
+ */
17
+ layout: {ntype: 'fit'}
18
+ }
19
+ }
20
+
21
+ Neo.setupClass(Viewport);
22
+
23
+ export default Viewport;
@@ -0,0 +1,6 @@
1
+ import Viewport from './Viewport.mjs';
2
+
3
+ export const onStart = () => Neo.app({
4
+ mainView: Viewport,
5
+ name : 'HelixControls'
6
+ });
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE HTML>
2
+ <html>
3
+ <head>
4
+ <meta name="viewport" content="width=device-width, initial-scale=1">
5
+ <meta charset="UTF-8">
6
+ <title>Helix Controls</title>
7
+ </head>
8
+ <body>
9
+ <script src="../../../../src/MicroLoader.mjs" type="module"></script>
10
+ </body>
11
+ </html>
@@ -0,0 +1,9 @@
1
+ {
2
+ "appPath" : "examples/component/multiWindowHelix/childapp/app.mjs",
3
+ "basePath" : "../../../../",
4
+ "environment" : "development",
5
+ "mainPath" : "./Main.mjs",
6
+ "mainThreadAddons": ["Stylesheet"],
7
+ "themes" : ["neo-theme-dark"],
8
+ "useSharedWorkers": true
9
+ }
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE HTML>
2
+ <html>
3
+ <head>
4
+ <meta name="viewport" content="width=device-width, initial-scale=1">
5
+ <meta charset="UTF-8">
6
+ <title>Neo Multi-Window Helix</title>
7
+ </head>
8
+ <body>
9
+ <script src="../../../src/MicroLoader.mjs" type="module"></script>
10
+ </body>
11
+ </html>
@@ -0,0 +1,9 @@
1
+ {
2
+ "appPath" : "examples/component/multiWindowHelix/app.mjs",
3
+ "basePath" : "../../../",
4
+ "environment" : "development",
5
+ "mainPath" : "./Main.mjs",
6
+ "renderCountDeltas": true,
7
+ "themes" : ["neo-theme-dark"],
8
+ "useSharedWorkers" : true
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "6.16.4",
3
+ "version": "6.17.0",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -53,15 +53,15 @@
53
53
  "fs-extra": "^11.2.0",
54
54
  "highlightjs-line-numbers.js": "^2.8.0",
55
55
  "inquirer": "^9.2.23",
56
- "marked": "^12.0.2",
56
+ "marked": "^13.0.0",
57
57
  "monaco-editor": "^0.49.0",
58
58
  "neo-jsdoc": "1.0.1",
59
59
  "neo-jsdoc-x": "1.0.5",
60
60
  "postcss": "^8.4.38",
61
- "sass": "^1.77.4",
61
+ "sass": "^1.77.6",
62
62
  "siesta-lite": "5.5.2",
63
63
  "url": "^0.11.3",
64
- "webpack": "^5.91.0",
64
+ "webpack": "^5.92.0",
65
65
  "webpack-cli": "^5.1.4",
66
66
  "webpack-dev-server": "^5.0.4",
67
67
  "webpack-hook-plugin": "^1.0.7",
@@ -158,7 +158,7 @@
158
158
  font-size: 16px;
159
159
  left : 30%;
160
160
  margin : 30px 40px;
161
- top : -400px;
161
+ top : 0;
162
162
  }
163
163
 
164
164
  .neo-list-item {
@@ -158,7 +158,7 @@
158
158
  font-size: 16px;
159
159
  left : 30%;
160
160
  margin : 30px 40px;
161
- top : -400px;
161
+ top : 0;
162
162
  }
163
163
 
164
164
  .neo-list-item {