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 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
- **Real-World Applications**
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.
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='9.1.0'
23
+ * @member {String} version='9.3.0'
24
24
  */
25
- version: '9.1.0'
25
+ version: '9.3.0'
26
26
  }
27
27
 
28
28
  /**
@@ -16,7 +16,7 @@
16
16
  "@type": "Organization",
17
17
  "name": "Neo.mjs"
18
18
  },
19
- "datePublished": "2025-05-13",
19
+ "datePublished": "2025-05-23",
20
20
  "publisher": {
21
21
  "@type": "Organization",
22
22
  "name": "Neo.mjs"
@@ -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: '0',
63
- hideDelay: '0'
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: '0',
71
- hideDelay: '0'
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: '0',
79
- hideDelay: '0'
78
+ showDelay: 0,
79
+ hideDelay: 0
80
80
  }
81
81
  }]
82
82
  }]
@@ -107,7 +107,7 @@ class FooterContainer extends Container {
107
107
  }, {
108
108
  module: Component,
109
109
  cls : ['neo-version'],
110
- html : 'v9.1.0'
110
+ html : 'v9.3.0'
111
111
  }]
112
112
  }],
113
113
  /**
@@ -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
 
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='9.1.0'
23
+ * @member {String} version='9.3.0'
24
24
  */
25
- version: '9.1.0'
25
+ version: '9.3.0'
26
26
  }
27
27
 
28
28
  /**
@@ -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,11 @@
1
+ Neo.overwrites = {
2
+ Neo: {
3
+ button: {
4
+ Base: {
5
+ editRoute: false
6
+ }
7
+ }
8
+ }
9
+ }
10
+
11
+ export default Neo.overwrites;
@@ -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,7 @@
1
+ import Overwrites from './Overwrites.mjs';
2
+ import Viewport from './Viewport.mjs';
3
+
4
+ export const onStart = () => Neo.app({
5
+ mainView: Viewport,
6
+ name : 'Neo.examples.serverside.toolbarItems'
7
+ });
@@ -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,6 @@
1
+ {
2
+ "appPath" : "examples/serverside/toolbarItems/app.mjs",
3
+ "basePath" : "../../../",
4
+ "environment": "development",
5
+ "mainPath" : "./Main.mjs"
6
+ }
@@ -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.1.0",
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": "^13.1.0",
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.11",
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.88.0",
65
+ "sass": "^1.89.0",
66
66
  "siesta-lite": "5.5.2",
67
67
  "url": "^0.11.4",
68
- "webpack": "^5.99.8",
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",
@@ -0,0 +1,14 @@
1
+ .neo-viewport.neo-serverside-toolbaritems-viewport {
2
+ padding: 1em;
3
+
4
+ .neo-toolbar {
5
+ background-color: #f2f2f2;
6
+ padding : 10px 5px 10px 10px;
7
+
8
+ .neo-button {
9
+ &:not(:last-child) {
10
+ margin-right: .2em;
11
+ }
12
+ }
13
+ }
14
+ }
@@ -263,12 +263,12 @@ const DefaultConfig = {
263
263
  useVdomWorker: true,
264
264
  /**
265
265
  * buildScripts/injectPackageVersion.mjs will update this value
266
- * @default '9.1.0'
266
+ * @default '9.3.0'
267
267
  * @memberOf! module:Neo
268
268
  * @name config.version
269
269
  * @type String
270
270
  */
271
- version: '9.1.0'
271
+ version: '9.3.0'
272
272
  };
273
273
 
274
274
  Object.assign(DefaultConfig, {
@@ -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
- me.items = Neo.merge(Neo.clone(me.constructor.config.items), config.items)
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
  }