neo.mjs 4.0.46 → 4.0.49

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.
@@ -16,7 +16,8 @@ const cwd = process.cwd(),
16
16
  regexTrimEnd = /\s+$/gm,
17
17
  regexTrimStart = /^\s+/gm;
18
18
 
19
- let config, examplesPath;
19
+ let contextAdjusted = false,
20
+ config, examplesPath;
20
21
 
21
22
  if (fs.existsSync(configPath)) {
22
23
  config = requireJson(configPath);
@@ -134,8 +135,11 @@ export default env => {
134
135
 
135
136
  plugins: [
136
137
  new webpack.ContextReplacementPlugin(/.*/, context => {
137
- if (!insideNeo && context.context.includes('/src/worker')) {
138
- context.request = '../../' + context.request;
138
+ let con = context.context;
139
+
140
+ if (!insideNeo && !contextAdjusted && (con.includes('/src/worker') || con.includes('\\src\\worker'))) {
141
+ context.request = path.join('../../', context.request);
142
+ contextAdjusted = true;
139
143
  }
140
144
  }),
141
145
  ...plugins
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "4.0.46",
3
+ "version": "4.0.49",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -42,11 +42,11 @@
42
42
  "chalk": "^5.0.1",
43
43
  "clean-webpack-plugin": "^4.0.0",
44
44
  "commander": "^9.3.0",
45
- "cssnano": "^5.1.11",
45
+ "cssnano": "^5.1.12",
46
46
  "envinfo": "^7.8.1",
47
47
  "fs-extra": "^10.1.0",
48
48
  "highlightjs-line-numbers.js": "^2.8.0",
49
- "inquirer": "^8.2.4",
49
+ "inquirer": "^9.0.0",
50
50
  "neo-jsdoc": "^1.0.1",
51
51
  "neo-jsdoc-x": "^1.0.4",
52
52
  "postcss": "^8.4.14",
@@ -1007,7 +1007,7 @@ class Base extends CoreBase {
1007
1007
  * @returns {Promise<*>}
1008
1008
  */
1009
1009
  getDomRect(id=this.id, appName=this.appName) {
1010
- return Neo.main.DomAccess.getBoundingClientRect({ appName, id });
1010
+ return Neo.main.DomAccess.getBoundingClientRect({appName, id});
1011
1011
  }
1012
1012
 
1013
1013
  /**
@@ -326,8 +326,9 @@ class DateSelector extends Component {
326
326
  me.currentDate = new Date(`${value}T00:00:00`);
327
327
 
328
328
  me.fire('change', {
329
- oldValue: oldValue,
330
- value : value
329
+ component: me,
330
+ oldValue,
331
+ value
331
332
  });
332
333
  } else {
333
334
  me.cacheUpdate();
@@ -191,8 +191,8 @@ class TextField extends Component {
191
191
 
192
192
  me.fire('change', {
193
193
  component: me,
194
- oldValue : oldValue,
195
- value : value
194
+ oldValue,
195
+ value
196
196
  });
197
197
  }
198
198
 
@@ -325,8 +325,8 @@ class DragZone extends Base {
325
325
 
326
326
  Object.assign(me, {
327
327
  dragElementRect: rect,
328
- offsetX : offsetX,
329
- offsetY : offsetY
328
+ offsetX,
329
+ offsetY
330
330
  });
331
331
 
332
332
  me.createDragProxy(rect);
@@ -337,8 +337,8 @@ class DragZone extends Base {
337
337
  dragElementRect: rect,
338
338
  eventData : data,
339
339
  id : me.id,
340
- offsetX : offsetX,
341
- offsetY : offsetY
340
+ offsetX,
341
+ offsetY
342
342
  });
343
343
  }
344
344
 
@@ -45,8 +45,8 @@ class BooleanContainer extends Container {
45
45
  if (oldValue !== undefined) {
46
46
  this.fire('change', {
47
47
  component: this,
48
- oldValue : oldValue,
49
- value : value
48
+ oldValue,
49
+ value
50
50
  });
51
51
  }
52
52
  }
@@ -59,8 +59,8 @@ class NumberContainer extends Container {
59
59
  if (oldValue !== undefined) {
60
60
  this.fire('operatorChange', {
61
61
  component: this,
62
- oldValue : oldValue,
63
- value : value
62
+ oldValue,
63
+ value
64
64
  });
65
65
  }
66
66
  }
@@ -74,8 +74,8 @@ class NumberContainer extends Container {
74
74
  if (oldValue !== undefined) {
75
75
  this.fire('change', {
76
76
  component: this,
77
- oldValue : oldValue,
78
- value : value
77
+ oldValue,
78
+ value
79
79
  });
80
80
  }
81
81
  }
@@ -53,8 +53,8 @@ class ToggleOperatorsButton extends Button {
53
53
 
54
54
  me.fire('change', {
55
55
  component: me,
56
- oldValue : oldValue,
57
- value : value
56
+ oldValue,
57
+ value
58
58
  });
59
59
  }
60
60
  }
@@ -42,8 +42,8 @@ class Base extends Component {
42
42
  fireChangeEvent(value, oldValue) {
43
43
  this.fire('change', {
44
44
  component: this,
45
- oldValue : oldValue,
46
- value : value
45
+ oldValue,
46
+ value
47
47
  });
48
48
  }
49
49
 
@@ -230,7 +230,7 @@ class AmCharts extends Base {
230
230
  this.setProperty({
231
231
  id : data.id,
232
232
  path : key,
233
- value: value
233
+ value
234
234
  })
235
235
  });
236
236
  }
@@ -0,0 +1,57 @@
1
+ import Base from '../../core/Base.mjs';
2
+
3
+ /**
4
+ * Addon to register WebComponents
5
+ * @class Neo.main.addon.WebComponent
6
+ * @extends Neo.core.Base
7
+ * @singleton
8
+ */
9
+ class WebComponent extends Base {
10
+ static getConfig() {return {
11
+ /**
12
+ * @member {String} className='Neo.main.addon.WebComponent'
13
+ * @protected
14
+ */
15
+ className: 'Neo.main.addon.WebComponent',
16
+ /**
17
+ * @member {Boolean} singleton=true
18
+ * @protected
19
+ */
20
+ singleton: true
21
+ }}
22
+
23
+ /**
24
+ * @param {Object} config
25
+ */
26
+ construct(config) {
27
+ super.construct(config);
28
+
29
+ this.registerElementLoader();
30
+ }
31
+
32
+ /**
33
+ *
34
+ */
35
+ registerElementLoader() {
36
+ customElements.define('element-loader', class extends HTMLElement {
37
+ async connectedCallback() {
38
+ let me = this,
39
+ content = await (await fetch(me.getAttribute('src'))).text(),
40
+ styles;
41
+
42
+ me.attachShadow({mode: 'open'}).innerHTML = content;
43
+
44
+ styles = me.querySelector('style');
45
+ styles && me.shadowRoot.append(styles);
46
+ }
47
+ });
48
+ }
49
+ }
50
+
51
+ Neo.applyClassConfig(WebComponent);
52
+
53
+ let instance = Neo.create(WebComponent);
54
+
55
+ Neo.applyToGlobalNs(instance);
56
+
57
+ export default instance;
@@ -54,7 +54,6 @@ class TouchDomEvents extends Base {
54
54
  * @param {Object} event
55
55
  */
56
56
  onTouchStart(event) {
57
- console.log('onTouchStart', event);
58
57
  this.sendMessageToApp(this.getEventData(event));
59
58
  }
60
59
  }
@@ -140,7 +140,7 @@ class GalleryModel extends Model {
140
140
  me.select(record[store.keyProperty]);
141
141
 
142
142
  view.fire('select', {
143
- record: record
143
+ record
144
144
  });
145
145
  }
146
146
 
@@ -190,7 +190,7 @@ class GalleryModel extends Model {
190
190
  me.select(record[store.keyProperty]);
191
191
 
192
192
  view.fire('select', {
193
- record: record
193
+ record
194
194
  });
195
195
  }
196
196
 
@@ -154,7 +154,7 @@ class HelixModel extends Model {
154
154
  me.select(record[store.keyProperty]);
155
155
 
156
156
  view.fire('select', {
157
- record: record
157
+ record
158
158
  });
159
159
  }
160
160
 
@@ -186,7 +186,7 @@ class HelixModel extends Model {
186
186
  me.select(record[store.keyProperty]);
187
187
 
188
188
  view.fire('select', {
189
- record: record
189
+ record
190
190
  });
191
191
  }
192
192
 
@@ -259,7 +259,7 @@ class HelixModel extends Model {
259
259
  view.mounted && Neo.currentWorker.promiseMessage('main', {
260
260
  action : 'updateDom',
261
261
  appName: view.appName,
262
- deltas : deltas
262
+ deltas
263
263
  }).then(() => {
264
264
  view.onSelect?.(items);
265
265
  me.fire('selectionChange', items, oldItems);
@@ -80,7 +80,7 @@ class View extends Component {
80
80
  trCls.push('neo-selected');
81
81
 
82
82
  Neo.getComponent(me.containerId).fire('select', {
83
- record: record
83
+ record
84
84
  });
85
85
  }
86
86