neo.mjs 8.1.1 → 8.1.2

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.
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='8.1.1'
23
+ * @member {String} version='8.1.2'
24
24
  */
25
- version: '8.1.1'
25
+ version: '8.1.2'
26
26
  }
27
27
 
28
28
  /**
@@ -16,7 +16,7 @@
16
16
  "@type": "Organization",
17
17
  "name": "Neo.mjs"
18
18
  },
19
- "datePublished": "2025-01-11",
19
+ "datePublished": "2025-01-12",
20
20
  "publisher": {
21
21
  "@type": "Organization",
22
22
  "name": "Neo.mjs"
@@ -107,7 +107,7 @@ class FooterContainer extends Container {
107
107
  }, {
108
108
  module: Component,
109
109
  cls : ['neo-version'],
110
- html : 'v8.1.1'
110
+ html : 'v8.1.2'
111
111
  }]
112
112
  }],
113
113
  /**
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='8.1.1'
23
+ * @member {String} version='8.1.2'
24
24
  */
25
- version: '8.1.1'
25
+ version: '8.1.2'
26
26
  }
27
27
 
28
28
  /**
@@ -20,7 +20,7 @@ class MainContainerController extends ComponentController {
20
20
  construct(config) {
21
21
  super.construct(config);
22
22
  Neo.main.addon.HighlightJS.switchTheme('dark');
23
- Neo.main.addon.HighlightJS.loadLibrary({})
23
+ Neo.main.addon.HighlightJS.loadFiles({})
24
24
  }
25
25
 
26
26
  /**
@@ -72,7 +72,9 @@ class MainContainerController extends ComponentController {
72
72
  }
73
73
  })
74
74
 
75
- values.appName = me.component.appName;
75
+ values.appName = me.component.appName;
76
+ values.windowId = me.component.windowId;
77
+
76
78
  Neo.toast(values)
77
79
  }
78
80
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "8.1.1",
3
+ "version": "8.1.2",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -1,7 +1,9 @@
1
1
  .neo-grid-wrapper {
2
- overflow-x: auto;
3
- overflow-y: hidden;
4
- position : relative;
2
+ overflow-anchor : none;
3
+ overflow-x : auto;
4
+ overflow-y : hidden;
5
+ overscroll-behavior: none;
6
+ position : relative;
5
7
  }
6
8
 
7
9
  .neo-grid-container {
@@ -1,8 +1,9 @@
1
1
  .neo-grid-view-wrapper {
2
- height : 100%;
3
- overflow-x: hidden;
4
- overflow-y: auto;
5
- position : relative;
2
+ height : 100%;
3
+ overflow-anchor: none;
4
+ overflow-x : hidden;
5
+ overflow-y : auto;
6
+ position : relative;
6
7
 
7
8
  .neo-grid-scrollbar {
8
9
  height : 1px;
@@ -262,12 +262,12 @@ const DefaultConfig = {
262
262
  useVdomWorker: true,
263
263
  /**
264
264
  * buildScripts/injectPackageVersion.mjs will update this value
265
- * @default '8.1.1'
265
+ * @default '8.1.2'
266
266
  * @memberOf! module:Neo
267
267
  * @name config.version
268
268
  * @type String
269
269
  */
270
- version: '8.1.1'
270
+ version: '8.1.2'
271
271
  };
272
272
 
273
273
  Object.assign(DefaultConfig, {
@@ -1,4 +1,4 @@
1
- import Base from '../component/Base.mjs';
1
+ import Component from '../component/Base.mjs';
2
2
  import NeoArray from "../util/Array.mjs";
3
3
  import ToastManager from '../manager/Toast.mjs';
4
4
 
@@ -20,7 +20,7 @@ import ToastManager from '../manager/Toast.mjs';
20
20
  title : 'Alarm Clock' // null
21
21
  })
22
22
  */
23
- class Toast extends Base {
23
+ class Toast extends Component {
24
24
  /**
25
25
  * Valid values for positions
26
26
  * @member {String[]} positions = ['tl','tc','tr','bl','bc','br']
@@ -614,10 +614,16 @@ class GridContainer extends BaseContainer {
614
614
  let me = this,
615
615
  [containerRect, headerRect] = await me.getDomRect([me.id, me.headerToolbarId]);
616
616
 
617
- me.view[silent ? 'setSilent' : 'set']({
618
- availableHeight: containerRect.height - headerRect.height,
619
- containerWidth : containerRect.width
620
- })
617
+ // delay for slow connections, where the container-sizing is not done yet
618
+ if (containerRect.height === headerRect.height) {
619
+ await me.timeout(100);
620
+ await me.passSizeToView(silent)
621
+ } else {
622
+ me.view[silent ? 'setSilent' : 'set']({
623
+ availableHeight: containerRect.height - headerRect.height,
624
+ containerWidth : containerRect.width
625
+ })
626
+ }
621
627
  }
622
628
 
623
629
  /**
@@ -179,14 +179,32 @@ class Toolbar extends BaseToolbar {
179
179
  * @returns {Promise<void>}
180
180
  */
181
181
  async passSizeToView(silent=false) {
182
- let me = this,
183
- rects = await me.getDomRect(me.items.map(item => item.id)),
184
- lastItem = rects[rects.length - 1];
185
-
186
- me.gridContainer.view[silent ? 'setSilent' : 'set']({
187
- availableWidth : lastItem.x + lastItem.width - rects[0].x,
188
- columnPositions: rects.map(item => ({width: item.width, x: item.x - rects[0].x}))
189
- })
182
+ let me = this,
183
+ rects = await me.getDomRect(me.items.map(item => item.id)),
184
+ lastItem = rects[rects.length - 1],
185
+ columnPositions = rects.map(item => ({width: item.width, x: item.x - rects[0].x})),
186
+ i = 1,
187
+ len = columnPositions.length,
188
+ layoutFinished = true;
189
+
190
+ // If the css sizing is not done, columns after the first one can get x = 0
191
+ for (; i < len; i++) {
192
+ if (columnPositions[i].x === 0) {
193
+ layoutFinished = false;
194
+ break;
195
+ }
196
+ }
197
+
198
+ // Delay for slow connections, where the container-sizing is not done yet
199
+ if (!layoutFinished) {
200
+ await me.timeout(100);
201
+ await me.passSizeToView(silent)
202
+ } else {
203
+ me.gridContainer.view[silent ? 'setSilent' : 'set']({
204
+ availableWidth: lastItem.x + lastItem.width - rects[0].x,
205
+ columnPositions
206
+ })
207
+ }
190
208
  }
191
209
  }
192
210
 
@@ -126,8 +126,8 @@ class HighlightJS extends Base {
126
126
  */
127
127
  switchTheme(theme) {
128
128
  let definedThemes = {
129
- dark : './resources/highlightjs-custom-dark-theme.css',
130
- light: './resources/highlightjs-custom-github-theme.css'
129
+ dark : './resources/lib/highlightjs-custom-dark-theme.css',
130
+ light: './resources/lib/highlightjs-custom-github-theme.css'
131
131
  },
132
132
  switchToTheme = definedThemes[theme];
133
133