neo.mjs 6.18.3 → 6.19.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.
Files changed (81) hide show
  1. package/README.md +28 -214
  2. package/apps/ServiceWorker.mjs +2 -2
  3. package/apps/colors/view/ViewportController.mjs +7 -3
  4. package/apps/portal/data/blog.json +13 -0
  5. package/apps/portal/view/HeaderToolbar.mjs +2 -2
  6. package/apps/portal/view/Viewport.mjs +4 -2
  7. package/apps/portal/view/ViewportController.mjs +89 -8
  8. package/apps/portal/view/blog/Container.mjs +8 -8
  9. package/apps/portal/view/blog/List.mjs +6 -6
  10. package/apps/portal/view/home/MainContainer.mjs +3 -2
  11. package/apps/portal/view/home/parts/Colors.mjs +2 -2
  12. package/apps/portal/view/home/parts/How.mjs +3 -3
  13. package/apps/portal/view/home/parts/MainNeo.mjs +6 -7
  14. package/apps/portal/view/home/parts/References.mjs +88 -0
  15. package/apps/portal/view/learn/MainContainer.mjs +3 -2
  16. package/apps/portal/view/learn/MainContainerController.mjs +11 -0
  17. package/apps/portal/view/learn/PageContainer.mjs +5 -3
  18. package/apps/portal/view/services/Component.mjs +73 -0
  19. package/apps/website/data/blog.json +13 -0
  20. package/examples/ServiceWorker.mjs +2 -2
  21. package/examples/component/carousel/MainContainer.mjs +42 -33
  22. package/examples/layout/cube/MainContainer.mjs +217 -0
  23. package/examples/layout/cube/app.mjs +6 -0
  24. package/examples/layout/cube/index.html +11 -0
  25. package/examples/layout/cube/neo-config.json +6 -0
  26. package/package.json +6 -6
  27. package/resources/data/deck/learnneo/pages/Earthquakes-01-goals.md +32 -0
  28. package/resources/data/deck/learnneo/pages/Earthquakes-Lab-01-generate-a-workspace.md +47 -0
  29. package/resources/data/deck/learnneo/pages/Earthquakes-Lab-02-generate-the-starter-app.md +150 -0
  30. package/resources/data/deck/learnneo/pages/Earthquakes-Lab-03-debugging.md +136 -0
  31. package/resources/data/deck/learnneo/pages/Earthquakes-Lab-04-fetch-data.md +146 -0
  32. package/resources/data/deck/learnneo/pages/Earthquakes-Lab-05-refactor-the-table.md +146 -0
  33. package/resources/data/deck/learnneo/pages/Earthquakes-Lab-06-use-a-view-model.md +301 -0
  34. package/resources/data/deck/learnneo/pages/Earthquakes-Lab-07-use-the-google-maps-addon.md +175 -0
  35. package/resources/data/deck/learnneo/pages/Earthquakes-Lab-08-events.md +38 -0
  36. package/resources/data/deck/learnneo/pages/Earthquakes.md +8 -8
  37. package/resources/data/deck/learnneo/pages/Glossary.md +0 -0
  38. package/resources/data/deck/learnneo/pages/GuideEvents.md +80 -1
  39. package/resources/data/deck/learnneo/tree.json +2 -1
  40. package/resources/images/apps/portal/neo-references.png +0 -0
  41. package/resources/scss/src/apps/portal/Viewport.scss +18 -0
  42. package/resources/scss/src/apps/portal/blog/Container.scss +7 -7
  43. package/resources/scss/src/apps/portal/blog/List.scss +20 -16
  44. package/resources/scss/src/apps/portal/home/parts/MainNeo.scss +4 -5
  45. package/resources/scss/src/apps/portal/home/parts/References.scss +46 -0
  46. package/resources/scss/src/apps/portal/learn/ContentTreeList.scss +20 -0
  47. package/resources/scss/src/apps/portal/learn/ContentView.scss +4 -0
  48. package/resources/scss/src/apps/portal/learn/MainContainer.scss +1 -1
  49. package/resources/scss/src/apps/portal/learn/PageContainer.scss +22 -16
  50. package/resources/scss/src/apps/portal/services/Component.scss +20 -0
  51. package/resources/scss/src/component/Carousel.scss +21 -0
  52. package/resources/scss/src/examples/layout/cube/MainContainer.scss +7 -0
  53. package/resources/scss/src/layout/Cube.scss +80 -0
  54. package/resources/scss/src/tab/Container.scss +10 -10
  55. package/resources/scss/theme-neo-light/apps/portal/blog/Container.scss +3 -0
  56. package/resources/scss/theme-neo-light/form/field/Search.scss +1 -1
  57. package/resources/scss/theme-neo-light/tooltip/Base.scss +1 -1
  58. package/src/DefaultConfig.mjs +2 -2
  59. package/src/Main.mjs +15 -1
  60. package/src/Neo.mjs +14 -3
  61. package/src/component/Base.mjs +18 -1
  62. package/src/container/Base.mjs +3 -1
  63. package/src/dialog/Base.mjs +1 -2
  64. package/src/layout/Base.mjs +43 -6
  65. package/src/layout/Card.mjs +21 -59
  66. package/src/layout/Cube.mjs +428 -0
  67. package/src/layout/Fit.mjs +9 -38
  68. package/src/layout/Flexbox.mjs +16 -17
  69. package/src/layout/Form.mjs +13 -70
  70. package/src/layout/Grid.mjs +6 -18
  71. package/src/main/mixin/DeltaUpdates.mjs +16 -3
  72. package/src/util/Array.mjs +36 -0
  73. package/src/vdom/Helper.mjs +328 -445
  74. package/src/vdom/VNode.mjs +12 -1
  75. package/test/siesta/siesta.js +16 -1
  76. package/test/siesta/tests/VdomCalendar.mjs +2111 -37
  77. package/test/siesta/tests/VdomHelper.mjs +283 -47
  78. package/test/siesta/tests/vdom/Advanced.mjs +367 -0
  79. package/test/siesta/tests/vdom/layout/Cube.mjs +189 -0
  80. package/test/siesta/tests/vdom/table/Container.mjs +133 -0
  81. package/resources/scss/theme-neo-light/apps/portal/learn/ContentTreeList.scss +0 -23
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <p align="center">
2
- <img height="250" width="250" src="https://raw.githubusercontent.com/neomjs/pages/main/resources/images/logo_rounded.svg">
2
+ <img height="100"src="https://raw.githubusercontent.com/neomjs/pages/main/resources/images/logo/neo_logo_text_primary.svg">
3
3
  </p>
