neo.mjs 7.0.1 → 7.0.3
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/README.md +28 -6
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/portal/Overwrites.mjs +0 -10
- package/apps/portal/index.html +1 -1
- package/apps/portal/view/home/FeatureSection.mjs +3 -1
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/apps/portal/view/home/parts/Colors.mjs +2 -2
- package/buildScripts/README.md +25 -81
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/component/coronaGallery/CountryGallery.mjs +15 -6
- package/examples/component/coronaGallery/Viewport.mjs +317 -0
- package/examples/component/coronaGallery/ViewportController.mjs +88 -0
- package/examples/component/coronaGallery/app.mjs +2 -2
- package/examples/component/multiWindowCoronaGallery/Viewport.mjs +47 -0
- package/examples/component/multiWindowCoronaGallery/ViewportController.mjs +128 -0
- package/examples/component/multiWindowCoronaGallery/app.mjs +6 -0
- package/examples/component/multiWindowCoronaGallery/childapp/Viewport.mjs +21 -0
- package/examples/component/multiWindowCoronaGallery/childapp/app.mjs +6 -0
- package/examples/component/multiWindowCoronaGallery/childapp/index.html +11 -0
- package/examples/component/multiWindowCoronaGallery/childapp/neo-config.json +9 -0
- package/examples/component/multiWindowCoronaGallery/index.html +11 -0
- package/examples/component/multiWindowCoronaGallery/neo-config.json +8 -0
- package/examples/table/container/MainContainer.mjs +1 -0
- package/examples/table/container/MainStore.mjs +2 -1
- package/package.json +4 -4
- package/resources/scss/src/apps/portal/home/parts/Helix.scss +4 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/Neo.mjs +0 -7
- package/src/button/Base.mjs +20 -2
- package/src/button/Split.mjs +16 -0
- package/src/collection/Base.mjs +2 -2
- package/src/component/Base.mjs +10 -5
- package/src/component/Video.mjs +8 -29
- package/src/container/Base.mjs +4 -3
- package/src/dialog/Base.mjs +34 -8
- package/src/draggable/DragZone.mjs +10 -8
- package/src/form/field/Text.mjs +2 -0
- package/src/form/field/trigger/Time.mjs +14 -0
- package/src/layout/Base.mjs +8 -8
- package/src/list/Component.mjs +14 -0
- package/src/plugin/PrefixField.mjs +1 -1
- package/src/plugin/Resizable.mjs +19 -5
- package/src/table/header/Button.mjs +2 -0
- package/src/toolbar/Base.mjs +15 -0
- package/src/worker/App.mjs +3 -5
- package/examples/component/coronaGallery/MainContainer.mjs +0 -377
package/README.md
CHANGED
@@ -11,12 +11,15 @@
|
|
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
|
-
#
|
14
|
+
# Modern Enterprise-Ready JavaScript Framework
|
15
15
|
|
16
16
|
## Content
|
17
17
|
1. <a href="#introduction">Introduction</a>
|
18
18
|
2. <a href="#slack-channel">Slack Channel for questions & feedback</a>
|
19
19
|
3. <a href="#architectures">Scalable frontend architectures</a>
|
20
|
+
4. <a href="#getting-started">Getting Started</a>
|
21
|
+
5. <a href="#cli">Command-Line Interface</a>
|
22
|
+
6. <a href="#blog">Blog</a>
|
20
23
|
|
21
24
|
</br></br>
|
22
25
|
<h2 id="introduction">1. Introduction</h2>
|
@@ -56,17 +59,36 @@ Potential Use-Cases:
|
|
56
59
|
Join our community:</br>
|
57
60
|
<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>
|
58
61
|
|
62
|
+
</br></br>
|
63
|
+
<h2 id="getting-started">4. Getting Started</h2>
|
64
|
+
Take a look at the <a href="./.github/GETTING_STARTED.md">Getting Started Guide</a>
|
65
|
+
</br></br>
|
66
|
+
There are 2 options:
|
59
67
|
|
68
|
+
1. In case you want to create a Neo.mjs App (workspace), use
|
69
|
+
> npx neo-app@latest
|
70
|
+
|
71
|
+
2. In case you want to work on the Framework and your App in parallel, you can fork this repository and use
|
72
|
+
> npm run create-app
|
73
|
+
|
74
|
+
inside of it.
|
60
75
|
|
61
|
-
</br></br>
|
62
76
|
|
63
|
-
|
64
|
-
|
77
|
+
* You can easily move your app from the framework to a workspace or vice versa.
|
78
|
+
* The CLI inside the framework and inside a workspace works the same.
|
65
79
|
|
66
|
-
|
80
|
+
Make sure to take a look into the <a href="https://neomjs.com/dist/production/apps/portal/#/learn/Setup">Learning Section</a>
|
67
81
|
|
68
|
-
The
|
82
|
+
The most advanced tutorial to help you with getting up to speed is this one:</br>
|
83
|
+
<a href="https://neomjs.com/dist/production/apps/portal/#/learn/Earthquakes">Earthquakes Tutorial</a>
|
69
84
|
|
85
|
+
</br></br>
|
86
|
+
<h2 id="cli">5. Command-Line Interface</h2>
|
87
|
+
You can find an in-depth description here: <a href="./buildScripts/README.md">Neo.mjs CLI</a>
|
88
|
+
|
89
|
+
</br></br>
|
90
|
+
<h2 id="blog">6. Blog</h2>
|
91
|
+
All Blog Posts are listed here: <a href="https://neomjs.com/dist/production/apps/portal/#/blog">Neo.mjs Blog</a>
|
70
92
|
|
71
93
|
</br></br>
|
72
94
|
Copyright (c) 2015 - today, <a href="https://www.linkedin.com/in/tobiasuhlig/">Tobias Uhlig</a>
|
package/apps/ServiceWorker.mjs
CHANGED
package/apps/portal/index.html
CHANGED
@@ -37,6 +37,7 @@ class FeatureSection extends Container {
|
|
37
37
|
*/
|
38
38
|
headline_: null,
|
39
39
|
/**
|
40
|
+
* Can either contain a route or a URL
|
40
41
|
* @member {String|null} learnMoreRoute_=null
|
41
42
|
*/
|
42
43
|
learnMoreRoute_: null,
|
@@ -136,7 +137,8 @@ class FeatureSection extends Container {
|
|
136
137
|
* @protected
|
137
138
|
*/
|
138
139
|
afterSetLearnMoreRoute(value, oldValue) {
|
139
|
-
|
140
|
+
let targetConfig = value.startsWith('http') ? 'url' : 'route';
|
141
|
+
this.getItem('learn-more-button')[targetConfig] = value
|
140
142
|
}
|
141
143
|
|
142
144
|
/**
|
@@ -20,9 +20,9 @@ class Colors extends FeatureSection {
|
|
20
20
|
*/
|
21
21
|
headline: 'Amazing Potential',
|
22
22
|
/**
|
23
|
-
* @member {String} learnMoreRoute='
|
23
|
+
* @member {String} learnMoreRoute='https://itnext.io/sharing-real-time-websocket-data-across-multiple-browser-windows-4e0538dd7563?source=friends_link&sk=9efb3e4f38c82fb3e04899c61bb5fcb8'
|
24
24
|
*/
|
25
|
-
learnMoreRoute: '
|
25
|
+
learnMoreRoute: 'https://itnext.io/sharing-real-time-websocket-data-across-multiple-browser-windows-4e0538dd7563?source=friends_link&sk=9efb3e4f38c82fb3e04899c61bb5fcb8',
|
26
26
|
/**
|
27
27
|
* @member {String} livePreviewCode
|
28
28
|
*/
|
package/buildScripts/README.md
CHANGED
@@ -11,8 +11,8 @@ You can run each script inside your terminal. E.g.:
|
|
11
11
|
|
12
12
|
Make sure to call them on the top-level folder (the one containing the package.json).
|
13
13
|
|
14
|
-
In case you want to pass program options,
|
15
|
-
>
|
14
|
+
In case you want to pass program options, use -- before adding options. E.g.:
|
15
|
+
> npm run build-all -- -h
|
16
16
|
|
17
17
|
All programs which are using options also have the visual inquirer interface in place.</br>
|
18
18
|
So it is up to you if you prefer adding the options manually (e.g. for adding them into your own CI),</br>
|
@@ -25,15 +25,14 @@ where the framework is included as a node module, but needs to deploy to a top-l
|
|
25
25
|
## Content
|
26
26
|
1. <a href="#build-all">build-all</a>
|
27
27
|
2. <a href="#build-all-questions">build-all-questions</a>
|
28
|
-
3. <a href="#build-
|
29
|
-
4. <a href="#build-
|
30
|
-
5. <a href="#
|
31
|
-
6. <a href="#
|
32
|
-
7. <a href="#
|
33
|
-
8. <a href="#server-start">server-start</a>
|
28
|
+
3. <a href="#build-themes">build-themes</a>
|
29
|
+
4. <a href="#build-threads">build-threads</a>
|
30
|
+
5. <a href="#create-app">create-app</a>
|
31
|
+
6. <a href="#generate-docs-json">generate-docs-json</a>
|
32
|
+
7. <a href="#server-start">server-start</a>
|
34
33
|
|
35
34
|
## build-all
|
36
|
-
>
|
35
|
+
> npm run build-all
|
37
36
|
|
38
37
|
It is strongly recommended to run this program after each git pull on this repo.
|
39
38
|
|
@@ -70,7 +69,7 @@ or dist/production.
|
|
70
69
|
Source code: <a href="./buildAll.js">build-all</a>
|
71
70
|
|
72
71
|
## build-all-questions
|
73
|
-
>
|
72
|
+
> npm run build-all-questions
|
74
73
|
|
75
74
|
This entry point is running the build-all program without passing options,
|
76
75
|
so we can select them using the inquirer interface.
|
@@ -130,64 +129,8 @@ neo.mjs buildAll
|
|
130
129
|
|
131
130
|
Source code: <a href="./buildAll.js">build-all</a>
|
132
131
|
|
133
|
-
## build-my-apps
|
134
|
-
> node ./buildScripts/webpack/buildMyApps.js -f
|
135
|
-
|
136
|
-
```bash
|
137
|
-
Options:
|
138
|
-
-V, --version output the version number
|
139
|
-
-i, --info print environment debug info
|
140
|
-
-a, --apps <value> "all", "Covid", "RealWorld", "RealWorld2", "SharedCovid", "SharedCovidChart", "SharedCovidGallery",
|
141
|
-
"SharedCovidHelix", "SharedCovidMap", "SharedDialog", "SharedDialog2", "Website"
|
142
|
-
-e, --env <value> "all", "dev", "prod"
|
143
|
-
-f, --framework
|
144
|
-
-n, --noquestions
|
145
|
-
-h, --help display help for command
|
146
|
-
```
|
147
|
-
|
148
|
-
build-my-apps is very similar to build-threads => App.
|
149
|
-
|
150
|
-
In both cases we are parsing <a href="../src/worker/App.mjs">worker/App</a>,
|
151
|
-
which will dynamically import all Apps inside the src/app folder and the Docs App and create split chunks
|
152
|
-
for all combinations. This enables you to add multiple Apps on one Page with close to zero overhead
|
153
|
-
in dist/development & dist/production.
|
154
|
-
|
155
|
-
The only difference to build-threads => App is that you can limit the generation of the App related index.html files,
|
156
|
-
so it is a little faster.
|
157
|
-
|
158
|
-
Let us take a look at the different inquirer steps:
|
159
|
-
1. Pick the -e (env) option:
|
160
|
-
```bash
|
161
|
-
neo % npm run build-my-apps
|
162
|
-
|
163
|
-
> neo.mjs@1.4.14 build-my-apps /Users/Shared/github/neomjs/neo
|
164
|
-
> node ./buildScripts/webpack/buildMyApps.js -f
|
165
|
-
|
166
|
-
neo.mjs buildMyApps
|
167
|
-
? Please choose the environment: (Use arrow keys)
|
168
|
-
❯ all
|
169
|
-
dev
|
170
|
-
prod
|
171
|
-
```
|
172
|
-
2. Pick the -a (apps) option:
|
173
|
-
```bash
|
174
|
-
neo.mjs buildMyApps
|
175
|
-
? Please choose the environment: all
|
176
|
-
? Please choose which apps you want to build: (Press <space> to select, <a> to toggle all, <i> to invert selection)
|
177
|
-
❯◯ Covid
|
178
|
-
◯ RealWorld
|
179
|
-
◯ RealWorld2
|
180
|
-
◯ SharedCovid
|
181
|
-
◯ SharedCovidChart
|
182
|
-
◯ SharedCovidGallery
|
183
|
-
◯ SharedCovidHelix
|
184
|
-
(Move up and down to reveal more choices)
|
185
|
-
```
|
186
|
-
|
187
|
-
Source code: <a href="./webpack/buildMyApps.js">build-my-apps</a>
|
188
|
-
|
189
132
|
## build-themes
|
190
|
-
>
|
133
|
+
> npm run build-themes
|
191
134
|
|
192
135
|
```bash
|
193
136
|
Options:
|
@@ -238,7 +181,7 @@ neo.mjs buildThemes
|
|
238
181
|
Source code: <a href="./webpack/buildThemes.js">build-themes</a>
|
239
182
|
|
240
183
|
## build-threads
|
241
|
-
>
|
184
|
+
> npm run build-threads
|
242
185
|
|
243
186
|
Since the default neo.mjs setup is using 3 workers, we have the following 4 threads to build:</br>
|
244
187
|
"app", "data", "main", "vdom"
|
@@ -286,7 +229,7 @@ neo.mjs buildThreads
|
|
286
229
|
Source code: <a href="./webpack/buildThreads.js">build-threads</a>
|
287
230
|
|
288
231
|
## create-app
|
289
|
-
>
|
232
|
+
> npm run create-app
|
290
233
|
|
291
234
|
Again: In case you want to create an App (workspace) based on neo.mjs, you don't need to clone this repository.</br>
|
292
235
|
Please take a look at the <a href="https://github.com/neomjs/create-app">create-app repository</a> (npx neo-app).
|
@@ -294,14 +237,14 @@ Please take a look at the <a href="https://github.com/neomjs/create-app">create-
|
|
294
237
|
If you want to create a new Demo App inside the framework repo,
|
295
238
|
using the create-app program makes sense, since you can work on the app & framework code in parallel.
|
296
239
|
|
297
|
-
Using the default options, this will generate the following
|
240
|
+
Using the default options, this will generate the following 4 files:
|
298
241
|
```
|
299
242
|
neo
|
300
243
|
| - apps
|
301
244
|
| | - myapp
|
302
245
|
| | | - app.mjs
|
303
|
-
| | | - config.json
|
304
246
|
| | | - index.html
|
247
|
+
| | | - neo-config.json
|
305
248
|
| | | - MainContainer.mjs
|
306
249
|
```
|
307
250
|
|
@@ -377,14 +320,15 @@ neo.mjs create-app
|
|
377
320
|
No worries, you can easily change the options after you created your App shell.
|
378
321
|
|
379
322
|
E.g. in case you want to add the MapboxGL main thread addon later on,
|
380
|
-
you can add it inside your
|
381
|
-
```
|
382
|
-
|
383
|
-
appPath :
|
384
|
-
basePath :
|
385
|
-
environment :
|
386
|
-
|
387
|
-
|
323
|
+
you can add it inside your neo-config.json file:
|
324
|
+
```json
|
325
|
+
{
|
326
|
+
"appPath" : "apps/myapp/app.mjs",
|
327
|
+
"basePath" : "../../",
|
328
|
+
"environment" : "development",
|
329
|
+
"mainPath" : "./Main.mjs",
|
330
|
+
"mainThreadAddons": ["DragDrop", "MapboxGL", "Navigator", "Stylesheet"]
|
331
|
+
}
|
388
332
|
```
|
389
333
|
|
390
334
|
Regarding the -u (SharedWorkers) option:</br>
|
@@ -399,7 +343,7 @@ Using SharedWorkers, you need to open a separate Window to inspect them:</br>
|
|
399
343
|
Source code: <a href="./buildScripts/createApp.js">create-app</a>
|
400
344
|
|
401
345
|
## generate-docs-json
|
402
|
-
>
|
346
|
+
> npm run generate-docs-json
|
403
347
|
|
404
348
|
neo.mjs is using jsdoc
|
405
349
|
> https://github.com/jsdoc/jsdoc
|
@@ -414,7 +358,7 @@ There are several enhancements around it to polish it for our class system impro
|
|
414
358
|
Source code: <a href="./docs/jsdocx.js">generate-docs-json</a>
|
415
359
|
|
416
360
|
## server-start
|
417
|
-
>
|
361
|
+
> npm run server-start
|
418
362
|
|
419
363
|
To open JS modules locally inside your Browser you need a web-server, since importing files is not possible
|
420
364
|
otherwise for security reasons. You could enable this on an OS level, but this is definitely not recommended.
|
@@ -60,6 +60,7 @@ class CountryGallery extends Gallery {
|
|
60
60
|
createItem(vdomItem, record, index) {
|
61
61
|
let me = this,
|
62
62
|
cls = ['neo-gallery-item', 'image-wrap', 'view', 'neo-transition-1000'],
|
63
|
+
fn = CountryGallery.formatNumber,
|
63
64
|
style = {height: (me.itemHeight - 70) + 'px', width: me.itemWidth + 'px'};
|
64
65
|
|
65
66
|
return {cls, id: me.getItemVnodeId(record[me.keyProperty]), tabIndex: '-1', cn: [
|
@@ -72,24 +73,24 @@ class CountryGallery extends Gallery {
|
|
72
73
|
{tag: 'table', cls: ['neo-content-table'], cn: [
|
73
74
|
{tag: 'tr', cn: [
|
74
75
|
{tag: 'td', html: 'Cases'},
|
75
|
-
{tag: 'td', cls: ['neo-align-right'], html: record.cases},
|
76
|
+
{tag: 'td', cls: ['neo-align-right'], html: fn(record.cases)},
|
76
77
|
{tag: 'td', style: {width: '100%'}},
|
77
78
|
{tag: 'td', html: 'Cases today'},
|
78
|
-
{tag: 'td', cls: ['neo-align-right'], html: record.todayCases}
|
79
|
+
{tag: 'td', cls: ['neo-align-right'], html: fn(record.todayCases)}
|
79
80
|
]},
|
80
81
|
{tag: 'tr', cn: [
|
81
82
|
{tag: 'td', html: 'Deaths'},
|
82
|
-
{tag: 'td', cls: ['neo-align-right', 'neo-content-deaths'], html: record.deaths},
|
83
|
+
{tag: 'td', cls: ['neo-align-right', 'neo-content-deaths'], html: fn(record.deaths)},
|
83
84
|
{tag: 'td', style: {width: '100%'}},
|
84
85
|
{tag: 'td', html: 'Deaths today'},
|
85
|
-
{tag: 'td', cls: ['neo-align-right', 'neo-content-deaths'], html: record.todayDeaths}
|
86
|
+
{tag: 'td', cls: ['neo-align-right', 'neo-content-deaths'], html: fn(record.todayDeaths)}
|
86
87
|
]},
|
87
88
|
{tag: 'tr', cn: [
|
88
89
|
{tag: 'td', html: 'Recovered'},
|
89
|
-
{tag: 'td', cls: ['neo-align-right', 'neo-content-recovered'], html: record.recovered},
|
90
|
+
{tag: 'td', cls: ['neo-align-right', 'neo-content-recovered'], html: fn(record.recovered)},
|
90
91
|
{tag: 'td', style: {width: '100%'}},
|
91
92
|
{tag: 'td', html: 'Critical'},
|
92
|
-
{tag: 'td', cls: ['neo-align-right', 'neo-content-critical'], html: record.critical}
|
93
|
+
{tag: 'td', cls: ['neo-align-right', 'neo-content-critical'], html: fn(record.critical)}
|
93
94
|
]}
|
94
95
|
]}
|
95
96
|
]}
|
@@ -97,6 +98,14 @@ class CountryGallery extends Gallery {
|
|
97
98
|
]}
|
98
99
|
}
|
99
100
|
|
101
|
+
/**
|
102
|
+
* @param {Number} value
|
103
|
+
* @returns {String}
|
104
|
+
*/
|
105
|
+
static formatNumber(value) {
|
106
|
+
return value.toLocaleString()
|
107
|
+
}
|
108
|
+
|
100
109
|
/**
|
101
110
|
* @param {String} name
|
102
111
|
* @returns {String} url
|