@node-red/editor-client 4.0.0-beta.3 → 4.0.0-beta.4

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 (39) hide show
  1. package/locales/en-US/editor.json +3 -0
  2. package/locales/fr/editor.json +3 -0
  3. package/locales/ja/editor.json +2 -0
  4. package/package.json +1 -1
  5. package/public/red/about +33 -657
  6. package/public/red/red.js +69 -11
  7. package/public/red/red.min.js +1 -1
  8. package/public/red/style.min.css +1 -1
  9. package/public/red/tours/welcome.js +24 -29
  10. package/public/types/node-red/util.d.ts +1 -1
  11. package/public/vendor/ace/worker-jsonata.js +1 -1
  12. package/public/vendor/mermaid/mermaid.min.js +705 -318
  13. package/public/vendor/monaco/dist/{0c718f5b7d2bce997c5f.ttf → 8f3abbcbc983396e1f13.ttf} +0 -0
  14. package/public/vendor/monaco/dist/css.worker.js +1 -1
  15. package/public/vendor/monaco/dist/css.worker.js.LICENSE.txt +1 -1
  16. package/public/vendor/monaco/dist/editor.js +1 -1
  17. package/public/vendor/monaco/dist/editor.js.LICENSE.txt +1 -1
  18. package/public/vendor/monaco/dist/editor.worker.js +1 -1
  19. package/public/vendor/monaco/dist/html.worker.js +1 -1
  20. package/public/vendor/monaco/dist/html.worker.js.LICENSE.txt +1 -1
  21. package/public/vendor/monaco/dist/json.worker.js +1 -1
  22. package/public/vendor/monaco/dist/json.worker.js.LICENSE.txt +1 -1
  23. package/public/vendor/monaco/dist/locale/cs.js +227 -139
  24. package/public/vendor/monaco/dist/locale/de.js +229 -141
  25. package/public/vendor/monaco/dist/locale/es.js +225 -137
  26. package/public/vendor/monaco/dist/locale/fr.js +226 -138
  27. package/public/vendor/monaco/dist/locale/it.js +226 -138
  28. package/public/vendor/monaco/dist/locale/ja.js +227 -139
  29. package/public/vendor/monaco/dist/locale/ko.js +226 -138
  30. package/public/vendor/monaco/dist/locale/pl.js +227 -139
  31. package/public/vendor/monaco/dist/locale/pt-br.js +243 -155
  32. package/public/vendor/monaco/dist/locale/qps-ploc.js +229 -141
  33. package/public/vendor/monaco/dist/locale/ru.js +225 -137
  34. package/public/vendor/monaco/dist/locale/tr.js +227 -139
  35. package/public/vendor/monaco/dist/locale/zh-hans.js +225 -137
  36. package/public/vendor/monaco/dist/locale/zh-hant.js +228 -140
  37. package/public/vendor/monaco/dist/ts.worker.js +2 -2
  38. package/public/vendor/vendor.js +1 -1
  39. package/templates/index.mst +2 -2
package/public/red/red.js CHANGED
@@ -15882,12 +15882,12 @@ RED.stack = (function() {
15882
15882
  }
15883
15883
  if (menu.opts.multiple) {
15884
15884
  var selected = {};
15885
- this.value().split(",").forEach(function(f) {
15886
- selected[f] = true;
15887
- })
15885
+ this.value().split(",").forEach(function(f) {
15886
+ selected[f] = true;
15887
+ });
15888
15888
  menu.find('input[type="checkbox"]').each(function() {
15889
- $(this).prop("checked",selected[$(this).data('value')])
15890
- })
15889
+ $(this).prop("checked", selected[$(this).data('value')] || false);
15890
+ });
15891
15891
  }
15892
15892
 
15893
15893
 
@@ -15978,7 +15978,7 @@ RED.stack = (function() {
15978
15978
  this.input.trigger('change',[this.propertyType,this.value()]);
15979
15979
  }
15980
15980
  } else {
15981
- this.optionSelectLabel.text(o.length+" selected");
15981
+ this.optionSelectLabel.text(RED._("typedInput.selected", { count: o.length }));
15982
15982
  }
15983
15983
  }
15984
15984
  },
