neo.mjs 10.0.0-alpha.5 → 10.0.0-beta.1

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.
Files changed (72) hide show
  1. package/ServiceWorker.mjs +2 -2
  2. package/apps/portal/index.html +1 -1
  3. package/apps/portal/resources/data/examples_devmode.json +26 -27
  4. package/apps/portal/resources/data/examples_dist_dev.json +26 -27
  5. package/apps/portal/resources/data/examples_dist_esm.json +26 -27
  6. package/apps/portal/resources/data/examples_dist_prod.json +27 -28
  7. package/apps/portal/view/home/FooterContainer.mjs +1 -1
  8. package/apps/portal/view/learn/ContentComponent.mjs +102 -111
  9. package/examples/table/cellEditing/MainContainer.mjs +1 -1
  10. package/examples/table/container/MainContainer.mjs +3 -3
  11. package/examples/table/nestedRecordFields/Viewport.mjs +6 -6
  12. package/examples/tableFiltering/MainContainer.mjs +1 -1
  13. package/examples/tablePerformance/MainContainer.mjs +1 -1
  14. package/examples/tablePerformance/MainContainer2.mjs +1 -1
  15. package/examples/tablePerformance/MainContainer3.mjs +2 -2
  16. package/examples/tableStore/MainContainer.mjs +2 -2
  17. package/learn/UsingTheseTopics.md +2 -2
  18. package/learn/benefits/ConfigSystem.md +2 -2
  19. package/learn/benefits/FormsEngine.md +14 -14
  20. package/learn/benefits/MultiWindow.md +2 -2
  21. package/learn/benefits/OffTheMainThread.md +2 -2
  22. package/learn/benefits/Speed.md +2 -2
  23. package/learn/gettingstarted/ComponentModels.md +4 -4
  24. package/learn/gettingstarted/Config.md +6 -6
  25. package/learn/gettingstarted/DescribingTheUI.md +4 -4
  26. package/learn/gettingstarted/Events.md +6 -6
  27. package/learn/gettingstarted/Extending.md +4 -4
  28. package/learn/gettingstarted/References.md +6 -6
  29. package/learn/gettingstarted/Workspaces.md +6 -6
  30. package/learn/guides/ApplicationBootstrap.md +26 -26
  31. package/learn/guides/ComponentsAndContainers.md +12 -12
  32. package/learn/guides/CustomComponents.md +2 -2
  33. package/learn/guides/MainThreadAddonIntro.md +2 -2
  34. package/learn/guides/PortalApp.md +2 -2
  35. package/learn/guides/StateProviders.md +12 -12
  36. package/learn/guides/events/CustomEvents.md +16 -16
  37. package/learn/guides/events/DomEvents.md +12 -12
  38. package/learn/javascript/ClassFeatures.md +3 -2
  39. package/learn/javascript/Classes.md +8 -8
  40. package/learn/javascript/NewNode.md +4 -4
  41. package/learn/javascript/Overrides.md +8 -8
  42. package/learn/javascript/Super.md +10 -8
  43. package/learn/tutorials/Earthquakes.md +54 -57
  44. package/learn/tutorials/TodoList.md +4 -4
  45. package/package.json +1 -1
  46. package/resources/scss/src/apps/portal/learn/ContentComponent.scss +12 -0
  47. package/resources/scss/src/table/{View.scss → Body.scss} +1 -1
  48. package/resources/scss/src/table/plugin/CellEditing.scss +1 -1
  49. package/resources/scss/theme-dark/table/{View.scss → Body.scss} +1 -1
  50. package/resources/scss/theme-light/table/{View.scss → Body.scss} +1 -1
  51. package/resources/scss/theme-neo-light/Global.scss +1 -2
  52. package/resources/scss/theme-neo-light/table/{View.scss → Body.scss} +1 -1
  53. package/src/DefaultConfig.mjs +2 -2
  54. package/src/core/Base.mjs +59 -12
  55. package/src/core/Util.mjs +14 -2
  56. package/src/draggable/grid/header/toolbar/SortZone.mjs +21 -21
  57. package/src/draggable/table/header/toolbar/SortZone.mjs +1 -1
  58. package/src/grid/Body.mjs +2 -3
  59. package/src/grid/_export.mjs +1 -1
  60. package/src/main/addon/AmCharts.mjs +8 -11
  61. package/src/main/addon/Base.mjs +150 -42
  62. package/src/main/addon/GoogleMaps.mjs +9 -16
  63. package/src/main/addon/HighlightJS.mjs +2 -13
  64. package/src/main/addon/IntersectionObserver.mjs +21 -21
  65. package/src/main/addon/MonacoEditor.mjs +1 -6
  66. package/src/table/{View.mjs → Body.mjs} +19 -20
  67. package/src/table/Container.mjs +43 -43
  68. package/src/table/_export.mjs +2 -2
  69. package/src/table/plugin/CellEditing.mjs +19 -19
  70. package/src/vdom/Helper.mjs +9 -12
  71. package/src/worker/Base.mjs +1 -1
  72. package/src/worker/mixin/RemoteMethodAccess.mjs +1 -1
