@node-red/editor-api 4.1.7 → 4.1.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/lib/editor/theme.js +24 -11
- package/package.json +3 -3
package/lib/editor/theme.js
CHANGED
|
@@ -133,7 +133,7 @@ async function loadThemePlugin () {
|
|
|
133
133
|
}
|
|
134
134
|
// check and load page settings from theme
|
|
135
135
|
if (themePlugin.page) {
|
|
136
|
-
if (themePlugin.page.favicon
|
|
136
|
+
if (themePlugin.page.favicon) {
|
|
137
137
|
const result = serveFilesFromTheme(
|
|
138
138
|
[themePlugin.page.favicon],
|
|
139
139
|
themeApp,
|
|
@@ -145,7 +145,7 @@ async function loadThemePlugin () {
|
|
|
145
145
|
themeContext.page.favicon = result[0]
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
if (themePlugin.page.tabicon && themePlugin.page.tabicon.icon
|
|
148
|
+
if (themePlugin.page.tabicon && themePlugin.page.tabicon.icon) {
|
|
149
149
|
const result = serveFilesFromTheme(
|
|
150
150
|
[themePlugin.page.tabicon.icon],
|
|
151
151
|
themeApp,
|
|
@@ -158,14 +158,13 @@ async function loadThemePlugin () {
|
|
|
158
158
|
themeContext.page.tabicon.colour = themeContext.page.tabicon.colour || themeContext.page.tabicon.colour
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
|
|
162
|
-
if (themePlugin.page.title && !theme.page.title) {
|
|
161
|
+
if (themePlugin.page.title) {
|
|
163
162
|
themeContext.page.title = themePlugin.page.title || themeContext.page.title
|
|
164
163
|
}
|
|
165
164
|
}
|
|
166
165
|
// check and load header settings from theme
|
|
167
166
|
if (themePlugin.header) {
|
|
168
|
-
if (themePlugin.header.image
|
|
167
|
+
if (themePlugin.header.image) {
|
|
169
168
|
const result = serveFilesFromTheme(
|
|
170
169
|
[themePlugin.header.image],
|
|
171
170
|
themeApp,
|
|
@@ -176,17 +175,27 @@ async function loadThemePlugin () {
|
|
|
176
175
|
// update themeContext header image
|
|
177
176
|
themeContext.header.image = result[0]
|
|
178
177
|
}
|
|
178
|
+
} else if (themePlugin.header.image === false) {
|
|
179
|
+
themeContext.header.image = false
|
|
179
180
|
}
|
|
180
|
-
// if the plugin has a title
|
|
181
|
-
if (themePlugin.header.title
|
|
182
|
-
themeContext.header.title = themePlugin.header.title
|
|
181
|
+
// if the plugin has a title
|
|
182
|
+
if (themePlugin.header.hasOwnProperty('title')) {
|
|
183
|
+
themeContext.header.title = themePlugin.header.title
|
|
183
184
|
}
|
|
184
|
-
// if the plugin has a header url
|
|
185
|
-
if (themePlugin.header.url
|
|
186
|
-
themeContext.header.url = themePlugin.header.url
|
|
185
|
+
// if the plugin has a header url
|
|
186
|
+
if (themePlugin.header.hasOwnProperty('url')) {
|
|
187
|
+
themeContext.header.url = themePlugin.header.url
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
190
|
|
|
191
|
+
if (themePlugin.menu) {
|
|
192
|
+
themeSettings.menu = Object.assign({}, themeSettings.menu, themePlugin.menu);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (themePlugin.help) {
|
|
196
|
+
themeSettings.help = themePlugin.help;
|
|
197
|
+
}
|
|
198
|
+
|
|
190
199
|
if (Array.isArray(themePlugin.palette?.theme)) {
|
|
191
200
|
themeSettings.palette = themeSettings.palette || {};
|
|
192
201
|
themeSettings.palette.theme = themePlugin.palette.theme;
|
|
@@ -384,6 +393,10 @@ module.exports = {
|
|
|
384
393
|
themeSettings.tours = theme.tours;
|
|
385
394
|
}
|
|
386
395
|
|
|
396
|
+
if (theme.hasOwnProperty("help")) {
|
|
397
|
+
themeSettings.tours = theme.help;
|
|
398
|
+
}
|
|
399
|
+
|
|
387
400
|
return themeApp;
|
|
388
401
|
},
|
|
389
402
|
context: async function() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-red/editor-api",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.8",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
}
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@node-red/util": "4.1.
|
|
20
|
-
"@node-red/editor-client": "4.1.
|
|
19
|
+
"@node-red/util": "4.1.8",
|
|
20
|
+
"@node-red/editor-client": "4.1.8",
|
|
21
21
|
"bcryptjs": "3.0.3",
|
|
22
22
|
"body-parser": "1.20.4",
|
|
23
23
|
"clone": "2.1.2",
|