neo.mjs 4.0.45 → 4.0.48

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.
@@ -174,7 +174,7 @@ if (programOpts.info) {
174
174
  appPath : `${insideNeo ? '' : '../../'}${appPath}app.mjs`,
175
175
  basePath : '../../',
176
176
  environment: 'development',
177
- mainPath : './Main.mjs'
177
+ mainPath : `${insideNeo ? './' : '../node_modules/neo.mjs/src/'}Main.mjs`
178
178
  };
179
179
 
180
180
  if (!(mainThreadAddons.includes('DragDrop') && mainThreadAddons.includes('Stylesheet') && mainThreadAddons.length === 2)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "4.0.45",
3
+ "version": "4.0.48",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -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
  /**
@@ -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;
@@ -65,15 +65,16 @@ class HashHistory extends Base {
65
65
  * @param {String} data.hashString
66
66
  */
67
67
  push(data) {
68
- let me = this;
68
+ let me = this,
69
+ stack = me.stack;
69
70
 
70
- me.stack.unshift(data);
71
+ stack.unshift(data);
71
72
 
72
- if (me.stack.length > me.maxItems) {
73
- me.stack.length = me.maxItems;
73
+ if (stack.length > me.maxItems) {
74
+ stack.length = me.maxItems;
74
75
  }
75
76
 
76
- me.fire('change', data, me.stack[1]);
77
+ me.fire('change', data, stack[1]);
77
78
  }
78
79
  }
79
80