@@ -16867,7 +16867,7 @@ RED.deploy = (function() {
16867
16867
  '<img src="red/images/spin.svg"/>'+
16868
16868
  '</span>'+
16869
16869
  '</a>'+
16870
- '<a id="red-ui-header-button-deploy-options" class="red-ui-deploy-button" href="#"><i class="fa fa-caret-down"></i></a>'+
16870
+ '<a id="red-ui-header-button-deploy-options" class="red-ui-deploy-button" href="#"><i class="fa fa-caret-down"></i><i class="fa fa-lock"></i></a>'+
16871
16871
  '</span></li>').prependTo(".red-ui-header-toolbar");
16872
16872
  const mainMenuItems = [
16873
16873
  {id:"deploymenu-item-full",toggle:"deploy-type",icon:"red/images/deploy-full.svg",label:RED._("deploy.full"),sublabel:RED._("deploy.fullDesc"),selected: true, onselect:function(s) { if(s){changeDeploymentType("full")}}},
@@ -16928,6 +16928,9 @@ RED.deploy = (function() {
16928
16928
  })
16929
16929
 
16930
16930
  RED.events.on('workspace:dirty',function(state) {
16931
+ if (RED.settings.user?.permissions === 'read') {
16932
+ return
16933
+ }
16931
16934
  if (state.dirty) {
16932
16935
  // window.onbeforeunload = function() {
16933
16936
  // return
@@ -16973,6 +16976,22 @@ RED.deploy = (function() {
16973
16976
  activeBackgroundDeployNotification.update(message, options)
16974
16977
  }
16975
16978
  });
16979
+
16980
+
16981
+ updateLockedState()
16982
+ RED.events.on('login', updateLockedState)
16983
+ }
16984
+
16985
+ function updateLockedState() {
16986
+ if (RED.settings.user?.permissions === 'read') {
16987
+ $(".red-ui-deploy-button-group").addClass("readOnly");
16988
+ $("#red-ui-header-button-deploy").addClass("disabled");
16989
+ } else {
16990
+ $(".red-ui-deploy-button-group").removeClass("readOnly");
16991
+ if (RED.nodes.dirty()) {
16992
+ $("#red-ui-header-button-deploy").removeClass("disabled");
16993
+ }
16994
+ }
16976
16995
  }
16977
16996
 
16978
16997
  function getNodeInfo(node) {
@@ -17447,6 +17466,7 @@ RED.deploy = (function() {
17447
17466
  // Once deployed, cannot undo back to a clean state
17448
17467
  RED.history.markAllDirty();
17449
17468
  RED.view.redraw();
17469
+ RED.sidebar.config.refresh();
17450
17470
  RED.events.emit("deploy");
17451
17471
  }).fail(function (xhr, textStatus, err) {
17452
17472
  RED.nodes.dirty(true);
@@ -22935,6 +22955,7 @@ RED.view = (function() {
22935
22955
 
22936
22956
  if (d3.event.button === 1) {
22937
22957
  // Middle Click pan
22958
+ d3.event.preventDefault();
22938
22959
  mouse_mode = RED.state.PANNING;
22939
22960
  mouse_position = [d3.event.pageX,d3.event.pageY]
22940
22961
  scroll_position = [chart.scrollLeft(),chart.scrollTop()];
@@ -32406,7 +32427,13 @@ RED.sidebar.help = (function() {
32406
32427
  toolbar = $("<div>", {class:"red-ui-sidebar-header red-ui-info-toolbar"}).appendTo(content);
32407
32428
  $('<span class="button-group"><a id="red-ui-sidebar-help-show-toc" class="red-ui-button red-ui-button-small selected" href="#"><i class="fa fa-list-ul"></i></a></span>').appendTo(toolbar)
32408
32429
  var showTOCButton = toolbar.find('#red-ui-sidebar-help-show-toc')
32409
- RED.popover.tooltip(showTOCButton,RED._("sidebar.help.showTopics"));
32430
+ RED.popover.tooltip(showTOCButton, function () {
32431
+ if ($(showTOCButton).hasClass('selected')) {
32432
+ return RED._("sidebar.help.hideTopics");
32433
+ } else {
32434
+ return RED._("sidebar.help.showTopics");
32435
+ }
32436
+ });
32410
32437
  showTOCButton.on("click",function(e) {
32411
32438
  e.preventDefault();
32412
32439
  if ($(this).hasClass('selected')) {
@@ -33250,9 +33277,11 @@ RED.sidebar.config = (function() {
33250
33277
  refreshConfigNodeList();
33251
33278
  }
33252
33279
  });
33280
+
33253
33281
  RED.popover.tooltip($('#red-ui-sidebar-config-filter-all'), RED._("sidebar.config.showAllConfigNodes"));
33254
33282
  RED.popover.tooltip($('#red-ui-sidebar-config-filter-unused'), RED._("sidebar.config.showAllUnusedConfigNodes"));
33255
-
33283
+ RED.popover.tooltip($('#red-ui-sidebar-config-collapse-all'), RED._("palette.actions.collapse-all"));
33284
+ RED.popover.tooltip($('#red-ui-sidebar-config-expand-all'), RED._("palette.actions.expand-all"));
33256
33285
  }
33257
33286
 
33258
33287
  function flashConfigNode(el) {
@@ -35367,6 +35396,8 @@ RED.editor = (function() {
35367
35396
  var value = input.val();
35368
35397
  if (defaults[property].hasOwnProperty("format") && defaults[property].format !== "" && input[0].nodeName === "DIV") {
35369
35398
  value = input.text();
35399
+ } else if (input.attr("type") === "checkbox") {
35400
+ value = input.prop("checked");
35370
35401
  }
35371
35402
  var valid = validateNodeProperty(node, defaults, property,value);
35372
35403
  if (((typeof valid) === "string") || !valid) {
@@ -35920,9 +35951,16 @@ RED.editor = (function() {
35920
35951
  }
35921
35952
 
35922
35953
  try {
35923
- var rc = editing_node._def.oneditsave.call(editing_node);
35954
+ const rc = editing_node._def.oneditsave.call(editing_node);
35924
35955
  if (rc === true) {
35925
35956
  editState.changed = true;
35957
+ } else if (typeof rc === 'object' && rc !== null ) {
35958
+ if (rc.changed === true) {
35959
+ editState.changed = true
35960
+ }
35961
+ if (Array.isArray(rc.history) && rc.history.length > 0) {
35962
+ editState.history = rc.history
35963
+ }
35926
35964
  }
35927
35965
  } catch(err) {
35928
35966
  console.warn("oneditsave",editing_node.id,editing_node.type,err.toString());
@@ -36124,6 +36162,17 @@ RED.editor = (function() {
36124
36162
  dirty: startDirty
36125
36163
  }
36126
36164
 
36165
+ if (editing_node.g) {
36166
+ const group = RED.nodes.group(editing_node.g);
36167
+ // Don't use RED.group.removeFromGroup as that emits
36168
+ // a change event on the node - but we're deleting it
36169
+ const index = group?.nodes.indexOf(editing_node) ?? -1;
36170
+ if (index > -1) {
36171
+ group.nodes.splice(index, 1);
36172
+ RED.group.markDirty(group);
36173
+ }
36174
+ }
36175
+
36127
36176
  RED.nodes.dirty(true);
36128
36177
  RED.view.redraw(true);
36129
36178
  RED.history.push(historyEvent);
@@ -36225,7 +36274,7 @@ RED.editor = (function() {
36225
36274
  }
36226
36275
  });
36227
36276
  }
36228
- var historyEvent = {
36277
+ let historyEvent = {
36229
36278
  t:'edit',
36230
36279
  node:editing_node,
36231
36280
  changes:editState.changes,
@@ -36241,6 +36290,15 @@ RED.editor = (function() {
36241
36290
  instances:subflowInstances
36242
36291
  }
36243
36292
  }
36293
+
36294
+ if (editState.history) {
36295
+ historyEvent = {
36296
+ t: 'multi',
36297
+ events: [ historyEvent, ...editState.history ],
36298
+ dirty: wasDirty
36299
+ }
36300
+ }
36301
+
36244
36302
  RED.history.push(historyEvent);
36245
36303
  }
36246
36304
  editing_node.dirty = true;