4
-
4
+ </br>
5
5
  <p align="center">
6
6
  <a href="https://npmcharts.com/compare/neo.mjs?minimal=true"><img src="https://img.shields.io/npm/dm/neo.mjs.svg?label=Downloads" alt="Downloads"></a>
7
7
  <a href="https://www.npmjs.com/package/neo.mjs"><img src="https://img.shields.io/npm/v/neo.mjs.svg?logo=npm" alt="Version"></a>
@@ -11,234 +11,48 @@
11
11
  <a href="./CONTRIBUTING.md"><img src="https://img.shields.io/badge/PRs-welcome-green.svg?logo=GitHub&logoColor=white" alt="PRs Welcome"></a>
12
12
  </p>
13
13
 
14
- # Welcome to neo.mjs!
15
- neo.mjs enables you to create scalable & high performant Apps using more than just one CPU core.
16
- No need to take care of a workers setup, and the cross channel communication on your own.
17
-
18
- <p align="center">
19
- <a href="https://youtu.be/pYfM28Pz6_0"><img height="316px" width="400px" src="https://raw.githubusercontent.com/neomjs/pages/main/resources/images/neo33s.png"></a>
20
- <a href="https://youtu.be/aEA5333WiWY"><img height="316px" width="400px" src="https://raw.githubusercontent.com/neomjs/pages/main/resources/images/neo-movie.png"></a>
21
- </p>
22
-
23
- <a href="https://tobiasuhlig.medium.com/predictive-offline-support-for-assets-you-have-not-used-yet-aeeccccd3754?source=friends_link&sk=e946e0f25f508e6a8cec4136400291a3">Version 4 release announcement</a>
24
-
25
- ## Content
26
- 1. <a href="#slack-channel">Slack Channel for questions & feedback</a>
27
- 2. <a href="#architectures">Scalable frontend architectures</a>
28
- 3. <a href="#sw-covid19-app">Multi Window COVID19 IN NUMBERS Demo App</a>
29
- 4. <a href="#covid19-app">COVID19 IN NUMBERS Demo App</a>
30
- 5. <a href="#what-if-">What if ...</a> (Short overview of the concept & design goals)
31
- 6. <a href="#learn-more">Want to learn more?</a>
32
- 7. <a href="#online-examples">Online Examples</a>
33
- 8. <a href="#online-docs">Online Docs</a>
34
- 9. <a href="#command-line-interface">Command-Line Interface</a>
35
- 10. <a href="#get-started">Ready to get started?</a>
36
- 11. <a href="#story--vision">Story & Vision</a>
37
- 12. <a href="#contributors">neo.mjs is in need of more contributors!</a>
38
- 13. <a href="#sponsors">neo.mjs is in need of more sponsors!</a>
39
-
40
- </br></br>
41
- <h2 id="slack-channel">1. Slack Channel for questions, ideas & feedback</h2>
42
- Join our community:</br>
43
- <a href="https://join.slack.com/t/neomjs/shared_invite/zt-6c50ueeu-3E1~M4T9xkNnb~M_prEEOA"><img src="https://img.shields.io/badge/Slack-neo.mjs-brightgreen.svg?logo=slack&style=for-the-badge" alt="Join the Slack channel"></a>
44
-
45
- </br></br>
46
- <h2 id="architectures">2. Scalable frontend architectures</h2>
47
- <img src="https://raw.githubusercontent.com/neomjs/pages/main/resources/images/apps-today.png">
48
-
49
- Most frontends today still look like this. Everything happens inside the main thread (browser window), leading to a poor rendering performance.
50
- The business logic happens inside main as well, which can slow down DOM updates and animations.
51
- The worst case would be a complete UI freeze.
52
-
53
- To solve this performance problem, it is not enough to just move expensive tasks into a worker.
54
- Instead, an application worker needs to be the main actor.
55
- neo.mjs offers two different setups which follow the exact same API.
56
- You can switch between <a href="https://developer.mozilla.org/en-US/docs/Web/API/Worker">dedicated</a> and
57
- <a href="https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker">shared</a> workers at any point.
58
-
59
- <img src="https://raw.githubusercontent.com/neomjs/pages/main/resources/images/workers-setup-v4.png">
60
-
61
- The dedicated workers setup uses 3-6 threads (CPUs).
62
- Most parts of the frameworks as well as your apps and components live within the app worker.
63
- Main threads are as small and idle as possible (42KB) plus optional main thread addons.
64
-
65
- <img src="https://raw.githubusercontent.com/neomjs/pages/main/resources/images/shared-workers-setup.png">
66
-
67
- In case you want to e.g. create a web based IDE or a multi window banking / trading app,
68
- the shared worker setup using 5+ threads (CPUs) is the perfect solution.
69
-
70
- All main threads share the same data, resulting in less API calls.
71
- You can move entire component trees across windows, while even keeping the same JS instances.
72
- Cross window state management, cross window drag&drop and cross window delta CSS updates are available.
73
-
74
- </br></br>
75
- <h2 id="sw-covid19-app">3. Multi Browser Window COVID19 IN NUMBERS Demo App</h2>
76
- The most compelling way to introduce a new framework might simply be to show what you can do with it.</br>
77
- </br>
78
- Blog post: <a href="https://medium.com/swlh/expanding-single-page-apps-into-multiple-browser-windows-e6d9bd155d59?source=friends_link&sk=bbfe1dada95c5674669e463f93360822">Expanding Single Page Apps into multiple Browser Windows</a></br>
79
- </br>
80
- <a href="https://neomjs.github.io/pages/node_modules/neo.mjs/apps/sharedcovid/index.html#mainview=table">Live Demo: COIN App (Multi Window)</a></br>
81
- Chrome (v83+), Edge, Firefox (Safari does not support SharedWorkers yet).</br>
82
- Desktop only.</br></br>
83
-
84
- <a href="https://youtu.be/n7m7ZT1kXQk"><img src="https://raw.githubusercontent.com/neomjs/pages/main/resources/images/expanding_spa_vid.png"></a></br>
14
+ # Harness the Power of Multi-Threading for Ultra-Fast Frontends
85
15
 