@@ -54,15 +54,15 @@ class SortZone extends BaseSortZone {
54
54
 
55
55
  let me = this,
56
56
  grid = me.owner.parent,
57
- {view} = grid,
58
- gridRows = view.getVdomRoot().cn,
57
+ {body} = grid,
58
+ bodyWrapperId = Neo.getId('grid-body-wrapper'),
59
+ gridRows = body.getVdomRoot().cn,
59
60
  columnIndex = me.dragElement['aria-colindex'] - 1,
60
- {dataField} = view.columnPositions.getAt(columnIndex),
61
- cells = view.getColumnCells(dataField),
61
+ {dataField} = body.columnPositions.getAt(columnIndex),
62
+ cells = body.getColumnCells(dataField),
62
63
  rows = [],
63
64
  config = await super.createDragProxy(data, false),
64
65
  rect = await grid.getDomRect(),
65
- viewWrapperId = Neo.getId('grid-view-wrapper'),
66
66
  row;
67
67
 
68
68
  config.cls = ['neo-grid-wrapper', me.owner.getTheme()];
@@ -85,9 +85,9 @@ class SortZone extends BaseSortZone {
85
85
  {cn: [
86
86
  {cls: ['neo-grid-container'], cn: [
87
87
  {...config.vdom, cls: ['neo-grid-header-toolbar', 'neo-toolbar']},
88
- {cls: ['neo-grid-view-wrapper'], id: viewWrapperId, cn: [
89
- {cls: ['neo-grid-view'], cn: rows},
90
- {cls: ['neo-grid-scrollbar'], style: {height: view.vdom.cn[0].height}}
88
+ {cls: ['neo-grid-body-wrapper'], id: bodyWrapperId, cn: [
89
+ {cls: ['neo-grid-body'], cn: rows},
90
+ {cls: ['neo-grid-scrollbar'], style: {height: body.vdom.cn[0].height}}
91
91
  ]}
92
92
  ]}
93
93
  ]};
@@ -95,8 +95,8 @@ class SortZone extends BaseSortZone {
95
95
  config.listeners = {
96
96
  mounted() {
97
97
  Neo.main.DomAccess.scrollTo({
98
- id : viewWrapperId,
99
- value : view.scrollTop,
98
+ id : bodyWrapperId,
99
+ value : body.scrollTop,
100
100
  windowId: this.windowId
101
101
  })
102
102
  }
@@ -133,11 +133,11 @@ class SortZone extends BaseSortZone {
133
133
  owner.updateDepth = 2;
134
134
  owner.update();
135
135
 
136
- await owner.passSizeToView();
136
+ await owner.passSizeToBody();
137
137
 
138
138
  await this.timeout(20);
139
139
 
140
- owner.parent.view.createViewData()
140
+ owner.parent.body.createViewData()
141
141
  }
142
142
 
143
143
  /**
@@ -148,11 +148,11 @@ class SortZone extends BaseSortZone {
148
148
 
149
149
  if (this.moveColumnContent) {
150
150
  let me = this,
151
- {view} = me.owner.parent,
151
+ {body} = me.owner.parent,
152
152
  columnIndex = me.dragElement['aria-colindex'] - 1,
153
- columnPosition = view.columnPositions.getAt(columnIndex),
153
+ columnPosition = body.columnPositions.getAt(columnIndex),
154
154
  {dataField} = columnPosition,
155
- cells = view.getColumnCells(dataField);
155
+ cells = body.getColumnCells(dataField);
156
156
 
157
157
  columnPosition.hidden = true;
158
158
 
@@ -160,7 +160,7 @@ class SortZone extends BaseSortZone {
160
160
  cell.style.visibility = 'hidden'
161
161
  });
162
162
 
163
- view.update()
163
+ body.update()
164
164
  }
165
165
  }
166
166
 
@@ -174,12 +174,12 @@ class SortZone extends BaseSortZone {
174
174
  if (this.moveColumnContent) {
175
175
  let me = this,
176
176
  {itemRects} = me,
177
- {view} = me.owner.parent,
178
- {columnPositions} = view,
177
+ {body} = me.owner.parent,
178
+ {columnPositions} = body,
179
179
  column1Position = columnPositions.getAt(index1),
180
180
  column2Position = columnPositions.getAt(index2),
181
- column1Cells = view.getColumnCells(column1Position.dataField),
182
- column2Cells = view.getColumnCells(column2Position.dataField);
181
+ column1Cells = body.getColumnCells(column1Position.dataField),
182
+ column2Cells = body.getColumnCells(column2Position.dataField);
183
183
 
184
184
  Object.assign(column1Position, {
185
185
  width: itemRects[index2].width,
@@ -203,7 +203,7 @@ class SortZone extends BaseSortZone {
203
203
  node.style.width = column2Position.width + 'px'
204
204
  });
205
205
 
206
- view.update()
206
+ body.update()
207
207
  }
208
208
  }
209
209
  }
@@ -63,7 +63,7 @@ class SortZone extends BaseSortZone {
63
63
  owner.updateDepth = 2;
64
64
  owner.update();
65
65
 
66
- owner.parent.view.createViewData()
66
+ owner.parent.body.createViewData()
67
67
  }
68
68
  }
69
69
 
package/src/grid/Body.mjs CHANGED
@@ -419,9 +419,8 @@ class GridBody extends Component {
419
419
  * @param {Number} data.rowIndex
420
420
  * @returns {Object}
421
421
  */
422
- applyRendererOutput(data) {
423
- let {cellId, column, columnIndex, record, rowIndex} = data,
424
- me = this,
422
+ applyRendererOutput({cellId, column, columnIndex, record, rowIndex}) {
423
+ let me = this,
425
424
  gridContainer = me.parent,
426
425
  {selectedCells, store} = me,
427
426
  cellCls = ['neo-grid-cell'],
@@ -2,4 +2,4 @@ import * as header from './header/_export.mjs';
2
2
  import Body from './Body.mjs';
3
3
  import Container from './Container.mjs';
4
4
 
5
- export {Body, header, Container};
5
+ export {header, Body, Container};
@@ -192,7 +192,7 @@ class AmCharts extends Base {
192
192
  * => fetching the other files after core.js is loaded
193
193
  * @param {Boolean} useFallback=false
194
194
  */
195
- loadFiles(useFallback=false) {
195
+ async loadFiles(useFallback=false) {
196
196
  let me = this,
197
197
  useFallbackPath = me.useFallbackPath || useFallback,
198
198
  basePath;
@@ -207,24 +207,21 @@ class AmCharts extends Base {
207
207
  basePath = useFallbackPath ? me.fallbackPath : me.downloadPath
208
208
  }
209
209
 
210
- me.isLoading = true;
210
+ try {
211
+ await DomAccess.loadScript(basePath + 'core.js');
211
212
 
212
- DomAccess.loadScript(basePath + 'core.js').then(() => {
213
- Promise.all([
213
+ await Promise.all([
214
214
  DomAccess.loadScript(basePath + 'charts.js'),
215
215
  DomAccess.loadScript(basePath + 'maps.js'),
216
216
  DomAccess.loadScript(basePath + 'themes/dark.js'),
217
217
  DomAccess.loadScript(basePath + 'geodata/worldLow.js')
218
- ]).then(() => {
219
- me.isLoading = false;
220
- me.isReady = true
221
- })
222
- }).catch(e => {
218
+ ])
219
+ } catch(e) {
223
220
  if (!useFallback && !me.useFallbackPath) {
224
221
  console.log('Download from amcharts.com failed, switching to fallback', e);
225
- me.loadFiles(true)
222
+ await me.loadFiles(true)
226
223
  }
227
- })
224
+ }
228
225
  }
229
226
 
230
227
  /**
@@ -4,6 +4,11 @@ import CoreBase from '../../core/Base.mjs';
4
4
  * Base class for main thread addons
5
5
  * @class Neo.main.addon.Base
6
6
  * @extends Neo.core.Base
7
+ *
8
+ * This version aligns the file loading and readiness state according to the rule:
9
+ * `initAsync()` MUST await for `loadFiles()` to be completed before the addon is considered `isReady`.
10
+ * `preloadFilesDelay` controls when `loadFiles()` is initiated in the background, but can be
11
+ * overridden by `cacheMethodCall()`.
7
12
  */
8
13
  class Base extends CoreBase {
9
14
  static config = {
@@ -19,34 +24,39 @@ class Base extends CoreBase {
19
24
  */
20
25
  isMainThreadAddon: true,
21
26
  /**
22
- * Will get set to true once all addon related files got loaded (if there is a need to load)
23
- * @member {Boolean} isReady_=false
24
- * @protected
25
- */
26
- isReady_: false,
27
- /**
28
- * Amount in ms to delay the loading of library files, unless remote method access happens
29
- * Change the value to false in case you don't want an automated preloading
27
+ * Amount in ms to delay the background loading of library files.
28
+ * Set to `false` to disable automated preloading and rely solely on lazy loading
29
+ * via `cacheMethodCall()`. Set to `0` for immediate background preload.
30
30
  * @member {Boolean|Number} preloadFilesDelay=5000
31
31
  * @protected
32
32
  */
33
- preloadFilesDelay: 5000,
33
+ preloadFilesDelay: 5000
34
34
  }
35
35
 
36
36
  /**
37
+ * Internal cache for remote method calls received when `isReady` is false.
37
38
  * @member {Object[]} cache=[]
38
39
  */
39
40
  cache = []
40
41
  /**
41
- * Will get set to true once we start loading Monaco related files
42
- * @member {Boolean} isLoading=false
42
+ * Returns true if `loadFiles()` has been initiated and is currently in progress.
43
+ * @member {Boolean} isLoading
44
+ */
45
+ get isLoading() {
46
+ // isLoading is true if the promise exists and its resolver is still available (meaning it's pending).
47
+ return !!this.#loadFilesPromise && !!this.#loadFilesPromiseResolver
48
+ }
49
+ /**
50
+ * A private promise that tracks the completion of `loadFiles()`.
51
+ * This ensures `loadFiles()` is called only once and can be awaited by multiple consumers.
52
+ * @member {Promise<void>|null} #loadFilesPromise=null
43
53
  */
44
- isLoading = false
54
+ #loadFilesPromise = null
45
55
  /**
46
- * Internal flag to store the setTimeout() id for loading external files
47
- * @member {Number|null} loadingTimeoutId=null
56
+ * The `resolve` function for `#loadFilesPromise`, allowing external control over its resolution.
57
+ * @member {Function|null} #loadFilesPromiseResolver=null
48
58
  */
49
- loadingTimeoutId = null
59
+ #loadFilesPromiseResolver = null
50
60
 
51
61
  /**
52
62
  * @param {Object} config
@@ -56,56 +66,154 @@ class Base extends CoreBase {
56
66
 
57
67
  let me = this;
58
68
 
59
- if (me.loadFiles) {
60
- if (me.preloadFilesDelay === 0) {
61
- me.loadFiles()
62
- } else if (Neo.isNumber(me.preloadFilesDelay)) {
63
- me.loadingTimeoutId = setTimeout(() => {
64
- me.loadFiles()
65
- }, me.preloadFilesDelay)
69
+ // Initialize #loadFilesPromise as a controllable promise.
70
+ // This promise will be awaited by initAsync and resolved by executeLoadFiles.
71
+ me.#loadFilesPromise = new Promise(resolve => {
72
+ me.#loadFilesPromiseResolver = resolve
73
+ });
74
+
75
+ if (me.preloadFilesDelay === false) {
76
+ // No automated preload: resolve #loadFilesPromise immediately as it won't be triggered by delay.
77
+ // It will only be triggered by cacheMethodCall or initAsync if needed.
78
+ me.#loadFilesPromiseResolver();
79
+ me.#loadFilesPromiseResolver = null // Mark as resolved/no longer pending
80
+ } else {
81
+ const delay = Neo.isNumber(me.preloadFilesDelay) ? me.preloadFilesDelay : 0;
82
+
83
+ if (delay === 0) {
84
+ // Immediate preload: Directly execute loadFiles and resolve the promise.
85
+ me.#executeLoadFiles()
86
+ } else {
87
+ // Delayed preload: Set up a timer to execute loadFiles later.
88
+ me.timeout(delay).then(() => {
89
+ // This callback checks if #loadFilesPromise is still pending (resolver is available).
90
+ if (me.#loadFilesPromiseResolver) {
91
+ me.#executeLoadFiles()
92
+ }
93
+ })
66
94
  }
67
95
  }
68
96
  }
69
97
 
70
98
  /**
71
- * Triggered after the isReady config got changed
99
+ * Executes the actual `loadFiles()` method and resolves `#loadFilesPromise`.
100
+ * This method is called internally to manage the single execution of `loadFiles()`.
101
+ * It ensures `loadFiles()` is only truly called once.
102
+ * @private
103
+ */
104
+ async #executeLoadFiles() {
105
+ let me = this;
106
+
107
+ // Only execute if the promise is still pending (resolver is available).
108
+ if (me.#loadFilesPromiseResolver) {
109
+ const resolver = me.#loadFilesPromiseResolver;
110
+ me.#loadFilesPromiseResolver = null; // Mark as no longer pending/resolved
111
+
112
+ await me.loadFiles();
113
+ resolver() // Resolve the main #loadFilesPromise
114
+ }
115
+ }
116
+
117
+ /**
118
+ * Async initialization hook for instances.
119
+ * `initAsync` MUST await for `loadFiles()` to be completed. Only then the addon is ready.
120
+ * @returns {Promise<void>}
121
+ */
122
+ async initAsync() {
123
+ await super.initAsync();
124
+
125
+ let me = this;
126
+
127
+ // `initAsync` must always wait for `me.#loadFilesPromise` to complete its resolution,
128
+ // regardless of how it was triggered (immediate, delayed, or by cacheMethodCall).
129
+ // `me.#loadFilesPromise` is always initialized in `construct()`.
130
+ await me.#loadFilesPromise
131
+ }
132
+
133
+ /**
134
+ * Triggered after the `isReady` config got changed.
135
+ * When `isReady` becomes true, any cached remote method calls are executed.
136
+ * At this point, `initAsync` has already ensured that `me.#loadFilesPromise` is resolved.
137
+ *
138
+ * This method is kept synchronous, delegating the async cache processing to a private method.
139
+ *
72
140
  * @param {Boolean} value
73
141
  * @param {Boolean} oldValue
74
142
  * @protected
75
143
  */
76
- afterSetIsReady(value, oldValue) {
144
+ afterSetIsReady(value, oldValue) { // Keep this synchronous
77
145
  if (value) {
78
- let me = this,
79
- returnValue;
80
-
81
- me.cache.forEach(item => {
82
- returnValue = me[item.fn](item.data);
83
- item.resolve(returnValue)
84
- });
85
-
86
- me.cache = []
146
+ // Initiate the asynchronous processing of cached method calls.
147
+ // This method itself does not need to be awaited here.
148
+ this.#processCachedMethodCalls();
87
149
  }
88
150
  }
89
151
 
90
152
  /**
91
- * Internally caches call when isReady===false
92
- * Loads the library files in case this is not already happening
93
- * @param item
94
- * @returns {Promise<unknown>}
153
+ * Internally caches remote method calls if `isReady` is false.
154
+ * It also ensures that `loadFiles()` is initiated immediately, bypassing `preloadFilesDelay`.
155
+ * @param {Object} item - Contains method name (`fn`) and data (`data`).
156
+ * @returns {Promise<unknown>} A promise that resolves with the method's return value.
95
157
  */
96
158
  cacheMethodCall(item) {
97
159
  let me = this;
98
160
 
99
- if (!me.isLoading) {
100
- me.loadingTimeoutId && clearTimeout(me.loadingTimeoutId);
101
- me.loadingTimeoutId = null;
102
- me.loadFiles()
161
+ // If loadFiles is defined, and it hasn't started yet (i.e., #loadFilesPromiseResolver is still available),
162
+ // execute it now, bypassing any pending preloadFilesDelay timer.
163
+ if (me.#loadFilesPromiseResolver) {
164
+ me.#executeLoadFiles() // This will resolve #loadFilesPromise immediately
103
165
  }
104
166
 
105
167
  return new Promise((resolve, reject) => {
106
- me.cache.push({...item, resolve})
168
+ me.cache.push({...item, reject, resolve})
107
169
  })
108
170
  }
171
+
172
+ /**
173
+ * Placeholder method for loading external files.
174
+ * Subclasses (e.g., `Neo.main.addon.AmCharts`) must implement this.
175
+ * It **must** return a Promise that resolves when all necessary files are loaded.
176
+ * If `loadFiles()` is called multiple times, it should return the same pending promise
177
+ * or a resolved promise if files are already loaded.
178
+ * @returns {Promise<void>}
179
+ */
180
+ async loadFiles() {}
181
+
182
+ /**
183
+ * Sequentially processes any method calls that were cached while the addon was not ready.
184
+ * This method is asynchronous to allow awaiting the execution of individual cached methods.
185
+ * @returns {Promise<void>} A promise that resolves when all cached methods have been processed.
186
+ * @private
187
+ */
188
+ async #processCachedMethodCalls() {
189
+ let me = this;
190
+
191
+ // Iterate over the cache items and await each one in sequence
192
+ for (const item of me.cache) {
193
+ let returnValue;
194
+
195
+ try {
196
+ returnValue = me[item.fn](item.data);
197
+
198
+ if (Neo.isPromise(returnValue)) {
199
+ returnValue = await returnValue;
200
+ }
201
+
202
+ item.resolve(returnValue)
203
+ } catch (e) {
204
+ // If an error occurs (either synchronous or a promise rejection),
205
+ // reject the promise associated with the current cached item.
206
+ item.reject(e)
207
+
208
+ // *** FAIL-FAST STRATEGY ***
209
+ // If any cached method call fails, we assume subsequent cached calls
210
+ // (especially for the same addon instance) are likely to also fail.
211
+ break
212
+ }
213
+ }
214
+
215
+ me.cache = []
216
+ }
109
217
  }
110
218
 
111
219
  export default Neo.setupClass(Base);
@@ -8,16 +8,19 @@ import Observable from '../../core/Observable.mjs';
8
8
  * @extends Neo.main.addon.Base
9
9
  */
10
10
  class GoogleMaps extends Base {
11
+ /**
12
+ * True automatically applies the core.Observable mixin
13
+ * @member {Boolean} observable=true
14
+ * @static
15
+ */
16
+ static observable = true
17
+
11
18
  static config = {
12
19
  /**
13
20
  * @member {String} className='Neo.main.addon.GoogleMaps'
14
21
  * @protected
15
22
  */
16
23
  className: 'Neo.main.addon.GoogleMaps',
17
- /**
18
- * @member {Neo.core.Base[]} mixins=[Observable]
19
- */
20
- mixins: [Observable],
21
24
  /**
22
25
  * @member {Object} remote
23
26
  * @protected
@@ -52,14 +55,6 @@ class GoogleMaps extends Base {
52
55
  */
53
56
  markers = {}
54
57
 
55
- /**
56
- * @param {Object} config
57
- */
58
- construct(config) {
59
- super.construct(config);
60
- this.loadApi()
61
- }
62
-
63
58
  /**
64
59
  * @param {Object} data
65
60
  * @param {Object} [data.anchorPoint] x & y
@@ -176,13 +171,11 @@ class GoogleMaps extends Base {
176
171
  /**
177
172
  * @protected
178
173
  */
179
- loadApi() {
174
+ async loadFiles() {
180
175
  let key = Neo.config.googleMapsApiKey,
181
176
  url = ' https://maps.googleapis.com/maps/api/js';
182
177
 
183
- DomAccess.loadScript(`${url}?key=${key}&v=weekly&callback=Neo.emptyFn`).then(() => {
184
- console.log('GoogleMaps API loaded')
185
- })
178
+ await DomAccess.loadScript(`${url}?key=${key}&v=weekly&callback=Neo.emptyFn`)
186
179
  }
187
180
 
188
181
  /**
@@ -68,17 +68,11 @@ class HighlightJS extends Base {
68
68
 
69
69
  /**
70
70
  * @param {Object} data
71
- * @returns {Boolean}
71
+ * @returns {Promise<void>}
72
72
  */
73
73
  async loadFiles(data) {
74
74
  let me = this;
75
75
 
76
- if (me.isLoading || me.isReady) {
77
- return true
78
- }
79
-
80
- me.isLoading = true;
81
-
82
76
  if (data) {
83
77
  delete data.appName;
84
78
  delete data.windowId;
@@ -91,12 +85,7 @@ class HighlightJS extends Base {
91
85
  await Promise.all([
92
86
  DomAccess.loadScript(me.highlightJsLineNumbersPath),
93
87
  Neo.main.addon.Stylesheet.createStyleSheet(null, 'hljs-theme', me.themePath)
94
- ]);
95
-
96
- me.isLoading = false;
97
- me.isReady = true;
98
-
99
- return true
88
+ ])
100
89
  }
101
90
 
102
91
  /**
@@ -29,17 +29,17 @@ class NeoIntersectionObserver extends Base {
29
29
  }
30
30
 
31
31
  /**
32
- * Storing data from observe() calls which arrived prior to register()
32
+ * Storing component ids and their IntersectionObservers
33
33
  * @member {Object} map={}
34
34
  * @protected
35
35
  */
36
- cache = {}
36
+ map = {}
37
37
  /**
38
- * Storing component ids and their IntersectionObservers
39
- * @member {Object} map={}
38
+ * Storing data from observe() calls which arrived prior to register()
39
+ * @member {Object} observeCache={}
40
40
  * @protected
41
41
  */
42
- map = {}
42
+ observeCache = {}
43
43
 
44
44
  /**
45
45
  * @param {Object} data
@@ -107,12 +107,12 @@ class NeoIntersectionObserver extends Base {
107
107
  * {Number} opts.countTargets: amount of found target nodes inside the DOM
108
108
  */
109
109
  observe(data) {
110
- let me = this,
111
- cache = me.cache,
112
- cached = false,
113
- {id, observe} = data,
114
- observer = me.map[data.id],
115
- targets = [];
110
+ let me = this,
111
+ cached = false,
112
+ {id, observe} = data,
113
+ {observeCache} = me,
114
+ observer = me.map[data.id],
115
+ targets = [];
116
116
 
117
117
  if (!Neo.isArray(observe)) {
118
118
  observe = [observe]
@@ -131,11 +131,11 @@ class NeoIntersectionObserver extends Base {
131
131
  } else {
132
132
  cached = true;
133
133
 
134
- if (!cache[id]) {
135
- cache[id] = []
134
+ if (!observeCache[id]) {
135
+ observeCache[id] = []
136
136
  }
137
137
 
138
- cache[id].push(data);
138
+ observeCache[id].push(data);
139
139
  }
140
140
 
141
141
  return {
@@ -157,10 +157,10 @@ class NeoIntersectionObserver extends Base {
157
157
  * if data.observe is not passed: true
158
158
  */
159
159
  register(data) {
160
- let me = this,
161
- {cache} = me,
162
- {id, observe} = data,
163
- returnValue = true,
160
+ let me = this,
161
+ {observeCache} = me,
162
+ {id, observe} = data,
163
+ returnValue = true,
164
164
  observer;
165
165
 
166
166
  me.map[id] = observer = new IntersectionObserver(me[data.callback].bind(me), {
@@ -175,9 +175,9 @@ class NeoIntersectionObserver extends Base {
175
175
  returnValue = me.observe({id, observe})
176
176
  }
177
177
 
178
- if (cache[id]) {
179
- cache[id].forEach(item => me.observe(item));
180
- delete cache[id]
178
+ if (observeCache[id]) {
179
+ observeCache[id].forEach(item => me.observe(item));
180
+ delete observeCache[id]
181
181
  }
182
182
 
183
183
  return returnValue
@@ -119,8 +119,6 @@ class MonacoEditor extends Base {
119
119
  let me = this,
120
120
  path = me.libraryBasePath;
121
121
 
122
- me.isLoading = true;
123
-
124
122
  window.require = {paths: {vs: path}};
125
123
 
126
124
  await DomAccess.loadScript(path + '/loader.js');
@@ -129,10 +127,7 @@ class MonacoEditor extends Base {
129
127
  DomAccess.loadStylesheet(path + '/editor/editor.main.css', {name: 'vs/editor/editor.main'}),
130
128
  DomAccess.loadScript(path + '/editor/editor.main.nls.js'),
131
129
  DomAccess.loadScript(path + '/editor/editor.main.js')
132
- ]);
133
-
134
- me.isLoading = false;
135
- me.isReady = true
130
+ ])
136
131
  }
137
132
 
138
133
  /**