Compare commits

..

466 Commits

Author SHA1 Message Date
Nick O'Leary
c9597b9447 Bump for 2.0.1 2021-07-20 14:44:47 +01:00
Nick O'Leary
b2dc1d8b23 Ensure default module export is exposed in Function node 2021-07-20 14:42:43 +01:00
Nick O'Leary
859c0c7f6c Update to latest node-red-admin 2021-07-20 11:19:13 +01:00
Nick O'Leary
aaf18e2416 Merge branch 'master' into dev 2021-07-20 11:11:28 +01:00
Nick O'Leary
fd679ef117 Update contributing docs 2021-07-20 11:10:41 +01:00
Nick O'Leary
6cc611b3f1 Merge branch 'master' into dev 2021-07-20 11:04:25 +01:00
Nick O'Leary
77ee726f66 Fix focus outline overlap in button-groups
Fixes #3070
2021-07-20 11:03:28 +01:00
Nick O'Leary
dc603b76a4 Fix focus outline overlap in button-groups
Fixes #3070
2021-07-20 11:02:24 +01:00
Nick O'Leary
bcb3371acc Fix another typo in issue template 2021-07-16 12:34:54 +01:00
Nick O'Leary
d14ce7e476 Fix typo in issue template 2021-07-16 12:30:21 +01:00
Nick O'Leary
47f7b43bcc Update bug_report.yml 2021-07-16 10:21:51 +01:00
Nick O'Leary
77fd8c120c Update bug_report.yml 2021-07-16 10:20:23 +01:00
Nick O'Leary
a1a6f40158 Update issue templates to use GH forms 2021-07-16 10:16:09 +01:00
Nick O'Leary
ed09cd7489 Merge pull request #3068 from hardillb/http-auth-fix
Fix for #3067
2021-07-16 09:47:57 +01:00
Nick O'Leary
eb3330d145 Fix vertical sizing of function node edit dialog 2021-07-16 09:44:56 +01:00
Nick O'Leary
5ba0588c7b Merge branch 'master' into dev 2021-07-16 08:53:35 +01:00
Nick O'Leary
d4a199f0e1 Avoid prototype pollution in RED.view.calculateTextDimensions 2021-07-16 08:52:00 +01:00
Ben Hardill
32dd186f4d Prevent Overwite of configured creds 2021-07-16 08:47:30 +01:00
Ben Hardill
81f0fb3c74 Fix creds in URL 2021-07-15 18:32:51 +01:00
Ben Hardill
972c83cd52 Fix for #3067
Check if there are any content to the credential object
2021-07-15 17:35:03 +01:00
Nick O'Leary
66a704af55 Fallback to 'require' if on node < 12.17 2021-07-15 15:38:07 +01:00
Nick O'Leary
31c5d6e1c1 Update changelog 2021-07-15 15:38:02 +01:00
Nick O'Leary
bf0ab95c09 Merge pull request #3066 from node-red-hitachi/update-message-jp
Update Japanese message catalogue
2021-07-15 13:17:41 +01:00
Hiroyasu Nishiyama
c1d85f760d update Japanese message catalogue 2021-07-15 21:09:20 +09:00
Nick O'Leary
88ad2f4c18 Merge pull request #3065 from node-red/funcExtMod-default
Enable functionExternalModules by default
2021-07-15 10:14:28 +01:00
Nick O'Leary
be9f9e7b0c Change default functionExternalModules test 2021-07-15 10:13:21 +01:00
Nick O'Leary
2cc1973f62 Enable functionExternalModules by default 2021-07-15 10:07:52 +01:00
Nick O'Leary
eb4625a0b9 Merge pull request #3064 from node-red/revert-external-modules-dir
Move externalModules back into the user dir
2021-07-15 09:56:23 +01:00
Nick O'Leary
5bfb01254b Add unit tests for externalModules.import 2021-07-15 09:52:53 +01:00
Nick O'Leary
bb80fa4a2d Fix externalModules tests 2021-07-14 23:38:46 +01:00
Nick O'Leary
ddb715d88d Record runtime-installed modules in .config.modules.json 2021-07-14 23:13:52 +01:00
Nick O'Leary
395b499856 Fix async loading of modules in function node 2021-07-14 21:10:59 +01:00
Nick O'Leary
cce6a47f11 Rework function module screen 2021-07-14 20:23:01 +01:00
Nick O'Leary
7fd17b4ec0 Add RED.import to support importing ES6 modules 2021-07-14 19:18:39 +01:00
Nick O'Leary
e16ab2a0fd Bump for 2.0.0 2021-07-13 11:51:23 +01:00
Nick O'Leary
15f5364c30 Update changelog 2021-07-13 11:50:38 +01:00
Nick O'Leary
65081767bf Fix externalModules tests 2021-07-13 11:44:12 +01:00
Nick O'Leary
c7c595e5fa Merge pull request #3063 from kazuhitoyokoi/dev-addjpn
Add Japanese translations for Node-RED v2.0
2021-07-13 11:37:23 +01:00
Nick O'Leary
5b24e8b69c Merge pull request #3059 from node-red/delay-queue
Delay node updates to added numeric flush control for releasing things from queue
2021-07-13 11:37:13 +01:00
Nick O'Leary
e6a845e606 Move externalModules back into the user dir 2021-07-13 11:24:10 +01:00
Kazuhito Yokoi
ec8b8a7b87 Change translation to be same as other usages 2021-07-13 14:15:37 +09:00
Kazuhito Yokoi
51a9205105 Add Japanese translations for Node-RED v2.0 2021-07-13 14:05:44 +09:00
Nick O'Leary
ed5567fc73 Merge pull request #3056 from node-red/ws-ping
Allow websocket client node to send pings
2021-07-12 19:40:57 +01:00
Nick O'Leary
4b3f5d74a0 Merge pull request #3058 from kazuhitoyokoi/master-fixdependencies
Add necessary modules and remove unnecessary module in dependencies
2021-07-12 19:40:40 +01:00
Nick O'Leary
b01c5a05e7 Fix reporting of type_already_registered error 2021-07-12 16:09:25 +01:00
Nick O'Leary
36eddabc1c Ensure node.types is defined if node html file missing 2021-07-12 16:09:02 +01:00
Dave Conway-Jones
ea11aa7a0d add some part flush tests 2021-07-08 13:51:37 +01:00
Nick O'Leary
e7efa76e6d Add a slight fade to tab labels that overflow 2021-07-08 12:23:15 +01:00
Dave Conway-Jones
41c8ca8ab4 Delay node updates to added flush control for queuing 2021-07-08 12:13:23 +01:00
Nick O'Leary
4624079be7 Merge pull request #3057 from kazuhitoyokoi/dev-fixdependencies
Add necessary modules and remove unnecessary module in dependencies
2021-07-08 12:07:07 +01:00
Nick O'Leary
c6f6042271 Show config node details when selected in outliner 2021-07-08 12:03:20 +01:00
Nick O'Leary
e9e3b9b7c6 Fix layout of info outliner for subflow entries 2021-07-08 12:02:11 +01:00
Kazuhito Yokoi
becbb09a29 Add necessary modules and remove unnecessary module in dependencies 2021-07-08 19:50:26 +09:00
Kazuhito Yokoi
6f6ab50995 Add necessary modules and remove unnecessary module in dependencies 2021-07-08 19:14:53 +09:00
Nick O'Leary
d8ee766860 Allow websocket client node to send pings 2021-07-08 10:51:36 +01:00
Nick O'Leary
108c26d8af Merge pull request #3055 from bonanitech/grip-horizontal
Fix grip on panels separator
2021-07-08 08:41:48 +01:00
Nick O'Leary
ed8d3088ca Merge pull request #3054 from bonanitech/scriptFiles
Fix scriptFiles
2021-07-08 08:41:18 +01:00
Nick O'Leary
46c4e2d212 Merge branch 'master' into dev 2021-07-08 08:40:44 +01:00
Nick O'Leary
94891d45f9 Merge pull request #3052 from kazuhitoyokoi/dev-fixdependencies
Add fs-extra module to dependencies in @node-red/util module
2021-07-08 08:39:51 +01:00
Nick O'Leary
7448ad109e Add missing dependency to @node-red/utils module 2021-07-08 08:39:20 +01:00
Mauricio Bonani
6211dfe024 Fix grip on horizontally displayed panels separator 2021-07-07 09:52:47 -04:00
Mauricio Bonani
9b85200954 Fix grip on panels separator 2021-07-07 09:24:14 -04:00
Mauricio Bonani
94ee739d91 Fix scriptFiles 2021-07-07 09:12:58 -04:00
Kazuhito Yokoi
e81a6db9a3 Add fs-extra module to dependencies in @node-red/util module 2021-07-05 13:34:56 +09:00
Nick O'Leary
b2f5a259ab Fix exec node test for gh-actions
The node adds `shell` to `execOpts` if `/bin/bash` exists. Clearly it
has not existed in Travis or running locally - but it does exist
on gh-action runner, so the test was failing.
2021-07-02 10:15:44 +01:00
Nick O'Leary
c8a0d3c10d Add error handling to exec test 2021-07-02 10:09:00 +01:00
Nick O'Leary
97df964051 Update changelog 2021-07-02 10:02:08 +01:00
Nick O'Leary
66dd05f8bc Merge branch 'master' into dev 2021-07-02 10:01:07 +01:00
Nick O'Leary
19589d9117 Merge branch 'master' into dev 2021-07-02 10:00:43 +01:00
Nick O'Leary
8147b2e0b1 Update changelog 2021-07-02 09:58:56 +01:00
Nick O'Leary
be22f8cd14 Update js-yaml 2021-07-02 09:39:19 +01:00
Nick O'Leary
868be9b7ff Update node-red-admin to 2.1 2021-07-02 09:37:14 +01:00
Nick O'Leary
5011281104 Merge branch 'dev' of github.com:node-red/node-red into dev 2021-07-02 09:22:56 +01:00
Nick O'Leary
42992c64ec Merge branch 'pr_3026' into dev 2021-07-02 09:22:35 +01:00
Nick O'Leary
2baff243ed Rename exec node hideWin option 2021-07-02 09:22:08 +01:00
Nick O'Leary
83440a6b0f Merge pull request #3047 from node-red/config-outliner-fix
Emit `nodes:change` for any updated config node when node deleted/added
2021-07-02 08:47:46 +01:00
Nick O'Leary
87c9a1c06c Include hasUser=false config nodes when exporting whole flow (#3048) 2021-07-01 21:40:57 +01:00
Nick O'Leary
b848fe249f Remove stray console.log from mqtt.html 2021-07-01 21:01:11 +01:00
Nick O'Leary
1e804d97ce Fix padding of compact notification
Closes #3045
2021-07-01 20:57:42 +01:00
Nick O'Leary
218d3c144b Emit nodes:change for any updated config node when node deleted/added 2021-07-01 20:52:13 +01:00
Nick O'Leary
05a4905490 Fix padding of compact notification
Closes #3045
2021-07-01 17:23:52 +01:00
Nick O'Leary
75103da378 Merge pull request #3044 from hardillb/hpagent-update
Bump hpagent to 0.1.2
2021-07-01 17:09:07 +01:00
Ben Hardill
9db9b53c81 Fix package.json
Also back out auth changes
2021-06-30 14:12:20 +01:00
Ben Hardill
0e4787f3e8 Bump hpagent to 0.1.2
Also remove workaround for empty proxy credentials
2021-06-30 13:42:56 +01:00
Nick O'Leary
f8d8d4b186 Update dependencies 2021-06-29 16:19:28 +01:00
Nick O'Leary
45e0a1ffea Merge pull request #3042 from node-red/bye-travis
Bye Travis. Hello GitHub Actions
2021-06-29 15:28:49 +01:00
Nick O'Leary
75c58093f1 Remove bye-travis branch trigger 2021-06-29 14:25:22 +01:00
Nick O'Leary
cc708e9fb4 Move to GH Actions in place of Travis 2021-06-29 14:19:24 +01:00
Nick O'Leary
2ce0e38827 Merge pull request #3040 from node-red/map-set-debug
Add support for Map/Set property types on Debug
2021-06-29 14:08:29 +01:00
Nick O'Leary
5b980e8c13 Merge pull request #3032 from node-red/view-annotations
Add RED.view.annotations api
2021-06-29 14:08:08 +01:00
Nick O'Leary
21b602650c Merge branch 'dev' of github.com:node-red/node-red into dev 2021-06-29 14:01:12 +01:00
Nick O'Leary
fa4b7a1a69 Ensure any html in changelog is escaped before displaying 2021-06-29 13:58:24 +01:00
Kazuhito Yokoi
977dfe700b Fix change log in help tab 2021-06-29 19:51:41 +09:00
Nick O'Leary
48ac50e1c9 Add support for Map/Set property types on Debug 2021-06-29 11:09:30 +01:00
Nick O'Leary
1a817947eb Merge pull request #3039 from kazuhitoyokoi/dev-fixfileinlabel
Fix output label in file-in node
2021-06-29 10:27:40 +01:00
Kazuhito Yokoi
be64603097 Fix indents from tab to space 2021-06-29 18:08:02 +09:00
Kazuhito Yokoi
f6b90c8271 Fix output label in file-in node 2021-06-29 18:02:06 +09:00
Kazuhito Yokoi
26e4be87c7 Add Japanese translation for file-in node (#3037) 2021-06-29 08:42:16 +01:00
Nick O'Leary
cddbb8d80d Merge pull request #3035 from node-red/file-node-msg-clone-option
Add option for file-in node to include all properties (default off)
2021-06-28 15:48:12 +01:00
Nick O'Leary
58023b4bf0 Merge branch 'pr_3024' into dev 2021-06-28 15:32:32 +01:00
Nick O'Leary
4f18a5f1c3 Merge pull request #3025 from node-red/comms-batch
Batch messages sent over Comms link
2021-06-28 15:28:40 +01:00
Nick O'Leary
56df8d8bd3 Merge pull request #3031 from Steve-Mcl/monaco0252
Update Monaco Editor to V0.25.2 (latest)
2021-06-28 15:28:09 +01:00
Nick O'Leary
211ec104c2 Merge pull request #3015 from Steve-Mcl/monaco-beta-bug-fix
Patches for Monaco editor
2021-06-28 15:27:27 +01:00
Nick O'Leary
3fb573247d Add 'theme' to default settings file 2021-06-25 18:10:13 +01:00
Dave Conway-Jones
6aac44db14 Add option for file-in node to include all properties (default off)
and add test
2021-06-25 14:39:18 +01:00
Nick O'Leary
3255e11cfc Limit annotations to badge type 2021-06-24 17:59:32 +01:00
Nick O'Leary
844bf29de1 Add RED.view.annotations api 2021-06-24 17:40:26 +01:00
Steve-Mcl
04d91d1422 prevent promise rejection when loading editor 2021-06-24 11:28:39 +01:00
Steve-Mcl
db90e1f801 remove unnecessary global uncaught promise handler
- monaco issue https://github.com/microsoft/monaco-editor/issues/2382
2021-06-24 11:27:24 +01:00
Steve-Mcl
7f30748a41 dont try to load en-gb or en-us (they're builtin)
- also monaco now comes with Turkish, Polish, Portuguese, Czech langs
2021-06-24 11:25:26 +01:00
Steve-Mcl
a4e0abb48f Update monaco editor to V0.5.2 2021-06-24 11:21:49 +01:00
Steve-Mcl
3f27dc89d8 Add overloads for context/flow/global set/get/keys 2021-06-23 22:27:13 +01:00
Nick O'Leary
d6f6efc189 Lower tray zIndex when overlay tray being opened
Fixes #3019
2021-06-23 14:34:52 +01:00
Nick O'Leary
2cda49fc38 Reduce z-Index of Function expand buttons to prevent overlap
Part of #3019
2021-06-23 14:16:36 +01:00
Nathanaël Lécaudé
04f4a76b41 exec node: clarify scope 2021-06-18 14:46:16 -04:00
Steve-Mcl
0a8f7085f3 allow static private field to have initializer 2021-06-17 08:44:44 +01:00
Nathanaël Lécaudé
7ae48d7390 exec: solidify tests 2021-06-16 17:38:34 -04:00
Steve-Mcl
c908502644 add 2 ace compatible functions
- clearSelection - blocky node
- selectAll - obvious addition
2021-06-16 22:36:00 +01:00
Nathanaël Lécaudé
2f0631809d exec node: modify test 2021-06-16 17:09:21 -04:00
Nathanaël Lécaudé
91ab3bd972 exec node: add windowsHide option to hide windows under Windows 2021-06-16 17:00:00 -04:00
Sam Machin
672636313c Update packages/node_modules/@node-red/runtime/locales/en-US/runtime.json
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2021-06-16 17:13:52 +01:00
Nick O'Leary
79875ef50d Merge branch 'master' into dev 2021-06-16 17:03:50 +01:00
Nick O'Leary
aea5445495 Support loading external module sub path
Fixes #3023
2021-06-16 17:02:24 +01:00
Nick O'Leary
754a36fbc9 Merge branch 'master' into dev 2021-06-16 13:42:56 +01:00
Nick O'Leary
85dafc0b3c Ensure RED.clipboard.import displays the right library
Fixes #3021
2021-06-16 13:41:58 +01:00
Nick O'Leary
b516ab9b4f Batch messages sent over comms to prevent flooding 2021-06-16 11:45:02 +01:00
Nick O'Leary
1a27e60e55 Allow RED.popover.panel to specify a closeButton to ignore click events on 2021-06-16 11:44:40 +01:00
Nick O'Leary
2c710736e8 Use browser default language for initial page load 2021-06-16 11:44:35 +01:00
Nick O'Leary
69b9ff69be Add css var for node font color 2021-06-16 11:44:30 +01:00
Nick O'Leary
a3a4fc0cc2 Fix label padding of toggleButton 2021-06-16 11:44:25 +01:00
Nick O'Leary
ae686bb15d Give sidebar open tab a bit more room for its label 2021-06-16 11:44:20 +01:00
Nick O'Leary
68a5325849 Bump version to 2.0.0-beta.2 2021-06-16 11:44:14 +01:00
Nick O'Leary
75e3bddfa9 Remove the request module as a dependency 2021-06-16 11:44:09 +01:00
Sam Machin
bd3a8db438 log readOnly on startup 2021-06-16 10:10:31 +01:00
Nick O'Leary
102868bf74 Merge pull request #3022 from kazuhitoyokoi/update-message-files
Add additional Japanese translations for Node-RED 2.0 beta-1
2021-06-15 23:28:19 +01:00
Steve-Mcl
1a73a27102 add diagnosticCodesToIgnore 2345
- handles issue with Intl.DateTimeFormat when `options` is a variable
2021-06-15 23:15:54 +01:00
Steve-Mcl
a9cf34ab56 prevent IE script error
- even though monaco does not work in EI, scripts must not fail to load
2021-06-15 21:02:30 +01:00
Steve-Mcl
46d17c3314 update code comments 2021-06-15 21:01:33 +01:00
Nick O'Leary
40f816c311 Merge pull request #3020 from node-red-hitachi/update-message-files
Update message catalogue
2021-06-15 08:53:02 +01:00
Kazuhito Yokoi
13f1c12912 Add translations to message catalog 2021-06-14 15:54:05 +09:00
Hiroyasu Nishiyama
93c25f5d1b Update message catalogue 2021-06-13 14:19:36 +09:00
Steve-Mcl
aa6ec60c34 fix up issues with function node types
- node.status add overload
- remove examples as they dont render correctly
- correct Number and Object types to number and object
2021-06-11 18:44:37 +01:00
Nick O'Leary
ac159bb52e Merge pull request #3017 from hardillb/dev
Fix for basic auth with @ in username
2021-06-11 14:51:38 +01:00
Ben Hardill
919aee64f9 Add support for user/pass in URL 2021-06-11 14:48:41 +01:00
Ben Hardill
553bec1a1f Add testcase 2021-06-11 14:34:16 +01:00
Ben Hardill
bcb6d1cf93 Fix for basic auth with @ in username 2021-06-11 14:25:18 +01:00
Steve-Mcl
7d24e5b279 node.status snippet enums for fill and shape 2021-06-11 08:01:38 +01:00
Steve-Mcl
12253e23b5 Add setReadOnly support 2021-06-10 21:18:29 +01:00
Nick O'Leary
4acb66fb7a Merge branch 'master' into dev 2021-06-10 16:06:30 +01:00
Nick O'Leary
68ef85b64b Update CHANGELOG 2021-06-10 15:48:24 +01:00
Dave Conway-Jones
b73efe6bb4 Ensure CSV node tries to parse number when set to do so (trim whitespace) 2021-06-10 14:55:47 +01:00
Nick O'Leary
89c84522d2 Merge branch 'master' into dev 2021-06-10 14:19:24 +01:00
Nick O'Leary
98172764ac Handle node icon paths for scoped modules
Fixes #3013
2021-06-10 14:15:43 +01:00
Nick O'Leary
448e881104 Update to latest node-red-admin 2021-06-10 10:31:54 +01:00
Nick O'Leary
f16134ab1f Update changelog 2021-06-09 13:49:33 +01:00
Nick O'Leary
f5dc1564a4 Merge pull request #3009 from hardillb/get-got
Get got - deactivate HTTP - Proxy unit tests
2021-06-09 09:59:31 +01:00
Nick O'Leary
133df75bd4 Merge branch 'dev' into get-got 2021-06-09 09:59:23 +01:00
Nick O'Leary
440be0653a Merge pull request #3012 from node-red/reorganise-settings
Restructure default settings.js to be more organised
2021-06-09 09:57:34 +01:00
Nick O'Leary
d721a40ca5 Clarify flowFilePretty option 2021-06-09 09:26:55 +01:00
Nick O'Leary
a9b252b8fa Ensure httpServerOptions gets applied to ALL the express apps
This is silly. Turns out setting options at a top level app
does not percolate down to sub apps (and vice versa). You
have to apply the options to ALL express apps.
2021-06-08 21:17:42 +01:00
Nick O'Leary
8a5b3ddee7 Change comment style in default settings file.
Makes clearer what is a comment and what is commented-out code.
2021-06-08 21:04:59 +01:00
Nick O'Leary
d83e543a98 Update dependencies 2021-06-08 17:33:40 +01:00
Nick O'Leary
bcd6e8fd63 Restructure default settings.js to be more organised 2021-06-08 15:58:19 +01:00
Ben Hardill
d5c5738aab Fix proxy authentication problem & reinstate tests
Down to only 2 of the previous tests not working
2021-06-08 14:22:20 +01:00
Ben Hardill
9e4dfe081f Remove unused dev dependency 2021-06-08 13:27:26 +01:00
Ben Hardill
090852b72b Revet changes to /proxyAuthneticate
This end point is currently not hit
2021-06-08 12:06:18 +01:00
Nick O'Leary
ff5e038c49 Improve contrast of export dialog JSON font color 2021-06-08 11:54:58 +01:00
Nick O'Leary
5cc2e5f6e1 Fix merge 2021-06-08 11:48:45 +01:00
Ben Hardill
4e8c0573c4 Re-enable as many http-request proxy tests as possible 2021-06-08 11:46:54 +01:00
Nick O'Leary
ce905ba2c4 Merge branch 'master' into dev 2021-06-08 11:44:31 +01:00
Nick O'Leary
3104c17fb3 Update to latest node-red-admin 2021-06-08 11:36:16 +01:00
Nick O'Leary
7651941722 Do not assign z property to tab node when updating flow
Fixes #3010
2021-06-08 11:35:43 +01:00
Nick O'Leary
7bf938901a Merge branch 'pr_2952' into dev 2021-06-08 11:09:56 +01:00
Nick O'Leary
f8b61d2926 Merge pull request #2997 from hardillb/watch-fix
Watch node throws errors if new files deleted
2021-06-08 11:07:37 +01:00
Nick O'Leary
4edea59ab1 Merge branch 'pr_2990' into dev 2021-06-08 10:56:57 +01:00
Nick O'Leary
c8bcd2818d Disable inject-now button if inside subflow 2021-06-08 10:56:34 +01:00
Nick O'Leary
9b46dbaff1 Switch editableList buttons from <a> to <button> elements 2021-06-08 10:56:04 +01:00
Ben Hardill
17a139f27f Start to add HTTP-PROXY tests back in 2021-06-08 10:30:24 +01:00
Nick O'Leary
bd00c728d1 Merge pull request #3008 from Steve-Mcl/node-red-typings-update
Node red typings update
2021-06-08 10:29:03 +01:00
Nick O'Leary
9d510b514c Merge pull request #3007 from Steve-Mcl/monaco-update
update monaco v0.24.0
2021-06-08 10:27:15 +01:00
Nick O'Leary
00dcc5ecda Merge pull request #3011 from node-red/cheerio-update
HTML node: cheerio update to 1.x
2021-06-08 10:22:20 +01:00
Nick O'Leary
dbbdd3f799 Update to latest cheerio module 2021-06-08 09:31:27 +01:00
Nick O'Leary
3541b4b968 Merge pull request #3004 from node-red-hitachi/fix-get-subflow-info
Fix allow Flow.getNode to return subflowInstance nodes
2021-06-07 18:16:01 +01:00
Nick O'Leary
5b1bf35a23 Fix over-greeding matching whilst parsing commit history
Fixes #3006
2021-06-07 18:07:58 +01:00
Ben Hardill
591b61945f Merge branch 'get-got' of github.com:hardillb/node-red into get-got 2021-06-07 16:01:06 +01:00
Ben Hardill
bd1943626b Add more comment 2021-06-07 16:00:07 +01:00
Ben Hardill
f152cdef51 Merge pull request #1 from node-red/get-got
Get got
2021-06-07 13:04:27 +01:00
Ben Hardill
33f8c9747d Comment out HTTP Proxy tests
These have been removed because the mock proxy doesn't
support using the HTTP CONNECT verb and the new Got based
http-request node only uses CONNET for proxied content
2021-06-07 13:00:02 +01:00
Steve-Mcl
714a5e26b3 add env.get to function node defs 2021-06-05 12:42:54 +01:00
Steve-Mcl
7f2c6e40d3 fix typescript errors in node-red d.ts def files 2021-06-05 12:42:13 +01:00
Steve-Mcl
db676ec223 add snippet for env.get 2021-06-05 12:34:47 +01:00
Steve-Mcl
ffb3e511a7 update monaco v0.24.0 2021-06-05 12:28:25 +01:00
Nick O'Leary
e9e64f6a44 Add option to RED.nodes.createCompleteNodeSet to include node dimensions
This allows the linter to use a flow json with more than just position
information.
2021-06-04 13:53:01 +01:00
Kazuhiro Ito
a7b8adb0e1 Fix allow Flow.getNode to return subflowInstance nodes 2021-06-04 15:08:03 +09:00
Jiye Yu
4140ff03d7 fix typo in zh-CN translation (#3003) 2021-06-03 19:03:00 +01:00
Nick O'Leary
e042ef05a4 Update dependencies 2021-06-02 16:24:12 +01:00
Nick O'Leary
7c02e4d66a Merge branch 'master' into dev 2021-06-02 15:40:56 +01:00
Nick O'Leary
711794cfe1 Merge pull request #2993 from Steve-Mcl/master
ensure context get/set key is a string
2021-06-02 15:20:25 +01:00
Nick O'Leary
c0e4cf2358 Fix handling of boolean subflow module properties
Fixes #3000
2021-06-02 14:48:54 +01:00
Nick O'Leary
a92f8f36c1 Keep proper track of moved/changed state in undo/redo history
Fixes #2999
2021-06-02 14:07:22 +01:00
Nick O'Leary
12698dc347 Add full ast parsing in Function node to spot node.done calls
Fixes #2998
2021-06-02 12:32:44 +01:00
Nick O'Leary
3e6a55f78e Update to latest 6.x ws module 2021-06-02 11:58:51 +01:00
Ben Hardill
7585f14b89 Watch node throws errors if new files deleted
before the node has finished processing them all.

Fixes #2996
2021-05-28 08:34:08 +01:00
Nick O'Leary
01b5fc4d49 Merge pull request #2987 from node-red/clean-ids
Change node id generation to give fixed length values without '.'
2021-05-27 12:18:38 +01:00
Nick O'Leary
0fb7d3bfc8 Merge pull request #2991 from node-red-hitachi/fix-empty-switch-rule
fix handling of empty switch rules
2021-05-27 12:18:23 +01:00
Nick O'Leary
2cd74d355c Merge pull request #2994 from node-red/css-vars
Add css named variables for certain key colours
2021-05-27 12:18:05 +01:00
Nick O'Leary
3d405f8c63 Merge pull request #2969 from node-red/ajv-update
Update ajv to 8.2.0 - drop support for JSON-Schema draft-04
2021-05-27 12:17:51 +01:00
Steve-Mcl
a92f0c4c6e fix context key validation + add tests
- adds a helper function validateContextKey to keep it DRY
- adds tests ensure key of null "" 1 {} [] [""] [1] [{}] all throw error
2021-05-26 13:04:09 +01:00
Nick O'Leary
de142ac9d6 Add css named variables for certain key colors 2021-05-25 21:03:01 +01:00
Nick O'Leary
468ef7ecff Allow RED.settings.set to replace string property with object property 2021-05-25 21:02:14 +01:00
Steve-Mcl
4d768fd236 ensure context get/set key is a string 2021-05-25 14:53:06 +01:00
Steve-Mcl
bfc1f95190 remove redundant i18n entries
- no longer needed since moving inject onto edit form
2021-05-25 13:53:59 +01:00
Nick O'Leary
bc17ebd90e Fix css of node help table of contents elements 2021-05-24 10:23:00 +01:00
Hiroyasu Nishiyama
bb1b3727cb add test case 2021-05-23 10:42:28 +09:00
Hiroyasu Nishiyama
4dbebefb45 fix handling empty rules 2021-05-23 10:01:45 +09:00
Steve-Mcl
e1c5764fbf move new inject button to existing edit form
- revert refactoring of building editableList (not needed now)
- remove node button modifier click & tray.show feature
- add inject button to editableList [buttons] array
- add `id` option to editableList to permit DOM access after creation
- get the new inject button via its `id` and float it to the right
- removed the popup tray buttons i18n entries
2021-05-22 10:52:44 +01:00
Steve-Mcl
70f975e4f0 move inject button off dialog and onto form 2021-05-21 13:26:50 +01:00
Steve-Mcl
845567d1ba add 2 tests for user inject values 2021-05-20 22:53:32 +01:00
Steve-Mcl
f570447000 i18n for buttons on user inject values 2021-05-20 22:53:10 +01:00
Steve-Mcl
9d7b8f1f2f change user prop name for injected values
- less chance for collision
2021-05-20 22:35:42 +01:00
Steve-Mcl
bae6bfc32d Add inject values without deploy feature 2021-05-20 21:12:32 +01:00
Nick O'Leary
8a63390464 Merge pull request #2988 from hardillb/ALPNProtocols
Add ALPN support to TLS node
2021-05-19 17:39:19 +01:00
Ben Hardill
0b52cd8b31 Fixes from testing
I set up a NGINX instance to test this and found I'd missed some bits.

Still can't find a way to test this easily from a nodejs unit test
2021-05-19 10:41:24 +01:00
Nick O'Leary
f97569dd34 Clarify codeEditor options only relate to monaco 2021-05-18 16:46:16 +01:00
Nick O'Leary
a9164e63ab Merge branch 'dev' into pr_2971 2021-05-18 16:30:13 +01:00
Ben Hardill
8c95067ec4 Add ALPN support to TLS node 2021-05-18 13:13:32 +01:00
Nick O'Leary
4f77bbeb2b Update for 1.3.5 2021-05-18 11:52:49 +01:00
Nick O'Leary
8bbed2c831 Change node id generation to give fixed length values without '.' 2021-05-18 11:32:17 +01:00
Nick O'Leary
6b43a23c4b Merge branch 'master' into dev 2021-05-14 21:18:32 +01:00
Nick O'Leary
be9521f659 Revert some of #2967 to fix treeList gutter width calculation 2021-05-14 21:17:47 +01:00
Nick O'Leary
90761fd840 Fix 'SyntaxError' in Function node when last line of on-stop is a comment 2021-05-13 17:23:25 +01:00
Nick O'Leary
d49d9a783c Merge branch 'master' into dev 2021-05-13 16:06:33 +01:00
Nick O'Leary
d7dc7c4eda Fix error handling in runtime/lib/api/nodes 2021-05-13 15:46:56 +01:00
Nick O'Leary
fe64c6a841 Merge branch 'master' into dev 2021-05-13 14:30:02 +01:00
Nick O'Leary
2bbdc85a29 Prevent unknown node from breaking editor
If a node provides a .js file that registers a type
but its .html is empty, then the editor will know about
the type, but there will be no node definition.

This fix handles that in some of the utility functions
for generating node appearance.

This wasn't an exhaustive check for these things - just
some obvious candidates that I hit in testing 'bad' nodes
2021-05-13 14:28:01 +01:00
Nick O'Leary
74628b7034 Update debug tests to handle compact comms format 2021-05-13 14:18:11 +01:00
Nick O'Leary
15aa249f64 Stop module with missing types from preventing editor load 2021-05-13 14:06:43 +01:00
Nick O'Leary
fdf58e1225 Fix lint errors in editor hooks 2021-05-13 14:00:21 +01:00
Nick O'Leary
866f305686 Open subflow tab next to active tab rather than at the end 2021-05-13 13:57:29 +01:00
Nick O'Leary
1550e5343c Merge branch 'master' into dev 2021-05-13 13:42:26 +01:00
Nick O'Leary
add3dd1077 Merge pull request #2986 from hardillb/get-got
Fix msg.responseUrl
2021-05-13 13:41:58 +01:00
Nick O'Leary
79a142fb19 Fix error log in runtime hooks module 2021-05-13 13:40:42 +01:00
Nick O'Leary
1a30fe4a1a Improve red-ui-node-icon css and add red-ui-node-icon-small modifier class 2021-05-13 13:39:29 +01:00
Nick O'Leary
4ff991764e Updates to encode/decode message when passed over debug comms link 2021-05-13 13:38:34 +01:00
Nick O'Leary
001f066769 Remove all input event listeners on a node once it is closed
This prevents in-flight messages being passed to the node after
it has closed.
2021-05-13 13:37:21 +01:00
Nick O'Leary
c47b553a8e Add viewAddPort viewRemovePort viewAddNode viewRemoveNode hooks to view 2021-05-13 13:36:50 +01:00
Nick O'Leary
319af51f84 Add RED.hooks to editor 2021-05-13 13:35:12 +01:00
Nick O'Leary
5dbaaae68e Merge branch 'master' into dev 2021-05-12 16:00:36 +01:00
Ben Hardill
8c1a749a5a Fix msg.responseUrl
The original version would pick up the proxy servers port number
2021-05-12 11:08:57 +01:00
Nick O'Leary
fc8643f238 Merge pull request #2983 from hardillb/get-got
Get got working with proxies
2021-05-12 09:41:26 +01:00
Nick O'Leary
c8653f19bf Merge pull request #2985 from node-red-hitachi/update-function-node-info-text
Update Japanese info text of function node
2021-05-12 09:41:09 +01:00
Hiroyasu Nishiyama
b01100d818 Update Japanese info text of function node 2021-05-12 08:54:32 +09:00
Nick O'Leary
d4096a9026 Merge pull request #2984 from node-red/migrate-sass
Migrate to sass module from node-sass
2021-05-11 18:56:06 +01:00
Nick O'Leary
b9e780cdcd Add Node 16 with sass fixed 2021-05-11 18:14:05 +01:00
Nick O'Leary
b77cd56a01 Migrate from node-sass to sass
node-sass is deprecated and doesn't work on Node 16.
sass is actively maintained and considered the canonical sass
implementation.
2021-05-11 18:13:21 +01:00
Nick O'Leary
9cdec156dc Merge pull request #2974 from aheissenberger/fix-bundle-error
Fixed esbuild bundle error "installRetry" was declared a constant and changed
2021-05-11 17:45:07 +01:00
Nick O'Leary
6aa5968863 Fix Function tab label names in the node help text
Closes #2978
2021-05-11 17:15:27 +01:00
Nick O'Leary
8f7686cd7b Handle sidebar tab that no longer exists when setting first active 2021-05-11 16:42:32 +01:00
Nick O'Leary
d8d384a979 Fix plugin loading when browser sends unrecognised lang 2021-05-11 16:42:00 +01:00
Nick O'Leary
ade318bb78 Support mousewheel scroll in tab bar 2021-05-11 15:58:01 +01:00
Nick O'Leary
ed3aa8189f Shrink default notification box
Also reduces Inject/Debug notification display time as 5 seconds is a
long time for a message telling you it worked
2021-05-11 14:45:53 +01:00
Nick O'Leary
3e43597617 Prevent error whilst drag/drop importing from leaving dropTarget visible
Fixes #2982
2021-05-11 14:10:40 +01:00
Ben Hardill
4c8e895ac7 Clean up console.logs 2021-05-11 09:56:22 +01:00
Ben Hardill
f6a3671366 Get the http-request node got port working with Proxy 2021-05-10 23:01:29 +01:00
Nick O'Leary
e641b0a965 Fix scaling issues when dragging nodes into scaled workspace 2021-05-10 21:03:27 +01:00
Hiroyasu Nishiyama
eddddc6c9b fix duplicate csv node example (#2980) 2021-05-10 15:39:23 +01:00
Nick O'Leary
f249d6306f Merge pull request #2976 from kazuhitoyokoi/master-fixinfotips
Fix incorrect shortcut keys in info tips
2021-05-10 09:42:59 +01:00
Kazuhito Yokoi
5c31bd54e4 Fix incorrect shortcut keys in info tips 2021-05-06 20:09:35 +09:00
Nick O'Leary
71ba73b38f Merge branch 'master' into dev 2021-05-04 11:19:05 +01:00
Nick O'Leary
db0ff74857 Reduce code duplication around node/label generation 2021-05-04 11:12:55 +01:00
Steve-Mcl
1acb073737 add support for explicit calls to ace.setFontSize
- found node-red-contrib-ui-svg explicitly calling ace function
2021-05-04 10:34:29 +01:00
Steve-Mcl
251dda3652 missing editor destroy() calls 2021-05-04 09:04:13 +01:00
Steve-Mcl
22db24509d Ensure monaco exists before attempting cleanup 2021-05-04 09:03:35 +01:00
Andreas Heissenberger
54c9d27fd8 fix 2021-05-03 17:35:50 +02:00
Andreas Heissenberger
01888ff078 fix "installRetry" was declared a constant and changed 2021-05-03 17:23:27 +02:00
Steve-Mcl
ffbd140a97 bug fix orphaned models and graphical tray glitch
- ensure models are disposed correctly
- clean up any orphaned models left after editor:close
- improve concurrent multiple instances javascript models
- fix graphical glitch
2021-05-03 16:19:01 +01:00
Steve-Mcl
dedf5c52d9 better support for multiple editors
- as the javascript model is singleton, need to disable
syntax checking when editor not focused
(support multiple instances of js editor (function node))
2021-05-02 23:11:29 +01:00
Steve-Mcl
10465c5d68 treat appcache files as shell (uibuilder support) 2021-05-02 23:00:35 +01:00
Steve-Mcl
1f4f64a7c0 handle node-red style affecting monaco rename box 2021-05-02 22:44:48 +01:00
Steve-Mcl
a6f116b57b add default basic entries in settings,js
- defaults to "ace" but provides instruction for using monaco
2021-05-01 22:17:48 +01:00
Steve-Mcl
0a80186a92 Merge branch 'dev' into monaco2 2021-05-01 21:56:45 +01:00
Nick O'Leary
635bdf15cb Fix use of paletteLabel in help tab
Fixes #2973
2021-05-01 21:55:50 +01:00
Steve-Mcl
a72bdfdacc Handle known bug (monaco-editor issue No 2382)
- handles "Uncaught (in promise) Canceled: Canceled"
2021-05-01 11:40:43 +01:00
Steve-Mcl
dc3e04456c remove temporary debugging window variable 2021-05-01 11:01:04 +01:00
Nick O'Leary
b0e4fb7602 Fix infotip display following i18n update 2021-04-30 13:54:25 +01:00
Steve-Mcl
df7aa3339b dont tokenise JSONata
- monaco has jsonata tokeniser
2021-04-29 18:11:47 +01:00
Steve-Mcl
c475536388 provide extra libs and call to refresh 2021-04-29 18:00:23 +01:00
Steve-Mcl
cc7def89af ensure monaco is correctly sized 2021-04-29 17:59:12 +01:00
Steve-Mcl
58da87898e integrate monaco
- refactors createEditor out to own code files
- moves ace editor to own code file
- adds monaco editor to own code file
- add monaco bootstrap
- update mst to include monaco asset
- update grunt to include new files and integrate
2021-04-29 17:58:41 +01:00
Steve-Mcl
bded5490d2 add utility func getBrowserInfo
- prep for monaco - for slimming down monaco on mobile
- prep for monaco - needed to prevent monaco on IE
2021-04-29 17:35:11 +01:00
Steve-Mcl
c3715a2a3d ensure editor is removed
- Fixes issue with left over HTML in the DOM
2021-04-29 17:32:44 +01:00
Steve-Mcl
abf084f6c2 Dont call to ACE, re-use createEditor instead 2021-04-29 17:31:38 +01:00
Steve-Mcl
37ba409dc3 ensure mode is set for event log viewer 2021-04-29 17:29:54 +01:00
Steve-Mcl
f29488b24f prevent editor context menu being clipped by sidebar
- raise / lower tray z-index for correct slide animation
2021-04-29 17:03:17 +01:00
Steve-Mcl
71bdade7b9 prevent exception if ace is missing 2021-04-29 16:59:11 +01:00
Steve-Mcl
60d97c887d missing args from JSONata $now signature 2021-04-29 16:57:22 +01:00
Steve-Mcl
5bba50f01f refactor node.libs to a function getLibsList
- preparation for monaco integration
2021-04-29 16:56:16 +01:00
Steve-Mcl
1f7884dc70 add typings for basic intellisense 2021-04-29 16:54:29 +01:00
Steve-Mcl
69dafd6c68 add codeEditor settings 2021-04-29 16:53:59 +01:00
Steve-Mcl
64b79cd5ac add monaco dist
- includes themes from https://github.com/brijeshb42/monaco-themes
2021-04-29 16:52:22 +01:00
Nick O'Leary
1af21735a9 Fix theme handling when no editorTheme.page setting 2021-04-29 15:32:26 +01:00
Nick O'Leary
9886af3cec Fix jshint error in treeList 2021-04-29 14:09:21 +01:00
Nick O'Leary
1eb8f9ad97 Update changelog 2021-04-29 14:01:40 +01:00
Nick O'Leary
08e73d9d7d Merge pull request #2967 from hanc2006/master
Fixed remove item when depth=0 and wrong gutter calc treeList widget
2021-04-29 14:00:02 +01:00
Nick O'Leary
b0e349b215 Update for 1.3.4 2021-04-29 11:22:22 +01:00
Nick O'Leary
caa98b08da Merge branch 'pr_2965' into dev 2021-04-29 11:04:50 +01:00
Nick O'Leary
00caa13a12 Update externalModules_spec to handle variable npm args length 2021-04-29 11:04:19 +01:00
Nick O'Leary
cfc0135e86 Update ajv to 8.2.0 - drop support for JSON-Schema draft-04 2021-04-29 10:48:26 +01:00
Dave Conway-Jones
9ee8c1c791 Give delay node random mina nd max more space so you can see complete value 2021-04-29 10:36:13 +01:00
Nick O'Leary
cd3aba2b89 Allow nodes to access resolved theme files
Fixes #2968
2021-04-29 10:17:07 +01:00
Daniele
a150d8e289 Update packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js
Thanks for the tip, I'll remember next time.

Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2021-04-28 23:37:26 +02:00
Nick O'Leary
6da8e92f20 Fix inject node output tooltip extra property count 2021-04-28 22:01:39 +01:00
Nick O'Leary
1d4dd4be96 Merge pull request #2961 from node-red/rerorder-inject-typedinput
Re-order inject typedinput to de-emphasise context options
2021-04-28 21:56:47 +01:00
Nick O'Leary
7df1a03b4b Handle subflow modules that contain subflows 2021-04-28 21:50:00 +01:00
Nick O'Leary
ad316ffd37 Merge pull request #2964 from node-red-hitachi/fix-grunt-error-on-exec-node
fix grunt fail on exec node test
2021-04-28 21:02:23 +01:00
Nick O'Leary
91f5542a57 Fix importing node to currently flow rather than match its old z value
If you import a node whose z value is a known existing tab, it is getting
imported to that tab, rather than the expected behaviour of being imported
to the current tab.

This commit fixes that by checked if the node is being imported to a tab
that was included in the import, rather than pre-existing.
2021-04-28 20:54:31 +01:00
GitHub
d47a8aa562 Fix remove item when depth=0 and wrong gutter calc 2021-04-28 17:25:26 +02:00
nileio
676f790933 add engine-strict flag to npm install args 2021-04-28 22:40:17 +10:00
Hiroyasu Nishiyama
70433f3d05 fix grunt fail on exec node test 2021-04-28 21:40:17 +09:00
Nick O'Leary
9f2a2b9869 Pass npm args to preUninstall hook to be consistent with preInstall 2021-04-27 17:32:18 +01:00
Nick O'Leary
a0c09fc617 Update api docs header 2021-04-27 17:30:30 +01:00
Dave Conway-Jones
19d391fa05 only move msg. instead 2021-04-27 11:28:01 +01:00
Dave Conway-Jones
d1aa1fd4d8 reorder inject typedinput to de-empahsise context options 2021-04-27 11:15:16 +01:00
Dave Conway-Jones
0e02d03d9a Merge branch 'master' of https://github.com/node-red/node-red 2021-04-27 11:12:10 +01:00
Nick O'Leary
4133f9c56f Merge pull request #2936 from node-red/npm-install-hooks
Add pre/postInstall hooks to npm install handling
2021-04-27 10:57:14 +01:00
Nick O'Leary
53055064e1 Merge pull request #2932 from node-red/file-cwd-setting
File node: Add fileWorkingDirectory to customise how relative paths are resolved
2021-04-27 10:49:02 +01:00
Nick O'Leary
06090d8de1 Merge branch 'dev' into pr_2949 2021-04-27 10:45:33 +01:00
Nick O'Leary
d6ccae38f8 Merge pull request #2959 from node-red/inject-cronosjs
Move Inject node to CronosJS module
2021-04-27 10:44:22 +01:00
Nick O'Leary
f7210effec Rework hooks structure to be a linkedlist
Allows for safe removal of hooks whilst they are being invoked
2021-04-26 21:14:42 +01:00
Nick O'Leary
8e7efd98b2 Don't let 'escape' whilst moving nodes interrupt things
Fixes #2960
2021-04-26 16:48:21 +01:00
Nick O'Leary
ea50ba16f9 Move Inject node to CronosJS module 2021-04-26 14:47:50 +01:00
Nick O'Leary
b62e4f6662 Fix deprecation of httpRoot 2021-04-26 14:43:06 +01:00
Nick O'Leary
f5a1c8bc49 Merge pull request #2957 from node-red-hitachi/fix-error-on-git-auto-commit
fix error on auto commit for no flow change
2021-04-26 11:54:05 +01:00
Nick O'Leary
4cb8e99430 Timeout http upgrade requests that are not otherwise handled
Fixes #2956
2021-04-26 11:45:28 +01:00
Nick O'Leary
bbac49ff38 Ensure function expand button is above vertical scrollbar
Fixes #2955
2021-04-26 10:18:25 +01:00
Nick O'Leary
1d12017f11 Sort context stores in TypedInput and ensure default first
Fixes #2954
2021-04-26 10:13:57 +01:00
Kazuhito Yokoi
46af2e37a7 Add Japanese translations for delay node enhancements (#2958) 2021-04-26 09:57:11 +01:00
Hiroyasu Nishiyama
a480919ec3 fix error on auto commit for no flow change 2021-04-26 09:05:53 +09:00
Dave Conway-Jones
f8abf9fce1 add another test to csv 2021-04-25 08:53:18 +01:00
Nick O'Leary
62f2a552ea Merge pull request #2953 from node-red/depreacte-usage-of-httpRoot-and-add-warning
Deprecate usage of httpRoot and add warning
2021-04-23 16:42:01 +01:00
Dave Conway-Jones
b053e02174 remove httpRoot from setting.js entirely 2021-04-23 16:38:45 +01:00
Dave Conway-Jones
3798167908 Update packages/node_modules/@node-red/runtime/locales/en-US/runtime.json
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2021-04-23 16:36:22 +01:00
Dave Conway-Jones
56fe2014e1 Update packages/node_modules/@node-red/runtime/lib/index.js
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2021-04-23 16:36:15 +01:00
Nick O'Leary
be2e64433f Merge pull request #2951 from node-red/fix-flowfile-name-in-settings
fix flowfile name to flows.json in settings
2021-04-23 16:27:45 +01:00
Dave Conway-Jones
8732e89e55 Update packages/node_modules/@node-red/runtime/locales/en-US/runtime.json
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
2021-04-23 16:22:50 +01:00
Dave Conway-Jones
fdd0a93bad Deprecate use of httpRoot in settings and add warning
(no change is actual behaviour yet - just warning)
Should we remove option from settings ? or just label it ?
2021-04-23 15:42:57 +01:00
Nick O'Leary
dd12572b1d Allow node16 build to fail for now 2021-04-23 14:30:50 +01:00
Nick O'Leary
e23f20227a Initial migration from request to got for http-request node 2021-04-23 14:19:15 +01:00
Dave Conway-Jones
5cc791690b fix flowfile name to flows.json in settings
and warn if not set (as if anyone reads warnings)
Move setting to top of settings.js as it will be edited more often.
Default behaviour will still work
(needs translations)
2021-04-23 14:09:06 +01:00
Dave Conway-Jones
9f1deb0c36 CSV Add couple more special character tests just to make sure 2021-04-23 11:19:23 +01:00
Dave Conway-Jones
4cebbf8d22 Fix CSV handling of special chars as separators
(ie escape regex special chars)
and add tests
to close #2950
2021-04-23 10:47:23 +01:00
Dave Conway-Jones
93971537b4 add rate option to queue and timed modes. so a simple check box instead. 2021-04-22 11:02:34 +01:00
Dave Conway-Jones
87e816a7f5 Delay node - Make msg.rate an optional override 2021-04-22 10:26:35 +01:00
Dave Conway-Jones
0f45b1da48 Try to make delay modes consistent as regards flush
behaviour is different. May cause minor breakage.
if flush arrives with payload that is now included with the flushed data so no data is lost. Previously any payload was dropped.
2021-04-22 09:43:54 +01:00
Kazuhito Yokoi
a20049c82a Delay node enhancements (#2294)
* Remove unused messages in message catalog

* Support msg.rate in delay node

* Support nodeMessageBufferMaxLength in delay node

* Add logging function for queue size

* Support msg.nodeMessageBufferMaxLength

* Revert "Support msg.nodeMessageBufferMaxLength"

This reverts commit cc72f892f7.

* Improve logging function for delay node

* Add support for Messaging API to delay node

* Add documentation about msg.rate in delay node

* Add test cases for msg.rate in delay node

Co-authored-by: Dave Conway-Jones <dceejay@users.noreply.github.com>
2021-04-22 09:01:28 +01:00
Nick O'Leary
e57ebdb583 Merge pull request #2947 from kazuhitoyokoi/master
Fix margin between nodes on palette
2021-04-21 09:42:43 +01:00
Kazuhito Yokoi
372122037f Fix margin between nodes on palette 2021-04-21 13:14:46 +09:00
Nick O'Leary
23a5cb1917 Ensure typedInput option is selected in dropdown menu
Part of #2945
2021-04-20 23:39:21 +01:00
Nick O'Leary
f8d5fef3c4 Ensure typedInput without value has focus class removed
Closes #2945
2021-04-20 23:25:56 +01:00
Nick O'Leary
250005ad16 Allow npm install args to be customised by preInstall trigger 2021-04-20 22:55:06 +01:00
Nick O'Leary
719aea2a58 Add Node 16 to travis 2021-04-20 18:38:35 +01:00
Nick O'Leary
0e06da6c63 Update for 1.3.3 2021-04-20 11:06:23 +01:00
Nick O'Leary
68fef169f3 Merge pull request #2944 from node-red/Pull-in-RBE-and-push-out-tail
v2: Pull in RBE node and push out tail
2021-04-20 10:57:37 +01:00
Nick O'Leary
c668201df4 Merge pull request #2931 from node-red/join-default
Join: change default manual mode to object
2021-04-20 10:57:23 +01:00
Nick O'Leary
1d68c8cc87 Merge pull request #2940 from node-red/i18n-update
Update to latest i18n in editor and runtime
2021-04-20 10:57:08 +01:00
Nick O'Leary
b9ac8b42ea Use paletteLabel if set in help sidebar 2021-04-19 21:07:44 +01:00
Nick O'Leary
b4a03a56b4 Allow preInstall hook to return false to skip npm install 2021-04-19 20:29:30 +01:00
Nick O'Leary
9eb668ab30 Prevent TypedInput label overflowing element
Also adds title attribute to the button for the label so it gets a tooltip
2021-04-19 15:28:17 +01:00
Nick O'Leary
233a74c146 Remove TypedInput from tab focus when only one type available 2021-04-19 15:27:47 +01:00
Dave Conway-Jones
e0c7269b8e bump other refs to bcrypt up to 5.0.1 2021-04-19 13:21:12 +01:00
Dave Conway-Jones
73063df11b Pull in RBE node and push out tail 2021-04-19 13:09:13 +01:00
Nick O'Leary
ff00afb5d7 Fix project credential secret reset handling
Part of #2868
2021-04-19 11:32:26 +01:00
Nick O'Leary
3f43dc1855 Fix jshint error 2021-04-19 10:43:01 +01:00
Nick O'Leary
4a4e7fc7cb Make typedInput.disable more consistent in behaviour
Fixes #2942
2021-04-19 10:39:58 +01:00
Dave Conway-Jones
0253dc9623 ensure CSV node can send false as string 2021-04-19 10:03:11 +01:00
Nick O'Leary
f8855b83fa Update i18next in util package 2021-04-16 17:11:57 +01:00
Nick O'Leary
0d0459d83d Update to latest i18n in editor and runtime
Fixes #2924
2021-04-16 16:52:12 +01:00
Nick O'Leary
374ef3902c Merge pull request #2938 from hardillb/dev
Fix for #2935
2021-04-16 13:27:22 +01:00
Ben Hardill
235690064f Fix for #2935 2021-04-16 13:26:11 +01:00
Nick O'Leary
0167c25e08 Export package version in Grunt file so docs template can access 2021-04-16 11:56:23 +01:00
Nick O'Leary
d2432716ea Fix hook requires in unit tests 2021-04-15 15:30:02 +01:00
Nick O'Leary
52ef85cba3 Update test for latest sinon 2021-04-15 15:15:52 +01:00
Nick O'Leary
8140057bea Add pre/postInstall hooks to module install path 2021-04-15 15:12:40 +01:00
Nick O'Leary
22df59e229 Update hooks api to support promise api 2021-04-15 15:12:35 +01:00
Nick O'Leary
ed351eee54 Move hooks to util package 2021-04-15 15:12:30 +01:00
Nick O'Leary
c021b4c368 Merge pull request #2922 from node-red/update-dependencies
Update dependencies
2021-04-15 14:57:07 +01:00
Nick O'Leary
04a3c4bb22 Ensure mqtt-close message is published when closing mqtt nodes
The change in 1.3 where we ensure config nodes are closed last broke this behaviour. Previously, the config node would get closed triggering the close message. With the new 1.3 behaviour, the flow nodes are stopped and as soon as the last flow node deregisters itself, the broker node would disconnect without sending the close message.

The fix is to send the close message as part of the deregister flow as that will handle all cases properly
2021-04-14 22:28:25 +01:00
Nick O'Leary
b5fda5642f Fix package semver comparison to allow >1 version increment 2021-04-14 18:06:59 +01:00
Nick O'Leary
b0955705be Update to 1.3.2 2021-04-13 13:34:16 +01:00
Nick O'Leary
a4a624d537 Update changelog 2021-04-13 13:33:41 +01:00
Nick O'Leary
6a8cf1b768 Fix variable reference error in editableList
Fixes #2933
2021-04-13 13:24:54 +01:00
Nick O'Leary
aac2a8f830 File node: Add fileWorkingDirectory to customise how relative paths are resolved 2021-04-12 18:00:58 +01:00
Nick O'Leary
8269490dd1 Join: change default manual mode to object 2021-04-12 14:22:27 +01:00
Kazuhito Yokoi
39274b0c5d Add Japanese translations for Node-RED v1.3.1 (#2930) 2021-04-12 14:15:07 +01:00
Dave Conway-Jones
55c2430671 Merge branch 'master' of https://github.com/node-red/node-red 2021-04-12 12:16:32 +01:00
Dave Conway-Jones
023486e175 File out node - fix timing of msg.send to be after close., and...
allow msg.encoding to set encoding if desired.
To close #2921
2021-04-12 12:16:23 +01:00
Nick O'Leary
8227643741 Merge branch 'pr_2920' 2021-04-12 12:08:32 +01:00
Nick O'Leary
e44131f97a Update function node help reference to node properties 2021-04-12 12:08:07 +01:00
Nick O'Leary
5028377d45 Fix MQTT Broker TLS config row layout
Fixes #2927
2021-04-12 11:48:10 +01:00
Nick O'Leary
51aaf1b150 Handle package.json without dependencies section 2021-04-12 10:34:43 +01:00
Nick O'Leary
13406e76de Ensure theme login image is passed through to api response
Fixes #2929
2021-04-12 10:06:35 +01:00
Dave Conway-Jones
4672d98e8a split node - add comment to info re $N being number of messages arriving 2021-04-12 09:47:18 +01:00
Dave Conway-Jones
858b3d640a fix CSV parsing with other than , separator
(and joining as well...
and add tests
to close #2925
2021-04-10 22:17:31 +01:00
Nick O'Leary
6087002562 Fix handling of user-provided keymap
Fixes #2926
2021-04-10 21:34:26 +01:00
Nick O'Leary
82ced56bed Update package versions 2021-04-09 14:12:10 +01:00
Nick O'Leary
982b8ea51d Update fs-extra and semver 2021-04-09 13:53:06 +01:00
Nick O'Leary
877c463494 Update to latest sinon 2021-04-09 11:22:57 +01:00
Nick O'Leary
9882582903 Update to latest bcrypt 2021-04-09 10:50:35 +01:00
Nick O'Leary
ba566657f1 Set minimum node version to 12 2021-04-09 10:37:05 +01:00
Nick O'Leary
cb1a178fbf Set 2.0.0-beta.1 version 2021-04-09 10:35:19 +01:00
Kristian Heljas
ad788fbed1 Function node: describe node.outputCount in help text 2021-04-08 21:09:44 +03:00
Nick O'Leary
749533b0b4 Bump for 1.3.1 2021-04-08 16:23:22 +01:00
Nick O'Leary
142a5f7ca1 Fix change node form validation 2021-04-08 16:21:03 +01:00
Nick O'Leary
28bfa8e418 Update changelog 2021-04-08 14:57:38 +01:00
Kristian Heljas
7b8ed487e9 Function node: add node.outputCount property to sandbox (#2918)
* Function node: add `node.outputs` property to sandbox

https://discourse.nodered.org/t/expose-configured-output-count-to-function-node-i-can-pr/43848

* style: indetation for function node sanbox code

I guess this was unintentionally unindented in d51aefa156 (diff-24cd715c3b7405ea194bfdc0dc2a350ceb2f5d18696b8163c3e40105b981a666)

* Function node: tests for accessing node properties

consistently tests that `node.id`, `node.name` and `node.outputs`
are available in `init()`, `func()` and `finalize()` methods.

* Function node: rename `node.outputs` to `node.outputCount`

https://discourse.nodered.org/t/expose-configured-output-count-to-function-node-i-can-pr/43848/9?u=kristian
2021-04-08 14:52:02 +01:00
Nick O'Leary
0059f9475e Merge pull request #2919 from kazuhitoyokoi/master-addjpn
Add Japanese translations for Node-RED v1.3
2021-04-08 14:50:22 +01:00
Kazuhito Yokoi
9429ea7c64 Fix typo 2021-04-08 20:32:01 +09:00
Kazuhito Yokoi
a157580b22 Add Japanese translations for Node-RED v1.3 2021-04-08 20:06:35 +09:00
Nick O'Leary
41a0147938 Update changelog 2021-04-07 14:37:13 +01:00
Nick O'Leary
16e021e94f Request node: set followAllRedirects to work with POSTs
Fixes #2017
2021-04-07 14:35:29 +01:00
Nick O'Leary
449d76a6c7 Update version for 1.3.0 2021-04-06 18:31:49 +01:00
Nick O'Leary
70172db693 Update changelog 2021-04-06 18:31:16 +01:00
Nick O'Leary
ff93a38354 Update dependencies 2021-04-06 18:31:02 +01:00
Nick O'Leary
e3b70b10d1 Add property validate to Change node rule set
Closes #2911
2021-04-06 17:26:06 +01:00
Nick O'Leary
400141b093 Merge pull request #2913 from heikokue/i18n-de/fixes1
small fixes/improvements of DE translations
2021-04-06 17:03:32 +01:00
Nick O'Leary
ca5e45a46d Flag validation errors in Inject node props config
Fixes #2914
2021-04-06 16:45:21 +01:00
Nick O'Leary
74b547b93c Remove Node 8 from travis due to node-sass breakage 2021-03-31 23:54:25 +01:00
Nick O'Leary
a688305572 Fix jshint errors 2021-03-31 23:53:53 +01:00
Nick O'Leary
f0f2eefb59 Merge branch 'pr_2908' into dev 2021-03-31 23:50:30 +01:00
Nick O'Leary
bdb548ffdc Exec node: remove addpayValue and reuse addpay to track appending property 2021-03-31 23:50:00 +01:00
Nick O'Leary
fe5d4abec1 Add externalModules config to settings.js 2021-03-31 23:14:26 +01:00
Nick O'Leary
70632706f9 Allow Flow.getNode to return subflowInstance nodes
Related to #2898
2021-03-31 23:14:26 +01:00
Nick O'Leary
8f424c063e Merge pull request #2892 from node-red/view-stack
Add actions to make tab navigation easier
2021-03-31 20:56:15 +01:00
Heiko Kuester
9955c3dd5d small fixes/improvements of DE translations 2021-03-31 17:51:40 +02:00
Nick O'Leary
d555fcf7bd Merge pull request #2903 from node-red/plugin-resources
Allow module to provide resources and automatically expose them
2021-03-30 22:50:36 +01:00
Nick O'Leary
8da00c0872 Fix Switch node handling of hasKey rule when property is undefined 2021-03-30 21:37:39 +01:00
Nick O'Leary
393290df2c Prevent accidental text selection of subflow toolbar text 2021-03-25 22:40:25 +00:00
Nick O'Leary
f8a7835341 Fix credential lookup for nested subflows
Fixes #2910
2021-03-25 22:27:49 +00:00
Nick O'Leary
082bac8c3a Handle invalid regex set dynamically in Switch node
Fixes #2905
2021-03-22 21:06:59 +00:00
Nick O'Leary
4cafe42cf4 Update node-sass to 5.x
Fixes #2907
2021-03-22 20:18:23 +00:00
Kazuhito Yokoi
89485971fa Use RED.util.getMessageProperty() to check message property 2021-03-22 20:48:01 +09:00
Kazuhito Yokoi
cb72d5100e Remove type for typedInput in exec node 2021-03-22 20:24:12 +09:00
Kazuhito Yokoi
f103533852 Support typedInput in msg.payload field of exec node 2021-03-22 16:19:55 +09:00
Nick O'Leary
55f1e7ece1 Merge pull request #2904 from node-red-hitachi/fix-exporting-config-node
fix exporting config node
2021-03-18 10:30:03 +00:00
Hiroyasu Nishiyama
c0a765c998 fix exporting config node 2021-03-18 00:11:35 +09:00
heikokue
ed44fb461c updated DE translation for 1.3.0 (MQTT5, modules, function, ...) and other small fixes (#2901) 2021-03-16 09:52:16 +00:00
Nick O'Leary
8543613563 Allow module to provide resources and automatically expose them 2021-03-15 21:06:10 +00:00
Kazuhito Yokoi
734adc6445 Add Japanese translations for Node-RED v1.3.0 (#2900) 2021-03-15 08:23:30 +00:00
heikokue
827f8d4d51 rework of DE translation (#2806)
* started rework of translation to DE, added translation rules and dictionary

* reworks DE translation of JSONata /editor-client/locales/de/jsonata.json

* rework DE translation of editor-client

* moved /editor-client/locales/de/README.md to Wiki https://github.com/node-red/node-red/wiki/Design:-i18n-de

* Update README.md

* Update README.md

* Create README.md

* Create README.md

* fixed #2: "Sie müssen ..., um ... zu können"

* fixed #3

* fixed #4 and removed unnecessary spaces

* fixed #5

* fixed #6, added missing dots, removed unnecessary spaces

* fixed #7, #8, #9

* fixed #10, #11, #12, #13, #14, #15

* fixed #17, #18, 19

* fixed #19

* moved /editor-client/locales/de/dictionary.csv to https://github.com/heikokue/node-red-designs/blob/i18n-de/designs/i18n-de/dictionary.csv

* reworked DE translation of runtime

* fine-tuned DE translation of editor-client

* reworked DE translation of common nodes, fine-tuned editor-client

* reworked DE translation of all nodes, fine-tuned editor-client, intotips, jsonata & runtime

* small i18n fixes
2021-03-12 13:07:12 +00:00
Nick O'Leary
5bbd3d6273 Merge pull request #2894 from node-red-hitachi/fix-error-report-on-node-load
Fix error report on  node load
2021-03-11 16:01:06 +00:00
Dave Conway-Jones
df90e3414d CSV better handling of messages with incoming parts - to create array output
and add tests (apologies for the massive reformat of test file) - but honestly there are two new tests
2021-03-11 12:47:54 +00:00
Dave Conway-Jones
16b9abbe92 redo CSV fix for commas in header template 2021-03-11 09:34:30 +00:00
Nick O'Leary
2de43b719e Merge branch 'pr_2895' into dev 2021-03-10 21:31:27 +00:00
Nick O'Leary
3b84f27f36 Remove arrow-funcs from editor code 2021-03-10 21:31:05 +00:00
Nick O'Leary
f7a6a333e1 Show context store name on TypedInput flow/global types
Fixes #2793
2021-03-10 17:51:20 +00:00
Nick O'Leary
c37ea90206 Remember TypedInput selected sub option when switching types
Fixes #2896
2021-03-10 17:50:46 +00:00
Nick O'Leary
0b39ef68d9 Use cursor keys to change selection in workspace 2021-03-10 14:04:47 +00:00
Hiroyasu Nishiyama
40ea759e2c fix vanishing link in subflow 2021-03-10 09:03:52 +09:00
Hiroyasu Nishiyama
3671a70e3b fix error report on node load 2021-03-09 10:57:29 +09:00
Nick O'Leary
2fa50e458f Fix select up/down stream when zoomed in or out 2021-03-09 00:37:01 +00:00
Nick O'Leary
9c7db1381c Add core:go-to-selected-subflow action 2021-03-06 23:28:20 +00:00
Nick O'Leary
2d4f5b8603 Ctrl-dbclick on subflow node opens subflow tab 2021-03-06 23:21:16 +00:00
Nick O'Leary
5181890433 Add go-to-previous/next-location actions 2021-03-06 23:20:53 +00:00
Nick O'Leary
99a9e3a91b Fix handling encrypted creds on /flows api 2021-03-06 20:27:51 +00:00
Nick O'Leary
101378c625 Properly handle credentials passed to /flows api 2021-03-06 20:09:03 +00:00
Nick O'Leary
aa5e47b462 Fix copy-to-clipboard action in FireFox 2021-03-04 10:45:30 +00:00
369 changed files with 44891 additions and 5467 deletions

View File

@@ -1,35 +0,0 @@
<!--
## Before you hit that Submit button....
This issue tracker is for problems with the Node-RED runtime, the editor or the core nodes.
If your issue is:
- a general 'how-to' type question,
- a feature request or suggestion for a change,
- or problems with 3rd party (`node-red-contrib-`) nodes
please use the [Node-RED Forum](https://discourse.nodered.org) or [slack team](https://nodered.org/slack).
You could also consider asking a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/node-red) and tag it `node-red`.
That way the whole Node-RED user community can help, rather than rely on the core development team.
## So you have a real issue to raise...
To help us understand the issue, please fill-in as much of the following information as you can:
-->
### What are the steps to reproduce?
### What happens?
### What do you expect to happen?
### Please tell us about your environment:
- [ ] Node-RED version:
- [ ] Node.js version:
- [ ] npm version:
- [ ] Platform/OS:
- [ ] Browser:
- [ ] running in Docker:

View File

@@ -1,39 +0,0 @@
---
name: Bug report
about: Reproducible software issues in the core of Node-RED
title: ''
labels: ''
assignees: ''
---
<!--
This issue tracker is for problems with the Node-RED runtime, the editor or the core nodes.
If your issue is:
- a general 'how-to' type question,
- a feature request or suggestion for a change,
- or problems with 3rd party (`node-red-contrib-`) nodes
please use the [Node-RED Forum](https://discourse.nodered.org) or [slack team](https://nodered.org/slack).
You could also consider asking a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/node-red) and tag it `node-red`.
That way the whole Node-RED user community can help, rather than rely on the core development team.
To help us understand the issue, please fill-in as much of the following information as you can:
-->
### What are the steps to reproduce?
### What happens?
### What do you expect to happen?
### Please tell us about your environment:
- [ ] Node-RED version:
- [ ] Node.js version:
- [ ] npm version:
- [ ] Platform/OS:
- [ ] Browser:

View File

@@ -1,17 +0,0 @@
---
name: Anything Else
about: Something that is not a bug report
title: ''
labels: ''
assignees: ''
---
Please DO NOT raise an issue.
We DO NOT use the issue tracker for general support or feature requests. Only bug reports should be raised here using the 'Bug report' template.
For general support, please use the [Node-RED Forum](https://discourse.nodered.org) or [slack team](https://nodered.org/slack). You could also consider asking a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/node-red) and tag it `node-red`.
That way the whole Node-RED user community can help, rather than rely on the core development team.
For feature requests, please use the Node-RED Forum](https://discourse.nodered.org). Many ideas have already been discussed there and you should search that for your request before starting a new discussion.

61
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -0,0 +1,61 @@
name: 🐞 Report a bug
description: File a bug/issue on the core of Node-RED
labels: [needs-triage]
body:
- type: markdown
attributes:
value: |
This issue tracker is for problems with the Node-RED runtime, the editor or the core nodes.
If your issue is:
- a general 'how-to' type question,
- a feature request or suggestion for a change,
- or problems with 3rd party (`node-red-contrib-`) nodes
please use the [Node-RED Forum](https://discourse.nodered.org) or [slack team](https://nodered.org/slack).
You could also consider asking a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/node-red) and tag it `node-red`.
That way the whole Node-RED user community can help, rather than rely on the core development team.
To help us understand the issue, please fill-in as much of the following information as you can:
- type: textarea
attributes:
label: Current Behavior
description: A clear & concise description of what you're experiencing.
validations:
required: false
- type: textarea
attributes:
label: Expected Behavior
description: A clear & concise description of what you expected to happen.
validations:
required: false
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
validations:
required: false
- type: textarea
attributes:
label: Example flow
description: If you have a minimal example flow that demonstrates the issue, share it here.
value: |
```
paste your flow here
```
validations:
required: false
- type: textarea
attributes:
label: Environment
description: Please tell us about your environment. Include any relevant information on how you are running Node-RED.
value: |
- Node-RED version:
- Node.js version:
- npm version:
- Platform/OS:
- Browser:
validations:
required: false

14
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
blank_issues_enabled: true
contact_links:
- name: ❓ Questions
url: https://discourse.nodered.org
about: Ask your question on the Node-RED forum
- name: ⭐️ Feature Request
url: https://discourse.nodered.org/c/development/feature-requests
about: Discuss your request with the community
- name: 🗂 Documentation
url: https://nodered.org/docs
about: Go straight to the documentation
- name: 💬 Slack
url: https://nodered.org/slack
about: Chat about the project on our slack team

View File

@@ -1,4 +1,4 @@
name: PublishDockerImage
name: Publish Release
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
on:

30
.github/workflows/tests.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Run tests
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12, 14, 16]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm install
- name: Run tests
run: |
npm run test
- name: Publish to coveralls.io
if: ${{ matrix.node-version == 14 }}
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ github.token }}

3
.gitignore vendored
View File

@@ -7,7 +7,9 @@
.sessions.json
.settings
.tern-project
.i18n-editor-metadata
*.backup
*.bak
*_cred*
coverage
credentials.json
@@ -24,3 +26,4 @@ docs
!packages/node_modules/**/docs
.vscode
.nyc_output
sync.ffs_db

View File

@@ -1,21 +0,0 @@
sudo: false
addons:
chrome: stable
language: node_js
matrix:
include:
- node_js: "14"
script:
- ./node_modules/.bin/grunt && ( cat coverage/lcov.info | $(npm get prefix)/bin/coveralls || true ) && rm -rf coverage
# - scripts/install-ui-test-dependencies.sh && grunt test-ui
before_script:
- npm install -g coveralls
- node_js: "12"
script:
- ./node_modules/.bin/grunt no-coverage
- node_js: "10"
script:
- ./node_modules/.bin/grunt no-coverage
- node_js: "8"
script:
- ./node_modules/.bin/grunt no-coverage

14
API.md
View File

@@ -1,8 +1,12 @@
Node-RED Modules
---
Node-RED consists of 6 node modules under the `@node-red` scope, which are pulled together
by the top-level `node-red` module. The typical scenario is where you are embedding Node-RED into your
own application, in which case you would use the `node-red` module rather than any of the
internal modules directly.
```javascript
let RED = require("node-red");
```
Node-RED provides a set of node modules that implement different parts of the
application.
Module | Description
-------|-------
@@ -11,5 +15,5 @@ Module | Description
[@node-red/runtime](@node-red_runtime.html) | the core runtime of Node-RED
[@node-red/util](@node-red_util.html) | common utilities for the Node-RED runtime and editor modules
[@node-red/registry](@node-red_registry.html) | the internal node registry
@node-red/nodes | the default set of core nodes
@node-red/nodes | the default set of core nodes. This module only contains the Node-RED nodes - it does not expose any APIs.
@node-red/editor-client | the client-side resources of the Node-RED editor application

View File

@@ -1,3 +1,300 @@
#### 2.0.1: Maintenance Release
Nodes
- Function: Ensure default module export is exposed in Function node
#### 2.0.0: Milestone Release
**Migration from 1.x**
- Node-RED now requires Node.js 12.x or later.
- The following nodes have had significant dependency updates. Unless stated,
they should be fully backward compatible.
- RBE: Relabelled as 'filter' to make it more discoverable and made part of
the core palette, rather than as a separate module.
- Tail: This node has been removed from the default palette. You can reinstall it
from node-red-node-tail
- HTTP Request: Reimplemented with a different underlying module. We have
tried to maintain 100% functional compatibility, but it is possible
some edge cases remain.
- JSON: The schema validation option no longer supports JSON-Schema draft-04
- HTML: Its underlying module has had a major version update. Should be fully
backward compatible.
- `functionExternalModules` is now enabled by default for new installs.
If you have an existing settings file that contains this setting, you will
need to set it to `true` yourself.
The external modules will now get installed in your Node-RED user directory,
(`~/.node-red`) rather than in a subdirectory. This means all dependencies will
be listed in your top-level `package.json`. If you have existing external modules,
they will get reinstalled to the new location when you first run Node-RED 2.0.
Runtime
- Fix missing dependencies (#3052, #2057) @kazuhitoyokoi
- Ensure node.types is defined if node html file missing
- Fix reporting of type_already_registered error
- Move install location of external modules (#3064) @knolleary
Editor
- Update translations (#3063) @kazuhitoyokoi
- Add a slight fade to tab labels that overflow
- Show config node details when selected in outliner
- Fix layout of info outliner for subflow entries
Nodes
- Delay: let `msg.flush` specify how many messages to flush from node (#3059) @dceejay
- Function: external modules is now enabled by default (#3065) @knolleary
- Function: external modules now supports both ES6 and CJS modules (#3065) @knolleary
- WebSocket: add option for client node to send automatic pings (#3056) @knolleary
##### 2.0.0-beta.2: Beta Release
Runtime
- Add `node-red admin init` (via `node-red-admin@2.1.0`)
- Move to GH Actions rather than Travis for build (#3042) @knolleary
Editor
- Include hasUser=false config nodes when exporting whole flow (#3048)
- Emit nodes:change for any updated config node when node deleted/added
- Fix padding of compact notification Closes #3045
- Ensure any html in changelog is escaped before displaying
- Add support for Map/Set property types on Debug (#3040) @knolleary
- Add 'theme' to default settings file
- Add RED.view.annotations api (#3032) @knolleary
- Update monaco editor to V0.25.2 (#3031) @Steve-Mcl
- Lower tray zIndex when overlay tray being opened Fixes #3019
- Reduce z-Index of Function expand buttons to prevent overlap Part of #3019
- Ensure RED.clipboard.import displays the right library Fixes #3021
- Batch messages sent over comms to prevent flooding (#3025) @knolleary
- Allow RED.popover.panel to specify a closeButton to ignore click events on
- Use browser default language for initial page load
- Add css var for node font color
- Fix label padding of toggleButton
- Give sidebar open tab a bit more room for its label
- Various Monaco updates (#3015) @Steve-Mcl
- Log readOnly on startup (#3024) @sammachin
- Translation updates (#3020 #3022) @HiroyasuNishiyama @kazuhitoyokoi
Nodes
- HTTP Request: Fix proxy handling (#3044) @hardillb
- HTTP Request: Handle basic auth with @ in username (#3017) @hardillb
- Add Japanese translation for file-in node (#3037 #3039) @kazuhitoyokoi
- File In: Add option for file-in node to include all properties (default off) (#3035) @dceejay
- Exec: add windowsHide option to hide windows under Windows (#3026) @natcl
- Support loading external module sub path Fixes #3023
##### 2.0.0-beta.1: Beta Release
Runtime
- [MAJOR] Set minimum node version to 12.
- [MAJOR] Fix flowfile name to flows.json in settings (#2951) @dceejay
- [MAJOR] Update to latest i18n in editor and runtime (#2940) @knolleary
- [MAJOR] Deprecate usage of httpRoot (#2953) @knolleary
- Add pre/postInstall hooks to npm install handling (#2936) @knolleary
- Add engine-strict flag to npm install args (#2965) @nileio
- Restructure default settings.js to be more organised (#3012) @knolleary
- Ensure httpServerOptions gets applied to ALL the express apps
- Allow RED.settings.set to replace string property with object property
- Update debug tests to handle compact comms format
- Updates to encode/decode message when passed over debug comms link
- Remove all input event listeners on a node once it is closed
- Move hooks to util package
- Rework hooks structure to be a linkedlist
- Update dependencies (#2922) @knolleary
Editor
- [MAJOR] Change node id generation to give fixed length values without '.' (#2987) @knolleary
- [MAJOR] Add Monaco code editor (#2971) @Steve-Mcl
- Update to latest Monaco (#3007) @Steve-Mcl
- Update Node-RED Function typings in Monaco (#3008) @Steve-Mcl
- Add css named variables for certain key colours (#2994) @knolleary
- Improve contrast of export dialog JSON font color
- Switch editableList buttons from <a> to <button> elements
- Add option to RED.nodes.createCompleteNodeSet to include node dimensions
- Fix css of node help table of contents elements
- Improve red-ui-node-icon css and add red-ui-node-icon-small modifier class
- Add RED.hooks to editor
- Add viewAddPort viewRemovePort viewAddNode viewRemoveNode hooks to view
- Use paletteLabel if set in help sidebar
- Add missing args from JSONata $now signature
Nodes
- [MAJOR] Relabel RBE node as 'filter' and move into core. Also remove tail (#2944) @dceejay
- [MAJOR] HTTP Request: migrate to 'got' module (#2952) @knolleary
- [MAJOR] Move Inject node to CronosJS module (#2959) @knolleary
- [MAJOR] JSON: Update ajv to 8.2.0 - drop support for JSON-Schema draft-04 (#2969) @knolleary
- [MAJOR] HTML node: cheerio update to 1.x (#3011) @knolleary
- Join: change default manual mode to object (#2931) @knolleary
- File node: Add fileWorkingDirectory (#2932) @knolleary
- Delay node enhancements (#2294) @kazuhitoyokoi (#2949) @dceejay
- Add Japanese translations for delay node enhancements (#2958) @kazuhitoyokoi
- Inject node: reorder TypedInput options (#2961) @dceejay
- HTTP Request: update to work with proxies (#2983) @hardillb (#3009) @hardillb
- HTTP Request: fix msg.responseUrl (#2986) @hardillb
- TLS: Add ALPN support to TLS node (#2988) @hardillb
- Inject: add "Inject now" button to edit dialog (#2990) @Steve-Mcl
### 1.3.5 Maintenance Release
Editor
- Open subflow tab next to active tab rather than at the end
- Shrink default notification box
- Support mousewheel scroll in tab bar
- Revert some of #2967 to fix treeList gutter width calculation
- Prevent unknown node from breaking editor
- Stop module with missing types from preventing editor load
- Handle sidebar tab that no longer exists when setting first active
- Fix plugin loading when browser sends unrecognised lang
- Prevent error whilst drag/drop importing from leaving dropTarget visible Fixes #2982
- Fix scaling issues when dragging nodes into scaled workspace
- Fix incorrect shortcut keys in info tips (#2980) @kazuhitoyokoi
- Reduce code duplication around node/label generation
- Fix theme handling when no editorTheme.page setting
- Fix jshint error in treeList
Runtime
- Fix error handling in runtime/lib/api/nodes
- Add Node 16 with sass fixed
- Migrate from node-sass to sass (#2984)
- Fix "installRetry" was declared a constant and changed (#2974) @aheissenberger
Nodes
- Function: Fix 'SyntaxError' in Function node when last line of on-stop is a comment
- Function: Fix Function tab label names in the node help text Closes #2978
- Function: Update Japanese info text of function node (#2985) @HiroyasuNishiyama
### 1.3.4 Maintenance Release
Editor
- Allow nodes to access resolved theme files Fixes #2968
- Fix importing node to currently flow rather than match its old z value
- Don't let 'escape' whilst moving nodes interrupt things Fixes #2960
- Sort context stores in TypedInput and ensure default first Fixes #2954
- Fix margin between nodes on palette (#2947) @kazuhitoyokoi
- Ensure typedInput option is selected in dropdown menu Part of #2945
- Ensure typedInput without value has focus class removed Closes #2945
- TreeList: Fix remove item when depth=0 and wrong gutter calc (#2967) @hanc2006
Runtime
- Handle subflow modules that contain subflows
- Timeout http upgrade requests that are not otherwise handled Fixes #2956
- Fix error on auto commit for no flow change (#2957) @HiroyasuNishiyama
Nodes
- CSV: Fix CSV handling of special chars as separators
- Delay: Give delay node random mina nd max more space so you can see complete value
- Exec: fix grunt fail on exec node test (#2964) @HiroyasuNishiyama
- Function: Ensure function expand button is above vertical scrollbar Fixes #2955
- Inject: Fix inject node output tooltip extra property count
### 1.3.3: Maintenance Release
Editor
- Fix package semver comparison to allow >1 version increment
- Prevent TypedInput label overflowing element Fixes #2941
- Remove TypedInput from tab focus when only one type available
- Make typedInput.disable more consistent in behaviour Fixes #2942
- Fix project credential secret reset handling Part of #2868
Runtime
- Export package version in Grunt file so docs template can access
Nodes
- CSV: ensure CSV node can send false as string
- HTTPIn: handle application/x-protobuf as Buffer type (#2935 #2938) @hardillb
- MQTT: Ensure mqtt-close message is published when closing mqtt nodes
### 1.3.2: Maintenance Release
Runtime
- Handle package.json without dependencies section
Editor
- Fix variable reference error in editableList Fixes #2933
- Fix handling of user-provided keymap Fixes #2926
- Ensure theme login image is passed through to api response Fixes #2929
- Add Japanese translations for Node-RED v1.3.1 (#2930) @kazuhitoyokoi
Nodes
- CSV: Fix CSV parsing with other than , separator
- File out: Fix timing of msg.send to be after close
- Function: describe `node.outputCount` in help text
- MQTT: Fix MQTT Broker TLS config row layout Fixes #2927
- Split: add comment to info re $N being number of messages arriving
### 1.3.1: Maintenance Release
Nodes
- Fix change node form validation
### 1.3.0: Milestone Release
Editor
- Remember TypedInput selected sub option when switching types Fixes #2896
- Show context store name on TypedInput flow/global types Fixes #2793
- Add core:go-to-selected-subflow action
- Ctrl-dbclick on subflow node opens subflow tab
- Add go-to-previous/next-location actions
- Fix copy-to-clipboard action in FireFox
- Fix select up/down stream when zoomed in or out
- Use cursor keys to change selection in workspace
- Prevent accidental text selection of subflow toolbar text
- Update node-sass to 5.x Fixes #2907
- Allow module to provide resources and automatically expose them (#2903) @knolleary
Runtime
- DE language updates (#2806 #2901 #2913) @heikokue
- Remove Node 8 from travis due to node-sass breakage
- Allow Flow.getNode to return subflowInstance nodes Related to #2898
- Fix credential lookup for nested subflows Fixes #2910
- Add externalModules config to settings.js
- Add Japanese translations for Node-RED v1.3.0 (#2900)
- Fix handling encrypted creds on /flows api
- Properly handle credentials passed to /flows api
- Fix line-number reporting in errors on node load (#2894) @HiroyasuNishiyama
Nodes
- Change: Add property validation to Change node rule set Closes #2911
- Exec: Allow any property to be appended to command (#2908) @kazuhitoyokoi
- HTTP Request: set followAllRedirects to work with POSTs Fixes #2017
- Inject: Flag validation errors in Inject node props config Fixes #2914
- Function: add node.outputCount to sandbox (#2918) @kristianheljas
- Switch: Fix Switch node handling of hasKey rule when property is undefined
- Switch: Handle invalid regex set dynamically in Switch node Fixes #2905
### 1.3.0-beta.1: Beta Release
Editor
@@ -100,8 +397,6 @@ Nodes
### 1.2.9: Maintenance Release
Editor

View File

@@ -46,6 +46,14 @@ If you raise a pull-request without having signed the CLA, you will be prompted
to do so automatically.
### Code Branches
When raising a PR for a fix or a new feature, it is important to target the right branch.
- `master` - this is the main branch for the latest stable release of Node-RED. All bug fixes for that release should target this branch.
- `v1.x` - this is the maintenance branch for the 1.x stream. If a fix *only* applies to 1.x, then it should target this branch. If it applies to the current stable release as well, target `master` first. We will then decide if it needs to be back ported to the 1.x stream.
- `dev` - this is the branch for new feature development targeting the next milestone release.
### Coding standards
Please ensure you follow the coding standards used through-out the existing

View File

@@ -16,7 +16,7 @@
var path = require("path");
var fs = require("fs-extra");
var sass = require("node-sass");
var sass = require("sass");
module.exports = function(grunt) {
@@ -40,8 +40,10 @@ module.exports = function(grunt) {
if (nonHeadless) {
process.env.NODE_RED_NON_HEADLESS = true;
}
const pkg = grunt.file.readJSON('package.json');
process.env.NODE_RED_PACKAGE_VERSION = pkg.version;
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
pkg: pkg,
paths: {
dist: ".dist"
},
@@ -135,6 +137,7 @@ module.exports = function(grunt) {
"packages/node_modules/@node-red/editor-client/src/js/jquery-addons.js",
"packages/node_modules/@node-red/editor-client/src/js/red.js",
"packages/node_modules/@node-red/editor-client/src/js/events.js",
"packages/node_modules/@node-red/editor-client/src/js/hooks.js",
"packages/node_modules/@node-red/editor-client/src/js/i18n.js",
"packages/node_modules/@node-red/editor-client/src/js/settings.js",
"packages/node_modules/@node-red/editor-client/src/js/user.js",
@@ -167,6 +170,7 @@ module.exports = function(grunt) {
"packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/statusBar.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/view.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/view-annotations.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/view-navigator.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/view-tools.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/sidebar.js",
@@ -179,6 +183,7 @@ module.exports = function(grunt) {
"packages/node_modules/@node-red/editor-client/src/js/ui/palette-editor.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/editor.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/editors/*.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/editors/code-editors/*.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/event-log.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/tray.js",
"packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js",
@@ -208,7 +213,9 @@ module.exports = function(grunt) {
"node_modules/marked/marked.min.js",
"node_modules/dompurify/dist/purify.min.js",
"packages/node_modules/@node-red/editor-client/src/vendor/d3/d3.v3.min.js",
"packages/node_modules/@node-red/editor-client/src/vendor/i18next/i18next.min.js",
"node_modules/i18next/i18next.min.js",
"node_modules/i18next-http-backend/i18nextHttpBackend.min.js",
"node_modules/jquery-i18next/jquery-i18next.min.js",
"node_modules/jsonata/jsonata-es5.min.js",
"packages/node_modules/@node-red/editor-client/src/vendor/jsonata/formatter.js",
"packages/node_modules/@node-red/editor-client/src/vendor/ace/ace.js",
@@ -281,7 +288,9 @@ module.exports = function(grunt) {
"packages/node_modules/@node-red/editor-client/public/index.html",
"packages/node_modules/@node-red/editor-client/public/favicon.ico",
"packages/node_modules/@node-red/editor-client/public/icons",
"packages/node_modules/@node-red/editor-client/public/vendor"
"packages/node_modules/@node-red/editor-client/public/vendor",
"packages/node_modules/@node-red/editor-client/public/types/node",
"packages/node_modules/@node-red/editor-client/public/types/node-red",
]
},
release: {
@@ -371,11 +380,24 @@ module.exports = function(grunt) {
src: [
'ace/**',
'jquery/css/base/**',
'font-awesome/**'
'font-awesome/**',
'monaco/dist/**',
'monaco/types/extraLibs.js',
'monaco/style.css',
'monaco/monaco-bootstrap.js'
],
expand: true,
dest: 'packages/node_modules/@node-red/editor-client/public/vendor/'
},
{
cwd: 'packages/node_modules/@node-red/editor-client/src',
src: [
'types/node/*.ts',
'types/node-red/*.ts',
],
expand: true,
dest: 'packages/node_modules/@node-red/editor-client/public/'
},
{
cwd: 'packages/node_modules/@node-red/editor-client/src/icons',
src: '**',
@@ -467,7 +489,8 @@ module.exports = function(grunt) {
],
options: {
destination: 'docs',
configure: './jsdoc.json'
configure: './jsdoc.json',
fred: "hi there"
}
},
_editor: {

View File

@@ -1,6 +1,6 @@
{
"name": "node-red",
"version": "1.3.0-beta.1",
"version": "2.0.1",
"description": "Low-code programming for event-driven applications",
"homepage": "http://nodered.org",
"license": "Apache-2.0",
@@ -26,43 +26,45 @@
}
],
"dependencies": {
"ajv": "6.12.6",
"async-mutex": "0.2.6",
"acorn": "8.4.1",
"acorn-walk": "8.1.1",
"ajv": "8.6.0",
"async-mutex": "0.3.1",
"basic-auth": "2.0.1",
"bcryptjs": "2.4.3",
"body-parser": "1.19.0",
"cheerio": "0.22.0",
"cheerio": "1.0.0-rc.10",
"clone": "2.1.2",
"content-type": "1.0.4",
"cookie": "0.4.1",
"cookie-parser": "1.4.5",
"cors": "2.8.5",
"cron": "1.7.2",
"cronosjs": "1.7.1",
"denque": "1.5.0",
"express": "4.17.1",
"express-session": "1.17.1",
"fs-extra": "8.1.0",
"express-session": "1.17.2",
"form-data": "4.0.0",
"fs-extra": "10.0.0",
"fs.notify": "0.0.4",
"got": "11.8.2",
"hash-sum": "2.0.0",
"hpagent": "^0.1.2",
"https-proxy-agent": "5.0.0",
"i18next": "15.1.2",
"iconv-lite": "0.6.2",
"i18next": "20.3.2",
"iconv-lite": "0.6.3",
"is-utf8": "0.2.1",
"js-yaml": "3.14.0",
"js-yaml": "3.14.1",
"json-stringify-safe": "5.0.1",
"jsonata": "1.8.4",
"lodash.clonedeep": "^4.5.0",
"media-typer": "1.1.0",
"memorystore": "1.6.4",
"mime": "2.4.7",
"moment-timezone": "0.5.32",
"mqtt": "4.2.6",
"memorystore": "1.6.6",
"mime": "2.5.2",
"moment-timezone": "0.5.33",
"mqtt": "4.2.8",
"multer": "1.4.2",
"mustache": "4.1.0",
"node-red-admin": "^0.2.6",
"node-red-node-rbe": "^0.2.9",
"node-red-node-sentiment": "^0.1.6",
"node-red-node-tail": "^0.1.0",
"mustache": "4.2.0",
"node-red-admin": "^2.2.0",
"nopt": "5.0.0",
"oauth2orize": "1.11.0",
"on-headers": "1.0.2",
@@ -70,51 +72,54 @@
"passport-http-bearer": "1.0.1",
"passport-oauth2-client-password": "0.1.2",
"raw-body": "2.4.1",
"request": "2.88.0",
"semver": "6.3.0",
"tar": "6.0.5",
"uglify-js": "3.12.4",
"ws": "6.2.1",
"semver": "7.3.5",
"tar": "6.1.0",
"tough-cookie": "4.0.0",
"uglify-js": "3.13.10",
"uuid": "8.3.2",
"ws": "7.5.1",
"xml2js": "0.4.23"
},
"optionalDependencies": {
"bcrypt": "3.0.8"
"bcrypt": "5.0.1"
},
"devDependencies": {
"dompurify": "2.2.6",
"grunt": "1.3.0",
"dompurify": "2.2.9",
"grunt": "1.4.1",
"grunt-chmod": "~1.1.1",
"grunt-cli": "~1.3.2",
"grunt-cli": "~1.4.3",
"grunt-concurrent": "3.0.0",
"grunt-contrib-clean": "~2.0.0",
"grunt-contrib-compress": "1.6.0",
"grunt-contrib-compress": "2.0.0",
"grunt-contrib-concat": "~1.0.1",
"grunt-contrib-copy": "~1.0.0",
"grunt-contrib-jshint": "~2.1.0",
"grunt-contrib-uglify": "~4.0.1",
"grunt-contrib-jshint": "3.0.0",
"grunt-contrib-uglify": "5.0.1",
"grunt-contrib-watch": "~1.1.0",
"grunt-jsdoc": "2.4.1",
"grunt-jsdoc-to-markdown": "5.0.0",
"grunt-jsdoc-to-markdown": "6.0.0",
"grunt-jsonlint": "2.1.3",
"grunt-mkdir": "~1.1.0",
"grunt-npm-command": "~0.1.2",
"grunt-sass": "~3.1.0",
"grunt-simple-mocha": "~0.4.1",
"grunt-simple-nyc": "^3.0.1",
"http-proxy": "1.18.1",
"i18next-http-backend": "1.2.6",
"jquery-i18next": "1.2.1",
"jsdoc-nr-template": "github:node-red/jsdoc-nr-template",
"marked": "2.0.0",
"marked": "2.1.3",
"minami": "1.2.3",
"mocha": "^5.2.0",
"mocha": "9.0.1",
"node-red-node-test-helper": "^0.2.7",
"node-sass": "^4.14.1",
"nodemon": "2.0.6",
"nodemon": "2.0.8",
"proxy": "^1.0.2",
"sass": "1.35.1",
"should": "13.2.3",
"sinon": "1.17.7",
"sinon": "11.1.1",
"stoppable": "^1.1.0",
"supertest": "5.0.0"
"supertest": "6.1.3"
},
"engines": {
"node": ">=8"
"node": ">=12"
}
}

View File

@@ -39,6 +39,15 @@ module.exports = {
var adminApp = express();
var defaultServerSettings = {
"x-powered-by": false
}
var serverSettings = Object.assign({},defaultServerSettings,settings.httpServerOptions||{});
for (var eOption in serverSettings) {
adminApp.set(eOption, serverSettings[eOption]);
}
// Flows
adminApp.get("/flows",needsPermission("flows.read"),flows.get,apiUtil.errorHandler);
adminApp.post("/flows",needsPermission("flows.write"),flows.post,apiUtil.errorHandler);

View File

@@ -17,9 +17,8 @@ module.exports = {
})
} else {
opts.lang = apiUtils.determineLangFromHeaders(req.acceptsLanguages());
if (/[^a-z\-\*]/i.test(opts.lang)) {
res.json({});
return;
if (/[^0-9a-z=\-\*]/i.test(opts.lang)) {
opts.lang = "en-US";
}
runtimeAPI.plugins.getPluginConfigs(opts).then(function(configs) {
res.send(configs);
@@ -32,9 +31,8 @@ module.exports = {
lang: req.query.lng,
req: apiUtils.getRequestLogObject(req)
}
if (/[^a-z\-\*]/i.test(opts.lang)) {
res.json({});
return;
if (/[^0-9a-z=\-\*]/i.test(opts.lang)) {
opts.lang = "en-US";
}
runtimeAPI.plugins.getPluginCatalogs(opts).then(function(result) {
res.json(result);

View File

@@ -90,7 +90,7 @@ function getToken(req,res,next) {
return server.token()(req,res,next);
}
function login(req,res) {
async function login(req,res) {
var response = {};
if (settings.adminAuth) {
var mergedAdminAuth = Object.assign({}, settings.adminAuth, settings.adminAuth.module);
@@ -116,8 +116,9 @@ function login(req,res) {
response.prompts[0].image = theme.serveFile('/login/',mergedAdminAuth.strategy.image);
}
}
if (theme.context().login && theme.context().login.image) {
response.image = theme.context().login.image;
let themeContext = await theme.context();
if (themeContext.login && themeContext.login.image) {
response.image = themeContext.login.image;
}
}
res.json(response);

View File

@@ -158,25 +158,31 @@ function CommsConnection(ws, user) {
}
CommsConnection.prototype.send = function(topic,data) {
var self = this;
if (topic && data) {
this.stack.push({topic:topic,data:data});
}
this._queueSend();
}
CommsConnection.prototype._queueSend = function() {
var self = this;
if (!this._xmitTimer) {
this._xmitTimer = setTimeout(function() {
try {
self.ws.send(JSON.stringify(self.stack));
self.ws.send(JSON.stringify(self.stack.splice(0,50)));
self.lastSentTime = Date.now();
} catch(err) {
removeActiveConnection(self);
log.warn(log._("comms.error-send",{message:err.toString()}));
}
delete self._xmitTimer;
self.stack = [];
if (self.stack.length > 0) {
self._queueSend();
}
},50);
}
}
CommsConnection.prototype.subscribe = function(topic) {
runtimeAPI.comms.subscribe({
user: this.user,

View File

@@ -64,10 +64,12 @@ module.exports = {
}
});
}
if (settings.httpServerOptions) {
for (var eOption in settings.httpServerOptions) {
editorApp.set(eOption, settings.httpServerOptions[eOption]);
}
var defaultServerSettings = {
"x-powered-by": false
}
var serverSettings = Object.assign({},defaultServerSettings,settings.httpServerOptions||{});
for (var eOption in serverSettings) {
editorApp.set(eOption, serverSettings[eOption]);
}
editorApp.get("/",ensureRuntimeStarted,ui.ensureSlash,ui.editor);
@@ -75,6 +77,8 @@ module.exports = {
editorApp.get("/icons/:module/:icon",ui.icon);
editorApp.get("/icons/:scope/:module/:icon",ui.icon);
editorApp.get(/^\/resources\/((?:@[^\/]+\/)?[^\/]+)\/(.+)$/,ui.moduleResource);
var theme = require("./theme");
theme.init(settings, runtimeAPI);
editorApp.use("/theme",theme.app());

View File

@@ -33,7 +33,7 @@ var defaultContext = {
asset: {
red: (process.env.NODE_ENV == "development")? "red/red.js":"red/red.min.js",
main: (process.env.NODE_ENV == "development")? "red/main.js":"red/main.min.js",
vendorMonaco: ""
}
};
@@ -93,6 +93,7 @@ module.exports = {
themeContext = clone(defaultContext);
themeSettings = null;
theme = settings.editorTheme || {};
themeContext.asset.vendorMonaco = ((theme.codeEditor || {}).lib === "monaco") ? "vendor/monaco/monaco-bootstrap.js" : "";
activeTheme = theme.theme;
},
@@ -129,6 +130,14 @@ module.exports = {
}
themeContext.page.title = theme.page.title || themeContext.page.title;
// Store the resolved urls to these resources so nodes (such as Debug)
// can access them
theme.page._ = {
css: themeContext.page.css,
scripts: themeContext.page.scripts,
favicon: themeContext.page.favicon
}
}
if (theme.header) {
@@ -223,6 +232,8 @@ module.exports = {
themePlugin.path
);
themeContext.page.css = cssFiles.concat(themeContext.page.css || [])
theme.page = theme.page || {_:{}}
theme.page._.css = cssFiles.concat(theme.page._.css || [])
}
if (themePlugin.scripts) {
const scriptFiles = serveFilesFromTheme(
@@ -232,6 +243,8 @@ module.exports = {
themePlugin.path
)
themeContext.page.scripts = scriptFiles.concat(themeContext.page.scripts || [])
theme.page = theme.page || {_:{}}
theme.page._.scripts = scriptFiles.concat(theme.page._.scripts || [])
}
}
activeThemeInitialised = true;

View File

@@ -68,6 +68,28 @@ module.exports = {
apiUtils.rejectHandler(req,res,err);
})
},
moduleResource: function(req, res) {
let resourcePath = req.params[1];
let opts = {
user: req.user,
module: req.params[0],
path: resourcePath
}
runtimeAPI.nodes.getModuleResource(opts).then(function(data) {
if (data) {
var contentType = mime.getType(resourcePath);
res.set("Content-Type", contentType);
res.send(data);
} else {
res.status(404).end()
}
}).catch(function(err) {
console.log(err.stack);
apiUtils.rejectHandler(req,res,err);
})
},
editor: async function(req,res) {
res.send(Mustache.render(editorTemplate,await theme.context()));
},

View File

@@ -64,6 +64,14 @@ function init(settings,_server,storage,runtimeAPI) {
}
}
var defaultServerSettings = {
"x-powered-by": false
}
var serverSettings = Object.assign({},defaultServerSettings,settings.httpServerOptions||{});
for (var eOption in serverSettings) {
adminApp.set(eOption, serverSettings[eOption]);
}
auth.init(settings,storage);
var maxApiRequestSize = settings.apiMaxLength || '5mb';

View File

@@ -1,6 +1,6 @@
{
"name": "@node-red/editor-api",
"version": "1.3.0-beta.1",
"version": "2.0.1",
"license": "Apache-2.0",
"main": "./lib/index.js",
"repository": {
@@ -16,25 +16,25 @@
}
],
"dependencies": {
"@node-red/util": "1.3.0-beta.1",
"@node-red/editor-client": "1.3.0-beta.1",
"@node-red/util": "2.0.1",
"@node-red/editor-client": "2.0.1",
"bcryptjs": "2.4.3",
"body-parser": "1.19.0",
"clone": "2.1.2",
"cors": "2.8.5",
"express-session": "1.17.1",
"express-session": "1.17.2",
"express": "4.17.1",
"memorystore": "1.6.4",
"mime": "2.4.7",
"memorystore": "1.6.6",
"mime": "2.5.2",
"multer": "1.4.2",
"mustache": "4.1.0",
"mustache": "4.2.0",
"oauth2orize": "1.11.0",
"passport-http-bearer": "1.0.1",
"passport-oauth2-client-password": "0.1.2",
"passport": "0.4.1",
"ws": "6.2.1"
"ws": "7.5.1"
},
"optionalDependencies": {
"bcrypt": "3.0.6"
"bcrypt": "5.0.1"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,23 +1,23 @@
{
"info" : {
"tip0" : "Sie können die ausgewählten Nodes oder Verbindungen mit {{ core:delete-selection }} entfernen.",
"tip1" : "Suche nach Nodes mit {{ core:search }}",
"tip2" : "{{ core:toggle-sidebar }} schaltet die Ansicht dieser Seitenleiste ein.",
"tip3" : "Sie können Ihre Palette von Nodes mit {{ core:manage-palette }} verwalten.",
"tip4" : "Ihre Flow-Konfigurations-Nodes werden in der Seitenleiste angezeigt. Es kann über das Menü oder mit {{ core:show-config-tab }} aufgerufen werden.",
"tip5" : "Aktiviert oder inaktiviert diese Tipps von der Option in den Einstellungen",
"tip6" : "Verschieben Sie die ausgewählten Nodes mit Hilfe der [left] [up] [down] und [right] Tasten. Halten Sie [Shift] gedrückt, um das Fenster weiter zu schieben",
"tip7" : "Wenn Sie einen Node auf eine Verbindung ziehen, wird er in die Verbindung eingefügt.",
"tip8" : "Die ausgewählten Nodes exportieren oder die aktuelle Registerkarte mit {{ core:show-export-dialog }}",
"tip9" : "Importieren Sie einen Flow, indem Sie sein JSON in den Editor ziehen oder mit {{ core:show-import-dialog }}.",
"tip10" : "[Umschalt] [Klicken] und ziehen Sie auf einen Node-Anschluss, um alle angeschlossenen Verbindungen oder nur die ausgewählte zu verschieben.",
"tip11" : "Die Registerkarte \"Info\" mit {{ core:show-info-tab }} oder der Registerkarte \"Debug\" mit {{ core:show-debug-tab }} anzeigen",
"tip12" : "[ctrl] [Klicken] in den Arbeitsbereich, um den Schnellhinzufügedialog zu öffnen.",
"tip13" : "Halten Sie [ctrl] gedrückt, wenn Sie auf einem Node-Anschluss klicken, um eine Schnellverbindung zu aktivieren.",
"tip14" : "Halten Sie [Umschalt] gedrückt, wenn Sie auf einen Node klicken, um auch alle verbundenen Nodes auszuwählen.",
"tip15" : "Halten Sie [ctrl] gedrückt, wenn Sie auf einen Node klicken, um ihn aus der aktuellen Auswahl hinzuzufügen oder zu entfernen.",
"tip16" : "Indexzungen wechseln mit {{ core:show-previous-tab }} und {{ core:show-next-tab }}",
"tip17" : "Sie können die Änderungen im Editierrahmen des Nodes mit {{ core:confirm-edit-tray }} bestätigen oder sie mit {{ core:cancel-edit-tray }} abbrechen.",
"tip18" : "Durch Drücken von {{ core:edit-selected-node }} wird der erste Node in der aktuellen Auswahl bearbeitet."
}
}
"info": {
"tip0": "Sie können die ausgewählten Nodes oder Verbindungen mit {{ core:delete-selection }} entfernen",
"tip1": "Sie können nach Nodes mit {{ core:search }} suchen",
"tip2": "{{ core:toggle-sidebar }} blendet die Seitenleiste ein/aus",
"tip3": "Sie können Ihre Node-Palette mit {{ core:manage-palette }} verwalten",
"tip4": "Ihre Flow-Konfigurationsnodes werden in der Seitenleiste angezeigt, die über das Menü oder mit {{ core:show-config-tab }} angezeigt werden kann",
"tip5": "Aktiviere oder deaktiviere diese Tipps in den Einstellungen im Tab 'Ansicht'",
"tip6": "Sie können die ausgewählten Nodes mit den [left]/[up]/[down]/[right]-Tasten verschieben. Wenn Sie dabei [Shift] gedrückt halten, können Sie den Fensterausschnitt verschieben.",
"tip7": "Wenn Sie ein Node auf eine Verbindung ziehen, wird es in die Verbindung eingefügt",
"tip8": "Sie können die ausgewählten Nodes oder den aktuellen Flow-Tab mit {{ core:show-export-dialog }} exportieren",
"tip9": "Sie können einen Flow importieren, indem Sie sein JSON in den Editor ziehen oder mittels {{ core:show-import-dialog }}",
"tip10": "Halten Sie [Shift] beim [Klicken] auf ein Node gedrückt, um auch alle verbundenen Nodes mit zu verschieben",
"tip11": "Sie können den Tab 'Info' mit {{ core:show-info-tab }} oder den Tab 'Debug' mit {{ core:show-debug-tab }} anzeigen lassen",
"tip12": "Halten Sie [Strg] beim [Klicken] in den Arbeitsbereich gedrückt, um den Schnellhinzufügedialog öffnen",
"tip13": "Halten Sie [Strg] beim [Klicken] auf einen Node-Anschluss gedrückt, um eine Verbindung nur durch kurzes [Klicken] (ohne Halten) zu verlegen",
"tip14": "Halten Sie [Shift] beim [Klicken] auf ein Node gedrückt, um auch alle verbundenen Nodes mit auszuwählen",
"tip15": "Halten Sie [Strg] beim [Klicken] auf ein Node gedrückt, um es zu der aktuellen Auswahl hinzuzufügen oder aus ihr zu entfernen",
"tip16": "Sie können die Flow-Tabs mit {{ core:show-previous-tab }} und {{ core:show-next-tab }} wechseln",
"tip17": "Sie können die Änderungen im Node-Editor mit {{ core:confirm-edit-tray }} bestätigen oder sie mit {{ core:cancel-edit-tray }} verwerfen",
"tip18": "Sie können mit {{ core:edit-selected-node }} den ersten Node in der aktuellen Auswahl bearbeiten"
}
}

View File

@@ -1,222 +1,274 @@
{
"$string" : {
"args" : "arg",
"desc" : "Transformiert den Parameter *arg* in eine Zeichenfolge mit den folgenden Transformationsregeln:\n\n -Zeichenfolgen bleiben unverändert\n -Funktionen werden in eine leere Zeichenfolge konvertiert\n -Numerische Unendlichkeit und NaN lösen einen Fehler aus, da sie nicht als JSON-Nummer dargestellt werden können.\n -Alle anderen Werte werden mit Hilfe der Funktion 'JSON.stringify' in eine JSON-Zeichenfolge konvertiert."
},
"$length" : {
"args" : "str",
"desc" : "Gibt die Anzahl der Zeichen in der Zeichenfolge `str` zurück. Es wird ein Fehler ausgelöst, wenn `str` keine Zeichenfolge ist."
},
"$substring" : {
"args" : "str, start [, länge]",
"desc" : "Gibt eine Zeichenfolge zurück, die die Zeichen im ersten Parameter `str` beginnend bei Position `start` (Null-Offset) enthält. Wenn \"length\" angegeben ist, enthält die Unterzeichenfolge maximal \"Länge\" Zeichen. Wenn `start` negativ ist, gibt es die Anzahl der Zeichen am Ende von `str` an."
},
"$substringBefore" : {
"args" : "str, chars",
"desc" : "Gibt die Unterzeichenfolge vor dem ersten Auftreten der Zeichenfolge `chars` in `str` zurück. Falls `str` nicht `chars` enthält, gibt es `str` zurück."
},
"$substringAfter" : {
"args" : "str, chars",
"desc" : "Gibt die Unterzeichenfolge nach dem ersten Auftreten der Zeichenfolge `chars` in `str` zurück. Falls `str` nicht `chars` enthält, gibt es `str` zurück."
},
"$uppercase" : {
"args" : "str",
"desc" : "Gibt eine Zeichenfolge mit allen Zeichen von `str` zurück, die in Großbuchstaben konvertiert werden."
},
"$lowercase" : {
"args" : "str",
"desc" : "Gibt eine Zeichenfolge mit allen Zeichen von `str` in Kleinbuchstaben zurück."
},
"$trim" : {
"args" : "str",
"desc" : "Normalisiert und trimmt alle Leerzeichen in `str` durch Anwenden der folgenden Schritte:\n\n -Alle Tabulatorstopps, Wagenrückläufe und Zeilenvorschübe werden durch Leerzeichen ersetzt.\n-Zusammenhängende Folgen von Räumen werden auf einen einzigen Raum reduziert.\n-Trailing und führende Plätze werden entfernt.\n\n Wenn 'str' nicht angegeben ist (d. h. Diese Funktion wird ohne Argumente aufgerufen), dann wird der Kontextwert als Wert von `str` verwendet. Es wird ein Fehler ausgelöst, wenn `str` keine Zeichenfolge ist."
},
"$contains" : {
"args" : "str, Muster",
"desc" : "Gibt `true` zurück, wenn `str` durch `Muster` abgeglichen wird, sonst gibt es `false` zurück. Wenn 'str' nicht angegeben ist (d. h. Diese Funktion wird mit einem Argument aufgerufen), dann wird der Kontextwert als Wert von `str` verwendet. Der Parameter 'Muster' kann entweder eine Zeichenfolge oder ein regulärer Ausdruck sein."
},
"$split" : {
"args" : "str [, Trennzeichen] [, Grenzwert]",
"desc" : "Teilt den Parameter 'str' in einem Array mit Unterzeichenfolgen. Es ist ein Fehler, wenn `str` keine Zeichenfolge ist. Der optionale Parameter 'Trennzeichen' gibt die Zeichen in der `str` an, um die es entweder als Zeichenfolge oder als regulärer Ausdruck geteilt werden soll. Wenn 'Trennzeichen' nicht angegeben wird, wird die leere Zeichenfolge angenommen, und `str` wird in ein Array aus einzelnen Zeichen aufgeteilt. Es handelt sich um einen Fehler, wenn `Trennzeichen' keine Zeichenfolge ist. Der optionale Parameter 'Grenzwert' ist eine Zahl, die die maximale Anzahl von Unterzeichenfolgen angibt, die in das resultierende Array eingeschlossen werden sollen. Alle zusätzlichen Unterzeichenfolgen werden gelöscht. Wenn 'Grenzwert' nicht angegeben wird, wird ' str ` vollständig geteilt, wobei die Größe des resultierenden Arrays nicht begrenzt ist. Es handelt sich um einen Fehler, wenn `Grenzwert' keine nicht negative Zahl ist."
},
"$join" : {
"args" : "array [, Trennzeichen]",
"desc" : "Verkettet ein Array von Komponentenzeichenfolgen in eine einzelne verkettete Zeichenfolge mit jeder Komponentenzeichenfolge, die durch den optionalen Parameter 'separator' getrennt ist. Es ist ein Fehler, wenn die Eingabe `Array` ein Element enthält, das keine Zeichenfolge ist. Wenn 'Trennzeichen' nicht angegeben wird, wird davon ausgegangen, dass es sich um eine leere Zeichenfolge handelt, d. h. Zwischen den Komponentenzeichenfolgen ist kein Trennzeichen vorhanden. Es handelt sich um einen Fehler, wenn `Trennzeichen' keine Zeichenfolge ist."
},
"$match" : {
"args" : "str, Muster [, Grenzwert]",
"desc" : "Wendet die Zeichenfolge `str` an den regulären Ausdruck `Muster` an und gibt ein Array von Objekten zurück, wobei jedes Objekt Informationen zu jedem Vorkommen einer Übereinstimmung in `str` enthält."
},
"$replace" : {
"args" : "str, Muster, Ersatz [, Grenzwert]",
"desc" : "Findet Vorkommen von `Muster` in `str` und ersetzt sie durch `Ersatz`.\n\nDer optionale Parameter 'Grenzwert' ist die maximale Anzahl an Ersetzungen."
},
"$now" : {
"args" : "",
"desc" : "Generiert einen Zeitstempel im ISO-8601-kompatiblen Format und gibt sie als Zeichenfolge zurück."
},
"$base64encode" : {
"args" : "Zeichenfolge",
"desc" : "Konvertiert eine ASCII-Zeichenfolge in eine Basis-64-Darstellung. Jedes Zeichen in der Zeichenfolge wird als Byte mit binären Daten behandelt. Dies setzt voraus, dass alle Zeichen in der Zeichenfolge im Bereich von 0x00 bis 0xFF liegen, der alle Zeichen in URI-codierten Zeichenfolgen enthält. Unicode-Zeichen außerhalb dieses Bereichs werden nicht unterstützt."
},
"$base64decode" : {
"args" : "Zeichenfolge",
"desc" : "Konvertiert die Basis-64-codierten Byte in eine Zeichenfolge unter Verwendung einer UTF-8-Unicode-Codepage."
},
"$number" : {
"args" : "arg",
"desc" : "Der Parameter 'arg' wird unter Verwendung der folgenden Regeln für das Casting in eine Zahl verwendet:\n\n -Zahlen bleiben unverändert\n -Zeichenfolgen, die eine Folge von Zeichen enthalten, die eine rechtliche JSON-Nummer darstellen, werden in diese Zahl konvertiert.\n -Alle anderen Werte bewirken, dass ein Fehler ausgelöst wird."
},
"$abs" : {
"args" : "Anzahl",
"desc" : "Gibt den absoluten Wert des Parameters 'Zahl' zurück."
},
"$floor" : {
"args" : "Anzahl",
"desc" : "Gibt den Wert von 'Zahl' auf die nächste ganze Zahl zurück, die kleiner oder gleich 'Zahl' ist."
},
"$ceil" : {
"args" : "Anzahl",
"desc" : "Gibt den Wert von 'Zahl' auf die nächste ganze Zahl zurück, die größer oder gleich 'Zahl' ist."
},
"$round" : {
"args" : "Zahl [, Genauigkeit]",
"desc" : "Gibt den Wert des Parameters `Zahl` zurück, der auf die Anzahl der Dezimalstellen gerundet wird, die durch den optionalen Parameter 'Genauigkeit' angegeben wird."
},
"$power" : {
"args" : "Basis, Exponent",
"desc" : "Gibt den Wert von `Basis` potenziert mit `Exponent` zurück."
},
"$sqrt" : {
"args" : "Zahl",
"desc" : "Gibt die Quadratwurzel des Werts des Parameters 'Zahl' zurück."
},
"$random" : {
"args" : "",
"desc" : "Gibt eine Pseudozufallszahl größer-gleich null und kleiner als eins zurück."
},
"$millis" : {
"args" : "",
"desc" : "Gibt die Anzahl der Millisekunden seit der Unix-Epoche (1. Januar 1970 (UTC)) als Zahl zurück. Alle Invocationen von `$millis ()` innerhalb einer Auswertung eines Ausdrucks geben alle denselben Wert zurück."
},
"$sum" : {
"args" : "Array",
"desc" : "Gibt die arithmetische Summe eines `Array` von Zahlen zurück. Es ist ein Fehler, wenn die Eingabe `Array` ein Element enthält, das keine Zahl ist."
},
"$max" : {
"args" : "Array",
"desc" : "Gibt die maximale Anzahl in einem `Array` von Zahlen zurück. Es ist ein Fehler, wenn die Eingabe `Array` ein Element enthält, das keine Zahl ist."
},
"$min" : {
"args" : "Array",
"desc" : "Gibt die minimale Zahl in einem `Array` von Zahlen zurück. Es ist ein Fehler, wenn die Eingabe `Array` ein Element enthält, das keine Zahl ist."
},
"$average" : {
"args" : "Array",
"desc" : "Gibt den Mittelwert eines `Array` von Zahlen zurück. Es ist ein Fehler, wenn die Eingabe `Array` ein Element enthält, das keine Zahl ist."
},
"$boolean" : {
"args" : "arg",
"desc" : "Castet das Argument mit den folgenden Regeln in einen Booleschen Wert:\n\n -` Boolean ': nicht geändert\n -` string `: leer: `false`\n -` string `: nicht leer: `true`\n -` Zahl `: ` 0 `: ` falsch `\n -` Zahl `: Nicht-Null: `true`\n -` null `: `false`\n -` array `: leer: `false`\n -` array `: enthält ein Mitglied, das auf `true` setzt: `true`\n -` array `: alle Member werden in `false` umgesetzt: `false`\n -` object `: empty: `false`\n -` object `: non-empty: `true`\n -` Funktion `: ` falsch `"
},
"$not" : {
"args" : "arg",
"desc" : "Gibt den Booleschen Wert NOT für das Argument zurück. `arg` wird zuerst in einen Booleschen Wert umgesetzt."
},
"$exists" : {
"args" : "arg",
"desc" : "Gibt den Booleschen Wert 'true' zurück, wenn der Ausdruck `arg` als Wert ausgewertet wird, oder 'false', wenn der Ausdruck nicht mit einem anderen Ausdruck übereinstimmt (z. B. ein Pfad zu einer nicht vorhandenen Feldreferenz)."
},
"$count" : {
"args" : "Array",
"desc" : "Gibt die Anzahl der Elemente in dem Array zurück."
},
"$append" : {
"args" : "Array, Array",
"desc" : "Hängen Sie zwei Arrays an."
},
"$sort" : {
"args" : "array [, Funktion]",
"desc" : "Gibt ein Array zurück, das alle Werte im Parameter 'array' enthält, aber in der Reihenfolge sortiert wird.\n\nWenn ein Vergleichsoperator 'function' angegeben wird, muss es sich um eine Funktion handeln, die zwei Parameter benötigt:\n\n` Funktion (links, rechts) `\n\nDiese Funktion wird durch den Sortieralgorithmus aufgerufen, um zwei Werte links und rechts zu vergleichen. Wenn der Wert von links nach dem Wert von rechts in der gewünschten Sortierreihenfolge platziert werden soll, muss die Funktion den Booleschen Wert 'true' zurückgeben, um einen Auslagerungsspeicher anzuzeigen. Andernfalls muss 'false' zurückgegeben werden."
},
"$reverse" : {
"args" : "Array",
"desc" : "Gibt ein Array zurück, das alle Werte aus dem Parameter 'array' enthält, aber in umgekehrter Reihenfolge."
},
"$shuffle" : {
"args" : "Array",
"desc" : "Gibt ein Array zurück, das alle Werte aus dem Parameter ` array ` enthält, aber in zufälliger Reihenfolge geschattiert ist."
},
"$zip" : {
"args" : "Array, ...",
"desc" : "Gibt ein konvolviertes (gezipptes) Array zurück, das gruppierte Arrays von Werten aus den Argumenten ` array1 ` ... ` arrayN ' aus Index 0, 1, 2 ... enthält."
},
"$keys" : {
"args" : "Objekt",
"desc" : "Gibt ein Array zurück, das die Schlüssel in dem Objekt enthält. Wenn es sich bei dem Argument um ein Array von Objekten handelt, enthält das zurückgegebene Array eine deduplizierte Liste aller Schlüssel in allen Objekten."
},
"$lookup" : {
"args" : "Objekt, Schlüssel",
"desc" : "Gibt den Wert zurück, der dem Schlüssel im Objekt zugeordnet ist. Wenn es sich bei dem ersten Argument um ein Array von Objekten handelt, werden alle Objekte im Array durchsucht, und die Werte, die mit allen Vorkommen des Schlüssels verknüpft sind, werden zurückgegeben."
},
"$spread" : {
"args" : "Objekt",
"desc" : "Teilt ein Objekt, das Schlüssel/Wert-Paare enthält, in ein Array von Objekten, von denen jedes ein einzelnes Schlüssel/Wert-Paar aus dem Eingabeobjekt hat. Wenn es sich bei dem Parameter um ein Array von Objekten handelt, enthält die resultierende Feldgruppe ein Objekt für jedes Schlüssel/Wert-Paar in jedem Objekt in der angegebenen Feldgruppe."
},
"$merge" : {
"args" : "array &lt;object&gt;",
"desc" : "Mischt ein Array von ` Objekten ` in ein einzelnes ` Objekt `, das alle Schlüssel/Wert-Paare aus jedem der Objekte in dem Eingabe-Array enthält. Wenn eines der Eingabeobjekte denselben Schlüssel enthält, enthält das zurückgegebene Objekt den Wert des letzten Objekts in der Feldgruppe. Es handelt sich um einen Fehler, wenn das Eingabe-Array ein Element enthält, das kein Objekt ist."
},
"$sift" : {
"args" : "Objekt, Funktion",
"desc" : "Gibt ein Objekt zurück, das nur die Schlüssel/Wert-Paare aus dem Parameter 'object' enthält, die die Prädikat ` funktion ' erfüllen, die als zweiter Parameter übergeben wird.\n\nDie Funktion ` function `, die als zweiter Parameter angegeben wird, muss die folgende Signatur aufweisen:\n\n` function (value [, key [, object]]) `"
},
"$each" : {
"args" : "Objekt, Funktion",
"desc" : "Gibt ein Array zurück, das die Werte enthält, die von der Funktion ` function ` zurückgegeben werden, wenn sie auf jedes Schlüssel/Wert-Paar im ` object ` angewendet werden."
},
"$map" : {
"args" : "Array, Funktion",
"desc" : "Gibt ein Array zurück, das die Ergebnisse der Anwendung des Parameters ` function ` auf jeden Wert im Parameter 'array' enthält.\n\nDie Funktion ` function `, die als zweiter Parameter angegeben wird, muss die folgende Signatur aufweisen:\n\n` function (value [, index [, array]]) `"
},
"$filter" : {
"args" : "Array, Funktion",
"desc" : "Gibt ein Array zurück, das nur die Werte im Parameter 'array' enthält, die das Prädikat ` funktion ` erfüllen.\n\nDie Funktion ` function `, die als zweiter Parameter angegeben wird, muss die folgende Signatur aufweisen:\n\n` function (value [, index [, array]]) `"
},
"$reduce" : {
"args" : "array, function [, init]",
"desc" : "Gibt einen aggregierten Wert zurück, der aus der Anwendung des Parameters ` function 'nacheinander auf jeden Wert in' array ` in Kombination mit dem Ergebnis der vorherigen Anwendung der Funktion angewendet wurde.\n\nDie Funktion muss zwei Argumente akzeptieren und verhält sich wie ein Infix-Operator zwischen jedem Wert innerhalb des ` Array `.\n\nDer optionale Parameter 'init' wird als Anfangswert in der Aggregation verwendet."
},
"$flowContext" : {
"args" : "Zeichenfolge [, Zeichenfolge]",
"desc" : "Ruft eine Flusskontexteigenschaft ab.\n\nDies ist eine definierte Funktion vom Typ \"Node-RED\"."
},
"$globalContext" : {
"args" : "Zeichenfolge [, Zeichenfolge]",
"desc" : "Ruft eine globale Kontexteigenschaft ab.\n\nDies ist eine definierte Funktion vom Typ \"Node-RED\"."
},
"$pad" : {
"args" : "string, width [, char]",
"desc" : "Gibt eine Kopie der ` Zeichenfolge ` mit zusätzlichen Aufenthalten zurück, falls erforderlich, so dass die Gesamtzahl der Zeichen mindestens der absolute Wert des Parameters 'width' ist.\n\nWenn ` width ` eine positive Zahl ist, wird die Zeichenfolge nach rechts aufgefüllt. Wenn sie negativ ist, wird sie nach links geplisften.\n\nDas optionale Argument 'char' gibt die Padding-Zeichen an, die verwendet werden sollen. Wenn keine Angabe gemacht wird, wird standardmäßig der Wert für das Leerzeichen angenommen."
},
"$fromMillis" : {
"args" : "Anzahl",
"desc" : "Konvertieren Sie eine Zahl, die Millisekunden seit der Unix-Epoche (1. Januar 1970 (UTC)) enthält in eine Zeitangabe im ISO 8601-Format."
},
"$formatNumber" : {
"args" : "Zahl, Bild [, Optionen]",
"desc" : "Transformiere die `Zahl` an eine Zeichenfolge und formatiert sie in eine dezimale Darstellung, wie in der 'Bild' -Zeichenfolge angegeben.\n\n Das Verhalten dieser Funktion ist mit der XPath/XQuery-Funktion fn:formatnummer konsistent, wie sie in der XPath F&O 3.1-Spezifikation definiert ist. Der Parameter für die Bildzeichenfolge definiert, wie die Zahl formatiert ist und hat die gleiche Syntax wie fn:format-number.\n\nDas optionale dritte Argument ` Optionen ` wird verwendet, um die standardmäßigen länderspezifischen Formatierungszeichen, wie z. B. das Dezimaltrennzeichen, zu überschreiben. Wenn dieses Argument angegeben wird, muss es sich um ein Objekt handeln, das Name/Wert-Paare enthält, die im Abschnitt mit dem Dezimalformat der XPath F&O 3.1-Spezifikation angegeben sind."
},
"$formatBase" : {
"args" : "Zahl [, Radix]",
"desc" : "Transformiere die `Zahl` in eine Zeichenfolge und formatiert sie in eine ganze Zahl, die in der durch das `radix` -Argument angegebenen Zahlenbasis dargestellt wird. Wenn 'radix' nicht angegeben wird, wird standardmäßig die Basis 10 verwendet. 'radix` kann zwischen 2 und 36 liegen, andernfalls wird ein Fehler ausgelöst."
},
"$toMillis" : {
"args" : "timestamp",
"desc" : "Konvertieren Sie eine Zeitangabe im ISO 8601-Format in die Anzahl der Millisekunden seit der Unix-Epoche (1. Januar 1970 (UTC)) als Zahl. Es wird ein Fehler ausgelöst, wenn die Zeichenfolge nicht das richtige Format hat."
},
"$env" : {
"args" : "arg",
"desc" : "Gibt den Wert einer Umgebungsvariablen zurück.\n\nDies ist eine definierte Funktion vom Typ \"Node-RED\"."
}
}
"$string": {
"args": "arg[, prettify]",
"desc": "Wandelt `arg` in eine Zeichenfolge um gemäß der folgenden Regeln:\n\n- Zeichenfolgen (string) bleiben unverändert\n- Funktionen werden in eine leere Zeichenfolge konvertiert\n- Numerische Unendlichkeit und NaN lösen einen Fehler aus, da sie nicht als JSON-Zahlenwert dargestellt werden können.\n- Alle anderen Werte werden mit Hilfe der Funktion `JSON.stringify` in eine JSON-Zeichenfolge konvertiert. Wenn `prettify` `true` ist, wird \"prettified\" JSON erzeugt. Z.B. Eine Zeile pro Feld und Zeilen werden eingeschoben basierend auf der Feldtiefe."
},
"$length": {
"args": "str",
"desc": "Gibt die Zeichenanzahl von `str` zurück. Es wird ein Fehler ausgelöst, wenn `str` keine Zeichenfolge ist."
},
"$substring": {
"args": "str, start [, length]",
"desc": "Gibt eine Teilzeichenfolge zurück, die die Zeichen in `str` beginnend bei Position `start` (Null-Offset) enthält. Wenn `length` vorgegeben ist, enthält die rückgegebene Zeichenfolge maximal die in `length` vorgegebene Zeichenanzahl. Wenn `start` negativ ist, werden die Zeichen vom Ende aus gezählt von `str` zurückgegeben."
},
"$substringBefore": {
"args": "str, chars",
"desc": "Gibt die Teilzeichenfolge vor dem ersten Auftreten der Zeichenfolge `chars` in `str` zurück. Falls `str` nicht `chars` enthält, wird `str` zurückgegeben."
},
"$substringAfter": {
"args": "str, chars",
"desc": "Gibt die Teilzeichenfolge nach dem ersten Auftreten der Zeichenfolge `chars` in `str` zurück. Falls `str` nicht `chars` enthält, wird `str` zurückgegeben."
},
"$uppercase": {
"args": "str",
"desc": "Gibt veränderten `str` zurück, bei dem allen Zeichen in Großbuchstaben umgewandelt wurden."
},
"$lowercase": {
"args": "str",
"desc": "Gibt veränderten `str` zurück, bei dem allen Zeichen in Kleinbuchstaben umgewandelt wurden."
},
"$trim": {
"args": "[str]",
"desc": "Normalisiert und trimmt alle Leerzeichen in `str` durch Anwenden der folgenden Schritte:\n\n- Alle Tabulatoren, Wagenrückläufe (returns) und Zeilenvorschübe (line feeds) werden durch Leerzeichen ersetzt.\n- Zusammenhängende Folgen von Leerzeichen werden auf ein einzelnes Leerzeichen reduziert.\n- Leerzeichen am Anfang und am Ende werden entfernt.\n\nWenn `str` nicht vorgegeben ist (d.h. diese Funktion wird ohne Parameter aufgerufen), dann wird der Kontextwert als Wert von `str` verwendet. Es wird ein Fehler ausgelöst, wenn `str` keine Zeichenfolge ist."
},
"$contains": {
"args": "str, pattern",
"desc": "Gibt `false` zurück, wenn `pattern` als Teilzeichenfolge in `str` enthalten ist, sonst gibt sie `false` zurück. Wenn `str` nicht vorgegeben ist (d. h. Diese Funktion wird mit einem Parameter aufgerufen), dann wird der Kontextwert als Wert von `str` verwendet. `pattern` kann entweder eine Zeichenfolge oder ein regulärer Ausdruck sein."
},
"$split": {
"args": "str [, separator] [, limit]",
"desc": "Teilt `str` in einem Array mit Teilzeichenfolgen. Es ergibt einen Fehler, wenn `str` keine Zeichenfolge ist.\n\nDer optionale Parameter `separator` gibt die Zeichen in der `str` an, anhand dem, vorgegeben entweder als Zeichenfolge oder als regulärer Ausdruck, `str` geteilt werden soll. Wenn `separator` nicht vorgegeben wird, wird ein leerer String als `separator` angenommen und `str` wird in ein Array aus einzelnen Zeichen aufgeteilt. Es handelt sich um einen Fehler, wenn `separator` leer ist.\n\nDer optionale Parameter `limit` ist eine Zahl, die die maximale Anzahl von Teilzeichenfolgen angibt, die in dem rückzugebenen Array enthalten sein sollen. Alle zusätzlichen Teilzeichenfolgen werden verworfen. Wenn `limit` nicht vorgegeben wird, wird `str` vollständig geteilt, wobei die Größe des resultierenden Arrays nicht begrenzt ist. Es handelt sich um einen Fehler, wenn `limit` eine negative Zahl ist."
},
"$join": {
"args": "array [, separator]",
"desc": "Verkettet ein Array von Zeichenfolgen zu einer einzigen Zeichenfolge, wobei die einzelnen Zeichenfolgen durch den optionalen Trennzeichen-Parameter `separator` getrennt sind. Es ergibt einen Fehler, wenn das `array` ein Element enthält, das keine Zeichenfolge ist. Wenn `separator` nicht vorgegeben wird, wird davon ausgegangen, dass es sich um eine leere Zeichenfolge handelt, d.h. zwischen den einzelnen Zeichenfolgen wird kein Trennzeichen eingefügt. Es handelt sich um einen Fehler, wenn `separator` keine Zeichenfolge ist."
},
"$match": {
"args": "str, pattern [, limit]",
"desc": "Wendet den regulären Ausdruck `pattern` auf die Zeichenfolge `str` an und gibt ein Array von Objekten zurück, die Informationen zu jedem Vorkommen von `pattern` in `str` enthält."
},
"$replace": {
"args": "str, pattern, replacement [, limit]",
"desc": "Findet Vorkommen von `pattern` in `str` und ersetzt sie durch `replacement`.\n\nDer optionale Parameter `limit` ist die maximale Anzahl an Ersetzungen."
},
"$now": {
"args": "",
"desc": "Generiert einen Zeitstempel im ISO-8601-kompatiblen Format und gibt sie als Zeichenfolge zurück."
},
"$base64encode": {
"args": "str",
"desc": "Konvertiert eine ASCII-Zeichenfolge `str` in eine Basis-64-Darstellung. Jedes Zeichen in `str` wird als Byte mit binären Daten behandelt. Dies setzt voraus, dass alle Zeichen in der Zeichenfolge im Bereich von 0x00 bis 0xFF liegen, der alle Zeichen in URI-codierten Zeichenfolgen enthält. Unicode-Zeichen außerhalb dieses Bereichs werden nicht unterstützt."
},
"$base64decode": {
"args": "str",
"desc": "Konvertiert den Basis-64-codierten `str` in eine Zeichenfolge unter Verwendung einer UTF-8-Unicode-Codepage."
},
"$number": {
"args": "arg",
"desc": "Wandelt `arg` unter Verwendung der folgenden Regeln in eine Zahl um:\n\n- Zahlen bleiben unverändert\n- Zeichenfolgen, die eine Folge von Zeichen enthalten, die einen echten JSON-Zahlenwert darstellen, werden in die entsprechende Zahl konvertiert.\n- Alle anderen Werte bewirken, dass ein Fehler ausgelöst wird."
},
"$abs": {
"args": "number",
"desc": "Gibt den absoluten Wert von `number` zurück."
},
"$floor": {
"args": "number",
"desc": "Gibt `number` abgerundet auf die nächste ganze Zahl zurück, die kleiner oder gleich `number` ist."
},
"$ceil": {
"args": "number",
"desc": "Gibt `number` aufgerundet auf die nächste ganze Zahl zurück, die größer oder gleich `number` ist."
},
"$round": {
"args": "number [, precision]",
"desc": "Gibt `number` gerundet auf die Anzahl der Nachkommastellen zurück, welche durch den optionalen Parameter `precision` vorgegeben ist."
},
"$power": {
"args": "base, exponent",
"desc": "Gibt `base` potenziert mit `exponent` zurück."
},
"$sqrt": {
"args": "number",
"desc": "Gibt die Quadratwurzel von `number` zurück."
},
"$random": {
"args": "",
"desc": "Gibt eine Pseudozufallszahl größer-gleich null und kleiner als eins zurück."
},
"$millis": {
"args": "",
"desc": "Gibt die aktuelle Anzahl der Millisekunden seit Beginn der Unix-Zeitrechnung (1. Januar 1970 UTC) als Zahl zurück. Alle Aufrufe von `$millis()` innerhalb der Auswertung eines Ausdrucks geben alle denselben Wert zurück."
},
"$sum": {
"args": "array",
"desc": "Gibt die arithmetische Summe eines `array` von Zahlen zurück. Es ergibt einen Fehler, wenn `array` ein Element enthält, das keine Zahl ist."
},
"$max": {
"args": "array",
"desc": "Gibt die größte Zahl von einem `array` von Zahlen zurück. Es ergibt einen Fehler, wenn `array` ein Element enthält, das keine Zahl ist."
},
"$min": {
"args": "array",
"desc": "Gibt die kleinste Zahl von einem `array` von Zahlen zurück. Es ergibt einen Fehler, wenn `array` ein Element enthält, das keine Zahl ist."
},
"$average": {
"args": "array",
"desc": "Gibt den Mittelwert eines `array` von Zahlen zurück. Es ergibt einen Fehler, wenn `array` ein Element enthält, das keine Zahl ist."
},
"$boolean": {
"args": "arg",
"desc": "Wandelt `arg` gemäß folgender Regeln in einen booleschen Wert um:\n\n- `Boolean`: unverändert\n- `string`: leer `false`, nicht leer `true`\n- `Zahl`: `0` → `falsch`, Nicht-Null `true`\n- `null` → `false`\n- `array`: leer `false`, enthält mindestens ein Element, das `true` ist → `true`, alle Elemente sind `false` `false`\n- `object`: leer → `false`, nicht leer → `true`\n- `function`: `false`"
},
"$not": {
"args": "arg",
"desc": "Gibt den invertierten booleschen Wert von `arg` zurück. `arg` wird zuerst in einen booleschen Wert umgesetzt."
},
"$exists": {
"args": "arg",
"desc": "Gibt den booleschen Wert `true` zurück, wenn der Ausdruck `arg` zu einem Wert ausgewertet wird, oder `false`, wenn der Ausdruck nicht mit einem anderen Ausdruck übereinstimmt (z.B. ein Pfad zu einer nicht vorhandenen Feldreferenz)."
},
"$count": {
"args": "array",
"desc": "Gibt die Anzahl der Elemente in dem Array `array` zurück."
},
"$append": {
"args": "array, array",
"desc": "Verkettet zwei Arrays miteinander."
},
"$sort": {
"args": "array [, function]",
"desc": "Gibt ein Array zurück, das alle Elemente vom `array` in sortierter Reihenfolge enthält.\n\nWenn ein Vergleichsoperator `function` vorgegeben wird, muss es sich um eine Funktion handeln, die zwei Parameter benötigt:\n\n`function(left, right)`\n\nDiese Funktion wird durch den Sortieralgorithmus aufgerufen, um zwei Elemente links und rechts zu vergleichen. Wenn das linke Element nach dem rechten in der gewünschten Sortierreihenfolge platziert werden soll, muss die Funktion den booleschen Wert `true` zurückgeben, um eine Vertauschung anzuzeigen. Andernfalls muss `false` zurückgegeben werden."
},
"$reverse": {
"args": "array",
"desc": "Gibt ein Array zurück, das alle Elemente vom `array` in umgekehrter Reihenfolge enthält."
},
"$shuffle": {
"args": "array",
"desc": "Gibt ein Array zurück, das alle Elemente vom `array` in zufälliger Reihenfolge enthält."
},
"$zip": {
"args": "array, ...",
"desc": "Gibt ein gepacktes (geziptes) Array zurück, das gruppierte Arrays der Elemente von `array1` ... `arrayN` aus Index 0, 1, 2 ... enthält."
},
"$keys": {
"args": "object",
"desc": "Gibt ein Array zurück, das die Schlüssel in dem Objekt `object` enthält. Wenn es sich bei dem Parameter um ein Array von Objekten handelt, enthält das zurückgegebene Array eine deduplizierte Liste aller Schlüssel in allen Objekten."
},
"$lookup": {
"args": "object, key",
"desc": "Gibt den Wert zurück, der dem Schlüssel `key` im Objekt `object` zugeordnet ist. Wenn es sich bei dem ersten Parameter um ein Array von Objekten handelt, werden alle Objekte im Array durchsucht, und die Werte, die mit allen Vorkommen des Schlüssels verknüpft sind, werden zurückgegeben."
},
"$spread": {
"args": "object",
"desc": "Teilt ein Objekt `object`, das Schlüssel/Wert-Paare enthält, in ein Array von Objekten, von denen jedes ein einzelnes Schlüssel/Wert-Paar aus dem Eingabeobjekt hat. Wenn es sich bei dem Parameter um ein Array von Objekten handelt, enthält die resultierende Feldgruppe ein Objekt für jedes Schlüssel/Wert-Paar in jedem Objekt in der vorgegebenen Feldgruppe."
},
"$merge": {
"args": "array&lt;object&gt;",
"desc": "Fügt ein Array von Objekt-Elementen `object` in ein einzelnes Objekt `object` zusammen, das alle Schlüssel/Wert-Paare aus jedem der Objekte in dem Ausgangs-Array enthält. Wenn eines der Ausgangs-Objekte denselben Schlüssel enthält, enthält das zurückgegebene Objekt den Wert des letzten Objekts des Arrays. Es handelt sich um einen Fehler, wenn das Ausgangs-Array ein Element enthält, das kein Objekt ist."
},
"$sift": {
"args": "object, function",
"desc": "Gibt ein Objekt zurück, das nur die Schlüssel/Wert-Paare aus dem Parameter `object` enthält, die die Prädikat `function` erfüllen, die als zweiter Parameter übergeben wird.\n\nDie Funktion `function`, die als zweiter Parameter vorgegeben wird, muss die folgende Signatur aufweisen:\n\n`function(value [, key [, object]])`"
},
"$each": {
"args": "object, function",
"desc": "Gibt ein Array zurück, das die Werte enthält, die von der Funktion `function` zurückgegeben werden, wenn sie auf jedes Schlüssel/Wert-Paar im `object` angewendet werden."
},
"$map": {
"args": "array, function",
"desc": "Gibt ein Array zurück, das die Ergebnisse von `function`, angewendet auf jedes Element von `array`, enthält.\n\nDie Funktion `function`, die als zweiter Parameter vorgegeben wird, muss die folgende Signatur aufweisen:\n\n`function(value [, index [, array]])`"
},
"$filter": {
"args": "array, function",
"desc": "Gibt ein Array zurück, das nur die Elemente von `array` enthält, die das Eigenschaft `function` erfüllen.\n\nDie Funktion `function`, die als zweiter Parameter vorgegeben wird, muss die folgende Signatur aufweisen:\n\n`function(value [, index [, array]])`"
},
"$reduce": {
"args": "array, function [, init]",
"desc": "Gibt einen aggregierten Wert zurück, der aus der Anwendung des Parameters `function` nacheinander auf jedes Element in `array` in Kombination mit dem Ergebnis der vorherigen Anwendung der Funktion angewendet wurde.\n\nDie Funktion muss zwei Parameter akzeptieren und verhält sich wie ein Infix-Operator zwischen jedem Element innerhalb des `array`.\n\nDer optionale Parameter `init` wird als Anfangswert in der Aggregation verwendet."
},
"$flowContext": {
"args": "str [, str]",
"desc": "Ruft eine Flow-Kontexteigenschaft ab.\n\nDies ist eine definierte Funktion vom Typ `Node-RED`."
},
"$globalContext": {
"args": "str [, str]",
"desc": "Ruft eine globale Kontexteigenschaft ab.\n\nDies ist eine definierte Funktion vom Typ `Node-RED`."
},
"$pad": {
"args": "str, width [, char]",
"desc": "Gibt eine aufgefüllte Kopie von `str` zurück, so dass (falls erforderlich) die Gesamtzahl der Zeichen mindestens dem absoluten Wert von `width` entspricht.\n\nWenn `width` eine positive Zahl ist, wird die Zeichenfolge nach rechts aufgefüllt. Wenn sie negativ ist, wird sie nach links aufgefüllt.\n\nDer optionale Parameter `char` gibt die Auffüll-Zeichen an, die verwendet werden sollen. Wenn keine Angabe gemacht wird, wird standardmäßig mit Leerzeichen aufgefüllt."
},
"$fromMillis": {
"args": "number",
"desc": "Konvertiert `number`, die die Millisekunden seit Beginn der Unix-Zeitrechnung (1. Januar 1970 UTC) enthält, in eine Zeitangabe im ISO 8601-Format."
},
"$formatNumber": {
"args": "number, picture [, options]",
"desc": "Wandelt `number` in eine Zeichenfolge um und formatiert sie in eine dezimale Darstellung, wie im `picture`-String-Parameter vorgegeben.\n\nDas Verhalten dieser Funktion ist mit der XPath/XQuery-Funktion fn:formatnummer konsistent, wie sie in der XPath F&O 3.1-Spezifikation definiert ist. Der `picture`-String-Parameter definiert, wie die Zahl formatiert ist und hat die gleiche Syntax wie fn:format-number.\n\nDer optionale dritte Parameter `options` wird verwendet, um die standardmäßigen länderspezifischen Formatierungszeichen, wie z.B. das Dezimaltrennzeichen, zu überschreiben. Wenn dieser Parameter vorgegeben wird, muss es sich um ein Objekt handeln, das Name/Wert-Paare enthält, die im Abschnitt mit dem Dezimalformat der XPath F&O 3.1-Spezifikation vorgegeben sind."
},
"$formatBase": {
"args": "number [, radix]",
"desc": "Wandelt `number` in eine Zeichenfolge um und formatiert sie in eine ganze Zahl, die in der durch den `radix`-Parameter vorgegebenen Zahlenbasis dargestellt wird. Wenn `radix` nicht vorgegeben wird, wird standardmäßig die Basis 10 verwendet. `radix` kann zwischen 2 und 36 liegen, andernfalls wird ein Fehler ausgelöst."
},
"$toMillis": {
"args": "timestamp",
"desc": "Konvertiert eine Zeitangabe `timestamp` im ISO 8601-Format in die Anzahl der Millisekunden seit Beginn der Unix-Zeitrechnung (1. Januar 1970 UTC). Es wird ein Fehler ausgelöst, wenn die Zeichenfolge nicht das richtige Format hat."
},
"$env": {
"args": "arg",
"desc": "Gibt den Wert einer Umgebungsvariablen zurück.\n\nDies ist eine definierte Funktion vom Typ `Node-RED`."
},
"$eval": {
"args": "expr [, context]",
"desc": "Analysiert (parse) und evaluiert den String `expr`, welcher JSON or a JSONata Ausdrücke enthält, unter Benutzung des aktuellen Kontextes für die Evaluierung."
},
"$formatInteger": {
"args": "number, picture",
"desc": "Wandelt `number` in eine Zeichenfolge um und formatiert sie in einer Ganzzahl-Darstellung, spezifiziert durch den `picture`-String-Parameter. Der `picture`-String-Parameter definiert, wie die Zahl `number` formatiert werden soll und hat den selben Syntax wie `fn:format-integer` der XPath F&O 3.1 Spezifikation."
},
"$parseInteger": {
"args": "str, picture",
"desc": "Wandelt den Inhalt von `str` in eine Ganzzahl `integer` (als JSON Zahl), spezifiziert durch den `picture`-String-Parameter. Der `picture`-String-Parameter hat das selbe Format wie `$formatInteger`."
},
"$error": {
"args": "[str]",
"desc": "Erzeugt eine Fehlermeldung. Der optionale String `str` ersetzt die Standardmeldung `$error() function evaluated`."
},
"$assert": {
"args": "arg, str",
"desc": "Wenn `arg` gleich `true` ist, liefert die Function `undefined` zurück. Wenn `arg` gleich `false` ist, wird ein Ausnahmefehler gemeldet mit dem String_Parameter `str` als Meldetext."
},
"$single": {
"args": "array, function",
"desc": "Gibt ein einziges Element aus `array` zurück, welches die Bedingung `function` erfüllt (d.h. die Funktion `function` gibt den booleschen Wert `true` zurück, wenn das Element übergeben werden soll). Sie meldet einen Ausnahmefehler, wenn die Anzahl der Elemente mit erfüllter Bedingung (`function` ist `true`) nicht genau eins ist.\n\nDie Funktion `function` sollte in der folgenden Art vorgegeben werden: `function(value [, index [, array]])` wobei `value` für jedes Element des Arrays gilt, `index` ist die Position dieses Elements und das gesamte Array `array` wird als dritter Parameter übergeben."
},
"$encodeUrlComponent": {
"args": "str",
"desc": "Kodiert eine URL-Komponente (Uniform Resource Locator), indem jedes Vorkommen bestimmter Zeichen durch eine, zwei, drei oder vier Escape-Sequenzen ersetzt wird, die die UTF-8-Kodierung des Zeichens darstellen.\n\nBeispiel: `$encodeUrlComponent(\"?x=test\")` => `\"%3Fx%3Dtest\"`"
},
"$encodeUrl": {
"args": "str",
"desc": "Kodiert eine URL (Uniform Resource Locator), indem jedes Vorkommen bestimmter Zeichen durch eine, zwei, drei oder vier Escape-Sequenzen ersetzt wird, die die UTF-8-Kodierung des Zeichens darstellen.\n\nBeispiel: `$encodeUrl(\"https://mozilla.org/?x=шеллы\")` => `\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\"`"
},
"$decodeUrlComponent": {
"args": "str",
"desc": "Dekodiert eine URL-Komponente (Uniform Resource Locator) zuvor erzeugt von encodeUrlComponent.\n\nBeispiel: `$decodeUrlComponent(\"%3Fx%3Dtest\")` => `\"?x=test\"`"
},
"$decodeUrl": {
"args": "str",
"desc": "Dekodiert eine URL (Uniform Resource Locator) zuvor erzeugt von encodeUrl.\n\nBeispiel: `$decodeUrl(\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\")` => `\"https://mozilla.org/?x=шеллы\"`"
},
"$distinct": {
"args": "array",
"desc": "Liefert ein `array` zurück, bei dem doppelte Elemente entfernt wurden."
},
"$type": {
"args": "value",
"desc": "Liefert den Typ von `value` als String. When `value` undefiniert ist, wird `undefined` zurückgeliefert."
},
"$moment": {
"args": "[str]",
"desc": "Liefert ein `date` Objekt unter Benutzung der Moment Library."
}
}

View File

@@ -44,7 +44,8 @@
"loadNodes": "Loading Nodes __count__",
"loadFlows": "Loading Flows",
"importFlows": "Adding Flows to workspace",
"importError": "<p>Error adding flows</p><p>__message__</p>"
"importError": "<p>Error adding flows</p><p>__message__</p>",
"loadingProject": "Loading project"
},
"workspace": {
"defaultName": "Flow __number__",
@@ -110,6 +111,7 @@
"projects-open": "Open",
"projects-settings": "Project Settings",
"showNodeLabelDefault": "Show label of newly added nodes",
"codeEditor": "Code Editor",
"groups": "Groups",
"groupSelection": "Group selection",
"ungroupSelection": "Ungroup selection",
@@ -884,6 +886,9 @@
"eval": "Error evaluating expression:\n __message__"
}
},
"monaco": {
"setTheme": "Set theme"
},
"jsEditor": {
"title": "JavaScript editor"
},

View File

@@ -52,8 +52,8 @@
"desc": "Finds occurrences of `pattern` within `str` and replaces them with `replacement`.\n\nThe optional `limit` parameter is the maximum number of replacements."
},
"$now": {
"args":"",
"desc":"Generates a timestamp in ISO 8601 compatible format and returns it as a string."
"args":"$[picture [, timezone]]",
"desc":"Generates a timestamp in ISO 8601 compatible format and returns it as a string. If the optional picture and timezone parameters are supplied, then the current timestamp is formatted as described by the `$fromMillis()` function"
},
"$base64encode": {
"args":"string",
@@ -200,8 +200,8 @@
"desc": "Returns a copy of the `string` with extra padding, if necessary, so that its total number of characters is at least the absolute value of the `width` parameter.\n\nIf `width` is a positive number, then the string is padded to the right; if negative, it is padded to the left.\n\nThe optional `char` argument specifies the padding character(s) to use. If not specified, it defaults to the space character."
},
"$fromMillis": {
"args": "number",
"desc": "Convert a number representing milliseconds since the Unix Epoch (1 January, 1970 UTC) to a timestamp string in the ISO 8601 format."
"args": "number, [, picture [, timezone]]",
"desc": "Convert the `number` representing milliseconds since the Unix Epoch (1 January, 1970 UTC) to a formatted string representation of the timestamp as specified by the picture string.\n\nIf the optional `picture` parameter is omitted, then the timestamp is formatted in the ISO 8601 format.\n\nIf the optional `picture` string is supplied, then the timestamp is formatted occording to the representation specified in that string. The behaviour of this function is consistent with the two-argument version of the XPath/XQuery function `format-dateTime` as defined in the XPath F&O 3.1 specification. The picture string parameter defines how the timestamp is formatted and has the same syntax as `format-dateTime`.\n\nIf the optional `timezone` string is supplied, then the formatted timestamp will be in that timezone. The `timezone` string should be in the format '±HHMM', where ± is either the plus or minus sign and HHMM is the offset in hours and minutes from UTC. Positive offset for timezones east of UTC, negative offset for timezones west of UTC."
},
"$formatNumber": {
"args": "number, picture [, options]",

View File

@@ -44,7 +44,8 @@
"loadNodes": "ノードを読み込み中 __count__",
"loadFlows": "フローを読み込み中",
"importFlows": "ワークスペースにフローを追加中",
"importError": "<p>フロー追加エラー</p><p>__message__</p>"
"importError": "<p>フロー追加エラー</p><p>__message__</p>",
"loadingProject": "プロジェクトを読み込み中"
},
"workspace": {
"defaultName": "フロー __number__",
@@ -110,6 +111,7 @@
"projects-open": "開く",
"projects-settings": "設定",
"showNodeLabelDefault": "追加したノードのラベルを表示",
"codeEditor": "コードエディタ",
"groups": "グループ",
"groupSelection": "選択部分をグループ化",
"ungroupSelection": "選択部分をグループ解除",
@@ -143,6 +145,7 @@
"nodeActionDisabled": "ノードのアクションは無効になっています",
"nodeActionDisabledSubflow": "ノードのアクションは、サブフロー内で無効になっています",
"missing-types": "<p>不明なノードが存在するため、フローを停止しました。</p>",
"missing-modules": "<p>不明なモジュールが存在するため、フローを停止しました。</p>",
"safe-mode": "<p>セーフモードでフローを停止しました</p><p>フローを変更し、再起動するために変更をデプロイできます</p>",
"restartRequired": "更新されたモジュールを有効化するため、Node-REDを再起動する必要があります",
"credentials_load_failed": "<p>認証情報を復号できないため、フローを停止しました</p><p>フローの認証情報ファイルは暗号化されています。しかし、プロジェクトの暗号鍵が存在しない、または不正です</p>",
@@ -522,8 +525,8 @@
"title": "パレットの管理",
"palette": "パレット",
"times": {
"seconds": "秒前",
"minutes": "分前",
"seconds": "秒前",
"minutes": "分前",
"minutesV": "__count__ 分前",
"hoursV": "__count__ 時間前",
"hoursV_plural": "__count__ 時間前",
@@ -857,7 +860,8 @@
}
},
"editableList": {
"add": "追加"
"add": "追加",
"addTitle": "要素を追加"
},
"search": {
"empty": "一致したものが見つかりませんでした",
@@ -882,6 +886,9 @@
"eval": "表現評価エラー:\n __message__"
}
},
"monaco": {
"setTheme": "テーマを設定:"
},
"jsEditor": {
"title": "JavaScriptエディタ"
},

View File

@@ -52,8 +52,8 @@
"desc": "文字列 `str` からパターン `pattern` を検索し、置換文字列 `replacement` に置き換えます。\n\n任意の引数 `limit` には、置換回数の上限値を指定します。"
},
"$now": {
"args": "",
"desc": "ISO 8601互換形式の時刻を生成し、文字列として返します。"
"args": "$[picture [, timezone]]",
"desc": "ISO 8601互換形式の時刻を生成し、文字列として返します。pictureおよびtimezoneパラメータが指定されている場合、現在時刻を`$fromMillis()`関数の説明に従ってフォーマットします。"
},
"$base64encode": {
"args": "string",
@@ -200,8 +200,8 @@
"desc": "文字数が引数 `width` の絶対値以上となるよう、必要に応じて追加文字を付け足した `string` のコピーを返します。\n\n`width` が正の値の場合、文字列の右側に追加文字を付け足します。もし負の値の場合、文字列の左側に追加文字を付け足します。\n\n任意の引数 `char` には、本関数で用いる追加文字を指定します。もし追加文字を指定しない場合は、既定値として空白文字を使用します。"
},
"$fromMillis": {
"args": "number",
"desc": "Unixエポック(1 January, 1970 UTC)からの経過ミリ秒を表す数値を、ISO 8601形式のタイムスタンプの文字列に変換します。"
"args": "number, [, picture [, timezone]]",
"desc": "Unixエポック(1 January, 1970 UTC)からの経過ミリ秒を表す数値を、`picture`の指定に従ってタイムスタンプの文字列に変換します。\n\n`picture`パラメータが指定されない場合、ISO 8601形式に変換します。\n\n`picture`を指定すると、指定した文字列に従って変換を行います。この変換はXPath F&O 3.1仕様におけるXPath/XQueryの2引数形式`format-dateTime`と同様です。`picture`パラメータはタイムスタンプの変換形式を定義し、その書式は`format-dateTime`と同じです。\n\n`timezone`を指定すると、指定タイムゾーンで変換します。`timezone`は'±HHMM'という形式で指定します。ここで、±は+もしくは-記号を表し、HHMMはUTCからの差分時間と分を表します。正の差分はUTCの東、負の差分は西のタイムゾーンとなります。"
},
"$formatNumber": {
"args": "number, picture [, options]",

View File

@@ -648,7 +648,7 @@
},
"context": {
"name": "上下文数据",
"label": "上下",
"label": "上下",
"none": "未选择",
"refresh": "刷新以加载",
"empty": "空",

View File

@@ -1,6 +1,6 @@
{
"name": "@node-red/editor-client",
"version": "1.3.0-beta.1",
"version": "2.0.1",
"license": "Apache-2.0",
"repository": {
"type": "git",

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 B

View File

@@ -66,12 +66,14 @@ RED.history = (function() {
var importedResult = RED.nodes.import(ev.config,{importMap: importMap})
inverseEv = {
t: 'replace',
config: importedResult.removedNodes
config: importedResult.removedNodes,
dirty: RED.nodes.dirty()
}
}
} else if (ev.t == 'add') {
inverseEv = {
t: "delete",
dirty: RED.nodes.dirty()
};
if (ev.nodes) {
inverseEv.nodes = [];
@@ -158,7 +160,8 @@ RED.history = (function() {
} else if (ev.t == "delete") {
inverseEv = {
t: "add"
t: "add",
dirty: RED.nodes.dirty()
};
if (ev.workspaces) {
inverseEv.workspaces = [];
@@ -300,11 +303,12 @@ RED.history = (function() {
} else if (ev.t == "move") {
inverseEv = {
t: 'move',
nodes: []
nodes: [],
dirty: RED.nodes.dirty()
};
for (i=0;i<ev.nodes.length;i++) {
var n = ev.nodes[i];
var rn = {n: n.n, ox: n.n.x, oy: n.n.y, dirty: true, moved: n.moved};
var rn = {n: n.n, ox: n.n.x, oy: n.n.y, dirty: true, moved: n.n.moved};
inverseEv.nodes.push(rn);
n.n.x = n.ox;
n.n.y = n.oy;
@@ -336,7 +340,9 @@ RED.history = (function() {
} else if (ev.t == "edit") {
inverseEv = {
t: "edit",
changes: {}
changes: {},
changed: ev.node.changed,
dirty: RED.nodes.dirty()
};
inverseEv.node = ev.node;
for (i in ev.changes) {
@@ -552,7 +558,8 @@ RED.history = (function() {
} else if (ev.t == "reorder") {
inverseEv = {
t: 'reorder',
order: RED.nodes.getWorkspaceOrder()
order: RED.nodes.getWorkspaceOrder(),
dirty: RED.nodes.dirty()
};
if (ev.order) {
RED.workspaces.order(ev.order);

View File

@@ -0,0 +1,156 @@
RED.hooks = (function() {
var VALID_HOOKS = [
]
var hooks = { }
var labelledHooks = { }
function add(hookId, callback) {
var parts = hookId.split(".");
var id = parts[0], label = parts[1];
// if (VALID_HOOKS.indexOf(id) === -1) {
// throw new Error("Invalid hook '"+id+"'");
// }
if (label && labelledHooks[label] && labelledHooks[label][id]) {
throw new Error("Hook "+hookId+" already registered")
}
var hookItem = {cb:callback, previousHook: null, nextHook: null }
var tailItem = hooks[id];
if (tailItem === undefined) {
hooks[id] = hookItem;
} else {
while(tailItem.nextHook !== null) {
tailItem = tailItem.nextHook
}
tailItem.nextHook = hookItem;
hookItem.previousHook = tailItem;
}
if (label) {
labelledHooks[label] = labelledHooks[label]||{};
labelledHooks[label][id] = hookItem;
}
}
function remove(hookId) {
var parts = hookId.split(".");
var id = parts[0], label = parts[1];
if ( !label) {
throw new Error("Cannot remove hook without label: "+hookId)
}
if (labelledHooks[label]) {
if (id === "*") {
// Remove all hooks for this label
var hookList = Object.keys(labelledHooks[label]);
for (var i=0;i<hookList.length;i++) {
removeHook(hookList[i],labelledHooks[label][hookList[i]])
}
delete labelledHooks[label];
} else if (labelledHooks[label][id]) {
removeHook(id,labelledHooks[label][id])
delete labelledHooks[label][id];
if (Object.keys(labelledHooks[label]).length === 0){
delete labelledHooks[label];
}
}
}
}
function removeHook(id,hookItem) {
var previousHook = hookItem.previousHook;
var nextHook = hookItem.nextHook;
if (previousHook) {
previousHook.nextHook = nextHook;
} else {
hooks[id] = nextHook;
}
if (nextHook) {
nextHook.previousHook = previousHook;
}
hookItem.removed = true;
if (!previousHook && !nextHook) {
delete hooks[id];
}
}
function trigger(hookId, payload, done) {
var hookItem = hooks[hookId];
if (!hookItem) {
if (done) {
done();
}
return;
}
function callNextHook(err) {
if (!hookItem || err) {
if (done) { done(err) }
return err;
}
if (hookItem.removed) {
hookItem = hookItem.nextHook;
return callNextHook();
}
var callback = hookItem.cb;
if (callback.length === 1) {
try {
let result = callback(payload);
if (result === false) {
// Halting the flow
if (done) { done(false) }
return result;
}
hookItem = hookItem.nextHook;
return callNextHook();
} catch(e) {
console.warn(e);
if (done) { done(e);}
return e;
}
} else {
// There is a done callback
try {
callback(payload,function(result) {
if (result === undefined) {
hookItem = hookItem.nextHook;
callNextHook();
} else {
if (done) { done(result)}
}
})
} catch(e) {
console.warn(e);
if (done) { done(e) }
return e;
}
}
}
return callNextHook();
}
function clear() {
hooks = {}
labelledHooks = {}
}
function has(hookId) {
var parts = hookId.split(".");
var id = parts[0], label = parts[1];
if (label) {
return !!(labelledHooks[label] && labelledHooks[label][id])
}
return !!hooks[id]
}
return {
has: has,
clear: clear,
add: add,
remove: remove,
trigger: trigger
}
})();

View File

@@ -18,53 +18,66 @@ RED.i18n = (function() {
var apiRootUrl;
function detectLanguage() {
return navigator.language
}
return {
init: function(options, done) {
apiRootUrl = options.apiRootUrl||"";
var preferredLanguage = localStorage.getItem("editor-language");
var preferredLanguage = localStorage.getItem("editor-language") || detectLanguage();
var opts = {
resGetPath: apiRootUrl+'locales/__ns__?lng=__lng__',
dynamicLoad: false,
load:'current',
ns: {
namespaces: ["editor","node-red","jsonata","infotips"],
defaultNs: "editor"
backend: {
loadPath: apiRootUrl+'locales/__ns__?lng=__lng__',
},
lng: 'en-US',
// debug: true,
preload:['en-US'],
ns: ["editor","node-red","jsonata","infotips"],
defaultNS: "editor",
fallbackLng: ['en-US'],
useCookie: false,
returnObjectTrees: true
returnObjects: true,
interpolation: {
unescapeSuffix: 'HTML',
escapeValue: false,
prefix: '__',
suffix: '__'
}
};
if (preferredLanguage) {
opts.lng = preferredLanguage;
}
i18n.init(opts,function() {
i18next.use(i18nextHttpBackend).init(opts,function() {
done();
});
jqueryI18next.init(i18next, $, { handleName: 'i18n' });
RED["_"] = function() {
var v = i18n.t.apply(null,arguments);
var v = i18next.t.apply(i18next,arguments);
if (typeof v === 'string') {
return v;
} else {
return arguments[0];
}
}
},
lang: function() {
// Gets the active message catalog language. This is based on what
// locale the editor is using and what languages are available.
//
var preferredLangs = i18n.functions.toLanguages(localStorage.getItem("editor-language")||i18n.detectLanguage());
var preferredLangs = [localStorage.getItem("editor-language")|| detectLanguage()].concat(i18next.languages);
var knownLangs = RED.settings.theme("languages")||["en-US"];
for (var i=0;i<preferredLangs.length;i++) {
if (knownLangs.indexOf(preferredLangs[i]) > -1) {
return preferredLangs[i]
}
}
return 'end-US'
return 'en-US'
},
loadNodeCatalog: function(namespace,done) {
var languageList = i18n.functions.toLanguages(localStorage.getItem("editor-language")||i18n.detectLanguage());
var languageList = [localStorage.getItem("editor-language")|| detectLanguage()].concat(i18next.languages);
var toLoad = languageList.length;
languageList.forEach(function(lang) {
$.ajax({
@@ -74,7 +87,7 @@ RED.i18n = (function() {
cache: false,
url: apiRootUrl+'nodes/'+namespace+'/messages?lng='+lang,
success: function(data) {
i18n.addResourceBundle(lang,namespace,data);
i18next.addResourceBundle(lang,namespace,data);
toLoad--;
if (toLoad === 0) {
done();
@@ -86,7 +99,7 @@ RED.i18n = (function() {
},
loadNodeCatalogs: function(done) {
var languageList = i18n.functions.toLanguages(localStorage.getItem("editor-language")||i18n.detectLanguage());
var languageList = [localStorage.getItem("editor-language")|| detectLanguage()].concat(i18next.languages);
var toLoad = languageList.length;
languageList.forEach(function(lang) {
@@ -99,7 +112,7 @@ RED.i18n = (function() {
success: function(data) {
var namespaces = Object.keys(data);
namespaces.forEach(function(ns) {
i18n.addResourceBundle(lang,ns,data[ns]);
i18next.addResourceBundle(lang,ns,data[ns]);
});
toLoad--;
if (toLoad === 0) {
@@ -111,7 +124,7 @@ RED.i18n = (function() {
},
loadPluginCatalogs: function(done) {
var languageList = i18n.functions.toLanguages(localStorage.getItem("editor-language")||i18n.detectLanguage());
var languageList = [localStorage.getItem("editor-language")|| detectLanguage()].concat(i18next.languages);
var toLoad = languageList.length;
languageList.forEach(function(lang) {
@@ -124,7 +137,7 @@ RED.i18n = (function() {
success: function(data) {
var namespaces = Object.keys(data);
namespaces.forEach(function(ns) {
i18n.addResourceBundle(lang,ns,data[ns]);
i18next.addResourceBundle(lang,ns,data[ns]);
});
toLoad--;
if (toLoad === 0) {
@@ -133,6 +146,7 @@ RED.i18n = (function() {
}
});
})
}
},
detectLanguage: detectLanguage
}
})();

View File

@@ -38,12 +38,14 @@
"backspace": "core:delete-selection",
"delete": "core:delete-selection",
"enter": "core:edit-selected-node",
"ctrl-enter": "core:go-to-selection",
"ctrl-c": "core:copy-selection-to-internal-clipboard",
"ctrl-x": "core:cut-selection-to-internal-clipboard",
"ctrl-v": "core:paste-from-internal-clipboard",
"ctrl-z": "core:undo",
"ctrl-y": "core:redo",
"ctrl-a": "core:select-all-nodes",
"escape": "core:select-none",
"alt-s u": "core:select-upstream-nodes",
"alt-s d": "core:select-downstream-nodes",
"alt-s c": "core:select-connected-nodes",
@@ -56,19 +58,25 @@
"shift-d": "core:step-view-right",
"shift-s": "core:step-view-down",
"shift-a": "core:step-view-left",
"up": "core:move-selection-up",
"right": "core:move-selection-right",
"down": "core:move-selection-down",
"left": "core:move-selection-left",
"ctrl-up": "core:move-selection-up",
"ctrl-right": "core:move-selection-right",
"ctrl-down": "core:move-selection-down",
"ctrl-left": "core:move-selection-left",
"shift-up": "core:step-selection-up",
"shift-right": "core:step-selection-right",
"shift-down": "core:step-selection-down",
"shift-left": "core:step-selection-left",
"ctrl-shift-j": "core:show-previous-tab",
"ctrl-shift-k": "core:show-next-tab",
"ctrl-[": "core:show-previous-tab",
"ctrl-]": "core:show-next-tab",
"ctrl-shift-left": "core:go-to-previous-location",
"ctrl-shift-right": "core:go-to-next-location",
"ctrl-shift-g": "core:group-selection",
"ctrl-shift-u": "core:ungroup-selection",
"ctrl-shift-c": "core:copy-group-style",
"ctrl-shift-v": "core:paste-group-style"
"ctrl-shift-v": "core:paste-group-style",
"right": "core:go-to-nearest-node-on-right",
"left": "core:go-to-nearest-node-on-left",
"up": "core:go-to-nearest-node-above",
"down": "core:go-to-nearest-node-below"
}
}

View File

@@ -86,6 +86,10 @@ RED.nodes = (function() {
}
},
addNodeSet: function(ns) {
if (!ns.types) {
// A node has been loaded without any types. Ignore it.
return;
}
ns.added = false;
nodeSets[ns.id] = ns;
for (var j=0;j<ns.types.length;j++) {
@@ -206,8 +210,11 @@ RED.nodes = (function() {
})();
function getID() {
// return Math.floor(Math.random()*15728640 + 1048576).toString(16)
return (1+Math.random()*4294967295).toString(16);
var bytes = [];
for (var i=0;i<8;i++) {
bytes.push(Math.round(0xff*Math.random()).toString(16).padStart(2,'0'));
}
return bytes.join("");
}
function parseNodePropertyTypeString(typeString) {
@@ -363,6 +370,7 @@ RED.nodes = (function() {
} else {
var users = configNode.users;
users.splice(users.indexOf(node),1);
RED.events.emit('nodes:change',configNode)
}
}
}
@@ -413,6 +421,27 @@ RED.nodes = (function() {
nodeTabMap[z] = {};
}
nodeTabMap[z][node.id] = node;
var nl = nodeLinks[node.id];
if (nl) {
nl.in.forEach(function(l) {
var idx = linkTabMap[node.z].indexOf(l);
if (idx != -1) {
linkTabMap[node.z].splice(idx, 1);
}
if ((l.source.z === z) && linkTabMap[z]) {
linkTabMap[z].push(l);
}
});
nl.out.forEach(function(l) {
var idx = linkTabMap[node.z].indexOf(l);
if (idx != -1) {
linkTabMap[node.z].splice(idx, 1);
}
if ((l.target.z === z) && linkTabMap[z]) {
linkTabMap[z].push(l);
}
});
}
node.z = z;
RED.events.emit("nodes:change",node);
}
@@ -666,11 +695,23 @@ RED.nodes = (function() {
/**
* Converts a node to an exportable JSON Object
**/
function convertNode(n, exportCreds) {
function convertNode(n, opts) {
var exportCreds = true;
var exportDimensions = false;
if (opts === false) {
exportCreds = false;
} else if (typeof opts === "object") {
if (opts.hasOwnProperty("credentials")) {
exportCreds = opts.credentials;
}
if (opts.hasOwnProperty("dimensions")) {
exportDimensions = opts.dimensions;
}
}
if (n.type === 'tab') {
return convertWorkspace(n);
}
exportCreds = exportCreds || false;
var node = {};
node.id = n.id;
node.type = n.type;
@@ -743,6 +784,19 @@ RED.nodes = (function() {
if (n._def.category != "config") {
node.x = n.x;
node.y = n.y;
if (exportDimensions) {
if (!n.hasOwnProperty('w')) {
// This node has not yet been drawn in the view. So we need
// to explicitly calculate its dimensions. Store the result
// on the node as if it had been drawn will save us doing
// it again
var dimensions = RED.view.calculateNodeDimensions(n);
n.w = dimensions[0];
n.h = dimensions[1];
}
node.w = n.w;
node.h = n.h;
}
node.wires = [];
for(var i=0;i<n.outputs;i++) {
node.wires.push([]);
@@ -782,7 +836,21 @@ RED.nodes = (function() {
return node;
}
function convertSubflow(n, exportCreds) {
function convertSubflow(n, opts) {
var exportCreds = true;
var exportDimensions = false;
if (opts === false) {
exportCreds = false;
} else if (typeof opts === "object") {
if (opts.hasOwnProperty("credentials")) {
exportCreds = opts.credentials;
}
if (opts.hasOwnProperty("dimensions")) {
exportDimensions = opts.dimensions;
}
}
var node = {};
node.id = n.id;
node.type = n.type;
@@ -928,8 +996,8 @@ RED.nodes = (function() {
if (!(id in exportedConfigNodes)) {
exportedConfigNodes[id] = true;
set.push(confNode);
return true;
}
return true;
}
return false;
}
@@ -954,11 +1022,10 @@ RED.nodes = (function() {
return nns;
}
//TODO: rename this (createCompleteNodeSet)
function createCompleteNodeSet(exportCredentials) {
if (exportCredentials === undefined) {
exportCredentials = true;
}
// Create the Flow JSON for the current configuration
// opts.credentials (whether to include (known) credentials) - default: true
// opts.dimensions (whether to include node dimensions) - default: false
function createCompleteNodeSet(opts) {
var nns = [];
var i;
for (i=0;i<workspacesOrder.length;i++) {
@@ -968,22 +1035,22 @@ RED.nodes = (function() {
}
for (i in subflows) {
if (subflows.hasOwnProperty(i)) {
nns.push(convertSubflow(subflows[i], exportCredentials));
nns.push(convertSubflow(subflows[i], opts));
}
}
for (i in groups) {
if (groups.hasOwnProperty(i)) {
nns.push(convertNode(groups[i]));
nns.push(convertNode(groups[i], opts));
}
}
for (i in configNodes) {
if (configNodes.hasOwnProperty(i)) {
nns.push(convertNode(configNodes[i], exportCredentials));
nns.push(convertNode(configNodes[i], opts));
}
}
for (i in nodes) {
if (nodes.hasOwnProperty(i)) {
nns.push(convertNode(nodes[i], exportCredentials));
nns.push(convertNode(nodes[i], opts));
}
}
return nns;
@@ -1403,6 +1470,8 @@ RED.nodes = (function() {
nid = getID();
workspace_map[n.id] = nid;
n.id = nid;
} else {
workspace_map[n.id] = n.id;
}
addWorkspace(n);
RED.workspaces.add(n);
@@ -1502,7 +1571,7 @@ RED.nodes = (function() {
}
}
} else {
if (n.z && !workspaces[n.z] && !subflow_map[n.z]) {
if (n.z && !workspace_map[n.z] && !subflow_map[n.z]) {
n.z = activeWorkspace;
}
}
@@ -1600,7 +1669,7 @@ RED.nodes = (function() {
node.id = getID();
} else {
node.id = n.id;
if (node.z == null || (!workspaces[node.z] && !subflow_map[node.z])) {
if (node.z == null || (!workspace_map[node.z] && !subflow_map[node.z])) {
if (createMissingWorkspace) {
if (missingWorkspace === null) {
missingWorkspace = RED.workspaces.add(null,true);
@@ -2005,6 +2074,7 @@ RED.nodes = (function() {
if (configNode) {
if (configNode.users.indexOf(n) === -1) {
configNode.users.push(n);
RED.events.emit('nodes:change',configNode)
}
}
}

View File

@@ -36,7 +36,7 @@ var RED = (function() {
}
function loadPlugins(done) {
loader.reportProgress(RED._("event.loadPlugins",{count:""}), 17)
var lang = localStorage.getItem("editor-language")||i18n.detectLanguage();
var lang = localStorage.getItem("editor-language")||RED.i18n.detectLanguage();
$.ajax({
headers: {
@@ -176,7 +176,7 @@ var RED = (function() {
function loadNodes() {
loader.reportProgress(RED._("event.loadNodes",{count:""}), 30)
var lang = localStorage.getItem("editor-language")||i18n.detectLanguage();
var lang = localStorage.getItem("editor-language")||RED.i18n.detectLanguage();
$.ajax({
headers: {
@@ -249,7 +249,7 @@ var RED = (function() {
RED.nodes.dirty(false);
RED.view.redraw(true);
if (/^#flow\/.+$/.test(currentHash)) {
RED.workspaces.show(currentHash.substring(6));
RED.workspaces.show(currentHash.substring(6),true);
}
} catch(err) {
console.warn(err);
@@ -281,7 +281,7 @@ var RED = (function() {
return;
}
if (notificationId === "project-update") {
loader.start("Loading project",0)
loader.start(RED._("event.loadingProject"), 0);
RED.nodes.clear();
RED.history.clear();
RED.view.redraw(true);
@@ -532,7 +532,7 @@ var RED = (function() {
RED.sidebar.show(":first");
setTimeout(function() {
loader.end();
},100);
@@ -540,6 +540,8 @@ var RED = (function() {
function showAbout() {
$.get('red/about', function(data) {
// data will be strictly markdown. Any HTML should be escaped.
data = RED.utils.sanitize(data);
var aboutHeader = '<div style="text-align:center;">'+
'<img width="50px" src="red/images/node-red-icon.svg" />'+
'</div>';
@@ -711,7 +713,7 @@ var RED = (function() {
throw new Error("RED already initialised");
}
initialised = true;
ace.require("ace/ext/language_tools");
if(window.ace) { window.ace.require("ace/ext/language_tools"); }
options = options || {};
options.apiRootUrl = options.apiRootUrl || "";
if (options.apiRootUrl && !/\/$/.test(options.apiRootUrl)) {

View File

@@ -143,7 +143,8 @@ RED.settings = (function () {
console.groupCollapsed("Versions");
console.log("jQuery",$().jquery)
console.log("jQuery UI",$.ui.version);
console.log("ACE",ace.version);
if(window.ace) { console.log("ACE",ace.version); }
if(window.monaco) { console.log("MONACO",monaco.version || "unknown"); }
console.log("D3",d3.version);
console.groupEnd();
loadUserSettings(done);

View File

@@ -151,7 +151,6 @@ RED.actionList = (function() {
}
if (!visible) {
previousActiveElement = document.activeElement;
RED.keyboard.add("*","escape",function(){hide()});
$("#red-ui-header-shade").show();
$("#red-ui-editor-shade").show();
$("#red-ui-palette-shade").show();
@@ -185,7 +184,6 @@ RED.actionList = (function() {
function hide() {
if (visible) {
RED.keyboard.remove("escape");
visible = false;
$("#red-ui-header-shade").hide();
$("#red-ui-editor-shade").hide();
@@ -215,6 +213,9 @@ RED.actionList = (function() {
RED.events.on("type-search:open",function() { disabled = true; });
RED.events.on("type-search:close",function() { disabled = false; });
RED.keyboard.add("red-ui-actionList","escape",function(){hide()});
$("#red-ui-header-shade").on('mousedown',hide);
$("#red-ui-editor-shade").on('mousedown',hide);
$("#red-ui-palette-shade").on('mousedown',hide);

View File

@@ -89,9 +89,12 @@ RED.clipboard = (function() {
text: RED._("clipboard.export.copy"),
click: function() {
if (activeTab === "red-ui-clipboard-dialog-export-tab-clipboard") {
copyText($("#red-ui-clipboard-dialog-export-text").val());
RED.notify(RED._("clipboard.nodesExported"),{id:"clipboard"});
var flowData = $("#red-ui-clipboard-dialog-export-text").val();
// Close the dialog first otherwise FireFox won't focus the hidden
// clipboard element in copyText
$( this ).dialog( "close" );
copyText(flowData);
RED.notify(RED._("clipboard.nodesExported"),{id:"clipboard"});
} else {
var flowToExport = $("#red-ui-clipboard-dialog-export-text").val();
var selectedPath = activeLibraries[activeTab].getSelected();
@@ -449,7 +452,7 @@ RED.clipboard = (function() {
var libraries = RED.settings.libraries || [];
libraries.forEach(function(lib) {
var tabId = "red-ui-clipboard-dialog-import-tab-library-"+lib.id
var tabId = "red-ui-clipboard-dialog-import-tab-"+lib.id
tabs.addTab({
id: tabId,
label: RED._(lib.label||lib.id)
@@ -698,6 +701,13 @@ RED.clipboard = (function() {
var activeWorkspace = RED.workspaces.active();
nodes = RED.nodes.groups(activeWorkspace);
nodes = nodes.concat(RED.nodes.filterNodes({z:activeWorkspace}));
RED.nodes.eachConfig(function(n) {
if (n.z === RED.workspaces.active() && n._def.hasUsers === false) {
// Grab any config nodes scoped to this flow that don't
// require any flow-nodes to use them
nodes.push(n);
}
});
var parentNode = RED.nodes.workspace(activeWorkspace)||RED.nodes.subflow(activeWorkspace);
nodes.unshift(parentNode);
nodes = RED.nodes.createExportableNodeSet(nodes);
@@ -886,7 +896,6 @@ RED.clipboard = (function() {
function hideDropTarget() {
$("#red-ui-drop-target").hide();
RED.keyboard.remove("escape");
}
function copyText(value,element,msg) {
var truncated = false;
@@ -1184,22 +1193,6 @@ RED.clipboard = (function() {
}
}
function getNodeLabelText(n) {
var label = n.name || n.type+": "+n.id;
if (n._def.label) {
try {
label = (typeof n._def.label === "function" ? n._def.label.call(n) : n._def.label)||"";
} catch(err) {
console.log("Definition error: "+n.type+".label",err);
}
}
var newlineIndex = label.indexOf("\\n");
if (newlineIndex > -1) {
label = label.substring(0,newlineIndex)+"...";
}
return label;
}
function getFlowLabel(n) {
n = JSON.parse(JSON.stringify(n));
n._def = RED.nodes.getType(n.type) || {};
@@ -1225,16 +1218,8 @@ RED.clipboard = (function() {
if (n._def) {
n._ = n._def._;
}
var div = $('<div>',{class:"red-ui-info-outline-item"});
RED.utils.createNodeIcon(n).appendTo(div);
var contentDiv = $('<div>',{class:"red-ui-search-result-description"}).appendTo(div);
var labelText = getNodeLabelText(n);
var label = $('<div>',{class:"red-ui-search-result-node-label red-ui-info-outline-item-label"}).appendTo(contentDiv);
if (labelText) {
label.text(labelText)
} else {
label.html(n.type)
}
var div = $('<div>',{class:"red-ui-node-list-item"});
RED.utils.createNodeIcon(n,true).appendTo(div);
return div;
}
@@ -1263,11 +1248,12 @@ RED.clipboard = (function() {
$('<div id="red-ui-drop-target"><div data-i18n="[append]workspace.dropFlowHere"><i class="fa fa-download"></i><br></div></div>').appendTo('#red-ui-editor');
RED.keyboard.add("#red-ui-drop-target", "escape" ,hideDropTarget);
$('#red-ui-workspace-chart').on("dragenter",function(event) {
if ($.inArray("text/plain",event.originalEvent.dataTransfer.types) != -1 ||
$.inArray("Files",event.originalEvent.dataTransfer.types) != -1) {
$("#red-ui-drop-target").css({display:'table'});
RED.keyboard.add("*", "escape" ,hideDropTarget);
$("#red-ui-drop-target").css({display:'table'}).focus();
}
});
@@ -1281,22 +1267,27 @@ RED.clipboard = (function() {
hideDropTarget();
})
.on("drop",function(event) {
if ($.inArray("text/plain",event.originalEvent.dataTransfer.types) != -1) {
var data = event.originalEvent.dataTransfer.getData("text/plain");
data = data.substring(data.indexOf('['),data.lastIndexOf(']')+1);
importNodes(data);
} else if ($.inArray("Files",event.originalEvent.dataTransfer.types) != -1) {
var files = event.originalEvent.dataTransfer.files;
if (files.length === 1) {
var file = files[0];
var reader = new FileReader();
reader.onload = (function(theFile) {
return function(e) {
importNodes(e.target.result);
};
})(file);
reader.readAsText(file);
try {
if ($.inArray("text/plain",event.originalEvent.dataTransfer.types) != -1) {
var data = event.originalEvent.dataTransfer.getData("text/plain");
data = data.substring(data.indexOf('['),data.lastIndexOf(']')+1);
importNodes(data);
} else if ($.inArray("Files",event.originalEvent.dataTransfer.types) != -1) {
var files = event.originalEvent.dataTransfer.files;
if (files.length === 1) {
var file = files[0];
var reader = new FileReader();
reader.onload = (function(theFile) {
return function(e) {
importNodes(e.target.result);
};
})(file);
reader.readAsText(file);
}
}
} catch(err) {
// Ensure any errors throw above doesn't stop the drop target from
// being hidden.
}
hideDropTarget();
event.preventDefault();

View File

@@ -18,7 +18,7 @@
/**
* options:
* - addButton : boolean|string - text for add label, default 'add'
* - buttons : array - list of custom buttons (objects with fields 'label', 'icon', 'title', 'click')
* - buttons : array - list of custom buttons (objects with fields 'id', 'label', 'icon', 'title', 'click')
* - height : number|'auto'
* - resize : function - called when list as a whole is resized
* - resizeItem : function(item) - called to resize individual item
@@ -71,7 +71,7 @@
var buttons = this.options.buttons || [];
if (this.options.addButton !== false) {
var addLabel, addTittle;
var addLabel, addTitle;
if (typeof this.options.addButton === 'string') {
addLabel = this.options.addButton
} else {
@@ -94,7 +94,7 @@
}
buttons.forEach(function(button) {
var element = $('<a href="#" class="red-ui-button red-ui-button-small red-ui-editableList-addButton" style="margin-top: 4px; margin-right: 5px;"></a>')
var element = $('<button type="button" class="red-ui-button red-ui-button-small red-ui-editableList-addButton" style="margin-top: 4px; margin-right: 5px;"></button>')
.appendTo(that.topContainer)
.on("click", function(evt) {
evt.preventDefault();
@@ -102,7 +102,10 @@
button.click(evt);
}
});
if (button.id) {
element.attr("id", button.id);
}
if (button.title) {
element.attr("title", button.title);
}
@@ -113,7 +116,7 @@
element.append($("<span></span>").text(" " + button.label));
}
});
if (this.element.css("position") === "absolute") {
["top","left","bottom","right"].forEach(function(s) {
var v = that.element.css(s);

View File

@@ -308,11 +308,9 @@ RED.popover = (function() {
// DOWN
if (currentItem.length > 0) {
if (currentItem.index() === menuOptions.length-1) {
console.log("WARP TO TOP")
// Wrap to top of list
list.children().first().children().first().focus();
} else {
console.log("GO DOWN ONE")
currentItem.next().children().first().focus();
}
} else {
@@ -323,11 +321,9 @@ RED.popover = (function() {
// UP
if (currentItem.length > 0) {
if (currentItem.index() === 0) {
console.log("WARP TO BOTTOM")
// Wrap to bottom of list
list.children().last().children().first().focus();
} else {
console.log("GO UP ONE")
currentItem.prev().children().first().focus();
}
} else {
@@ -363,7 +359,6 @@ RED.popover = (function() {
panel.css({ display: "none" });
panel.appendTo(document.body);
content.appendTo(panel);
var closeCallback;
function hide(dispose) {
$(document).off("mousedown.red-ui-popover-panel-close");
@@ -378,6 +373,7 @@ RED.popover = (function() {
}
function show(options) {
var closeCallback = options.onclose;
var closeButton = options.closeButton;
var target = options.target;
var align = options.align || "right";
var offset = options.offset || [0,0];
@@ -393,7 +389,7 @@ RED.popover = (function() {
top -= (top+panelHeight)-$(window).height() + 5;
}
if (top < 0) {
panelHeight.height(panelHeight+top)
panel.height(panelHeight+top)
top = 0;
}
if (align === "right") {
@@ -420,7 +416,8 @@ RED.popover = (function() {
});
$(document).on("mousedown.red-ui-popover-panel-close", function(event) {
if(!$(event.target).closest(panel).length && !$(event.target).closest(".red-ui-editor-dialog").length) {
var hitCloseButton = closeButton && $(event.target).closest(closeButton).length;
if(!hitCloseButton && !$(event.target).closest(panel).length && !$(event.target).closest(".red-ui-editor-dialog").length) {
if (closeCallback) {
closeCallback();
}

View File

@@ -100,7 +100,22 @@ RED.tabs = (function() {
if (options.scrollable) {
wrapper.addClass("red-ui-tabs-scrollable");
scrollContainer.addClass("red-ui-tabs-scroll-container");
scrollContainer.on("scroll",updateScroll);
scrollContainer.on("scroll",function(evt) {
// Generated by trackpads - not mousewheel
updateScroll(evt);
});
scrollContainer.on("wheel", function(evt) {
if (evt.originalEvent.deltaX === 0) {
// Prevent the scroll event from firing
evt.preventDefault();
// Assume this is wheel event which might not trigger
// the scroll event, so do things manually
var sl = scrollContainer.scrollLeft();
sl -= evt.originalEvent.deltaY;
scrollContainer.scrollLeft(sl);
}
})
scrollLeft = $('<div class="red-ui-tab-button red-ui-tab-scroll red-ui-tab-scroll-left"><a href="#" style="display:none;"><i class="fa fa-caret-left"></i></a></div>').appendTo(wrapper).find("a");
scrollLeft.on('mousedown',function(evt) { scrollEventHandler(evt,'-=150') }).on('click',function(evt){ evt.preventDefault();});
scrollRight = $('<div class="red-ui-tab-button red-ui-tab-scroll red-ui-tab-scroll-right"><a href="#" style="display:none;"><i class="fa fa-caret-right"></i></a></div>').appendTo(wrapper).find("a");
@@ -373,7 +388,7 @@ RED.tabs = (function() {
var visibleCount = collapsedButtonsRow.children(":visible").length;
tabWidth = width - collapsedButtonsRow.width()-10;
var maxTabWidth = 198;
var minTabWidth = 80;
var minTabWidth = 120;
if (tabWidth <= minTabWidth || (tabWidth < maxTabWidth && visibleCount > 5)) {
// The tab is too small. Hide the next button to make room
// Start at the end of the button row, -1 for the menu button
@@ -659,11 +674,15 @@ RED.tabs = (function() {
});
}
$('<span class="red-ui-tabs-fade"></span>').appendTo(li);
var badges = $('<span class="red-ui-tabs-badges"></span>').appendTo(li);
if (options.onselect) {
$('<i class="red-ui-tabs-badge-changed fa fa-circle"></i>').appendTo(badges);
$('<i class="red-ui-tabs-badge-selected fa fa-check-circle"></i>').appendTo(badges);
}
if (options.onadd) {
options.onadd(tab);
}
@@ -770,6 +789,9 @@ RED.tabs = (function() {
count: function() {
return ul.find("li.red-ui-tab").length;
},
activeIndex: function() {
return ul.find("li.active").index()
},
contains: function(id) {
return ul.find("a[href='#"+id+"']").length > 0;
},

View File

@@ -48,7 +48,7 @@
});
this.button = $('<button type="button" class="red-ui-toggleButton '+baseClass+' toggle single"></button>');
if (enabledLabel || disabledLabel) {
this.buttonLabel = $("<span>").appendTo(this.button);
this.buttonLabel = $("<span>").appendTo(this.button).css("margin-left", "5px");
}
if (this.options.class) {

View File

@@ -312,6 +312,7 @@
}
if (child.depth !== parent.depth+1) {
child.depth = parent.depth+1;
// var labelPaddingWidth = ((child.gutter ? child.gutter[0].offsetWidth + 2 : 0) + (child.depth * 20));
var labelPaddingWidth = ((child.gutter?child.gutter.width()+2:0)+(child.depth*20));
child.treeList.labelPadding.width(labelPaddingWidth+'px');
if (child.element) {
@@ -348,6 +349,18 @@
that._selected.delete(item);
delete item.treeList;
delete that._items[item.id];
if(item.depth === 0) {
for(var key in that._items) {
if (that._items.hasOwnProperty(key)) {
var child = that._items[key];
if(child.parent && child.parent.id === item.id) {
delete that._items[key].treeList;
delete that._items[key];
}
}
}
that._data = that._data.filter(function(data) { return data.id !== item.id})
}
}
item.treeList.insertChildAt = function(newItem,position,select) {
newItem.parent = item;
@@ -480,7 +493,10 @@
if (item.treeList.container) {
$(item.element).remove();
$(element).appendTo(item.treeList.label);
var labelPaddingWidth = (item.gutter?item.gutter.width()+2:0)+(item.depth*20);
// using the JQuery Object, the gutter width will
// be wrong when the element is reattached the second time
var labelPaddingWidth = (item.gutter ? item.gutter[0].offsetWidth + 2 : 0) + (item.depth * 20);
$(element).css({
width: "calc(100% - "+(labelPaddingWidth+20+(item.icon?20:0))+"px)"
})
@@ -517,6 +533,7 @@
}
var labelPaddingWidth = (item.gutter?item.gutter.width()+2:0)+(depth*20);
// var labelPaddingWidth = (item.gutter ? item.gutter[0].offsetWidth + 2 : 0) + (depth * 20)
item.treeList.labelPadding = $('<span>').css({
display: "inline-block",
width: labelPaddingWidth+'px'

View File

@@ -14,8 +14,8 @@
* limitations under the License.
**/
(function($) {
var contextParse = function(v) {
var parts = RED.utils.parseContextKey(v);
var contextParse = function(v,defaultStore) {
var parts = RED.utils.parseContextKey(v, defaultStore&&defaultStore.value);
return {
option: parts.store,
value: parts.key
@@ -32,6 +32,21 @@
return v;
}
}
var contextLabel = function(container,value) {
var that = this;
container.css("pointer-events","none");
container.css("flex-grow",0);
container.css("position",'relative');
container.css("overflow",'visible');
$('<div></div>').text(value).css({
position: "absolute",
bottom:"-2px",
right: "5px",
"font-size": "0.7em",
opacity: 0.3
}).appendTo(container);
this.elementDiv.show();
}
var mapDeprecatedIcon = function(icon) {
if (/^red\/images\/typedInput\/.+\.png$/.test(icon)) {
icon = icon.replace(/.png$/,".svg");
@@ -44,13 +59,15 @@
options:[],
validate:RED.utils.validatePropertyExpression,
parse: contextParse,
export: contextExport
export: contextExport,
valueLabel: contextLabel
},
global: {value:"global",label:"global.",hasValue:true,
options:[],
validate:RED.utils.validatePropertyExpression,
parse: contextParse,
export: contextExport
export: contextExport,
valueLabel: contextLabel
},
str: {value:"str",label:"string",icon:"red/images/typedInput/az.svg"},
num: {value:"num",label:"number",icon:"red/images/typedInput/09.svg",validate:/^[+-]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?$/},
@@ -262,6 +279,14 @@
var contextStores = RED.settings.context.stores;
var contextOptions = contextStores.map(function(store) {
return {value:store,label: store, icon:'<i class="red-ui-typedInput-icon fa fa-database"></i>'}
}).sort(function(A,B) {
if (A.value === RED.settings.context.default) {
return -1;
} else if (B.value === RED.settings.context.default) {
return 1;
} else {
return A.value.localeCompare(B.value);
}
})
if (contextOptions.length < 2) {
allOptions.flow.options = [];
@@ -372,6 +397,11 @@
evt.stopPropagation();
}).on('focus', function() {
that.uiSelect.addClass('red-ui-typedInput-focus');
}).on('blur', function() {
var opt = that.typeMap[that.propertyType];
if (opt.hasValue === false) {
that.uiSelect.removeClass('red-ui-typedInput-focus');
}
})
// explicitly set optionSelectTrigger display to inline-block otherwise jQ sets it to 'inline'
@@ -421,7 +451,11 @@
});
this._showMenu(this.optionMenu,this.optionSelectTrigger);
var selectedOption = this.optionMenu.find("[value='"+this.optionValue+"']");
var targetValue = this.optionValue;
if (this.optionValue === null || this.optionValue === undefined) {
targetValue = this.value();
}
var selectedOption = this.optionMenu.find("[value='"+targetValue+"']");
if (selectedOption.length === 0) {
selectedOption = this.optionMenu.children(":first");
}
@@ -592,34 +626,43 @@
_updateOptionSelectLabel: function(o) {
var opt = this.typeMap[this.propertyType];
this.optionSelectLabel.empty();
if (opt.hasValue) {
this.valueLabelContainer.empty();
this.valueLabelContainer.show();
} else {
this.valueLabelContainer.hide();
}
if (this.typeMap[this.propertyType].valueLabel) {
if (opt.multiple) {
this.typeMap[this.propertyType].valueLabel.call(this,this.optionSelectLabel,o);
this.typeMap[this.propertyType].valueLabel.call(this,opt.hasValue?this.valueLabelContainer:this.optionSelectLabel,o);
} else {
this.typeMap[this.propertyType].valueLabel.call(this,this.optionSelectLabel,o.value);
this.typeMap[this.propertyType].valueLabel.call(this,opt.hasValue?this.valueLabelContainer:this.optionSelectLabel,o.value);
}
} else if (!opt.multiple) {
if (o.icon) {
if (o.icon.indexOf("<") === 0) {
$(o.icon).prependTo(this.optionSelectLabel);
} else if (o.icon.indexOf("/") !== -1) {
// url
$('<img>',{src:mapDeprecatedIcon(o.icon),style:"height: 18px;"}).prependTo(this.optionSelectLabel);
}
if (!this.typeMap[this.propertyType].valueLabel || opt.hasValue) {
if (!opt.multiple) {
if (o.icon) {
if (o.icon.indexOf("<") === 0) {
$(o.icon).prependTo(this.optionSelectLabel);
} else if (o.icon.indexOf("/") !== -1) {
// url
$('<img>',{src:mapDeprecatedIcon(o.icon),style:"height: 18px;"}).prependTo(this.optionSelectLabel);
} else {
// icon class
$('<i>',{class:"red-ui-typedInput-icon "+o.icon}).prependTo(this.optionSelectLabel);
}
} else if (o.label) {
this.optionSelectLabel.text(o.label);
} else {
// icon class
$('<i>',{class:"red-ui-typedInput-icon "+o.icon}).prependTo(this.optionSelectLabel);
this.optionSelectLabel.text(o.value);
}
if (opt.hasValue) {
this.optionValue = o.value;
this.input.trigger('change',[this.propertyType,this.value()]);
}
} else if (o.label) {
this.optionSelectLabel.text(o.label);
} else {
this.optionSelectLabel.text(o.value);
this.optionSelectLabel.text(o.length+" selected");
}
if (opt.hasValue) {
this.optionValue = o.value;
this.input.trigger('change',[this.propertyType,this.value()]);
}
} else {
this.optionSelectLabel.text(o.length+" selected");
}
},
_destroy: function() {
@@ -643,6 +686,11 @@
that.typeMap[result.value] = result;
return result;
});
if (this.typeList.length < 2) {
this.selectTrigger.attr("tabindex", -1)
} else {
this.selectTrigger.attr("tabindex", 0)
}
this.selectTrigger.toggleClass("disabled", this.typeList.length === 1);
this.selectTrigger.find(".fa-caret-down").toggle(this.typeList.length > 1)
if (this.menu) {
@@ -742,6 +790,11 @@
if (opt.hasValue === false || (opt.showLabel !== false && !opt.icon)) {
this.selectLabel.text(opt.label);
}
if (opt.label) {
this.selectTrigger.attr("title",opt.label);
} else {
this.selectTrigger.attr("title","");
}
if (opt.hasValue === false) {
this.selectTrigger.addClass("red-ui-typedInput-full-width");
} else {
@@ -829,7 +882,7 @@
} else {
var selectedOption = this.optionValue||opt.options[0];
if (opt.parse) {
var parts = opt.parse(this.input.val());
var parts = opt.parse(this.input.val(),selectedOption);
if (parts.option) {
selectedOption = parts.option;
if (!this.activeOptions.hasOwnProperty(selectedOption)) {
@@ -893,6 +946,7 @@
// Reset any CSS the custom label may have set
this.valueLabelContainer.css("pointer-events","");
this.valueLabelContainer.css("flex-grow",1);
this.valueLabelContainer.css("overflow","hidden");
this.valueLabelContainer.show();
this.valueLabelContainer.empty();
this.elementDiv.hide();
@@ -977,16 +1031,17 @@
this.uiSelect.hide();
},
disable: function(val) {
if(val === true) {
if(val === undefined || !!val ) {
this.uiSelect.attr("disabled", "disabled");
} else if (val === false) {
this.uiSelect.attr("disabled", null); //remove attr
} else {
this.uiSelect.attr("disabled", val); //user value
this.uiSelect.attr("disabled", null); //remove attr
}
},
enable: function() {
this.uiSelect.attr("disabled", null); //remove attr
},
disabled: function() {
return this.uiSelect.attr("disabled");
return this.uiSelect.attr("disabled") === "disabled";
}
});
})(jQuery);

View File

@@ -1525,6 +1525,7 @@ var buildingEditDialog = false;
console.log("oneditresize",editing_node.id,editing_node.type,err.toString());
}
}
if (nodeInfoEditor) {nodeInfoEditor.resize();} //markdown editor doesnt size up without this - idkw!?
},
open: function(tray, done) {
if (editing_node.hasOwnProperty('outputs')) {
@@ -2759,98 +2760,11 @@ var buildingEditDialog = false;
}
}
function createEditor(options) {
var el = options.element || $("#"+options.id)[0];
var toolbarRow = $("<div>").appendTo(el);
el = $("<div>").appendTo(el).addClass("red-ui-editor-text-container")[0];
var editor = ace.edit(el);
editor.setTheme("ace/theme/tomorrow");
var session = editor.getSession();
session.on("changeAnnotation", function () {
var annotations = session.getAnnotations() || [];
var i = annotations.length;
var len = annotations.length;
while (i--) {
if (/doctype first\. Expected/.test(annotations[i].text)) { annotations.splice(i, 1); }
else if (/Unexpected End of file\. Expected/.test(annotations[i].text)) { annotations.splice(i, 1); }
}
if (len > annotations.length) { session.setAnnotations(annotations); }
});
if (options.mode) {
session.setMode(options.mode);
}
if (options.foldStyle) {
session.setFoldStyle(options.foldStyle);
} else {
session.setFoldStyle('markbeginend');
}
if (options.options) {
editor.setOptions(options.options);
} else {
editor.setOptions({
enableBasicAutocompletion:true,
enableSnippets:true,
tooltipFollowsMouse: false
});
}
if (options.readOnly) {
editor.setOption('readOnly',options.readOnly);
editor.container.classList.add("ace_read-only");
}
if (options.hasOwnProperty('lineNumbers')) {
editor.renderer.setOption('showGutter',options.lineNumbers);
}
editor.$blockScrolling = Infinity;
if (options.value) {
session.setValue(options.value,-1);
}
if (options.globals) {
setTimeout(function() {
if (!!session.$worker) {
session.$worker.send("setOptions", [{globals: options.globals, maxerr:1000}]);
}
},100);
}
if (options.mode === 'ace/mode/markdown') {
$(el).addClass("red-ui-editor-text-container-toolbar");
editor.toolbar = customEditTypes['_markdown'].buildToolbar(toolbarRow,editor);
if (options.expandable !== false) {
var expandButton = $('<button type="button" class="red-ui-button" style="float: right;"><i class="fa fa-expand"></i></button>').appendTo(editor.toolbar);
RED.popover.tooltip(expandButton, RED._("markdownEditor.expand"));
expandButton.on("click", function(e) {
e.preventDefault();
var value = editor.getValue();
RED.editor.editMarkdown({
value: value,
width: "Infinity",
cursor: editor.getCursorPosition(),
complete: function(v,cursor) {
editor.setValue(v, -1);
editor.gotoLine(cursor.row+1,cursor.column,false);
setTimeout(function() {
editor.focus();
},300);
}
})
});
}
var helpButton = $('<button type="button" class="red-ui-editor-text-help red-ui-button red-ui-button-small"><i class="fa fa-question"></i></button>').appendTo($(el).parent());
RED.popover.create({
target: helpButton,
trigger: 'click',
size: "small",
direction: "left",
content: RED._("markdownEditor.format"),
autoClose: 50
});
session.setUseWrapMode(true);
}
return editor;
}
return {
init: function() {
ace.config.set('basePath', 'vendor/ace');
if(window.ace) { window.ace.config.set('basePath', 'vendor/ace'); }
RED.tray.init();
RED.actions.add("core:confirm-edit-tray", function() {
$(document.activeElement).blur();
@@ -2862,6 +2776,7 @@ var buildingEditDialog = false;
$("#node-dialog-cancel").trigger("click");
$("#node-config-dialog-cancel").trigger("click");
});
RED.editor.codeEditor.init();
},
edit: showEditDialog,
editConfig: showEditConfigNodeDialog,
@@ -2908,9 +2823,14 @@ var buildingEditDialog = false;
/**
* Create a editor ui component
* @param {object} options - the editor options
* @function
* @returs The code editor
* @memberof RED.editor
*/
createEditor: createEditor
createEditor: function(options) {
return RED.editor.codeEditor.create(options);
},
get customEditTypes() {
return customEditTypes;
}
}
})();

View File

@@ -0,0 +1,107 @@
/**
* Copyright JS Foundation and other contributors, http://js.foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
/**
* @namespace RED.editor.codeEditor
*/
RED.editor.codeEditor = (function() {
const MONACO = "monaco";
const ACE = "ace";
const defaultEditor = ACE;
const DEFAULT_SETTINGS = { lib: defaultEditor, options: {} };
var selectedCodeEditor = null;
var initialised = false;
function init() {
var codeEditorSettings = RED.editor.codeEditor.settings;
var editorChoice = codeEditorSettings.lib === MONACO ? MONACO : ACE;
try {
var browser = RED.utils.getBrowserInfo();
selectedCodeEditor = RED.editor.codeEditor[editorChoice];
//fall back to default code editor if there are any issues
if (!selectedCodeEditor || (editorChoice === MONACO && (browser.ie || !window.monaco))) {
selectedCodeEditor = RED.editor.codeEditor[defaultEditor];
}
initialised = selectedCodeEditor.init();
} catch (error) {
selectedCodeEditor = null;
console.warn("Problem initialising '" + editorChoice + "' code editor", error);
}
if(!initialised) {
selectedCodeEditor = RED.editor.codeEditor[defaultEditor];
initialised = selectedCodeEditor.init();
}
}
function create(options) {
//TODO: (quandry - for consideration)
// Below, I had to create a hidden element if options.id || options.element is not in the DOM
// I have seen 1 node calling `this.editor = RED.editor.createEditor()` with an
// invalid (non existing html element selector) (e.g. node-red-contrib-components does this)
// This causes monaco to throw an error when attempting to hook up its events to the dom & the rest of the 'oneditperapre'
// code is thus skipped.
// In ACE mode, creating an ACE editor (with an invalid ID) allows the editor to be created (but obviously there is no UI)
// Because one (or more) contrib nodes have left this bad code in place, how would we handle this?
// For compatibility, I have decided to create a hidden element so that at least an editor is created & errors do not occur.
// IMO, we should warn and exit as it is a coding error by the contrib author.
if (!options) {
console.warn("createEditor() options are missing");
options = {};
}
if (this.editor.type === MONACO) {
// compatibility (see above note)
if (!options.element && !options.id) {
options.id = 'node-backwards-compatability-dummy-editor';
}
options.element = options.element || $("#" + options.id)[0];
if (!options.element) {
console.warn("createEditor() options.element or options.id is not valid", options);
$("#dialog-form").append('<div id="' + options.id + '" style="display: none;" />');
}
return this.editor.create(options);
} else {
return this.editor.create(options);//fallback to ACE
}
}
return {
init: init,
/**
* Get editor settings object
* @memberof RED.editor.codeEditor
*/
get settings() {
return RED.settings.get('codeEditor') || DEFAULT_SETTINGS;
},
/**
* Get user selected code editor
* @return {string} Returns
* @memberof RED.editor.codeEditor
*/
get editor() {
return selectedCodeEditor;
},
/**
* Create a editor ui component
* @param {object} options - the editor options
* @memberof RED.editor.codeEditor
*/
create: create
}
})();

View File

@@ -0,0 +1,153 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
/**
* @namespace RED.editor.codeEditor.ace
*/
RED.editor.codeEditor.ace = (function() {
const type = "ace";
var initialised = false;
var initOptions = {};
function init(options) {
initOptions = options || {};
initialised = true;
return initialised;
}
function create(options) {
var editorSettings = RED.editor.codeEditor.settings || {};
var el = options.element || $("#"+options.id)[0];
var toolbarRow = $("<div>").appendTo(el);
el = $("<div>").appendTo(el).addClass("red-ui-editor-text-container")[0];
var editor = window.ace.edit(el);
editor.setTheme(editorSettings.theme || initOptions.theme || "ace/theme/tomorrow");
var session = editor.getSession();
session.on("changeAnnotation", function () {
var annotations = session.getAnnotations() || [];
var i = annotations.length;
var len = annotations.length;
while (i--) {
if (/doctype first\. Expected/.test(annotations[i].text)) { annotations.splice(i, 1); }
else if (/Unexpected End of file\. Expected/.test(annotations[i].text)) { annotations.splice(i, 1); }
}
if (len > annotations.length) { session.setAnnotations(annotations); }
});
if (options.mode) {
session.setMode(options.mode);
}
if (options.foldStyle) {
session.setFoldStyle(options.foldStyle);
} else {
session.setFoldStyle('markbeginend');
}
if (options.options) {
editor.setOptions(options.options);
} else {
editor.setOptions({
enableBasicAutocompletion:true,
enableSnippets:true,
tooltipFollowsMouse: false
});
}
if (options.readOnly) {
editor.setOption('readOnly',options.readOnly);
editor.container.classList.add("ace_read-only");
}
if (options.hasOwnProperty('lineNumbers')) {
editor.renderer.setOption('showGutter',options.lineNumbers);
}
editor.$blockScrolling = Infinity;
if (options.value) {
session.setValue(options.value,-1);
}
if (options.globals) {
setTimeout(function() {
if (!!session.$worker) {
session.$worker.send("setOptions", [{globals: options.globals, maxerr:1000}]);
}
},100);
}
if (options.mode === 'ace/mode/markdown') {
$(el).addClass("red-ui-editor-text-container-toolbar");
editor.toolbar = RED.editor.customEditTypes['_markdown'].buildToolbar(toolbarRow,editor);
if (options.expandable !== false) {
var expandButton = $('<button type="button" class="red-ui-button" style="float: right;"><i class="fa fa-expand"></i></button>').appendTo(editor.toolbar);
RED.popover.tooltip(expandButton, RED._("markdownEditor.expand"));
expandButton.on("click", function(e) {
e.preventDefault();
var value = editor.getValue();
RED.editor.editMarkdown({
value: value,
width: "Infinity",
cursor: editor.getCursorPosition(),
complete: function(v,cursor) {
editor.setValue(v, -1);
editor.gotoLine(cursor.row+1,cursor.column,false);
setTimeout(function() {
editor.focus();
},300);
}
})
});
}
var helpButton = $('<button type="button" class="red-ui-editor-text-help red-ui-button red-ui-button-small"><i class="fa fa-question"></i></button>').appendTo($(el).parent());
RED.popover.create({
target: helpButton,
trigger: 'click',
size: "small",
direction: "left",
content: RED._("markdownEditor.format"),
autoClose: 50
});
session.setUseWrapMode(true);
}
editor._destroy = editor.destroy;
editor.destroy = function() {
try {
this._destroy();
} catch (e) { }
$(el).remove();
$(toolbarRow).remove();
}
editor.type = type;
return editor;
}
return {
/**
* Editor type
* @memberof RED.editor.codeEditor.ace
*/
get type() { return type; },
/**
* Editor initialised
* @memberof RED.editor.codeEditor.ace
*/
get initialised() { return initialised; },
/**
* Initialise code editor
* @param {object} options - initialisation options
* @memberof RED.editor.codeEditor.ace
*/
init: init,
/**
* Create a code editor
* @param {object} options - the editor options
* @memberof RED.editor.codeEditor.ace
*/
create: create
}
})();

File diff suppressed because it is too large Load Diff

View File

@@ -121,73 +121,75 @@
var currentFunctionMarker = null;
expressionEditor.getSession().setValue(value||"",-1);
expressionEditor.on("changeSelection", function() {
var c = expressionEditor.getCursorPosition();
var token = expressionEditor.getSession().getTokenAt(c.row,c.column);
if (token !== currentToken || (token && /paren/.test(token.type) && c.column !== currentTokenPos)) {
currentToken = token;
var r,p;
var scopedFunction = null;
if (token && token.type === 'keyword') {
r = c.row;
scopedFunction = token;
} else {
var depth = 0;
var next = false;
if (token) {
if (token.type === 'paren.rparen') {
// If this is a block of parens ')))', set
// depth to offset against the cursor position
// within the block
currentTokenPos = c.column;
depth = c.column - (token.start + token.value.length);
}
//ace only (monaco has jsonata tokeniser)
if(expressionEditor.type == "ace") {
expressionEditor.on("changeSelection", function() {
var c = expressionEditor.getCursorPosition();
var token = expressionEditor.getSession().getTokenAt(c.row,c.column);
if (token !== currentToken || (token && /paren/.test(token.type) && c.column !== currentTokenPos)) {
currentToken = token;
var r,p;
var scopedFunction = null;
if (token && token.type === 'keyword') {
r = c.row;
p = token.index;
scopedFunction = token;
} else {
r = c.row-1;
p = -1;
}
while ( scopedFunction === null && r > -1) {
var rowTokens = expressionEditor.getSession().getTokens(r);
if (p === -1) {
p = rowTokens.length-1;
var depth = 0;
var next = false;
if (token) {
if (token.type === 'paren.rparen') {
// If this is a block of parens ')))', set
// depth to offset against the cursor position
// within the block
currentTokenPos = c.column;
depth = c.column - (token.start + token.value.length);
}
r = c.row;
p = token.index;
} else {
r = c.row-1;
p = -1;
}
while (p > -1) {
var type = rowTokens[p].type;
if (next) {
if (type === 'keyword') {
scopedFunction = rowTokens[p];
// console.log("HIT",scopedFunction);
break;
while ( scopedFunction === null && r > -1) {
var rowTokens = expressionEditor.getSession().getTokens(r);
if (p === -1) {
p = rowTokens.length-1;
}
while (p > -1) {
var type = rowTokens[p].type;
if (next) {
if (type === 'keyword') {
scopedFunction = rowTokens[p];
// console.log("HIT",scopedFunction);
break;
}
next = false;
}
next = false;
if (type === 'paren.lparen') {
depth-=rowTokens[p].value.length;
} else if (type === 'paren.rparen') {
depth+=rowTokens[p].value.length;
}
if (depth < 0) {
next = true;
depth = 0;
}
// console.log(r,p,depth,next,rowTokens[p]);
p--;
}
if (type === 'paren.lparen') {
depth-=rowTokens[p].value.length;
} else if (type === 'paren.rparen') {
depth+=rowTokens[p].value.length;
if (!scopedFunction) {
r--;
}
if (depth < 0) {
next = true;
depth = 0;
}
// console.log(r,p,depth,next,rowTokens[p]);
p--;
}
if (!scopedFunction) {
r--;
}
}
expressionEditor.session.removeMarker(currentFunctionMarker);
if (scopedFunction) {
//console.log(token,.map(function(t) { return t.type}));
funcSelect.val(scopedFunction.value).trigger("change");
}
}
expressionEditor.session.removeMarker(currentFunctionMarker);
if (scopedFunction) {
//console.log(token,.map(function(t) { return t.type}));
funcSelect.val(scopedFunction.value).trigger("change");
}
}
});
});
}
dialogForm.i18n();
$("#red-ui-editor-type-expression-func-insert").on("click", function(e) {
e.preventDefault();
@@ -343,6 +345,7 @@
}
expressionEditor.destroy();
testDataEditor.destroy();
testResultEditor.destroy();
},
show: function() {}
}

View File

@@ -602,10 +602,10 @@
},
close: function() {
// expressionEditor.destroy();
if (options.onclose) {
options.onclose();
}
expressionEditor.destroy();
},
show: function() {}
}

View File

@@ -73,6 +73,7 @@ RED.eventLog = (function() {
var trayBody = tray.find('.red-ui-tray-body');
var dialogForm = RED.editor.buildEditForm(tray.find('.red-ui-tray-body'),'dialog-form',type,'editor');
eventLogEditor = RED.editor.createEditor({
mode:"ace/mode/shell",
id: 'red-ui-event-log-editor',
value: backlog.join("\n"),
lineNumbers: false,

View File

@@ -44,7 +44,11 @@ RED.keyboard = (function() {
"/":191,
"\\":220,
"'":222,
"?":191 // <- QWERTY specific
"?":191, // <- QWERTY specific
"[": 219,
"]": 221,
"{": 219,// <- QWERTY specific
"}": 221 // <- QWERTY specific
}
var metaKeyCodes = {
16: true,
@@ -115,7 +119,7 @@ RED.keyboard = (function() {
} else {
mergedKeymap[action] = [{
scope: themeKeymap[action].scope || "*",
key: [themeKeymap[action].key],
key: themeKeymap[action].key,
user: false
}]
if (mergedKeymap[action][0].scope === "workspace") {

View File

@@ -27,7 +27,7 @@ RED.library = (function() {
'<div class="red-ui-panel" id="red-ui-library-dialog-load-browser"></div>'+
'<div class="red-ui-panel">'+
'<div id="red-ui-library-dialog-load-preview">'+
'<div class="red-ui-panel" id="red-ui-library-dialog-load-preview-text"></div>'+
'<div class="red-ui-panel" id="red-ui-library-dialog-load-preview-text" style="position:relative; height: 50%; overflow-y: hidden;"></div>'+
'<div class="red-ui-panel" id="red-ui-library-dialog-load-preview-details">'+
'<table id="red-ui-library-dialog-load-preview-details-table" class="red-ui-info-table"></table>'+
'</div>'+
@@ -216,21 +216,27 @@ RED.library = (function() {
{ id:'node-input-'+options.type+'-menu-open-library',
label: RED._("library.openLibrary"),
onselect: function() {
libraryEditor = ace.edit('red-ui-library-dialog-load-preview-text',{
useWorker: false
});
libraryEditor.setTheme("ace/theme/tomorrow");
if (options.mode) {
libraryEditor.getSession().setMode(options.mode);
}
libraryEditor.setOptions({
var editorOpts = {
id: 'red-ui-library-dialog-load-preview-text',
mode: options.mode,
readOnly: true,
highlightActiveLine: false,
highlightGutterLine: false
});
libraryEditor.renderer.$cursorLayer.element.style.opacity=0;
libraryEditor.$blockScrolling = Infinity;
highlightGutterLine: false,
contextmenu: false
}
libraryEditor = RED.editor.createEditor(editorOpts); //use red.editor
if(libraryEditor.isACE) {
if (options.mode) {
libraryEditor.getSession().setMode(options.mode);
}
libraryEditor.setOptions({
readOnly: true,
highlightActiveLine: false,
highlightGutterLine: false
});
libraryEditor.renderer.$cursorLayer.element.style.opacity=0;
libraryEditor.$blockScrolling = Infinity;
}
activeLibrary = options;
var listing = [];
@@ -809,11 +815,12 @@ RED.library = (function() {
open: function(e) {
RED.keyboard.disable();
$(this).parent().find(".ui-dialog-titlebar-close").hide();
libraryEditor.resize();
},
close: function(e) {
RED.keyboard.enable();
if (libraryEditor) {
libraryEditor.destroy();
libraryEditor.remove();
libraryEditor = null;
}
}

View File

@@ -331,7 +331,7 @@ RED.palette.editor = (function() {
nodeEntry.versionSpan.html(moduleInfo.version+' <i class="fa fa-long-arrow-right"></i> '+moduleInfo.pending_version).appendTo(nodeEntry.metaRow)
nodeEntry.updateButton.text(RED._('palette.editor.updated')).addClass('disabled').css('display', 'inline-block');
} else if (loadedIndex.hasOwnProperty(module)) {
if (semVerCompare(loadedIndex[module].version,moduleInfo.version) === 1) {
if (semVerCompare(loadedIndex[module].version,moduleInfo.version) > 0) {
nodeEntry.updateButton.show();
nodeEntry.updateButton.text(RED._('palette.editor.update',{version:loadedIndex[module].version}));
} else {

View File

@@ -320,12 +320,12 @@ RED.palette = (function() {
var paletteNode = getPaletteNode(nt);
ui.originalPosition.left = paletteNode.offset().left;
mouseX = ui.position.left - paletteWidth + (ui.helper.width()/2) + chart.scrollLeft();
mouseY = ui.position.top - paletteTop + (ui.helper.height()/2) + chart.scrollTop();
mouseY = ui.position.top - paletteTop + (ui.helper.height()/2) + chart.scrollTop() + 10;
if (!groupTimer) {
groupTimer = setTimeout(function() {
mouseX /= RED.view.scale();
mouseY /= RED.view.scale();
var group = RED.view.getGroupAtPoint(mouseX,mouseY);
var mx = mouseX / RED.view.scale();
var my = mouseY / RED.view.scale();
var group = RED.view.getGroupAtPoint(mx,my);
if (group !== hoverGroup) {
if (hoverGroup) {
document.getElementById("group_select_"+hoverGroup.id).classList.remove("red-ui-flow-group-hovered");
@@ -357,23 +357,20 @@ RED.palette = (function() {
svgRect.width = 1;
svgRect.height = 1;
nodes = chartSVG.getIntersectionList(svgRect,chartSVG);
mouseX /= RED.view.scale();
mouseY /= RED.view.scale();
} else {
// Firefox doesn't do getIntersectionList and that
// makes us sad
mouseX /= RED.view.scale();
mouseY /= RED.view.scale();
nodes = RED.view.getLinksAtPoint(mouseX,mouseY);
}
var mx = mouseX / RED.view.scale();
var my = mouseY / RED.view.scale();
for (var i=0;i<nodes.length;i++) {
var node = d3.select(nodes[i]);
if (node.classed('red-ui-flow-link-background') && !node.classed('red-ui-flow-link-link')) {
var length = nodes[i].getTotalLength();
for (var j=0;j<length;j+=10) {
var p = nodes[i].getPointAtLength(j);
var d2 = ((p.x-mouseX)*(p.x-mouseX))+((p.y-mouseY)*(p.y-mouseY));
var d2 = ((p.x-mx)*(p.x-mx))+((p.y-my)*(p.y-my));
if (d2 < 200 && d2 < bestDistance) {
bestDistance = d2;
bestLink = nodes[i];

View File

@@ -928,11 +928,11 @@ RED.projects.settings = (function() {
saveDisabled = isFlowInvalid || credFileLabelText.text()==="";
if (credentialSecretExistingInput.is(":visible")) {
if (credentialSecretExistingRow.is(":visible")) {
credentialSecretExistingInput.toggleClass("input-error", credentialSecretExistingInput.val() === "");
saveDisabled = saveDisabled || credentialSecretExistingInput.val() === "";
}
if (credentialSecretNewInput.is(":visible")) {
if (credentialSecretNewRow.is(":visible")) {
credentialSecretNewInput.toggleClass("input-error", credentialSecretNewInput.val() === "");
saveDisabled = saveDisabled || credentialSecretNewInput.val() === "";
}
@@ -1130,7 +1130,7 @@ RED.projects.settings = (function() {
}
if (credentialSecretResetButton.hasClass('selected') || credentialSecretEditButton.hasClass('selected')) {
payload.credentialSecret = credentialSecretNewInput.val();
if (credentialSecretExistingInput.is(":visible")) {
if (credentialSecretExistingRow.is(":visible")) {
payload.currentCredentialSecret = credentialSecretExistingInput.val();
}
}

View File

@@ -357,7 +357,6 @@ RED.search = (function() {
}
if (!visible) {
previousActiveElement = document.activeElement;
RED.keyboard.add("*","escape",function(){hide()});
$("#red-ui-header-shade").show();
$("#red-ui-editor-shade").show();
$("#red-ui-palette-shade").show();
@@ -377,7 +376,6 @@ RED.search = (function() {
function hide() {
if (visible) {
RED.keyboard.remove("escape");
visible = false;
$("#red-ui-header-shade").hide();
$("#red-ui-editor-shade").hide();
@@ -429,7 +427,7 @@ RED.search = (function() {
RED.events.on("actionList:open",function() { disabled = true; });
RED.events.on("actionList:close",function() { disabled = false; });
RED.keyboard.add("red-ui-search","escape",hide);
$("#red-ui-header-shade").on('mousedown',hide);
$("#red-ui-editor-shade").on('mousedown',hide);

View File

@@ -199,7 +199,7 @@ RED.sidebar = (function() {
id = RED.settings.get("editor.sidebar.order",["info", "help", "version-control", "debug"])[0]
}
if (id) {
if (!containsTab(id)) {
if (!containsTab(id) && knownTabs[id]) {
sidebar_tabs.addTab(knownTabs[id]);
}
sidebar_tabs.activateTab(id);

View File

@@ -230,10 +230,17 @@ RED.sidebar.help = (function() {
}
function getNodeLabel(n) {
var div = $('<div>',{class:"red-ui-info-outline-item"});
RED.utils.createNodeIcon(n).appendTo(div);
var contentDiv = $('<div>',{class:"red-ui-search-result-description"}).appendTo(div);
$('<div>',{class:"red-ui-search-result-node-label red-ui-info-outline-item-label"}).text(n.name||n.type).appendTo(contentDiv);
var div = $('<div>',{class:"red-ui-node-list-item"});
var icon = RED.utils.createNodeIcon(n).appendTo(div);
var label = n.name;
if (!label && n._def.paletteLabel) {
try {
label = (typeof n._def.paletteLabel === "function" ? n._def.paletteLabel.call(n._def) : n._def.paletteLabel)||"";
} catch (err) {
}
}
label = label || n.type;
$('<div>',{class:"red-ui-node-label"}).text(n.name||n.type).appendTo(icon);
return div;
}
@@ -248,7 +255,15 @@ RED.sidebar.help = (function() {
title = subflowNode.name || nodeType;
} else {
helpText = RED.nodes.getNodeHelp(nodeType)||('<span class="red-ui-help-info-none">'+RED._("sidebar.info.none")+'</span>');
title = nodeType;
var _def = RED.nodes.registry.getNodeType(nodeType);
title = (_def && _def.paletteLabel)?_def.paletteLabel:nodeType;
if (typeof title === "function") {
try {
title = _def.paletteLabel.call(_def);
} catch(err) {
title = nodeType;
}
}
}
setInfoText(title, helpText, helpSection);

View File

@@ -73,36 +73,11 @@ RED.sidebar.info.outliner = (function() {
return item;
}
function getNodeLabelText(n) {
var label = n.name || n.type+": "+n.id;
if (n._def.label) {
try {
label = (typeof n._def.label === "function" ? n._def.label.call(n) : n._def.label)||"";
} catch(err) {
console.log("Definition error: "+n.type+".label",err);
}
}
var newlineIndex = label.indexOf("\\n");
if (newlineIndex > -1) {
label = label.substring(0,newlineIndex)+"...";
}
return label;
}
function getNodeLabel(n) {
var div = $('<div>',{class:"red-ui-info-outline-item"});
RED.utils.createNodeIcon(n).appendTo(div);
var contentDiv = $('<div>',{class:"red-ui-search-result-description"}).appendTo(div);
var labelText = getNodeLabelText(n);
var label = $('<div>',{class:"red-ui-search-result-node-label red-ui-info-outline-item-label"}).appendTo(contentDiv);
if (labelText) {
label.text(labelText)
} else {
label.html("&nbsp;")
}
var div = $('<div>',{class:"red-ui-node-list-item red-ui-info-outline-item"});
RED.utils.createNodeIcon(n, true).appendTo(div);
div.find(".red-ui-node-label").addClass("red-ui-info-outline-item-label")
addControls(n, div);
return div;
}
@@ -304,6 +279,8 @@ RED.sidebar.info.outliner = (function() {
if (node) {
if (node.type === 'group' || node._def.category !== "config") {
RED.view.select({nodes:[node]})
} else if (node._def.category === "config") {
RED.sidebar.info.refresh(node);
} else {
RED.view.select({nodes:[]})
}
@@ -430,7 +407,7 @@ RED.sidebar.info.outliner = (function() {
var existingObject = objects[n.id];
var parent = n.g||n.z||"__global__";
var nodeLabelText = getNodeLabelText(n);
var nodeLabelText = RED.utils.getNodeLabel(n,n.name || (n.type+": "+n.id));
if (nodeLabelText) {
existingObject.element.find(".red-ui-info-outline-item-label").text(nodeLabelText);
} else {

View File

@@ -477,7 +477,7 @@ RED.sidebar.info = (function() {
return;
}
}
while ((m=/(\[(.*?)\])/.exec(tip))) {
while ((m=/(\[([a-z]*?)\])/.exec(tip))) {
tip = tip.replace(m[1],RED.keyboard.formatKey(m[2]));
}
tipBox.html(tip).fadeIn(200);
@@ -499,7 +499,7 @@ RED.sidebar.info = (function() {
if (tipCount === -1) {
do {
tipCount++;
} while(RED._("infotips:info.tip"+tipCount)!=="infotips:info.tip"+tipCount);
} while(RED._("infotips:info.tip"+tipCount)!=="info.tip"+tipCount);
}
startTimeout = setTimeout(setTip,startDelay);
}

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
RED.tray = (function() {
RED.tray = (function() {
var stack = [];
var editorStack;
@@ -166,6 +166,8 @@ RED.tray = (function() {
setTimeout(function() {
// Delay resetting the flag, so we don't close prematurely
openingTray = false;
raiseTrayZ();
handleWindowResize();//cause call to monaco layout
},200);
body.find(":focusable:first").trigger("focus");
@@ -206,6 +208,17 @@ RED.tray = (function() {
}
}
//raise tray z-index to prevent editor context menu being clipped by sidebar
function raiseTrayZ() {
setTimeout(function(){
$('#red-ui-editor-stack').css("zIndex","13");
},300);
}
//lower tray z-index back to original place for correct slide animation (related to fix for editor context menu clipped by sidebar)
function lowerTrayZ(){
$('#red-ui-editor-stack').css("zIndex","9");
}
return {
init: function init() {
editorStack = $("#red-ui-editor-stack");
@@ -221,6 +234,7 @@ RED.tray = (function() {
});
},
show: function show(options) {
lowerTrayZ();
if (!options) {
if (stack.length > 0) {
var tray = stack[stack.length-1];
@@ -246,12 +260,16 @@ RED.tray = (function() {
showTray(options);
},250)
} else {
if (stack.length > 0) {
stack[stack.length-1].tray.css("z-index", 0);
}
RED.events.emit("editor:open");
showTray(options);
}
},
hide: function hide() {
lowerTrayZ();
if (stack.length > 0) {
var tray = stack[stack.length-1];
tray.tray.css({
@@ -266,15 +284,16 @@ RED.tray = (function() {
},
resize: handleWindowResize,
close: function close(done) {
lowerTrayZ(); //lower tray z-index for correct animation
if (stack.length > 0) {
var tray = stack.pop();
tray.tray.css({
right: -(tray.tray.width()+10)+"px"
});
setTimeout(function() {
if (tray.options.close) {
tray.options.close();
}
try {
if (tray.options.close) { tray.options.close(); }
} catch (ex) { }
tray.tray.remove();
if (stack.length > 0) {
var oldTray = stack[stack.length-1];
@@ -284,6 +303,8 @@ RED.tray = (function() {
handleWindowResize();
oldTray.tray.css({right:0});
if (oldTray.options.show) {
raiseTrayZ();
handleWindowResize();//cause call to monaco layout
oldTray.options.show();
}
},0);
@@ -304,6 +325,8 @@ RED.tray = (function() {
$(".red-ui-sidebar-shade").hide();
RED.events.emit("editor:close");
RED.view.focus();
} else {
stack[stack.length-1].tray.css("z-index", "auto");
}
},250)
}

View File

@@ -224,14 +224,14 @@ RED.typeSearch = (function() {
}
function show(opts) {
if (!visible) {
RED.keyboard.add("*","escape",function(){
hide();
if (cancelCallback) {
cancelCallback();
}
});
if (dialog === null) {
createDialog();
RED.keyboard.add("red-ui-type-search","escape",function(){
hide();
if (cancelCallback) {
cancelCallback();
}
});
}
visible = true;
} else {
@@ -266,11 +266,10 @@ RED.typeSearch = (function() {
if (!opts.disableFocus) {
searchInput.trigger("focus");
}
},100);
},200);
}
function hide(fast) {
if (visible) {
RED.keyboard.remove("escape");
visible = false;
if (dialog !== null) {
searchResultsDiv.slideUp(fast?50:200,function() {

View File

@@ -58,6 +58,10 @@ RED.utils = (function() {
result = $('<span class="red-ui-debug-msg-object-value red-ui-debug-msg-type-meta"></span>').text('buffer['+value.length+']');
} else if (value.hasOwnProperty('type') && value.type === 'array' && value.hasOwnProperty('data')) {
result = $('<span class="red-ui-debug-msg-object-value red-ui-debug-msg-type-meta"></span>').text('array['+value.length+']');
} else if (value.hasOwnProperty('type') && value.type === 'set' && value.hasOwnProperty('data')) {
result = $('<span class="red-ui-debug-msg-object-value red-ui-debug-msg-type-meta"></span>').text('set['+value.length+']');
} else if (value.hasOwnProperty('type') && value.type === 'map' && value.hasOwnProperty('data')) {
result = $('<span class="red-ui-debug-msg-object-value red-ui-debug-msg-type-meta"></span>').text('map');
} else if (value.hasOwnProperty('type') && value.type === 'function') {
result = $('<span class="red-ui-debug-msg-object-value red-ui-debug-msg-type-meta"></span>').text('function');
} else if (value.hasOwnProperty('type') && (value.type === 'number' || value.type === 'bigint')) {
@@ -178,8 +182,14 @@ RED.utils = (function() {
RED.popover.tooltip(pinPath,RED._("node-red:debug.sidebar.pinPath"));
}
if (extraTools) {
extraTools.addClass("red-ui-debug-msg-tools-other");
extraTools.appendTo(tools);
var t = extraTools;
if (typeof t === 'function') {
t = t(key,msg);
}
if (t) {
t.addClass("red-ui-debug-msg-tools-other");
t.appendTo(tools);
}
}
}
function checkExpanded(strippedKey,expandPaths,minRange,maxRange) {
@@ -344,7 +354,7 @@ RED.utils = (function() {
var isArray = Array.isArray(obj);
var isArrayObject = false;
if (obj && typeof obj === 'object' && obj.hasOwnProperty('type') && obj.hasOwnProperty('data') && ((obj.__enc__ && obj.type === 'array') || obj.type === 'Buffer')) {
if (obj && typeof obj === 'object' && obj.hasOwnProperty('type') && obj.hasOwnProperty('data') && ((obj.__enc__ && obj.type === 'set') || (obj.__enc__ && obj.type === 'array') || obj.type === 'Buffer')) {
isArray = true;
isArrayObject = true;
}
@@ -411,7 +421,7 @@ RED.utils = (function() {
}
var fullLength = data.length;
if (originalLength > 0) {
if (originalLength > 0) {
$('<i class="fa fa-caret-right red-ui-debug-msg-object-handle"></i> ').prependTo(header);
var arrayRows = $('<div class="red-ui-debug-msg-array-rows"></div>').appendTo(element);
element.addClass('red-ui-debug-msg-buffer-raw');
@@ -476,7 +486,8 @@ RED.utils = (function() {
rootPath: rootPath,
expandPaths: expandPaths,
ontoggle: ontoggle,
exposeApi: exposeApi
exposeApi: exposeApi,
tools: tools
}
).appendTo(row);
}
@@ -504,8 +515,8 @@ RED.utils = (function() {
rootPath: rootPath,
expandPaths: expandPaths,
ontoggle: ontoggle,
exposeApi: exposeApi
exposeApi: exposeApi,
tools: tools
}
).appendTo(row);
}
@@ -525,12 +536,18 @@ RED.utils = (function() {
}
} else if (typeof obj === 'object') {
element.addClass('collapsed');
var keys = Object.keys(obj);
var data = obj;
var type = "object";
if (data.__enc__) {
data = data.data;
type = obj.type.toLowerCase();
}
var keys = Object.keys(data);
if (key || keys.length > 0) {
$('<i class="fa fa-caret-right red-ui-debug-msg-object-handle"></i> ').prependTo(header);
makeExpandable(header, function() {
if (!key) {
$('<span class="red-ui-debug-msg-type-meta red-ui-debug-msg-object-type-header"></span>').text('object').appendTo(header);
$('<span class="red-ui-debug-msg-type-meta red-ui-debug-msg-object-type-header"></span>').text(type).appendTo(header);
}
for (i=0;i<keys.length;i++) {
var row = $('<div class="red-ui-debug-msg-object-entry collapsed"></div>').appendTo(element);
@@ -543,7 +560,7 @@ RED.utils = (function() {
}
}
subElements[newPath] = buildMessageElement(
obj[keys[i]],
data[keys[i]],
{
key: keys[i],
typeHint: false,
@@ -553,8 +570,8 @@ RED.utils = (function() {
rootPath: rootPath,
expandPaths: expandPaths,
ontoggle: ontoggle,
exposeApi: exposeApi
exposeApi: exposeApi,
tools: tools
}
).appendTo(row);
}
@@ -566,7 +583,7 @@ RED.utils = (function() {
checkExpanded(strippedKey,expandPaths));
}
if (key) {
$('<span class="red-ui-debug-msg-type-meta"></span>').text('object').appendTo(entryObj);
$('<span class="red-ui-debug-msg-type-meta"></span>').text(type).appendTo(entryObj);
} else {
headerHead = $('<span class="red-ui-debug-msg-object-header"></span>').appendTo(entryObj);
$('<span>{ </span>').appendTo(headerHead);
@@ -574,7 +591,7 @@ RED.utils = (function() {
for (i=0;i<keysLength;i++) {
$('<span class="red-ui-debug-msg-object-key"></span>').text(keys[i]).appendTo(headerHead);
$('<span>: </span>').appendTo(headerHead);
buildMessageSummaryValue(obj[keys[i]]).appendTo(headerHead);
buildMessageSummaryValue(data[keys[i]]).appendTo(headerHead);
if (i < keysLength-1) {
$('<span>, </span>').appendTo(headerHead);
}
@@ -856,6 +873,7 @@ RED.utils = (function() {
obj[key] = value;
}
}
function separateIconPath(icon) {
var result = {module: "", file: ""};
if (icon) {
@@ -863,10 +881,10 @@ RED.utils = (function() {
if (index === 0) {
icon = icon.substring((RED.settings.apiRootUrl+'icons/').length);
}
index = icon.indexOf('/');
if (index !== -1) {
result.module = icon.slice(0, index);
result.file = icon.slice(index + 1);
var match = /^((?:@[^/]+\/)?[^/]+)\/(.*)$/.exec(icon);
if (match) {
result.module = match[1];
result.file = match[2];
} else {
result.file = icon;
}
@@ -875,6 +893,7 @@ RED.utils = (function() {
}
function getDefaultNodeIcon(def,node) {
def = def || {};
var icon_url;
if (node && node.type === "subflow") {
icon_url = "node-red/subflow.svg";
@@ -912,6 +931,7 @@ RED.utils = (function() {
}
function getNodeIcon(def,node) {
def = def || {};
if (node && node.type === '_selection_') {
return "font-awesome/fa-object-ungroup";
} else if (node && node.type === 'group') {
@@ -999,6 +1019,7 @@ RED.utils = (function() {
}
function getNodeColor(type, def) {
def = def || {};
var result = def.color;
var paletteTheme = RED.settings.theme('palette.theme') || [];
if (paletteTheme.length > 0) {
@@ -1051,7 +1072,7 @@ RED.utils = (function() {
payload = Infinity;
} else if ((format === 'number') && (payload === "-Infinity")) {
payload = -Infinity;
} else if (format === 'Object' || /^array/.test(format) || format === 'boolean' || format === 'number' ) {
} else if (format === 'Object' || /^(array|set|map)/.test(format) || format === 'boolean' || format === 'number' ) {
payload = JSON.parse(payload);
} else if (/error/i.test(format)) {
payload = JSON.parse(payload);
@@ -1070,7 +1091,7 @@ RED.utils = (function() {
return payload;
}
function parseContextKey(key) {
function parseContextKey(key, defaultStore) {
var parts = {};
var m = /^#:\((\S+?)\)::(.*)$/.exec(key);
if (m) {
@@ -1078,7 +1099,9 @@ RED.utils = (function() {
parts.key = m[2];
} else {
parts.key = key;
if (RED.settings.context) {
if (defaultStore) {
parts.store = defaultStore;
} else if (RED.settings.context) {
parts.store = RED.settings.context.default;
}
}
@@ -1123,9 +1146,11 @@ RED.utils = (function() {
imageIconElement.css("backgroundImage", "url("+iconUrl+")");
}
function createNodeIcon(node) {
function createNodeIcon(node, includeLabel) {
var container = $('<span class="red-ui-node-icon-container">');
var def = node._def;
var nodeDiv = $('<div>',{class:"red-ui-search-result-node"})
var nodeDiv = $('<div>',{class:"red-ui-node-icon"})
if (node.type === "_selection_") {
nodeDiv.addClass("red-ui-palette-icon-selection");
} else if (node.type === "group") {
@@ -1145,9 +1170,20 @@ RED.utils = (function() {
}
var icon_url = RED.utils.getNodeIcon(def,node);
var iconContainer = $('<div/>',{class:"red-ui-palette-icon-container"}).appendTo(nodeDiv);
RED.utils.createIconElement(icon_url, iconContainer, true);
return nodeDiv;
RED.utils.createIconElement(icon_url, nodeDiv, true);
nodeDiv.appendTo(container);
if (includeLabel) {
var labelText = RED.utils.getNodeLabel(node,node.name || (node.type+": "+node.id));
var label = $('<div>',{class:"red-ui-node-label"}).appendTo(container);
if (labelText) {
label.text(labelText)
} else {
label.html("&nbsp;")
}
}
return container;
}
function getDarkerColor(c) {
@@ -1232,6 +1268,23 @@ RED.utils = (function() {
}
return false;
}
function getBrowserInfo() {
var r = {}
try {
var ua = navigator.userAgent;
r.ua = ua;
r.browser = /Edge\/\d+/.test(ua) ? 'ed' : /MSIE 9/.test(ua) ? 'ie9' : /MSIE 10/.test(ua) ? 'ie10' : /MSIE 11/.test(ua) ? 'ie11' : /MSIE\s\d/.test(ua) ? 'ie?' : /rv\:11/.test(ua) ? 'ie11' : /Firefox\W\d/.test(ua) ? 'ff' : /Chrom(e|ium)\W\d|CriOS\W\d/.test(ua) ? 'gc' : /\bSafari\W\d/.test(ua) ? 'sa' : /\bOpera\W\d/.test(ua) ? 'op' : /\bOPR\W\d/i.test(ua) ? 'op' : typeof MSPointerEvent !== 'undefined' ? 'ie?' : '';
r.os = /Windows NT 10/.test(ua) ? "win10" : /Windows NT 6\.0/.test(ua) ? "winvista" : /Windows NT 6\.1/.test(ua) ? "win7" : /Windows NT 6\.\d/.test(ua) ? "win8" : /Windows NT 5\.1/.test(ua) ? "winxp" : /Windows NT [1-5]\./.test(ua) ? "winnt" : /Mac/.test(ua) ? "mac" : /Linux/.test(ua) ? "linux" : /X11/.test(ua) ? "nix" : "";
r.touch = 'ontouchstart' in document.documentElement;
r.mobile = /IEMobile|Windows Phone|Lumia/i.test(ua) ? 'w' : /iPhone|iP[oa]d/.test(ua) ? 'i' : /Android/.test(ua) ? 'a' : /BlackBerry|PlayBook|BB10/.test(ua) ? 'b' : /Mobile Safari/.test(ua) ? 's' : /webOS|Mobile|Tablet|Opera Mini|\bCrMo\/|Opera Mobi/i.test(ua) ? 1 : 0;
r.tablet = /Tablet|iPad/i.test(ua);
r.ie = /MSIE \d|Trident.*rv:/.test(navigator.userAgent);
r.android = /android/i.test(navigator.userAgent);
} catch (error) { }
return r;
}
return {
createObjectElement: buildMessageElement,
getMessageProperty: getMessageProperty,
@@ -1253,6 +1306,7 @@ RED.utils = (function() {
createNodeIcon: createNodeIcon,
getDarkerColor: getDarkerColor,
parseModuleList: parseModuleList,
checkModuleAllowed: checkModuleAllowed
checkModuleAllowed: checkModuleAllowed,
getBrowserInfo: getBrowserInfo
}
})();

View File

@@ -0,0 +1,151 @@
RED.view.annotations = (function() {
var annotations = {};
function init() {
RED.hooks.add("viewRedrawNode.annotations", function(evt) {
try {
if (evt.node.__pendingAnnotation__) {
addAnnotation(evt.node.__pendingAnnotation__,evt);
delete evt.node.__pendingAnnotation__;
}
var badgeDX = 0;
var controlDX = 0;
for (var i=0,l=evt.el.__annotations__.length;i<l;i++) {
var annotation = evt.el.__annotations__[i];
if (annotations.hasOwnProperty(annotation.id)) {
var opts = annotations[annotation.id];
var showAnnotation = true;
var isBadge = opts.type === 'badge';
if (opts.show !== undefined) {
if (typeof opts.show === "string") {
showAnnotation = !!evt.node[opts.show]
} else if (typeof opts.show === "function"){
showAnnotation = opts.show(evt.node)
} else {
showAnnotation = !!opts.show;
}
annotation.element.classList.toggle("hide", !showAnnotation);
}
if (isBadge) {
if (showAnnotation) {
var rect = annotation.element.getBoundingClientRect();
badgeDX += rect.width;
annotation.element.setAttribute("transform", "translate("+(evt.node.w-3-badgeDX)+", -8)");
badgeDX += 4;
}
} else {
if (showAnnotation) {
var rect = annotation.element.getBoundingClientRect();
annotation.element.setAttribute("transform", "translate("+(3+controlDX)+", -12)");
controlDX += rect.width + 4;
}
}
} else {
annotation.element.parentNode.removeChild(annotation.element);
evt.el.__annotations__.splice(i,1);
i--;
l--;
}
}
}catch(err) {
console.log(err)
}
});
}
/**
* Register a new node annotation
* @param {string} id - unique identifier
* @param {type} opts - annotations options
*
* opts: {
* type: "badge"
* class: "",
* element: function(node),
* show: string|function(node),
* filter: function(node) -> boolean
* }
*/
function register(id, opts) {
if (opts.type !== 'badge') {
throw new Error("Unsupported annotation type: "+opts.type);
}
annotations[id] = opts
RED.hooks.add("viewAddNode.annotation-"+id, function(evt) {
if (opts.filter && !opts.filter(evt.node)) {
return;
}
addAnnotation(id,evt);
});
var nodes = RED.view.getActiveNodes();
nodes.forEach(function(n) {
n.__pendingAnnotation__ = id;
})
RED.view.redraw();
}
function addAnnotation(id,evt) {
var opts = annotations[id];
evt.el.__annotations__ = evt.el.__annotations__ || [];
var annotationGroup = document.createElementNS("http://www.w3.org/2000/svg","g");
annotationGroup.setAttribute("class",opts.class || "");
evt.el.__annotations__.push({
id:id,
element: annotationGroup
});
var annotation = opts.element(evt.node);
if (opts.tooltip) {
annotation.addEventListener("mouseenter", getAnnotationMouseEnter(annotation,evt.node,opts.tooltip));
annotation.addEventListener("mouseleave", annotationMouseLeave);
}
annotationGroup.appendChild(annotation);
evt.el.appendChild(annotationGroup);
}
function unregister(id) {
delete annotations[id]
RED.hooks.remove("*.annotation-"+id);
RED.view.redraw();
}
var badgeHoverTimeout;
var badgeHover;
function getAnnotationMouseEnter(annotation,node,tooltip) {
return function() {
var text = typeof tooltip === "function"?tooltip(node):tooltip;
if (text) {
clearTimeout(badgeHoverTimeout);
badgeHoverTimeout = setTimeout(function() {
var pos = RED.view.getElementPosition(annotation);
var rect = annotation.getBoundingClientRect();
badgeHoverTimeout = null;
badgeHover = RED.view.showTooltip(
(pos[0]+rect.width/2),
(pos[1]),
text,
"top"
);
},500);
}
}
}
function annotationMouseLeave() {
clearTimeout(badgeHoverTimeout);
if (badgeHover) {
badgeHover.remove();
badgeHover = null;
}
}
return {
init: init,
register:register,
unregister:unregister
}
})();

View File

@@ -201,6 +201,237 @@ RED.view.tools = (function() {
}
function selectFirstNode() {
var canidates;
var origin = {x:0, y:0};
var activeGroup = RED.view.getActiveGroup();
if (!activeGroup) {
candidates = RED.view.getActiveNodes();
} else {
candidates = RED.group.getNodes(activeGroup,false);
origin = activeGroup;
}
var distances = [];
candidates.forEach(function(node) {
var deltaX = node.x - origin.x;
var deltaY = node.y - origin.x;
var delta = deltaY*deltaY + deltaX*deltaX;
distances.push({node: node, delta: delta})
});
if (distances.length > 0) {
distances.sort(function(A,B) {
return A.delta - B.delta
})
var newNode = distances[0].node;
if (newNode) {
RED.view.select({nodes:[newNode]});
RED.view.reveal(newNode.id,false);
}
}
}
function gotoNextNode() {
var selection = RED.view.selection();
if (selection.nodes && selection.nodes.length === 1) {
var origin = selection.nodes[0];
var links = RED.nodes.filterLinks({source:origin});
if (links.length > 0) {
links.sort(function(A,B) {
return Math.abs(A.target.y - origin.y) - Math.abs(B.target.y - origin.y)
})
var newNode = links[0].target;
if (newNode) {
RED.view.select({nodes:[newNode]});
RED.view.reveal(newNode.id,false);
}
}
} else if (RED.workspaces.selection().length === 0) {
selectFirstNode();
}
}
function gotoPreviousNode() {
var selection = RED.view.selection();
if (selection.nodes && selection.nodes.length === 1) {
var origin = selection.nodes[0];
var links = RED.nodes.filterLinks({target:origin});
if (links.length > 0) {
links.sort(function(A,B) {
return Math.abs(A.source.y - origin.y) - Math.abs(B.source.y - origin.y)
})
var newNode = links[0].source;
if (newNode) {
RED.view.select({nodes:[newNode]});
RED.view.reveal(newNode.id,false);
}
}
} else if (RED.workspaces.selection().length === 0) {
selectFirstNode();
}
}
function getChildren(node) {
return RED.nodes.filterLinks({source:node}).map(function(l) { return l.target})
}
function getParents(node) {
return RED.nodes.filterLinks({target:node}).map(function(l) { return l.source})
}
function getSiblings(node) {
var siblings = new Set();
var parents = getParents(node);
parents.forEach(function(p) {
getChildren(p).forEach(function(c) { siblings.add(c) })
});
var children = getChildren(node);
children.forEach(function(p) {
getParents(p).forEach(function(c) { siblings.add(c) })
});
siblings.delete(node);
return Array.from(siblings);
}
function gotoNextSibling() {
// 'next' defined as nearest on the y-axis below this node
var selection = RED.view.selection();
if (selection.nodes && selection.nodes.length === 1) {
var origin = selection.nodes[0];
var siblings = getSiblings(origin);
if (siblings.length > 0) {
siblings = siblings.filter(function(n) { return n.y > origin. y})
siblings.sort(function(A,B) {
return Math.abs(A.y - origin.y) - Math.abs(B.y - origin.y)
})
var newNode = siblings[0];
if (newNode) {
RED.view.select({nodes:[newNode]});
RED.view.reveal(newNode.id,false);
}
}
} else if (RED.workspaces.selection().length === 0) {
selectFirstNode();
}
}
function gotoPreviousSibling() {
// 'next' defined as nearest on the y-axis above this node
var selection = RED.view.selection();
if (selection.nodes && selection.nodes.length === 1) {
var origin = selection.nodes[0];
var siblings = getSiblings(origin);
if (siblings.length > 0) {
siblings = siblings.filter(function(n) { return n.y < origin. y})
siblings.sort(function(A,B) {
return Math.abs(A.y - origin.y) - Math.abs(B.y - origin.y)
})
var newNode = siblings[0];
if (newNode) {
RED.view.select({nodes:[newNode]});
RED.view.reveal(newNode.id,false);
}
}
} else if (RED.workspaces.selection().length === 0) {
selectFirstNode();
}
}
function addNode() {
var selection = RED.view.selection();
if (selection.nodes && selection.nodes.length === 1 && selection.nodes[0].outputs > 0) {
var selectedNode = selection.nodes[0];
RED.view.showQuickAddDialog([
selectedNode.x + selectedNode.w + 50,selectedNode.y
])
} else {
RED.view.showQuickAddDialog();
}
}
function gotoNearestNode(direction) {
var selection = RED.view.selection();
if (selection.nodes && selection.nodes.length === 1) {
var origin = selection.nodes[0];
var candidates = RED.nodes.filterNodes({z:origin.z});
candidates = candidates.concat(RED.view.getSubflowPorts());
var distances = [];
candidates.forEach(function(node) {
if (node === origin) {
return;
}
var deltaX = node.x - origin.x;
var deltaY = node.y - origin.y;
var delta = deltaY*deltaY + deltaX*deltaX;
var angle = (180/Math.PI)*Math.atan2(deltaY,deltaX);
if (angle < 0) { angle += 360 }
if (angle > 360) { angle -= 360 }
var weight;
// 0 - right
// 270 - above
// 90 - below
// 180 - left
switch(direction) {
case 'up': if (angle < 210 || angle > 330) { return }
weight = Math.max(Math.abs(270 - angle)/60, 0.2);
break;
case 'down': if (angle < 30 || angle > 150) { return }
weight = Math.max(Math.abs(90 - angle)/60, 0.2);
break;
case 'left': if (angle < 140 || angle > 220) { return }
weight = Math.max(Math.abs(180 - angle)/40, 0.1 );
break;
case 'right': if (angle > 40 && angle < 320) { return }
weight = Math.max(Math.abs(angle)/40, 0.1);
break;
}
weight = Math.max(weight,0.1);
distances.push({
node: node,
d: delta,
w: weight,
delta: delta*weight
})
})
if (distances.length > 0) {
distances.sort(function(A,B) {
return A.delta - B.delta
})
var newNode = distances[0].node;
if (newNode) {
RED.view.select({nodes:[newNode]});
RED.view.reveal(newNode.id,false);
}
}
} else if (RED.workspaces.selection().length === 0) {
var candidates = RED.view.getActiveNodes();
var distances = [];
candidates.forEach(function(node) {
var deltaX = node.x;
var deltaY = node.y;
var delta = deltaY*deltaY + deltaX*deltaX;
distances.push({node: node, delta: delta})
});
if (distances.length > 0) {
distances.sort(function(A,B) {
return A.delta - B.delta
})
var newNode = distances[0].node;
if (newNode) {
RED.view.select({nodes:[newNode]});
RED.view.reveal(newNode.id,false);
}
}
}
}
return {
init: function() {
RED.actions.add("core:show-selected-node-labels", function() { setSelectedNodeLabelState(true); })
@@ -231,6 +462,19 @@ RED.view.tools = (function() {
RED.actions.add("core:select-connected-nodes", function() { selectConnected("all") });
RED.actions.add("core:select-downstream-nodes", function() { selectConnected("down") });
RED.actions.add("core:select-upstream-nodes", function() { selectConnected("up") });
RED.actions.add("core:go-to-next-node", function() { gotoNextNode() })
RED.actions.add("core:go-to-previous-node", function() { gotoPreviousNode() })
RED.actions.add("core:go-to-next-sibling", function() { gotoNextSibling() })
RED.actions.add("core:go-to-previous-sibling", function() { gotoPreviousSibling() })
RED.actions.add("core:go-to-nearest-node-on-left", function() { gotoNearestNode('left')})
RED.actions.add("core:go-to-nearest-node-on-right", function() { gotoNearestNode('right')})
RED.actions.add("core:go-to-nearest-node-above", function() { gotoNearestNode('up') })
RED.actions.add("core:go-to-nearest-node-below", function() { gotoNearestNode('down') })
// RED.actions.add("core:add-node", function() { addNode() })
},
/**
* Aligns all selected nodes to the current grid

View File

@@ -86,7 +86,7 @@ RED.view = (function() {
var quickAddLink = null;
var showAllLinkPorts = -1;
var groupNodeSelectPrimed = false;
var lastClickPosition = [];
var selectNodesOptions;
var clipboard = "";
@@ -503,9 +503,21 @@ RED.view = (function() {
RED.actions.add("core:paste-from-internal-clipboard",function(){importNodes(clipboard,{generateIds: true});});
RED.actions.add("core:delete-selection",deleteSelection);
RED.actions.add("core:edit-selected-node",editSelection);
RED.actions.add("core:go-to-selection",function() {
if (movingSet.length() > 0) {
var node = movingSet.get(0).n;
if (/^subflow:/.test(node.type)) {
RED.workspaces.show(node.type.substring(8))
} else if (node.type === 'group') {
enterActiveGroup(node);
redraw();
}
}
});
RED.actions.add("core:undo",RED.history.pop);
RED.actions.add("core:redo",RED.history.redo);
RED.actions.add("core:select-all-nodes",selectAll);
RED.actions.add("core:select-none", selectNone);
RED.actions.add("core:zoom-in",zoomIn);
RED.actions.add("core:zoom-out",zoomOut);
RED.actions.add("core:zoom-reset",zoomZero);
@@ -534,10 +546,44 @@ RED.view = (function() {
}
});
RED.view.annotations.init();
RED.view.navigator.init();
RED.view.tools.init();
RED.view.annotations.register("red-ui-flow-node-changed",{
type: "badge",
class: "red-ui-flow-node-changed",
element: function() {
var changeBadge = document.createElementNS("http://www.w3.org/2000/svg","circle");
changeBadge.setAttribute("cx",5);
changeBadge.setAttribute("cy",5);
changeBadge.setAttribute("r",5);
return changeBadge;
},
show: function(n) { return n.changed||n.moved }
})
RED.view.annotations.register("red-ui-flow-node-error",{
type: "badge",
class: "red-ui-flow-node-error",
element: function(d) {
var errorBadge = document.createElementNS("http://www.w3.org/2000/svg","path");
errorBadge.setAttribute("d","M 0,9 l 10,0 -5,-8 z");
return errorBadge
},
tooltip: function(d) {
if (d.validationErrors && d.validationErrors.length > 0) {
return RED._("editor.errors.invalidProperties")+"\n - "+d.validationErrors.join("\n - ")
}
},
show: function(n) { return !n.valid }
})
}
function updateGrid() {
var gridTicks = [];
for (var i=0;i<space_width;i+=+gridSize) {
@@ -848,7 +894,7 @@ RED.view = (function() {
if (drag_lines.length > 0) {
clickedGroup = clickedGroup || RED.nodes.group(drag_lines[0].node.g)
}
showQuickAddDialog(point, null, clickedGroup);
showQuickAddDialog({position:point, group:clickedGroup});
}
}
if (mouse_mode === 0 && !(d3.event.metaKey || d3.event.ctrlKey)) {
@@ -869,7 +915,13 @@ RED.view = (function() {
}
}
function showQuickAddDialog(point, spliceLink, targetGroup, touchTrigger) {
function showQuickAddDialog(options) {
options = options || {};
var point = options.position || lastClickPosition;
var spliceLink = options.splice;
var targetGroup = options.group;
var touchTrigger = options.touchTrigger;
if (targetGroup && !targetGroup.active) {
selectGroup(targetGroup,false);
enterActiveGroup(targetGroup);
@@ -1458,15 +1510,15 @@ RED.view = (function() {
var mouseY = node.n.y;
if (outer[0][0].getIntersectionList) {
var svgRect = outer[0][0].createSVGRect();
svgRect.x = mouseX;
svgRect.y = mouseY;
svgRect.x = mouseX*scaleFactor;
svgRect.y = mouseY*scaleFactor;
svgRect.width = 1;
svgRect.height = 1;
nodes = outer[0][0].getIntersectionList(svgRect, outer[0][0]);
} else {
// Firefox doesn"t do getIntersectionList and that
// makes us sad
nodes = RED.view.getLinksAtPoint(mouseX,mouseY);
nodes = RED.view.getLinksAtPoint(mouseX*scaleFactor,mouseY*scaleFactor);
}
for (var i=0;i<nodes.length;i++) {
if (d3.select(nodes[i]).classed("red-ui-flow-link-background")) {
@@ -1522,6 +1574,7 @@ RED.view = (function() {
}
function canvasMouseUp() {
lastClickPosition = [d3.event.offsetX/scaleFactor,d3.event.offsetY/scaleFactor];
if (RED.view.DEBUG) { console.warn("canvasMouseUp", mouse_mode); }
var i;
var historyEvent;
@@ -1591,7 +1644,6 @@ RED.view = (function() {
if (n.x > x && n.x < x2 && n.y > y && n.y < y2) {
if (!activeGroup || RED.group.contains(activeGroup,n)) {
if (n.g && (!activeGroup || n.g !== activeGroup.id)) {
console.log("HERE")
var group = RED.nodes.group(n.g);
while (group.g && (!activeGroup || group.g !== activeGroup.id)) {
group = RED.nodes.group(group.g);
@@ -1733,7 +1785,6 @@ RED.view = (function() {
}
}
if (mouse_mode == RED.state.IMPORT_DRAGGING) {
RED.keyboard.remove("escape");
updateActiveNodes();
RED.nodes.dirty(true);
}
@@ -1767,7 +1818,21 @@ RED.view = (function() {
redraw();
}
function selectNone() {
if (mouse_mode === RED.state.MOVING || mouse_mode === RED.state.MOVING_ACTIVE) {
return;
}
if (mouse_mode === RED.state.IMPORT_DRAGGING) {
clearSelection();
RED.history.pop();
mouse_mode = 0;
} else if (activeGroup) {
exitActiveGroup()
} else {
clearSelection();
}
redraw();
}
function selectAll() {
if (mouse_mode === RED.state.SELECTING_NODE && selectNodesOptions.single) {
return;
@@ -2304,6 +2369,7 @@ RED.view = (function() {
var textDimensionPlaceholder = {};
var textDimensionCache = {};
function calculateTextDimensions(str,className) {
var cacheKey = "!"+str;
if (!textDimensionPlaceholder[className]) {
textDimensionPlaceholder[className] = document.createElement("span");
textDimensionPlaceholder[className].className = className;
@@ -2312,15 +2378,15 @@ RED.view = (function() {
document.getElementById("red-ui-editor").appendChild(textDimensionPlaceholder[className]);
textDimensionCache[className] = {};
} else {
if (textDimensionCache[className][str]) {
return textDimensionCache[className][str]
if (textDimensionCache[className][cacheKey]) {
return textDimensionCache[className][cacheKey]
}
}
textDimensionPlaceholder[className].textContent = (str||"");
var w = textDimensionPlaceholder[className].offsetWidth;
var h = textDimensionPlaceholder[className].offsetHeight;
textDimensionCache[className][str] = [w,h];
return textDimensionCache[className][str];
textDimensionCache[className][cacheKey] = [w,h];
return textDimensionCache[className][cacheKey];
}
function convertLineBreakCharacter(str) {
@@ -2809,7 +2875,11 @@ RED.view = (function() {
if (dblClickPrimed && mousedown_node == d && clickElapsed > 0 && clickElapsed < dblClickInterval) {
mouse_mode = RED.state.DEFAULT;
if (d.type != "subflow") {
RED.editor.edit(d);
if (/^subflow:/.test(d.type) && (d3.event.ctrlKey || d3.event.metaKey)) {
RED.workspaces.show(d.type.substring(8));
} else {
RED.editor.edit(d);
}
} else {
RED.editor.editSubflow(activeSubflow);
}
@@ -2874,7 +2944,6 @@ RED.view = (function() {
//var pos = [touch0.pageX,touch0.pageY];
//RED.touch.radialMenu.show(d3.select(this),pos);
if (mouse_mode == RED.state.IMPORT_DRAGGING) {
RED.keyboard.remove("escape");
var historyEvent = RED.history.peek();
if (activeSpliceLink) {
// TODO: DRY - droppable/nodeMouseDown/canvasMouseUp
@@ -2952,7 +3021,7 @@ RED.view = (function() {
clickTime = now;
dblClickPrimed = (lastClickNode == mousedown_node &&
(d3.event.touches || d3.event.button === 0) &&
!d3.event.shiftKey && !d3.event.metaKey && !d3.event.altKey && !d3.event.ctrlKey &&
!d3.event.shiftKey && !d3.event.altKey &&
clickElapsed < dblClickInterval
)
lastClickNode = mousedown_node;
@@ -3081,7 +3150,7 @@ RED.view = (function() {
// } else
if (d3.event.shiftKey) {
clearSelection();
var clickPosition = (d3.event.offsetX - mousedown_node.x)
var clickPosition = (d3.event.offsetX/scaleFactor - mousedown_node.x)
var edgeDelta = (mousedown_node.w/2) - Math.abs(clickPosition);
var cnodes;
var targetEdgeDelta = mousedown_node.w > 30 ? 25 : 8;
@@ -3245,7 +3314,7 @@ RED.view = (function() {
d3.select(this).classed("red-ui-flow-link-splice",true);
var point = d3.mouse(this);
var clickedGroup = getGroupAt(point[0],point[1]);
showQuickAddDialog(point, selected_link, clickedGroup);
showQuickAddDialog({position:point, splice:selected_link, group:clickedGroup});
}
}
function linkTouchStart(d) {
@@ -3291,9 +3360,8 @@ RED.view = (function() {
if (d3.event.button === 1) {
return;
}
if (mouse_mode == RED.state.IMPORT_DRAGGING) {
RED.keyboard.remove("escape");
} else if (mouse_mode == RED.state.QUICK_JOINING) {
if (mouse_mode == RED.state.QUICK_JOINING) {
d3.event.stopPropagation();
return;
} else if (mouse_mode === RED.state.SELECTING_NODE) {
@@ -3412,6 +3480,7 @@ RED.view = (function() {
}
}
function getGroupAt(x,y) {
// x,y expected to be in node-co-ordinate space
var candidateGroups = {};
for (var i=0;i<activeGroups.length;i++) {
var g = activeGroups[i];
@@ -3500,7 +3569,10 @@ RED.view = (function() {
options.push({name:"undo",disabled:(RED.history.depth() === 0),onselect:function() {RED.history.pop();}});
options.push({name:"add",onselect:function() {
chartPos = chart.offset();
showQuickAddDialog([pos[0]-chartPos.left+chart.scrollLeft(),pos[1]-chartPos.top+chart.scrollTop()],undefined,undefined,true)
showQuickAddDialog({
position:[pos[0]-chartPos.left+chart.scrollLeft(),pos[1]-chartPos.top+chart.scrollTop()],
touchTrigger:true
})
}});
RED.touch.radialMenu.show(obj,pos,options);
@@ -3560,31 +3632,6 @@ RED.view = (function() {
}
}
function errorBadgeMouseEnter(e) {
var d = this.__data__;
if (d.validationErrors && d.validationErrors.length > 0) {
clearTimeout(portLabelHoverTimeout);
var node = this;
portLabelHoverTimeout = setTimeout(function() {
var pos = getElementPosition(node);
portLabelHoverTimeout = null;
portLabelHover = showTooltip(
(pos[0]),
(pos[1]),
RED._("editor.errors.invalidProperties")+"\n - "+d.validationErrors.join("\n - "),
"top"
);
},500);
}
}
function errorBadgeMouseLeave() {
clearTimeout(portLabelHoverTimeout);
if (portLabelHover) {
portLabelHover.remove();
portLabelHover = null;
}
}
function redrawStatus(d,nodeEl) {
if (d.z !== RED.workspaces.active()) {
return;
@@ -3752,7 +3799,9 @@ RED.view = (function() {
}
var node = nodeLayer.selectAll(".red-ui-flow-node-group").data(activeNodes,function(d){return d.id});
node.exit().remove();
node.exit().each(function(d,i) {
RED.hooks.trigger("viewRemoveNode",{node:d,el:this})
}).remove();
var nodeEnter = node.enter().insert("svg:g")
.attr("class", "red-ui-flow-node red-ui-flow-node-group")
@@ -3899,33 +3948,14 @@ RED.view = (function() {
nodeContents.appendChild(statusEl);
var changeBadgeG = document.createElementNS("http://www.w3.org/2000/svg","g");
changeBadgeG.setAttribute("class","red-ui-flow-node-changed hide");
changeBadgeG.setAttribute("transform","translate(20, -2)");
node[0][0].__changeBadge__ = changeBadgeG;
var changeBadge = document.createElementNS("http://www.w3.org/2000/svg","circle");
changeBadge.setAttribute("r",5);
changeBadgeG.appendChild(changeBadge);
nodeContents.appendChild(changeBadgeG);
var errorBadgeG = document.createElementNS("http://www.w3.org/2000/svg","g");
errorBadgeG.setAttribute("class","red-ui-flow-node-error hide");
errorBadgeG.setAttribute("transform","translate(0, -2)");
node[0][0].__errorBadge__ = errorBadgeG;
var errorBadge = document.createElementNS("http://www.w3.org/2000/svg","path");
errorBadge.setAttribute("d","M -5,4 l 10,0 -5,-8 z");
errorBadgeG.appendChild(errorBadge);
errorBadge.__data__ = d;
errorBadge.addEventListener("mouseenter", errorBadgeMouseEnter);
errorBadge.addEventListener("mouseleave", errorBadgeMouseLeave);
nodeContents.appendChild(errorBadgeG);
node[0][0].appendChild(nodeContents);
RED.hooks.trigger("viewAddNode",{node:d,el:this})
});
node.each(function(d,i) {
if (d.dirty) {
var self = this;
var thisNode = d3.select(this);
var isLink = (d.type === "link in" || d.type === "link out")
@@ -4036,7 +4066,15 @@ RED.view = (function() {
var inputPorts = thisNode.selectAll(".red-ui-flow-port-input");
if ((!isLink || (showAllLinkPorts === -1 && !activeLinkNodes[d.id])) && d.inputs === 0 && !inputPorts.empty()) {
inputPorts.remove();
inputPorts.each(function(d,i) {
RED.hooks.trigger("viewRemovePort",{
node:d,
el:self,
port:d3.select(this)[0][0],
portType: "input",
portIndex: 0
})
}).remove();
} else if (((isLink && (showAllLinkPorts===PORT_TYPE_INPUT||activeLinkNodes[d.id]))|| d.inputs === 1) && inputPorts.empty()) {
var inputGroup = thisNode.append("g").attr("class","red-ui-flow-port-input");
var inputGroupPorts;
@@ -4049,12 +4087,17 @@ RED.view = (function() {
} else {
inputGroupPorts = inputGroup.append("rect").attr("class","red-ui-flow-port").attr("rx",3).attr("ry",3).attr("width",10).attr("height",10)
}
inputGroup[0][0].__port__ = inputGroupPorts[0][0];
inputGroupPorts[0][0].__data__ = this.__data__;
inputGroupPorts[0][0].__portType__ = PORT_TYPE_INPUT;
inputGroupPorts[0][0].__portIndex__ = 0;
inputGroupPorts.on("mousedown",function(d){portMouseDown(d,PORT_TYPE_INPUT,0);})
.on("touchstart",function(d){portMouseDown(d,PORT_TYPE_INPUT,0);d3.event.preventDefault();})
.on("mouseup",function(d){portMouseUp(d,PORT_TYPE_INPUT,0);} )
.on("touchend",function(d){portMouseUp(d,PORT_TYPE_INPUT,0);d3.event.preventDefault();} )
.on("mouseover",function(d){portMouseOver(d3.select(this),d,PORT_TYPE_INPUT,0);})
.on("mouseout",function(d) {portMouseOut(d3.select(this),d,PORT_TYPE_INPUT,0);});
RED.hooks.trigger("viewAddPort",{node:d,el: this, port: inputGroup[0][0], portType: "input", portIndex: 0})
}
var numOutputs = d.outputs;
if (isLink && d.type === "link out") {
@@ -4069,6 +4112,13 @@ RED.view = (function() {
// Remove extra ports
while (this.__outputs__.length > numOutputs) {
var port = this.__outputs__.pop();
RED.hooks.trigger("viewRemovePort",{
node:d,
el:this,
port:port,
portType: "output",
portIndex: this.__outputs__.length
})
port.remove();
}
for(var portIndex = 0; portIndex < numOutputs; portIndex++ ) {
@@ -4092,6 +4142,7 @@ RED.view = (function() {
portPort.setAttribute("class","red-ui-flow-port");
}
portGroup.appendChild(portPort);
portGroup.__port__ = portPort;
portPort.__data__ = this.__data__;
portPort.__portType__ = PORT_TYPE_OUTPUT;
portPort.__portIndex__ = portIndex;
@@ -4104,6 +4155,7 @@ RED.view = (function() {
this.appendChild(portGroup);
this.__outputs__.push(portGroup);
RED.hooks.trigger("viewAddPort",{node:d,el: this, port: portGroup, portType: "output", portIndex: portIndex})
} else {
portGroup = this.__outputs__[portIndex];
}
@@ -4140,10 +4192,10 @@ RED.view = (function() {
);
faIcon.attr("y",(d.h+13)/2);
}
this.__changeBadge__.setAttribute("transform", "translate("+(d.w-10)+", -2)");
this.__changeBadge__.classList.toggle("hide", !(d.changed||d.moved));
this.__errorBadge__.setAttribute("transform", "translate("+(d.w-10-((d.changed||d.moved)?14:0))+", -2)");
this.__errorBadge__.classList.toggle("hide", d.valid);
// this.__changeBadge__.setAttribute("transform", "translate("+(d.w-10)+", -2)");
// this.__changeBadge__.classList.toggle("hide", !(d.changed||d.moved));
// this.__errorBadge__.setAttribute("transform", "translate("+(d.w-10-((d.changed||d.moved)?14:0))+", -2)");
// this.__errorBadge__.classList.toggle("hide", d.valid);
thisNode.selectAll(".red-ui-flow-port-input").each(function(d,i) {
var port = d3.select(this);
@@ -4206,6 +4258,8 @@ RED.view = (function() {
}
}
}
RED.hooks.trigger("viewRedrawNode",{node:d,el:this})
});
var link = linkLayer.selectAll(".red-ui-flow-link").data(
activeLinks,
@@ -4792,12 +4846,7 @@ RED.view = (function() {
}
}
RED.keyboard.add("*","escape",function(){
RED.keyboard.remove("escape");
clearSelection();
RED.history.pop();
mouse_mode = 0;
});
}
var historyEvent = {
@@ -4985,6 +5034,30 @@ RED.view = (function() {
}
return selection;
}
function calculateNodeDimensions(node) {
var result = [node_width,node_height];
try {
var isLink = (node.type === "link in" || node.type === "link out")
var hideLabel = node.hasOwnProperty('l')?!node.l : isLink;
var label = RED.utils.getNodeLabel(node, node.type);
var labelParts = getLabelParts(label, "red-ui-flow-node-label");
if (hideLabel) {
result[1] = Math.max(node_height,(node.outputs || 0) * 15);
} else {
result[1] = Math.max(6+24*labelParts.lines.length,(node.outputs || 0) * 15, 30);
}
if (hideLabel) {
result[0] = node_height;
} else {
result[0] = Math.max(node_width,20*(Math.ceil((labelParts.width+50+(node._def.inputs>0?7:0))/20)) );
}
}catch(err) {
console.log("Error",node);
}
return result;
}
return {
init: init,
state:function(state) {
@@ -5050,6 +5123,9 @@ RED.view = (function() {
return scaleFactor;
},
getLinksAtPoint: function(x,y) {
// x,y must be in SVG co-ordinate space
// if they come from a node.x/y, they will need to be scaled using
// scaleFactor first.
var result = [];
var links = outer.selectAll(".red-ui-flow-link-background")[0];
for (var i=0;i<links.length;i++) {
@@ -5125,6 +5201,18 @@ RED.view = (function() {
getActiveNodes: function() {
return activeNodes;
},
getSubflowPorts: function() {
var result = [];
if (activeSubflow) {
var subflowOutputs = nodeLayer.selectAll(".red-ui-flow-subflow-port-output").data(activeSubflow.out,function(d,i){ return d.id;});
subflowOutputs.each(function(d,i) { result.push(d) })
var subflowInputs = nodeLayer.selectAll(".red-ui-flow-subflow-port-input").data(activeSubflow.in,function(d,i){ return d.id;});
subflowInputs.each(function(d,i) { result.push(d) })
var subflowStatus = nodeLayer.selectAll(".red-ui-flow-subflow-port-status").data(activeSubflow.status?[activeSubflow.status]:[],function(d,i){ return d.id;});
subflowStatus.each(function(d,i) { result.push(d) })
}
return result;
},
selectNodes: function(options) {
$("#red-ui-workspace-tabs-shade").show();
$("#red-ui-palette-shade").show();
@@ -5200,6 +5288,10 @@ RED.view = (function() {
clipboard: function() {
return clipboard
},
redrawStatus: redrawStatus
redrawStatus: redrawStatus,
showQuickAddDialog:showQuickAddDialog,
calculateNodeDimensions: calculateNodeDimensions,
getElementPosition:getElementPosition,
showTooltip:showTooltip
};
})();

View File

@@ -20,6 +20,19 @@ RED.workspaces = (function() {
var activeWorkspace = 0;
var workspaceIndex = 0;
var viewStack = [];
var viewStackPos = 0;
function addToViewStack(id) {
if (viewStackPos !== viewStack.length) {
viewStack.splice(viewStackPos);
}
viewStack.push(id);
viewStackPos = viewStack.length;
// console.warn("addToViewStack",id,viewStack);
}
function addWorkspace(ws,skipHistoryEntry,targetIndex) {
if (ws) {
workspace_tabs.addTab(ws,targetIndex);
@@ -245,6 +258,9 @@ RED.workspaces = (function() {
RED.view.focus();
},
onclick: function(tab) {
if (tab.id !== activeWorkspace) {
addToViewStack(activeWorkspace);
}
RED.view.focus();
},
ondblclick: function(tab) {
@@ -328,8 +344,20 @@ RED.workspaces = (function() {
createWorkspaceTabs();
RED.events.on("sidebar:resize",workspace_tabs.resize);
RED.actions.add("core:show-next-tab",workspace_tabs.nextTab);
RED.actions.add("core:show-previous-tab",workspace_tabs.previousTab);
RED.actions.add("core:show-next-tab",function() {
var oldActive = activeWorkspace;
workspace_tabs.nextTab();
if (oldActive !== activeWorkspace) {
addToViewStack(oldActive)
}
});
RED.actions.add("core:show-previous-tab",function() {
var oldActive = activeWorkspace;
workspace_tabs.previousTab();
if (oldActive !== activeWorkspace) {
addToViewStack(oldActive)
}
});
RED.menu.setAction('menu-item-workspace-delete',function() {
deleteWorkspace(RED.nodes.workspace(activeWorkspace));
@@ -349,6 +377,23 @@ RED.workspaces = (function() {
RED.actions.invoke("core:search","type:tab ");
})
RED.actions.add("core:go-to-previous-location", function() {
if (viewStackPos > 0) {
if (viewStackPos === viewStack.length) {
// We're at the end of the stack. Remember the activeWorkspace
// so we can come back to it.
viewStack.push(activeWorkspace);
}
RED.workspaces.show(viewStack[--viewStackPos],true);
}
})
RED.actions.add("core:go-to-next-location", function() {
if (viewStackPos < viewStack.length - 1) {
RED.workspaces.show(viewStack[++viewStackPos],true);
}
})
hideWorkspace();
}
@@ -444,15 +489,22 @@ RED.workspaces = (function() {
selection: function() {
return workspace_tabs.selection();
},
show: function(id) {
show: function(id,skipStack) {
if (!workspace_tabs.contains(id)) {
var sf = RED.nodes.subflow(id);
if (sf) {
addWorkspace({type:"subflow",id:id,icon:"red/images/subflow_tab.svg",label:sf.name, closeable: true});
addWorkspace(
{type:"subflow",id:id,icon:"red/images/subflow_tab.svg",label:sf.name, closeable: true},
null,
workspace_tabs.activeIndex()+1
);
} else {
return;
}
}
if (!skipStack && activeWorkspace !== id) {
addToViewStack(activeWorkspace)
}
workspace_tabs.activateTab(id);
},
refresh: function() {

View File

@@ -149,7 +149,7 @@ body {
.red-ui-font-code {
font-family: $monospace-font;
font-size: $primary-font-size;
color: $info-text-code-color;
color: $text-color-code;
white-space: nowrap;
}
@@ -158,7 +158,7 @@ body {
font-size: $primary-font-size;
padding: 0px;
margin: 1px;
color: $info-text-code-color;
color: $text-color-code;
white-space: nowrap;
}

View File

@@ -48,15 +48,22 @@ $tertiary-text-color: #aaa;//#90f;
// Heading text
$header-text-color: #444;//#f00;
$text-color-warning: #AD1625;
$text-color-green: #3a3;
$text-color-error: #AD1625;
$text-color-warning: #CAB200;
$text-color-success: #3a3;
$text-color-code: #AD1625;
$text-color-link: #0088cc;
$primary-border-color: #bbbbbb;//#f00;
$secondary-border-color: #dddddd;//#0f0;
$tertiary-border-color: #ccc;//#00f;
$form-background: $secondary-background;
$border-color-error: #DF2935;
$border-color-warning: #FFCF70;
$border-color-success: #4B8400;
$form-background: $secondary-background;
$form-placeholder-color: $tertiary-text-color;
$form-text-color: $primary-text-color;
$form-text-color-disabled: $secondary-text-color-disabled;
@@ -257,16 +264,13 @@ $headerMenuCaret: #C7C7C7;
$vcCommitShaColor: #c38888;
$info-text-code-color: #AD1625;
$info-text-link-color: #0088cc;
$dnd-background: rgba(0,0,0,0.3);
$dnd-color: #fff;
$notification-border-default: #325C80;
$notification-border-success: #4B8400;
$notification-border-warning: #D74108;
$notification-border-error: $text-color-warning;
$notification-border-success: $border-color-success;
$notification-border-warning: $border-color-warning;
$notification-border-error: $border-color-error;
$debug-message-background: $secondary-background;
$debug-message-background-hover: $secondary-background-selected;
@@ -282,11 +286,16 @@ $debug-message-text-color-msg-type-number: #2033d6;
$debug-message-border: #eee;
$debug-message-border-hover: #999;
$debug-message-border-warning: #ffdf9d;
$debug-message-border-error: #f99;
$debug-message-border-warning: $border-color-warning;
$debug-message-border-error: $border-color-error;
$group-default-fill: none;
$group-default-fill-opacity: 1;
$group-default-stroke: #999;
$group-default-stroke-opacity: 1;
$group-default-label-color: #a4a4a4;
$group-default-label-color: #a4a4a4;
// Deprecated
$text-color-green: $text-color-success;
$info-text-code-color: $text-color-code;
$info-text-link-color: $text-color-link;

View File

@@ -500,7 +500,7 @@ ul.red-ui-deploy-dialog-confirm-list {
width: 30px;
margin-right: 10px;
&.fa-check {
color: $text-color-green;
color: $text-color-success;
}
&.fa-exclamation {
color: $secondary-text-color;

View File

@@ -222,7 +222,7 @@ button.red-ui-tray-resize-button {
}
.form-warning {
border-color: $text-color-warning;
border-color: $text-color-error;
}
}

View File

@@ -255,11 +255,11 @@ g.red-ui-flow-node-selected {
}
}
@each $current-color in red green yellow blue grey gray {
.red-ui-flow-node-status-dot-#{$current-color} {
.red-ui-flow-node-status-dot-#{""+$current-color} {
fill: map-get($node-status-colors,$current-color);
stroke: map-get($node-status-colors,$current-color);
}
.red-ui-flow-node-status-ring-#{$current-color} {
.red-ui-flow-node-status-ring-#{""+$current-color} {
fill: $view-background;
stroke: map-get($node-status-colors,$current-color);
}

View File

@@ -395,6 +395,7 @@
select[readonly],
textarea[readonly] {
cursor: not-allowed;
color: $form-text-color-disabled;
background-color: $form-input-background-disabled;
}

View File

@@ -51,18 +51,17 @@
}
.red-ui-clipboard-dialog-tab-clipboard {
textarea {
resize: none;
width: 100%;
border-radius: 4px;
font-family: $monospace-font !important;
font-size: 13px !important;
height: 100%;
line-height: 1.3em;
padding: 6px 10px;
background: $clipboard-textarea-background;
color: $secondary-text-color-active !important;
resize: none;
width: 100%;
border-radius: 4px;
font-family: $monospace-font !important;
font-size: 13px !important;
height: 100%;
line-height: 1.3em;
padding: 6px 10px;
background: $clipboard-textarea-background;
}
}
@@ -269,4 +268,4 @@
color: $secondary-text-color;
font-size: 0.9em;
}
}
}

View File

@@ -99,6 +99,9 @@
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.button-group &:focus {
position: relative;
}
.button-row &:not(:first-child) {
margin-left: 15px;
@@ -106,6 +109,7 @@
&:focus {
outline: 1px solid $workspace-button-color-focus-outline;
outline-offset: 1px;
}
&.primary {

View File

@@ -25,7 +25,7 @@
.red-ui-notification {
box-sizing: border-box;
position: relative;
padding: 14px 18px;
padding: 8px 18px 0px;
margin-bottom: 4px;
box-shadow: 0 1px 1px 1px $shadow;
background-color: $secondary-background;
@@ -35,6 +35,7 @@
overflow: hidden;
.ui-dialog-buttonset {
margin-top: 20px;
margin-bottom: 10px;
}
}
.red-ui-notification p:first-child {
@@ -59,13 +60,13 @@
}
.red-ui-notification-compact {
p {
margin: 0;
}
.ui-dialog-buttonset {
button {
line-height: 12px;
}
margin-top: 0;
position: absolute;
top: 8px;
top: 6px;
right: 10px;
}
}

View File

@@ -174,7 +174,7 @@
display: block;
text-align: center;
padding: 12px 8px;
color: $text-color-warning;
color: $text-color-code;
&:hover {
text-decoration: none;

View File

@@ -134,7 +134,7 @@
&:not(.red-ui-palette-node-config):not(.red-ui-palette-node-small):first-child {
margin-top: 15px;
}
&:not(.red-ui-palette-node-config):not(.red-ui-palette-node-small):first-child {
&:not(.red-ui-palette-node-config):not(.red-ui-palette-node-small):last-child {
margin-bottom: 15px;
}
}
@@ -229,3 +229,90 @@
left: 1px;
}
}
////////////////
.red-ui-node-list-item {
display: inline-block;
padding: 0;
font-size: 13px;
border: none;
}
.red-ui-node-icon {
display: inline-block;
width: 24px;
height: 20px;
line-height: 20px;
margin-top: 1px;
// width: 30px;
// height: 25px;
border-radius: 3px;
border: 1px solid $node-border;
background-position: 5% 50%;
background-repeat: no-repeat;
background-size: contain;
position: relative;
background-color: $node-icon-background-color;
text-align: center;
.red-ui-palette-icon {
width: 20px;
}
.red-ui-palette-icon-fa {
font-size: 14px;
position: relative;
top: -1px;
left: 0px;
}
&.red-ui-palette-icon-flow,
&.red-ui-palette-icon-group,
&.red-ui-palette-icon-selection {
background: none;
border-color: transparent;
.red-ui-palette-icon-container {
background: none;
}
.red-ui-palette-icon-fa {
color: $secondary-text-color;
font-size: 16px;
}
}
}
.red-ui-node-icon-container {
display: inline-flex;
align-items: center;
}
.red-ui-node-icon-container.red-ui-node-icon-small {
.red-ui-node-icon {
width: 18px;
height: 15px;
line-height: 15px;
.red-ui-palette-icon {
width: 15px;
}
.red-ui-palette-icon-fa {
font-size: 11px;
}
.red-ui-icons-flow {
width: 14px;
}
&.red-ui-palette-icon-flow {
margin-top: -2px;
}
&.red-ui-palette-icon-group .red-ui-palette-icon-fa {
font-size: 14px;
}
}
.red-ui-node-label {
}
}
.red-ui-node-label {
white-space: nowrap;
margin-left: 4px;
color: $secondary-text-color;
}

View File

@@ -40,7 +40,7 @@
height: 7px;
box-sizing: border-box;
cursor: ns-resize;
background: $primary-background url(images/grip.png) no-repeat 50% 50%;
background: $primary-background url(images/grip-horizontal.png) no-repeat 50% 50%;
}
@@ -70,5 +70,6 @@
width: 7px;
display: inline-block;
cursor: ew-resize;
background: $primary-background url(images/grip.png) no-repeat 50% 50%;
}
}

View File

@@ -103,7 +103,7 @@
left: -1px;
}
.red-ui-search-result-description {
margin-left:28px;
margin-left:8px;
}
.red-ui-search-result-node-label {
color: $secondary-text-color;
@@ -133,7 +133,8 @@
}
.red-ui-search-result {
padding: 8px 2px 8px 5px;
display: block;
display: flex;
align-items: start;
cursor: pointer;
color: $list-item-color;
background: $list-item-background;
@@ -156,12 +157,7 @@
display: table;
clear: both;
}
.red-ui-palette-icon-fa {
top: 6px;
left: 3px;
}
}
.red-ui-search-result-node {
display: inline-block;
width: 30px;
@@ -180,8 +176,9 @@
}
.red-ui-search-result-node-description {
margin-left: 40px;
margin-left: 10px;
margin-right: 5px;
flex-grow: 1;
}
.red-ui-search-result-node-label {
color: $primary-text-color;

View File

@@ -46,7 +46,7 @@
right: 315px;
bottom:10px;
width: 7px;
z-index: 11;
// z-index: 11;
background: $primary-background url(images/grip.png) no-repeat 50% 50%;
cursor: col-resize;
}
@@ -134,6 +134,7 @@ button.red-ui-sidebar-header-button-toggle {
right: calc(100%);
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
z-index: 13;
}
.red-ui-sidebar-control-left {
@include red-ui-sidebar-control;

View File

@@ -15,6 +15,7 @@
**/
@import "colors";
@import "variables";
@import "mixins";
@import "base";

View File

@@ -125,13 +125,13 @@ div.red-ui-info-table {
line-height: 1.5em;
a {
color: $info-text-link-color;
color: $text-color-link;
text-decoration: none;
}
a:hover,
a:focus {
color: $info-text-link-color;
color: $text-color-link;
text-decoration: underline;
}
@@ -176,7 +176,7 @@ div.red-ui-info-table {
font-family: $monospace-font;
font-weight: normal;
margin: 5px 3px 1px;
color: $text-color-warning;
color: $text-color-code;
white-space: nowrap;
&.optional {
font-style: italic;
@@ -326,13 +326,17 @@ div.red-ui-info-table {
border-bottom: 1px solid $secondary-border-color;
}
}
.red-ui-info-outline,.red-ui-sidebar-help-toc, #red-ui-clipboard-dialog-import-conflicts-list, #red-ui-clipboard-dialog-export-tab-clipboard-preview {
.red-ui-info-outline,
// TODO: remove these classes for 2.0. Keeping in 1.x for backwards compatibility
// of theme generators.
.red-ui-sidebar-help-toc, #red-ui-clipboard-dialog-import-conflicts-list, #red-ui-clipboard-dialog-export-tab-clipboard-preview
{
.red-ui-info-outline-item {
display: inline-block;
display: inline-flex;
padding: 0;
font-size: 13px;
border: none;
.red-ui-palette-icon-fa {
&:not(.red-ui-node-list-item) .red-ui-palette-icon-fa {
position: relative;
top: 1px;
left: 0px;
@@ -398,8 +402,7 @@ div.red-ui-info-table {
.red-ui-info-outline-gutter {
display:none;
button {
position: absolute;
top: 1px;
position: relative;
left: 2px;
}
.red-ui-treeList-label:hover & {

View File

@@ -102,10 +102,21 @@
img.red-ui-tab-icon {
opacity: 0.2;
}
.red-ui-tabs-fade {
background-image: linear-gradient(to right, transparent, $tab-background-active);
}
}
&.selected {
&:not(.active) {
background: $tab-background-selected;
.red-ui-tabs-fade {
background-image: linear-gradient(to right, transparent, $tab-background-selected);
}
.red-ui-tabs-badge-selected {
background: $tab-background-selected;
}
}
font-weight: bold;
.red-ui-tabs-badge-selected {
@@ -291,6 +302,15 @@
.red-ui-tabs.red-ui-tabs-add.red-ui-tabs-search .red-ui-tabs-add {
right: 38px;
}
.red-ui-tabs-fade {
position: absolute;
bottom: 0;
top: 0;
right: 0;
width: 15px;
background-image: linear-gradient(to right, transparent, $tab-background-inactive);
pointer-events: none;
}
img.red-ui-tab-icon {

View File

@@ -69,7 +69,8 @@
.red-ui-treeList-label {
@include disable-selection;
padding: 6px 0;
display: block;
display: flex;
align-items: center;
color: $list-item-color;
text-decoration: none;
cursor: pointer;

View File

@@ -24,7 +24,7 @@
margin: 0;
vertical-align: middle;
box-sizing: border-box;
overflow:visible;
overflow: hidden;
position: relative;
&[disabled] {
input, button {
@@ -33,7 +33,7 @@
cursor: not-allowed;
}
}
.red-ui-typedInput-input-wrap {
flex-grow: 1;
}

View File

@@ -0,0 +1,92 @@
:root {
--red-ui-primary-font: #{$primary-font};
--red-ui-primary-font-size: #{$primary-font-size};
--red-ui-monospace-font: #{$monospace-font};
--red-ui-primary-background: #{$primary-background};
--red-ui-secondary-background: #{$secondary-background};
--red-ui-secondary-background-selected: #{$secondary-background-selected};
--red-ui-secondary-background-inactive: #{$secondary-background-inactive};
--red-ui-secondary-background-hover: #{$secondary-background-hover};
--red-ui-secondary-background-disabled: #{$secondary-background-disabled};
--red-ui-tertiary-background: #{$tertiary-background};
--red-ui-shadow: #{$shadow};
// Main body text
--red-ui-primary-text-color: #{$primary-text-color};
// UI control label text
--red-ui-secondary-text-color: #{$secondary-text-color};
--red-ui-secondary-text-color-focus: #{$secondary-text-color-focus};
--red-ui-secondary-text-color-hover: #{$secondary-text-color-hover};
--red-ui-secondary-text-color-active: #{$secondary-text-color-active};
--red-ui-secondary-text-color-selected: #{$secondary-text-color-selected};
--red-ui-secondary-text-color-inactive: #{$secondary-text-color-inactive};
--red-ui-secondary-text-color-disabled: #{$secondary-text-color-disabled};
--red-ui-secondary-text-color-disabled-active: #{$secondary-text-color-disabled-active};
--red-ui-secondary-text-color-disabled-inactive: #{$secondary-text-color-disabled-inactive};
// Sub label text
--red-ui-tertiary-text-color: #{$tertiary-text-color};
// Heading text
--red-ui-header-text-color: #{$header-text-color};
--red-ui-text-color-error: #{$text-color-error};
--red-ui-text-color-warning: #{$text-color-warning};
--red-ui-text-color-success: #{$text-color-success};
--red-ui-text-color-code: #{$text-color-code};
--red-ui-text-color-link: #{$text-color-link};
--red-ui-primary-border-color: #{$primary-border-color};
--red-ui-secondary-border-color: #{$secondary-border-color};
--red-ui-tertiary-border-color: #{$tertiary-border-color};
--red-ui-border-color-error: #{$border-color-error};
--red-ui-border-color-warning: #{$border-color-warning};
--red-ui-border-color-success: #{$border-color-success};
--red-ui-form-background: #{$form-background};
--red-ui-form-placeholder-color: #{$form-placeholder-color};
--red-ui-form-text-color: #{$form-text-color};
--red-ui-form-text-color-disabled: #{$form-text-color-disabled};
--red-ui-form-input-border-color: #{$form-input-border-color};
--red-ui-form-input-border-color-focus: #{$form-input-focus-color};
--red-ui-form-input-border-color-selected: #{$form-input-border-selected-color};
--red-ui-form-input-border-color-error: #{$form-input-border-error-color};
--red-ui-form-input-background: #{$form-input-background};
--red-ui-form-input-background-disabled: #{$form-input-background-disabled};
--red-ui-form-button-background: #{$form-button-background};
--red-ui-form-tips-background: #{$form-tips-background};
--red-ui-list-item-color: #{$list-item-color};
--red-ui-list-item-secondary-color: #{$list-item-secondary-color};
--red-ui-list-item-background: #{$list-item-background};
--red-ui-list-item-background-disabled: #{$list-item-background-disabled};
--red-ui-list-item-background-hover: #{$list-item-background-hover};
--red-ui-list-item-background-selected: #{$list-item-background-selected};
--red-ui-list-item-border-selected: #{$list-item-border-selected};
--red-ui-shade-color: #{$shade-color};
--red-ui-node-link-port-background: #{$node-link-port-background};
--red-ui-node-status-error-border: #{$node-status-error-border};
--red-ui-node-status-error-background: #{$node-status-error-background};
--red-ui-node-status-changed-border: #{$node-status-changed-border};
--red-ui-node-status-changed-background: #{$node-status-changed-background};
--red-ui-node-border: #{$node-border};
--red-ui-node-port-background:#{$node-port-background};
--red-ui-node-label-color: #{$node-label-color};
--red-ui-node-selected-color: #{$node-selected-color};
--red-ui-port-selected-color: #{$port-selected-color};
}

View File

@@ -32,6 +32,7 @@
white-space: nowrap;
transition: right 0.2s ease;
overflow: hidden;
@include disable-selection;
label {
padding: 1px 8px;
@@ -47,7 +48,6 @@
margin-right: 10px;
padding: 2px 8px;
}
.button-group {
@include disable-selection;

View File

@@ -0,0 +1,39 @@
node and node-red types for intellisense for monaco
---------------------------------------------------
node-js and node-red types are included in node-red for monaco and any other editor to provide intellisense in the code editor
as node-js v14 is the default recommended target as of writing, the most popular node-js types (see below) have been taken from most up-to-date types from `@types/node` and minified using `dts-minify`
* buffer.d.ts
* console.d.ts
* crypto.d.ts
* fs.d.ts
* globals.d.ts
* http.d.ts
* net.d.ts
* os.d.ts
* process.d.ts
* querystring.d.ts
* string_decoder.d.ts
* url.d.ts
* zlib.d.ts
These are placed in `node_modules/@node-red/editor-client/src/`
The grunt task will place this default set of typings in `node_modules/@node-red/editor-client/public/types/` for consumption by the code editor.
# Instructions
See packages/node_modules/@node-red/editor-client/src/vendor/monaco/README.md
# Alternative / Manual Installation
* `npm install --save @types/node@14.14.43`
* (optional) minify using `dts-minify`
* copy files from `node_modules/@node-red/editor-client/src/` to `(node-red-src)/packages/node_modules/@node-red/editor-client/src/types/node`
* update types for node-red in files to match src definitions...
* (node-red-src)/packages/node_modules/@node-red/editor-client/src/types/node-red/func.d.ts
* (node-red-src)/packages/node_modules/@node-red/editor-client/src/types/node-red/util.d.ts

View File

@@ -0,0 +1,266 @@
/* NOTE: Do not edit directly! This file is generated using \`npm run update-types\` in https://github.com/Steve-Mcl/monaco-editor-esm-i18n */
interface NodeMessage {
topic?: string;
payload?: any;
_msgid?: string;
[other: string]: any; //permit other properties
}
/** @type {NodeMessage} the `msg` object */
declare var msg: NodeMessage;
/** @type {string} the id of the incoming `msg` (alias of msg._msgid) */
declare const __msgid__:string;
/**
* @typedef NodeStatus
* @type {object}
* @property {string} [fill] The fill property can be: red, green, yellow, blue or grey.
* @property {string} [shape] The shape property can be: ring or dot.
* @property {string} [text] The text to display
*/
interface NodeStatus {
/** The fill property can be: red, green, yellow, blue or grey */
fill?: string,
/** The shape property can be: ring or dot */
shape?: string,
/** The text to display */
text?: string|boolean|number
}
declare class node {
/**
* Send 1 or more messages asynchronously
* @param {object | object[]} msg The msg object
* @param {Boolean} [clone=true] Flag to indicate the `msg` should be cloned. Default = `true`
* @see node-red documentation [writing-functions: sending messages asynchronously](https://nodered.org/docs/user-guide/writing-functions#sending-messages-asynchronously)
*/
static send(msg:object|object[], clone?:Boolean): void;
/** Inform runtime this instance has completed its operation */
static done();
/** Send an error to the console and debug side bar. Include `msg` in the 2nd parameter to trigger the catch node. */
static error(err:string|Error, msg?:object);
/** Log a warn message to the console and debug sidebar */
static warn(warning:string|object);
/** Log an info message to the console (not sent to sidebar)' */
static log(info:string|object);
/** Sets the status icon and text underneath the node.
* @param {NodeStatus} status - The status object `{fill, shape, text}`
* @see node-red documentation [writing-functions: adding-status](https://nodered.org/docs/user-guide/writing-functions#adding-status)
*/
static status(status:NodeStatus);
/** Sets the status text underneath the node.
* @param {string} status - The status to display
* @see node-red documentation [writing-functions: adding-status](https://nodered.org/docs/user-guide/writing-functions#adding-status)
*/
static status(status:string|boolean|number);
/** the id of this node */
public readonly id:string;
/** the name of this node */
public readonly name:string;
/** the number of outputs of this node */
public readonly outputCount:number;
}
declare class context {
/**
* Get one or multiple values from context (synchronous).
* @param name - Name of context variable
*/
static get(name: string | string[]);
/**
* Get one or multiple values from context (asynchronous).
* @param name - Name (or array of names) to get from context
* @param {function} callback - (optional) Callback function (`(err,value) => {}`)
*/
static get(name: string | string[], callback: Function);
/**
* Get one or multiple values from context (synchronous).
* @param name - Name (or array of names) to get from context
* @param store - Name of context store
*/
static get(name: string | string[], store: string);
/**
* Get one or multiple values from context (asynchronous).
* @param name - Name (or array of names) to get from context
* @param store - Name of context store
* @param {function} callback - (optional) Callback function (`(err,value) => {}`)
*/
static get(name: string | string[], store: string, callback: Function);
/**
* Set one or multiple values in context (synchronous).
* @param name - Name (or array of names) to set in context
* @param value - The value (or array of values) to store in context. If the value(s) are null/undefined, the context item(s) will be removed.
*/
static set(name: string | string[], value?: any | any[]);
/**
* Set one or multiple values in context (asynchronous).
* @param name - Name (or array of names) to set in context
* @param value - The value (or array of values) to store in context. If the value(s) are null/undefined, the context item(s) will be removed.
* @param callback - (optional) Callback function (`(err) => {}`)
*/
static set(name: string | string[], value?: any | any[], callback?: Function);
/**
* Set one or multiple values in context (synchronous).
* @param name - Name (or array of names) to set in context
* @param value - The value (or array of values) to store in context. If the value(s) are null/undefined, the context item(s) will be removed.
* @param store - (optional) Name of context store
*/
static set(name: string | string[], value?: any | any[], store?: string);
/**
* Set one or multiple values in context (asynchronous).
* @param name - Name (or array of names) to set in context
* @param value - The value (or array of values) to store in context. If the value(s) are null/undefined, the context item(s) will be removed.
* @param store - (optional) Name of context store
* @param callback - (optional) Callback function (`(err) => {}`)
*/
static set(name: string | string[], value?: any | any[], store?: string, callback?: Function);
/** Get an array of the keys in the context store */
static keys(): Array<string>;
/** Get an array of the keys in the context store */
static keys(store: string): Array<string>;
/** Get an array of the keys in the context store */
static keys(callback: Function);
/** Get an array of the keys in the context store */
static keys(store: string, callback: Function);
}
declare class flow {
/**
* Get one or multiple values from context (synchronous).
* @param name - Name of context variable
*/
static get(name: string | string[]);
/**
* Get one or multiple values from context (asynchronous).
* @param name - Name (or array of names) to get from context
* @param {function} callback - (optional) Callback function (`(err,value) => {}`)
*/
static get(name: string | string[], callback: Function);
/**
* Get one or multiple values from context (synchronous).
* @param name - Name (or array of names) to get from context
* @param store - Name of context store
*/
static get(name: string | string[], store: string);
/**
* Get one or multiple values from context (asynchronous).
* @param name - Name (or array of names) to get from context
* @param store - Name of context store
* @param {function} callback - (optional) Callback function (`(err,value) => {}`)
*/
static get(name: string | string[], store: string, callback: Function);
/**
* Set one or multiple values in context (synchronous).
* @param name - Name (or array of names) to set in context
* @param value - The value (or array of values) to store in context. If the value(s) are null/undefined, the context item(s) will be removed.
*/
static set(name: string | string[], value?: any | any[]);
/**
* Set one or multiple values in context (asynchronous).
* @param name - Name (or array of names) to set in context
* @param value - The value (or array of values) to store in context. If the value(s) are null/undefined, the context item(s) will be removed.
* @param callback - (optional) Callback function (`(err) => {}`)
*/
static set(name: string | string[], value?: any | any[], callback?: Function);
/**
* Set one or multiple values in context (synchronous).
* @param name - Name (or array of names) to set in context
* @param value - The value (or array of values) to store in context. If the value(s) are null/undefined, the context item(s) will be removed.
* @param store - (optional) Name of context store
*/
static set(name: string | string[], value?: any | any[], store?: string);
/**
* Set one or multiple values in context (asynchronous).
* @param name - Name (or array of names) to set in context
* @param value - The value (or array of values) to store in context. If the value(s) are null/undefined, the context item(s) will be removed.
* @param store - (optional) Name of context store
* @param callback - (optional) Callback function (`(err) => {}`)
*/
static set(name: string | string[], value?: any | any[], store?: string, callback?: Function);
/** Get an array of the keys in the context store */
static keys(): Array<string>;
/** Get an array of the keys in the context store */
static keys(store: string): Array<string>;
/** Get an array of the keys in the context store */
static keys(callback: Function);
/** Get an array of the keys in the context store */
static keys(store: string, callback: Function);
}
// @ts-ignore
declare class global {
/**
* Get one or multiple values from context (synchronous).
* @param name - Name of context variable
*/
static get(name: string | string[]);
/**
* Get one or multiple values from context (asynchronous).
* @param name - Name (or array of names) to get from context
* @param {function} callback - (optional) Callback function (`(err,value) => {}`)
*/
static get(name: string | string[], callback: Function);
/**
* Get one or multiple values from context (synchronous).
* @param name - Name (or array of names) to get from context
* @param store - Name of context store
*/
static get(name: string | string[], store: string);
/**
* Get one or multiple values from context (asynchronous).
* @param name - Name (or array of names) to get from context
* @param store - Name of context store
* @param {function} callback - (optional) Callback function (`(err,value) => {}`)
*/
static get(name: string | string[], store: string, callback: Function);
/**
* Set one or multiple values in context (synchronous).
* @param name - Name (or array of names) to set in context
* @param value - The value (or array of values) to store in context. If the value(s) are null/undefined, the context item(s) will be removed.
*/
static set(name: string | string[], value?: any | any[]);
/**
* Set one or multiple values in context (asynchronous).
* @param name - Name (or array of names) to set in context
* @param value - The value (or array of values) to store in context. If the value(s) are null/undefined, the context item(s) will be removed.
* @param callback - (optional) Callback function (`(err) => {}`)
*/
static set(name: string | string[], value?: any | any[], callback?: Function);
/**
* Set one or multiple values in context (synchronous).
* @param name - Name (or array of names) to set in context
* @param value - The value (or array of values) to store in context. If the value(s) are null/undefined, the context item(s) will be removed.
* @param store - (optional) Name of context store
*/
static set(name: string | string[], value?: any | any[], store?: string);
/**
* Set one or multiple values in context (asynchronous).
* @param name - Name (or array of names) to set in context
* @param value - The value (or array of values) to store in context. If the value(s) are null/undefined, the context item(s) will be removed.
* @param store - (optional) Name of context store
* @param callback - (optional) Callback function (`(err) => {}`)
*/
static set(name: string | string[], value?: any | any[], store?: string, callback?: Function);
/** Get an array of the keys in the context store */
static keys(): Array<string>;
/** Get an array of the keys in the context store */
static keys(store: string): Array<string>;
/** Get an array of the keys in the context store */
static keys(callback: Function);
/** Get an array of the keys in the context store */
static keys(store: string, callback: Function);
}
declare class env {
/** Get an environment variable value */
static get(name:string);
}

View File

@@ -0,0 +1,211 @@
/* NOTE: Do not edit directly! This file is generated using \`npm run update-types\` in https://github.com/Steve-Mcl/monaco-editor-esm-i18n */
/*
How to generate...
1. Generate from packages\node_modules\@node-red\util\lib\util.js using `npx typescript` and a tsconfig.json of...
{
"files": ["packages/node_modules/@node-red/util/lib/util.js"],
"compilerOptions": {
"allowJs": true,
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "types",
"strict": false,
"moduleResolution": "node"
}
}
2. remove all the `export ` statements
3. Wrap the remaining code in declare namespace RED { declare namespace util { ... } }
4. check . adjust types like String --> string, Object --> object etc (where appropriate)
*/
declare namespace RED {
/**
* Utility functions for the node-red function sandbox
*/
namespace util {
/**
* Encode an object to JSON without losing information about non-JSON types
* such as Buffer and Function.
*
* *This function is closely tied to its reverse within the editor*
*
* @param {Object} msg
* @param {Object} opts
* @return {Object} the encoded object
* @memberof @node-red/util_util
*/
function encodeObject(msg: any, opts: any): any;
/**
* Converts the provided argument to a String, using type-dependent
* methods.
*
* @param {any} o - the property to convert to a String
* @return {string} the stringified version
* @memberof @node-red/util_util
*/
function ensureString(o: any): string;
/**
* Converts the provided argument to a Buffer, using type-dependent
* methods.
*
* @param {any} o - the property to convert to a Buffer
* @return {string} the Buffer version
* @memberof @node-red/util_util
*/
function ensureBuffer(o: any): string;
/**
* Safely clones a message object. This handles msg.req/msg.res objects that must
* not be cloned.
*
* @param {object} msg - the message object to clone
* @return {object} the cloned message
* @memberof @node-red/util_util
*/
function cloneMessage(msg: object): object;
/**
* Compares two objects, handling various JavaScript types.
*
* @param {any} obj1
* @param {any} obj2
* @return {boolean} whether the two objects are the same
* @memberof @node-red/util_util
*/
function compareObjects(obj1: any, obj2: any): boolean;
/**
* Generates a psuedo-unique-random id.
* @return {string} a random-ish id
* @memberof @node-red/util_util
*/
function generateId(): string;
/**
* Gets a property of a message object.
*
* Unlike {@link @node-red/util-util.getObjectProperty}, this function will strip `msg.` from the
* front of the property expression if present.
*
* @param {object} msg - the message object
* @param {string} expr - the property expression
* @return {any} the message property, or undefined if it does not exist
* @throws Will throw an error if the *parent* of the property does not exist
* @memberof @node-red/util_util
*/
function getMessageProperty(msg: object, expr: string): any;
/**
* Sets a property of a message object.
*
* Unlike {@link @node-red/util-util.setObjectProperty}, this function will strip `msg.` from the
* front of the property expression if present.
*
* @param {object} msg - the message object
* @param {string} prop - the property expression
* @param {any} [value] - the value to set
* @param {boolean} [createMissing] - whether to create missing parent properties
* @memberof @node-red/util_util
*/
function setMessageProperty(msg: object, prop: string, value?: any, createMissing?: boolean): boolean;
/**
* Gets a property of an object.
*
* Given the object:
*
* {
* "pet": {
* "type": "cat"
* }
* }
*
* - `pet.type` will return `"cat"`.
* - `pet.name` will return `undefined`
* - `car` will return `undefined`
* - `car.type` will throw an Error (as `car` does not exist)
*
* @param {object} msg - the object
* @param {string} expr - the property expression
* @return {any} the object property, or undefined if it does not exist
* @throws Will throw an error if the *parent* of the property does not exist
* @memberof @node-red/util_util
*/
function getObjectProperty(msg: object, expr: string): any;
/**
* Sets a property of an object.
*
* @param {object} msg - the object
* @param {string} prop - the property expression
* @param {any} [value] - the value to set
* @param {boolean} [createMissing] - whether to create missing parent properties
* @memberof @node-red/util_util
*/
function setObjectProperty(msg: object, prop: string, value?: any, createMissing?: boolean): boolean;
/**
* Evaluates a property value according to its type.
*
* @param {string} value - the raw value
* @param {string} type - the type of the value
* @param {Node} node - the node evaluating the property
* @param {Object} msg - the message object to evaluate against
* @param {Function} callback - (optional) called when the property is evaluated
* @return {any} The evaluated property, if no `callback` is provided
* @memberof @node-red/util_util
*/
function evaluateNodeProperty(value: string, type: string, node: Node, msg: any, callback: Function): any;
/**
* Parses a property expression, such as `msg.foo.bar[3]` to validate it
* and convert it to a canonical version expressed as an Array of property
* names.
*
* For example, `a["b"].c` returns `['a','b','c']`
*
* @param {string} str - the property expression
* @return {any[]} the normalised expression
* @memberof @node-red/util_util
*/
function normalisePropertyExpression(str: string): any[];
/**
* Normalise a node type name to camel case.
*
* For example: `a-random node type` will normalise to `aRandomNodeType`
*
* @param {string} name - the node type
* @return {string} The normalised name
* @memberof @node-red/util_util
*/
function normaliseNodeTypeName(name: string): string;
/**
* Prepares a JSONata expression for evaluation.
* This attaches Node-RED specific functions to the expression.
*
* @param {string} value - the JSONata expression
* @param {Node} node - the node evaluating the property
* @return {any} The JSONata expression that can be evaluated
* @memberof @node-red/util_util
*/
function prepareJSONataExpression(value: string, node: Node): any;
/**
* Evaluates a JSONata expression.
* The expression must have been prepared with {@link @node-red/util-util.prepareJSONataExpression}
* before passing to this function.
*
* @param {Object} expr - the prepared JSONata expression
* @param {Object} msg - the message object to evaluate against
* @param {Function} callback - (optional) called when the expression is evaluated
* @return {any} If no callback was provided, the result of the expression
* @memberof @node-red/util_util
*/
function evaluateJSONataExpression(expr: any, msg: any, callback: Function): any;
/**
* Parses a context property string, as generated by the TypedInput, to extract
* the store name if present.
*
* For example, `#:(file)::foo` results in ` { store: "file", key: "foo" }`.
*
* @param {string} key - the context property string to parse
* @return {any} The parsed property
* @memberof @node-red/util_util
*/
function parseContextStore(key: string): any;
}
}

View File

@@ -0,0 +1 @@
declare module'node:buffer'{export*from'buffer';}declare module'buffer'{export const INSPECT_MAX_BYTES:number;export const kMaxLength:number;export const kStringMaxLength:number;export const constants:{MAX_LENGTH:number;MAX_STRING_LENGTH:number;};const BuffType:typeof Buffer;export type TranscodeEncoding="ascii"|"utf8"|"utf16le"|"ucs2"|"latin1"|"binary";export function transcode(source:Uint8Array,fromEnc:TranscodeEncoding,toEnc:TranscodeEncoding):Buffer;export const SlowBuffer:{new(size:number):Buffer;prototype:Buffer;};export{BuffType as Buffer};}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
declare module'node:console'{export=console;}declare module'console'{import{InspectOptions}from'node:util';global{interface Console{Console:NodeJS.ConsoleConstructor;assert(value:any,message?:string,...optionalParams:any[]):void;clear():void;count(label?:string):void;countReset(label?:string):void;debug(message?:any,...optionalParams:any[]):void;dir(obj:any,options?:InspectOptions):void;dirxml(...data:any[]):void;error(message?:any,...optionalParams:any[]):void;group(...label:any[]):void;groupCollapsed(...label:any[]):void;groupEnd():void;info(message?:any,...optionalParams:any[]):void;log(message?:any,...optionalParams:any[]):void;table(tabularData:any,properties?:ReadonlyArray<string>):void;time(label?:string):void;timeEnd(label?:string):void;timeLog(label?:string,...data:any[]):void;trace(message?:any,...optionalParams:any[]):void;warn(message?:any,...optionalParams:any[]):void;profile(label?:string):void;profileEnd(label?:string):void;timeStamp(label?:string):void;}var console:Console;namespace NodeJS{interface ConsoleConstructorOptions{stdout:WritableStream;stderr?:WritableStream;ignoreErrors?:boolean;colorMode?:boolean|'auto';inspectOptions?:InspectOptions;}interface ConsoleConstructor{prototype:Console;new(stdout:WritableStream,stderr?:WritableStream,ignoreErrors?:boolean):Console;new(options:ConsoleConstructorOptions):Console;}interface Global{console:typeof console;}}}export=console;}

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More