From f786c7f144d20008ad0b496b3ae2965261ec5eb7 Mon Sep 17 00:00:00 2001 From: Hiroyasu Nishiyama Date: Thu, 13 Jan 2022 21:42:50 +0900 Subject: [PATCH 1/6] fix JSON propety validation of inject node --- .../node_modules/@node-red/nodes/core/common/20-inject.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/nodes/core/common/20-inject.html b/packages/node_modules/@node-red/nodes/core/common/20-inject.html index a5dcb061a..f233c62fd 100644 --- a/packages/node_modules/@node-red/nodes/core/common/20-inject.html +++ b/packages/node_modules/@node-red/nodes/core/common/20-inject.html @@ -234,7 +234,7 @@ } } else if (v[i].vt === "jsonata") { try{jsonata(v[i].v);}catch(e){return false;} - } else if ([i].vt === "json") { + } else if (v[i].vt === "json") { try{JSON.parse(v[i].v);}catch(e){return false;} } } From e7189ab81f3c1fadce09a9e2ba2ab9406a656e48 Mon Sep 17 00:00:00 2001 From: Hiroyasu Nishiyama Date: Thu, 13 Jan 2022 23:52:06 +0900 Subject: [PATCH 2/6] fix unit value validation of delay node --- .../node_modules/@node-red/nodes/core/function/89-delay.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/nodes/core/function/89-delay.html b/packages/node_modules/@node-red/nodes/core/function/89-delay.html index 3ae4637d7..8ee404924 100644 --- a/packages/node_modules/@node-red/nodes/core/function/89-delay.html +++ b/packages/node_modules/@node-red/nodes/core/function/89-delay.html @@ -114,7 +114,8 @@ timeout: {value:"5", required:true, validate:function(v) { return RED.validators.number(v) && (v >= 0); }}, timeoutUnits: {value:"seconds"}, rate: {value:"1", required:true, validate:function(v) { return RED.validators.number(v) && (v >= 0); }}, - nbRateUnits: {value:"1", required:false, validate:RED.validators.regex(/\d+|/)}, + nbRateUnits: {value:"1", required:false, + validate:function(v) { return RED.validators.number(v) && (v >= 0); }}, rateUnits: {value: "second"}, randomFirst: {value:"1", required:true, validate:function(v) { return RED.validators.number(v) && (v >= 0); }}, randomLast: {value:"5", required:true, validate:function(v) { return RED.validators.number(v) && (v >= 0); }}, From a2c9458b1be417eb02f284f6295a7d3608fa4951 Mon Sep 17 00:00:00 2001 From: Hiroyasu Nishiyama Date: Sat, 15 Jan 2022 13:11:56 +0900 Subject: [PATCH 3/6] aligin start of property error tooltip messages --- packages/node_modules/@node-red/editor-client/src/js/ui/view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index 166cb2901..b471dd768 100755 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -596,7 +596,7 @@ RED.view = (function() { }, tooltip: function(d) { if (d.validationErrors && d.validationErrors.length > 0) { - return RED._("editor.errors.invalidProperties")+"\n - "+d.validationErrors.join("\n - ") + return RED._("editor.errors.invalidProperties")+"\n - "+d.validationErrors.join("\n - ") } }, show: function(n) { return !n.valid } From a2e00740612a17d5777ac6c3de19dfc32ba471a0 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 18 Jan 2022 09:20:52 +0000 Subject: [PATCH 4/6] Update marked to latest --- package.json | 2 +- .../node_modules/@node-red/editor-client/src/js/ui/utils.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fd6532c6e..c0ba83645 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "i18next-http-backend": "1.3.1", "jquery-i18next": "1.2.1", "jsdoc-nr-template": "github:node-red/jsdoc-nr-template", - "marked": "3.0.7", + "marked": "4.0.10", "minami": "1.2.3", "mocha": "9.1.3", "node-red-node-test-helper": "^0.2.7", diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js b/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js index 2f5f7063e..33f6c3ea1 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js @@ -109,7 +109,7 @@ RED.utils = (function() { window._marked.use({extensions: [descriptionList, description] } ); function renderMarkdown(txt) { - var rendered = _marked(txt); + var rendered = _marked.parse(txt); var cleaned = DOMPurify.sanitize(rendered, {SAFE_FOR_JQUERY: true}) return cleaned; } From dbefe6a560df56ce10244f0ad4897ed87e793a5f Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 18 Jan 2022 09:26:42 +0000 Subject: [PATCH 5/6] Revert copy-text change and apply alternative fix Reverts PR #3331 and applies the alternative fix originally proposed in PR #3329 --- .../editor-client/src/js/ui/clipboard.js | 37 ++++++++++--------- .../editor-client/src/sass/editor.scss | 5 +++ 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js b/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js index f6a613f5f..cde9da938 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js @@ -946,23 +946,26 @@ RED.clipboard = (function() { if (truncated) { msg += "_truncated"; } - navigator.clipboard.writeText(value).then(function () { - if (element) { - var popover = RED.popover.create({ - target: element, - direction: 'left', - size: 'small', - content: RED._(msg) - }); - setTimeout(function() { - popover.close(); - },1000); - popover.open(); - } - if (currentFocus) { - $(currentFocus).focus(); - } - }).catch(err => { console.error("Failed to copy:",err) }); + var clipboardHidden = $('