@node-red/editor-api 4.1.6 → 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 +28 -11
- package/package.json +4 -4
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;
|
|
@@ -198,6 +207,10 @@ async function loadThemePlugin () {
|
|
|
198
207
|
}
|
|
199
208
|
})
|
|
200
209
|
}
|
|
210
|
+
if (Array.isArray(themePlugin.palette?.categories)) {
|
|
211
|
+
themeSettings.palette = themeSettings.palette || {};
|
|
212
|
+
themeSettings.palette.categories = themePlugin.palette.categories;
|
|
213
|
+
}
|
|
201
214
|
|
|
202
215
|
// These settings are not exposed under `editorTheme`, so we don't have a merge strategy for them
|
|
203
216
|
// If they're defined in the theme plugin, they replace any settings.js values.
|
|
@@ -380,6 +393,10 @@ module.exports = {
|
|
|
380
393
|
themeSettings.tours = theme.tours;
|
|
381
394
|
}
|
|
382
395
|
|
|
396
|
+
if (theme.hasOwnProperty("help")) {
|
|
397
|
+
themeSettings.tours = theme.help;
|
|
398
|
+
}
|
|
399
|
+
|
|
383
400
|
return themeApp;
|
|
384
401
|
},
|
|
385
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",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"express": "4.22.1",
|
|
27
27
|
"memorystore": "1.6.7",
|
|
28
28
|
"mime": "3.0.0",
|
|
29
|
-
"multer": "2.
|
|
29
|
+
"multer": "2.1.1",
|
|
30
30
|
"mustache": "4.2.0",
|
|
31
31
|
"oauth2orize": "1.12.0",
|
|
32
32
|
"passport-http-bearer": "1.0.1",
|