diff --git a/package-lock.json b/package-lock.json index 556bf1f005..0193f52c32 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8515,6 +8515,12 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "node_modules/@types/jsonpath": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@types/jsonpath/-/jsonpath-0.2.0.tgz", + "integrity": "sha512-v7qlPA0VpKUlEdhghbDqRoKMxFB3h3Ch688TApBJ6v+XLDdvWCGLJIYiPKGZnS6MAOie+IorCfNYVHOPIHSWwQ==", + "dev": true + }, "node_modules/@types/jsonwebtoken": { "version": "8.5.9", "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.9.tgz", @@ -27636,6 +27642,28 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsonpath": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.1.1.tgz", + "integrity": "sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w==", + "dependencies": { + "esprima": "1.2.2", + "static-eval": "2.0.2", + "underscore": "1.12.1" + } + }, + "node_modules/jsonpath/node_modules/esprima": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz", + "integrity": "sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/jsonschema": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", @@ -36655,6 +36683,90 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/static-eval": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz", + "integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==", + "dependencies": { + "escodegen": "^1.8.1" + } + }, + "node_modules/static-eval/node_modules/escodegen": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=4.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/static-eval/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/static-eval/node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/static-eval/node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/static-eval/node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/static-eval/node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", @@ -39532,6 +39644,11 @@ "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", "dev": true }, + "node_modules/underscore": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", + "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==" + }, "node_modules/undertaker": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.3.0.tgz", @@ -41142,15 +41259,6 @@ "vue": ">=2" } }, - "node_modules/vue-json-pretty": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/vue-json-pretty/-/vue-json-pretty-1.7.1.tgz", - "integrity": "sha512-D7aHQ5XPooSAEndTkb/RvXXJdmuCjaj14IMRdJwO4q+yJMpzPv87FT2gz4Dt2mCr1EzFyat7z7Qv9R+l/1as+w==", - "engines": { - "node": ">= 10.0.0", - "npm": ">= 5.0.0" - } - }, "node_modules/vue-loader": { "version": "15.10.0", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.0.tgz", @@ -45572,6 +45680,7 @@ "file-saver": "^2.0.2", "flatted": "^3.2.4", "jquery": "^3.4.1", + "jsonpath": "^1.1.1", "jsplumb": "2.15.4", "lodash.camelcase": "^4.3.0", "lodash.debounce": "^4.0.8", @@ -45593,7 +45702,7 @@ "vue-agile": "^2.0.0", "vue-fragment": "1.5.1", "vue-i18n": "^8.26.7", - "vue-json-pretty": "1.7.1", + "vue-json-pretty": "1.9.2", "vue-prism-editor": "^0.3.0", "vue-router": "^3.0.6", "vue-template-compiler": "~2.6.11", @@ -45612,6 +45721,7 @@ "@types/dateformat": "^3.0.0", "@types/express": "^4.17.6", "@types/file-saver": "^2.0.1", + "@types/jsonpath": "^0.2.0", "@types/lodash.camelcase": "^4.3.6", "@types/lodash.get": "^4.4.6", "@types/lodash.set": "^4.3.6", @@ -46067,6 +46177,15 @@ "eslint": ">=5.0.0" } }, + "packages/editor-ui/node_modules/vue-json-pretty": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/vue-json-pretty/-/vue-json-pretty-1.9.2.tgz", + "integrity": "sha512-FHAYmZAazhVC6Wi+Zi9DVYha+oZb9uylJPGkl/yTYLxlqLMxmnaVC2R8ZwaYzt6TBGvkLe3Y2D2vgyJCDBJy1w==", + "engines": { + "node": ">= 10.0.0", + "npm": ">= 5.0.0" + } + }, "packages/editor-ui/node_modules/vue-tsc": { "version": "0.34.17", "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-0.34.17.tgz", @@ -54742,6 +54861,12 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "@types/jsonpath": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@types/jsonpath/-/jsonpath-0.2.0.tgz", + "integrity": "sha512-v7qlPA0VpKUlEdhghbDqRoKMxFB3h3Ch688TApBJ6v+XLDdvWCGLJIYiPKGZnS6MAOie+IorCfNYVHOPIHSWwQ==", + "dev": true + }, "@types/jsonwebtoken": { "version": "8.5.9", "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.9.tgz", @@ -69795,6 +69920,23 @@ "graceful-fs": "^4.1.6" } }, + "jsonpath": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.1.1.tgz", + "integrity": "sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w==", + "requires": { + "esprima": "1.2.2", + "static-eval": "2.0.2", + "underscore": "1.12.1" + }, + "dependencies": { + "esprima": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz", + "integrity": "sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A==" + } + } + }, "jsonschema": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", @@ -73647,6 +73789,7 @@ "@types/dateformat": "^3.0.0", "@types/express": "^4.17.6", "@types/file-saver": "^2.0.1", + "@types/jsonpath": "^0.2.0", "@types/lodash.camelcase": "^4.3.6", "@types/lodash.get": "^4.4.6", "@types/lodash.set": "^4.3.6", @@ -73668,6 +73811,7 @@ "flatted": "^3.2.4", "jquery": "^3.4.1", "jshint": "^2.9.7", + "jsonpath": "^1.1.1", "jsplumb": "2.15.4", "lodash.camelcase": "^4.3.0", "lodash.debounce": "^4.0.8", @@ -73698,7 +73842,7 @@ "vue-agile": "^2.0.0", "vue-fragment": "1.5.1", "vue-i18n": "^8.26.7", - "vue-json-pretty": "1.7.1", + "vue-json-pretty": "1.9.2", "vue-prism-editor": "^0.3.0", "vue-router": "^3.0.6", "vue-template-compiler": "~2.6.11", @@ -74031,6 +74175,11 @@ "semver": "^6.3.0" } }, + "vue-json-pretty": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/vue-json-pretty/-/vue-json-pretty-1.9.2.tgz", + "integrity": "sha512-FHAYmZAazhVC6Wi+Zi9DVYha+oZb9uylJPGkl/yTYLxlqLMxmnaVC2R8ZwaYzt6TBGvkLe3Y2D2vgyJCDBJy1w==" + }, "vue-tsc": { "version": "0.34.17", "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-0.34.17.tgz", @@ -81135,6 +81284,68 @@ "integrity": "sha512-d/5Z4/2iiCnHw6Xzghyhb+GcmF89bxwgXG60wjIiZaxnymbyOmI8Hk4VqHXiVVp6u2ysaskFfXg3ekCj4WNftQ==", "dev": true }, + "static-eval": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz", + "integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==", + "requires": { + "escodegen": "^1.8.1" + }, + "dependencies": { + "escodegen": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "requires": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==" + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "requires": { + "prelude-ls": "~1.1.2" + } + } + } + }, "static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", @@ -83251,6 +83462,11 @@ "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", "dev": true }, + "underscore": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", + "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==" + }, "undertaker": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.3.0.tgz", @@ -84483,11 +84699,6 @@ "integrity": "sha512-hQN3mzLmWM33Ua2Oua5OgF8/BJjP6+T1Wzea5xHDRYCwVvJo2pxSJLhVqluaeBe3PB5vquMddceaKC4mhLe25A==", "dev": true }, - "vue-json-pretty": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/vue-json-pretty/-/vue-json-pretty-1.7.1.tgz", - "integrity": "sha512-D7aHQ5XPooSAEndTkb/RvXXJdmuCjaj14IMRdJwO4q+yJMpzPv87FT2gz4Dt2mCr1EzFyat7z7Qv9R+l/1as+w==" - }, "vue-loader": { "version": "15.10.0", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.0.tgz", diff --git a/packages/design-system/src/components/N8nInfoTip/__tests__/__snapshots__/InfoTip.spec.ts.snap b/packages/design-system/src/components/N8nInfoTip/__tests__/__snapshots__/InfoTip.spec.ts.snap index 12dc7441d1..1bd09e20c7 100644 --- a/packages/design-system/src/components/N8nInfoTip/__tests__/__snapshots__/InfoTip.spec.ts.snap +++ b/packages/design-system/src/components/N8nInfoTip/__tests__/__snapshots__/InfoTip.spec.ts.snap @@ -4,6 +4,6 @@ exports[`N8nInfoTip > should render correctly as note 1`] = `"
should render correctly as tooltip 1`] = ` "
- Need help doing something?Open docs + Need help doing something?Open docs
" `; diff --git a/packages/design-system/src/components/N8nTooltip/Tooltip.vue b/packages/design-system/src/components/N8nTooltip/Tooltip.vue index a2b4112b02..62ad2a13c3 100644 --- a/packages/design-system/src/components/N8nTooltip/Tooltip.vue +++ b/packages/design-system/src/components/N8nTooltip/Tooltip.vue @@ -1,7 +1,50 @@ + + + + diff --git a/packages/design-system/src/css/_tokens.dark.scss b/packages/design-system/src/css/_tokens.dark.scss index 4bc642e549..7a2c9ea6e6 100644 --- a/packages/design-system/src/css/_tokens.dark.scss +++ b/packages/design-system/src/css/_tokens.dark.scss @@ -301,7 +301,7 @@ --color-json-brackets: var(--color-text-dark); --color-json-brackets-hover: #1890ff; --color-json-line: #bfcbd9; - --color-json-highlight: hsl(226, 13%, 71%); + --color-json-highlight: #dcdfea; // Generated Color Shades from 50 to 950 // Not yet used in design system diff --git a/packages/design-system/src/types/button.ts b/packages/design-system/src/types/button.ts new file mode 100644 index 0000000000..930db154bc --- /dev/null +++ b/packages/design-system/src/types/button.ts @@ -0,0 +1,17 @@ +export type IN8nButton = { + attrs: { + label: string, + type?: 'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger', + size?: 'mini' | 'small' | 'medium' | 'large' | 'xlarge', + loading?: boolean, + disabled?: boolean, + outline?: boolean, + text?: boolean, + icon?: string, + block?: boolean, + active?: boolean, + float?: 'left' | 'right', + square?: boolean, + }, + listeners?: Record void> +}; diff --git a/packages/design-system/src/types/index.ts b/packages/design-system/src/types/index.ts index 20b5b9aa9f..a9602f5874 100644 --- a/packages/design-system/src/types/index.ts +++ b/packages/design-system/src/types/index.ts @@ -1,2 +1,3 @@ export * from './form'; export * from './user'; +export * from './button'; diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index 9f0f70b9fb..3481d4614a 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -36,6 +36,7 @@ "file-saver": "^2.0.2", "flatted": "^3.2.4", "jquery": "^3.4.1", + "jsonpath": "^1.1.1", "jsplumb": "2.15.4", "lodash.camelcase": "^4.3.0", "lodash.debounce": "^4.0.8", @@ -57,7 +58,7 @@ "vue-agile": "^2.0.0", "vue-fragment": "1.5.1", "vue-i18n": "^8.26.7", - "vue-json-pretty": "1.7.1", + "vue-json-pretty": "1.9.2", "vue-prism-editor": "^0.3.0", "vue-router": "^3.0.6", "vue-template-compiler": "~2.6.11", @@ -76,6 +77,7 @@ "@types/dateformat": "^3.0.0", "@types/express": "^4.17.6", "@types/file-saver": "^2.0.1", + "@types/jsonpath": "^0.2.0", "@types/lodash.camelcase": "^4.3.6", "@types/lodash.get": "^4.4.6", "@types/lodash.set": "^4.3.6", diff --git a/packages/editor-ui/public/static/json-mapping-gif.gif b/packages/editor-ui/public/static/json-mapping-gif.gif new file mode 100644 index 0000000000..80701be92a Binary files /dev/null and b/packages/editor-ui/public/static/json-mapping-gif.gif differ diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index 2521f1cabc..c38766fd29 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -18,7 +18,6 @@ import { IWorkflowSettings as IWorkflowSettingsWorkflow, WorkflowExecuteMode, PublicInstalledPackage, - IResourceLocatorResult, INodeTypeNameVersion, ILoadOptions, INodeCredentials, @@ -943,9 +942,15 @@ export interface IUiState { sessionId: string; input: { displayMode: IRunDataDisplayMode; + data: { + isEmpty: boolean; + } }; output: { displayMode: IRunDataDisplayMode; + data: { + isEmpty: boolean; + } editMode: { enabled: boolean; value: string; diff --git a/packages/editor-ui/src/components/Draggable.vue b/packages/editor-ui/src/components/Draggable.vue index 7e1f771f84..a10d82da87 100644 --- a/packages/editor-ui/src/components/Draggable.vue +++ b/packages/editor-ui/src/components/Draggable.vue @@ -27,6 +27,7 @@ import Vue from 'vue'; import Teleport from 'vue2-teleport'; export default Vue.extend({ + name: 'draggable', components: { Teleport, }, @@ -49,22 +50,22 @@ export default Vue.extend({ }, }, data() { + const draggablePosition = { + x: -100, + y: -100, + }; + return { isDragging: false, - draggablePosition: { - x: -100, - y: -100, - }, + draggablePosition, draggingEl: null as null | HTMLElement, + draggableStyle: { + transform: `translate(${draggablePosition.x}px, ${draggablePosition.y}px)`, + }, + animationFrameId: 0, }; }, computed: { - draggableStyle(): { top: string; left: string; } { - return { - top: `${this.draggablePosition.y}px`, - left: `${this.draggablePosition.x}px`, - }; - }, canDrop(): boolean { return this.$store.getters['ui/canDraggableDrop']; }, @@ -73,61 +74,65 @@ export default Vue.extend({ }, }, methods: { - onDragStart(e: DragEvent) { + setDraggableStyle() { + this.draggableStyle = { + transform: `translate(${this.draggablePosition.x}px, ${this.draggablePosition.y}px)`, + }; + }, + onDragStart(e: MouseEvent) { if (this.disabled) { return; } - const target = e.target as HTMLElement; - if (this.targetDataKey && target && target.dataset.target !== this.targetDataKey) { + this.draggingEl = e.target as HTMLElement; + if (this.targetDataKey && this.draggingEl && this.draggingEl.dataset.target !== this.targetDataKey) { return; } - this.draggingEl = target; - - e.preventDefault(); - e.stopPropagation(); - this.isDragging = true; - - const data = this.targetDataKey ? target.dataset.value : (this.data || ''); - this.$store.commit('ui/draggableStartDragging', {type: this.type, data }); - - this.$emit('dragstart', this.draggingEl); - document.body.style.cursor = 'grabbing'; + this.isDragging = false; + this.draggablePosition = { x: e.pageX, y: e.pageY }; + this.setDraggableStyle(); window.addEventListener('mousemove', this.onDrag); window.addEventListener('mouseup', this.onDragEnd); - - this.draggablePosition = { x: e.pageX, y: e.pageY }; }, onDrag(e: MouseEvent) { + e.preventDefault(); + e.stopPropagation(); + if (this.disabled) { return; } - e.preventDefault(); - e.stopPropagation(); + if(!this.isDragging) { + this.isDragging = true; - if (this.canDrop && this.stickyPosition) { - this.draggablePosition = { x: this.stickyPosition[0], y: this.stickyPosition[1]}; - } - else { - this.draggablePosition = { x: e.pageX, y: e.pageY }; + const data = this.targetDataKey && this.draggingEl ? this.draggingEl.dataset.value : (this.data || ''); + this.$store.commit('ui/draggableStartDragging', {type: this.type, data }); + + this.$emit('dragstart', this.draggingEl); + document.body.style.cursor = 'grabbing'; } - this.$emit('drag', this.draggablePosition); + this.animationFrameId = window.requestAnimationFrame(() => { + if (this.canDrop && this.stickyPosition) { + this.draggablePosition = { x: this.stickyPosition[0], y: this.stickyPosition[1]}; + } else { + this.draggablePosition = { x: e.pageX, y: e.pageY }; + } + this.setDraggableStyle(); + this.$emit('drag', this.draggablePosition); + }); }, - onDragEnd(e: MouseEvent) { + onDragEnd() { if (this.disabled) { return; } - e.preventDefault(); - e.stopPropagation(); - document.body.style.cursor = 'unset'; window.removeEventListener('mousemove', this.onDrag); window.removeEventListener('mouseup', this.onDragEnd); + window.cancelAnimationFrame(this.animationFrameId); setTimeout(() => { this.$emit('dragend', this.draggingEl); @@ -149,10 +154,12 @@ export default Vue.extend({ .draggable { position: fixed; z-index: 9999999; + top: 0; + left: 0; } .draggable-data-transfer { - width: 0px; - height: 0px; + width: 0; + height: 0; } diff --git a/packages/editor-ui/src/components/PanelDragButton.vue b/packages/editor-ui/src/components/PanelDragButton.vue index 81094fd8fd..4eba8703ef 100644 --- a/packages/editor-ui/src/components/PanelDragButton.vue +++ b/packages/editor-ui/src/components/PanelDragButton.vue @@ -32,11 +32,10 @@ diff --git a/packages/editor-ui/src/components/RunData.vue b/packages/editor-ui/src/components/RunData.vue index 6c910cf313..d760236a06 100644 --- a/packages/editor-ui/src/components/RunData.vue +++ b/packages/editor-ui/src/components/RunData.vue @@ -131,37 +131,9 @@
-
- - - - - - - {{ $locale.baseText('runData.copyValue') }} - - - {{ $locale.baseText('runData.copyItemPath') }} - - - {{ $locale.baseText('runData.copyParameterPath') }} - - - -
-
{{ executingMessage }} @@ -239,25 +211,34 @@
-
- -
+ -
- -
+
{{ $locale.baseText('runData.noBinaryDataFound') }} @@ -338,8 +319,9 @@ + + + + diff --git a/packages/editor-ui/src/components/RunDataJsonActions.vue b/packages/editor-ui/src/components/RunDataJsonActions.vue new file mode 100644 index 0000000000..e160cb25e5 --- /dev/null +++ b/packages/editor-ui/src/components/RunDataJsonActions.vue @@ -0,0 +1,215 @@ + + + + + diff --git a/packages/editor-ui/src/components/RunDataTable.vue b/packages/editor-ui/src/components/RunDataTable.vue index 13e3d0ad59..e725e67787 100644 --- a/packages/editor-ui/src/components/RunDataTable.vue +++ b/packages/editor-ui/src/components/RunDataTable.vue @@ -1,5 +1,5 @@ - + - 1 ? 'dataMapping.mapAllKeysToField' - : 'dataMapping.mapSpecificColumnToField', + : 'dataMapping.mapKeyToField', { interpolate: { name: shorten(getPathNameFromTarget(el) || '', 16, 2) }, }, @@ -148,7 +128,7 @@ - +
@@ -156,24 +136,23 @@