86
- <img src="https://raw.githubusercontent.com/neomjs/pages/main/resources/images/covidDashboard/sw_covid.png">
16
+ Neo.mjs is **not** intended for rather simple & static websites.
87
17
 
88
- You can find the code of the multi window covid app <a href="https://github.com/neomjs/neo/tree/dev/apps/sharedcovid">here</a>.
18
+ The Framework does not focus primarily on a fast first rendering experience for new users,
19
+ but instead on a super-fast update & navigation experience for returning users.
89
20
 
90
- </br></br>
91
- <h2 id="covid19-app">4. COVID19 IN NUMBERS Demo App</h2>
92
- <a href="https://neomjs.github.io/pages/node_modules/neo.mjs/dist/production/apps/covid/index.html#mainview=table">Live Demo: COIN App dist/production</a></br>
93
- Desktop only => support for mobile devices is on the roadmap.</br></br>
21
+ Neo.mjs drives the OMT (off the main thread) paradigm into perfection,
22
+ which is intended to move expensive tasks into Workers.
94
23
 
95
- <a href="https://www.youtube.com/watch?v=8lqNVaoGNdU"><img src="https://raw.githubusercontent.com/neomjs/pages/main/resources/images/covid_app_vid.png"></a></br>
24
+ > So, what are the most expensive tasks we are dealing with?
25
+
26
+ The answer is simple: a Framework and the Apps which we build with it.
96
27
 
