neo.mjs 6.9.6 → 6.9.8
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/learnneo/neo-config.json +6 -5
- package/apps/learnneo/store/Content.mjs +52 -2
- package/apps/learnneo/view/home/ContentTreeList.mjs +32 -4
- package/apps/learnneo/view/home/MainContainer.mjs +17 -29
- package/apps/learnneo/view/home/MainContainerController.mjs +28 -19
- package/apps/learnneo/view/home/MainContainerModel.mjs +35 -0
- package/docs/app/view/MainContainerController.mjs +12 -0
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/button/base/neo-config.json +2 -1
- package/examples/form/field/textarea/MainContainer.mjs +7 -1
- package/package.json +1 -1
- package/resources/data/learnneo/p/2023-10-01T18-29-19-158Z.md +102 -0
- package/resources/data/learnneo/p/2023-10-07T19-18-28-517Z.md +110 -0
- package/resources/data/learnneo/p/2023-10-08T20-20-07-934Z.md +75 -0
- package/resources/data/learnneo/p/2023-10-08T20-20-37-336Z.md +29 -0
- package/resources/data/learnneo/p/2023-10-08T20-37-30-658Z.md +0 -0
- package/resources/data/learnneo/p/2023-10-08T21-58-25-809Z.md +68 -0
- package/resources/data/learnneo/p/2023-10-08T22-22-11-013Z.md +0 -0
- package/resources/data/learnneo/p/2023-10-14T19-25-08-153Z.md +124 -0
- package/resources/data/learnneo/pages/whyneo.md +4 -0
- package/resources/data/learnneo/t.json +130 -0
- package/resources/data/learnneo/tree.json +27 -0
- package/resources/deck/whyneo.md +80 -0
- package/resources/images/Neo_Vector.svg +3 -0
- package/resources/scss/src/apps/learnneo/Viewport.scss +63 -0
- package/resources/scss/src/apps/newwebsite/MainContainer.css +33 -0
- package/resources/scss/theme-neo-light/Global.scss +7 -0
- package/resources/scss/theme-neo-light/apps/covid/HeaderContainer.scss +10 -0
- package/resources/scss/theme-neo-light/apps/covid/country/Gallery.scss +7 -0
- package/resources/scss/theme-neo-light/apps/covid/country/Helix.scss +8 -0
- package/resources/scss/theme-neo-light/apps/covid/country/LineChartComponent.scss +3 -0
- package/resources/scss/theme-neo-light/apps/docs/ContentTabContainer.scss +4 -0
- package/resources/scss/theme-neo-light/apps/docs/HeaderContainer.scss +10 -0
- package/resources/scss/theme-neo-light/apps/docs/MainContainer.scss +3 -0
- package/resources/scss/theme-neo-light/apps/docs/classdetails/HeaderComponent.scss +4 -0
- package/resources/scss/theme-neo-light/apps/docs/classdetails/MembersList.scss +17 -0
- package/resources/scss/theme-neo-light/apps/docs/classdetails/TutorialComponent.scss +4 -0
- package/resources/scss/theme-neo-light/apps/website/HeaderContainer.scss +5 -0
- package/resources/scss/theme-neo-light/apps/website/MainContainer.scss +4 -0
- package/resources/scss/theme-neo-light/apps/website/blog/Container.scss +3 -0
- package/resources/scss/theme-neo-light/apps/website/home/TabContainer.scss +4 -0
- package/resources/scss/theme-neo-light/button/Base.scss +117 -0
- package/resources/scss/theme-neo-light/calendar/view/EditEventContainer.scss +5 -0
- package/resources/scss/theme-neo-light/calendar/view/MainContainer.scss +23 -0
- package/resources/scss/theme-neo-light/calendar/view/SettingsContainer.scss +3 -0
- package/resources/scss/theme-neo-light/calendar/view/YearComponent.scss +10 -0
- package/resources/scss/theme-neo-light/calendar/view/calendars/EditContainer.scss +5 -0
- package/resources/scss/theme-neo-light/calendar/view/calendars/List.scss +3 -0
- package/resources/scss/theme-neo-light/calendar/view/month/Component.scss +10 -0
- package/resources/scss/theme-neo-light/calendar/view/week/Component.scss +13 -0
- package/resources/scss/theme-neo-light/component/Base.scss +6 -0
- package/resources/scss/theme-neo-light/component/BoxLabel.scss +5 -0
- package/resources/scss/theme-neo-light/component/Chip.scss +14 -0
- package/resources/scss/theme-neo-light/component/DateSelector.scss +24 -0
- package/resources/scss/theme-neo-light/component/Process.scss +9 -0
- package/resources/scss/theme-neo-light/component/Progress.scss +3 -0
- package/resources/scss/theme-neo-light/component/Splitter.scss +5 -0
- package/resources/scss/theme-neo-light/component/StatusBadge.scss +19 -0
- package/resources/scss/theme-neo-light/component/Timer.scss +6 -0
- package/resources/scss/theme-neo-light/component/Toast.scss +9 -0
- package/resources/scss/theme-neo-light/component/Video.scss +4 -0
- package/resources/scss/theme-neo-light/container/Accordion.scss +5 -0
- package/resources/scss/theme-neo-light/container/AccordionItem.scss +10 -0
- package/resources/scss/theme-neo-light/container/Base.scss +4 -0
- package/resources/scss/theme-neo-light/container/Panel.scss +5 -0
- package/resources/scss/theme-neo-light/container/Viewport.scss +3 -0
- package/resources/scss/theme-neo-light/design-tokens/Components.scss +3 -0
- package/resources/scss/theme-neo-light/dialog/Base.scss +5 -0
- package/resources/scss/theme-neo-light/examples/ConfigurationPanel.scss +3 -0
- package/resources/scss/theme-neo-light/examples/calendar/basic/MainContainer.scss +4 -0
- package/resources/scss/theme-neo-light/form/Fieldset.scss +6 -0
- package/resources/scss/theme-neo-light/form/field/CheckBox.scss +8 -0
- package/resources/scss/theme-neo-light/form/field/FileUpload.scss +12 -0
- package/resources/scss/theme-neo-light/form/field/Picker.scss +5 -0
- package/resources/scss/theme-neo-light/form/field/Range.scss +4 -0
- package/resources/scss/theme-neo-light/form/field/Search.scss +3 -0
- package/resources/scss/theme-neo-light/form/field/Select.scss +9 -0
- package/resources/scss/theme-neo-light/form/field/Switch.scss +17 -0
- package/resources/scss/theme-neo-light/form/field/Text.scss +32 -0
- package/resources/scss/theme-neo-light/form/field/trigger/Base.scss +6 -0
- package/resources/scss/theme-neo-light/form/field/trigger/Time.scss +4 -0
- package/resources/scss/theme-neo-light/grid/Container.scss +7 -0
- package/resources/scss/theme-neo-light/grid/View.scss +13 -0
- package/resources/scss/theme-neo-light/grid/header/Button.scss +6 -0
- package/resources/scss/theme-neo-light/list/Base.scss +12 -0
- package/resources/scss/theme-neo-light/menu/List.scss +21 -0
- package/resources/scss/theme-neo-light/menu/Panel.scss +3 -0
- package/resources/scss/theme-neo-light/tab/Container.scss +3 -0
- package/resources/scss/theme-neo-light/tab/Strip.scss +5 -0
- package/resources/scss/theme-neo-light/tab/header/Button.scss +30 -0
- package/resources/scss/theme-neo-light/table/Container.scss +10 -0
- package/resources/scss/theme-neo-light/table/View.scss +13 -0
- package/resources/scss/theme-neo-light/table/header/Button.scss +7 -0
- package/resources/scss/theme-neo-light/toolbar/Base.scss +4 -0
- package/resources/scss/theme-neo-light/tree/List.scss +4 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/form/field/FileUpload.mjs +10 -8
- package/src/form/field/Text.mjs +2 -2
- package/src/form/field/TextArea.mjs +52 -0
- package/src/main/DomAccess.mjs +23 -0
- package/src/main/addon/HighlightJS.mjs +35 -10
- package/src/vdom/Helper.mjs +2 -1
@@ -0,0 +1,30 @@
|
|
1
|
+
:root .neo-theme-neo-light { // .neo-tab-header-button
|
2
|
+
--tab-button-background-color : #fff;
|
3
|
+
--tab-button-background-color-active : #ddd;
|
4
|
+
--tab-button-background-color-disabled : #fff;
|
5
|
+
--tab-button-background-color-hover : #fff;
|
6
|
+
--tab-button-background-image : none;
|
7
|
+
--tab-button-background-image-bottom : none;
|
8
|
+
--tab-button-background-image-left : none;
|
9
|
+
--tab-button-background-image-pressed : none;
|
10
|
+
--tab-button-background-image-pressed-bottom: none;
|
11
|
+
--tab-button-background-image-pressed-left : none;
|
12
|
+
--tab-button-background-image-pressed-right : none;
|
13
|
+
--tab-button-background-image-right : none;
|
14
|
+
--tab-button-border : none;
|
15
|
+
--tab-button-border-bottom : none;
|
16
|
+
--tab-button-border-bottom-pressed : none;
|
17
|
+
--tab-button-border-pressed : none;
|
18
|
+
--tab-button-border-radius : 0;
|
19
|
+
--tab-button-gap : 0;
|
20
|
+
--tab-button-glyph-color : #bbb;
|
21
|
+
--tab-button-glyph-color-active : #1c60a0;
|
22
|
+
--tab-button-glyph-color-hover : #1c60a0;
|
23
|
+
--tab-button-glyph-color-pressed : #1c60a0;
|
24
|
+
--tab-button-height : 25px;
|
25
|
+
--tab-button-height-pressed : 25px;
|
26
|
+
--tab-button-margin-bottom : 0;
|
27
|
+
--tab-button-padding : 7px 12px 6px 12px;
|
28
|
+
--tab-button-text-color : #2b2b2b;
|
29
|
+
--tab-button-text-transform : uppercase;
|
30
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
:root .neo-theme-neo-light { // .neo-table-container
|
2
|
+
--table-container-border-color : #ddd;
|
3
|
+
--table-container-cell-background-color : #fff;
|
4
|
+
--table-container-cell-background-color-even: #f2f2f2;
|
5
|
+
--table-container-cell-border-bottom : 1px solid #ddd;
|
6
|
+
--table-container-cell-height : 32px;
|
7
|
+
--table-container-cell-padding : 2px 10px 2px;
|
8
|
+
--table-container-color : #666;
|
9
|
+
--table-container-header-cell-border-bottom : 1px solid #ddd;
|
10
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
:root .neo-theme-neo-light { // .neo-table-view
|
2
|
+
--table-cell-background-color-hover : #{lighten(#33343d, 70%)};
|
3
|
+
--table-cellmodel-selected-cell-background-color : #{lighten(#64B5F6, 22%)};
|
4
|
+
--table-cellmodel-selected-cell-color : #2b2b2b;
|
5
|
+
--table-cellmodel-selected-column-cell-background-color: #{lighten(#4f558a, 52%)};
|
6
|
+
--table-cellmodel-selected-column-cell-color : #2b2b2b;
|
7
|
+
--table-cellrowmodel-selected-cell-background-color : #{lighten(#64B5F6, 22%)};
|
8
|
+
--table-cellrowmodel-selected-cell-color : #2b2b2b;
|
9
|
+
--table-cellrowmodel-selected-row-cell-background-color: #{lighten(#4f558a, 52%)};
|
10
|
+
--table-cellrowmodel-selected-row-cell-color : #2b2b2b;
|
11
|
+
--table-rowmodel-selected-cell-background-color : #{lighten(#64B5F6, 22%)};
|
12
|
+
--table-rowmodel-selected-cell-color : #2b2b2b;
|
13
|
+
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
:root .neo-theme-neo-light { // .neo-table-header-button
|
2
|
+
--table-header-button-background-color : #5d83a7;
|
3
|
+
--table-header-button-background-image : none;
|
4
|
+
--table-header-button-color : #fff;
|
5
|
+
--table-header-button-glyph-color : #fff;
|
6
|
+
--table-header-button-ripple-background-color: #{darken(#5d83a7, 10%)};
|
7
|
+
}
|
package/src/DefaultConfig.mjs
CHANGED
@@ -236,12 +236,12 @@ const DefaultConfig = {
|
|
236
236
|
useVdomWorker: true,
|
237
237
|
/**
|
238
238
|
* buildScripts/injectPackageVersion.mjs will update this value
|
239
|
-
* @default '6.9.
|
239
|
+
* @default '6.9.8'
|
240
240
|
* @memberOf! module:Neo
|
241
241
|
* @name config.version
|
242
242
|
* @type String
|
243
243
|
*/
|
244
|
-
version: '6.9.
|
244
|
+
version: '6.9.8'
|
245
245
|
};
|
246
246
|
|
247
247
|
Object.assign(DefaultConfig, {
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import Base
|
2
|
-
import NeoArray
|
1
|
+
import Base from '../../form/field/Base.mjs';
|
2
|
+
import NeoArray from '../../util/Array.mjs';
|
3
|
+
import StringUtil from '../../util/String.mjs';
|
3
4
|
|
4
5
|
const
|
5
6
|
sizeRE = /^(\d+)(kb|mb|gb)?$/i,
|
@@ -404,15 +405,16 @@ class FileUpload extends Base {
|
|
404
405
|
const
|
405
406
|
file = files.item(0),
|
406
407
|
pointPos = file.name.lastIndexOf('.'),
|
407
|
-
type = pointPos > -1 ? file.name.slice(pointPos + 1) : ''
|
408
|
+
type = pointPos > -1 ? file.name.slice(pointPos + 1) : '',
|
409
|
+
escapedFileName = StringUtil.escapeHtml(file.name);
|
408
410
|
|
409
411
|
if (me.types && !types[type]) {
|
410
|
-
body.cn[0].innerHTML =
|
412
|
+
body.cn[0].innerHTML = escapedFileName;
|
411
413
|
body.cn[1].innerHTML = `${me.invalidFileFormat} (.${type}) ${me.formatSize(file.size)}`;
|
412
414
|
me.error = me.pleaseUseTheseTypes?.replace('{allowedFileTypes}', Object.keys(types).join(' .'))
|
413
415
|
}
|
414
416
|
else if (file.size > me.maxSize) {
|
415
|
-
body.cn[0].innerHTML =
|
417
|
+
body.cn[0].innerHTML = escapedFileName;
|
416
418
|
body.cn[1].innerHTML = me.formatSize(file.size);
|
417
419
|
me.error = me.fileSizeMoreThan?.replace('{allowedFileSize}', String(me._maxSize).toUpperCase());
|
418
420
|
}
|
@@ -444,8 +446,8 @@ class FileUpload extends Base {
|
|
444
446
|
// We have to wait for the DOM to have changed, and the action button to be visible
|
445
447
|
await new Promise(resolve => setTimeout(resolve, 100));
|
446
448
|
me.focus(me.vdom.cn[2].id);
|
447
|
-
|
448
|
-
me.vdom.cn[1].cn[0].innerHTML = file.name;
|
449
|
+
|
450
|
+
me.vdom.cn[1].cn[0].innerHTML = StringUtil.escapeHtml(file.name);
|
449
451
|
me.update();
|
450
452
|
me.state = 'uploading';
|
451
453
|
|
@@ -669,7 +671,7 @@ class FileUpload extends Base {
|
|
669
671
|
|
670
672
|
me.documentId = document.id;
|
671
673
|
me.fileSize = me.formatSize(document.size);
|
672
|
-
me.vdom.cn[1].cn[0].innerHTML = document.fileName;
|
674
|
+
me.vdom.cn[1].cn[0].innerHTML = StringUtil.escapeHtml(document.fileName);
|
673
675
|
me.state = me.documentStatusMap[document.status];
|
674
676
|
}
|
675
677
|
}
|
package/src/form/field/Text.mjs
CHANGED
@@ -1283,7 +1283,7 @@ class Text extends Base {
|
|
1283
1283
|
onInputValueChange(data) {
|
1284
1284
|
let me = this,
|
1285
1285
|
oldValue = me.value,
|
1286
|
-
value = data.value,
|
1286
|
+
value = data.value ? data.value.toString().trim() : me.emptyValue,
|
1287
1287
|
vnode = VNodeUtil.findChildVnode(me.vnode, {nodeName: 'input'});
|
1288
1288
|
|
1289
1289
|
if (vnode) {
|
@@ -1482,7 +1482,7 @@ class Text extends Base {
|
|
1482
1482
|
minLength = me.minLength,
|
1483
1483
|
required = me.required,
|
1484
1484
|
returnValue = true,
|
1485
|
-
value = me.value,
|
1485
|
+
value = me.value ? me.value.toString().trim() : me.emptyValue,
|
1486
1486
|
valueLength = value?.toString().length,
|
1487
1487
|
inputPattern = me.inputPattern,
|
1488
1488
|
isEmpty = value !== 0 && (!value || valueLength < 1),
|
@@ -27,6 +27,12 @@ class TextArea extends Text {
|
|
27
27
|
* @protected
|
28
28
|
*/
|
29
29
|
ntype: 'textarea',
|
30
|
+
/**
|
31
|
+
* Set this to `true` to have the text area grow and shrink to accommodate
|
32
|
+
* any height of text. Bounds can be set using the `minHeight` and `maxHeight` settings.
|
33
|
+
* @member {Boolean} autoGrow=false
|
34
|
+
*/
|
35
|
+
autoGrow : false,
|
30
36
|
/**
|
31
37
|
* @member {String[]} baseCls=['neo-textarea','neo-textfield']
|
32
38
|
*/
|
@@ -88,6 +94,17 @@ class TextArea extends Text {
|
|
88
94
|
this.changeInputElKey('tag', value);
|
89
95
|
}
|
90
96
|
|
97
|
+
/**
|
98
|
+
* Triggered after the mounted config got changed
|
99
|
+
* @param {Boolean} value
|
100
|
+
* @param {Boolean} oldValue
|
101
|
+
* @protected
|
102
|
+
*/
|
103
|
+
afterSetMounted(value, oldValue) {
|
104
|
+
super.afterSetMounted(value, oldValue);
|
105
|
+
this.syncAutoGrowHeight();
|
106
|
+
}
|
107
|
+
|
91
108
|
/**
|
92
109
|
* Triggered after the resizable config got changed
|
93
110
|
* @param {Boolean} value
|
@@ -126,6 +143,7 @@ class TextArea extends Text {
|
|
126
143
|
}
|
127
144
|
|
128
145
|
super.afterSetValue(value, oldValue);
|
146
|
+
this.syncAutoGrowHeight();
|
129
147
|
}
|
130
148
|
|
131
149
|
/**
|
@@ -148,6 +166,40 @@ class TextArea extends Text {
|
|
148
166
|
beforeSetWrap(value, oldValue) {
|
149
167
|
return this.beforeSetEnumValue(value, oldValue, 'wrap', 'wrapValues');
|
150
168
|
}
|
169
|
+
|
170
|
+
/**
|
171
|
+
* @param {Object} data
|
172
|
+
* @protected
|
173
|
+
*/
|
174
|
+
onInputValueChange(data) {
|
175
|
+
this.syncAutoGrowHeight();
|
176
|
+
super.onInputValueChange(data);
|
177
|
+
}
|
178
|
+
|
179
|
+
/**
|
180
|
+
* @protected
|
181
|
+
*/
|
182
|
+
async syncAutoGrowHeight() {
|
183
|
+
let me = this;
|
184
|
+
|
185
|
+
if (me.mounted && me.autoGrow) {
|
186
|
+
const
|
187
|
+
inputEl = me.getInputEl(),
|
188
|
+
dims = await Neo.main.DomAccess.getScrollingDimensions({
|
189
|
+
appName : me.appName,
|
190
|
+
id : me.getInputElId()
|
191
|
+
});
|
192
|
+
|
193
|
+
// We must not show the scrollbar when autoGrowing
|
194
|
+
inputEl.style.overflowY = 'hidden';
|
195
|
+
|
196
|
+
if (dims.scrollHeight > dims.clientHeight - 5) {
|
197
|
+
inputEl.height = dims.scrollHeight;
|
198
|
+
}
|
199
|
+
|
200
|
+
me.update();
|
201
|
+
}
|
202
|
+
}
|
151
203
|
}
|
152
204
|
|
153
205
|
Neo.applyClassConfig(TextArea);
|
package/src/main/DomAccess.mjs
CHANGED
@@ -100,6 +100,7 @@ class DomAccess extends Base {
|
|
100
100
|
'focus',
|
101
101
|
'getAttributes',
|
102
102
|
'getBoundingClientRect',
|
103
|
+
'getScrollingDimensions',
|
103
104
|
'measure',
|
104
105
|
'scrollBy',
|
105
106
|
'scrollIntoView',
|
@@ -459,6 +460,28 @@ class DomAccess extends Base {
|
|
459
460
|
return nodeId.nodeType ? nodeId : (nodeId === 'body' || nodeId === 'document.body') ? document.body : this.getElement(nodeId);
|
460
461
|
}
|
461
462
|
|
463
|
+
/**
|
464
|
+
* @param {HTMLElement|Object} data
|
465
|
+
* @param {String|String[]} data.id
|
466
|
+
* @returns {Object}
|
467
|
+
*/
|
468
|
+
getScrollingDimensions(data) {
|
469
|
+
const me = this;
|
470
|
+
|
471
|
+
if (Array.isArray(data.id)) {
|
472
|
+
return data.id.map(id => me.getScrollingDimensions({ id }));
|
473
|
+
} else {
|
474
|
+
const node = data.nodeType ? data : me.getElementOrBody(data.id);
|
475
|
+
|
476
|
+
return {
|
477
|
+
clientWidth : node?.clientWidth,
|
478
|
+
clientHeight: node?.clientHeight,
|
479
|
+
scrollWidth : node?.scrollWidth,
|
480
|
+
scrollHeight: node?.scrollHeight
|
481
|
+
};
|
482
|
+
}
|
483
|
+
}
|
484
|
+
|
462
485
|
/**
|
463
486
|
* @param {HTMLElement} el
|
464
487
|
* @returns {Boolean}
|
@@ -32,6 +32,7 @@ class HighlightJS extends Base {
|
|
32
32
|
*/
|
33
33
|
remote: {
|
34
34
|
app: [
|
35
|
+
'loadLibrary',
|
35
36
|
'scrollIntoView',
|
36
37
|
'syntaxHighlight',
|
37
38
|
'switchTheme',
|
@@ -56,14 +57,26 @@ class HighlightJS extends Base {
|
|
56
57
|
*/
|
57
58
|
construct(config) {
|
58
59
|
super.construct(config);
|
60
|
+
}
|
61
|
+
|
62
|
+
/**
|
63
|
+
* @param {Object} data
|
64
|
+
* @returns {Boolean}
|
65
|
+
*/
|
66
|
+
async loadLibrary(data) {
|
67
|
+
delete data.appName;
|
59
68
|
|
60
69
|
let me = this;
|
61
70
|
|
62
|
-
|
71
|
+
me.set(data);
|
72
|
+
|
73
|
+
await DomAccess.loadScript(me.highlightJsPath).then(() => {
|
63
74
|
DomAccess.addScript({src: me.highlightJsLineNumbersPath});
|
64
75
|
});
|
65
76
|
|
66
77
|
Stylesheet.createStyleSheet(null, 'hljs-theme', me.themePath)
|
78
|
+
|
79
|
+
return true
|
67
80
|
}
|
68
81
|
|
69
82
|
/**
|
@@ -85,17 +98,14 @@ class HighlightJS extends Base {
|
|
85
98
|
|
86
99
|
/**
|
87
100
|
* @param {Object} data
|
88
|
-
* @
|
101
|
+
* @returns {Boolean}
|
89
102
|
*/
|
90
|
-
|
91
|
-
|
92
|
-
let node = document.getElementById(data.vnodeId);
|
103
|
+
setConfigs(data) {
|
104
|
+
delete data.appName;
|
93
105
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
console.error('highlight.js is not included inside the main thread.')
|
98
|
-
}
|
106
|
+
this.set(data);
|
107
|
+
|
108
|
+
return true
|
99
109
|
}
|
100
110
|
|
101
111
|
/**
|
@@ -114,6 +124,21 @@ class HighlightJS extends Base {
|
|
114
124
|
Stylesheet.createStyleSheet(null, 'hljs-theme', switchToTheme);
|
115
125
|
}
|
116
126
|
|
127
|
+
/**
|
128
|
+
* @param {Object} data
|
129
|
+
* @param {String} data.vnodeId
|
130
|
+
*/
|
131
|
+
syntaxHighlight(data) {
|
132
|
+
if (hljs) {
|
133
|
+
let node = document.getElementById(data.vnodeId);
|
134
|
+
|
135
|
+
hljs.highlightBlock(node);
|
136
|
+
hljs.lineNumbersBlock(node);
|
137
|
+
} else {
|
138
|
+
console.error('highlight.js is not included inside the main thread.')
|
139
|
+
}
|
140
|
+
}
|
141
|
+
|
117
142
|
/**
|
118
143
|
* @param {Object} data
|
119
144
|
*/
|
package/src/vdom/Helper.mjs
CHANGED