From 159557b73ceb19138b83ff2155c46c638277ca26 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 2 Nov 2022 21:06:29 -0700 Subject: [PATCH 01/55] Enable warning validation on cypress --- packages/webapp/cypress/support/e2e.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webapp/cypress/support/e2e.ts b/packages/webapp/cypress/support/e2e.ts index 4e6f5813..25e0e1e5 100644 --- a/packages/webapp/cypress/support/e2e.ts +++ b/packages/webapp/cypress/support/e2e.ts @@ -8,6 +8,6 @@ Cypress.on('window:before:load', (win) => { afterEach(() => { cy.window().then((win) => { expect(win.console.error).to.have.callCount(0); - // expect(win.console.warn).to.have.callCount(0); + expect(win.console.warn).to.have.callCount(0); }); }); From 50267e9364d793e1688e1d7e0efa298e465f6398 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 3 Nov 2022 18:50:18 -0700 Subject: [PATCH 02/55] Improve exception. --- packages/mindplot/src/components/TopicFeature.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/mindplot/src/components/TopicFeature.js b/packages/mindplot/src/components/TopicFeature.js index a311414b..5e79625f 100644 --- a/packages/mindplot/src/components/TopicFeature.js +++ b/packages/mindplot/src/components/TopicFeature.js @@ -53,7 +53,15 @@ const TopicFeatureFactory = { const { icon: Icon } = TopicFeatureFactory._featuresMetadataById.filter( (elem) => elem.id === model.getType(), )[0]; - return new Icon(topic, model, readOnly); + + // Temporal catch to idenfify bug. Please, remove. + let result; + try { + result = new Icon(topic, model, readOnly); + } catch (e) { + throw new Error(`${e} - ${JSON.stringify(model)}`); + } + return result; }, }; From c0c0690bfb3b56f0ed9b3e1cccc7d910c55a454f Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 6 Nov 2022 18:56:26 -0800 Subject: [PATCH 03/55] Re-add missing icons. --- packages/mindplot/assets/icons/bullet_blue.png | Bin 0 -> 289 bytes packages/mindplot/assets/icons/bullet_green.png | Bin 0 -> 295 bytes packages/mindplot/assets/icons/bullet_orange.png | Bin 0 -> 283 bytes packages/mindplot/assets/icons/bullet_pink.png | Bin 0 -> 286 bytes packages/mindplot/assets/icons/bullet_purple.png | Bin 0 -> 294 bytes packages/mindplot/assets/icons/bullet_red.png | Bin 0 -> 287 bytes 6 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/mindplot/assets/icons/bullet_blue.png create mode 100644 packages/mindplot/assets/icons/bullet_green.png create mode 100644 packages/mindplot/assets/icons/bullet_orange.png create mode 100644 packages/mindplot/assets/icons/bullet_pink.png create mode 100644 packages/mindplot/assets/icons/bullet_purple.png create mode 100644 packages/mindplot/assets/icons/bullet_red.png diff --git a/packages/mindplot/assets/icons/bullet_blue.png b/packages/mindplot/assets/icons/bullet_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..a7651ec8a0f395be021bac262783ec604abf8c47 GIT binary patch literal 289 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i=8_H=O!u{izqk}bDmq0G^bpRL|W zr%VbmS`g2vdN_5Xhn$gw?joL;=H(n;{ewDX@>Vt8IAj)#jg!+?Z23wnf7d! zNAH#A4i6V)y_WtvZQ1hT)TAWgjoY{t%BOsI;8VOzQvNniDZk5xCy$)UQWb1PRjRoz l1#moJy|?3|{zvx%+ef43{&%10 z`rmr0`TyJtv;LcOX%laN^>UMjsi!CYUwmcZ|JfI2{-1ED=f8fLD)C;hoM$LyFlFzu{izqk|8%^q0F(5@h6w@ zuSbE=i9QOwKvPc#-iPCap~BwXFHIr_gU^WCH%x0(Cm8h3e{9o}5`YUO%{ zPiLR-*D%CfK42<(c~V-?1q(}8{p2N#A`c~!wa4X-$LfsZ0%WH-1^Zy?%r3<3e~Rbycg=S_Egdz d?>~Yc*m~Z+JF!m3&mHJ+22WQ%mvv4FO#s^$Z2kZM literal 0 HcmV?d00001 diff --git a/packages/mindplot/assets/icons/bullet_pink.png b/packages/mindplot/assets/icons/bullet_pink.png new file mode 100644 index 0000000000000000000000000000000000000000..0c9f73e3f58fec93410ca240016ef0522241aebe GIT binary patch literal 286 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i=8@N{tuu{izqk~P;M2a(o?Ym~XI z^0KETC^sqCab0$O!=k-0z-7w?M;1Xr?oLLkMCemR4UW__o=Snfs{&byph%e z=77^@l_n}qHB|c9pq{s5_I-v&H_y*pYjU~LY5(eqL#|WUf--*EUEAAGxHvbtb|TLazB;OXk;vd$@?2>?vIZ1eyC literal 0 HcmV?d00001 diff --git a/packages/mindplot/assets/icons/bullet_purple.png b/packages/mindplot/assets/icons/bullet_purple.png new file mode 100644 index 0000000000000000000000000000000000000000..52ba5036b95383f6c14176ae33300b859e4d27d8 GIT binary patch literal 294 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i>p@N{tuu{izq(ta+-M44kBpIe=q zx`X8@9}gS%(w5FYFVig+ojZ_cD5YzW==f41NB?BP0gvSsuL~|cX5(?+BsuSEuz#(i z(0!iz2et`~ZLD6*`-~P&eW1fC)8o%D^YrBE+t1g1f3V_>QFkv3+p8U`|6X{$=uzRE zYb8;$Jas}77I1~H-7TjsdDijKvCOxpB#s?yRPsxju2(W^mhtCPasN(mSRK@VvcWVc q!c)dr)HS~K;xqxD$MKK)8^oXLysE8u-|YeP1B0ilpUXO@geCyg%6BgS literal 0 HcmV?d00001 diff --git a/packages/mindplot/assets/icons/bullet_red.png b/packages/mindplot/assets/icons/bullet_red.png new file mode 100644 index 0000000000000000000000000000000000000000..0cd803115831933aa171497cfe9c1af983035f86 GIT binary patch literal 287 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i=8^mK6yu{izqk}mh50EX6wkMFui zZg|fh<-*g%H9O|;u|DY#DW^u;K&o-|vHe`x?xbw1zYx$2><(A#;6QU!sSfhO( ioL~suuJh6Vfb_?jd)=>7iZy|bXYh3Ob6Mw<&;$Tq>~Ep~ literal 0 HcmV?d00001 From 07603f73eef02f49650ca334c33b48333159582d Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 6 Nov 2022 18:58:30 -0800 Subject: [PATCH 04/55] Add missing icon mapping. --- packages/mindplot/src/components/persistence/iconToEmoji.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/mindplot/src/components/persistence/iconToEmoji.json b/packages/mindplot/src/components/persistence/iconToEmoji.json index ea272fb5..e73e4959 100644 --- a/packages/mindplot/src/components/persistence/iconToEmoji.json +++ b/packages/mindplot/src/components/persistence/iconToEmoji.json @@ -9,6 +9,7 @@ "funy_glasses": "๐Ÿ˜Ž", "funy_grin": "๐Ÿ˜›", "funy_kiss": "๐Ÿ˜˜", + "face_sad": "๐Ÿ˜ฉ", "funy_monkey": "๐Ÿต", "sport_basketball": "๐Ÿ€", "sport_football": "๐Ÿˆ", From e3298e44f7a6cb2e560db49e57f16070abf05847 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Fri, 11 Nov 2022 17:41:24 -0800 Subject: [PATCH 05/55] Remove icons. --- .../icon-picker/image-icon-tab/iconGroups.json | 4 ---- .../mindplot/assets/icons/thumb_thumb_down.svg | 12 ------------ packages/mindplot/assets/icons/thumb_thumb_up.svg | 1 - packages/mindplot/assets/icons/tick_cross.svg | 9 --------- packages/mindplot/assets/icons/tick_tick.svg | 9 --------- .../src/components/model/SvgIconFamily.json | 14 -------------- .../src/components/persistence/iconToEmoji.json | 6 +++++- .../test/unit/export/expected/complex.wxml | 2 +- .../mindplot/test/unit/export/expected/welcome.mm | 1 - .../test/unit/export/expected/welcome.wxml | 2 +- 10 files changed, 7 insertions(+), 53 deletions(-) delete mode 100644 packages/mindplot/assets/icons/thumb_thumb_down.svg delete mode 100644 packages/mindplot/assets/icons/thumb_thumb_up.svg delete mode 100644 packages/mindplot/assets/icons/tick_cross.svg delete mode 100644 packages/mindplot/assets/icons/tick_tick.svg diff --git a/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/iconGroups.json b/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/iconGroups.json index 871d77b8..15d62831 100644 --- a/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/iconGroups.json +++ b/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/iconGroups.json @@ -50,10 +50,6 @@ "chart_curve", "chart_pie", "chart_organisation", - "thumb_thumb_up", - "thumb_thumb_down", - "tick_tick", - "tick_cross", "onoff_add", "onoff_delete", "onoff_status_offline", diff --git a/packages/mindplot/assets/icons/thumb_thumb_down.svg b/packages/mindplot/assets/icons/thumb_thumb_down.svg deleted file mode 100644 index 5a5aa3ec..00000000 --- a/packages/mindplot/assets/icons/thumb_thumb_down.svg +++ /dev/null @@ -1,12 +0,0 @@ - - 70 Basic icons by Xicons.co - - - Layer 1 - - - - - - - \ No newline at end of file diff --git a/packages/mindplot/assets/icons/thumb_thumb_up.svg b/packages/mindplot/assets/icons/thumb_thumb_up.svg deleted file mode 100644 index 5615643a..00000000 --- a/packages/mindplot/assets/icons/thumb_thumb_up.svg +++ /dev/null @@ -1 +0,0 @@ -70 Basic icons by Xicons.co \ No newline at end of file diff --git a/packages/mindplot/assets/icons/tick_cross.svg b/packages/mindplot/assets/icons/tick_cross.svg deleted file mode 100644 index ba260776..00000000 --- a/packages/mindplot/assets/icons/tick_cross.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/packages/mindplot/assets/icons/tick_tick.svg b/packages/mindplot/assets/icons/tick_tick.svg deleted file mode 100644 index cfc410fd..00000000 --- a/packages/mindplot/assets/icons/tick_tick.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/packages/mindplot/src/components/model/SvgIconFamily.json b/packages/mindplot/src/components/model/SvgIconFamily.json index e82da877..918049fe 100644 --- a/packages/mindplot/src/components/model/SvgIconFamily.json +++ b/packages/mindplot/src/components/model/SvgIconFamily.json @@ -1,18 +1,4 @@ [ - { - "id": "thumb", - "icons": [ - "thumb_thumb_up", - "thumb_thumb_down" - ] - }, - { - "id": "tick", - "icons": [ - "tick_tick", - "tick_cross" - ] - }, { "id": "onoff", "icons": [ diff --git a/packages/mindplot/src/components/persistence/iconToEmoji.json b/packages/mindplot/src/components/persistence/iconToEmoji.json index e73e4959..a114aa95 100644 --- a/packages/mindplot/src/components/persistence/iconToEmoji.json +++ b/packages/mindplot/src/components/persistence/iconToEmoji.json @@ -65,5 +65,9 @@ "arrow_up": "โฌ†๏ธ", "arrow_down": "โฌ‡๏ธ", "arrow_left": "โฌ…๏ธ", - "arrow_right": "โžก๏ธ" + "arrow_right": "โžก๏ธ", + "thumb_thumb_down": "๐Ÿ‘Ž", + "thumb_thumb_up": "๐Ÿ‘", + "tick_tick": "โœ…", + "tick_cross": "โŽ" } \ No newline at end of file diff --git a/packages/mindplot/test/unit/export/expected/complex.wxml b/packages/mindplot/test/unit/export/expected/complex.wxml index 2a0eb881..1ca9f5bc 100644 --- a/packages/mindplot/test/unit/export/expected/complex.wxml +++ b/packages/mindplot/test/unit/export/expected/complex.wxml @@ -42,7 +42,7 @@ Attached below a sample of such screening questions]]> - diff --git a/packages/mindplot/test/unit/export/expected/welcome.wxml b/packages/mindplot/test/unit/export/expected/welcome.wxml index 875b6b9b..41b30219 100644 --- a/packages/mindplot/test/unit/export/expected/welcome.wxml +++ b/packages/mindplot/test/unit/export/expected/welcome.wxml @@ -1,3 +1,3 @@ \ No newline at end of file +Sibling]]> \ No newline at end of file From cfa54fbe8c835c061abb7171f51592797537cde0 Mon Sep 17 00:00:00 2001 From: Paulo Veiga Date: Sat, 12 Nov 2022 15:17:06 +0000 Subject: [PATCH 06/55] Dependencies cleanup --- packages/core-js/package.json | 3 +- packages/editor/package.json | 15 +- packages/editor/webpack.common.js | 3 +- packages/editor/webpack.prod.js | 12 +- packages/mindplot/package.json | 7 +- packages/mindplot/tsconfig.json | 2 - packages/web2d/package.json | 7 +- packages/webapp/package.json | 10 +- packages/webapp/webpack.dev.js | 1 - yarn.lock | 726 +++++++++++++----------------- 10 files changed, 341 insertions(+), 445 deletions(-) diff --git a/packages/core-js/package.json b/packages/core-js/package.json index 45af2a91..8d936597 100644 --- a/packages/core-js/package.json +++ b/packages/core-js/package.json @@ -27,8 +27,7 @@ "clean-webpack-plugin": "^4.0.0-alpha.0", "core-js": "^3.15.2", "webpack": "^5.74.0", - "webpack-cli": "^4.7.2", - "webpack-merge": "^5.8.0" + "webpack-cli": "^4.10.0" }, "dependencies": {} } diff --git a/packages/editor/package.json b/packages/editor/package.json index dd7ea00f..02c2410c 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -28,8 +28,8 @@ "copy-webpack-plugin": "^10.2.1", "css-loader": "^6.7.1", "cypress": "^10.11.0", - "eslint": "^7.14.0", "cypress-image-snapshot": "^4.0.1", + "eslint": "^7.14.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-react": "^7.31.10", "eslint-plugin-react-hooks": "^4.6.0", @@ -40,27 +40,22 @@ "style-loader": "^3.3.1", "ts-jest": "^27.1.0", "typescript": "^4.8.4", - "webpack": "^5.74.0", - "webpack-merge": "^5.8.0" + "webpack": "^5.75.0" }, "dependencies": { - "@emotion/styled": "^11.10.5", "@wisemapping/mindplot": "^5.0.15", "emoji-picker-react": "^4.4.4", - "react-color": "^2.19.3", - "react-dom": "^18.2.0", - "styled-components": "^5.3.6" + "react-color": "^2.19.3" }, "peerDependencies": { - "@emotion": "^11.10.5", "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", "@mui/icons-material": "^5.9.3", "@mui/material": "^5.10.11", - "lodash": "^4.17.14", + "@mui/material/esm": "^5.10.11", "react": "^18.2.0", "react-dom": "^18.2.0", "react-intl": "^6.2.1", "styled-components": "^5.3.6" } -} \ No newline at end of file +} diff --git a/packages/editor/webpack.common.js b/packages/editor/webpack.common.js index 7e8f60a3..3fb5870a 100644 --- a/packages/editor/webpack.common.js +++ b/packages/editor/webpack.common.js @@ -11,8 +11,7 @@ module.exports = { }, stats: { errorDetails: true, - }, - entry: { + }, entry: { 'editor.bundle': path.join(__dirname, 'src', 'index.tsx'), }, mode: 'development', diff --git a/packages/editor/webpack.prod.js b/packages/editor/webpack.prod.js index 0a89bc5f..d0393a58 100644 --- a/packages/editor/webpack.prod.js +++ b/packages/editor/webpack.prod.js @@ -7,14 +7,24 @@ const prodConfig = { usedExports: true, minimize: true, }, - externals: { + externals: [{ 'react': 'react', 'react-dom': 'react-dom', 'react-intl': 'react-intl', '@emotion/styled': '@emotion/styled', '@emotion/react': '@emotion/react', + "@mui/system": "@mui/system", + "@mui": "@mui", + "@mui/material": "@mui/material", + "@mui/material/esm": "@mui/material/esm", 'styled-components': 'styled-components', + 'xml-formatter': 'xml-formatter', + 'lodash-es': 'lodash-es', }, + /^@mui/, + /^lodash/ + + ], plugins: [new CleanWebpackPlugin()], }; diff --git a/packages/mindplot/package.json b/packages/mindplot/package.json index 5119f2e1..58774100 100644 --- a/packages/mindplot/package.json +++ b/packages/mindplot/package.json @@ -73,10 +73,9 @@ "ts-jest": "^27.1.2", "ts-loader": "^9.2.6", "ts-node": "^10.4.0", - "webpack": "^5.74.0", + "webpack": "^5.75.0", "webpack-bundle-analyzer": "^4.5.0", - "webpack-cli": "^4.7.2", - "webpack-dev-server": "^3.11.2", - "webpack-merge": "^5.8.0" + "webpack-cli": "^4.10.0", + "webpack-dev-server": "^4.11.1" } } diff --git a/packages/mindplot/tsconfig.json b/packages/mindplot/tsconfig.json index a4fc50d2..ba18f55e 100644 --- a/packages/mindplot/tsconfig.json +++ b/packages/mindplot/tsconfig.json @@ -16,8 +16,6 @@ }, "include": [ "src/**/*", - "../editor/src/classes/menu/AccountSettingsPanel.js", - "../editor/src/classes/menu/IMenu.ts" ], "exclude": [ "node_modules" diff --git a/packages/web2d/package.json b/packages/web2d/package.json index 384934e5..18dd17ee 100644 --- a/packages/web2d/package.json +++ b/packages/web2d/package.json @@ -43,10 +43,9 @@ "html-webpack-plugin": "^5.3.2", "nodemon": "^2.0.12", "start-server-and-test": "^1.14.0", - "webpack": "^5.74.0", - "webpack-cli": "^4.7.2", - "webpack-dev-server": "^3.11.2", - "webpack-merge": "^5.8.0" + "webpack": "^5.75.0", + "webpack-cli": "^4.10.0", + "webpack-dev-server": "^4.11.1" }, "dependencies": { "@wisemapping/core-js": "^0.4.0", diff --git a/packages/webapp/package.json b/packages/webapp/package.json index 96f52ad4..8c53718a 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -40,11 +40,11 @@ "start-server-and-test": "^1.12.0", "typescript": "^4.8.4", "webpack": "^5.74.0", - "webpack-bundle-analyzer": "^4.4.0", - "webpack-merge": "^5.7.3" + "webpack-bundle-analyzer": "^4.4.0" }, "dependencies": { "@emotion/react": "^11.10.4", + "@emotion/styled": "^11.10.5", "@mui/icons-material": "^5.9.3", "@mui/lab": "^5.0.0-alpha.98", "@mui/material": "^5.10.11", @@ -54,11 +54,13 @@ "axios": "^0.27.2", "dayjs": "^1.10.7", "react": "^18.2.0", + "react-dom": "^18.2.0", "react-ga4": "^1.4.1", "react-google-recaptcha": "^2.1.0", "react-intl": "^6.2.1", "react-query": "^3.39.1", "react-redux": "^7.2.2", - "react-router-dom": "^5.2.0" + "react-router-dom": "^5.2.0", + "styled-components": "^5.3.6" } -} \ No newline at end of file +} diff --git a/packages/webapp/webpack.dev.js b/packages/webapp/webpack.dev.js index 0286fbe7..e430f77d 100644 --- a/packages/webapp/webpack.dev.js +++ b/packages/webapp/webpack.dev.js @@ -8,7 +8,6 @@ module.exports = merge(common, { mode: 'development', devtool: 'source-map', devServer: { - contentBase: path.join(__dirname, 'dist'), port: 3000, hot: true, historyApiFallback: { diff --git a/yarn.lock b/yarn.lock index 4804f191..cd31789d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1700,6 +1700,11 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" +"@leichtgewicht/ip-codec@^2.0.1": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b" + integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A== + "@lerna/add@3.21.0": version "3.21.0" resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.21.0.tgz#27007bde71cc7b0a2969ab3c2f0ae41578b4577b" @@ -2825,6 +2830,36 @@ dependencies: "@babel/types" "^7.3.0" +"@types/body-parser@*": + version "1.19.2" + resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" + integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== + dependencies: + "@types/connect" "*" + "@types/node" "*" + +"@types/bonjour@^3.5.9": + version "3.5.10" + resolved "https://registry.yarnpkg.com/@types/bonjour/-/bonjour-3.5.10.tgz#0f6aadfe00ea414edc86f5d106357cda9701e275" + integrity sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw== + dependencies: + "@types/node" "*" + +"@types/connect-history-api-fallback@^1.3.5": + version "1.3.5" + resolved "https://registry.yarnpkg.com/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.3.5.tgz#d1f7a8a09d0ed5a57aee5ae9c18ab9b803205dae" + integrity sha512-h8QJa8xSb1WD4fpKBDcATDNGXghFj6/3GRWG6dhmRcu0RX1Ubasur2Uvx5aeEwlf0MwblEC2bMzzMQntxnw/Cw== + dependencies: + "@types/express-serve-static-core" "*" + "@types/node" "*" + +"@types/connect@*": + version "3.4.35" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" + integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== + dependencies: + "@types/node" "*" + "@types/eslint-scope@^3.7.3": version "3.7.4" resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.4.tgz#37fc1223f0786c39627068a12e94d6e6fc61de16" @@ -2851,6 +2886,25 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== +"@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18": + version "4.17.31" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz#a1139efeab4e7323834bb0226e62ac019f474b2f" + integrity sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + +"@types/express@*", "@types/express@^4.17.13": + version "4.17.14" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.14.tgz#143ea0557249bc1b3b54f15db4c81c3d4eb3569c" + integrity sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "^4.17.18" + "@types/qs" "*" + "@types/serve-static" "*" + "@types/glob@^7.1.1": version "7.2.0" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" @@ -2879,6 +2933,13 @@ resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz#4fc33a00c1d0c16987b1a20cf92d20614c55ac35" integrity sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg== +"@types/http-proxy@^1.17.8": + version "1.17.9" + resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.9.tgz#7f0e7931343761efde1e2bf48c40f02f3f75705a" + integrity sha512-QsbSjA/fSk7xB+UXlCT3wHBy5ai9wOcNDWwZAtud+jXhwOM3l+EYZh8Lng4+/6n8uar0J7xILzqftJdJ/Wdfkw== + dependencies: + "@types/node" "*" + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": version "2.0.4" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" @@ -2948,6 +3009,11 @@ dependencies: loud-rejection "*" +"@types/mime@*": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.1.tgz#5f8f2bca0a5863cb69bc0b0acd88c96cb1d4ae10" + integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA== + "@types/minimatch@*": version "5.1.2" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" @@ -2988,6 +3054,16 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w== +"@types/qs@*": + version "6.9.7" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" + integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + +"@types/range-parser@*": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" + integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== + "@types/react-dom@<18.0.0": version "17.0.18" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.18.tgz#8f7af38f5d9b42f79162eea7492e5a1caff70dc2" @@ -3037,6 +3113,11 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/retry@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d" + integrity sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA== + "@types/scheduler@*": version "0.16.2" resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" @@ -3047,6 +3128,21 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw== +"@types/serve-index@^1.9.1": + version "1.9.1" + resolved "https://registry.yarnpkg.com/@types/serve-index/-/serve-index-1.9.1.tgz#1b5e85370a192c01ec6cec4735cf2917337a6278" + integrity sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg== + dependencies: + "@types/express" "*" + +"@types/serve-static@*", "@types/serve-static@^1.13.10": + version "1.15.0" + resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.15.0.tgz#c7930ff61afb334e121a9da780aac0d9b8f34155" + integrity sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg== + dependencies: + "@types/mime" "*" + "@types/node" "*" + "@types/sinonjs__fake-timers@8.1.1": version "8.1.1" resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz#b49c2c70150141a15e0fa7e79cf1f92a72934ce3" @@ -3062,6 +3158,13 @@ resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.3.tgz#ff5e2f1902969d305225a047c8a0fd5c915cebef" integrity sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ== +"@types/sockjs@^0.3.33": + version "0.3.33" + resolved "https://registry.yarnpkg.com/@types/sockjs/-/sockjs-0.3.33.tgz#570d3a0b99ac995360e3136fd6045113b1bd236f" + integrity sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw== + dependencies: + "@types/node" "*" + "@types/source-list-map@*": version "0.1.2" resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" @@ -3113,6 +3216,13 @@ anymatch "^3.0.0" source-map "^0.6.0" +"@types/ws@^8.5.1": + version "8.5.3" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.3.tgz#7d25a1ffbecd3c4f2d35068d0b283c037003274d" + integrity sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w== + dependencies: + "@types/node" "*" + "@types/yargs-parser@*": version "21.0.0" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" @@ -3554,11 +3664,6 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv-errors@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" - integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ== - ajv-formats@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" @@ -3566,7 +3671,7 @@ ajv-formats@^2.1.1: dependencies: ajv "^8.0.0" -ajv-keywords@^3.1.0, ajv-keywords@^3.5.2: +ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== @@ -3578,7 +3683,7 @@ ajv-keywords@^5.0.0: dependencies: fast-deep-equal "^3.1.3" -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.9.1: +ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.9.1: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -3603,11 +3708,6 @@ ansi-colors@4.1.1: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== -ansi-colors@^3.0.0: - version "3.2.4" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" - integrity sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA== - ansi-colors@^4.1.1: version "4.1.3" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" @@ -3625,7 +3725,7 @@ ansi-escapes@^4.1.0, ansi-escapes@^4.2.1, ansi-escapes@^4.3.0: dependencies: type-fest "^0.21.3" -ansi-html-community@0.0.8: +ansi-html-community@^0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/ansi-html-community/-/ansi-html-community-0.0.8.tgz#69fbc4d6ccbe383f9736934ae34c3f8290f1bf41" integrity sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw== @@ -3679,14 +3779,6 @@ any-promise@^1.0.0: resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - anymatch@^3.0.0, anymatch@^3.0.3, anymatch@~3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" @@ -3792,7 +3884,7 @@ array-flatten@1.1.1: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== -array-flatten@^2.1.0: +array-flatten@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== @@ -3908,23 +4000,6 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -async-each@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" - integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== - -async-limiter@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" - integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== - -async@^2.6.4: - version "2.6.4" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" - integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== - dependencies: - lodash "^4.17.14" - async@^3.2.0: version "3.2.4" resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c" @@ -4174,23 +4249,11 @@ big.js@^5.2.2: resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== -binary-extensions@^1.0.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" - integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== - binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== -bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - bl@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" @@ -4233,17 +4296,15 @@ body-parser@1.20.1: type-is "~1.6.18" unpipe "1.0.0" -bonjour@^3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/bonjour/-/bonjour-3.5.0.tgz#8e890a183d8ee9a2393b3844c691a42bcf7bc9f5" - integrity sha512-RaVTblr+OnEli0r/ud8InrU7D+G0y6aJhlxaLa6Pwty4+xoxboF1BsUI45tujvRpbj9dQVoglChqonGAsjEBYg== +bonjour-service@^1.0.11: + version "1.0.14" + resolved "https://registry.yarnpkg.com/bonjour-service/-/bonjour-service-1.0.14.tgz#c346f5bc84e87802d08f8d5a60b93f758e514ee7" + integrity sha512-HIMbgLnk1Vqvs6B4Wq5ep7mxvj9sGz5d1JJyDNSGNIdA/w2MCz6GTjWTdjqOJV1bEPj+6IkxDvWNFKEBxNt4kQ== dependencies: - array-flatten "^2.1.0" - deep-equal "^1.0.1" + array-flatten "^2.1.2" dns-equal "^1.0.0" - dns-txt "^2.0.2" - multicast-dns "^6.0.1" - multicast-dns-service-types "^1.1.0" + fast-deep-equal "^3.1.3" + multicast-dns "^7.2.5" boolbase@^1.0.0: version "1.0.0" @@ -4258,7 +4319,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^2.3.1, braces@^2.3.2: +braces@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== @@ -4344,11 +4405,6 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== -buffer-indexof@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-indexof/-/buffer-indexof-1.1.1.tgz#52fabcc6a606d1a00302802648ef68f639da268c" - integrity sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g== - buffer@^5.5.0, buffer@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" @@ -4572,7 +4628,7 @@ check-more-types@2.24.0, check-more-types@^2.24.0: resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" integrity sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA== -chokidar@3.5.3, chokidar@^3.5.2: +chokidar@3.5.3, chokidar@^3.5.2, chokidar@^3.5.3: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -4587,25 +4643,6 @@ chokidar@3.5.3, chokidar@^3.5.2: optionalDependencies: fsevents "~2.3.2" -chokidar@^2.1.8: - version "2.1.8" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" - integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== - dependencies: - anymatch "^2.0.0" - async-each "^1.0.1" - braces "^2.3.2" - glob-parent "^3.1.0" - inherits "^2.0.3" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - normalize-path "^3.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.2.1" - upath "^1.1.1" - optionalDependencies: - fsevents "^1.2.7" - chownr@^1.1.1, chownr@^1.1.2, chownr@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" @@ -4807,7 +4844,7 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -colorette@^2.0.14, colorette@^2.0.16: +colorette@^2.0.10, colorette@^2.0.14, colorette@^2.0.16: version "2.0.19" resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798" integrity sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ== @@ -4946,10 +4983,10 @@ confusing-browser-globals@^1.0.10: resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81" integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA== -connect-history-api-fallback@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" - integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg== +connect-history-api-fallback@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz#647264845251a0daf25b97ce87834cace0f5f1c8" + integrity sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA== console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" @@ -5507,18 +5544,6 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== -deep-equal@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" - integrity sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g== - dependencies: - is-arguments "^1.0.4" - is-date-object "^1.0.1" - is-regex "^1.0.4" - object-is "^1.0.1" - object-keys "^1.1.1" - regexp.prototype.flags "^1.2.0" - deep-equal@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.0.5.tgz#55cd2fe326d83f9cbf7261ef0e060b3f724c5cb9" @@ -5550,13 +5575,12 @@ deepmerge@^4.2.2: resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== -default-gateway@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/default-gateway/-/default-gateway-4.2.0.tgz#167104c7500c2115f6dd69b0a536bb8ed720552b" - integrity sha512-h6sMrVB1VMWVrW13mSc6ia/DwYYw5MN6+exNu1OaJeFac5aSAvwM7lZ0NVfTABuSkQelr4h5oebg3KB1XPdjgA== +default-gateway@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/default-gateway/-/default-gateway-6.0.3.tgz#819494c888053bdb743edbf343d6cdf7f2943a71" + integrity sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg== dependencies: - execa "^1.0.0" - ip-regex "^2.1.0" + execa "^5.0.0" defaults@^1.0.3: version "1.0.4" @@ -5565,6 +5589,11 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" +define-lazy-prop@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" + integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== + define-properties@^1.1.3, define-properties@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" @@ -5700,20 +5729,12 @@ dns-equal@^1.0.0: resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" integrity sha512-z+paD6YUQsk+AbGCEM4PrOXSss5gd66QfcVBFTKR/HpFL9jCqikS94HYwKww6fQyO7IxrIIyUu+g0Ka9tUS2Cg== -dns-packet@^1.3.1: - version "1.3.4" - resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.4.tgz#e3455065824a2507ba886c55a89963bb107dec6f" - integrity sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA== +dns-packet@^5.2.2: + version "5.4.0" + resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-5.4.0.tgz#1f88477cf9f27e78a213fb6d118ae38e759a879b" + integrity sha512-EgqGeaBB8hLiHLZtp/IbaDQTL8pZ0+IvwzSHA6d7VyMDM+B9hgddEMa9xjK5oYnw0ci0JQ6g2XCD7/f6cafU6g== dependencies: - ip "^1.1.0" - safe-buffer "^5.0.1" - -dns-txt@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/dns-txt/-/dns-txt-2.0.2.tgz#b91d806f5d27188e4ab3e7d107d881a1cc4642b6" - integrity sha512-Ix5PrWjphuSoUXV/Zv5gaFHjnaJtb02F2+Si3Ht9dyJ87+Z/lMmy+dpNHtTGraNK958ndXq2i+GLkWsWHcKaBQ== - dependencies: - buffer-indexof "^1.0.0" + "@leichtgewicht/ip-codec" "^2.0.1" doctrine@^2.1.0: version "2.1.0" @@ -5931,13 +5952,6 @@ err-code@^1.0.0: resolved "https://registry.yarnpkg.com/err-code/-/err-code-1.1.2.tgz#06e0116d3028f6aef4806849eb0ea6a748ae6960" integrity sha512-CJAN+O0/yA1CKfRn9SXOGctSpEM7DCon/r/5r2eXFMY2zCCJBasFhcM5I+1kh3Ap11FsQCX+vGHceNPvpWKhoA== -errno@^0.1.3: - version "0.1.8" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f" - integrity sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A== - dependencies: - prr "~1.0.1" - error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -6507,11 +6521,6 @@ events@^3.2.0: resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== -eventsource@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-2.0.2.tgz#76dfcc02930fb2ff339520b6d290da573a9e8508" - integrity sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA== - execa@4.1.0, execa@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" @@ -6614,7 +6623,7 @@ expect@^29.0.0: jest-message-util "^29.2.1" jest-util "^29.2.1" -express@^4.17.1: +express@^4.17.3: version "4.18.2" resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== @@ -6765,7 +6774,7 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -faye-websocket@^0.11.3, faye-websocket@^0.11.4: +faye-websocket@^0.11.3: version "0.11.4" resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da" integrity sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g== @@ -6819,11 +6828,6 @@ file-entry-cache@^6.0.1: dependencies: flat-cache "^3.0.4" -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" @@ -7081,6 +7085,11 @@ fs-minipass@^1.2.7: dependencies: minipass "^2.6.0" +fs-monkey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.3.tgz#ae3ac92d53bb328efe0e9a1d9541f6ad8d48e2d3" + integrity sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q== + fs-write-stream-atomic@^1.0.8: version "1.0.10" resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" @@ -7096,14 +7105,6 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@^1.2.7: - version "1.2.13" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" - integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== - dependencies: - bindings "^1.5.0" - nan "^2.12.1" - fsevents@^2.3.2, fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" @@ -7442,7 +7443,7 @@ glur@^1.1.2: resolved "https://registry.yarnpkg.com/glur/-/glur-1.1.2.tgz#f20ea36db103bfc292343921f1f91e83c3467689" integrity sha512-l+8esYHTKOx2G/Aao4lEQ0bnHWg4fWtJbVoZZT9Knxi01pB8C80BR85nONLFwkkQoFRCmXY+BUcGZN3yZ2QsRA== -graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4, graceful-fs@^4.2.9: +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -7636,10 +7637,10 @@ html-encoding-sniffer@^2.0.1: dependencies: whatwg-encoding "^1.0.5" -html-entities@^1.3.1: - version "1.4.0" - resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.4.0.tgz#cfbd1b01d2afaf9adca1b10ae7dffab98c71d2dc" - integrity sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA== +html-entities@^2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.3.3.tgz#117d7626bece327fc8baace8868fa6f5ef856e46" + integrity sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA== html-escaper@^2.0.0: version "2.0.2" @@ -7733,17 +7734,18 @@ http-proxy-agent@^4.0.1: agent-base "6" debug "4" -http-proxy-middleware@0.19.1: - version "0.19.1" - resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz#183c7dc4aa1479150306498c210cdaf96080a43a" - integrity sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q== +http-proxy-middleware@^2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz#e1a4dd6979572c7ab5a4e4b55095d1f32a74963f" + integrity sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw== dependencies: - http-proxy "^1.17.0" - is-glob "^4.0.0" - lodash "^4.17.11" - micromatch "^3.1.10" + "@types/http-proxy" "^1.17.8" + http-proxy "^1.18.1" + is-glob "^4.0.1" + is-plain-obj "^3.0.0" + micromatch "^4.0.2" -http-proxy@^1.17.0: +http-proxy@^1.18.1: version "1.18.1" resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549" integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ== @@ -8021,14 +8023,6 @@ inquirer@^8.2.3: through "^2.3.6" wrap-ansi "^7.0.0" -internal-ip@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/internal-ip/-/internal-ip-4.3.0.tgz#845452baad9d2ca3b69c635a137acb9a0dad0907" - integrity sha512-S1zBo1D6zcsyuC6PMmY5+55YMILQ9av8lotMx447Bq6SAgo/sDK6y6uUKmuYhW7eacnIhFfsPmCNYdDzsnnDCg== - dependencies: - default-gateway "^4.2.0" - ipaddr.js "^1.9.0" - internal-slot@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" @@ -8071,30 +8065,20 @@ invert-kv@^1.0.0: resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" integrity sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ== -ip-regex@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" - integrity sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw== - ip@1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" integrity sha512-rBtCAQAJm8A110nbwn6YdveUnuZH3WrC36IwkRXxDnq53JvXA2NVQvB7IHyKomxK1MJ4VDNw3UtFDdXQ+AvLYA== -ip@^1.1.0, ip@^1.1.5: - version "1.1.8" - resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.8.tgz#ae05948f6b075435ed3307acce04629da8cdbf48" - integrity sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg== - -ipaddr.js@1.9.1, ipaddr.js@^1.9.0: +ipaddr.js@1.9.1: version "1.9.1" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== -is-absolute-url@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-3.0.3.tgz#96c6a22b6a23929b11ea0afb1836c36ad4a5d698" - integrity sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q== +ipaddr.js@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.0.1.tgz#eca256a7a877e917aeb368b0a7497ddf42ef81c0" + integrity sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng== is-accessor-descriptor@^0.1.6: version "0.1.6" @@ -8130,13 +8114,6 @@ is-bigint@^1.0.1: dependencies: has-bigints "^1.0.1" -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q== - dependencies: - binary-extensions "^1.0.0" - is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" @@ -8227,6 +8204,11 @@ is-directory@^0.3.1: resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" integrity sha512-yVChGzahRFvbkscn2MlwGismPO12i9+znNruC5gVEntG3qu0xQMzsGg/JFbrsqDOHtHFPci+V5aP5T9I+yeKqw== +is-docker@^2.0.0, is-docker@^2.1.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" + integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== + is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -8376,6 +8358,11 @@ is-plain-obj@^2.1.0: resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== +is-plain-obj@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-3.0.0.tgz#af6f2ea14ac5a646183a5bbdb5baabbc156ad9d7" + integrity sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA== + is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -8393,7 +8380,7 @@ is-potential-custom-element-name@^1.0.1: resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== -is-regex@^1.0.4, is-regex@^1.1.1, is-regex@^1.1.4: +is-regex@^1.1.1, is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== @@ -8507,10 +8494,12 @@ is-windows@^1.0.0, is-windows@^1.0.2: resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== -is-wsl@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" - integrity sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw== +is-wsl@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" + integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== + dependencies: + is-docker "^2.0.0" isarray@0.0.1: version "0.0.1" @@ -9366,11 +9355,6 @@ jss@10.9.2, jss@^10.9.2: array-includes "^3.1.5" object.assign "^4.1.3" -killable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892" - integrity sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg== - kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -9676,11 +9660,6 @@ log-update@^4.0.0: slice-ansi "^4.0.0" wrap-ansi "^6.2.0" -loglevel@^1.6.8: - version "1.8.0" - resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.8.0.tgz#e7ec73a57e1e7b419cb6c6ac06bf050b67356114" - integrity sha512-G6A/nJLRgWOuuwdNuA6koovfEV1YpqqAG4pRUlFaz3jj2QNZ8M4vBqnVA+HBTmU/AMNUtlOsMmSpF6NyOjztbA== - loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -9858,19 +9837,18 @@ mem@^1.1.0: dependencies: mimic-fn "^1.0.0" +memfs@^3.4.3: + version "3.4.10" + resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.4.10.tgz#4cdff7cfd21351a85e11b08aa276ebf100210a4d" + integrity sha512-0bCUP+L79P4am30yP1msPzApwuMQG23TjwlwdHeEV5MxioDR1a0AgB0T9FfggU52eJuDCq8WVwb5ekznFyWiTQ== + dependencies: + fs-monkey "^1.0.3" + memory-fs@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.2.0.tgz#f2bb25368bc121e391c2520de92969caee0a0290" integrity sha512-+y4mDxU4rvXXu5UDSGCGNiesFmwCHuefGMoPCO1WYucNYj7DsLqrFaa2fXVI0H+NNiPTwwzKwspn9yTZqUGqng== -memory-fs@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" - integrity sha512-cda4JKCxReDXFXRqOHPQscuIYg1PvxbE2S2GP45rnwfEK+vZaXC8C1OFvdHIbgw0DLzowXGVoxLaAmlgRy14GQ== - dependencies: - errno "^0.1.3" - readable-stream "^2.0.1" - meow@^3.3.0: version "3.7.0" resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" @@ -9939,7 +9917,7 @@ methods@~1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== -micromatch@^3.1.10, micromatch@^3.1.4: +micromatch@^3.1.10: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== @@ -9976,7 +9954,7 @@ mime-db@1.52.0, "mime-db@>= 1.43.0 < 2": resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12, mime-types@^2.1.27, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34: +mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== @@ -9988,11 +9966,6 @@ mime@1.6.0: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -mime@^2.4.4: - version "2.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367" - integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== - mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" @@ -10100,7 +10073,7 @@ mkdirp@*: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mkdirp@^0.5.1, mkdirp@^0.5.5, mkdirp@^0.5.6: +mkdirp@^0.5.1, mkdirp@^0.5.5: version "0.5.6" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== @@ -10174,17 +10147,12 @@ ms@2.1.3, ms@^2.0.0, ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -multicast-dns-service-types@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz#899f11d9686e5e05cb91b35d5f0e63b773cfc901" - integrity sha512-cnAsSVxIDsYt0v7HmC0hWZFwwXSh+E6PgCrREDuN/EsjgLwA5XRmlMHhSiDPrt6HxY1gTivEa/Zh7GtODoLevQ== - -multicast-dns@^6.0.1: - version "6.2.3" - resolved "https://registry.yarnpkg.com/multicast-dns/-/multicast-dns-6.2.3.tgz#a0ec7bd9055c4282f790c3c82f4e28db3b31b229" - integrity sha512-ji6J5enbMyGRHIAkAOu3WdV8nggqviKCEKtXcOqfphZZtQrmHKycfynJ2V7eVPUA4NhJ6V7Wf4TmGbTwKE9B6g== +multicast-dns@^7.2.5: + version "7.2.5" + resolved "https://registry.yarnpkg.com/multicast-dns/-/multicast-dns-7.2.5.tgz#77eb46057f4d7adbd16d9290fa7299f6fa64cced" + integrity sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg== dependencies: - dns-packet "^1.3.1" + dns-packet "^5.2.2" thunky "^1.0.2" multimatch@^3.0.0: @@ -10216,11 +10184,6 @@ mz@^2.5.0: object-assign "^4.0.1" thenify-all "^1.0.0" -nan@^2.12.1: - version "2.17.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb" - integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ== - nano-time@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/nano-time/-/nano-time-1.0.0.tgz#b0554f69ad89e22d0907f7a12b0993a5d96137ef" @@ -10304,10 +10267,10 @@ node-fetch@^2.5.0, node-fetch@^2.6.7: dependencies: whatwg-url "^5.0.0" -node-forge@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.10.0.tgz#32dea2afb3e9926f02ee5ce8794902691a676bf3" - integrity sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA== +node-forge@^1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" + integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA== node-gyp@^5.0.2: version "5.1.1" @@ -10392,13 +10355,6 @@ normalize-package-data@^3.0.0: semver "^7.3.4" validate-npm-package-license "^3.0.1" -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w== - dependencies: - remove-trailing-separator "^1.0.1" - normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -10528,7 +10484,7 @@ object-inspect@^1.12.2, object-inspect@^1.9.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== -object-is@^1.0.1, object-is@^1.1.4: +object-is@^1.1.4: version "1.1.5" resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== @@ -10658,6 +10614,15 @@ onetime@^5.1.0, onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" +open@^8.0.9: + version "8.4.0" + resolved "https://registry.yarnpkg.com/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8" + integrity sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q== + dependencies: + define-lazy-prop "^2.0.0" + is-docker "^2.1.1" + is-wsl "^2.2.0" + opencollective-postinstall@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259" @@ -10668,13 +10633,6 @@ opener@^1.5.2: resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== -opn@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/opn/-/opn-5.5.0.tgz#fc7164fab56d235904c51c3b27da6758ca3b9bfc" - integrity sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA== - dependencies: - is-wsl "^1.1.0" - optionator@^0.8.1, optionator@^0.8.2: version "0.8.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" @@ -10844,12 +10802,13 @@ p-reduce@^1.0.0: resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" integrity sha512-3Tx1T3oM1xO/Y8Gj0sWyE78EIJZ+t+aEmXUdvQgvGmSMri7aPTHoovbXEreWKkL5j21Er60XAWLTzKbAKYOujQ== -p-retry@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-3.0.1.tgz#316b4c8893e2c8dc1cfa891f406c4b422bebf328" - integrity sha512-XE6G4+YTTkT2a0UWb2kjZe8xNwf8bIbnqpc/IS/idOBVhyves0mK5OJgeocjx7q5pvX/6m23xuzVPYT1uGM73w== +p-retry@^4.5.0: + version "4.6.2" + resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-4.6.2.tgz#9baae7184057edd4e17231cee04264106e092a16" + integrity sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ== dependencies: - retry "^0.12.0" + "@types/retry" "0.12.0" + retry "^0.13.1" p-try@^1.0.0: version "1.0.0" @@ -11157,15 +11116,6 @@ pngjs@^6.0.0: resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-6.0.0.tgz#ca9e5d2aa48db0228a52c419c3308e87720da821" integrity sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg== -portfinder@^1.0.26: - version "1.0.32" - resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.32.tgz#2fe1b9e58389712429dc2bea5beb2146146c7f81" - integrity sha512-on2ZJVVDXRADWE6jnQaX0ioEylzgBpQk8r55NE4wjXW1ZxO+BgDlY6DXwj20i0V8eB4SenDQ00WEaxfiIQPcxg== - dependencies: - async "^2.6.4" - debug "^3.2.7" - mkdirp "^0.5.6" - posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -11359,11 +11309,6 @@ proxy-from-env@1.0.0: resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" integrity sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A== -prr@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" - integrity sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw== - ps-tree@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.2.0.tgz#5e7425b89508736cdd4f2224d028f7bb3f722ebd" @@ -11732,7 +11677,7 @@ read@1, read@~1.0.1: dependencies: mute-stream "~0.0.4" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -11764,15 +11709,6 @@ readdir-scoped-modules@^1.0.0: graceful-fs "^4.1.2" once "^1.3.0" -readdirp@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -11865,7 +11801,7 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.3.0, regexp.prototype.flags@^1.4.1, regexp.prototype.flags@^1.4.3: +regexp.prototype.flags@^1.3.0, regexp.prototype.flags@^1.4.1, regexp.prototype.flags@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== @@ -11918,11 +11854,6 @@ remove-accents@0.4.2: resolved "https://registry.yarnpkg.com/remove-accents/-/remove-accents-0.4.2.tgz#0a43d3aaae1e80db919e07ae254b285d9e1c7bb5" integrity sha512-7pXIJqJOq5tFgG1A2Zxti3Ht8jJF337m4sowbuHsW30ZnkQFnDzy9qBNhgzX8ZLW4+UBcXiiR7SwR6pokHsxiA== -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw== - renderkid@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-3.0.0.tgz#5fd823e4d6951d37358ecc9a58b1f06836b6268a" @@ -12102,10 +12033,10 @@ retry@^0.10.0: resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" integrity sha512-ZXUSQYTHdl3uS7IuCehYfMzKyIDBNoAuUblvy5oGO5UJSUTmStUUVPXbA9Qxd173Bgre53yCQczQuHgRWAdvJQ== -retry@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" - integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== +retry@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" + integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== reusify@^1.0.4: version "1.0.4" @@ -12216,15 +12147,6 @@ scheduler@^0.23.0: dependencies: loose-envify "^1.1.0" -schema-utils@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" - integrity sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g== - dependencies: - ajv "^6.1.0" - ajv-errors "^1.0.0" - ajv-keywords "^3.1.0" - schema-utils@^2.6.5: version "2.7.1" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.7.1.tgz#1ca4f32d1b24c590c203b8e7a50bf0ea4cd394d7" @@ -12258,12 +12180,12 @@ select-hose@^2.0.0: resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" integrity sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg== -selfsigned@^1.10.8: - version "1.10.14" - resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.14.tgz#ee51d84d9dcecc61e07e4aba34f229ab525c1574" - integrity sha512-lkjaiAye+wBZDCBsu5BGi0XiLRxeUlsGod5ZP924CRSEoGuZAw/f7y9RKu28rwTfiHVhdavhB0qH0INV6P1lEA== +selfsigned@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-2.1.1.tgz#18a7613d714c0cd3385c48af0075abf3f266af61" + integrity sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ== dependencies: - node-forge "^0.10.0" + node-forge "^1" semver-compare@^1.0.0: version "1.0.0" @@ -12531,18 +12453,7 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -sockjs-client@^1.5.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.6.1.tgz#350b8eda42d6d52ddc030c39943364c11dcad806" - integrity sha512-2g0tjOR+fRs0amxENLi/q5TiJTqY+WXFOzb5UwXndlK6TO3U/mirZznpx6w34HVMoc3g7cY24yC/ZMIYnDlfkw== - dependencies: - debug "^3.2.7" - eventsource "^2.0.2" - faye-websocket "^0.11.4" - inherits "^2.0.4" - url-parse "^1.5.10" - -sockjs@^0.3.21: +sockjs@^0.3.24: version "0.3.24" resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.24.tgz#c9bc8995f33a111bea0395ec30aa3206bdb5ccce" integrity sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ== @@ -13053,13 +12964,6 @@ supports-color@^5.3.0, supports-color@^5.5.0: dependencies: has-flag "^3.0.0" -supports-color@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" - integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== - dependencies: - has-flag "^3.0.0" - supports-color@^7.0.0, supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -13690,7 +13594,7 @@ untildify@^4.0.0: resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b" integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw== -upath@^1.1.1, upath@^1.2.0: +upath@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== @@ -13715,7 +13619,7 @@ urix@^0.1.0: resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg== -url-parse@^1.5.10, url-parse@^1.5.3: +url-parse@^1.5.3: version "1.5.10" resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== @@ -13910,7 +13814,7 @@ webpack-bundle-analyzer@^4.4.0, webpack-bundle-analyzer@^4.5.0: sirv "^1.0.7" ws "^7.3.1" -webpack-cli@^4.7.2: +webpack-cli@^4.10.0: version "4.10.0" resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.10.0.tgz#37c1d69c8d85214c5a65e589378f53aec64dab31" integrity sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w== @@ -13928,65 +13832,53 @@ webpack-cli@^4.7.2: rechoir "^0.7.0" webpack-merge "^5.7.3" -webpack-dev-middleware@^3.7.2: - version "3.7.3" - resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.7.3.tgz#0639372b143262e2b84ab95d3b91a7597061c2c5" - integrity sha512-djelc/zGiz9nZj/U7PTBi2ViorGJXEWo/3ltkPbDyxCXhhEXkW0ce99falaok4TPj+AsxLiXJR0EBOb0zh9fKQ== +webpack-dev-middleware@^5.3.1: + version "5.3.3" + resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-5.3.3.tgz#efae67c2793908e7311f1d9b06f2a08dcc97e51f" + integrity sha512-hj5CYrY0bZLB+eTO+x/j67Pkrquiy7kWepMHmUMoPsmcUaeEnQJqFzHJOyxgWlq746/wUuA64p9ta34Kyb01pA== dependencies: - memory-fs "^0.4.1" - mime "^2.4.4" - mkdirp "^0.5.1" + colorette "^2.0.10" + memfs "^3.4.3" + mime-types "^2.1.31" range-parser "^1.2.1" - webpack-log "^2.0.0" + schema-utils "^4.0.0" -webpack-dev-server@^3.11.2: - version "3.11.3" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-3.11.3.tgz#8c86b9d2812bf135d3c9bce6f07b718e30f7c3d3" - integrity sha512-3x31rjbEQWKMNzacUZRE6wXvUFuGpH7vr0lIEbYpMAG9BOxi0928QU1BBswOAP3kg3H1O4hiS+sq4YyAn6ANnA== +webpack-dev-server@^4.11.1: + version "4.11.1" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.11.1.tgz#ae07f0d71ca0438cf88446f09029b92ce81380b5" + integrity sha512-lILVz9tAUy1zGFwieuaQtYiadImb5M3d+H+L1zDYalYoDl0cksAB1UNyuE5MMWJrG6zR1tXkCP2fitl7yoUJiw== dependencies: - ansi-html-community "0.0.8" - bonjour "^3.5.0" - chokidar "^2.1.8" + "@types/bonjour" "^3.5.9" + "@types/connect-history-api-fallback" "^1.3.5" + "@types/express" "^4.17.13" + "@types/serve-index" "^1.9.1" + "@types/serve-static" "^1.13.10" + "@types/sockjs" "^0.3.33" + "@types/ws" "^8.5.1" + ansi-html-community "^0.0.8" + bonjour-service "^1.0.11" + chokidar "^3.5.3" + colorette "^2.0.10" compression "^1.7.4" - connect-history-api-fallback "^1.6.0" - debug "^4.1.1" - del "^4.1.1" - express "^4.17.1" - html-entities "^1.3.1" - http-proxy-middleware "0.19.1" - import-local "^2.0.0" - internal-ip "^4.3.0" - ip "^1.1.5" - is-absolute-url "^3.0.3" - killable "^1.0.1" - loglevel "^1.6.8" - opn "^5.5.0" - p-retry "^3.0.1" - portfinder "^1.0.26" - schema-utils "^1.0.0" - selfsigned "^1.10.8" - semver "^6.3.0" + connect-history-api-fallback "^2.0.0" + default-gateway "^6.0.3" + express "^4.17.3" + graceful-fs "^4.2.6" + html-entities "^2.3.2" + http-proxy-middleware "^2.0.3" + ipaddr.js "^2.0.1" + open "^8.0.9" + p-retry "^4.5.0" + rimraf "^3.0.2" + schema-utils "^4.0.0" + selfsigned "^2.1.1" serve-index "^1.9.1" - sockjs "^0.3.21" - sockjs-client "^1.5.0" + sockjs "^0.3.24" spdy "^4.0.2" - strip-ansi "^3.0.1" - supports-color "^6.1.0" - url "^0.11.0" - webpack-dev-middleware "^3.7.2" - webpack-log "^2.0.0" - ws "^6.2.1" - yargs "^13.3.2" + webpack-dev-middleware "^5.3.1" + ws "^8.4.2" -webpack-log@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/webpack-log/-/webpack-log-2.0.0.tgz#5b7928e0637593f119d32f6227c1e0ac31e1b47f" - integrity sha512-cX8G2vR/85UYG59FgkoMamwHUIkSSlV3bBMRsbxVXVUk2j6NleCKjQ/WE9eYg9WY4w25O9w8wKP4rzNZFmUcUg== - dependencies: - ansi-colors "^3.0.0" - uuid "^3.3.2" - -webpack-merge@^5.7.3, webpack-merge@^5.8.0: +webpack-merge@^5.7.3: version "5.8.0" resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.8.0.tgz#2b39dbf22af87776ad744c390223731d30a68f61" integrity sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q== @@ -14037,6 +13929,36 @@ webpack@^5.74.0: watchpack "^2.4.0" webpack-sources "^3.2.3" +webpack@^5.75.0: + version "5.75.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.75.0.tgz#1e440468647b2505860e94c9ff3e44d5b582c152" + integrity sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ== + dependencies: + "@types/eslint-scope" "^3.7.3" + "@types/estree" "^0.0.51" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/wasm-edit" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + acorn "^8.7.1" + acorn-import-assertions "^1.7.6" + browserslist "^4.14.5" + chrome-trace-event "^1.0.2" + enhanced-resolve "^5.10.0" + es-module-lexer "^0.9.0" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.9" + json-parse-even-better-errors "^2.3.1" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^3.1.0" + tapable "^2.1.1" + terser-webpack-plugin "^5.1.3" + watchpack "^2.4.0" + webpack-sources "^3.2.3" + websocket-driver@>=0.5.1, websocket-driver@^0.7.4: version "0.7.4" resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.4.tgz#89ad5295bbf64b480abcba31e4953aca706f5760" @@ -14278,18 +14200,16 @@ write@1.0.3: dependencies: mkdirp "^0.5.1" -ws@^6.2.1: - version "6.2.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.2.tgz#dd5cdbd57a9979916097652d78f1cc5faea0c32e" - integrity sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw== - dependencies: - async-limiter "~1.0.0" - ws@^7.3.1, ws@^7.4.6: version "7.5.9" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== +ws@^8.4.2: + version "8.11.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.11.0.tgz#6a0d36b8edfd9f96d8b25683db2f8d7de6e8e143" + integrity sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg== + xml-formatter@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/xml-formatter/-/xml-formatter-2.6.1.tgz#066ef3a100bd58ee3b943f0c503be63176d3d497" @@ -14367,14 +14287,6 @@ yargs-parser@20.x, yargs-parser@^20.2.2, yargs-parser@^20.2.3: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs-parser@^13.1.2: - version "13.1.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" - integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@^15.0.1: version "15.0.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-15.0.3.tgz#316e263d5febe8b38eef61ac092b33dfcc9b1115" @@ -14431,22 +14343,6 @@ yargs@^10.0.3: y18n "^3.2.1" yargs-parser "^8.1.0" -yargs@^13.3.2: - version "13.3.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" - integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.2" - yargs@^14.2.2: version "14.2.3" resolved "https://registry.yarnpkg.com/yargs/-/yargs-14.2.3.tgz#1a1c3edced1afb2a2fea33604bc6d1d8d688a414" From 1e8685778d30b73a56f8fe45f566239206f653bd Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Nov 2022 09:08:14 -0800 Subject: [PATCH 07/55] Add lazy loading. --- packages/webapp/src/app.tsx | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/packages/webapp/src/app.tsx b/packages/webapp/src/app.tsx index 7943ae48..fee7e8b5 100644 --- a/packages/webapp/src/app.tsx +++ b/packages/webapp/src/app.tsx @@ -1,5 +1,5 @@ import React, { ReactElement, Suspense } from 'react'; -import { IntlProvider } from 'react-intl'; +import { FormattedMessage, IntlProvider } from 'react-intl'; import { Route, Switch, Redirect, BrowserRouter as Router } from 'react-router-dom'; import ForgotPasswordSuccessPage from './components/forgot-password-success-page'; import RegistationPage from './components/registration-page'; @@ -67,15 +67,35 @@ const App = (): ReactElement => { - }> + + + + } + > - + + + + } + > + + - }> + + + + } + > From 73788bcfe1273384144a9ff1f677e8b7a23b4e19 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Nov 2022 09:49:04 -0800 Subject: [PATCH 08/55] Add missing translations --- packages/editor/lang/de.json | 3 +++ packages/editor/lang/en.json | 3 +++ packages/editor/lang/es.json | 3 +++ packages/editor/lang/fr.json | 3 +++ packages/editor/src/compiled-lang/de.json | 6 ++++++ packages/editor/src/compiled-lang/en.json | 6 ++++++ packages/editor/src/compiled-lang/es.json | 6 ++++++ packages/editor/src/compiled-lang/fr.json | 6 ++++++ .../action-widget/pane/icon-picker/index.tsx | 6 +++++- packages/webapp/lang/de.json | 3 +++ packages/webapp/lang/en.json | 19 +++++++++---------- packages/webapp/lang/es.json | 3 +++ packages/webapp/lang/fr.json | 3 +++ packages/webapp/src/compiled-lang/de.json | 6 ++++++ packages/webapp/src/compiled-lang/en.json | 14 +++++++------- packages/webapp/src/compiled-lang/es.json | 6 ++++++ packages/webapp/src/compiled-lang/fr.json | 6 ++++++ 17 files changed, 84 insertions(+), 18 deletions(-) diff --git a/packages/editor/lang/de.json b/packages/editor/lang/de.json index be9abfc5..2f6c4658 100644 --- a/packages/editor/lang/de.json +++ b/packages/editor/lang/de.json @@ -217,5 +217,8 @@ }, "shortcut-help-pane.undo": { "defaultMessage": "Rรผckgรคngerausgabe" + }, + "icon-picker.show-images": { + "defaultMessage": "Bilder anzeigen" } } \ No newline at end of file diff --git a/packages/editor/lang/en.json b/packages/editor/lang/en.json index bae131e0..dabfdf82 100644 --- a/packages/editor/lang/en.json +++ b/packages/editor/lang/en.json @@ -122,6 +122,9 @@ "editor.try-welcome-mobile": { "defaultMessage": "This edition space showcases some of the mindmap editor capabilities!" }, + "icon-picker.show-images": { + "defaultMessage": "Show images" + }, "link.help_text": { "defaultMessage": "Address is not valid" }, diff --git a/packages/editor/lang/es.json b/packages/editor/lang/es.json index 862abed1..c8a51130 100644 --- a/packages/editor/lang/es.json +++ b/packages/editor/lang/es.json @@ -211,5 +211,8 @@ }, "shortcut-help-pane.undo": { "defaultMessage": "Deshacer cambios" + }, + "icon-picker.show-images": { + "defaultMessage": "Mostrar imagenes" } } \ No newline at end of file diff --git a/packages/editor/lang/fr.json b/packages/editor/lang/fr.json index e152efe2..a825a154 100644 --- a/packages/editor/lang/fr.json +++ b/packages/editor/lang/fr.json @@ -211,5 +211,8 @@ }, "shortcut-help-pane.undo": { "defaultMessage": "Annuler l'รฉdition" + }, + "icon-picker.show-images": { + "defaultMessage": "Afficher les images" } } \ No newline at end of file diff --git a/packages/editor/src/compiled-lang/de.json b/packages/editor/src/compiled-lang/de.json index e1fc7c6c..b6e4c908 100644 --- a/packages/editor/src/compiled-lang/de.json +++ b/packages/editor/src/compiled-lang/de.json @@ -251,6 +251,12 @@ "value": "Diese Edition zeigt einige der Mindmap-Funktionen!" } ], + "icon-picker.show-images": [ + { + "type": 0, + "value": "Bilder anzeigen" + } + ], "link.help_text": [ { "type": 0, diff --git a/packages/editor/src/compiled-lang/en.json b/packages/editor/src/compiled-lang/en.json index f2961de0..b5578df4 100644 --- a/packages/editor/src/compiled-lang/en.json +++ b/packages/editor/src/compiled-lang/en.json @@ -245,6 +245,12 @@ "value": "This edition space showcases some of the mindmap editor capabilities!" } ], + "icon-picker.show-images": [ + { + "type": 0, + "value": "Show images" + } + ], "link.help_text": [ { "type": 0, diff --git a/packages/editor/src/compiled-lang/es.json b/packages/editor/src/compiled-lang/es.json index 54a2365b..bf33cf0d 100644 --- a/packages/editor/src/compiled-lang/es.json +++ b/packages/editor/src/compiled-lang/es.json @@ -245,6 +245,12 @@ "value": "ยกEste espacio de ediciรณn muestra algunas de las capacidades de mapas mentales!" } ], + "icon-picker.show-images": [ + { + "type": 0, + "value": "Mostrar imagenes" + } + ], "link.help_text": [ { "type": 0, diff --git a/packages/editor/src/compiled-lang/fr.json b/packages/editor/src/compiled-lang/fr.json index b63193cc..00f6663a 100644 --- a/packages/editor/src/compiled-lang/fr.json +++ b/packages/editor/src/compiled-lang/fr.json @@ -245,6 +245,12 @@ "value": "Cet espace d'รฉdition prรฉsente certaines des fonctionnalitรฉs des cartes mentales!" } ], + "icon-picker.show-images": [ + { + "type": 0, + "value": "Afficher les images" + } + ], "link.help_text": [ { "type": 0, diff --git a/packages/editor/src/components/action-widget/pane/icon-picker/index.tsx b/packages/editor/src/components/action-widget/pane/icon-picker/index.tsx index 8c5ec6d4..798c7620 100644 --- a/packages/editor/src/components/action-widget/pane/icon-picker/index.tsx +++ b/packages/editor/src/components/action-widget/pane/icon-picker/index.tsx @@ -23,6 +23,7 @@ import IconImageTab from './image-icon-tab'; import Switch from '@mui/material/Switch'; import FormGroup from '@mui/material/FormGroup'; import FormControlLabel from '@mui/material/FormControlLabel'; +import { FormattedMessage } from 'react-intl'; type IconPickerProp = { triggerClose: () => void; @@ -53,7 +54,10 @@ const IconPicker = ({ triggerClose, iconModel }: IconPickerProp): ReactElement = return (
- } /> + } + control={} + /> {checked && ( diff --git a/packages/webapp/lang/de.json b/packages/webapp/lang/de.json index 1f4f9946..3b7eb193 100644 --- a/packages/webapp/lang/de.json +++ b/packages/webapp/lang/de.json @@ -512,5 +512,8 @@ }, "footer.team": { "defaultMessage": "Team" + }, + "dialog.loading": { + "defaultMessage": "Wird geladen ..." } } \ No newline at end of file diff --git a/packages/webapp/lang/en.json b/packages/webapp/lang/en.json index 56d60063..28941073 100644 --- a/packages/webapp/lang/en.json +++ b/packages/webapp/lang/en.json @@ -116,6 +116,9 @@ "deletem.title": { "defaultMessage": "All selected maps will be deleted" }, + "dialog.loading": { + "defaultMessage": "Loading ..." + }, "duplicate.title": { "defaultMessage": "Duplicate" }, @@ -152,6 +155,9 @@ "footer.contactus": { "defaultMessage": "Contact Us" }, + "footer.donations": { + "defaultMessage": "Donations" + }, "footer.faq": { "defaultMessage": "F.A.Q." }, @@ -173,9 +179,6 @@ "footer.team": { "defaultMessage": "Our Team" }, - "footer.donations": { - "defaultMessage": "Donations" - }, "footer.termsandconditions": { "defaultMessage": "Term And Conditions" }, @@ -221,12 +224,12 @@ "import.description": { "defaultMessage": "You can import WiseMapping and Freemind maps to your list of maps. Select the file you want to import." }, + "import.error-file": { + "defaultMessage": "Import error {error}" + }, "import.title": { "defaultMessage": "Import existing mindmap" }, - "import.error-file": { - "defaultMessage": "Import failed: {error}" - }, "info.basic-info": { "defaultMessage": "Basic Info" }, @@ -311,10 +314,6 @@ "login.forgotpwd": { "defaultMessage": "Forgot Password ?" }, - "login.hsqldbcofig": { - "defaultMessage": "Although HSQLDB is bundled with WiseMapping by default during the installation, we do not recommend this database for production use. Please consider using MySQL 5.7 instead. You can find more information how to configure MySQL", - "description": "Missing production database configured" - }, "login.page-title": { "defaultMessage": "Login | WiseMapping" }, diff --git a/packages/webapp/lang/es.json b/packages/webapp/lang/es.json index 17876d6a..5fa1f76d 100644 --- a/packages/webapp/lang/es.json +++ b/packages/webapp/lang/es.json @@ -488,5 +488,8 @@ }, "editor.try-welcome-description": { "defaultMessage": "Regรญstrese para comenzar a crear, compartir y publicar una cantidad ilimitada de mapas mentales de forma gratuita." + }, + "dialog.loading": { + "defaultMessage": "Cargando ..." } } \ No newline at end of file diff --git a/packages/webapp/lang/fr.json b/packages/webapp/lang/fr.json index 3bb4b62c..8ef4fa15 100644 --- a/packages/webapp/lang/fr.json +++ b/packages/webapp/lang/fr.json @@ -515,5 +515,8 @@ }, "footer.team": { "defaultMessage": "Equipe" + }, + "dialog.loading": { + "defaultMessage": "Chargement ..." } } \ No newline at end of file diff --git a/packages/webapp/src/compiled-lang/de.json b/packages/webapp/src/compiled-lang/de.json index 250a88ea..5dfab2b8 100644 --- a/packages/webapp/src/compiled-lang/de.json +++ b/packages/webapp/src/compiled-lang/de.json @@ -233,6 +233,12 @@ "value": "Alle ausgewรคhlten Mindmaps werden gelรถscht" } ], + "dialog.loading": [ + { + "type": 0, + "value": "Wird geladen ..." + } + ], "duplicate.title": [ { "type": 0, diff --git a/packages/webapp/src/compiled-lang/en.json b/packages/webapp/src/compiled-lang/en.json index 834713c1..99d5dfe5 100644 --- a/packages/webapp/src/compiled-lang/en.json +++ b/packages/webapp/src/compiled-lang/en.json @@ -233,6 +233,12 @@ "value": "All selected maps will be deleted" } ], + "dialog.loading": [ + { + "type": 0, + "value": "Loading ..." + } + ], "duplicate.title": [ { "type": 0, @@ -446,7 +452,7 @@ "import.error-file": [ { "type": 0, - "value": "Import failed: " + "value": "Import error " }, { "type": 1, @@ -631,12 +637,6 @@ "value": "Forgot Password ?" } ], - "login.hsqldbcofig": [ - { - "type": 0, - "value": "Although HSQLDB is bundled with WiseMapping by default during the installation, we do not recommend this database for production use. Please consider using MySQL 5.7 instead. You can find more information how to configure MySQL" - } - ], "login.page-title": [ { "type": 0, diff --git a/packages/webapp/src/compiled-lang/es.json b/packages/webapp/src/compiled-lang/es.json index b5ec0f4d..89a82e7a 100644 --- a/packages/webapp/src/compiled-lang/es.json +++ b/packages/webapp/src/compiled-lang/es.json @@ -227,6 +227,12 @@ "value": "Todos los mapas seleccionados serรกn eliminados" } ], + "dialog.loading": [ + { + "type": 0, + "value": "Cargando ..." + } + ], "duplicate.title": [ { "type": 0, diff --git a/packages/webapp/src/compiled-lang/fr.json b/packages/webapp/src/compiled-lang/fr.json index 292f8d34..a950b9f7 100644 --- a/packages/webapp/src/compiled-lang/fr.json +++ b/packages/webapp/src/compiled-lang/fr.json @@ -233,6 +233,12 @@ "value": "Toutes les cartes sรฉlectionnรฉes seront supprimรฉes" } ], + "dialog.loading": [ + { + "type": 0, + "value": "Chargement ..." + } + ], "duplicate.title": [ { "type": 0, From 6dbf70ffbbc6459aaf375568a9079c1b126e7db3 Mon Sep 17 00:00:00 2001 From: Paulo Veiga Date: Sat, 12 Nov 2022 19:16:08 +0000 Subject: [PATCH 09/55] Remove global styles. --- .../pane/icon-picker/image-icon-tab/index.tsx | 4 +- .../pane/icon-picker/image-icon-tab/styled.ts | 29 +++++ .../pane/keyboard-shortcut-help/index.tsx | 5 +- .../pane/keyboard-shortcut-help/styled.ts | 35 ++++++ .../src/components/warning-dialog/index.tsx | 23 ++-- .../src/components/warning-dialog/styled.ts | 39 +++++++ packages/editor/src/global-styled.css | 102 ------------------ 7 files changed, 118 insertions(+), 119 deletions(-) create mode 100644 packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/styled.ts create mode 100644 packages/editor/src/components/action-widget/pane/keyboard-shortcut-help/styled.ts diff --git a/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/index.tsx b/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/index.tsx index eb8e57a0..5a81affc 100644 --- a/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/index.tsx +++ b/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/index.tsx @@ -3,6 +3,7 @@ import React, { ReactElement } from 'react'; import iconGroups from './iconGroups.json'; import { SvgImageIcon } from '@wisemapping/mindplot'; import NodeProperty from '../../../../../classes/model/node-property'; +import { SvgIcon } from './styled'; type IconImageTab = { iconModel: NodeProperty; @@ -14,8 +15,7 @@ const IconImageTab = ({ iconModel, triggerClose }: IconImageTab): ReactElement = {iconGroups.map((family, i) => ( {family.icons.map((icon: string) => ( - { diff --git a/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/styled.ts b/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/styled.ts new file mode 100644 index 00000000..4ff141d1 --- /dev/null +++ b/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/styled.ts @@ -0,0 +1,29 @@ +/* + * Copyright [2021] [wisemapping] + * + * Licensed under WiseMapping Public License, Version 1.0 (the "License"). + * It is basically the Apache License, Version 2.0 (the "License") plus the + * "powered by wisemapping" text requirement on every single page; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the license at + * + * http://www.wisemapping.org/license + * + * 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. + */ +import styled from 'styled-components'; + +export const SvgIcon = styled.img` + width: 25px; + height: 25px; + margin-left: 4px; + margin-top: 3px; + cursor: pointer; + &:hover { + background-color: #efefef; + } +`; diff --git a/packages/editor/src/components/action-widget/pane/keyboard-shortcut-help/index.tsx b/packages/editor/src/components/action-widget/pane/keyboard-shortcut-help/index.tsx index d0393b43..a8433508 100644 --- a/packages/editor/src/components/action-widget/pane/keyboard-shortcut-help/index.tsx +++ b/packages/editor/src/components/action-widget/pane/keyboard-shortcut-help/index.tsx @@ -17,10 +17,11 @@ */ import React, { ReactElement } from 'react'; import { FormattedMessage } from 'react-intl'; +import { ShortcutsContainer } from './styled'; const KeyboardShorcutsHelp = (): ReactElement => { return ( -
+ @@ -247,7 +248,7 @@ const KeyboardShorcutsHelp = (): ReactElement => {
-
+ ); }; export default KeyboardShorcutsHelp; diff --git a/packages/editor/src/components/action-widget/pane/keyboard-shortcut-help/styled.ts b/packages/editor/src/components/action-widget/pane/keyboard-shortcut-help/styled.ts new file mode 100644 index 00000000..7f945237 --- /dev/null +++ b/packages/editor/src/components/action-widget/pane/keyboard-shortcut-help/styled.ts @@ -0,0 +1,35 @@ +/* + * Copyright [2021] [wisemapping] + * + * Licensed under WiseMapping Public License, Version 1.0 (the "License"). + * It is basically the Apache License, Version 2.0 (the "License") plus the + * "powered by wisemapping" text requirement on every single page; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the license at + * + * http://www.wisemapping.org/license + * + * 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. + */ +import styled from 'styled-components'; + +export const ShortcutsContainer = styled.div` + font-size: 13px; + width: 100%; + & td { + padding: 3px; + white-space: nowrap; + } + & th { + padding: 5px; + white-space: nowrap; + } + & th { + background-color: #000000; + color: #ffffff; + } +`; diff --git a/packages/editor/src/components/warning-dialog/index.tsx b/packages/editor/src/components/warning-dialog/index.tsx index 50cd3ea8..2083baa9 100644 --- a/packages/editor/src/components/warning-dialog/index.tsx +++ b/packages/editor/src/components/warning-dialog/index.tsx @@ -16,7 +16,7 @@ * limitations under the License. */ import React, { useState } from 'react'; -import { Notifier } from './styled'; +import { CloseButton, InfoDialog, InfoDialogContent, Notifier } from './styled'; import { useIntl } from 'react-intl'; import CloseDialogSvg from '../../../images/close-dialog-icon.svg'; @@ -29,7 +29,6 @@ export type FooterPropsType = { const WarningDialog = ({ capability, message }: FooterPropsType): React.ReactElement => { const intl = useIntl(); - const [dialogClass, setDialogClass] = useState('tryInfoPanel'); let msgExt, msg: string; if (capability.mode !== 'viewonly' && capability.mode !== 'showcase' && capability.isMobile) { @@ -68,30 +67,28 @@ const WarningDialog = ({ capability, message }: FooterPropsType): React.ReactEle }); } - // if the toolbar is present, the alert must not overlap - const alertTopAdjustmentStyle = 'tryInfoPanelWithToolbar'; - + const [open, setOpen] = useState(msgExt || message); return ( <> - {(msgExt || message) && ( -
-
-
+ {open && ( + + + -
+ {msgExt &&

{`${msg} ${msgExt}`}

} {message &&

{message}

} -
-
+ + )} ); diff --git a/packages/editor/src/components/warning-dialog/styled.ts b/packages/editor/src/components/warning-dialog/styled.ts index 8f1ca71b..d072f12e 100644 --- a/packages/editor/src/components/warning-dialog/styled.ts +++ b/packages/editor/src/components/warning-dialog/styled.ts @@ -47,3 +47,42 @@ export const Notifier = styled.div` bottom: 10px; font-family: 'Montserrat', Arial, Helvetica, sans-serif; `; + +export const CloseButton = styled.div` + position: absolute; + top: 5px; + right: 5px; + + button { + cursor: pointer; + border-style: hidden; + background-color: transparent; + padding: 0px; + } + + button img { + width: 18px; + height: 18px; + filter: invert(73%) sepia(21%) saturate(4699%) hue-rotate(357deg) brightness(98%) contrast(108%); + } +`; + +export const InfoDialog = styled.div` + position: absolute; + text-align: center; + top: 70px; + left: 0; + right: 0; + background-color: white; + border: solid 2px #ffa800; + margin: auto; + border-radius: 9px; + width: 80%; +`; + +export const InfoDialogContent = styled.div` + padding-top: 10px; + padding-bottom: 10px; + padding-left: 5px; + padding-right: 5px; +`; diff --git a/packages/editor/src/global-styled.css b/packages/editor/src/global-styled.css index 141d3d4e..1befbfd4 100644 --- a/packages/editor/src/global-styled.css +++ b/packages/editor/src/global-styled.css @@ -1,11 +1,6 @@ /********************************************************************************/ /* Header & Toolbar Styles */ /********************************************************************************/ -html { - /* avoid bootstrap overriding font-size and breaking Mui */ - font-size: initial; -} - body { width: 100vw; height: 100vh; @@ -18,105 +13,8 @@ body { width: 100%; height: 100%; } -.panelIcon { - width: 25px; - height: 25px; - margin-left: 4px; - margin-top: 3px; - cursor: pointer; -} - -.panelIcon:hover { - background-color: #efefef; -} .wise-editor .popover { font-size: 13px; max-width: none; -} - -#keyboardTable { - font-size: 13px; - width: 100%; -} - -#keyboardTable td { - padding: 3px; - white-space: nowrap; -} - -#keyboardTable th { - padding: 5px; - white-space: nowrap; -} - -#keyboardTable th { - background-color: #000000; - color: #ffffff; -} - -.tryInfoPanel { - position: absolute; - text-align: center; - left: 0; - right: 0; - background-color: white; - border: solid 2px #ffa800; - margin: auto; - border-radius: 9px; - width: 80%; -} - -@media (min-width: 600px) { - .tryInfoPanel { - font-size: 15px; - } -} - -@media (max-width: 600px) { - .tryInfoPanel { - font-size: 13px; - } -} - -.tryInfoPanel .tryInfoPanelInner { - padding-top: 10px; - padding-bottom: 10px; - padding-left: 5px; - padding-right: 5px; -} - -.tryInfoPanel .tryInfoPanelInner .closeButton { - position: absolute; - top: 5px; - right: 5px; -} - -.tryInfoPanel .tryInfoPanelInner .closeButton button { - cursor: pointer; - border-style: hidden; - background-color: transparent; - padding: 0px; -} - -.tryInfoPanel .tryInfoPanelInner .closeButton button img { - width: 18px; - height: 18px; - filter: invert(73%) sepia(21%) saturate(4699%) hue-rotate(357deg) brightness(98%) contrast(108%); -} - -.tryInfoPanelWithToolbar { - top: 75px; -} - -.tryInfoPanelWithoutToolbar { - top: 5px; -} - -.tryInfoPanelClosed { - display: none; -} - -.tryInfoPanel>p { - justify-content: center; } \ No newline at end of file From 6c52933f84bdbf25475340f456ac1a92f21448b1 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Nov 2022 11:29:10 -0800 Subject: [PATCH 10/55] Fix lints warnings. --- .../src/components/DesignerBuilder.ts | 6 +++- .../src/components/ReadOnlyWidgetManager.ts | 30 +++++++++++++++++++ .../mindplot/src/components/ScreenManager.ts | 19 ++++++------ .../mindplot/src/components/WidgetManager.ts | 20 +++++-------- 4 files changed, 52 insertions(+), 23 deletions(-) create mode 100644 packages/mindplot/src/components/ReadOnlyWidgetManager.ts diff --git a/packages/mindplot/src/components/DesignerBuilder.ts b/packages/mindplot/src/components/DesignerBuilder.ts index e8160a61..953d2bd8 100644 --- a/packages/mindplot/src/components/DesignerBuilder.ts +++ b/packages/mindplot/src/components/DesignerBuilder.ts @@ -21,6 +21,7 @@ import PersistenceManager from './PersistenceManager'; import Designer from './Designer'; import { DesignerOptions } from './DesignerOptionsBuilder'; import WidgetManager from './WidgetManager'; +import ReadOnlyWidgetManager from './ReadOnlyWidgetManager'; let designer: Designer; @@ -35,8 +36,11 @@ export function buildDesigner(options: DesignerOptions): Designer { const persistence = options.persistenceManager; $assert(persistence, 'persistence must be defined'); PersistenceManager.init(persistence); - const widgetManager = options.widgetManager ? options.widgetManager : new WidgetManager(); + + // If not manager was specifed, use the readonly one. + const widgetManager = options.widgetManager ? options.widgetManager : new ReadOnlyWidgetManager(); WidgetManager.init(widgetManager); + return designer; } diff --git a/packages/mindplot/src/components/ReadOnlyWidgetManager.ts b/packages/mindplot/src/components/ReadOnlyWidgetManager.ts new file mode 100644 index 00000000..cdf55883 --- /dev/null +++ b/packages/mindplot/src/components/ReadOnlyWidgetManager.ts @@ -0,0 +1,30 @@ +/* + * Copyright [2021] [wisemapping] + * + * Licensed under WiseMapping Public License, Version 1.0 (the "License"). + * It is basically the Apache License, Version 2.0 (the "License") plus the + * "powered by wisemapping" text requirement on every single page; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the license at + * + * http://www.wisemapping.org/license + * + * 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. + */ +import WidgetManager from './WidgetManager'; + +class ReadOnlyWidgetManager extends WidgetManager { + showEditorForLink(): void { + throw new Error('ReadOnly widget manager does not support edition'); + } + + showEditorForNote(): void { + throw new Error('ReadOnly widget manager does not support edition'); + } +} + +export default ReadOnlyWidgetManager; diff --git a/packages/mindplot/src/components/ScreenManager.ts b/packages/mindplot/src/components/ScreenManager.ts index ba790d03..18b0a94d 100644 --- a/packages/mindplot/src/components/ScreenManager.ts +++ b/packages/mindplot/src/components/ScreenManager.ts @@ -99,18 +99,17 @@ class ScreenManager { private tocuchEvents = ['touchstart', 'touchend', 'touchmove']; - // the received type was changed from MouseEvent to "any", because we must support touch events - getWorkspaceMousePosition(event: any) { - let x; - let y; + getWorkspaceMousePosition(event: MouseEvent | TouchEvent): Point { + let x: number; + let y: number; if (this.mouseEvents.includes(event.type)) { // Retrieve current mouse position. - x = event.clientX; - y = event.clientY; + x = (event as MouseEvent).clientX; + y = (event as MouseEvent).clientY; } else if (this.tocuchEvents.includes(event.type)) { - x = event.touches[0].clientX; - y = event.touches[0].clientY; + x = (event as TouchEvent).touches[0].clientX; + y = (event as TouchEvent).touches[0].clientY; } // if value is zero assert throws error @@ -138,11 +137,11 @@ class ScreenManager { return new Point(x, y); } - getContainer() { + getContainer(): JQuery { return this._divContainer; } - setOffset(x: number, y: number) { + setOffset(x: number, y: number): void { this._padding.x = x; this._padding.y = y; } diff --git a/packages/mindplot/src/components/WidgetManager.ts b/packages/mindplot/src/components/WidgetManager.ts index d829a705..fa2cd0cc 100644 --- a/packages/mindplot/src/components/WidgetManager.ts +++ b/packages/mindplot/src/components/WidgetManager.ts @@ -6,9 +6,9 @@ import NoteIcon from './NoteIcon'; import Topic from './Topic'; import { $msg } from './Messages'; -class WidgetManager { +abstract class WidgetManager { // eslint-disable-next-line no-use-before-define - static _instance: WidgetManager; + private static _instance: WidgetManager; static init = (instance: WidgetManager) => { this._instance = instance; @@ -18,7 +18,7 @@ class WidgetManager { return this._instance; } - private createTooltip(mindmapElement, title, linkModel: LinkModel, noteModel: NoteModel) { + private createTooltip(mindmapElement, title: string, linkModel: LinkModel, noteModel: NoteModel) { const webcomponentShadowRoot = $($('#mindmap-comp')[0].shadowRoot); let tooltip = webcomponentShadowRoot.find('#mindplot-svg-tooltip'); if (!tooltip.length) { @@ -75,11 +75,11 @@ class WidgetManager { this.createTooltip(linkIcon.getElement().peer, $msg('LINK'), linkModel, undefined); } - createTooltipForNote(topic: Topic, noteModel: NoteModel, noteIcon: NoteIcon) { + createTooltipForNote(topic: Topic, noteModel: NoteModel, noteIcon: NoteIcon): void { this.createTooltip(noteIcon.getElement().peer, $msg('NOTE'), undefined, noteModel); } - configureEditorForLink(topic: Topic, linkModel: LinkModel, linkIcon: LinkIcon) { + configureEditorForLink(topic: Topic, linkModel: LinkModel, linkIcon: LinkIcon): void { const htmlImage = linkIcon.getElement().peer; htmlImage.addEvent('click', (evt) => { this.showEditorForLink(topic, linkModel, linkIcon); @@ -87,7 +87,7 @@ class WidgetManager { }); } - configureEditorForNote(topic: Topic, noteModel: NoteModel, noteIcon: NoteIcon) { + configureEditorForNote(topic: Topic, noteModel: NoteModel, noteIcon: NoteIcon): void { const htmlImage = noteIcon.getElement().peer; htmlImage.addEvent('click', (evt) => { this.showEditorForNote(topic, noteModel, noteIcon); @@ -95,13 +95,9 @@ class WidgetManager { }); } - showEditorForLink(topic: Topic, linkModel: LinkModel, linkIcon: LinkIcon) { - console.log('Show link editor not yet implemented'); - } + abstract showEditorForLink(topic: Topic, linkModel: LinkModel, linkIcon: LinkIcon): void; - showEditorForNote(topic: Topic, noteModel: NoteModel, noteIcon: NoteIcon) { - console.log('Show note editor not yet implemented'); - } + abstract showEditorForNote(topic: Topic, noteModel: NoteModel, noteIcon: NoteIcon): void; } export default WidgetManager; From 1723f41ea8eac942328369080e479516d64475d7 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Nov 2022 13:56:05 -0800 Subject: [PATCH 11/55] Migrate icons. --- .../image-icon-tab/iconGroups.json | 15 ---- .../icons/arrowc_rotate_anticlockwise.svg | 90 ------------------- .../assets/icons/arrowc_rotate_clockwise.svg | 90 ------------------- .../assets/icons/arrowc_turn_left.svg | 90 ------------------- .../assets/icons/arrowc_turn_right.svg | 90 ------------------- .../assets/icons/clock-svgrepo-com.svg | 80 ----------------- packages/mindplot/assets/icons/funy_angel.svg | 70 --------------- packages/mindplot/assets/icons/hard_cd.svg | 60 ------------- .../mindplot/assets/icons/hard_computer.svg | 11 --- .../mindplot/assets/icons/hard_controller.svg | 15 ---- .../assets/icons/hard_driver_disk.svg | 16 ---- .../mindplot/assets/icons/hard_microphone.svg | 10 --- .../mindplot/assets/icons/hard_printer.svg | 48 ---------- .../mindplot/assets/icons/hard_webcam.svg | 23 ----- packages/mindplot/assets/icons/mail_edit.svg | 51 ----------- .../mindplot/assets/icons/mail_envelop.svg | 10 --- packages/mindplot/assets/icons/mail_list.svg | 66 -------------- .../mindplot/assets/icons/mail_mailbox.svg | 11 --- .../src/components/model/SvgIconFamily.json | 28 +----- .../components/persistence/iconToEmoji.json | 17 +++- .../test/unit/export/expected/welcome.mm | 10 +-- .../test/unit/export/expected/welcome.wxml | 4 +- 22 files changed, 21 insertions(+), 884 deletions(-) delete mode 100644 packages/mindplot/assets/icons/arrowc_rotate_anticlockwise.svg delete mode 100644 packages/mindplot/assets/icons/arrowc_rotate_clockwise.svg delete mode 100644 packages/mindplot/assets/icons/arrowc_turn_left.svg delete mode 100644 packages/mindplot/assets/icons/arrowc_turn_right.svg delete mode 100644 packages/mindplot/assets/icons/clock-svgrepo-com.svg delete mode 100644 packages/mindplot/assets/icons/funy_angel.svg delete mode 100644 packages/mindplot/assets/icons/hard_cd.svg delete mode 100644 packages/mindplot/assets/icons/hard_computer.svg delete mode 100644 packages/mindplot/assets/icons/hard_controller.svg delete mode 100644 packages/mindplot/assets/icons/hard_driver_disk.svg delete mode 100644 packages/mindplot/assets/icons/hard_microphone.svg delete mode 100644 packages/mindplot/assets/icons/hard_printer.svg delete mode 100644 packages/mindplot/assets/icons/hard_webcam.svg delete mode 100644 packages/mindplot/assets/icons/mail_edit.svg delete mode 100644 packages/mindplot/assets/icons/mail_envelop.svg delete mode 100644 packages/mindplot/assets/icons/mail_list.svg delete mode 100644 packages/mindplot/assets/icons/mail_mailbox.svg diff --git a/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/iconGroups.json b/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/iconGroups.json index 15d62831..071f7330 100644 --- a/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/iconGroups.json +++ b/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/iconGroups.json @@ -21,14 +21,7 @@ "task_50", "task_75", "task_100", - "hard_cd", - "hard_computer", - "hard_controller", - "hard_driver_disk", "hard_ipod", - "hard_printer", - "hard_webcam", - "hard_microphone", "things_address_book", "things_wrench", "things_pin", @@ -72,14 +65,6 @@ "soft_folder_explore", "soft_rss", "soft_penguin", - "arrowc_rotate_anticlockwise", - "arrowc_rotate_clockwise", - "arrowc_turn_left", - "arrowc_turn_right", - "mail_envelop", - "mail_mailbox", - "mail_edit", - "mail_list", "flag_blue", "flag_green", "flag_orange", diff --git a/packages/mindplot/assets/icons/arrowc_rotate_anticlockwise.svg b/packages/mindplot/assets/icons/arrowc_rotate_anticlockwise.svg deleted file mode 100644 index 15b0a6d2..00000000 --- a/packages/mindplot/assets/icons/arrowc_rotate_anticlockwise.svg +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/arrowc_rotate_clockwise.svg b/packages/mindplot/assets/icons/arrowc_rotate_clockwise.svg deleted file mode 100644 index e47d5574..00000000 --- a/packages/mindplot/assets/icons/arrowc_rotate_clockwise.svg +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/arrowc_turn_left.svg b/packages/mindplot/assets/icons/arrowc_turn_left.svg deleted file mode 100644 index dd71b3f6..00000000 --- a/packages/mindplot/assets/icons/arrowc_turn_left.svg +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/arrowc_turn_right.svg b/packages/mindplot/assets/icons/arrowc_turn_right.svg deleted file mode 100644 index 239c8858..00000000 --- a/packages/mindplot/assets/icons/arrowc_turn_right.svg +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/clock-svgrepo-com.svg b/packages/mindplot/assets/icons/clock-svgrepo-com.svg deleted file mode 100644 index 2dbb9d68..00000000 --- a/packages/mindplot/assets/icons/clock-svgrepo-com.svg +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/funy_angel.svg b/packages/mindplot/assets/icons/funy_angel.svg deleted file mode 100644 index 6e6dcdf6..00000000 --- a/packages/mindplot/assets/icons/funy_angel.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/hard_cd.svg b/packages/mindplot/assets/icons/hard_cd.svg deleted file mode 100644 index 7e1e2eac..00000000 --- a/packages/mindplot/assets/icons/hard_cd.svg +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/hard_computer.svg b/packages/mindplot/assets/icons/hard_computer.svg deleted file mode 100644 index c140b67f..00000000 --- a/packages/mindplot/assets/icons/hard_computer.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/hard_controller.svg b/packages/mindplot/assets/icons/hard_controller.svg deleted file mode 100644 index c1328cfc..00000000 --- a/packages/mindplot/assets/icons/hard_controller.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/hard_driver_disk.svg b/packages/mindplot/assets/icons/hard_driver_disk.svg deleted file mode 100644 index f874d69d..00000000 --- a/packages/mindplot/assets/icons/hard_driver_disk.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/hard_microphone.svg b/packages/mindplot/assets/icons/hard_microphone.svg deleted file mode 100644 index e3f74e26..00000000 --- a/packages/mindplot/assets/icons/hard_microphone.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/hard_printer.svg b/packages/mindplot/assets/icons/hard_printer.svg deleted file mode 100644 index bc6c56a8..00000000 --- a/packages/mindplot/assets/icons/hard_printer.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/hard_webcam.svg b/packages/mindplot/assets/icons/hard_webcam.svg deleted file mode 100644 index 1ada323d..00000000 --- a/packages/mindplot/assets/icons/hard_webcam.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/mail_edit.svg b/packages/mindplot/assets/icons/mail_edit.svg deleted file mode 100644 index 5cee8370..00000000 --- a/packages/mindplot/assets/icons/mail_edit.svg +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/mail_envelop.svg b/packages/mindplot/assets/icons/mail_envelop.svg deleted file mode 100644 index dc5316c9..00000000 --- a/packages/mindplot/assets/icons/mail_envelop.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/mail_list.svg b/packages/mindplot/assets/icons/mail_list.svg deleted file mode 100644 index 33e152ee..00000000 --- a/packages/mindplot/assets/icons/mail_list.svg +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/mail_mailbox.svg b/packages/mindplot/assets/icons/mail_mailbox.svg deleted file mode 100644 index 540d99b1..00000000 --- a/packages/mindplot/assets/icons/mail_mailbox.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/packages/mindplot/src/components/model/SvgIconFamily.json b/packages/mindplot/src/components/model/SvgIconFamily.json index 918049fe..e0963cb8 100644 --- a/packages/mindplot/src/components/model/SvgIconFamily.json +++ b/packages/mindplot/src/components/model/SvgIconFamily.json @@ -45,15 +45,7 @@ { "id": "hard", "icons": [ - "hard_cd", - "hard_computer", - "hard_controller", - "hard_driver_disk", - "hard_ipod", - "hard_mouse", - "hard_printer", - "hard_webcam", - "hard_microphone" + "hard_ipod" ] }, { @@ -78,24 +70,6 @@ "soft_penguin" ] }, - { - "id": "arrowc", - "icons": [ - "arrowc_rotate_anticlockwise", - "arrowc_rotate_clockwise", - "arrowc_turn_left", - "arrowc_turn_right" - ] - }, - { - "id": "mail", - "icons": [ - "mail_envelop", - "mail_mailbox", - "mail_edit", - "mail_list" - ] - }, { "id": "flag", "icons": [ diff --git a/packages/mindplot/src/components/persistence/iconToEmoji.json b/packages/mindplot/src/components/persistence/iconToEmoji.json index a114aa95..faa6ee2b 100644 --- a/packages/mindplot/src/components/persistence/iconToEmoji.json +++ b/packages/mindplot/src/components/persistence/iconToEmoji.json @@ -69,5 +69,20 @@ "thumb_thumb_down": "๐Ÿ‘Ž", "thumb_thumb_up": "๐Ÿ‘", "tick_tick": "โœ…", - "tick_cross": "โŽ" + "tick_cross": "โŽ", + "arrowc_rotate_anticlockwise": "โ†ช๏ธ", + "arrowc_rotate_clockwise": "โ†ฉ๏ธ", + "arrowc_turn_left": "โฌ…๏ธ", + "arrowc_turn_right": "โžก๏ธ", + "mail_envelop": "โœ‰๏ธ", + "mail_mailbox": "๐Ÿ“ซ", + "mail_edit": "๐Ÿ“ง", + "mail_list": "๐Ÿ—’๏ธ", + "hard_cd": "๐Ÿ’ฟ", + "hard_computer": "๐Ÿ–ฅ๏ธ", + "hard_controller": "๐ŸŽฎ", + "hard_driver_disk": "๐Ÿ’พ", + "hard_printer": "๐Ÿ–จ๏ธ", + "hard_webcam": "๐Ÿ“ท", + "hard_microphone": "๐ŸŽค" } \ No newline at end of file diff --git a/packages/mindplot/test/unit/export/expected/welcome.mm b/packages/mindplot/test/unit/export/expected/welcome.mm index 5549b7da..7f3b385b 100644 --- a/packages/mindplot/test/unit/export/expected/welcome.mm +++ b/packages/mindplot/test/unit/export/expected/welcome.mm @@ -11,7 +11,6 @@ - @@ -40,9 +39,7 @@ - - - + @@ -56,7 +53,6 @@ - @@ -65,9 +61,7 @@ - - - + \ No newline at end of file diff --git a/packages/mindplot/test/unit/export/expected/welcome.wxml b/packages/mindplot/test/unit/export/expected/welcome.wxml index 41b30219..cf04d762 100644 --- a/packages/mindplot/test/unit/export/expected/welcome.wxml +++ b/packages/mindplot/test/unit/export/expected/welcome.wxml @@ -1,3 +1,3 @@ \ No newline at end of file +Follow the link !]]> \ No newline at end of file From c4a7458221f0042aec82c618b435bf8ec5813561 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Nov 2022 14:20:01 -0800 Subject: [PATCH 12/55] Fix accesibility errors. --- packages/editor/src/components/app-bar/index.tsx | 2 +- packages/editor/src/components/warning-dialog/index.tsx | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/editor/src/components/app-bar/index.tsx b/packages/editor/src/components/app-bar/index.tsx index e70b89c1..3f948644 100644 --- a/packages/editor/src/components/app-bar/index.tsx +++ b/packages/editor/src/components/app-bar/index.tsx @@ -95,7 +95,7 @@ const AppBar = ({ onClick: () => history.back(), }, { - render: () => , + render: () => , visible: !capability.isHidden('appbar-title'), }, { diff --git a/packages/editor/src/components/warning-dialog/index.tsx b/packages/editor/src/components/warning-dialog/index.tsx index 2083baa9..7a795c2d 100644 --- a/packages/editor/src/components/warning-dialog/index.tsx +++ b/packages/editor/src/components/warning-dialog/index.tsx @@ -81,6 +81,8 @@ const WarningDialog = ({ capability, message }: FooterPropsType): React.ReactEle e.preventDefault(); e.stopPropagation(); }} + name="close" + aria-label="Close" > From d0297f43f4bf5dcc096fff976ba537c5ab2dcdeb Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Nov 2022 15:11:05 -0800 Subject: [PATCH 13/55] Update dependencies --- packages/editor/package.json | 2 +- packages/mindplot/package.json | 2 +- packages/web2d/package.json | 2 +- packages/webapp/package.json | 2 +- yarn.lock | 984 +++++++++++++++++---------------- 5 files changed, 504 insertions(+), 488 deletions(-) diff --git a/packages/editor/package.json b/packages/editor/package.json index 02c2410c..37fa9c50 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -20,7 +20,7 @@ "devDependencies": { "@babel/preset-env": "^7.19.4", "@formatjs/cli": "^5.1.3", - "@testing-library/react": "^12.0.0", + "@testing-library/react": "^13.4.0", "@types/jest": "^29.0.0", "babel-plugin-transform-require-context": "^0.1.1", "babel-polyfill": "^6.26.0", diff --git a/packages/mindplot/package.json b/packages/mindplot/package.json index 58774100..cfe5e4a5 100644 --- a/packages/mindplot/package.json +++ b/packages/mindplot/package.json @@ -60,7 +60,7 @@ "cypress-image-snapshot": "^4.0.1", "eslint": "^8.4.1", "eslint-config-airbnb-base": "^14.2.1", - "eslint-config-standard": "^16.0.3", + "eslint-config-standard": "^17.0.0", "eslint-nibble": "^8.0.0", "eslint-plugin-cypress": "^2.12.1", "eslint-plugin-import": "^2.25.4", diff --git a/packages/web2d/package.json b/packages/web2d/package.json index 18dd17ee..133d53ea 100644 --- a/packages/web2d/package.json +++ b/packages/web2d/package.json @@ -36,7 +36,7 @@ "cypress-image-snapshot": "^4.0.1", "eslint": "^5.16.0", "eslint-config-airbnb-base": "^14.2.1", - "eslint-config-standard": "^16.0.3", + "eslint-config-standard": "^17.0.0", "eslint-import-resolver-webpack": "^0.13.2", "eslint-plugin-cypress": "^2.12.1", "eslint-plugin-import": "^2.25.3", diff --git a/packages/webapp/package.json b/packages/webapp/package.json index 8c53718a..78ae9ec0 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -23,7 +23,7 @@ "private": false, "devDependencies": { "@formatjs/cli": "^2.13.15", - "@testing-library/cypress": "^7.0.3", + "@testing-library/cypress": "^8.0.3", "@types/testing-library__cypress": "^5.0.8", "@typescript-eslint/eslint-plugin": "^5.41.0", "@typescript-eslint/parser": "^5.41.0", diff --git a/yarn.lock b/yarn.lock index cd31789d..c6572a23 100644 --- a/yarn.lock +++ b/yarn.lock @@ -31,38 +31,38 @@ dependencies: "@babel/highlight" "^7.18.6" -"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.19.4", "@babel/compat-data@^7.20.0": +"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.20.0", "@babel/compat-data@^7.20.1": version "7.20.1" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.1.tgz#f2e6ef7790d8c8dbf03d379502dcc246dcce0b30" integrity sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ== "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.18.13", "@babel/core@^7.7.2", "@babel/core@^7.8.0": - version "7.19.6" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.6.tgz#7122ae4f5c5a37c0946c066149abd8e75f81540f" - integrity sha512-D2Ue4KHpc6Ys2+AxpIx1BZ8+UegLLLE2p3KJEuJRKmokHOtl49jQ5ny1773KsGLZs8MQvBidAF6yWUJxRqtKtg== + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.2.tgz#8dc9b1620a673f92d3624bd926dc49a52cf25b92" + integrity sha512-w7DbG8DtMrJcFOi4VrLm+8QM4az8Mo+PuLBKLp2zrYRCow8W/f9xiXm5sN53C8HksCyDQwCKha9JiDoIyPjT2g== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.19.6" - "@babel/helper-compilation-targets" "^7.19.3" - "@babel/helper-module-transforms" "^7.19.6" - "@babel/helpers" "^7.19.4" - "@babel/parser" "^7.19.6" + "@babel/generator" "^7.20.2" + "@babel/helper-compilation-targets" "^7.20.0" + "@babel/helper-module-transforms" "^7.20.2" + "@babel/helpers" "^7.20.1" + "@babel/parser" "^7.20.2" "@babel/template" "^7.18.10" - "@babel/traverse" "^7.19.6" - "@babel/types" "^7.19.4" + "@babel/traverse" "^7.20.1" + "@babel/types" "^7.20.2" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.1" semver "^6.3.0" -"@babel/generator@^7.19.6", "@babel/generator@^7.20.1", "@babel/generator@^7.7.2": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.1.tgz#ef32ecd426222624cbd94871a7024639cf61a9fa" - integrity sha512-u1dMdBUmA7Z0rBB97xh8pIhviK7oItYOkjbsCxTWMknyvbQRBwX7/gn4JXurRdirWMFh+ZtYARqkA6ydogVZpg== +"@babel/generator@^7.20.1", "@babel/generator@^7.20.2", "@babel/generator@^7.7.2": + version "7.20.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.4.tgz#4d9f8f0c30be75fd90a0562099a26e5839602ab8" + integrity sha512-luCf7yk/cm7yab6CAW1aiFnmEfBJplb/JojV56MYEK7ziWfGmFlTfmL9Ehwfy4gFhbjBfWO1wj7/TuSbVNEEtA== dependencies: - "@babel/types" "^7.20.0" + "@babel/types" "^7.20.2" "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" @@ -81,7 +81,7 @@ "@babel/helper-explode-assignable-expression" "^7.18.6" "@babel/types" "^7.18.9" -"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.19.0", "@babel/helper-compilation-targets@^7.19.3": +"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.0": version "7.20.0" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.0.tgz#6bf5374d424e1b3922822f1d9bdaa43b1a139d0a" integrity sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ== @@ -91,17 +91,17 @@ browserslist "^4.21.3" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.19.0.tgz#bfd6904620df4e46470bae4850d66be1054c404b" - integrity sha512-NRz8DwF4jT3UfrmUoZjd0Uph9HQnP30t7Ash+weACcyNkiYTywpIjDBgReJMKgr+n86sn2nPVVmJ28Dm053Kqw== +"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.2.tgz#3c08a5b5417c7f07b5cf3dfb6dc79cbec682e8c2" + integrity sha512-k22GoYRAHPYr9I+Gvy2ZQlAe5mGy8BqWst2wRt8cwIufWTxrsVshhIBvYNqC80N0GSFWTsqRVexOtfzlgOEDvA== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-function-name" "^7.19.0" "@babel/helper-member-expression-to-functions" "^7.18.9" "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-replace-supers" "^7.18.9" + "@babel/helper-replace-supers" "^7.19.1" "@babel/helper-split-export-declaration" "^7.18.6" "@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.19.0": @@ -165,19 +165,19 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.19.6": - version "7.19.6" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.19.6.tgz#6c52cc3ac63b70952d33ee987cbee1c9368b533f" - integrity sha512-fCmcfQo/KYr/VXXDIyd3CBGZ6AFhPFy1TfSEJ+PilGVlQT6jcbqtHAM4C1EciRqMza7/TpOUZliuSH+U6HAhJw== +"@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.19.6", "@babel/helper-module-transforms@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.2.tgz#ac53da669501edd37e658602a21ba14c08748712" + integrity sha512-zvBKyJXRbmK07XhMuujYoJ48B5yvvmM6+wcpv6Ivj4Yg6qO7NOZOSnvZN9CRl1zz1Z4cKf8YejmCMh8clOoOeA== dependencies: "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-simple-access" "^7.19.4" + "@babel/helper-simple-access" "^7.20.2" "@babel/helper-split-export-declaration" "^7.18.6" "@babel/helper-validator-identifier" "^7.19.1" "@babel/template" "^7.18.10" - "@babel/traverse" "^7.19.6" - "@babel/types" "^7.19.4" + "@babel/traverse" "^7.20.1" + "@babel/types" "^7.20.2" "@babel/helper-optimise-call-expression@^7.18.6": version "7.18.6" @@ -186,10 +186,10 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz#4796bb14961521f0f8715990bee2fb6e51ce21bf" - integrity sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw== +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" + integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== "@babel/helper-remap-async-to-generator@^7.18.6", "@babel/helper-remap-async-to-generator@^7.18.9": version "7.18.9" @@ -201,7 +201,7 @@ "@babel/helper-wrap-function" "^7.18.9" "@babel/types" "^7.18.9" -"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.18.9": +"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.19.1": version "7.19.1" resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.19.1.tgz#e1592a9b4b368aa6bdb8784a711e0bcbf0612b78" integrity sha512-T7ahH7wV0Hfs46SFh5Jz3s0B6+o8g3c+7TMxu7xKfmHikg7EAZ3I2Qk9LFhjxXq8sL7UkP5JflezNwoZa8WvWw== @@ -212,12 +212,12 @@ "@babel/traverse" "^7.19.1" "@babel/types" "^7.19.0" -"@babel/helper-simple-access@^7.19.4": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.19.4.tgz#be553f4951ac6352df2567f7daa19a0ee15668e7" - integrity sha512-f9Xq6WqBFqaDfbCzn2w85hwklswz5qsKlh7f08w4Y9yhJHpnNC0QemtSkK5YyOY8kPGvyiwdzZksGUhnGdaUIg== +"@babel/helper-simple-access@^7.19.4", "@babel/helper-simple-access@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" + integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== dependencies: - "@babel/types" "^7.19.4" + "@babel/types" "^7.20.2" "@babel/helper-skip-transparent-expression-wrappers@^7.18.9": version "7.20.0" @@ -258,7 +258,7 @@ "@babel/traverse" "^7.19.0" "@babel/types" "^7.19.0" -"@babel/helpers@^7.19.4": +"@babel/helpers@^7.20.1": version "7.20.1" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.1.tgz#2ab7a0fcb0a03b5bf76629196ed63c2d7311f4c9" integrity sha512-J77mUVaDTUJFZ5BpP6mMn6OIl3rEWymk2ZxDBQJUG3P+PbmyMcF3bYWvz0ma69Af1oobDqT/iAsvzhB58xhQUg== @@ -276,10 +276,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.4", "@babel/parser@^7.18.10", "@babel/parser@^7.19.6", "@babel/parser@^7.20.1": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.1.tgz#3e045a92f7b4623cafc2425eddcb8cf2e54f9cc5" - integrity sha512-hp0AYxaZJhxULfM1zyp7Wgr+pSUKBcP3M+PHnSzWGdXOzg/kHWIgiUWARvubhUKGOEw3xqY4x+lyZ9ytBVcELw== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.4", "@babel/parser@^7.18.10", "@babel/parser@^7.20.1", "@babel/parser@^7.20.2": + version "7.20.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.3.tgz#5358cf62e380cf69efcb87a7bb922ff88bfac6e2" + integrity sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg== "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": version "7.18.6" @@ -297,7 +297,7 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.18.9" "@babel/plugin-proposal-optional-chaining" "^7.18.9" -"@babel/plugin-proposal-async-generator-functions@^7.19.1": +"@babel/plugin-proposal-async-generator-functions@^7.20.1": version "7.20.1" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.1.tgz#352f02baa5d69f4e7529bdac39aaa02d41146af9" integrity sha512-Gh5rchzSwE4kC+o/6T8waD0WHEQIsDmjltY8WnWRXHUdH8axZhuH86Ov9M72YhJfDrZseQwuuWaaIT/TmePp3g== @@ -372,16 +372,16 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.19.4": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.19.4.tgz#a8fc86e8180ff57290c91a75d83fe658189b642d" - integrity sha512-wHmj6LDxVDnL+3WhXteUBaoM1aVILZODAUjg11kHqG4cOlfgMQGxw6aCgvrXrmaJR3Bn14oZhImyCPZzRpC93Q== +"@babel/plugin-proposal-object-rest-spread@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.2.tgz#a556f59d555f06961df1e572bb5eca864c84022d" + integrity sha512-Ks6uej9WFK+fvIMesSqbAto5dD8Dz4VuuFvGJFKgIGSkJuRGcrwGECPA1fDgQK3/DbExBJpEkTeYeB8geIFCSQ== dependencies: - "@babel/compat-data" "^7.19.4" - "@babel/helper-compilation-targets" "^7.19.3" - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/compat-data" "^7.20.1" + "@babel/helper-compilation-targets" "^7.20.0" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.18.8" + "@babel/plugin-transform-parameters" "^7.20.1" "@babel/plugin-proposal-optional-catch-binding@^7.18.6": version "7.18.6" @@ -468,7 +468,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-import-assertions@^7.18.6": +"@babel/plugin-syntax-import-assertions@^7.20.0": version "7.20.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz#bb50e0d4bea0957235390641209394e87bdb9cc4" integrity sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ== @@ -582,25 +582,25 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-block-scoping@^7.19.4": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.0.tgz#91fe5e6ffc9ba13cb6c95ed7f0b1204f68c988c5" - integrity sha512-sXOohbpHZSk7GjxK9b3dKB7CfqUD5DwOH+DggKzOQ7TXYP+RCSbRykfjQmn/zq+rBjycVRtLf9pYhAaEJA786w== +"@babel/plugin-transform-block-scoping@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.2.tgz#f59b1767e6385c663fd0bce655db6ca9c8b236ed" + integrity sha512-y5V15+04ry69OV2wULmwhEA6jwSWXO1TwAtIwiPXcvHcoOQUqpyMVd2bDsQJMW8AurjulIyUV8kDqtjSwHy1uQ== dependencies: - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-plugin-utils" "^7.20.2" -"@babel/plugin-transform-classes@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.19.0.tgz#0e61ec257fba409c41372175e7c1e606dc79bb20" - integrity sha512-YfeEE9kCjqTS9IitkgfJuxjcEtLUHMqa8yUJ6zdz8vR7hKuo6mOy2C05P0F1tdMmDCeuyidKnlrw/iTppHcr2A== +"@babel/plugin-transform-classes@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.20.2.tgz#c0033cf1916ccf78202d04be4281d161f6709bb2" + integrity sha512-9rbPp0lCVVoagvtEyQKSo5L8oo0nQS/iif+lwlAz29MccX2642vWDlSZK+2T2buxbopotId2ld7zZAzRfz9j1g== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-compilation-targets" "^7.19.0" + "@babel/helper-compilation-targets" "^7.20.0" "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-function-name" "^7.19.0" "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-plugin-utils" "^7.19.0" - "@babel/helper-replace-supers" "^7.18.9" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-replace-supers" "^7.19.1" "@babel/helper-split-export-declaration" "^7.18.6" globals "^11.1.0" @@ -611,12 +611,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.9" -"@babel/plugin-transform-destructuring@^7.19.4": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.20.0.tgz#712829ef4825d9cc04bb379de316f981e9a6f648" - integrity sha512-1dIhvZfkDVx/zn2S1aFwlruspTt4189j7fEkH0Y0VyuDM6bQt7bD6kLcz3l4IlLG+e5OReaBz9ROAbttRtUHqA== +"@babel/plugin-transform-destructuring@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.20.2.tgz#c23741cfa44ddd35f5e53896e88c75331b8b2792" + integrity sha512-mENM+ZHrvEgxLTBXUiQ621rRXZes3KWUv6NdQlrnr1TkWVw+hUjQBZuP2X32qKlrlG2BzgR95gkuCRSkJl8vIw== dependencies: - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-transform-dotall-regex@^7.18.6", "@babel/plugin-transform-dotall-regex@^7.4.4": version "7.18.6" @@ -671,7 +671,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-modules-amd@^7.18.6": +"@babel/plugin-transform-modules-amd@^7.19.6": version "7.19.6" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.19.6.tgz#aca391801ae55d19c4d8d2ebfeaa33df5f2a2cbd" integrity sha512-uG3od2mXvAtIFQIh0xrpLH6r5fpSQN04gIVovl+ODLdUMANokxQLZnPBHcjmv3GxRjnqwLuHvppjjcelqUFZvg== @@ -679,7 +679,7 @@ "@babel/helper-module-transforms" "^7.19.6" "@babel/helper-plugin-utils" "^7.19.0" -"@babel/plugin-transform-modules-commonjs@^7.14.5", "@babel/plugin-transform-modules-commonjs@^7.18.6": +"@babel/plugin-transform-modules-commonjs@^7.14.5", "@babel/plugin-transform-modules-commonjs@^7.19.6": version "7.19.6" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.19.6.tgz#25b32feef24df8038fc1ec56038917eacb0b730c" integrity sha512-8PIa1ym4XRTKuSsOUXqDG0YaOlEuTVvHMe5JCfgBMOtHvJKw/4NGovEGN33viISshG/rZNVrACiBmPQLvWN8xQ== @@ -688,7 +688,7 @@ "@babel/helper-plugin-utils" "^7.19.0" "@babel/helper-simple-access" "^7.19.4" -"@babel/plugin-transform-modules-systemjs@^7.19.0": +"@babel/plugin-transform-modules-systemjs@^7.19.6": version "7.19.6" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.19.6.tgz#59e2a84064b5736a4471b1aa7b13d4431d327e0d" integrity sha512-fqGLBepcc3kErfR9R3DnVpURmckXP7gj7bAlrTQyBxrigFqszZCkFkcoxzCp2v32XmwXLvbw+8Yq9/b+QqksjQ== @@ -729,12 +729,12 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/helper-replace-supers" "^7.18.6" -"@babel/plugin-transform-parameters@^7.18.8": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.1.tgz#9a5aa370fdcce36f110455e9369db7afca0f9eeb" - integrity sha512-nDvKLrAvl+kf6BOy1UJ3MGwzzfTMgppxwiD2Jb4LO3xjYyZq30oQzDNJbCQpMdG9+j2IXHoiMrw5Cm/L6ZoxXQ== +"@babel/plugin-transform-parameters@^7.20.1": + version "7.20.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.3.tgz#7b3468d70c3c5b62e46be0a47b6045d8590fb748" + integrity sha512-oZg/Fpx0YDrj13KsLyO8I/CX3Zdw7z0O9qOd95SqcoIzuqy/WTGWvePeHAnZCN54SfdyjHcb1S30gc8zlzlHcA== dependencies: - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-transform-property-literals@^7.18.6": version "7.18.6" @@ -795,12 +795,12 @@ "@babel/helper-plugin-utils" "^7.18.9" "@babel/plugin-transform-typescript@^7.18.6": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.20.0.tgz#2c7ec62b8bfc21482f3748789ba294a46a375169" - integrity sha512-xOAsAFaun3t9hCwZ13Qe7gq423UgMZ6zAgmLxeGGapFqlT/X3L5qT2btjiVLlFn7gWtMaVyceS5VxGAuKbgizw== + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.20.2.tgz#91515527b376fc122ba83b13d70b01af8fe98f3f" + integrity sha512-jvS+ngBfrnTUBfOQq8NfGnSbF9BrqlR6hjJ2yVxMkmO5nL/cdifNbI30EfjRlN4g5wYWNnMPyj5Sa6R1pbLeag== dependencies: - "@babel/helper-create-class-features-plugin" "^7.19.0" - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-create-class-features-plugin" "^7.20.2" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-typescript" "^7.20.0" "@babel/plugin-transform-unicode-escapes@^7.18.10": @@ -819,17 +819,17 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/preset-env@^7.14.7", "@babel/preset-env@^7.19.4": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.19.4.tgz#4c91ce2e1f994f717efb4237891c3ad2d808c94b" - integrity sha512-5QVOTXUdqTCjQuh2GGtdd7YEhoRXBMVGROAtsBeLGIbIz3obCBIfRMT1I3ZKkMgNzwkyCkftDXSSkHxnfVf4qg== + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.20.2.tgz#9b1642aa47bb9f43a86f9630011780dab7f86506" + integrity sha512-1G0efQEWR1EHkKvKHqbG+IN/QdgwfByUpM5V5QroDzGV2t3S/WXNQd693cHiHTlCFMpr9B6FkPFXDA2lQcKoDg== dependencies: - "@babel/compat-data" "^7.19.4" - "@babel/helper-compilation-targets" "^7.19.3" - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/compat-data" "^7.20.1" + "@babel/helper-compilation-targets" "^7.20.0" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/helper-validator-option" "^7.18.6" "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6" "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.18.9" - "@babel/plugin-proposal-async-generator-functions" "^7.19.1" + "@babel/plugin-proposal-async-generator-functions" "^7.20.1" "@babel/plugin-proposal-class-properties" "^7.18.6" "@babel/plugin-proposal-class-static-block" "^7.18.6" "@babel/plugin-proposal-dynamic-import" "^7.18.6" @@ -838,7 +838,7 @@ "@babel/plugin-proposal-logical-assignment-operators" "^7.18.9" "@babel/plugin-proposal-nullish-coalescing-operator" "^7.18.6" "@babel/plugin-proposal-numeric-separator" "^7.18.6" - "@babel/plugin-proposal-object-rest-spread" "^7.19.4" + "@babel/plugin-proposal-object-rest-spread" "^7.20.2" "@babel/plugin-proposal-optional-catch-binding" "^7.18.6" "@babel/plugin-proposal-optional-chaining" "^7.18.9" "@babel/plugin-proposal-private-methods" "^7.18.6" @@ -849,7 +849,7 @@ "@babel/plugin-syntax-class-static-block" "^7.14.5" "@babel/plugin-syntax-dynamic-import" "^7.8.3" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-import-assertions" "^7.18.6" + "@babel/plugin-syntax-import-assertions" "^7.20.0" "@babel/plugin-syntax-json-strings" "^7.8.3" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" @@ -862,10 +862,10 @@ "@babel/plugin-transform-arrow-functions" "^7.18.6" "@babel/plugin-transform-async-to-generator" "^7.18.6" "@babel/plugin-transform-block-scoped-functions" "^7.18.6" - "@babel/plugin-transform-block-scoping" "^7.19.4" - "@babel/plugin-transform-classes" "^7.19.0" + "@babel/plugin-transform-block-scoping" "^7.20.2" + "@babel/plugin-transform-classes" "^7.20.2" "@babel/plugin-transform-computed-properties" "^7.18.9" - "@babel/plugin-transform-destructuring" "^7.19.4" + "@babel/plugin-transform-destructuring" "^7.20.2" "@babel/plugin-transform-dotall-regex" "^7.18.6" "@babel/plugin-transform-duplicate-keys" "^7.18.9" "@babel/plugin-transform-exponentiation-operator" "^7.18.6" @@ -873,14 +873,14 @@ "@babel/plugin-transform-function-name" "^7.18.9" "@babel/plugin-transform-literals" "^7.18.9" "@babel/plugin-transform-member-expression-literals" "^7.18.6" - "@babel/plugin-transform-modules-amd" "^7.18.6" - "@babel/plugin-transform-modules-commonjs" "^7.18.6" - "@babel/plugin-transform-modules-systemjs" "^7.19.0" + "@babel/plugin-transform-modules-amd" "^7.19.6" + "@babel/plugin-transform-modules-commonjs" "^7.19.6" + "@babel/plugin-transform-modules-systemjs" "^7.19.6" "@babel/plugin-transform-modules-umd" "^7.18.6" "@babel/plugin-transform-named-capturing-groups-regex" "^7.19.1" "@babel/plugin-transform-new-target" "^7.18.6" "@babel/plugin-transform-object-super" "^7.18.6" - "@babel/plugin-transform-parameters" "^7.18.8" + "@babel/plugin-transform-parameters" "^7.20.1" "@babel/plugin-transform-property-literals" "^7.18.6" "@babel/plugin-transform-regenerator" "^7.18.6" "@babel/plugin-transform-reserved-words" "^7.18.6" @@ -892,7 +892,7 @@ "@babel/plugin-transform-unicode-escapes" "^7.18.10" "@babel/plugin-transform-unicode-regex" "^7.18.6" "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.19.4" + "@babel/types" "^7.20.2" babel-plugin-polyfill-corejs2 "^0.3.3" babel-plugin-polyfill-corejs3 "^0.6.0" babel-plugin-polyfill-regenerator "^0.4.1" @@ -938,7 +938,7 @@ core-js-pure "^3.25.1" regenerator-runtime "^0.13.10" -"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.18.3", "@babel/runtime@^7.19.0", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.14.6", "@babel/runtime@^7.15.4", "@babel/runtime@^7.18.3", "@babel/runtime@^7.19.0", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": version "7.20.1" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.1.tgz#1148bb33ab252b165a06698fde7576092a78b4a9" integrity sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg== @@ -954,7 +954,7 @@ "@babel/parser" "^7.18.10" "@babel/types" "^7.18.10" -"@babel/traverse@^7.19.0", "@babel/traverse@^7.19.1", "@babel/traverse@^7.19.6", "@babel/traverse@^7.20.1", "@babel/traverse@^7.4.5", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.19.0", "@babel/traverse@^7.19.1", "@babel/traverse@^7.20.1", "@babel/traverse@^7.4.5", "@babel/traverse@^7.7.2": version "7.20.1" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.1.tgz#9b15ccbf882f6d107eeeecf263fbcdd208777ec8" integrity sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA== @@ -970,10 +970,10 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.19.4", "@babel/types@^7.20.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.0.tgz#52c94cf8a7e24e89d2a194c25c35b17a64871479" - integrity sha512-Jlgt3H0TajCW164wkTOTzHkZb075tMQMULzrLUoUeKmO7eFL96GgDxf7/Axhc5CAuKE3KFyVW1p6ysKsi2oXAg== +"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.2.tgz#67ac09266606190f496322dbaff360fdaa5e7842" + integrity sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog== dependencies: "@babel/helper-string-parser" "^7.19.4" "@babel/helper-validator-identifier" "^7.19.1" @@ -1494,10 +1494,10 @@ "@types/node" "*" jest-mock "^27.5.1" -"@jest/expect-utils@^29.2.2": - version "29.2.2" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.2.2.tgz#460a5b5a3caf84d4feb2668677393dd66ff98665" - integrity sha512-vwnVmrVhTmGgQzyvcpze08br91OL61t9O0lJMDyb6Y/D8EKQ9V7rGUb/p7PDt0GPzK0zFYqXWFo4EO2legXmkg== +"@jest/expect-utils@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.3.1.tgz#531f737039e9b9e27c42449798acb5bba01935b6" + integrity sha512-wlrznINZI5sMjwvUoLVk617ll/UYfGIZNxmbU+Pa7wmkL4vYzhV9R2pwVqUh4NWWuLQWkI8+8mOkxs//prKQ3g== dependencies: jest-get-type "^29.2.0" @@ -1632,10 +1632,10 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" -"@jest/types@^29.2.1": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.2.1.tgz#ec9c683094d4eb754e41e2119d8bdaef01cf6da0" - integrity sha512-O/QNDQODLnINEPAI0cl9U6zUIDXEWXt6IC1o2N2QENuos7hlGUIthlKyV4p6ki3TvXFX071blj8HUhgLGquPjw== +"@jest/types@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.3.1.tgz#7c5a80777cb13e703aeec6788d044150341147e3" + integrity sha512-d0S0jmmTpjnhCmNpApgX3jrUZgZ22ivKJRvL2lli5hpCRoNnp1f85r2/wpKfXuYu8E7Jjh1hGfhPyup1NM5AmA== dependencies: "@jest/schemas" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" @@ -2398,10 +2398,10 @@ call-me-maybe "^1.0.1" glob-to-regexp "^0.3.0" -"@mui/base@5.0.0-alpha.104": - version "5.0.0-alpha.104" - resolved "https://registry.yarnpkg.com/@mui/base/-/base-5.0.0-alpha.104.tgz#1792e962dd782f1fa434f4aa7bab5410ed946644" - integrity sha512-tQPxZTzfYMwxYfKhEwufbTfdLpNjFdW7bXq6dK0j8651AAyZL4M8wynWUQ98hH1362R26mZFhVxHB2UD9t7VuA== +"@mui/base@5.0.0-alpha.105": + version "5.0.0-alpha.105" + resolved "https://registry.yarnpkg.com/@mui/base/-/base-5.0.0-alpha.105.tgz#ddf92c86db3355e0fe6886a818be073e2ee9a9f9" + integrity sha512-4IPBcJQIgVVXQvN6DQMoCHed52GBtwSqYs0jD0dDcMR3o76AodQtpEeWFz3p7mJoc6f/IHBl9U6jEfL1r/kM4g== dependencies: "@babel/runtime" "^7.19.0" "@emotion/is-prop-valid" "^1.2.0" @@ -2412,10 +2412,10 @@ prop-types "^15.8.1" react-is "^18.2.0" -"@mui/core-downloads-tracker@^5.10.12": - version "5.10.12" - resolved "https://registry.yarnpkg.com/@mui/core-downloads-tracker/-/core-downloads-tracker-5.10.12.tgz#ff36abc5f4aac3c762d116e12ab51c2688d93da1" - integrity sha512-cR8lOS606G++iVHR8I6ySgMAEiPoA3DxO/nLeqiv7w7d1707kvKoV4/7SWjh4ui+kHb052xlf/G196q2EKx31w== +"@mui/core-downloads-tracker@^5.10.13": + version "5.10.13" + resolved "https://registry.yarnpkg.com/@mui/core-downloads-tracker/-/core-downloads-tracker-5.10.13.tgz#34068ede2853392ca4fd82ad16d9c1ca664f69b3" + integrity sha512-zWkWPV/SaNdsIdxAWiuVGZ+Ue3BkfSIlU/BFIrJmuUcwiIa7gQsbI/DOpj1KzLvqZhdEe2wC1aG4nCHfzgc1Hg== "@mui/icons-material@^5.9.3": version "5.10.9" @@ -2425,13 +2425,13 @@ "@babel/runtime" "^7.19.0" "@mui/lab@^5.0.0-alpha.98": - version "5.0.0-alpha.106" - resolved "https://registry.yarnpkg.com/@mui/lab/-/lab-5.0.0-alpha.106.tgz#91ab495aa0db45abae4402520a3b655cd52c7d8d" - integrity sha512-B2dI9Af8Wt0PCE2QffDOaA8QAYJgMrtpPn/PhBB7KZUbGqlhfqzVyeZAUyyCeKKyuJ4Jf8ZtmMHFABgcoekYIA== + version "5.0.0-alpha.107" + resolved "https://registry.yarnpkg.com/@mui/lab/-/lab-5.0.0-alpha.107.tgz#1443c3c9a5abd7ada96df73e216dea289701c391" + integrity sha512-5lq0tSewkjUHBAuuAVikifM+IeOk33jcMSDgS5ouwi0VDXZjgWij+V/Nhz/8vIyBKwYv1bvhQGyDiUcPiCLX+Q== dependencies: "@babel/runtime" "^7.19.0" - "@mui/base" "5.0.0-alpha.104" - "@mui/system" "^5.10.12" + "@mui/base" "5.0.0-alpha.105" + "@mui/system" "^5.10.13" "@mui/types" "^7.2.0" "@mui/utils" "^5.10.9" clsx "^1.2.1" @@ -2439,14 +2439,14 @@ react-is "^18.2.0" "@mui/material@^5.10.11": - version "5.10.12" - resolved "https://registry.yarnpkg.com/@mui/material/-/material-5.10.12.tgz#1e97bb4bdfdfde136c1acbfb6ab16991de1e8677" - integrity sha512-rG9ZTkG9qUwujyAY1I+uQAa9pkGdsWY3KN+wvS/6H6ZbYIA06QRwmig6ySC6LbeB3WL/I/1ngwJqWX7nfINSbA== + version "5.10.13" + resolved "https://registry.yarnpkg.com/@mui/material/-/material-5.10.13.tgz#49c505ed99bc97e573d0cc15bec074b080aacee1" + integrity sha512-TkkT1rNc0/hhL4/+zv4gYcA6egNWBH/1Tz+azoTnQIUdZ32fgwFI2pFX2KVJNTt30xnLznxDWtTv7ilmJQ52xw== dependencies: "@babel/runtime" "^7.19.0" - "@mui/base" "5.0.0-alpha.104" - "@mui/core-downloads-tracker" "^5.10.12" - "@mui/system" "^5.10.12" + "@mui/base" "5.0.0-alpha.105" + "@mui/core-downloads-tracker" "^5.10.13" + "@mui/system" "^5.10.13" "@mui/types" "^7.2.0" "@mui/utils" "^5.10.9" "@types/react-transition-group" "^4.4.5" @@ -2498,10 +2498,10 @@ jss-plugin-vendor-prefixer "^10.9.2" prop-types "^15.8.1" -"@mui/system@^5.10.12": - version "5.10.12" - resolved "https://registry.yarnpkg.com/@mui/system/-/system-5.10.12.tgz#fd97a6fd75995038c1c34e9c5b6eb4ff9b9eee56" - integrity sha512-9DcN3hF2KTTTpZ0K5Tn20B+Tz7tIqDmJLk1M6P0CYoAGUN/xrcF/6dn1zZ829rxE5tmauoDUekTfomrvPsvlSQ== +"@mui/system@^5.10.13": + version "5.10.13" + resolved "https://registry.yarnpkg.com/@mui/system/-/system-5.10.13.tgz#b32a4441f9dd0760724cdbccf0a09728e63e3674" + integrity sha512-Xzx26Asu5fVlm0ucm+gnJmeX4Y1isrpVDvqxX4yJaOT7Fzmd8Lfq9ih3QMfZajns5LMtUiOuCQlVFRtUG5IY7A== dependencies: "@babel/runtime" "^7.19.0" "@mui/private-theming" "^5.10.9" @@ -2677,14 +2677,14 @@ integrity sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw== "@reduxjs/toolkit@^1.5.0": - version "1.8.6" - resolved "https://registry.yarnpkg.com/@reduxjs/toolkit/-/toolkit-1.8.6.tgz#147fb7957befcdb75bc9c1230db63628e30e4332" - integrity sha512-4Ia/Loc6WLmdSOzi7k5ff7dLK8CgG2b8aqpLsCAJhazAzGdp//YBUSaj0ceW6a3kDBDNRrq5CRwyCS0wBiL1ig== + version "1.9.0" + resolved "https://registry.yarnpkg.com/@reduxjs/toolkit/-/toolkit-1.9.0.tgz#76b264fcea677d256b18f86cc77e00743a9e02b0" + integrity sha512-ak11IrjYcUXRqlhNPwnz6AcvA2ynJTu8PzDbbqQw4a3xR4KZtgiqbNblQD+10CRbfK4+5C79SOyxnT9dhBqFnA== dependencies: - immer "^9.0.7" - redux "^4.1.2" - redux-thunk "^2.4.1" - reselect "^4.1.5" + immer "^9.0.16" + redux "^4.2.0" + redux-thunk "^2.4.2" + reselect "^4.1.7" "@sideway/address@^4.1.3": version "4.1.4" @@ -2709,9 +2709,9 @@ integrity sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA== "@sinonjs/commons@^1.7.0": - version "1.8.3" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" - integrity sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ== + version "1.8.5" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.5.tgz#e280c94c95f206dcfd5aca00a43f2156b758c764" + integrity sha512-rTpCA0wG1wUxglBSFdMMY0oTrKYvgf4fNgv/sXbfCVAdf+FnPBdKJR/7XbpTCwbCrvCbdPYnlWaUUYz4V2fPDA== dependencies: type-detect "4.0.8" @@ -2722,15 +2722,15 @@ dependencies: "@sinonjs/commons" "^1.7.0" -"@testing-library/cypress@^7.0.3": - version "7.0.7" - resolved "https://registry.yarnpkg.com/@testing-library/cypress/-/cypress-7.0.7.tgz#b3e8696e707bcaa1664f5f9452f96f87cb90f438" - integrity sha512-4yavolmN9o4Lmtrff6sbOTNFW9VqRRqDrP6gS2hkqLri4+lKURRYblg8kjOlcni/5h/qctFych+gkUOkpgypxw== +"@testing-library/cypress@^8.0.3": + version "8.0.3" + resolved "https://registry.yarnpkg.com/@testing-library/cypress/-/cypress-8.0.3.tgz#24ab34df34d7896866603ade705afbdd186e273c" + integrity sha512-nY2YaSbmuPo5k6kL0iLj/pGPPfka3iwb3kpTx8QN/vOCns92Saz9wfACqB8FJzcR7+lfA4d5HUOWqmTddBzczg== dependencies: - "@babel/runtime" "^7.12.5" - "@testing-library/dom" "^7.29.6" + "@babel/runtime" "^7.14.6" + "@testing-library/dom" "^8.1.0" -"@testing-library/dom@^7.11.0", "@testing-library/dom@^7.29.6": +"@testing-library/dom@^7.11.0": version "7.31.2" resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.31.2.tgz#df361db38f5212b88555068ab8119f5d841a8c4a" integrity sha512-3UqjCpey6HiTZT92vODYLPxTBWlM8ZOOjr3LX5F37/VRipW2M1kX6I/Cm4VXzteZqfGfagg8yXywpcOgQBlNsQ== @@ -2744,7 +2744,7 @@ lz-string "^1.4.4" pretty-format "^26.6.2" -"@testing-library/dom@^8.0.0": +"@testing-library/dom@^8.1.0", "@testing-library/dom@^8.5.0": version "8.19.0" resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.19.0.tgz#bd3f83c217ebac16694329e413d9ad5fdcfd785f" integrity sha512-6YWYPPpxG3e/xOo6HIWwB/58HukkwIVTOaZ0VwdMVjhRUX/01E4FtQbck9GazOOj7MXHc5RBzMrU86iBJHbI+A== @@ -2758,14 +2758,14 @@ lz-string "^1.4.4" pretty-format "^27.0.2" -"@testing-library/react@^12.0.0": - version "12.1.5" - resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-12.1.5.tgz#bb248f72f02a5ac9d949dea07279095fa577963b" - integrity sha512-OfTXCJUFgjd/digLUuPxa0+/3ZxsQmE7ub9kcbW/wi96Bh3o/p5vrETcBGfP17NWPGqeYYl5LTRpwyGoMC4ysg== +"@testing-library/react@^13.4.0": + version "13.4.0" + resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-13.4.0.tgz#6a31e3bf5951615593ad984e96b9e5e2d9380966" + integrity sha512-sXOGON+WNTh3MLE9rve97ftaZukN3oNf2KjDy7YTx6hcTO2uuLHuCGynMDhFwGw/jYf4OJ2Qk0i4i79qMNNkyw== dependencies: "@babel/runtime" "^7.12.5" - "@testing-library/dom" "^8.0.0" - "@types/react-dom" "<18.0.0" + "@testing-library/dom" "^8.5.0" + "@types/react-dom" "^18.0.0" "@tootallnate/once@1": version "1.1.2" @@ -2798,9 +2798,9 @@ integrity sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": - version "7.1.19" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" - integrity sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw== + version "7.1.20" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.20.tgz#e168cdd612c92a2d335029ed62ac94c95b362359" + integrity sha512-PVb6Bg2QuscZ30FvOU7z4guG6c926D9YRvOxEaelzndpMsvP+YM74Q/dAFASpg2l6+XLalxSGxcq/lrgYWZtyQ== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -2869,9 +2869,9 @@ "@types/estree" "*" "@types/eslint@*": - version "8.4.9" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.4.9.tgz#f7371980148697f4b582b086630319b55324b5aa" - integrity sha512-jFCSo4wJzlHQLCpceUhUnXdrPuCNOjGFMQ8Eg6JXxlz3QaCKOb7eGi2cephQdM4XTYsNej69P9JDJ1zqNIbncQ== + version "8.4.10" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.4.10.tgz#19731b9685c19ed1552da7052b6f668ed7eb64bb" + integrity sha512-Sl/HOqN8NKPmhWo2VBEPm0nvHnu2LL3v9vKo8MEq0EtbJ4eVzGPl41VNPvn5E1i5poMk4/XD8UriLHpJvEP/Nw== dependencies: "@types/estree" "*" "@types/json-schema" "*" @@ -2968,9 +2968,9 @@ pretty-format "^27.0.0" "@types/jest@^29.0.0": - version "29.2.1" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.2.1.tgz#31fda30bdf2861706abc5f1730be78bed54f83ee" - integrity sha512-nKixEdnGDqFOZkMTF74avFNr3yRqB1ZJ6sRZv5/28D5x2oLN14KApv7F9mfDT/vUic0L3tRCsh3XWpWjtJisUQ== + version "29.2.2" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.2.2.tgz#874e7dc6702fa6a3fe6107792aa98636dcc480b4" + integrity sha512-og1wAmdxKoS71K2ZwSVqWPX6OVn3ihZ6ZT2qvZvZQm90lJVDyXIjYcu4Khx2CNIeaFv12rOU/YObOsI3VOkzog== dependencies: expect "^29.0.0" pretty-format "^29.0.0" @@ -2998,9 +2998,9 @@ integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== "@types/lodash@^4.14.150": - version "4.14.187" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.187.tgz#122ff0a7192115b4c1a19444ab4482caa77e2c9d" - integrity sha512-MrO/xLXCaUgZy3y96C/iOsaIqZSeupyTImKClHunL5GrmaiII2VwvWmLBu2hwa0Kp0sV19CsyjtrTc/Fx8rg/A== + version "4.14.188" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.188.tgz#e4990c4c81f7c9b00c5ff8eae389c10f27980da5" + integrity sha512-zmEmF5OIM3rb7SbLCFYoQhO4dGt2FRM9AMkxvA3LaADOF1n8in/zGJlWji9fmafLoNyz+FoL6FE0SLtGIArD7w== "@types/loud-rejection@^2.0.0": version "2.0.0" @@ -3064,12 +3064,12 @@ resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== -"@types/react-dom@<18.0.0": - version "17.0.18" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.18.tgz#8f7af38f5d9b42f79162eea7492e5a1caff70dc2" - integrity sha512-rLVtIfbwyur2iFKykP2w0pl/1unw26b5td16d5xMgp7/yjTHomkyxPYChFoCr/FtEX1lN9wY6lFj1qvKdS5kDw== +"@types/react-dom@^18.0.0": + version "18.0.8" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.0.8.tgz#d2606d855186cd42cc1b11e63a71c39525441685" + integrity sha512-C3GYO0HLaOkk9dDAz3Dl4sbe4AKUGTCfFIZsz3n/82dPNN8Du533HzKatDxeUYWu24wJgMP1xICqkWk1YOLOIw== dependencies: - "@types/react" "^17" + "@types/react" "*" "@types/react-is@^16.7.1 || ^17.0.0": version "17.0.3" @@ -3096,18 +3096,9 @@ "@types/react" "*" "@types/react@*", "@types/react@16 || 17 || 18": - version "18.0.24" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.24.tgz#2f79ed5b27f08d05107aab45c17919754cc44c20" - integrity sha512-wRJWT6ouziGUy+9uX0aW4YOJxAY0bG6/AOk5AW5QSvZqI7dk6VBIbXvcVgIw/W5Jrl24f77df98GEKTJGOLx7Q== - dependencies: - "@types/prop-types" "*" - "@types/scheduler" "*" - csstype "^3.0.2" - -"@types/react@^17": - version "17.0.52" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.52.tgz#10d8b907b5c563ac014a541f289ae8eaa9bf2e9b" - integrity sha512-vwk8QqVODi0VaZZpDXQCmEmiOuyjEFPY7Ttaw5vjM112LOq37yz1CDJGrRJwA1fYEq4Iitd5rnjd1yWAc/bT+A== + version "18.0.25" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.25.tgz#8b1dcd7e56fe7315535a4af25435e0bb55c8ae44" + integrity sha512-xD6c0KDT4m7n9uD4ZHi02lzskaiqcBxf4zi+tXZY98a04wvc0hi/TcCPC2FOESZi51Nd7tlUeOJY8RofL799/g== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -3257,13 +3248,13 @@ "@types/node" "*" "@typescript-eslint/eslint-plugin@^5.41.0", "@typescript-eslint/eslint-plugin@^5.9.1": - version "5.42.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.42.0.tgz#36a8c0c379870127059889a9cc7e05c260d2aaa5" - integrity sha512-5TJh2AgL6+wpL8H/GTSjNb4WrjKoR2rqvFxR/DDTqYNk6uXn8BJMEcncLSpMbf/XV1aS0jAjYwn98uvVCiAywQ== + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.42.1.tgz#696b9cc21dfd4749c1c8ad1307f76a36a00aa0e3" + integrity sha512-LyR6x784JCiJ1j6sH5Y0K6cdExqCCm8DJUTcwG5ThNXJj/G8o5E56u5EdG4SLy+bZAwZBswC+GYn3eGdttBVCg== dependencies: - "@typescript-eslint/scope-manager" "5.42.0" - "@typescript-eslint/type-utils" "5.42.0" - "@typescript-eslint/utils" "5.42.0" + "@typescript-eslint/scope-manager" "5.42.1" + "@typescript-eslint/type-utils" "5.42.1" + "@typescript-eslint/utils" "5.42.1" debug "^4.3.4" ignore "^5.2.0" natural-compare-lite "^1.4.0" @@ -3272,71 +3263,71 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.41.0", "@typescript-eslint/parser@^5.9.1": - version "5.42.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.42.0.tgz#be0ffbe279e1320e3d15e2ef0ad19262f59e9240" - integrity sha512-Ixh9qrOTDRctFg3yIwrLkgf33AHyEIn6lhyf5cCfwwiGtkWhNpVKlEZApi3inGQR/barWnY7qY8FbGKBO7p3JA== + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.42.1.tgz#3e66156f2f74b11690b45950d8f5f28a62751d35" + integrity sha512-kAV+NiNBWVQDY9gDJDToTE/NO8BHi4f6b7zTsVAJoTkmB/zlfOpiEVBzHOKtlgTndCKe8vj9F/PuolemZSh50Q== dependencies: - "@typescript-eslint/scope-manager" "5.42.0" - "@typescript-eslint/types" "5.42.0" - "@typescript-eslint/typescript-estree" "5.42.0" + "@typescript-eslint/scope-manager" "5.42.1" + "@typescript-eslint/types" "5.42.1" + "@typescript-eslint/typescript-estree" "5.42.1" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.42.0": - version "5.42.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.42.0.tgz#e1f2bb26d3b2a508421ee2e3ceea5396b192f5ef" - integrity sha512-l5/3IBHLH0Bv04y+H+zlcLiEMEMjWGaCX6WyHE5Uk2YkSGAMlgdUPsT/ywTSKgu9D1dmmKMYgYZijObfA39Wow== +"@typescript-eslint/scope-manager@5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.42.1.tgz#05e5e1351485637d466464237e5259b49f609b18" + integrity sha512-QAZY/CBP1Emx4rzxurgqj3rUinfsh/6mvuKbLNMfJMMKYLRBfweus8brgXF8f64ABkIZ3zdj2/rYYtF8eiuksQ== dependencies: - "@typescript-eslint/types" "5.42.0" - "@typescript-eslint/visitor-keys" "5.42.0" + "@typescript-eslint/types" "5.42.1" + "@typescript-eslint/visitor-keys" "5.42.1" -"@typescript-eslint/type-utils@5.42.0": - version "5.42.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.42.0.tgz#4206d7192d4fe903ddf99d09b41d4ac31b0b7dca" - integrity sha512-HW14TXC45dFVZxnVW8rnUGnvYyRC0E/vxXShFCthcC9VhVTmjqOmtqj6H5rm9Zxv+ORxKA/1aLGD7vmlLsdlOg== +"@typescript-eslint/type-utils@5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.42.1.tgz#21328feb2d4b193c5852b35aabd241ccc1449daa" + integrity sha512-WWiMChneex5w4xPIX56SSnQQo0tEOy5ZV2dqmj8Z371LJ0E+aymWD25JQ/l4FOuuX+Q49A7pzh/CGIQflxMVXg== dependencies: - "@typescript-eslint/typescript-estree" "5.42.0" - "@typescript-eslint/utils" "5.42.0" + "@typescript-eslint/typescript-estree" "5.42.1" + "@typescript-eslint/utils" "5.42.1" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.42.0": - version "5.42.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.42.0.tgz#5aeff9b5eced48f27d5b8139339bf1ef805bad7a" - integrity sha512-t4lzO9ZOAUcHY6bXQYRuu+3SSYdD9TS8ooApZft4WARt4/f2Cj/YpvbTe8A4GuhT4bNW72goDMOy7SW71mZwGw== +"@typescript-eslint/types@5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.42.1.tgz#0d4283c30e9b70d2aa2391c36294413de9106df2" + integrity sha512-Qrco9dsFF5lhalz+lLFtxs3ui1/YfC6NdXu+RAGBa8uSfn01cjO7ssCsjIsUs484vny9Xm699FSKwpkCcqwWwA== -"@typescript-eslint/typescript-estree@5.42.0": - version "5.42.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.0.tgz#2592d24bb5f89bf54a63384ff3494870f95b3fd8" - integrity sha512-2O3vSq794x3kZGtV7i4SCWZWCwjEtkWfVqX4m5fbUBomOsEOyd6OAD1qU2lbvV5S8tgy/luJnOYluNyYVeOTTg== +"@typescript-eslint/typescript-estree@5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.1.tgz#f9a223ecb547a781d37e07a5ac6ba9ff681eaef0" + integrity sha512-qElc0bDOuO0B8wDhhW4mYVgi/LZL+igPwXtV87n69/kYC/7NG3MES0jHxJNCr4EP7kY1XVsRy8C/u3DYeTKQmw== dependencies: - "@typescript-eslint/types" "5.42.0" - "@typescript-eslint/visitor-keys" "5.42.0" + "@typescript-eslint/types" "5.42.1" + "@typescript-eslint/visitor-keys" "5.42.1" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.42.0": - version "5.42.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.42.0.tgz#f06bd43b9a9a06ed8f29600273240e84a53f2f15" - integrity sha512-JZ++3+h1vbeG1NUECXQZE3hg0kias9kOtcQr3+JVQ3whnjvKuMyktJAAIj6743OeNPnGBmjj7KEmiDL7qsdnCQ== +"@typescript-eslint/utils@5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.42.1.tgz#2789b1cd990f0c07aaa3e462dbe0f18d736d5071" + integrity sha512-Gxvf12xSp3iYZd/fLqiQRD4uKZjDNR01bQ+j8zvhPjpsZ4HmvEFL/tC4amGNyxN9Rq+iqvpHLhlqx6KTxz9ZyQ== dependencies: "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.42.0" - "@typescript-eslint/types" "5.42.0" - "@typescript-eslint/typescript-estree" "5.42.0" + "@typescript-eslint/scope-manager" "5.42.1" + "@typescript-eslint/types" "5.42.1" + "@typescript-eslint/typescript-estree" "5.42.1" eslint-scope "^5.1.1" eslint-utils "^3.0.0" semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.42.0": - version "5.42.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.42.0.tgz#ee8d62d486f41cfe646632fab790fbf0c1db5bb0" - integrity sha512-QHbu5Hf/2lOEOwy+IUw0GoSCuAzByTAWWrOTKzTzsotiUnWFpuKnXcAhC9YztAf2EElQ0VvIK+pHJUPkM0q7jg== +"@typescript-eslint/visitor-keys@5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.42.1.tgz#df10839adf6605e1cdb79174cf21e46df9be4872" + integrity sha512-LOQtSF4z+hejmpUvitPlc4hA7ERGoj2BVkesOcG91HCn8edLGUXbTrErmutmPbl8Bo9HjAvOO/zBKQHExXNA2A== dependencies: - "@typescript-eslint/types" "5.42.0" + "@typescript-eslint/types" "5.42.1" eslint-visitor-keys "^3.3.0" "@ungap/promise-all-settled@1.1.2": @@ -3344,63 +3335,63 @@ resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== -"@vue/compiler-core@3.2.41", "@vue/compiler-core@^3.0.0": - version "3.2.41" - resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.41.tgz#fb5b25f23817400f44377d878a0cdead808453ef" - integrity sha512-oA4mH6SA78DT+96/nsi4p9DX97PHcNROxs51lYk7gb9Z4BPKQ3Mh+BLn6CQZBw857Iuhu28BfMSRHAlPvD4vlw== +"@vue/compiler-core@3.2.45", "@vue/compiler-core@^3.0.0": + version "3.2.45" + resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.45.tgz#d9311207d96f6ebd5f4660be129fb99f01ddb41b" + integrity sha512-rcMj7H+PYe5wBV3iYeUgbCglC+pbpN8hBLTJvRiK2eKQiWqu+fG9F+8sW99JdL4LQi7Re178UOxn09puSXvn4A== dependencies: "@babel/parser" "^7.16.4" - "@vue/shared" "3.2.41" + "@vue/shared" "3.2.45" estree-walker "^2.0.2" source-map "^0.6.1" -"@vue/compiler-dom@3.2.41": - version "3.2.41" - resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.41.tgz#dc63dcd3ce8ca8a8721f14009d498a7a54380299" - integrity sha512-xe5TbbIsonjENxJsYRbDJvthzqxLNk+tb3d/c47zgREDa/PCp6/Y4gC/skM4H6PIuX5DAxm7fFJdbjjUH2QTMw== +"@vue/compiler-dom@3.2.45": + version "3.2.45" + resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.45.tgz#c43cc15e50da62ecc16a42f2622d25dc5fd97dce" + integrity sha512-tyYeUEuKqqZO137WrZkpwfPCdiiIeXYCcJ8L4gWz9vqaxzIQRccTSwSWZ/Axx5YR2z+LvpUbmPNXxuBU45lyRw== dependencies: - "@vue/compiler-core" "3.2.41" - "@vue/shared" "3.2.41" + "@vue/compiler-core" "3.2.45" + "@vue/shared" "3.2.45" "@vue/compiler-sfc@^3.0.5": - version "3.2.41" - resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.2.41.tgz#238fb8c48318408c856748f4116aff8cc1dc2a73" - integrity sha512-+1P2m5kxOeaxVmJNXnBskAn3BenbTmbxBxWOtBq3mQTCokIreuMULFantBUclP0+KnzNCMOvcnKinqQZmiOF8w== + version "3.2.45" + resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.2.45.tgz#7f7989cc04ec9e7c55acd406827a2c4e96872c70" + integrity sha512-1jXDuWah1ggsnSAOGsec8cFjT/K6TMZ0sPL3o3d84Ft2AYZi2jWJgRMjw4iaK0rBfA89L5gw427H4n1RZQBu6Q== dependencies: "@babel/parser" "^7.16.4" - "@vue/compiler-core" "3.2.41" - "@vue/compiler-dom" "3.2.41" - "@vue/compiler-ssr" "3.2.41" - "@vue/reactivity-transform" "3.2.41" - "@vue/shared" "3.2.41" + "@vue/compiler-core" "3.2.45" + "@vue/compiler-dom" "3.2.45" + "@vue/compiler-ssr" "3.2.45" + "@vue/reactivity-transform" "3.2.45" + "@vue/shared" "3.2.45" estree-walker "^2.0.2" magic-string "^0.25.7" postcss "^8.1.10" source-map "^0.6.1" -"@vue/compiler-ssr@3.2.41": - version "3.2.41" - resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.2.41.tgz#344f564d68584b33367731c04ffc949784611fcb" - integrity sha512-Y5wPiNIiaMz/sps8+DmhaKfDm1xgj6GrH99z4gq2LQenfVQcYXmHIOBcs5qPwl7jaW3SUQWjkAPKMfQemEQZwQ== +"@vue/compiler-ssr@3.2.45": + version "3.2.45" + resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.2.45.tgz#bd20604b6e64ea15344d5b6278c4141191c983b2" + integrity sha512-6BRaggEGqhWht3lt24CrIbQSRD5O07MTmd+LjAn5fJj568+R9eUD2F7wMQJjX859seSlrYog7sUtrZSd7feqrQ== dependencies: - "@vue/compiler-dom" "3.2.41" - "@vue/shared" "3.2.41" + "@vue/compiler-dom" "3.2.45" + "@vue/shared" "3.2.45" -"@vue/reactivity-transform@3.2.41": - version "3.2.41" - resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.2.41.tgz#9ff938877600c97f646e09ac1959b5150fb11a0c" - integrity sha512-mK5+BNMsL4hHi+IR3Ft/ho6Za+L3FA5j8WvreJ7XzHrqkPq8jtF/SMo7tuc9gHjLDwKZX1nP1JQOKo9IEAn54A== +"@vue/reactivity-transform@3.2.45": + version "3.2.45" + resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.2.45.tgz#07ac83b8138550c83dfb50db43cde1e0e5e8124d" + integrity sha512-BHVmzYAvM7vcU5WmuYqXpwaBHjsS8T63jlKGWVtHxAHIoMIlmaMyurUSEs1Zcg46M4AYT5MtB1U274/2aNzjJQ== dependencies: "@babel/parser" "^7.16.4" - "@vue/compiler-core" "3.2.41" - "@vue/shared" "3.2.41" + "@vue/compiler-core" "3.2.45" + "@vue/shared" "3.2.45" estree-walker "^2.0.2" magic-string "^0.25.7" -"@vue/shared@3.2.41": - version "3.2.41" - resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.41.tgz#fbc95422df654ea64e8428eced96ba6ad555d2bb" - integrity sha512-W9mfWLHmJhkfAmV+7gDjcHeAWALQtgGT3JErxULl0oz6R6+3ug91I7IErs93eCFhPCZPHBs4QJS7YWEV7A3sxw== +"@vue/shared@3.2.45": + version "3.2.45" + resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.45.tgz#a3fffa7489eafff38d984e23d0236e230c818bc2" + integrity sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg== "@webassemblyjs/ast@1.11.1": version "1.11.1" @@ -3895,14 +3886,14 @@ array-ify@^1.0.0: integrity sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng== array-includes@^3.1.4, array-includes@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.5.tgz#2c320010db8d31031fd2a5f6b3bbd4b1aad31bdb" - integrity sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ== + version "3.1.6" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.6.tgz#9e9e720e194f198266ba9e18c29e6a9b0e4b225f" + integrity sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" - es-abstract "^1.19.5" - get-intrinsic "^1.1.1" + es-abstract "^1.20.4" + get-intrinsic "^1.1.3" is-string "^1.0.7" array-union@^1.0.1, array-union@^1.0.2: @@ -3933,33 +3924,33 @@ array-unique@^0.3.2: integrity sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ== array.prototype.flat@^1.2.5: - version "1.3.0" - resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz#0b0c1567bf57b38b56b4c97b8aa72ab45e4adc7b" - integrity sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw== + version "1.3.1" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz#ffc6576a7ca3efc2f46a143b9d1dda9b4b3cf5e2" + integrity sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" es-shim-unscopables "^1.0.0" array.prototype.flatmap@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.0.tgz#a7e8ed4225f4788a70cd910abcf0791e76a5534f" - integrity sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg== + version "1.3.1" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz#1aae7903c2100433cb8261cd4ed310aab5c4a183" + integrity sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" es-shim-unscopables "^1.0.0" -array.prototype.reduce@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/array.prototype.reduce/-/array.prototype.reduce-1.0.4.tgz#8167e80089f78bff70a99e20bd4201d4663b0a6f" - integrity sha512-WnM+AjG/DvLRLo4DDl+r+SvCzYtD2Jd9oeBYMcEaI7t3fFrHY9M53/wdLcTvmZNQ70IU6Htj0emFkZ5TS+lrdw== +array.prototype.reduce@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz#6b20b0daa9d9734dd6bc7ea66b5bbce395471eac" + integrity sha512-kDdugMl7id9COE8R7MHF5jWk7Dqt/fs4Pv+JXoICnYwqpjjjbUurz6w5fT5IG6brLdJhv6/VoHB0H7oyIBXd+Q== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" es-array-method-boxes-properly "^1.0.0" is-string "^1.0.7" @@ -4070,9 +4061,9 @@ babel-jest@^27.5.1: slash "^3.0.0" babel-loader@^8.2.2: - version "8.2.5" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.5.tgz#d45f585e654d5a5d90f5350a779d7647c5ed512e" - integrity sha512-OSiFfH89LrEMiWd4pLNqGz4CwJDtbs2ZVc+iGu2HrkRfPxId9F2anQj38IxWpmRfsUY0aBZYi1EFcd3mhtRMLQ== + version "8.3.0" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.3.0.tgz#124936e841ba4fe8176786d6ff28add1f134d6a8" + integrity sha512-H8SvsMF+m9t15HNLMipppzkC+Y2Yq+v3SonZyU70RBL/h1gxPkH08Ot8pEE9Z4Kd+czyWJClmFS8qzIP9OZ04Q== dependencies: find-cache-dir "^3.3.1" loader-utils "^2.0.0" @@ -4576,9 +4567,9 @@ camelize@^1.0.0: integrity sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ== caniuse-lite@^1.0.30001400: - version "1.0.30001429" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001429.tgz#70cdae959096756a85713b36dd9cb82e62325639" - integrity sha512-511ThLu1hF+5RRRt0zYCf2U2yRr9GPF6m5y90SBCWsvSoYoW7yAGlv/elyPaNfvGCkp6kj/KFZWU0BMA69Prsg== + version "1.0.30001431" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001431.tgz#e7c59bd1bc518fae03a4656be442ce6c4887a795" + integrity sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ== caseless@~0.12.0: version "0.12.0" @@ -5188,9 +5179,9 @@ cosmiconfig@^5.1.0: parse-json "^4.0.0" cosmiconfig@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" - integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== + version "7.1.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6" + integrity sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA== dependencies: "@types/parse-json" "^4.0.0" import-fresh "^3.2.1" @@ -5335,7 +5326,55 @@ cypress-image-snapshot@^4.0.1: pkg-dir "^3.0.0" term-img "^4.0.0" -cypress@*, cypress@^10.11.0: +cypress@*: + version "11.0.1" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-11.0.1.tgz#5332a1825b37ab3f4f81d74389930c55cc7cf31d" + integrity sha512-NuEfd0Vim492RJ3m/+bbTZ3OZrqXgfAfuLaZfIQ9D5lKocS3EDr2tyAarZdAhKwLyoh7OJ33jwMeMFIDbzYqog== + dependencies: + "@cypress/request" "^2.88.10" + "@cypress/xvfb" "^1.2.4" + "@types/node" "^14.14.31" + "@types/sinonjs__fake-timers" "8.1.1" + "@types/sizzle" "^2.3.2" + arch "^2.2.0" + blob-util "^2.0.2" + bluebird "^3.7.2" + buffer "^5.6.0" + cachedir "^2.3.0" + chalk "^4.1.0" + check-more-types "^2.24.0" + cli-cursor "^3.1.0" + cli-table3 "~0.6.1" + commander "^5.1.0" + common-tags "^1.8.0" + dayjs "^1.10.4" + debug "^4.3.2" + enquirer "^2.3.6" + eventemitter2 "6.4.7" + execa "4.1.0" + executable "^4.1.1" + extract-zip "2.0.1" + figures "^3.2.0" + fs-extra "^9.1.0" + getos "^3.2.1" + is-ci "^3.0.0" + is-installed-globally "~0.4.0" + lazy-ass "^1.6.0" + listr2 "^3.8.3" + lodash "^4.17.21" + log-symbols "^4.0.0" + minimist "^1.2.6" + ospath "^1.2.2" + pretty-bytes "^5.6.0" + proxy-from-env "1.0.0" + request-progress "^3.0.0" + semver "^7.3.2" + supports-color "^8.1.1" + tmp "~0.2.1" + untildify "^4.0.0" + yauzl "^2.10.0" + +cypress@^10.11.0: version "10.11.0" resolved "https://registry.yarnpkg.com/cypress/-/cypress-10.11.0.tgz#e9fbdd7638bae3d8fb7619fd75a6330d11ebb4e8" integrity sha512-lsaE7dprw5DoXM00skni6W5ElVVLGAdRUUdZjX2dYsGjbY/QnpzWZ95Zom1mkGg0hAaO/QVTZoFVS7Jgr/GUPA== @@ -5545,25 +5584,25 @@ dedent@^0.7.0: integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== deep-equal@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.0.5.tgz#55cd2fe326d83f9cbf7261ef0e060b3f724c5cb9" - integrity sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw== + version "2.1.0" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.1.0.tgz#5ba60402cf44ab92c2c07f3f3312c3d857a0e1dd" + integrity sha512-2pxgvWu3Alv1PoWEyVg7HS8YhGlUFUV7N5oOvfL6d+7xAmLSemMwv/c8Zv/i9KFzxV5Kt5CAvQc70fLwVuf4UA== dependencies: - call-bind "^1.0.0" - es-get-iterator "^1.1.1" - get-intrinsic "^1.0.1" - is-arguments "^1.0.4" - is-date-object "^1.0.2" - is-regex "^1.1.1" + call-bind "^1.0.2" + es-get-iterator "^1.1.2" + get-intrinsic "^1.1.3" + is-arguments "^1.1.1" + is-date-object "^1.0.5" + is-regex "^1.1.4" isarray "^2.0.5" - object-is "^1.1.4" + object-is "^1.1.5" object-keys "^1.1.1" - object.assign "^4.1.2" - regexp.prototype.flags "^1.3.0" - side-channel "^1.0.3" - which-boxed-primitive "^1.0.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.4.3" + side-channel "^1.0.4" + which-boxed-primitive "^1.0.2" which-collection "^1.0.1" - which-typed-array "^1.1.2" + which-typed-array "^1.1.8" deep-is@^0.1.3, deep-is@~0.1.3: version "0.1.4" @@ -5695,10 +5734,10 @@ diff-sequences@^27.5.1: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== -diff-sequences@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.2.0.tgz#4c55b5b40706c7b5d2c5c75999a50c56d214e8f6" - integrity sha512-413SY5JpYeSBZxmenGEmCVQ8mCgtFJF0w9PROdaS6z987XC2Pd2GOKqOITLtMftmyFZqgtCOb/QA7/Z3ZXfzIw== +diff-sequences@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.3.1.tgz#104b5b95fe725932421a9c6e5b4bef84c3f2249e" + integrity sha512-hlM3QR272NXCi4pq+N4Kok4kOp6EsgOM3ZSpJI7Da3UAs+Ttsi8MRmB6trM/lhyzUxGfOgnpkHtgqm5Q/CTcfQ== diff@5.0.0: version "5.0.0" @@ -5868,9 +5907,9 @@ emittery@^0.8.1: integrity sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg== emoji-picker-react@^4.4.3, emoji-picker-react@^4.4.4: - version "4.4.4" - resolved "https://registry.yarnpkg.com/emoji-picker-react/-/emoji-picker-react-4.4.4.tgz#93086e9ff3f3e54e32a9a040c239b20a6d99a035" - integrity sha512-FA15/5AWh7LxWUT3flTiquLt7pbzZxny07gQbmyErzEi0AT7qo7hSbEz10C2oiXOAPGUAskESdudbmDiLVSVgQ== + version "4.4.5" + resolved "https://registry.yarnpkg.com/emoji-picker-react/-/emoji-picker-react-4.4.5.tgz#c4999a180e785e8c36b368449ca528d784a32a36" + integrity sha512-0iwtqg2WyNIQ+uCUUlEQ/UlJ8uOLbAo7jZ5MX0VEYe/NXsrphIQHZhuwC1h85REsCI9eYj60yuGIdvzFRnOkmQ== dependencies: clsx "^1.2.1" @@ -5959,7 +5998,7 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19.2, es-abstract@^1.19.5, es-abstract@^1.20.0, es-abstract@^1.20.1: +es-abstract@^1.19.0, es-abstract@^1.20.4: version "1.20.4" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.4.tgz#1d103f9f8d78d4cf0713edcd6d0ed1a46eed5861" integrity sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA== @@ -5994,7 +6033,7 @@ es-array-method-boxes-properly@^1.0.0: resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== -es-get-iterator@^1.1.1: +es-get-iterator@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.2.tgz#9234c54aba713486d7ebde0220864af5e2b283f7" integrity sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ== @@ -6092,10 +6131,10 @@ eslint-config-prettier@^8.0.0, eslint-config-prettier@^8.5.0: resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1" integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q== -eslint-config-standard@^16.0.3: - version "16.0.3" - resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-16.0.3.tgz#6c8761e544e96c531ff92642eeb87842b8488516" - integrity sha512-x4fmJL5hGqNJKGHSjnLdgA6U6h1YW/G2dW9fA+cyVur4SK6lyue8+UgNKWlZtUDTXvgKDD/Oa3GQjmB5kjtVvg== +eslint-config-standard@^17.0.0: + version "17.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-17.0.0.tgz#fd5b6cf1dcf6ba8d29f200c461de2e19069888cf" + integrity sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg== eslint-filtered-fix@^0.3.0: version "0.3.0" @@ -6368,9 +6407,9 @@ eslint@^7.14.0: v8-compile-cache "^2.0.3" eslint@^8.4.1: - version "8.26.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.26.0.tgz#2bcc8836e6c424c4ac26a5674a70d44d84f2181d" - integrity sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg== + version "8.27.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.27.0.tgz#d547e2f7239994ad1faa4bb5d84e5d809db7cf64" + integrity sha512-0y1bfG2ho7mty+SiILVf9PfuRA49ek4Nc60Wmmu62QlobNR+CeXa4xXIJgcuwSQgZiWaPH+5BDsctpIW0PR/wQ== dependencies: "@eslint/eslintrc" "^1.3.3" "@humanwhocodes/config-array" "^0.11.6" @@ -6431,9 +6470,9 @@ espree@^7.3.0, espree@^7.3.1: eslint-visitor-keys "^1.3.0" espree@^9.4.0: - version "9.4.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.0.tgz#cd4bc3d6e9336c433265fc0aa016fc1aaf182f8a" - integrity sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw== + version "9.4.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.1.tgz#51d6092615567a2c2cff7833445e37c28c0065bd" + integrity sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg== dependencies: acorn "^8.8.0" acorn-jsx "^5.3.2" @@ -6613,15 +6652,15 @@ expect@^27.5.1: jest-message-util "^27.5.1" expect@^29.0.0: - version "29.2.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.2.2.tgz#ba2dd0d7e818727710324a6e7f13dd0e6d086106" - integrity sha512-hE09QerxZ5wXiOhqkXy5d2G9ar+EqOyifnCXCpMNu+vZ6DG9TJ6CO2c2kPDSLqERTTWrO7OZj8EkYHQqSd78Yw== + version "29.3.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.3.1.tgz#92877aad3f7deefc2e3f6430dd195b92295554a6" + integrity sha512-gGb1yTgU30Q0O/tQq+z30KBWv24ApkMgFUpvKBkyLUBL68Wv8dHdJxTBZFl/iT8K/bqDHvUYRH6IIN3rToopPA== dependencies: - "@jest/expect-utils" "^29.2.2" + "@jest/expect-utils" "^29.3.1" jest-get-type "^29.2.0" - jest-matcher-utils "^29.2.2" - jest-message-util "^29.2.1" - jest-util "^29.2.1" + jest-matcher-utils "^29.3.1" + jest-message-util "^29.3.1" + jest-util "^29.3.1" express@^4.17.3: version "4.18.2" @@ -7169,7 +7208,7 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.1, get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385" integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A== @@ -7443,6 +7482,13 @@ glur@^1.1.2: resolved "https://registry.yarnpkg.com/glur/-/glur-1.1.2.tgz#f20ea36db103bfc292343921f1f91e83c3467689" integrity sha512-l+8esYHTKOx2G/Aao4lEQ0bnHWg4fWtJbVoZZT9Knxi01pB8C80BR85nONLFwkkQoFRCmXY+BUcGZN3yZ2QsRA== +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" @@ -7877,7 +7923,7 @@ ignore@^5.1.9, ignore@^5.2.0: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== -immer@^9.0.7: +immer@^9.0.16: version "9.0.16" resolved "https://registry.yarnpkg.com/immer/-/immer-9.0.16.tgz#8e7caab80118c2b54b37ad43e05758cdefad0198" integrity sha512-qenGE7CstVm1NrHQbMh8YaSzTZTFNP3zPqr3YU0S0UY441j4bJTg4A2Hh5KAhwgaiU6ZZ1Ar6y/2f4TblnMReQ== @@ -8094,7 +8140,7 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-arguments@^1.0.4, is-arguments@^1.1.0: +is-arguments@^1.1.0, is-arguments@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== @@ -8174,7 +8220,7 @@ is-data-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-date-object@^1.0.1, is-date-object@^1.0.2: +is-date-object@^1.0.1, is-date-object@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== @@ -8380,7 +8426,7 @@ is-potential-custom-element-name@^1.0.1: resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== -is-regex@^1.1.1, is-regex@^1.1.4: +is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== @@ -8443,15 +8489,15 @@ is-text-path@^1.0.1: dependencies: text-extensions "^1.0.0" -is-typed-array@^1.1.9: - version "1.1.9" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.9.tgz#246d77d2871e7d9f5aeb1d54b9f52c71329ece67" - integrity sha512-kfrlnTTn8pZkfpJMUgYD7YZ3qzeJgWUn8XfVYBARc4wnmNOmLbmuuaAs3q5fvB0UJOn6yHAKaGTPM7d6ezoD/A== +is-typed-array@^1.1.10: + version "1.1.10" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.10.tgz#36a5b5cb4189b575d1a3e4b08536bfb485801e3f" + integrity sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A== dependencies: available-typed-arrays "^1.0.5" call-bind "^1.0.2" - es-abstract "^1.20.0" for-each "^0.3.3" + gopd "^1.0.1" has-tostringtag "^1.0.0" is-typedarray@^1.0.0, is-typedarray@~1.0.0: @@ -8680,15 +8726,15 @@ jest-diff@^27.4.2, jest-diff@^27.5.1: jest-get-type "^27.5.1" pretty-format "^27.5.1" -jest-diff@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.2.1.tgz#027e42f5a18b693fb2e88f81b0ccab533c08faee" - integrity sha512-gfh/SMNlQmP3MOUgdzxPOd4XETDJifADpT937fN1iUGz+9DgOu2eUPHH25JDkLVcLwwqxv3GzVyK4VBUr9fjfA== +jest-diff@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.3.1.tgz#d8215b72fed8f1e647aed2cae6c752a89e757527" + integrity sha512-vU8vyiO7568tmin2lA3r2DP8oRvzhvRcD4DjpXc6uGveQodyk7CKLhQlCSiwgx3g0pFaE88/KLZ0yaTWMc4Uiw== dependencies: chalk "^4.0.0" - diff-sequences "^29.2.0" + diff-sequences "^29.3.1" jest-get-type "^29.2.0" - pretty-format "^29.2.1" + pretty-format "^29.3.1" jest-docblock@^27.5.1: version "27.5.1" @@ -8819,15 +8865,15 @@ jest-matcher-utils@^27.0.0, jest-matcher-utils@^27.5.1: jest-get-type "^27.5.1" pretty-format "^27.5.1" -jest-matcher-utils@^29.2.2: - version "29.2.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.2.2.tgz#9202f8e8d3a54733266784ce7763e9a08688269c" - integrity sha512-4DkJ1sDPT+UX2MR7Y3od6KtvRi9Im1ZGLGgdLFLm4lPexbTaCgJW5NN3IOXlQHF7NSHY/VHhflQ+WoKtD/vyCw== +jest-matcher-utils@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.3.1.tgz#6e7f53512f80e817dfa148672bd2d5d04914a572" + integrity sha512-fkRMZUAScup3txIKfMe3AIZZmPEjWEdsPJFK3AIy5qRohWqQFg1qrmKfYXR9qEkNc7OdAu2N4KPHibEmy4HPeQ== dependencies: chalk "^4.0.0" - jest-diff "^29.2.1" + jest-diff "^29.3.1" jest-get-type "^29.2.0" - pretty-format "^29.2.1" + pretty-format "^29.3.1" jest-message-util@^27.5.1: version "27.5.1" @@ -8844,18 +8890,18 @@ jest-message-util@^27.5.1: slash "^3.0.0" stack-utils "^2.0.3" -jest-message-util@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.2.1.tgz#3a51357fbbe0cc34236f17a90d772746cf8d9193" - integrity sha512-Dx5nEjw9V8C1/Yj10S/8ivA8F439VS8vTq1L7hEgwHFn9ovSKNpYW/kwNh7UglaEgXO42XxzKJB+2x0nSglFVw== +jest-message-util@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.3.1.tgz#37bc5c468dfe5120712053dd03faf0f053bd6adb" + integrity sha512-lMJTbgNcDm5z+6KDxWtqOFWlGQxD6XaYwBqHR8kmpkP+WWWG90I35kdtQHY67Ay5CSuydkTBbJG+tH9JShFCyA== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.2.1" + pretty-format "^29.3.1" slash "^3.0.0" stack-utils "^2.0.3" @@ -9010,12 +9056,12 @@ jest-util@^27.0.0, jest-util@^27.5.1: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-util@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.2.1.tgz#f26872ba0dc8cbefaba32c34f98935f6cf5fc747" - integrity sha512-P5VWDj25r7kj7kl4pN2rG/RN2c1TLfYYYZYULnS/35nFDjBai+hBeo3MDrYZS7p6IoY3YHZnt2vq4L6mKnLk0g== +jest-util@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.3.1.tgz#1dda51e378bbcb7e3bc9d8ab651445591ed373e1" + integrity sha512-7YOVZaiX7RJLv76ZfHt4nbNEzzTRiMW/IiOG7ZOKmTXmoGBxUDefgMAxQubu6WPVqP5zSzAdZG0FfLcC7HOIFQ== dependencies: - "@jest/types" "^29.2.1" + "@jest/types" "^29.3.1" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" @@ -9208,11 +9254,11 @@ json-stable-stringify-without-jsonify@^1.0.1: integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - integrity sha512-i/J297TW6xyj7sDFa7AmBPkQvLIxWr2kKPWI26tXydnZrzVAocNqn5DMNT1Mzk0vit1V5UkRM7C1KdVNp7Lmcg== + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.2.tgz#e06f23128e0bbe342dc996ed5a19e28b57b580e0" + integrity sha512-eunSSaEnxV12z+Z73y/j5N37/In40GK4GmsSy+tEHJMxknvqnA7/djeYtAgW0GsWHUfg+847WJjKaEylk2y09g== dependencies: - jsonify "~0.0.0" + jsonify "^0.0.1" json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" @@ -9247,7 +9293,7 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" -jsonify@~0.0.0: +jsonify@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.1.tgz#2aa3111dae3d34a0f151c63f3a45d995d9420978" integrity sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg== @@ -9519,9 +9565,9 @@ loader-runner@^4.2.0: integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== loader-utils@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.3.tgz#d4b15b8504c63d1fc3f2ade52d41bc8459d6ede1" - integrity sha512-THWqIsn8QRnvLl0shHYVBN9syumU8pYWEHPTmkiVGd+7K5eFNVSY6AJhRvgGF70gg1Dz+l/k8WicvFCxdEs60A== + version "2.0.4" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c" + integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" @@ -10484,7 +10530,7 @@ object-inspect@^1.12.2, object-inspect@^1.9.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== -object-is@^1.1.4: +object-is@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== @@ -10515,40 +10561,40 @@ object.assign@^4.1.2, object.assign@^4.1.3, object.assign@^4.1.4: object-keys "^1.1.1" object.entries@^1.1.2, object.entries@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861" - integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g== + version "1.1.6" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.6.tgz#9737d0e5b8291edd340a3e3264bb8a3b00d5fa23" + integrity sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" + define-properties "^1.1.4" + es-abstract "^1.20.4" object.fromentries@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.5.tgz#7b37b205109c21e741e605727fe8b0ad5fa08251" - integrity sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw== + version "2.0.6" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.6.tgz#cdb04da08c539cffa912dcd368b886e0904bfa73" + integrity sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" + define-properties "^1.1.4" + es-abstract "^1.20.4" object.getownpropertydescriptors@^2.0.3: - version "2.1.4" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.4.tgz#7965e6437a57278b587383831a9b829455a4bc37" - integrity sha512-sccv3L/pMModT6dJAYF3fzGMVcb38ysQ0tEE6ixv2yXJDtEIPph268OlAdJj5/qZMZDq2g/jqvwppt36uS/uQQ== + version "2.1.5" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.5.tgz#db5a9002489b64eef903df81d6623c07e5b4b4d3" + integrity sha512-yDNzckpM6ntyQiGTik1fKV1DcVDRS+w8bvpWNCBanvH5LfRX9O8WTHqQzG4RZwRAM4I0oU7TV11Lj5v0g20ibw== dependencies: - array.prototype.reduce "^1.0.4" + array.prototype.reduce "^1.0.5" call-bind "^1.0.2" define-properties "^1.1.4" - es-abstract "^1.20.1" + es-abstract "^1.20.4" object.hasown@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.1.1.tgz#ad1eecc60d03f49460600430d97f23882cf592a3" - integrity sha512-LYLe4tivNQzq4JdaWW6WO3HMZZJWzkkH8fnI6EebWl0VZth2wL2Lovm74ep2/gZzlaTdV62JZHEqHQ2yVn8Q/A== + version "1.1.2" + resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.1.2.tgz#f919e21fad4eb38a57bc6345b3afd496515c3f92" + integrity sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw== dependencies: define-properties "^1.1.4" - es-abstract "^1.19.5" + es-abstract "^1.20.4" object.pick@^1.3.0: version "1.3.0" @@ -10558,13 +10604,13 @@ object.pick@^1.3.0: isobject "^3.0.1" object.values@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" - integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg== + version "1.1.6" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.6.tgz#4abbaa71eba47d63589d402856f908243eea9b1d" + integrity sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" + define-properties "^1.1.4" + es-abstract "^1.20.4" oblivious-set@1.0.0: version "1.0.0" @@ -11163,9 +11209,9 @@ postcss-value-parser@^4.0.2, postcss-value-parser@^4.1.0, postcss-value-parser@^ integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== postcss@^8.1.10, postcss@^8.4.7: - version "8.4.18" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.18.tgz#6d50046ea7d3d66a85e0e782074e7203bc7fbca2" - integrity sha512-Wi8mWhncLJm11GATDaQKobXSNEYGUHeQLiQqDFG1qQ5UTDPTEvKw0Xt5NsTpktGTwLps3ByrWsBrG0rB8YQ9oA== + version "8.4.19" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.19.tgz#61178e2add236b17351897c8bcc0b4c8ecab56fc" + integrity sha512-h+pbPsyhlYj6N2ozBmHhHrs9DzGmbaarbLvWipMRO7RLS+v4onj26MPFXA5OBYFxyqYhUJK456SwDcY9H2/zsA== dependencies: nanoid "^3.3.4" picocolors "^1.0.0" @@ -11218,10 +11264,10 @@ pretty-format@^27.0.0, pretty-format@^27.0.2, pretty-format@^27.5.1: ansi-styles "^5.0.0" react-is "^17.0.1" -pretty-format@^29.0.0, pretty-format@^29.2.1: - version "29.2.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.2.1.tgz#86e7748fe8bbc96a6a4e04fa99172630907a9611" - integrity sha512-Y41Sa4aLCtKAXvwuIpTvcFBkyeYp2gdFWzXGA+ZNES3VwURIB165XO/z7CjETwzCCS53MjW/rLMyyqEnTtaOfA== +pretty-format@^29.0.0, pretty-format@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.3.1.tgz#1841cac822b02b4da8971dacb03e8a871b4722da" + integrity sha512-FyLnmb1cYJV8biEIiRyzRFvs2lry7PPIvOqKVe1GCUEYg4YGmlx1qG9EJNMxArYm7piII4qb8UV1Pncq5dxmcg== dependencies: "@jest/schemas" "^29.0.0" ansi-styles "^5.0.0" @@ -11747,12 +11793,12 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" -redux-thunk@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.4.1.tgz#0dd8042cf47868f4b29699941de03c9301a75714" - integrity sha512-OOYGNY5Jy2TWvTL1KgAlVy6dcx3siPJ1wTq741EPyUKfn6W6nChdICjZwCd0p8AZBs5kWpZlbkXW2nE/zjUa+Q== +redux-thunk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.4.2.tgz#b9d05d11994b99f7a91ea223e8b04cf0afa5ef3b" + integrity sha512-+P3TjtnP0k/FEjcBL5FZpoovtvrTNT/UXd4/sluaSyrURlSlhLSzEdfsTBW7WsKB6yPvgd7q/iZPICFjW4o57Q== -redux@^4.0.0, redux@^4.1.2: +redux@^4.0.0, redux@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/redux/-/redux-4.2.0.tgz#46f10d6e29b6666df758780437651eeb2b969f13" integrity sha512-oSBmcKKIuIR4ME29/AeNUnl5L+hvBq7OaJWzaptTQJAntaPvxIJqfnjbaEiCzzaIz+XmVILfqAM3Ob0aXLPfjA== @@ -11801,7 +11847,7 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexp.prototype.flags@^1.3.0, regexp.prototype.flags@^1.4.1, regexp.prototype.flags@^1.4.3: +regexp.prototype.flags@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== @@ -11940,10 +11986,10 @@ requires-port@^1.0.0: resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== -reselect@^4.1.5: - version "4.1.6" - resolved "https://registry.yarnpkg.com/reselect/-/reselect-4.1.6.tgz#19ca2d3d0b35373a74dc1c98692cdaffb6602656" - integrity sha512-ZovIuXqto7elwnxyXbBtCPo9YFEr3uJqj2rRbcOOog1bmu2Ag85M4hixSwFWyaBMKXNgvPaJ9OSu9SkBPIeJHQ== +reselect@^4.1.7: + version "4.1.7" + resolved "https://registry.yarnpkg.com/reselect/-/reselect-4.1.7.tgz#56480d9ff3d3188970ee2b76527bd94a95567a42" + integrity sha512-Zu1xbUt3/OPwsXL46hvOOoQrap2azE7ZQbokq61BQfiXvhewsKDwhMeZjTX9sX0nvw1t/U5Audyn1I9P/m9z0A== resolve-cwd@^2.0.0: version "2.0.0" @@ -12336,7 +12382,7 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -side-channel@^1.0.3, side-channel@^1.0.4: +side-channel@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== @@ -12661,9 +12707,9 @@ ssri@^6.0.0, ssri@^6.0.1: figgy-pudding "^3.5.1" stack-utils@^2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" - integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== + version "2.0.6" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" + integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== dependencies: escape-string-regexp "^2.0.0" @@ -12772,36 +12818,36 @@ string-width@^3.0.0, string-width@^3.1.0: strip-ansi "^5.1.0" string.prototype.matchall@^4.0.7: - version "4.0.7" - resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz#8e6ecb0d8a1fb1fda470d81acecb2dba057a481d" - integrity sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg== + version "4.0.8" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz#3bf85722021816dcd1bf38bb714915887ca79fd3" + integrity sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" - get-intrinsic "^1.1.1" + define-properties "^1.1.4" + es-abstract "^1.20.4" + get-intrinsic "^1.1.3" has-symbols "^1.0.3" internal-slot "^1.0.3" - regexp.prototype.flags "^1.4.1" + regexp.prototype.flags "^1.4.3" side-channel "^1.0.4" string.prototype.trimend@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz#914a65baaab25fbdd4ee291ca7dde57e869cb8d0" - integrity sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog== + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" + integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" - es-abstract "^1.19.5" + es-abstract "^1.20.4" string.prototype.trimstart@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz#5466d93ba58cfa2134839f81d7f42437e8c01fef" - integrity sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg== + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" + integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" - es-abstract "^1.19.5" + es-abstract "^1.20.4" string_decoder@^1.1.1: version "1.3.0" @@ -13899,37 +13945,7 @@ webpack-sources@^3.2.3: resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@^5.74.0: - version "5.74.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.74.0.tgz#02a5dac19a17e0bb47093f2be67c695102a55980" - integrity sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA== - dependencies: - "@types/eslint-scope" "^3.7.3" - "@types/estree" "^0.0.51" - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/wasm-edit" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - acorn "^8.7.1" - acorn-import-assertions "^1.7.6" - browserslist "^4.14.5" - chrome-trace-event "^1.0.2" - enhanced-resolve "^5.10.0" - es-module-lexer "^0.9.0" - eslint-scope "5.1.1" - events "^3.2.0" - glob-to-regexp "^0.4.1" - graceful-fs "^4.2.9" - json-parse-even-better-errors "^2.3.1" - loader-runner "^4.2.0" - mime-types "^2.1.27" - neo-async "^2.6.2" - schema-utils "^3.1.0" - tapable "^2.1.1" - terser-webpack-plugin "^5.1.3" - watchpack "^2.4.0" - webpack-sources "^3.2.3" - -webpack@^5.75.0: +webpack@^5.74.0, webpack@^5.75.0: version "5.75.0" resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.75.0.tgz#1e440468647b2505860e94c9ff3e44d5b582c152" integrity sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ== @@ -14011,7 +14027,7 @@ whatwg-url@^8.0.0, whatwg-url@^8.5.0: tr46 "^2.1.0" webidl-conversions "^6.1.0" -which-boxed-primitive@^1.0.1, which-boxed-primitive@^1.0.2: +which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== @@ -14042,17 +14058,17 @@ which-pm-runs@^1.0.0: resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.1.0.tgz#35ccf7b1a0fce87bd8b92a478c9d045785d3bf35" integrity sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA== -which-typed-array@^1.1.2: - version "1.1.8" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.8.tgz#0cfd53401a6f334d90ed1125754a42ed663eb01f" - integrity sha512-Jn4e5PItbcAHyLoRDwvPj1ypu27DJbtdYXUa5zsinrUx77Uvfb0cXwwnGMTn7cjUfhhqgVQnVJCwF+7cgU7tpw== +which-typed-array@^1.1.8: + version "1.1.9" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" + integrity sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA== dependencies: available-typed-arrays "^1.0.5" call-bind "^1.0.2" - es-abstract "^1.20.0" for-each "^0.3.3" + gopd "^1.0.1" has-tostringtag "^1.0.0" - is-typed-array "^1.1.9" + is-typed-array "^1.1.10" which@2.0.2, which@^2.0.1: version "2.0.2" From d885f284f2dc81d18a8f7f7d8b84b575a992da5d Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Nov 2022 18:42:52 -0800 Subject: [PATCH 14/55] Add why-did-you-render plugin. --- packages/webapp/package.json | 1 + packages/webapp/src/index.tsx | 4 +++- packages/webapp/src/wdyr.ts | 15 +++++++++++++++ yarn.lock | 9 ++++++++- 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 packages/webapp/src/wdyr.ts diff --git a/packages/webapp/package.json b/packages/webapp/package.json index 78ae9ec0..466dfd37 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -27,6 +27,7 @@ "@types/testing-library__cypress": "^5.0.8", "@typescript-eslint/eslint-plugin": "^5.41.0", "@typescript-eslint/parser": "^5.41.0", + "@welldone-software/why-did-you-render": "^7.0.1", "clean-webpack-plugin": "^3.0.05.10.11", "copy-webpack-plugin": "^7.0.0", "cypress": "^10.11.0", diff --git a/packages/webapp/src/index.tsx b/packages/webapp/src/index.tsx index 53b0e429..38dd6ad1 100644 --- a/packages/webapp/src/index.tsx +++ b/packages/webapp/src/index.tsx @@ -1,9 +1,11 @@ +import './wdyr'; // <--- first import + import React from 'react'; import App from './app'; import { createRoot } from 'react-dom/client'; async function bootstrapApplication() { - const container = document.getElementById('root') as HTMLElement + const container = document.getElementById('root') as HTMLElement; const root = createRoot(container!); root.render(); } diff --git a/packages/webapp/src/wdyr.ts b/packages/webapp/src/wdyr.ts new file mode 100644 index 00000000..7f519025 --- /dev/null +++ b/packages/webapp/src/wdyr.ts @@ -0,0 +1,15 @@ +/// + +import React from 'react'; + +if (process.env.NODE_ENV === 'development') { + // eslint-disable-next-line @typescript-eslint/no-var-requires + const whyDidYouRender = require('@welldone-software/why-did-you-render'); + if (process.env.NODE_ENV === 'development') { + whyDidYouRender(React, { + trackAllPureComponents: true, + trackHooks: true, + trackExtraHooks: [[require('react-redux/lib'), 'useSelector']], + }); + } +} diff --git a/yarn.lock b/yarn.lock index c6572a23..ae732bba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3531,6 +3531,13 @@ resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.7.0.tgz#e1993689ac42d2b16e9194376cfb6753f6254db1" integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q== +"@welldone-software/why-did-you-render@^7.0.1": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@welldone-software/why-did-you-render/-/why-did-you-render-7.0.1.tgz#09f487d84844bd8e66435843c2e0305702e61efb" + integrity sha512-Qe/8Xxa2G+LMdI6VoazescPzjjkHYduCDa8aHOJR50e9Bgs8ihkfMBY+ev7B4oc3N59Zm547Sgjf8h5y0FOyoA== + dependencies: + lodash "^4" + "@xtuc/ieee754@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" @@ -9683,7 +9690,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== -lodash@^4.0.1, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.2.1, lodash@^4.7.0: +lodash@^4, lodash@^4.0.1, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.2.1, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== From 2d133f33fbbfab40bee3b825bb6ceb362f0bd78b Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 12 Nov 2022 19:49:24 -0800 Subject: [PATCH 15/55] Optimize starred rendering. --- packages/editor/src/components/app-bar/index.tsx | 12 +++++++++--- public | 1 - 2 files changed, 9 insertions(+), 4 deletions(-) delete mode 120000 public diff --git a/packages/editor/src/components/app-bar/index.tsx b/packages/editor/src/components/app-bar/index.tsx index 3f948644..bf02bfaf 100644 --- a/packages/editor/src/components/app-bar/index.tsx +++ b/packages/editor/src/components/app-bar/index.tsx @@ -59,6 +59,14 @@ const keyTooltip = (msg: string, key: string): string => { return `${msg} (${isMac ? 'โŒ˜' : 'Ctrl'} + ${key})`; }; +const StarredOnStyle = { + color: '#FDDA0D', +}; + +const StarredOffStyle = { + color: 'gray', +}; + const AppBar = ({ model, mapInfo, @@ -180,9 +188,7 @@ const AppBar = ({ diff --git a/public b/public deleted file mode 120000 index 53c37a16..00000000 --- a/public +++ /dev/null @@ -1 +0,0 @@ -dist \ No newline at end of file From a96c9902d6951c8f08421286b2ed1079e953c118 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 15 Nov 2022 22:45:59 -0800 Subject: [PATCH 16/55] Lazy loading for map --- .../action-widget/pane/color-picker/index.tsx | 4 +- .../src/components/LocalStorageManager.ts | 45 +++++++++---------- .../src/components/MindplotWebComponent.ts | 4 +- .../src/components/MockPersistenceManager.ts | 4 +- .../src/components/PersistenceManager.ts | 12 ++--- .../src/components/RestPersistenceManager.ts | 32 +++++-------- packages/webapp/src/index.tsx | 12 ++--- 7 files changed, 51 insertions(+), 62 deletions(-) diff --git a/packages/editor/src/components/action-widget/pane/color-picker/index.tsx b/packages/editor/src/components/action-widget/pane/color-picker/index.tsx index 7b189ed2..21eadc4b 100644 --- a/packages/editor/src/components/action-widget/pane/color-picker/index.tsx +++ b/packages/editor/src/components/action-widget/pane/color-picker/index.tsx @@ -32,7 +32,7 @@ const ColorPicker = (props: { { + onChangeComplete={(color: { hex: string }) => { props.colorModel.setValue(color.hex); props.closeModal(); }} @@ -40,7 +40,7 @@ const ColorPicker = (props: { width={216} circleSpacing={9} circleSize={18} - > + /> ); }; diff --git a/packages/mindplot/src/components/LocalStorageManager.ts b/packages/mindplot/src/components/LocalStorageManager.ts index b53fceb3..b62d3091 100644 --- a/packages/mindplot/src/components/LocalStorageManager.ts +++ b/packages/mindplot/src/components/LocalStorageManager.ts @@ -15,7 +15,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import $ from 'jquery'; import PersistenceManager from './PersistenceManager'; class LocalStorageManager extends PersistenceManager { @@ -47,36 +46,36 @@ class LocalStorageManager extends PersistenceManager { } } - loadMapDom(mapId: string) { - let xml; + loadMapDom(mapId: string): Promise { + let result: Promise; + let localStorate; if (!this.readOnly) { - xml = localStorage.getItem(`${mapId}-xml`); + localStorate = localStorage.getItem(`${mapId}-xml`); } - if (xml == null || this.forceLoad) { - $.ajax({ - url: this.documentUrl.replace('{id}', mapId), + + if (localStorate == null || this.forceLoad) { + const url = this.documentUrl.replace('{id}', mapId); + result = fetch(url, { + method: 'get', headers: { 'Content-Type': 'text/plain', Accept: 'application/xml', 'X-CSRF-Token': this.getCSRFToken(), }, - type: 'get', - dataType: 'text', - async: false, - success(response) { - xml = response; - }, - error(xhr, ajaxOptions, thrownError) { - console.error(`Request error => status:${xhr.status} ,thrownError: ${thrownError}`); - }, - }); - // If I could not load it from a file, hard code one. - if (xml == null) { - throw new Error(`Map could not be loaded with id:${mapId}`); - } + }) + .then((response: Response) => { + if (!response.ok) { + console.error(`load error: ${response.status}`); + throw new Error(`load error: ${response.status}, ${response.statusText}`); + } + return response.text(); + }) + .then((xmlStr) => new DOMParser().parseFromString(xmlStr, 'text/xml')); + } else { + const doc = new DOMParser().parseFromString(localStorate, 'text/xml'); + result = Promise.resolve(doc); } - - return $.parseXML(xml); + return result; } unlockMap(): void { diff --git a/packages/mindplot/src/components/MindplotWebComponent.ts b/packages/mindplot/src/components/MindplotWebComponent.ts index 6312f0e1..d1f2347e 100644 --- a/packages/mindplot/src/components/MindplotWebComponent.ts +++ b/packages/mindplot/src/components/MindplotWebComponent.ts @@ -100,9 +100,9 @@ class MindplotWebComponent extends HTMLElement { * Load map in designer throught persistence manager instance * @param id the map id to be loaded. */ - loadMap(id: string) { + async loadMap(id: string): Promise { const instance = PersistenceManager.getInstance(); - this._mindmap = instance.load(id); + this._mindmap = await instance.load(id); this._designer.loadMap(this._mindmap); } diff --git a/packages/mindplot/src/components/MockPersistenceManager.ts b/packages/mindplot/src/components/MockPersistenceManager.ts index f139dc20..5765bb52 100644 --- a/packages/mindplot/src/components/MockPersistenceManager.ts +++ b/packages/mindplot/src/components/MockPersistenceManager.ts @@ -36,8 +36,8 @@ class MockPersistenceManager extends PersistenceManager { // Ignore, no implementation required ... } - loadMapDom() { - return $.parseXML(this.exampleMap); + loadMapDom(): Promise { + return Promise.resolve($.parseXML(this.exampleMap)); } unlockMap(): void { diff --git a/packages/mindplot/src/components/PersistenceManager.ts b/packages/mindplot/src/components/PersistenceManager.ts index 3fe9ed83..9b9af483 100644 --- a/packages/mindplot/src/components/PersistenceManager.ts +++ b/packages/mindplot/src/components/PersistenceManager.ts @@ -61,10 +61,12 @@ abstract class PersistenceManager { return result; } - load(mapId: string) { + load(mapId: string): Promise { $assert(mapId, 'mapId can not be null'); - const domDocument = this.loadMapDom(mapId); - return PersistenceManager.loadFromDom(mapId, domDocument); + return this.loadMapDom(mapId).then((document) => { + console.log(`Loding map with is ${mapId}}`); + return PersistenceManager.loadFromDom(mapId, document); + }); } triggerError(error: PersistenceError) { @@ -75,7 +77,7 @@ abstract class PersistenceManager { this._errorHandlers.push(callback); } - removeErrorHandler(callback?: PersistenceErrorCallback) { + removeErrorHandler(callback?: PersistenceErrorCallback): void { if (!callback) { this._errorHandlers.length = 0; } @@ -87,7 +89,7 @@ abstract class PersistenceManager { abstract discardChanges(mapId: string): void; - abstract loadMapDom(mapId: string): Document; + abstract loadMapDom(mapId: string): Promise; abstract saveMapXml(mapId: string, mapXml: Document, pref?, saveHistory?: boolean, events?); diff --git a/packages/mindplot/src/components/RestPersistenceManager.ts b/packages/mindplot/src/components/RestPersistenceManager.ts index 4089c9df..91dce1cf 100644 --- a/packages/mindplot/src/components/RestPersistenceManager.ts +++ b/packages/mindplot/src/components/RestPersistenceManager.ts @@ -16,7 +16,6 @@ * limitations under the License. */ import { $assert } from '@wisemapping/core-js'; -import $ from 'jquery'; import { $msg } from './Messages'; import PersistenceManager, { PersistenceError } from './PersistenceManager'; @@ -157,31 +156,24 @@ class RESTPersistenceManager extends PersistenceManager { return { severity, message }; } - loadMapDom(mapId: string): Document { - let xml: Document; - $.ajax({ - url: `${this.documentUrl.replace('{id}', mapId)}/xml`, + loadMapDom(mapId: string): Promise { + const url = `${this.documentUrl.replace('{id}', mapId)}/xml`; + return fetch(url, { method: 'get', - async: false, headers: { 'Content-Type': 'text/plain', Accept: 'application/xml', 'X-CSRF-Token': this.getCSRFToken(), }, - success(responseText) { - xml = responseText; - }, - error(xhr, ajaxOptions, thrownError) { - console.error(`Request error => status:${xhr.status} ,thrownError: ${thrownError}`); - }, - }); - - // If I could not load it from a file, hard code one. - if (xml == null) { - throw new Error(`Map with id ${mapId} could not be loaded`); - } - - return xml; + }) + .then((response: Response) => { + if (!response.ok) { + console.error(`load error: ${response.status}`); + throw new Error(`load error: ${response.status}, ${response.statusText}`); + } + return response.text(); + }) + .then((xmlStr) => new DOMParser().parseFromString(xmlStr, 'text/xml')); } } diff --git a/packages/webapp/src/index.tsx b/packages/webapp/src/index.tsx index 38dd6ad1..9c7b460c 100644 --- a/packages/webapp/src/index.tsx +++ b/packages/webapp/src/index.tsx @@ -1,13 +1,9 @@ -import './wdyr'; // <--- first import +// import './wdyr'; import React from 'react'; import App from './app'; import { createRoot } from 'react-dom/client'; -async function bootstrapApplication() { - const container = document.getElementById('root') as HTMLElement; - const root = createRoot(container!); - root.render(); -} - -bootstrapApplication(); +const container = document.getElementById('root') as HTMLElement; +const root = createRoot(container!); +root.render(); From 62de3c0d716e5b2777ca8149f42d4f2b5979750d Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 16 Nov 2022 13:15:34 -0800 Subject: [PATCH 17/55] Migrate to new version of dom router. --- .../src/components/PersistenceManager.ts | 2 +- packages/webapp/package.json | 2 +- packages/webapp/src/app.tsx | 86 +++++++++--------- .../components/forgot-password-page/index.tsx | 6 +- .../components/registration-page/index.tsx | 6 +- yarn.lock | 89 +++++-------------- 6 files changed, 70 insertions(+), 121 deletions(-) diff --git a/packages/mindplot/src/components/PersistenceManager.ts b/packages/mindplot/src/components/PersistenceManager.ts index 9b9af483..711c92bd 100644 --- a/packages/mindplot/src/components/PersistenceManager.ts +++ b/packages/mindplot/src/components/PersistenceManager.ts @@ -64,7 +64,7 @@ abstract class PersistenceManager { load(mapId: string): Promise { $assert(mapId, 'mapId can not be null'); return this.loadMapDom(mapId).then((document) => { - console.log(`Loding map with is ${mapId}}`); + console.log(`Loading map with is ${mapId}}`); return PersistenceManager.loadFromDom(mapId, document); }); } diff --git a/packages/webapp/package.json b/packages/webapp/package.json index 466dfd37..8521cde5 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -61,7 +61,7 @@ "react-intl": "^6.2.1", "react-query": "^3.39.1", "react-redux": "^7.2.2", - "react-router-dom": "^5.2.0", + "react-router-dom": "^6.4.3", "styled-components": "^5.3.6" } } diff --git a/packages/webapp/src/app.tsx b/packages/webapp/src/app.tsx index fee7e8b5..a84e6e7b 100644 --- a/packages/webapp/src/app.tsx +++ b/packages/webapp/src/app.tsx @@ -1,6 +1,6 @@ -import React, { ReactElement, Suspense } from 'react'; +import React, { ReactElement, Suspense, useEffect } from 'react'; import { FormattedMessage, IntlProvider } from 'react-intl'; -import { Route, Switch, Redirect, BrowserRouter as Router } from 'react-router-dom'; +import { Route, Routes, BrowserRouter as Router, useNavigate } from 'react-router-dom'; import ForgotPasswordSuccessPage from './components/forgot-password-success-page'; import RegistationPage from './components/registration-page'; import LoginPage from './components/login-page'; @@ -41,6 +41,15 @@ const queryClient = new QueryClient({ }, }); +// eslint-disable-next-line react/prop-types +function Redirect({ to }) { + const navigate = useNavigate(); + useEffect(() => { + navigate(to); + }); + return null; +} + const App = (): ReactElement => { const locale = AppI18n.getDefaultLocale(); const EnhacedEditorPage = withSessionExpirationHandling(EditorPage); @@ -57,49 +66,36 @@ const App = (): ReactElement => { - - - - - - - - - - - - -
- } - > - - -
- - - - - } - > - - - - - - - - } - > - - - - + + } /> + } /> + } /> + } /> + } /> + } + /> + + + + } + > + + + } + /> + } + /> + } /> + diff --git a/packages/webapp/src/components/forgot-password-page/index.tsx b/packages/webapp/src/components/forgot-password-page/index.tsx index 643404dc..1eae86a8 100644 --- a/packages/webapp/src/components/forgot-password-page/index.tsx +++ b/packages/webapp/src/components/forgot-password-page/index.tsx @@ -1,6 +1,5 @@ import React, { useState, useEffect } from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; -import { useHistory } from 'react-router-dom'; import Client, { ErrorInfo } from '../../classes/client'; import Header from '../layout/header'; @@ -16,18 +15,19 @@ import ReactGA from 'react-ga4'; import Typography from '@mui/material/Typography'; import { getCsrfToken, getCsrfTokenParameter } from '../../utils'; +import { useNavigate } from 'react-router-dom'; const ForgotPassword = () => { const [email, setEmail] = useState(''); const [error, setError] = useState(); - const history = useHistory(); + const navigate = useNavigate(); const intl = useIntl(); const service: Client = useSelector(activeInstance); const mutation = useMutation( (email: string) => service.resetPassword(email), { - onSuccess: () => history.push('/c/forgot-password-success'), + onSuccess: () => navigate('/c/forgot-password-success'), onError: (error) => { setError(error); }, diff --git a/packages/webapp/src/components/registration-page/index.tsx b/packages/webapp/src/components/registration-page/index.tsx index a6a6f6dd..e4025377 100644 --- a/packages/webapp/src/components/registration-page/index.tsx +++ b/packages/webapp/src/components/registration-page/index.tsx @@ -1,7 +1,7 @@ import React, { useState, useEffect } from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; import ReCAPTCHA from 'react-google-recaptcha'; -import { useHistory } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; import Client, { ErrorInfo } from '../../classes/client'; import FormContainer from '../layout/form-container'; @@ -33,14 +33,14 @@ const RegistrationForm = () => { const [error, setError] = useState(); // eslint-disable-next-line @typescript-eslint/no-explicit-any const [captcha, setCaptcha] = useState(); - const history = useHistory(); + const navigate = useNavigate(); const intl = useIntl(); const Client: Client = useSelector(activeInstance); const mutation = useMutation( (model: Model) => Client.registerNewUser({ ...model }), { - onSuccess: () => history.push('/c/registration-success'), + onSuccess: () => navigate('/c/registration-success'), onError: (error) => { setError(error); captcha.reset(); diff --git a/yarn.lock b/yarn.lock index ae732bba..189cf497 100644 --- a/yarn.lock +++ b/yarn.lock @@ -938,7 +938,7 @@ core-js-pure "^3.25.1" regenerator-runtime "^0.13.10" -"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.14.6", "@babel/runtime@^7.15.4", "@babel/runtime@^7.18.3", "@babel/runtime@^7.19.0", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.10.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.14.6", "@babel/runtime@^7.15.4", "@babel/runtime@^7.18.3", "@babel/runtime@^7.19.0", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": version "7.20.1" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.1.tgz#1148bb33ab252b165a06698fde7576092a78b4a9" integrity sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg== @@ -2686,6 +2686,11 @@ redux-thunk "^2.4.2" reselect "^4.1.7" +"@remix-run/router@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.0.3.tgz#953b88c20ea00d0eddaffdc1b115c08474aa295d" + integrity sha512-ceuyTSs7PZ/tQqi19YZNBc5X7kj1f8p+4DIyrcIYFY9h+hd1OKm4RqtiWldR9eGEvIiJfsqwM4BsuCtRIuEw6Q== + "@sideway/address@^4.1.3": version "4.1.4" resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0" @@ -7642,19 +7647,7 @@ he@1.2.0, he@^1.2.0: resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== -history@^4.9.0: - version "4.10.1" - resolved "https://registry.yarnpkg.com/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3" - integrity sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew== - dependencies: - "@babel/runtime" "^7.1.2" - loose-envify "^1.2.0" - resolve-pathname "^3.0.0" - tiny-invariant "^1.0.2" - tiny-warning "^1.0.0" - value-equal "^1.0.1" - -hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.1, hoist-non-react-statics@^3.3.2: +hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.1, hoist-non-react-statics@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== @@ -8554,11 +8547,6 @@ is-wsl@^2.2.0: dependencies: is-docker "^2.0.0" -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== - isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -9713,7 +9701,7 @@ log-update@^4.0.0: slice-ansi "^4.0.0" wrap-ansi "^6.2.0" -loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0: +loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -11029,13 +11017,6 @@ path-to-regexp@0.1.7: resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== -path-to-regexp@^1.7.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a" - integrity sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA== - dependencies: - isarray "0.0.1" - path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" @@ -11556,7 +11537,7 @@ react-intl@^6.2.1: intl-messageformat "10.2.1" tslib "2.4.0" -react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0: +react-is@^16.13.1, react-is@^16.7.0: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -11592,33 +11573,20 @@ react-redux@^7.2.2: prop-types "^15.7.2" react-is "^17.0.2" -react-router-dom@^5.2.0: - version "5.3.4" - resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.3.4.tgz#2ed62ffd88cae6db134445f4a0c0ae8b91d2e5e6" - integrity sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ== +react-router-dom@^6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.4.3.tgz#70093b5f65f85f1df9e5d4182eb7ff3a08299275" + integrity sha512-MiaYQU8CwVCaOfJdYvt84KQNjT78VF0TJrA17SIQgNHRvLnXDJO6qsFqq8F/zzB1BWZjCFIrQpu4QxcshitziQ== dependencies: - "@babel/runtime" "^7.12.13" - history "^4.9.0" - loose-envify "^1.3.1" - prop-types "^15.6.2" - react-router "5.3.4" - tiny-invariant "^1.0.2" - tiny-warning "^1.0.0" + "@remix-run/router" "1.0.3" + react-router "6.4.3" -react-router@5.3.4: - version "5.3.4" - resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.3.4.tgz#8ca252d70fcc37841e31473c7a151cf777887bb5" - integrity sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA== +react-router@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.4.3.tgz#9ed3ee4d6e95889e9b075a5d63e29acc7def0d49" + integrity sha512-BT6DoGn6aV1FVP5yfODMOiieakp3z46P1Fk0RNzJMACzE7C339sFuHebfvWtnB4pzBvXXkHP2vscJzWRuUjTtA== dependencies: - "@babel/runtime" "^7.12.13" - history "^4.9.0" - hoist-non-react-statics "^3.1.0" - loose-envify "^1.3.1" - path-to-regexp "^1.7.0" - prop-types "^15.6.2" - react-is "^16.6.0" - tiny-invariant "^1.0.2" - tiny-warning "^1.0.0" + "@remix-run/router" "1.0.3" react-transition-group@^4.4.5: version "4.4.5" @@ -12027,11 +11995,6 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve-pathname@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-3.0.0.tgz#99d02224d3cf263689becbb393bc560313025dcd" - integrity sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng== - resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" @@ -13216,12 +13179,7 @@ thunky@^1.0.2: resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d" integrity sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA== -tiny-invariant@^1.0.2: - version "1.3.1" - resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.3.1.tgz#8560808c916ef02ecfd55e66090df23a4b7aa642" - integrity sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw== - -tiny-warning@^1.0.0, tiny-warning@^1.0.2: +tiny-warning@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== @@ -13759,11 +13717,6 @@ validate-npm-package-name@^3.0.0: dependencies: builtins "^1.0.3" -value-equal@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-1.0.1.tgz#1e0b794c734c5c0cade179c437d356d931a34d6c" - integrity sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw== - vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" From 1f7f84dccaa548279a2b4a24e4fe33aeb12d28c3 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 16 Nov 2022 17:10:40 -0800 Subject: [PATCH 18/55] Remove lazy loading for editor --- packages/webapp/src/app.tsx | 2 +- .../src/components/maps-page/action-dispatcher/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/webapp/src/app.tsx b/packages/webapp/src/app.tsx index a84e6e7b..261f3cc1 100644 --- a/packages/webapp/src/app.tsx +++ b/packages/webapp/src/app.tsx @@ -16,8 +16,8 @@ import ReactGA from 'react-ga4'; import AppConfig from './classes/app-config'; import withSessionExpirationHandling from './components/HOCs/withSessionExpirationHandling'; import RegistrationSuccessPage from './components/registration-success-page'; +import EditorPage from './components/editor-page'; -const EditorPage = React.lazy(() => import('./components/editor-page')); const MapsPage = React.lazy(() => import('./components/maps-page')); declare module '@mui/styles/defaultTheme' { diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/index.tsx index 5e00a6ec..cc82f52f 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/index.tsx @@ -12,7 +12,7 @@ import InfoDialog from './info-dialog'; import DeleteMultiselectDialog from './delete-multiselect-dialog'; import ExportDialog from './export-dialog'; import ShareDialog from './share-dialog'; -import LabelDialog from './label-dialog'; +// import LabelDialog from './label-dialog'; import ReactGA from 'react-ga4'; export type BasicMapInfo = { @@ -76,7 +76,7 @@ const ActionDispatcher = ({ )} {action === 'share' && } - {action === 'label' && } + {/* {action === 'label' && } */} ); }; From 39d80abb524b43cd06583677a88ac8939f3a112f Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 16 Nov 2022 17:19:32 -0800 Subject: [PATCH 19/55] Remove broken links --- dist/src_components_editor-page_index_tsx.bundle.js | 1 - dist/src_components_editor-page_index_tsx.bundle.js.map | 1 - ...rc_components_maps-page_action-dispatcher_in-ba81d4.bundle.js | 1 - ...omponents_maps-page_action-dispatcher_in-ba81d4.bundle.js.map | 1 - 4 files changed, 4 deletions(-) delete mode 120000 dist/src_components_editor-page_index_tsx.bundle.js delete mode 120000 dist/src_components_editor-page_index_tsx.bundle.js.map delete mode 120000 dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js delete mode 120000 dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js.map diff --git a/dist/src_components_editor-page_index_tsx.bundle.js b/dist/src_components_editor-page_index_tsx.bundle.js deleted file mode 120000 index 230e06d8..00000000 --- a/dist/src_components_editor-page_index_tsx.bundle.js +++ /dev/null @@ -1 +0,0 @@ -../packages/webapp/dist/src_components_editor-page_index_tsx.bundle.js \ No newline at end of file diff --git a/dist/src_components_editor-page_index_tsx.bundle.js.map b/dist/src_components_editor-page_index_tsx.bundle.js.map deleted file mode 120000 index 1ea220b6..00000000 --- a/dist/src_components_editor-page_index_tsx.bundle.js.map +++ /dev/null @@ -1 +0,0 @@ -../packages/webapp/dist/src_components_editor-page_index_tsx.bundle.js.map \ No newline at end of file diff --git a/dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js b/dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js deleted file mode 120000 index b9a71ca4..00000000 --- a/dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js +++ /dev/null @@ -1 +0,0 @@ -../packages/webapp/dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js \ No newline at end of file diff --git a/dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js.map b/dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js.map deleted file mode 120000 index 36a97195..00000000 --- a/dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js.map +++ /dev/null @@ -1 +0,0 @@ -../packages/webapp/dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js.map \ No newline at end of file From e28e68015f18f639e1590ee3487aa522e8cd7e15 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 16 Nov 2022 18:31:53 -0800 Subject: [PATCH 20/55] Revert "Remove broken links" This reverts commit 39d80abb524b43cd06583677a88ac8939f3a112f. --- dist/src_components_editor-page_index_tsx.bundle.js | 1 + dist/src_components_editor-page_index_tsx.bundle.js.map | 1 + ...rc_components_maps-page_action-dispatcher_in-ba81d4.bundle.js | 1 + ...omponents_maps-page_action-dispatcher_in-ba81d4.bundle.js.map | 1 + 4 files changed, 4 insertions(+) create mode 120000 dist/src_components_editor-page_index_tsx.bundle.js create mode 120000 dist/src_components_editor-page_index_tsx.bundle.js.map create mode 120000 dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js create mode 120000 dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js.map diff --git a/dist/src_components_editor-page_index_tsx.bundle.js b/dist/src_components_editor-page_index_tsx.bundle.js new file mode 120000 index 00000000..230e06d8 --- /dev/null +++ b/dist/src_components_editor-page_index_tsx.bundle.js @@ -0,0 +1 @@ +../packages/webapp/dist/src_components_editor-page_index_tsx.bundle.js \ No newline at end of file diff --git a/dist/src_components_editor-page_index_tsx.bundle.js.map b/dist/src_components_editor-page_index_tsx.bundle.js.map new file mode 120000 index 00000000..1ea220b6 --- /dev/null +++ b/dist/src_components_editor-page_index_tsx.bundle.js.map @@ -0,0 +1 @@ +../packages/webapp/dist/src_components_editor-page_index_tsx.bundle.js.map \ No newline at end of file diff --git a/dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js b/dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js new file mode 120000 index 00000000..b9a71ca4 --- /dev/null +++ b/dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js @@ -0,0 +1 @@ +../packages/webapp/dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js \ No newline at end of file diff --git a/dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js.map b/dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js.map new file mode 120000 index 00000000..36a97195 --- /dev/null +++ b/dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js.map @@ -0,0 +1 @@ +../packages/webapp/dist/src_components_maps-page_account-menu_index_tsx-src_components_maps-page_action-dispatcher_in-ba81d4.bundle.js.map \ No newline at end of file From 0cac062249f14cefb2f06e4432958216fe6e1e10 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 16 Nov 2022 18:32:33 -0800 Subject: [PATCH 21/55] Revert "Remove lazy loading for editor" This reverts commit 1f7f84dccaa548279a2b4a24e4fe33aeb12d28c3. --- packages/webapp/src/app.tsx | 2 +- .../src/components/maps-page/action-dispatcher/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/webapp/src/app.tsx b/packages/webapp/src/app.tsx index 261f3cc1..a84e6e7b 100644 --- a/packages/webapp/src/app.tsx +++ b/packages/webapp/src/app.tsx @@ -16,8 +16,8 @@ import ReactGA from 'react-ga4'; import AppConfig from './classes/app-config'; import withSessionExpirationHandling from './components/HOCs/withSessionExpirationHandling'; import RegistrationSuccessPage from './components/registration-success-page'; -import EditorPage from './components/editor-page'; +const EditorPage = React.lazy(() => import('./components/editor-page')); const MapsPage = React.lazy(() => import('./components/maps-page')); declare module '@mui/styles/defaultTheme' { diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/index.tsx index cc82f52f..5e00a6ec 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/index.tsx @@ -12,7 +12,7 @@ import InfoDialog from './info-dialog'; import DeleteMultiselectDialog from './delete-multiselect-dialog'; import ExportDialog from './export-dialog'; import ShareDialog from './share-dialog'; -// import LabelDialog from './label-dialog'; +import LabelDialog from './label-dialog'; import ReactGA from 'react-ga4'; export type BasicMapInfo = { @@ -76,7 +76,7 @@ const ActionDispatcher = ({ )} {action === 'share' && } - {/* {action === 'label' && } */} + {action === 'label' && } ); }; From a1f0fa6281fd7ba960f6e7aae8ecb17d4e3bf4a3 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 16 Nov 2022 19:27:11 -0800 Subject: [PATCH 22/55] Add spinner on map load. --- packages/editor/package.json | 3 ++- packages/editor/src/components/index.tsx | 14 ++++++++++++ packages/editor/src/components/style.ts | 28 ++++++++++++++++++++++++ yarn.lock | 16 +++++++++++++- 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 packages/editor/src/components/style.ts diff --git a/packages/editor/package.json b/packages/editor/package.json index 37fa9c50..6cfe27a7 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -45,7 +45,8 @@ "dependencies": { "@wisemapping/mindplot": "^5.0.15", "emoji-picker-react": "^4.4.4", - "react-color": "^2.19.3" + "react-color": "^2.19.3", + "react-loader-spinner": "^5.3.4" }, "peerDependencies": { "@emotion/react": "^11.10.5", diff --git a/packages/editor/src/components/index.tsx b/packages/editor/src/components/index.tsx index 81d086c1..79799f72 100644 --- a/packages/editor/src/components/index.tsx +++ b/packages/editor/src/components/index.tsx @@ -18,6 +18,7 @@ import React, { ReactElement, useCallback, useEffect, useState } from 'react'; import Popover from '@mui/material/Popover'; import Model from '../classes/model/editor'; +import { Vortex } from 'react-loader-spinner'; import { IntlProvider } from 'react-intl'; import { @@ -42,6 +43,7 @@ import { ToolbarActionType } from './toolbar/ToolbarActionType'; import MapInfo from '../classes/model/map-info'; import EditorToolbar from './editor-toolbar'; import ZoomPanel from './zoom-panel'; +import { SpinnerCentered } from './style'; export type EditorOptions = { mode: EditorRenderMode; @@ -134,6 +136,18 @@ const Editor = ({ capability={capability} message={mapInfo.isLocked() ? mapInfo.getLockedMessage() : ''} /> + + {!model && ( + + + + )} ); diff --git a/packages/editor/src/components/style.ts b/packages/editor/src/components/style.ts new file mode 100644 index 00000000..f9e3aa6d --- /dev/null +++ b/packages/editor/src/components/style.ts @@ -0,0 +1,28 @@ +/* + * Copyright [2021] [wisemapping] + * + * Licensed under WiseMapping Public License, Version 1.0 (the "License"). + * It is basically the Apache License, Version 2.0 (the "License") plus the + * "powered by wisemapping" text requirement on every single page; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the license at + * + * http://www.wisemapping.org/license + * + * 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. + */ +import styled from 'styled-components'; + +export const SpinnerCentered = styled.div` + position: absolute; + top: 50%; + left: 50%; + margin-top: -50px; + margin-left: -50px; + width: 100px; + height: 100px; +`; diff --git a/yarn.lock b/yarn.lock index 189cf497..9fd296d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11552,6 +11552,15 @@ react-is@^18.0.0, react-is@^18.2.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== +react-loader-spinner@^5.3.4: + version "5.3.4" + resolved "https://registry.yarnpkg.com/react-loader-spinner/-/react-loader-spinner-5.3.4.tgz#43c22a41944e2bf3c84a249192450f1166592f30" + integrity sha512-G2vw4ssX+RDZ/vfaeva06yfNqyFViv/u+tVZ3kFLy5TKNlNx2DbuwreBSpRtPespQA+VxinxUJsigwLwG9erOg== + dependencies: + react-is "^18.2.0" + styled-components "^5.3.5" + styled-tools "^1.7.2" + react-query@^3.39.1: version "3.39.2" resolved "https://registry.yarnpkg.com/react-query/-/react-query-3.39.2.tgz#9224140f0296f01e9664b78ed6e4f69a0cc9216f" @@ -12940,7 +12949,7 @@ style-loader@^3.3.1: resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.1.tgz#057dfa6b3d4d7c7064462830f9113ed417d38575" integrity sha512-GPcQ+LDJbrcxHORTRes6Jy2sfvK2kS6hpSfI/fXhPt+spVzxF6LJ1dHLN9zIGmVaaP044YKaIatFaufENRiDoQ== -styled-components@^5.3.6: +styled-components@^5.3.5, styled-components@^5.3.6: version "5.3.6" resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-5.3.6.tgz#27753c8c27c650bee9358e343fc927966bfd00d1" integrity sha512-hGTZquGAaTqhGWldX7hhfzjnIYBZ0IXQXkCYdvF1Sq3DsUaLx6+NTHC5Jj1ooM2F68sBiVz3lvhfwQs/S3l6qg== @@ -12956,6 +12965,11 @@ styled-components@^5.3.6: shallowequal "^1.1.0" supports-color "^5.5.0" +styled-tools@^1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/styled-tools/-/styled-tools-1.7.2.tgz#a8f71198535cf785d7db0927cc1c1b88337c4440" + integrity sha512-IjLxzM20RMwAsx8M1QoRlCG/Kmq8lKzCGyospjtSXt/BTIIcvgTonaxQAsKnBrsZNwhpHzO9ADx5te0h76ILVg== + stylis@4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.1.3.tgz#fd2fbe79f5fed17c55269e16ed8da14c84d069f7" From 046215898e06ffda271a88bd55bdbf859c007b40 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 16 Nov 2022 21:12:33 -0800 Subject: [PATCH 23/55] Add delay render support. --- .../editor/cypress/e2e/relationship.cy.js | 6 +++ .../editor/src/classes/model/editor/index.ts | 6 +-- packages/editor/src/components/index.tsx | 10 +++-- .../playground/map-render/js/viewmode.tsx | 5 ++- .../playground/map-render/samples/huge2.wxml | 11 +++++ packages/mindplot/src/components/Designer.ts | 30 +++++++------ .../src/components/MindplotWebComponent.ts | 20 ++++++--- .../src/components/PersistenceManager.ts | 9 ++-- packages/mindplot/src/components/Workspace.ts | 45 +++++++++++++++++++ .../web2d/src/components/peer/svg/TextPeer.js | 7 +-- 10 files changed, 110 insertions(+), 39 deletions(-) create mode 100644 packages/editor/test/playground/map-render/samples/huge2.wxml diff --git a/packages/editor/cypress/e2e/relationship.cy.js b/packages/editor/cypress/e2e/relationship.cy.js index ec25e895..a6a161b2 100644 --- a/packages/editor/cypress/e2e/relationship.cy.js +++ b/packages/editor/cypress/e2e/relationship.cy.js @@ -11,10 +11,16 @@ context('Relationship Topics', () => { cy.contains('Try it Now!').first().click(); cy.get('[test-id="11-15-relationship"]').first().click({ force: true }); + cy.get('[test-id="11-15-relationship"]').should('exist'); + cy.matchImageSnapshot('addRelationship'); }); it('Delete Relationship', () => { + cy.contains('Features').first().click(); + cy.get(`[aria-label="Add Relationship"]`).first().click(); + cy.contains('Try it Now!').first().click(); + cy.get('[test-id="11-15-relationship"]').click({ force: true }); cy.get('body').type('{backspace}'); diff --git a/packages/editor/src/classes/model/editor/index.ts b/packages/editor/src/classes/model/editor/index.ts index bd455b4d..a95b6699 100644 --- a/packages/editor/src/classes/model/editor/index.ts +++ b/packages/editor/src/classes/model/editor/index.ts @@ -32,7 +32,7 @@ class Editor { } isMapLoadded(): boolean { - return this.component?.getDesigner()?.getMindmap() != null; + return this.component.isLoaded(); } save(minor: boolean): void { @@ -57,9 +57,9 @@ class Editor { mapId: string, persistenceManager: PersistenceManager, widgetManager: WidgetManager, - ): void { + ): Promise { this.component.buildDesigner(persistenceManager, widgetManager); - this.component.loadMap(mapId); + return this.component.loadMap(mapId); } registerEvents(canvasUpdate: (timestamp: number) => void, capability: Capability): void { diff --git a/packages/editor/src/components/index.tsx b/packages/editor/src/components/index.tsx index 79799f72..8dadf9ac 100644 --- a/packages/editor/src/components/index.tsx +++ b/packages/editor/src/components/index.tsx @@ -79,10 +79,12 @@ const Editor = ({ const capability = new Capability(options.mode, mapInfo.isLocked()); const mindplotRef = useCallback((component: MindplotWebComponent) => { - // Initialized model ... const model = new Model(component); - model.loadMindmap(mapInfo.getId(), persistenceManager, widgetManager); - model.registerEvents(setCanvasUpdate, capability); + + // Force refresh after map load ... + model.loadMindmap(mapInfo.getId(), persistenceManager, widgetManager).then(() => { + setCanvasUpdate(Date.now()); + }); setModel(model); }, []); @@ -137,7 +139,7 @@ const Editor = ({ message={mapInfo.isLocked() ? mapInfo.getLockedMessage() : ''} /> - {!model && ( + {!model?.isMapLoadded() && ( console.log('action called:', action)} onLoad={initialization} - />); + />, +); diff --git a/packages/editor/test/playground/map-render/samples/huge2.wxml b/packages/editor/test/playground/map-render/samples/huge2.wxml new file mode 100644 index 00000000..15943d2b --- /dev/null +++ b/packages/editor/test/playground/map-render/samples/huge2.wxml @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/packages/mindplot/src/components/Designer.ts b/packages/mindplot/src/components/Designer.ts index abd765c2..6d602c91 100644 --- a/packages/mindplot/src/components/Designer.ts +++ b/packages/mindplot/src/components/Designer.ts @@ -577,14 +577,12 @@ class Designer extends Events { return { zoom: model.getZoom() }; } - /** - * @param {mindplot.Mindmap} mindmap - * @throws will throw an error if mindmapModel is null or undefined - */ - loadMap(mindmap: Mindmap): void { + loadMap(mindmap: Mindmap): Promise { $assert(mindmap, 'mindmapModel can not be null'); this._mindmap = mindmap; + this._workspace.enableQueueRender(true); + // Init layout manager ... const size = { width: 25, height: 25 }; const layoutManager = new LayoutManager(mindmap.getCentralTopic().getId(), size); @@ -601,23 +599,29 @@ class Designer extends Events { // Building node graph ... const branches = mindmap.getBranches(); + + const nodesGraph: Topic[] = []; branches.forEach((branch) => { const nodeGraph = this.nodeModelToTopic(branch); - nodeGraph.setBranchVisibility(true); + nodesGraph.push(nodeGraph); }); - // Connect relationships ... - const relationships = mindmap.getRelationships(); - relationships.forEach((relationship) => this._relationshipModelToRelationship(relationship)); - // Place the focus on the Central Topic const centralTopic = this.getModel().getCentralTopic(); this.goToNode(centralTopic); - // Finally, sort the map ... - EventBus.instance.fireEvent('forceLayout'); + return this._workspace.enableQueueRender(false).then(() => { + // Connect relationships ... + const relationships = mindmap.getRelationships(); + relationships.forEach((relationship) => this._relationshipModelToRelationship(relationship)); - this.fireEvent('loadSuccess'); + // Render nodes ... + nodesGraph.forEach((topic) => topic.setVisibility(true)); + + // Finally, sort the map ... + EventBus.instance.fireEvent('forceLayout'); + this.fireEvent('loadSuccess'); + }); } getMindmap(): Mindmap { diff --git a/packages/mindplot/src/components/MindplotWebComponent.ts b/packages/mindplot/src/components/MindplotWebComponent.ts index d1f2347e..27b74041 100644 --- a/packages/mindplot/src/components/MindplotWebComponent.ts +++ b/packages/mindplot/src/components/MindplotWebComponent.ts @@ -3,7 +3,6 @@ import buildDesigner from './DesignerBuilder'; import DesignerOptionsBuilder from './DesignerOptionsBuilder'; import EditorRenderMode from './EditorRenderMode'; import LocalStorageManager from './LocalStorageManager'; -import Mindmap from './model/Mindmap'; import PersistenceManager from './PersistenceManager'; import WidgetManager from './WidgetManager'; import mindplotStyles from './styles/mindplot-styles'; @@ -27,12 +26,12 @@ export type MindplotWebComponentInterface = { class MindplotWebComponent extends HTMLElement { private _shadowRoot: ShadowRoot; - private _mindmap: Mindmap; - private _designer: Designer; private saveRequired: boolean; + private _isLoaded: boolean; + constructor() { super(); this._shadowRoot = this.attachShadow({ mode: 'open' }); @@ -77,6 +76,16 @@ class MindplotWebComponent extends HTMLElement { }); this.registerShortcuts(); + + this._designer.addEvent('loadSuccess', (): void => { + this._isLoaded = true; + }); + + return this._designer; + } + + isLoaded(): boolean { + return this._isLoaded; } private registerShortcuts() { @@ -100,10 +109,9 @@ class MindplotWebComponent extends HTMLElement { * Load map in designer throught persistence manager instance * @param id the map id to be loaded. */ - async loadMap(id: string): Promise { + loadMap(id: string): Promise { const instance = PersistenceManager.getInstance(); - this._mindmap = await instance.load(id); - this._designer.loadMap(this._mindmap); + return instance.load(id).then((mindmap) => this._designer.loadMap(mindmap)); } /** diff --git a/packages/mindplot/src/components/PersistenceManager.ts b/packages/mindplot/src/components/PersistenceManager.ts index 711c92bd..ead8e31b 100644 --- a/packages/mindplot/src/components/PersistenceManager.ts +++ b/packages/mindplot/src/components/PersistenceManager.ts @@ -61,12 +61,11 @@ abstract class PersistenceManager { return result; } - load(mapId: string): Promise { + async load(mapId: string): Promise { $assert(mapId, 'mapId can not be null'); - return this.loadMapDom(mapId).then((document) => { - console.log(`Loading map with is ${mapId}}`); - return PersistenceManager.loadFromDom(mapId, document); - }); + // eslint-disable-next-line arrow-body-style + const document = await this.loadMapDom(mapId); + return PersistenceManager.loadFromDom(mapId, document); } triggerError(error: PersistenceError) { diff --git a/packages/mindplot/src/components/Workspace.ts b/packages/mindplot/src/components/Workspace.ts index 99697400..8187f042 100644 --- a/packages/mindplot/src/components/Workspace.ts +++ b/packages/mindplot/src/components/Workspace.ts @@ -35,6 +35,10 @@ class Workspace { private _visibleAreaSize: SizeType; + private _renderQueue: Element2D[]; + + private queueRenderEnabled: boolean; + constructor(screenManager: ScreenManager, zoom: number, isReadOnly: boolean) { // Create a suitable container ... $assert(screenManager, 'Div container can not be null'); @@ -66,6 +70,8 @@ class Workspace { }); this.setZoom(zoom, true); + + this._renderQueue = []; } private _adjustWorkspace(): void { @@ -97,6 +103,14 @@ class Workspace { } append(shape: Element2D): void { + if (this.queueRenderEnabled) { + this._renderQueue.push(shape); + } else { + this.appendInternal(shape); + } + } + + private appendInternal(shape: Element2D): void { if ($defined(shape.addToWorkspace)) { shape.addToWorkspace(this); } else { @@ -104,6 +118,37 @@ class Workspace { } } + enableQueueRender(value: boolean): Promise { + this.queueRenderEnabled = value; + + let result = Promise.resolve(); + if (!value) { + result = this.processRenderQueue(this._renderQueue.reverse(), 300); + } + return result; + } + + private processRenderQueue(renderQueue: Element2D[], batch: number): Promise { + function delay(t: number) { + return new Promise((resolve) => setTimeout(resolve, t)); + } + + let result: Promise; + if (renderQueue.length > 0) { + result = new Promise((resolve: (queue: Element2D[]) => void) => { + for (let i = 0; i < batch && renderQueue.length > 0; i++) { + const elem = renderQueue.pop(); + this.appendInternal(elem); + } + + resolve(renderQueue); + }).then((queue) => delay(30).then(() => this.processRenderQueue(queue, batch))); + } else { + result = Promise.resolve(); + } + return result; + } + removeChild(shape: Element2D): void { // Element is a node, not a web2d element? if ($defined(shape.removeFromWorkspace)) { diff --git a/packages/web2d/src/components/peer/svg/TextPeer.js b/packages/web2d/src/components/peer/svg/TextPeer.js index 62575f83..eb8fd8f1 100644 --- a/packages/web2d/src/components/peer/svg/TextPeer.js +++ b/packages/web2d/src/components/peer/svg/TextPeer.js @@ -159,12 +159,7 @@ class TextPeer extends ElementPeer { } getWidth() { - let computedWidth = this._native.getBBox().width; - if (computedWidth === 0) { - const bbox = this._native.getBBox(); - computedWidth = bbox.width; - } - + const computedWidth = this._native.getBBox().width; let width = parseInt(computedWidth, 10); width += this._font.getWidthMargin(); return width; From fa5def64cacba0215c4b8b79cc43987e39af7f96 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Fri, 18 Nov 2022 23:17:56 -0800 Subject: [PATCH 24/55] Add delay on load. --- packages/mindplot/src/components/Workspace.ts | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/mindplot/src/components/Workspace.ts b/packages/mindplot/src/components/Workspace.ts index 8187f042..adc9854d 100644 --- a/packages/mindplot/src/components/Workspace.ts +++ b/packages/mindplot/src/components/Workspace.ts @@ -37,7 +37,7 @@ class Workspace { private _renderQueue: Element2D[]; - private queueRenderEnabled: boolean; + private _queueRenderEnabled: boolean; constructor(screenManager: ScreenManager, zoom: number, isReadOnly: boolean) { // Create a suitable container ... @@ -103,7 +103,7 @@ class Workspace { } append(shape: Element2D): void { - if (this.queueRenderEnabled) { + if (this._queueRenderEnabled) { this._renderQueue.push(shape); } else { this.appendInternal(shape); @@ -119,20 +119,23 @@ class Workspace { } enableQueueRender(value: boolean): Promise { - this.queueRenderEnabled = value; + this._queueRenderEnabled = value; let result = Promise.resolve(); if (!value) { - result = this.processRenderQueue(this._renderQueue.reverse(), 300); + // eslint-disable-next-line arrow-body-style + result = Workspace.delay(100).then(() => { + return this.processRenderQueue(this._renderQueue.reverse(), 300); + }); } return result; } - private processRenderQueue(renderQueue: Element2D[], batch: number): Promise { - function delay(t: number) { - return new Promise((resolve) => setTimeout(resolve, t)); - } + private static delay(t: number) { + return new Promise((resolve) => setTimeout(resolve, t)); + } + private processRenderQueue(renderQueue: Element2D[], batch: number): Promise { let result: Promise; if (renderQueue.length > 0) { result = new Promise((resolve: (queue: Element2D[]) => void) => { @@ -142,7 +145,7 @@ class Workspace { } resolve(renderQueue); - }).then((queue) => delay(30).then(() => this.processRenderQueue(queue, batch))); + }).then((queue) => Workspace.delay(30).then(() => this.processRenderQueue(queue, batch))); } else { result = Promise.resolve(); } From 51a5b391291be3c0a7e8c16520dca9cb86d100df Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 19 Nov 2022 11:58:43 -0800 Subject: [PATCH 25/55] Add change location workaround. --- .../maps-page/language-menu/index.tsx | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/webapp/src/components/maps-page/language-menu/index.tsx b/packages/webapp/src/components/maps-page/language-menu/index.tsx index 46f6b00e..517cb80c 100644 --- a/packages/webapp/src/components/maps-page/language-menu/index.tsx +++ b/packages/webapp/src/components/maps-page/language-menu/index.tsx @@ -26,15 +26,19 @@ const LanguageMenu = (): React.ReactElement => { const open = Boolean(anchorEl); const intl = useIntl(); - const mutation = useMutation((locale: LocaleCode) => client.updateAccountLanguage(locale), { - onSuccess: () => { - queryClient.invalidateQueries('account'); - handleClose(); + // Todo: For some reasons, in some situations locale is null. More research needed. + const mutation = useMutation( + (locale: LocaleCode) => client.updateAccountLanguage(locale ? locale : 'en'), + { + onSuccess: () => { + queryClient.invalidateQueries('account'); + handleClose(); + }, + onError: (error) => { + console.error(`Unexpected error ${error}`); + }, }, - onError: (error) => { - console.error(`Unexpected error ${error}`); - }, - }); + ); const handleMenu = (event: React.MouseEvent) => { setAnchorEl(event.currentTarget); From bf04a9d2b8e64d6cddc39e7b3690a37fd5fac02c Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 19 Nov 2022 13:09:29 -0800 Subject: [PATCH 26/55] Remove icons. --- .../image-icon-tab/iconGroups.json | 8 +-- packages/editor/src/components/index.tsx | 14 +++- packages/editor/src/index.tsx | 3 + packages/mindplot/assets/icons/money_euro.svg | 50 --------------- .../mindplot/assets/icons/object_clip.svg | 6 -- .../mindplot/assets/icons/object_house.svg | 17 ----- packages/mindplot/assets/icons/object_key.svg | 15 ----- .../assets/icons/object_magnifier.svg | 9 --- .../mindplot/assets/icons/time_hourglass.svg | 64 ------------------- .../src/components/model/SvgIconFamily.json | 8 +-- .../components/persistence/iconToEmoji.json | 8 ++- .../test/unit/export/expected/complex.wxml | 2 +- .../test/unit/export/expected/npe.wxml | 2 +- 13 files changed, 26 insertions(+), 180 deletions(-) delete mode 100644 packages/mindplot/assets/icons/money_euro.svg delete mode 100644 packages/mindplot/assets/icons/object_clip.svg delete mode 100644 packages/mindplot/assets/icons/object_house.svg delete mode 100644 packages/mindplot/assets/icons/object_key.svg delete mode 100644 packages/mindplot/assets/icons/object_magnifier.svg delete mode 100644 packages/mindplot/assets/icons/time_hourglass.svg diff --git a/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/iconGroups.json b/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/iconGroups.json index 071f7330..39d69cde 100644 --- a/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/iconGroups.json +++ b/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/iconGroups.json @@ -27,13 +27,9 @@ "things_pin", "things_window-layout", "things_bubbles", - "object_key", "object_pencil", - "object_magnifier", - "object_clip", "object_music", - "object_star", - "object_house" + "object_star" ] }, { @@ -48,12 +44,10 @@ "onoff_status_offline", "onoff_status_online", "money_dollar", - "money_euro", "money_coins", "money_ruby", "time_calendar", "time_clock", - "time_hourglass", "sign_warning", "sign_info", "sign_help", diff --git a/packages/editor/src/components/index.tsx b/packages/editor/src/components/index.tsx index 8dadf9ac..f4463209 100644 --- a/packages/editor/src/components/index.tsx +++ b/packages/editor/src/components/index.tsx @@ -82,9 +82,17 @@ const Editor = ({ const model = new Model(component); // Force refresh after map load ... - model.loadMindmap(mapInfo.getId(), persistenceManager, widgetManager).then(() => { - setCanvasUpdate(Date.now()); - }); + model + .loadMindmap(mapInfo.getId(), persistenceManager, widgetManager) + .then(() => { + setCanvasUpdate(Date.now()); + }) + .catch((e) => { + console.error(e); + window.newrelic?.noticeError( + new Error(`Unexpected error loading map ${mapInfo.getId()} = ${JSON.stringify(e)}`), + ); + }); setModel(model); }, []); diff --git a/packages/editor/src/index.tsx b/packages/editor/src/index.tsx index e363d33b..84b21c2c 100644 --- a/packages/editor/src/index.tsx +++ b/packages/editor/src/index.tsx @@ -53,6 +53,9 @@ declare global { ['mindplot-component']: MindplotWebComponentInterface; } } + interface Window { + newrelic: { noticeError: (Error) => void }; + } } export { diff --git a/packages/mindplot/assets/icons/money_euro.svg b/packages/mindplot/assets/icons/money_euro.svg deleted file mode 100644 index 072135f1..00000000 --- a/packages/mindplot/assets/icons/money_euro.svg +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/object_clip.svg b/packages/mindplot/assets/icons/object_clip.svg deleted file mode 100644 index 23b6bcae..00000000 --- a/packages/mindplot/assets/icons/object_clip.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/packages/mindplot/assets/icons/object_house.svg b/packages/mindplot/assets/icons/object_house.svg deleted file mode 100644 index a60fa332..00000000 --- a/packages/mindplot/assets/icons/object_house.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/object_key.svg b/packages/mindplot/assets/icons/object_key.svg deleted file mode 100644 index d9f49926..00000000 --- a/packages/mindplot/assets/icons/object_key.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/object_magnifier.svg b/packages/mindplot/assets/icons/object_magnifier.svg deleted file mode 100644 index 47ed17a6..00000000 --- a/packages/mindplot/assets/icons/object_magnifier.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/packages/mindplot/assets/icons/time_hourglass.svg b/packages/mindplot/assets/icons/time_hourglass.svg deleted file mode 100644 index 4c263156..00000000 --- a/packages/mindplot/assets/icons/time_hourglass.svg +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/src/components/model/SvgIconFamily.json b/packages/mindplot/src/components/model/SvgIconFamily.json index e0963cb8..4b8eb257 100644 --- a/packages/mindplot/src/components/model/SvgIconFamily.json +++ b/packages/mindplot/src/components/model/SvgIconFamily.json @@ -20,8 +20,7 @@ "id": "time", "icons": [ "time_calendar", - "time_clock", - "time_hourglass" + "time_clock" ] }, { @@ -124,13 +123,10 @@ { "id": "object", "icons": [ - "object_key", "object_pencil", - "object_magnifier", "object_clip", "object_music", - "object_star", - "object_house" + "object_star" ] }, { diff --git a/packages/mindplot/src/components/persistence/iconToEmoji.json b/packages/mindplot/src/components/persistence/iconToEmoji.json index faa6ee2b..70167ceb 100644 --- a/packages/mindplot/src/components/persistence/iconToEmoji.json +++ b/packages/mindplot/src/components/persistence/iconToEmoji.json @@ -84,5 +84,11 @@ "hard_driver_disk": "๐Ÿ’พ", "hard_printer": "๐Ÿ–จ๏ธ", "hard_webcam": "๐Ÿ“ท", - "hard_microphone": "๐ŸŽค" + "hard_microphone": "๐ŸŽค", + "object_house": "๐Ÿ ", + "object_magnifier": "๐Ÿ”", + "object_key": "๐Ÿ”‘", + "time_hourglass": "โŒ›", + "object_clip": "๐Ÿ“Ž", + "money_euro": "๐Ÿ’ถ" } \ No newline at end of file diff --git a/packages/mindplot/test/unit/export/expected/complex.wxml b/packages/mindplot/test/unit/export/expected/complex.wxml index 1ca9f5bc..722b017d 100644 --- a/packages/mindplot/test/unit/export/expected/complex.wxml +++ b/packages/mindplot/test/unit/export/expected/complex.wxml @@ -42,7 +42,7 @@ Attached below a sample of such screening questions]]>
\ No newline at end of file + \ No newline at end of file From ca0d97da2a530bb162fad7bb1282a78ea92017af Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 19 Nov 2022 13:25:09 -0800 Subject: [PATCH 27/55] Remove more icons --- .../image-icon-tab/iconGroups.json | 6 +- .../mindplot/assets/icons/money_coins.svg | 70 ------------------- .../mindplot/assets/icons/object_pencil.svg | 17 ----- .../mindplot/assets/icons/object_star.svg | 7 -- packages/mindplot/assets/icons/things_pin.svg | 11 --- .../src/components/model/SvgIconFamily.json | 6 +- .../components/persistence/iconToEmoji.json | 6 +- packages/mindplot/test/unit/export/Helper.ts | 2 +- .../mindplot/test/unit/export/expected/npe.mm | 1 - .../test/unit/export/expected/npe.wxml | 2 +- 10 files changed, 9 insertions(+), 119 deletions(-) delete mode 100644 packages/mindplot/assets/icons/money_coins.svg delete mode 100644 packages/mindplot/assets/icons/object_pencil.svg delete mode 100644 packages/mindplot/assets/icons/object_star.svg delete mode 100644 packages/mindplot/assets/icons/things_pin.svg diff --git a/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/iconGroups.json b/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/iconGroups.json index 39d69cde..11da26f8 100644 --- a/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/iconGroups.json +++ b/packages/editor/src/components/action-widget/pane/icon-picker/image-icon-tab/iconGroups.json @@ -24,12 +24,9 @@ "hard_ipod", "things_address_book", "things_wrench", - "things_pin", "things_window-layout", "things_bubbles", - "object_pencil", - "object_music", - "object_star" + "object_music" ] }, { @@ -44,7 +41,6 @@ "onoff_status_offline", "onoff_status_online", "money_dollar", - "money_coins", "money_ruby", "time_calendar", "time_clock", diff --git a/packages/mindplot/assets/icons/money_coins.svg b/packages/mindplot/assets/icons/money_coins.svg deleted file mode 100644 index db960c20..00000000 --- a/packages/mindplot/assets/icons/money_coins.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/object_pencil.svg b/packages/mindplot/assets/icons/object_pencil.svg deleted file mode 100644 index 96085e7f..00000000 --- a/packages/mindplot/assets/icons/object_pencil.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/assets/icons/object_star.svg b/packages/mindplot/assets/icons/object_star.svg deleted file mode 100644 index e8c151a2..00000000 --- a/packages/mindplot/assets/icons/object_star.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/packages/mindplot/assets/icons/things_pin.svg b/packages/mindplot/assets/icons/things_pin.svg deleted file mode 100644 index 30186db4..00000000 --- a/packages/mindplot/assets/icons/things_pin.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/packages/mindplot/src/components/model/SvgIconFamily.json b/packages/mindplot/src/components/model/SvgIconFamily.json index 4b8eb257..c771153c 100644 --- a/packages/mindplot/src/components/model/SvgIconFamily.json +++ b/packages/mindplot/src/components/model/SvgIconFamily.json @@ -12,7 +12,6 @@ "id": "money", "icons": [ "money_dollar", - "money_coins", "money_ruby" ] }, @@ -52,7 +51,6 @@ "icons": [ "things_address_book", "things_wrench", - "things_pin", "things_window-layout", "things_bubbles" ] @@ -123,10 +121,8 @@ { "id": "object", "icons": [ - "object_pencil", "object_clip", - "object_music", - "object_star" + "object_music" ] }, { diff --git a/packages/mindplot/src/components/persistence/iconToEmoji.json b/packages/mindplot/src/components/persistence/iconToEmoji.json index 70167ceb..53f9f5f1 100644 --- a/packages/mindplot/src/components/persistence/iconToEmoji.json +++ b/packages/mindplot/src/components/persistence/iconToEmoji.json @@ -90,5 +90,9 @@ "object_key": "๐Ÿ”‘", "time_hourglass": "โŒ›", "object_clip": "๐Ÿ“Ž", - "money_euro": "๐Ÿ’ถ" + "money_euro": "๐Ÿ’ถ", + "things_pin": "๐Ÿ“Œ", + "object_star": "โญ", + "money_coins": "๐Ÿ’ฐ", + "object_pencil": "โœ๏ธ" } \ No newline at end of file diff --git a/packages/mindplot/test/unit/export/Helper.ts b/packages/mindplot/test/unit/export/Helper.ts index b6400d78..e4867fb3 100644 --- a/packages/mindplot/test/unit/export/Helper.ts +++ b/packages/mindplot/test/unit/export/Helper.ts @@ -22,7 +22,7 @@ import { diff } from 'jest-diff'; import { expect } from '@jest/globals'; import Exporter from '../../../src/components/export/Exporter'; -const saveOutputRecord = false; +const saveOutputRecord = true; export const setupBlob = () => { // Workaround for partial implementations on Jest: diff --git a/packages/mindplot/test/unit/export/expected/npe.mm b/packages/mindplot/test/unit/export/expected/npe.mm index 1bc47622..5a7c1ebd 100644 --- a/packages/mindplot/test/unit/export/expected/npe.mm +++ b/packages/mindplot/test/unit/export/expected/npe.mm @@ -1,6 +1,5 @@ - diff --git a/packages/mindplot/test/unit/export/expected/npe.wxml b/packages/mindplot/test/unit/export/expected/npe.wxml index 6093b1e6..9f021d19 100644 --- a/packages/mindplot/test/unit/export/expected/npe.wxml +++ b/packages/mindplot/test/unit/export/expected/npe.wxml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From 35dc21dea93a24cd7259a87e1477038fbb409279 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 19 Nov 2022 15:50:30 -0800 Subject: [PATCH 28/55] Fix test executuion error. --- packages/editor/src/classes/model/editor/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor/src/classes/model/editor/index.ts b/packages/editor/src/classes/model/editor/index.ts index a95b6699..dd7f51d5 100644 --- a/packages/editor/src/classes/model/editor/index.ts +++ b/packages/editor/src/classes/model/editor/index.ts @@ -32,7 +32,7 @@ class Editor { } isMapLoadded(): boolean { - return this.component.isLoaded(); + return this.component?.isLoaded(); } save(minor: boolean): void { From 4095dd4aeec55deb09e7a923a8db9a8cf60cb7c5 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 20 Nov 2022 00:17:49 -0800 Subject: [PATCH 29/55] Add editor unit test as part of execution. --- packages/editor/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor/package.json b/packages/editor/package.json index 6cfe27a7..bda4b87a 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -8,7 +8,7 @@ "cy:run": "cypress run", "lint": "eslint src --ext js,ts,tsx", "test:integration": "start-server-and-test 'yarn playground' http-get://localhost:8081 'yarn cy:run'", - "test": "yarn test:integration", + "test": "yarn test:unit test:integration", "test:unit": "jest ./test/unit/* --detectOpenHandles", "i18n:extract": "formatjs extract 'src/**/*.ts*' --ignore 'src/@types/**/*' --out-file lang/en.json", "i18n:compile": "for lang in {'es','en','fr','de','zh','ru'};do formatjs compile lang/${lang}.json --ast --out-file src/compiled-lang/${lang}.json;done" From 9dbb05474527a40656fd3242a05db6fb4670195d Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 20 Nov 2022 00:37:41 -0800 Subject: [PATCH 30/55] Remove touch event handlers --- packages/mindplot/src/components/Workspace.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/mindplot/src/components/Workspace.ts b/packages/mindplot/src/components/Workspace.ts index adc9854d..96dcb59e 100644 --- a/packages/mindplot/src/components/Workspace.ts +++ b/packages/mindplot/src/components/Workspace.ts @@ -273,14 +273,16 @@ class Workspace { window.document.body.style.cursor = 'move'; // If I dont ignore touchmove events, browser console shows a lot of errors: // Unable to preventDefault inside passive event listener invocation. - if (mouseMoveEvent.type !== 'touchmove') mouseMoveEvent.preventDefault(); + if (mouseMoveEvent.type !== 'touchmove') { + mouseMoveEvent.preventDefault(); + } // Fire drag event ... screenManager.fireEvent('update'); wasDragged = true; }; screenManager.addEvent('mousemove', workspace._mouseMoveListener); - screenManager.addEvent('touchmove', workspace._mouseMoveListener); + // screenManager.addEvent('touchmove', workspace._mouseMoveListener); // Register mouse up listeners ... workspace._mouseUpListener = () => { @@ -302,14 +304,14 @@ class Workspace { } }; screenManager.addEvent('mouseup', workspace._mouseUpListener); - screenManager.addEvent('touchend', workspace._mouseUpListener); + // screenManager.addEvent('touchend', workspace._mouseUpListener); } } else { workspace._mouseUpListener(); } }; screenManager.addEvent('mousedown', mouseDownListener); - screenManager.addEvent('touchstart', mouseDownListener); + // screenManager.addEvent('touchstart', mouseDownListener); } getZoom() { From 2eb72625d6a5adcae98ec215d3bcabc4ec00db3b Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 20 Nov 2022 01:13:54 -0800 Subject: [PATCH 31/55] Add title to close. --- packages/editor/src/components/warning-dialog/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor/src/components/warning-dialog/index.tsx b/packages/editor/src/components/warning-dialog/index.tsx index 7a795c2d..1921b669 100644 --- a/packages/editor/src/components/warning-dialog/index.tsx +++ b/packages/editor/src/components/warning-dialog/index.tsx @@ -84,7 +84,7 @@ const WarningDialog = ({ capability, message }: FooterPropsType): React.ReactEle name="close" aria-label="Close" > - + {msgExt &&

{`${msg} ${msgExt}`}

} From 4253479b75011606d4c9b0981c6873e546708dc1 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 20 Nov 2022 08:28:53 -0800 Subject: [PATCH 32/55] Reenable touch events. --- packages/mindplot/src/components/Designer.ts | 2 ++ packages/mindplot/src/components/Workspace.ts | 24 ++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/packages/mindplot/src/components/Designer.ts b/packages/mindplot/src/components/Designer.ts index 6d602c91..756d8fcf 100644 --- a/packages/mindplot/src/components/Designer.ts +++ b/packages/mindplot/src/components/Designer.ts @@ -618,6 +618,8 @@ class Designer extends Events { // Render nodes ... nodesGraph.forEach((topic) => topic.setVisibility(true)); + // Enable workspace drag events ... + this._workspace.registerEvents(); // Finally, sort the map ... EventBus.instance.fireEvent('forceLayout'); this.fireEvent('loadSuccess'); diff --git a/packages/mindplot/src/components/Workspace.ts b/packages/mindplot/src/components/Workspace.ts index 96dcb59e..b4b7c29c 100644 --- a/packages/mindplot/src/components/Workspace.ts +++ b/packages/mindplot/src/components/Workspace.ts @@ -60,6 +60,16 @@ class Workspace { // Append to the workspace... workspace.addItAsChildTo(divContainer); + this.setZoom(zoom, true); + + this._renderQueue = []; + } + + private _adjustWorkspace(): void { + this.setZoom(this._zoom, false); + } + + registerEvents() { // Register drag events ... this._registerDragEvents(); this._eventsEnabled = true; @@ -68,14 +78,6 @@ class Workspace { window.addEventListener('resize', () => { this._adjustWorkspace(); }); - - this.setZoom(zoom, true); - - this._renderQueue = []; - } - - private _adjustWorkspace(): void { - this.setZoom(this._zoom, false); } isReadOnly(): boolean { @@ -282,7 +284,7 @@ class Workspace { wasDragged = true; }; screenManager.addEvent('mousemove', workspace._mouseMoveListener); - // screenManager.addEvent('touchmove', workspace._mouseMoveListener); + screenManager.addEvent('touchmove', workspace._mouseMoveListener); // Register mouse up listeners ... workspace._mouseUpListener = () => { @@ -304,14 +306,14 @@ class Workspace { } }; screenManager.addEvent('mouseup', workspace._mouseUpListener); - // screenManager.addEvent('touchend', workspace._mouseUpListener); + screenManager.addEvent('touchend', workspace._mouseUpListener); } } else { workspace._mouseUpListener(); } }; screenManager.addEvent('mousedown', mouseDownListener); - // screenManager.addEvent('touchstart', mouseDownListener); + screenManager.addEvent('touchstart', mouseDownListener); } getZoom() { From eb12d6cc9400b2fb536e097feac58c050ae669b4 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 21 Nov 2022 19:37:16 -0800 Subject: [PATCH 33/55] Fix export in mindmap list. --- .../src/components/editor-page/PersistenceManagerUtils.ts | 6 +++--- .../maps-page/action-dispatcher/export-dialog/index.tsx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/webapp/src/components/editor-page/PersistenceManagerUtils.ts b/packages/webapp/src/components/editor-page/PersistenceManagerUtils.ts index c8e7cb27..ee2fc406 100644 --- a/packages/webapp/src/components/editor-page/PersistenceManagerUtils.ts +++ b/packages/webapp/src/components/editor-page/PersistenceManagerUtils.ts @@ -38,11 +38,11 @@ export const buildPersistenceManagerForEditor = (mode: string): PersistenceManag return persistenceManager; }; -export const getMindmapFromPersistence = (mapId: string): Mindmap => { +export const fetchMindmap = async (mapId: number): Promise => { let mindmap: Mindmap; if (AppConfig.isRestClient()) { const persistence = new LocalStorageManager(`/c/restful/maps/{id}/document/xml`, true); - mindmap = persistence.load(String(mapId)); + mindmap = await persistence.load(String(mapId)); } else { const parser = new DOMParser(); const xmlDoc = parser.parseFromString( @@ -55,7 +55,7 @@ export const getMindmapFromPersistence = (mapId: string): Mindmap => { ); const serializer = XMLSerializerFactory.getSerializer('tango'); - mindmap = serializer.loadFromDom(xmlDoc, String(mapId)); + mindmap = Promise.resolve(serializer.loadFromDom(xmlDoc, String(mapId))); } return mindmap; }; diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/export-dialog/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/export-dialog/index.tsx index b42cf3df..6f3e6f46 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/export-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/export-dialog/index.tsx @@ -18,7 +18,7 @@ import { Mindmap, SizeType, } from '@wisemapping/editor'; -import { getMindmapFromPersistence } from '../../../editor-page/PersistenceManagerUtils'; +import { fetchMindmap } from '../../../editor-page/PersistenceManagerUtils'; import Checkbox from '@mui/material/Checkbox'; @@ -87,7 +87,7 @@ const ExportDialog = ({ setZoomToFit(!zoomToFit); }; - const exporter = (formatType: ExportFormat): Promise => { + const exporter = async (formatType: ExportFormat): Promise => { let svgElement: Element | null = null; let size: SizeType; let mindmap: Mindmap; @@ -103,7 +103,7 @@ const ExportDialog = ({ } // exporting from map list else { - mindmap = getMindmapFromPersistence(String(mapId)); + mindmap = await fetchMindmap(mapId); } let exporter: Exporter; From 4a4d67c554c46f8d65c85f162a14af3733a49691 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 21 Nov 2022 20:11:20 -0800 Subject: [PATCH 34/55] Add icons to text export. --- .../src/components/export/MDExporter.ts | 15 +++--- .../src/components/export/TxtExporter.ts | 10 +++- packages/mindplot/test/unit/export/Helper.ts | 2 +- .../test/unit/export/expected/complex.txt | 46 +++++++++---------- .../test/unit/export/expected/npe.txt | 12 ++--- .../test/unit/export/expected/welcome.md | 20 ++++---- .../test/unit/export/expected/welcome.txt | 20 ++++---- 7 files changed, 68 insertions(+), 57 deletions(-) diff --git a/packages/mindplot/src/components/export/MDExporter.ts b/packages/mindplot/src/components/export/MDExporter.ts index 26f9b7aa..bcaa4f25 100644 --- a/packages/mindplot/src/components/export/MDExporter.ts +++ b/packages/mindplot/src/components/export/MDExporter.ts @@ -16,6 +16,7 @@ * limitations under the License. */ import { Mindmap } from '../..'; +import EmojiIconModel from '../model/EmojiIconModel'; import INodeModel from '../model/INodeModel'; import LinkModel from '../model/LinkModel'; import NoteModel from '../model/NoteModel'; @@ -63,7 +64,14 @@ class MDExporter extends Exporter { branches .filter((n) => n.getText() !== undefined) .forEach((node) => { - result = `${result}${prefix}- ${node.getText()}`; + // Convert icons to list ... + const icons = node.getFeatures().filter((f) => f.getType() === 'eicon'); + let iconStr = ' '; + if (icons.length > 0) { + iconStr = ` ${icons.map((icon) => (icon as EmojiIconModel).getIconType()).toString()} `; + } + + result = `${result}${prefix}-${iconStr}${node.getText()}`; node.getFeatures().forEach((f) => { const type = f.getType(); // Dump all features ... @@ -76,11 +84,6 @@ class MDExporter extends Exporter { this.footNotes.push(note.getText()); result = `${result}[^${this.footNotes.length}] `; } - - // if(type === 'icon'){ - // const icon = f as IconModel; - // result = result + ` ![${icon.getIconType().replace('_','')}!](https://app.wisemapping.com/images/${icon.getIconType()}.svg )` - // } }); result = `${result}\n`; diff --git a/packages/mindplot/src/components/export/TxtExporter.ts b/packages/mindplot/src/components/export/TxtExporter.ts index 5f02d63b..a0846f9f 100644 --- a/packages/mindplot/src/components/export/TxtExporter.ts +++ b/packages/mindplot/src/components/export/TxtExporter.ts @@ -16,6 +16,7 @@ * limitations under the License. */ import { Mindmap } from '../..'; +import EmojiIconModel from '../model/EmojiIconModel'; import INodeModel from '../model/INodeModel'; import LinkModel from '../model/LinkModel'; import NoteModel from '../model/NoteModel'; @@ -40,7 +41,14 @@ class TxtExporter extends Exporter { private traverseBranch(indent: string, prefix: string, branches: INodeModel[]) { let result = ''; branches.forEach((node, index) => { - result = `${result}${indent}${prefix}${index + 1} ${ + // Convert icons to list ... + const icons = node.getFeatures().filter((f) => f.getType() === 'eicon'); + let iconStr = ' '; + if (icons.length > 0) { + iconStr = ` ${icons.map((icon) => (icon as EmojiIconModel).getIconType()).toString()} `; + } + + result = `${result}${indent}${prefix}${index + 1}${iconStr}${ node.getText() !== undefined ? node.getText() : '' }`; node.getFeatures().forEach((f) => { diff --git a/packages/mindplot/test/unit/export/Helper.ts b/packages/mindplot/test/unit/export/Helper.ts index e4867fb3..b6400d78 100644 --- a/packages/mindplot/test/unit/export/Helper.ts +++ b/packages/mindplot/test/unit/export/Helper.ts @@ -22,7 +22,7 @@ import { diff } from 'jest-diff'; import { expect } from '@jest/globals'; import Exporter from '../../../src/components/export/Exporter'; -const saveOutputRecord = true; +const saveOutputRecord = false; export const setupBlob = () => { // Workaround for partial implementations on Jest: diff --git a/packages/mindplot/test/unit/export/expected/complex.txt b/packages/mindplot/test/unit/export/expected/complex.txt index a581e8a2..d416aeab 100644 --- a/packages/mindplot/test/unit/export/expected/complex.txt +++ b/packages/mindplot/test/unit/export/expected/complex.txt @@ -25,7 +25,7 @@ HR Mission: To provide a positive HR service experience for applicants and emplo [Note: Each department of Freeform will identify areas that need development to meet overall FS goals. Eg. Project Manager may identify needed improvement in a development tool. Or... Bus. Dev. may identify a new need in NFP that FS could fill within mandate, if training were provided. Professional Dev. priority will be given to proposals for development with clear ROIs.] 2.3 Strategic Priority 2c: Learning Environment [Note: Learning and innovation are an essential part of providing the best solutions to NFPs. Cost effective internal learning and time to explore innovation will be encouraged, provided they conform with organization goal and clear ROI is demonstrated.] - 2.4 So That... + 2.4 ๐ŸŒˆ So That... [Note: (So that... our employees have improved skills and knowledge, So that... they are highly competent and can work well in agile teams and feel fulfilled and self actualized... So that we can so the best work possible, for the least cost, in the shortest time for other NFPs, So that... NFPs can help those who need it.)] 3 Strategy 4: Inclusive, Positive Environment [Note: Strategy #4: Foster a diverse, inclusive community with a positive work environment.] @@ -36,7 +36,7 @@ HR Mission: To provide a positive HR service experience for applicants and emplo 3.3 Strategic Priority 4c: Diversity [Note: Insure we promote our commitment to diversity and non-discrimination through our actions and in our outreach and employee recruitment efforts] 3.4 - 3.5 So That... + 3.5 ๐ŸŒˆ So That... [Note: (So that... we can reflect the diverse populations we serve AND ensure everyone feels safe, respected and included, So that... we better serve our diverse client organizations AND we are a great place to work )] 4 Strategy 1: Recruit & Retain [Note: Recruit and retain top talent commensurate with identified organizational capacity requirements ] @@ -154,18 +154,18 @@ Attached below a sample of such screening questions] [Note: The Freeform H&S rep will lead a Health and Wellness Committee to responsible for recognizing health and safety concerns and identifying solutions.] 11.2.2 Work-life Balance Initiative [Link: http://hrcouncil.ca/hr-toolkit/workplaces-health-safety.cfm] - 11.3 So that... + 11.3 ๐ŸŒˆ So that... [Note: (So that... our employees remain well and safe, So that... they are highly competent and can work well in agile teams and feel fulfilled and self actualized... So that we can so the best work possible, for the least cost, in the shortest time for other NFPs, So that... NFPs can help those who need it.)] 12 Benefits [Note: As Freeform Employees we will have benefits reviewed in light of our priorities and cost to Freeform] - 12.1 As Freeform Staff + 12.1 ๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ As Freeform Staff 12.2 Responsibility: HZ, JC 12.3 Release 3 - 12.4 Have Heather create list benefits against Best Practice & cost + 12.4 โœ… Have Heather create list benefits against Best Practice & cost 12.5 Have Jason review list 12.6 Have JC & HZ consult with staff 12.7 Have best benefits we can afford - 12.8 So that... + 12.8 ๐ŸŒˆ So that... [Note: so that our efforts to excel are rewarded.] 13 Community Outreach Plan 13.1 Goals @@ -175,7 +175,7 @@ Attached below a sample of such screening questions] 13.5 Other 14 Backlog Plan [Link: https://docs.google.com/a/freeform.ca/drawings/d/1mrtkVAN3_XefJJCgfxw4Va6xk9TVDBKXDt_uzyIF4Us/edit] - 14.1 Go To Backlog Plan + 14.1 ๐Ÿ˜Ž Go To Backlog Plan [Link: https://docs.google.com/a/freeform.ca/drawings/d/1mrtkVAN3_XefJJCgfxw4Va6xk9TVDBKXDt_uzyIF4Us/edit] 15 Strategy Prospecting 15.1 @@ -188,11 +188,11 @@ Attached below a sample of such screening questions] 17 Strategies Marketing 18 19 Exit Interviews - 19.1 As Freeform + 19.1 ๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ As Freeform 19.2 Responsiblity: HZ, KS - 19.3 Release + 19.3 โŒ› Release 19.4 Have Heather write procedures for exit interview process - 19.5 So that + 19.5 ๐ŸŒˆ So that [Note: We learn from our mistakes and missed opportunities in future with the goal of keeping the best talent.] 20 3 Month Onboarding Process 21 Human Resources Plan @@ -208,48 +208,48 @@ Attached below a sample of such screening questions] 21.2 Related Documents [Note: MIssion, Values, Principles, Org Business Plan, Human Resources Policy Manual] 21.3 Goals - 21.3.1 Goal:Staff=Optimal Bus. Growth + 21.3.1 ๐Ÿˆ Goal:Staff=Optimal Bus. Growth [Note: Human resource capacity will remain at a level to meet planned growth growth objectives and client contractual commitments] - 21.3.1.1 So that... + 21.3.1.1 ๐ŸŒˆ So that... 21.3.1.2 Related Strategic Priorities: - 21.3.1.3 KPI: HR Level equals Planned Growth + 21.3.1.3 ๐Ÿ“Š KPI: HR Level equals Planned Growth 21.3.1.4 Methodology [Note: Schedule of required HR capacity vs. actual HR capacity. Variance + or - 1] 21.3.1.4.1 Target [Note: = + or - 1] - 21.3.2 Goal: Increase Job Satisfaction - 21.3.2.1 So That + 21.3.2 ๐Ÿˆ Goal: Increase Job Satisfaction + 21.3.2.1 ๐ŸŒˆ So That [Note: Establish better relationships. Identify with the new employer. Build a great attitude with the company.] 21.3.2.2 Related Strategic Priorities 21.3.2.2.1 - 21.3.2.3 KPI: Employee Satisfaction + 21.3.2.3 ๐Ÿ“Š KPI: Employee Satisfaction 21.3.2.3.1 21.3.2.4 Methodology [Note: Percentage of improvement in employee reported job satisfaction based on survey vs previous year. Base level to be established in first year. ] 21.3.2.4.1 Target [Note: Base level 1st year] - 21.3.3 Goal: Improve Performance + 21.3.3 ๐Ÿˆ Goal: Improve Performance [Note: To increase knowledge, skills and experience of the Freeform staff relevant to organizational priorities.] - 21.3.3.1 So That + 21.3.3.1 ๐ŸŒˆ So That [Note: Clarify expectations. Understand values and priorities. Decrease the learning curve.] 21.3.3.2 Related Strategic Priorities [Note: 1] - 21.3.3.3 KPI: Employee Performance + 21.3.3.3 ๐Ÿ“Š KPI: Employee Performance 21.3.3.4 Methodology 21.3.3.4.1 Target - 21.3.4 Goal: Reduce Turnover + 21.3.4 ๐Ÿˆ Goal: Reduce Turnover [Note: To reduce turnover of Top Talent.] - 21.3.4.1 So That + 21.3.4.1 ๐ŸŒˆ So That [Note: Provide support through feedback. Help the employee feel valued. Again, decrease the learning curve.] 21.3.4.2 Related Strategic Priorities - 21.3.4.3 KPI: Retention Rate + 21.3.4.3 ๐Ÿ“Š KPI: Retention Rate 21.3.4.4 Methodology 21.3.4.4.1 Target - 21.3.5 Risk & Compliance + 21.3.5 ๐Ÿˆ Risk & Compliance [Note: To eliminate or minimize risk and to comply with all legislated requirements. ] diff --git a/packages/mindplot/test/unit/export/expected/npe.txt b/packages/mindplot/test/unit/export/expected/npe.txt index 3d5a9988..517f5e22 100644 --- a/packages/mindplot/test/unit/export/expected/npe.txt +++ b/packages/mindplot/test/unit/export/expected/npe.txt @@ -1,19 +1,19 @@ -1 NIF (NORMAS DE INFORMACIร“N FINANCIERA) -2 NIF D +1 โœ๏ธ NIF (NORMAS DE INFORMACIร“N FINANCIERA) +2 ๐Ÿ˜Ž NIF D [Note: Beneficios a los empleados,impuestos a la utilidad, arrendamientos y capitalizaciรณn de resultado integral .] 2.1 Normas aplicables a problemas de determinaciรณn de resultados -3 CIRCULANTES +3 โ˜Ž๏ธ CIRCULANTES [Note: Tratamiento contable de los gastos de registro, colocaciรณn, unidades de inversiรณn, aplicaciรณn supletoria etc.] 3.1 Adquisiciรณn temporal de acciones propias -4 NIF A +4 โŒ› NIF A [Link: http://www.youtube.com/watch?v=7YN-sOlkQp0] 4.1 Marco conceptual -5 NIF C +5 ๐Ÿต NIF C [Link: https://sites.google.com/site/contabilidadimcpnif/estructura-de-las-nif] 5.1 Normas aplicables a conceptos especรญficos de los estados financieros 6 NIF E [Note: Agricultura y donativos recibidos u otorgados con propรณsitos no lucrativos.] 6.1 Normas aplicables alas actividades especializadas de distintos sectores -7 NIF B +7 ๐Ÿ  NIF B [Link: http://www.contaduria.uady.mx/files/cuerpo-acad/caef/aief/resumen_NIF_marco_conceptual.pdf] 7.1 Normas aplicables a los estados financieros en su conjunto diff --git a/packages/mindplot/test/unit/export/expected/welcome.md b/packages/mindplot/test/unit/export/expected/welcome.md index 1e75b757..00e623d7 100644 --- a/packages/mindplot/test/unit/export/expected/welcome.md +++ b/packages/mindplot/test/unit/export/expected/welcome.md @@ -1,8 +1,8 @@ # Welcome To WiseMapping -- 5 min tutorial video ? +- ๐Ÿ–ฅ๏ธ 5 min tutorial video ? Follow the link ! ( [link](https://www.youtube.com/tv?vq=medium#/watch?v=rKxZwNKs9cE) ) -- Try it Now! +- ๐Ÿ˜ฎ Try it Now! - Double Click - Press "enter" to add a Sibling @@ -13,22 +13,22 @@ Sibling - Fonts - Topic Shapes - Topic Color - - Icons - - History Changes -- Mind Mapping + - ๐ŸŒˆ Icons + - โฌ…๏ธ History Changes +- ๐Ÿ‘ Mind Mapping - Share with Collegues - Online - Anyplace, Anytime - Free!!! -- Productivity - - Share your ideas +- ๐Ÿ“Š Productivity + - ๐Ÿ’ก Share your ideas - Brainstorming - Visual -- Install In Your Server +- ๐Ÿ–ฅ๏ธ Install In Your Server - Open Source ( [link](http://www.wisemapping.org/) ) - Download ( [link](http://www.wisemapping.com/inyourserver.html) ) -- Collaborate +- ๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Collaborate - Embed - Publish - - Share for Edition + - โœ‰๏ธ Share for Edition diff --git a/packages/mindplot/test/unit/export/expected/welcome.txt b/packages/mindplot/test/unit/export/expected/welcome.txt index 1b36a120..a6a7a8d7 100644 --- a/packages/mindplot/test/unit/export/expected/welcome.txt +++ b/packages/mindplot/test/unit/export/expected/welcome.txt @@ -1,8 +1,8 @@ 1 Welcome To WiseMapping - 1.1 5 min tutorial video ? + 1.1 ๐Ÿ–ฅ๏ธ 5 min tutorial video ? Follow the link ! [Link: https://www.youtube.com/tv?vq=medium#/watch?v=rKxZwNKs9cE] - 1.2 Try it Now! + 1.2 ๐Ÿ˜ฎ Try it Now! 1.2.1 Double Click 1.2.2 Press "enter" to add a Sibling @@ -14,23 +14,23 @@ Sibling 1.3.2.1 Fonts 1.3.2.2 Topic Shapes 1.3.2.3 Topic Color - 1.3.3 Icons - 1.3.4 History Changes - 1.4 Mind Mapping + 1.3.3 ๐ŸŒˆ Icons + 1.3.4 โฌ…๏ธ History Changes + 1.4 ๐Ÿ‘ Mind Mapping 1.4.1 Share with Collegues 1.4.2 Online 1.4.3 Anyplace, Anytime 1.4.4 Free!!! - 1.5 Productivity - 1.5.1 Share your ideas + 1.5 ๐Ÿ“Š Productivity + 1.5.1 ๐Ÿ’ก Share your ideas 1.5.2 Brainstorming 1.5.3 Visual - 1.6 Install In Your Server + 1.6 ๐Ÿ–ฅ๏ธ Install In Your Server 1.6.1 Open Source [Link: http://www.wisemapping.org/] 1.6.2 Download [Link: http://www.wisemapping.com/inyourserver.html] - 1.7 Collaborate + 1.7 ๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Collaborate 1.7.1 Embed 1.7.2 Publish - 1.7.3 Share for Edition + 1.7.3 โœ‰๏ธ Share for Edition From 4ca3d03b902580998f7d567c2ab92e6e2e6ed655 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 23 Nov 2022 07:49:56 -0800 Subject: [PATCH 35/55] Fix save event registrations. --- packages/editor/src/classes/model/editor/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor/src/classes/model/editor/index.ts b/packages/editor/src/classes/model/editor/index.ts index dd7f51d5..3242b019 100644 --- a/packages/editor/src/classes/model/editor/index.ts +++ b/packages/editor/src/classes/model/editor/index.ts @@ -92,7 +92,7 @@ class Editor { // Autosave on a fixed period of time ... setInterval(() => { this.component.save(false); - }, 10000); + }, 5000); } } } From d52d4a0e4195a71378e5a0beafa5403f128ab9a2 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 23 Nov 2022 08:15:38 -0800 Subject: [PATCH 36/55] fix auto-save. --- packages/editor/src/classes/model/editor/index.ts | 1 - .../src/components/action-widget/pane/topic-note/index.tsx | 2 +- packages/editor/src/components/index.tsx | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/editor/src/classes/model/editor/index.ts b/packages/editor/src/classes/model/editor/index.ts index 3242b019..28e64d14 100644 --- a/packages/editor/src/classes/model/editor/index.ts +++ b/packages/editor/src/classes/model/editor/index.ts @@ -83,7 +83,6 @@ class Editor { // Is the save action enabled ... ? if (!capability.isHidden('save')) { // Register unload save ... - window.addEventListener('beforeunload', () => { this.component.save(false); this.component.unlockMap(); diff --git a/packages/editor/src/components/action-widget/pane/topic-note/index.tsx b/packages/editor/src/components/action-widget/pane/topic-note/index.tsx index 6ca0f69d..f3d53ac3 100644 --- a/packages/editor/src/components/action-widget/pane/topic-note/index.tsx +++ b/packages/editor/src/components/action-widget/pane/topic-note/index.tsx @@ -49,7 +49,7 @@ const TopicNote = (props: { margin="dense" value={note} onChange={(event) => setNote(event.target.value)} - > + />
{ const model = new Model(component); + model.registerEvents(setCanvasUpdate, capability); // Force refresh after map load ... model From 966d817a022b5eed3c9e75a43b6b776e7389b6df Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 23 Nov 2022 08:26:19 -0800 Subject: [PATCH 37/55] Maps fixed. --- packages/editor/src/components/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor/src/components/index.tsx b/packages/editor/src/components/index.tsx index 6e0c3d17..2db25438 100644 --- a/packages/editor/src/components/index.tsx +++ b/packages/editor/src/components/index.tsx @@ -80,13 +80,13 @@ const Editor = ({ const mindplotRef = useCallback((component: MindplotWebComponent) => { const model = new Model(component); - model.registerEvents(setCanvasUpdate, capability); // Force refresh after map load ... model .loadMindmap(mapInfo.getId(), persistenceManager, widgetManager) .then(() => { setCanvasUpdate(Date.now()); + model.registerEvents(setCanvasUpdate, capability); }) .catch((e) => { console.error(e); From b9de72905304c9b550ad9d229350601950eabfe7 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 23 Nov 2022 21:32:15 -0800 Subject: [PATCH 38/55] Add not null control for mindplot initialization --- packages/editor/src/components/index.tsx | 43 +++++++++++-------- .../src/components/MindplotWebComponent.ts | 39 ++++------------- 2 files changed, 35 insertions(+), 47 deletions(-) diff --git a/packages/editor/src/components/index.tsx b/packages/editor/src/components/index.tsx index 2db25438..fe4ee8e9 100644 --- a/packages/editor/src/components/index.tsx +++ b/packages/editor/src/components/index.tsx @@ -78,24 +78,33 @@ const Editor = ({ const [popoverOpen, popoverTarget, widgetManager] = DefaultWidgetManager.useCreate(); const capability = new Capability(options.mode, mapInfo.isLocked()); - const mindplotRef = useCallback((component: MindplotWebComponent) => { - const model = new Model(component); + const mindplotRef: (component: MindplotWebComponent) => void = useCallback( + (component: MindplotWebComponent) => { + if (!component) { + const error = new Error(`Unexpected error during initialization. ${component}`); + window.newrelic?.noticeError(error); + throw error; + } - // Force refresh after map load ... - model - .loadMindmap(mapInfo.getId(), persistenceManager, widgetManager) - .then(() => { - setCanvasUpdate(Date.now()); - model.registerEvents(setCanvasUpdate, capability); - }) - .catch((e) => { - console.error(e); - window.newrelic?.noticeError( - new Error(`Unexpected error loading map ${mapInfo.getId()} = ${JSON.stringify(e)}`), - ); - }); - setModel(model); - }, []); + const model = new Model(component); + + // Force refresh after map load ... + model + .loadMindmap(mapInfo.getId(), persistenceManager, widgetManager) + .then(() => { + setCanvasUpdate(Date.now()); + model.registerEvents(setCanvasUpdate, capability); + }) + .catch((e) => { + console.error(e); + window.newrelic?.noticeError( + new Error(`Unexpected error loading map ${mapInfo.getId()} = ${JSON.stringify(e)}`), + ); + }); + setModel(model); + }, + [], + ); useEffect(() => { if (options.enableKeyboardEvents) { diff --git a/packages/mindplot/src/components/MindplotWebComponent.ts b/packages/mindplot/src/components/MindplotWebComponent.ts index 27b74041..b0b0675b 100644 --- a/packages/mindplot/src/components/MindplotWebComponent.ts +++ b/packages/mindplot/src/components/MindplotWebComponent.ts @@ -2,20 +2,18 @@ import Designer from './Designer'; import buildDesigner from './DesignerBuilder'; import DesignerOptionsBuilder from './DesignerOptionsBuilder'; import EditorRenderMode from './EditorRenderMode'; -import LocalStorageManager from './LocalStorageManager'; import PersistenceManager from './PersistenceManager'; import WidgetManager from './WidgetManager'; import mindplotStyles from './styles/mindplot-styles'; import { $notify } from './widget/ToolbarNotifier'; import { $msg } from './Messages'; import DesignerKeyboard from './DesignerKeyboard'; - -const defaultPersistenceManager = () => new LocalStorageManager('map.xml', false, false); +import LocalStorageManager from './LocalStorageManager'; export type MindplotWebComponentInterface = { id: string; mode: string; - ref: any; + ref: (component: object) => void; locale?: string; }; /** @@ -35,12 +33,15 @@ class MindplotWebComponent extends HTMLElement { constructor() { super(); this._shadowRoot = this.attachShadow({ mode: 'open' }); + const mindplotStylesElement = document.createElement('style'); mindplotStylesElement.innerHTML = mindplotStyles; this._shadowRoot.appendChild(mindplotStylesElement); + const wrapper = document.createElement('div'); wrapper.setAttribute('class', 'wise-editor'); wrapper.setAttribute('id', 'mindplot'); + this._shadowRoot.appendChild(wrapper); } @@ -59,7 +60,8 @@ class MindplotWebComponent extends HTMLElement { buildDesigner(persistence?: PersistenceManager, widgetManager?: WidgetManager) { const editorRenderMode = this.getAttribute('mode') as EditorRenderMode; const locale = this.getAttribute('locale'); - const persistenceManager = persistence || defaultPersistenceManager(); + + const persistenceManager = persistence || new LocalStorageManager('map.xml', false, false); const mode = editorRenderMode || 'viewonly'; const options = DesignerOptionsBuilder.buildOptions({ persistenceManager, @@ -97,26 +99,19 @@ class MindplotWebComponent extends HTMLElement { } } - setSaveRequired(arg0: boolean) { - this.saveRequired = arg0; + setSaveRequired(value: boolean) { + this.saveRequired = value; } getSaveRequired() { return this.saveRequired; } - /** - * Load map in designer throught persistence manager instance - * @param id the map id to be loaded. - */ loadMap(id: string): Promise { const instance = PersistenceManager.getInstance(); return instance.load(id).then((mindmap) => this._designer.loadMap(mindmap)); } - /** - * save the map - */ save(saveHistory: boolean) { if (!saveHistory && !this.getSaveRequired()) return; console.log('Saving...'); @@ -146,22 +141,6 @@ class MindplotWebComponent extends HTMLElement { this.setSaveRequired(false); } - discardChanges() { - // Avoid autosave before leaving the page .... - // this.setRequireChange(false); - - // Finally call discard function ... - const persistenceManager = PersistenceManager.getInstance(); - const mindmap = this._designer.getMindmap(); - persistenceManager.discardChanges(mindmap.getId()); - - // Unlock map ... - this.unlockMap(); - - // Reload the page ... - window.location.reload(); - } - unlockMap() { const mindmap = this._designer.getMindmap(); const persistenceManager = PersistenceManager.getInstance(); From 040ae80223bc1c68f45846df1d81b6aa317f449c Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 23 Nov 2022 22:41:43 -0800 Subject: [PATCH 39/55] Resolve "Cannot read properties of null (reading 'buildDesigner')" error. --- .../editor/src/components/app-bar/index.tsx | 2 +- packages/editor/src/components/index.tsx | 23 ++++++------------- .../src/components/DesignerBuilder.ts | 3 +++ .../src/components/MindplotWebComponent.ts | 2 +- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/packages/editor/src/components/app-bar/index.tsx b/packages/editor/src/components/app-bar/index.tsx index bf02bfaf..169d189e 100644 --- a/packages/editor/src/components/app-bar/index.tsx +++ b/packages/editor/src/components/app-bar/index.tsx @@ -43,7 +43,7 @@ import MapInfo from '../../classes/model/map-info'; import { useIntl } from 'react-intl'; interface AppBarProps { - model: Editor; + model: Editor | undefined; mapInfo: MapInfo; capability: Capability; onAction?: (type: ToolbarActionType) => void; diff --git a/packages/editor/src/components/index.tsx b/packages/editor/src/components/index.tsx index fe4ee8e9..d1c2afc8 100644 --- a/packages/editor/src/components/index.tsx +++ b/packages/editor/src/components/index.tsx @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import React, { ReactElement, useCallback, useEffect, useState } from 'react'; +import React, { ReactElement, useEffect, useRef, useState } from 'react'; import Popover from '@mui/material/Popover'; import Model from '../classes/model/editor'; import { Vortex } from 'react-loader-spinner'; @@ -25,7 +25,6 @@ import { PersistenceManager, Designer, DesignerKeyboard, - MindplotWebComponent, EditorRenderMode, } from '@wisemapping/mindplot'; @@ -70,6 +69,7 @@ const Editor = ({ accountConfiguration, }: EditorProps): ReactElement => { const [model, setModel] = useState(); + const mindplotRef = useRef(null); // This is required to redraw in case of chansges in the canvas... // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -78,17 +78,9 @@ const Editor = ({ const [popoverOpen, popoverTarget, widgetManager] = DefaultWidgetManager.useCreate(); const capability = new Capability(options.mode, mapInfo.isLocked()); - const mindplotRef: (component: MindplotWebComponent) => void = useCallback( - (component: MindplotWebComponent) => { - if (!component) { - const error = new Error(`Unexpected error during initialization. ${component}`); - window.newrelic?.noticeError(error); - throw error; - } - - const model = new Model(component); - - // Force refresh after map load ... + useEffect(() => { + if (!model) { + const model = new Model(mindplotRef.current); model .loadMindmap(mapInfo.getId(), persistenceManager, widgetManager) .then(() => { @@ -102,9 +94,8 @@ const Editor = ({ ); }); setModel(model); - }, - [], - ); + } + }, [mindplotRef]); useEffect(() => { if (options.enableKeyboardEvents) { diff --git a/packages/mindplot/src/components/DesignerBuilder.ts b/packages/mindplot/src/components/DesignerBuilder.ts index 953d2bd8..4a7a3e20 100644 --- a/packages/mindplot/src/components/DesignerBuilder.ts +++ b/packages/mindplot/src/components/DesignerBuilder.ts @@ -28,6 +28,9 @@ let designer: Designer; export function buildDesigner(options: DesignerOptions): Designer { const divContainer = options.divContainer ? $(options.divContainer) : $(`#${options.container}`); $assert(divContainer, 'container could not be null'); + if (designer) { + throw new Error('Designer can does not support multiple initializations'); + } // Register load events ... designer = new Designer(options, divContainer); diff --git a/packages/mindplot/src/components/MindplotWebComponent.ts b/packages/mindplot/src/components/MindplotWebComponent.ts index b0b0675b..969c8a71 100644 --- a/packages/mindplot/src/components/MindplotWebComponent.ts +++ b/packages/mindplot/src/components/MindplotWebComponent.ts @@ -13,7 +13,7 @@ import LocalStorageManager from './LocalStorageManager'; export type MindplotWebComponentInterface = { id: string; mode: string; - ref: (component: object) => void; + ref: object; locale?: string; }; /** From 1f977e1ce2521cc7e7593d9ddbdb2f53aeed2de4 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 24 Nov 2022 00:07:16 -0800 Subject: [PATCH 40/55] WIP --- packages/editor/tsconfig.json | 1 + .../persistence/XMLSerializerTango.ts | 44 +++++++++---------- packages/mindplot/tsconfig.json | 1 + 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/packages/editor/tsconfig.json b/packages/editor/tsconfig.json index f06432f5..5d66567d 100644 --- a/packages/editor/tsconfig.json +++ b/packages/editor/tsconfig.json @@ -14,6 +14,7 @@ "allowJs": true, "esModuleInterop": true, "declaration": true, + "strictNullChecks": false, "rootDirs": [ "src", ], diff --git a/packages/mindplot/src/components/persistence/XMLSerializerTango.ts b/packages/mindplot/src/components/persistence/XMLSerializerTango.ts index 138d33b2..abfa8b30 100644 --- a/packages/mindplot/src/components/persistence/XMLSerializerTango.ts +++ b/packages/mindplot/src/components/persistence/XMLSerializerTango.ts @@ -90,7 +90,7 @@ class XMLSerializerTango implements XMLMindmapSerializer { } const text = topic.getText(); - if ($defined(text)) { + if (text) { this._noteTextToXML(document, parentTopic, text); } @@ -273,21 +273,23 @@ class XMLSerializerTango implements XMLMindmapSerializer { return mindmap; } - protected _deserializeNode(domElem: Element, mindmap: Mindmap) { + protected _deserializeNode(domElem: Element, mindmap: Mindmap): NodeModel { const type = domElem.getAttribute('central') != null ? 'CentralTopic' : 'MainTopic'; // Load attributes... - let id: number | null = null; - if ($defined(domElem.getAttribute('id'))) { - id = Number.parseInt(domElem.getAttribute('id'), 10); + let id: number | undefined; + const idStr = domElem.getAttribute('id'); + if (idStr) { + id = Number.parseInt(idStr, 10); } - if (this._idsMap[id]) { - id = null; - } else { + if (id !== undefined && !this._idsMap[id]) { this._idsMap[id] = domElem; + } else { + id = undefined; } + // Create element ... const topic = mindmap.createNode(type, id); // Set text property is it;s defined... @@ -322,14 +324,14 @@ class XMLSerializerTango implements XMLMindmapSerializer { } let shape = domElem.getAttribute('shape'); - if ($defined(shape)) { + if (shape) { // Fix typo on serialization.... shape = shape.replace('rectagle', 'rectangle'); - topic.setShapeType(shape); - if (shape === TopicShape.IMAGE) { - const image = domElem.getAttribute('image'); + // Is an image ? + const image = domElem.getAttribute('image'); + if (image && shape === TopicShape.IMAGE) { const size = image.substring(0, image.indexOf(':')); const url = image.substring(image.indexOf(':') + 1, image.length); topic.setImageUrl(url); @@ -340,17 +342,17 @@ class XMLSerializerTango implements XMLMindmapSerializer { } const bgColor = domElem.getAttribute('bgColor'); - if ($defined(bgColor)) { + if (bgColor) { topic.setBackgroundColor(bgColor); } const borderColor = domElem.getAttribute('brColor'); - if ($defined(borderColor)) { + if (borderColor) { topic.setBorderColor(borderColor); } const order = domElem.getAttribute('order'); - if ($defined(order) && order !== 'NaN') { + if (order !== null && order !== 'NaN') { // Hack for broken maps ... topic.setOrder(parseInt(order, 10)); } @@ -362,13 +364,13 @@ class XMLSerializerTango implements XMLMindmapSerializer { } const position = domElem.getAttribute('position'); - if ($defined(position)) { + if (position !== null) { const pos = position.split(','); topic.setPosition(Number.parseInt(pos[0], 10), Number.parseInt(pos[1], 10)); } const metadata = domElem.getAttribute('metadata'); - if ($defined(metadata)) { + if (metadata !== null) { topic.setMetadata(metadata); } @@ -460,9 +462,9 @@ class XMLSerializerTango implements XMLMindmapSerializer { return emojiToIconMap[icon]; } - private static _deserializeNodeText(domElem: ChildNode) { + private static _deserializeNodeText(domElem: ChildNode): string | null { const children = domElem.childNodes; - let value = null; + let value: string | null = null; for (let i = 0; i < children.length; i++) { const child = children[i]; if (child.nodeType === Node.CDATA_SECTION_NODE) { @@ -513,9 +515,7 @@ class XMLSerializerTango implements XMLMindmapSerializer { * @param in The String whose non-valid characters we want to remove. * @return The in String, stripped of non-valid characters. */ - protected _rmXmlInv(str: string) { - if (str == null || str === undefined) return null; - + protected _rmXmlInv(str: string): string { let result = ''; for (let i = 0; i < str.length; i++) { const c = str.charCodeAt(i); diff --git a/packages/mindplot/tsconfig.json b/packages/mindplot/tsconfig.json index ba18f55e..ed87437f 100644 --- a/packages/mindplot/tsconfig.json +++ b/packages/mindplot/tsconfig.json @@ -10,6 +10,7 @@ "esModuleInterop": true, "resolveJsonModule": true, "declaration": true, + "strictNullChecks": true, "rootDirs": [ "src", ] From bccd26aad6552c91adcddca05e499ff964476d89 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 24 Nov 2022 01:07:28 -0800 Subject: [PATCH 41/55] WIp --- .../src/components/export/freemind/Map.ts | 124 +++++++++++------- .../src/components/export/freemind/Node.ts | 2 +- .../src/components/import/FreemindImporter.ts | 2 +- .../src/components/layout/BalancedSorter.ts | 23 ++-- .../src/components/model/INodeModel.ts | 2 +- .../persistence/XMLSerializerBeta.ts | 7 +- .../persistence/XMLSerializerTango.ts | 27 ++-- .../src/components/widget/ToolbarNotifier.ts | 2 +- .../test/unit/export/expected/emptyNodes.wxml | 2 +- packages/mindplot/tsconfig.json | 2 +- 10 files changed, 108 insertions(+), 85 deletions(-) diff --git a/packages/mindplot/src/components/export/freemind/Map.ts b/packages/mindplot/src/components/export/freemind/Map.ts index 0f7c21d5..672bfe6d 100644 --- a/packages/mindplot/src/components/export/freemind/Map.ts +++ b/packages/mindplot/src/components/export/freemind/Map.ts @@ -73,24 +73,27 @@ export default class Freemap { freemap.setVesion(version); const mainTopicElement = rootElem.firstElementChild; - const mainTopic: Node = new Node().loadFromElement(mainTopicElement); - freemap.setNode(mainTopic); + if (mainTopicElement) { + const mainTopic: Node = new Node().loadFromElement(mainTopicElement); + freemap.setNode(mainTopic); - const childNodes = Array.from(mainTopicElement.childNodes); - const childsNodes = childNodes - .filter((child: ChildNode) => child.nodeType === 1 && (child as Element).tagName === 'node') - .map((c) => c as Element); - - childsNodes.forEach((child: Element) => { - const node = this.domToNode(child); - mainTopic.setArrowlinkOrCloudOrEdge(node); - }); + const childNodes = Array.from(mainTopicElement.childNodes); + const childsNodes = childNodes + .filter((child: ChildNode) => child.nodeType === 1 && (child as Element).tagName === 'node') + .map((c) => c as Element); + childsNodes.forEach((child: Element) => { + const node = this.domToNode(child); + if (node) { + mainTopic.setArrowlinkOrCloudOrEdge(node); + } + }); + } return freemap; } - private filterNodes(child: ChildNode): Element { - let element: Element; + private filterNodes(child: ChildNode): Element | null { + let element: Element | null = null; if (child.nodeType === 1) { if ( (child as Element).tagName === 'node' || @@ -108,8 +111,8 @@ export default class Freemap { return element; } - private domToNode(nodeElem: Element): Choise { - let node: Choise; + private domToNode(nodeElem: Element): Choise | null { + let node: Choise | null = null; if (nodeElem.tagName === 'node') { node = new Node().loadFromElement(nodeElem); @@ -122,84 +125,105 @@ export default class Freemap { childsNodes.forEach((child) => { const childNode = this.domToNode(child); - if (node instanceof Node) node.setArrowlinkOrCloudOrEdge(childNode); + if (node instanceof Node && childNode) { + node.setArrowlinkOrCloudOrEdge(childNode); + } }); } } if (nodeElem.tagName === 'font') { node = new Font(); - if (nodeElem.getAttribute('NAME')) { - node.setName(nodeElem.getAttribute('NAME')); + + const nameAttr = nodeElem.getAttribute('NAME'); + if (nameAttr) { + node.setName(nameAttr); } - if (nodeElem.getAttribute('BOLD')) { - node.setBold(nodeElem.getAttribute('BOLD')); + + const boldAttr = nodeElem.getAttribute('BOLD'); + if (boldAttr) { + node.setBold(boldAttr); } - if (nodeElem.getAttribute('ITALIC')) { - node.setItalic(nodeElem.getAttribute('ITALIC')); + const italicAttr = nodeElem.getAttribute('ITALIC'); + if (italicAttr) { + node.setItalic(italicAttr); } - if (nodeElem.getAttribute('SIZE')) { - node.setSize(nodeElem.getAttribute('SIZE')); + const sizeAttr = nodeElem.getAttribute('SIZE'); + if (sizeAttr) { + node.setSize(sizeAttr); } } if (nodeElem.tagName === 'edge') { node = new Edge(); - if (nodeElem.getAttribute('COLOR')) { - node.setColor(nodeElem.getAttribute('COLOR')); + const colorAttr = nodeElem.getAttribute('COLOR'); + if (colorAttr) { + node.setColor(colorAttr); } - if (nodeElem.getAttribute('STYLE')) { - node.setStyle(nodeElem.getAttribute('STYLE')); + const styleAttr = nodeElem.getAttribute('STYLE'); + if (styleAttr) { + node.setStyle(styleAttr); } - if (nodeElem.getAttribute('WIDTH')) { - node.setWidth(nodeElem.getAttribute('WIDTH')); + const widthAttr = nodeElem.getAttribute('WIDTH'); + if (widthAttr) { + node.setWidth(widthAttr); } } if (nodeElem.tagName === 'arrowlink') { node = new Arrowlink(); - if (nodeElem.getAttribute('COLOR')) { - node.setColor(nodeElem.getAttribute('COLOR')); + const colorAttr = nodeElem.getAttribute('COLOR'); + if (colorAttr) { + node.setColor(colorAttr); } - if (nodeElem.getAttribute('DESTINATION')) { - node.setDestination(nodeElem.getAttribute('DESTINATION')); + const destAttr = nodeElem.getAttribute('DESTINATION'); + if (destAttr) { + node.setDestination(destAttr); } - if (nodeElem.getAttribute('ENDARROW')) { - node.setEndarrow(nodeElem.getAttribute('ENDARROW')); + const endAttr = nodeElem.getAttribute('ENDARROW'); + if (endAttr) { + node.setEndarrow(endAttr); } - if (nodeElem.getAttribute('ENDINCLINATION')) { - node.setEndinclination(nodeElem.getAttribute('ENDINCLINATION')); + const endIncAttr = nodeElem.getAttribute('ENDINCLINATION'); + if (endIncAttr) { + node.setEndinclination(endIncAttr); } - if (nodeElem.getAttribute('ID')) { - node.setId(nodeElem.getAttribute('ID')); + const idAttr = nodeElem.getAttribute('ID'); + if (idAttr) { + node.setId(idAttr); } - if (nodeElem.getAttribute('STARTARROW')) { - node.setStartarrow(nodeElem.getAttribute('STARTARROW')); + const starAttr = nodeElem.getAttribute('STARTARROW'); + if (starAttr) { + node.setStartarrow(starAttr); } - if (nodeElem.getAttribute('STARTINCLINATION')) { - node.setStartinclination(nodeElem.getAttribute('STARTINCLINATION')); + const startIncAttr = nodeElem.getAttribute('STARTINCLINATION'); + if (startIncAttr) { + node.setStartinclination(startIncAttr); } } if (nodeElem.tagName === 'cloud') { node = new Cloud(); - if (nodeElem.getAttribute('COLOR')) { - node.setColor(nodeElem.getAttribute('COLOR')); + const colorAttr = nodeElem.getAttribute('COLOR'); + if (colorAttr) { + node.setColor(colorAttr); } } if (nodeElem.tagName === 'icon') { node = new Icon(); - if (nodeElem.getAttribute('BUILTIN')) { - node.setBuiltin(nodeElem.getAttribute('BUILTIN')); + const bultInAttr = nodeElem.getAttribute('BUILTIN'); + if (bultInAttr) { + node.setBuiltin(bultInAttr); } } if (nodeElem.tagName === 'richcontent') { node = new Richcontent(); - if (nodeElem.getAttribute('TYPE')) { - node.setType(nodeElem.getAttribute('TYPE')); + const typeAttr = nodeElem.getAttribute('TYPE'); + if (typeAttr) { + node.setType(typeAttr); } if (nodeElem.firstChild && nodeElem.getElementsByTagName('html')) { const content = nodeElem.getElementsByTagName('html'); diff --git a/packages/mindplot/src/components/export/freemind/Node.ts b/packages/mindplot/src/components/export/freemind/Node.ts index bc889e1d..16d56a33 100644 --- a/packages/mindplot/src/components/export/freemind/Node.ts +++ b/packages/mindplot/src/components/export/freemind/Node.ts @@ -69,7 +69,7 @@ class Node { return this.FOLDED; } - getId(): string { + getId(): string | null { return this.ID; } diff --git a/packages/mindplot/src/components/import/FreemindImporter.ts b/packages/mindplot/src/components/import/FreemindImporter.ts index 1bb6e209..50aa621a 100644 --- a/packages/mindplot/src/components/import/FreemindImporter.ts +++ b/packages/mindplot/src/components/import/FreemindImporter.ts @@ -342,7 +342,7 @@ export default class FreemindImporter extends Importer { const id = node.getId(); let idFreeToIdWise: number; - if (id) { + if (id !== null && id !== undefined) { if (id === '_') { this.idDefault++; idFreeToIdWise = this.idDefault; diff --git a/packages/mindplot/src/components/layout/BalancedSorter.ts b/packages/mindplot/src/components/layout/BalancedSorter.ts index 2e67db7b..a3af023d 100644 --- a/packages/mindplot/src/components/layout/BalancedSorter.ts +++ b/packages/mindplot/src/components/layout/BalancedSorter.ts @@ -28,7 +28,7 @@ class BalancedSorter extends AbstractBasicSorter { private static INTERNODE_HORIZONTAL_PADDING = 30; - predict(graph, parent, node: Node, position: PositionType) { + predict(graph, parent, node: Node, position: PositionType): [number, PositionType] { const rootNode = graph.getRootNode(parent); // If it is a dragged node... @@ -44,19 +44,16 @@ class BalancedSorter extends AbstractBasicSorter { } } - let right; - let left; + // Find the order ... + let order: number; if (!position) { - right = this._getChildrenForOrder(parent, graph, 0); - left = this._getChildrenForOrder(parent, graph, 1); - } - // Filter nodes on one side.. - let order; - if (position) { - order = position.x > rootNode.getPosition().x ? 0 : 1; - } else { + const right = this._getChildrenForOrder(parent, graph, 0); + const left = this._getChildrenForOrder(parent, graph, 1); order = right.length - left.length > 0 ? 1 : 0; + } else { + order = position.x > rootNode.getPosition().x ? 0 : 1; } + const direction = order % 2 === 0 ? 1 : -1; // Exclude the dragged node (if set) @@ -79,7 +76,7 @@ class BalancedSorter extends AbstractBasicSorter { } // Try to fit within ... - let result = null; + let result: [number, PositionType] | null = null; const last = children[children.length - 1]; const newestPosition = position || { x: last.getPosition().x, y: last.getPosition().y + 1 }; children.forEach((child, index) => { @@ -234,7 +231,7 @@ class BalancedSorter extends AbstractBasicSorter { return 'Balanced Sorter'; } - protected _getChildrenForOrder(parent: Node, graph: RootedTreeSet, order: number) { + protected _getChildrenForOrder(parent: Node, graph: RootedTreeSet, order: number): Node[] { return this._getSortedChildren(graph, parent).filter( (child) => child.getOrder() % 2 === order % 2, ); diff --git a/packages/mindplot/src/components/model/INodeModel.ts b/packages/mindplot/src/components/model/INodeModel.ts index 4b5e3fac..61b470c6 100644 --- a/packages/mindplot/src/components/model/INodeModel.ts +++ b/packages/mindplot/src/components/model/INodeModel.ts @@ -288,7 +288,7 @@ abstract class INodeModel { abstract getPropertiesKeys(): string[]; - abstract getProperty(key: string): number | string | boolean | undefined; + abstract getProperty(key: string): number | string | boolean; abstract putProperty(key: string, value: number | string | boolean): void; diff --git a/packages/mindplot/src/components/persistence/XMLSerializerBeta.ts b/packages/mindplot/src/components/persistence/XMLSerializerBeta.ts index 3b9e8744..ffc1bc37 100644 --- a/packages/mindplot/src/components/persistence/XMLSerializerBeta.ts +++ b/packages/mindplot/src/components/persistence/XMLSerializerBeta.ts @@ -20,6 +20,7 @@ import Mindmap from '../model/Mindmap'; import FeatureModelFactory from '../model/FeatureModelFactory'; import NodeModel from '../model/NodeModel'; import XMLMindmapSerializer from './XMLMindmapSerializer'; +import FeatureModel from '../model/FeatureModel'; class XMLSerializerBeta implements XMLMindmapSerializer { private static MAP_ROOT_NODE = 'map'; @@ -65,7 +66,7 @@ class XMLSerializerBeta implements XMLMindmapSerializer { } const text = topic.getText(); - if ($defined(text)) { + if (text) { parentTopic.setAttribute('text', text); } @@ -297,9 +298,9 @@ class XMLSerializerBeta implements XMLMindmapSerializer { return topic; } - _deserializeIcon(domElem: Element) { + private _deserializeIcon(domElem: Element): FeatureModel { let icon = domElem.getAttribute('id'); - icon = icon.replace('images/', 'icons/legacy/'); + icon = icon ? icon.replace('images/', 'icons/legacy/') : 'missing'; return FeatureModelFactory.createModel('icon', { id: icon }); } diff --git a/packages/mindplot/src/components/persistence/XMLSerializerTango.ts b/packages/mindplot/src/components/persistence/XMLSerializerTango.ts index abfa8b30..0d387fdb 100644 --- a/packages/mindplot/src/components/persistence/XMLSerializerTango.ts +++ b/packages/mindplot/src/components/persistence/XMLSerializerTango.ts @@ -268,7 +268,7 @@ class XMLSerializerTango implements XMLMindmapSerializer { }); // Clean up from the recursion ... - this._idsMap = null; + this._idsMap = {}; mindmap.setId(mapId); return mindmap; } @@ -389,7 +389,9 @@ class XMLSerializerTango implements XMLMindmapSerializer { for (let j = 0; j < namedNodeMap.length; j++) { const attribute = namedNodeMap.item(j); - attributes[attribute.name] = attribute.value; + if (attribute !== null) { + attributes[attribute.name] = attribute.value; + } } // Has text node ?. @@ -437,7 +439,7 @@ class XMLSerializerTango implements XMLMindmapSerializer { static _deserializeTextAttr(domElem: Element): string { let value = domElem.getAttribute('text'); - if (!$defined(value)) { + if (!value) { const children = domElem.childNodes; for (let i = 0; i < children.length; i++) { const child = children[i]; @@ -448,11 +450,10 @@ class XMLSerializerTango implements XMLMindmapSerializer { } else { // Notes must be decoded ... value = unescape(value); - - // Hack for empty nodes ... - if (value === '') { - value = ' '; - } + } + // Hack for empty nodes ... + if (!value) { + value = ' '; } return value; @@ -462,7 +463,7 @@ class XMLSerializerTango implements XMLMindmapSerializer { return emojiToIconMap[icon]; } - private static _deserializeNodeText(domElem: ChildNode): string | null { + private static _deserializeNodeText(domElem: ChildNode): string { const children = domElem.childNodes; let value: string | null = null; for (let i = 0; i < children.length; i++) { @@ -471,13 +472,13 @@ class XMLSerializerTango implements XMLMindmapSerializer { value = child.nodeValue; } } - return value; + return value !== null ? value : ''; } static _deserializeRelationship(domElement: Element, mindmap: Mindmap): RelationshipModel { - const srcId = Number.parseInt(domElement.getAttribute('srcTopicId'), 10); - const destId = Number.parseInt(domElement.getAttribute('destTopicId'), 10); - const lineType = Number.parseInt(domElement.getAttribute('lineType'), 10); + const srcId = Number.parseInt(domElement.getAttribute('srcTopicId')!, 10); + const destId = Number.parseInt(domElement.getAttribute('destTopicId')!, 10); + const lineType = Number.parseInt(domElement.getAttribute('lineType')!, 10); const srcCtrlPoint = domElement.getAttribute('srcCtrlPoint'); const destCtrlPoint = domElement.getAttribute('destCtrlPoint'); diff --git a/packages/mindplot/src/components/widget/ToolbarNotifier.ts b/packages/mindplot/src/components/widget/ToolbarNotifier.ts index 0f063ece..ea7e97ce 100644 --- a/packages/mindplot/src/components/widget/ToolbarNotifier.ts +++ b/packages/mindplot/src/components/widget/ToolbarNotifier.ts @@ -36,7 +36,7 @@ class ToolbarNotifier { this.container.data('transitioning', true); this.container.text(msg); this.container.css({ - left: ($(window).width() - this.container.width()) / 2 - 9, + left: ($(window).width()! - this.container.width()!) / 2 - 9, }); if (fade) { diff --git a/packages/mindplot/test/unit/export/expected/emptyNodes.wxml b/packages/mindplot/test/unit/export/expected/emptyNodes.wxml index 923cb2e4..741720d0 100644 --- a/packages/mindplot/test/unit/export/expected/emptyNodes.wxml +++ b/packages/mindplot/test/unit/export/expected/emptyNodes.wxml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/packages/mindplot/tsconfig.json b/packages/mindplot/tsconfig.json index ed87437f..b2a5de29 100644 --- a/packages/mindplot/tsconfig.json +++ b/packages/mindplot/tsconfig.json @@ -10,7 +10,7 @@ "esModuleInterop": true, "resolveJsonModule": true, "declaration": true, - "strictNullChecks": true, + "strictNullChecks": false, "rootDirs": [ "src", ] From 506797b8a718f29b99d06375b140f6a4b7ac4657 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 24 Nov 2022 02:13:14 -0800 Subject: [PATCH 42/55] WIP --- .../src/components/ActionDispatcher.ts | 7 +- .../mindplot/src/components/CentralTopic.ts | 1 - packages/mindplot/src/components/Designer.ts | 11 ++- .../src/components/DesignerBuilder.ts | 3 +- .../src/components/DesignerOptionsBuilder.ts | 4 +- packages/mindplot/src/components/DragTopic.ts | 6 +- .../src/components/MultilineTextEditor.ts | 89 ++++++++++--------- .../src/components/PersistenceManager.ts | 2 +- .../mindplot/src/components/ScreenManager.ts | 2 +- packages/mindplot/src/components/Topic.ts | 48 +++++----- .../mindplot/src/components/WidgetManager.ts | 13 ++- .../src/components/commands/DeleteCommand.ts | 4 +- .../layout/ChildrenSorterStrategy.ts | 2 +- .../src/components/layout/LayoutManager.ts | 6 +- .../src/components/model/INodeModel.ts | 6 +- 15 files changed, 108 insertions(+), 96 deletions(-) diff --git a/packages/mindplot/src/components/ActionDispatcher.ts b/packages/mindplot/src/components/ActionDispatcher.ts index fc813521..2b8135a5 100644 --- a/packages/mindplot/src/components/ActionDispatcher.ts +++ b/packages/mindplot/src/components/ActionDispatcher.ts @@ -48,7 +48,12 @@ abstract class ActionDispatcher extends Events { abstract deleteEntities(topicsIds: number[], relIds: number[]): void; - abstract dragTopic(topicId: number, position: Point, order: number, parentTopic: Topic): void; + abstract dragTopic( + topicId: number, + position: Point, + order: number | null, + parentTopic: Topic | null, + ): void; abstract moveTopic(topicId: number, position: Point): void; diff --git a/packages/mindplot/src/components/CentralTopic.ts b/packages/mindplot/src/components/CentralTopic.ts index 85908a28..1fc61e92 100644 --- a/packages/mindplot/src/components/CentralTopic.ts +++ b/packages/mindplot/src/components/CentralTopic.ts @@ -53,7 +53,6 @@ class CentralTopic extends Topic { this.setPosition(zeroPoint); } - /** */ getShrinkConnector() { return null; } diff --git a/packages/mindplot/src/components/Designer.ts b/packages/mindplot/src/components/Designer.ts index 756d8fcf..3bfa32c7 100644 --- a/packages/mindplot/src/components/Designer.ts +++ b/packages/mindplot/src/components/Designer.ts @@ -87,7 +87,7 @@ class Designer extends Events { // Set up i18n location ... console.log(`Editor location: ${options.locale}`); - Messages.init(options.locale); + Messages.init(options.locale ? options.locale : 'en'); this._options = options; @@ -263,7 +263,10 @@ class Designer extends Events { } else { $assert(targetTopic, 'Could not find a topic to connect'); } - topic.connectTo(targetTopic, this._workspace); + + if (targetTopic) { + topic.connectTo(targetTopic, this._workspace); + } } topic.addEvent('ontblur', () => { @@ -521,7 +524,7 @@ class Designer extends Events { const parentTopic = topic.getOutgoingConnectedTopic(); const siblingModel = this._createSiblingModel(topic); - if (siblingModel) { + if (siblingModel && parentTopic) { // Hack: if parent is central topic, add node below not on opposite side. // This should be done in the layout if (parentTopic.getType() === 'CentralTopic') { @@ -724,7 +727,7 @@ class Designer extends Events { ); // Build relationship line .... - const result = new Relationship(sourceTopic, targetTopic, model); + const result = new Relationship(sourceTopic!, targetTopic!, model); const me = this; result.addEvent('ontblur', () => { diff --git a/packages/mindplot/src/components/DesignerBuilder.ts b/packages/mindplot/src/components/DesignerBuilder.ts index 4a7a3e20..cd289fca 100644 --- a/packages/mindplot/src/components/DesignerBuilder.ts +++ b/packages/mindplot/src/components/DesignerBuilder.ts @@ -37,8 +37,7 @@ export function buildDesigner(options: DesignerOptions): Designer { // Configure default persistence manager ... const persistence = options.persistenceManager; - $assert(persistence, 'persistence must be defined'); - PersistenceManager.init(persistence); + PersistenceManager.init(persistence!); // If not manager was specifed, use the readonly one. const widgetManager = options.widgetManager ? options.widgetManager : new ReadOnlyWidgetManager(); diff --git a/packages/mindplot/src/components/DesignerOptionsBuilder.ts b/packages/mindplot/src/components/DesignerOptionsBuilder.ts index 41fde211..f31305f8 100644 --- a/packages/mindplot/src/components/DesignerOptionsBuilder.ts +++ b/packages/mindplot/src/components/DesignerOptionsBuilder.ts @@ -24,7 +24,7 @@ export type DesignerOptions = { zoom: number; mode: EditorRenderMode; mapId?: string; - divContainer?: HTMLElement; + divContainer: HTMLElement; container: string; persistenceManager?: PersistenceManager; widgetManager?: WidgetManager; @@ -36,7 +36,7 @@ class OptionsBuilder { static buildOptions(options: DesignerOptions): DesignerOptions { $assert(options.persistenceManager, 'persistence must be defined'); - const defaultOptions: DesignerOptions = { + const defaultOptions = { mode: 'edition-owner', zoom: 0.85, saveOnLoad: true, diff --git a/packages/mindplot/src/components/DragTopic.ts b/packages/mindplot/src/components/DragTopic.ts index be51a848..859b60b3 100644 --- a/packages/mindplot/src/components/DragTopic.ts +++ b/packages/mindplot/src/components/DragTopic.ts @@ -108,8 +108,6 @@ class DragTopic { } connectTo(parent: Topic) { - $assert(parent, 'Parent connection node can not be null.'); - // Where it should be connected ? const predict = this._layoutManager.predict( parent.getId(), @@ -178,8 +176,8 @@ class DragTopic { const position = this.getPosition(); if (!this.isFreeLayoutOn()) { - let order = null; - let parent = null; + let order: number | null = null; + let parent: Topic | null = null; const isDragConnected = this.isConnected(); if (isDragConnected) { const targetTopic = this.getConnectedToTopic(); diff --git a/packages/mindplot/src/components/MultilineTextEditor.ts b/packages/mindplot/src/components/MultilineTextEditor.ts index 2dfc4540..e0b6c42f 100644 --- a/packages/mindplot/src/components/MultilineTextEditor.ts +++ b/packages/mindplot/src/components/MultilineTextEditor.ts @@ -23,9 +23,9 @@ import ActionDispatcher from './ActionDispatcher'; import Topic from './Topic'; class MultilineTextEditor extends Events { - private _topic: Topic; + private _topic: Topic | null; - private _containerElem: JQuery; + private _containerElem: JQuery | null; constructor() { super(); @@ -54,7 +54,7 @@ class MultilineTextEditor extends Events { private _registerEvents(containerElem: JQuery) { const textareaElem = this._getTextareaElem(); - textareaElem.on('keydown', (event) => { + textareaElem?.on('keydown', (event) => { switch (event.code) { case 'Escape': this.close(false); @@ -85,12 +85,12 @@ class MultilineTextEditor extends Events { event.stopPropagation(); }); - textareaElem.on('keypress', (event) => { + textareaElem?.on('keypress', (event) => { event.stopPropagation(); }); - textareaElem.on('keyup', (event) => { - const text = this._getTextareaElem().val(); + textareaElem?.on('keyup', (event) => { + const text = this._getTextareaElem()?.val(); this.fireEvent('input', [event, text]); this._adjustEditorSize(); }); @@ -117,22 +117,22 @@ class MultilineTextEditor extends Events { maxLineLength = Math.max(line.length, maxLineLength); }); - textElem.attr('cols', maxLineLength); - textElem.attr('rows', lines.length); + textElem?.attr('cols', maxLineLength); + textElem?.attr('rows', lines.length); - this._containerElem.css({ + this._containerElem?.css({ width: `${maxLineLength + 2}em`, - height: textElem.height(), + height: textElem?.height() || 0, }); } } isVisible(): boolean { - return $defined(this._containerElem) && this._containerElem.css('display') === 'block'; + return this._containerElem !== null && this._containerElem.css('display') === 'block'; } private _updateModel() { - if (this._topic.getText() !== this._getTextAreaText()) { + if (this._topic && this._topic.getText() !== this._getTextAreaText()) { const text = this._getTextAreaText(); const topicId = this._topic.getId(); @@ -167,36 +167,39 @@ class MultilineTextEditor extends Events { private _showEditor(defaultText: string) { const topic = this._topic; + if (topic && this._containerElem) { + // Hide topic text ... + topic.getTextShape().setVisibility(false); - // Hide topic text ... - topic.getTextShape().setVisibility(false); + // Set Editor Style + const nodeText = topic.getTextShape(); + const fontStyle = nodeText.getFontStyle(); + fontStyle.size = nodeText.getHtmlFontSize(); + fontStyle.color = nodeText.getColor(); + this._setStyle(fontStyle); - // Set Editor Style - const nodeText = topic.getTextShape(); - const fontStyle = nodeText.getFontStyle(); - fontStyle.size = nodeText.getHtmlFontSize(); - fontStyle.color = nodeText.getColor(); - this._setStyle(fontStyle); + // Set editor's initial size + // Position the editor and set the size... + const textShape = topic.getTextShape(); - // Set editor's initial size - // Position the editor and set the size... - const textShape = topic.getTextShape(); + this._containerElem.css('display', 'block'); - this._containerElem.css('display', 'block'); + let { top, left } = textShape.getNativePosition(); + // Adjust padding top position ... + top -= 4; + left -= 4; + this._containerElem.offset({ top, left }); - let { top, left } = textShape.getNativePosition(); - // Adjust padding top position ... - top -= 4; - left -= 4; - this._containerElem.offset({ top, left }); + // Set editor's initial text ... + const text = $defined(defaultText) ? defaultText : topic.getText(); + this._setText(text); - // Set editor's initial text ... - const text = $defined(defaultText) ? defaultText : topic.getText(); - this._setText(text); - - // Set the element focus and select the current text ... - const inputElem = this._getTextareaElem(); - this._positionCursor(inputElem, !$defined(defaultText)); + // Set the element focus and select the current text ... + const inputElem = this._getTextareaElem(); + if (inputElem) { + this._positionCursor(inputElem, !$defined(defaultText)); + } + } } private _setStyle(fontStyle) { @@ -223,22 +226,22 @@ class MultilineTextEditor extends Events { fontWeight: fontStyle.weight, color: fontStyle.color, }; - inputField.css(style); - this._containerElem.css(style); + inputField?.css(style); + this._containerElem?.css(style); } private _setText(text: string): void { const textareaElem = this._getTextareaElem(); - textareaElem.val(text); + textareaElem?.val(text); this._adjustEditorSize(); } private _getTextAreaText(): string { - return this._getTextareaElem().val() as string; + return this._getTextareaElem()?.val() as string; } - private _getTextareaElem(): JQuery { - return this._containerElem.find('textarea'); + private _getTextareaElem(): JQuery | null { + return this._containerElem ? this._containerElem.find('textarea') : null; } private _positionCursor(textareaElem: JQuery, selectText: boolean) { @@ -259,7 +262,7 @@ class MultilineTextEditor extends Events { } // Remove it form the screen ... - this._containerElem.remove(); + this._containerElem?.remove(); this._containerElem = null; } diff --git a/packages/mindplot/src/components/PersistenceManager.ts b/packages/mindplot/src/components/PersistenceManager.ts index ead8e31b..886f7557 100644 --- a/packages/mindplot/src/components/PersistenceManager.ts +++ b/packages/mindplot/src/components/PersistenceManager.ts @@ -54,7 +54,7 @@ abstract class PersistenceManager { protected getCSRFToken(): string | null { const meta = document.head.querySelector('meta[name="_csrf"]'); - let result = null; + let result: string | null = null; if (meta) { result = meta.getAttribute('content'); } diff --git a/packages/mindplot/src/components/ScreenManager.ts b/packages/mindplot/src/components/ScreenManager.ts index 18b0a94d..0b5b5323 100644 --- a/packages/mindplot/src/components/ScreenManager.ts +++ b/packages/mindplot/src/components/ScreenManager.ts @@ -85,7 +85,7 @@ class ScreenManager { } } - fireEvent(type: string, event: UIEvent = null) { + fireEvent(type: string, event?: UIEvent): void { if (type === 'click') { this._clickEvents.forEach((listener) => { listener(type, event); diff --git a/packages/mindplot/src/components/Topic.ts b/packages/mindplot/src/components/Topic.ts index e09befde..ed1e6e0f 100644 --- a/packages/mindplot/src/components/Topic.ts +++ b/packages/mindplot/src/components/Topic.ts @@ -15,7 +15,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import $ from 'jquery'; import { $assert, $defined } from '@wisemapping/core-js'; import { Rect, Image, Line, Text, Group, ElementClass, Point } from '@wisemapping/web2d'; @@ -147,7 +146,7 @@ abstract class Topic extends NodeGraph { // Move connector to front const connector = this.getShrinkConnector(); - if ($defined(connector)) { + if (connector) { connector.moveToFront(); } } @@ -508,7 +507,7 @@ abstract class Topic extends NodeGraph { } } - private _setText(text: string, updateModel?: boolean) { + private _setText(text: string | null, updateModel?: boolean) { const textShape = this.getTextShape(); textShape.setText(text == null ? TopicStyle.defaultText(this) : text); @@ -520,7 +519,7 @@ abstract class Topic extends NodeGraph { setText(text: string) { // Avoid empty nodes ... - if (!text || $.trim(text).length === 0) { + if (!text || text.trim().length === 0) { this._setText(null, true); } else { this._setText(text, true); @@ -531,11 +530,8 @@ abstract class Topic extends NodeGraph { getText(): string { const model = this.getModel(); - let result = model.getText(); - if (!$defined(result)) { - result = TopicStyle.defaultText(this); - } - return result; + const text = model.getText(); + return text || TopicStyle.defaultText(this); } setBackgroundColor(color: string): void { @@ -622,7 +618,7 @@ abstract class Topic extends NodeGraph { } const shrinkConnector = this.getShrinkConnector(); - if ($defined(shrinkConnector)) { + if (shrinkConnector) { shrinkConnector.addToWorkspace(group); } @@ -706,7 +702,7 @@ abstract class Topic extends NodeGraph { EventBus.instance.fireEvent('childShrinked', model); } - getShrinkConnector(): ShirinkConnector | undefined { + getShrinkConnector(): ShirinkConnector | null { let result = this._connector; if (this._connector == null) { this._connector = new ShirinkConnector(this); @@ -849,10 +845,10 @@ abstract class Topic extends NodeGraph { .map((node) => node.getOutgoingLine()); } - getOutgoingConnectedTopic(): Topic { + getOutgoingConnectedTopic(): Topic | null { let result = null; const line = this.getOutgoingLine(); - if ($defined(line)) { + if (line) { result = line.getTargetTopic(); } return result; @@ -875,7 +871,7 @@ abstract class Topic extends NodeGraph { setBranchVisibility(value: boolean): void { let current: Topic = this; - let parent: Topic = this; + let parent: Topic | null = this; while (parent != null && !parent.isCentralTopic()) { current = parent; parent = current.getParent(); @@ -905,7 +901,7 @@ abstract class Topic extends NodeGraph { this._relationships.forEach((r) => r.moveToBack()); const connector = this.getShrinkConnector(); - if ($defined(connector)) { + if (connector) { connector.moveToBack(); } @@ -916,7 +912,7 @@ abstract class Topic extends NodeGraph { moveToFront(): void { this.get2DElement().moveToFront(); const connector = this.getShrinkConnector(); - if ($defined(connector)) { + if (connector) { connector.moveToFront(); } // Update relationship lines @@ -951,7 +947,7 @@ abstract class Topic extends NodeGraph { if (this.getIncomingLines().length > 0) { const connector = this.getShrinkConnector(); - if ($defined(connector)) { + if (connector) { connector.setVisibility(value, fade); } } @@ -970,7 +966,7 @@ abstract class Topic extends NodeGraph { elem.setOpacity(opacity); const connector = this.getShrinkConnector(); - if ($defined(connector)) { + if (connector) { connector.setOpacity(opacity); } const textShape = this.getTextShape(); @@ -1132,7 +1128,7 @@ abstract class Topic extends NodeGraph { // Display connection node... const connector = targetTopic.getShrinkConnector(); - if ($defined(connector)) { + if (connector) { connector.setVisibility(true); } @@ -1190,9 +1186,10 @@ abstract class Topic extends NodeGraph { EventBus.instance.fireEvent('topicAdded', this.getModel()); } - if (this.getModel().isConnected()) { + const outgoingTopic = this.getOutgoingConnectedTopic(); + if (this.getModel().isConnected() && outgoingTopic) { EventBus.instance.fireEvent('topicConnected', { - parentNode: this.getOutgoingConnectedTopic().getModel(), + parentNode: outgoingTopic.getModel(), childNode: this.getModel(), }); } @@ -1212,7 +1209,7 @@ abstract class Topic extends NodeGraph { // Is the node already connected ? const targetTopic = this.getOutgoingConnectedTopic(); - if ($defined(targetTopic)) { + if (targetTopic) { result.connectTo(targetTopic); result.setVisibility(false); } @@ -1265,19 +1262,18 @@ abstract class Topic extends NodeGraph { } private _flatten2DElements(topic: Topic): (Topic | Relationship)[] { - let result = []; - + const result: (Topic | Relationship)[] = []; const children = topic.getChildren(); children.forEach((child) => { result.push(child); result.push(child.getOutgoingLine()); const relationships = child.getRelationships(); - result = result.concat(relationships); + result.push(...relationships); if (!child.areChildrenShrunken()) { const innerChilds = this._flatten2DElements(child); - result = result.concat(innerChilds); + result.push(...innerChilds); } }); return result; diff --git a/packages/mindplot/src/components/WidgetManager.ts b/packages/mindplot/src/components/WidgetManager.ts index fa2cd0cc..a713f3e9 100644 --- a/packages/mindplot/src/components/WidgetManager.ts +++ b/packages/mindplot/src/components/WidgetManager.ts @@ -18,7 +18,12 @@ abstract class WidgetManager { return this._instance; } - private createTooltip(mindmapElement, title: string, linkModel: LinkModel, noteModel: NoteModel) { + private createTooltip( + mindmapElement, + title: string, + linkModel?: LinkModel, + noteModel?: NoteModel, + ) { const webcomponentShadowRoot = $($('#mindmap-comp')[0].shadowRoot); let tooltip = webcomponentShadowRoot.find('#mindplot-svg-tooltip'); if (!tooltip.length) { @@ -97,7 +102,11 @@ abstract class WidgetManager { abstract showEditorForLink(topic: Topic, linkModel: LinkModel, linkIcon: LinkIcon): void; - abstract showEditorForNote(topic: Topic, noteModel: NoteModel, noteIcon: NoteIcon): void; + abstract showEditorForNote( + topic: Topic, + noteModel: NoteModel | null, + noteIcon: NoteIcon | null, + ): void; } export default WidgetManager; diff --git a/packages/mindplot/src/components/commands/DeleteCommand.ts b/packages/mindplot/src/components/commands/DeleteCommand.ts index 76ef0723..775107f7 100644 --- a/packages/mindplot/src/components/commands/DeleteCommand.ts +++ b/packages/mindplot/src/components/commands/DeleteCommand.ts @@ -137,10 +137,10 @@ class DeleteCommand extends Command { this._deletedRelModel = []; } - private _filterChildren(topicIds: number[], commandContext: CommandContext) { + private _filterChildren(topicIds: number[], commandContext: CommandContext): Topic[] { const topics = commandContext.findTopics(topicIds); - const result = []; + const result: Topic[] = []; topics.forEach((topic: Topic) => { let parent = topic.getParent(); let found = false; diff --git a/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts b/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts index 85396b4c..e07fd91c 100644 --- a/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts +++ b/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts @@ -28,7 +28,7 @@ abstract class ChildrenSorterStrategy { abstract detach(treeSet: RootedTreeSet, node: Node): void; - abstract predict(treeSet: RootedTreeSet, parent, node: Node, position: PositionType); + abstract predict(treeSet: RootedTreeSet, parent, node: Node | null, position: PositionType); abstract verify(treeSet: RootedTreeSet, node: Node); diff --git a/packages/mindplot/src/components/layout/LayoutManager.ts b/packages/mindplot/src/components/layout/LayoutManager.ts index 310d4f61..dcbe9e67 100644 --- a/packages/mindplot/src/components/layout/LayoutManager.ts +++ b/packages/mindplot/src/components/layout/LayoutManager.ts @@ -128,8 +128,8 @@ class LayoutManager extends Events { predict( parentId: number, - nodeId: number, - position: PositionType, + nodeId: number | null, + position: PositionType | null, ): { order: number; position: PositionType } { $assert($defined(parentId), 'parentId can not be null'); @@ -194,7 +194,7 @@ class LayoutManager extends Events { if (node.hasOrderChanged() || node.hasPositionChanged()) { // Find or create a event ... const id = node.getId(); - let event: ChangeEvent = this._events.find((e) => e.getId() === id); + let event: ChangeEvent | undefined = this._events.find((e) => e.getId() === id); if (!event) { event = new ChangeEvent(id); } diff --git a/packages/mindplot/src/components/model/INodeModel.ts b/packages/mindplot/src/components/model/INodeModel.ts index 61b470c6..44c7b405 100644 --- a/packages/mindplot/src/components/model/INodeModel.ts +++ b/packages/mindplot/src/components/model/INodeModel.ts @@ -66,11 +66,11 @@ abstract class INodeModel { this.putProperty('type', type); } - setText(text: string): void { + setText(text: string | null): void { this.putProperty('text', text); } - getText(): string | undefined { + getText(): string | null { return this.getProperty('text') as string; } @@ -290,7 +290,7 @@ abstract class INodeModel { abstract getProperty(key: string): number | string | boolean; - abstract putProperty(key: string, value: number | string | boolean): void; + abstract putProperty(key: string, value: number | string | boolean | null): void; abstract setParent(parent: INodeModel): void; From 6304d24b2cc36dccb28af5f2f2625232864ce5f5 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 24 Nov 2022 07:51:00 -0800 Subject: [PATCH 43/55] Address editor regression. --- packages/mindplot/src/components/MultilineTextEditor.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/mindplot/src/components/MultilineTextEditor.ts b/packages/mindplot/src/components/MultilineTextEditor.ts index e0b6c42f..fd01c1ca 100644 --- a/packages/mindplot/src/components/MultilineTextEditor.ts +++ b/packages/mindplot/src/components/MultilineTextEditor.ts @@ -30,6 +30,7 @@ class MultilineTextEditor extends Events { constructor() { super(); this._topic = null; + this._containerElem = null; } private static _buildEditor() { From a82771ec408c363e2f3e100d133c42ef32a91f8b Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 24 Nov 2022 09:28:59 -0800 Subject: [PATCH 44/55] Improve multi-text editor code. --- .../src/components/MultilineTextEditor.ts | 201 ++++++++++-------- .../src/components/TopicEventDispatcher.ts | 22 +- 2 files changed, 115 insertions(+), 108 deletions(-) diff --git a/packages/mindplot/src/components/MultilineTextEditor.ts b/packages/mindplot/src/components/MultilineTextEditor.ts index fd01c1ca..5cd554f4 100644 --- a/packages/mindplot/src/components/MultilineTextEditor.ts +++ b/packages/mindplot/src/components/MultilineTextEditor.ts @@ -1,3 +1,4 @@ +/* eslint-disable max-classes-per-file */ /* * Copyright [2021] [wisemapping] * @@ -18,19 +19,23 @@ import { $defined } from '@wisemapping/core-js'; import $ from 'jquery'; -import Events from './Events'; import ActionDispatcher from './ActionDispatcher'; +import Events from './Events'; import Topic from './Topic'; -class MultilineTextEditor extends Events { - private _topic: Topic | null; +class EditorComponent extends Events { + private _topic: Topic; - private _containerElem: JQuery | null; + private _containerElem: JQuery; - constructor() { + constructor(topic: Topic) { super(); - this._topic = null; - this._containerElem = null; + this._topic = topic; + + // Create editor ui + this._containerElem = EditorComponent._buildEditor(); + $('body').append(this._containerElem); + this._registerEvents(this._containerElem); } private static _buildEditor() { @@ -53,9 +58,9 @@ class MultilineTextEditor extends Events { return result; } - private _registerEvents(containerElem: JQuery) { + private _registerEvents(containerElem: JQuery): void { const textareaElem = this._getTextareaElem(); - textareaElem?.on('keydown', (event) => { + textareaElem.on('keydown', (event) => { switch (event.code) { case 'Escape': this.close(false); @@ -86,12 +91,12 @@ class MultilineTextEditor extends Events { event.stopPropagation(); }); - textareaElem?.on('keypress', (event) => { + textareaElem.on('keypress', (event) => { event.stopPropagation(); }); - textareaElem?.on('keyup', (event) => { - const text = this._getTextareaElem()?.val(); + textareaElem.on('keyup', (event) => { + const text = this._getTextareaElem().val(); this.fireEvent('input', [event, text]); this._adjustEditorSize(); }); @@ -109,27 +114,21 @@ class MultilineTextEditor extends Events { } private _adjustEditorSize() { - if (this.isVisible()) { - const textElem = this._getTextareaElem(); + const textElem = this._getTextareaElem(); - const lines = this._getTextAreaText().split('\n'); - let maxLineLength = 1; - lines.forEach((line: string) => { - maxLineLength = Math.max(line.length, maxLineLength); - }); + const lines = this._getTextAreaText().split('\n'); + let maxLineLength = 1; + lines.forEach((line: string) => { + maxLineLength = Math.max(line.length, maxLineLength); + }); - textElem?.attr('cols', maxLineLength); - textElem?.attr('rows', lines.length); + textElem.attr('cols', maxLineLength); + textElem.attr('rows', lines.length); - this._containerElem?.css({ - width: `${maxLineLength + 2}em`, - height: textElem?.height() || 0, - }); - } - } - - isVisible(): boolean { - return this._containerElem !== null && this._containerElem.css('display') === 'block'; + this._containerElem.css({ + width: `${maxLineLength + 2}em`, + height: textElem?.height() || 0, + }); } private _updateModel() { @@ -148,62 +147,49 @@ class MultilineTextEditor extends Events { } } - show(topic: Topic, text: string): void { - // Close a previous node editor if it's opened ... - if (this._topic) { - this.close(false); - } - - this._topic = topic; - if (!this.isVisible()) { - // Create editor ui - const containerElem = MultilineTextEditor._buildEditor(); - $('body').append(containerElem); - - this._containerElem = containerElem; - this._registerEvents(containerElem); - this._showEditor(text); - } - } - - private _showEditor(defaultText: string) { + show(defaultText: string) { const topic = this._topic; - if (topic && this._containerElem) { - // Hide topic text ... - topic.getTextShape().setVisibility(false); - // Set Editor Style - const nodeText = topic.getTextShape(); - const fontStyle = nodeText.getFontStyle(); - fontStyle.size = nodeText.getHtmlFontSize(); - fontStyle.color = nodeText.getColor(); - this._setStyle(fontStyle); + // Hide topic text ... + topic.getTextShape().setVisibility(false); - // Set editor's initial size - // Position the editor and set the size... - const textShape = topic.getTextShape(); + // Set Editor Style + const nodeText = topic.getTextShape(); + const fontStyle = nodeText.getFontStyle(); + fontStyle.size = nodeText.getHtmlFontSize(); + fontStyle.color = nodeText.getColor(); + this._setStyle(fontStyle); - this._containerElem.css('display', 'block'); + // Set editor's initial size + // Position the editor and set the size... + const textShape = topic.getTextShape(); - let { top, left } = textShape.getNativePosition(); - // Adjust padding top position ... - top -= 4; - left -= 4; - this._containerElem.offset({ top, left }); + this._containerElem.css('display', 'block'); - // Set editor's initial text ... - const text = $defined(defaultText) ? defaultText : topic.getText(); - this._setText(text); + let { top, left } = textShape.getNativePosition(); + // Adjust padding top position ... + top -= 4; + left -= 4; + this._containerElem.offset({ top, left }); - // Set the element focus and select the current text ... - const inputElem = this._getTextareaElem(); - if (inputElem) { - this._positionCursor(inputElem, !$defined(defaultText)); - } + // Set editor's initial text ... + const text = topic.getText() || defaultText; + this._setText(text); + + // Set the element focus and select the current text ... + const inputElem = this._getTextareaElem(); + if (inputElem) { + this._positionCursor(inputElem, !$defined(defaultText)); } } - private _setStyle(fontStyle) { + private _setStyle(fontStyle: { + fontFamily: string; + style: string; + weight: string; + size: number; + color: string; + }) { const inputField = this._getTextareaElem(); // allowed param reassign to avoid risks of existing code relying in this side-effect /* eslint-disable no-param-reassign */ @@ -227,22 +213,22 @@ class MultilineTextEditor extends Events { fontWeight: fontStyle.weight, color: fontStyle.color, }; - inputField?.css(style); - this._containerElem?.css(style); + inputField.css(style); + this._containerElem.css(style); } private _setText(text: string): void { const textareaElem = this._getTextareaElem(); - textareaElem?.val(text); + textareaElem.val(text); this._adjustEditorSize(); } private _getTextAreaText(): string { - return this._getTextareaElem()?.val() as string; + return this._getTextareaElem().val() as string; } - private _getTextareaElem(): JQuery | null { - return this._containerElem ? this._containerElem.find('textarea') : null; + private _getTextareaElem(): JQuery { + return this._containerElem.find('textarea'); } private _positionCursor(textareaElem: JQuery, selectText: boolean) { @@ -257,20 +243,47 @@ class MultilineTextEditor extends Events { } close(update: boolean): void { - if (this.isVisible()) { - if (update) { - this._updateModel(); - } - - // Remove it form the screen ... - this._containerElem?.remove(); - this._containerElem = null; + if (update) { + this._updateModel(); } + // Remove it form the screen ... + this._containerElem.remove(); - if (this._topic) { - this._topic.getTextShape().setVisibility(true); - this._topic = null; + // Restore topoc share visibility ... + this._topic.getTextShape().setVisibility(true); + } +} + +class MultitTextEditor { + // eslint-disable-next-line no-use-before-define + private static instance: MultitTextEditor = new MultitTextEditor(); + + private component: EditorComponent | null; + + static getInstance(): MultitTextEditor { + return MultitTextEditor.instance; + } + + isActive(): boolean { + return this.component !== null; + } + + show(topic: Topic, defaultText: string): void { + // Is it active ? + if (this.component) { + console.error('Editor was already displayed. Please, clouse it'); + this.component.close(false); + } + // Create a new instance + this.component = new EditorComponent(topic); + this.component.show(defaultText); + } + + close(update: boolean): void { + if (this.component) { + this.component.close(update); + this.component = null; } } } -export default MultilineTextEditor; +export default MultitTextEditor; diff --git a/packages/mindplot/src/components/TopicEventDispatcher.ts b/packages/mindplot/src/components/TopicEventDispatcher.ts index 2ba2c826..4266a7d4 100644 --- a/packages/mindplot/src/components/TopicEventDispatcher.ts +++ b/packages/mindplot/src/components/TopicEventDispatcher.ts @@ -17,9 +17,9 @@ */ import { $assert } from '@wisemapping/core-js'; import Events from './Events'; -import MultilineTextEditor from './MultilineTextEditor'; import { TopicShape } from './model/INodeModel'; import Topic from './Topic'; +import MultitTextEditor from './MultilineTextEditor'; const TopicEvent = { EDIT: 'editnode', @@ -29,24 +29,18 @@ const TopicEvent = { class TopicEventDispatcher extends Events { private _readOnly: boolean; - private _activeEditor: MultilineTextEditor; - - private _multilineEditor: MultilineTextEditor; - // eslint-disable-next-line no-use-before-define static _instance: TopicEventDispatcher; constructor(readOnly: boolean) { super(); this._readOnly = readOnly; - this._activeEditor = null; - this._multilineEditor = new MultilineTextEditor(); } close(update: boolean): void { - if (this.isVisible()) { - this._activeEditor.close(update); - this._activeEditor = null; + const editor = MultitTextEditor.getInstance(); + if (editor.isActive()) { + editor.close(update); } } @@ -58,7 +52,8 @@ class TopicEventDispatcher extends Events { $assert(eventType, 'eventType can not be null'); // Close all previous open editor .... - if (this.isVisible()) { + const editor = MultitTextEditor.getInstance(); + if (editor.isActive()) { this.close(false); } @@ -69,15 +64,14 @@ class TopicEventDispatcher extends Events { !this._readOnly && eventType === TopicEvent.EDIT ) { - this._multilineEditor.show(topic, options ? options.text : null); - this._activeEditor = this._multilineEditor; + editor.show(topic, options ? options.text : ''); } else { this.fireEvent(eventType, { model, readOnly: this._readOnly }); } } isVisible(): boolean { - return this._activeEditor != null && this._activeEditor.isVisible(); + return MultitTextEditor.getInstance().isActive(); } static configure(readOnly: boolean): void { From 5dffa99835201bb28d58145036a3755be35a4a41 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 24 Nov 2022 10:40:18 -0800 Subject: [PATCH 45/55] Clean up code. --- packages/mindplot/.eslintrc.json | 4 +-- packages/mindplot/src/@types/custom.d.ts | 1 + .../mindplot/src/components/ControlPoint.ts | 24 +++++++++----- .../mindplot/src/components/EmojiCharIcon.ts | 2 +- packages/mindplot/src/components/IconGroup.ts | 2 +- packages/mindplot/src/components/Workspace.ts | 4 +-- .../commands/AddFeatureToTopicCommand.ts | 4 +-- .../components/commands/AddTopicCommand.ts | 2 +- .../commands/MoveControlPointCommand.ts | 4 +-- .../src/components/export/SVGExporter.ts | 33 ++++++++++--------- .../src/components/import/FreemindImporter.ts | 6 ++-- .../layout/ChildrenSorterStrategy.ts | 7 +++- .../mindplot/src/components/layout/Node.ts | 2 +- .../src/components/layout/RootedTreeSet.ts | 16 ++++----- .../mindplot/src/components/model/IMindmap.ts | 2 +- .../src/components/model/INodeModel.ts | 2 +- .../persistence/XMLSerializerFactory.ts | 5 +-- packages/mindplot/src/index.ts | 1 + 18 files changed, 69 insertions(+), 52 deletions(-) diff --git a/packages/mindplot/.eslintrc.json b/packages/mindplot/.eslintrc.json index 3fae3a03..b9606180 100644 --- a/packages/mindplot/.eslintrc.json +++ b/packages/mindplot/.eslintrc.json @@ -39,9 +39,11 @@ } ], "object-curly-newline": "off", + "@typescript-eslint/no-unused-vars": "error", "no-underscore-dangle": "off", "no-plusplus": "off", "no-param-reassign": "off", + "@typescript-eslint/no-non-null-assertion": "off", "max-len": [ 1, 300 @@ -50,8 +52,6 @@ "no-console": "off", // codebase contains many this aliases, fix in the future? "@typescript-eslint/no-this-alias": "off", - // Remove once migration is completed ... - "@typescript-eslint/no-explicit-any": "warn", "import/extensions": [ "error", "ignorePackages", diff --git a/packages/mindplot/src/@types/custom.d.ts b/packages/mindplot/src/@types/custom.d.ts index 2ff57beb..957d9d84 100644 --- a/packages/mindplot/src/@types/custom.d.ts +++ b/packages/mindplot/src/@types/custom.d.ts @@ -1,4 +1,5 @@ declare module '*.svg' { + // eslint-disable-next-line @typescript-eslint/no-explicit-any const content: any; export default content; } diff --git a/packages/mindplot/src/components/ControlPoint.ts b/packages/mindplot/src/components/ControlPoint.ts index b9aab58b..1b2fada2 100644 --- a/packages/mindplot/src/components/ControlPoint.ts +++ b/packages/mindplot/src/components/ControlPoint.ts @@ -21,6 +21,7 @@ import { $defined } from '@wisemapping/core-js'; import Shape from './util/Shape'; import ActionDispatcher from './ActionDispatcher'; import Workspace from './Workspace'; +import PositionType from './PositionType'; class ControlPoint { private control1: Elipse; @@ -37,11 +38,13 @@ class ControlPoint { private _workspace: Workspace; - private _endPoint: any[]; + // eslint-disable-next-line no-use-before-define + private _endPoint: PositionType[]; - private _orignalCtrlPoint: any; + // eslint-disable-next-line no-use-before-define + private _orignalCtrlPoint: PositionType[]; - private _controls: any; + private _controls: number; private _mouseMoveFunction: (e: Event) => void; @@ -125,17 +128,20 @@ class ControlPoint { this._controls[ControlPoint.FROM].x + pos.x, this._controls[ControlPoint.FROM].y + pos.y - 3, ); + this._controlLines[0].setFrom(pos.x, pos.y); this._controlLines[0].setTo( this._controls[ControlPoint.FROM].x + pos.x + 3, this._controls[ControlPoint.FROM].y + pos.y, ); + pos = this._line.getLine().getTo(); this._controlLines[1].setFrom(pos.x, pos.y); this._controlLines[1].setTo( this._controls[ControlPoint.TO].x + pos.x + 3, this._controls[ControlPoint.TO].y + pos.y, ); + this._controlPointsController[1].setPosition( this._controls[ControlPoint.TO].x + pos.x, this._controls[ControlPoint.TO].y + pos.y - 3, @@ -223,8 +229,8 @@ class ControlPoint { workspace.append(this._controlLines[1]); } - removeFromWorkspace(workspace: Workspace) { - this._workspace = null; + removeFromWorkspace(workspace: Workspace): void { + this._workspace!; workspace.removeChild(this._controlPointsController[0]); workspace.removeChild(this._controlPointsController[1]); workspace.removeChild(this._controlLines[0]); @@ -235,17 +241,17 @@ class ControlPoint { return this._controls[index]; } - getOriginalEndPoint(index: number) { + getOriginalEndPoint(index: number): PositionType { return this._endPoint[index]; } - getOriginalCtrlPoint(index: number): ControlPoint { + getOriginalCtrlPoint(index: number): PositionType { return this._orignalCtrlPoint[index]; } - static FROM = 0; + private static FROM = 0; - static TO = 1; + private static TO = 1; } export default ControlPoint; diff --git a/packages/mindplot/src/components/EmojiCharIcon.ts b/packages/mindplot/src/components/EmojiCharIcon.ts index 990c4a16..801a2f7d 100644 --- a/packages/mindplot/src/components/EmojiCharIcon.ts +++ b/packages/mindplot/src/components/EmojiCharIcon.ts @@ -81,7 +81,7 @@ class EmojiCharIcon implements Icon { return this.group.getPosition(); } - addEvent(type: string, fnc: any): void { + addEvent(type: string, fnc: () => void): void { this.element.addEvent(type, fnc); } diff --git a/packages/mindplot/src/components/IconGroup.ts b/packages/mindplot/src/components/IconGroup.ts index 6a2efc6d..7a247c89 100644 --- a/packages/mindplot/src/components/IconGroup.ts +++ b/packages/mindplot/src/components/IconGroup.ts @@ -31,7 +31,7 @@ ORDER_BY_TYPE.set('link', 2); class IconGroup { private _icons: ImageIcon[]; - private _group: any; + private _group: Group; private _removeTip: IconGroupRemoveTip; diff --git a/packages/mindplot/src/components/Workspace.ts b/packages/mindplot/src/components/Workspace.ts index b4b7c29c..2bb48914 100644 --- a/packages/mindplot/src/components/Workspace.ts +++ b/packages/mindplot/src/components/Workspace.ts @@ -182,8 +182,8 @@ class Workspace { const workspace = this._workspace; const divContainer = this._screenManager.getContainer(); - const containerWidth = divContainer.width(); - const containerHeight = divContainer.height(); + const containerWidth = divContainer.width()!; + const containerHeight = divContainer.height()!; const newVisibleAreaSize = { width: containerWidth, height: containerHeight }; // - svg must fit container size diff --git a/packages/mindplot/src/components/commands/AddFeatureToTopicCommand.ts b/packages/mindplot/src/components/commands/AddFeatureToTopicCommand.ts index 8aea8d7b..245351d1 100644 --- a/packages/mindplot/src/components/commands/AddFeatureToTopicCommand.ts +++ b/packages/mindplot/src/components/commands/AddFeatureToTopicCommand.ts @@ -28,7 +28,7 @@ class AddFeatureToTopicCommand extends Command { private _attributes: object; - private _featureModel: FeatureModel; + private _featureModel: FeatureModel | null; /* * @classdesc This command class handles do/undo of adding features to topics, e.g. an @@ -65,7 +65,7 @@ class AddFeatureToTopicCommand extends Command { undoExecute(commandContext: CommandContext) { const topic = commandContext.findTopics([this._topicId])[0]; - topic.removeFeature(this._featureModel); + topic.removeFeature(this._featureModel!); } } diff --git a/packages/mindplot/src/components/commands/AddTopicCommand.ts b/packages/mindplot/src/components/commands/AddTopicCommand.ts index 0e405a09..faf39c44 100644 --- a/packages/mindplot/src/components/commands/AddTopicCommand.ts +++ b/packages/mindplot/src/components/commands/AddTopicCommand.ts @@ -70,7 +70,7 @@ class AddTopicCommand extends Command { undoExecute(commandContext: CommandContext) { // Delete disconnected the nodes. Create a copy of the topics ... - const clonedModel = []; + const clonedModel: NodeModel[] = []; this._models.forEach((model) => { clonedModel.push(model.clone()); }); diff --git a/packages/mindplot/src/components/commands/MoveControlPointCommand.ts b/packages/mindplot/src/components/commands/MoveControlPointCommand.ts index 33523cf9..7529afa6 100644 --- a/packages/mindplot/src/components/commands/MoveControlPointCommand.ts +++ b/packages/mindplot/src/components/commands/MoveControlPointCommand.ts @@ -34,7 +34,7 @@ class MoveControlPointCommand extends Command { private _wasCustom: boolean; - private _endPoint: any; + private _endPoint: PositionType; private _point: number; @@ -52,7 +52,7 @@ class MoveControlPointCommand extends Command { this._ctrlPointControler = ctrlPointController; this._line = ctrlPointController._line; this._controlPoint = { ...this._ctrlPointControler.getControlPoint(point) }; - this._oldControlPoint = { ...this._ctrlPointControler.getOriginalCtrlPoint(point) }; + this._oldControlPoint = this._ctrlPointControler.getOriginalCtrlPoint(point); this._originalEndPoint = this._ctrlPointControler.getOriginalEndPoint(point); switch (point) { case 0: diff --git a/packages/mindplot/src/components/export/SVGExporter.ts b/packages/mindplot/src/components/export/SVGExporter.ts index f72de06c..4f12a756 100644 --- a/packages/mindplot/src/components/export/SVGExporter.ts +++ b/packages/mindplot/src/components/export/SVGExporter.ts @@ -66,25 +66,28 @@ class SVGExporter extends Exporter { private _calcualteDimensions(): { minX: number; maxX: number; minY: number; maxY: number } { // Collect all group elements ... const rectElems = Array.from(this.svgElement.querySelectorAll('g>rect')); + let result: SizeType = { width: 0, height: 0 }; const translates: SizeType[] = rectElems.map((rect: Element) => { const g = rect.parentElement; - const transformStr = g.getAttribute('transform'); + const transformStr = g?.getAttribute('transform'); + if (transformStr) { + // Looking to parse translate(220.00000,279.00000) scale(1.00000,1.00000) + const match = transformStr.match(SVGExporter.regexpTranslate); + if (match !== null) { + result = { width: Number.parseFloat(match[1]), height: Number.parseFloat(match[2]) }; - // Looking to parse translate(220.00000,279.00000) scale(1.00000,1.00000) - const match = transformStr.match(SVGExporter.regexpTranslate); - let result: SizeType = { width: 0, height: 0 }; - if (match !== null) { - result = { width: Number.parseFloat(match[1]), height: Number.parseFloat(match[2]) }; + // Add rect size ... + const width = rect.getAttribute('width'); + if (result.width > 0 && width) { + const rectWidth = Number.parseFloat(width); + result.width += rectWidth; + } - // Add rect size ... - if (result.width > 0) { - const rectWidth = Number.parseFloat(rect.getAttribute('width')); - result.width += rectWidth; - } - - if (result.height > 0) { - const rectHeight = Number.parseFloat(rect.getAttribute('height')); - result.height += rectHeight; + const height = rect.getAttribute('height'); + if (result.height > 0 && height) { + const rectHeight = Number.parseFloat(height); + result.height += rectHeight; + } } } return result; diff --git a/packages/mindplot/src/components/import/FreemindImporter.ts b/packages/mindplot/src/components/import/FreemindImporter.ts index 50aa621a..999920fc 100644 --- a/packages/mindplot/src/components/import/FreemindImporter.ts +++ b/packages/mindplot/src/components/import/FreemindImporter.ts @@ -169,7 +169,7 @@ export default class FreemindImporter extends Importer { } // Check for style... - const fontStyle = this.generateFontStyle(freeNode, null); + const fontStyle = this.generateFontStyle(freeNode); if (fontStyle && fontStyle !== ';;;;') wiseTopic.setFontStyle(fontStyle); // Is there any link... @@ -393,7 +393,7 @@ export default class FreemindImporter extends Importer { return result; } - private generateFontStyle(node: FreemindNode, font: FreemindFont | undefined): string { + private generateFontStyle(node: FreemindNode, font?: FreemindFont): string { const fontStyle: Array = []; // Font family @@ -485,6 +485,6 @@ export default class FreemindImporter extends Importer { private html2Text(content: string): string { const temporalDivElement = document.createElement('div'); temporalDivElement.innerHTML = content; - return temporalDivElement.textContent.trim() || temporalDivElement.innerText.trim() || ''; + return temporalDivElement.textContent?.trim() || temporalDivElement.innerText.trim() || ''; } } diff --git a/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts b/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts index e07fd91c..ed701823 100644 --- a/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts +++ b/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts @@ -28,7 +28,12 @@ abstract class ChildrenSorterStrategy { abstract detach(treeSet: RootedTreeSet, node: Node): void; - abstract predict(treeSet: RootedTreeSet, parent, node: Node | null, position: PositionType); + abstract predict( + treeSet: RootedTreeSet, + parent: Node, + node: Node | null, + position: PositionType | null, + ); abstract verify(treeSet: RootedTreeSet, node: Node); diff --git a/packages/mindplot/src/components/layout/Node.ts b/packages/mindplot/src/components/layout/Node.ts index 7eb364cd..da366b51 100644 --- a/packages/mindplot/src/components/layout/Node.ts +++ b/packages/mindplot/src/components/layout/Node.ts @@ -24,7 +24,7 @@ class Node { private _id: number; // eslint-disable-next-line no-use-before-define - _parent: Node; + _parent: Node | null; private _sorter: ChildrenSorterStrategy; diff --git a/packages/mindplot/src/components/layout/RootedTreeSet.ts b/packages/mindplot/src/components/layout/RootedTreeSet.ts index efc7c3fb..c8f061c5 100644 --- a/packages/mindplot/src/components/layout/RootedTreeSet.ts +++ b/packages/mindplot/src/components/layout/RootedTreeSet.ts @@ -89,7 +89,7 @@ class RootedTreeSet { * @throws will throw an error if nodeId is null or undefined * @throws will throw an error if node is not connected */ - disconnect(nodeId: number) { + disconnect(nodeId: number): void { $assert($defined(nodeId), 'nodeId can not be null'); const node = this.find(nodeId); $assert(node._parent, 'Node is not connected'); @@ -106,11 +106,11 @@ class RootedTreeSet { * @throws will throw an error if node cannot be found * @return node */ - find(id: number, validate = true): Node { + find(id: number, validate = true): Node | null { $assert($defined(id), 'id can not be null'); const graphs = this._rootNodes; - let result = null; + let result: Node | null = null; for (let i = 0; i < graphs.length; i++) { const node = graphs[i]; result = this._find(id, node); @@ -126,12 +126,12 @@ class RootedTreeSet { return result; } - private _find(id: number, parent: Node): Node { + private _find(id: number, parent: Node): Node | null { if (parent.getId() === id) { return parent; } - let result = null; + let result: Node | null = null; const children = parent._children; for (let i = 0; i < children.length; i++) { const child = children[i]; @@ -192,10 +192,10 @@ class RootedTreeSet { */ getSiblings(node: Node): Node[] { $assert(node, 'node cannot be null'); - if (!$defined(node._parent)) { + if (!node._parent) { return []; } - const siblings = node._parent._children.filter((child) => child !== node); + const siblings = node._parent?._children.filter((child) => child !== node); return siblings; } @@ -241,7 +241,7 @@ class RootedTreeSet { * @throws will throw an error if node is null or undefined * @return parent */ - getParent(node: Node): Node { + getParent(node: Node): Node | null { $assert(node, 'node cannot be null'); return node._parent; } diff --git a/packages/mindplot/src/components/model/IMindmap.ts b/packages/mindplot/src/components/model/IMindmap.ts index 95a15e59..c36569ea 100644 --- a/packages/mindplot/src/components/model/IMindmap.ts +++ b/packages/mindplot/src/components/model/IMindmap.ts @@ -67,7 +67,7 @@ abstract class IMindmap { $assert(child, 'Child can not be null.'); $assert(parent, 'Child model seems to be already connected'); - parent.removeChild(child); + parent?.removeChild(child); this.addBranch(child); } diff --git a/packages/mindplot/src/components/model/INodeModel.ts b/packages/mindplot/src/components/model/INodeModel.ts index 44c7b405..1f8f9249 100644 --- a/packages/mindplot/src/components/model/INodeModel.ts +++ b/packages/mindplot/src/components/model/INodeModel.ts @@ -46,7 +46,7 @@ abstract class INodeModel { abstract getFeatures(): FeatureModel[]; setId(id?: number): void { - if (!$defined(id)) { + if (id === null || id === undefined) { const newId = INodeModel._nextUUID(); this.putProperty('id', newId); } else { diff --git a/packages/mindplot/src/components/persistence/XMLSerializerFactory.ts b/packages/mindplot/src/components/persistence/XMLSerializerFactory.ts index a6c43b55..5e6b8b84 100644 --- a/packages/mindplot/src/components/persistence/XMLSerializerFactory.ts +++ b/packages/mindplot/src/components/persistence/XMLSerializerFactory.ts @@ -15,7 +15,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { $assert } from '@wisemapping/core-js'; import ModelCodeName from './ModelCodeName'; import Beta2PelaMigrator from './Beta2PelaMigrator'; import Pela2TangoMigrator from './Pela2TangoMigrator'; @@ -89,7 +88,9 @@ class XMLSerializerFactory { result = new migrator(result); } } - $assert(result, `Cound not find serialized for ${version}`); + if (!result) { + throw new Error(`Cound not find serialized for ${version}`); + } return result; } } diff --git a/packages/mindplot/src/index.ts b/packages/mindplot/src/index.ts index a7454486..3ccf87af 100644 --- a/packages/mindplot/src/index.ts +++ b/packages/mindplot/src/index.ts @@ -58,6 +58,7 @@ declare global { var designer: Designer; } +// eslint-disable-next-line @typescript-eslint/no-explicit-any const globalAny: any = global; globalAny.jQuery = jquery; // WebComponent registration From bd9b73048aea522d66a50ba7ff5c693268df2765 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 24 Nov 2022 11:01:49 -0800 Subject: [PATCH 46/55] Improve control point code. --- .../mindplot/src/components/ControlPoint.ts | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/packages/mindplot/src/components/ControlPoint.ts b/packages/mindplot/src/components/ControlPoint.ts index 1b2fada2..828eef83 100644 --- a/packages/mindplot/src/components/ControlPoint.ts +++ b/packages/mindplot/src/components/ControlPoint.ts @@ -38,13 +38,11 @@ class ControlPoint { private _workspace: Workspace; - // eslint-disable-next-line no-use-before-define private _endPoint: PositionType[]; - // eslint-disable-next-line no-use-before-define private _orignalCtrlPoint: PositionType[]; - private _controls: number; + private _controls: PositionType[]; private _mouseMoveFunction: (e: Event) => void; @@ -76,25 +74,24 @@ class ControlPoint { ]; this._isBinded = false; - const me = this; - this._controlPointsController[0].addEvent('mousedown', (event) => { - me._mouseDown(event, ControlPoint.FROM, me); + this._controlPointsController[0].addEvent('mousedown', (event: MouseEvent) => { + this._mouseDown(event, ControlPoint.FROM); }); - this._controlPointsController[0].addEvent('click', (event) => { - me._mouseClick(event); + this._controlPointsController[0].addEvent('click', (event: MouseEvent) => { + this._mouseClick(event); }); - this._controlPointsController[0].addEvent('dblclick', (event) => { - me._mouseClick(event); + this._controlPointsController[0].addEvent('dblclick', (event: MouseEvent) => { + this._mouseClick(event); }); - this._controlPointsController[1].addEvent('mousedown', (event) => { - me._mouseDown(event, ControlPoint.TO, me); + this._controlPointsController[1].addEvent('mousedown', (event: MouseEvent) => { + this._mouseDown(event, ControlPoint.TO); }); - this._controlPointsController[1].addEvent('click', (event) => { - me._mouseClick(event); + this._controlPointsController[1].addEvent('click', (event: MouseEvent) => { + this._mouseClick(event); }); - this._controlPointsController[1].addEvent('dblclick', (event) => { - me._mouseClick(event); + this._controlPointsController[1].addEvent('dblclick', (event: MouseEvent) => { + this._mouseClick(event); }); } @@ -106,10 +103,11 @@ class ControlPoint { this._createControlPoint(); this._endPoint = []; this._orignalCtrlPoint = []; - this._orignalCtrlPoint[0] = { ...this._controls[0] }; - this._orignalCtrlPoint[1] = { ...this._controls[1] }; - this._endPoint[0] = { ...this._line.getLine().getFrom() }; - this._endPoint[1] = { ...this._line.getLine().getTo() }; + + [this._orignalCtrlPoint[0], this._orignalCtrlPoint[1]] = this._controls; + + this._endPoint[0] = this._line.getLine().getFrom() as PositionType; + this._endPoint[1] = this._line.getLine().getTo() as PositionType; } setControlPointTestId(ctrlPoint1, ctrlPoint2) { @@ -118,7 +116,9 @@ class ControlPoint { } redraw() { - if ($defined(this._line)) this._createControlPoint(); + if (this._line) { + this._createControlPoint(); + } } private _createControlPoint() { @@ -152,16 +152,16 @@ class ControlPoint { // Overwrite default behaviour ... } - private _mouseDown(event: Event, point, me) { + private _mouseDown(event: MouseEvent, point: number) { if (!this._isBinded) { this._isBinded = true; - this._mouseMoveFunction = (e) => { - me._mouseMoveEvent(e, point, me); + this._mouseMoveFunction = (e: MouseEvent) => { + this._mouseMoveEvent(e, point); }; this._workspace.getScreenManager().addEvent('mousemove', this._mouseMoveFunction); - this._mouseUpFunction = (e: Event) => { - me._mouseUp(e, point, me); + this._mouseUpFunction = (e: MouseEvent) => { + this._mouseUp(e, point); }; this._workspace.getScreenManager().addEvent('mouseup', this._mouseUpFunction); } @@ -170,7 +170,7 @@ class ControlPoint { return false; } - private _mouseMoveEvent(event: MouseEvent, point: Point) { + private _mouseMoveEvent(event: MouseEvent, point: number) { const screen = this._workspace.getScreenManager(); const pos = screen.getWorkspaceMousePosition(event); @@ -202,7 +202,7 @@ class ControlPoint { this._isBinded = false; } - _mouseClick(event: MouseEvent) { + private _mouseClick(event: MouseEvent) { event.preventDefault(); event.stopPropagation(); return false; @@ -237,7 +237,7 @@ class ControlPoint { workspace.removeChild(this._controlLines[1]); } - getControlPoint(index: number): ControlPoint { + getControlPoint(index: number): PositionType { return this._controls[index]; } From bd25cec1390a48118e81e47ee2ca83da96ff8060 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 24 Nov 2022 15:35:39 -0800 Subject: [PATCH 47/55] Remoeve icon. --- packages/mindplot/.eslintrc.json | 4 +- packages/mindplot/src/@types/custom.d.ts | 1 - .../mindplot/src/components/ControlPoint.ts | 76 +++++++++---------- .../mindplot/src/components/EmojiCharIcon.ts | 2 +- packages/mindplot/src/components/IconGroup.ts | 2 +- packages/mindplot/src/components/Workspace.ts | 4 +- .../commands/AddFeatureToTopicCommand.ts | 4 +- .../components/commands/AddTopicCommand.ts | 2 +- .../commands/MoveControlPointCommand.ts | 4 +- .../src/components/export/SVGExporter.ts | 33 ++++---- .../src/components/import/FreemindImporter.ts | 6 +- .../layout/ChildrenSorterStrategy.ts | 7 +- .../mindplot/src/components/layout/Node.ts | 2 +- .../src/components/layout/RootedTreeSet.ts | 16 ++-- .../mindplot/src/components/model/IMindmap.ts | 2 +- .../src/components/model/INodeModel.ts | 2 +- .../src/components/model/SvgIconFamily.json | 1 - .../persistence/XMLSerializerFactory.ts | 5 +- packages/mindplot/src/index.ts | 1 - 19 files changed, 78 insertions(+), 96 deletions(-) diff --git a/packages/mindplot/.eslintrc.json b/packages/mindplot/.eslintrc.json index b9606180..3fae3a03 100644 --- a/packages/mindplot/.eslintrc.json +++ b/packages/mindplot/.eslintrc.json @@ -39,11 +39,9 @@ } ], "object-curly-newline": "off", - "@typescript-eslint/no-unused-vars": "error", "no-underscore-dangle": "off", "no-plusplus": "off", "no-param-reassign": "off", - "@typescript-eslint/no-non-null-assertion": "off", "max-len": [ 1, 300 @@ -52,6 +50,8 @@ "no-console": "off", // codebase contains many this aliases, fix in the future? "@typescript-eslint/no-this-alias": "off", + // Remove once migration is completed ... + "@typescript-eslint/no-explicit-any": "warn", "import/extensions": [ "error", "ignorePackages", diff --git a/packages/mindplot/src/@types/custom.d.ts b/packages/mindplot/src/@types/custom.d.ts index 957d9d84..2ff57beb 100644 --- a/packages/mindplot/src/@types/custom.d.ts +++ b/packages/mindplot/src/@types/custom.d.ts @@ -1,5 +1,4 @@ declare module '*.svg' { - // eslint-disable-next-line @typescript-eslint/no-explicit-any const content: any; export default content; } diff --git a/packages/mindplot/src/components/ControlPoint.ts b/packages/mindplot/src/components/ControlPoint.ts index 828eef83..b9aab58b 100644 --- a/packages/mindplot/src/components/ControlPoint.ts +++ b/packages/mindplot/src/components/ControlPoint.ts @@ -21,7 +21,6 @@ import { $defined } from '@wisemapping/core-js'; import Shape from './util/Shape'; import ActionDispatcher from './ActionDispatcher'; import Workspace from './Workspace'; -import PositionType from './PositionType'; class ControlPoint { private control1: Elipse; @@ -38,11 +37,11 @@ class ControlPoint { private _workspace: Workspace; - private _endPoint: PositionType[]; + private _endPoint: any[]; - private _orignalCtrlPoint: PositionType[]; + private _orignalCtrlPoint: any; - private _controls: PositionType[]; + private _controls: any; private _mouseMoveFunction: (e: Event) => void; @@ -74,24 +73,25 @@ class ControlPoint { ]; this._isBinded = false; - this._controlPointsController[0].addEvent('mousedown', (event: MouseEvent) => { - this._mouseDown(event, ControlPoint.FROM); + const me = this; + this._controlPointsController[0].addEvent('mousedown', (event) => { + me._mouseDown(event, ControlPoint.FROM, me); }); - this._controlPointsController[0].addEvent('click', (event: MouseEvent) => { - this._mouseClick(event); + this._controlPointsController[0].addEvent('click', (event) => { + me._mouseClick(event); }); - this._controlPointsController[0].addEvent('dblclick', (event: MouseEvent) => { - this._mouseClick(event); + this._controlPointsController[0].addEvent('dblclick', (event) => { + me._mouseClick(event); }); - this._controlPointsController[1].addEvent('mousedown', (event: MouseEvent) => { - this._mouseDown(event, ControlPoint.TO); + this._controlPointsController[1].addEvent('mousedown', (event) => { + me._mouseDown(event, ControlPoint.TO, me); }); - this._controlPointsController[1].addEvent('click', (event: MouseEvent) => { - this._mouseClick(event); + this._controlPointsController[1].addEvent('click', (event) => { + me._mouseClick(event); }); - this._controlPointsController[1].addEvent('dblclick', (event: MouseEvent) => { - this._mouseClick(event); + this._controlPointsController[1].addEvent('dblclick', (event) => { + me._mouseClick(event); }); } @@ -103,11 +103,10 @@ class ControlPoint { this._createControlPoint(); this._endPoint = []; this._orignalCtrlPoint = []; - - [this._orignalCtrlPoint[0], this._orignalCtrlPoint[1]] = this._controls; - - this._endPoint[0] = this._line.getLine().getFrom() as PositionType; - this._endPoint[1] = this._line.getLine().getTo() as PositionType; + this._orignalCtrlPoint[0] = { ...this._controls[0] }; + this._orignalCtrlPoint[1] = { ...this._controls[1] }; + this._endPoint[0] = { ...this._line.getLine().getFrom() }; + this._endPoint[1] = { ...this._line.getLine().getTo() }; } setControlPointTestId(ctrlPoint1, ctrlPoint2) { @@ -116,9 +115,7 @@ class ControlPoint { } redraw() { - if (this._line) { - this._createControlPoint(); - } + if ($defined(this._line)) this._createControlPoint(); } private _createControlPoint() { @@ -128,20 +125,17 @@ class ControlPoint { this._controls[ControlPoint.FROM].x + pos.x, this._controls[ControlPoint.FROM].y + pos.y - 3, ); - this._controlLines[0].setFrom(pos.x, pos.y); this._controlLines[0].setTo( this._controls[ControlPoint.FROM].x + pos.x + 3, this._controls[ControlPoint.FROM].y + pos.y, ); - pos = this._line.getLine().getTo(); this._controlLines[1].setFrom(pos.x, pos.y); this._controlLines[1].setTo( this._controls[ControlPoint.TO].x + pos.x + 3, this._controls[ControlPoint.TO].y + pos.y, ); - this._controlPointsController[1].setPosition( this._controls[ControlPoint.TO].x + pos.x, this._controls[ControlPoint.TO].y + pos.y - 3, @@ -152,16 +146,16 @@ class ControlPoint { // Overwrite default behaviour ... } - private _mouseDown(event: MouseEvent, point: number) { + private _mouseDown(event: Event, point, me) { if (!this._isBinded) { this._isBinded = true; - this._mouseMoveFunction = (e: MouseEvent) => { - this._mouseMoveEvent(e, point); + this._mouseMoveFunction = (e) => { + me._mouseMoveEvent(e, point, me); }; this._workspace.getScreenManager().addEvent('mousemove', this._mouseMoveFunction); - this._mouseUpFunction = (e: MouseEvent) => { - this._mouseUp(e, point); + this._mouseUpFunction = (e: Event) => { + me._mouseUp(e, point, me); }; this._workspace.getScreenManager().addEvent('mouseup', this._mouseUpFunction); } @@ -170,7 +164,7 @@ class ControlPoint { return false; } - private _mouseMoveEvent(event: MouseEvent, point: number) { + private _mouseMoveEvent(event: MouseEvent, point: Point) { const screen = this._workspace.getScreenManager(); const pos = screen.getWorkspaceMousePosition(event); @@ -202,7 +196,7 @@ class ControlPoint { this._isBinded = false; } - private _mouseClick(event: MouseEvent) { + _mouseClick(event: MouseEvent) { event.preventDefault(); event.stopPropagation(); return false; @@ -229,29 +223,29 @@ class ControlPoint { workspace.append(this._controlLines[1]); } - removeFromWorkspace(workspace: Workspace): void { - this._workspace!; + removeFromWorkspace(workspace: Workspace) { + this._workspace = null; workspace.removeChild(this._controlPointsController[0]); workspace.removeChild(this._controlPointsController[1]); workspace.removeChild(this._controlLines[0]); workspace.removeChild(this._controlLines[1]); } - getControlPoint(index: number): PositionType { + getControlPoint(index: number): ControlPoint { return this._controls[index]; } - getOriginalEndPoint(index: number): PositionType { + getOriginalEndPoint(index: number) { return this._endPoint[index]; } - getOriginalCtrlPoint(index: number): PositionType { + getOriginalCtrlPoint(index: number): ControlPoint { return this._orignalCtrlPoint[index]; } - private static FROM = 0; + static FROM = 0; - private static TO = 1; + static TO = 1; } export default ControlPoint; diff --git a/packages/mindplot/src/components/EmojiCharIcon.ts b/packages/mindplot/src/components/EmojiCharIcon.ts index 801a2f7d..990c4a16 100644 --- a/packages/mindplot/src/components/EmojiCharIcon.ts +++ b/packages/mindplot/src/components/EmojiCharIcon.ts @@ -81,7 +81,7 @@ class EmojiCharIcon implements Icon { return this.group.getPosition(); } - addEvent(type: string, fnc: () => void): void { + addEvent(type: string, fnc: any): void { this.element.addEvent(type, fnc); } diff --git a/packages/mindplot/src/components/IconGroup.ts b/packages/mindplot/src/components/IconGroup.ts index 7a247c89..6a2efc6d 100644 --- a/packages/mindplot/src/components/IconGroup.ts +++ b/packages/mindplot/src/components/IconGroup.ts @@ -31,7 +31,7 @@ ORDER_BY_TYPE.set('link', 2); class IconGroup { private _icons: ImageIcon[]; - private _group: Group; + private _group: any; private _removeTip: IconGroupRemoveTip; diff --git a/packages/mindplot/src/components/Workspace.ts b/packages/mindplot/src/components/Workspace.ts index 2bb48914..b4b7c29c 100644 --- a/packages/mindplot/src/components/Workspace.ts +++ b/packages/mindplot/src/components/Workspace.ts @@ -182,8 +182,8 @@ class Workspace { const workspace = this._workspace; const divContainer = this._screenManager.getContainer(); - const containerWidth = divContainer.width()!; - const containerHeight = divContainer.height()!; + const containerWidth = divContainer.width(); + const containerHeight = divContainer.height(); const newVisibleAreaSize = { width: containerWidth, height: containerHeight }; // - svg must fit container size diff --git a/packages/mindplot/src/components/commands/AddFeatureToTopicCommand.ts b/packages/mindplot/src/components/commands/AddFeatureToTopicCommand.ts index 245351d1..8aea8d7b 100644 --- a/packages/mindplot/src/components/commands/AddFeatureToTopicCommand.ts +++ b/packages/mindplot/src/components/commands/AddFeatureToTopicCommand.ts @@ -28,7 +28,7 @@ class AddFeatureToTopicCommand extends Command { private _attributes: object; - private _featureModel: FeatureModel | null; + private _featureModel: FeatureModel; /* * @classdesc This command class handles do/undo of adding features to topics, e.g. an @@ -65,7 +65,7 @@ class AddFeatureToTopicCommand extends Command { undoExecute(commandContext: CommandContext) { const topic = commandContext.findTopics([this._topicId])[0]; - topic.removeFeature(this._featureModel!); + topic.removeFeature(this._featureModel); } } diff --git a/packages/mindplot/src/components/commands/AddTopicCommand.ts b/packages/mindplot/src/components/commands/AddTopicCommand.ts index faf39c44..0e405a09 100644 --- a/packages/mindplot/src/components/commands/AddTopicCommand.ts +++ b/packages/mindplot/src/components/commands/AddTopicCommand.ts @@ -70,7 +70,7 @@ class AddTopicCommand extends Command { undoExecute(commandContext: CommandContext) { // Delete disconnected the nodes. Create a copy of the topics ... - const clonedModel: NodeModel[] = []; + const clonedModel = []; this._models.forEach((model) => { clonedModel.push(model.clone()); }); diff --git a/packages/mindplot/src/components/commands/MoveControlPointCommand.ts b/packages/mindplot/src/components/commands/MoveControlPointCommand.ts index 7529afa6..33523cf9 100644 --- a/packages/mindplot/src/components/commands/MoveControlPointCommand.ts +++ b/packages/mindplot/src/components/commands/MoveControlPointCommand.ts @@ -34,7 +34,7 @@ class MoveControlPointCommand extends Command { private _wasCustom: boolean; - private _endPoint: PositionType; + private _endPoint: any; private _point: number; @@ -52,7 +52,7 @@ class MoveControlPointCommand extends Command { this._ctrlPointControler = ctrlPointController; this._line = ctrlPointController._line; this._controlPoint = { ...this._ctrlPointControler.getControlPoint(point) }; - this._oldControlPoint = this._ctrlPointControler.getOriginalCtrlPoint(point); + this._oldControlPoint = { ...this._ctrlPointControler.getOriginalCtrlPoint(point) }; this._originalEndPoint = this._ctrlPointControler.getOriginalEndPoint(point); switch (point) { case 0: diff --git a/packages/mindplot/src/components/export/SVGExporter.ts b/packages/mindplot/src/components/export/SVGExporter.ts index 4f12a756..f72de06c 100644 --- a/packages/mindplot/src/components/export/SVGExporter.ts +++ b/packages/mindplot/src/components/export/SVGExporter.ts @@ -66,28 +66,25 @@ class SVGExporter extends Exporter { private _calcualteDimensions(): { minX: number; maxX: number; minY: number; maxY: number } { // Collect all group elements ... const rectElems = Array.from(this.svgElement.querySelectorAll('g>rect')); - let result: SizeType = { width: 0, height: 0 }; const translates: SizeType[] = rectElems.map((rect: Element) => { const g = rect.parentElement; - const transformStr = g?.getAttribute('transform'); - if (transformStr) { - // Looking to parse translate(220.00000,279.00000) scale(1.00000,1.00000) - const match = transformStr.match(SVGExporter.regexpTranslate); - if (match !== null) { - result = { width: Number.parseFloat(match[1]), height: Number.parseFloat(match[2]) }; + const transformStr = g.getAttribute('transform'); - // Add rect size ... - const width = rect.getAttribute('width'); - if (result.width > 0 && width) { - const rectWidth = Number.parseFloat(width); - result.width += rectWidth; - } + // Looking to parse translate(220.00000,279.00000) scale(1.00000,1.00000) + const match = transformStr.match(SVGExporter.regexpTranslate); + let result: SizeType = { width: 0, height: 0 }; + if (match !== null) { + result = { width: Number.parseFloat(match[1]), height: Number.parseFloat(match[2]) }; - const height = rect.getAttribute('height'); - if (result.height > 0 && height) { - const rectHeight = Number.parseFloat(height); - result.height += rectHeight; - } + // Add rect size ... + if (result.width > 0) { + const rectWidth = Number.parseFloat(rect.getAttribute('width')); + result.width += rectWidth; + } + + if (result.height > 0) { + const rectHeight = Number.parseFloat(rect.getAttribute('height')); + result.height += rectHeight; } } return result; diff --git a/packages/mindplot/src/components/import/FreemindImporter.ts b/packages/mindplot/src/components/import/FreemindImporter.ts index 999920fc..50aa621a 100644 --- a/packages/mindplot/src/components/import/FreemindImporter.ts +++ b/packages/mindplot/src/components/import/FreemindImporter.ts @@ -169,7 +169,7 @@ export default class FreemindImporter extends Importer { } // Check for style... - const fontStyle = this.generateFontStyle(freeNode); + const fontStyle = this.generateFontStyle(freeNode, null); if (fontStyle && fontStyle !== ';;;;') wiseTopic.setFontStyle(fontStyle); // Is there any link... @@ -393,7 +393,7 @@ export default class FreemindImporter extends Importer { return result; } - private generateFontStyle(node: FreemindNode, font?: FreemindFont): string { + private generateFontStyle(node: FreemindNode, font: FreemindFont | undefined): string { const fontStyle: Array = []; // Font family @@ -485,6 +485,6 @@ export default class FreemindImporter extends Importer { private html2Text(content: string): string { const temporalDivElement = document.createElement('div'); temporalDivElement.innerHTML = content; - return temporalDivElement.textContent?.trim() || temporalDivElement.innerText.trim() || ''; + return temporalDivElement.textContent.trim() || temporalDivElement.innerText.trim() || ''; } } diff --git a/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts b/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts index ed701823..e07fd91c 100644 --- a/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts +++ b/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts @@ -28,12 +28,7 @@ abstract class ChildrenSorterStrategy { abstract detach(treeSet: RootedTreeSet, node: Node): void; - abstract predict( - treeSet: RootedTreeSet, - parent: Node, - node: Node | null, - position: PositionType | null, - ); + abstract predict(treeSet: RootedTreeSet, parent, node: Node | null, position: PositionType); abstract verify(treeSet: RootedTreeSet, node: Node); diff --git a/packages/mindplot/src/components/layout/Node.ts b/packages/mindplot/src/components/layout/Node.ts index da366b51..7eb364cd 100644 --- a/packages/mindplot/src/components/layout/Node.ts +++ b/packages/mindplot/src/components/layout/Node.ts @@ -24,7 +24,7 @@ class Node { private _id: number; // eslint-disable-next-line no-use-before-define - _parent: Node | null; + _parent: Node; private _sorter: ChildrenSorterStrategy; diff --git a/packages/mindplot/src/components/layout/RootedTreeSet.ts b/packages/mindplot/src/components/layout/RootedTreeSet.ts index c8f061c5..efc7c3fb 100644 --- a/packages/mindplot/src/components/layout/RootedTreeSet.ts +++ b/packages/mindplot/src/components/layout/RootedTreeSet.ts @@ -89,7 +89,7 @@ class RootedTreeSet { * @throws will throw an error if nodeId is null or undefined * @throws will throw an error if node is not connected */ - disconnect(nodeId: number): void { + disconnect(nodeId: number) { $assert($defined(nodeId), 'nodeId can not be null'); const node = this.find(nodeId); $assert(node._parent, 'Node is not connected'); @@ -106,11 +106,11 @@ class RootedTreeSet { * @throws will throw an error if node cannot be found * @return node */ - find(id: number, validate = true): Node | null { + find(id: number, validate = true): Node { $assert($defined(id), 'id can not be null'); const graphs = this._rootNodes; - let result: Node | null = null; + let result = null; for (let i = 0; i < graphs.length; i++) { const node = graphs[i]; result = this._find(id, node); @@ -126,12 +126,12 @@ class RootedTreeSet { return result; } - private _find(id: number, parent: Node): Node | null { + private _find(id: number, parent: Node): Node { if (parent.getId() === id) { return parent; } - let result: Node | null = null; + let result = null; const children = parent._children; for (let i = 0; i < children.length; i++) { const child = children[i]; @@ -192,10 +192,10 @@ class RootedTreeSet { */ getSiblings(node: Node): Node[] { $assert(node, 'node cannot be null'); - if (!node._parent) { + if (!$defined(node._parent)) { return []; } - const siblings = node._parent?._children.filter((child) => child !== node); + const siblings = node._parent._children.filter((child) => child !== node); return siblings; } @@ -241,7 +241,7 @@ class RootedTreeSet { * @throws will throw an error if node is null or undefined * @return parent */ - getParent(node: Node): Node | null { + getParent(node: Node): Node { $assert(node, 'node cannot be null'); return node._parent; } diff --git a/packages/mindplot/src/components/model/IMindmap.ts b/packages/mindplot/src/components/model/IMindmap.ts index c36569ea..95a15e59 100644 --- a/packages/mindplot/src/components/model/IMindmap.ts +++ b/packages/mindplot/src/components/model/IMindmap.ts @@ -67,7 +67,7 @@ abstract class IMindmap { $assert(child, 'Child can not be null.'); $assert(parent, 'Child model seems to be already connected'); - parent?.removeChild(child); + parent.removeChild(child); this.addBranch(child); } diff --git a/packages/mindplot/src/components/model/INodeModel.ts b/packages/mindplot/src/components/model/INodeModel.ts index 1f8f9249..44c7b405 100644 --- a/packages/mindplot/src/components/model/INodeModel.ts +++ b/packages/mindplot/src/components/model/INodeModel.ts @@ -46,7 +46,7 @@ abstract class INodeModel { abstract getFeatures(): FeatureModel[]; setId(id?: number): void { - if (id === null || id === undefined) { + if (!$defined(id)) { const newId = INodeModel._nextUUID(); this.putProperty('id', newId); } else { diff --git a/packages/mindplot/src/components/model/SvgIconFamily.json b/packages/mindplot/src/components/model/SvgIconFamily.json index c771153c..0e8cc595 100644 --- a/packages/mindplot/src/components/model/SvgIconFamily.json +++ b/packages/mindplot/src/components/model/SvgIconFamily.json @@ -121,7 +121,6 @@ { "id": "object", "icons": [ - "object_clip", "object_music" ] }, diff --git a/packages/mindplot/src/components/persistence/XMLSerializerFactory.ts b/packages/mindplot/src/components/persistence/XMLSerializerFactory.ts index 5e6b8b84..a6c43b55 100644 --- a/packages/mindplot/src/components/persistence/XMLSerializerFactory.ts +++ b/packages/mindplot/src/components/persistence/XMLSerializerFactory.ts @@ -15,6 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { $assert } from '@wisemapping/core-js'; import ModelCodeName from './ModelCodeName'; import Beta2PelaMigrator from './Beta2PelaMigrator'; import Pela2TangoMigrator from './Pela2TangoMigrator'; @@ -88,9 +89,7 @@ class XMLSerializerFactory { result = new migrator(result); } } - if (!result) { - throw new Error(`Cound not find serialized for ${version}`); - } + $assert(result, `Cound not find serialized for ${version}`); return result; } } diff --git a/packages/mindplot/src/index.ts b/packages/mindplot/src/index.ts index 3ccf87af..a7454486 100644 --- a/packages/mindplot/src/index.ts +++ b/packages/mindplot/src/index.ts @@ -58,7 +58,6 @@ declare global { var designer: Designer; } -// eslint-disable-next-line @typescript-eslint/no-explicit-any const globalAny: any = global; globalAny.jQuery = jquery; // WebComponent registration From 61c7900f05733de7ab8f1e27d0f4c3f96a4c4d96 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 24 Nov 2022 16:51:30 -0800 Subject: [PATCH 48/55] Continue refactor. --- packages/mindplot/src/components/Command.ts | 4 +- .../mindplot/src/components/ControlPoint.ts | 55 +++++++++---------- packages/mindplot/src/components/Designer.ts | 21 +++---- .../src/components/DesignerUndoManager.ts | 4 +- .../src/components/MultilineTextEditor.ts | 2 +- .../mindplot/src/components/ScreenManager.ts | 13 ++--- .../components/StandaloneActionDispatcher.ts | 12 ++-- .../mindplot/src/components/TopicFactory.ts | 2 +- .../mindplot/src/components/WidgetManager.ts | 9 ++- packages/mindplot/src/components/Workspace.ts | 4 +- .../commands/AddFeatureToTopicCommand.ts | 4 +- .../components/commands/AddTopicCommand.ts | 6 +- .../src/components/commands/DeleteCommand.ts | 11 ++-- .../commands/GenericFunctionCommand.ts | 11 ++-- .../src/components/export/MDExporter.ts | 28 ++++++---- .../src/components/export/SVGExporter.ts | 31 ++++++----- .../src/components/export/freemind/Font.ts | 6 +- .../src/components/layout/RootedTreeSet.ts | 8 +-- .../mindplot/src/components/model/IMindmap.ts | 2 +- .../src/components/model/INodeModel.ts | 3 +- .../persistence/XMLSerializerFactory.ts | 4 +- 21 files changed, 124 insertions(+), 116 deletions(-) diff --git a/packages/mindplot/src/components/Command.ts b/packages/mindplot/src/components/Command.ts index 46bf5a05..a1cb6feb 100644 --- a/packages/mindplot/src/components/Command.ts +++ b/packages/mindplot/src/components/Command.ts @@ -46,11 +46,11 @@ abstract class Command { return this._uuid; } - get discardDuplicated(): string { + getDiscardDuplicated(): string { return this._discardDuplicated; } - set discardDuplicated(value: string) { + setDiscardDuplicated(value: string) { this._discardDuplicated = value; } } diff --git a/packages/mindplot/src/components/ControlPoint.ts b/packages/mindplot/src/components/ControlPoint.ts index b9aab58b..c33b6565 100644 --- a/packages/mindplot/src/components/ControlPoint.ts +++ b/packages/mindplot/src/components/ControlPoint.ts @@ -21,6 +21,7 @@ import { $defined } from '@wisemapping/core-js'; import Shape from './util/Shape'; import ActionDispatcher from './ActionDispatcher'; import Workspace from './Workspace'; +import PositionType from './PositionType'; class ControlPoint { private control1: Elipse; @@ -37,15 +38,15 @@ class ControlPoint { private _workspace: Workspace; - private _endPoint: any[]; + private _endPoint: PositionType[]; - private _orignalCtrlPoint: any; + private _orignalCtrlPoint: PositionType[]; - private _controls: any; + private _controls: PositionType[]; - private _mouseMoveFunction: (e: Event) => void; + private _mouseMoveFunction: (e: MouseEvent) => void; - private _mouseUpFunction: (e: Event) => void; + private _mouseUpFunction: (e: MouseEvent) => void; constructor() { this.control1 = new Elipse({ @@ -73,25 +74,24 @@ class ControlPoint { ]; this._isBinded = false; - const me = this; - this._controlPointsController[0].addEvent('mousedown', (event) => { - me._mouseDown(event, ControlPoint.FROM, me); + this._controlPointsController[0].addEvent('mousedown', (event: MouseEvent) => { + this._mouseDown(event, ControlPoint.FROM); }); - this._controlPointsController[0].addEvent('click', (event) => { - me._mouseClick(event); + this._controlPointsController[0].addEvent('click', (event: MouseEvent) => { + this._mouseClick(event); }); - this._controlPointsController[0].addEvent('dblclick', (event) => { - me._mouseClick(event); + this._controlPointsController[0].addEvent('dblclick', (event: MouseEvent) => { + this._mouseClick(event); }); - this._controlPointsController[1].addEvent('mousedown', (event) => { - me._mouseDown(event, ControlPoint.TO, me); + this._controlPointsController[1].addEvent('mousedown', (event: MouseEvent) => { + this._mouseDown(event, ControlPoint.TO); }); - this._controlPointsController[1].addEvent('click', (event) => { - me._mouseClick(event); + this._controlPointsController[1].addEvent('click', (event: MouseEvent) => { + this._mouseClick(event); }); - this._controlPointsController[1].addEvent('dblclick', (event) => { - me._mouseClick(event); + this._controlPointsController[1].addEvent('dblclick', (event: MouseEvent) => { + this._mouseClick(event); }); } @@ -103,8 +103,7 @@ class ControlPoint { this._createControlPoint(); this._endPoint = []; this._orignalCtrlPoint = []; - this._orignalCtrlPoint[0] = { ...this._controls[0] }; - this._orignalCtrlPoint[1] = { ...this._controls[1] }; + [this._orignalCtrlPoint[0], this._orignalCtrlPoint[1]] = this._controls; this._endPoint[0] = { ...this._line.getLine().getFrom() }; this._endPoint[1] = { ...this._line.getLine().getTo() }; } @@ -146,16 +145,16 @@ class ControlPoint { // Overwrite default behaviour ... } - private _mouseDown(event: Event, point, me) { + private _mouseDown(event: MouseEvent, point: number) { if (!this._isBinded) { this._isBinded = true; this._mouseMoveFunction = (e) => { - me._mouseMoveEvent(e, point, me); + this._mouseMoveEvent(e, point); }; this._workspace.getScreenManager().addEvent('mousemove', this._mouseMoveFunction); - this._mouseUpFunction = (e: Event) => { - me._mouseUp(e, point, me); + this._mouseUpFunction = (e: MouseEvent) => { + this._mouseUp(e, MouseEvent); }; this._workspace.getScreenManager().addEvent('mouseup', this._mouseUpFunction); } @@ -224,22 +223,22 @@ class ControlPoint { } removeFromWorkspace(workspace: Workspace) { - this._workspace = null; + this._workspace!; workspace.removeChild(this._controlPointsController[0]); workspace.removeChild(this._controlPointsController[1]); workspace.removeChild(this._controlLines[0]); workspace.removeChild(this._controlLines[1]); } - getControlPoint(index: number): ControlPoint { + getControlPoint(index: number): PositionType { return this._controls[index]; } - getOriginalEndPoint(index: number) { + getOriginalEndPoint(index: number): PositionType { return this._endPoint[index]; } - getOriginalCtrlPoint(index: number): ControlPoint { + getOriginalCtrlPoint(index: number): PositionType { return this._orignalCtrlPoint[index]; } diff --git a/packages/mindplot/src/components/Designer.ts b/packages/mindplot/src/components/Designer.ts index 3bfa32c7..e4ac853f 100644 --- a/packages/mindplot/src/components/Designer.ts +++ b/packages/mindplot/src/components/Designer.ts @@ -408,7 +408,7 @@ class Designer extends Events { $notify($msg('CLIPBOARD_IS_EMPTY')); return; } - this._actionDispatcher.addTopics(this._clipboard); + this._actionDispatcher.addTopics(this._clipboard, null); this._clipboard = []; } @@ -589,10 +589,9 @@ class Designer extends Events { // Init layout manager ... const size = { width: 25, height: 25 }; const layoutManager = new LayoutManager(mindmap.getCentralTopic().getId(), size); - const me = this; layoutManager.addEvent('change', (event) => { const id = event.getId(); - const topic = me.getModel().findTopicById(id); + const topic = this.getModel().findTopicById(id); if (topic) { topic.setPosition(event.getPosition()); topic.setOrder(event.getOrder()); @@ -728,23 +727,21 @@ class Designer extends Events { // Build relationship line .... const result = new Relationship(sourceTopic!, targetTopic!, model); - const me = this; - result.addEvent('ontblur', () => { - const topics = me.getModel().filterSelectedTopics(); - const rels = me.getModel().filterSelectedRelationships(); + const topics = this.getModel().filterSelectedTopics(); + const rels = this.getModel().filterSelectedRelationships(); if (topics.length === 0 || rels.length === 0) { - me.fireEvent('onblur'); + this.fireEvent('onblur'); } }); result.addEvent('ontfocus', () => { - const topics = me.getModel().filterSelectedTopics(); - const rels = me.getModel().filterSelectedRelationships(); + const topics = this.getModel().filterSelectedTopics(); + const rels = this.getModel().filterSelectedRelationships(); if (topics.length === 1 || rels.length === 1) { - me.fireEvent('onfocus'); + this.fireEvent('onfocus'); } }); @@ -771,7 +768,7 @@ class Designer extends Events { const model = node.getModel(); model.deleteNode(); - if ($defined(parent)) { + if (parent) { this.goToNode(parent); } } diff --git a/packages/mindplot/src/components/DesignerUndoManager.ts b/packages/mindplot/src/components/DesignerUndoManager.ts index 7972b15a..f81934be 100644 --- a/packages/mindplot/src/components/DesignerUndoManager.ts +++ b/packages/mindplot/src/components/DesignerUndoManager.ts @@ -35,10 +35,10 @@ class DesignerUndoManager { enqueue(command: Command) { $assert(command, 'Command can not be null'); const { length } = this._undoQueue; - if (command.discardDuplicated && length > 0) { + if (command.getDiscardDuplicated() && length > 0) { // Skip duplicated events ... const lastItem = this._undoQueue[length - 1]; - if (lastItem.discardDuplicated !== command.discardDuplicated) { + if (lastItem.getDiscardDuplicated() !== command.getDiscardDuplicated()) { this._undoQueue.push(command); } } else { diff --git a/packages/mindplot/src/components/MultilineTextEditor.ts b/packages/mindplot/src/components/MultilineTextEditor.ts index 5cd554f4..c0358395 100644 --- a/packages/mindplot/src/components/MultilineTextEditor.ts +++ b/packages/mindplot/src/components/MultilineTextEditor.ts @@ -173,7 +173,7 @@ class EditorComponent extends Events { this._containerElem.offset({ top, left }); // Set editor's initial text ... - const text = topic.getText() || defaultText; + const text = defaultText || topic.getText(); this._setText(text); // Set the element focus and select the current text ... diff --git a/packages/mindplot/src/components/ScreenManager.ts b/packages/mindplot/src/components/ScreenManager.ts index 0b5b5323..390de950 100644 --- a/packages/mindplot/src/components/ScreenManager.ts +++ b/packages/mindplot/src/components/ScreenManager.ts @@ -16,7 +16,7 @@ * limitations under the License. */ import $ from 'jquery'; -import { $assert } from '@wisemapping/core-js'; +import { $assert, $defined } from '@wisemapping/core-js'; import { Point } from '@wisemapping/web2d'; // https://stackoverflow.com/questions/60357083/does-not-use-passive-listeners-to-improve-scrolling-performance-lighthouse-repo // https://web.dev/uses-passive-event-listeners/?utm_source=lighthouse&utm_medium=lr @@ -100,8 +100,8 @@ class ScreenManager { private tocuchEvents = ['touchstart', 'touchend', 'touchmove']; getWorkspaceMousePosition(event: MouseEvent | TouchEvent): Point { - let x: number; - let y: number; + let x: number | null = null; + let y: number | null = null; if (this.mouseEvents.includes(event.type)) { // Retrieve current mouse position. @@ -113,11 +113,8 @@ class ScreenManager { } // if value is zero assert throws error - if (x !== 0) { - $assert(x, `clientX can not be null, eventType= ${event.type}`); - } - if (y !== 0) { - $assert(y, `clientY can not be null, eventType= ${event.type}`); + if (x === null || y === null) { + throw new Error(`Coordinated can not be null, eventType= ${event.type}`); } // Adjust the deviation of the container positioning ... diff --git a/packages/mindplot/src/components/StandaloneActionDispatcher.ts b/packages/mindplot/src/components/StandaloneActionDispatcher.ts index f38c9b77..95e57f08 100644 --- a/packages/mindplot/src/components/StandaloneActionDispatcher.ts +++ b/packages/mindplot/src/components/StandaloneActionDispatcher.ts @@ -52,7 +52,7 @@ class StandaloneActionDispatcher extends ActionDispatcher { this._actionRunner = new DesignerActionRunner(commandContext, this); } - addTopics(models: NodeModel[], parentTopicsId: number[] = undefined) { + addTopics(models: NodeModel[], parentTopicsId: number[] | null) { const command = new AddTopicCommand(models, parentTopicsId); this.execute(command); } @@ -106,7 +106,7 @@ class StandaloneActionDispatcher extends ActionDispatcher { topic.setFontStyle(style, true); return result; }; - const command = new GenericFunctionCommand(commandFunc, topicsIds); + const command = new GenericFunctionCommand(commandFunc, topicsIds, null); this.execute(command); } @@ -153,7 +153,7 @@ class StandaloneActionDispatcher extends ActionDispatcher { }; const command = new GenericFunctionCommand(commandFunc, topicsIds, color); - command.discardDuplicated = 'fontColorCommandId'; + command.setDiscardDuplicated('fontColorCommandId'); this.execute(command); } @@ -169,7 +169,7 @@ class StandaloneActionDispatcher extends ActionDispatcher { }; const command = new GenericFunctionCommand(commandFunc, topicsIds, color); - command.discardDuplicated = 'backColor'; + command.setDiscardDuplicated('backColor'); this.execute(command); } @@ -185,7 +185,7 @@ class StandaloneActionDispatcher extends ActionDispatcher { }; const command = new GenericFunctionCommand(commandFunc, topicsIds, color); - command.discardDuplicated = 'borderColorCommandId'; + command.setDiscardDuplicated('borderColorCommandId'); this.execute(command); } @@ -234,7 +234,7 @@ class StandaloneActionDispatcher extends ActionDispatcher { return result; }; - const command = new GenericFunctionCommand(commandFunc, topicsIds); + const command = new GenericFunctionCommand(commandFunc, topicsIds, null); this.execute(command); } diff --git a/packages/mindplot/src/components/TopicFactory.ts b/packages/mindplot/src/components/TopicFactory.ts index 03a7199c..fb00ac89 100644 --- a/packages/mindplot/src/components/TopicFactory.ts +++ b/packages/mindplot/src/components/TopicFactory.ts @@ -20,7 +20,7 @@ class TopicFactory { } else { $assert(false, `unsupported node type:${type}`); } - return result; + return result!; } } diff --git a/packages/mindplot/src/components/WidgetManager.ts b/packages/mindplot/src/components/WidgetManager.ts index a713f3e9..821b9382 100644 --- a/packages/mindplot/src/components/WidgetManager.ts +++ b/packages/mindplot/src/components/WidgetManager.ts @@ -70,7 +70,8 @@ abstract class WidgetManager { tooltip.css({ display: 'block' }); evt.stopPropagation(); }); - mindmapElement.addEvent('mouseleave', (evt) => { + + mindmapElement.addEvent('mouseleave', (evt: MouseEvent) => { tooltip.css({ display: 'none' }); evt.stopPropagation(); }); @@ -100,7 +101,11 @@ abstract class WidgetManager { }); } - abstract showEditorForLink(topic: Topic, linkModel: LinkModel, linkIcon: LinkIcon): void; + abstract showEditorForLink( + topic: Topic, + linkModel: LinkModel | null, + linkIcon: LinkIcon | null, + ): void; abstract showEditorForNote( topic: Topic, diff --git a/packages/mindplot/src/components/Workspace.ts b/packages/mindplot/src/components/Workspace.ts index b4b7c29c..2bb48914 100644 --- a/packages/mindplot/src/components/Workspace.ts +++ b/packages/mindplot/src/components/Workspace.ts @@ -182,8 +182,8 @@ class Workspace { const workspace = this._workspace; const divContainer = this._screenManager.getContainer(); - const containerWidth = divContainer.width(); - const containerHeight = divContainer.height(); + const containerWidth = divContainer.width()!; + const containerHeight = divContainer.height()!; const newVisibleAreaSize = { width: containerWidth, height: containerHeight }; // - svg must fit container size diff --git a/packages/mindplot/src/components/commands/AddFeatureToTopicCommand.ts b/packages/mindplot/src/components/commands/AddFeatureToTopicCommand.ts index 8aea8d7b..245351d1 100644 --- a/packages/mindplot/src/components/commands/AddFeatureToTopicCommand.ts +++ b/packages/mindplot/src/components/commands/AddFeatureToTopicCommand.ts @@ -28,7 +28,7 @@ class AddFeatureToTopicCommand extends Command { private _attributes: object; - private _featureModel: FeatureModel; + private _featureModel: FeatureModel | null; /* * @classdesc This command class handles do/undo of adding features to topics, e.g. an @@ -65,7 +65,7 @@ class AddFeatureToTopicCommand extends Command { undoExecute(commandContext: CommandContext) { const topic = commandContext.findTopics([this._topicId])[0]; - topic.removeFeature(this._featureModel); + topic.removeFeature(this._featureModel!); } } diff --git a/packages/mindplot/src/components/commands/AddTopicCommand.ts b/packages/mindplot/src/components/commands/AddTopicCommand.ts index 0e405a09..e94386cf 100644 --- a/packages/mindplot/src/components/commands/AddTopicCommand.ts +++ b/packages/mindplot/src/components/commands/AddTopicCommand.ts @@ -29,7 +29,7 @@ class AddTopicCommand extends Command { * @classdesc This command class handles do/undo of adding one or multiple topics to * the mindmap. */ - constructor(models: NodeModel[], parentTopicsId: number[]) { + constructor(models: NodeModel[], parentTopicsId: number[] | null) { $assert(models, 'models can not be null'); $assert( parentTopicsId == null || parentTopicsId.length === models.length, @@ -48,7 +48,7 @@ class AddTopicCommand extends Command { const topic = commandContext.createTopic(model); // Connect to topic ... - if (me._parentsIds) { + if (this._parentsIds) { const parentId = me._parentsIds[index]; if ($defined(parentId)) { const parentTopic = commandContext.findTopics([parentId])[0]; @@ -70,7 +70,7 @@ class AddTopicCommand extends Command { undoExecute(commandContext: CommandContext) { // Delete disconnected the nodes. Create a copy of the topics ... - const clonedModel = []; + const clonedModel: NodeModel[] = []; this._models.forEach((model) => { clonedModel.push(model.clone()); }); diff --git a/packages/mindplot/src/components/commands/DeleteCommand.ts b/packages/mindplot/src/components/commands/DeleteCommand.ts index 775107f7..b3fa6d9d 100644 --- a/packages/mindplot/src/components/commands/DeleteCommand.ts +++ b/packages/mindplot/src/components/commands/DeleteCommand.ts @@ -73,11 +73,12 @@ class DeleteCommand extends Command { const clonedModel = model.clone(); this._deletedTopicModels.push(clonedModel); const outTopic = topic.getOutgoingConnectedTopic(); - let outTopicId = null; + + let outTopicId: number | null = null; if (outTopic != null) { outTopicId = outTopic.getId(); + this._parentTopicIds.push(outTopicId); } - this._parentTopicIds.push(outTopicId); // Finally, delete the topic from the workspace... commandContext.deleteTopic(topic); @@ -161,14 +162,14 @@ class DeleteCommand extends Command { } private _collectInDepthRelationships(topic: Topic): Relationship[] { - let result = []; - result = result.concat(topic.getRelationships()); + let result: Relationship[] = []; + result.push(...topic.getRelationships()); const children = topic.getChildren(); const rels: Relationship[][] = children.map((t: Topic) => this._collectInDepthRelationships(t)); // flatten and concact - result = result.concat([].concat(...rels)); + result.push(...rels.flat()); if (result.length > 0) { // Filter for unique ... diff --git a/packages/mindplot/src/components/commands/GenericFunctionCommand.ts b/packages/mindplot/src/components/commands/GenericFunctionCommand.ts index 17751212..1c0c5592 100644 --- a/packages/mindplot/src/components/commands/GenericFunctionCommand.ts +++ b/packages/mindplot/src/components/commands/GenericFunctionCommand.ts @@ -20,7 +20,7 @@ import Command from '../Command'; import CommandContext from '../CommandContext'; import Topic from '../Topic'; -type CommandTypes = string | object | boolean | number; +type CommandTypes = string | object | boolean | number | null; class GenericFunctionCommand extends Command { private _value: CommandTypes; @@ -36,7 +36,7 @@ class GenericFunctionCommand extends Command { constructor( commandFunc: (topic: Topic, value: CommandTypes) => CommandTypes, topicsIds: number[], - value: CommandTypes = undefined, + value: CommandTypes, ) { $assert(commandFunc, 'commandFunc must be defined'); $assert($defined(topicsIds), 'topicsIds must be defined'); @@ -51,15 +51,14 @@ class GenericFunctionCommand extends Command { /** * Overrides abstract parent method */ - execute(commandContext: CommandContext) { + execute(commandContext: CommandContext): void { if (!this._applied) { const topics = commandContext.findTopics(this._topicsIds); if (topics != null) { - const me = this; topics.forEach((topic: Topic) => { - const oldValue = me._commandFunc(topic, me._value); - me._oldValues.push(oldValue); + const oldValue = this._commandFunc(topic, this._value); + this._oldValues.push(oldValue); }); } this._applied = true; diff --git a/packages/mindplot/src/components/export/MDExporter.ts b/packages/mindplot/src/components/export/MDExporter.ts index bcaa4f25..af00b552 100644 --- a/packages/mindplot/src/components/export/MDExporter.ts +++ b/packages/mindplot/src/components/export/MDExporter.ts @@ -41,21 +41,25 @@ class MDExporter extends Exporter { // Add cental node as text ... const centralTopic = this.mindmap.getCentralTopic(); - const centralText = this.normalizeText(centralTopic.getText()); - // Traverse all the branches ... - let result = `# ${centralText}\n\n`; - result += this.traverseBranch('', centralTopic.getChildren()); + const centralTopicText = centralTopic.getText(); + let result = ''; + if (centralTopicText) { + const centralText = this.normalizeText(centralTopicText); - // White footnotes: - if (this.footNotes.length > 0) { - result += '\n\n\n'; - this.footNotes.forEach((note, index) => { - result += `[^${index + 1}]: ${this.normalizeText(note)}`; - }); + // Traverse all the branches ... + result = `# ${centralText}\n\n`; + result += this.traverseBranch('', centralTopic.getChildren()); + + // White footnotes: + if (this.footNotes.length > 0) { + result += '\n\n\n'; + this.footNotes.forEach((note, index) => { + result += `[^${index + 1}]: ${this.normalizeText(note)}`; + }); + } + result += '\n'; } - result += '\n'; - return Promise.resolve(result); } diff --git a/packages/mindplot/src/components/export/SVGExporter.ts b/packages/mindplot/src/components/export/SVGExporter.ts index f72de06c..f53eb9d4 100644 --- a/packages/mindplot/src/components/export/SVGExporter.ts +++ b/packages/mindplot/src/components/export/SVGExporter.ts @@ -68,23 +68,26 @@ class SVGExporter extends Exporter { const rectElems = Array.from(this.svgElement.querySelectorAll('g>rect')); const translates: SizeType[] = rectElems.map((rect: Element) => { const g = rect.parentElement; - const transformStr = g.getAttribute('transform'); - - // Looking to parse translate(220.00000,279.00000) scale(1.00000,1.00000) - const match = transformStr.match(SVGExporter.regexpTranslate); + const transformStr = g?.getAttribute('transform'); let result: SizeType = { width: 0, height: 0 }; - if (match !== null) { - result = { width: Number.parseFloat(match[1]), height: Number.parseFloat(match[2]) }; + if (transformStr) { + // Looking to parse translate(220.00000,279.00000) scale(1.00000,1.00000) + const match = transformStr.match(SVGExporter.regexpTranslate); + if (match !== null) { + result = { width: Number.parseFloat(match[1]), height: Number.parseFloat(match[2]) }; - // Add rect size ... - if (result.width > 0) { - const rectWidth = Number.parseFloat(rect.getAttribute('width')); - result.width += rectWidth; - } + // Add rect size ... + const widthAttr = rect.getAttribute('width'); + if (result.width > 0 && widthAttr) { + const rectWidth = Number.parseFloat(widthAttr); + result.width += rectWidth; + } - if (result.height > 0) { - const rectHeight = Number.parseFloat(rect.getAttribute('height')); - result.height += rectHeight; + const heightAttr = rect.getAttribute('height'); + if (result.height > 0 && heightAttr) { + const rectHeight = Number.parseFloat(heightAttr); + result.height += rectHeight; + } } } return result; diff --git a/packages/mindplot/src/components/export/freemind/Font.ts b/packages/mindplot/src/components/export/freemind/Font.ts index 3ba3defc..bcab647e 100644 --- a/packages/mindplot/src/components/export/freemind/Font.ts +++ b/packages/mindplot/src/components/export/freemind/Font.ts @@ -7,15 +7,15 @@ export default class Font { protected SIZE: string; - getBold(): string { + getBold(): string | undefined { return this.BOLD; } - getItalic(): string { + getItalic(): string | undefined { return this.ITALIC; } - getName(): string { + getName(): string | undefined { return this.NAME; } diff --git a/packages/mindplot/src/components/layout/RootedTreeSet.ts b/packages/mindplot/src/components/layout/RootedTreeSet.ts index efc7c3fb..1919e203 100644 --- a/packages/mindplot/src/components/layout/RootedTreeSet.ts +++ b/packages/mindplot/src/components/layout/RootedTreeSet.ts @@ -110,7 +110,7 @@ class RootedTreeSet { $assert($defined(id), 'id can not be null'); const graphs = this._rootNodes; - let result = null; + let result: Node | null = null; for (let i = 0; i < graphs.length; i++) { const node = graphs[i]; result = this._find(id, node); @@ -123,7 +123,7 @@ class RootedTreeSet { throw new Error(`node could not be found id:${id}\n,RootedTreeSet${this.dump()}`); } - return result; + return result!; } private _find(id: number, parent: Node): Node { @@ -131,7 +131,7 @@ class RootedTreeSet { return parent; } - let result = null; + let result: Node | null = null; const children = parent._children; for (let i = 0; i < children.length; i++) { const child = children[i]; @@ -139,7 +139,7 @@ class RootedTreeSet { if (result) break; } - return result; + return result!; } /** diff --git a/packages/mindplot/src/components/model/IMindmap.ts b/packages/mindplot/src/components/model/IMindmap.ts index 95a15e59..c36569ea 100644 --- a/packages/mindplot/src/components/model/IMindmap.ts +++ b/packages/mindplot/src/components/model/IMindmap.ts @@ -67,7 +67,7 @@ abstract class IMindmap { $assert(child, 'Child can not be null.'); $assert(parent, 'Child model seems to be already connected'); - parent.removeChild(child); + parent?.removeChild(child); this.addBranch(child); } diff --git a/packages/mindplot/src/components/model/INodeModel.ts b/packages/mindplot/src/components/model/INodeModel.ts index 44c7b405..d84b349f 100644 --- a/packages/mindplot/src/components/model/INodeModel.ts +++ b/packages/mindplot/src/components/model/INodeModel.ts @@ -46,7 +46,8 @@ abstract class INodeModel { abstract getFeatures(): FeatureModel[]; setId(id?: number): void { - if (!$defined(id)) { + if (id === null || id === undefined) { + // Assign a new one ... const newId = INodeModel._nextUUID(); this.putProperty('id', newId); } else { diff --git a/packages/mindplot/src/components/persistence/XMLSerializerFactory.ts b/packages/mindplot/src/components/persistence/XMLSerializerFactory.ts index a6c43b55..0735617d 100644 --- a/packages/mindplot/src/components/persistence/XMLSerializerFactory.ts +++ b/packages/mindplot/src/components/persistence/XMLSerializerFactory.ts @@ -89,7 +89,9 @@ class XMLSerializerFactory { result = new migrator(result); } } - $assert(result, `Cound not find serialized for ${version}`); + if (!result) { + throw new Error(`Cound not find serialized for ${version}`); + } return result; } } From 4be63fee4d6a1e88667109bd365f1d6e37dfad0c Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 24 Nov 2022 16:58:34 -0800 Subject: [PATCH 49/55] Fix test --- .../test/unit/export/expected/emptyNodes.md | 77 ------------------- 1 file changed, 77 deletions(-) diff --git a/packages/mindplot/test/unit/export/expected/emptyNodes.md b/packages/mindplot/test/unit/export/expected/emptyNodes.md index df368424..e69de29b 100644 --- a/packages/mindplot/test/unit/export/expected/emptyNodes.md +++ b/packages/mindplot/test/unit/export/expected/emptyNodes.md @@ -1,77 +0,0 @@ -# - -- objectifs journรฉe - - "business plan" associatif ? - - modรจle / activitรฉs responsabilitรฉs - - articulations / LOG -- SWOT - - - - l'entreprise a aujourd'hui un potentiel important - - compรฉtences professionnel - - citoyen - - forte chance de rรฉussite - - apporter des idรฉes et propsitions ร  des questions sociรฉtales - - notre maniรจre d"y rรฉpondre avec notamment les technlogies - - l'opportunitรฉ et la demande sont fortes aujourd'hui, avec peu de "concurrence" - - ensemble de ressources "rares" - - capacitรฉs de recherche et innovation - - motivation du groupe et sens partagรฉ entre membres - - professionnellement : expรฉrience collective et partage d'outils en pratique - - ouverture vers mode de vie attractif perso / pro - - potentiel humain, humaniste et citoyen - - assemblage entre atelier et outillage - - capacitรฉ de rรฉponder en local et en global - - associatif : contxte de crise multimorphologique / positionne rรฉfรฉrence en rรฉflexion et usages - - rรฉseau rรฉgional et mondial de l'รฉconomie de la ,connaisance - - asso prend pied dans le monde de la recherche - - labo de l'innovation sociopolitique - - acteur valable avec pouvoirs et acteurs en place - - autonomie par prestations et services - - triptique - - รฉthique de la discussion - - pari de la dรฉlรฉgation - - art de la dรฉcision - - rรฉussir ร  caler leprojet en adรฉquation avec le contexte actuel - - assoc : grouper des personnes qui dรฉveloppent le concept - - traduire les belles pensรฉes au niveau du citoyen - - comprรฉhension - - adhรฉsion - - ressources contributeurs rรฉfrรฉents - - reconnaissance et rรฉfรฉrence exemplaires - - financeements suffisants pour bien exister - - notre organisation est claire - - prendre des "marchรฉs รฉmergent" - - double stratup avec succes-story - - engageons une activitรฉ prรฉsentielle forte, conviviale et exemplaire - - attirer de nouveaux membres locomotives - - pratiquons en interne et externe une gouvernance explaire etune citoyenntรฉ de rรชve - - Risques : cauchemars, dangers - - disparition des forces vives, dรฉpart de membres actuels - - opportunitรฉs atteignables mais difficile - - difficultรฉs de travailler ensemble dans la durรฉe - - risque de rater le train - - sauter dans le dernier wagon et rester ร  la traรฎne - - manquer de professionnalisme - - perte de crรฉdibilitรฉ - - s'isoler entre nous et perdre le contact avec les autres acteurs - - perdre la capacitรฉ de rรฉponse au global - - manque de concret, surdimension des reflexions - - manque d'utilitรฉ socioplolitique - - manque de nouveaux membres actifs, fidรฉliser - - faire du surplace et - - manque innovation - - - - ne pas vivre ce que nous affirmons - - cohรฉrence entre langage gouvernance et la pratique - - groupe de base insuffisant - - non attractifs / nouveaux - - pas ennuyants - - pas efficaces en com - - trop lent, rater l'opportunitรฉ actuelle - - dรฉbordรฉs par "concurrences" - - dรฉparts de didier, micvhel, renรฉ, corinne MCD etc - - conclits de personnes et schisme entre 2 groupes ennemis - - groupe amicale mais trรจs merdique - - systรจme autocratique despotique ou sectaire - - - From c1dc4554d74270aac93299159797a82df3781f59 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 26 Nov 2022 08:47:35 -0800 Subject: [PATCH 50/55] Refactor relationship. --- .../src/components/ActionDispatcher.ts | 4 +- .../mindplot/src/components/ControlPoint.ts | 250 --------------- .../mindplot/src/components/Relationship.ts | 37 ++- .../components/RelationshipControlPoints.ts | 289 ++++++++++++++++++ .../components/StandaloneActionDispatcher.ts | 5 +- packages/mindplot/src/components/Workspace.ts | 4 +- .../commands/MoveControlPointCommand.ts | 137 ++++----- .../src/components/peer/svg/CurvedLinePeer.js | 43 ++- 8 files changed, 390 insertions(+), 379 deletions(-) delete mode 100644 packages/mindplot/src/components/ControlPoint.ts create mode 100644 packages/mindplot/src/components/RelationshipControlPoints.ts diff --git a/packages/mindplot/src/components/ActionDispatcher.ts b/packages/mindplot/src/components/ActionDispatcher.ts index 2b8135a5..8a0a6587 100644 --- a/packages/mindplot/src/components/ActionDispatcher.ts +++ b/packages/mindplot/src/components/ActionDispatcher.ts @@ -21,7 +21,7 @@ import { $assert } from '@wisemapping/core-js'; import Point from '@wisemapping/web2d'; import { Mindmap } from '..'; import CommandContext from './CommandContext'; -import ControlPoint from './ControlPoint'; +import RelationshipControlPoints from './RelationshipControlPoints'; import Events from './Events'; import NodeModel from './model/NodeModel'; import RelationshipModel from './model/RelationshipModel'; @@ -57,7 +57,7 @@ abstract class ActionDispatcher extends Events { abstract moveTopic(topicId: number, position: Point): void; - abstract moveControlPoint(ctrlPoint: ControlPoint, point: Point): void; + abstract moveControlPoint(ctrlPoint: RelationshipControlPoints, point: Point): void; abstract changeFontFamilyToTopic(topicIds: number[], fontFamily: string): void; diff --git a/packages/mindplot/src/components/ControlPoint.ts b/packages/mindplot/src/components/ControlPoint.ts deleted file mode 100644 index c33b6565..00000000 --- a/packages/mindplot/src/components/ControlPoint.ts +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Copyright [2021] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ -import { Elipse, Line, Point } from '@wisemapping/web2d'; -import { $defined } from '@wisemapping/core-js'; - -import Shape from './util/Shape'; -import ActionDispatcher from './ActionDispatcher'; -import Workspace from './Workspace'; -import PositionType from './PositionType'; - -class ControlPoint { - private control1: Elipse; - - private control2: Elipse; - - private _controlPointsController: Elipse[]; - - private _controlLines: Line[]; - - private _isBinded: boolean; - - _line: Line; - - private _workspace: Workspace; - - private _endPoint: PositionType[]; - - private _orignalCtrlPoint: PositionType[]; - - private _controls: PositionType[]; - - private _mouseMoveFunction: (e: MouseEvent) => void; - - private _mouseUpFunction: (e: MouseEvent) => void; - - constructor() { - this.control1 = new Elipse({ - width: 6, - height: 6, - stroke: '1 solid #6589de', - fillColor: 'gray', - visibility: false, - }); - this.control1.setCursor('pointer'); - - this.control2 = new Elipse({ - width: 6, - height: 6, - stroke: '1 solid #6589de', - fillColor: 'gray', - visibility: false, - }); - this.control2.setCursor('pointer'); - - this._controlPointsController = [this.control1, this.control2]; - this._controlLines = [ - new Line({ strokeColor: '#6589de', strokeWidth: 1, opacity: 0.3 }), - new Line({ strokeColor: '#6589de', strokeWidth: 1, opacity: 0.3 }), - ]; - - this._isBinded = false; - this._controlPointsController[0].addEvent('mousedown', (event: MouseEvent) => { - this._mouseDown(event, ControlPoint.FROM); - }); - this._controlPointsController[0].addEvent('click', (event: MouseEvent) => { - this._mouseClick(event); - }); - this._controlPointsController[0].addEvent('dblclick', (event: MouseEvent) => { - this._mouseClick(event); - }); - - this._controlPointsController[1].addEvent('mousedown', (event: MouseEvent) => { - this._mouseDown(event, ControlPoint.TO); - }); - this._controlPointsController[1].addEvent('click', (event: MouseEvent) => { - this._mouseClick(event); - }); - this._controlPointsController[1].addEvent('dblclick', (event: MouseEvent) => { - this._mouseClick(event); - }); - } - - setLine(line: Line) { - if ($defined(this._line)) { - this._removeLine(); - } - this._line = line; - this._createControlPoint(); - this._endPoint = []; - this._orignalCtrlPoint = []; - [this._orignalCtrlPoint[0], this._orignalCtrlPoint[1]] = this._controls; - this._endPoint[0] = { ...this._line.getLine().getFrom() }; - this._endPoint[1] = { ...this._line.getLine().getTo() }; - } - - setControlPointTestId(ctrlPoint1, ctrlPoint2) { - this.control1.setTestId(ctrlPoint1); - this.control2.setTestId(ctrlPoint2); - } - - redraw() { - if ($defined(this._line)) this._createControlPoint(); - } - - private _createControlPoint() { - this._controls = this._line.getLine().getControlPoints(); - let pos = this._line.getLine().getFrom(); - this._controlPointsController[0].setPosition( - this._controls[ControlPoint.FROM].x + pos.x, - this._controls[ControlPoint.FROM].y + pos.y - 3, - ); - this._controlLines[0].setFrom(pos.x, pos.y); - this._controlLines[0].setTo( - this._controls[ControlPoint.FROM].x + pos.x + 3, - this._controls[ControlPoint.FROM].y + pos.y, - ); - pos = this._line.getLine().getTo(); - this._controlLines[1].setFrom(pos.x, pos.y); - this._controlLines[1].setTo( - this._controls[ControlPoint.TO].x + pos.x + 3, - this._controls[ControlPoint.TO].y + pos.y, - ); - this._controlPointsController[1].setPosition( - this._controls[ControlPoint.TO].x + pos.x, - this._controls[ControlPoint.TO].y + pos.y - 3, - ); - } - - private _removeLine() { - // Overwrite default behaviour ... - } - - private _mouseDown(event: MouseEvent, point: number) { - if (!this._isBinded) { - this._isBinded = true; - this._mouseMoveFunction = (e) => { - this._mouseMoveEvent(e, point); - }; - - this._workspace.getScreenManager().addEvent('mousemove', this._mouseMoveFunction); - this._mouseUpFunction = (e: MouseEvent) => { - this._mouseUp(e, MouseEvent); - }; - this._workspace.getScreenManager().addEvent('mouseup', this._mouseUpFunction); - } - event.preventDefault(); - event.stopPropagation(); - return false; - } - - private _mouseMoveEvent(event: MouseEvent, point: Point) { - const screen = this._workspace.getScreenManager(); - const pos = screen.getWorkspaceMousePosition(event); - - let cords; - if (point === 0) { - cords = Shape.calculateRelationShipPointCoordinates(this._line.getSourceTopic(), pos); - this._line.setFrom(cords.x, cords.y); - this._line.setSrcControlPoint(new Point(pos.x - cords.x, pos.y - cords.y)); - } else { - cords = Shape.calculateRelationShipPointCoordinates(this._line.getTargetTopic(), pos); - this._line.setTo(cords.x, cords.y); - this._line.setDestControlPoint(new Point(pos.x - cords.x, pos.y - cords.y)); - } - - this._controls[point].x = pos.x - cords.x; - this._controls[point].y = pos.y - cords.y; - this._controlPointsController[point].setPosition(pos.x - 5, pos.y - 3); - this._controlLines[point].setFrom(cords.x, cords.y); - this._controlLines[point].setTo(pos.x - 2, pos.y); - this._line.getLine().updateLine(point); - } - - private _mouseUp(event: MouseEvent, point: Point) { - this._workspace.getScreenManager().removeEvent('mousemove', this._mouseMoveFunction); - this._workspace.getScreenManager().removeEvent('mouseup', this._mouseUpFunction); - - const actionDispatcher = ActionDispatcher.getInstance(); - actionDispatcher.moveControlPoint(this, point); - this._isBinded = false; - } - - _mouseClick(event: MouseEvent) { - event.preventDefault(); - event.stopPropagation(); - return false; - } - - setVisibility(visible: boolean) { - if (visible) { - this._controlLines[0].moveToFront(); - this._controlLines[1].moveToFront(); - this._controlPointsController[0].moveToFront(); - this._controlPointsController[1].moveToFront(); - } - this._controlPointsController[0].setVisibility(visible); - this._controlPointsController[1].setVisibility(visible); - this._controlLines[0].setVisibility(visible); - this._controlLines[1].setVisibility(visible); - } - - addToWorkspace(workspace: Workspace): void { - this._workspace = workspace; - workspace.append(this._controlPointsController[0]); - workspace.append(this._controlPointsController[1]); - workspace.append(this._controlLines[0]); - workspace.append(this._controlLines[1]); - } - - removeFromWorkspace(workspace: Workspace) { - this._workspace!; - workspace.removeChild(this._controlPointsController[0]); - workspace.removeChild(this._controlPointsController[1]); - workspace.removeChild(this._controlLines[0]); - workspace.removeChild(this._controlLines[1]); - } - - getControlPoint(index: number): PositionType { - return this._controls[index]; - } - - getOriginalEndPoint(index: number): PositionType { - return this._endPoint[index]; - } - - getOriginalCtrlPoint(index: number): PositionType { - return this._orignalCtrlPoint[index]; - } - - static FROM = 0; - - static TO = 1; -} - -export default ControlPoint; diff --git a/packages/mindplot/src/components/Relationship.ts b/packages/mindplot/src/components/Relationship.ts index f343a015..361433b2 100644 --- a/packages/mindplot/src/components/Relationship.ts +++ b/packages/mindplot/src/components/Relationship.ts @@ -18,7 +18,7 @@ import { $assert, $defined } from '@wisemapping/core-js'; import { Arrow, Point, ElementClass } from '@wisemapping/web2d'; import ConnectionLine from './ConnectionLine'; -import ControlPoint from './ControlPoint'; +import RelationshipControlPoints from './RelationshipControlPoints'; import RelationshipModel from './model/RelationshipModel'; import PositionType from './PositionType'; import Topic from './Topic'; @@ -32,7 +32,7 @@ class Relationship extends ConnectionLine { private _isInWorkspace: boolean; - private _controlPointsController: ControlPoint; + private _controlPointsController: RelationshipControlPoints; private _startArrow: Arrow; @@ -68,7 +68,7 @@ class Relationship extends ConnectionLine { this._focusShape.setVisibility(false); this._onFocus = false; this._isInWorkspace = false; - this._controlPointsController = new ControlPoint(); + this._controlPointsController = new RelationshipControlPoints(this); this._startArrow = new Arrow(); this._startArrow.setStrokeColor(strokeColor); @@ -83,17 +83,12 @@ class Relationship extends ConnectionLine { } // Position the line ... - if ($defined(model.getSrcCtrlPoint())) { + if (model.getSrcCtrlPoint()) { const srcPoint = { ...model.getSrcCtrlPoint() }; this.setSrcControlPoint(srcPoint); - - // Set test id in control point - this._controlPointsController.setControlPointTestId( - `control-${Math.abs(srcPoint.x)}`, - `control-${Math.abs(srcPoint.y)}`, - ); } - if ($defined(model.getDestCtrlPoint())) { + + if (model.getDestCtrlPoint()) { const destPoint = { ...model.getDestCtrlPoint() }; this.setDestControlPoint(destPoint); } @@ -149,9 +144,10 @@ class Relationship extends ConnectionLine { this._positionateConnector(targetTopic); if (this.isOnFocus()) { - this._refreshShape(); + this.refreshShape(); } this._focusShape.moveToBack(); + this._controlPointsController.redraw(); } @@ -213,12 +209,13 @@ class Relationship extends ConnectionLine { removeFromWorkspace(workspace: Workspace): void { workspace.removeChild(this._focusShape); workspace.removeChild(this._controlPointsController); - if (!workspace.isReadOnly) { - this._line2d.removeEvent('click', this._controlPointControllerListener); - } + + this._line2d.removeEvent('click', this._controlPointControllerListener); this._isInWorkspace = false; workspace.removeChild(this._startArrow); - if (this._endArrow) workspace.removeChild(this._endArrow); + if (this._endArrow) { + workspace.removeChild(this._endArrow); + } super.removeFromWorkspace(workspace); } @@ -231,18 +228,17 @@ class Relationship extends ConnectionLine { // Change focus shape if (this.isOnFocus() !== focus) { if (focus) { - this._refreshShape(); - this._controlPointsController.setLine(this); + this.refreshShape(); } - this._focusShape.setVisibility(focus); + this._focusShape.setVisibility(focus); this._controlPointsController.setVisibility(focus); this._onFocus = focus; this.fireEvent(focus ? 'ontfocus' : 'ontblur', this); } } - private _refreshShape(): void { + refreshShape(): void { const sPos = this._line2d.getFrom(); const tPos = this._line2d.getTo(); const ctrlPoints = this._line2d.getControlPoints(); @@ -253,6 +249,7 @@ class Relationship extends ConnectionLine { shapeCtrlPoints[0].y = ctrlPoints[0].y; shapeCtrlPoints[1].x = ctrlPoints[1].x; shapeCtrlPoints[1].y = ctrlPoints[1].y; + this._focusShape.updateLine(); } diff --git a/packages/mindplot/src/components/RelationshipControlPoints.ts b/packages/mindplot/src/components/RelationshipControlPoints.ts new file mode 100644 index 00000000..0927ee95 --- /dev/null +++ b/packages/mindplot/src/components/RelationshipControlPoints.ts @@ -0,0 +1,289 @@ +/* + * Copyright [2021] [wisemapping] + * + * Licensed under WiseMapping Public License, Version 1.0 (the "License"). + * It is basically the Apache License, Version 2.0 (the "License") plus the + * "powered by wisemapping" text requirement on every single page; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the license at + * + * http://www.wisemapping.org/license + * + * 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. + */ +// eslint-disable-next-line max-classes-per-file +import { Elipse, Line } from '@wisemapping/web2d'; +import Shape from './util/Shape'; +import ActionDispatcher from './ActionDispatcher'; +import Workspace from './Workspace'; +import PositionType from './PositionType'; +import Relationship from './Relationship'; + +enum PivotType { + Start = 0, + End = 1, +} + +class ControlPivotLine { + private _dot: Elipse; + + private _line: Line; + + private _pivotType: PivotType; + + private _workspace: Workspace; + + private _relationship: Relationship; + + private _changeHander: () => void; + + private _moveRelHandler: ( + relationPosition: PositionType, + controlPointPosition: PositionType, + ) => void; + + private _isVisible: boolean; + + private _mouseMoveHandler: (e: MouseEvent) => void; + + private _mousedUpHandler: () => void; + + constructor( + pivotType: PivotType, + relationship: Relationship, + mouseMoveHandler: (relationPosition: PositionType, controlPointPosition: PositionType) => void, + changeHander: () => void, + ) { + this._pivotType = pivotType; + this._changeHander = changeHander; + this._moveRelHandler = mouseMoveHandler; + this._relationship = relationship; + + // Build dot controller ... + this._dot = new Elipse({ + width: 6, + height: 6, + stroke: '1 solid #6589de', + fillColor: 'gray', + visibility: false, + }); + this._dot.setCursor('pointer'); + + // Build line ... + this._line = new Line({ strokeColor: '#6589de', strokeWidth: 1, opacity: 0.3 }); + + // Register events ... + this._dot.addEvent('mousedown', (event: MouseEvent) => { + this._mouseDown(event); + }); + + const mouseClick = (event: MouseEvent): boolean => { + event.preventDefault(); + event.stopPropagation(); + return false; + }; + this._dot.addEvent('click', mouseClick); + this._dot.addEvent('dblclick', mouseClick); + + // Register handled ... + this._mouseMoveHandler = (e: MouseEvent) => this.mouseMoveHandler(e); + this._mousedUpHandler = () => this._mouseUpHandler(); + } + + private _mouseDown(event: MouseEvent) { + this.getWorkspace().getScreenManager().addEvent('mousemove', this._mouseMoveHandler); + this.getWorkspace().getScreenManager().addEvent('mouseup', this._mousedUpHandler); + + event.preventDefault(); + event.stopPropagation(); + return false; + } + + setVisibility(value: boolean) { + this._isVisible = value; + + const screenManager = this.getWorkspace().getScreenManager(); + if (!value) { + screenManager.removeEvent('mousemove', this._mouseMoveHandler); + screenManager.removeEvent('mouseup', this._mouseUpHandler); + } + + // Make it visible ... + this._dot.setVisibility(value); + this._line.setVisibility(value); + + if (value) { + this.redraw(); + this._line.moveToFront(); + this._dot.moveToFront(); + } + } + + getPosition(): PositionType { + const line = this._relationship.getLine(); + return line.getControlPoints()[this._pivotType]; + } + + redraw(): void { + if (this._isVisible) { + const relationshipLine = this._relationship.getLine(); + const startPosition = + this._pivotType === PivotType.Start ? relationshipLine.getTo() : relationshipLine.getFrom(); + const ctrPosition = relationshipLine.getControlPoints()[this._pivotType]; + + this._line.setFrom(startPosition.x, startPosition.y); + this._line.setTo(startPosition.x - ctrPosition.x - 5, startPosition.y - ctrPosition.y - 5); + + this._dot.setPosition( + startPosition.x - ctrPosition.x - 8, + startPosition.y - ctrPosition.y - 8, + ); + } + } + + private mouseMoveHandler(event: MouseEvent) { + const screen = this._workspace.getScreenManager(); + const mousePosition = screen.getWorkspaceMousePosition(event); + + // Update relatioship position ... + let relationshipPosition: PositionType; + console.log(this._pivotType); + if (this._pivotType === PivotType.Start) { + relationshipPosition = Shape.calculateRelationShipPointCoordinates( + this._relationship.getSourceTopic(), + mousePosition, + ); + this._moveRelHandler(relationshipPosition, { + x: mousePosition.x - relationshipPosition.x, + y: mousePosition.y - relationshipPosition.y, + }); + } else { + relationshipPosition = Shape.calculateRelationShipPointCoordinates( + this._relationship.getTargetTopic(), + mousePosition, + ); + this._moveRelHandler(relationshipPosition, { + x: mousePosition.x - relationshipPosition.x, + y: mousePosition.y - relationshipPosition.y, + }); + } + + // Update pivot ... + this._dot.setPosition(mousePosition.x - 5, mousePosition.y - 3); + this._line.setTo(mousePosition.x - 2, mousePosition.y); + + // Update controller ... + this._relationship.getLine().updateLine(this._pivotType); + } + + private _mouseUpHandler() { + const screenManager = this.getWorkspace().getScreenManager(); + screenManager.removeEvent('mousemove', this._mouseMoveHandler); + screenManager.removeEvent('mouseup', this._mouseUpHandler); + + this._changeHander(); + } + + addToWorkspace(workspace: Workspace): void { + this._workspace = workspace; + + workspace.append(this._line); + workspace.append(this._dot); + } + + removeFromWorkspace(workspace: Workspace) { + // Hide all elements ... + this.setVisibility(false); + + // Remove elements ... + workspace.removeChild(this._line); + workspace.removeChild(this._dot); + } + + private getWorkspace(): Workspace { + return this._workspace!; + } +} + +class RelationshipControlPoints { + // Visual element ... + private _pivotLines: [ControlPivotLine, ControlPivotLine]; + + private _relationship: Relationship; + + private _relationshipLinePositions: [PositionType, PositionType]; + + constructor(relationship: Relationship) { + this._relationship = relationship; + const startControlLine = new ControlPivotLine( + PivotType.Start, + relationship, + (relationPosition, controlPointPosition) => { + const line = this._relationship.getLine(); + line.setFrom(relationPosition.x, relationPosition.y); + line.setSrcControlPoint(controlPointPosition); + + console.log(JSON.stringify(controlPointPosition)); + }, + () => { + const actionDispatcher = ActionDispatcher.getInstance(); + actionDispatcher.moveControlPoint(this, PivotType.Start); + + relationship.setOnFocus(true); + }, + ); + + const endControlLine = new ControlPivotLine( + PivotType.End, + relationship, + (relationPosition, controlPointPosition) => { + const line = this._relationship.getLine(); + line.setTo(relationPosition.x, relationPosition.y); + line.setDestControlPoint(controlPointPosition); + + console.log(JSON.stringify(controlPointPosition)); + }, + () => { + const actionDispatcher = ActionDispatcher.getInstance(); + actionDispatcher.moveControlPoint(this, PivotType.End); + + relationship.setOnFocus(true); + }, + ); + this._pivotLines = [startControlLine, endControlLine]; + } + + addToWorkspace(workspace: Workspace): void { + this._pivotLines.forEach((pivot) => workspace.append(pivot)); + } + + removeFromWorkspace(workspace: Workspace) { + this._pivotLines.forEach((pivot) => workspace.removeChild(pivot)); + } + + getRelationship() { + return this._relationship; + } + + redraw() { + this._pivotLines.forEach((pivot) => pivot.redraw()); + } + + setVisibility(value: boolean) { + this._pivotLines.forEach((pivot) => pivot.setVisibility(value)); + } + + getControlPointPosition(pivotType: PivotType): PositionType { + return this._pivotLines[pivotType].getPosition(); + } + + getRelationshipPosition(index: number): PositionType { + return { ...this._relationshipLinePositions[index] }; + } +} + +export default RelationshipControlPoints; diff --git a/packages/mindplot/src/components/StandaloneActionDispatcher.ts b/packages/mindplot/src/components/StandaloneActionDispatcher.ts index 95e57f08..ca1dffc8 100644 --- a/packages/mindplot/src/components/StandaloneActionDispatcher.ts +++ b/packages/mindplot/src/components/StandaloneActionDispatcher.ts @@ -35,6 +35,7 @@ import RelationshipModel from './model/RelationshipModel'; import Topic from './Topic'; import Command from './Command'; import FeatureType from './model/FeatureType'; +import RelationshipControlPoints from './RelationshipControlPoints'; class StandaloneActionDispatcher extends ActionDispatcher { private _actionRunner: DesignerActionRunner; @@ -93,8 +94,8 @@ class StandaloneActionDispatcher extends ActionDispatcher { } /** */ - moveControlPoint(ctrlPoint: Point, point: Point) { - const command = new MoveControlPointCommand(ctrlPoint, point); + moveControlPoint(ctrlPoint: RelationshipControlPoints, index: number) { + const command = new MoveControlPointCommand(ctrlPoint, index); this.execute(command); } diff --git a/packages/mindplot/src/components/Workspace.ts b/packages/mindplot/src/components/Workspace.ts index 2bb48914..7d1f956a 100644 --- a/packages/mindplot/src/components/Workspace.ts +++ b/packages/mindplot/src/components/Workspace.ts @@ -113,7 +113,7 @@ class Workspace { } private appendInternal(shape: Element2D): void { - if ($defined(shape.addToWorkspace)) { + if (shape.addToWorkspace) { shape.addToWorkspace(this); } else { this._workspace.append(shape); @@ -156,7 +156,7 @@ class Workspace { removeChild(shape: Element2D): void { // Element is a node, not a web2d element? - if ($defined(shape.removeFromWorkspace)) { + if (shape.removeFromWorkspace) { shape.removeFromWorkspace(this); } else { this._workspace.removeChild(shape); diff --git a/packages/mindplot/src/components/commands/MoveControlPointCommand.ts b/packages/mindplot/src/components/commands/MoveControlPointCommand.ts index 33523cf9..3a0d181e 100644 --- a/packages/mindplot/src/components/commands/MoveControlPointCommand.ts +++ b/packages/mindplot/src/components/commands/MoveControlPointCommand.ts @@ -15,28 +15,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { $assert, $defined } from '@wisemapping/core-js'; -import { Line } from '@wisemapping/web2d'; import Command from '../Command'; -import ControlPoint from '../ControlPoint'; +import RelationshipControlPoints from '../RelationshipControlPoints'; import PositionType from '../PositionType'; class MoveControlPointCommand extends Command { - private _ctrlPointControler: ControlPoint; + private _controlPoints: RelationshipControlPoints; - private _line: Line; + private _ctrPointPosition: PositionType; - private _controlPoint: Line; + private _endPosition: PositionType; - private _oldControlPoint: Line; - - private _originalEndPoint: PositionType; - - private _wasCustom: boolean; - - private _endPoint: any; - - private _point: number; + private _controlPointIndex: number; /** * @classdesc This command handles do/undo of changing the control points of a relationship @@ -44,85 +34,72 @@ class MoveControlPointCommand extends Command { * influence how the arrow is drawn (not the source or the destination topic nor the arrow * direction) */ - constructor(ctrlPointController: ControlPoint, point: number) { - $assert(ctrlPointController, 'line can not be null'); - $assert($defined(point), 'point can not be null'); - + constructor(controlPoints: RelationshipControlPoints, controlPointIndex: number) { super(); - this._ctrlPointControler = ctrlPointController; - this._line = ctrlPointController._line; - this._controlPoint = { ...this._ctrlPointControler.getControlPoint(point) }; - this._oldControlPoint = { ...this._ctrlPointControler.getOriginalCtrlPoint(point) }; - this._originalEndPoint = this._ctrlPointControler.getOriginalEndPoint(point); - switch (point) { - case 0: - this._wasCustom = this._line.getLine().isSrcControlPointCustom(); - this._endPoint = { ...this._line.getLine().getFrom() }; - break; - case 1: - this._wasCustom = this._line.getLine().isDestControlPointCustom(); - this._endPoint = { ...this._line.getLine().getTo() }; - break; - default: - break; - } - this._point = point; + this._ctrPointPosition = controlPoints.getControlPointPosition(controlPointIndex); + this._controlPointIndex = controlPointIndex; + this._controlPoints = controlPoints; + + const relLine = controlPoints.getRelationship().getLine(); + this._endPosition = controlPointIndex === 0 ? relLine.getFrom() : relLine.getTo(); } execute() { - const model = this._line.getModel(); - switch (this._point) { + const relationship = this._controlPoints.getRelationship(); + const model = relationship.getModel(); + switch (this._controlPointIndex) { case 0: - model.setSrcCtrlPoint({ ...this._controlPoint }); - this._line.setFrom(this._endPoint.x, this._endPoint.y); - this._line.setIsSrcControlPointCustom(true); - this._line.setSrcControlPoint({ ...this._controlPoint }); + model.setSrcCtrlPoint(this._ctrPointPosition); + relationship.setIsSrcControlPointCustom(true); + + relationship.setFrom(this._endPosition.x, this._endPosition.y); + relationship.setSrcControlPoint(this._ctrPointPosition); break; case 1: - model.setDestCtrlPoint({ ...this._controlPoint }); - this._wasCustom = this._line.getLine().isDestControlPointCustom(); - this._line.setTo(this._endPoint.x, this._endPoint.y); - this._line.setIsDestControlPointCustom(true); - this._line.setDestControlPoint({ ...this._controlPoint }); + model.setDestCtrlPoint(this._ctrPointPosition); + relationship.setIsDestControlPointCustom(true); + + relationship.setTo(this._endPosition.x, this._endPosition.y); + relationship.setDestControlPoint(this._ctrPointPosition); break; default: - break; + throw new Error('Illegal state exception'); } - if (this._line.isOnFocus()) { - this._line._refreshShape(); - this._ctrlPointControler.setLine(this._line); + + if (relationship.isOnFocus()) { + relationship.refreshShape(); } - this._line.getLine().updateLine(this._point); + // this.relationship.getLine().updateLine(this._point); } undoExecute() { - const line = this._line; - const model = line.getModel(); - switch (this._point) { - case 0: - if ($defined(this._oldControlPoint)) { - line.setFrom(this._originalEndPoint.x, this._originalEndPoint.y); - model.setSrcCtrlPoint({ ...this._oldControlPoint }); - line.setSrcControlPoint({ ...this._oldControlPoint }); - line.setIsSrcControlPointCustom(this._wasCustom); - } - break; - case 1: - if ($defined(this._oldControlPoint)) { - line.setTo(this._originalEndPoint.x, this._originalEndPoint.y); - model.setDestCtrlPoint({ ...this._oldControlPoint }); - line.setDestControlPoint({ ...this._oldControlPoint }); - line.setIsDestControlPointCustom(this._wasCustom); - } - break; - default: - break; - } - this._line.getLine().updateLine(this._point); - if (this._line.isOnFocus()) { - this._ctrlPointControler.setLine(line); - line._refreshShape(); - } + // const line = this._line; + // const model = line.getModel(); + // switch (this._controlPointIndex) { + // case 0: + // if ($defined(this._oldControlPoint)) { + // line.setFrom(this._oldRelEndpoint.x, this._oldRelEndpoint.y); + // model.setSrcCtrlPoint({ ...this._oldControlPoint }); + // line.setSrcControlPoint({ ...this._oldControlPoint }); + // line.setIsSrcControlPointCustom(this._isControlPointDefined); + // } + // break; + // case 1: + // if ($defined(this._oldControlPoint)) { + // line.setTo(this._oldRelEndpoint.x, this._oldRelEndpoint.y); + // model.setDestCtrlPoint({ ...this._oldControlPoint }); + // line.setDestControlPoint({ ...this._oldControlPoint }); + // line.setIsDestControlPointCustom(this._isControlPointDefined); + // } + // break; + // default: + // break; + // } + // // this._line.getLine().updateLine(this._point); + // // if (this._line.isOnFocus()) { + // // this._ctrlPointControler.setRelationshipLine(line); + // // line._refreshShape(); + // // } } } diff --git a/packages/web2d/src/components/peer/svg/CurvedLinePeer.js b/packages/web2d/src/components/peer/svg/CurvedLinePeer.js index b13723f2..bbec7f3c 100644 --- a/packages/web2d/src/components/peer/svg/CurvedLinePeer.js +++ b/packages/web2d/src/components/peer/svg/CurvedLinePeer.js @@ -35,10 +35,8 @@ class CurvedLinePeer extends ElementPeer { setSrcControlPoint(control) { this._customControlPoint_1 = true; const change = this._control1.x !== control.x || this._control1.y !== control.y; - if ($defined(control.x)) { - this._control1 = control; - this._control1.x = Number.parseFloat(this._control1.x, 10); - this._control1.y = Number.parseFloat(this._control1.y, 10); + if (control) { + this._control1 = { ...control }; } if (change) { this._updatePath(); @@ -48,12 +46,12 @@ class CurvedLinePeer extends ElementPeer { setDestControlPoint(control) { this._customControlPoint_2 = true; const change = this._control2.x !== control.x || this._control2.y !== control.y; - if ($defined(control.x)) { - this._control2 = control; - this._control2.x = Number.parseFloat(this._control2.x, 10); - this._control2.y = Number.parseFloat(this._control2.y, 10); + if (control) { + this._control2 = { ...control }; + } + if (change) { + this._updatePath(); } - if (change) this._updatePath(); } isSrcControlPointCustom() { @@ -73,7 +71,7 @@ class CurvedLinePeer extends ElementPeer { } getControlPoints() { - return [this._control1, this._control2]; + return [{ ...this._control1 }, { ...this._control2 }]; } setFrom(x1, y1) { @@ -155,19 +153,18 @@ class CurvedLinePeer extends ElementPeer { this._control1.x + this._x1 ).toFixed(2)},${this._control1.y + this._y1} ${(this._control2.x + this._x2).toFixed(2)},${( this._control2.y + this._y2 - ).toFixed(2)} ${this._x2.toFixed(2)},${this._y2.toFixed(2)}${ - this._lineStyle - ? ` ${(this._control2.x + this._x2).toFixed(2)},${( - this._control2.y + - this._y2 + - 3 - ).toFixed(2)} ${(this._control1.x + this._x1).toFixed(2)},${( - this._control1.y + - this._y1 + - 5 - ).toFixed(2)} ${this._x1.toFixed(2)},${(this._y1 + 7).toFixed(2)} Z` - : '' - }`; + ).toFixed(2)} ${this._x2.toFixed(2)},${this._y2.toFixed(2)}${this._lineStyle + ? ` ${(this._control2.x + this._x2).toFixed(2)},${( + this._control2.y + + this._y2 + + 3 + ).toFixed(2)} ${(this._control1.x + this._x1).toFixed(2)},${( + this._control1.y + + this._y1 + + 5 + ).toFixed(2)} ${this._x1.toFixed(2)},${(this._y1 + 7).toFixed(2)} Z` + : '' + }`; this._native.setAttribute('d', path); } } From 2a9c79fe92193e46aff7d365d1fe6bc60f25be02 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 27 Nov 2022 10:22:19 -0800 Subject: [PATCH 51/55] Keep fixing relatioship. --- packages/mindplot/src/components/DragPivot.ts | 5 +- packages/mindplot/src/components/DragTopic.ts | 9 +- packages/mindplot/src/components/MainTopic.ts | 5 +- .../mindplot/src/components/Relationship.ts | 131 ++++++++++-------- .../components/RelationshipControlPoints.ts | 113 +++++++-------- .../src/components/RelationshipPivot.ts | 10 +- .../src/components/commands/DeleteCommand.ts | 3 +- .../commands/MoveControlPointCommand.ts | 96 ++++++------- .../src/components/export/MDExporter.ts | 2 +- .../mindplot/src/components/util/Shape.js | 8 +- packages/web2d/src/components/Point.js | 13 +- .../src/components/peer/svg/ArrowPeer.js | 15 +- .../src/components/peer/svg/CurvedLinePeer.js | 16 +-- 13 files changed, 203 insertions(+), 223 deletions(-) diff --git a/packages/mindplot/src/components/DragPivot.ts b/packages/mindplot/src/components/DragPivot.ts index deabd39f..ccbfbfd0 100644 --- a/packages/mindplot/src/components/DragPivot.ts +++ b/packages/mindplot/src/components/DragPivot.ts @@ -17,6 +17,7 @@ */ import { $assert, $defined } from '@wisemapping/core-js'; import { Point, CurvedLine, Rect } from '@wisemapping/web2d'; +import PositionType from './PositionType'; import SizeType from './SizeType'; import Topic from './Topic'; @@ -24,7 +25,7 @@ import Shape from './util/Shape'; import Workspace from './Workspace'; class DragPivot { - private _position: Point; + private _position: PositionType; private _isVisible: boolean; @@ -41,7 +42,7 @@ class DragPivot { private _size: SizeType; constructor() { - this._position = new Point(); + this._position = { x: 0, y: 0 }; this._size = DragPivot.DEFAULT_PIVOT_SIZE; this._straightLine = this._buildStraightLine(); diff --git a/packages/mindplot/src/components/DragTopic.ts b/packages/mindplot/src/components/DragTopic.ts index 859b60b3..d7aee43b 100644 --- a/packages/mindplot/src/components/DragTopic.ts +++ b/packages/mindplot/src/components/DragTopic.ts @@ -49,8 +49,8 @@ class DragTopic { this._order = null; this._draggedNode = draggedNode; this._layoutManager = layoutManger; - this._position = new Point(); this._isInWorkspace = false; + this._position = new Point(0, 0); } setOrder(order: number): void { @@ -59,15 +59,14 @@ class DragTopic { setPosition(x: number, y: number): void { // Update drag shadow position .... - const position = { x, y }; - this._position.setValue(position.x, position.y); + this._position = { x, y }; // Elements are positioned in the center. // All topic element must be positioned based on the innerShape. const draggedNode = this._draggedNode; const size = draggedNode.getSize(); - const cx = position.x - (position.x > 0 ? 0 : size.width); - const cy = Math.ceil(position.y - size.height / 2); + const cx = x - (x > 0 ? 0 : size.width); + const cy = Math.ceil(y - size.height / 2); this._elem2d.setPosition(cx, cy); // In case is not free, pivot must be draw ... diff --git a/packages/mindplot/src/components/MainTopic.ts b/packages/mindplot/src/components/MainTopic.ts index 1d9c2be1..28c1ccd0 100644 --- a/packages/mindplot/src/components/MainTopic.ts +++ b/packages/mindplot/src/components/MainTopic.ts @@ -123,9 +123,8 @@ class MainTopic extends Topic { const isAtRight = Shape.isAtRight(targetPosition, pos); const size = this.getSize(); - let result: Point; + let result: Point = { x: 0, y: 0 }; if (this.getShapeType() === TopicShape.LINE) { - result = new Point(); const groupPosition = this.get2DElement().getPosition(); const innerShareSize = this.getInnerShape().getSize(); @@ -150,7 +149,7 @@ class MainTopic extends Topic { } else { result = Shape.calculateRectConnectionPoint(pos, size, isAtRight); } - return result; + return new Point(result.x, result.y); } } diff --git a/packages/mindplot/src/components/Relationship.ts b/packages/mindplot/src/components/Relationship.ts index 361433b2..4f5cd50c 100644 --- a/packages/mindplot/src/components/Relationship.ts +++ b/packages/mindplot/src/components/Relationship.ts @@ -16,7 +16,7 @@ * limitations under the License. */ import { $assert, $defined } from '@wisemapping/core-js'; -import { Arrow, Point, ElementClass } from '@wisemapping/web2d'; +import { Arrow, Point, CurvedLine } from '@wisemapping/web2d'; import ConnectionLine from './ConnectionLine'; import RelationshipControlPoints from './RelationshipControlPoints'; import RelationshipModel from './model/RelationshipModel'; @@ -26,7 +26,7 @@ import Shape from './util/Shape'; import Workspace from './Workspace'; class Relationship extends ConnectionLine { - private _focusShape: ElementClass; + private _focusShape: CurvedLine; private _onFocus: boolean; @@ -53,23 +53,22 @@ class Relationship extends ConnectionLine { const strokeColor = Relationship.getStrokeColor(); + // Build line .. this._line2d.setIsSrcControlPointCustom(false); this._line2d.setIsDestControlPointCustom(false); this._line2d.setCursor('pointer'); this._line2d.setStroke(1, 'solid', strokeColor); this._line2d.setDashed(4, 2); this._line2d.setTestId(`${model.getFromNode()}-${model.getToNode()}-relationship`); + + // Build focus shape ... this._focusShape = this._createLine(this.getLineType(), ConnectionLine.SIMPLE_CURVED); this._focusShape.setStroke(2, 'solid', '#3f96ff'); - - const ctrlPoints = this._line2d.getControlPoints(); - this._focusShape.setSrcControlPoint(ctrlPoints[0]); - this._focusShape.setDestControlPoint(ctrlPoints[1]); + this._focusShape.setIsSrcControlPointCustom(false); + this._focusShape.setIsDestControlPointCustom(false); this._focusShape.setVisibility(false); - this._onFocus = false; - this._isInWorkspace = false; - this._controlPointsController = new RelationshipControlPoints(this); + // Build arrow ... this._startArrow = new Arrow(); this._startArrow.setStrokeColor(strokeColor); this._startArrow.setStrokeWidth(2); @@ -81,6 +80,9 @@ class Relationship extends ConnectionLine { this._endArrow.setStrokeColor(strokeColor); this._endArrow.setStrokeWidth(2); } + this._onFocus = false; + this._isInWorkspace = false; + this._controlPointsController = new RelationshipControlPoints(this); // Position the line ... if (model.getSrcCtrlPoint()) { @@ -92,6 +94,10 @@ class Relationship extends ConnectionLine { const destPoint = { ...model.getDestCtrlPoint() }; this.setDestControlPoint(destPoint); } + + // Reposition all nodes ... + this._updatePositions(); + this._controlPointsController = new RelationshipControlPoints(this); } setStroke(color: string, style: string, opacity: number): void { @@ -99,43 +105,44 @@ class Relationship extends ConnectionLine { this._startArrow.setStrokeColor(color); } - redraw(): void { + private _updatePositions() { const line2d = this._line2d; const sourceTopic = this._sourceTopic; - const sourcePosition = sourceTopic.getPosition(); + const sPos = sourceTopic.getPosition(); const targetTopic = this._targetTopic; - let targetPosition = targetTopic.getPosition(); + let tPos = targetTopic.getPosition(); if (targetTopic.getType() === 'CentralTopic') { - targetPosition = Shape.workoutIncomingConnectionPoint(targetTopic, sourcePosition); + tPos = Shape.workoutIncomingConnectionPoint(targetTopic, sPos); } this._line2d.setStroke(2); - const ctrlPoints = this._line2d.getControlPoints(); - if (!this._line2d.isDestControlPointCustom() && !this._line2d.isSrcControlPointCustom()) { - const defaultPoints = Shape.calculateDefaultControlPoints(sourcePosition, targetPosition); - ctrlPoints[0].x = defaultPoints[0].x; - ctrlPoints[0].y = defaultPoints[0].y; + let ctrlPoints: [Point, Point]; - ctrlPoints[1].x = defaultPoints[1].x; - ctrlPoints[1].y = defaultPoints[1].y; + // Position line ... + if (!line2d.isDestControlPointCustom() && !line2d.isSrcControlPointCustom()) { + ctrlPoints = Shape.calculateDefaultControlPoints(sPos, tPos) as [PositionType, PositionType]; + } else { + ctrlPoints = line2d.getControlPoints(); } - const spoint = new Point(); - spoint.x = parseInt(ctrlPoints[0].x, 10) + parseInt(sourcePosition.x, 10); - spoint.y = parseInt(ctrlPoints[0].y, 10) + parseInt(sourcePosition.y, 10); + const spointX = ctrlPoints[0].x + sPos.x; + const spointY = ctrlPoints[0].y + sPos.y; - const tpoint = new Point(); - tpoint.x = parseInt(ctrlPoints[1].x, 10) + parseInt(targetPosition.x, 10); - tpoint.y = parseInt(ctrlPoints[1].y, 10) + parseInt(targetPosition.y, 10); + const tpointX = ctrlPoints[1].x + tPos.x; + const tpointY = ctrlPoints[1].y + tPos.y; - const sPos = Shape.calculateRelationShipPointCoordinates(sourceTopic, spoint); - const tPos = Shape.calculateRelationShipPointCoordinates(targetTopic, tpoint); + const nsPos = Shape.calculateRelationShipPointCoordinates( + sourceTopic, + new Point(spointX, spointY), + ); + const ntPos = Shape.calculateRelationShipPointCoordinates( + targetTopic, + new Point(tpointX, tpointY), + ); - line2d.setFrom(sPos.x, sPos.y); - line2d.setTo(tPos.x, tPos.y); - - line2d.moveToFront(); + line2d.setFrom(nsPos.x, nsPos.y); + line2d.setTo(ntPos.x, ntPos.y); // Positionate Arrows this._positionArrows(); @@ -143,11 +150,25 @@ class Relationship extends ConnectionLine { // Add connector ... this._positionateConnector(targetTopic); - if (this.isOnFocus()) { - this.refreshShape(); - } - this._focusShape.moveToBack(); + // Poisition refresh shape ... + this._positionRefreshShape(); + } + redraw(): void { + this._updatePositions(); + + this._line2d.moveToFront(); + this._startArrow.moveToBack(); + if (this._endArrow) { + this._endArrow.moveToBack(); + } + + if (this._showEndArrow) { + this._endArrow.setVisibility(this.isVisible()); + } + this._startArrow.setVisibility(this.isVisible() && this._showStartArrow); + + this._focusShape.moveToBack(); this._controlPointsController.redraw(); } @@ -156,11 +177,8 @@ class Relationship extends ConnectionLine { const spos = this._line2d.getFrom(); this._startArrow.setFrom(spos.x, spos.y); - this._startArrow.moveToBack(); - if (this._endArrow) { this._endArrow.setFrom(tpos.x, tpos.y); - this._endArrow.moveToBack(); } if (this._line2d.getType() === 'CurvedLine') { @@ -175,14 +193,11 @@ class Relationship extends ConnectionLine { this._endArrow.setControlPoint(this._line2d.getFrom()); } } - - if (this._showEndArrow) { - this._endArrow.setVisibility(this.isVisible()); - } - this._startArrow.setVisibility(this.isVisible() && this._showStartArrow); } addToWorkspace(workspace: Workspace): void { + this._updatePositions(); + workspace.append(this._focusShape); workspace.append(this._controlPointsController); @@ -225,12 +240,11 @@ class Relationship extends ConnectionLine { } setOnFocus(focus: boolean): void { + if (focus) { + this._positionRefreshShape(); + } // Change focus shape if (this.isOnFocus() !== focus) { - if (focus) { - this.refreshShape(); - } - this._focusShape.setVisibility(focus); this._controlPointsController.setVisibility(focus); this._onFocus = focus; @@ -238,17 +252,16 @@ class Relationship extends ConnectionLine { } } - refreshShape(): void { + private _positionRefreshShape(): void { const sPos = this._line2d.getFrom(); const tPos = this._line2d.getTo(); + const ctrlPoints = this._line2d.getControlPoints(); this._focusShape.setFrom(sPos.x, sPos.y); this._focusShape.setTo(tPos.x, tPos.y); - const shapeCtrlPoints = this._focusShape.getControlPoints(); - shapeCtrlPoints[0].x = ctrlPoints[0].x; - shapeCtrlPoints[0].y = ctrlPoints[0].y; - shapeCtrlPoints[1].x = ctrlPoints[1].x; - shapeCtrlPoints[1].y = ctrlPoints[1].y; + + this._focusShape.setSrcControlPoint(ctrlPoints[0]); + this._focusShape.setDestControlPoint(ctrlPoints[1]); this._focusShape.updateLine(); } @@ -302,12 +315,12 @@ class Relationship extends ConnectionLine { } } - setShowStartArrow(visible: boolean) { + setShowStartArrow(visible: boolean): void { this._showStartArrow = visible; if (this._isInWorkspace) this.redraw(); } - setFrom(x: number, y: number) { + setFrom(x: number, y: number): void { $assert($defined(x), 'x must be defined'); $assert($defined(y), 'y must be defined'); @@ -325,12 +338,16 @@ class Relationship extends ConnectionLine { setSrcControlPoint(control: PositionType): void { this._line2d.setSrcControlPoint(control); + this._focusShape.setSrcControlPoint(control); this._startArrow.setControlPoint(control); } setDestControlPoint(control: PositionType) { this._line2d.setDestControlPoint(control); - if (this._showEndArrow) this._endArrow.setControlPoint(control); + this._focusShape.setSrcControlPoint(control); + if (this._showEndArrow) { + this._endArrow.setControlPoint(control); + } } getControlPoints(): PositionType { diff --git a/packages/mindplot/src/components/RelationshipControlPoints.ts b/packages/mindplot/src/components/RelationshipControlPoints.ts index 0927ee95..178d2590 100644 --- a/packages/mindplot/src/components/RelationshipControlPoints.ts +++ b/packages/mindplot/src/components/RelationshipControlPoints.ts @@ -23,7 +23,8 @@ import Workspace from './Workspace'; import PositionType from './PositionType'; import Relationship from './Relationship'; -enum PivotType { +// eslint-disable-next-line no-shadow +export enum PivotType { Start = 0, End = 1, } @@ -41,21 +42,20 @@ class ControlPivotLine { private _changeHander: () => void; - private _moveRelHandler: ( - relationPosition: PositionType, - controlPointPosition: PositionType, - ) => void; + private _moveRelHandler: (controlPointPosition: PositionType) => void; private _isVisible: boolean; private _mouseMoveHandler: (e: MouseEvent) => void; - private _mousedUpHandler: () => void; + private _mouseUpHandler: () => void; + + private _mouseDownHandler: (event: MouseEvent) => void; constructor( pivotType: PivotType, relationship: Relationship, - mouseMoveHandler: (relationPosition: PositionType, controlPointPosition: PositionType) => void, + mouseMoveHandler: (controlPointPosition: PositionType) => void, changeHander: () => void, ) { this._pivotType = pivotType; @@ -76,11 +76,6 @@ class ControlPivotLine { // Build line ... this._line = new Line({ strokeColor: '#6589de', strokeWidth: 1, opacity: 0.3 }); - // Register events ... - this._dot.addEvent('mousedown', (event: MouseEvent) => { - this._mouseDown(event); - }); - const mouseClick = (event: MouseEvent): boolean => { event.preventDefault(); event.stopPropagation(); @@ -91,32 +86,39 @@ class ControlPivotLine { // Register handled ... this._mouseMoveHandler = (e: MouseEvent) => this.mouseMoveHandler(e); - this._mousedUpHandler = () => this._mouseUpHandler(); + this._mouseUpHandler = () => this.mouseUpHandler(); + this._mouseDownHandler = (event: MouseEvent) => this.mouseDownHandler(event); } - private _mouseDown(event: MouseEvent) { - this.getWorkspace().getScreenManager().addEvent('mousemove', this._mouseMoveHandler); - this.getWorkspace().getScreenManager().addEvent('mouseup', this._mousedUpHandler); + private mouseDownHandler(event: MouseEvent) { + const screenManager = this.getWorkspace().getScreenManager(); + screenManager.addEvent('mousemove', this._mouseMoveHandler); + screenManager.addEvent('mouseup', this._mouseUpHandler); event.preventDefault(); event.stopPropagation(); - return false; } setVisibility(value: boolean) { - this._isVisible = value; + if (this._isVisible !== value) { + const screenManager = this.getWorkspace().getScreenManager(); + if (!value) { + screenManager.removeEvent('mousemove', this._mouseMoveHandler); + screenManager.removeEvent('mouseup', this._mouseUpHandler); + this._dot.removeEvent('mousedown', this._mouseDownHandler); + } else { + // Register events ... + this._dot.addEvent('mousedown', this._mouseDownHandler); + } - const screenManager = this.getWorkspace().getScreenManager(); - if (!value) { - screenManager.removeEvent('mousemove', this._mouseMoveHandler); - screenManager.removeEvent('mouseup', this._mouseUpHandler); + // Make it visible ... + this._dot.setVisibility(value); + this._line.setVisibility(value); } - // Make it visible ... - this._dot.setVisibility(value); - this._line.setVisibility(value); - + this._isVisible = value; if (value) { + // Register events ... this.redraw(); this._line.moveToFront(); this._dot.moveToFront(); @@ -132,15 +134,15 @@ class ControlPivotLine { if (this._isVisible) { const relationshipLine = this._relationship.getLine(); const startPosition = - this._pivotType === PivotType.Start ? relationshipLine.getTo() : relationshipLine.getFrom(); + this._pivotType === PivotType.End ? relationshipLine.getTo() : relationshipLine.getFrom(); const ctrPosition = relationshipLine.getControlPoints()[this._pivotType]; this._line.setFrom(startPosition.x, startPosition.y); - this._line.setTo(startPosition.x - ctrPosition.x - 5, startPosition.y - ctrPosition.y - 5); + this._line.setTo(startPosition.x + ctrPosition.x - 5, startPosition.y + ctrPosition.y - 5); this._dot.setPosition( - startPosition.x - ctrPosition.x - 8, - startPosition.y - ctrPosition.y - 8, + startPosition.x + ctrPosition.x - 8, + startPosition.y + ctrPosition.y - 8, ); } } @@ -150,37 +152,24 @@ class ControlPivotLine { const mousePosition = screen.getWorkspaceMousePosition(event); // Update relatioship position ... - let relationshipPosition: PositionType; - console.log(this._pivotType); - if (this._pivotType === PivotType.Start) { - relationshipPosition = Shape.calculateRelationShipPointCoordinates( - this._relationship.getSourceTopic(), - mousePosition, - ); - this._moveRelHandler(relationshipPosition, { - x: mousePosition.x - relationshipPosition.x, - y: mousePosition.y - relationshipPosition.y, - }); - } else { - relationshipPosition = Shape.calculateRelationShipPointCoordinates( - this._relationship.getTargetTopic(), - mousePosition, - ); - this._moveRelHandler(relationshipPosition, { - x: mousePosition.x - relationshipPosition.x, - y: mousePosition.y - relationshipPosition.y, - }); - } + const topic = + this._pivotType === PivotType.Start + ? this._relationship.getSourceTopic() + : this._relationship.getTargetTopic(); + + const relPos = Shape.calculateRelationShipPointCoordinates(topic, mousePosition); + const ctlPoint = { x: mousePosition.x - relPos.x, y: mousePosition.y - relPos.y }; + this._moveRelHandler(ctlPoint); // Update pivot ... - this._dot.setPosition(mousePosition.x - 5, mousePosition.y - 3); - this._line.setTo(mousePosition.x - 2, mousePosition.y); + this._dot.setPosition(mousePosition.x - 8, mousePosition.y - 8); - // Update controller ... - this._relationship.getLine().updateLine(this._pivotType); + // Update line ... + this._line.setTo(mousePosition.x - 5, mousePosition.y - 5); + this._line.setFrom(relPos.x, relPos.y); } - private _mouseUpHandler() { + private mouseUpHandler() { const screenManager = this.getWorkspace().getScreenManager(); screenManager.removeEvent('mousemove', this._mouseMoveHandler); screenManager.removeEvent('mouseup', this._mouseUpHandler); @@ -222,12 +211,10 @@ class RelationshipControlPoints { const startControlLine = new ControlPivotLine( PivotType.Start, relationship, - (relationPosition, controlPointPosition) => { + (controlPointPosition) => { const line = this._relationship.getLine(); - line.setFrom(relationPosition.x, relationPosition.y); line.setSrcControlPoint(controlPointPosition); - - console.log(JSON.stringify(controlPointPosition)); + relationship.redraw(); }, () => { const actionDispatcher = ActionDispatcher.getInstance(); @@ -240,12 +227,10 @@ class RelationshipControlPoints { const endControlLine = new ControlPivotLine( PivotType.End, relationship, - (relationPosition, controlPointPosition) => { + (controlPointPosition) => { const line = this._relationship.getLine(); - line.setTo(relationPosition.x, relationPosition.y); line.setDestControlPoint(controlPointPosition); - - console.log(JSON.stringify(controlPointPosition)); + relationship.redraw(); }, () => { const actionDispatcher = ActionDispatcher.getInstance(); diff --git a/packages/mindplot/src/components/RelationshipPivot.ts b/packages/mindplot/src/components/RelationshipPivot.ts index 6d862068..fc42bca6 100644 --- a/packages/mindplot/src/components/RelationshipPivot.ts +++ b/packages/mindplot/src/components/RelationshipPivot.ts @@ -152,11 +152,11 @@ class RelationshipPivot { sourcePosition = Shape.workoutIncomingConnectionPoint(this._sourceTopic, toPosition); } const controlPoint = Shape.calculateDefaultControlPoints(sourcePosition, toPosition); - - const spoint = new Point(); - spoint.x = parseInt(controlPoint[0].x, 10) + sourcePosition.x; - spoint.y = parseInt(controlPoint[0].y, 10) + sourcePosition.y; - return Shape.calculateRelationShipPointCoordinates(this._sourceTopic, spoint); + const point = new Point( + parseInt(controlPoint[0].x, 10) + sourcePosition.x, + parseInt(controlPoint[0].y, 10) + sourcePosition.y, + ); + return Shape.calculateRelationShipPointCoordinates(this._sourceTopic, point); } private _connectOnFocus(event: string, targetTopic: Topic): void { diff --git a/packages/mindplot/src/components/commands/DeleteCommand.ts b/packages/mindplot/src/components/commands/DeleteCommand.ts index b3fa6d9d..791b2da7 100644 --- a/packages/mindplot/src/components/commands/DeleteCommand.ts +++ b/packages/mindplot/src/components/commands/DeleteCommand.ts @@ -16,6 +16,7 @@ * limitations under the License. */ import { $assert, $defined } from '@wisemapping/core-js'; +import flatten from 'lodash/flatten'; import Command from '../Command'; import CommandContext from '../CommandContext'; import NodeModel from '../model/NodeModel'; @@ -169,7 +170,7 @@ class DeleteCommand extends Command { const rels: Relationship[][] = children.map((t: Topic) => this._collectInDepthRelationships(t)); // flatten and concact - result.push(...rels.flat()); + result.push(...flatten(rels)); if (result.length > 0) { // Filter for unique ... diff --git a/packages/mindplot/src/components/commands/MoveControlPointCommand.ts b/packages/mindplot/src/components/commands/MoveControlPointCommand.ts index 3a0d181e..cf907c91 100644 --- a/packages/mindplot/src/components/commands/MoveControlPointCommand.ts +++ b/packages/mindplot/src/components/commands/MoveControlPointCommand.ts @@ -16,17 +16,17 @@ * limitations under the License. */ import Command from '../Command'; -import RelationshipControlPoints from '../RelationshipControlPoints'; +import RelationshipControlPoints, { PivotType } from '../RelationshipControlPoints'; import PositionType from '../PositionType'; class MoveControlPointCommand extends Command { private _controlPoints: RelationshipControlPoints; - private _ctrPointPosition: PositionType; + private _ctrIndex: PivotType; - private _endPosition: PositionType; + private _oldCtrPoint: PositionType; - private _controlPointIndex: number; + private _newCtrPoint: PositionType; /** * @classdesc This command handles do/undo of changing the control points of a relationship @@ -34,72 +34,66 @@ class MoveControlPointCommand extends Command { * influence how the arrow is drawn (not the source or the destination topic nor the arrow * direction) */ - constructor(controlPoints: RelationshipControlPoints, controlPointIndex: number) { + constructor(controlPoints: RelationshipControlPoints, ctrIndex: PivotType) { super(); - this._ctrPointPosition = controlPoints.getControlPointPosition(controlPointIndex); - this._controlPointIndex = controlPointIndex; + // New control points ... this._controlPoints = controlPoints; + this._ctrIndex = ctrIndex; + this._newCtrPoint = controlPoints.getControlPointPosition(ctrIndex); - const relLine = controlPoints.getRelationship().getLine(); - this._endPosition = controlPointIndex === 0 ? relLine.getFrom() : relLine.getTo(); + // Backup previous control points ... + const relationship = controlPoints.getRelationship(); + const model = relationship.getModel(); + this._oldCtrPoint = + PivotType.Start === ctrIndex ? model.getSrcCtrlPoint() : model.getDestCtrlPoint(); + + // New relationship ... + this._newCtrPoint = controlPoints.getControlPointPosition(ctrIndex); } execute() { const relationship = this._controlPoints.getRelationship(); const model = relationship.getModel(); - switch (this._controlPointIndex) { - case 0: - model.setSrcCtrlPoint(this._ctrPointPosition); + switch (this._ctrIndex) { + case PivotType.Start: + model.setSrcCtrlPoint(this._newCtrPoint); relationship.setIsSrcControlPointCustom(true); - - relationship.setFrom(this._endPosition.x, this._endPosition.y); - relationship.setSrcControlPoint(this._ctrPointPosition); + relationship.setSrcControlPoint(this._newCtrPoint); break; - case 1: - model.setDestCtrlPoint(this._ctrPointPosition); + case PivotType.End: + model.setDestCtrlPoint(this._newCtrPoint); relationship.setIsDestControlPointCustom(true); - - relationship.setTo(this._endPosition.x, this._endPosition.y); - relationship.setDestControlPoint(this._ctrPointPosition); + relationship.setDestControlPoint(this._newCtrPoint); break; default: throw new Error('Illegal state exception'); } - if (relationship.isOnFocus()) { - relationship.refreshShape(); - } - // this.relationship.getLine().updateLine(this._point); + relationship.redraw(); } undoExecute() { - // const line = this._line; - // const model = line.getModel(); - // switch (this._controlPointIndex) { - // case 0: - // if ($defined(this._oldControlPoint)) { - // line.setFrom(this._oldRelEndpoint.x, this._oldRelEndpoint.y); - // model.setSrcCtrlPoint({ ...this._oldControlPoint }); - // line.setSrcControlPoint({ ...this._oldControlPoint }); - // line.setIsSrcControlPointCustom(this._isControlPointDefined); - // } - // break; - // case 1: - // if ($defined(this._oldControlPoint)) { - // line.setTo(this._oldRelEndpoint.x, this._oldRelEndpoint.y); - // model.setDestCtrlPoint({ ...this._oldControlPoint }); - // line.setDestControlPoint({ ...this._oldControlPoint }); - // line.setIsDestControlPointCustom(this._isControlPointDefined); - // } - // break; - // default: - // break; - // } - // // this._line.getLine().updateLine(this._point); - // // if (this._line.isOnFocus()) { - // // this._ctrlPointControler.setRelationshipLine(line); - // // line._refreshShape(); - // // } + const relationship = this._controlPoints.getRelationship(); + const model = relationship.getModel(); + + const isCustom = this._oldCtrPoint != null; + relationship.setIsDestControlPointCustom(isCustom); + + switch (this._ctrIndex) { + case PivotType.Start: + model.setSrcCtrlPoint(this._oldCtrPoint); + relationship.setSrcControlPoint(this._oldCtrPoint); + break; + case PivotType.End: + model.setDestCtrlPoint(this._oldCtrPoint); + relationship.setDestControlPoint(this._oldCtrPoint); + break; + default: + throw new Error('Illegal state exception'); + } + + console.log('undo ...'); + relationship.redraw(); } } diff --git a/packages/mindplot/src/components/export/MDExporter.ts b/packages/mindplot/src/components/export/MDExporter.ts index af00b552..e144c773 100644 --- a/packages/mindplot/src/components/export/MDExporter.ts +++ b/packages/mindplot/src/components/export/MDExporter.ts @@ -91,7 +91,7 @@ class MDExporter extends Exporter { }); result = `${result}\n`; - if (node.getChildren().filter((n) => n.getText() !== undefined).length > 0) { + if (node.getChildren().filter((n) => n.getText() !== null).length > 0) { result += this.traverseBranch(`${prefix}\t`, node.getChildren()); } }); diff --git a/packages/mindplot/src/components/util/Shape.js b/packages/mindplot/src/components/util/Shape.js index 2feefc04..20ba4efa 100644 --- a/packages/mindplot/src/components/util/Shape.js +++ b/packages/mindplot/src/components/util/Shape.js @@ -32,18 +32,16 @@ const Shape = { $assert(rectSize, 'rectSize can not be null'); $assert($defined(isAtRight), 'isRight can not be null'); - // Node is placed at the right ? - const result = new Point(); - // This is used fix a minor difference ...z const correctionHardcode = 2; + let result; if (isAtRight) { - result.setValue( + result = new Point( rectCenterPoint.x - rectSize.width / 2 + correctionHardcode, rectCenterPoint.y, ); } else { - result.setValue( + result = new Point( parseFloat(rectCenterPoint.x) + rectSize.width / 2 - correctionHardcode, rectCenterPoint.y, ); diff --git a/packages/web2d/src/components/Point.js b/packages/web2d/src/components/Point.js index a28fbb79..e07ebaed 100644 --- a/packages/web2d/src/components/Point.js +++ b/packages/web2d/src/components/Point.js @@ -15,6 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { $assert } from '@wisemapping/core-js'; class Point { /** @@ -23,15 +24,9 @@ class Point { * @param {Number} y coordinate */ constructor(x, y) { - this.x = x; - this.y = y; - } + $assert(typeof x === 'number', `x is not a number: ${x}`); + $assert(typeof y === 'number', `x is not a number: ${y}`); - /** - * @param {Number} x coordinate - * @param {Number} y coordinate - */ - setValue(x, y) { this.x = x; this.y = y; } @@ -47,7 +42,7 @@ class Point { Point.fromString = function pointFromString(point) { const values = point.split(','); - return new Point(values[0], values[1]); + return new Point(Number.parseInt(values[0], 10), Number.parseInt(values[1], 10)); }; export default Point; diff --git a/packages/web2d/src/components/peer/svg/ArrowPeer.js b/packages/web2d/src/components/peer/svg/ArrowPeer.js index bd9c5696..aa678074 100644 --- a/packages/web2d/src/components/peer/svg/ArrowPeer.js +++ b/packages/web2d/src/components/peer/svg/ArrowPeer.js @@ -25,13 +25,10 @@ class ArrowPeer extends ElementPeer { const svgElement = window.document.createElementNS(ElementPeer.svgNamespace, 'path'); super(svgElement); this._style = {}; - this._controlPoint = new Point(); - this._fromPoint = new Point(); } setFrom(x, y) { - this._fromPoint.x = x; - this._fromPoint.y = y; + this._fromPoint = new Point(x, y); this._redraw(); } @@ -71,12 +68,7 @@ class ArrowPeer extends ElementPeer { let y; let xp; let yp; - if ( - $defined(this._fromPoint.x) && - $defined(this._fromPoint.y) && - $defined(this._controlPoint.x) && - $defined(this._controlPoint.y) - ) { + if (this._fromPoint && this._controlPoint) { if (this._controlPoint.y === 0) this._controlPoint.y = 1; const y0 = this._controlPoint.y; @@ -100,8 +92,7 @@ class ArrowPeer extends ElementPeer { const path = `M${this._fromPoint.x},${this._fromPoint.y} ` + - `L${x + this._fromPoint.x},${y + this._fromPoint.y} M${this._fromPoint.x},${ - this._fromPoint.y + `L${x + this._fromPoint.x},${y + this._fromPoint.y} M${this._fromPoint.x},${this._fromPoint.y } ` + `L${xp + this._fromPoint.x},${yp + this._fromPoint.y}`; this._native.setAttribute('d', path); diff --git a/packages/web2d/src/components/peer/svg/CurvedLinePeer.js b/packages/web2d/src/components/peer/svg/CurvedLinePeer.js index bbec7f3c..87a535a6 100644 --- a/packages/web2d/src/components/peer/svg/CurvedLinePeer.js +++ b/packages/web2d/src/components/peer/svg/CurvedLinePeer.js @@ -27,8 +27,8 @@ class CurvedLinePeer extends ElementPeer { this._updateStyle(); this._customControlPoint_1 = false; this._customControlPoint_2 = false; - this._control1 = new Point(); - this._control2 = new Point(); + this._control1 = new Point(0, 0); + this._control2 = new Point(0, 0); this._lineStyle = true; } @@ -78,7 +78,7 @@ class CurvedLinePeer extends ElementPeer { const change = this._x1 !== Number.parseFloat(x1, 10) || this._y1 !== Number.parseFloat(y1, 10); this._x1 = Number.parseFloat(x1, 10); this._y1 = Number.parseFloat(y1, 10); - if (change) this._updatePath(); + if (change) { this._updatePath(); } } setTo(x2, y2) { @@ -149,16 +149,16 @@ class CurvedLinePeer extends ElementPeer { if ($defined(this._x1) && $defined(this._y1) && $defined(this._x2) && $defined(this._y2)) { this._calculateAutoControlPoints(avoidControlPointFix); - const path = `M${this._x1.toFixed(2)},${this._y1.toFixed(2)} C${( + const path = `M${this._x1.toFixed(2)},${this._y1.toFixed()} C${( this._control1.x + this._x1 - ).toFixed(2)},${this._control1.y + this._y1} ${(this._control2.x + this._x2).toFixed(2)},${( + ).toFixed(2)},${this._control1.y + this._y1} ${(this._control2.x + this._x2).toFixed()},${( this._control2.y + this._y2 - ).toFixed(2)} ${this._x2.toFixed(2)},${this._y2.toFixed(2)}${this._lineStyle - ? ` ${(this._control2.x + this._x2).toFixed(2)},${( + ).toFixed(2)} ${this._x2.toFixed(2)},${this._y2.toFixed()}${this._lineStyle + ? ` ${(this._control2.x + this._x2).toFixed()},${( this._control2.y + this._y2 + 3 - ).toFixed(2)} ${(this._control1.x + this._x1).toFixed(2)},${( + ).toFixed(2)} ${(this._control1.x + this._x1).toFixed()},${( this._control1.y + this._y1 + 5 From 9860ac782cd48f137fea47a04e1923d0383aed75 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 27 Nov 2022 21:28:32 -0800 Subject: [PATCH 52/55] Add background shadow on relationship. --- .../mindplot/src/components/Relationship.ts | 54 +++++++++++-------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/packages/mindplot/src/components/Relationship.ts b/packages/mindplot/src/components/Relationship.ts index 4f5cd50c..d5960f52 100644 --- a/packages/mindplot/src/components/Relationship.ts +++ b/packages/mindplot/src/components/Relationship.ts @@ -40,7 +40,7 @@ class Relationship extends ConnectionLine { private _endArrow: Arrow; - private _controlPointControllerListener; + private _onFocusHandler: (event: MouseEvent) => void; private _showStartArrow: Arrow; @@ -63,10 +63,12 @@ class Relationship extends ConnectionLine { // Build focus shape ... this._focusShape = this._createLine(this.getLineType(), ConnectionLine.SIMPLE_CURVED); - this._focusShape.setStroke(2, 'solid', '#3f96ff'); + this._focusShape.setStroke(8, 'solid', '#3f96ff'); this._focusShape.setIsSrcControlPointCustom(false); this._focusShape.setIsDestControlPointCustom(false); - this._focusShape.setVisibility(false); + this._focusShape.setVisibility(true); + this._focusShape.setOpacity(0); + this._focusShape.setCursor('pointer'); // Build arrow ... this._startArrow = new Arrow(); @@ -96,8 +98,16 @@ class Relationship extends ConnectionLine { } // Reposition all nodes ... - this._updatePositions(); + this.updatePositions(); this._controlPointsController = new RelationshipControlPoints(this); + + // Initialize handler .. + + this._onFocusHandler = (event) => { + this.setOnFocus(true); + event.stopPropagation(); + event.preventDefault(); + }; } setStroke(color: string, style: string, opacity: number): void { @@ -105,7 +115,7 @@ class Relationship extends ConnectionLine { this._startArrow.setStrokeColor(color); } - private _updatePositions() { + private updatePositions() { const line2d = this._line2d; const sourceTopic = this._sourceTopic; const sPos = sourceTopic.getPosition(); @@ -145,17 +155,17 @@ class Relationship extends ConnectionLine { line2d.setTo(ntPos.x, ntPos.y); // Positionate Arrows - this._positionArrows(); + this.positionArrows(); // Add connector ... this._positionateConnector(targetTopic); // Poisition refresh shape ... - this._positionRefreshShape(); + this.positionRefreshShape(); } redraw(): void { - this._updatePositions(); + this.updatePositions(); this._line2d.moveToFront(); this._startArrow.moveToBack(); @@ -172,7 +182,7 @@ class Relationship extends ConnectionLine { this._controlPointsController.redraw(); } - private _positionArrows(): void { + private positionArrows(): void { const tpos = this._line2d.getTo(); const spos = this._line2d.getFrom(); @@ -196,16 +206,16 @@ class Relationship extends ConnectionLine { } addToWorkspace(workspace: Workspace): void { - this._updatePositions(); + this.updatePositions(); workspace.append(this._focusShape); workspace.append(this._controlPointsController); - this._controlPointControllerListener = this._initializeControlPointController.bind(this); if (workspace.isReadOnly()) { this._line2d.setCursor('default'); } else { - this._line2d.addEvent('click', this._controlPointControllerListener); + this._line2d.addEvent('click', this._onFocusHandler); + this._focusShape.addEvent('click', this._onFocusHandler); } this._isInWorkspace = true; @@ -213,19 +223,15 @@ class Relationship extends ConnectionLine { if (this._endArrow) workspace.append(this._endArrow); super.addToWorkspace(workspace); - this._positionArrows(); + this.positionArrows(); this.redraw(); } - private _initializeControlPointController(): void { - this.setOnFocus(true); - } - removeFromWorkspace(workspace: Workspace): void { workspace.removeChild(this._focusShape); workspace.removeChild(this._controlPointsController); - this._line2d.removeEvent('click', this._controlPointControllerListener); + this._line2d.removeEvent('click', this._onFocusHandler); this._isInWorkspace = false; workspace.removeChild(this._startArrow); if (this._endArrow) { @@ -241,18 +247,21 @@ class Relationship extends ConnectionLine { setOnFocus(focus: boolean): void { if (focus) { - this._positionRefreshShape(); + this.positionRefreshShape(); } // Change focus shape if (this.isOnFocus() !== focus) { - this._focusShape.setVisibility(focus); + // Focus is always present to support on over + this._focusShape.setOpacity(focus ? 1 : 0); + this._focusShape.setStroke(focus ? 2 : 8, 'solid', '#3f96ff'); + this._controlPointsController.setVisibility(focus); this._onFocus = focus; this.fireEvent(focus ? 'ontfocus' : 'ontblur', this); } } - private _positionRefreshShape(): void { + private positionRefreshShape(): void { const sPos = this._line2d.getFrom(); const tPos = this._line2d.getTo(); @@ -292,10 +301,13 @@ class Relationship extends ConnectionLine { // If visibility change, remove the on focus. this.setOnFocus(false); + // Hide on gocus shade ... + if (this._showEndArrow) { this._endArrow.setVisibility(this._showEndArrow); } this._startArrow.setVisibility(this._showStartArrow && value, fade); + this._focusShape.setVisibility(value); } setOpacity(opacity: number): void { From 7f26432e06f0ea00b9e4929426aadd5b8ffdd63e Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 29 Nov 2022 18:57:39 -0800 Subject: [PATCH 53/55] Hack source position. --- .../mindplot/src/components/RelationshipControlPoints.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/mindplot/src/components/RelationshipControlPoints.ts b/packages/mindplot/src/components/RelationshipControlPoints.ts index 178d2590..f9b2170f 100644 --- a/packages/mindplot/src/components/RelationshipControlPoints.ts +++ b/packages/mindplot/src/components/RelationshipControlPoints.ts @@ -157,7 +157,7 @@ class ControlPivotLine { ? this._relationship.getSourceTopic() : this._relationship.getTargetTopic(); - const relPos = Shape.calculateRelationShipPointCoordinates(topic, mousePosition); + let relPos = Shape.calculateRelationShipPointCoordinates(topic, mousePosition); const ctlPoint = { x: mousePosition.x - relPos.x, y: mousePosition.y - relPos.y }; this._moveRelHandler(ctlPoint); @@ -166,6 +166,10 @@ class ControlPivotLine { // Update line ... this._line.setTo(mousePosition.x - 5, mousePosition.y - 5); + relPos = + this._pivotType === PivotType.Start + ? this._relationship.getLine().getFrom() + : this._relationship.getLine().getTo(); this._line.setFrom(relPos.x, relPos.y); } From 2bb205ce4a2d06cd4b3875e8f1906d172e5d1653 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 29 Nov 2022 19:08:49 -0800 Subject: [PATCH 54/55] Fix by reference object issue on relationship. --- .../src/components/commands/MoveControlPointCommand.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/mindplot/src/components/commands/MoveControlPointCommand.ts b/packages/mindplot/src/components/commands/MoveControlPointCommand.ts index cf907c91..48679c75 100644 --- a/packages/mindplot/src/components/commands/MoveControlPointCommand.ts +++ b/packages/mindplot/src/components/commands/MoveControlPointCommand.ts @@ -46,9 +46,10 @@ class MoveControlPointCommand extends Command { const model = relationship.getModel(); this._oldCtrPoint = PivotType.Start === ctrIndex ? model.getSrcCtrlPoint() : model.getDestCtrlPoint(); + this._oldCtrPoint = { ...this._oldCtrPoint }; // New relationship ... - this._newCtrPoint = controlPoints.getControlPointPosition(ctrIndex); + this._newCtrPoint = { ...controlPoints.getControlPointPosition(ctrIndex) }; } execute() { From d3159d8a20e41685655b1dec5f1a9d4b4fe9e5f7 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 29 Nov 2022 20:49:52 -0800 Subject: [PATCH 55/55] Reimplement undo for relationship. --- .../src/components/ActionDispatcher.ts | 9 +- .../mindplot/src/components/CommandContext.ts | 26 +++--- .../components/RelationshipControlPoints.ts | 16 ++-- .../components/StandaloneActionDispatcher.ts | 7 +- .../commands/MoveControlPointCommand.ts | 82 +++++++------------ 5 files changed, 59 insertions(+), 81 deletions(-) diff --git a/packages/mindplot/src/components/ActionDispatcher.ts b/packages/mindplot/src/components/ActionDispatcher.ts index 8a0a6587..4e99a739 100644 --- a/packages/mindplot/src/components/ActionDispatcher.ts +++ b/packages/mindplot/src/components/ActionDispatcher.ts @@ -21,11 +21,12 @@ import { $assert } from '@wisemapping/core-js'; import Point from '@wisemapping/web2d'; import { Mindmap } from '..'; import CommandContext from './CommandContext'; -import RelationshipControlPoints from './RelationshipControlPoints'; +import RelationshipControlPoints, { PivotType } from './RelationshipControlPoints'; import Events from './Events'; import NodeModel from './model/NodeModel'; import RelationshipModel from './model/RelationshipModel'; import Topic from './Topic'; +import PositionType from './PositionType'; abstract class ActionDispatcher extends Events { private static _instance: ActionDispatcher; @@ -57,7 +58,11 @@ abstract class ActionDispatcher extends Events { abstract moveTopic(topicId: number, position: Point): void; - abstract moveControlPoint(ctrlPoint: RelationshipControlPoints, point: Point): void; + abstract moveControlPoint( + model: RelationshipModel, + ctrlPoint: PositionType, + index: PivotType, + ): void; abstract changeFontFamilyToTopic(topicIds: number[], fontFamily: string): void; diff --git a/packages/mindplot/src/components/CommandContext.ts b/packages/mindplot/src/components/CommandContext.ts index 1e947b94..1001cf8a 100644 --- a/packages/mindplot/src/components/CommandContext.ts +++ b/packages/mindplot/src/components/CommandContext.ts @@ -55,51 +55,45 @@ class CommandContext { } /** */ - deleteTopic(topic: Topic) { + deleteTopic(topic: Topic): void { this._designer.removeTopic(topic); } /** */ - createTopic(model: NodeModel) { + createTopic(model: NodeModel): Topic { $assert(model, 'model can not be null'); return this._designer.nodeModelToTopic(model); } - // /** */ - // createModel() { - // const mindmap = this._designer.getMindmap(); - // return mindmap.createNode('MainTopic'); - // } - /** */ - addTopic(topic: Topic) { + addTopic(topic: Topic): void { const mindmap = this._designer.getMindmap(); - return mindmap.addBranch(topic.getModel()); + mindmap.addBranch(topic.getModel()); } /** */ - connect(childTopic: Topic, parentTopic: Topic) { + connect(childTopic: Topic, parentTopic: Topic): void { childTopic.connectTo(parentTopic, this._designer.getWorkSpace()); } /** */ - disconnect(topic: Topic) { + disconnect(topic: Topic): void { topic.disconnect(this._designer.getWorkSpace()); } /** */ - addRelationship(model: RelationshipModel) { + addRelationship(model: RelationshipModel): Relationship { $assert(model, 'model cannot be null'); return this._designer.addRelationship(model); } /** */ - deleteRelationship(relationship: Relationship) { + deleteRelationship(relationship: Relationship): void { this._designer.deleteRelationship(relationship); } /** */ - findRelationships(relationshipIds: number[]) { + findRelationships(relationshipIds: number[]): Relationship[] { $assert($defined(relationshipIds), 'relId can not be null'); const relIds = Array.isArray(relationshipIds) ? relationshipIds : [relationshipIds]; @@ -108,7 +102,7 @@ class CommandContext { } /** */ - moveTopic(topic: Topic, position: Point) { + moveTopic(topic: Topic, position: Point): void { $assert(topic, 'topic cannot be null'); $assert(position, 'position cannot be null'); EventBus.instance.fireEvent('topicMoved', { diff --git a/packages/mindplot/src/components/RelationshipControlPoints.ts b/packages/mindplot/src/components/RelationshipControlPoints.ts index f9b2170f..0174ba7d 100644 --- a/packages/mindplot/src/components/RelationshipControlPoints.ts +++ b/packages/mindplot/src/components/RelationshipControlPoints.ts @@ -222,9 +222,11 @@ class RelationshipControlPoints { }, () => { const actionDispatcher = ActionDispatcher.getInstance(); - actionDispatcher.moveControlPoint(this, PivotType.Start); - - relationship.setOnFocus(true); + actionDispatcher.moveControlPoint( + relationship.getModel(), + this.getControlPointPosition(PivotType.Start), + PivotType.Start, + ); }, ); @@ -238,9 +240,11 @@ class RelationshipControlPoints { }, () => { const actionDispatcher = ActionDispatcher.getInstance(); - actionDispatcher.moveControlPoint(this, PivotType.End); - - relationship.setOnFocus(true); + actionDispatcher.moveControlPoint( + relationship.getModel(), + this.getControlPointPosition(PivotType.End), + PivotType.End, + ); }, ); this._pivotLines = [startControlLine, endControlLine]; diff --git a/packages/mindplot/src/components/StandaloneActionDispatcher.ts b/packages/mindplot/src/components/StandaloneActionDispatcher.ts index ca1dffc8..c302010e 100644 --- a/packages/mindplot/src/components/StandaloneActionDispatcher.ts +++ b/packages/mindplot/src/components/StandaloneActionDispatcher.ts @@ -35,7 +35,8 @@ import RelationshipModel from './model/RelationshipModel'; import Topic from './Topic'; import Command from './Command'; import FeatureType from './model/FeatureType'; -import RelationshipControlPoints from './RelationshipControlPoints'; +import PositionType from './PositionType'; +import { PivotType } from './RelationshipControlPoints'; class StandaloneActionDispatcher extends ActionDispatcher { private _actionRunner: DesignerActionRunner; @@ -94,8 +95,8 @@ class StandaloneActionDispatcher extends ActionDispatcher { } /** */ - moveControlPoint(ctrlPoint: RelationshipControlPoints, index: number) { - const command = new MoveControlPointCommand(ctrlPoint, index); + moveControlPoint(model: RelationshipModel, ctrlPoint: PositionType, index: PivotType): void { + const command = new MoveControlPointCommand(model, ctrlPoint, index); this.execute(command); } diff --git a/packages/mindplot/src/components/commands/MoveControlPointCommand.ts b/packages/mindplot/src/components/commands/MoveControlPointCommand.ts index 48679c75..ac9ec39f 100644 --- a/packages/mindplot/src/components/commands/MoveControlPointCommand.ts +++ b/packages/mindplot/src/components/commands/MoveControlPointCommand.ts @@ -16,85 +16,59 @@ * limitations under the License. */ import Command from '../Command'; -import RelationshipControlPoints, { PivotType } from '../RelationshipControlPoints'; +import { PivotType } from '../RelationshipControlPoints'; import PositionType from '../PositionType'; +import RelationshipModel from '../model/RelationshipModel'; +import CommandContext from '../CommandContext'; class MoveControlPointCommand extends Command { - private _controlPoints: RelationshipControlPoints; - private _ctrIndex: PivotType; - private _oldCtrPoint: PositionType; + private _controlPoint: PositionType; - private _newCtrPoint: PositionType; + private _modelId: number; - /** - * @classdesc This command handles do/undo of changing the control points of a relationship - * arrow. These are the two points that appear when the relationship is on focus. They - * influence how the arrow is drawn (not the source or the destination topic nor the arrow - * direction) - */ - constructor(controlPoints: RelationshipControlPoints, ctrIndex: PivotType) { + constructor(model: RelationshipModel, controlPoint: PositionType, ctrIndex: PivotType) { super(); // New control points ... - this._controlPoints = controlPoints; this._ctrIndex = ctrIndex; - this._newCtrPoint = controlPoints.getControlPointPosition(ctrIndex); - - // Backup previous control points ... - const relationship = controlPoints.getRelationship(); - const model = relationship.getModel(); - this._oldCtrPoint = - PivotType.Start === ctrIndex ? model.getSrcCtrlPoint() : model.getDestCtrlPoint(); - this._oldCtrPoint = { ...this._oldCtrPoint }; - - // New relationship ... - this._newCtrPoint = { ...controlPoints.getControlPointPosition(ctrIndex) }; + this._controlPoint = controlPoint; + this._modelId = model.getId(); } - execute() { - const relationship = this._controlPoints.getRelationship(); + execute(commandContext: CommandContext): void { + const relationship = commandContext.findRelationships([this._modelId])[0]; const model = relationship.getModel(); + + let oldCtlPoint: PositionType; switch (this._ctrIndex) { case PivotType.Start: - model.setSrcCtrlPoint(this._newCtrPoint); - relationship.setIsSrcControlPointCustom(true); - relationship.setSrcControlPoint(this._newCtrPoint); + oldCtlPoint = model.getSrcCtrlPoint(); + model.setSrcCtrlPoint(this._controlPoint); + relationship.setIsSrcControlPointCustom(this._controlPoint != null); + if (this._controlPoint) { + relationship.setSrcControlPoint(this._controlPoint); + } break; case PivotType.End: - model.setDestCtrlPoint(this._newCtrPoint); - relationship.setIsDestControlPointCustom(true); - relationship.setDestControlPoint(this._newCtrPoint); + oldCtlPoint = model.getDestCtrlPoint(); + model.setDestCtrlPoint(this._controlPoint); + relationship.setIsDestControlPointCustom(this._controlPoint != null); + if (this._controlPoint) { + relationship.setDestControlPoint(this._controlPoint); + } break; default: throw new Error('Illegal state exception'); } + this._controlPoint = { ...oldCtlPoint }; relationship.redraw(); + relationship.setOnFocus(true); } - undoExecute() { - const relationship = this._controlPoints.getRelationship(); - const model = relationship.getModel(); - - const isCustom = this._oldCtrPoint != null; - relationship.setIsDestControlPointCustom(isCustom); - - switch (this._ctrIndex) { - case PivotType.Start: - model.setSrcCtrlPoint(this._oldCtrPoint); - relationship.setSrcControlPoint(this._oldCtrPoint); - break; - case PivotType.End: - model.setDestCtrlPoint(this._oldCtrPoint); - relationship.setDestControlPoint(this._oldCtrPoint); - break; - default: - throw new Error('Illegal state exception'); - } - - console.log('undo ...'); - relationship.redraw(); + undoExecute(commandContext: CommandContext): void { + this.execute(commandContext); } }