@kumologica/sdk 3.5.4 → 3.6.0-alpha7

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.
Files changed (36) hide show
  1. package/cli/cli.js +31 -8
  2. package/cli/commands/open.js +88 -15
  3. package/cli/commands/run.js +167 -0
  4. package/cli/commands/serve.js +139 -0
  5. package/package.json +5 -5
  6. package/src/app/main-process/main-window.js +1 -0
  7. package/src/app/main-process/modal-home.js +1 -0
  8. package/src/app/main-process/modal-newproject.js +1 -0
  9. package/src/app/main-process/modal-newtab.js +1 -0
  10. package/src/app/main-process/modal-nodelibrary.js +1 -0
  11. package/src/app/main-process/modal-renameTab.js +1 -0
  12. package/src/app/main-process/modal-welcome.js +1 -0
  13. package/src/app/main.js +179 -141
  14. package/src/app/preload.js +225 -139
  15. package/src/app/ui/editor-client/public/red/red.js +1943 -783
  16. package/src/app/ui/editor-client/public/red/red.min.js +2 -2
  17. package/src/app/ui/editor-client/public/red/style.min.css +1 -1
  18. package/src/app/ui/editor-client/public/vendor/ace-linters/javascript-service.js +10 -2
  19. package/src/app/ui/editor-client/src/js/red.js +183 -179
  20. package/src/app/ui/editor-client/src/js/ui/common/commandBox.js +107 -0
  21. package/src/app/ui/editor-client/src/js/ui/common/searchBox.js +91 -90
  22. package/src/app/ui/editor-client/src/js/ui/modules.js +164 -0
  23. package/src/app/ui/editor-client/src/js/ui/search.js +171 -123
  24. package/src/app/ui/editor-client/src/js/ui/sidebar.js +1 -1
  25. package/src/app/ui/editor-client/src/js/ui/ui-settings.js +419 -410
  26. package/src/app/ui/editor-client/src/sass/editor.scss +745 -746
  27. package/src/app/ui/editor-client/src/sass/forms.scss +1 -1
  28. package/src/app/ui/editor-client/src/sass/search.scss +16 -2
  29. package/src/app/ui/editor-client/src/sass/sidebar.scss +1 -1
  30. package/src/app/ui/editor-client/src/sass/style.scss +72 -69
  31. package/src/app/ui/editor-client/src/sass/ui/common/commandBox.scss +100 -0
  32. package/src/app/ui/editor-client/src/sass/ui/common/searchBox.scss +3 -2
  33. package/src/app/ui/editor-client/src/sass/ui-settings.scss +14 -14
  34. package/src/app/ui/editor-client/src/vendor/ace-linters/build/javascript-service.js +10 -2
  35. package/src/app/ui/editor-client/templates/index.mst +2 -2
  36. package/src/server/DesignerServer.js +152 -153