97
- <img src="https://raw.githubusercontent.com/neomjs/pages/main/resources/images/covidDashboard/v3/table.png">
28
+ Neo.mjs moves most parts of the framework and your App(s) including their Components
29
+ into an Application Worker.
98
30
 
99
- You can find the code of the covid app <a href="https://github.com/neomjs/neo/tree/dev/apps/covid">here</a>.
31
+ This enables us to re-use existing Component instances and mount & unmount them
32
+ several times. Even into different Browser-Windows.
100
33
 
101
- </br></br>
102
- <h2 id="what-if-">5. Short overview of the concept & design goals</h2>
103
-
104
- <table>
105
- <tr>
106
- <th></th>
107
- <th>What if ...</th>
108
- <th>Benefit</th>
109
- </tr>
110
- <tr>
111
- <td>1.</td>
112
- <td>... a framework & all the apps you build are running inside a separate thread (web worker)?</td>
113
- <td>You get extreme Performance</td>
114
- </tr>
115
- <tr>
116
- <td>2.</td>
117
- <td>... the main thread would be mostly idle, only applying the real dom manipulations,
118
- so there are no background tasks slowing it down?</td>
119
- <td>You get extreme UI responsiveness</td>
120
- </tr>
121
- <tr>
122
- <td>3.</td>
123
- <td>... a framework was fully built on top of ES8, but can run inside multiple workers without any Javascript builds?</td>
124
- <td>Your development speed will increase</td>
125
- </tr>
126
- <tr>
127
- <td>4.</td>
128
- <td>... you don’t need source-maps to debug your code, since you do get the real code 1:1?</td>
129
- <td>You get a smoother Debugging Experience</td>
130
- </tr>
131
- <tr>
132
- <td>5.</td>
133
- <td>... you don’t have to use string based pseudo XML templates ever again?</td>
134
- <td>You get unreached simplicity, no more scoping nightmares</td>
135
- </tr>
136
- <tr>
137
- <td>6.</td>
138
- <td>... you don’t have to use any sort of templates at all, ever again?</td>
139
- <td>You gain full control!</td>
140
- </tr>
141
- <tr>
142
- <td>7.</td>
143
- <td>... you can use persistent JSON structures instead?</td>
144
- <td>You gain more simplicity</td>
145
- </tr>
146
- <tr>
147
- <td>8.</td>
148
- <td>... there is a custom virtual dom engine in place, which is so fast,
149
- that it will change your mind about the performance of web based user interfaces?</td>
150
- <td>You get extreme performance</td>
151
- </tr>
152
- <tr>
153
- <td>9.</td>
154
- <td>... the ES8 class system gets enhanced with a custom config system,
155
- making it easier to extend and work with config driven design patterns?</td>
156
- <td>Extensibility, a robust base for solid UI architectures</td>
157
- </tr>
158
- <tr>
159
- <td>10.</td>
160
- <td>... your user interfaces can truly scale?</td>
161
- <td>You get extreme Performance</td>
162
- </tr>
163
- </table>
34
+ Neo.mjs also provides sharing state across multiple Browser-Windows.
164
35
 
165
- </br></br>
166
- <h2 id="learn-more">6. Want to learn more?</h2>
167
-
168
- <a href=".github/CONCEPT.md">neo.mjs Concepts</a>
36
+ So far, it is the only Framework which enables us to build complex multi-Window Apps
37
+ without the need for a native shell.
169
38
 
