neo.mjs 6.15.0 → 6.15.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.
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/portal/model/ContentSection.mjs +3 -0
- package/apps/portal/view/learn/ContentView.mjs +19 -12
- package/apps/portal/view/learn/MainContainerController.mjs +30 -26
- package/apps/portal/view/learn/MainContainerModel.mjs +1 -24
- package/apps/portal/view/learn/PageContainer.mjs +4 -8
- package/apps/portal/view/learn/PageSectionsList.mjs +80 -0
- package/apps/portal/view/learn/PageSectionsPanel.mjs +13 -48
- package/apps/website/neo-config.json +1 -1
- package/docs/app/view/classdetails/MembersList.mjs +1 -0
- package/docs/app/view/classdetails/SourceViewComponent.mjs +1 -1
- package/docs/resources/highlightjs-custom-dark-theme.css +2 -2
- package/docs/resources/highlightjs-custom-github-theme.css +2 -2
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/calendar/basic/neo-config.json +4 -5
- package/examples/calendar/weekview/neo-config.json +4 -5
- package/examples/component/timer/neo-config.json +4 -5
- package/examples/component/toast/MainContainerController.mjs +1 -0
- package/examples/component/toast/neo-config.json +1 -1
- package/examples/component/video/neo-config.json +4 -5
- package/examples/core/config/neo-config.json +5 -6
- package/examples/grid/container/neo-config.json +4 -5
- package/examples/grid/covid/neo-config.json +5 -6
- package/examples/list/animate/neo-config.json +4 -5
- package/examples/list/color/neo-config.json +4 -5
- package/examples/menu/list/neo-config.json +4 -5
- package/examples/menu/panel/neo-config.json +4 -5
- package/examples/model/advanced/neo-config.json +5 -6
- package/examples/model/extendedClass/neo-config.json +5 -6
- package/examples/model/inline/neo-config.json +5 -6
- package/examples/model/inlineNoModel/neo-config.json +5 -6
- package/examples/model/nestedData/neo-config.json +5 -6
- package/examples/model/table/neo-config.json +5 -6
- package/examples/panel/MainContainer.mjs +1 -2
- package/examples/panel/neo-config.json +5 -6
- package/examples/popover/neo-config.json +6 -10
- package/examples/table/container/neo-config.json +4 -5
- package/examples/table/covid/neo-config.json +5 -6
- package/examples/tableFiltering/neo-config.json +4 -5
- package/examples/tablePerformance/neo-config.json +5 -6
- package/examples/tableStore/neo-config.json +4 -5
- package/examples/tabs/neo-config.json +5 -6
- package/examples/todoList/version1/neo-config.json +5 -6
- package/examples/todoList/version2/neo-config.json +5 -6
- package/package.json +6 -6
- package/resources/data/deck/learnneo/pages/Earthquakes.md +1 -1
- package/resources/scss/src/apps/portal/learn/PageSectionsList.scss +12 -0
- package/resources/scss/src/apps/portal/learn/PageSectionsPanel.scss +13 -5
- package/resources/scss/theme-neo-light/Global.scss +0 -19
- package/resources/scss/theme-neo-light/component/Splitter.scss +18 -1
- package/src/DefaultConfig.mjs +2 -2
- package/src/list/Base.mjs +7 -0
- package/src/main/DomEvents.mjs +1 -1
- package/src/worker/Base.mjs +8 -6
package/apps/ServiceWorker.mjs
CHANGED
@@ -4,7 +4,9 @@ import {marked} from '../../../../node_modules/marked/lib/marked.esm.js';
|
|
4
4
|
|
5
5
|
const
|
6
6
|
labCloseRegex = /<!--\s*\/lab\s*-->/g,
|
7
|
-
labOpenRegex = /<!--\s*lab\s*-->/g
|
7
|
+
labOpenRegex = /<!--\s*lab\s*-->/g,
|
8
|
+
preJsRegex = /<pre\s+data-javascript\s*>([\s\S]*?)<\/pre>/g,
|
9
|
+
preNeoRegex = /<pre\s+data-neo\s*>([\s\S]*?)<\/pre>/g;
|
8
10
|
|
9
11
|
/**
|
10
12
|
* @class Portal.view.learn.ContentView
|
@@ -147,13 +149,10 @@ class ContentView extends Component {
|
|
147
149
|
// 1. Replace <pre data-neo> with <div id='neo-preview-2'/>
|
148
150
|
// and update map with key/value pairs, where the key is the ID and the value is the <pre> contents.
|
149
151
|
|
150
|
-
// Define a regular expression to match <pre data-javascript> tags
|
151
|
-
const preRegex = /<pre\s+data-neo\s*>([\s\S]*?)<\/pre>/g;
|
152
|
-
|
153
152
|
let count = 0;
|
154
153
|
|
155
154
|
// Replace the content with tokens, and create a promise to update the corresponding content
|
156
|
-
return htmlString.replace(
|
155
|
+
return htmlString.replace(preNeoRegex, (match, preContent) => {
|
157
156
|
const key = `pre-live-preview-${Neo.core.IdGenerator.getId()}-${count++}`;
|
158
157
|
map[key] = preContent;
|
159
158
|
return `<div id="${key}"></div>`
|
@@ -182,15 +181,12 @@ class ContentView extends Component {
|
|
182
181
|
|
183
182
|
// Note that if we were to import HighlightJS directly, we wouldn't need all this async code.
|
184
183
|
|
185
|
-
// Define a regular expression to match <pre data-javascript> tags
|
186
|
-
const preRegex = /<pre\s+data-javascript\s*>([\s\S]*?)<\/pre>/g;
|
187
|
-
|
188
184
|
// Create an array to store promises for each replacement
|
189
185
|
const replacementPromises = [];
|
190
186
|
let count = 0;
|
191
187
|
|
192
188
|
// Replace the content with tokens, and create a promise to update the corresponding content
|
193
|
-
let updatedHtml = htmlString.replace(
|
189
|
+
let updatedHtml = htmlString.replace(preJsRegex, (match, preContent) => {
|
194
190
|
const token = `__NEO-PRE-TOKEN-${++count}__`;
|
195
191
|
replacementPromises.push(this.getHighlightPromise(preContent, token, `pre-preview-${Neo.core.IdGenerator.getId()}`));
|
196
192
|
return token
|
@@ -247,15 +243,26 @@ class ContentView extends Component {
|
|
247
243
|
let me = this,
|
248
244
|
contentArray = content.split('\n'),
|
249
245
|
i = 1,
|
250
|
-
storeData = []
|
246
|
+
storeData = [],
|
247
|
+
tag;
|
251
248
|
|
252
249
|
contentArray.forEach((line, index) => {
|
250
|
+
tag = null;
|
251
|
+
|
253
252
|
if (line.startsWith('##') && line.charAt(2) !== '#') {
|
254
253
|
line = line.substring(2).trim();
|
254
|
+
tag = 'h2';
|
255
|
+
}
|
256
|
+
|
257
|
+
else if (line.startsWith('###') && line.charAt(3) !== '#') {
|
258
|
+
line = line.substring(3).trim();
|
259
|
+
tag = 'h3';
|
260
|
+
}
|
255
261
|
|
256
|
-
|
262
|
+
if (tag) {
|
263
|
+
storeData.push({id: i, name: line, sourceId: me.id, tag});
|
257
264
|
|
258
|
-
contentArray[index] =
|
265
|
+
contentArray[index] = `<${tag} class="neo-${tag}" data-record-id="${i}">${line}</${tag}>`;
|
259
266
|
|
260
267
|
i++
|
261
268
|
}
|
@@ -67,12 +67,13 @@ class MainContainerController extends Controller {
|
|
67
67
|
/**
|
68
68
|
* @param {Object} data
|
69
69
|
* @param {String} data.appName
|
70
|
+
* @param {Number} data.windowId
|
70
71
|
*/
|
71
72
|
async onAppConnect(data) {
|
72
73
|
let me = this,
|
73
74
|
app = Neo.apps[data.appName],
|
74
75
|
mainView = app.mainView,
|
75
|
-
windowId
|
76
|
+
{windowId} = data,
|
76
77
|
searchString = await Neo.Main.getByPath({path: 'location.search', windowId}),
|
77
78
|
livePreviewId = me.decodeUri(searchString.substring(1)).id,
|
78
79
|
livePreview = Neo.getComponent(livePreviewId),
|
@@ -91,32 +92,35 @@ class MainContainerController extends Controller {
|
|
91
92
|
/**
|
92
93
|
* @param {Object} data
|
93
94
|
* @param {String} data.appName
|
95
|
+
* @param {Number} data.windowId
|
94
96
|
*/
|
95
97
|
async onAppDisconnect(data) {
|
96
|
-
let me
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
98
|
+
let me = this,
|
99
|
+
{appName, windowId} = data,
|
100
|
+
app = Neo.apps[appName],
|
101
|
+
mainView = app.mainView;
|
102
|
+
|
103
|
+
// Closing a code preview window needs to drop the preview back into the related main app
|
104
|
+
if (appName !== 'Portal') {
|
105
|
+
let searchString = await Neo.Main.getByPath({path: 'location.search', windowId}),
|
106
|
+
livePreviewId = me.decodeUri(searchString.substring(1)).id,
|
107
|
+
livePreview = Neo.getComponent(livePreviewId),
|
108
|
+
sourceContainer = livePreview.getReference('preview'),
|
109
|
+
tabContainer = livePreview.tabContainer,
|
110
|
+
sourceView = mainView.removeAt(0, false);
|
111
|
+
|
112
|
+
livePreview.previewContainer = null;
|
113
|
+
sourceContainer.add(sourceView);
|
114
|
+
|
115
|
+
tabContainer.activeIndex = 1; // switch to the source view
|
116
|
+
|
117
|
+
livePreview.getReference('popout-window-button').disabled = false;
|
118
|
+
tabContainer.getTabAtIndex(1).disabled = false
|
119
|
+
}
|
120
|
+
// Close popup windows when closing or reloading the main window
|
121
|
+
else {
|
122
|
+
Neo.Main.windowClose({names: me.connectedApps, windowId})
|
123
|
+
}
|
120
124
|
}
|
121
125
|
|
122
126
|
/**
|
@@ -184,7 +188,7 @@ class MainContainerController extends Controller {
|
|
184
188
|
list = panel.list,
|
185
189
|
recordId = parseInt(data.data.recordId);
|
186
190
|
|
187
|
-
if (!
|
191
|
+
if (!list.isAnimating) {
|
188
192
|
list.selectionModel.select(list.store.get(recordId))
|
189
193
|
}
|
190
194
|
}
|
@@ -47,12 +47,7 @@ class MainContainerModel extends Component {
|
|
47
47
|
* The record which gets shown as the content page
|
48
48
|
* @member {Object} data.previousPageRecord=null
|
49
49
|
*/
|
50
|
-
previousPageRecord: null
|
51
|
-
/**
|
52
|
-
* Merging the direct parent text
|
53
|
-
* @member {String|null} data.previousPageText=null
|
54
|
-
*/
|
55
|
-
previousPageText: null
|
50
|
+
previousPageRecord: null
|
56
51
|
},
|
57
52
|
/**
|
58
53
|
* @member {Object} stores
|
@@ -67,22 +62,6 @@ class MainContainerModel extends Component {
|
|
67
62
|
}
|
68
63
|
}
|
69
64
|
|
70
|
-
/**
|
71
|
-
* Combines the record parent node name (if available) with the record name
|
72
|
-
* @param {Object} record
|
73
|
-
* @param {Neo.data.Store} store
|
74
|
-
* @returns {String|null}
|
75
|
-
*/
|
76
|
-
getRecordTreeName(record, store) {
|
77
|
-
let parentText = record.name;
|
78
|
-
|
79
|
-
if (record.parentId !== null) {
|
80
|
-
parentText = store.get(record.parentId).name + ': ' + parentText
|
81
|
-
}
|
82
|
-
|
83
|
-
return parentText
|
84
|
-
}
|
85
|
-
|
86
65
|
/**
|
87
66
|
* @param {String} key
|
88
67
|
* @param {*} value
|
@@ -111,7 +90,6 @@ class MainContainerModel extends Component {
|
|
111
90
|
|
112
91
|
if (record.isLeaf && !me.recordIsHidden(record, store)) {
|
113
92
|
previousPageRecord = record;
|
114
|
-
previousPageText = me.getRecordTreeName(record, store);
|
115
93
|
break
|
116
94
|
}
|
117
95
|
}
|
@@ -124,7 +102,6 @@ class MainContainerModel extends Component {
|
|
124
102
|
|
125
103
|
if (record.isLeaf && !me.recordIsHidden(record, store)) {
|
126
104
|
nextPageRecord = record;
|
127
|
-
nextPageText = me.getRecordTreeName(record, store);
|
128
105
|
break
|
129
106
|
}
|
130
107
|
}
|
@@ -89,12 +89,10 @@ class PageContainer extends Container {
|
|
89
89
|
*/
|
90
90
|
afterSetNextPageRecord(value, oldValue) {
|
91
91
|
if (oldValue !== undefined) {
|
92
|
-
let me = this;
|
93
|
-
|
94
92
|
if (value) {
|
95
|
-
|
93
|
+
this.nextPageButton.set({hidden: false, text: value.name})
|
96
94
|
} else {
|
97
|
-
|
95
|
+
this.nextPageButton.hidden = true
|
98
96
|
}
|
99
97
|
}
|
100
98
|
}
|
@@ -106,12 +104,10 @@ class PageContainer extends Container {
|
|
106
104
|
*/
|
107
105
|
afterSetPreviousPageRecord(value, oldValue) {
|
108
106
|
if (oldValue !== undefined) {
|
109
|
-
let me = this;
|
110
|
-
|
111
107
|
if (value) {
|
112
|
-
|
108
|
+
this.prevPageButton.set({hidden: false, text: value.name})
|
113
109
|
} else {
|
114
|
-
|
110
|
+
this.prevPageButton.hidden = true
|
115
111
|
}
|
116
112
|
}
|
117
113
|
}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
import List from '../../../../src/list/Base.mjs';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @class Portal.view.learn.PageSectionsList
|
5
|
+
* @extends Neo.list.Base
|
6
|
+
*/
|
7
|
+
class PageSectionsList extends List {
|
8
|
+
static config = {
|
9
|
+
/**
|
10
|
+
* @member {String} className='Portal.view.learn.PageSectionsList'
|
11
|
+
* @protected
|
12
|
+
*/
|
13
|
+
className: 'Portal.view.learn.PageSectionsList',
|
14
|
+
/**
|
15
|
+
* @member {Object} bind
|
16
|
+
*/
|
17
|
+
bind: {
|
18
|
+
store: 'stores.contentSections'
|
19
|
+
},
|
20
|
+
/**
|
21
|
+
* @member {String[]} cls=['portal-page-sections-list','topics-tree']
|
22
|
+
*/
|
23
|
+
cls: ['portal-page-sections-list', 'topics-tree']
|
24
|
+
}
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Internal flag to indicate that node.scrollIntoView() is running with an animation
|
28
|
+
* @member {Boolean} isAnimating=false
|
29
|
+
*/
|
30
|
+
isAnimating = false
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @param {Object} record
|
34
|
+
* @param {Number} index
|
35
|
+
* @returns {Object|Object[]|String} Either a config object to assign to the item, a vdom cn array or a html string
|
36
|
+
*/
|
37
|
+
createItemContent(record, index) {
|
38
|
+
return {
|
39
|
+
cls : `neo-${record.tag}`,
|
40
|
+
html: record[this.displayField]
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
/**
|
45
|
+
*
|
46
|
+
*/
|
47
|
+
onConstructed() {
|
48
|
+
super.onConstructed();
|
49
|
+
|
50
|
+
let me = this;
|
51
|
+
|
52
|
+
me.on('itemClick', me.onSelectionChange, me)
|
53
|
+
}
|
54
|
+
|
55
|
+
/**
|
56
|
+
* @param {Object} data
|
57
|
+
*/
|
58
|
+
async onSelectionChange(data) {
|
59
|
+
let me = this,
|
60
|
+
record = data.record;
|
61
|
+
|
62
|
+
if (record) {
|
63
|
+
me.isAnimating = true;
|
64
|
+
|
65
|
+
await Neo.main.DomAccess.scrollIntoView({
|
66
|
+
querySelector: `[data-record-id='${record.id}']`,
|
67
|
+
windowId : me.windowId
|
68
|
+
});
|
69
|
+
|
70
|
+
// better safe than sorry
|
71
|
+
await me.timeout(200);
|
72
|
+
|
73
|
+
me.isAnimating = false
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
Neo.setupClass(PageSectionsList);
|
79
|
+
|
80
|
+
export default PageSectionsList;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import
|
2
|
-
import Panel
|
1
|
+
import PageSectionsList from './PageSectionsList.mjs';
|
2
|
+
import Panel from '../../../../src/container/Panel.mjs';
|
3
3
|
|
4
4
|
/**
|
5
5
|
* @class Portal.view.learn.PageSectionsPanel
|
@@ -20,67 +20,32 @@ class PageSectionsPanel extends Panel {
|
|
20
20
|
* @member {Object[]} headers
|
21
21
|
*/
|
22
22
|
headers: [{
|
23
|
-
dock: 'top',
|
24
|
-
|
23
|
+
dock : 'top',
|
24
|
+
items: [{
|
25
|
+
ntype: 'label',
|
26
|
+
text : 'On this page'
|
27
|
+
}, '->', {
|
28
|
+
iconCls: 'fas fa-chevron-right',
|
29
|
+
ui : 'secondary',
|
30
|
+
tooltip: 'Collapse Sections'
|
31
|
+
}]
|
25
32
|
}],
|
26
33
|
/**
|
27
34
|
* @member {Object[]} items
|
28
35
|
*/
|
29
36
|
items: [{
|
30
|
-
module :
|
31
|
-
bind : {store: 'stores.contentSections'},
|
32
|
-
cls : ['topics-tree'],
|
37
|
+
module : PageSectionsList,
|
33
38
|
reference: 'list'
|
34
39
|
}]
|
35
40
|
}
|
36
41
|
|
37
|
-
/**
|
38
|
-
* Internal flag to indicate that node.scrollIntoView() is running with an animation
|
39
|
-
* @member {Boolean} isAnimating=false
|
40
|
-
*/
|
41
|
-
isAnimating = false
|
42
|
-
|
43
42
|
/**
|
44
43
|
* Convenience shortcut
|
45
|
-
* @member {
|
44
|
+
* @member {Portal.view.learn.PageSectionsList} list
|
46
45
|
*/
|
47
46
|
get list() {
|
48
47
|
return this.getReference('list')
|
49
48
|
}
|
50
|
-
|
51
|
-
/**
|
52
|
-
*
|
53
|
-
*/
|
54
|
-
onConstructed() {
|
55
|
-
super.onConstructed();
|
56
|
-
|
57
|
-
let me = this;
|
58
|
-
|
59
|
-
// me.getReference('list').on('selectionChange', me.onSelectionChange, me) // todo
|
60
|
-
me.getReference('list').on('itemClick', me.onSelectionChange, me)
|
61
|
-
}
|
62
|
-
|
63
|
-
/**
|
64
|
-
* @param {Object} data
|
65
|
-
*/
|
66
|
-
async onSelectionChange(data) {
|
67
|
-
let me = this,
|
68
|
-
record = data.record;
|
69
|
-
|
70
|
-
if (record) {
|
71
|
-
me.isAnimating = true;
|
72
|
-
|
73
|
-
await Neo.main.DomAccess.scrollIntoView({
|
74
|
-
querySelector: `[data-record-id='${record.id}']`,
|
75
|
-
windowId : me.windowId
|
76
|
-
});
|
77
|
-
|
78
|
-
// better safe than sorry
|
79
|
-
await me.timeout(200);
|
80
|
-
|
81
|
-
me.isAnimating = false
|
82
|
-
}
|
83
|
-
}
|
84
49
|
}
|
85
50
|
|
86
51
|
Neo.setupClass(PageSectionsPanel);
|
@@ -14,7 +14,7 @@ pre.hljs {
|
|
14
14
|
display : block;
|
15
15
|
font-size : 12px;
|
16
16
|
overflow-x: auto;
|
17
|
-
padding : 0
|
17
|
+
padding : 0;
|
18
18
|
}
|
19
19
|
|
20
20
|
.hljs-comment,
|
@@ -133,4 +133,4 @@ pre.hljs {
|
|
133
133
|
|
134
134
|
.neo-highlighted-line {
|
135
135
|
background-color: #cee8fc !important;
|
136
|
-
}
|
136
|
+
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"mainThreadAddons": ["DragDrop", "Stylesheet"]
|
2
|
+
"appPath" : "examples/calendar/basic/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs"
|
7
6
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"mainThreadAddons": ["DragDrop", "Stylesheet"]
|
2
|
+
"appPath" : "examples/calendar/weekview/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs"
|
7
6
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"mainThreadAddons": ["Stylesheet"]
|
2
|
+
"appPath" : "examples/component/timer/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs"
|
7
6
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"mainThreadAddons": ["Stylesheet"]
|
2
|
+
"appPath" : "examples/component/video/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs"
|
7
6
|
}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"
|
7
|
-
"themes" : ["neo-theme-dark"]
|
2
|
+
"appPath" : "examples/core/config/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs",
|
6
|
+
"themes" : ["neo-theme-dark"]
|
8
7
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"mainThreadAddons": ["Stylesheet"]
|
2
|
+
"appPath" : "examples/grid/container/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs"
|
7
6
|
}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"
|
7
|
-
"themes" : ["neo-theme-dark", "neo-theme-light"]
|
2
|
+
"appPath" : "examples/grid/covid/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs",
|
6
|
+
"themes" : ["neo-theme-dark", "neo-theme-light"]
|
8
7
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"mainThreadAddons": ["Stylesheet"]
|
2
|
+
"appPath" : "examples/list/animate/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs"
|
7
6
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"mainThreadAddons": ["Stylesheet"]
|
2
|
+
"appPath" : "examples/list/color/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs"
|
7
6
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"mainThreadAddons": ["Stylesheet"]
|
2
|
+
"appPath" : "examples/menu/list/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs"
|
7
6
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"mainThreadAddons": ["Stylesheet"]
|
2
|
+
"appPath" : "examples/menu/panel/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs"
|
7
6
|
}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"
|
7
|
-
"themes" : ["neo-theme-dark"]
|
2
|
+
"appPath" : "examples/model/advanced/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs",
|
6
|
+
"themes" : ["neo-theme-dark"]
|
8
7
|
}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"
|
7
|
-
"themes" : ["neo-theme-dark"]
|
2
|
+
"appPath" : "examples/model/extendedClass/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs",
|
6
|
+
"themes" : ["neo-theme-dark"]
|
8
7
|
}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"
|
7
|
-
"themes" : ["neo-theme-dark"]
|
2
|
+
"appPath" : "examples/model/inline/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs",
|
6
|
+
"themes" : ["neo-theme-dark"]
|
8
7
|
}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"
|
7
|
-
"themes" : ["neo-theme-dark"]
|
2
|
+
"appPath" : "examples/model/inlineNoModel/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs",
|
6
|
+
"themes" : ["neo-theme-dark"]
|
8
7
|
}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"
|
7
|
-
"themes" : ["neo-theme-dark"]
|
2
|
+
"appPath" : "examples/model/nestedData/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs",
|
6
|
+
"themes" : ["neo-theme-dark"]
|
8
7
|
}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"
|
7
|
-
"themes" : ["neo-theme-dark"]
|
2
|
+
"appPath" : "examples/model/table/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs",
|
6
|
+
"themes" : ["neo-theme-dark"]
|
8
7
|
}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"
|
7
|
-
"themes" : ["neo-theme-dark"]
|
2
|
+
"appPath" : "examples/panel/app.mjs",
|
3
|
+
"basePath" : "../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs",
|
6
|
+
"themes" : ["neo-theme-dark"]
|
8
7
|
}
|
@@ -1,12 +1,8 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment": "development",
|
5
|
-
"mainPath"
|
6
|
-
"
|
7
|
-
"
|
8
|
-
"DragDrop",
|
9
|
-
"Stylesheet",
|
10
|
-
"Popover"
|
11
|
-
]
|
2
|
+
"appPath" : "examples/popover/app.mjs",
|
3
|
+
"basePath" : "../../",
|
4
|
+
"environment" : "development",
|
5
|
+
"mainPath" : "./Main.mjs",
|
6
|
+
"mainThreadAddons": ["DragDrop", "Navigator", "Popover", "Stylesheet"],
|
7
|
+
"themes" : ["neo-theme-dark", "neo-theme-light"]
|
12
8
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"mainThreadAddons": ["Stylesheet"]
|
2
|
+
"appPath" : "examples/table/container/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs"
|
7
6
|
}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"
|
7
|
-
"themes" : ["neo-theme-dark", "neo-theme-light"]
|
2
|
+
"appPath" : "examples/table/covid/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs",
|
6
|
+
"themes" : ["neo-theme-dark", "neo-theme-light"]
|
8
7
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"mainThreadAddons": ["Stylesheet"]
|
2
|
+
"appPath" : "examples/tableFiltering/app.mjs",
|
3
|
+
"basePath" : "../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs"
|
7
6
|
}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"
|
7
|
-
"themes" : ["neo-theme-dark", "neo-theme-light"]
|
2
|
+
"appPath" : "examples/tablePerformance/app.mjs",
|
3
|
+
"basePath" : "../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs",
|
6
|
+
"themes" : ["neo-theme-dark", "neo-theme-light"]
|
8
7
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"mainThreadAddons": ["Stylesheet"]
|
2
|
+
"appPath" : "examples/tableStore/app.mjs",
|
3
|
+
"basePath" : "../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs"
|
7
6
|
}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"
|
7
|
-
"themes" : ["neo-theme-dark"]
|
2
|
+
"appPath" : "examples/tabs/app.mjs",
|
3
|
+
"basePath" : "../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs",
|
6
|
+
"themes" : ["neo-theme-dark"]
|
8
7
|
}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"
|
7
|
-
"themes" : ["neo-theme-light"]
|
2
|
+
"appPath" : "examples/todoList/version1/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs",
|
6
|
+
"themes" : ["neo-theme-light"]
|
8
7
|
}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"appPath"
|
3
|
-
"basePath"
|
4
|
-
"environment"
|
5
|
-
"mainPath"
|
6
|
-
"
|
7
|
-
"themes" : ["neo-theme-light"]
|
2
|
+
"appPath" : "examples/todoList/version2/app.mjs",
|
3
|
+
"basePath" : "../../../",
|
4
|
+
"environment": "development",
|
5
|
+
"mainPath" : "./Main.mjs",
|
6
|
+
"themes" : ["neo-theme-light"]
|
8
7
|
}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
{
|
3
3
|
"name": "neo.mjs",
|
4
|
-
"version": "6.15.
|
4
|
+
"version": "6.15.2",
|
5
5
|
"description": "The webworkers driven UI framework",
|
6
6
|
"type": "module",
|
7
7
|
"repository": {
|
@@ -45,11 +45,11 @@
|
|
45
45
|
"homepage": "https://neomjs.github.io/pages/",
|
46
46
|
"devDependencies": {
|
47
47
|
"@fortawesome/fontawesome-free": "^6.5.1",
|
48
|
-
"autoprefixer": "^10.4.
|
48
|
+
"autoprefixer": "^10.4.19",
|
49
49
|
"chalk": "^5.3.0",
|
50
50
|
"clean-webpack-plugin": "^4.0.0",
|
51
51
|
"commander": "^12.0.0",
|
52
|
-
"cssnano": "^6.1.
|
52
|
+
"cssnano": "^6.1.1",
|
53
53
|
"envinfo": "^7.11.1",
|
54
54
|
"fs-extra": "^11.2.0",
|
55
55
|
"highlightjs-line-numbers.js": "^2.8.0",
|
@@ -58,13 +58,13 @@
|
|
58
58
|
"monaco-editor": "^0.47.0",
|
59
59
|
"neo-jsdoc": "1.0.1",
|
60
60
|
"neo-jsdoc-x": "1.0.5",
|
61
|
-
"postcss": "^8.4.
|
61
|
+
"postcss": "^8.4.38",
|
62
62
|
"sass": "^1.72.0",
|
63
63
|
"siesta-lite": "5.5.2",
|
64
64
|
"url": "^0.11.3",
|
65
|
-
"webpack": "^5.
|
65
|
+
"webpack": "^5.91.0",
|
66
66
|
"webpack-cli": "^5.1.4",
|
67
|
-
"webpack-dev-server": "^4.15.
|
67
|
+
"webpack-dev-server": "^4.15.2",
|
68
68
|
"webpack-hook-plugin": "^1.0.7",
|
69
69
|
"webpack-node-externals": "^3.0.0"
|
70
70
|
},
|
@@ -588,7 +588,7 @@ The app logic
|
|
588
588
|
|
589
589
|
Let's review the code and see what it's doing.
|
590
590
|
|
591
|
-
### The
|
591
|
+
### The Store
|
592
592
|
|
593
593
|
A store is a collection of records. A record is described in the `model` and the model's `fields`.
|
594
594
|
Here's the config for the store.
|
@@ -5,12 +5,20 @@
|
|
5
5
|
display: none;
|
6
6
|
}
|
7
7
|
|
8
|
-
.neo-list .neo-list-item {
|
9
|
-
white-space: normal;
|
10
|
-
}
|
11
|
-
|
12
8
|
.neo-panel-header-toolbar {
|
13
9
|
border : none; // reset the default 1px
|
14
|
-
border-bottom: 1px solid #f2f2f2
|
10
|
+
border-bottom: 1px solid #f2f2f2;
|
11
|
+
|
12
|
+
.neo-button {
|
13
|
+
// todo: we need styling for toolbar buttons within neo-theme-neo-light
|
14
|
+
border-radius: 4px;
|
15
|
+
height : inherit;
|
16
|
+
min-width : inherit;
|
17
|
+
padding : 5px 12px;
|
18
|
+
|
19
|
+
.neo-button-glyph {
|
20
|
+
color: var(--panel-header-text-color);
|
21
|
+
}
|
22
|
+
}
|
15
23
|
}
|
16
24
|
}
|
@@ -56,22 +56,3 @@ mark {
|
|
56
56
|
color : black;
|
57
57
|
padding : 0.1em 0.2em;
|
58
58
|
}
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
.neo-splitter {
|
63
|
-
opacity: 1;
|
64
|
-
margin: 8px 2px;
|
65
|
-
border-radius: 100px;
|
66
|
-
border: unset !important;
|
67
|
-
|
68
|
-
&:hover, &:active {
|
69
|
-
background-color: #5595F5 !important;
|
70
|
-
}
|
71
|
-
}
|
72
|
-
|
73
|
-
.neo-dragproxy {
|
74
|
-
&.neo-splitter {
|
75
|
-
background-color: #5595F5 !important;
|
76
|
-
}
|
77
|
-
}
|
@@ -1,5 +1,22 @@
|
|
1
1
|
:root .neo-theme-neo-light { // .neo-splitter
|
2
2
|
--splitter-background-color: #f2f2f2;
|
3
3
|
--splitter-border : 1px solid #ddd;
|
4
|
-
--splitter-hover-color : #5d83a7
|
4
|
+
--splitter-hover-color : #5d83a7;
|
5
|
+
|
6
|
+
.neo-splitter {
|
7
|
+
opacity: 1;
|
8
|
+
margin: 8px 2px;
|
9
|
+
border-radius: 100px;
|
10
|
+
border: unset !important;
|
11
|
+
|
12
|
+
&:hover, &:active {
|
13
|
+
background-color: #5595F5 !important;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
.neo-dragproxy {
|
18
|
+
&.neo-splitter {
|
19
|
+
background-color: #5595F5 !important;
|
20
|
+
}
|
21
|
+
}
|
5
22
|
}
|
package/src/DefaultConfig.mjs
CHANGED
@@ -260,12 +260,12 @@ const DefaultConfig = {
|
|
260
260
|
useVdomWorker: true,
|
261
261
|
/**
|
262
262
|
* buildScripts/injectPackageVersion.mjs will update this value
|
263
|
-
* @default '6.15.
|
263
|
+
* @default '6.15.2'
|
264
264
|
* @memberOf! module:Neo
|
265
265
|
* @name config.version
|
266
266
|
* @type String
|
267
267
|
*/
|
268
|
-
version: '6.15.
|
268
|
+
version: '6.15.2'
|
269
269
|
};
|
270
270
|
|
271
271
|
Object.assign(DefaultConfig, {
|
package/src/list/Base.mjs
CHANGED
@@ -486,6 +486,12 @@ class Base extends Component {
|
|
486
486
|
}
|
487
487
|
|
488
488
|
case 'Object': {
|
489
|
+
// We want a merge for custom cls rules
|
490
|
+
if (itemContent.cls) {
|
491
|
+
NeoArray.add(item.cls, itemContent.cls);
|
492
|
+
delete itemContent.cls
|
493
|
+
}
|
494
|
+
|
489
495
|
Object.assign(item, itemContent);
|
490
496
|
break;
|
491
497
|
}
|
@@ -493,6 +499,7 @@ class Base extends Component {
|
|
493
499
|
case 'Number':
|
494
500
|
case 'String': {
|
495
501
|
item.html = itemContent;
|
502
|
+
break;
|
496
503
|
}
|
497
504
|
}
|
498
505
|
|
package/src/main/DomEvents.mjs
CHANGED
@@ -412,7 +412,7 @@ class DomEvents extends Base {
|
|
412
412
|
let manager = Neo.worker.Manager;
|
413
413
|
|
414
414
|
manager.appNames.forEach(appName => {
|
415
|
-
manager.broadcast({action: 'disconnect', appName})
|
415
|
+
manager.broadcast({action: 'disconnect', appName, windowId: manager.windowId})
|
416
416
|
})
|
417
417
|
}
|
418
418
|
|
package/src/worker/Base.mjs
CHANGED
@@ -109,11 +109,12 @@ class Base extends CoreBase {
|
|
109
109
|
* Only relevant for SharedWorkers
|
110
110
|
* @param {Object} data
|
111
111
|
*/
|
112
|
-
onConnect(data) {
|
112
|
+
async onConnect(data) {
|
113
113
|
// short delay to ensure app VCs are in place
|
114
|
-
|
115
|
-
|
116
|
-
|
114
|
+
await this.timeout(10);
|
115
|
+
|
116
|
+
let {appName, windowId} = data;
|
117
|
+
this.fire('connect', {appName, windowId})
|
117
118
|
}
|
118
119
|
|
119
120
|
/**
|
@@ -162,7 +163,8 @@ class Base extends CoreBase {
|
|
162
163
|
* @param {Object} data
|
163
164
|
*/
|
164
165
|
onDisconnect(data) {
|
165
|
-
|
166
|
+
let {appName, windowId} = data;
|
167
|
+
this.fire('disconnect', {appName, windowId})
|
166
168
|
}
|
167
169
|
|
168
170
|
/**
|
@@ -212,7 +214,7 @@ class Base extends CoreBase {
|
|
212
214
|
for (port of me.ports) {
|
213
215
|
if (!port.appName) {
|
214
216
|
port.appName = appName;
|
215
|
-
me.onConnect({appName});
|
217
|
+
me.onConnect({appName, windowId: port.windowId});
|
216
218
|
break
|
217
219
|
}
|
218
220
|
}
|