neo.mjs 9.11.0 → 9.12.0
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.
- package/ServiceWorker.mjs +2 -2
- package/apps/portal/index.html +1 -1
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/docs/app/view/ApiTreeList.mjs +11 -1
- package/docs/app/view/MainContainer.mjs +7 -4
- package/package.json +3 -3
- package/src/DefaultConfig.mjs +2 -2
- package/src/code/LivePreview.mjs +19 -8
- package/src/data/Store.mjs +25 -16
- package/src/tab/Strip.mjs +12 -5
package/ServiceWorker.mjs
CHANGED
package/apps/portal/index.html
CHANGED
@@ -29,7 +29,17 @@ class ApiTreeList extends TreeList {
|
|
29
29
|
*/
|
30
30
|
onConstructed() {
|
31
31
|
super.onConstructed();
|
32
|
-
|
32
|
+
|
33
|
+
this.store.load().then(data => {
|
34
|
+
if (!data) {
|
35
|
+
this.html = [
|
36
|
+
'<div style="padding: 1em">',
|
37
|
+
'To get the content please use:</br>',
|
38
|
+
'<code>npm run generate-docs-json</code>',
|
39
|
+
'</div>'
|
40
|
+
].join('')
|
41
|
+
}
|
42
|
+
})
|
33
43
|
}
|
34
44
|
}
|
35
45
|
|
@@ -127,12 +127,15 @@ class MainContainer extends Viewport {
|
|
127
127
|
onConstructed() {
|
128
128
|
super.onConstructed();
|
129
129
|
|
130
|
-
let me
|
130
|
+
let me = this,
|
131
|
+
url = '../../docs/output/all.json';
|
131
132
|
|
132
|
-
Neo.Xhr.promiseJson({
|
133
|
-
|
133
|
+
Neo.Xhr.promiseJson({url}).catch(err => {
|
134
|
+
console.error('Error for Neo.Xhr.request', {id: me.store.id, error: err, url})
|
134
135
|
}).then(data => {
|
135
|
-
|
136
|
+
if (data) {
|
137
|
+
me.store.items = data.json
|
138
|
+
}
|
136
139
|
})
|
137
140
|
}
|
138
141
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name" : "neo.mjs",
|
3
|
-
"version" : "9.
|
3
|
+
"version" : "9.12.0",
|
4
4
|
"description" : "The webworkers driven UI framework",
|
5
5
|
"type" : "module",
|
6
6
|
"repository" : {
|
@@ -64,9 +64,9 @@
|
|
64
64
|
"neo-jsdoc" : "1.0.1",
|
65
65
|
"neo-jsdoc-x" : "1.0.5",
|
66
66
|
"postcss" : "^8.5.4",
|
67
|
-
"sass" : "^1.89.
|
67
|
+
"sass" : "^1.89.2",
|
68
68
|
"siesta-lite" : "5.5.2",
|
69
|
-
"terser" : "^5.
|
69
|
+
"terser" : "^5.42.0",
|
70
70
|
"url" : "^0.11.4",
|
71
71
|
"webpack" : "^5.99.9",
|
72
72
|
"webpack-cli" : "^6.0.1",
|
package/src/DefaultConfig.mjs
CHANGED
@@ -264,12 +264,12 @@ const DefaultConfig = {
|
|
264
264
|
useVdomWorker: true,
|
265
265
|
/**
|
266
266
|
* buildScripts/injectPackageVersion.mjs will update this value
|
267
|
-
* @default '9.
|
267
|
+
* @default '9.12.0'
|
268
268
|
* @memberOf! module:Neo
|
269
269
|
* @name config.version
|
270
270
|
* @type String
|
271
271
|
*/
|
272
|
-
version: '9.
|
272
|
+
version: '9.12.0'
|
273
273
|
};
|
274
274
|
|
275
275
|
Object.assign(DefaultConfig, {
|
package/src/code/LivePreview.mjs
CHANGED
@@ -223,9 +223,8 @@ class LivePreview extends Container {
|
|
223
223
|
}
|
224
224
|
|
225
225
|
let me = this,
|
226
|
-
{
|
226
|
+
{environment} = Neo.config,
|
227
227
|
container = me.getPreviewContainer(),
|
228
|
-
hasJsModules = config.environment === 'development' || config.environment === 'dist/esm',
|
229
228
|
source = me.editorValue || me.value,
|
230
229
|
className = me.findLastClassName(source),
|
231
230
|
cleanLines = [],
|
@@ -242,13 +241,25 @@ class LivePreview extends Container {
|
|
242
241
|
path = importMatch[2],
|
243
242
|
index;
|
244
243
|
|
245
|
-
|
244
|
+
// We want the non-minified version for code which can not get bundled.
|
245
|
+
if (environment === 'dist/development') {
|
246
246
|
index = path.lastIndexOf('../');
|
247
247
|
|
248
248
|
if (index === 0) {
|
249
|
-
path = '../../../../src/' + path.slice(index + 3)
|
249
|
+
path = '../../../../src/' + path.slice(index + 3)
|
250
250
|
} else {
|
251
|
-
path = path.slice(0, index) + '../../../' + path.slice(index + 3)
|
251
|
+
path = path.slice(0, index) + '../../../' + path.slice(index + 3)
|
252
|
+
}
|
253
|
+
}
|
254
|
+
|
255
|
+
// We want the minified version of the code which can not get bundled.
|
256
|
+
else if (environment === 'dist/production') {
|
257
|
+
index = path.lastIndexOf('../');
|
258
|
+
|
259
|
+
if (index === 0) {
|
260
|
+
path = '../../../esm/src/' + path.slice(index + 3)
|
261
|
+
} else {
|
262
|
+
path = path.slice(0, index) + '../../esm/' + path.slice(index + 3)
|
252
263
|
}
|
253
264
|
}
|
254
265
|
|
@@ -261,9 +272,9 @@ class LivePreview extends Container {
|
|
261
272
|
});
|
262
273
|
|
263
274
|
// Figure out the parts of the source we'll be running.
|
264
|
-
//
|
265
|
-
//
|
266
|
-
//
|
275
|
+
// * The promises/import() corresponding to the user's import statements
|
276
|
+
// * The vars holding the name of the imported module based on the module name for each import
|
277
|
+
// * The rest of the user-provided source
|
267
278
|
// It'll end up looking like this:
|
268
279
|
// Promise.all([
|
269
280
|
// import('../../../node_modules/neo.mjs/src/container/Base.mjs'),
|
package/src/data/Store.mjs
CHANGED
@@ -351,9 +351,10 @@ class Store extends Base {
|
|
351
351
|
* @param {String} opts.responseType
|
352
352
|
* @param {Object} opts.scope
|
353
353
|
* @param {String} opts.url
|
354
|
+
* @returns {Promise<Object|Object[]>}
|
354
355
|
* @protected
|
355
356
|
*/
|
356
|
-
load(opts={}) {
|
357
|
+
async load(opts={}) {
|
357
358
|
let me = this,
|
358
359
|
params = {page: me.currentPage, pageSize: me.pageSize, ...opts.params};
|
359
360
|
|
@@ -371,26 +372,34 @@ class Store extends Base {
|
|
371
372
|
service = Neo.ns(apiArray.join('.'));
|
372
373
|
|
373
374
|
if (!service) {
|
374
|
-
console.
|
375
|
+
console.error('Api is not defined', this)
|
375
376
|
} else {
|
376
|
-
service[fn](params)
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
}
|
377
|
+
const response = await service[fn](params);
|
378
|
+
|
379
|
+
if (response.success) {
|
380
|
+
me.totalCount = response.totalCount;
|
381
|
+
me.data = Neo.ns(me.responseRoot, false, response); // fires the load event
|
382
|
+
|
383
|
+
return me.data
|
384
|
+
}
|
385
|
+
|
386
|
+
return null
|
384
387
|
}
|
385
388
|
} else {
|
386
389
|
opts.url ??= me.url;
|
387
390
|
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
391
|
+
try {
|
392
|
+
const data = await Neo.Xhr.promiseJson(opts);
|
393
|
+
|
394
|
+
if (data) {
|
395
|
+
me.data = Neo.ns(me.responseRoot, false, data.json) || data.json // fires the load event
|
396
|
+
}
|
397
|
+
|
398
|
+
return data?.json || null
|
399
|
+
} catch(err) {
|
400
|
+
console.error('Error for Neo.Xhr.request', {id: me.id, error: err, url: opts.url});
|
401
|
+
return null
|
402
|
+
}
|
394
403
|
}
|
395
404
|
}
|
396
405
|
|
package/src/tab/Strip.mjs
CHANGED
@@ -57,15 +57,22 @@ class Strip extends Component {
|
|
57
57
|
getActiveTabRectThenMove(opts) {
|
58
58
|
let me = this,
|
59
59
|
ids = [me.id],
|
60
|
-
tabContainer = me.getTabContainer()
|
60
|
+
tabContainer = me.getTabContainer(),
|
61
|
+
oldTab;
|
61
62
|
|
62
63
|
// We do not need a movement, in case there is no oldValue
|
63
64
|
if (me.useActiveTabIndicator && me.vnode && Neo.isNumber(opts?.oldValue)) {
|
64
|
-
|
65
|
+
oldTab = tabContainer.getTabAtIndex(opts.oldValue);
|
65
66
|
|
66
|
-
|
67
|
-
|
68
|
-
|
67
|
+
// The activeIndexChange event can get triggered when removing the currently active tab,
|
68
|
+
// In this case, we can no longer access the related DOMRect and need to opt out.
|
69
|
+
if (oldTab) {
|
70
|
+
ids.push(tabContainer.getTabAtIndex(opts.value).id, oldTab.id);
|
71
|
+
|
72
|
+
me.getDomRect(ids).then(data => {
|
73
|
+
me.moveActiveIndicator(data)
|
74
|
+
})
|
75
|
+
}
|
69
76
|
}
|
70
77
|
}
|
71
78
|
|