170
- </br></br>
171
- <h2 id="online-examples">7. Online Examples</h2>
172
-
173
- You can find a full list of (desktop based) online examples here:</br>
174
- <a href="https://neomjs.github.io/pages/">Online Examples</a>
175
-
176
- You can pick between the 3 modes (development, dist/development, dist/production) for each one.
177
-
178
- </br></br>
179
- <h2 id="online-docs">8. Online Docs</h2>
180
-
181
- The Online Docs are also included inside the Online Examples.
182
-
183
- dist/production does not support lazy loading the examples yet, but works in every browser:</br>
184
- <a href="https://neomjs.github.io/pages/node_modules/neo.mjs/dist/production/docs/index.html">Online Docs (dist/production)</a>
185
-
186
- The development mode only works in Chrome and Safari Technology Preview, but does lazy load the example apps:</br>
187
- <a href="https://neomjs.github.io/pages/node_modules/neo.mjs/docs/index.html">Online Docs (dev mode)</a>
188
-
189
- **Hint**: As soon as you create your own apps, you want to use the docs app locally,</br>
190
- since this will include documentation views for your own apps.
191
-
192
- </br></br>
193
- <h2 id="command-line-interface">9. Command-Line Interface</h2>
194
- You can run several build programs inside your terminal.</br>
195
- Please take a look at the <a href="./buildScripts/README.md">Command-Line Interface Guide</a>.
196
-
197
- </br></br>
198
- <h2 id="get-started">10. Ready to get started?</h2>
199
-
200
- There are 3 different ways on how you can get the basics running locally.</br>
201
- Please take a look at the <a href=".github/GETTING_STARTED.md">Getting Started Guide</a>.
202
-
203
- Here is an in depth tutorial on how to build your first neo.mjs app:</br>
204
- https://itnext.io/define-a-web-4-0-app-to-be-multi-threaded-9c495c0d0ef9?source=friends_link&sk=4d143ace05f0e9bbe82babd9433cc822
205
- </br></br>
206
- <h2 id="story--vision">11. Story & Vision</h2>
207
-
208
- Although neo.mjs is ready to craft beautiful & blazing fast UIs,</br>
209
- the current state is just a fraction of a bigger picture.
210
-
211
- Take a look at the <a href=".github/STORY.md">Project Story</a> and <a href=".github/VISION.md">Vision</a>.
212
-
213
- </br></br>
214
- <h2 id="contributors">12. neo.mjs is in need for more contributors!</h2>
215
-
216
- Another way to fasten up the neo.mjs development speed is to actively jump in.</br>
217
- As the shiny "PRs welcome" badge suggests: open source is intended to be improved by anyone who is up for the challenge.
218
-
219
- You can also write a guide in case you learned something new while using neo.mjs or just help to get more eyes on this project.
39
+ <img src="https://raw.githubusercontent.com/neomjs/pages/main/resources/images/workers-setup-v4.png">
220
40
 
221
- Either way, here are more infos: <a href="./CONTRIBUTING.md">Contributing</a>
41
+ Potential Use-Cases:
42
+ 1. Finance (Banking & Trading Apps)
43
+ 2. Data Science
44
+ 3. Web-based IDEs
45
+ 4. Multi-Window Data Visualisation
222
46
 
223
47
  </br></br>
224
- <h2 id="sponsors">13. neo.mjs is in need for sponsors!</h2>
225
-
226
- neo.mjs is an MIT-licensed open source project with an ongoing development.</br>
227
- So far the development was made possible with burning my (tobiu's) personal savings.</br>
228
-
229
- This is obviously not sustainable. To enable me keep pushing like this, please support it.</br>
230
- The benefit of doing so is getting results delivered faster.
231
48
 
232
- <a href="https://github.com/sponsors/tobiu">Sponsor tobiu</a>
49
+ [Spoiler] We are in the middle of wrapping up the new Framework Website,
50
+ which will include the first version of a self-study based Learning Section.
233
51
 
234
- More infos: <a href="./BACKERS.md">Sponsors & Backers</a>
52
+ We are aiming to release it on August 1st, 2024.
235
53
 
54
+ The current development state is already inside the dev branch.
236
55
 
237
- </br></br>
238
- Logo contributed by <a href="https://www.linkedin.com/in/torsten-dinkheller-614516231/">Torsten Dinkheller</a>.
239
-
240
- </br></br>
241
- Build with :heart: in Germany.
242
56
 
243
57
  </br></br>
244
58
  Copyright (c) 2015 - today, <a href="https://www.linkedin.com/in/tobiasuhlig/">Tobias Uhlig</a>
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='6.18.3'
23
+ * @member {String} version='6.19.0'
24
24
  */
25
- version: '6.18.3'
25
+ version: '6.19.0'
26
26
  }
27
27
 
