neo.mjs 9.1.0 → 9.3.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/README.md +1 -1
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/portal/index.html +1 -1
- package/apps/portal/view/HeaderToolbar.mjs +6 -6
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/buildScripts/webpack/production/webpack.config.appworker.mjs +11 -1
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/grid/bigData/MainContainer.mjs +5 -5
- package/examples/serverside/toolbarItems/Overwrites.mjs +11 -0
- package/examples/serverside/toolbarItems/Viewport.mjs +40 -0
- package/examples/serverside/toolbarItems/app.mjs +7 -0
- package/examples/serverside/toolbarItems/index.html +11 -0
- package/examples/serverside/toolbarItems/neo-config.json +6 -0
- package/examples/serverside/toolbarItems/resources/data/toolbar-items.json +43 -0
- package/package.json +5 -5
- package/resources/scss/src/examples/serverside/toolbarItems/Viewport.scss +14 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/container/Base.mjs +9 -2
package/README.md
CHANGED
@@ -50,7 +50,7 @@ Key Benefits of Neo.mjs
|
|
50
50
|
- Neo is built on modern web standards like JavaScript modules and worker threads, ensuring compatibility with the latest browser features.
|
51
51
|
- By embracing the OMT paradigm, Neo is uniquely positioned to take advantage of future advancements in web development.
|
52
52
|
|
53
|
-
|
53
|
+
## Real-World Applications
|
54
54
|
|
55
55
|
Neo is ideal for:
|
56
56
|
- **Data-intensive applications**: Handle large datasets and complex calculations without compromising UI responsiveness.
|
package/apps/ServiceWorker.mjs
CHANGED
package/apps/portal/index.html
CHANGED
@@ -59,24 +59,24 @@ class HeaderToolbar extends Base {
|
|
59
59
|
url : 'https://github.com/neomjs/neo',
|
60
60
|
tooltip: {
|
61
61
|
html : 'GitHub',
|
62
|
-
showDelay:
|
63
|
-
hideDelay:
|
62
|
+
showDelay: 0,
|
63
|
+
hideDelay: 0
|
64
64
|
}
|
65
65
|
}, {
|
66
66
|
iconCls: 'fa-brands fa-slack',
|
67
67
|
url : 'https://join.slack.com/t/neomjs/shared_invite/zt-6c50ueeu-3E1~M4T9xkNnb~M_prEEOA',
|
68
68
|
tooltip: {
|
69
69
|
html : 'Join Slack',
|
70
|
-
showDelay:
|
71
|
-
hideDelay:
|
70
|
+
showDelay: 0,
|
71
|
+
hideDelay: 0
|
72
72
|
}
|
73
73
|
}, {
|
74
74
|
iconCls: 'fa-brands fa-discord',
|
75
75
|
url : 'https://discord.gg/6p8paPq',
|
76
76
|
tooltip: {
|
77
77
|
html : 'Join Discord',
|
78
|
-
showDelay:
|
79
|
-
hideDelay:
|
78
|
+
showDelay: 0,
|
79
|
+
hideDelay: 0
|
80
80
|
}
|
81
81
|
}]
|
82
82
|
}]
|
@@ -41,11 +41,21 @@ export default env => {
|
|
41
41
|
const copyResources = resourcesPath => {
|
42
42
|
let inputPath = path.resolve(cwd, resourcesPath),
|
43
43
|
outputPath = path.resolve(cwd, buildTarget.folder, resourcesPath),
|
44
|
-
childProcess;
|
44
|
+
childProcess, content, filePath;
|
45
45
|
|
46
46
|
if (fs.existsSync(inputPath)) {
|
47
47
|
childProcess = spawnSync('node', [`${neoPath}/buildScripts/copyFolder.mjs -s ${inputPath} -t ${outputPath}`], cpOpts);
|
48
48
|
childProcess.status && process.exit(childProcess.status);
|
49
|
+
|
50
|
+
// Minify all json files inside the copied resources folder
|
51
|
+
fs.readdirSync(outputPath, {recursive: true}).forEach(fileOrFolder => {
|
52
|
+
if (fileOrFolder.endsWith('.json')) {
|
53
|
+
filePath = path.join(outputPath, fileOrFolder);
|
54
|
+
content = requireJson(filePath);
|
55
|
+
|
56
|
+
fs.writeFileSync(filePath, JSON.stringify(content));
|
57
|
+
}
|
58
|
+
});
|
49
59
|
}
|
50
60
|
};
|
51
61
|
|
@@ -17,6 +17,10 @@ class MainContainer extends Viewport {
|
|
17
17
|
* @member {String[]} cls=['neo-examples-bigdata-maincontainer']
|
18
18
|
*/
|
19
19
|
cls: ['neo-examples-bigdata-maincontainer'],
|
20
|
+
/**
|
21
|
+
* @member {Object} layout={ntype:'hbox',align:'stretch'}
|
22
|
+
*/
|
23
|
+
layout: {ntype: 'hbox', align: 'stretch'},
|
20
24
|
/**
|
21
25
|
* @member {Object[]} items
|
22
26
|
*/
|
@@ -25,11 +29,7 @@ class MainContainer extends Viewport {
|
|
25
29
|
reference: 'grid'
|
26
30
|
}, {
|
27
31
|
module: ControlsContainer
|
28
|
-
}]
|
29
|
-
/**
|
30
|
-
* @member {Object} layout={ntype:'hbox',align:'stretch'}
|
31
|
-
*/
|
32
|
-
layout: {ntype: 'hbox', align: 'stretch'}
|
32
|
+
}]
|
33
33
|
}
|
34
34
|
|
35
35
|
/**
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import BaseViewport from '../../../src/container/Viewport.mjs';
|
2
|
+
import Button from '../../../src/button/Base.mjs';
|
3
|
+
import Toolbar from '../../../src/toolbar/Base.mjs';
|
4
|
+
|
5
|
+
/**
|
6
|
+
* @class Neo.examples.serverside.toolbarItems.Viewport
|
7
|
+
* @extends Neo.container.Viewport
|
8
|
+
*/
|
9
|
+
class Viewport extends BaseViewport {
|
10
|
+
static config = {
|
11
|
+
className: 'Neo.examples.serverside.toolbarItems.Viewport',
|
12
|
+
cls : ['neo-serverside-toolbaritems-viewport'],
|
13
|
+
layout : 'base',
|
14
|
+
|
15
|
+
items: [{
|
16
|
+
module : Toolbar,
|
17
|
+
reference: 'toolbar'
|
18
|
+
}, {
|
19
|
+
module : Button,
|
20
|
+
handler: 'up.onLoadItemsButtonClick',
|
21
|
+
style : {marginTop: '1em'},
|
22
|
+
text : 'Load Toolbar Items'
|
23
|
+
}]
|
24
|
+
}
|
25
|
+
|
26
|
+
/**
|
27
|
+
* @param {Object} data
|
28
|
+
* @returns {Promise<void>}
|
29
|
+
*/
|
30
|
+
async onLoadItemsButtonClick(data) {
|
31
|
+
data.component.disabled = true;
|
32
|
+
|
33
|
+
let response = await fetch('../../examples/serverside/toolbarItems/resources/data/toolbar-items.json'),
|
34
|
+
remoteData = await response.json();
|
35
|
+
|
36
|
+
this.getReference('toolbar').add(remoteData.items)
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
export default Neo.setupClass(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>Neo.mjs - Load Toolbar Items</title>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<script src="../../../src/MicroLoader.mjs" type="module"></script>
|
10
|
+
</body>
|
11
|
+
</html>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
{
|
2
|
+
"items": [{
|
3
|
+
"minWidth": 60,
|
4
|
+
"route" : "/home",
|
5
|
+
"text" : "Neo.mjs"
|
6
|
+
}, "->", {
|
7
|
+
"text" : "Learn",
|
8
|
+
"route": "/learn"
|
9
|
+
}, {
|
10
|
+
"text" : "Blog",
|
11
|
+
"route": "/blog"
|
12
|
+
}, {
|
13
|
+
"text" : "Examples",
|
14
|
+
"route": "/examples"
|
15
|
+
}, {
|
16
|
+
"text" : "Services",
|
17
|
+
"route": "/services"
|
18
|
+
}, {
|
19
|
+
"iconCls": "fa-brands fa-github",
|
20
|
+
"url" : "https://github.com/neomjs/neo",
|
21
|
+
"tooltip": {
|
22
|
+
"html" : "GitHub",
|
23
|
+
"showDelay": 0,
|
24
|
+
"hideDelay": 0
|
25
|
+
}
|
26
|
+
}, {
|
27
|
+
"iconCls": "fa-brands fa-slack",
|
28
|
+
"url" : "https://join.slack.com/t/neomjs/shared_invite/zt-6c50ueeu-3E1~M4T9xkNnb~M_prEEOA",
|
29
|
+
"tooltip": {
|
30
|
+
"html" : "Join Slack",
|
31
|
+
"showDelay": 0,
|
32
|
+
"hideDelay": 0
|
33
|
+
}
|
34
|
+
}, {
|
35
|
+
"iconCls": "fa-brands fa-discord",
|
36
|
+
"url" : "https://discord.gg/6p8paPq",
|
37
|
+
"tooltip": {
|
38
|
+
"html" : "Join Discord",
|
39
|
+
"showDelay": 0,
|
40
|
+
"hideDelay": 0
|
41
|
+
}
|
42
|
+
}]
|
43
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "neo.mjs",
|
3
|
-
"version": "9.
|
3
|
+
"version": "9.3.0",
|
4
4
|
"description": "The webworkers driven UI framework",
|
5
5
|
"type": "module",
|
6
6
|
"repository": {
|
@@ -51,21 +51,21 @@
|
|
51
51
|
"autoprefixer": "^10.4.21",
|
52
52
|
"chalk": "^5.4.1",
|
53
53
|
"clean-webpack-plugin": "^4.0.0",
|
54
|
-
"commander": "^
|
54
|
+
"commander": "^14.0.0",
|
55
55
|
"cssnano": "^7.0.7",
|
56
56
|
"envinfo": "^7.14.0",
|
57
57
|
"fs-extra": "^11.3.0",
|
58
58
|
"highlightjs-line-numbers.js": "^2.9.0",
|
59
59
|
"inquirer": "^12.6.1",
|
60
|
-
"marked": "^15.0.
|
60
|
+
"marked": "^15.0.12",
|
61
61
|
"monaco-editor": "0.50.0",
|
62
62
|
"neo-jsdoc": "1.0.1",
|
63
63
|
"neo-jsdoc-x": "1.0.5",
|
64
64
|
"postcss": "^8.5.3",
|
65
|
-
"sass": "^1.
|
65
|
+
"sass": "^1.89.0",
|
66
66
|
"siesta-lite": "5.5.2",
|
67
67
|
"url": "^0.11.4",
|
68
|
-
"webpack": "^5.99.
|
68
|
+
"webpack": "^5.99.9",
|
69
69
|
"webpack-cli": "^6.0.1",
|
70
70
|
"webpack-dev-server": "^5.2.1",
|
71
71
|
"webpack-hook-plugin": "^1.0.7",
|
package/src/DefaultConfig.mjs
CHANGED
@@ -263,12 +263,12 @@ const DefaultConfig = {
|
|
263
263
|
useVdomWorker: true,
|
264
264
|
/**
|
265
265
|
* buildScripts/injectPackageVersion.mjs will update this value
|
266
|
-
* @default '9.
|
266
|
+
* @default '9.3.0'
|
267
267
|
* @memberOf! module:Neo
|
268
268
|
* @name config.version
|
269
269
|
* @type String
|
270
270
|
*/
|
271
|
-
version: '9.
|
271
|
+
version: '9.3.0'
|
272
272
|
};
|
273
273
|
|
274
274
|
Object.assign(DefaultConfig, {
|
package/src/container/Base.mjs
CHANGED
@@ -584,7 +584,8 @@ class Container extends Component {
|
|
584
584
|
*/
|
585
585
|
mergeConfig(...args) {
|
586
586
|
let me = this,
|
587
|
-
config = super.mergeConfig(...args)
|
587
|
+
config = super.mergeConfig(...args),
|
588
|
+
ctorItems;
|
588
589
|
|
589
590
|
// avoid any interference on prototype level
|
590
591
|
// does not clone existing Neo instances
|
@@ -595,9 +596,15 @@ class Container extends Component {
|
|
595
596
|
}
|
596
597
|
|
597
598
|
if (config.items) {
|
599
|
+
ctorItems = me.constructor.config.items;
|
600
|
+
|
598
601
|
// If we are passed an object, merge the class's own items object into it
|
599
602
|
if (Neo.typeOf(config.items) === 'Object') {
|
600
|
-
|
603
|
+
if (Neo.isArray(ctorItems)) {
|
604
|
+
me.items = Neo.clone(config.items, true, true)
|
605
|
+
} else {
|
606
|
+
me.items = Neo.merge(Neo.clone(ctorItems), config.items)
|
607
|
+
}
|
601
608
|
} else {
|
602
609
|
me._items = Neo.clone(config.items, true, true)
|
603
610
|
}
|