neo.mjs 4.0.66 → 4.0.69

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.
@@ -360,6 +360,8 @@ class MainContainerController extends ComponentController {
360
360
  me.mainTabs.splice(1, 0, 'mapboxglmap');
361
361
  break;
362
362
  }
363
+
364
+ Neo.apps[name].destroy();
363
365
  }
364
366
  }
365
367
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "4.0.66",
3
+ "version": "4.0.69",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -62,7 +62,7 @@
62
62
  "webpack-node-externals": "^3.0.0"
63
63
  },
64
64
  "devDependencies": {
65
- "siesta-lite": "^5.5.2",
65
+ "siesta-lite": "5.5.2",
66
66
  "url": "^0.11.0"
67
67
  },
68
68
  "funding": {
package/src/Xhr.mjs CHANGED
@@ -24,7 +24,8 @@ class Xhr extends XhrConnection {
24
24
  remote: {
25
25
  app: [
26
26
  'promiseJson',
27
- 'promiseRequest'
27
+ 'promiseRequest',
28
+ 'setDefaultHeaders'
28
29
  ]
29
30
  },
30
31
  /**
@@ -99,6 +99,15 @@ class Application extends Base {
99
99
 
100
100
  return null;
101
101
  }
102
+
103
+ /**
104
+ * Unregister the app from the CSS map
105
+ * @param args
106
+ */
107
+ destroy(...args) {
108
+ Neo.currentWorker.removeAppFromThemeMap(this.name);
109
+ super.destroy(...args);
110
+ }
102
111
  }
103
112
 
104
113
  Neo.applyClassConfig(Application);
@@ -270,6 +270,11 @@ class RecordFactory extends Base {
270
270
  return new Date(value);
271
271
  }
272
272
 
273
+ if (type === 'string' && value !== null) {
274
+ value = value + '';
275
+ value = value.replace(/(<([^>]+)>)/ig, '');
276
+ }
277
+
273
278
  return value;
274
279
  }
275
280
 
@@ -217,6 +217,15 @@ class Xhr extends Base {
217
217
 
218
218
  return this.request(opts);
219
219
  }
220
+
221
+ /**
222
+ * Needed for remote method access
223
+ *
224
+ * @param {Object} value
225
+ */
226
+ setDefaultHeaders(value) {
227
+ this.defaultHeaders = value;
228
+ }
220
229
  }
221
230
 
222
231
  Neo.applyClassConfig(Xhr);
@@ -149,14 +149,16 @@ class DragDrop extends Base {
149
149
 
150
150
  me.addGlobalEventListeners();
151
151
 
152
+ if (Neo.config.hasMouseEvents) {
153
+ imports.push(import('../draggable/sensor/Mouse.mjs'));
154
+ }
155
+
152
156
  if (Neo.config.hasTouchEvents) {
153
157
  imports.push(import('../draggable/sensor/Touch.mjs'));
154
- } else {
155
- imports.push(import('../draggable/sensor/Mouse.mjs'));
156
158
  }
157
159
 
158
160
  Promise.all(imports).then(modules => {
159
- // create the Touch or MouseSensor
161
+ // create the Mouse- and / or TouchSensor
160
162
  Neo.create({
161
163
  module: modules[0].default
162
164
  });
@@ -270,6 +270,15 @@ class App extends Base {
270
270
  });
271
271
  }
272
272
 
273
+ /**
274
+ * Unregister the app from the CSS map
275
+ * Only needed for SharedWorkers
276
+ * @param {String} appName
277
+ */
278
+ removeAppFromThemeMap(appName) {
279
+ delete Neo.cssMap[appName.toLowerCase()];
280
+ }
281
+
273
282
  /**
274
283
  * @private
275
284
  */
@@ -204,6 +204,7 @@ class Manager extends Base {
204
204
  detectFeatures() {
205
205
  let me = this;
206
206
 
207
+ NeoConfig.hasMouseEvents = matchMedia('(pointer:fine)').matches;
207
208
  NeoConfig.hasTouchEvents = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0);
208
209
 
209
210
  if (window.Worker) {