28
28
  /**
@@ -1,10 +1,10 @@
1
- import Component from '../../../src/controller/Component.mjs';
1
+ import Controller from '../../../src/controller/Component.mjs';
2
2
 
3
3
  /**
4
4
  * @class Colors.view.ViewportController
5
5
  * @extends Neo.controller.Component
6
6
  */
7
- class ViewportController extends Component {
7
+ class ViewportController extends Controller {
8
8
  static config = {
9
9
  /**
10
10
  * @member {String} className='Colors.view.ViewportController'
@@ -248,7 +248,11 @@ class ViewportController extends Component {
248
248
  if (store.getCount()) {
249
249
  table.bulkUpdateRecords(records)
250
250
  } else {
251
- store.data = records
251
+ // Depending on the delay of the Socket Connection,
252
+ // the next data package could still contain the old settings
253
+ if (this.getModel().getData('amountRows') === records.length) {
254
+ store.data = records
255
+ }
252
256
  }
253
257
  }
254
258
 
@@ -1,4 +1,17 @@
1
1
  [
2
+ {
3
+ "author" : "Tobias Uhlig",
4
+ "authorImage" : "author_TobiasUhlig.jpeg",
5
+ "date" : "Jul 12, 2024",
6
+ "id" : 59,
7
+ "image" : "transform_dom_tree.png",
8
+ "name" : "A blazing-fast algorithm to transform one DOM tree into another",
9
+ "provider" : "Medium",
10
+ "publisher" : "ITNEXT",
11
+ "selectedInto": [],
12
+ "type" : "Blog Post",
13
+ "url" : "https://itnext.io/a-blazing-fast-algorithm-to-transform-one-dom-tree-into-another-4ff9c934bc49?source=friends_link&sk=f1de46dbd464095b8d0b0a271644cb75"
14
+ },
2
15
  {
3
16
  "author" : "Tobias Uhlig",
4
17
  "authorImage" : "author_TobiasUhlig.jpeg",
@@ -39,8 +39,8 @@ class HeaderToolbar extends Base {
39
39
  reference: 'blog-header-button',
40
40
  route : '/blog'
41
41
  }, {
42
- text : 'Docs',
43
- route: '/docs'
42
+ text : 'Services',
43
+ route: '/services'
44
44
  }, {
45
45
  ntype : 'container',
46
46
  layout: 'hbox',
@@ -40,14 +40,16 @@ class Viewport extends BaseViewport {
40
40
  flex : 'none'
41
41
  }, {
42
42
  module : Container,
43
- layout : {ntype: 'card', activeIndex: null},
44
43
  reference: 'main-content',
45
44
 
45
+ // The layout will get assigned inside ViewportController
46
+
46
47
  items: [
47
48
  {module: () => import('./home/MainContainer.mjs')},
48
49
  {module: () => import('./learn/MainContainer.mjs')},
49
50
  {module: () => import('./blog/Container.mjs')},
50
- {module: () => import('../../../docs/app/view/MainContainer.mjs')}
51
+ {module: () => import('../../../docs/app/view/MainContainer.mjs')},
52
+ {module: () => import('./services/Component.mjs')}
51
53
  ]
52
54
  }],
53
55
  /**
@@ -1,4 +1,5 @@
1
1
  import Controller from '../../../src/controller/Component.mjs';
2
+ import CubeLayout from '../../../src/layout/Cube.mjs';
2
3
  import {getSearchParams} from '../Util.mjs';
3
4
 
4
5
  /**
@@ -6,6 +7,14 @@ import {getSearchParams} from '../Util.mjs';
6
7
  * @extends Neo.controller.Component
7
8
  */
8
9
  class ViewportController extends Controller {
10
+ /**
11
+ * Valid values for mainContentLayout
12
+ * @member {String[]} iconPositions=['top','right','bottom','left']
13
+ * @protected
14
+ * @static
15
+ */
16
+ static mainContentLayouts = ['card', 'cube', 'mixed']
17
+
9
18
  static config = {
10
19
  /**
11
20
  * @member {String} className='Portal.view.ViewportController'
@@ -17,10 +26,18 @@ class ViewportController extends Controller {
17
26
  * @protected
18
27
  */
19
28
  ntype: 'viewport-controller',
29
+ /**
30
+ * @member {Number|null} activeIndex=null
31
+ */
32
+ activeIndex: null,
20
33
  /**
21
34
  * @member {String|null} defaultHash='/home'
22
35
  */
23
36
  defaultHash: '/home',
37
+ /**
38
+ * @member {String} mainContentLayout_='cube'
39
+ */
40
+ mainContentLayout_: 'mixed',
24
41
  /**
25
42
  * @member {Object} routes
26
43
  */
@@ -29,7 +46,8 @@ class ViewportController extends Controller {
29
46
  '/docs' : 'onDocsRoute',
30
47
  '/home' : 'onHomeRoute',
31
48
  '/learn' : 'onLearnRoute',
32
- '/learn/{itemId}': 'onLearnRoute'
49
+ '/learn/{itemId}': 'onLearnRoute',
50
+ '/services' : 'onServicesRoute',
33
51
  }
34
52
  }
35
53
 
@@ -38,6 +56,33 @@ class ViewportController extends Controller {
38
56
  */
39
57
  connectedApps = []
40
58
 
59
+ /**
60
+ * Triggered after the mainContentLayout config got changed
61
+ * @param {String} value
62
+ * @param {String} oldValue
63
+ * @protected
64
+ */
65
+ afterSetMainContentLayout(value, oldValue) {
66
+ let {activeIndex} = this,
67
+ container = this.component.getItem('main-content'); // happens before instantiation
68
+
69
+ if (value === 'cube') {
70
+ container.layout = {ntype: 'cube', activeIndex, fitContainer: true, hideInactiveCardsOnDestroy: true}
71
+ } else {
72
+ container.layout = {ntype: 'card', activeIndex}
73
+ }
74
+ }
75
+
76
+ /**
77
+ * Triggered before the mainContentLayout config gets changed
78
+ * @param {String} value
79
+ * @param {String} oldValue
80
+ * @protected
81
+ */
82
+ beforeSetMainContentLayout(value, oldValue) {
83
+ return this.beforeSetEnumValue(value, oldValue, 'mainContentLayout')
84
+ }
85
+
41
86
  /**
42
87
  * @param {Object} data
43
88
  * @param {String} data.appName
@@ -71,8 +116,7 @@ class ViewportController extends Controller {
71
116
  * @param {Number} data.windowId
72
117
  */
73
118
  async onAppDisconnect(data) {
74
- let me = this,
75
- {appName, windowId} = data,
119
+ let {appName, windowId} = data,
76
120
  app = Neo.apps[appName],
77
121
  mainView = app.mainView;
78
122
 
@@ -96,7 +140,7 @@ class ViewportController extends Controller {
96
140
  }
97
141
  // Close popup windows when closing or reloading the main window
98
142
  else if (appName === 'Portal') {
99
- Neo.Main.windowClose({names: me.connectedApps, windowId})
143
+ Neo.Main.windowCloseAll({windowId})
100
144
  }
101
145
  }
102
146
 
@@ -144,7 +188,7 @@ class ViewportController extends Controller {
144
188
  * @param {Object} oldValue
145
189
  */
146
190
  onDocsRoute(params, value, oldValue) {
147
- this.setMainContentIndex(3)
191
+ this.setMainContentIndex(4)
148
192
  }
149
193
 
150
194
  /**
@@ -166,10 +210,47 @@ class ViewportController extends Controller {
166
210
  }
167
211
 
168
212
  /**
169
- * @param {Number} value
213
+ * @param {Object} params
214
+ * @param {Object} value
215
+ * @param {Object} oldValue
170
216
  */
171
- setMainContentIndex(value) {
172
- this.getReference('main-content').layout.activeIndex = value
217
+ onServicesRoute(params, value, oldValue) {
218
+ this.setMainContentIndex(4)
219
+ }
220
+
221
+ /**
222
+ * @param {Number} index
223
+ */
224
+ async setMainContentIndex(index) {
225
+ let me = this,
226
+ {activeIndex, mainContentLayout} = me,
227
+ container = me.getReference('main-content'),
228
+ updateLayout = true;
229
+
230
+ if (index !== activeIndex) {
231
+ // skip the initial layout-switch, since we do not need a transition
232
+ if (mainContentLayout === 'mixed' && Neo.isNumber(activeIndex)) {
233
+ updateLayout = false;
234
+
235
+ container.wrapperStyle; // todo: without accessing the getter, the flex value can get lost.
236
+
237
+ container.layout = {ntype: 'cube', activeIndex, fitContainer: true, hideInactiveCardsOnDestroy: true};
238
+
239
+ await me.timeout(200);
240
+
241
+ container.layout.activeIndex = index;
242
+
243
+ await me.timeout(1100);
244
+
245
+ container.layout = {ntype: 'card', activeIndex: index}
246
+ }
247
+
248
+ if (updateLayout) {
249
+ container.layout.activeIndex = index
250
+ }
251
+
252
+ me.activeIndex = index
253
+ }
173
254
  }
174
255
  }
175
256
 
@@ -14,23 +14,23 @@ class Container extends BaseContainer {
14
14
  */
15
15
  className: 'Portal.view.blog.Container',
16
16
  /**
17
- * @member {String[]} baseCls=['website-blog-container','neo-container']
17
+ * @member {String[]} cls=['portal-blog-container']
18
18
  */
19
- baseCls: ['website-blog-container', 'neo-container'],
19
+ cls: ['portal-blog-container'],
20
20
  /**
21
- * @member {Array} items
21
+ * @member {Object[]} items
22
22
  */
23
- items: [{ //#323232
23
+ items: [{
24
24
  module: BaseContainer,
25
- cls : ['website-blog-toolbar', 'neo-container'],
25
+ cls : ['portal-blog-toolbar'],
26
26
  flex : 'none',
27
27
  layout: {ntype: 'hbox', align: 'stretch'},
28
28
 
29
29
  items: [{
30
30
  module : SearchField,
31
- cls : ['website-blog-searchfield', 'neo-searchfield', 'neo-textfield'],
31
+ cls : ['portal-blog-searchfield'],
32
32
  listeners : {change: 'onBlogSearchFieldChange'},
33
- placeholderText: 'Filter Items',
33
+ placeholderText: 'Filter Blog Items',
34
34
  width : 240
35
35
  }]
36
36
  }, {
@@ -39,7 +39,7 @@ class Container extends BaseContainer {
39
39
  reference: 'blog-list'
40
40
  }],
41
41
  /**
42
- * @member {Object} layout={ntype: 'vbox', align: 'stretch'}
42
+ * @member {Object} layout={ntype:'vbox',align:'stretch'}
43
43
  */
44
44
  layout: {ntype: 'vbox', align: 'stretch'}
45
45
  }
@@ -22,9 +22,9 @@ class List extends BaseList {
22
22
  */
23
23
  className: 'Portal.view.blog.List',
24
24
  /**
25
- * @member {String[]} baseCls=['website-blog-list','neo-list']
25
+ * @member {String[]} baseCls=['portal-blog-list','neo-list']
26
26
  */
27
- baseCls: ['website-blog-list', 'neo-list'],
27
+ baseCls: ['portal-blog-list', 'neo-list'],
28
28
  /**
29
29
  * @member {Neo.data.Store} store=BlogPosts
30
30
  */
@@ -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,10 +65,10 @@ 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 = [
@@ -99,7 +99,7 @@ class List extends BaseList {
99
99
  VDomUtil.getByFlag(vdomCn[0], 'author').cn.push(
100
100
  {vtype: 'text', html : ' in '},
101
101
  {tag: 'span', cls: ['neo-bold'], html: record.publisher}
102
- );
102
+ )
103
103
  }
104
104
 
105
105
  if (record.selectedInto.length > 0) {
@@ -1,10 +1,10 @@
1
1
  import AfterMath from './parts/AfterMath.mjs';
2
2
  import Colors from './parts/Colors.mjs';
3
3
  import Container from '../../../../src/container/Base.mjs';
4
- import Features from './parts/Features.mjs';
5
4
  import Helix from './parts/Helix.mjs';
6
5
  import How from './parts/How.mjs';
7
6
  import MainNeo from './parts/MainNeo.mjs';
7
+ // import References from './parts/References.mjs';
8
8
 
9
9
  /**
10
10
  * @class Portal.view.home.MainContainer
@@ -38,7 +38,8 @@ class MainContainer extends Container {
38
38
  items: [
39
39
  {ntype: 'component', cls: ['portal-home-progress']},
40
40
  MainNeo,
41
- Features,
41
+ // References,
42
+ // Features,
42
43
  Helix,
43
44
  Colors,
44
45
  How,
@@ -28,12 +28,12 @@ class Colors extends BaseContainer {
28
28
  style : {padding: '2rem'},
29
29
  layout: {ntype: 'vbox', align: 'center', pack: 'center'},
30
30
  items : [{
31
- cls : 'neo-h1',
31
+ cls : ['neo-h1'],
32
32
  flex: 'none',
33
33
  html: 'Amazing Potential',
34
34
  vdom: {tag: 'h1'}
35
35
  }, {
36
- cls : 'neo-h2',
36
+ cls : ['neo-h2'],
37
37
  flex: 'none',
38
38
  html: 'Socket Data',
39
39
  vdom: {tag: 'h2'}