@node-red/editor-api 3.0.0-beta.4 → 3.0.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.
@@ -101,7 +101,10 @@ module.exports = {
101
101
  }
102
102
  themeSettings = null;
103
103
  theme = settings.editorTheme || {};
104
- themeContext.asset.vendorMonaco = ((theme.codeEditor || {}).lib === "monaco") ? "vendor/monaco/monaco-bootstrap.js" : "";
104
+ themeContext.asset.vendorMonaco = "vendor/monaco/monaco-bootstrap.js"
105
+ if (theme.codeEditor && theme.codeEditor.lib === 'ace') {
106
+ themeContext.asset.vendorMonaco = ''
107
+ }
105
108
  activeTheme = theme.theme;
106
109
  },
107
110
 
@@ -263,9 +266,69 @@ module.exports = {
263
266
  theme.page = theme.page || {_:{}}
264
267
  theme.page._.scripts = scriptFiles.concat(theme.page._.scripts || [])
265
268
  }
266
- if(theme.codeEditor) {
267
- theme.codeEditor.options = Object.assign({}, themePlugin.monacoOptions, theme.codeEditor.options);
269
+ // check and load page settings from theme
270
+ if (themePlugin.page) {
271
+ if (themePlugin.page.favicon && !theme.page.favicon) {
272
+ const result = serveFilesFromTheme(
273
+ [themePlugin.page.favicon],
274
+ themeApp,
275
+ "/",
276
+ themePlugin.path
277
+ )
278
+ if(result && result.length > 0) {
279
+ // update themeContext page favicon
280
+ themeContext.page.favicon = result[0]
281
+ theme.page = theme.page || {_:{}}
282
+ theme.page._.favicon = result[0]
283
+ }
284
+ }
285
+ if (themePlugin.page.tabicon && themePlugin.page.tabicon.icon && !theme.page.tabicon) {
286
+ const result = serveFilesFromTheme(
287
+ [themePlugin.page.tabicon.icon],
288
+ themeApp,
289
+ "/page/",
290
+ themePlugin.path
291
+ )
292
+ if(result && result.length > 0) {
293
+ // update themeContext page tabicon
294
+ themeContext.page.tabicon.icon = result[0]
295
+ themeContext.page.tabicon.colour = themeContext.page.tabicon.colour || themeContext.page.tabicon.colour
296
+ theme.page = theme.page || {_:{}}
297
+ theme.page._.tabicon = theme.page._.tabicon || {}
298
+ theme.page._.tabicon.icon = themeContext.page.tabicon.icon
299
+ theme.page._.tabicon.colour = themeContext.page.tabicon.colour
300
+ }
301
+ }
302
+ // if the plugin has a title AND the users settings.js does NOT
303
+ if (themePlugin.page.title && !theme.page.title) {
304
+ themeContext.page.title = themePlugin.page.title || themeContext.page.title
305
+ }
306
+ }
307
+ // check and load header settings from theme
308
+ if (themePlugin.header) {
309
+ if (themePlugin.header.image && !theme.header.image) {
310
+ const result = serveFilesFromTheme(
311
+ [themePlugin.header.image],
312
+ themeApp,
313
+ "/header/",
314
+ themePlugin.path
315
+ )
316
+ if(result && result.length > 0) {
317
+ // update themeContext header image
318
+ themeContext.header.image = result[0]
319
+ }
320
+ }
321
+ // if the plugin has a title AND the users settings.js does NOT have a title
322
+ if (themePlugin.header.title && !theme.header.title) {
323
+ themeContext.header.title = themePlugin.header.title || themeContext.header.title
324
+ }
325
+ // if the plugin has a header url AND the users settings.js does NOT
326
+ if (themePlugin.header.url && !theme.header.url) {
327
+ themeContext.header.url = themePlugin.header.url || themeContext.header.url
328
+ }
268
329
  }
330
+ theme.codeEditor = theme.codeEditor || {}
331
+ theme.codeEditor.options = Object.assign({}, themePlugin.monacoOptions, theme.codeEditor.options);
269
332
  }
270
333
  activeThemeInitialised = true;
271
334
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-red/editor-api",
3
- "version": "3.0.0-beta.4",
3
+ "version": "3.0.2",
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": "3.0.0-beta.4",
20
- "@node-red/editor-client": "3.0.0-beta.4",
19
+ "@node-red/util": "3.0.2",
20
+ "@node-red/editor-client": "3.0.2",
21
21
  "bcryptjs": "2.4.3",
22
22
  "body-parser": "1.20.0",
23
23
  "clone": "2.1.2",
@@ -31,7 +31,7 @@
31
31
  "oauth2orize": "1.11.1",
32
32
  "passport-http-bearer": "1.0.1",
33
33
  "passport-oauth2-client-password": "0.1.2",
34
- "passport": "0.5.2",
34
+ "passport": "0.6.0",
35
35
  "ws": "7.5.6"
36
36
  },
37
37
  "optionalDependencies": {