neo.mjs 6.9.11 → 6.10.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/BACKERS.md +0 -30
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/learnneo/index.html +7 -2
- package/apps/learnneo/neo-config.json +1 -4
- package/apps/learnneo/view/LivePreview.mjs +171 -0
- package/apps/learnneo/view/Viewport.mjs +11 -4
- package/apps/learnneo/view/ViewportController.mjs +2 -2
- package/apps/learnneo/view/home/ContentTreeList.mjs +93 -5
- package/apps/learnneo/view/home/MainContainer.mjs +16 -16
- package/apps/learnneo/view/home/MainContainerController.mjs +5 -20
- package/apps/learnneo/view/home/MainContainerModel.mjs +3 -5
- package/apps/newwebsite/index.html +3 -0
- package/buildScripts/convertDesignTokens.mjs +173 -0
- package/examples/ServiceWorker.mjs +2 -2
- package/package.json +5 -8
- package/resources/data/deck/learnneo/p/2023-10-01T18-29-19-158Z.md +14 -16
- package/resources/data/deck/learnneo/p/2023-10-07T19-18-28-517Z.md +9 -17
- package/resources/data/deck/learnneo/p/2023-10-08T20-20-07-934Z.md +7 -5
- package/resources/data/deck/learnneo/p/2023-10-08T20-20-37-336Z.md +17 -10
- package/resources/data/deck/learnneo/p/2023-10-14T19-25-08-153Z.md +18 -22
- package/resources/data/deck/learnneo/p/2023-10-31T13-59-37-550Z.md +31 -0
- package/resources/data/deck/learnneo/p/MainThreadAddonExample.md +15 -0
- package/resources/data/deck/learnneo/p/MainThreadAddonIntro.md +46 -0
- package/resources/data/deck/learnneo/p/TestLivePreview.md +10 -0
- package/resources/data/deck/learnneo/p/stylesheet.md +22 -8
- package/resources/data/deck/learnneo/t.json +126 -56
- package/resources/data/deck/training/p/2023-01-10T02-21-54-303Z.md +1 -1
- package/resources/data/deck/training/t.json +1276 -1
- package/resources/design-tokens/json/component.json +288 -0
- package/resources/design-tokens/json/core.json +352 -0
- package/resources/design-tokens/json/semantic.json +231 -0
- package/resources/images/logos/Github-logo-black.svg +1 -0
- package/resources/images/logos/Slack-logo-black.svg +17 -0
- package/resources/scss/src/apps/learnneo/Viewport.scss +3 -0
- package/resources/scss/src/apps/learnneo/home/ContentTreeList.scss +60 -13
- package/resources/scss/src/apps/learnneo/home/ContentView.scss +11 -2
- package/resources/scss/src/apps/newwebsite/MainContainer.scss +14 -15
- package/resources/scss/src/list/Base.scss +4 -0
- package/resources/scss/theme-neo-light/Global.scss +36 -16
- package/resources/scss/theme-neo-light/button/Base.scss +46 -45
- package/resources/scss/theme-neo-light/design-tokens/Component.scss +66 -1
- package/resources/scss/theme-neo-light/design-tokens/Core.scss +66 -5
- package/resources/scss/theme-neo-light/design-tokens/Semantic.scss +64 -0
- package/resources/scss/theme-neo-light/list/Base.scss +27 -6
- package/resources/scss/theme-neo-light/tab/header/Button.scss +1 -1
- package/src/DefaultConfig.mjs +2 -2
- package/src/component/StatusBadge.mjs +194 -246
- package/src/component/Video.mjs +19 -25
- package/src/controller/Base.mjs +33 -26
- package/src/core/Base.mjs +2 -2
- package/src/data/connection/Xhr.mjs +1 -1
- package/src/form/field/TextArea.mjs +3 -3
- package/src/main/DomAccess.mjs +64 -70
- package/src/main/DomEvents.mjs +1 -1
- package/src/main/addon/HighlightJS.mjs +16 -1
- package/src/main/addon/Mwc.mjs +6 -1
- package/src/worker/Manager.mjs +8 -3
- package/examples/container/dialog/MainContainer.mjs +0 -68
- package/examples/container/dialog/MainContainerController.mjs +0 -84
- package/examples/container/dialog/app.mjs +0 -6
- package/examples/container/dialog/index.html +0 -11
- package/examples/container/dialog/neo-config.json +0 -7
- package/src/container/Dialog.mjs +0 -205
- package/src/main/addon/Dialog.mjs +0 -68
package/src/container/Dialog.mjs
DELETED
@@ -1,205 +0,0 @@
|
|
1
|
-
import Base from '../container/Panel.mjs';
|
2
|
-
import NeoArray from '../util/Array.mjs';
|
3
|
-
import HeaderToolbar from '../dialog/header/Toolbar.mjs';
|
4
|
-
|
5
|
-
/**
|
6
|
-
* Lightweight implementation using the dialog tag.
|
7
|
-
* See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog
|
8
|
-
* @class Neo.container.Dialog
|
9
|
-
* @extends Neo.container.Panel
|
10
|
-
*/
|
11
|
-
class Dialog extends Base {
|
12
|
-
static config = {
|
13
|
-
/**
|
14
|
-
* @member {String} className='Neo.container.Dialog'
|
15
|
-
* @protected
|
16
|
-
*/
|
17
|
-
className: 'Neo.container.Dialog',
|
18
|
-
/**
|
19
|
-
* @member {String} ntype='container-dialog'
|
20
|
-
* @protected
|
21
|
-
*/
|
22
|
-
ntype: 'container-dialog',
|
23
|
-
/**
|
24
|
-
* @member {Boolean} autoMount=true
|
25
|
-
*/
|
26
|
-
autoMount: true,
|
27
|
-
/**
|
28
|
-
* @member {Boolean} autoRender=true
|
29
|
-
*/
|
30
|
-
autoRender: true,
|
31
|
-
/**
|
32
|
-
* @member {String[]} baseCls=['neo-container-dialog', 'neo-panel', 'neo-container']
|
33
|
-
* @protected
|
34
|
-
*/
|
35
|
-
baseCls: ['neo-container-dialog', 'neo-panel', 'neo-container'],
|
36
|
-
/**
|
37
|
-
* @member {Object} headerConfig=null
|
38
|
-
*/
|
39
|
-
headerConfig: null,
|
40
|
-
/**
|
41
|
-
* @member {Neo.toolbar.Base|null} headerToolbar=null
|
42
|
-
*/
|
43
|
-
headerToolbar: null,
|
44
|
-
/**
|
45
|
-
* The CSS class to use for an icon, e.g. ['fa', 'fa-home']
|
46
|
-
* @member {String[]} [iconCls_=null]
|
47
|
-
*/
|
48
|
-
iconCls_: null,
|
49
|
-
/**
|
50
|
-
* @member {Object} itemDefaults
|
51
|
-
*/
|
52
|
-
itemDefaults: {
|
53
|
-
baseCls: ['neo-dialog-content']
|
54
|
-
},
|
55
|
-
/**
|
56
|
-
* @member {Object[]} items
|
57
|
-
*/
|
58
|
-
items: [],
|
59
|
-
/**
|
60
|
-
* @member {String} title=null
|
61
|
-
*/
|
62
|
-
title_: null,
|
63
|
-
/**
|
64
|
-
* @member {Object} _vdom={tag: 'dialog', cn: []}
|
65
|
-
*/
|
66
|
-
_vdom:
|
67
|
-
{tag: 'dialog', cn: []}
|
68
|
-
}
|
69
|
-
|
70
|
-
/**
|
71
|
-
* @param {Object} config
|
72
|
-
*/
|
73
|
-
construct(config) {
|
74
|
-
super.construct(config);
|
75
|
-
this.createHeader();
|
76
|
-
}
|
77
|
-
|
78
|
-
/**
|
79
|
-
* Triggered after the iconCls config got changed
|
80
|
-
* @param {String} value
|
81
|
-
* @param {String} oldValue
|
82
|
-
* @protected
|
83
|
-
*/
|
84
|
-
afterSetIconCls(value, oldValue) {
|
85
|
-
if (!this.headers) { return }
|
86
|
-
let iconNode = this.headers.down({flag: 'dialog-header-icon'}),
|
87
|
-
iconNodeCls = [...iconNode.cls];
|
88
|
-
|
89
|
-
NeoArray.remove(iconNodeCls, oldValue);
|
90
|
-
NeoArray.add( iconNodeCls, value);
|
91
|
-
|
92
|
-
iconNode.cls = iconNodeCls;
|
93
|
-
|
94
|
-
iconNode.removeDom = !value || value === '';
|
95
|
-
this.update();
|
96
|
-
}
|
97
|
-
|
98
|
-
/**
|
99
|
-
* Triggered after the title config got changed
|
100
|
-
* @param {String} value
|
101
|
-
* @param {String} oldValue
|
102
|
-
* @protected
|
103
|
-
*/
|
104
|
-
afterSetTitle(value, oldValue) {
|
105
|
-
this.headerToolbar?.down({flag: 'panel-header-title'}).set({
|
106
|
-
text: value
|
107
|
-
})
|
108
|
-
}
|
109
|
-
|
110
|
-
/**
|
111
|
-
* close the dialog in main thread
|
112
|
-
*/
|
113
|
-
close() {
|
114
|
-
let me = this;
|
115
|
-
|
116
|
-
Neo.main.addon.Dialog.close({
|
117
|
-
appName: me.appName,
|
118
|
-
id : me.id
|
119
|
-
})
|
120
|
-
}
|
121
|
-
|
122
|
-
/**
|
123
|
-
* @protected
|
124
|
-
*/
|
125
|
-
createHeader() {
|
126
|
-
let me = this,
|
127
|
-
cls = ['neo-header-toolbar', 'neo-toolbar'],
|
128
|
-
headers = me.headers || [],
|
129
|
-
headerConfigCopy = {...me.headerConfig};
|
130
|
-
delete headerConfigCopy.items;
|
131
|
-
|
132
|
-
me.headerToolbar = Neo.create({
|
133
|
-
module : HeaderToolbar,
|
134
|
-
actions : [{action: 'close', iconCls: 'fa-solid fa-xmark'}],
|
135
|
-
appName : me.appName,
|
136
|
-
cls,
|
137
|
-
dock : 'top',
|
138
|
-
flex : 'none',
|
139
|
-
id : me.getHeaderToolbarId(),
|
140
|
-
listeners: {headerAction: me.executeHeaderAction, scope: me},
|
141
|
-
items : [{
|
142
|
-
ntype: '',
|
143
|
-
cls : ['neo-dialog-header-icon', ...me.iconCls],
|
144
|
-
flag : 'dialog-header-icon',
|
145
|
-
}, {
|
146
|
-
ntype : 'label',
|
147
|
-
cls : ['neo-panel-header-text', 'neo-label'],
|
148
|
-
flag : 'panel-header-title',
|
149
|
-
hidden: !me.title,
|
150
|
-
text : me.title
|
151
|
-
}, ...me.headerConfig.items || []],
|
152
|
-
|
153
|
-
...headerConfigCopy
|
154
|
-
});
|
155
|
-
|
156
|
-
headers.unshift(me.headerToolbar);
|
157
|
-
|
158
|
-
me.headers = headers;
|
159
|
-
}
|
160
|
-
|
161
|
-
/**
|
162
|
-
* {Object} data
|
163
|
-
*/
|
164
|
-
executeHeaderAction(data) {
|
165
|
-
let me = this,
|
166
|
-
|
167
|
-
map = {
|
168
|
-
close: me.close
|
169
|
-
};
|
170
|
-
|
171
|
-
map[data.action]?.call(me, data);
|
172
|
-
|
173
|
-
me.fire('headerAction', {
|
174
|
-
dialog: me,
|
175
|
-
...data
|
176
|
-
})
|
177
|
-
}
|
178
|
-
|
179
|
-
/**
|
180
|
-
* Returns the id of the header toolbar
|
181
|
-
* @returns {String}
|
182
|
-
*/
|
183
|
-
getHeaderToolbarId() {
|
184
|
-
return this.id + '-header-toolbar';
|
185
|
-
}
|
186
|
-
|
187
|
-
/**
|
188
|
-
* Shows the dialog (with / without Modal) in main thread
|
189
|
-
* @param {Boolean} modal
|
190
|
-
*/
|
191
|
-
async show(modal = true) {
|
192
|
-
let me = this;
|
193
|
-
|
194
|
-
await me.timeout(20);
|
195
|
-
|
196
|
-
Neo.main.addon.Dialog[modal ? 'showModal': 'show']({
|
197
|
-
appName: me.appName,
|
198
|
-
id : me.id
|
199
|
-
});
|
200
|
-
}
|
201
|
-
}
|
202
|
-
|
203
|
-
Neo.applyClassConfig(Dialog);
|
204
|
-
|
205
|
-
export default Dialog;
|
@@ -1,68 +0,0 @@
|
|
1
|
-
import Base from '../../core/Base.mjs';
|
2
|
-
import DomAccess from '../DomAccess.mjs'
|
3
|
-
/**
|
4
|
-
* Addon for component.Dialog
|
5
|
-
* @class Neo.main.addon.Dialog
|
6
|
-
* @extends Neo.core.Base
|
7
|
-
* @singleton
|
8
|
-
*/
|
9
|
-
class Dialog extends Base {
|
10
|
-
static config = {
|
11
|
-
/**
|
12
|
-
* @member {String} className='Neo.main.addon.Dialog'
|
13
|
-
* @protected
|
14
|
-
*/
|
15
|
-
className: 'Neo.main.addon.Dialog',
|
16
|
-
/**
|
17
|
-
* Remote method access for other workers
|
18
|
-
* @member {Object} remote={app: [//...]}
|
19
|
-
* @protected
|
20
|
-
*/
|
21
|
-
remote: {
|
22
|
-
app: [
|
23
|
-
'close',
|
24
|
-
'show',
|
25
|
-
'showModal'
|
26
|
-
]
|
27
|
-
},
|
28
|
-
/**
|
29
|
-
* @member {Boolean} singleton=true
|
30
|
-
* @protected
|
31
|
-
*/
|
32
|
-
singleton: true
|
33
|
-
}
|
34
|
-
|
35
|
-
/**
|
36
|
-
* @param {Object} data
|
37
|
-
* @param {String} data.id
|
38
|
-
* @returns {Boolean}
|
39
|
-
*/
|
40
|
-
close(data) {
|
41
|
-
DomAccess.getElement(data.id).close()
|
42
|
-
return true;
|
43
|
-
}
|
44
|
-
|
45
|
-
/**
|
46
|
-
* @param {Object} data
|
47
|
-
* @param {String} data.id
|
48
|
-
* @returns {Boolean}
|
49
|
-
*/
|
50
|
-
show(data) {
|
51
|
-
DomAccess.getElement(data.id).show()
|
52
|
-
return true;
|
53
|
-
}
|
54
|
-
|
55
|
-
/**
|
56
|
-
* @param {Object} data
|
57
|
-
* @param {String} data.id
|
58
|
-
* @returns {Boolean}
|
59
|
-
*/
|
60
|
-
showModal(data) {
|
61
|
-
DomAccess.getElement(data.id).showModal()
|
62
|
-
return true;
|
63
|
-
}
|
64
|
-
}
|
65
|
-
|
66
|
-
let instance = Neo.applyClassConfig(Dialog);
|
67
|
-
|
68
|
-
export default instance;
|