diff --git a/.yarn/cache/@juggle-resize-observer-npm-3.3.1-f36d80a4f0-ddabc40442.zip b/.yarn/cache/@juggle-resize-observer-npm-3.3.1-f36d80a4f0-ddabc40442.zip deleted file mode 100644 index d6c7b40e8..000000000 Binary files a/.yarn/cache/@juggle-resize-observer-npm-3.3.1-f36d80a4f0-ddabc40442.zip and /dev/null differ diff --git a/.yarn/cache/@nanostores-preact-npm-0.1.3-bf50aa330a-ae5ba0ecdb.zip b/.yarn/cache/@nanostores-preact-npm-0.1.3-bf50aa330a-ae5ba0ecdb.zip deleted file mode 100644 index b0c2d416f..000000000 Binary files a/.yarn/cache/@nanostores-preact-npm-0.1.3-bf50aa330a-ae5ba0ecdb.zip and /dev/null differ diff --git a/.yarn/cache/@reach-alert-dialog-npm-0.16.2-bb38ed8c2a-677ff78bd8.zip b/.yarn/cache/@reach-alert-dialog-npm-0.16.2-bb38ed8c2a-677ff78bd8.zip deleted file mode 100644 index 9313a39a1..000000000 Binary files a/.yarn/cache/@reach-alert-dialog-npm-0.16.2-bb38ed8c2a-677ff78bd8.zip and /dev/null differ diff --git a/.yarn/cache/@reach-auto-id-npm-0.16.0-e74832ae13-80211f7db1.zip b/.yarn/cache/@reach-auto-id-npm-0.16.0-e74832ae13-80211f7db1.zip deleted file mode 100644 index 6d3cc4c6d..000000000 Binary files a/.yarn/cache/@reach-auto-id-npm-0.16.0-e74832ae13-80211f7db1.zip and /dev/null differ diff --git a/.yarn/cache/@reach-descendants-npm-0.16.1-7ed4b73a60-0d2a5d322e.zip b/.yarn/cache/@reach-descendants-npm-0.16.1-7ed4b73a60-0d2a5d322e.zip deleted file mode 100644 index 19b80c320..000000000 Binary files a/.yarn/cache/@reach-descendants-npm-0.16.1-7ed4b73a60-0d2a5d322e.zip and /dev/null differ diff --git a/.yarn/cache/@reach-dialog-npm-0.16.2-a04260975d-1478ad3c4c.zip b/.yarn/cache/@reach-dialog-npm-0.16.2-a04260975d-1478ad3c4c.zip deleted file mode 100644 index 10b7c0b93..000000000 Binary files a/.yarn/cache/@reach-dialog-npm-0.16.2-a04260975d-1478ad3c4c.zip and /dev/null differ diff --git a/.yarn/cache/@reach-dropdown-npm-0.16.2-272a86f577-484ea82f36.zip b/.yarn/cache/@reach-dropdown-npm-0.16.2-272a86f577-484ea82f36.zip deleted file mode 100644 index 04a2a3129..000000000 Binary files a/.yarn/cache/@reach-dropdown-npm-0.16.2-272a86f577-484ea82f36.zip and /dev/null differ diff --git a/.yarn/cache/@reach-listbox-npm-0.16.2-e808fe0edb-695d155d6b.zip b/.yarn/cache/@reach-listbox-npm-0.16.2-e808fe0edb-695d155d6b.zip deleted file mode 100644 index b6c3854e0..000000000 Binary files a/.yarn/cache/@reach-listbox-npm-0.16.2-e808fe0edb-695d155d6b.zip and /dev/null differ diff --git a/.yarn/cache/@reach-machine-npm-0.16.0-90892bcecc-9df37f4ddc.zip b/.yarn/cache/@reach-machine-npm-0.16.0-90892bcecc-9df37f4ddc.zip deleted file mode 100644 index 7a5046383..000000000 Binary files a/.yarn/cache/@reach-machine-npm-0.16.0-90892bcecc-9df37f4ddc.zip and /dev/null differ diff --git a/.yarn/cache/@reach-menu-button-npm-0.16.2-24ee75791a-e7ffaac11f.zip b/.yarn/cache/@reach-menu-button-npm-0.16.2-24ee75791a-e7ffaac11f.zip deleted file mode 100644 index 7ac607840..000000000 Binary files a/.yarn/cache/@reach-menu-button-npm-0.16.2-24ee75791a-e7ffaac11f.zip and /dev/null differ diff --git a/.yarn/cache/@reach-popover-npm-0.16.2-3dcad37fb2-ed6e7636ce.zip b/.yarn/cache/@reach-popover-npm-0.16.2-3dcad37fb2-ed6e7636ce.zip deleted file mode 100644 index 61973a26b..000000000 Binary files a/.yarn/cache/@reach-popover-npm-0.16.2-3dcad37fb2-ed6e7636ce.zip and /dev/null differ diff --git a/.yarn/cache/@reach-portal-npm-0.16.2-0bc53bebd7-7413dcd169.zip b/.yarn/cache/@reach-portal-npm-0.16.2-0bc53bebd7-7413dcd169.zip deleted file mode 100644 index ba300944b..000000000 Binary files a/.yarn/cache/@reach-portal-npm-0.16.2-0bc53bebd7-7413dcd169.zip and /dev/null differ diff --git a/.yarn/cache/@reach-rect-npm-0.16.0-fe95d371fa-a3d0df3b12.zip b/.yarn/cache/@reach-rect-npm-0.16.0-fe95d371fa-a3d0df3b12.zip deleted file mode 100644 index 8a495e241..000000000 Binary files a/.yarn/cache/@reach-rect-npm-0.16.0-fe95d371fa-a3d0df3b12.zip and /dev/null differ diff --git a/.yarn/cache/@reach-utils-npm-0.16.0-90d42d1ed1-36bc0eb41a.zip b/.yarn/cache/@reach-utils-npm-0.16.0-90d42d1ed1-36bc0eb41a.zip deleted file mode 100644 index 746b179fc..000000000 Binary files a/.yarn/cache/@reach-utils-npm-0.16.0-90d42d1ed1-36bc0eb41a.zip and /dev/null differ diff --git a/.yarn/cache/@reach-visually-hidden-npm-0.16.0-3ac4dfbf84-e2af897885.zip b/.yarn/cache/@reach-visually-hidden-npm-0.16.0-3ac4dfbf84-e2af897885.zip deleted file mode 100644 index 7e9848dd5..000000000 Binary files a/.yarn/cache/@reach-visually-hidden-npm-0.16.0-3ac4dfbf84-e2af897885.zip and /dev/null differ diff --git a/.yarn/cache/@react-hook-latest-npm-1.0.3-3d70c2d1bb-2408c9cd35.zip b/.yarn/cache/@react-hook-latest-npm-1.0.3-3d70c2d1bb-2408c9cd35.zip deleted file mode 100644 index 36a39793b..000000000 Binary files a/.yarn/cache/@react-hook-latest-npm-1.0.3-3d70c2d1bb-2408c9cd35.zip and /dev/null differ diff --git a/.yarn/cache/@react-hook-passive-layout-effect-npm-1.2.1-ef94afc326-217cb8aa90.zip b/.yarn/cache/@react-hook-passive-layout-effect-npm-1.2.1-ef94afc326-217cb8aa90.zip deleted file mode 100644 index c8936a18f..000000000 Binary files a/.yarn/cache/@react-hook-passive-layout-effect-npm-1.2.1-ef94afc326-217cb8aa90.zip and /dev/null differ diff --git a/.yarn/cache/@react-hook-resize-observer-npm-1.2.5-31c198b62d-a2f3b333e3.zip b/.yarn/cache/@react-hook-resize-observer-npm-1.2.5-31c198b62d-a2f3b333e3.zip deleted file mode 100644 index 14561e137..000000000 Binary files a/.yarn/cache/@react-hook-resize-observer-npm-1.2.5-31c198b62d-a2f3b333e3.zip and /dev/null differ diff --git a/.yarn/cache/@reduxjs-toolkit-npm-1.8.0-436263eab0-e229571b80.zip b/.yarn/cache/@reduxjs-toolkit-npm-1.8.0-436263eab0-e229571b80.zip deleted file mode 100644 index 7876242fd..000000000 Binary files a/.yarn/cache/@reduxjs-toolkit-npm-1.8.0-436263eab0-e229571b80.zip and /dev/null differ diff --git a/.yarn/cache/@standardnotes-stylekit-npm-5.23.0-214e97f7f6-35e6ed6196.zip b/.yarn/cache/@standardnotes-stylekit-npm-5.23.0-214e97f7f6-35e6ed6196.zip deleted file mode 100644 index 55dc2cc56..000000000 Binary files a/.yarn/cache/@standardnotes-stylekit-npm-5.23.0-214e97f7f6-35e6ed6196.zip and /dev/null differ diff --git a/.yarn/cache/@testing-library-dom-npm-8.11.3-bcb55609ff-2245d254b6.zip b/.yarn/cache/@testing-library-dom-npm-8.11.3-bcb55609ff-2245d254b6.zip deleted file mode 100644 index 145b79592..000000000 Binary files a/.yarn/cache/@testing-library-dom-npm-8.11.3-bcb55609ff-2245d254b6.zip and /dev/null differ diff --git a/.yarn/cache/@testing-library-jest-dom-npm-5.16.2-1ae5bcade4-e4569df67c.zip b/.yarn/cache/@testing-library-jest-dom-npm-5.16.2-1ae5bcade4-e4569df67c.zip deleted file mode 100644 index b41800774..000000000 Binary files a/.yarn/cache/@testing-library-jest-dom-npm-5.16.2-1ae5bcade4-e4569df67c.zip and /dev/null differ diff --git a/.yarn/cache/@testing-library-react-npm-12.1.4-8a17fe6c11-944c5f8d4a.zip b/.yarn/cache/@testing-library-react-npm-12.1.4-8a17fe6c11-944c5f8d4a.zip deleted file mode 100644 index 4b88b19d5..000000000 Binary files a/.yarn/cache/@testing-library-react-npm-12.1.4-8a17fe6c11-944c5f8d4a.zip and /dev/null differ diff --git a/.yarn/cache/@types-lodash-npm-4.14.179-cf476a29f8-71faa0c807.zip b/.yarn/cache/@types-lodash-npm-4.14.179-cf476a29f8-71faa0c807.zip deleted file mode 100644 index ed3530b87..000000000 Binary files a/.yarn/cache/@types-lodash-npm-4.14.179-cf476a29f8-71faa0c807.zip and /dev/null differ diff --git a/.yarn/cache/@types-node-npm-17.0.21-7d68eb6a13-89dcd2fe82.zip b/.yarn/cache/@types-node-npm-17.0.21-7d68eb6a13-89dcd2fe82.zip deleted file mode 100644 index ccdd01e5a..000000000 Binary files a/.yarn/cache/@types-node-npm-17.0.21-7d68eb6a13-89dcd2fe82.zip and /dev/null differ diff --git a/.yarn/cache/@types-raf-schd-npm-4.0.1-f381dfea40-0babaa8554.zip b/.yarn/cache/@types-raf-schd-npm-4.0.1-f381dfea40-0babaa8554.zip deleted file mode 100644 index f979d7235..000000000 Binary files a/.yarn/cache/@types-raf-schd-npm-4.0.1-f381dfea40-0babaa8554.zip and /dev/null differ diff --git a/.yarn/cache/@types-react-beautiful-dnd-npm-13.1.2-deaeb386a7-28372854fc.zip b/.yarn/cache/@types-react-beautiful-dnd-npm-13.1.2-deaeb386a7-28372854fc.zip deleted file mode 100644 index 3a3cbd817..000000000 Binary files a/.yarn/cache/@types-react-beautiful-dnd-npm-13.1.2-deaeb386a7-28372854fc.zip and /dev/null differ diff --git a/.yarn/cache/@types-react-dom-npm-17.0.13-f79f9e6f0b-62c42a54ac.zip b/.yarn/cache/@types-react-dom-npm-17.0.13-f79f9e6f0b-62c42a54ac.zip deleted file mode 100644 index 0dc7cccc5..000000000 Binary files a/.yarn/cache/@types-react-dom-npm-17.0.13-f79f9e6f0b-62c42a54ac.zip and /dev/null differ diff --git a/.yarn/cache/@types-react-npm-17.0.40-7487e5fdd0-24d1b210b5.zip b/.yarn/cache/@types-react-npm-17.0.40-7487e5fdd0-24d1b210b5.zip deleted file mode 100644 index 8363edca7..000000000 Binary files a/.yarn/cache/@types-react-npm-17.0.40-7487e5fdd0-24d1b210b5.zip and /dev/null differ diff --git a/.yarn/cache/@types-react-redux-npm-7.1.23-67db323719-7cedb0f208.zip b/.yarn/cache/@types-react-redux-npm-7.1.23-67db323719-7cedb0f208.zip deleted file mode 100644 index 27d8dd4ed..000000000 Binary files a/.yarn/cache/@types-react-redux-npm-7.1.23-67db323719-7cedb0f208.zip and /dev/null differ diff --git a/.yarn/cache/@types-react-transition-group-npm-4.4.4-258f9685b8-86e9ff9731.zip b/.yarn/cache/@types-react-transition-group-npm-4.4.4-258f9685b8-86e9ff9731.zip deleted file mode 100644 index c664fb5e2..000000000 Binary files a/.yarn/cache/@types-react-transition-group-npm-4.4.4-258f9685b8-86e9ff9731.zip and /dev/null differ diff --git a/.yarn/cache/@types-redux-mock-store-npm-1.0.3-0f91ea344f-b8c76be560.zip b/.yarn/cache/@types-redux-mock-store-npm-1.0.3-0f91ea344f-b8c76be560.zip deleted file mode 100644 index 2c3a13800..000000000 Binary files a/.yarn/cache/@types-redux-mock-store-npm-1.0.3-0f91ea344f-b8c76be560.zip and /dev/null differ diff --git a/.yarn/cache/@types-styled-components-npm-5.1.24-e5cbab65b7-158c69085a.zip b/.yarn/cache/@types-styled-components-npm-5.1.24-e5cbab65b7-158c69085a.zip deleted file mode 100644 index 5634d1050..000000000 Binary files a/.yarn/cache/@types-styled-components-npm-5.1.24-e5cbab65b7-158c69085a.zip and /dev/null differ diff --git a/.yarn/cache/@types-styled-components-npm-5.1.26-aabda06611-84f53b3101.zip b/.yarn/cache/@types-styled-components-npm-5.1.26-aabda06611-84f53b3101.zip new file mode 100644 index 000000000..8b3291cb7 Binary files /dev/null and b/.yarn/cache/@types-styled-components-npm-5.1.26-aabda06611-84f53b3101.zip differ diff --git a/.yarn/cache/dom-helpers-npm-5.2.1-b38bb4470b-863ba9e086.zip b/.yarn/cache/dom-helpers-npm-5.2.1-b38bb4470b-863ba9e086.zip deleted file mode 100644 index c1e066c84..000000000 Binary files a/.yarn/cache/dom-helpers-npm-5.2.1-b38bb4470b-863ba9e086.zip and /dev/null differ diff --git a/.yarn/cache/email-addresses-npm-3.1.0-332eec577b-e911985f09.zip b/.yarn/cache/email-addresses-npm-3.1.0-332eec577b-e911985f09.zip deleted file mode 100644 index f60e99b05..000000000 Binary files a/.yarn/cache/email-addresses-npm-3.1.0-332eec577b-e911985f09.zip and /dev/null differ diff --git a/.yarn/cache/filename-reserved-regex-npm-2.0.0-5d8c6e337c-323a0020fd.zip b/.yarn/cache/filename-reserved-regex-npm-2.0.0-5d8c6e337c-323a0020fd.zip deleted file mode 100644 index 9d3f7e9fc..000000000 Binary files a/.yarn/cache/filename-reserved-regex-npm-2.0.0-5d8c6e337c-323a0020fd.zip and /dev/null differ diff --git a/.yarn/cache/filenamify-npm-4.3.0-e6531169ab-5b71a7ff8e.zip b/.yarn/cache/filenamify-npm-4.3.0-e6531169ab-5b71a7ff8e.zip deleted file mode 100644 index 278eee355..000000000 Binary files a/.yarn/cache/filenamify-npm-4.3.0-e6531169ab-5b71a7ff8e.zip and /dev/null differ diff --git a/.yarn/cache/gh-pages-npm-3.2.3-de723c58be-0a6e92180c.zip b/.yarn/cache/gh-pages-npm-3.2.3-de723c58be-0a6e92180c.zip deleted file mode 100644 index 62f8d56d6..000000000 Binary files a/.yarn/cache/gh-pages-npm-3.2.3-de723c58be-0a6e92180c.zip and /dev/null differ diff --git a/.yarn/cache/lilconfig-npm-2.0.4-f0d8b03457-02ae530aa4.zip b/.yarn/cache/lilconfig-npm-2.0.4-f0d8b03457-02ae530aa4.zip deleted file mode 100644 index dd979acd7..000000000 Binary files a/.yarn/cache/lilconfig-npm-2.0.4-f0d8b03457-02ae530aa4.zip and /dev/null differ diff --git a/.yarn/cache/lint-staged-npm-12.3.5-930196af82-6653c7078b.zip b/.yarn/cache/lint-staged-npm-12.3.5-930196af82-6653c7078b.zip deleted file mode 100644 index c9ec3ae7e..000000000 Binary files a/.yarn/cache/lint-staged-npm-12.3.5-930196af82-6653c7078b.zip and /dev/null differ diff --git a/.yarn/cache/react-scripts-npm-5.0.0-14ea4c40dd-55ffad0d68.zip b/.yarn/cache/react-scripts-npm-5.0.0-14ea4c40dd-55ffad0d68.zip deleted file mode 100644 index f4514c286..000000000 Binary files a/.yarn/cache/react-scripts-npm-5.0.0-14ea4c40dd-55ffad0d68.zip and /dev/null differ diff --git a/.yarn/cache/react-transition-group-npm-4.4.2-5052c30656-b67bf5b3e8.zip b/.yarn/cache/react-transition-group-npm-4.4.2-5052c30656-b67bf5b3e8.zip deleted file mode 100644 index de6b94534..000000000 Binary files a/.yarn/cache/react-transition-group-npm-4.4.2-5052c30656-b67bf5b3e8.zip and /dev/null differ diff --git a/.yarn/cache/redux-mock-store-npm-1.5.4-87bd452380-571eab2cca.zip b/.yarn/cache/redux-mock-store-npm-1.5.4-87bd452380-571eab2cca.zip deleted file mode 100644 index 3d5e7c48b..000000000 Binary files a/.yarn/cache/redux-mock-store-npm-1.5.4-87bd452380-571eab2cca.zip and /dev/null differ diff --git a/.yarn/cache/redux-npm-4.1.2-04cdbe7a08-6a839cee5b.zip b/.yarn/cache/redux-npm-4.1.2-04cdbe7a08-6a839cee5b.zip deleted file mode 100644 index 4b967a63b..000000000 Binary files a/.yarn/cache/redux-npm-4.1.2-04cdbe7a08-6a839cee5b.zip and /dev/null differ diff --git a/.yarn/cache/redux-thunk-npm-2.4.1-2ba08bf615-af5abb425f.zip b/.yarn/cache/redux-thunk-npm-2.4.1-2ba08bf615-af5abb425f.zip deleted file mode 100644 index 03a3656c9..000000000 Binary files a/.yarn/cache/redux-thunk-npm-2.4.1-2ba08bf615-af5abb425f.zip and /dev/null differ diff --git a/.yarn/cache/reselect-npm-4.1.6-869f318cc3-3ea1058422.zip b/.yarn/cache/reselect-npm-4.1.6-869f318cc3-3ea1058422.zip deleted file mode 100644 index e0fa67b4f..000000000 Binary files a/.yarn/cache/reselect-npm-4.1.6-869f318cc3-3ea1058422.zip and /dev/null differ diff --git a/.yarn/cache/strip-outer-npm-1.0.1-4ed024bb0a-f8d65d33ca.zip b/.yarn/cache/strip-outer-npm-1.0.1-4ed024bb0a-f8d65d33ca.zip deleted file mode 100644 index e0bd11b36..000000000 Binary files a/.yarn/cache/strip-outer-npm-1.0.1-4ed024bb0a-f8d65d33ca.zip and /dev/null differ diff --git a/.yarn/cache/supports-color-npm-9.2.2-d003069e84-976d848774.zip b/.yarn/cache/supports-color-npm-9.2.2-d003069e84-976d848774.zip deleted file mode 100644 index a4c7d6d63..000000000 Binary files a/.yarn/cache/supports-color-npm-9.2.2-d003069e84-976d848774.zip and /dev/null differ diff --git a/.yarn/cache/trim-repeated-npm-1.0.0-1152152315-e25c235305.zip b/.yarn/cache/trim-repeated-npm-1.0.0-1152152315-e25c235305.zip deleted file mode 100644 index de4b1f9ee..000000000 Binary files a/.yarn/cache/trim-repeated-npm-1.0.0-1152152315-e25c235305.zip and /dev/null differ diff --git a/.yarn/cache/typescript-npm-4.6.2-1d0ebc9cf1-8a44ed7e6f.zip b/.yarn/cache/typescript-npm-4.6.2-1d0ebc9cf1-8a44ed7e6f.zip deleted file mode 100644 index 80e4cb691..000000000 Binary files a/.yarn/cache/typescript-npm-4.6.2-1d0ebc9cf1-8a44ed7e6f.zip and /dev/null differ diff --git a/.yarn/cache/typescript-patch-5886f4a5f5-40b493a717.zip b/.yarn/cache/typescript-patch-5886f4a5f5-40b493a717.zip deleted file mode 100644 index 5bfde7b58..000000000 Binary files a/.yarn/cache/typescript-patch-5886f4a5f5-40b493a717.zip and /dev/null differ diff --git a/packages/components/dist/Components.js b/packages/components/dist/Components.js index b967277f0..d10a8b778 100644 --- a/packages/components/dist/Components.js +++ b/packages/components/dist/Components.js @@ -13,11 +13,6 @@ exports.Components = void 0; var BaseEditorStaticFiles = ['index.html', 'dist', 'package.json']; var BaseThemeStaticFiles = ['dist', 'package.json']; var Editors = [ - { - identifier: 'org.standardnotes.advanced-checklist', - path: 'Editors/org.standardnotes.advanced-checklist', - static_files: __spreadArray(__spreadArray([], BaseEditorStaticFiles, true), ['build'], false), - }, { identifier: 'org.standardnotes.code-editor', path: 'Editors/org.standardnotes.code-editor', diff --git a/packages/components/dist/zips/checksums.json b/packages/components/dist/zips/checksums.json index 3b8f6d3bc..5b04542ba 100644 --- a/packages/components/dist/zips/checksums.json +++ b/packages/components/dist/zips/checksums.json @@ -89,11 +89,6 @@ "base64": "0ae54799c28a336447a63ddabfe43d0c6e18f8c2cd29cfdb1c0174ab96fde248", "binary": "54a01414a21e46c67fa59c69189a3d34a6548de7539699f2cf0248f9c5059d37" }, - "org.standardnotes.advanced-checklist": { - "version": "0.2.5", - "base64": "077a56ef75958105bc9dc16376bcea2e89aee57b512b43f9e1b33e1d32ea8358", - "binary": "e903a5c592bd03ca28d205d09dcbc7e4329c7cd57fb74b4e0e5fa724c2321a61" - }, "org.standardnotes.file-safe": { "version": "2.0.16", "base64": "2bb641344613fc86c340fb29636a68678a13e453d04fb36228af6045e06664db", diff --git a/packages/components/src/Components.ts b/packages/components/src/Components.ts index 04c95744f..5d86fa7d3 100644 --- a/packages/components/src/Components.ts +++ b/packages/components/src/Components.ts @@ -2,11 +2,6 @@ const BaseEditorStaticFiles = ['index.html', 'dist', 'package.json'] const BaseThemeStaticFiles = ['dist', 'package.json'] const Editors = [ - { - identifier: 'org.standardnotes.advanced-checklist', - path: 'Editors/org.standardnotes.advanced-checklist', - static_files: [...BaseEditorStaticFiles, 'build'], - }, { identifier: 'org.standardnotes.code-editor', path: 'Editors/org.standardnotes.code-editor', diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/.gitignore b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/.gitignore deleted file mode 100644 index 728dccf38..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/.gitignore +++ /dev/null @@ -1,131 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache - -# Next.js build output -.next - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and *not* Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -#### Copied from Create React App #### - -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* -/public/ext.json diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/CHANGELOG.md b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/CHANGELOG.md deleted file mode 100644 index f23f75346..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/CHANGELOG.md +++ /dev/null @@ -1,115 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [0.2.5](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.2.4...@standardnotes/advanced-checklist@0.2.5) (2022-09-13) - -**Note:** Version bump only for package @standardnotes/advanced-checklist - -## [0.2.4](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.2.3...@standardnotes/advanced-checklist@0.2.4) (2022-08-23) - -**Note:** Version bump only for package @standardnotes/advanced-checklist - -## [0.2.3](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.2.2...@standardnotes/advanced-checklist@0.2.3) (2022-07-13) - -### Bug Fixes - -* upgrade jest with types to latest version ([09e08ca](https://github.com/standardnotes/app/commit/09e08ca899ba8694cf43292e918c4c204c0d2cb9)) -* upgrade ts-jest in packages ([71e792d](https://github.com/standardnotes/app/commit/71e792da354ff90335b92758e196075a0f88d060)) - -## [0.2.2](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.2.1...@standardnotes/advanced-checklist@0.2.2) (2022-07-06) - -### Bug Fixes - -* **advanced checklist:** improve editor styles ([#1221](https://github.com/standardnotes/app/issues/1221)) ([f7ba658](https://github.com/standardnotes/app/commit/f7ba6588a7d062e3ec82e6413042ce5d8cd075f7)) - -## [0.2.1](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.2.0...@standardnotes/advanced-checklist@0.2.1) (2022-07-06) - -**Note:** Version bump only for package @standardnotes/advanced-checklist - -# [0.2.0](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.1.6...@standardnotes/advanced-checklist@0.2.0) (2022-07-06) - -### Features - -* add utils package ([aef4ceb](https://github.com/standardnotes/app/commit/aef4ceb7f85948f1f08b8b09a4db5d187daa371b)) - -## [0.1.6](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.1.5...@standardnotes/advanced-checklist@0.1.6) (2022-07-05) - -### Bug Fixes - -* **advanced checklist:** remove test for reorder icon ([#1209](https://github.com/standardnotes/app/issues/1209)) ([296aa9a](https://github.com/standardnotes/app/commit/296aa9aab2072d4aad68485c31c000ad2c3bf013)) - -## [0.1.5](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.1.4...@standardnotes/advanced-checklist@0.1.5) (2022-07-05) - -### Bug Fixes - -* **advanced checklist:** UI changes ([#1208](https://github.com/standardnotes/app/issues/1208)) ([1ce4cb3](https://github.com/standardnotes/app/commit/1ce4cb3c5c8f4e590fd67fdbd684b36ac6383bd9)) - -## [0.1.4](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.1.3...@standardnotes/advanced-checklist@0.1.4) (2022-07-04) - -### Bug Fixes - -* **advanced checklist:** animations and error handling ([#1200](https://github.com/standardnotes/app/issues/1200)) ([a0205a5](https://github.com/standardnotes/app/commit/a0205a5c7dd72184cb575195ced3132091072239)) - -## [0.1.3](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.1.2...@standardnotes/advanced-checklist@0.1.3) (2022-06-30) - -### Bug Fixes - -* debounce saving task description/draft ([#1187](https://github.com/standardnotes/app/issues/1187)) ([47a0551](https://github.com/standardnotes/app/commit/47a0551967ca420a957e2123d56bd7f0c8a95c53)) - -## [0.1.2](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.1.1...@standardnotes/advanced-checklist@0.1.2) (2022-06-29) - -### Bug Fixes - -* **advanced checklist:** style and layout improvements ([#1182](https://github.com/standardnotes/app/issues/1182)) ([6c19adb](https://github.com/standardnotes/app/commit/6c19adba1902ef054f501d57f6e284fbf44ca28b)) - -## [0.1.1](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.1.0...@standardnotes/advanced-checklist@0.1.1) (2022-06-28) - -**Note:** Version bump only for package @standardnotes/advanced-checklist - -# [0.1.0](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.0.5...@standardnotes/advanced-checklist@0.1.0) (2022-06-28) - -### Features - -* **advanced checklist:** collapsible group sections ([#1167](https://github.com/standardnotes/app/issues/1167)) ([59e5324](https://github.com/standardnotes/app/commit/59e5324a29029d024811bf2bb63e08ae42d3b62b)) -* deprecated editors ([#1166](https://github.com/standardnotes/app/issues/1166)) ([60ca415](https://github.com/standardnotes/app/commit/60ca4150446f9a14bb6a31416686c6d07a7d0cd9)) -* **web:** tailwind css ([#1147](https://github.com/standardnotes/app/issues/1147)) ([b80038f](https://github.com/standardnotes/app/commit/b80038f607d7411912fa99366abf559a44874ef3)) - -## [0.0.5](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.0.5-alpha.0...@standardnotes/advanced-checklist@0.0.5) (2022-06-22) - -**Note:** Version bump only for package @standardnotes/advanced-checklist - -## [0.0.5-alpha.0](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.0.4...@standardnotes/advanced-checklist@0.0.5-alpha.0) (2022-06-22) - -### Bug Fixes - -* components scripts ([#1136](https://github.com/standardnotes/app/issues/1136)) ([e80b4d0](https://github.com/standardnotes/app/commit/e80b4d0ffad495c758b593c30e1c4c754dda9b7e)) - -## 0.0.4 (2022-06-16) - -**Note:** Version bump only for package @standardnotes/advanced-checklist - -## 0.0.3 (2022-06-16) - -**Note:** Version bump only for package @standardnotes/advanced-checklist - -## [0.0.2](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.0.2-alpha.3...@standardnotes/advanced-checklist@0.0.2) (2022-06-16) - -**Note:** Version bump only for package @standardnotes/advanced-checklist - -## [0.0.2-alpha.3](https://github.com/standardnotes/app/compare/@standardnotes/advanced-checklist@0.0.2-alpha.2...@standardnotes/advanced-checklist@0.0.2-alpha.3) (2022-06-16) - -**Note:** Version bump only for package @standardnotes/advanced-checklist - -## 0.0.2-alpha.2 (2022-06-16) - -**Note:** Version bump only for package @standardnotes/advanced-checklist - -## 0.0.2-alpha.1 (2022-06-16) - -**Note:** Version bump only for package @standardnotes/advanced-checklist - -## 0.0.2-alpha.0 (2022-06-15) - -**Note:** Version bump only for package @standardnotes/advanced-checklist diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/README.md b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/README.md deleted file mode 100644 index 1744abead..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# advanced-checklist - -A great way to manage short-term and long-term to-do's. You can mark tasks as completed, change their order, and edit the text naturally in place. - -## Development - -**Prerequisites:** Install [Node.js](https://nodejs.org/en/), [Yarn](https://classic.yarnpkg.com/en/docs/install/), and [Git](https://github.com/git-guides/install-git) on your computer. - -The general instructions setting up an environment to develop Standard Notes extensions can be found [here](https://docs.standardnotes.org/extensions/local-setup). You can also follow these instructions: - -1. Fork the [repository](https://github.com/standardnotes/advanced-checklist) on GitHub. -1. [Clone](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) your fork of the repository. -1. Run `cd advanced-checklist` to enter the `advanced-checklist` directory. -1. Run `yarn install` to install the dependencies on your machine as they are described in `yarn.lock`. - -### Testing in the browser - -1. To run the app in development mode, run `yarn start` and visit http://localhost:8001. Press `ctrl/cmd + C` to exit development mode. - -### Testing in the Standard Notes app - -1. Create an `ext.json` in the `public` directory. You have three options: - 1. Use `sample.ext.json`. - 1. Create `ext.json` as a copy of `sample.ext.json`. - 1. Follow the instructions [here](https://docs.standardnotes.org/extensions/local-setup) with `url: "http://localhost:3000/index.html"`. -1. Install http-server using `sudo npm install -g http-server` then run `yarn server` to serve the `./build` directory at http://localhost:3000. -1. To build the app, run `yarn build`. -1. Install the editor into the [web](https://app.standardnotes.org) or [desktop](https://standardnotes.org/download) app with `http://localhost:3000/sample.ext.json` or with your custom `ext.json`. Press `ctrl/cmd + C` to shut down the server. - -### Deployment - -1. To make the source code prettier, run `yarn pretty`. -1. To the deploy the build into the `gh-pages` branch of your repository on GitHub, run `yarn deploy-stable`. -1. To deploy the build into to the `dev` branch for testing, run `yarn deploy-dev`. -1. To deploy the built into the `build` branch for distributing, run `yarn deploy-build` for distributing builds. - -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -### Available Scripts - -In the project directory, you can run: - -#### `yarn start` - -Runs the app in the development mode.\ -Open [http://localhost:8001](http://localhost:8001) to view it in the browser. - -The page will reload if you make edits.\ -You will also see any lint errors in the console. - -#### `yarn test` - -Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - -#### `yarn build` - -Builds the app for production to the `build` folder.\ -It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.\ -Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. - -#### `yarn eject` - -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** - -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. - -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. - -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. - -### Learn More - -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/config-overrides.js b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/config-overrides.js deleted file mode 100644 index 77e36434d..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/config-overrides.js +++ /dev/null @@ -1,2 +0,0 @@ -const override = require('../cra-app.override') -module.exports = override diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/package.json b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/package.json deleted file mode 100644 index 42514ea90..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/package.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "name": "@standardnotes/advanced-checklist", - "version": "0.2.5", - "description": "A task editor with grouping functionality.", - "author": "Standard Notes.", - "keywords": [ - "Standard Notes", - "Standard Notes Extensions" - ], - "private": true, - "license": "AGPL-3.0-or-later", - "sn": { - "main": "build/index.html" - }, - "homepage": ".", - "scripts": { - "analyze": "source-map-explorer 'build/static/js/*.js'", - "start": "react-app-rewired start", - "test:coverage": "npm run test -- --coverage --watchAll --no-silent", - "eject": "react-scripts eject", - "components:compile": "react-app-rewired build", - "test": "react-app-rewired test --watchAll=false --silent", - "format": "prettier --write 'src/**/*.{html,css,scss,js,jsx,ts,tsx,json}' README.md" - }, - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ] - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "lint-staged": { - "README.md": [ - "prettier --write" - ], - "src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [ - "prettier --write" - ] - }, - "jest": { - "collectCoverageFrom": [ - "src/**/*.{js,jsx,ts,tsx}", - "!/node_modules/" - ], - "coveragePathIgnorePatterns": [ - "/src/mockData.ts", - "/src/app/hooks.ts", - "/src/app/store.ts", - "/src/app/listenerMiddleware.ts" - ], - "coverageReporters": [ - "text", - "html" - ], - "coverageThreshold": { - "global": { - "branches": 90, - "functions": 100, - "lines": 100, - "statements": 100 - } - }, - "transform": { - "^.+\\.(ts|tsx)$": "ts-jest" - }, - "transformIgnorePatterns": [ - "[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$", - "^.+\\.module\\.(css|sass|scss)$" - ] - }, - "dependencies": { - "@standardnotes/utils": "workspace:*" - }, - "devDependencies": { - "@reach/alert-dialog": "0.16.2", - "@reach/menu-button": "0.16.2", - "@reach/visually-hidden": "0.16.0", - "@react-hook/resize-observer": "^1.2.5", - "@reduxjs/toolkit": "1.8.0", - "@standardnotes/editor-kit": "2.2.5", - "@standardnotes/stylekit": "5.23.0", - "@testing-library/dom": "8.11.3", - "@testing-library/jest-dom": "5.16.2", - "@testing-library/react": "12.1.4", - "@testing-library/user-event": "13.5.0", - "@types/jest": "^28.1.5", - "@types/lodash": "4.14.179", - "@types/node": "17.0.21", - "@types/react": "17.0.40", - "@types/react-beautiful-dnd": "13.1.2", - "@types/react-dom": "17.0.13", - "@types/react-redux": "7.1.23", - "@types/react-transition-group": "4.4.4", - "@types/redux-mock-store": "1.0.3", - "@types/styled-components": "5.1.24", - "@types/uuid": "8.3.4", - "gh-pages": "3.2.3", - "lint-staged": "12.3.5", - "node-sass": "*", - "prettier": "*", - "react": "17.0.2", - "react-app-rewired": "^2.2.1", - "react-beautiful-dnd": "13.1.0", - "react-dom": "17.0.2", - "react-redux": "7.2.8", - "react-scripts": "5.0.0", - "react-transition-group": "4.4.2", - "redux": "4.1.2", - "redux-mock-store": "1.5.4", - "source-map-explorer": "2.5.2", - "styled-components": "5.3.5", - "ts-jest": "^28.0.5", - "typescript": "4.6.2", - "uuid": "8.3.2" - } -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/favicon.ico b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/favicon.ico deleted file mode 100644 index a11777cc4..000000000 Binary files a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/favicon.ico and /dev/null differ diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/index.html b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/index.html deleted file mode 100644 index 6c1d7ae89..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/index.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - Advanced Checklist - - - - -
- - - diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/logo192.png b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/logo192.png deleted file mode 100644 index fc44b0a37..000000000 Binary files a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/logo192.png and /dev/null differ diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/logo512.png b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/logo512.png deleted file mode 100644 index a4e47a654..000000000 Binary files a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/logo512.png and /dev/null differ diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/manifest.json b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/manifest.json deleted file mode 100644 index 76ef6af20..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/manifest.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "short_name": "Advanced Checklist", - "name": "Advanced Checklist", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/robots.txt b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/robots.txt deleted file mode 100644 index e9e57dc4d..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/sample.ext.json b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/sample.ext.json deleted file mode 100644 index f831e465b..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/public/sample.ext.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "identifier": "org.standardnotes.advanced-checklist-dev", - "name": "Advanced Checklist - Dev", - "content_type": "SN|Component", - "area": "editor-editor", - "version": "0.1.0", - "description": "A task editor with grouping functionality.", - "url": "http://localhost:3000/index.html", - "download_url": "", - "latest_url": "", - "thumbnail_url": "" -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/app/hooks.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/app/hooks.ts deleted file mode 100644 index 453dae958..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/app/hooks.ts +++ /dev/null @@ -1,54 +0,0 @@ -import useResizeObserver from '@react-hook/resize-observer' -import React, { useEffect, useRef, useState } from 'react' -import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux' -import type { AppDispatch, RootState } from './store' - -export const useAppDispatch = () => useDispatch() -export const useAppSelector: TypedUseSelectorHook = useSelector - -export const useDidMount = (effect: React.EffectCallback, deps?: React.DependencyList) => { - const [didMount, setDidMount] = useState(false) - - useEffect(() => { - if (didMount) { - effect() - } else { - setDidMount(true) - } - }, [deps, didMount, effect]) -} - -export const useResize = (ref: React.RefObject, effect: (target: HTMLElement) => void) => { - const [size, setSize] = useState() - - function isDeepEqual(prevSize?: DOMRect, nextSize?: DOMRect) { - return JSON.stringify(prevSize) === JSON.stringify(nextSize) - } - - useResizeObserver(ref, ({ contentRect, target }) => { - if (!isDeepEqual(size, contentRect)) { - setSize(contentRect) - effect(target as HTMLElement) - } - }) -} - -export const useDebouncedCallback = (callback: () => void, waitMs: number = 500) => { - const timeout = useRef() - - clearTimeout(timeout.current) - - timeout.current = setTimeout(() => { - callback() - }, waitMs) -} - -export const usePrevious = (value: any) => { - const ref = useRef() - - useEffect(() => { - ref.current = value - }, [value]) - - return ref.current -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/app/listenerMiddleware.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/app/listenerMiddleware.ts deleted file mode 100644 index 3ce923ae8..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/app/listenerMiddleware.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { createListenerMiddleware, isAnyOf } from '@reduxjs/toolkit' -import { - deleteAllCompleted, - openAllCompleted, - taskAdded, - taskDeleted, - taskModified, - tasksGroupAdded, - tasksGroupCollapsed, - tasksGroupDeleted, - tasksGroupLastActive, - tasksGroupMerged, - tasksReordered, - taskToggled, -} from '../features/tasks/tasks-slice' - -const listenerMiddleware = createListenerMiddleware() - -/** - * A list of actions that we want to listen to. - * The groupName is obtained from the payload, and we use it to - * dispatch the tasksGroupLastActive action. - */ -const actionsWithGroup = isAnyOf( - taskAdded, - taskModified, - taskToggled, - taskDeleted, - openAllCompleted, - deleteAllCompleted, - tasksReordered, - tasksGroupAdded, - tasksGroupDeleted, - tasksGroupMerged, - tasksGroupCollapsed, -) - -listenerMiddleware.startListening({ - matcher: actionsWithGroup, - effect: ({ payload }, listenerApi) => { - const { groupName } = payload - listenerApi.dispatch(tasksGroupLastActive({ groupName })) - }, -}) - -export default listenerMiddleware.middleware diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/app/store.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/app/store.ts deleted file mode 100644 index 2f84eca1c..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/app/store.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { configureStore } from '@reduxjs/toolkit' - -import settingsReducer from '../features/settings/settings-slice' -import tasksReducer from '../features/tasks/tasks-slice' -import listenerMiddleware from './listenerMiddleware' - -export const store = configureStore({ - reducer: { - tasks: tasksReducer, - settings: settingsReducer, - }, - middleware: (getDefaultMiddleware) => getDefaultMiddleware().prepend(listenerMiddleware), -}) - -export type AppDispatch = typeof store.dispatch -export type RootState = ReturnType diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/CheckBoxInput.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/CheckBoxInput.tsx deleted file mode 100644 index 62e0f2a65..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/CheckBoxInput.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { ChangeEvent, forwardRef, MouseEvent } from 'react' - -type CheckBoxInputProps = { - checked?: boolean - disabled?: boolean - testId?: string - onChange?: (event: ChangeEvent) => void - onClick?: (event: MouseEvent) => void -} - -export const CheckBoxInput = forwardRef( - ({ checked, disabled, testId, onChange, onClick }, ref) => { - return ( - - ) - }, -) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/CircularProgressBar.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/CircularProgressBar.tsx deleted file mode 100644 index d5b06f30e..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/CircularProgressBar.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import React, { useEffect, useState } from 'react' -import styled from 'styled-components' - -const ProgressBarBackground = styled.circle` - fill: none; - stroke: var(--sn-stylekit-neutral-color); -` - -const ProgressBarStroke = styled.circle` - fill: none; - stroke: var(--sn-stylekit-info-color); - transition: all 0.5s; -` - -type CircularProgressBarProps = { - size: number - percentage: number -} - -export const CircularProgressBar: React.FC = ({ size, percentage }) => { - const [progress, setProgress] = useState(0) - - useEffect(() => { - setProgress(percentage) - }, [percentage]) - - const viewBox = `0 0 ${size} ${size}` - const strokeWidth = size * (0.1 / 100) * 100 + 1 - const radius = (size - strokeWidth) / 2 - const circumference = radius * Math.PI * 2 - const dash = (progress * circumference) / 100 - - return ( - - - - - ) -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/ConfirmDialog.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/ConfirmDialog.tsx deleted file mode 100644 index f6eb58b3d..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/ConfirmDialog.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import '@reach/dialog/styles.css' - -import { AlertDialog, AlertDialogDescription, AlertDialogLabel } from '@reach/alert-dialog' -import React, { useRef } from 'react' - -import { sanitizeHtmlString } from '@standardnotes/utils' - -type ConfirmDialogProps = { - testId?: string - title?: string - confirmButtonText?: string - confirmButtonStyle?: 'danger' | 'info' - confirmButtonCb: () => void - cancelButtonText?: string - cancelButtonCb: () => void -} - -export const ConfirmDialog: React.FC = ({ - testId, - title = '', - confirmButtonText = 'Confirm', - confirmButtonStyle = 'info', - confirmButtonCb, - cancelButtonText = 'Cancel', - cancelButtonCb, - children, -}) => { - const cancelRef = useRef(null) - - return ( - -
-
-
-
-
- - - -

{children}

-
- -
- - -
-
-
-
-
-
-
- ) -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/GenericInlineText.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/GenericInlineText.tsx deleted file mode 100644 index 6c67e1426..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/GenericInlineText.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import styled from 'styled-components' - -export const GenericInlineText = styled.span` - color: var(--sn-stylekit-paragraph-text-color); - font-size: var(--sn-stylekit-font-size-p); - margin: 0 10px; -` diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/MainTitle.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/MainTitle.tsx deleted file mode 100644 index ff661d9ac..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/MainTitle.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import styled from 'styled-components' - -type Header1Props = { - crossed: boolean -} - -const Header1 = styled.h1` - color: var(--sn-stylekit-editor-foreground-color); - display: inline; - font-size: 1.125rem !important; - margin-right: 10px !important; - text-decoration: ${({ crossed }) => (crossed ? 'line-through' : 'none')}; -` - -type MainTitleProps = { - highlight?: boolean - crossed?: boolean -} - -export const MainTitle: React.FC = ({ children, highlight = false, crossed = false, ...props }) => { - return ( - - {children} - - ) -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/RoundButton.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/RoundButton.tsx deleted file mode 100644 index 507f38952..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/RoundButton.tsx +++ /dev/null @@ -1,13 +0,0 @@ -type RoundButtonProps = { - testId?: string - onClick: () => void - size?: 'normal' | 'small' -} - -export const RoundButton: React.FC = ({ testId, onClick, children, size = 'normal' }) => { - return ( - - ) -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/SubTitle.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/SubTitle.tsx deleted file mode 100644 index a1cf443a9..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/SubTitle.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import styled from 'styled-components' - -export const SubTitle = styled.h3` - color: var(--sn-stylekit-foreground-color); - cursor: pointer; - font-size: var(--sn-stylekit-font-size-h3); - font-weight: 500; - margin: 10px 0px; - opacity: 0.55; - - &::first-letter { - text-transform: capitalize; - } -` diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/TextAreaInput.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/TextAreaInput.tsx deleted file mode 100644 index bb06479de..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/TextAreaInput.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { ChangeEvent, forwardRef, KeyboardEvent } from 'react' -import styled from 'styled-components' - -const StyledTextArea = styled.textarea` - background-color: transparent; - border: none; - color: inherit; - font-size: 0.98rem; - font-weight: 400; - margin-left: 2px; - outline: none; - overflow: hidden; - resize: none; - width: 100%; -` - -type TextAreaInputProps = { - value: string - className?: string - dir?: 'ltr' | 'rtl' | 'auto' - disabled?: boolean - spellCheck?: boolean - testId?: string - onChange?: (event: ChangeEvent) => void - onKeyPress?: (event: KeyboardEvent) => void - onKeyUp?: (event: KeyboardEvent) => void -} - -export const TextAreaInput = forwardRef( - ({ value, className, dir = 'auto', disabled, spellCheck, testId, onChange, onKeyPress, onKeyUp }, ref) => { - return ( - - ) - }, -) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/TextInput.scss b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/TextInput.scss deleted file mode 100644 index 305506a8e..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/TextInput.scss +++ /dev/null @@ -1,21 +0,0 @@ -$transition-duration: 750ms; - -@keyframes strike { - from { - text-decoration: line-through 1px solid transparent; - } - to { - text-decoration: line-through 1px solid var(--sn-stylekit-info-color); - } -} - -.cross-out { - animation-duration: $transition-duration; - animation-fill-mode: forwards; - animation-name: strike; - animation-timing-function: linear; -} - -.no-text-decoration { - text-decoration: none !important; -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/TextInput.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/TextInput.tsx deleted file mode 100644 index 7b6c6d34b..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/TextInput.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import './TextInput.scss' - -import { ChangeEvent, FocusEvent, forwardRef, KeyboardEvent } from 'react' -import styled from 'styled-components' - -type StyledInputProps = { - textSize: 'normal' | 'big' -} - -const StyledInput = styled.input` - background-color: unset; - border: none; - color: var(--sn-stylekit-foreground-color); - font-size: ${({ textSize }) => (textSize === 'big' ? '1.125rem' : 'var(--sn-stylekit-font-size-h3)')}; - font-weight: ${({ textSize }) => (textSize === 'big' ? '500' : '400')}; - height: auto; - margin: 6px 0 6px 0; - outline: none; - padding: 0; - width: 100%; - - /* Remove default shadow for iOS mobile */ - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - - ::placeholder { - color: var(--sn-stylekit-input-placeholder-color); - } -` - -type TextInputProps = { - value: string - autoFocus?: boolean - dir?: 'ltr' | 'rtl' | 'auto' - disabled?: boolean - enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' - placeholder?: string - spellCheck?: boolean - testId?: string - textSize?: 'normal' | 'big' - onBlur?: (event: FocusEvent) => void - onChange?: (event: ChangeEvent) => void - onKeyPress?: (event: KeyboardEvent) => void -} - -export const TextInput = forwardRef( - ( - { - value, - autoFocus, - dir = 'auto', - disabled, - enterKeyHint, - placeholder, - spellCheck, - testId, - textSize = 'normal', - onBlur, - onChange, - onKeyPress, - }, - ref, - ) => { - return ( - - ) - }, -) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/WideButton.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/WideButton.tsx deleted file mode 100644 index 986f9ea87..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/WideButton.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import styled from 'styled-components' - -export const WideButton = styled.button` - align-items: center; - background-color: var(--sn-stylekit-background-color); - border-radius: 8px; - border: 1px solid var(--sn-stylekit-border-color); - box-sizing: border-box; - color: var(--sn-stylekit-paragraph-text-color); - cursor: pointer; - display: flex; - height: 36px; - justify-content: center; - width: 100%; -` diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/AddIcon.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/AddIcon.tsx deleted file mode 100644 index bc3ab3ac4..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/AddIcon.tsx +++ /dev/null @@ -1,14 +0,0 @@ -export const AddIcon = () => { - return ( - - - - ) -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/ChevronDownIcon.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/ChevronDownIcon.tsx deleted file mode 100644 index 45862542e..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/ChevronDownIcon.tsx +++ /dev/null @@ -1,7 +0,0 @@ -export const ChevronDownIcon = () => { - return ( - - - - ) -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/ChevronUpIcon.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/ChevronUpIcon.tsx deleted file mode 100644 index 7f00a7a77..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/ChevronUpIcon.tsx +++ /dev/null @@ -1,7 +0,0 @@ -export const ChevronUpIcon = () => { - return ( - - - - ) -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/DottedCircleIcon.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/DottedCircleIcon.tsx deleted file mode 100644 index fdd2ceb63..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/DottedCircleIcon.tsx +++ /dev/null @@ -1,12 +0,0 @@ -export const DottedCircleIcon = () => { - return ( - - - - ) -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/MergeIcon.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/MergeIcon.tsx deleted file mode 100644 index 4208e1d47..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/MergeIcon.tsx +++ /dev/null @@ -1,7 +0,0 @@ -export const MergeIcon = () => { - return ( - - - - ) -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/MoreIcon.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/MoreIcon.tsx deleted file mode 100644 index 1f8188fa5..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/MoreIcon.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import styled from 'styled-components' - -const Ellipsis = ({ ...props }) => ( - - … - -) - -/** - * SVG icons don't work well with the MenuButton components. - * So we create a text-based replacement for it. - */ -export const MoreIcon = styled(Ellipsis)` - font-weight: 800; - height: 18px; - line-height: 10px; -` diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/RenameIcon.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/RenameIcon.tsx deleted file mode 100644 index c8349cc6e..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/RenameIcon.tsx +++ /dev/null @@ -1,7 +0,0 @@ -export const RenameIcon = () => { - return ( - - - - ) -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/ReorderIcon.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/ReorderIcon.tsx deleted file mode 100644 index 683764272..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/ReorderIcon.tsx +++ /dev/null @@ -1,17 +0,0 @@ -type ReorderIconProps = { - highlight?: boolean -} - -export const ReorderIcon: React.FC = ({ highlight = false }) => { - return ( - - - - ) -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/TrashIcon.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/TrashIcon.tsx deleted file mode 100644 index 45c428e8d..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/TrashIcon.tsx +++ /dev/null @@ -1,7 +0,0 @@ -export const TrashIcon = () => { - return ( - - - - ) -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/index.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/index.ts deleted file mode 100644 index 16eb810b4..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/icons/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { AddIcon } from './AddIcon' -export { ChevronDownIcon } from './ChevronDownIcon' -export { ChevronUpIcon } from './ChevronUpIcon' -export { DottedCircleIcon } from './DottedCircleIcon' -export { MergeIcon } from './MergeIcon' -export { MoreIcon } from './MoreIcon' -export { RenameIcon } from './RenameIcon' -export { ReorderIcon } from './ReorderIcon' -export { TrashIcon } from './TrashIcon' diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/index.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/index.ts deleted file mode 100644 index 4caf5d4e7..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from './CheckBoxInput' -export * from './CircularProgressBar' -export * from './ConfirmDialog' -export * from './GenericInlineText' -export * from './MainTitle' -export * from './RoundButton' -export * from './SubTitle' -export * from './TextAreaInput' -export * from './TextInput' -export * from './WideButton' diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/svg/CheckBoxElementsDefs.scss b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/svg/CheckBoxElementsDefs.scss deleted file mode 100644 index 2ac013a1d..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/svg/CheckBoxElementsDefs.scss +++ /dev/null @@ -1,114 +0,0 @@ -$transition-duration: 750ms; - -.checkbox-container { - display: block; - padding-left: 22px; - position: relative; - - &:last-child { - border-bottom: none; - } -} - -.checkbox-state { - height: 0; - left: 0; - opacity: 0; - position: absolute; - top: 0; - width: 0; -} - -.checkbox-button { - bottom: 0; - cursor: pointer; - fill: var(--sn-stylekit-contrast-background-color); - height: 18px; - left: 0; - margin: auto; - position: absolute; - stroke-linecap: round; - stroke-linejoin: round; - stroke-width: 1; - top: 0; - width: 18px; -} - -.align-baseline { - .checkbox-button { - top: -10px !important; - } -} - -.checkbox-square, -.checkbox-mark { - cursor: pointer; - transition: stroke-dashoffset $transition-duration cubic-bezier(0.9, 0, 0.5, 1); -} - -.checkbox-circle { - animation-delay: 1s; - animation: none $transition-duration linear; - stroke-dasharray: 1 6; - stroke-width: 0; - stroke: var(--sn-stylekit-neutral-color); - transform-origin: 13.5px 12.5px; - transform: scale(0.4) rotate(0deg); -} - -.checkbox-square { - stroke-dasharray: 56.1053, 56.1053; - stroke-dashoffset: 0; - stroke: var(--sn-stylekit-shadow-color); - transition-delay: $transition-duration * 0.2; - fill: var(--sn-stylekit-contrast-background-color); -} - -.checkbox-mark { - stroke-dasharray: 9.8995, 9.8995; - stroke-dashoffset: 9.8995; - stroke: var(--sn-stylekit-neutral-color); - transition-duration: $transition-duration * 0.4; -} - -.checkbox-circle { - animation-delay: $transition-duration * 0.7; - animation-duration: $transition-duration * 0.7; -} - -.checkbox-state:checked { - ~ .checkbox-button .checkbox-square { - stroke-dashoffset: 56.1053; - stroke: var(--sn-stylekit-info-color); - transition-delay: 0s; - } - - ~ .checkbox-button .checkbox-mark { - stroke-dashoffset: 0; - stroke: var(--sn-stylekit-info-color); - transition-delay: $transition-duration * 0.6; - } -} - -@keyframes explode { - 30% { - stroke: var(--sn-stylekit-info-color); - stroke-opacity: 1; - stroke-width: 3; - transform: scale(0.8) rotate(40deg); - } - 100% { - stroke: var(--sn-stylekit-neutral-color); - stroke-opacity: 0; - stroke-width: 0; - transform: scale(1.1) rotate(60deg); - } -} - -.explode { - .checkbox-circle { - animation: explode ease $transition-duration; - animation-delay: $transition-duration; - animation-fill-mode: forwards; - } -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/svg/CheckBoxElementsDefs.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/svg/CheckBoxElementsDefs.tsx deleted file mode 100644 index 2b98205f6..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/svg/CheckBoxElementsDefs.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import './CheckBoxElementsDefs.scss' - -export const CheckBoxElementsDefs = () => { - return ( - - - - - - - - ) -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/svg/index.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/svg/index.ts deleted file mode 100644 index 225bbc640..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/svg/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './CheckBoxElementsDefs' diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/vectors/ArrowVector.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/vectors/ArrowVector.tsx deleted file mode 100644 index 08bde5db4..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/vectors/ArrowVector.tsx +++ /dev/null @@ -1,19 +0,0 @@ -type ArrowVectorProps = { - style?: React.CSSProperties -} - -export const ArrowVector: React.FC = ({ style }) => { - return ( - - - - ) -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/vectors/index.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/vectors/index.ts deleted file mode 100644 index 0c7c2d84f..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/components/vectors/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { ArrowVector } from './ArrowVector' diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/utils.test.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/utils.test.ts deleted file mode 100644 index fcbef4465..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/utils.test.ts +++ /dev/null @@ -1,296 +0,0 @@ -import { DEFAULT_SECTIONS, GroupModel, TaskModel } from '../features/tasks/tasks-slice' -import { - arrayDefault, - arrayMoveImmutable, - arrayMoveMutable, - getPercentage, - getPlainPreview, - getTaskArrayFromGroupedTasks, - groupTasksByCompletedStatus, - parseMarkdownTasks, - truncateText, -} from './utils' - -describe('arrayMoveMutable', () => { - it('should not mutate array if there are no elements', () => { - const theArray: any[] = [] - arrayMoveMutable(theArray, 0, 1) - - expect(theArray).toHaveLength(0) - }) - - test('passing a negative number to fromIndex should use 0 instead', () => { - const theArray = ['test', 'another test'] - arrayMoveMutable(theArray, -1, 1) - - expect(theArray).toHaveLength(2) - expect(theArray[0]).toBe('test') - expect(theArray[1]).toBe('another test') - }) - - test('passing a negative number to toIndex should use 0 instead', () => { - const theArray = ['test', 'another test'] - arrayMoveMutable(theArray, 1, -1) - - expect(theArray).toHaveLength(2) - expect(theArray[0]).toBe('test') - expect(theArray[1]).toBe('another test') - }) -}) - -describe('arrayMoveImmutable', () => { - it('should move the element to the desired position', () => { - const theArray = ['test', 'testing'] - const newArray = arrayMoveImmutable(theArray, 0, 1) - - expect(theArray).toHaveLength(2) - expect(theArray[0]).toBe('test') - expect(theArray[1]).toBe('testing') - - expect(newArray).toHaveLength(2) - expect(newArray[0]).toBe('testing') - expect(newArray[1]).toBe('test') - }) -}) - -describe('getPercentage', () => { - it('should return 0 if the first number is 0', () => { - const percentage = getPercentage(0, 1) - expect(percentage).toBe(0) - }) - - it('should return 0 if the second number is 0', () => { - const percentage = getPercentage(1, 0) - expect(percentage).toBe(0) - }) - - it('should swap first number with second number, if the later is greater', () => { - const percentage = getPercentage(10, 1) - expect(percentage).toBe(10) - }) - - it('should trucate numbers up to two places', () => { - expect(getPercentage(38.2, 125)).toBe(30.56) - expect(getPercentage(67.55, 125)).toBe(54.04) - expect(getPercentage(86.65, 125)).toBe(69.32) - expect(getPercentage(98.85, 125)).toBe(79.08) - }) - - it('should return the percentage of two numbers', () => { - expect(getPercentage(4, 20)).toBe(20) - expect(getPercentage(10, 10)).toBe(100) - expect(getPercentage(10, 100)).toBe(10) - expect(getPercentage(10, 40)).toBe(25) - expect(getPercentage(15, 30)).toBe(50) - }) -}) - -describe('groupTasksByCompletedStatus', () => { - it('should return open tasks and completed tasks', () => { - const tasks: TaskModel[] = [ - { - id: 'test-1', - description: 'Testing #1', - completed: false, - createdAt: new Date(), - }, - { - id: 'test-2', - description: 'Testing #2', - createdAt: new Date(), - }, - { - id: 'test-3', - description: 'Testing #3', - completed: true, - createdAt: new Date(), - }, - ] - - const { openTasks, completedTasks } = groupTasksByCompletedStatus(tasks) - - expect(openTasks).toHaveLength(2) - expect(openTasks[0]).toBe(tasks[0]) - expect(openTasks[1]).toBe(tasks[1]) - - expect(completedTasks).toHaveLength(1) - expect(completedTasks[0]).toBe(tasks[2]) - }) -}) - -describe('getTaskArrayFromGroupedTasks', () => { - it('should return an array of tasks', () => { - const workTasks = [ - { - id: 'test-b-1', - description: 'Test #1', - createdAt: new Date(), - }, - { - id: 'test-b-2', - description: 'Test #2', - completed: true, - createdAt: new Date(), - }, - ] - - const personalTasks = [ - { - id: 'test-c-1', - description: 'Test #3', - createdAt: new Date(), - }, - { - id: 'test-c-2', - description: 'Test #4', - completed: true, - createdAt: new Date(), - }, - ] - - const groupedTasks: GroupModel[] = [ - { - name: 'Work', - sections: DEFAULT_SECTIONS, - tasks: workTasks, - }, - { - name: 'Personal', - sections: DEFAULT_SECTIONS, - tasks: personalTasks, - }, - ] - - const taskArray = getTaskArrayFromGroupedTasks(groupedTasks) - - expect(taskArray).toHaveLength(workTasks.length + personalTasks.length) - expect(taskArray).toStrictEqual([...workTasks, ...personalTasks]) - }) -}) - -describe('truncateText', () => { - it('should return the text as-is', () => { - const text = 'This is a simple text. It should not be truncated.' - - expect(truncateText(text, 100)).toBe(text) - }) - - it('should return the truncated text', () => { - const text = 'This is a simple text. It should not be truncated.' - const truncated = truncateText(text, 10) - - expect(truncated).toHaveLength(13) // Includes ellipsis - expect(truncated).toBe('This is a ...') - }) -}) - -describe('getPlainPreview', () => { - it('should return a text preview in the format: {open tasks}/{all tasks}', () => { - const workTasks = [ - { - id: 'test-b-1', - description: 'Test #1', - createdAt: new Date(), - }, - { - id: 'test-b-2', - description: 'Test #2', - completed: true, - createdAt: new Date(), - }, - ] - - const personalTasks = [ - { - id: 'test-c-1', - description: 'Test #3', - createdAt: new Date(), - }, - { - id: 'test-c-2', - description: 'Test #4', - completed: true, - createdAt: new Date(), - }, - { - id: 'test-c-3', - description: 'Test #5', - createdAt: new Date(), - }, - ] - - const groupedTasks: GroupModel[] = [ - { - name: 'Work', - sections: DEFAULT_SECTIONS, - tasks: workTasks, - }, - { - name: 'Personal', - sections: DEFAULT_SECTIONS, - tasks: personalTasks, - }, - ] - - expect(getPlainPreview(groupedTasks)).toBe('2/5 tasks completed') - expect(getPlainPreview([])).toBe('0/0 tasks completed') - expect(getPlainPreview([{ name: 'Test', tasks: [], sections: [] }])).toBe('0/0 tasks completed') - }) -}) - -describe('parseMarkdownTasks', () => { - it('should not return tasks if payload is not in correct format', () => { - expect(parseMarkdownTasks('')).toBeUndefined() - expect(parseMarkdownTasks(' ')).toBeUndefined() - expect(parseMarkdownTasks('this is just a piece of text')).toBeUndefined() - expect(parseMarkdownTasks(undefined)).toBeUndefined() - }) - - it('should not return tasks without descriptions', () => { - const payload = '- [ ] ' - expect(parseMarkdownTasks(payload)).toBeUndefined() - }) - - it('should return tasks from a payload with correct format', () => { - const payload = `- [ ] Foo -- [x] Bar -- [ ] Foobar` - - expect(parseMarkdownTasks(payload)).toMatchObject({ - name: 'Checklist', - tasks: [ - { - id: expect.any(String), - description: 'Foo', - completed: false, - createdAt: expect.any(Date), - }, - { - id: expect.any(String), - description: 'Bar', - completed: true, - createdAt: expect.any(Date), - }, - { - id: expect.any(String), - description: 'Foobar', - completed: false, - createdAt: expect.any(Date), - }, - ], - sections: DEFAULT_SECTIONS, - }) - }) -}) - -describe('arrayDefault', () => { - it('should fallback to default value', () => { - expect(arrayDefault({ defaultValue: [] })).toEqual([]) - expect(arrayDefault({ value: undefined, defaultValue: [] })).toEqual([]) - expect(arrayDefault({ value: [], defaultValue: ['test'] })).toEqual(['test']) - }) - - it('should return value', () => { - expect(arrayDefault({ value: ['test'], defaultValue: [] })).toEqual(['test']) - }) -}) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/utils.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/utils.ts deleted file mode 100644 index bbb8be716..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/common/utils.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { v4 as uuidv4 } from 'uuid' -import { DEFAULT_SECTIONS, GroupModel, TaskModel } from '../features/tasks/tasks-slice' - -export function arrayMoveMutable(array: any[], fromIndex: number, toIndex: number) { - const startIndex = fromIndex < 0 ? array.length + fromIndex : fromIndex - if (startIndex >= 0 && startIndex < array.length) { - const endIndex = toIndex < 0 ? array.length + toIndex : toIndex - const [item] = array.splice(fromIndex, 1) - array.splice(endIndex, 0, item) - } -} - -export function arrayMoveImmutable(array: any[], fromIndex: number, toIndex: number) { - array = [...array] - arrayMoveMutable(array, fromIndex, toIndex) - return array -} - -export function getPercentage(numberA: number, numberB: number): number { - if (numberA === 0 || numberB === 0) { - return 0 - } - const min = Math.min(numberA, numberB) - const max = Math.max(numberA, numberB) - const percentage = (min / max) * 100 - return Number(percentage.toFixed(2)) -} - -export function groupTasksByCompletedStatus(tasks: TaskModel[]) { - const openTasks = tasks.filter((task) => !task.completed) - const completedTasks = tasks.filter((task) => task.completed) - return { - openTasks, - completedTasks, - } -} - -export function getTaskArrayFromGroupedTasks(groupedTasks: GroupModel[]): TaskModel[] { - let taskArray: TaskModel[] = [] - - groupedTasks.forEach((group) => { - taskArray = taskArray.concat(group.tasks) - }) - - return taskArray -} - -export function truncateText(text: string, limit: number = 50) { - if (text.length <= limit) { - return text - } - return text.substring(0, limit) + '...' -} - -export function getPlainPreview(groupedTasks: GroupModel[]) { - const allTasks = getTaskArrayFromGroupedTasks(groupedTasks) - const { completedTasks } = groupTasksByCompletedStatus(allTasks) - - return `${completedTasks.length}/${allTasks.length} tasks completed` -} - -function createTaskFromLine(rawTask: string): TaskModel | undefined { - const IS_COMPLETED = /^- \[x\] /i - const OPEN_PREFIX = '- [ ] ' - - const description = rawTask.replace(OPEN_PREFIX, '').replace(IS_COMPLETED, '') - - if (description.length === 0) { - return - } - - return { - id: uuidv4(), - description, - completed: IS_COMPLETED.test(rawTask), - createdAt: new Date(), - } -} - -export function parseMarkdownTasks(payload?: string): GroupModel | undefined { - if (!payload) { - return - } - - const IS_LEGACY_FORMAT = /^- \[[x ]\] .*/gim - if (!IS_LEGACY_FORMAT.test(payload)) { - return - } - - const lines = payload.split('\n') - const tasks: TaskModel[] = [] - - lines - .filter((line) => line.replace(/ /g, '').length > 0) - .map((line) => createTaskFromLine(line)) - .forEach((item) => item && tasks.push(item)) - - if (tasks.length === 0) { - return - } - - return { - name: 'Checklist', - tasks, - sections: DEFAULT_SECTIONS, - } -} - -export function isJsonString(rawString: string) { - try { - JSON.parse(rawString) - } catch (e) { - return false - } - return true -} - -export function isLastActiveGroup(allGroups: GroupModel[], groupName: string): boolean { - if (allGroups.length === 0) { - return true - } - - const lastActiveGroup = allGroups.reduce((prev, current) => { - if (!prev.lastActive) { - return current - } - if (!current.lastActive) { - return prev - } - return prev.lastActive > current.lastActive ? prev : current - }) - - return lastActiveGroup.name === groupName -} - -export function arrayDefault({ value, defaultValue }: { value?: any[]; defaultValue: any[] }) { - if (!value) { - return defaultValue - } - if (value.length === 0) { - return defaultValue - } - return value -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/settings/settings-slice.test.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/settings/settings-slice.test.ts deleted file mode 100644 index b017e4d00..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/settings/settings-slice.test.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { SettingsState } from './settings-slice' -import reducer, { setCanEdit, setIsRunningOnMobile, setSpellCheckerEnabled } from './settings-slice' - -it('should return the initial state', () => { - return expect( - reducer(undefined, { - type: undefined, - }), - ).toEqual({ - canEdit: true, - isRunningOnMobile: false, - spellCheckerEnabled: true, - }) -}) - -it('should handle setting canEdit property', () => { - const previousState: SettingsState = { - canEdit: false, - isRunningOnMobile: false, - spellCheckerEnabled: false, - } - - expect(reducer(previousState, setCanEdit(true))).toEqual({ - ...previousState, - canEdit: true, - }) -}) - -it('should handle setting isRunningOnMobile property', () => { - const previousState: SettingsState = { - canEdit: false, - isRunningOnMobile: false, - spellCheckerEnabled: false, - } - - expect(reducer(previousState, setIsRunningOnMobile(true))).toEqual({ - ...previousState, - isRunningOnMobile: true, - }) -}) - -it('should handle setting spellCheckerEnabled property', () => { - const previousState: SettingsState = { - canEdit: false, - isRunningOnMobile: false, - spellCheckerEnabled: false, - } - - expect(reducer(previousState, setSpellCheckerEnabled(true))).toEqual({ - ...previousState, - spellCheckerEnabled: true, - }) -}) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/settings/settings-slice.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/settings/settings-slice.ts deleted file mode 100644 index 8a2836fc1..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/settings/settings-slice.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { createSlice, PayloadAction } from '@reduxjs/toolkit' - -export type SettingsState = { - canEdit: boolean - isRunningOnMobile: boolean - spellCheckerEnabled: boolean -} - -const initialState: SettingsState = { - canEdit: true, - isRunningOnMobile: false, - spellCheckerEnabled: true, -} - -const settingsSlice = createSlice({ - name: 'settings', - initialState, - reducers: { - setCanEdit(state, action: PayloadAction) { - state.canEdit = action.payload - }, - setIsRunningOnMobile(state, action: PayloadAction) { - state.isRunningOnMobile = action.payload - }, - setSpellCheckerEnabled(state, action: PayloadAction) { - state.spellCheckerEnabled = action.payload - }, - }, -}) - -export const { setCanEdit, setIsRunningOnMobile, setSpellCheckerEnabled } = settingsSlice.actions -export default settingsSlice.reducer diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CompletedTasksActions.test.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CompletedTasksActions.test.tsx deleted file mode 100644 index 983e84f0d..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CompletedTasksActions.test.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import { fireEvent, screen } from '@testing-library/react' -import { testRender } from '../../testUtils' - -import { RootState } from '../../app/store' -import CompletedTasksActions from './CompletedTasksActions' -import { deleteAllCompleted, openAllCompleted } from './tasks-slice' - -const group = 'default group' - -it('renders two buttons', () => { - testRender() - - expect(screen.getByTestId('reopen-completed-button')).toHaveTextContent('Reopen Completed') - expect(screen.getByTestId('delete-completed-button')).toHaveTextContent('Delete Completed') -}) - -it('should not render buttons if can not edit', () => { - const defaultState: Partial = { - settings: { - canEdit: false, - isRunningOnMobile: false, - spellCheckerEnabled: true, - }, - } - - testRender(, {}, defaultState) - - expect(screen.queryByTestId('reopen-completed-button')).not.toBeInTheDocument() - expect(screen.queryByTestId('delete-completed-button')).not.toBeInTheDocument() -}) - -it('should dispatch openAllCompleted action', () => { - const { mockStore } = testRender() - - const reOpenCompletedButton = screen.getByTestId('reopen-completed-button') - fireEvent.click(reOpenCompletedButton) - - const confirmDialog = screen.getByTestId('reopen-all-tasks-dialog') - expect(confirmDialog).toBeInTheDocument() - expect(confirmDialog).toHaveTextContent(`Are you sure you want to reopen completed tasks in the '${group}' group?`) - - const confirmButton = screen.getByTestId('confirm-dialog-button') - fireEvent.click(confirmButton) - - const dispatchedActions = mockStore.getActions() - expect(dispatchedActions).toHaveLength(1) - expect(dispatchedActions[0]).toMatchObject(openAllCompleted({ groupName: group })) -}) - -it('should dispatch deleteCompleted action', () => { - const { mockStore } = testRender() - - const deleteCompletedButton = screen.getByTestId('delete-completed-button') - fireEvent.click(deleteCompletedButton) - - const confirmDialog = screen.getByTestId('delete-completed-tasks-dialog') - expect(confirmDialog).toBeInTheDocument() - expect(confirmDialog).toHaveTextContent(`Are you sure you want to delete completed tasks in the '${group}' group?`) - - const confirmButton = screen.getByTestId('confirm-dialog-button') - fireEvent.click(confirmButton) - - const dispatchedActions = mockStore.getActions() - expect(dispatchedActions).toHaveLength(1) - expect(dispatchedActions[0]).toMatchObject(deleteAllCompleted({ groupName: group })) -}) - -it('should dismiss dialogs', () => { - const { mockStore } = testRender() - - const reOpenCompletedButton = screen.getByTestId('reopen-completed-button') - fireEvent.click(reOpenCompletedButton) - - fireEvent.click(screen.getByTestId('cancel-dialog-button')) - - const deleteCompletedButton = screen.getByTestId('delete-completed-button') - fireEvent.click(deleteCompletedButton) - - fireEvent.click(screen.getByTestId('cancel-dialog-button')) - - const dispatchedActions = mockStore.getActions() - expect(dispatchedActions).toHaveLength(0) -}) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CompletedTasksActions.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CompletedTasksActions.tsx deleted file mode 100644 index 69a96df7e..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CompletedTasksActions.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import { useState } from 'react' -import styled from 'styled-components' - -import { useAppDispatch, useAppSelector } from '../../app/hooks' -import { ConfirmDialog } from '../../common/components' - -import { deleteAllCompleted, openAllCompleted } from './tasks-slice' - -const ActionButton = styled.button` - background-color: var(--sn-stylekit-contrast-background-color); - border-radius: 4px; - border-style: none; - color: var(--sn-stylekit-paragraph-text-color); - cursor: pointer; - display: inline; - font-size: var(--sn-stylekit-font-size-h6); - font-weight: 500; - height: 25px; - margin-right: 10px; - opacity: 0.96; - padding: 4px 10px 4px; - - &:hover { - opacity: 0.8; - text-decoration: none; - } -` - -type CompletedTasksActionsProps = { - groupName: string -} - -const CompletedTasksActions: React.FC = ({ groupName }) => { - const dispatch = useAppDispatch() - - const canEdit = useAppSelector((state) => state.settings.canEdit) - - const [showReopenDialog, setShowReopenDialog] = useState(false) - const [showDeleteDialog, setShowDeleteDialog] = useState(false) - - if (!canEdit) { - return <> - } - - return ( -
- setShowReopenDialog(true)} data-testid="reopen-completed-button"> - Reopen Completed - - setShowDeleteDialog(true)} data-testid="delete-completed-button"> - Delete Completed - - {showReopenDialog && ( - dispatch(openAllCompleted({ groupName }))} - cancelButtonCb={() => setShowReopenDialog(false)} - > - Are you sure you want to reopen completed tasks in the '{groupName}' group? - - )} - {showDeleteDialog && ( - dispatch(deleteAllCompleted({ groupName }))} - cancelButtonCb={() => setShowDeleteDialog(false)} - > - Are you sure you want to delete completed tasks in the '{groupName}' group? - - )} -
- ) -} - -export default CompletedTasksActions diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CreateGroup.test.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CreateGroup.test.tsx deleted file mode 100644 index 2cda03b87..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CreateGroup.test.tsx +++ /dev/null @@ -1,126 +0,0 @@ -import { fireEvent, screen } from '@testing-library/react' -import { RootState } from '../../app/store' - -import { testRender } from '../../testUtils' -import CreateGroup from './CreateGroup' -import { tasksGroupAdded } from './tasks-slice' - -const defaultTasksState = { - tasks: { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'test', - tasks: [], - }, - ], - }, -} - -it('renders a button by default', () => { - testRender() - - expect(screen.queryByTestId('create-group-button')).not.toBeInTheDocument() - expect(screen.getByTestId('create-group-input')).toBeInTheDocument() -}) - -it('renders nothing if user can not edit', () => { - const defaultState: Partial = { - settings: { - canEdit: false, - isRunningOnMobile: false, - spellCheckerEnabled: true, - }, - } - - testRender(, {}, defaultState) - - expect(screen.queryByTestId('create-group-button')).not.toBeInTheDocument() - expect(screen.queryByTestId('create-group-input')).not.toBeInTheDocument() -}) - -it('renders an input box when the button is clicked', () => { - testRender(, {}, defaultTasksState) - - const button = screen.getByTestId('create-group-button') - fireEvent.click(button) - - expect(button).not.toBeInTheDocument() - - const inputBox = screen.queryByTestId('create-group-input') - expect(inputBox).toBeInTheDocument() - expect(inputBox).toHaveTextContent('') -}) - -it('changes the input box text', () => { - testRender() - - const inputBox = screen.getByTestId('create-group-input') as HTMLInputElement - fireEvent.change(inputBox, { target: { value: 'This is the new text' } }) - - expect(inputBox.value).toBe('This is the new text') -}) - -test('pressing enter when input box is empty, should not create a new group', () => { - const { mockStore } = testRender(, {}, defaultTasksState) - - let button = screen.getByTestId('create-group-button') - fireEvent.click(button) - - const inputBox = screen.getByTestId('create-group-input') - fireEvent.keyPress(inputBox, { - key: 'Enter', - code: 'Enter', - charCode: 13, - target: { value: '' }, - }) - - const dispatchedActions = mockStore.getActions() - expect(dispatchedActions).toHaveLength(0) - - button = screen.getByTestId('create-group-button') - - expect(inputBox).not.toBeInTheDocument() - expect(button).toBeInTheDocument() -}) - -test('pressing enter should create a new group', () => { - const groupName = 'My group name' - const { mockStore } = testRender(, {}, defaultTasksState) - - let button = screen.getByTestId('create-group-button') - fireEvent.click(button) - - const inputBox = screen.getByTestId('create-group-input') - fireEvent.keyPress(inputBox, { - key: 'Enter', - code: 'Enter', - charCode: 13, - target: { value: groupName }, - }) - - const dispatchedActions = mockStore.getActions() - expect(dispatchedActions).toHaveLength(1) - expect(dispatchedActions[0]).toMatchObject(tasksGroupAdded({ groupName })) - - button = screen.getByTestId('create-group-button') - - expect(inputBox).not.toBeInTheDocument() - expect(button).toBeInTheDocument() -}) - -test('the create new group button is shown if the input box loses focus', () => { - testRender(, {}, defaultTasksState) - - let button = screen.getByTestId('create-group-button') - fireEvent.click(button) - - const inputBox = screen.getByTestId('create-group-input') - fireEvent.blur(inputBox) - - button = screen.getByTestId('create-group-button') - - expect(inputBox).not.toBeInTheDocument() - expect(button).toBeInTheDocument() -}) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CreateGroup.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CreateGroup.tsx deleted file mode 100644 index 67839dae2..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CreateGroup.tsx +++ /dev/null @@ -1,153 +0,0 @@ -import { ChangeEvent, createRef, FocusEvent, KeyboardEvent, useState } from 'react' -import styled from 'styled-components' - -import { useAppDispatch, useAppSelector } from '../../app/hooks' -import { tasksGroupAdded } from './tasks-slice' - -import { TextInput, WideButton } from '../../common/components' -import { AddIcon } from '../../common/components/icons' -import { ArrowVector } from '../../common/components/vectors' - -const InputContainer = styled.div` - background-color: var(--sn-stylekit-background-color); - border: 1px solid var(--sn-stylekit-border-color); - border-radius: 8px; - box-sizing: border-box; - padding: 16px; - width: 100%; -` - -const TutorialContainer = styled.div` - display: flex; - flex-direction: column; - margin-top: 9px; - position: relative; -` - -const Tutorial = styled.div` - align-items: center; - align-content: center; - display: flex; - flex-direction: column; - position: absolute; - width: 100%; - z-index: 100; -` - -const TutorialText = styled.div` - color: var(--sn-stylekit-paragraph-text-color); - font-size: var(--sn-stylekit-font-size-h2); - margin: 0; - text-align: center; - width: 194px; -` - -const BaseEmptyContainer = styled.div` - background-color: var(--sn-stylekit-border-color); - border-radius: 8px; - box-sizing: border-box; - height: 66px; - padding: 16px; - margin-bottom: 9px; -` - -const EmptyContainer1 = styled(BaseEmptyContainer)` - opacity: 0.8; -` - -const EmptyContainer2 = styled(BaseEmptyContainer)` - opacity: 0.6; -` - -const EmptyContainer3 = styled(BaseEmptyContainer)` - opacity: 0.4; -` - -const EmptyContainer4 = styled(BaseEmptyContainer)` - opacity: 0.2; -` - -const CreateGroup: React.FC = () => { - const inputRef = createRef() - - const dispatch = useAppDispatch() - - const [group, setGroup] = useState('') - const [isCreateMode, setIsCreateMode] = useState(false) - - const canEdit = useAppSelector((state) => state.settings.canEdit) - const spellCheckerEnabled = useAppSelector((state) => state.settings.spellCheckerEnabled) - const groupedTasks = useAppSelector((state) => state.tasks.groups) - const taskGroupCount = groupedTasks.length - - function toggleMode() { - setIsCreateMode(!isCreateMode) - } - - function handleBlur(event: FocusEvent) { - setIsCreateMode(false) - setGroup('') - } - - function handleTextChange(event: ChangeEvent) { - setGroup(event.target.value) - } - - function handleKeyPress(event: KeyboardEvent) { - if (event.key === 'Enter') { - const groupName = (event.target as HTMLInputElement).value - if (groupName.length > 0) { - dispatch(tasksGroupAdded({ groupName })) - } - - setIsCreateMode(false) - setGroup('') - } - } - - if (!canEdit) { - return <> - } - - return ( - <> - {!isCreateMode && taskGroupCount > 0 ? ( - - - - ) : ( - <> - - - - {taskGroupCount === 0 && ( - - - - Get started by naming your first task group - - - - - - - )} - - )} - - ) -} - -export default CreateGroup diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CreateTask.test.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CreateTask.test.tsx deleted file mode 100644 index eefcebf79..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CreateTask.test.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import { fireEvent, screen } from '@testing-library/react' -import { RootState } from '../../app/store' - -import { testRender } from '../../testUtils' -import CreateTask from './CreateTask' -import { DEFAULT_SECTIONS, taskAdded } from './tasks-slice' - -jest.mock('uuid', () => { - return { - v4: () => 'my-fake-uuid', - } -}) - -const defaultGroup = { - name: 'My default group', - tasks: [], - sections: DEFAULT_SECTIONS, -} - -it('renders a button by default', () => { - testRender() - - const inputBox = screen.queryByTestId('create-task-input') - expect(inputBox).toBeInTheDocument() - expect(inputBox).toHaveTextContent('') -}) - -it('should not render input if can not edit', () => { - const defaultState: Partial = { - settings: { - canEdit: false, - isRunningOnMobile: false, - spellCheckerEnabled: true, - }, - } - - testRender(, {}, defaultState) - - expect(screen.queryByTestId('create-task-input')).not.toBeInTheDocument() -}) - -it('changes the input box value', () => { - testRender() - - const inputBox = screen.getByTestId('create-task-input') as HTMLInputElement - fireEvent.change(inputBox, { target: { value: 'This is a simple task' } }) - - expect(inputBox.value).toBe('This is a simple task') -}) - -test('pressing enter when input box is empty, should not create a new task', () => { - const { mockStore } = testRender() - - const inputBox = screen.getByTestId('create-task-input') - fireEvent.keyPress(inputBox, { - key: 'Enter', - code: 'Enter', - charCode: 13, - target: { value: '' }, - }) - - const dispatchedActions = mockStore.getActions() - expect(dispatchedActions).toHaveLength(0) -}) - -test('pressing enter when input box is not empty, should create a new task', () => { - const { mockStore } = testRender() - - const inputBox = screen.getByTestId('create-task-input') - fireEvent.keyPress(inputBox, { - key: 'Enter', - code: 'Enter', - charCode: 13, - target: { value: 'My awesome task' }, - }) - - const dispatchedActions = mockStore.getActions() - expect(dispatchedActions).toHaveLength(1) - expect(dispatchedActions[0]).toMatchObject( - taskAdded({ - task: { id: 'my-fake-uuid', description: 'My awesome task' }, - groupName: defaultGroup.name, - }), - ) -}) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CreateTask.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CreateTask.tsx deleted file mode 100644 index 46c667c9f..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/CreateTask.tsx +++ /dev/null @@ -1,80 +0,0 @@ -import { ChangeEvent, createRef, KeyboardEvent, useState } from 'react' -import styled from 'styled-components' -import { v4 as uuidv4 } from 'uuid' - -import { useAppDispatch, useAppSelector, useDebouncedCallback } from '../../app/hooks' -import { GroupModel, taskAdded, tasksGroupDraft } from './tasks-slice' - -import { TextInput } from '../../common/components' -import { isLastActiveGroup } from '../../common/utils' - -const Container = styled.div` - align-items: center; - display: flex; - margin-bottom: 8px; -` - -type CreateTaskProps = { - group: GroupModel -} - -const CreateTask: React.FC = ({ group }) => { - const inputRef = createRef() - - const dispatch = useAppDispatch() - - const spellCheckerEnabled = useAppSelector((state) => state.settings.spellCheckerEnabled) - const canEdit = useAppSelector((state) => state.settings.canEdit) - const allGroups = useAppSelector((state) => state.tasks.groups) - - const groupName = group.name - const [taskDraft, setTaskDraft] = useState(group.draft ?? '') - - function onTextChange(event: ChangeEvent) { - setTaskDraft(event.target.value) - } - - function handleKeyPress(event: KeyboardEvent) { - if (event.key === 'Enter') { - const rawString = (event.target as HTMLInputElement).value - if (rawString.length === 0) { - return - } - - dispatch(taskAdded({ task: { id: uuidv4(), description: rawString }, groupName })) - setTaskDraft('') - } - } - - useDebouncedCallback(() => { - const currentDraft = group.draft ?? '' - if (currentDraft !== taskDraft) { - dispatch(tasksGroupDraft({ groupName, draft: taskDraft })) - } - }) - - if (!canEdit) { - return <> - } - - const isLastActive = isLastActiveGroup(allGroups, groupName) - - return ( - - - - ) -} - -export default CreateTask diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/InvalidContentError.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/InvalidContentError.tsx deleted file mode 100644 index 588c61757..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/InvalidContentError.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import styled from 'styled-components' -import { useAppSelector } from '../../app/hooks' - -const Container = styled.div` - background-color: var(--sn-stylekit-background-color); - border: 1px solid var(--sn-stylekit-border-color); - border-radius: 8px; - box-sizing: border-box; - height: 100%; - padding: 16px; - margin-bottom: 9px; -` - -const InvalidContentError: React.FC = () => { - const lastError = useAppSelector((state) => state.tasks.lastError) - if (!lastError) { - return <> - } - - return {lastError} -} - -export default InvalidContentError diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/MergeTaskGroups.test.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/MergeTaskGroups.test.tsx deleted file mode 100644 index 5cd6b9f58..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/MergeTaskGroups.test.tsx +++ /dev/null @@ -1,243 +0,0 @@ -import { fireEvent, screen } from '@testing-library/react' -import { RootState } from '../../app/store' -import { testRender } from '../../testUtils' - -import MergeTaskGroups from './MergeTaskGroups' -import { tasksGroupMerged } from './tasks-slice' - -const handleClose = jest.fn() - -it('renders the alert dialog when no groups are available to merge', () => { - const defaultGroup = 'Test' - const defaultState: Partial = { - tasks: { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - }, - } - - testRender(, {}, defaultState) - - const alertDialog = screen.getByTestId('merge-task-group-dialog') - expect(alertDialog).toBeInTheDocument() - expect(alertDialog).toHaveTextContent(`There are no other groups to merge '${defaultGroup}' with.`) - expect(alertDialog).not.toHaveTextContent(`Select which group you want to merge '${defaultGroup}' into:`) - - // There shouldn't be any radio buttons - expect(screen.queryAllByRole('radio')).toHaveLength(0) -}) - -it('renders the alert dialog when there are groups available to merge', () => { - const defaultGroup = 'Test' - const defaultState: Partial = { - tasks: { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - { - name: 'Testing', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - { - name: 'Tests', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - }, - } - - testRender(, {}, defaultState) - - const alertDialog = screen.getByTestId('merge-task-group-dialog') - expect(alertDialog).toBeInTheDocument() - expect(alertDialog).toHaveTextContent(`Select which group you want to merge '${defaultGroup}' into:`) - expect(alertDialog).not.toHaveTextContent(`There are no other groups to merge '${defaultGroup}' with.`) - - const radioButtons = screen.queryAllByRole('radio') - expect(radioButtons).toHaveLength(2) - - const firstRadioButton = radioButtons[0] - expect(firstRadioButton).not.toBeChecked() - expect(firstRadioButton).toHaveAttribute('value', 'Testing') - - const secondRadioButton = radioButtons[1] - expect(secondRadioButton).not.toBeChecked() - expect(secondRadioButton).toHaveAttribute('value', 'Tests') -}) - -it('should close the dialog if no group is selected and the Merge button is clicked', () => { - const defaultGroup = 'Test' - const defaultState: Partial = { - tasks: { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - { - name: 'Testing', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - { - name: 'Tests', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - }, - } - - const { mockStore } = testRender( - , - {}, - defaultState, - ) - - const buttons = screen.queryAllByRole('button') - expect(buttons).toHaveLength(2) - - const mergeButton = buttons[1] - expect(mergeButton).toHaveTextContent('Merge groups') - - fireEvent.click(mergeButton) - - const dispatchedActions = mockStore.getActions() - expect(dispatchedActions).toHaveLength(0) - expect(handleClose).toHaveBeenCalledTimes(1) -}) - -it('should dispatch the action to merge groups', () => { - const defaultGroup = 'Test' - const defaultState: Partial = { - tasks: { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - { - name: 'Testing', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - { - name: 'Tests', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - }, - } - - const { mockStore } = testRender( - , - {}, - defaultState, - ) - - const radioButtons = screen.queryAllByRole('radio') - - let dispatchedActions = mockStore.getActions() - expect(dispatchedActions).toHaveLength(0) - expect(handleClose).toHaveBeenCalledTimes(0) - - const firstRadioButton = radioButtons[0] - fireEvent.click(firstRadioButton) - - const buttons = screen.queryAllByRole('button') - expect(buttons).toHaveLength(2) - - const cancelButton = buttons[0] - expect(cancelButton).toHaveTextContent('Cancel') - - const mergeButton = buttons[1] - expect(mergeButton).toHaveTextContent('Merge groups') - - fireEvent.click(mergeButton) - - dispatchedActions = mockStore.getActions() - expect(dispatchedActions).toHaveLength(1) - expect(dispatchedActions[0]).toMatchObject(tasksGroupMerged({ groupName: defaultGroup, mergeWith: 'Testing' })) - expect(handleClose).toHaveBeenCalledTimes(1) -}) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/MergeTaskGroups.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/MergeTaskGroups.tsx deleted file mode 100644 index 5a943a567..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/MergeTaskGroups.tsx +++ /dev/null @@ -1,90 +0,0 @@ -import '@reach/dialog/styles.css' - -import { AlertDialog, AlertDialogDescription, AlertDialogLabel } from '@reach/alert-dialog' -import React, { useRef, useState } from 'react' - -import { useAppDispatch, useAppSelector } from '../../app/hooks' -import { tasksGroupMerged } from './tasks-slice' - -type MergeTaskGroupsProps = { - groupName: string - handleClose: () => void -} - -const MergeTaskGroups: React.FC = ({ groupName, handleClose }) => { - const cancelRef = useRef(null) - - const dispatch = useAppDispatch() - - const groupedTasks = useAppSelector((state) => state.tasks.groups) - const mergeableGroups = groupedTasks.filter((item) => item.name !== groupName) - - const [mergeWith, setMergeWith] = useState() - - function handleChange(event: React.FormEvent) { - // @ts-ignore - const selectedGroup = event.target.value - setMergeWith(selectedGroup) - } - - function handleMergeGroups() { - if (!mergeWith) { - handleClose() - return - } - - dispatch(tasksGroupMerged({ groupName, mergeWith })) - handleClose() - } - - return ( - -
-
-
-
-
- Merging task groups - - {mergeableGroups.length > 0 ? ( - <> - -

- Select which group you want to merge '{groupName}' into: -

-
-
- {mergeableGroups.map((item) => ( - - ))} -
- - ) : ( - -

- There are no other groups to merge '{groupName}' with. -

-
- )} - -
- - -
-
-
-
-
-
-
- ) -} - -export default MergeTaskGroups diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/MigrateLegacyContent.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/MigrateLegacyContent.tsx deleted file mode 100644 index a75908447..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/MigrateLegacyContent.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import '@reach/dialog/styles.css' - -import { AlertDialog, AlertDialogLabel } from '@reach/alert-dialog' -import React, { useRef } from 'react' - -import { useAppDispatch } from '../../app/hooks' -import { tasksLegacyContentMigrated } from './tasks-slice' - -const MigrateLegacyContent: React.FC = () => { - const cancelRef = useRef(null) - - const dispatch = useAppDispatch() - - function handleMigrate() { - dispatch(tasksLegacyContentMigrated({ continue: true })) - } - - function handleCancel() { - dispatch(tasksLegacyContentMigrated({ continue: false })) - } - - return ( - -
-
-
-
-
- - Are you sure you want to migrate legacy content to the new format? - - -
- - -
-
-
-
-
-
-
- ) -} - -export default MigrateLegacyContent diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/NotePreview.test.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/NotePreview.test.tsx deleted file mode 100644 index 838012347..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/NotePreview.test.tsx +++ /dev/null @@ -1,138 +0,0 @@ -import { render, screen } from '@testing-library/react' -import NotePreview from './NotePreview' -import { DEFAULT_SECTIONS, GroupModel } from './tasks-slice' - -const workTasks = [ - { - id: 'test-b-1', - description: 'Test #1', - createdAt: new Date(), - }, - { - id: 'test-b-2', - description: 'Test #2', - completed: true, - createdAt: new Date(), - }, -] - -const personalTasks = [ - { - id: 'test-c-1', - description: 'Test #3', - createdAt: new Date(), - }, - { - id: 'test-c-2', - description: 'Test #4', - completed: true, - createdAt: new Date(), - }, -] - -const miscTasks = [ - { - id: 'test-d-1', - description: 'Test #5', - createdAt: new Date(), - }, - { - id: 'test-d-2', - description: 'Test #6', - createdAt: new Date(), - }, -] - -it('should render without tasks', () => { - const groupedTasks: GroupModel[] = [] - - render() - - const header = screen.getByText('0/0 tasks completed') - expect(header).toBeVisible() - - const progressBar = screen.getByTestId('circular-progress-bar') - expect(progressBar).toBeVisible() - - // eslint-disable-next-line testing-library/no-node-access - const progressBarBackground = progressBar.firstChild - expect(progressBarBackground).toHaveClass('background') - - // eslint-disable-next-line testing-library/no-node-access - const progressBarStroke = progressBar.lastChild - expect(progressBarStroke).toHaveClass('progress p-0') - - const groupList = screen.queryAllByTestId('group-summary') - expect(groupList).toHaveLength(0) -}) - -it('should render with tasks', () => { - const groupedTasks = [ - { - name: 'Work', - tasks: workTasks, - sections: DEFAULT_SECTIONS, - }, - { - name: 'Personal', - tasks: personalTasks, - sections: DEFAULT_SECTIONS, - }, - ] - - render() - - const header = screen.getByText('2/4 tasks completed') - expect(header).toBeVisible() - - const progressBar = screen.getByTestId('circular-progress-bar') - expect(progressBar).toBeVisible() - - // eslint-disable-next-line testing-library/no-node-access - const progressBarBackground = progressBar.firstChild - expect(progressBarBackground).toHaveClass('background') - - // eslint-disable-next-line testing-library/no-node-access - const progressBarStroke = progressBar.lastChild - expect(progressBarStroke).toHaveClass('progress p-50') - - const groupList = screen.getAllByTestId('group-summary') - expect(groupList).toHaveLength(2) -}) - -it('should render a summary of the remaining group(s)', () => { - const groupedTasks = [ - { - name: 'Work', - tasks: workTasks, - sections: DEFAULT_SECTIONS, - }, - { - name: 'Personal', - tasks: personalTasks, - sections: DEFAULT_SECTIONS, - }, - { - name: 'Misc', - tasks: miscTasks, - sections: DEFAULT_SECTIONS, - }, - { - name: 'Groceries', - tasks: [ - { - id: 'test-e-1', - description: 'Test #7', - createdAt: new Date(), - }, - ], - sections: DEFAULT_SECTIONS, - }, - ] - - render() - - const remainingGroups = screen.getByTestId('groups-remaining') - expect(remainingGroups).toHaveTextContent('And 1 other group') - expect(remainingGroups).toBeVisible() -}) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/NotePreview.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/NotePreview.tsx deleted file mode 100644 index 612f4fac1..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/NotePreview.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import { - getPercentage, - getTaskArrayFromGroupedTasks, - groupTasksByCompletedStatus, - truncateText, -} from '../../common/utils' -import { GroupModel, TaskModel } from './tasks-slice' - -const GROUPS_PREVIEW_LIMIT = 3 -const MAX_GROUP_DESCRIPTION_LENGTH = 30 - -const Title: React.FC = ({ children }) => { - return

{children}

-} - -type GroupSummaryProps = { - groups: GroupModel[] -} - -const GroupSummary: React.FC = ({ groups }) => { - const totalGroups = groups.length - const groupsToPreview = groups.slice(0, Math.min(totalGroups, GROUPS_PREVIEW_LIMIT)) - if (groupsToPreview.length === 0) { - return <> - } - - const remainingGroups = totalGroups - groupsToPreview.length - const groupNoun = remainingGroups > 1 ? 'groups' : 'group' - - return ( - <> -
- {groupsToPreview.map((group, index) => { - const totalTasks = group.tasks.length - const totalCompletedTasks = group.tasks.filter((task) => task.completed === true).length - - return ( -

- {truncateText(group.name, MAX_GROUP_DESCRIPTION_LENGTH)} - - {totalCompletedTasks}/{totalTasks} - -

- ) - })} -
- {remainingGroups > 0 && ( -

- And {remainingGroups} other {groupNoun} -

- )} - - ) -} - -type NotePreviewProps = { - groupedTasks: GroupModel[] -} - -const NotePreview: React.FC = ({ groupedTasks }) => { - const allTasks: TaskModel[] = getTaskArrayFromGroupedTasks(groupedTasks) - const { completedTasks } = groupTasksByCompletedStatus(allTasks) - const percentage = getPercentage(allTasks.length, completedTasks.length) - const roundedPercentage = Math.floor(percentage / 10) * 10 - - return ( - <> -
- - - - - - {completedTasks.length}/{allTasks.length} tasks completed - -
- - - ) -} - -export default NotePreview diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/RenameTaskGroups.test.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/RenameTaskGroups.test.tsx deleted file mode 100644 index 81d992623..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/RenameTaskGroups.test.tsx +++ /dev/null @@ -1,162 +0,0 @@ -import { fireEvent, screen } from '@testing-library/react' -import { RootState } from '../../app/store' -import { testRender } from '../../testUtils' - -import RenameTaskGroups from './RenameTaskGroups' -import { tasksGroupRenamed } from './tasks-slice' - -const handleClose = jest.fn() - -it('renders the alert dialog with an input box', () => { - const defaultGroup = 'Test' - const defaultState: Partial = { - tasks: { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: defaultGroup, - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - }, - } - - testRender(, {}, defaultState) - - const alertDialog = screen.getByTestId('rename-task-group-dialog') - expect(alertDialog).toBeInTheDocument() - expect(alertDialog).toHaveTextContent(`Renaming group '${defaultGroup}':`) - - const inputBox = screen.getByTestId('new-group-name-input') - expect(inputBox).toBeInTheDocument() - expect(inputBox).toHaveTextContent('') -}) - -it('should dispatch the action to merge groups', () => { - const defaultGroup = 'Test' - const defaultState: Partial = { - tasks: { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: defaultGroup, - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - { - name: 'Testing', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - ], - }, - } - - const { mockStore } = testRender( - , - {}, - defaultState, - ) - - const newGroupName = 'My new group name' - - const inputBox = screen.getByTestId('new-group-name-input') as HTMLInputElement - - fireEvent.change(inputBox, { target: { value: newGroupName } }) - - expect(inputBox.value).toBe(newGroupName) - - const buttons = screen.queryAllByRole('button') - expect(buttons).toHaveLength(2) - - const cancelButton = buttons[0] - expect(cancelButton).toHaveTextContent('Cancel') - - const mergeButton = buttons[1] - expect(mergeButton).toHaveTextContent('Rename') - - fireEvent.click(mergeButton) - - const dispatchedActions = mockStore.getActions() - expect(dispatchedActions).toHaveLength(1) - expect(dispatchedActions[0]).toMatchObject(tasksGroupRenamed({ groupName: defaultGroup, newName: newGroupName })) - expect(handleClose).toHaveBeenCalledTimes(1) -}) - -it('should dispatch the action to merge groups on Enter press', () => { - const defaultGroup = 'Test' - const defaultState: Partial = { - tasks: { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: defaultGroup, - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - { - name: 'Testing', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - ], - }, - } - - const { mockStore } = testRender( - , - {}, - defaultState, - ) - - const newGroupName = 'My new group name' - - const inputBox = screen.getByTestId('new-group-name-input') as HTMLInputElement - - fireEvent.change(inputBox, { target: { value: newGroupName } }) - fireEvent.keyPress(inputBox, { - key: 'Enter', - code: 'Enter', - charCode: 13, - target: { value: newGroupName }, - }) - - const dispatchedActions = mockStore.getActions() - expect(dispatchedActions).toHaveLength(1) - expect(dispatchedActions[0]).toMatchObject(tasksGroupRenamed({ groupName: defaultGroup, newName: newGroupName })) - expect(handleClose).toHaveBeenCalledTimes(1) -}) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/RenameTaskGroups.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/RenameTaskGroups.tsx deleted file mode 100644 index 4e03d529e..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/RenameTaskGroups.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import '@reach/dialog/styles.css' - -import { AlertDialog, AlertDialogDescription, AlertDialogLabel } from '@reach/alert-dialog' -import React, { KeyboardEvent, useRef, useState } from 'react' - -import { useAppDispatch } from '../../app/hooks' -import { TextInput } from '../../common/components' -import { tasksGroupRenamed } from './tasks-slice' - -type RenameTaskGroupsProps = { - groupName: string - handleClose: () => void -} - -const RenameTaskGroups: React.FC = ({ groupName, handleClose }) => { - const cancelRef = useRef(null) - - const dispatch = useAppDispatch() - - const [renameTo, setRenameTo] = useState(groupName) - - function handleChange(event: React.ChangeEvent) { - const newName = event.target.value - setRenameTo(newName) - } - - function handleKeyPress(event: KeyboardEvent) { - if (event.key === 'Enter') { - const rawString = (event.target as HTMLInputElement).value - rawString.length > 0 && handleRenameGroup() - } - } - - function handleRenameGroup() { - dispatch(tasksGroupRenamed({ groupName, newName: renameTo })) - handleClose() - } - - return ( - -
-
-
-
-
- - Renaming group '{groupName}': - - - - - - -
- - -
-
-
-
-
-
-
- ) -} - -export default RenameTaskGroups diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroup.test.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroup.test.tsx deleted file mode 100644 index 802362f3f..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroup.test.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import { fireEvent, screen } from '@testing-library/react' - -import { RootState } from '../../app/store' -import { testRender } from '../../testUtils' -import TaskGroup from './TaskGroup' -import { DEFAULT_SECTIONS } from './tasks-slice' - -const defaultGroup = { - name: 'default group', - tasks: [ - { - id: 'test-1', - description: 'Testing', - completed: false, - createdAt: new Date(), - }, - { - id: 'test-2', - description: 'Testing', - completed: false, - createdAt: new Date(), - }, - ], - sections: DEFAULT_SECTIONS, -} - -it('renders the group name', () => { - testRender() - - expect(screen.getByText(defaultGroup.name)).toBeVisible() -}) - -it('renders the number of completed tasks and total tasks', () => { - testRender() - - const completedTasks = defaultGroup.tasks.filter((task) => task.completed).length - const totalTasks = defaultGroup.tasks.length - - expect(screen.getByTestId('task-group-stats')).toHaveTextContent(`${completedTasks}/${totalTasks}`) -}) - -it('renders the circular progress bar', () => { - testRender() - - expect(screen.getByTestId('circular-progress-bar')).toBeInTheDocument() -}) - -it('does not render a thematic break element', () => { - testRender() - - expect(screen.queryByTestId('task-group-separator')).not.toBeInTheDocument() -}) - -it('renders the element that is used to create a new task', () => { - testRender() - - expect(screen.getByTestId('create-task-input')).toBeInTheDocument() -}) - -it('renders the element that is used to display the list of tasks', () => { - testRender() - - expect(screen.getByTestId('task-section-list')).toBeInTheDocument() -}) - -it('collapses the group', () => { - testRender() - - const createTask = screen.getByTestId('create-task-input') - const taskSectionList = screen.getByTestId('task-section-list') - - expect(createTask).toBeVisible() - expect(taskSectionList).toBeVisible() - - const collapseButton = screen.getByTestId('collapse-task-group') - fireEvent.click(collapseButton) - - expect(createTask).not.toBeVisible() - expect(taskSectionList).not.toBeVisible() -}) - -it('shows group options', () => { - testRender() - - expect(screen.getByTestId('task-group-options')).toBeInTheDocument() -}) - -it('hides group options if can not edit', () => { - const defaultState: Partial = { - settings: { - canEdit: false, - isRunningOnMobile: false, - spellCheckerEnabled: true, - }, - } - - testRender(, {}, defaultState) - - expect(screen.queryByTestId('task-group-options')).not.toBeInTheDocument() -}) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroup.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroup.tsx deleted file mode 100644 index 2d89b46c4..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroup.tsx +++ /dev/null @@ -1,122 +0,0 @@ -import styled from 'styled-components' - -import { useAppDispatch, useAppSelector } from '../../app/hooks' -import { getPercentage } from '../../common/utils' -import { GroupModel, tasksGroupCollapsed } from './tasks-slice' - -import CreateTask from './CreateTask' -import TaskSectionList from './TaskSectionList' - -import TaskGroupOptions from './TaskGroupOptions' - -import { useEffect, useState } from 'react' -import { CircularProgressBar, GenericInlineText, MainTitle, RoundButton } from '../../common/components' -import { ChevronDownIcon, ChevronUpIcon } from '../../common/components/icons' - -const TaskGroupContainer = styled.div<{ isLast?: boolean }>` - background-color: var(--sn-stylekit-background-color); - border: 1px solid var(--sn-stylekit-border-color); - border-radius: 4px; - box-sizing: border-box; - padding: 16px 18px; - margin-bottom: ${({ isLast }) => (!isLast ? '9px' : '0px')}; - - @media only screen and (max-width: 600px) { - padding: 8px 10px; - } -` - -type TaskGroupProps = { - group: GroupModel - isDragging: boolean - isLast?: boolean - style?: React.CSSProperties - innerRef?: (element?: HTMLElement | null | undefined) => any - onDragStart?: React.DragEventHandler - onTransitionEnd?: React.TransitionEventHandler -} - -const TaskGroup: React.FC = ({ - group, - isDragging, - isLast, - style, - innerRef, - onDragStart, - onTransitionEnd, - ...props -}) => { - const dispatch = useAppDispatch() - - const groupName = group.name - - const completedTasks = group.tasks.filter((task) => task.completed).length - const totalTasks = group.tasks.length - const percentageCompleted = getPercentage(completedTasks, totalTasks) - - const [collapsed, setCollapsed] = useState(!!group.collapsed) - - const canEdit = useAppSelector((state) => state.settings.canEdit) - - const allTasksCompleted = totalTasks > 0 && totalTasks === completedTasks - - function handleCollapse() { - setCollapsed(!collapsed) - } - - function handleClick() { - if (!collapsed) { - return - } - setCollapsed(false) - } - - useEffect(() => { - dispatch(tasksGroupCollapsed({ groupName, type: 'group', collapsed })) - }, [collapsed, dispatch, groupName]) - - return ( - -
-
- - {groupName} - - - - {completedTasks}/{totalTasks} - -
- {!isDragging && ( -
- {canEdit && ( -
- -
- )} -
- - {!collapsed ? : } - -
-
- )} -
- - {!collapsed && ( - <> - - - - )} -
- ) -} - -export default TaskGroup diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroupList.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroupList.tsx deleted file mode 100644 index 67d1ebb45..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroupList.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import React from 'react' -import { DragDropContext, Draggable, Droppable, DropResult } from 'react-beautiful-dnd' - -import { useAppDispatch, useAppSelector } from '../../app/hooks' -import { tasksGroupReordered } from './tasks-slice' - -import TaskGroup from './TaskGroup' - -const TaskGroupList: React.FC = () => { - const dispatch = useAppDispatch() - - const canEdit = useAppSelector((state) => state.settings.canEdit) - const groupedTasks = useAppSelector((state) => state.tasks.groups) - - function onDragEnd(result: DropResult) { - const droppedOutsideList = !result.destination - if (droppedOutsideList) { - return - } - - const { source, destination } = result - if (!destination) { - return - } - - dispatch( - tasksGroupReordered({ - swapGroupIndex: source.index, - withGroupIndex: destination.index, - }), - ) - } - - return ( - - - {(provided) => ( -
- {groupedTasks.map((group, index) => { - return ( - - {({ innerRef, draggableProps, dragHandleProps }, { isDragging }) => { - const { onTransitionEnd, ...restDraggableProps } = draggableProps - return ( - - ) - }} - - ) - })} - {provided.placeholder} -
- )} -
-
- ) -} - -export default TaskGroupList diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroupOptions.test.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroupOptions.test.tsx deleted file mode 100644 index c546a21fc..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroupOptions.test.tsx +++ /dev/null @@ -1,135 +0,0 @@ -import { fireEvent, screen } from '@testing-library/react' -import { testRender } from '../../testUtils' - -import TaskGroupOptions from './TaskGroupOptions' -import { tasksGroupDeleted } from './tasks-slice' - -function clickButton(element: HTMLElement) { - fireEvent.mouseDown(element) - fireEvent.mouseUp(element) - fireEvent.click(element) - fireEvent.mouseMove(element) - fireEvent.mouseUp(element) -} - -const groupName = 'default group' - -it('renders an options menu', () => { - testRender() - - const optionsButton = screen.getByTestId('task-group-options') - expect(optionsButton).toBeInTheDocument() - - const deleteTaskGroup = screen.getByTestId('delete-task-group') - const mergeTaskGroup = screen.getByTestId('merge-task-group') - - expect(deleteTaskGroup).not.toBeVisible() - expect(mergeTaskGroup).not.toBeVisible() - - clickButton(optionsButton) - - expect(deleteTaskGroup).toBeVisible() - expect(mergeTaskGroup).toBeVisible() -}) - -it('should dispatch tasksGroupDeleted action', () => { - const { mockStore } = testRender() - - const optionsButton = screen.getByTestId('task-group-options') - fireEvent.click(optionsButton) - - const deleteTaskGroup = screen.getByTestId('delete-task-group') - clickButton(deleteTaskGroup) - - const confirmDialog = screen.getByTestId('delete-task-group-dialog') - expect(confirmDialog).toBeInTheDocument() - expect(confirmDialog).toHaveTextContent(`Are you sure you want to delete the group '${groupName}'?`) - - const confirmButton = screen.getByTestId('confirm-dialog-button') - fireEvent.click(confirmButton) - - const dispatchedActions = mockStore.getActions() - expect(dispatchedActions).toHaveLength(1) - expect(dispatchedActions[0]).toMatchObject(tasksGroupDeleted({ groupName })) -}) - -it('should open the merge task group dialog', () => { - testRender() - - const optionsButton = screen.getByTestId('task-group-options') - fireEvent.click(optionsButton) - - const mergeTaskGroup = screen.getByTestId('merge-task-group') - clickButton(mergeTaskGroup) - - expect(screen.getByTestId('merge-task-group-dialog')).toBeInTheDocument() -}) - -it('should open the delete task group dialog', () => { - testRender() - - const optionsButton = screen.getByTestId('task-group-options') - fireEvent.click(optionsButton) - - const deleteTaskGroup = screen.getByTestId('delete-task-group') - clickButton(deleteTaskGroup) - - expect(screen.getByTestId('delete-task-group-dialog')).toBeInTheDocument() -}) - -it('should open the rename task group dialog', () => { - testRender() - - const optionsButton = screen.getByTestId('task-group-options') - fireEvent.click(optionsButton) - - const renameTaskGroup = screen.getByTestId('rename-task-group') - clickButton(renameTaskGroup) - - expect(screen.getByTestId('rename-task-group-dialog')).toBeInTheDocument() -}) - -it('should close the delete task group dialog', () => { - testRender() - - const optionsButton = screen.getByTestId('task-group-options') - fireEvent.click(optionsButton) - - const deleteTaskGroup = screen.getByTestId('delete-task-group') - clickButton(deleteTaskGroup) - - const cancelButton = screen.getByTestId('cancel-dialog-button') - clickButton(cancelButton) - - expect(screen.queryByTestId('trash-task-group-dialog')).not.toBeInTheDocument() -}) - -it('should close the merge task group dialog', () => { - testRender() - - const optionsButton = screen.getByTestId('task-group-options') - fireEvent.click(optionsButton) - - const mergeTaskGroup = screen.getByTestId('merge-task-group') - clickButton(mergeTaskGroup) - - const cancelButton = screen.queryAllByRole('button')[0] - clickButton(cancelButton) - - expect(screen.queryByTestId('merge-task-group-dialog')).not.toBeInTheDocument() -}) - -it('should close the rename task group dialog', () => { - testRender() - - const optionsButton = screen.getByTestId('task-group-options') - fireEvent.click(optionsButton) - - const renameTaskGroup = screen.getByTestId('rename-task-group') - clickButton(renameTaskGroup) - - const cancelButton = screen.queryAllByRole('button')[0] - clickButton(cancelButton) - - expect(screen.queryByTestId('rename-task-group-dialog')).not.toBeInTheDocument() -}) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroupOptions.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroupOptions.tsx deleted file mode 100644 index d52c66119..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskGroupOptions.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import { Menu, MenuButton, MenuItem, MenuList } from '@reach/menu-button' -import VisuallyHidden from '@reach/visually-hidden' -import { useState } from 'react' - -import { useAppDispatch } from '../../app/hooks' -import { tasksGroupDeleted } from './tasks-slice' - -import { MergeIcon, MoreIcon, RenameIcon, TrashIcon } from '../../common/components/icons' - -import { ConfirmDialog } from '../../common/components' - -import MergeTaskGroups from './MergeTaskGroups' -import RenameTaskGroups from './RenameTaskGroups' - -type TaskGroupOptionsProps = { - groupName: string -} - -const TaskGroupOptions: React.FC = ({ groupName }) => { - const dispatch = useAppDispatch() - - const [showMergeDialog, setShowMergeDialog] = useState(false) - const [showDeleteDialog, setShowDeleteDialog] = useState(false) - const [showRenameDialog, setShowRenameDialog] = useState(false) - - return ( - <> - - - Options for '{groupName}' group - - - - setShowDeleteDialog(true)}> - - Delete group - - setShowMergeDialog(true)}> - - Merge into another group - - setShowRenameDialog(true)}> - - Rename - - - - {showDeleteDialog && ( - dispatch(tasksGroupDeleted({ groupName }))} - cancelButtonCb={() => setShowDeleteDialog(false)} - > - Are you sure you want to delete the group '{groupName}'? - - )} - {showMergeDialog && setShowMergeDialog(false)} />} - {showRenameDialog && setShowRenameDialog(false)} />} - - ) -} - -export default TaskGroupOptions diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskItem.scss b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskItem.scss deleted file mode 100644 index f409b94bb..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskItem.scss +++ /dev/null @@ -1,47 +0,0 @@ -$transition-duration: 750ms; - -@keyframes fadeOut { - 100% { - opacity: 0; - max-height: 0; - } - 0% { - opacity: 1; - max-height: 100px; - } -} - -@keyframes fadeIn { - 0% { - opacity: 0; - max-height: 0; - } - 100% { - opacity: 1; - max-height: 100px; - } -} - -.fade-out { - animation: fadeOut ease $transition-duration; - animation-delay: 0s; - animation-fill-mode: forwards; -} - -.fade-in { - animation: fadeIn ease $transition-duration; - animation-delay: 0s; - animation-fill-mode: forwards; -} - -.completed { - animation-delay: 1.8s; -} - -.opened { - animation-delay: 1.2s; -} - -.hide { - display: none; -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskItem.test.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskItem.test.tsx deleted file mode 100644 index f3008151d..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskItem.test.tsx +++ /dev/null @@ -1,131 +0,0 @@ -import { fireEvent, screen, waitFor } from '@testing-library/react' - -import { testRender } from '../../testUtils' -import TaskItem from './TaskItem' -import { taskDeleted, TaskModel, taskModified, taskToggled } from './tasks-slice' - -const groupName = 'default group' -const task: TaskModel = { - id: 'test-1', - description: 'Testing #1', - completed: false, - createdAt: new Date(), -} - -it('renders a check box and textarea input', async () => { - testRender() - - expect(screen.getByTestId('check-box-input')).toBeInTheDocument() - expect(screen.getByTestId('text-area-input')).toBeInTheDocument() -}) - -test('clicking the check box should toggle the task as open/completed', () => { - jest.useFakeTimers() - - const { mockStore } = testRender() - - const checkBox = screen.getByTestId('check-box-input') - fireEvent.click(checkBox) - - jest.runAllTimers() - - let dispatchedActions = mockStore.getActions() - - expect(dispatchedActions).toHaveLength(1) - expect(dispatchedActions[0]).toMatchObject( - taskToggled({ - id: task.id, - groupName, - }), - ) - - fireEvent.click(checkBox) - - dispatchedActions = mockStore.getActions() - - jest.runAllTimers() - - expect(dispatchedActions).toHaveLength(2) - expect(dispatchedActions[1]).toMatchObject( - taskToggled({ - id: task.id, - groupName, - }), - ) -}) - -test('changing the textarea input text should update the task description', async () => { - jest.useFakeTimers() - - const newTaskDescription = 'My new task' - - const { mockStore } = testRender() - - const textAreaInput = screen.getByTestId('text-area-input') as HTMLTextAreaElement - fireEvent.change(textAreaInput, { - target: { value: newTaskDescription }, - }) - fireEvent.keyUp(textAreaInput, { - target: { value: newTaskDescription }, - }) - - await waitFor(() => { - expect(textAreaInput.value).toBe(newTaskDescription) - }) - - jest.runAllTimers() - - const dispatchedActions = mockStore.getActions() - - expect(dispatchedActions).toHaveLength(1) - expect(dispatchedActions[0]).toMatchObject( - taskModified({ - task: { - id: task.id, - description: newTaskDescription, - }, - groupName, - }), - ) -}) - -test('clearing the textarea input text should delete the task', () => { - const { mockStore } = testRender() - - const textAreaInput = screen.getByTestId('text-area-input') - fireEvent.change(textAreaInput, { - target: { value: '' }, - }) - fireEvent.keyUp(textAreaInput, { - key: 'Enter', - code: 'Enter', - charCode: 13, - target: { value: '' }, - }) - - const dispatchedActions = mockStore.getActions() - - expect(dispatchedActions).toHaveLength(1) - expect(dispatchedActions[0]).toMatchObject( - taskDeleted({ - id: task.id, - groupName, - }), - ) -}) - -test('pressing enter should not update the task description', () => { - const { mockStore } = testRender() - - const textAreaInput = screen.getByTestId('text-area-input') - fireEvent.keyPress(textAreaInput, { - key: 'Enter', - code: 'Enter', - charCode: 13, - target: { value: 'This is a test' }, - }) - - const dispatchedActions = mockStore.getActions() - - expect(dispatchedActions).toHaveLength(0) -}) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskItem.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskItem.tsx deleted file mode 100644 index a1782c709..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskItem.tsx +++ /dev/null @@ -1,146 +0,0 @@ -import './TaskItem.scss' - -import { ChangeEvent, KeyboardEvent, MouseEvent, useRef, useState } from 'react' -import styled from 'styled-components' - -import { useAppDispatch, useAppSelector, useDebouncedCallback, useResize } from '../../app/hooks' -import { taskDeleted, TaskModel, taskModified, taskToggled } from './tasks-slice' - -import { CheckBoxInput, TextAreaInput } from '../../common/components' - -const Container = styled.div` - align-content: center; - align-items: center; - display: flex; - flex-direction: row; - min-width: 10%; - max-width: 90%; -` - -export type TaskItemProps = { - task: TaskModel - groupName: string -} - -const TaskItem: React.FC = ({ task, groupName }) => { - const containerRef = useRef(null) - const textAreaRef = useRef(null) - - const dispatch = useAppDispatch() - - const canEdit = useAppSelector((state) => state.settings.canEdit) - const spellCheckEnabled = useAppSelector((state) => state.settings.spellCheckerEnabled) - - const [completed, setCompleted] = useState(!!task.completed) - const [description, setDescription] = useState(task.description) - - function resizeTextArea(textarea: HTMLElement): void { - if (!textarea) { - return - } - - const heightOffset = 4 - /** - * Set to 1px first to reset scroll height in case it shrunk. - */ - textarea.style.height = '1px' - textarea.style.height = textarea.scrollHeight - heightOffset + 'px' - - const singleLineHeight = 20 - const currentHeight = parseFloat(textarea.style.height) - - const containerElement = containerRef.current - - if (currentHeight > singleLineHeight) { - containerElement?.classList.add('align-baseline') - containerElement?.classList.remove('align-center') - } else { - containerElement?.classList.add('align-center') - containerElement?.classList.remove('align-baseline') - } - } - - function onCheckBoxToggle() { - const newCompletedState = !completed - setCompleted(newCompletedState) - - const textarea = textAreaRef.current - - if (newCompletedState) { - textarea?.classList.add(...['cross-out', 'info-color']) - } else { - textarea?.classList.add('no-text-decoration') - } - - dispatch(taskToggled({ id: task.id, groupName })) - } - - function onCheckBoxClick({ currentTarget }: MouseEvent) { - const parentElement = containerRef.current?.parentElement - - if (task.completed) { - currentTarget.classList.remove('explode') - parentElement?.classList.add('completed') - } else { - currentTarget.classList.add('explode') - parentElement?.classList.add('opened') - } - } - - function onTextChange(event: ChangeEvent) { - setDescription(event.target.value) - } - - function onKeyUp(event: KeyboardEvent) { - // Delete task if empty and enter pressed - if (event.key === 'Enter') { - if (description.length === 0) { - dispatch(taskDeleted({ id: task.id, groupName })) - event.preventDefault() - } - } - - const element = event.target as HTMLTextAreaElement - resizeTextArea(element) - } - - function onKeyPress(event: KeyboardEvent) { - if (event.key === 'Enter') { - // We want to disable any action on enter. - event.preventDefault() - } - } - - useDebouncedCallback(() => { - if (description !== task.description) { - dispatch(taskModified({ task: { id: task.id, description }, groupName })) - } - }) - - useResize(textAreaRef, resizeTextArea) - - return ( - - - - - ) -} - -export default TaskItem diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskSectionList.test.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskSectionList.test.tsx deleted file mode 100644 index c6ba65067..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskSectionList.test.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import { screen, within } from '@testing-library/react' -import { RootState } from '../../app/store' - -import { testRender } from '../../testUtils' -import { DEFAULT_SECTIONS, GroupModel } from './tasks-slice' -import TaskSectionList from './TaskSectionList' - -const defaultGroup: GroupModel = { - name: 'default group', - tasks: [ - { - id: 'test-1', - description: 'Testing #1', - completed: false, - createdAt: new Date(), - }, - { - id: 'test-2', - description: 'Testing #2', - completed: false, - createdAt: new Date(), - }, - ], - sections: [ - { - id: 'open-tasks', - name: 'Open tasks', - }, - { - id: 'completed-tasks', - name: 'Completed tasks', - }, - ], -} - -it('renders the open tasks container', async () => { - testRender() - - const openTasksContainer = screen.getByTestId('open-tasks-section') - expect(openTasksContainer).toBeInTheDocument() - expect(openTasksContainer).toHaveTextContent('Open tasks') - - const taskItems = within(openTasksContainer).getAllByTestId('task-item') - expect(taskItems).toHaveLength(2) - - const completedTasksActions = screen.queryByTestId('completed-tasks-actions') - expect(completedTasksActions).not.toBeInTheDocument() -}) - -it('renders the completed tasks section', () => { - const groupWithCompletedTask = defaultGroup - groupWithCompletedTask.tasks.push({ - id: 'test-3', - description: 'Testing #3', - completed: true, - createdAt: new Date(), - }) - - testRender() - - const completedTasksSection = screen.getByTestId('completed-tasks-section') - expect(completedTasksSection).toBeInTheDocument() - expect(completedTasksSection).toHaveTextContent('Completed') - - const taskItems = within(completedTasksSection).getAllByTestId('task-item') - expect(taskItems).toHaveLength(1) - - const completedTasksActions = screen.getByTestId('completed-tasks-actions') - expect(completedTasksActions).toBeInTheDocument() -}) - -it('renders default sections', () => { - const defaultState: Partial = { - settings: { - canEdit: true, - isRunningOnMobile: false, - spellCheckerEnabled: true, - }, - tasks: { - schemaVersion: '1.0.0', - defaultSections: DEFAULT_SECTIONS, - groups: [], - }, - } - - const group: GroupModel = { - name: 'Test group', - tasks: [ - ...defaultGroup.tasks, - { - id: 'test-3', - description: 'Testing #3', - completed: true, - createdAt: new Date(), - }, - ], - } - - testRender(, {}, defaultState) - - const completedTasksSection = screen.getByTestId('completed-tasks-section') - expect(completedTasksSection).toBeInTheDocument() - expect(completedTasksSection).toHaveTextContent('Completed') - - const taskItems = within(completedTasksSection).getAllByTestId('task-item') - expect(taskItems).toHaveLength(1) - - const completedTasksActions = screen.getByTestId('completed-tasks-actions') - expect(completedTasksActions).toBeInTheDocument() -}) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskSectionList.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskSectionList.tsx deleted file mode 100644 index 05e148001..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TaskSectionList.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import React from 'react' -import { DragDropContext, DropResult } from 'react-beautiful-dnd' -import styled from 'styled-components' - -import { useAppDispatch, useAppSelector } from '../../app/hooks' -import { GroupModel, tasksReordered } from './tasks-slice' - -import CompletedTasksActions from './CompletedTasksActions' -import TasksSection from './TasksSection' - -const Container = styled.div` - position: relative; -` - -type TaskSectionListProps = { - group: GroupModel -} - -const TaskSectionList: React.FC = ({ group }) => { - const dispatch = useAppDispatch() - const defaultSections = useAppSelector((state) => state.tasks.defaultSections) - - function onDragEnd(result: DropResult) { - const droppedOutsideList = !result.destination - if (droppedOutsideList) { - return - } - - const { source, destination } = result - if (!destination) { - return - } - - dispatch( - tasksReordered({ - groupName: group.name, - swapTaskIndex: source.index, - withTaskIndex: destination.index, - isSameSection: source.droppableId === destination.droppableId, - }), - ) - } - - const sections = group.sections ?? defaultSections - - return ( - - {sections.map((section) => { - const tasks = group.tasks.filter((task) => - section.id === 'completed-tasks' ? task.completed === true : !task.completed, - ) - return ( - - - {section.id === 'completed-tasks' && tasks.length > 0 && } - - - ) - })} - - ) -} - -export default TaskSectionList diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TasksSection.scss b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TasksSection.scss deleted file mode 100644 index 5166f97aa..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TasksSection.scss +++ /dev/null @@ -1,10 +0,0 @@ -.completed-tasks-container { - .task-item .checkbox-button * { - stroke: var(--sn-stylekit-neutral-color) !important; - } - - .task-item .text-area-input { - color: var(--sn-stylekit-neutral-color) !important; - text-decoration: line-through 1px solid var(--sn-stylekit-neutral-color); - } -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TasksSection.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TasksSection.tsx deleted file mode 100644 index 11fb37ebf..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/TasksSection.tsx +++ /dev/null @@ -1,177 +0,0 @@ -import './TasksSection.scss' - -import React, { useEffect, useState } from 'react' -import { Draggable, DraggingStyle, Droppable, NotDraggingStyle } from 'react-beautiful-dnd' -import { CSSTransition, TransitionGroup } from 'react-transition-group' -import styled from 'styled-components' - -import { useAppDispatch, useAppSelector, usePrevious } from '../../app/hooks' -import { SubTitle } from '../../common/components' -import { SectionModel, TaskModel, tasksGroupCollapsed } from './tasks-slice' - -import TaskItem from './TaskItem' - -const SectionHeader = styled.div` - align-items: center; - display: flex; - - & > *:first-child { - margin-right: 14px; - } -` - -const InnerTasksContainer = styled.div` - display: flex; - flex-direction: column; - - & > *:not(:last-child) { - margin-bottom: 9px; - } -` - -const OuterContainer = styled.div<{ addMargin: boolean; items: number; collapsed: boolean }>` - margin-bottom: ${({ addMargin, items, collapsed }) => (addMargin && items > 0 && !collapsed ? '10px' : '0')}; -` - -const ChildrenContainer = styled.div<{ addMargin: boolean; items: number }>` - margin-top: ${({ addMargin, items }) => (addMargin && items > 0 ? '15px' : '0')}; -` - -const Wrapper = styled.div` - color: var(--sn-stylekit-foreground-color); -` - -const COMPLETED_TASK_TIMEOUT_MS = 1_800 -const OPEN_TASK_TIMEOUT_MS = 1_200 - -type TransitionTimeout = { - enter: number - exit: number -} - -function getTimeout(completed?: boolean): TransitionTimeout { - return { - enter: completed ? COMPLETED_TASK_TIMEOUT_MS : OPEN_TASK_TIMEOUT_MS, - exit: !completed ? COMPLETED_TASK_TIMEOUT_MS : OPEN_TASK_TIMEOUT_MS, - } -} - -const getItemStyle = (isDragging: boolean, draggableStyle?: DraggingStyle | NotDraggingStyle) => ({ - ...draggableStyle, - ...(isDragging && { - color: 'var(--sn-stylekit-info-color)', - fontWeight: 500, - }), -}) - -type TasksSectionProps = { - groupName: string - tasks: TaskModel[] - section: SectionModel - allTasks?: TaskModel[] - testId?: string -} - -const TasksSection: React.FC = ({ groupName, tasks, section, allTasks, testId, children }) => { - const dispatch = useAppDispatch() - const canEdit = useAppSelector((state) => state.settings.canEdit) - const droppableId = `${section.id}-droppable` - - const [collapsed, setCollapsed] = useState(!!section.collapsed) - - function handleCollapse() { - setCollapsed(!collapsed) - } - - const prevTasks: TaskModel[] = usePrevious(allTasks) - - useEffect(() => { - dispatch(tasksGroupCollapsed({ groupName, type: section.id, collapsed })) - }, [collapsed, dispatch, groupName, section.id]) - - return ( - - - {(provided) => ( - - - {section.name} - - {!collapsed && ( - - - {tasks.map((task, index) => { - const timeout = getTimeout(task.completed) - return ( - { - const exists = prevTasks.find((t) => t.id === task.id) - exists && node.classList.add('hide') - - const completed = !!task.completed - completed && node.classList.add('explode') - !completed && node.classList.remove('explode') - }} - onEntered={(node: HTMLElement) => { - node.classList.remove('hide') - setTimeout(() => node.classList.remove(...['fade-in', 'explode']), timeout.enter) - }} - > - - {({ innerRef, draggableProps, dragHandleProps }, { isDragging }) => { - const { style, ...restDraggableProps } = draggableProps - return ( -
- -
- ) - }} -
-
- ) - })} -
- - {provided.placeholder} -
- )} - - {children} - -
- )} -
-
- ) -} - -export default TasksSection diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/migrations/BaseMigration.spec.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/migrations/BaseMigration.spec.ts deleted file mode 100644 index 4816d9ca9..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/migrations/BaseMigration.spec.ts +++ /dev/null @@ -1,37 +0,0 @@ -import BaseMigration, { PartialData } from './BaseMigration' - -class MockMigration extends BaseMigration { - override get version() { - return '0.0.0' - } - - override upgrade(data: PartialData) { - return data - } - - override downgrade(data: PartialData) { - return data - } -} - -describe('BaseMigration', () => { - const mockMigration = new MockMigration() - - it('should throw error if version is not in the semantic version scheme', () => { - expect(() => { - mockMigration.run({ schemaVersion: '0.0.0.0', groups: [], defaultSections: [] }) - }).toThrowError("'0.0.0.0' is not in the semantic version scheme: MAJOR.MINOR.PATCH") - }) - - it('should throw error if version is not a number', () => { - expect(() => { - mockMigration.run({ schemaVersion: 'a.0.0', groups: [], defaultSections: [] }) - }).toThrowError('MAJOR version should be a number') - expect(() => { - mockMigration.run({ schemaVersion: '0.a.0', groups: [], defaultSections: [] }) - }).toThrowError('MINOR version should be a number') - expect(() => { - mockMigration.run({ schemaVersion: '0.0.a', groups: [], defaultSections: [] }) - }).toThrowError('PATCH version should be a number') - }) -}) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/migrations/BaseMigration.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/migrations/BaseMigration.ts deleted file mode 100644 index 481d57d1c..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/migrations/BaseMigration.ts +++ /dev/null @@ -1,63 +0,0 @@ -const SemanticVersionParts = ['MAJOR', 'MINOR', 'PATCH'] - -enum MigrationAction { - Upgrade = 'up', - Downgrade = 'down', - Nothing = 'nothing', -} - -export type PartialData = { - schemaVersion: string - defaultSections?: any[] - groups: any[] -} - -abstract class BaseMigration { - protected abstract get version(): string - protected abstract upgrade(data: PartialData): PartialData - protected abstract downgrade(data: PartialData): PartialData - - private parseVersion(version: string): number[] { - const versionScheme = version.split('.') - if (versionScheme.length !== SemanticVersionParts.length) { - throw Error(`'${version}' is not in the semantic version scheme: ${SemanticVersionParts.join('.')}`) - } - return versionScheme.map((value, index) => { - const number = Number(value) - if (isNaN(number)) { - throw Error(`${SemanticVersionParts[index]} version should be a number`) - } - return number - }) - } - - protected getAction(schemaVersion: string): MigrationAction { - const fromVersion = this.parseVersion(schemaVersion) - const toVersion = this.parseVersion(this.version) - - for (let index = 0; index < fromVersion.length; index++) { - if (fromVersion[index] < toVersion[index]) { - return MigrationAction.Upgrade - } - if (fromVersion[index] > toVersion[index]) { - return MigrationAction.Downgrade - } - } - return MigrationAction.Nothing - } - - public run(data: PartialData): PartialData { - const { schemaVersion } = data - const migrationAction = this.getAction(schemaVersion) - switch (migrationAction) { - case MigrationAction.Upgrade: - return this.upgrade(data) - case MigrationAction.Downgrade: - return this.downgrade(data) - default: - return data - } - } -} - -export default BaseMigration diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/migrations/MigrationService.spec.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/migrations/MigrationService.spec.ts deleted file mode 100644 index 85070d50c..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/migrations/MigrationService.spec.ts +++ /dev/null @@ -1,150 +0,0 @@ -import { TasksState } from '../tasks-slice' -import BaseMigration, { PartialData } from './BaseMigration' -import MigrationService from './MigrationService' - -class MockMigration extends BaseMigration { - override get version() { - return '1.0.123' - } - - override upgrade(data: PartialData) { - return { - ...data, - schemaVersion: this.version, - } - } - - override downgrade(data: PartialData) { - return { - ...data, - schemaVersion: this.version, - } - } -} - -describe('MigrationService', () => { - it('should upgrade 1.0.0 to 1.0.123', () => { - const testData: Partial = { - schemaVersion: '1.0.0', - groups: [ - { - name: 'Test group #1', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: false, - createdAt: new Date(), - }, - { - id: 'another-id', - description: 'Another simple task', - completed: true, - createdAt: new Date(), - }, - ], - collapsed: true, - }, - { - name: 'Test group #2', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - } - - const migrationClasses = [MockMigration] - const migrationService = new MigrationService(migrationClasses) - const result = migrationService.performMigrations(testData as any) - - expect(result).toEqual>({ - ...testData, - schemaVersion: '1.0.123', - }) - }) - - it('should do nothing if latest version', () => { - const testData: Partial = { - schemaVersion: '1.0.123', - groups: [ - { - name: 'Test group #1', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: false, - createdAt: new Date(), - }, - ], - collapsed: true, - }, - { - name: 'Test group #2', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - } - - const migrationClasses = [MockMigration] - const migrationService = new MigrationService(migrationClasses) - const result = migrationService.performMigrations(testData as any) - - expect(result).toBe(testData) - }) - - it('should downgrade if version > 1.0.123', () => { - const testData: Partial = { - schemaVersion: '1.0.130', - groups: [ - { - name: 'Test group #1', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: false, - createdAt: new Date(), - }, - ], - collapsed: true, - }, - { - name: 'Test group #2', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - } - - const migrationClasses = [MockMigration] - const migrationService = new MigrationService(migrationClasses) - const result = migrationService.performMigrations(testData as any) - - expect(result).toMatchObject( - expect.objectContaining({ - schemaVersion: '1.0.123', - groups: testData.groups, - }), - ) - }) -}) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/migrations/MigrationService.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/migrations/MigrationService.ts deleted file mode 100644 index 7435bee20..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/migrations/MigrationService.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { PartialData } from './BaseMigration' -import { MigrationClasses } from './versions' - -class MigrationService { - private migrationClasses: any[] - - constructor(migrationClasses?: any[]) { - this.migrationClasses = migrationClasses ?? MigrationClasses - } - - private getMigrationInstances() { - return this.migrationClasses.map((migrationClass) => { - return new migrationClass() - }) - } - - public performMigrations(data: PartialData) { - this.getMigrationInstances().forEach((migration) => { - data = migration.run(data) - }) - return data - } -} - -export default MigrationService diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/migrations/versions/index.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/migrations/versions/index.ts deleted file mode 100644 index 78e2e4848..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/migrations/versions/index.ts +++ /dev/null @@ -1 +0,0 @@ -export const MigrationClasses: any[] = [] diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/tasks-slice.test.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/tasks-slice.test.ts deleted file mode 100644 index 35981e3e7..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/tasks-slice.test.ts +++ /dev/null @@ -1,1587 +0,0 @@ -import reducer, { - DEFAULT_SECTIONS, - deleteAllCompleted, - LATEST_SCHEMA_VERSION, - openAllCompleted, - taskAdded, - taskDeleted, - taskModified, - tasksGroupAdded, - tasksGroupCollapsed, - tasksGroupDeleted, - tasksGroupDraft, - tasksGroupLastActive, - tasksGroupMerged, - tasksGroupRenamed, - tasksGroupReordered, - tasksLoaded, - tasksReordered, - TasksState, - taskToggled, -} from './tasks-slice' - -it('should return the initial state', () => { - return expect( - reducer(undefined, { - type: undefined, - }), - ).toEqual({ schemaVersion: LATEST_SCHEMA_VERSION, groups: [], defaultSections: [] }) -}) - -it('should handle a task being added to a non-existing group', () => { - const previousState: TasksState = { schemaVersion: '1.0.0', groups: [], defaultSections: [] } - - expect( - reducer( - previousState, - taskAdded({ - task: { id: 'some-id', description: 'A simple task' }, - groupName: 'Test', - }), - ), - ).toEqual({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [], - }) -}) - -it('should handle a task being added to the existing tasks store', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: false, - createdAt: expect.any(Date), - }, - ], - }, - ], - } - - expect( - reducer( - previousState, - taskAdded({ - task: { id: 'another-id', description: 'Another simple task' }, - groupName: 'Test', - }), - ), - ).toEqual({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: expect.any(Date), - }, - { - id: 'some-id', - description: 'A simple task', - completed: false, - createdAt: expect.any(Date), - }, - ], - }, - ], - }) -}) - -it('should handle an existing task being modified', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: false, - createdAt: new Date(), - }, - ], - sections: DEFAULT_SECTIONS, - }, - ], - } - - expect( - reducer( - previousState, - taskModified({ - task: { id: 'some-id', description: 'Task description changed' }, - groupName: 'Test', - }), - ), - ).toEqual({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'Task description changed', - completed: false, - createdAt: expect.any(Date), - updatedAt: expect.any(Date), - }, - ], - sections: DEFAULT_SECTIONS, - }, - ], - }) -}) - -it('should not modify tasks if an invalid id is provided', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - ], - } - - expect( - reducer( - previousState, - taskModified({ - task: { id: 'some-invalid-id', description: 'New description' }, - groupName: 'Test', - }), - ), - ).toEqual({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: false, - createdAt: expect.any(Date), - }, - ], - }, - ], - }) -}) - -it('should keep completed field as-is, if task is modified', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - ], - } - - expect( - reducer( - previousState, - taskModified({ - task: { - id: 'some-id', - description: 'New description', - }, - groupName: 'Test', - }), - ), - ).toEqual({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'New description', - completed: false, - createdAt: expect.any(Date), - updatedAt: expect.any(Date), - }, - ], - }, - ], - }) -}) - -it('should handle an existing task being toggled', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - ], - } - - expect(reducer(previousState, taskToggled({ id: 'some-id', groupName: 'Test' }))).toEqual({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: expect.any(Date), - updatedAt: expect.any(Date), - completedAt: expect.any(Date), - }, - ], - }, - ], - }) -}) - -test('toggled tasks should be on top of the list', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: false, - createdAt: new Date(), - }, - { - id: 'another-id', - description: 'A simple task', - completed: false, - createdAt: new Date(), - }, - { - id: 'extra-id', - description: 'A simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - ], - } - - expect(reducer(previousState, taskToggled({ id: 'another-id', groupName: 'Test' }))).toEqual({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'another-id', - description: 'A simple task', - completed: true, - createdAt: expect.any(Date), - updatedAt: expect.any(Date), - completedAt: expect.any(Date), - }, - { - id: 'some-id', - description: 'A simple task', - completed: false, - createdAt: expect.any(Date), - }, - { - id: 'extra-id', - description: 'A simple task', - completed: false, - createdAt: expect.any(Date), - }, - ], - }, - ], - }) -}) - -it('should handle an existing completed task being toggled', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - } - - expect(reducer(previousState, taskToggled({ id: 'some-id', groupName: 'Test' }))).toEqual({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: false, - createdAt: expect.any(Date), - updatedAt: expect.any(Date), - }, - ], - }, - ], - }) -}) - -it('should handle an existing task being deleted', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: false, - createdAt: new Date(), - }, - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - ], - } - - expect(reducer(previousState, taskDeleted({ id: 'some-id', groupName: 'Test' }))).toEqual({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: expect.any(Date), - }, - ], - }, - ], - }) -}) - -it('should handle opening all tasks that are marked as completed', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: false, - createdAt: new Date(), - }, - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - } - - expect(reducer(previousState, openAllCompleted({ groupName: 'Test' }))).toEqual({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: false, - createdAt: expect.any(Date), - }, - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: expect.any(Date), - }, - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: false, - createdAt: expect.any(Date), - }, - ], - }, - ], - }) -}) - -it('should handle clear all completed tasks', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - } - - expect(reducer(previousState, deleteAllCompleted({ groupName: 'Test' }))).toEqual({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: expect.any(Date), - }, - ], - }, - ], - }) -}) - -it('should handle loading tasks into the tasks store, if an invalid payload is provided', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - ], - } - - expect(reducer(previousState, tasksLoaded('null'))).toEqual({ - schemaVersion: LATEST_SCHEMA_VERSION, - defaultSections: DEFAULT_SECTIONS, - groups: [], - initialized: true, - }) - expect(reducer(previousState, tasksLoaded('undefined'))).toMatchObject({ - ...previousState, - initialized: false, - lastError: expect.stringContaining("An error has occurred while parsing the note's content"), - }) -}) - -it('should initialize the storage with an empty object', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - ], - } - - expect(reducer(previousState, tasksLoaded(''))).toEqual({ - schemaVersion: LATEST_SCHEMA_VERSION, - defaultSections: DEFAULT_SECTIONS, - groups: [], - initialized: true, - }) -}) - -it('should handle loading tasks into the tasks store, with a valid payload', () => { - const previousState: TasksState = { - schemaVersion: LATEST_SCHEMA_VERSION, - defaultSections: DEFAULT_SECTIONS, - groups: [], - } - - const tasksPayload: Partial = { - schemaVersion: LATEST_SCHEMA_VERSION, - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - } - - const serializedPayload = JSON.stringify(tasksPayload) - expect(reducer(previousState, tasksLoaded(serializedPayload))).toEqual({ - schemaVersion: LATEST_SCHEMA_VERSION, - defaultSections: DEFAULT_SECTIONS, - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: expect.any(String), - }, - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: expect.any(String), - }, - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: expect.any(String), - }, - ], - }, - ], - initialized: true, - }) -}) - -it('should set defaultSections property if not provided', () => { - const previousState: TasksState = { - schemaVersion: LATEST_SCHEMA_VERSION, - defaultSections: [], - groups: [], - } - - const tasksPayload: Partial = { - schemaVersion: LATEST_SCHEMA_VERSION, - groups: [ - { - name: 'Test', - tasks: [], - }, - ], - } - - const serializedPayload = JSON.stringify(tasksPayload) - expect(reducer(previousState, tasksLoaded(serializedPayload))).toEqual({ - schemaVersion: LATEST_SCHEMA_VERSION, - defaultSections: DEFAULT_SECTIONS, - groups: [ - { - name: 'Test', - tasks: [], - }, - ], - initialized: true, - }) -}) - -it('should handle adding a new task group', () => { - const previousState: TasksState = { schemaVersion: '1.0.0', groups: [], defaultSections: [] } - - expect(reducer(previousState, tasksGroupAdded({ groupName: 'New group' }))).toEqual({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'New group', - tasks: [], - }, - ], - }) -}) - -it('should handle adding an existing task group', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Existing group', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - } - - expect(reducer(previousState, tasksGroupAdded({ groupName: 'Existing group' }))).toEqual(previousState) -}) - -it('should handle reordering tasks from the same section', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - } - - expect( - reducer( - previousState, - tasksReordered({ - groupName: 'Test', - swapTaskIndex: 0, - withTaskIndex: 1, - isSameSection: true, - }), - ), - ).toEqual({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: expect.any(Date), - }, - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: expect.any(Date), - }, - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: expect.any(Date), - }, - ], - }, - ], - }) -}) - -it('should handle reordering tasks from different sections', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - } - - expect( - reducer( - previousState, - tasksReordered({ - groupName: 'Test', - swapTaskIndex: 0, - withTaskIndex: 1, - isSameSection: false, - }), - ), - ).toEqual({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: expect.any(Date), - }, - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: expect.any(Date), - }, - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: expect.any(Date), - }, - ], - }, - ], - }) -}) - -it('should handle reordering task groups', () => { - const defaultCreatedAt = new Date() - - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: defaultCreatedAt, - }, - ], - }, - { - name: 'Testing', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: defaultCreatedAt, - }, - ], - }, - { - name: 'Tests', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: defaultCreatedAt, - }, - ], - }, - ], - } - - const currentState = reducer( - previousState, - tasksGroupReordered({ - swapGroupIndex: 0, - withGroupIndex: 1, - }), - ) - - const expectedState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Testing', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: defaultCreatedAt, - }, - ], - }, - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: defaultCreatedAt, - }, - ], - }, - { - name: 'Tests', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: defaultCreatedAt, - }, - ], - }, - ], - } - - expect(JSON.stringify(currentState)).toEqual(JSON.stringify(expectedState)) -}) - -it('should handle deleting groups', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - { - name: 'Testing', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - { - name: 'Tests', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - } - - const currentState = reducer(previousState, tasksGroupDeleted({ groupName: 'Testing' })) - - const expectedState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: expect.any(Date), - }, - ], - }, - { - name: 'Tests', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: expect.any(Date), - }, - ], - }, - ], - } - - expect(currentState).toEqual(expectedState) -}) - -it('should not merge the same group', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - { - name: 'Testing', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - { - name: 'Tests', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - } - - const currentState = reducer(previousState, tasksGroupMerged({ groupName: 'Testing', mergeWith: 'Testing' })) - - expect(currentState).toEqual(previousState) -}) - -it('should handle merging groups', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test group #1', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - { - name: 'Test group #2', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - { - name: 'Test group #3', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - } - - const currentState = reducer( - previousState, - tasksGroupMerged({ groupName: 'Test group #3', mergeWith: 'Test group #2' }), - ) - - expect(currentState).toMatchObject({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test group #1', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: expect.any(Date), - }, - ], - }, - { - name: 'Test group #2', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: expect.any(Date), - }, - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: expect.any(Date), - }, - ], - }, - ], - }) -}) - -it('should handle renaming a group', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - { - name: 'Testing', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - ], - } - - const currentState = reducer(previousState, tasksGroupRenamed({ groupName: 'Testing', newName: 'Tested' })) - - expect(currentState).toEqual({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: expect.any(Date), - }, - ], - }, - { - name: 'Tested', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: expect.any(Date), - }, - ], - }, - ], - }) -}) - -it("should rename a group and preserve it's current order", () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: '1st group', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - { - name: '2nd group', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - { - name: '3rd group', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - ], - } - - const currentState = reducer(previousState, tasksGroupRenamed({ groupName: '2nd group', newName: 'Middle group' })) - - expect(currentState).toMatchObject({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: '1st group', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: expect.any(Date), - }, - ], - }, - { - name: 'Middle group', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: expect.any(Date), - }, - ], - }, - { - name: '3rd group', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: false, - createdAt: expect.any(Date), - }, - ], - }, - ], - }) -}) - -it('should handle collapsing groups', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - { - name: 'Testing', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - { - name: 'Tests', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - } - - const currentState = reducer( - previousState, - tasksGroupCollapsed({ groupName: 'Testing', type: 'group', collapsed: true }), - ) - - const expectedState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: expect.any(Date), - }, - ], - }, - { - name: 'Testing', - collapsed: true, - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: expect.any(Date), - }, - ], - }, - { - name: 'Tests', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: expect.any(Date), - }, - ], - }, - ], - } - - expect(currentState).toEqual(expectedState) -}) - -it('should handle saving task draft for groups', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - { - name: 'Testing', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - { - name: 'Tests', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - ], - } - - const currentState = reducer(previousState, tasksGroupDraft({ groupName: 'Tests', draft: 'Remember to ...' })) - - const expectedState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: expect.any(Date), - }, - ], - }, - { - name: 'Testing', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: expect.any(Date), - }, - ], - }, - { - name: 'Tests', - draft: 'Remember to ...', - tasks: [ - { - id: 'yet-another-id', - description: 'Yet another simple task', - completed: true, - createdAt: expect.any(Date), - }, - ], - }, - ], - } - - expect(currentState).toEqual(expectedState) -}) - -it('should handle setting a group as last active', () => { - const previousState: TasksState = { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: new Date(), - }, - ], - }, - { - name: 'Testing', - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: new Date(), - }, - ], - }, - ], - } - - const currentState = reducer(previousState, tasksGroupLastActive({ groupName: 'Testing' })) - - expect(currentState).toMatchObject({ - schemaVersion: '1.0.0', - defaultSections: [], - groups: [ - { - name: 'Test', - tasks: [ - { - id: 'some-id', - description: 'A simple task', - completed: true, - createdAt: expect.any(Date), - }, - ], - }, - { - name: 'Testing', - lastActive: expect.any(Date), - tasks: [ - { - id: 'another-id', - description: 'Another simple task', - completed: false, - createdAt: expect.any(Date), - }, - ], - }, - ], - }) -}) - -it('should detect and load legacy content', () => { - const payload = '- [ ] Foo bar' - expect(reducer(undefined, tasksLoaded(payload))).toMatchObject({ - schemaVersion: LATEST_SCHEMA_VERSION, - defaultSections: [], - initialized: false, - groups: [], - legacyContent: { - name: 'Checklist', - tasks: [ - { - id: expect.any(String), - description: 'Foo bar', - completed: false, - createdAt: expect.any(Date), - }, - ], - }, - }) -}) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/tasks-slice.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/tasks-slice.ts deleted file mode 100644 index bc5f4a224..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/features/tasks/tasks-slice.ts +++ /dev/null @@ -1,371 +0,0 @@ -import { createSlice, PayloadAction } from '@reduxjs/toolkit' -import { arrayDefault, arrayMoveImmutable, isJsonString, parseMarkdownTasks } from '../../common/utils' - -export const LATEST_SCHEMA_VERSION = '1.0.0' -export const DEFAULT_SECTIONS: SectionModel[] = [ - { - id: 'open-tasks', - name: 'Open', - }, - { - id: 'completed-tasks', - name: 'Completed', - }, -] - -export type TasksState = { - schemaVersion: string - groups: GroupModel[] - defaultSections: SectionModel[] - initialized?: boolean - legacyContent?: GroupModel - lastError?: string -} - -const initialState: TasksState = { - schemaVersion: LATEST_SCHEMA_VERSION, - defaultSections: [], - groups: [], -} - -export type TaskModel = { - id: string - description: string - completed?: boolean - createdAt: Date - updatedAt?: Date - completedAt?: Date -} - -export type SectionModel = { - id: string - name: string - collapsed?: boolean -} - -export type GroupModel = { - name: string - collapsed?: boolean - draft?: string - lastActive?: Date - tasks: TaskModel[] - sections?: SectionModel[] -} - -const tasksSlice = createSlice({ - name: 'tasks', - initialState, - reducers: { - taskAdded( - state, - action: PayloadAction<{ - task: { id: string; description: string } - groupName: string - }>, - ) { - const { groupName, task } = action.payload - const group = state.groups.find((item) => item.name === groupName) - if (!group) { - return - } - delete group.draft - group.tasks.unshift({ - ...task, - completed: false, - createdAt: new Date(), - }) - }, - taskModified( - state, - action: PayloadAction<{ - task: { id: string; description: string } - groupName: string - }>, - ) { - const { groupName, task } = action.payload - const group = state.groups.find((item) => item.name === groupName) - if (!group) { - return - } - const currentTask = group.tasks.find((item) => item.id === task.id) - if (!currentTask) { - return - } - currentTask.description = task.description - currentTask.updatedAt = new Date() - }, - taskDeleted(state, action: PayloadAction<{ id: string; groupName: string }>) { - const { id, groupName } = action.payload - const group = state.groups.find((item) => item.name === groupName) - if (!group) { - return - } - group.tasks = group.tasks.filter((task) => task.id !== id) - }, - taskToggled(state, action: PayloadAction<{ id: string; groupName: string }>) { - const { id, groupName } = action.payload - const group = state.groups.find((item) => item.name === groupName) - if (!group) { - return - } - const currentTask = group.tasks.find((task) => task.id === id) - if (!currentTask) { - return - } - currentTask.completed = !currentTask.completed - currentTask.updatedAt = new Date() - if (currentTask.completed) { - currentTask.completedAt = new Date() - } else { - delete currentTask.completedAt - } - /** - * Puts the recently toggled task on top - */ - const tasks = group.tasks.filter((task) => task.id !== id) - group.tasks = [currentTask, ...tasks] - }, - openAllCompleted(state, action: PayloadAction<{ groupName: string }>) { - const { groupName } = action.payload - const group = state.groups.find((item) => item.name === groupName) - if (!group) { - return - } - group.tasks.forEach((task) => { - task.completed = false - delete task.completedAt - }) - }, - deleteAllCompleted(state, action: PayloadAction<{ groupName: string }>) { - const { groupName } = action.payload - const group = state.groups.find((item) => item.name === groupName) - if (!group) { - return - } - group.tasks = group.tasks.filter((task) => task.completed === false) - }, - tasksReordered( - state, - action: PayloadAction<{ - groupName: string - swapTaskIndex: number - withTaskIndex: number - isSameSection: boolean - }>, - ) { - const { groupName, swapTaskIndex, withTaskIndex, isSameSection } = action.payload - if (!isSameSection) { - return - } - const group = state.groups.find((item) => item.name === groupName) - if (!group) { - return - } - group.tasks = arrayMoveImmutable(group.tasks, swapTaskIndex, withTaskIndex) - }, - tasksGroupAdded( - state, - action: PayloadAction<{ - groupName: string - }>, - ) { - const { groupName } = action.payload - const group = state.groups.find((item) => item.name === groupName) - if (group) { - return - } - state.groups.push({ - name: groupName, - tasks: [], - }) - }, - tasksGroupReordered( - state, - action: PayloadAction<{ - swapGroupIndex: number - withGroupIndex: number - }>, - ) { - const { swapGroupIndex, withGroupIndex } = action.payload - state.groups = arrayMoveImmutable(state.groups, swapGroupIndex, withGroupIndex) - }, - tasksGroupDeleted( - state, - action: PayloadAction<{ - groupName: string - }>, - ) { - const { groupName } = action.payload - state.groups = state.groups.filter((item) => item.name !== groupName) - }, - tasksGroupMerged( - state, - action: PayloadAction<{ - groupName: string - mergeWith: string - }>, - ) { - const { groupName, mergeWith } = action.payload - if (groupName === mergeWith) { - return - } - const groupA = state.groups.find((item) => item.name === groupName) - if (!groupA) { - return - } - const groupB = state.groups.find((item) => item.name === mergeWith) - if (!groupB) { - return - } - groupA.name = mergeWith - groupA.tasks = [...(groupB.tasks ?? []), ...groupA.tasks] - state.groups = state.groups.filter((group) => group !== groupB) - }, - tasksGroupRenamed( - state, - action: PayloadAction<{ - groupName: string - newName: string - }>, - ) { - const { groupName, newName } = action.payload - if (groupName === newName) { - return - } - const groupA = state.groups.find((item) => item.name === groupName) - if (!groupA) { - return - } - groupA.name = newName - }, - tasksGroupCollapsed( - state, - action: PayloadAction<{ - groupName: string - type: 'group' | 'open-tasks' | 'completed-tasks' | string - collapsed: boolean - }>, - ) { - const { groupName, type, collapsed } = action.payload - const group = state.groups.find((item) => item.name === groupName) - if (!group) { - return - } - if (type === 'group') { - group.collapsed = collapsed - return - } - if (!group.sections) { - group.sections = state.defaultSections.map((section) => ({ id: section.id, name: section.name })) - } - const section = group.sections.find((item) => item.id === type) - if (!section) { - return - } - section.collapsed = collapsed - }, - tasksGroupDraft( - state, - action: PayloadAction<{ - groupName: string - draft: string - }>, - ) { - const { groupName, draft } = action.payload - const group = state.groups.find((item) => item.name === groupName) - if (!group) { - return - } - group.draft = draft - }, - tasksGroupLastActive( - state, - action: PayloadAction<{ - groupName: string - }>, - ) { - const { groupName } = action.payload - const group = state.groups.find((item) => item.name === groupName) - if (!group) { - return - } - group.lastActive = new Date() - }, - tasksLegacyContentMigrated(state, { payload }: PayloadAction<{ continue: boolean }>) { - if (!state.legacyContent) { - return - } - - if (payload.continue) { - state.initialized = true - state.groups.push(state.legacyContent) - delete state.lastError - } else { - state.initialized = false - state.groups = [] - state.lastError = - 'The legacy content migration has been canceled by the user. ' + - 'Please reload this note to try again or switch to the Basic Checklist editor.' - } - - delete state.legacyContent - }, - tasksLoaded(state, { payload }: PayloadAction) { - if (!payload && !state.initialized) { - payload = '{}' - } - - try { - const isJson = isJsonString(payload) - if (!isJson) { - const legacyContent = parseMarkdownTasks(payload) - if (legacyContent) { - state.legacyContent = legacyContent - state.initialized = false - return - } - } - - const parsedState = JSON.parse(payload) as TasksState - let newState: TasksState = { - schemaVersion: parsedState?.schemaVersion ?? LATEST_SCHEMA_VERSION, - defaultSections: arrayDefault({ value: parsedState?.defaultSections, defaultValue: DEFAULT_SECTIONS }), - groups: parsedState?.groups ?? [], - } - - if (newState !== initialState) { - state.schemaVersion = newState.schemaVersion - state.groups = newState.groups - state.defaultSections = newState.defaultSections - state.initialized = true - delete state.lastError - } - } catch (error: any) { - state.initialized = false - state.lastError = `An error has occurred while parsing the note's content: ${error}` - return - } - }, - }, -}) - -export const { - taskAdded, - taskModified, - taskToggled, - taskDeleted, - openAllCompleted, - deleteAllCompleted, - tasksLoaded, - tasksLegacyContentMigrated, - tasksGroupAdded, - tasksReordered, - tasksGroupReordered, - tasksGroupDeleted, - tasksGroupMerged, - tasksGroupRenamed, - tasksGroupCollapsed, - tasksGroupDraft, - tasksGroupLastActive, -} = tasksSlice.actions -export default tasksSlice.reducer diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/index.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/index.tsx deleted file mode 100644 index 15b98a08e..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/index.tsx +++ /dev/null @@ -1,179 +0,0 @@ -import './stylesheets/main.scss' - -import EditorKit, { EditorKitDelegate } from '@standardnotes/editor-kit' -import React, { useCallback, useEffect, useRef } from 'react' -import ReactDOM from 'react-dom' -import { renderToString } from 'react-dom/server' -import { Provider } from 'react-redux' -import styled from 'styled-components' - -import { useAppDispatch, useAppSelector } from './app/hooks' -import { store } from './app/store' -import { setCanEdit, setIsRunningOnMobile, setSpellCheckerEnabled } from './features/settings/settings-slice' -import CreateGroup from './features/tasks/CreateGroup' -import InvalidContentError from './features/tasks/InvalidContentError' -import MigrateLegacyContent from './features/tasks/MigrateLegacyContent' -import NotePreview from './features/tasks/NotePreview' -import TaskGroupList from './features/tasks/TaskGroupList' -import { tasksLoaded } from './features/tasks/tasks-slice' - -import { CheckBoxElementsDefs } from './common/components/svg' -import { getPlainPreview } from './common/utils' - -const MainContainer = styled.div` - margin: 6px; - padding-bottom: 60px; -` - -const FloatingContainer = styled.div` - background-color: var(--sn-stylekit-secondary-background-color); - border-top: 1px solid var(--sn-stylekit-border-color); - bottom: 0; - display: flex; - position: fixed; - width: 100%; -` - -const CenteredContainer = styled.div` - display: flex; - justify-content: center; - margin: 0px; - padding: 12px 16px; - position: relative; - width: 98%; -` - -const TaskEditor: React.FC = () => { - const note = useRef() - const editorKit = useRef() - - const initialized = useAppSelector((state) => state.tasks.initialized) - const groupedTasks = useAppSelector((state) => state.tasks.groups) - const legacyContent = useAppSelector((state) => state.tasks.legacyContent) - - const dispatch = useAppDispatch() - - function isRunningOnMobile(): boolean { - return editorKit.current!.isRunningInMobileApplication() - } - - const configureEditorKit = useCallback(() => { - const editorKitDelegate: EditorKitDelegate = { - setEditorRawText: (rawString: string) => { - dispatch(tasksLoaded(rawString)) - }, - onNoteValueChange: async (currentNote: any) => { - note.current = currentNote - - const editable = !currentNote.content.appData['org.standardnotes.sn'].locked ?? true - const spellCheckEnabled = currentNote.content.spellcheck - - dispatch(setCanEdit(editable)) - dispatch(setSpellCheckerEnabled(spellCheckEnabled)) - dispatch(setIsRunningOnMobile(isRunningOnMobile())) - }, - onNoteLockToggle: (locked: boolean) => { - dispatch(setCanEdit(!locked)) - }, - } - - editorKit.current = new EditorKit(editorKitDelegate, { - mode: 'json', - supportsFileSafe: false, - }) - }, [dispatch]) - - useEffect(() => { - configureEditorKit() - }, [configureEditorKit]) - - const saveNote = useCallback(() => { - const { initialized } = store.getState().tasks - const currentNote = note.current - if (!currentNote || !initialized) { - return - } - - const canEdit = store.getState().settings.canEdit - if (!canEdit) { - return - } - - editorKit.current!.saveItemWithPresave(currentNote, () => { - const { schemaVersion, groups, defaultSections } = store.getState().tasks - currentNote.content.text = JSON.stringify({ schemaVersion, groups, defaultSections }, null, 2) - - currentNote.content.preview_plain = getPlainPreview(groups) - currentNote.content.preview_html = renderToString() - }) - }, []) - - useEffect(() => { - const unsubscribe = store.subscribe(() => initialized && saveNote()) - return unsubscribe - }) - - /** - * Prevents dragging and dropping files - */ - useEffect(() => { - function rejectDragAndDrop(event: DragEvent) { - event && event.preventDefault() - } - - window.addEventListener('drop', rejectDragAndDrop) - window.addEventListener('dragover', rejectDragAndDrop) - - return () => { - window.removeEventListener('drop', rejectDragAndDrop) - window.removeEventListener('dragover', rejectDragAndDrop) - } - }, []) - - if (legacyContent) { - return ( - - - - ) - } - - if (!initialized) { - return ( - - - - ) - } - - if (groupedTasks.length === 0) { - return ( - - - - ) - } - - return ( - <> - - - - - - - - - - - ) -} - -ReactDOM.render( - - - - - , - document.getElementById('root'), -) diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/react-app-env.d.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/react-app-env.d.ts deleted file mode 100644 index 6431bc5fc..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/react-app-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/setupTests.ts b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/setupTests.ts deleted file mode 100644 index 52aaef1d2..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/setupTests.ts +++ /dev/null @@ -1,5 +0,0 @@ -// jest-dom adds custom jest matchers for asserting on DOM nodes. -// allows you to do things like: -// expect(element).toHaveTextContent(/react/i) -// learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom' diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/stylesheets/main.scss b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/stylesheets/main.scss deleted file mode 100644 index 624e12756..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/stylesheets/main.scss +++ /dev/null @@ -1,175 +0,0 @@ -@import '~@standardnotes/stylekit/dist/stylekit.css'; - -body, -html { - background-color: var(--sn-stylekit-secondary-background-color); - padding: 0 !important; -} - -* { - // To prevent gray flash when focusing input on mobile Safari - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); - font-family: var(--sn-stylekit-sans-serif-font); -} - -.sn-component { - display: flex; - flex-direction: column; - - @media screen and (max-width: 420px) { - min-height: -webkit-fill-available; - } - - .ml-3 { - margin-left: 0.75rem; - } - - .mr-3 { - margin-right: 0.75rem; - } - - .sn-icon.small { - height: 0.875rem; - width: 0.875rem; - } - - .no-fill { - fill: none; - } - - .stroke-info-color { - stroke: var(--sn-stylekit-info-color); - } - - .stroke-neutral-color { - stroke: var(--sn-stylekit-neutral-color); - } - - .fill-info-color { - fill: var(--sn-stylekit-info-color); - } - - .info-color { - color: var(--sn-stylekit-info-color); - } - - .sn-icon-button { - border-width: 0; - - &:hover { - background-color: inherit; - border-width: 1px; - } - - &.small { - height: 1.25rem; - min-width: 1.25rem; - width: 1.25rem; - } - } - - .pt-1px { - padding-top: 1px; - } - - .align-baseline { - align-items: baseline; - } - - .align-center { - align-items: center; - } -} - -:root { - --reach-menu-button: 1; -} - -reach-portal { - @import '~@standardnotes/stylekit/src/css/utils'; - @import '~@standardnotes/stylekit/src/css/sn'; - - div[data-reach-menu-list] { - @extend .bg-default; - @extend .border-main; - @extend .rounded; - @extend .box-shadow; - @extend .min-w-55; - @extend .mt-2; - @extend .focus\:outline-none; - @extend .origin-top-right; - @extend .py-2; - @extend .slide-down-animation; - @extend .color-text; - @extend .w-auto; - } - - div[data-reach-menu-item] { - @extend .items-center; - @extend .cursor-pointer; - @extend .flex; - @extend .hover\:bg-highlight; - @extend .focus\:outline-none; - @extend .focus\:shadow-none; - @extend .px-2; - @extend .selected\:bg-color; - @extend .selected\:fg-color; - @extend .m-h-32; - } - - div[data-reach-menu-item] > .sn-icon { - @extend .mr-2; - } - - div[data-selected][data-reach-menu-item] { - background-color: var(--sn-stylekit-contrast-background-color); - } - - div[data-reach-dialog-overlay] { - align-items: center; - background: none; - display: flex; - flex-direction: column; - justify-content: center; - overflow: unset; - z-index: 1001; - } - - div[data-reach-dialog-overlay]::before { - background-color: var(--sn-stylekit-contrast-background-color); - bottom: 0px; - content: ''; - left: 0px; - opacity: 0.75; - position: fixed; - right: 0px; - top: 0px; - } - - div[data-reach-dialog-content] { - background: none; - flex-basis: 0; - margin: 0; - max-width: 600px; - min-width: 400px; - overflow: unset; - padding: 0; - position: relative; - width: auto; - } - - div[data-reach-dialog-content] .sk-modal-content, - div[data-reach-dialog-content] .sn-component, - div[data-reach-dialog-content] .sk-panel { - height: 100%; - } - - div[data-reach-alert-dialog-content] { - width: auto; - } - - fieldset { - border: 0; - padding-left: 0; - } -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/testUtils.tsx b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/testUtils.tsx deleted file mode 100644 index 8761446ff..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/src/testUtils.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { render as rtlRender, RenderOptions } from '@testing-library/react' -import React from 'react' -import { Provider } from 'react-redux' -import configureStore from 'redux-mock-store' - -import { RootState } from './app/store' - -const defaultMockState: RootState = { - tasks: { - schemaVersion: '1.0.0', - defaultSections: [], - groups: [], - }, - settings: { - canEdit: true, - isRunningOnMobile: false, - spellCheckerEnabled: true, - }, -} - -export function testRender(ui: React.ReactElement, renderOptions?: RenderOptions, state?: Partial) { - const mockStore = configureStore()({ - ...defaultMockState, - ...state, - }) - function Wrapper({ children }: { children: React.ReactElement> }) { - return {children} - } - return { - component: rtlRender(ui, { wrapper: Wrapper, ...renderOptions }), - mockStore, - } -} diff --git a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/tsconfig.json b/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/tsconfig.json deleted file mode 100644 index c7dcc2906..000000000 --- a/packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "target": "es6", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx", - "typeRoots": ["./types", "./node_modules/@types", "../../node_modules/@types"] - }, - "include": ["src"], - "exclude": ["node_modules", "types"] -} diff --git a/packages/features/src/Domain/Feature/FeatureIdentifier.ts b/packages/features/src/Domain/Feature/FeatureIdentifier.ts index 5cd3d9b6c..78467bd80 100644 --- a/packages/features/src/Domain/Feature/FeatureIdentifier.ts +++ b/packages/features/src/Domain/Feature/FeatureIdentifier.ts @@ -28,7 +28,6 @@ export enum FeatureIdentifier { SolarizedDarkTheme = 'org.standardnotes.theme-solarized-dark', TitaniumTheme = 'org.standardnotes.theme-titanium', - AdvancedChecklist = 'org.standardnotes.advanced-checklist', CodeEditor = 'org.standardnotes.code-editor', MarkdownProEditor = 'org.standardnotes.advanced-markdown-editor', MarkdownVisualEditor = 'org.standardnotes.markdown-visual-editor', @@ -51,4 +50,4 @@ export enum FeatureIdentifier { */ export const LegacyFileSafeIdentifier = 'org.standardnotes.legacy.file-safe' -export const ExperimentalFeatures = [FeatureIdentifier.AdvancedChecklist] +export const ExperimentalFeatures = [] diff --git a/packages/features/src/Domain/Lists/ExperimentalFeatures.ts b/packages/features/src/Domain/Lists/ExperimentalFeatures.ts index b517a2b0c..30c3ebf5a 100644 --- a/packages/features/src/Domain/Lists/ExperimentalFeatures.ts +++ b/packages/features/src/Domain/Lists/ExperimentalFeatures.ts @@ -1,23 +1,5 @@ -import { SubscriptionName } from '@standardnotes/common' -import { NoteType } from '../Component/NoteType' -import { PermissionName } from '../Permission/PermissionName' -import { EditorFeatureDescription, FeatureDescription } from '../Feature/FeatureDescription' -import { FeatureIdentifier } from '../Feature/FeatureIdentifier' -import { FillEditorComponentDefaults } from './Utilities/FillEditorComponentDefaults' +import { FeatureDescription } from '../Feature/FeatureDescription' export function experimentalFeatures(): FeatureDescription[] { - const advancedChecklist: EditorFeatureDescription = FillEditorComponentDefaults({ - availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan], - name: 'Advanced Checklist [Beta]', - identifier: FeatureIdentifier.AdvancedChecklist, - note_type: NoteType.Task, - spellcheckControl: true, - file_type: 'json', - interchangeable: false, - permission_name: PermissionName.AdvancedChecklist, - description: 'A task editor with grouping functionality.', - index_path: 'build/index.html', - }) - - return [advancedChecklist] + return [] } diff --git a/packages/features/src/Domain/Permission/PermissionName.ts b/packages/features/src/Domain/Permission/PermissionName.ts index 8b9777494..841f999d0 100644 --- a/packages/features/src/Domain/Permission/PermissionName.ts +++ b/packages/features/src/Domain/Permission/PermissionName.ts @@ -1,6 +1,5 @@ export enum PermissionName { AccountSwitcher = 'app:account-switcher', - AdvancedChecklist = 'editor:advanced-checklist', AutobiographyTheme = 'theme:autobiography', BoldEditor = 'editor:bold', CloudLink = 'component:cloud-link', diff --git a/packages/web/package.json b/packages/web/package.json index bbe3580a5..3808f5123 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -33,6 +33,7 @@ "@types/jest": "^29.0.2", "@types/react": "^18.0.20", "@types/react-dom": "^18.0.6", + "@types/styled-components": "^5.1.26", "@types/wicg-file-system-access": "^2020.9.5", "autoprefixer": "^10.4.10", "babel-loader": "^8.2.5", diff --git a/yarn.lock b/yarn.lock index cb4fdfce8..0bac0babb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1841,7 +1841,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.10.3, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.1, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.15.4, @babel/runtime@npm:^7.16.3, @babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.18.2, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.7.1, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": +"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.10.3, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.1, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.15.4, @babel/runtime@npm:^7.16.3, @babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.18.2, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.7.1, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.9.2": version: 7.18.6 resolution: "@babel/runtime@npm:7.18.6" dependencies: @@ -4230,13 +4230,6 @@ __metadata: languageName: node linkType: hard -"@juggle/resize-observer@npm:^3.3.1": - version: 3.3.1 - resolution: "@juggle/resize-observer@npm:3.3.1" - checksum: ddabc4044276a2cb57d469c4917206c7e39f2463aa8e3430e33e4eda554412afe29c22afa40e6708b49dad5d56768dc83acd68a704b1dcd49a0906bb96b991b2 - languageName: node - linkType: hard - "@leichtgewicht/ip-codec@npm:^2.0.1": version: 2.0.4 resolution: "@leichtgewicht/ip-codec@npm:2.0.4" @@ -4912,16 +4905,6 @@ __metadata: languageName: node linkType: hard -"@nanostores/preact@npm:^0.1.3": - version: 0.1.3 - resolution: "@nanostores/preact@npm:0.1.3" - peerDependencies: - nanostores: ^0.5.2 - preact: ">=10.0.0" - checksum: ae5ba0ecdbeb6edc316e10cd41bdd0e21c19aa8421191237e647cccc89cf5ed050e483d3c7dda3345d3778ffb07075260b4dc868e448b1634e34f67974d065e8 - languageName: node - linkType: hard - "@nanostores/react@npm:^0.2.0": version: 0.2.0 resolution: "@nanostores/react@npm:0.2.0" @@ -5323,23 +5306,6 @@ __metadata: languageName: node linkType: hard -"@reach/alert-dialog@npm:0.16.2": - version: 0.16.2 - resolution: "@reach/alert-dialog@npm:0.16.2" - dependencies: - "@reach/auto-id": 0.16.0 - "@reach/dialog": 0.16.2 - "@reach/utils": 0.16.0 - invariant: ^2.2.4 - prop-types: ^15.7.2 - tslib: ^2.3.0 - peerDependencies: - react: ^16.8.0 || 17.x - react-dom: ^16.8.0 || 17.x - checksum: 677ff78bd8ef99aeb216f797c294c0c2cead7b50f250160ab4a9c464fb16e705e90d9760557428d549c7efd00416a6fc4b8d0023db8cf49abc10db5bd4586fe5 - languageName: node - linkType: hard - "@reach/alert-dialog@npm:^0.17.0": version: 0.17.0 resolution: "@reach/alert-dialog@npm:0.17.0" @@ -5372,19 +5338,6 @@ __metadata: languageName: node linkType: hard -"@reach/auto-id@npm:0.16.0": - version: 0.16.0 - resolution: "@reach/auto-id@npm:0.16.0" - dependencies: - "@reach/utils": 0.16.0 - tslib: ^2.3.0 - peerDependencies: - react: ^16.8.0 || 17.x - react-dom: ^16.8.0 || 17.x - checksum: 80211f7db1c0e3b107e2c1d3fe8055e7e41d7399b51ff0da5f0c9df43d90b77aa4a31a896545c699f9629b3fbc3c762ee0518de70faf8112098886c6759d3f15 - languageName: node - linkType: hard - "@reach/auto-id@npm:0.17.0": version: 0.17.0 resolution: "@reach/auto-id@npm:0.17.0" @@ -5415,19 +5368,6 @@ __metadata: languageName: node linkType: hard -"@reach/descendants@npm:0.16.1": - version: 0.16.1 - resolution: "@reach/descendants@npm:0.16.1" - dependencies: - "@reach/utils": 0.16.0 - tslib: ^2.3.0 - peerDependencies: - react: ^16.8.0 || 17.x - react-dom: ^16.8.0 || 17.x - checksum: 0d2a5d322e3564683e65651367af47157f7782ce6be3cadcc861334638a02bf2a672b8e0fcbeeea4284c329f0218a119b2f2e0724d0faefe833ef772bab09d05 - languageName: node - linkType: hard - "@reach/descendants@npm:0.17.0": version: 0.17.0 resolution: "@reach/descendants@npm:0.17.0" @@ -5441,23 +5381,6 @@ __metadata: languageName: node linkType: hard -"@reach/dialog@npm:0.16.2": - version: 0.16.2 - resolution: "@reach/dialog@npm:0.16.2" - dependencies: - "@reach/portal": 0.16.2 - "@reach/utils": 0.16.0 - prop-types: ^15.7.2 - react-focus-lock: ^2.5.2 - react-remove-scroll: ^2.4.3 - tslib: ^2.3.0 - peerDependencies: - react: ^16.8.0 || 17.x - react-dom: ^16.8.0 || 17.x - checksum: 1478ad3c4c0a86c30b02f4360fb06ead5b2e894c5e6ab96523970d45272298e2e31cb5278f861e4f92a90bcab0a30f4bac5572ab534f56529145619e7675497f - languageName: node - linkType: hard - "@reach/dialog@npm:0.17.0, @reach/dialog@npm:^0.17.0": version: 0.17.0 resolution: "@reach/dialog@npm:0.17.0" @@ -5491,22 +5414,6 @@ __metadata: languageName: node linkType: hard -"@reach/dropdown@npm:0.16.2": - version: 0.16.2 - resolution: "@reach/dropdown@npm:0.16.2" - dependencies: - "@reach/auto-id": 0.16.0 - "@reach/descendants": 0.16.1 - "@reach/popover": 0.16.2 - "@reach/utils": 0.16.0 - tslib: ^2.3.0 - peerDependencies: - react: ^16.8.0 || 17.x - react-dom: ^16.8.0 || 17.x - checksum: 484ea82f36f86b4bf53b363e440b1ffcd4262f8b553ec82ded0423b1f66dfaee254bdc9fffcd1c7030a39473c12b10916c1a240898b7b7228a98e28ee4787cf1 - languageName: node - linkType: hard - "@reach/dropdown@npm:0.17.0": version: 0.17.0 resolution: "@reach/dropdown@npm:0.17.0" @@ -5523,23 +5430,6 @@ __metadata: languageName: node linkType: hard -"@reach/listbox@npm:^0.16.2": - version: 0.16.2 - resolution: "@reach/listbox@npm:0.16.2" - dependencies: - "@reach/auto-id": 0.16.0 - "@reach/descendants": 0.16.1 - "@reach/machine": 0.16.0 - "@reach/popover": 0.16.2 - "@reach/utils": 0.16.0 - prop-types: ^15.7.2 - peerDependencies: - react: ^16.8.0 || 17.x - react-dom: ^16.8.0 || 17.x - checksum: 695d155d6b09656f6a8a1b71d89e8db76c5d5e2e6c38c342f6f99abb41ab050558fec7325843dabaa9eb1770748a51038c5a2e98bdd54fef27babaaffaa1bcf9 - languageName: node - linkType: hard - "@reach/listbox@npm:^0.17.0": version: 0.17.0 resolution: "@reach/listbox@npm:0.17.0" @@ -5557,20 +5447,6 @@ __metadata: languageName: node linkType: hard -"@reach/machine@npm:0.16.0": - version: 0.16.0 - resolution: "@reach/machine@npm:0.16.0" - dependencies: - "@reach/utils": 0.16.0 - "@xstate/fsm": 1.4.0 - tslib: ^2.3.0 - peerDependencies: - react: ^16.8.0 || 17.x - react-dom: ^16.8.0 || 17.x - checksum: 9df37f4ddcb7f7e44080a9948209e08e56223cc8fd33203f6064ccf1c89981dbdaef8b43b7b62f306c29fb9c08f6cf6798c4f702c18bdb02571f56eabe1ba979 - languageName: node - linkType: hard - "@reach/machine@npm:0.17.0": version: 0.17.0 resolution: "@reach/machine@npm:0.17.0" @@ -5585,24 +5461,6 @@ __metadata: languageName: node linkType: hard -"@reach/menu-button@npm:0.16.2, @reach/menu-button@npm:^0.16.2": - version: 0.16.2 - resolution: "@reach/menu-button@npm:0.16.2" - dependencies: - "@reach/dropdown": 0.16.2 - "@reach/popover": 0.16.2 - "@reach/utils": 0.16.0 - prop-types: ^15.7.2 - tiny-warning: ^1.0.3 - tslib: ^2.3.0 - peerDependencies: - react: ^16.8.0 || 17.x - react-dom: ^16.8.0 || 17.x - react-is: ^16.8.0 || 17.x - checksum: e7ffaac11fdb4ad5239dd69b4d2f37774903d6e91a1eddbd8aace9f32d07396b2f4cf8a0107a8e3e86386c993f8fdd8b412005ca1b1a52d870e05b0218cff11b - languageName: node - linkType: hard - "@reach/menu-button@npm:^0.17.0": version: 0.17.0 resolution: "@reach/menu-button@npm:0.17.0" @@ -5628,22 +5486,6 @@ __metadata: languageName: node linkType: hard -"@reach/popover@npm:0.16.2": - version: 0.16.2 - resolution: "@reach/popover@npm:0.16.2" - dependencies: - "@reach/portal": 0.16.2 - "@reach/rect": 0.16.0 - "@reach/utils": 0.16.0 - tabbable: ^4.0.0 - tslib: ^2.3.0 - peerDependencies: - react: ^16.8.0 || 17.x - react-dom: ^16.8.0 || 17.x - checksum: ed6e7636cedb19ad4d29132191e02b752b6f2e69017356686b1886c5f54330ddec927d080b41d681bc3670a75f80ae0c6bf11ce6bf8e6cdd38a5cdce5f092d18 - languageName: node - linkType: hard - "@reach/popover@npm:0.17.0": version: 0.17.0 resolution: "@reach/popover@npm:0.17.0" @@ -5660,20 +5502,6 @@ __metadata: languageName: node linkType: hard -"@reach/portal@npm:0.16.2": - version: 0.16.2 - resolution: "@reach/portal@npm:0.16.2" - dependencies: - "@reach/utils": 0.16.0 - tiny-warning: ^1.0.3 - tslib: ^2.3.0 - peerDependencies: - react: ^16.8.0 || 17.x - react-dom: ^16.8.0 || 17.x - checksum: 7413dcd169cfb9854dd0d3a01f811ec19ef170558fcbd00118d676fc02c197d1c0bce1d1357508879d4775169561d103e13a8e4d74cc677eb0037cc7b04f7a1e - languageName: node - linkType: hard - "@reach/portal@npm:0.17.0": version: 0.17.0 resolution: "@reach/portal@npm:0.17.0" @@ -5688,22 +5516,6 @@ __metadata: languageName: node linkType: hard -"@reach/rect@npm:0.16.0": - version: 0.16.0 - resolution: "@reach/rect@npm:0.16.0" - dependencies: - "@reach/observe-rect": 1.2.0 - "@reach/utils": 0.16.0 - prop-types: ^15.7.2 - tiny-warning: ^1.0.3 - tslib: ^2.3.0 - peerDependencies: - react: ^16.8.0 || 17.x - react-dom: ^16.8.0 || 17.x - checksum: a3d0df3b127fcafc8693a84f6f38e5042ae38bef3c6c9a324d0f46977999ac9f44a4fcda4f27343530248714e7a149e7e4625ffb73aeba9fb7ab59618975af4f - languageName: node - linkType: hard - "@reach/rect@npm:0.17.0": version: 0.17.0 resolution: "@reach/rect@npm:0.17.0" @@ -5739,19 +5551,6 @@ __metadata: languageName: node linkType: hard -"@reach/utils@npm:0.16.0": - version: 0.16.0 - resolution: "@reach/utils@npm:0.16.0" - dependencies: - tiny-warning: ^1.0.3 - tslib: ^2.3.0 - peerDependencies: - react: ^16.8.0 || 17.x - react-dom: ^16.8.0 || 17.x - checksum: 36bc0eb41a71798eb6186b23de265ba709e51dae5bf214fb8505c66bb3f2e6a41bb2401457350436ba89ca9e3a50f93a04fe7c33d15648ce11e568a85622d770 - languageName: node - linkType: hard - "@reach/utils@npm:0.17.0": version: 0.17.0 resolution: "@reach/utils@npm:0.17.0" @@ -5765,19 +5564,6 @@ __metadata: languageName: node linkType: hard -"@reach/visually-hidden@npm:0.16.0": - version: 0.16.0 - resolution: "@reach/visually-hidden@npm:0.16.0" - dependencies: - prop-types: ^15.7.2 - tslib: ^2.3.0 - peerDependencies: - react: ^16.8.0 || 17.x - react-dom: ^16.8.0 || 17.x - checksum: e2af8978857640dcf031e1942da397b15dfbddbd3bce2d406e923cd9947f07c8beb18e4ae399f4eea34e8f1390a2a8327a4220113a9682771f86ea32a9778c8b - languageName: node - linkType: hard - "@reach/visually-hidden@npm:0.17.0, @reach/visually-hidden@npm:^0.17.0": version: 0.17.0 resolution: "@reach/visually-hidden@npm:0.17.0" @@ -5812,39 +5598,6 @@ __metadata: languageName: node linkType: hard -"@react-hook/latest@npm:^1.0.2": - version: 1.0.3 - resolution: "@react-hook/latest@npm:1.0.3" - peerDependencies: - react: ">=16.8" - checksum: 2408c9cd35c5cfa7697b6da3bc5eebef254a932ade70955074c474f23be7dd3e2f81bbba12edcc9208bd0f89c6ed366d6b11d4f6d7b1052877a0bac8f74afad4 - languageName: node - linkType: hard - -"@react-hook/passive-layout-effect@npm:^1.2.0": - version: 1.2.1 - resolution: "@react-hook/passive-layout-effect@npm:1.2.1" - peerDependencies: - react: ">=16.8" - checksum: 217cb8aa90fb8e677672319a9a466d7752890cf4357c76df000b207696e9cc717cf2ee88080671cc9dae238a82f92093ab4f61ab2f6032d2a8db958fc7d99b5d - languageName: node - linkType: hard - -"@react-hook/resize-observer@npm:^1.2.5": - version: 1.2.5 - resolution: "@react-hook/resize-observer@npm:1.2.5" - dependencies: - "@juggle/resize-observer": ^3.3.1 - "@react-hook/latest": ^1.0.2 - "@react-hook/passive-layout-effect": ^1.2.0 - "@types/raf-schd": ^4.0.0 - raf-schd: ^4.0.2 - peerDependencies: - react: ">=16.8" - checksum: a2f3b333e344adb3d7a4cfd2bc77fd75054b07063fba706d57bef0c497650c3e82038eafb64fa4148c08527e8b0a34f2f70392da1700a7a0d9676ee8ba795c16 - languageName: node - linkType: hard - "@react-native-community/async-storage@npm:1.12.1": version: 1.12.1 resolution: "@react-native-community/async-storage@npm:1.12.1" @@ -6157,26 +5910,6 @@ __metadata: languageName: node linkType: hard -"@reduxjs/toolkit@npm:1.8.0": - version: 1.8.0 - resolution: "@reduxjs/toolkit@npm:1.8.0" - dependencies: - immer: ^9.0.7 - redux: ^4.1.2 - redux-thunk: ^2.4.1 - reselect: ^4.1.5 - peerDependencies: - react: ^16.9.0 || ^17.0.0 || 18.0.0-beta - react-redux: ^7.2.1 || ^8.0.0-beta - peerDependenciesMeta: - react: - optional: true - react-redux: - optional: true - checksum: e229571b80d7f5c4407af2050ac2a26a22472541fef1705d5e8b73b93bfb2884072d79e1cea2cd81d89939cc6b6073ef3ddf1680950aac66ba34cd202a6cf371 - languageName: node - linkType: hard - "@rollup/plugin-babel@npm:^5.2.0": version: 5.3.1 resolution: "@rollup/plugin-babel@npm:5.3.1" @@ -6331,54 +6064,6 @@ __metadata: languageName: node linkType: hard -"@standardnotes/advanced-checklist@workspace:packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist": - version: 0.0.0-use.local - resolution: "@standardnotes/advanced-checklist@workspace:packages/components/src/Packages/Editors/org.standardnotes.advanced-checklist" - dependencies: - "@reach/alert-dialog": 0.16.2 - "@reach/menu-button": 0.16.2 - "@reach/visually-hidden": 0.16.0 - "@react-hook/resize-observer": ^1.2.5 - "@reduxjs/toolkit": 1.8.0 - "@standardnotes/editor-kit": 2.2.5 - "@standardnotes/stylekit": 5.23.0 - "@standardnotes/utils": "workspace:*" - "@testing-library/dom": 8.11.3 - "@testing-library/jest-dom": 5.16.2 - "@testing-library/react": 12.1.4 - "@testing-library/user-event": 13.5.0 - "@types/jest": ^28.1.5 - "@types/lodash": 4.14.179 - "@types/node": 17.0.21 - "@types/react": 17.0.40 - "@types/react-beautiful-dnd": 13.1.2 - "@types/react-dom": 17.0.13 - "@types/react-redux": 7.1.23 - "@types/react-transition-group": 4.4.4 - "@types/redux-mock-store": 1.0.3 - "@types/styled-components": 5.1.24 - "@types/uuid": 8.3.4 - gh-pages: 3.2.3 - lint-staged: 12.3.5 - node-sass: "*" - prettier: "*" - react: 17.0.2 - react-app-rewired: ^2.2.1 - react-beautiful-dnd: 13.1.0 - react-dom: 17.0.2 - react-redux: 7.2.8 - react-scripts: 5.0.0 - react-transition-group: 4.4.2 - redux: 4.1.2 - redux-mock-store: 1.5.4 - source-map-explorer: 2.5.2 - styled-components: 5.3.5 - ts-jest: ^28.0.5 - typescript: 4.6.2 - uuid: 8.3.2 - languageName: unknown - linkType: soft - "@standardnotes/api@workspace:*, @standardnotes/api@workspace:^, @standardnotes/api@workspace:packages/api": version: 0.0.0-use.local resolution: "@standardnotes/api@workspace:packages/api" @@ -7562,23 +7247,6 @@ __metadata: languageName: unknown linkType: soft -"@standardnotes/stylekit@npm:5.23.0": - version: 5.23.0 - resolution: "@standardnotes/stylekit@npm:5.23.0" - dependencies: - "@nanostores/preact": ^0.1.3 - "@reach/listbox": ^0.16.2 - "@reach/menu-button": ^0.16.2 - "@svgr/webpack": ^6.2.1 - nanoid: ^3.3.1 - nanostores: ^0.5.10 - prop-types: ^15.8.1 - peerDependencies: - preact: ^10.6.6 - checksum: 35e6ed6196b7283534d30ea8546422524f98e8b9aec5641d8869d571baa784c9c71c548a61804dd9b88be31f7aaf702530631d5800c73450b5eafe9fccd10da8 - languageName: node - linkType: hard - "@standardnotes/stylekit@npm:5.29.3": version: 5.29.3 resolution: "@standardnotes/stylekit@npm:5.29.3" @@ -7706,6 +7374,7 @@ __metadata: "@types/jest": ^29.0.2 "@types/react": ^18.0.20 "@types/react-dom": ^18.0.6 + "@types/styled-components": ^5.1.26 "@types/wicg-file-system-access": ^2020.9.5 "@zip.js/zip.js": ^2.6.26 autoprefixer: ^10.4.10 @@ -8068,22 +7737,6 @@ __metadata: languageName: node linkType: hard -"@testing-library/dom@npm:8.11.3": - version: 8.11.3 - resolution: "@testing-library/dom@npm:8.11.3" - dependencies: - "@babel/code-frame": ^7.10.4 - "@babel/runtime": ^7.12.5 - "@types/aria-query": ^4.2.0 - aria-query: ^5.0.0 - chalk: ^4.1.0 - dom-accessibility-api: ^0.5.9 - lz-string: ^1.4.4 - pretty-format: ^27.0.2 - checksum: 2245d254b6058590e25de86fb7b3c75e4a31096901a191f80d3efb9fa7e1e273043416f370c8770feb9f3ccc73a1550a877a3b003b593f1728ae828fcb52cd62 - languageName: node - linkType: hard - "@testing-library/dom@npm:^8.0.0, @testing-library/dom@npm:^8.11.3": version: 8.14.0 resolution: "@testing-library/dom@npm:8.14.0" @@ -8100,23 +7753,6 @@ __metadata: languageName: node linkType: hard -"@testing-library/jest-dom@npm:5.16.2": - version: 5.16.2 - resolution: "@testing-library/jest-dom@npm:5.16.2" - dependencies: - "@babel/runtime": ^7.9.2 - "@types/testing-library__jest-dom": ^5.9.1 - aria-query: ^5.0.0 - chalk: ^3.0.0 - css: ^3.0.0 - css.escape: ^1.5.1 - dom-accessibility-api: ^0.5.6 - lodash: ^4.17.15 - redent: ^3.0.0 - checksum: e4569df67c4c4998d2c60c6cf00ce2f1ac10c9397e0970320728c8be8f4e2c17a0e801705ce8a7384f7f5629b598a6f58db91d4401dde02044f5625405ca0988 - languageName: node - linkType: hard - "@testing-library/jest-dom@npm:^5.16.2": version: 5.16.4 resolution: "@testing-library/jest-dom@npm:5.16.4" @@ -8134,20 +7770,6 @@ __metadata: languageName: node linkType: hard -"@testing-library/react@npm:12.1.4": - version: 12.1.4 - resolution: "@testing-library/react@npm:12.1.4" - dependencies: - "@babel/runtime": ^7.12.5 - "@testing-library/dom": ^8.0.0 - "@types/react-dom": "*" - peerDependencies: - react: "*" - react-dom: "*" - checksum: 944c5f8d4abb22c0650c25c7ae499651828c37c0e741ff67a4635d4cd99b307d486dabec05b372aba638bd359d29cd2af97393b5055ea294a201d80b4bc384b8 - languageName: node - linkType: hard - "@testing-library/react@npm:^12.1.4": version: 12.1.5 resolution: "@testing-library/react@npm:12.1.5" @@ -8162,7 +7784,7 @@ __metadata: languageName: node linkType: hard -"@testing-library/user-event@npm:13.5.0, @testing-library/user-event@npm:^13.5.0": +"@testing-library/user-event@npm:^13.5.0": version: 13.5.0 resolution: "@testing-library/user-event@npm:13.5.0" dependencies: @@ -8663,13 +8285,6 @@ __metadata: languageName: node linkType: hard -"@types/lodash@npm:4.14.179": - version: 4.14.179 - resolution: "@types/lodash@npm:4.14.179" - checksum: 71faa0c8071732c2b7f0bd092850d3cea96fc7912055d57d819cf2ab399a64150e4190d8a4ea35a0905662ddc118be9d2abd55891d8047c085acf98608156149 - languageName: node - linkType: hard - "@types/lodash@npm:^4.14.179, @types/lodash@npm:^4.14.182": version: 4.14.182 resolution: "@types/lodash@npm:4.14.182" @@ -8756,13 +8371,6 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:17.0.21": - version: 17.0.21 - resolution: "@types/node@npm:17.0.21" - checksum: 89dcd2fe82f21d3634266f8384e9c865cf8af49685639fbdbd799bdd1040480fb1e8eeda2d3b9fce41edbe704d2a4be9f427118c4ae872e8d9bb7cbeb3c41a94 - languageName: node - linkType: hard - "@types/node@npm:^12.0.12": version: 12.20.55 resolution: "@types/node@npm:12.20.55" @@ -8991,13 +8599,6 @@ __metadata: languageName: node linkType: hard -"@types/raf-schd@npm:^4.0.0": - version: 4.0.1 - resolution: "@types/raf-schd@npm:4.0.1" - checksum: 0babaa85541aadc6e5f8aa64ec79cd68bf67ea56abb7610c8daf3ca5f4b1a75d12e4e147a0b5434938a4031650ebddc733021ec4e7db4f11f7955390ec32c917 - languageName: node - linkType: hard - "@types/range-parser@npm:*": version: 1.2.4 resolution: "@types/range-parser@npm:1.2.4" @@ -9005,39 +8606,12 @@ __metadata: languageName: node linkType: hard -"@types/react-beautiful-dnd@npm:13.1.2": - version: 13.1.2 - resolution: "@types/react-beautiful-dnd@npm:13.1.2" - dependencies: - "@types/react": "*" - checksum: 28372854fcd4b7546aabe55ee6569da59fad10f117929cff8a9c6f928448e4dd08ed1139facca33232833b9de100edf017aab9a0ee34065f8fc0e2a7a1262b2c - languageName: node - linkType: hard - "@types/react-dom@link:../web/node_modules/@types/react-dom::locator=%40standardnotes%2Ftoast%40workspace%3Apackages%2Ftoast": version: 0.0.0-use.local resolution: "@types/react-dom@link:../web/node_modules/@types/react-dom::locator=%40standardnotes%2Ftoast%40workspace%3Apackages%2Ftoast" languageName: node linkType: soft -"@types/react-dom@npm:*, @types/react-dom@npm:^18.0.6": - version: 18.0.6 - resolution: "@types/react-dom@npm:18.0.6" - dependencies: - "@types/react": "*" - checksum: db571047af1a567631758700b9f7d143e566df939cfe5fbf7535347cc0c726a1cdbb5e3f8566d076e54cf708b6c1166689de194a9ba09ee35efc9e1d45911685 - languageName: node - linkType: hard - -"@types/react-dom@npm:17.0.13": - version: 17.0.13 - resolution: "@types/react-dom@npm:17.0.13" - dependencies: - "@types/react": "*" - checksum: 62c42a54ac8961c23a0e74b9cdd8b0a78563757e462b1ab665b2aa365bfd8b86a73d3f6eafc09a4a80fb08659321db168f012aa597c41c0df36f645a94e9266b - languageName: node - linkType: hard - "@types/react-dom@npm:<18.0.0, @types/react-dom@npm:^17.0.13": version: 17.0.17 resolution: "@types/react-dom@npm:17.0.17" @@ -9047,6 +8621,15 @@ __metadata: languageName: node linkType: hard +"@types/react-dom@npm:^18.0.6": + version: 18.0.6 + resolution: "@types/react-dom@npm:18.0.6" + dependencies: + "@types/react": "*" + checksum: db571047af1a567631758700b9f7d143e566df939cfe5fbf7535347cc0c726a1cdbb5e3f8566d076e54cf708b6c1166689de194a9ba09ee35efc9e1d45911685 + languageName: node + linkType: hard + "@types/react-native-vector-icons@npm:^6.4.10": version: 6.4.11 resolution: "@types/react-native-vector-icons@npm:6.4.11" @@ -9084,18 +8667,6 @@ __metadata: languageName: node linkType: hard -"@types/react-redux@npm:7.1.23": - version: 7.1.23 - resolution: "@types/react-redux@npm:7.1.23" - dependencies: - "@types/hoist-non-react-statics": ^3.3.0 - "@types/react": "*" - hoist-non-react-statics: ^3.3.0 - redux: ^4.0.0 - checksum: 7cedb0f20806ce67255f676fab2d4d9534c12705d43636df95224cfa77fdf5a2e792dc76c6e072c02cad1c88030aea822c14f36fe85d459b898ee68fcff6f05c - languageName: node - linkType: hard - "@types/react-redux@npm:^7.1.20": version: 7.1.24 resolution: "@types/react-redux@npm:7.1.24" @@ -9117,15 +8688,6 @@ __metadata: languageName: node linkType: hard -"@types/react-transition-group@npm:4.4.4": - version: 4.4.4 - resolution: "@types/react-transition-group@npm:4.4.4" - dependencies: - "@types/react": "*" - checksum: 86e9ff9731798e12bc2afe0304678918769633b531dcf6397f86af81718fb7930ef8648e894eeb3718fc6eab6eb885cfb9b82a44d1d74e10951ee11ebc4643ae - languageName: node - linkType: hard - "@types/react@link:../web/node_modules/@types/react::locator=%40standardnotes%2Ftoast%40workspace%3Apackages%2Ftoast": version: 0.0.0-use.local resolution: "@types/react@link:../web/node_modules/@types/react::locator=%40standardnotes%2Ftoast%40workspace%3Apackages%2Ftoast" @@ -9153,17 +8715,6 @@ __metadata: languageName: node linkType: hard -"@types/react@npm:17.0.40": - version: 17.0.40 - resolution: "@types/react@npm:17.0.40" - dependencies: - "@types/prop-types": "*" - "@types/scheduler": "*" - csstype: ^3.0.2 - checksum: 24d1b210b5bf3c7d49f9a7fe5490db02e005a1d989045a2d67528347557dd0bcb0d7bcf96088152697e97521ac4c9506d1357ee48a2b7d4e701c70d838dc7284 - languageName: node - linkType: hard - "@types/react@npm:^17, @types/react@npm:^17.0.40": version: 17.0.47 resolution: "@types/react@npm:17.0.47" @@ -9186,15 +8737,6 @@ __metadata: languageName: node linkType: hard -"@types/redux-mock-store@npm:1.0.3": - version: 1.0.3 - resolution: "@types/redux-mock-store@npm:1.0.3" - dependencies: - redux: ^4.0.5 - checksum: b8c76be560fb06c0b5fc8b8874001f0b0219a7a5d0bbbf8f06ebfc437a1300df49f079b30199a9fa99c738817145895a4f0297b8f614edadd1d9e110e917cd0a - languageName: node - linkType: hard - "@types/refractor@npm:^3.0.0": version: 3.0.2 resolution: "@types/refractor@npm:3.0.2" @@ -9316,14 +8858,14 @@ __metadata: languageName: node linkType: hard -"@types/styled-components@npm:5.1.24": - version: 5.1.24 - resolution: "@types/styled-components@npm:5.1.24" +"@types/styled-components@npm:^5.1.26": + version: 5.1.26 + resolution: "@types/styled-components@npm:5.1.26" dependencies: "@types/hoist-non-react-statics": "*" "@types/react": "*" csstype: ^3.0.2 - checksum: 158c69085ad899622f558426c623d3052f7b521ede01c0fd342280c93ef2ac462a39c4c3b2374e7c7e2630fcc64dfcfd8f4446c8d4809cbac9a7b962a73357c0 + checksum: 84f53b3101739b20d1731554fb7735bc2f3f5d050a8b392e9845403c8c8bbd729737d033978649f9195a97b557875b010d46e35a4538564a2d0dbcce661dbf76 languageName: node linkType: hard @@ -9382,7 +8924,7 @@ __metadata: languageName: node linkType: hard -"@types/uuid@npm:8.3.4, @types/uuid@npm:^8.3.4": +"@types/uuid@npm:^8.3.4": version: 8.3.4 resolution: "@types/uuid@npm:8.3.4" checksum: 6f11f3ff70f30210edaa8071422d405e9c1d4e53abbe50fdce365150d3c698fe7bbff65c1e71ae080cbfb8fded860dbb5e174da96fdbbdfcaa3fb3daa474d20f @@ -11054,7 +10596,7 @@ __metadata: languageName: node linkType: hard -"async@npm:^2.4.0, async@npm:^2.4.1, async@npm:^2.5.0, async@npm:^2.6.0, async@npm:^2.6.1, async@npm:^2.6.2, async@npm:^2.6.4": +"async@npm:^2.4.0, async@npm:^2.4.1, async@npm:^2.5.0, async@npm:^2.6.0, async@npm:^2.6.2, async@npm:^2.6.4": version: 2.6.4 resolution: "async@npm:2.6.4" dependencies: @@ -13908,7 +13450,7 @@ __metadata: languageName: node linkType: hard -"commander@npm:2, commander@npm:^2.11.0, commander@npm:^2.15.1, commander@npm:^2.18.0, commander@npm:^2.19.0, commander@npm:^2.20.0": +"commander@npm:2, commander@npm:^2.11.0, commander@npm:^2.15.1, commander@npm:^2.19.0, commander@npm:^2.20.0": version: 2.20.3 resolution: "commander@npm:2.20.3" checksum: ab8c07884e42c3a8dbc5dd9592c606176c7eb5c1ca5ff274bcf907039b2c41de3626f684ea75ccf4d361ba004bbaff1f577d5384c155f3871e456bdf27becf9e @@ -16907,16 +16449,6 @@ __metadata: languageName: node linkType: hard -"dom-helpers@npm:^5.0.1": - version: 5.2.1 - resolution: "dom-helpers@npm:5.2.1" - dependencies: - "@babel/runtime": ^7.8.7 - csstype: ^3.0.2 - checksum: 863ba9e086f7093df3376b43e74ce4422571d404fc9828bf2c56140963d5edf0e56160f9b2f3bb61b282c07f8fc8134f023c98fd684bddcb12daf7b0f14d951c - languageName: node - linkType: hard - "dom-serializer@npm:0": version: 0.2.2 resolution: "dom-serializer@npm:0.2.2" @@ -17399,13 +16931,6 @@ __metadata: languageName: node linkType: hard -"email-addresses@npm:^3.0.1": - version: 3.1.0 - resolution: "email-addresses@npm:3.1.0" - checksum: e911985f096fa0198019caee4a12685146f677738d8ae1ebe25419181a37930a15be15447abef3612bdc3b88f72aaae4fd2cf1a95669705e638ebcfea4a15047 - languageName: node - linkType: hard - "emittery@npm:^0.10.2": version: 0.10.2 resolution: "emittery@npm:0.10.2" @@ -17788,7 +17313,7 @@ __metadata: languageName: node linkType: hard -"eslint-config-react-app@npm:^7.0.0, eslint-config-react-app@npm:^7.0.1": +"eslint-config-react-app@npm:^7.0.1": version: 7.0.1 resolution: "eslint-config-react-app@npm:7.0.1" dependencies: @@ -19160,24 +18685,6 @@ __metadata: languageName: node linkType: hard -"filename-reserved-regex@npm:^2.0.0": - version: 2.0.0 - resolution: "filename-reserved-regex@npm:2.0.0" - checksum: 323a0020fd7f243238ffccab9d728cbc5f3a13c84b2c10e01efb09b8324561d7a51776be76f36603c734d4f69145c39a5d12492bf6142a28b50d7f90bd6190bc - languageName: node - linkType: hard - -"filenamify@npm:^4.3.0": - version: 4.3.0 - resolution: "filenamify@npm:4.3.0" - dependencies: - filename-reserved-regex: ^2.0.0 - strip-outer: ^1.0.1 - trim-repeated: ^1.0.0 - checksum: 5b71a7ff8e958c8621957e6fbf7872024126d3b5da50f59b1634af3343ba1a69d4cc15cfe4ca4bbfa7c959ad4d98614ee51e6f1d9fa7326eef8ceda2da8cd74e - languageName: node - linkType: hard - "filesafe-embed@npm:1.0.13": version: 1.0.13 resolution: "filesafe-embed@npm:1.0.13" @@ -20131,24 +19638,6 @@ __metadata: languageName: node linkType: hard -"gh-pages@npm:3.2.3": - version: 3.2.3 - resolution: "gh-pages@npm:3.2.3" - dependencies: - async: ^2.6.1 - commander: ^2.18.0 - email-addresses: ^3.0.1 - filenamify: ^4.3.0 - find-cache-dir: ^3.3.1 - fs-extra: ^8.1.0 - globby: ^6.1.0 - bin: - gh-pages: bin/gh-pages.js - gh-pages-clean: bin/gh-pages-clean.js - checksum: 0a6e92180ce8fac6f244403d1c8af6d004615b96c7bafdc25da0022eab34f84470895587c618d440ae77b4b4ce1c1b85442ddf3184f53a522f87974da5a41760 - languageName: node - linkType: hard - "git-raw-commits@npm:^2.0.0, git-raw-commits@npm:^2.0.8": version: 2.0.11 resolution: "git-raw-commits@npm:2.0.11" @@ -25230,13 +24719,6 @@ __metadata: languageName: node linkType: hard -"lilconfig@npm:2.0.4": - version: 2.0.4 - resolution: "lilconfig@npm:2.0.4" - checksum: 02ae530aa49218d782eb79e92c600ea5220828987f85aa3403fa512cadc7efe38c0ac7d0cd2edf600ad3fae1f6c1752f5b4bb78c0d9950435b044d53d507c9e1 - languageName: node - linkType: hard - "lilconfig@npm:2.0.5, lilconfig@npm:^2.0.3, lilconfig@npm:^2.0.5": version: 2.0.5 resolution: "lilconfig@npm:2.0.5" @@ -25306,30 +24788,7 @@ __metadata: languageName: node linkType: hard -"lint-staged@npm:12.3.5": - version: 12.3.5 - resolution: "lint-staged@npm:12.3.5" - dependencies: - cli-truncate: ^3.1.0 - colorette: ^2.0.16 - commander: ^8.3.0 - debug: ^4.3.3 - execa: ^5.1.1 - lilconfig: 2.0.4 - listr2: ^4.0.1 - micromatch: ^4.0.4 - normalize-path: ^3.0.0 - object-inspect: ^1.12.0 - string-argv: ^0.3.1 - supports-color: ^9.2.1 - yaml: ^1.10.2 - bin: - lint-staged: bin/lint-staged.js - checksum: 6653c7078b36741e521e5f309b56bb75db198a05cbdd188124ff82a290e352ade3eb1e6080265729e19711ac08d190e300874af00e4e540b57b3c8f0690e2573 - languageName: node - linkType: hard - -"listr2@npm:^4.0.1, listr2@npm:^4.0.5": +"listr2@npm:^4.0.5": version: 4.0.5 resolution: "listr2@npm:4.0.5" dependencies: @@ -27897,7 +27356,7 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:^3.1.23, nanoid@npm:^3.1.25, nanoid@npm:^3.3.1, nanoid@npm:^3.3.4": +"nanoid@npm:^3.1.23, nanoid@npm:^3.1.25, nanoid@npm:^3.3.4": version: 3.3.4 resolution: "nanoid@npm:3.3.4" bin: @@ -27925,7 +27384,7 @@ __metadata: languageName: node linkType: hard -"nanostores@npm:^0.5.10, nanostores@npm:^0.5.12": +"nanostores@npm:^0.5.12": version: 0.5.12 resolution: "nanostores@npm:0.5.12" checksum: 87a975b00d79cd227f465a3f2933a5c6f76688e89b52230671ecc3065e0487c8bc6bb61adba4a6d12b2993d3b9e2047065586769e8c2113e671192c447d4b15c @@ -32343,7 +31802,7 @@ __metadata: languageName: node linkType: hard -"react-beautiful-dnd@npm:13.1.0, react-beautiful-dnd@npm:^13.1.0": +"react-beautiful-dnd@npm:^13.1.0": version: 13.1.0 resolution: "react-beautiful-dnd@npm:13.1.0" dependencies: @@ -32421,7 +31880,7 @@ __metadata: languageName: node linkType: hard -"react-dev-utils@npm:^12.0.0, react-dev-utils@npm:^12.0.1": +"react-dev-utils@npm:^12.0.1": version: 12.0.1 resolution: "react-dev-utils@npm:12.0.1" dependencies: @@ -32567,7 +32026,7 @@ __metadata: languageName: node linkType: hard -"react-dom@npm:17.0.2, react-dom@npm:17.x, react-dom@npm:^17.0.1, react-dom@npm:^17.0.2": +"react-dom@npm:17.x, react-dom@npm:^17.0.1, react-dom@npm:^17.0.2": version: 17.0.2 resolution: "react-dom@npm:17.0.2" dependencies: @@ -33176,7 +32635,7 @@ __metadata: languageName: node linkType: hard -"react-redux@npm:7.2.8, react-redux@npm:^7.2.0": +"react-redux@npm:^7.2.0": version: 7.2.8 resolution: "react-redux@npm:7.2.8" dependencies: @@ -33302,73 +32761,6 @@ __metadata: languageName: node linkType: hard -"react-scripts@npm:5.0.0": - version: 5.0.0 - resolution: "react-scripts@npm:5.0.0" - dependencies: - "@babel/core": ^7.16.0 - "@pmmmwh/react-refresh-webpack-plugin": ^0.5.3 - "@svgr/webpack": ^5.5.0 - babel-jest: ^27.4.2 - babel-loader: ^8.2.3 - babel-plugin-named-asset-import: ^0.3.8 - babel-preset-react-app: ^10.0.1 - bfj: ^7.0.2 - browserslist: ^4.18.1 - camelcase: ^6.2.1 - case-sensitive-paths-webpack-plugin: ^2.4.0 - css-loader: ^6.5.1 - css-minimizer-webpack-plugin: ^3.2.0 - dotenv: ^10.0.0 - dotenv-expand: ^5.1.0 - eslint: ^8.3.0 - eslint-config-react-app: ^7.0.0 - eslint-webpack-plugin: ^3.1.1 - file-loader: ^6.2.0 - fs-extra: ^10.0.0 - fsevents: ^2.3.2 - html-webpack-plugin: ^5.5.0 - identity-obj-proxy: ^3.0.0 - jest: ^27.4.3 - jest-resolve: ^27.4.2 - jest-watch-typeahead: ^1.0.0 - mini-css-extract-plugin: ^2.4.5 - postcss: ^8.4.4 - postcss-flexbugs-fixes: ^5.0.2 - postcss-loader: ^6.2.1 - postcss-normalize: ^10.0.1 - postcss-preset-env: ^7.0.1 - prompts: ^2.4.2 - react-app-polyfill: ^3.0.0 - react-dev-utils: ^12.0.0 - react-refresh: ^0.11.0 - resolve: ^1.20.0 - resolve-url-loader: ^4.0.0 - sass-loader: ^12.3.0 - semver: ^7.3.5 - source-map-loader: ^3.0.0 - style-loader: ^3.3.1 - tailwindcss: ^3.0.2 - terser-webpack-plugin: ^5.2.5 - webpack: ^5.64.4 - webpack-dev-server: ^4.6.0 - webpack-manifest-plugin: ^4.0.2 - workbox-webpack-plugin: ^6.4.1 - peerDependencies: - react: ">= 16" - typescript: ^3.2.1 || ^4 - dependenciesMeta: - fsevents: - optional: true - peerDependenciesMeta: - typescript: - optional: true - bin: - react-scripts: bin/react-scripts.js - checksum: 55ffad0d68ee6345326f5803c1925ae44b46cc33cb1cad9bcb68fd1784acfb3876bc12118b3079bc4d934834ae0197a9776baa0a06df0263831acc91ac42df29 - languageName: node - linkType: hard - "react-scripts@npm:^5.0.0": version: 5.0.1 resolution: "react-scripts@npm:5.0.1" @@ -33501,21 +32893,6 @@ __metadata: languageName: node linkType: hard -"react-transition-group@npm:4.4.2": - version: 4.4.2 - resolution: "react-transition-group@npm:4.4.2" - dependencies: - "@babel/runtime": ^7.5.5 - dom-helpers: ^5.0.1 - loose-envify: ^1.4.0 - prop-types: ^15.6.2 - peerDependencies: - react: ">=16.6.0" - react-dom: ">=16.6.0" - checksum: b67bf5b3e86dbab72d658b9a52a3589e5960583ab28c7c66272427d8fe30d4c7de422d5046ae96bd2683cdf80cc3264b2516f5ce80cae1dbe6cf3ca6dda392c5 - languageName: node - linkType: hard - "react@link:../web/node_modules/react::locator=%40standardnotes%2Ftoast%40workspace%3Apackages%2Ftoast": version: 0.0.0-use.local resolution: "react@link:../web/node_modules/react::locator=%40standardnotes%2Ftoast%40workspace%3Apackages%2Ftoast" @@ -33778,34 +33155,7 @@ __metadata: languageName: node linkType: hard -"redux-mock-store@npm:1.5.4": - version: 1.5.4 - resolution: "redux-mock-store@npm:1.5.4" - dependencies: - lodash.isplainobject: ^4.0.6 - checksum: 571eab2cca3e46321969025af865ddd780804c811be9db277fddf772d86e3ea67b4ef1b19ea3866417d41eb1b73605103020321f68cf68f379a52679a6823d12 - languageName: node - linkType: hard - -"redux-thunk@npm:^2.4.1": - version: 2.4.1 - resolution: "redux-thunk@npm:2.4.1" - peerDependencies: - redux: ^4 - checksum: af5abb425fb9dccda02e5f387d6f3003997f62d906542a3d35fc9420088f550dc1a018bdc246c7d23ee852b4d4ab8b5c64c5be426e45a328d791c4586a3c6b6e - languageName: node - linkType: hard - -"redux@npm:4.1.2": - version: 4.1.2 - resolution: "redux@npm:4.1.2" - dependencies: - "@babel/runtime": ^7.9.2 - checksum: 6a839cee5bd580c5298d968e9e2302150e961318253819bcd97f9d945a5a409559eacddf6026f4118bb68b681c593d90e8a2c5bbf278f014aff9bf0d2d8fa084 - languageName: node - linkType: hard - -"redux@npm:^4.0.0, redux@npm:^4.0.4, redux@npm:^4.0.5, redux@npm:^4.1.2, redux@npm:^4.2.0": +"redux@npm:^4.0.0, redux@npm:^4.0.4, redux@npm:^4.2.0": version: 4.2.0 resolution: "redux@npm:4.2.0" dependencies: @@ -34353,13 +33703,6 @@ __metadata: languageName: node linkType: hard -"reselect@npm:^4.1.5": - version: 4.1.6 - resolution: "reselect@npm:4.1.6" - checksum: 3ea1058422904063ec93c8f4693fe33dcb2178bbf417ace8db5b2c797a5875cf357d9308d11ed3942ee22507dd34ecfbf1f3a21340a4f31c206cab1d36ceef31 - languageName: node - linkType: hard - "resolve-alpn@npm:^1.2.0": version: 1.2.1 resolution: "resolve-alpn@npm:1.2.1" @@ -36066,7 +35409,7 @@ __metadata: languageName: node linkType: hard -"source-map-explorer@npm:2.5.2, source-map-explorer@npm:^2.5.2": +"source-map-explorer@npm:^2.5.2": version: 2.5.2 resolution: "source-map-explorer@npm:2.5.2" dependencies: @@ -36882,15 +36225,6 @@ __metadata: languageName: node linkType: hard -"strip-outer@npm:^1.0.1": - version: 1.0.1 - resolution: "strip-outer@npm:1.0.1" - dependencies: - escape-string-regexp: ^1.0.2 - checksum: f8d65d33ca2b49aabc66bb41d689dda7b8b9959d320e3a40a2ef4d7079ff2f67ffb72db43f179f48dbf9495c2e33742863feab7a584d180fa62505439162c191 - languageName: node - linkType: hard - "strong-log-transformer@npm:^2.1.0": version: 2.1.0 resolution: "strong-log-transformer@npm:2.1.0" @@ -37123,13 +36457,6 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^9.2.1": - version: 9.2.2 - resolution: "supports-color@npm:9.2.2" - checksum: 976d84877402fc38c1d43b1fde20b0a8dc0283273f21cfebe4ff7507d27543cdfbeec7db108a96b82d694465f06d64e8577562b05d0520b41710088e0a33cc50 - languageName: node - linkType: hard - "supports-hyperlinks@npm:^2.0.0": version: 2.2.0 resolution: "supports-hyperlinks@npm:2.2.0" @@ -37936,15 +37263,6 @@ __metadata: languageName: node linkType: hard -"trim-repeated@npm:^1.0.0": - version: 1.0.0 - resolution: "trim-repeated@npm:1.0.0" - dependencies: - escape-string-regexp: ^1.0.2 - checksum: e25c235305b82c43f1d64a67a71226c406b00281755e4c2c4f3b1d0b09c687a535dd3c4483327f949f28bb89dc400a0bc5e5b749054f4b99f49ebfe48ba36496 - languageName: node - linkType: hard - "trim-right@npm:^1.0.1": version: 1.0.1 resolution: "trim-right@npm:1.0.1" @@ -38379,16 +37697,6 @@ __metadata: languageName: node linkType: hard -"typescript@npm:4.6.2": - version: 4.6.2 - resolution: "typescript@npm:4.6.2" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 8a44ed7e6f6c4cb1ebe8cf236ecda2fb119d84dcf0fbd77e707b2dfea1bbcfc4e366493a143513ce7f57203c75da9d4e20af6fe46de89749366351046be7577c - languageName: node - linkType: hard - "typescript@patch:typescript@*#~builtin, typescript@patch:typescript@^4.6.3#~builtin, typescript@patch:typescript@^4.6.4#~builtin, typescript@patch:typescript@^4.7.3#~builtin, typescript@patch:typescript@^4.7.4#~builtin": version: 4.7.4 resolution: "typescript@patch:typescript@npm%3A4.7.4#~builtin::version=4.7.4&hash=7ad353" @@ -38399,16 +37707,6 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@4.6.2#~builtin": - version: 4.6.2 - resolution: "typescript@patch:typescript@npm%3A4.6.2#~builtin::version=4.6.2&hash=7ad353" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 40b493a71747fb89fa70df104e2c4a5e284b43750af5bea024090a5261cefa387f7a9372411b13030f7bf5555cee4275443d08805642ae5c74ef76740854a4c7 - languageName: node - linkType: hard - "typo-js@npm:*": version: 1.2.1 resolution: "typo-js@npm:1.2.1" @@ -39271,15 +38569,6 @@ __metadata: languageName: node linkType: hard -"uuid@npm:8.3.2, uuid@npm:^8.3.2": - version: 8.3.2 - resolution: "uuid@npm:8.3.2" - bin: - uuid: dist/bin/uuid - checksum: 5575a8a75c13120e2f10e6ddc801b2c7ed7d8f3c8ac22c7ed0c7b2ba6383ec0abda88c905085d630e251719e0777045ae3236f04c812184b7c765f63a70e58df - languageName: node - linkType: hard - "uuid@npm:^3.0.1, uuid@npm:^3.3.2": version: 3.4.0 resolution: "uuid@npm:3.4.0" @@ -39289,6 +38578,15 @@ __metadata: languageName: node linkType: hard +"uuid@npm:^8.3.2": + version: 8.3.2 + resolution: "uuid@npm:8.3.2" + bin: + uuid: dist/bin/uuid + checksum: 5575a8a75c13120e2f10e6ddc801b2c7ed7d8f3c8ac22c7ed0c7b2ba6383ec0abda88c905085d630e251719e0777045ae3236f04c812184b7c765f63a70e58df + languageName: node + linkType: hard + "uvu@npm:^0.5.0": version: 0.5.6 resolution: "uvu@npm:0.5.6"