neo.mjs 6.22.0 → 6.23.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/ViewportController.mjs +23 -10
- package/apps/portal/view/about/Container.mjs +8 -0
- package/apps/portal/view/blog/Container.mjs +14 -1
- package/apps/portal/view/home/MainContainer.mjs +6 -1
- package/apps/portal/view/learn/PageContainer.mjs +13 -0
- package/apps/portal/view/services/Component.mjs +13 -0
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/component/video/MainContainer.mjs +6 -7
- package/examples/videoMove/MainContainer.mjs +77 -0
- package/examples/videoMove/app.mjs +6 -0
- package/examples/videoMove/index.html +11 -0
- package/examples/videoMove/neo-config.json +6 -0
- package/package.json +2 -2
- package/resources/images/team/torsten.png +0 -0
- package/src/DefaultConfig.mjs +2 -2
package/apps/ServiceWorker.mjs
CHANGED
@@ -9,7 +9,7 @@ import {getSearchParams} from '../Util.mjs';
|
|
9
9
|
class ViewportController extends Controller {
|
10
10
|
/**
|
11
11
|
* Valid values for mainContentLayout
|
12
|
-
* @member {String[]}
|
12
|
+
* @member {String[]} mainContentLayouts=['card','cube','mixed']
|
13
13
|
* @protected
|
14
14
|
* @static
|
15
15
|
*/
|
@@ -56,6 +56,12 @@ class ViewportController extends Controller {
|
|
56
56
|
* @member {String[]} connectedApps=[]
|
57
57
|
*/
|
58
58
|
connectedApps = []
|
59
|
+
/**
|
60
|
+
* Internal flag to store the amount of main navigation changes
|
61
|
+
* @member {Number} #transitionId=0
|
62
|
+
* @private
|
63
|
+
*/
|
64
|
+
#transitionId = 0
|
59
65
|
|
60
66
|
/**
|
61
67
|
* Triggered after the mainContentLayout config got changed
|
@@ -108,7 +114,7 @@ class ViewportController extends Controller {
|
|
108
114
|
livePreviewId = getSearchParams(searchString).id,
|
109
115
|
livePreview = Neo.getComponent(livePreviewId),
|
110
116
|
sourceContainer = livePreview.getReference('preview'),
|
111
|
-
tabContainer
|
117
|
+
{tabContainer} = livePreview,
|
112
118
|
sourceView = sourceContainer.removeAt(0, false);
|
113
119
|
|
114
120
|
livePreview.previewContainer = mainView;
|
@@ -136,7 +142,7 @@ class ViewportController extends Controller {
|
|
136
142
|
livePreviewId = getSearchParams(searchString).id,
|
137
143
|
livePreview = Neo.getComponent(livePreviewId),
|
138
144
|
sourceContainer = livePreview.getReference('preview'),
|
139
|
-
tabContainer
|
145
|
+
{tabContainer} = livePreview,
|
140
146
|
sourceView = mainView.removeAt(0, false);
|
141
147
|
|
142
148
|
livePreview.previewContainer = null;
|
@@ -235,16 +241,23 @@ class ViewportController extends Controller {
|
|
235
241
|
let me = this,
|
236
242
|
{activeIndex, mainContentLayout} = me,
|
237
243
|
container = me.getReference('main-content'),
|
238
|
-
updateLayout = true
|
244
|
+
updateLayout = true,
|
245
|
+
transitionId;
|
239
246
|
|
240
247
|
if (index !== activeIndex) {
|
248
|
+
me.activeIndex = index;
|
249
|
+
me.#transitionId++;
|
250
|
+
|
251
|
+
transitionId = me.#transitionId;
|
252
|
+
|
241
253
|
// skip the initial layout-switch, since we do not need a transition
|
242
254
|
if (mainContentLayout === 'mixed' && Neo.isNumber(activeIndex)) {
|
243
255
|
updateLayout = false;
|
244
256
|
|
245
|
-
|
246
|
-
|
247
|
-
|
257
|
+
// enable "fast clicking" on main nav items => do not replace a cube layout with a new instance of cube
|
258
|
+
if (container.layout.ntype !== 'layout-cube') {
|
259
|
+
container.layout = {ntype: 'cube', activeIndex, fitContainer: true, hideInactiveCardsOnDestroy: true}
|
260
|
+
}
|
248
261
|
|
249
262
|
await me.timeout(200);
|
250
263
|
|
@@ -252,14 +265,14 @@ class ViewportController extends Controller {
|
|
252
265
|
|
253
266
|
await me.timeout(1100);
|
254
267
|
|
255
|
-
|
268
|
+
if (transitionId === me.#transitionId) {
|
269
|
+
container.layout = {ntype: 'card', activeIndex: index}
|
270
|
+
}
|
256
271
|
}
|
257
272
|
|
258
273
|
if (updateLayout) {
|
259
274
|
container.layout.activeIndex = index
|
260
275
|
}
|
261
|
-
|
262
|
-
me.activeIndex = index
|
263
276
|
}
|
264
277
|
}
|
265
278
|
}
|
@@ -31,6 +31,14 @@ class Container extends Base {
|
|
31
31
|
profileLinkedIn: 'https://www.linkedin.com/in/tobiasuhlig/',
|
32
32
|
profileX : 'https://x.com/UhligTobias',
|
33
33
|
teamRole : 'Co-Founder & Core Team Member'
|
34
|
+
}, {
|
35
|
+
module : MemberContainer,
|
36
|
+
location : 'Germany',
|
37
|
+
name : 'Torsten Dinkheller',
|
38
|
+
picture : 'torsten.png',
|
39
|
+
profileGitHub : 'https://github.com/Dinkh',
|
40
|
+
profileLinkedIn: 'https://www.linkedin.com/in/dinkheller/',
|
41
|
+
teamRole : 'Co-Founder & Core Team Member'
|
34
42
|
}],
|
35
43
|
/**
|
36
44
|
* @member {Object} layout={ntype:'vbox',align:'start'}
|
@@ -36,7 +36,20 @@ class Container extends BaseContainer {
|
|
36
36
|
}, {
|
37
37
|
module : List,
|
38
38
|
flex : 1,
|
39
|
-
reference: 'blog-list'
|
39
|
+
reference: 'blog-list',
|
40
|
+
/**
|
41
|
+
* @member {Object[]} domListeners
|
42
|
+
*/
|
43
|
+
domListeners: [{
|
44
|
+
scroll(event) {
|
45
|
+
const isHomeContainer = event.target.cls.includes('portal-blog-list'),
|
46
|
+
beyondEighty = event.scrollTop > 80;
|
47
|
+
|
48
|
+
if (isHomeContainer) {
|
49
|
+
this.toggleCls('hide-sidebar', beyondEighty);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}]
|
40
53
|
}],
|
41
54
|
/**
|
42
55
|
* @member {Object} layout={ntype:'vbox',align:'stretch'}
|
@@ -32,7 +32,12 @@ class MainContainer extends Container {
|
|
32
32
|
Neo.getComponent(data.targetId)?.activate?.()
|
33
33
|
},
|
34
34
|
scroll(event) {
|
35
|
-
|
35
|
+
const isHomeContainer = event.target.cls.includes('portal-home-maincontainer'),
|
36
|
+
beyondEighty = event.scrollTop > 80;
|
37
|
+
|
38
|
+
if (isHomeContainer) {
|
39
|
+
this.toggleCls('hide-sidebar', beyondEighty);
|
40
|
+
}
|
36
41
|
}
|
37
42
|
}],
|
38
43
|
/**
|
@@ -25,6 +25,19 @@ class PageContainer extends Container {
|
|
25
25
|
nextPageRecord : data => data.nextPageRecord,
|
26
26
|
previousPageRecord: data => data.previousPageRecord
|
27
27
|
},
|
28
|
+
/**
|
29
|
+
* @member {Object[]} domListeners
|
30
|
+
*/
|
31
|
+
domListeners: [{
|
32
|
+
scroll(event) {
|
33
|
+
const isHomeContainer = event.target.cls.includes('portal-learn-page-container'),
|
34
|
+
beyondEighty = event.scrollTop > 80;
|
35
|
+
|
36
|
+
if (isHomeContainer) {
|
37
|
+
this.toggleCls('hide-sidebar', beyondEighty);
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}],
|
28
41
|
/**
|
29
42
|
* @member {Object[]} items
|
30
43
|
*/
|
@@ -15,6 +15,19 @@ class Component extends BaseComponent {
|
|
15
15
|
* @member {String[]} cls=['portal-services-component']
|
16
16
|
*/
|
17
17
|
cls: ['portal-services-component'],
|
18
|
+
/**
|
19
|
+
* @member {Object[]} domListeners
|
20
|
+
*/
|
21
|
+
domListeners: [{
|
22
|
+
scroll(event) {
|
23
|
+
const isHomeContainer = event.target.cls.includes('portal-services-component'),
|
24
|
+
beyondEighty = event.scrollTop > 80;
|
25
|
+
|
26
|
+
if (isHomeContainer) {
|
27
|
+
this.toggleCls('hide-sidebar', beyondEighty);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}],
|
18
31
|
/**
|
19
32
|
* @member {Object} vdom
|
20
33
|
*/
|
@@ -1,16 +1,15 @@
|
|
1
|
-
import Viewport from '../../../src/container/Viewport.mjs';
|
2
|
-
import Video from '../../../src/component/Video.mjs';
|
3
|
-
import Panel from '../../../src/container/Panel.mjs';
|
4
1
|
import MainContainerController from "./MainContainerController.mjs";
|
2
|
+
import Panel from '../../../src/container/Panel.mjs';
|
3
|
+
import Video from '../../../src/component/Video.mjs';
|
4
|
+
import Viewport from '../../../src/container/Viewport.mjs';
|
5
5
|
|
6
6
|
/**
|
7
|
-
* @class Neo.examples.component.
|
7
|
+
* @class Neo.examples.component.video.MainContainer
|
8
8
|
* @extends Neo.examples.Viewport
|
9
9
|
*/
|
10
10
|
class MainContainer extends Viewport {
|
11
11
|
static config = {
|
12
|
-
className: 'Neo.examples.component.timer.MainContainer',
|
13
|
-
|
12
|
+
className : 'Neo.examples.component.timer.MainContainer',
|
14
13
|
controller: MainContainerController,
|
15
14
|
|
16
15
|
items : [{
|
@@ -35,7 +34,7 @@ class MainContainer extends Viewport {
|
|
35
34
|
module : Video,
|
36
35
|
url : 'https://video-ssl.itunes.apple.com/itunes-assets/Video125/v4/a0/57/54/a0575426-dd8e-2d25-bdf3-139702870b50/mzvf_786190431362224858.640x464.h264lc.U.p.m4v',
|
37
36
|
flag : 'video-component',
|
38
|
-
minHeight: 400
|
37
|
+
minHeight: 400
|
39
38
|
}]
|
40
39
|
}]
|
41
40
|
}
|
@@ -0,0 +1,77 @@
|
|
1
|
+
import Button from '../../src/button/Base.mjs';
|
2
|
+
import Video from '../../src/component/Video.mjs';
|
3
|
+
import Viewport from '../../src/container/Viewport.mjs';
|
4
|
+
|
5
|
+
/**
|
6
|
+
* @class Neo.examples.videoMove.MainContainer
|
7
|
+
* @extends Neo.container.Viewport
|
8
|
+
*/
|
9
|
+
class MainContainer extends Viewport {
|
10
|
+
static config = {
|
11
|
+
className: 'Neo.examples.videoMove.MainContainer',
|
12
|
+
layout : {ntype: 'vbox', align: 'stretch'},
|
13
|
+
style : {padding: '50px'},
|
14
|
+
|
15
|
+
items: [{
|
16
|
+
ntype : 'container',
|
17
|
+
layout: {ntype: 'hbox', align: 'stretch'},
|
18
|
+
|
19
|
+
itemDefaults: {
|
20
|
+
ntype : 'container',
|
21
|
+
layout: 'fit'
|
22
|
+
},
|
23
|
+
|
24
|
+
items: [{
|
25
|
+
reference: 'container-1',
|
26
|
+
style : {backgroundColor: 'rgb(139,166,255)', padding: '50px'},
|
27
|
+
|
28
|
+
items: [{
|
29
|
+
module : Video,
|
30
|
+
playing: true,
|
31
|
+
url : 'https://video-ssl.itunes.apple.com/itunes-assets/Video125/v4/a0/57/54/a0575426-dd8e-2d25-bdf3-139702870b50/mzvf_786190431362224858.640x464.h264lc.U.p.m4v'
|
32
|
+
}]
|
33
|
+
}, {
|
34
|
+
reference: 'container-2',
|
35
|
+
style : {backgroundColor: 'rgb(139,166,255)', marginLeft: '50px', padding: '50px'}
|
36
|
+
}]
|
37
|
+
}, {
|
38
|
+
ntype : 'container',
|
39
|
+
layout: {ntype: 'vbox', align: 'start'},
|
40
|
+
style : {marginTop: '50px'},
|
41
|
+
|
42
|
+
items: [{
|
43
|
+
module : Button,
|
44
|
+
handler: 'up.onMoveVideoButtonClick',
|
45
|
+
text : 'Move Video'
|
46
|
+
}]
|
47
|
+
}]
|
48
|
+
}
|
49
|
+
|
50
|
+
/**
|
51
|
+
*
|
52
|
+
* @param {Object} data
|
53
|
+
*/
|
54
|
+
onMoveVideoButtonClick(data) {
|
55
|
+
let me = this,
|
56
|
+
container1 = me.getReference('container-1'),
|
57
|
+
container2 = me.getReference('container-2');
|
58
|
+
|
59
|
+
container1.silentVdomUpdate = true;
|
60
|
+
container2.silentVdomUpdate = true;
|
61
|
+
|
62
|
+
if (container2.items.length < 1) {
|
63
|
+
container2.add(container1.removeAt(0, false))
|
64
|
+
} else {
|
65
|
+
container1.add(container2.removeAt(0, false))
|
66
|
+
}
|
67
|
+
|
68
|
+
me.promiseUpdate().then(() => {
|
69
|
+
container1.silentVdomUpdate = false;
|
70
|
+
container2.silentVdomUpdate = false
|
71
|
+
})
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
Neo.setupClass(MainContainer);
|
76
|
+
|
77
|
+
export default MainContainer;
|
@@ -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.mjs -Moving a Video Tag</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.23.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.5",
|
56
56
|
"marked": "^13.0.3",
|
57
57
|
"monaco-editor": "^0.50.0",
|
58
58
|
"neo-jsdoc": "1.0.1",
|
Binary file
|
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.23.0'
|
264
264
|
* @memberOf! module:Neo
|
265
265
|
* @name config.version
|
266
266
|
* @type String
|
267
267
|
*/
|
268
|
-
version: '6.
|
268
|
+
version: '6.23.0'
|
269
269
|
};
|
270
270
|
|
271
271
|
Object.assign(DefaultConfig, {
|