@@ -2,33 +2,33 @@ var RED = (function () {
2
2
  let disableComms = false;
3
3
 
4
4
  function appendNodeConfig(nodeConfig, done) {
5
- done = done || function () { };
5
+ done = done || function () {};
6
6
  var m = /<!-- --- \[red-module:(\S+)\] --- -->/.exec(nodeConfig.trim());
7
7
  var moduleId;
8
8
  if (m) {
9
9
  moduleId = m[1];
10
10
  } else {
11
- moduleId = 'unknown';
11
+ moduleId = "unknown";
12
12
  }
13
13
  try {
14
14
  var hasDeferred = false;
15
15
 
16
- var nodeConfigEls = $('<div>' + nodeConfig + '</div>');
17
- var scripts = nodeConfigEls.find('script');
16
+ var nodeConfigEls = $("<div>" + nodeConfig + "</div>");
17
+ var scripts = nodeConfigEls.find("script");
18
18
  var scriptCount = scripts.length;
19
19
  scripts.each(function (i, el) {
20
- var srcUrl = $(el).attr('src');
20
+ var srcUrl = $(el).attr("src");
21
21
  if (srcUrl && !/^\s*(https?:|\/|\.)/.test(srcUrl)) {
22
22
  $(el).remove();
23
- var newScript = document.createElement('script');
23
+ var newScript = document.createElement("script");
24
24
  newScript.onload = function () {
25
25
  scriptCount--;
26
26
  if (scriptCount === 0) {
27
- $('body').append(nodeConfigEls);
27
+ $("body").append(nodeConfigEls);
28
28
  done();
29
29
  }
30
30
  };
31
- $('body').append(newScript);
31
+ $("body").append(newScript);
32
32
  newScript.src = RED.settings.apiRootUrl + srcUrl;
33
33
  hasDeferred = true;
34
34
  } else {
@@ -40,24 +40,25 @@ var RED = (function () {
40
40
  // break the version of ace included in the editor.
41
41
  // At the time of commit, the contrib-python nodes did this.
42
42
  // This is a crude fix until the python nodes are fixed.
43
- console.warn('Blocked attempt to load', srcUrl, 'by', moduleId);
43
+ console.warn("Blocked attempt to load", srcUrl, "by", moduleId);
44
44
  $(el).remove();
45
45
  }
46
46
  scriptCount--;
47
47
  }
48
48
  });
49
49
  if (!hasDeferred) {
50
- $('body').append(nodeConfigEls);
50
+ $("body").append(nodeConfigEls);
51
51
  done();
52
52
  }
53
53
  } catch (err) {
54
- RED.notify(`<p>Failed to load '${moduleId}'</p><p>${err.toString()}</p>`,
54
+ RED.notify(
55
+ `<p>Failed to load '${moduleId}'</p><p>${err.toString()}</p>`,
55
56
  {
56
- type: 'error',
57
+ type: "error",
57
58
  timeout: 10000,
58
59
  }
59
60
  );
60
- console.log('[' + moduleId + '] ' + err.toString());
61
+ console.log("[" + moduleId + "] " + err.toString());
61
62
  done();
62
63
  }
63
64
  }
@@ -65,10 +66,10 @@ var RED = (function () {
65
66
  function loadNodeList() {
66
67
  $.ajax({
67
68
  headers: {
68
- Accept: 'application/json',
69
+ Accept: "application/json",
69
70
  },
70
71
  cache: false,
71
- url: 'nodes',
72
+ url: "nodes",
72
73
  success: function (data) {
73
74
  RED.nodes.setNodeList(data);
74
75
  // RED.i18n.loadNodeCatalogs(function () {
@@ -81,10 +82,10 @@ var RED = (function () {
81
82
  function loadIconList(done) {
82
83
  $.ajax({
83
84
  headers: {
84
- Accept: 'application/json',
85
+ Accept: "application/json",
85
86
  },
86
87
  cache: false,
87
- url: '__icons',
88
+ url: "__icons",
88
89
  success: function (data) {
89
90
  RED.nodes.setIconSets(data);
90
91
  if (done) {
@@ -97,28 +98,28 @@ var RED = (function () {
97
98
  function loadNodes() {
98
99
  $.ajax({
99
100
  headers: {
100
- Accept: 'text/html',
101
+ Accept: "text/html",
101
102
  },
102
103
  cache: false,
103
- url: 'nodes',
104
+ url: "nodes",
104
105
  success: function (data) {
105
106
  var configs = data
106
107
  .trim()
107
108
  .split(/(?=<!-- --- \[red-module:\S+\] --- -->)/);
108
109
  var stepConfig = function () {
109
110
  if (configs.length === 0) {
110
- $('body').i18n();
111
- $('#palette > .palette-spinner').hide();
112
- $('.palette-scroll').removeClass('hide');
113
- $('#palette-search').removeClass('hide');
111
+ $("body").i18n();
112
+ $("#palette > .palette-spinner").hide();
113
+ $(".palette-scroll").removeClass("hide");
114
+ $("#palette-search").removeClass("hide");
114
115
  loadFlows(function () {
115
- if (RED.settings.theme('projects.enabled', false)) {
116
+ if (RED.settings.theme("projects.enabled", false)) {
116
117
  RED.projects.refresh(function (activeProject) {
117
118
  RED.sidebar.info.refresh();
118
119
  if (!activeProject) {
119
120
  // Projects enabled but no active project
120
- RED.menu.setDisabled('menu-item-projects-open', true);
121
- RED.menu.setDisabled('menu-item-projects-settings', true);
121
+ RED.menu.setDisabled("menu-item-projects-open", true);
122
+ RED.menu.setDisabled("menu-item-projects-settings", true);
122
123
  if (activeProject === false) {
123
124
  // User previously decline the migration to projects.
124
125
  } else {
@@ -147,10 +148,10 @@ var RED = (function () {
147
148
  function loadFlows(done) {
148
149
  $.ajax({
149
150
  headers: {
150
- Accept: 'application/json',
151
+ Accept: "application/json",
151
152
  },
152
153
  cache: false,
153
- url: 'flows',
154
+ url: "flows",
154
155
  success: function (nodes) {
155
156
  if (nodes) {
156
157
  var currentHash = window.location.hash;
@@ -169,18 +170,18 @@ var RED = (function () {
169
170
 
170
171
  function completeLoad() {
171
172
  var persistentNotifications = {};
172
- RED.comms.subscribe('notification/#', function (topic, msg) {
173
- var parts = topic.split('/');
173
+ RED.comms.subscribe("notification/#", function (topic, msg) {
174
+ var parts = topic.split("/");
174
175
  var notificationId = parts[1];
175
- if (notificationId === 'runtime-deploy') {
176
+ if (notificationId === "runtime-deploy") {
176
177
  // handled in ui/deploy.js
177
178
  return;
178
179
  }
179
- if (notificationId === 'node') {
180
+ if (notificationId === "node") {
180
181
  // handled below
181
182
  return;
182
183
  }
183
- if (notificationId === 'project-update') {
184
+ if (notificationId === "project-update") {
184
185
  RED.nodes.clear();
185
186
  RED.history.clear();
186
187
  RED.view.redraw(true);
@@ -201,28 +202,28 @@ var RED = (function () {
201
202
  timeout: msg.timeout,
202
203
  id: notificationId,
203
204
  };
204
- if (notificationId === 'runtime-state') {
205
- if (msg.error === 'safe-mode') {
205
+ if (notificationId === "runtime-state") {
206
+ if (msg.error === "safe-mode") {
206
207
  options.buttons = [
207
208
  {
208
- text: 'Close',
209
+ text: "Close",
209
210
  click: function () {
210
211
  persistentNotifications[notificationId].hideNotification();
211
212
  },
212
213
  },
213
214
  ];
214
- } else if (msg.error === 'missing-types') {
215
+ } else if (msg.error === "missing-types") {
215
216
  text +=
216
- '<ul><li>' +
217
- msg.types.map(RED.utils.sanitize).join('</li><li>') +
218
- '</li></ul>';
217
+ "<ul><li>" +
218
+ msg.types.map(RED.utils.sanitize).join("</li><li>") +
219
+ "</li></ul>";
219
220
  if (!!RED.projects.getActiveProject()) {
220
221
  options.buttons = [
221
222
  {
222
- text: 'Manage project dependencies',
223
+ text: "Manage project dependencies",
223
224
  click: function () {
224
225
  persistentNotifications[notificationId].hideNotification();
225
- RED.projects.settings.show('deps');
226
+ RED.projects.settings.show("deps");
226
227
  },
227
228
  },
228
229
  ];
@@ -230,20 +231,20 @@ var RED = (function () {
230
231
  } else {
231
232
  options.buttons = [
232
233
  {
233
- text: 'Close',
234
+ text: "Close",
234
235
  click: function () {
235
236
  persistentNotifications[notificationId].hideNotification();
236
237
  },
237
238
  },
238
239
  ];
239
240
  }
240
- } else if (msg.error === 'credentials_load_failed') {
241
- if (RED.settings.theme('projects.enabled', false)) {
241
+ } else if (msg.error === "credentials_load_failed") {
242
+ if (RED.settings.theme("projects.enabled", false)) {
242
243
  // projects enabled
243
- if (RED.user.hasPermission('projects.write')) {
244
+ if (RED.user.hasPermission("projects.write")) {
244
245
  options.buttons = [
245
246
  {
246
- text: 'Setup credentials',
247
+ text: "Setup credentials",
247
248
  click: function () {
248
249
  persistentNotifications[
249
250
  notificationId
@@ -256,18 +257,18 @@ var RED = (function () {
256
257
  } else {
257
258
  options.buttons = [
258
259
  {
259
- text: 'Close',
260
+ text: "Close",
260
261
  click: function () {
261
262
  persistentNotifications[notificationId].hideNotification();
262
263
  },
263
264
  },
264
265
  ];
265
266
  }
266
- } else if (msg.error === 'missing_flow_file') {
267
- if (RED.user.hasPermission('projects.write')) {
267
+ } else if (msg.error === "missing_flow_file") {
268
+ if (RED.user.hasPermission("projects.write")) {
268
269
  options.buttons = [
269
270
  {
270
- text: 'Setup credentials',
271
+ text: "Setup credentials",
271
272
  click: function () {
272
273
  persistentNotifications[notificationId].hideNotification();
273
274
  RED.projects.showFilesPrompt();
@@ -275,11 +276,11 @@ var RED = (function () {
275
276
  },
276
277
  ];
277
278
  }
278
- } else if (msg.error === 'missing_package_file') {
279
- if (RED.user.hasPermission('projects.write')) {
279
+ } else if (msg.error === "missing_package_file") {
280
+ if (RED.user.hasPermission("projects.write")) {
280
281
  options.buttons = [
281
282
  {
282
- text: 'Setup credentials',
283
+ text: "Setup credentials",
283
284
  click: function () {
284
285
  persistentNotifications[notificationId].hideNotification();
285
286
  RED.projects.showFilesPrompt();
@@ -287,17 +288,17 @@ var RED = (function () {
287
288
  },
288
289
  ];
289
290
  }
290
- } else if (msg.error === 'project_empty') {
291
- if (RED.user.hasPermission('projects.write')) {
291
+ } else if (msg.error === "project_empty") {
292
+ if (RED.user.hasPermission("projects.write")) {
292
293
  options.buttons = [
293
294
  {
294
- text: 'No thanks',
295
+ text: "No thanks",
295
296
  click: function () {
296
297
  persistentNotifications[notificationId].hideNotification();
297
298
  },
298
299
  },
299
300
  {
300
- text: 'Create default project files',
301
+ text: "Create default project files",
301
302
  click: function () {
302
303
  persistentNotifications[notificationId].hideNotification();
303
304
  RED.projects.createDefaultFileSet();
@@ -305,13 +306,13 @@ var RED = (function () {
305
306
  },
306
307
  ];
307
308
  }
308
- } else if (msg.error === 'git_merge_conflict') {
309
+ } else if (msg.error === "git_merge_conflict") {
309
310
  RED.nodes.clear();
310
311
  RED.sidebar.versionControl.refresh(true);
311
- if (RED.user.hasPermission('projects.write')) {
312
+ if (RED.user.hasPermission("projects.write")) {
312
313
  options.buttons = [
313
314
  {
314
- text: 'Show merge conflicts',
315
+ text: "Show merge conflicts",
315
316
  click: function () {
316
317
  persistentNotifications[notificationId].hideNotification();
317
318
  RED.sidebar.versionControl.showLocalChanges();
@@ -331,11 +332,11 @@ var RED = (function () {
331
332
  delete persistentNotifications[notificationId];
332
333
  }
333
334
  });
334
- RED.comms.subscribe('status/#', function (topic, msg) {
335
- var parts = topic.split('/');
335
+ RED.comms.subscribe("status/#", function (topic, msg) {
336
+ var parts = topic.split("/");
336
337
  var node = RED.nodes.node(parts[1]);
337
338
  if (node) {
338
- if (msg.hasOwnProperty('text') && /^[a-zA-Z]/.test(msg.text)) {
339
+ if (msg.hasOwnProperty("text") && /^[a-zA-Z]/.test(msg.text)) {
339
340
  msg.text = node._(msg.text.toString(), {
340
341
  defaultValue: msg.text.toString(),
341
342
  });
@@ -345,74 +346,77 @@ var RED = (function () {
345
346
  RED.view.redraw();
346
347
  }
347
348
  });
348
- RED.comms.subscribe('notification/node/#', function (topic, msg) {
349
+ RED.comms.subscribe("notification/node/#", function (topic, msg) {
349
350
  var i, m;
350
351
  var typeList;
351
352
  var info;
352
- if (topic == 'notification/node/added') {
353
+ if (topic == "notification/node/added") {
353
354
  var addedTypes = [];
354
355
  msg.forEach(function (m) {
355
356
  var id = m.id;
356
357
  RED.nodes.addNodeSet(m);
357
358
  addedTypes = addedTypes.concat(m.types);
358
359
  RED.i18n.loadNodeCatalog(id, function () {
359
- $.get('nodes/' + id, function (data) {
360
+ $.get("nodes/" + id, function (data) {
360
361
  appendNodeConfig(data);
361
362
  });
362
363
  });
363
364
  });
364
365
  if (addedTypes.length) {
365
- typeList = '<ul><li>' + addedTypes.join('</li><li>') + '</li></ul>';
366
- RED.notify(`Node added to palette: ${addedTypes.length} ` + typeList,
367
- 'success'
366
+ typeList = "<ul><li>" + addedTypes.join("</li><li>") + "</li></ul>";
367
+ RED.notify(
368
+ `Node added to palette: ${addedTypes.length} ` + typeList,
369
+ "success"
368
370
  );
369
371
  }
370
372
  loadIconList();
371
- } else if (topic == 'notification/node/removed') {
373
+ } else if (topic == "notification/node/removed") {
372
374
  for (i = 0; i < msg.length; i++) {
373
375
  m = msg[i];
374
376
  info = RED.nodes.removeNodeSet(m.id);
375
377
  if (info.added) {
376
- typeList = '<ul><li>' + m.types.join('</li><li>') + '</li></ul>';
377
- RED.notify(`Node removed from palette: ${m.types.length}` + typeList,
378
- 'success'
378
+ typeList = "<ul><li>" + m.types.join("</li><li>") + "</li></ul>";
379
+ RED.notify(
380
+ `Node removed from palette: ${m.types.length}` + typeList,
381
+ "success"
379
382
  );
380
383
  }
381
384
  }
382
385
  loadIconList();
383
- } else if (topic == 'notification/node/enabled') {
386
+ } else if (topic == "notification/node/enabled") {
384
387
  if (msg.types) {
385
388
  info = RED.nodes.getNodeSet(msg.id);
386
389
  if (info.added) {
387
390
  RED.nodes.enableNodeSet(msg.id);
388
- typeList = '<ul><li>' + msg.types.join('</li><li>') + '</li></ul>';
391
+ typeList = "<ul><li>" + msg.types.join("</li><li>") + "</li></ul>";
389
392
  // RED.notify(
390
393
  // RED._('palette.event.nodeEnabled', { count: msg.types.length }) +
391
394
  // typeList,
392
395
  // 'success'
393
396
  // );
394
397
  } else {
395
- $.get('nodes/' + msg.id, function (data) {
398
+ $.get("nodes/" + msg.id, function (data) {
396
399
  appendNodeConfig(data);
397
400
  typeList =
398
- '<ul><li>' + msg.types.join('</li><li>') + '</li></ul>';
399
- RED.notify(`Node added to palette: ${msg.types.length} ` + typeList,
400
- 'success'
401
+ "<ul><li>" + msg.types.join("</li><li>") + "</li></ul>";
402
+ RED.notify(
403
+ `Node added to palette: ${msg.types.length} ` + typeList,
404
+ "success"
401
405
  );
402
406
  });
403
407
  }
404
408
  }
405
- } else if (topic == 'notification/node/disabled') {
409
+ } else if (topic == "notification/node/disabled") {
406
410
  if (msg.types) {
407
411
  RED.nodes.disableNodeSet(msg.id);
408
- typeList = '<ul><li>' + msg.types.join('</li><li>') + '</li></ul>';
412
+ typeList = "<ul><li>" + msg.types.join("</li><li>") + "</li></ul>";
409
413
  // RED.notify(
410
414
  // RED._('palette.event.nodeDisabled', { count: msg.types.length }) +
411
415
  // typeList,
412
416
  // 'success'
413
417
  // );
414
418
  }
415
- } else if (topic == 'notification/node/upgraded') {
419
+ } else if (topic == "notification/node/upgraded") {
416
420
  // RED.notify(
417
421
  // RED._('palette.event.nodeUpgraded', {
418
422
  // module: msg.module,
@@ -423,18 +427,18 @@ var RED = (function () {
423
427
  RED.nodes.registry.setModulePendingUpdated(msg.module, msg.version);
424
428
  }
425
429
  });
426
- RED.comms.subscribe('event-log/#', function (topic, payload) {
430
+ RED.comms.subscribe("event-log/#", function (topic, payload) {
427
431
  var id = topic.substring(9);
428
432
  RED.eventLog.log(id, payload);
429
433
  });
430
434
  }
431
435
 
432
436
  function showAbout() {
433
- $.get('red/about', function (data) {
437
+ $.get("red/about", function (data) {
434
438
  var aboutHeader =
435
439
  '<div style="text-align:center;">' +
436
440
  '<img width="50px" src="red/images/kumologica-core-icon.svg" />' +
437
- '</div>';
441
+ "</div>";
438
442
 
439
443
  RED.sidebar.info.set(aboutHeader + marked(data));
440
444
  RED.sidebar.info.show();
@@ -443,180 +447,180 @@ var RED = (function () {
443
447
 
444
448
  function loadEditor() {
445
449
  var menuOptions = [];
446
- if (RED.settings.theme('projects.enabled', false)) {
450
+ if (RED.settings.theme("projects.enabled", false)) {
447
451
  menuOptions.push({
448
- id: 'menu-item-projects-menu',
449
- label: 'Projects',
452
+ id: "menu-item-projects-menu",
453
+ label: "Projects",
450
454
  options: [
451
455
  {
452
- id: 'menu-item-projects-new',
453
- label: 'New',
456
+ id: "menu-item-projects-new",
457
+ label: "New",
454
458
  disabled: false,
455
- onselect: 'core:new-project',
459
+ onselect: "core:new-project",
456
460
  },
457
461
  {
458
- id: 'menu-item-projects-open',
459
- label: 'Open',
462
+ id: "menu-item-projects-open",
463
+ label: "Open",
460
464
  disabled: false,
461
- onselect: 'core:open-project',
465
+ onselect: "core:open-project",
462
466
  },
463
467
  {
464
- id: 'menu-item-projects-settings',
465
- label: 'Project Settings',
468
+ id: "menu-item-projects-settings",
469
+ label: "Project Settings",
466
470
  disabled: false,
467
- onselect: 'core:show-project-settings',
471
+ onselect: "core:show-project-settings",
468
472
  },
469
473
  ],
470
474
  });
471
475
  }
472
476
 
473
477
  menuOptions.push({
474
- id: 'menu-item-view-menu',
475
- label: 'View',
478
+ id: "menu-item-view-menu",
479
+ label: "View",
476
480
  options: [
477
481
  {
478
- id: 'menu-item-palette',
479
- label: 'Show palette',
482
+ id: "menu-item-palette",
483
+ label: "Show palette",
480
484
  toggle: true,
481
- onselect: 'core:toggle-palette',
485
+ onselect: "core:toggle-palette",
482
486
  selected: true,
483
487
  },
484
488
  {
485
- id: 'menu-item-sidebar',
486
- label: 'Show sidebar',
489
+ id: "menu-item-sidebar",
490
+ label: "Show sidebar",
487
491
  toggle: true,
488
- onselect: 'core:toggle-sidebar',
492
+ onselect: "core:toggle-sidebar",
489
493
  selected: false,
490
494
  },
491
495
  {
492
- id: 'menu-item-event-log',
493
- label: 'Event log',
494
- onselect: 'core:show-event-log',
496
+ id: "menu-item-event-log",
497
+ label: "Event log",
498
+ onselect: "core:show-event-log",
495
499
  },
496
500
  null,
497
501
  ],
498
502
  });
499
503
  menuOptions.push(null);
500
504
  menuOptions.push({
501
- id: 'menu-item-import',
502
- label: 'Import',
505
+ id: "menu-item-import",
506
+ label: "Import",
503
507
  options: [
504
508
  {
505
- id: 'menu-item-import-clipboard',
506
- label: 'Clipboard',
507
- onselect: 'core:show-import-dialog',
509
+ id: "menu-item-import-clipboard",
510
+ label: "Clipboard",
511
+ onselect: "core:show-import-dialog",
508
512
  },
509
513
  {
510
- id: 'menu-item-import-library',
511
- label: 'Library',
514
+ id: "menu-item-import-library",
515
+ label: "Library",
512
516
  options: [],
513
517
  },
514
518
  ],
515
519
  });
516
520
  menuOptions.push({
517
- id: 'menu-item-export',
518
- label: 'Export',
521
+ id: "menu-item-export",
522
+ label: "Export",
519
523
  options: [
520
524
  {
521
- id: 'menu-item-export-clipboard',
522
- label: 'Clipboard',
523
- onselect: 'core:show-export-dialog',
525
+ id: "menu-item-export-clipboard",
526
+ label: "Clipboard",
527
+ onselect: "core:show-export-dialog",
524
528
  },
525
529
  {
526
- id: 'menu-item-export-library',
527
- label: 'Library',
530
+ id: "menu-item-export-library",
531
+ label: "Library",
528
532
  disabled: true,
529
- onselect: 'core:library-export',
533
+ onselect: "core:library-export",
530
534
  },
531
535
  ],
532
536
  });
533
537
  menuOptions.push(null);
534
538
  menuOptions.push({
535
- id: 'menu-item-search',
536
- label: 'Search',
537
- onselect: 'core:search',
539
+ id: "menu-item-search",
540
+ label: "Search",
541
+ onselect: "core:search",
538
542
  });
539
543
  menuOptions.push(null);
540
544
  menuOptions.push({
541
- id: 'menu-item-config-nodes',
542
- label: 'Configuration nodes',
543
- onselect: 'core:show-config-tab',
545
+ id: "menu-item-config-nodes",
546
+ label: "Configuration nodes",
547
+ onselect: "core:show-config-tab",
544
548
  });
545
549
  menuOptions.push({
546
- id: 'menu-item-workspace',
547
- label: 'Flows',
550
+ id: "menu-item-workspace",
551
+ label: "Flows",
548
552
  options: [
549
553
  {
550
- id: 'menu-item-workspace-add',
551
- label: 'Add',
552
- onselect: 'core:add-flow',
554
+ id: "menu-item-workspace-add",
555
+ label: "Add",
556
+ onselect: "core:add-flow",
553
557
  },
554
558
  {
555
- id: 'menu-item-workspace-edit',
556
- label: 'Rename',
557
- onselect: 'core:edit-flow',
559
+ id: "menu-item-workspace-edit",
560
+ label: "Rename",
561
+ onselect: "core:edit-flow",
558
562
  },
559
563
  {
560
- id: 'menu-item-workspace-delete',
561
- label: 'Delete',
562
- onselect: 'core:remove-flow',
564
+ id: "menu-item-workspace-delete",
565
+ label: "Delete",
566
+ onselect: "core:remove-flow",
563
567
  },
564
568
  ],
565
569
  });
566
570
  menuOptions.push({
567
- id: 'menu-item-subflow',
568
- label: 'Subflows',
571
+ id: "menu-item-subflow",
572
+ label: "Subflows",
569
573
  options: [
570
574
  {
571
- id: 'menu-item-subflow-create',
572
- label: 'Create Subflow',
573
- onselect: 'core:create-subflow',
575
+ id: "menu-item-subflow-create",
576
+ label: "Create Subflow",
577
+ onselect: "core:create-subflow",
574
578
  },
575
579
  {
576
- id: 'menu-item-subflow-convert',
577
- label: 'Selection to Subflow',
580
+ id: "menu-item-subflow-convert",
581
+ label: "Selection to Subflow",
578
582
  disabled: true,
579
- onselect: 'core:convert-to-subflow',
583
+ onselect: "core:convert-to-subflow",
580
584
  },
581
585
  ],
582
586
  });
583
587
  menuOptions.push(null);
584
- if (RED.settings.theme('palette.editable') !== false) {
588
+ if (RED.settings.theme("palette.editable") !== false) {
585
589
  menuOptions.push({
586
- id: 'menu-item-edit-palette',
587
- label: 'Manage palette',
588
- onselect: 'core:manage-palette',
590
+ id: "menu-item-edit-palette",
591
+ label: "Manage palette",
592
+ onselect: "core:manage-palette",
589
593
  });
590
594
  menuOptions.push(null);
591
595
  }
592
596
 
593
597
  menuOptions.push({
594
- id: 'menu-item-user-settings',
595
- label: 'Settings',
596
- onselect: 'core:show-user-settings',
598
+ id: "menu-item-user-settings",
599
+ label: "Settings",
600
+ onselect: "core:show-user-settings",
597
601
  });
598
602
  menuOptions.push(null);
599
603
 
600
604
  menuOptions.push({
601
- id: 'menu-item-keyboard-shortcuts',
602
- label: 'Keyboard shortcuts',
603
- onselect: 'core:show-help',
605
+ id: "menu-item-keyboard-shortcuts",
606
+ label: "Keyboard shortcuts",
607
+ onselect: "core:show-help",
604
608
  });
605
609
  menuOptions.push({
606
- id: 'menu-item-help',
610
+ id: "menu-item-help",
607
611
  label: RED.settings.theme(
608
- 'menu.menu-item-help.label',
609
- 'Kumologica website'
612
+ "menu.menu-item-help.label",
613
+ "Kumologica website"
610
614
  ),
611
615
  href: RED.settings.theme(
612
- 'menu.menu-item-help.url',
613
- 'http://kumologica.com/docs'
616
+ "menu.menu-item-help.url",
617
+ "http://kumologica.com/docs"
614
618
  ),
615
619
  });
616
620
  menuOptions.push({
617
- id: 'menu-item-kumologica-core-version',
618
- label: 'v' + RED.settings.version,
619
- onselect: 'core:show-about',
621
+ id: "menu-item-kumologica-core-version",
622
+ label: "v" + RED.settings.version,
623
+ onselect: "core:show-about",
620
624
  });
621
625
 
622
626
  RED.view.init();
@@ -628,13 +632,13 @@ var RED = (function () {
628
632
  RED.palette.explorer.init();
629
633
  RED.palette.nodes.init();
630
634
  RED.eventLog.init();
631
- if (RED.settings.theme('palette.editable') !== false) {
635
+ if (RED.settings.theme("palette.editable") !== false) {
632
636
  RED.palette.editor.init();
633
637
  }
634
638
 
635
639
  RED.sidebar.init();
636
640
 
637
- if (RED.settings.theme('projects.enabled', false)) {
641
+ if (RED.settings.theme("projects.enabled", false)) {
638
642
  RED.projects.init();
639
643
  }
640
644
 
@@ -645,16 +649,17 @@ var RED = (function () {
645
649
  RED.search.init();
646
650
  RED.projectInfo.init();
647
651
  RED.uiSettings.init();
652
+ RED.modules.init();
648
653
 
649
654
  RED.editor.init();
650
655
  //RED.diff.init();
651
656
 
652
- RED.menu.init({ id: 'btn-sidemenu', options: menuOptions });
657
+ RED.menu.init({ id: "btn-sidemenu", options: menuOptions });
653
658
 
654
- RED.deploy.init(RED.settings.theme('deployButton', null));
659
+ RED.deploy.init(RED.settings.theme("deployButton", null));
655
660
  RED.notifications.init();
656
661
 
657
- RED.actions.add('core:show-about', showAbout);
662
+ RED.actions.add("core:show-about", showAbout);
658
663
  RED.nodes.init();
659
664
 
660
665
  if (!disableComms) {
@@ -672,8 +677,8 @@ var RED = (function () {
672
677
 
673
678
  //RED.comms.connectWS();
674
679
 
675
- $('#main-container').show();
676
- $('.header-toolbar').show();
680
+ $("#main-container").show();
681
+ $(".header-toolbar").show();
677
682
 
678
683
  // Terminal must go before headers, as they reference the terminal in the shelves section
679
684
  //RED.terminal.init();
@@ -687,21 +692,20 @@ var RED = (function () {
687
692
 
688
693
  function init(options) {
689
694
  if (initialised) {
690
- throw new Error('RED already initialised');
695
+ throw new Error("RED already initialised");
691
696
  }
692
697
  disableComms = options.disableComms || false;
693
698
  initialised = true;
694
- ace.require('ace/ext/language_tools');
699
+ ace.require("ace/ext/language_tools");
695
700
  options = options || {};
696
- options.apiRootUrl = options.apiRootUrl || '';
701
+ options.apiRootUrl = options.apiRootUrl || "";
697
702
  if (options.apiRootUrl && !/\/$/.test(options.apiRootUrl)) {
698
- options.apiRootUrl = options.apiRootUrl + '/';
703
+ options.apiRootUrl = options.apiRootUrl + "/";
699
704
  }
700
705
  RED.i18n.init(options, function () {
701
706
  RED.settings.init(options, loadEditor);
702
707
  });
703
708
  RED.footer.init();
704
-
705
709
  }
706
710
 
707
711
  return {