neo.mjs 6.19.3 → 6.20.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/portal/view/home/parts/Colors.mjs +1 -0
- package/apps/portal/view/home/parts/Features.mjs +56 -8
- package/apps/portal/view/home/parts/Helix.mjs +1 -0
- package/apps/portal/view/home/parts/How.mjs +1 -0
- package/examples/ServiceWorker.mjs +2 -2
- package/package.json +2 -2
- package/resources/scss/src/apps/portal/home/ContentBox.scss +4 -1
- package/resources/scss/src/apps/portal/home/parts/BaseContainer.scss +7 -0
- package/resources/scss/src/apps/portal/home/parts/Features.scss +3 -1
- package/resources/scss/src/apps/portal/learn/PageContainer.scss +6 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/component/Helix.mjs +11 -3
- package/src/list/Base.mjs +0 -1
- package/src/main/DomEvents.mjs +6 -0
- package/src/main/mixin/TouchDomEvents.mjs +27 -4
- package/src/manager/DomEvent.mjs +1 -0
- package/src/tree/List.mjs +72 -41
package/apps/ServiceWorker.mjs
CHANGED
@@ -25,23 +25,71 @@ class Features extends BaseContainer {
|
|
25
25
|
*/
|
26
26
|
items: [{
|
27
27
|
module: ContentBox,
|
28
|
-
header: '
|
28
|
+
header: 'Multi-Window Apps',
|
29
29
|
route : '#/learn/WhyNeo-Quick',
|
30
30
|
|
31
31
|
content: [
|
32
|
-
'
|
33
|
-
'
|
34
|
-
'
|
32
|
+
'No need for a Native Shell (e.g. Electron)',
|
33
|
+
'Sharing Data across Windows',
|
34
|
+
'Sharing State across Windows',
|
35
|
+
'Moving Components across Windows while keeping the same JS instances'
|
35
36
|
]
|
36
37
|
}, {
|
37
38
|
module: ContentBox,
|
38
|
-
header: '
|
39
|
+
header: 'Multi-threading',
|
40
|
+
route : '#/learn/WhyNeo-Quick',
|
41
|
+
|
42
|
+
content: [
|
43
|
+
'Following the OMT (Off the Main-Thread) paradigm',
|
44
|
+
'Your Apps & the Framework live within an Application Worker',
|
45
|
+
'Non-blocking, no-freeze, user interaction responses, even for heavy data i/o, processing, and intensive, complex screen updating',
|
46
|
+
'Additional Workers for OffscreenCanvas, Data, Delta-Updates & Tasks',
|
47
|
+
'A ServiceWorker connected to the App Worker for predictive Caching'
|
48
|
+
]
|
49
|
+
}, {
|
50
|
+
module: ContentBox,
|
51
|
+
header: 'Modern JavaScript directly in your Browser',
|
52
|
+
route : '#/learn/WhyNeo-Quick',
|
53
|
+
|
54
|
+
content: [
|
55
|
+
'The Dev-Mode runs without the need for Transpilations or Compilations',
|
56
|
+
'Using the latest ECMAScript Features, as soon as the Browser Support is there',
|
57
|
+
'Simple and powerful Debugging',
|
58
|
+
'Reduced Development Costs'
|
59
|
+
]
|
60
|
+
}, {
|
61
|
+
module: ContentBox,
|
62
|
+
header: 'Powerful Component-Library',
|
63
|
+
route : '#/learn/WhyNeo-Quick',
|
64
|
+
|
65
|
+
content: [
|
66
|
+
'Declarative Component-Trees',
|
67
|
+
'High Order Components',
|
68
|
+
'Many out-of-the-box Components, including nested lazy-loaded forms',
|
69
|
+
'Multiple themes, which can get nested'
|
70
|
+
]
|
71
|
+
}, {
|
72
|
+
module: ContentBox,
|
73
|
+
header: 'Elegant State Management',
|
74
|
+
route : '#/learn/WhyNeo-Speed',
|
75
|
+
|
76
|
+
content: [
|
77
|
+
'Multiple communicating State-Providers',
|
78
|
+
'Observable',
|
79
|
+
'Supporting different architectures like MVVM without enforcing them'
|
80
|
+
]
|
81
|
+
}, {
|
82
|
+
module: ContentBox,
|
83
|
+
header: 'Core Features',
|
39
84
|
route : '#/learn/WhyNeo-Speed',
|
40
85
|
|
41
86
|
content: [
|
42
|
-
'
|
43
|
-
'
|
44
|
-
'
|
87
|
+
'RPC Layer (cross-realm, including Backends)',
|
88
|
+
'Extensibility',
|
89
|
+
'Scalability',
|
90
|
+
'Class Config System',
|
91
|
+
'Drag & Drop',
|
92
|
+
'Mixins, Plugins & Main-Thread Addons'
|
45
93
|
]
|
46
94
|
}]
|
47
95
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "neo.mjs",
|
3
|
-
"version": "6.
|
3
|
+
"version": "6.20.0",
|
4
4
|
"description": "The webworkers driven UI framework",
|
5
5
|
"type": "module",
|
6
6
|
"repository": {
|
@@ -52,7 +52,7 @@
|
|
52
52
|
"envinfo": "^7.13.0",
|
53
53
|
"fs-extra": "^11.2.0",
|
54
54
|
"highlightjs-line-numbers.js": "^2.8.0",
|
55
|
-
"inquirer": "^10.1.
|
55
|
+
"inquirer": "^10.1.2",
|
56
56
|
"marked": "^13.0.2",
|
57
57
|
"monaco-editor": "^0.50.0",
|
58
58
|
"neo-jsdoc": "1.0.1",
|
@@ -2,7 +2,6 @@
|
|
2
2
|
border : 1px solid darkgray;
|
3
3
|
cursor : pointer;
|
4
4
|
color : #000;
|
5
|
-
height : 200px;
|
6
5
|
margin-top : 2em;
|
7
6
|
padding : 0 1em 1em 1em;
|
8
7
|
text-decoration: none;
|
@@ -23,4 +22,8 @@
|
|
23
22
|
.portal-content-box-header {
|
24
23
|
|
25
24
|
}
|
25
|
+
|
26
|
+
@media (max-width: 600px) {
|
27
|
+
margin-right: 0;
|
28
|
+
}
|
26
29
|
}
|
package/src/DefaultConfig.mjs
CHANGED
@@ -260,12 +260,12 @@ const DefaultConfig = {
|
|
260
260
|
useVdomWorker: true,
|
261
261
|
/**
|
262
262
|
* buildScripts/injectPackageVersion.mjs will update this value
|
263
|
-
* @default '6.
|
263
|
+
* @default '6.20.0'
|
264
264
|
* @memberOf! module:Neo
|
265
265
|
* @name config.version
|
266
266
|
* @type String
|
267
267
|
*/
|
268
|
-
version: '6.
|
268
|
+
version: '6.20.0'
|
269
269
|
};
|
270
270
|
|
271
271
|
Object.assign(DefaultConfig, {
|
package/src/component/Helix.mjs
CHANGED
@@ -258,9 +258,10 @@ class Helix extends Component {
|
|
258
258
|
me[lockWheel] = true;
|
259
259
|
|
260
260
|
me.addDomListeners({
|
261
|
-
click: me.onClick,
|
262
|
-
|
263
|
-
|
261
|
+
click : me.onClick,
|
262
|
+
touchmove: me.onTouchMove,
|
263
|
+
wheel : me.onMouseWheel,
|
264
|
+
scope : me
|
264
265
|
})
|
265
266
|
}
|
266
267
|
|
@@ -840,6 +841,13 @@ class Helix extends Component {
|
|
840
841
|
}
|
841
842
|
}
|
842
843
|
|
844
|
+
/**
|
845
|
+
* @param {Object} data
|
846
|
+
*/
|
847
|
+
onTouchMove(data) {
|
848
|
+
this.onMouseWheel(data)
|
849
|
+
}
|
850
|
+
|
843
851
|
/**
|
844
852
|
* @param {String[]} value
|
845
853
|
* @param {String[]} oldValue
|
package/src/list/Base.mjs
CHANGED
package/src/main/DomEvents.mjs
CHANGED
@@ -19,14 +19,20 @@ class TouchDomEvents extends Base {
|
|
19
19
|
* @param {Object} event
|
20
20
|
*/
|
21
21
|
onTouchCancel(event) {
|
22
|
-
this
|
22
|
+
let me = this;
|
23
|
+
|
24
|
+
me.sendMessageToApp(me.getEventData(event));
|
25
|
+
me.lastTouch = null
|
23
26
|
}
|
24
27
|
|
25
28
|
/**
|
26
29
|
* @param {Object} event
|
27
30
|
*/
|
28
31
|
onTouchEnd(event) {
|
29
|
-
this
|
32
|
+
let me = this;
|
33
|
+
|
34
|
+
me.sendMessageToApp(me.getEventData(event));
|
35
|
+
me.lastTouch = null
|
30
36
|
}
|
31
37
|
|
32
38
|
/**
|
@@ -47,14 +53,31 @@ class TouchDomEvents extends Base {
|
|
47
53
|
* @param {Object} event
|
48
54
|
*/
|
49
55
|
onTouchMove(event) {
|
50
|
-
this
|
56
|
+
let me = this,
|
57
|
+
data = me.getEventData(event),
|
58
|
+
touch = event.touches[0],
|
59
|
+
{lastTouch} = me;
|
60
|
+
|
61
|
+
if (lastTouch) {
|
62
|
+
Object.assign(data, {
|
63
|
+
deltaX: touch.clientX - lastTouch.clientX,
|
64
|
+
deltaY: touch.clientY - lastTouch.clientY
|
65
|
+
})
|
66
|
+
}
|
67
|
+
|
68
|
+
me.sendMessageToApp(data);
|
69
|
+
me.lastTouch = touch
|
51
70
|
}
|
52
71
|
|
53
72
|
/**
|
54
73
|
* @param {Object} event
|
55
74
|
*/
|
56
75
|
onTouchStart(event) {
|
57
|
-
this
|
76
|
+
let me = this;
|
77
|
+
|
78
|
+
me.lastTouch = event.touches[0];
|
79
|
+
|
80
|
+
me.sendMessageToApp(me.getEventData(event))
|
58
81
|
}
|
59
82
|
}
|
60
83
|
|
package/src/manager/DomEvent.mjs
CHANGED
package/src/tree/List.mjs
CHANGED
@@ -3,6 +3,7 @@ import ClassSystemUtil from '../util/ClassSystem.mjs';
|
|
3
3
|
import Collection from '../collection/Base.mjs';
|
4
4
|
import NeoArray from '../util/Array.mjs';
|
5
5
|
import TreeModel from '../selection/TreeModel.mjs';
|
6
|
+
import VDomUtil from "../util/VDom.mjs";
|
6
7
|
|
7
8
|
/**
|
8
9
|
* @class Neo.tree.List
|
@@ -172,6 +173,53 @@ class Tree extends Base {
|
|
172
173
|
}
|
173
174
|
}
|
174
175
|
|
176
|
+
/**
|
177
|
+
*
|
178
|
+
* @param {Object} record
|
179
|
+
* @returns {Object}
|
180
|
+
*/
|
181
|
+
createItem(record) {
|
182
|
+
let me = this,
|
183
|
+
{folderCls, itemCls} = me,
|
184
|
+
cls = [itemCls],
|
185
|
+
itemVdom;
|
186
|
+
|
187
|
+
if (record.isLeaf) {
|
188
|
+
cls.push(itemCls + (record.singleton ? '-leaf-singleton' : '-leaf'))
|
189
|
+
} else {
|
190
|
+
cls.push(folderCls);
|
191
|
+
|
192
|
+
if (!record.collapsed) {
|
193
|
+
cls.push('neo-folder-open')
|
194
|
+
}
|
195
|
+
}
|
196
|
+
|
197
|
+
itemVdom = {
|
198
|
+
tag: 'li',
|
199
|
+
cls,
|
200
|
+
id : me.getItemId(record.id),
|
201
|
+
cn : [{
|
202
|
+
tag : 'span',
|
203
|
+
cls : [itemCls + '-content', record.iconCls],
|
204
|
+
innerHTML: record.name,
|
205
|
+
style : {pointerEvents: 'none'}
|
206
|
+
}],
|
207
|
+
style: {
|
208
|
+
display : record.hidden ? 'none' : 'flex',
|
209
|
+
padding : '10px',
|
210
|
+
position: record.isLeaf ? null : 'sticky',
|
211
|
+
top : record.isLeaf ? null : (record.level * 38) + 'px',
|
212
|
+
zIndex : record.isLeaf ? null : (20 / (record.level + 1))
|
213
|
+
}
|
214
|
+
};
|
215
|
+
|
216
|
+
if (me.itemsFocusable) {
|
217
|
+
itemVdom.tabIndex = -1
|
218
|
+
}
|
219
|
+
|
220
|
+
return itemVdom
|
221
|
+
}
|
222
|
+
|
175
223
|
/**
|
176
224
|
* @param {String} [parentId] The parent node
|
177
225
|
* @param {Object} [vdomRoot] The vdom template root for the current sub tree
|
@@ -181,10 +229,9 @@ class Tree extends Base {
|
|
181
229
|
* @protected
|
182
230
|
*/
|
183
231
|
createItems(parentId, vdomRoot, level, hidden=false) {
|
184
|
-
let me
|
185
|
-
items
|
186
|
-
|
187
|
-
cls, itemVdom, tmpRoot;
|
232
|
+
let me = this,
|
233
|
+
items = me.store.find('parentId', parentId),
|
234
|
+
tmpRoot;
|
188
235
|
|
189
236
|
if (items.length > 0) {
|
190
237
|
if (!vdomRoot.cn) {
|
@@ -207,45 +254,12 @@ class Tree extends Base {
|
|
207
254
|
tmpRoot = vdomRoot
|
208
255
|
}
|
209
256
|
|
210
|
-
items.forEach(
|
211
|
-
|
212
|
-
|
213
|
-
if (item.isLeaf) {
|
214
|
-
cls.push(itemCls + (item.singleton ? '-leaf-singleton' : '-leaf'))
|
215
|
-
} else {
|
216
|
-
cls.push(folderCls);
|
217
|
-
|
218
|
-
if (!item.collapsed) {
|
219
|
-
cls.push('neo-folder-open')
|
220
|
-
}
|
221
|
-
}
|
257
|
+
items.forEach(record => {
|
258
|
+
record.level = level;
|
222
259
|
|
223
|
-
|
224
|
-
tag: 'li',
|
225
|
-
cls,
|
226
|
-
id : me.getItemId(item.id),
|
227
|
-
cn : [{
|
228
|
-
tag : 'span',
|
229
|
-
cls : [itemCls + '-content', item.iconCls],
|
230
|
-
innerHTML: item.name,
|
231
|
-
style : {pointerEvents: 'none'}
|
232
|
-
}],
|
233
|
-
style: {
|
234
|
-
display : item.hidden ? 'none' : 'flex',
|
235
|
-
padding : '10px',
|
236
|
-
position: item.isLeaf ? null : 'sticky',
|
237
|
-
top : item.isLeaf ? null : (level * 38) + 'px',
|
238
|
-
zIndex : item.isLeaf ? null : (20 / (level + 1))
|
239
|
-
}
|
240
|
-
};
|
260
|
+
tmpRoot.cn.push(me.createItem(record));
|
241
261
|
|
242
|
-
|
243
|
-
itemVdom.tabIndex = -1
|
244
|
-
}
|
245
|
-
|
246
|
-
tmpRoot.cn.push(itemVdom);
|
247
|
-
|
248
|
-
me.createItems(item.id, tmpRoot, level + 1, item.hidden || hidden)
|
262
|
+
me.createItems(record.id, tmpRoot, level + 1, record.hidden || hidden)
|
249
263
|
})
|
250
264
|
}
|
251
265
|
|
@@ -435,6 +449,23 @@ class Tree extends Base {
|
|
435
449
|
this.expandAll()
|
436
450
|
}
|
437
451
|
}
|
452
|
+
|
453
|
+
/**
|
454
|
+
* @param {Object} data
|
455
|
+
* @param {Object[]} data.fields Each field object contains the keys: name, oldValue, value
|
456
|
+
* @param {Number} data.index
|
457
|
+
* @param {Neo.data.Model} data.model
|
458
|
+
* @param {Object} data.record
|
459
|
+
*/
|
460
|
+
onStoreRecordChange(data) {
|
461
|
+
let me = this,
|
462
|
+
{record} = data,
|
463
|
+
{index, parentNode} = VDomUtil.findVdomChild(me.vdom, me.getItemId(record.id));
|
464
|
+
|
465
|
+
parentNode.cn[index] = me.createItem(record);
|
466
|
+
|
467
|
+
me.update()
|
468
|
+
}
|
438
469
|
}
|
439
470
|
|
440
471
|
Neo.setupClass(Tree);
|