neo.mjs 6.16.5 → 6.17.1
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/website/data/docs.json +2 -2
- package/apps/website/view/blog/List.mjs +28 -30
- package/apps/website/view/examples/List.mjs +15 -17
- package/docs/app/view/classdetails/MembersList.mjs +4 -0
- package/examples/component/helix/MainContainer.mjs +10 -9
- package/examples/component/multiWindowHelix/Viewport.mjs +41 -0
- package/examples/component/multiWindowHelix/ViewportController.mjs +113 -0
- package/examples/component/multiWindowHelix/app.mjs +6 -0
- package/examples/component/multiWindowHelix/childapp/Viewport.mjs +23 -0
- package/examples/component/multiWindowHelix/childapp/app.mjs +6 -0
- package/examples/component/multiWindowHelix/childapp/index.html +11 -0
- package/examples/component/multiWindowHelix/childapp/neo-config.json +9 -0
- package/examples/component/multiWindowHelix/index.html +11 -0
- package/examples/component/multiWindowHelix/neo-config.json +9 -0
- package/package.json +2 -2
@@ -1,6 +1,6 @@
|
|
1
1
|
[
|
2
2
|
{
|
3
|
-
"browsers" : ["Chrome (including more examples)"],
|
3
|
+
"browsers" : ["Chrome", "Edge", "Firefox", "Safari</br>(including more examples)"],
|
4
4
|
"environments": ["Desktop"],
|
5
5
|
"id" : 1,
|
6
6
|
"image" : "devmode/docs.png",
|
@@ -26,4 +26,4 @@
|
|
26
26
|
"sourceUrl" : "https://github.com/neomjs/neo/tree/dev/docs",
|
27
27
|
"url" : "https://neomjs.github.io/pages/node_modules/neo.mjs/dist/production/docs/index.html"
|
28
28
|
}
|
29
|
-
]
|
29
|
+
]
|
@@ -52,7 +52,7 @@ class List extends BaseList {
|
|
52
52
|
value.on({
|
53
53
|
load : 'onBlogPostStoreLoad',
|
54
54
|
scope: this.getController()
|
55
|
-
})
|
55
|
+
})
|
56
56
|
}
|
57
57
|
|
58
58
|
/**
|
@@ -65,30 +65,28 @@ class List extends BaseList {
|
|
65
65
|
basePath = '../../../../resources/website';
|
66
66
|
|
67
67
|
if (Neo.config.environment !== 'development') {
|
68
|
-
basePath = '../../' + basePath
|
68
|
+
basePath = '../../' + basePath
|
69
69
|
}
|
70
70
|
} else {
|
71
|
-
basePath = 'https://raw.githubusercontent.com/neomjs/pages/main/resources/website'
|
71
|
+
basePath = 'https://raw.githubusercontent.com/neomjs/pages/main/resources/website'
|
72
72
|
}
|
73
73
|
|
74
74
|
const vdomCn = [
|
75
|
-
{cls: ['content'], cn: [
|
76
|
-
{cls: ['neo-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
{cls: ['neo-
|
81
|
-
{
|
82
|
-
|
83
|
-
|
84
|
-
{cls: ['neo-
|
85
|
-
|
86
|
-
{cls: ['neo-inner-
|
87
|
-
{cls: ['neo-
|
88
|
-
|
89
|
-
|
90
|
-
{cls: ['neo-inner-details'], html: record.date}
|
91
|
-
]}
|
75
|
+
{cls: ['content', 'neo-relative'], cn: [
|
76
|
+
{cls: ['neo-full-size', 'preview-image'], style: {
|
77
|
+
backgroundImage: `url('${basePath}/blog/${record.image}'), linear-gradient(#777, #333)`}
|
78
|
+
},
|
79
|
+
{cls: ['neo-absolute', 'neo-item-bottom-position'], cn: [
|
80
|
+
{tag: 'a', cls: ['neo-title'], href: record.url, target: '_blank', cn: [
|
81
|
+
{flag: 'name', html: record.name.replace(List.nameRegEx, "$1")}
|
82
|
+
]},
|
83
|
+
{cls: ['neo-top-20'], cn: [
|
84
|
+
{tag: 'img', cls: ['neo-user-image'], src: `${basePath}/blogAuthor/${record.authorImage}`},
|
85
|
+
{cls: ['neo-inner-content'], cn: [
|
86
|
+
{cls: ['neo-inner-details'], flag: 'author', cn: [
|
87
|
+
{tag: 'span', cls: ['neo-bold'], html: record.author}
|
88
|
+
]},
|
89
|
+
{cls: ['neo-inner-details'], html: record.date}
|
92
90
|
]}
|
93
91
|
]}
|
94
92
|
]}
|
@@ -99,19 +97,19 @@ class List extends BaseList {
|
|
99
97
|
VDomUtil.getByFlag(vdomCn[0], 'author').cn.push(
|
100
98
|
{vtype: 'text', html : ' in '},
|
101
99
|
{tag: 'span', cls: ['neo-bold'], html: record.publisher}
|
102
|
-
)
|
100
|
+
)
|
103
101
|
}
|
104
102
|
|
105
103
|
if (record.selectedInto.length > 0) {
|
106
|
-
vdomCn[0].cn
|
104
|
+
vdomCn[0].cn.splice(1, 0,
|
107
105
|
{cls: ['neo-absolute', 'neo-item-top-position'], cn: [
|
108
106
|
{html: `Officially selected by ${record.provider} into`},
|
109
107
|
{cls: ['neo-bold'], html: record.selectedInto.join('</br>')}
|
110
108
|
]}
|
111
|
-
)
|
109
|
+
)
|
112
110
|
}
|
113
111
|
|
114
|
-
return vdomCn
|
112
|
+
return vdomCn
|
115
113
|
}
|
116
114
|
|
117
115
|
/**
|
@@ -135,7 +133,7 @@ class List extends BaseList {
|
|
135
133
|
|
136
134
|
if (emptyValue) {
|
137
135
|
itemName.html = name;
|
138
|
-
delete item.style.display
|
136
|
+
delete item.style.display
|
139
137
|
} else {
|
140
138
|
itemName.html = name.replace(valueRegEx, match => {
|
141
139
|
hasMatch = true;
|
@@ -143,28 +141,28 @@ class List extends BaseList {
|
|
143
141
|
});
|
144
142
|
|
145
143
|
if (hasMatch) {
|
146
|
-
delete item.style.display
|
144
|
+
delete item.style.display
|
147
145
|
} else {
|
148
|
-
item.style.display = 'none'
|
146
|
+
item.style.display = 'none'
|
149
147
|
}
|
150
148
|
}
|
151
149
|
});
|
152
150
|
|
153
|
-
me.update()
|
151
|
+
me.update()
|
154
152
|
}
|
155
153
|
|
156
154
|
/**
|
157
155
|
* @returns {Object}
|
158
156
|
*/
|
159
157
|
getVdomRoot() {
|
160
|
-
return this.vdom.cn[0]
|
158
|
+
return this.vdom.cn[0]
|
161
159
|
}
|
162
160
|
|
163
161
|
/**
|
164
162
|
* @returns {Object}
|
165
163
|
*/
|
166
164
|
getVnodeRoot() {
|
167
|
-
return this.vnode.childNodes[0]
|
165
|
+
return this.vnode.childNodes[0]
|
168
166
|
}
|
169
167
|
}
|
170
168
|
|
@@ -77,47 +77,45 @@ class List extends BaseList {
|
|
77
77
|
basePath = '../../../../resources/website/examples';
|
78
78
|
|
79
79
|
if (Neo.config.environment !== 'development') {
|
80
|
-
basePath = '../../' + basePath
|
80
|
+
basePath = '../../' + basePath
|
81
81
|
}
|
82
82
|
} else {
|
83
|
-
basePath = 'https://raw.githubusercontent.com/neomjs/pages/main/resources/website/examples'
|
83
|
+
basePath = 'https://raw.githubusercontent.com/neomjs/pages/main/resources/website/examples'
|
84
84
|
}
|
85
85
|
|
86
86
|
return [
|
87
|
-
{cls: ['content'], cn: [
|
87
|
+
{cls: ['content', 'neo-relative'], cn: [
|
88
88
|
{cls: ['neo-full-size', 'preview-image'], style: {
|
89
89
|
backgroundImage: `url('${basePath}/${record.image}'), linear-gradient(#777, #333)`}
|
90
90
|
},
|
91
|
-
{cls: ['neo-
|
92
|
-
{cls: ['neo-
|
93
|
-
{
|
94
|
-
|
95
|
-
|
96
|
-
{cls: ['neo-
|
97
|
-
|
98
|
-
{cls: ['neo-inner-
|
99
|
-
|
100
|
-
{cls: ['neo-inner-details'], html: record.environments.join(', ')}
|
101
|
-
]}
|
91
|
+
{cls: ['neo-absolute', 'neo-item-bottom-position'], cn: [
|
92
|
+
{tag: 'a', cls: ['neo-title'], href: record.url, target: '_blank', cn: [
|
93
|
+
{html: record.name.replace(List.nameRegEx, "$1")}
|
94
|
+
]},
|
95
|
+
{cls: ['neo-top-20'], cn: [
|
96
|
+
{tag: 'a', cls: ['fab fa-github', 'neo-github-image'], href: record.sourceUrl, target: '_blank'},
|
97
|
+
{cls: ['neo-inner-content'], cn: [
|
98
|
+
{cls: ['neo-inner-details'], html: record.browsers.join(', ')},
|
99
|
+
{cls: ['neo-inner-details'], html: record.environments.join(', ')}
|
102
100
|
]}
|
103
101
|
]}
|
104
102
|
]}
|
105
103
|
]}
|
106
|
-
]
|
104
|
+
]
|
107
105
|
}
|
108
106
|
|
109
107
|
/**
|
110
108
|
* @returns {Object}
|
111
109
|
*/
|
112
110
|
getVdomRoot() {
|
113
|
-
return this.vdom.cn[0]
|
111
|
+
return this.vdom.cn[0]
|
114
112
|
}
|
115
113
|
|
116
114
|
/**
|
117
115
|
* @returns {Object}
|
118
116
|
*/
|
119
117
|
getVnodeRoot() {
|
120
|
-
return this.vnode.childNodes[0]
|
118
|
+
return this.vnode.childNodes[0]
|
121
119
|
}
|
122
120
|
}
|
123
121
|
|
@@ -246,6 +246,10 @@ class MembersList extends Base {
|
|
246
246
|
|
247
247
|
// methods
|
248
248
|
if (item.params && item.kind !== 'event') {
|
249
|
+
if (item.$kind === 'property') {console.log(item);
|
250
|
+
headerText = 'get ' + headerText
|
251
|
+
}
|
252
|
+
|
249
253
|
headerText += ('(' + item.params.reduce((result, param) => {
|
250
254
|
if (param.name.indexOf('.') < 0) {
|
251
255
|
if (param.optional) {
|
@@ -59,16 +59,22 @@ class MainContainer extends Viewport {
|
|
59
59
|
}
|
60
60
|
}]
|
61
61
|
}, {
|
62
|
-
ntype
|
63
|
-
layout: {ntype: 'vbox',align: 'stretch'},
|
64
|
-
|
65
|
-
|
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,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,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>
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "neo.mjs",
|
3
|
-
"version": "6.
|
3
|
+
"version": "6.17.1",
|
4
4
|
"description": "The webworkers driven UI framework",
|
5
5
|
"type": "module",
|
6
6
|
"repository": {
|
@@ -58,7 +58,7 @@
|
|
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.
|
61
|
+
"sass": "^1.77.6",
|
62
62
|
"siesta-lite": "5.5.2",
|
63
63
|
"url": "^0.11.3",
|
64
64
|
"webpack": "^5.92.0",
|