From 2d5eb2c45d582ecaa8f79ef334a665b9b098e220 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:00:37 +0000 Subject: [PATCH 01/37] Bump @radix-ui/react-collapsible from 1.1.0 to 1.1.1 Bumps [@radix-ui/react-collapsible](https://github.com/radix-ui/primitives) from 1.1.0 to 1.1.1. - [Changelog](https://github.com/radix-ui/primitives/blob/main/release-process.md) - [Commits](https://github.com/radix-ui/primitives/commits) --- updated-dependencies: - dependency-name: "@radix-ui/react-collapsible" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- pnpm-lock.yaml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 83a52278..8a500e7a 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@paralleldrive/cuid2": "^2.2.2", "@radix-ui/react-alert-dialog": "^1.1.1", "@radix-ui/react-checkbox": "^1.1.2", - "@radix-ui/react-collapsible": "^1.1.0", + "@radix-ui/react-collapsible": "^1.1.1", "@radix-ui/react-dialog": "^1.1.2", "@radix-ui/react-dropdown-menu": "^2.1.2", "@radix-ui/react-label": "^2.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 66a0719f..50cccd5f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,8 +36,8 @@ importers: specifier: ^1.1.2 version: 1.1.2(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-collapsible': - specifier: ^1.1.0 - version: 1.1.0(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.1.1 + version: 1.1.1(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-dialog': specifier: ^1.1.2 version: 1.1.2(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -1162,8 +1162,8 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-collapsible@1.1.0': - resolution: {integrity: sha512-zQY7Epa8sTL0mq4ajSJpjgn2YmCgyrG7RsQgLp3C0LQVkG7+Tf6Pv1CeNWZLyqMjhdPkBa5Lx7wYBeSu7uCSTA==} + '@radix-ui/react-collapsible@1.1.1': + resolution: {integrity: sha512-1///SnrfQHJEofLokyczERxQbWfCGQlQ2XsCZMucVs6it+lq9iw4vXy+uDn1edlb58cOZOWSldnfPAYcT4O/Yg==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6191,13 +6191,13 @@ snapshots: '@types/react': 18.3.7 '@types/react-dom': 18.3.1 - '@radix-ui/react-collapsible@1.1.0(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/react-collapsible@1.1.1(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@radix-ui/primitive': 1.1.0 '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.7)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.7)(react@18.3.1) + '@radix-ui/react-context': 1.1.1(@types/react@18.3.7)(react@18.3.1) '@radix-ui/react-id': 1.1.0(@types/react@18.3.7)(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-presence': 1.1.1(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.7)(react@18.3.1) '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.7)(react@18.3.1) From 419f087e84c153a328ad320622edc18b873e53f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:00:51 +0000 Subject: [PATCH 02/37] Bump @radix-ui/react-alert-dialog from 1.1.1 to 1.1.2 Bumps [@radix-ui/react-alert-dialog](https://github.com/radix-ui/primitives) from 1.1.1 to 1.1.2. - [Changelog](https://github.com/radix-ui/primitives/blob/main/release-process.md) - [Commits](https://github.com/radix-ui/primitives/commits) --- updated-dependencies: - dependency-name: "@radix-ui/react-alert-dialog" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- pnpm-lock.yaml | 134 +++---------------------------------------------- 2 files changed, 8 insertions(+), 128 deletions(-) diff --git a/package.json b/package.json index 83a52278..33e6e9d4 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@hookform/resolvers": "^3.9.1", "@lucia-auth/adapter-prisma": "^3.0.2", "@paralleldrive/cuid2": "^2.2.2", - "@radix-ui/react-alert-dialog": "^1.1.1", + "@radix-ui/react-alert-dialog": "^1.1.2", "@radix-ui/react-checkbox": "^1.1.2", "@radix-ui/react-collapsible": "^1.1.0", "@radix-ui/react-dialog": "^1.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 66a0719f..e5f1ed6d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,8 +30,8 @@ importers: specifier: ^2.2.2 version: 2.2.2 '@radix-ui/react-alert-dialog': - specifier: ^1.1.1 - version: 1.1.1(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.1.2 + version: 1.1.2(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-checkbox': specifier: ^1.1.2 version: 1.1.2(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -1123,8 +1123,8 @@ packages: '@radix-ui/primitive@1.1.0': resolution: {integrity: sha512-4Z8dn6Upk0qk4P74xBhZ6Hd/w0mPEzOOLxy4xiPXOXqjF7jZS0VAKk7/x/H6FyY2zCkYJqePf1G5KmkmNJ4RBA==} - '@radix-ui/react-alert-dialog@1.1.1': - resolution: {integrity: sha512-wmCoJwj7byuVuiLKqDLlX7ClSUU0vd9sdCeM+2Ls+uf13+cpSJoMgwysHq1SGVVkJj5Xn0XWi1NoRCdkMpr6Mw==} + '@radix-ui/react-alert-dialog@1.1.2': + resolution: {integrity: sha512-eGSlLzPhKO+TErxkiGcCZGuvbVMnLA1MTnyBksGOeGRGkxHiiJUujsjmNTdWTm4iHVSRaUao9/4Ur671auMghQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -1215,19 +1215,6 @@ packages: '@types/react': optional: true - '@radix-ui/react-dialog@1.1.1': - resolution: {integrity: sha512-zysS+iU4YP3STKNS6USvFVqI4qqx8EpiwmT5TuCApVEBca+eRCbONi4EgzfNSuVnOXvC5UPHHMjs8RXO6DH9Bg==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-dialog@1.1.2': resolution: {integrity: sha512-Yj4dZtqa2o+kG61fzB0H2qUvmwBA2oyQroGLyNtBj1beo1khoQ3q1a2AO8rrQYjd8256CO9+N8L9tvsS+bnIyA==} peerDependencies: @@ -1250,19 +1237,6 @@ packages: '@types/react': optional: true - '@radix-ui/react-dismissable-layer@1.1.0': - resolution: {integrity: sha512-/UovfmmXGptwGcBQawLzvn2jOfM0t4z3/uKffoBlj724+n3FvBbZ7M0aaBOmkp6pqFYpO4yx8tSVJjx3Fl2jig==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-dismissable-layer@1.1.1': resolution: {integrity: sha512-QSxg29lfr/xcev6kSz7MAlmDnzbP1eI/Dwn3Tp1ip0KT5CUELsxkekFEMVBEoykI3oV39hKT4TKZzBNMbcTZYQ==} peerDependencies: @@ -1289,15 +1263,6 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-focus-guards@1.1.0': - resolution: {integrity: sha512-w6XZNUPVv6xCpZUqb/yN9DL6auvpGX3C/ee6Hdi16v2UUy25HV2Q5bcflsiDyT/g5RwbPQ/GIT1vLkeRb+ITBw==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@radix-ui/react-focus-guards@1.1.1': resolution: {integrity: sha512-pSIwfrT1a6sIoDASCSpFwOasEwKTZWDw/iBdtnqKO7v6FeOzYJ7U53cPzYFVR3geGGXgVHaH+CdngrrAzqUGxg==} peerDependencies: @@ -1381,19 +1346,6 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-portal@1.1.1': - resolution: {integrity: sha512-A3UtLk85UtqhzFqtoC8Q0KvR2GbXF3mtPgACSazajqq6A41mEQgo53iPzY4i6BwDxlIFqWIhiQ2G729n+2aw/g==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-portal@1.1.2': resolution: {integrity: sha512-WeDYLGPxJb/5EGBoedyJbT0MpoULmwnIPMJMSldkuiMsBAv7N1cRdsTWZWht9vpPOiN3qyiGAtbK2is47/uMFg==} peerDependencies: @@ -4411,16 +4363,6 @@ packages: '@types/react': optional: true - react-remove-scroll@2.5.7: - resolution: {integrity: sha512-FnrTWO4L7/Bhhf3CYBNArEG/yROV0tKmTv7/3h9QCFvH6sndeFf1wPqOcbFVu5VAulS5dV1wGT3GZZ/1GawqiA==} - engines: {node: '>=10'} - peerDependencies: - '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - react-remove-scroll@2.6.0: resolution: {integrity: sha512-I2U4JVEsQenxDAKaVa3VZ/JeJZe0/2DxPWL8Tj8yLKctQJQiZM52pn/GWFpSp8dftjM3pSAHVJZscAnC/y+ySQ==} engines: {node: '>=10'} @@ -6152,12 +6094,12 @@ snapshots: '@radix-ui/primitive@1.1.0': {} - '@radix-ui/react-alert-dialog@1.1.1(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/react-alert-dialog@1.1.2(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@radix-ui/primitive': 1.1.0 '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.7)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.7)(react@18.3.1) - '@radix-ui/react-dialog': 1.1.1(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-context': 1.1.1(@types/react@18.3.7)(react@18.3.1) + '@radix-ui/react-dialog': 1.1.2(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-slot': 1.1.0(@types/react@18.3.7)(react@18.3.1) react: 18.3.1 @@ -6237,28 +6179,6 @@ snapshots: optionalDependencies: '@types/react': 18.3.7 - '@radix-ui/react-dialog@1.1.1(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.7)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.7)(react@18.3.1) - '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-focus-guards': 1.1.0(@types/react@18.3.7)(react@18.3.1) - '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-id': 1.1.0(@types/react@18.3.7)(react@18.3.1) - '@radix-ui/react-portal': 1.1.1(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.7)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.7)(react@18.3.1) - aria-hidden: 1.2.4 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-remove-scroll: 2.5.7(@types/react@18.3.7)(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.7 - '@types/react-dom': 18.3.1 - '@radix-ui/react-dialog@1.1.2(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@radix-ui/primitive': 1.1.0 @@ -6287,19 +6207,6 @@ snapshots: optionalDependencies: '@types/react': 18.3.7 - '@radix-ui/react-dismissable-layer@1.1.0(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.7)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.7)(react@18.3.1) - '@radix-ui/react-use-escape-keydown': 1.1.0(@types/react@18.3.7)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.7 - '@types/react-dom': 18.3.1 - '@radix-ui/react-dismissable-layer@1.1.1(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@radix-ui/primitive': 1.1.0 @@ -6328,12 +6235,6 @@ snapshots: '@types/react': 18.3.7 '@types/react-dom': 18.3.1 - '@radix-ui/react-focus-guards@1.1.0(@types/react@18.3.7)(react@18.3.1)': - dependencies: - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.7 - '@radix-ui/react-focus-guards@1.1.1(@types/react@18.3.7)(react@18.3.1)': dependencies: react: 18.3.1 @@ -6434,16 +6335,6 @@ snapshots: '@types/react': 18.3.7 '@types/react-dom': 18.3.1 - '@radix-ui/react-portal@1.1.1(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.7)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.7 - '@types/react-dom': 18.3.1 - '@radix-ui/react-portal@1.1.2(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -9997,17 +9888,6 @@ snapshots: optionalDependencies: '@types/react': 18.3.7 - react-remove-scroll@2.5.7(@types/react@18.3.7)(react@18.3.1): - dependencies: - react: 18.3.1 - react-remove-scroll-bar: 2.3.6(@types/react@18.3.7)(react@18.3.1) - react-style-singleton: 2.2.1(@types/react@18.3.7)(react@18.3.1) - tslib: 2.8.0 - use-callback-ref: 1.3.2(@types/react@18.3.7)(react@18.3.1) - use-sidecar: 1.1.2(@types/react@18.3.7)(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.7 - react-remove-scroll@2.6.0(@types/react@18.3.7)(react@18.3.1): dependencies: react: 18.3.1 From e2b7f3a94a35ee95467aea225c25fa6710fa5d98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:01:30 +0000 Subject: [PATCH 03/37] Bump vite-tsconfig-paths from 4.3.2 to 5.1.2 Bumps [vite-tsconfig-paths](https://github.com/aleclarson/vite-tsconfig-paths) from 4.3.2 to 5.1.2. - [Release notes](https://github.com/aleclarson/vite-tsconfig-paths/releases) - [Commits](https://github.com/aleclarson/vite-tsconfig-paths/compare/v4.3.2...v5.1.2) --- updated-dependencies: - dependency-name: vite-tsconfig-paths dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 83a52278..80724532 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "sass": "^1.79.1", "tailwindcss": "^3.4.12", "typescript": "5.6.3", - "vite-tsconfig-paths": "^4.3.2", + "vite-tsconfig-paths": "^5.1.2", "vitest": "^2.1.4" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 66a0719f..f2eeabe7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -370,8 +370,8 @@ importers: specifier: 5.6.3 version: 5.6.3 vite-tsconfig-paths: - specifier: ^4.3.2 - version: 4.3.2(typescript@5.6.3)(vite@5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0)) + specifier: ^5.1.2 + version: 5.1.2(typescript@5.6.3)(vite@5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0)) vitest: specifier: ^2.1.4 version: 2.1.4(@types/node@20.16.5)(jsdom@25.0.1)(sass@1.79.1)(terser@5.36.0) @@ -5173,8 +5173,8 @@ packages: engines: {node: ^18.0.0 || >=20.0.0} hasBin: true - vite-tsconfig-paths@4.3.2: - resolution: {integrity: sha512-0Vd/a6po6Q+86rPlntHye7F31zA2URZMbH8M3saAZ/xR9QoGN/L21bxEGfXdWmFdNkqPpRdxFT7nmNe12e9/uA==} + vite-tsconfig-paths@5.1.2: + resolution: {integrity: sha512-gEIbKfJzSEv0yR3XS2QEocKetONoWkbROj6hGx0FHM18qKUojhvcokQsxQx5nMkelZq2n37zbSGCJn+FSODSjA==} peerDependencies: vite: '*' peerDependenciesMeta: @@ -10890,7 +10890,7 @@ snapshots: - supports-color - terser - vite-tsconfig-paths@4.3.2(typescript@5.6.3)(vite@5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0)): + vite-tsconfig-paths@5.1.2(typescript@5.6.3)(vite@5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0)): dependencies: debug: 4.3.7 globrex: 0.1.2 From 765a60ce9d71b2b4733ea67c3413eaaa486a1473 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:01:57 +0000 Subject: [PATCH 04/37] Bump vitest from 2.1.4 to 2.1.5 Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 2.1.4 to 2.1.5. - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v2.1.5/packages/vitest) --- updated-dependencies: - dependency-name: vitest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- pnpm-lock.yaml | 118 +++++++++++++++++++++++-------------------------- 2 files changed, 57 insertions(+), 63 deletions(-) diff --git a/package.json b/package.json index 83a52278..56d293c6 100644 --- a/package.json +++ b/package.json @@ -145,6 +145,6 @@ "tailwindcss": "^3.4.12", "typescript": "5.6.3", "vite-tsconfig-paths": "^4.3.2", - "vitest": "^2.1.4" + "vitest": "^2.1.5" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 66a0719f..e20180da 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -373,8 +373,8 @@ importers: specifier: ^4.3.2 version: 4.3.2(typescript@5.6.3)(vite@5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0)) vitest: - specifier: ^2.1.4 - version: 2.1.4(@types/node@20.16.5)(jsdom@25.0.1)(sass@1.79.1)(terser@5.36.0) + specifier: ^2.1.5 + version: 2.1.5(@types/node@20.16.5)(jsdom@25.0.1)(sass@1.79.1)(terser@5.36.0) packages: @@ -2040,11 +2040,11 @@ packages: peerDependencies: vite: ^4.2.0 || ^5.0.0 - '@vitest/expect@2.1.4': - resolution: {integrity: sha512-DOETT0Oh1avie/D/o2sgMHGrzYUFFo3zqESB2Hn70z6QB1HrS2IQ9z5DfyTqU8sg4Bpu13zZe9V4+UTNQlUeQA==} + '@vitest/expect@2.1.5': + resolution: {integrity: sha512-nZSBTW1XIdpZvEJyoP/Sy8fUg0b8od7ZpGDkTUcfJ7wz/VoZAFzFfLyxVxGFhUjJzhYqSbIpfMtl/+k/dpWa3Q==} - '@vitest/mocker@2.1.4': - resolution: {integrity: sha512-Ky/O1Lc0QBbutJdW0rqLeFNbuLEyS+mIPiNdlVlp2/yhJ0SbyYqObS5IHdhferJud8MbbwMnexg4jordE5cCoQ==} + '@vitest/mocker@2.1.5': + resolution: {integrity: sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ==} peerDependencies: msw: ^2.4.9 vite: ^5.0.0 @@ -2054,20 +2054,20 @@ packages: vite: optional: true - '@vitest/pretty-format@2.1.4': - resolution: {integrity: sha512-L95zIAkEuTDbUX1IsjRl+vyBSLh3PwLLgKpghl37aCK9Jvw0iP+wKwIFhfjdUtA2myLgjrG6VU6JCFLv8q/3Ww==} + '@vitest/pretty-format@2.1.5': + resolution: {integrity: sha512-4ZOwtk2bqG5Y6xRGHcveZVr+6txkH7M2e+nPFd6guSoN638v/1XQ0K06eOpi0ptVU/2tW/pIU4IoPotY/GZ9fw==} - '@vitest/runner@2.1.4': - resolution: {integrity: sha512-sKRautINI9XICAMl2bjxQM8VfCMTB0EbsBc/EDFA57V6UQevEKY/TOPOF5nzcvCALltiLfXWbq4MaAwWx/YxIA==} + '@vitest/runner@2.1.5': + resolution: {integrity: sha512-pKHKy3uaUdh7X6p1pxOkgkVAFW7r2I818vHDthYLvUyjRfkKOU6P45PztOch4DZarWQne+VOaIMwA/erSSpB9g==} - '@vitest/snapshot@2.1.4': - resolution: {integrity: sha512-3Kab14fn/5QZRog5BPj6Rs8dc4B+mim27XaKWFWHWA87R56AKjHTGcBFKpvZKDzC4u5Wd0w/qKsUIio3KzWW4Q==} + '@vitest/snapshot@2.1.5': + resolution: {integrity: sha512-zmYw47mhfdfnYbuhkQvkkzYroXUumrwWDGlMjpdUr4jBd3HZiV2w7CQHj+z7AAS4VOtWxI4Zt4bWt4/sKcoIjg==} - '@vitest/spy@2.1.4': - resolution: {integrity: sha512-4JOxa+UAizJgpZfaCPKK2smq9d8mmjZVPMt2kOsg/R8QkoRzydHH1qHxIYNvr1zlEaFj4SXiaaJWxq/LPLKaLg==} + '@vitest/spy@2.1.5': + resolution: {integrity: sha512-aWZF3P0r3w6DiYTVskOYuhBc7EMc3jvn1TkBg8ttylFFRqNN2XGD7V5a4aQdk6QiUzZQ4klNBSpCLJgWNdIiNw==} - '@vitest/utils@2.1.4': - resolution: {integrity: sha512-MXDnZn0Awl2S86PSNIim5PWXgIAx8CIkzu35mBdSApUip6RFOGXBCf3YFyeEu8n1IHk4bWD46DeYFu9mQlFIRg==} + '@vitest/utils@2.1.5': + resolution: {integrity: sha512-yfj6Yrp0Vesw2cwJbP+cl04OC+IHFsuQsrsJBL9pyGeQXE56v1UAOQco+SR55Vf1nQzfV0QJg1Qum7AaWUwwYg==} '@xmldom/xmldom@0.8.10': resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==} @@ -2734,6 +2734,9 @@ packages: resolution: {integrity: sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw==} engines: {node: '>= 0.4'} + es-module-lexer@1.5.4: + resolution: {integrity: sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==} + es-object-atoms@1.0.0: resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} engines: {node: '>= 0.4'} @@ -3074,9 +3077,6 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} - get-func-name@2.0.2: - resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} - get-intrinsic@1.2.4: resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} engines: {node: '>= 0.4'} @@ -3753,9 +3753,6 @@ packages: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true - loupe@3.1.1: - resolution: {integrity: sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==} - loupe@3.1.2: resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==} @@ -4737,8 +4734,8 @@ packages: stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} - std-env@3.7.0: - resolution: {integrity: sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==} + std-env@3.8.0: + resolution: {integrity: sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==} stop-iteration-iterator@1.0.0: resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} @@ -5168,8 +5165,8 @@ packages: vfile@6.0.3: resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} - vite-node@2.1.4: - resolution: {integrity: sha512-kqa9v+oi4HwkG6g8ufRnb5AeplcRw8jUF6/7/Qz1qRQOXHImG8YnLbB+LLszENwFnoBl9xIf9nVdCFzNd7GQEg==} + vite-node@2.1.5: + resolution: {integrity: sha512-rd0QIgx74q4S1Rd56XIiL2cYEdyWn13cunYBIuqh9mpmQr7gGS0IxXoP8R6OaZtNQQLyXSWbd4rXKYUbhFpK5w==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -5212,15 +5209,15 @@ packages: terser: optional: true - vitest@2.1.4: - resolution: {integrity: sha512-eDjxbVAJw1UJJCHr5xr/xM86Zx+YxIEXGAR+bmnEID7z9qWfoxpHw0zdobz+TQAFOLT+nEXz3+gx6nUJ7RgmlQ==} + vitest@2.1.5: + resolution: {integrity: sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/node': ^18.0.0 || >=20.0.0 - '@vitest/browser': 2.1.4 - '@vitest/ui': 2.1.4 + '@vitest/browser': 2.1.5 + '@vitest/ui': 2.1.5 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -7093,43 +7090,43 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitest/expect@2.1.4': + '@vitest/expect@2.1.5': dependencies: - '@vitest/spy': 2.1.4 - '@vitest/utils': 2.1.4 + '@vitest/spy': 2.1.5 + '@vitest/utils': 2.1.5 chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.4(vite@5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0))': + '@vitest/mocker@2.1.5(vite@5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0))': dependencies: - '@vitest/spy': 2.1.4 + '@vitest/spy': 2.1.5 estree-walker: 3.0.3 magic-string: 0.30.12 optionalDependencies: vite: 5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0) - '@vitest/pretty-format@2.1.4': + '@vitest/pretty-format@2.1.5': dependencies: tinyrainbow: 1.2.0 - '@vitest/runner@2.1.4': + '@vitest/runner@2.1.5': dependencies: - '@vitest/utils': 2.1.4 + '@vitest/utils': 2.1.5 pathe: 1.1.2 - '@vitest/snapshot@2.1.4': + '@vitest/snapshot@2.1.5': dependencies: - '@vitest/pretty-format': 2.1.4 + '@vitest/pretty-format': 2.1.5 magic-string: 0.30.12 pathe: 1.1.2 - '@vitest/spy@2.1.4': + '@vitest/spy@2.1.5': dependencies: tinyspy: 3.0.2 - '@vitest/utils@2.1.4': + '@vitest/utils@2.1.5': dependencies: - '@vitest/pretty-format': 2.1.4 + '@vitest/pretty-format': 2.1.5 loupe: 3.1.2 tinyrainbow: 1.2.0 @@ -7479,7 +7476,7 @@ snapshots: assertion-error: 2.0.1 check-error: 2.1.1 deep-eql: 5.0.2 - loupe: 3.1.1 + loupe: 3.1.2 pathval: 2.0.0 chalk@2.4.2: @@ -7920,6 +7917,8 @@ snapshots: iterator.prototype: 1.1.2 safe-array-concat: 1.1.2 + es-module-lexer@1.5.4: {} + es-object-atoms@1.0.0: dependencies: es-errors: 1.3.0 @@ -8356,8 +8355,6 @@ snapshots: get-caller-file@2.0.5: {} - get-func-name@2.0.2: {} - get-intrinsic@1.2.4: dependencies: es-errors: 1.3.0 @@ -9279,10 +9276,6 @@ snapshots: dependencies: js-tokens: 4.0.0 - loupe@3.1.1: - dependencies: - get-func-name: 2.0.2 - loupe@3.1.2: {} lru-cache@10.4.3: {} @@ -10400,7 +10393,7 @@ snapshots: stackback@0.0.2: {} - std-env@3.7.0: {} + std-env@3.8.0: {} stop-iteration-iterator@1.0.0: dependencies: @@ -10873,10 +10866,11 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 - vite-node@2.1.4(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0): + vite-node@2.1.5(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0): dependencies: cac: 6.7.14 debug: 4.3.7 + es-module-lexer: 1.5.4 pathe: 1.1.2 vite: 5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0) transitivePeerDependencies: @@ -10912,27 +10906,27 @@ snapshots: sass: 1.79.1 terser: 5.36.0 - vitest@2.1.4(@types/node@20.16.5)(jsdom@25.0.1)(sass@1.79.1)(terser@5.36.0): + vitest@2.1.5(@types/node@20.16.5)(jsdom@25.0.1)(sass@1.79.1)(terser@5.36.0): dependencies: - '@vitest/expect': 2.1.4 - '@vitest/mocker': 2.1.4(vite@5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0)) - '@vitest/pretty-format': 2.1.4 - '@vitest/runner': 2.1.4 - '@vitest/snapshot': 2.1.4 - '@vitest/spy': 2.1.4 - '@vitest/utils': 2.1.4 + '@vitest/expect': 2.1.5 + '@vitest/mocker': 2.1.5(vite@5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0)) + '@vitest/pretty-format': 2.1.5 + '@vitest/runner': 2.1.5 + '@vitest/snapshot': 2.1.5 + '@vitest/spy': 2.1.5 + '@vitest/utils': 2.1.5 chai: 5.1.2 debug: 4.3.7 expect-type: 1.1.0 magic-string: 0.30.12 pathe: 1.1.2 - std-env: 3.7.0 + std-env: 3.8.0 tinybench: 2.9.0 tinyexec: 0.3.1 tinypool: 1.0.1 tinyrainbow: 1.2.0 vite: 5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0) - vite-node: 2.1.4(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0) + vite-node: 2.1.5(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 20.16.5 From c6be29897b0d3eb80e61c4328fa2b147eae0c77c Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Mon, 18 Nov 2024 16:08:40 +0200 Subject: [PATCH 05/37] Update package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9be1af93..17d259f0 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "sass": "^1.79.1", "tailwindcss": "^3.4.12", "typescript": "5.6.3", - "vitest": "^2.1.5" - "vite-tsconfig-paths": "^5.1.2", + "vitest": "^2.1.5", + "vite-tsconfig-paths": "^5.1.2" } } From b34ce46113dd4395925bf0fe44bbc9b1b0702b7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:10:28 +0000 Subject: [PATCH 06/37] Bump @types/node from 20.16.5 to 22.9.0 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.16.5 to 22.9.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- pnpm-lock.yaml | 191 ++++++++++++++++++++++++++----------------------- 2 files changed, 104 insertions(+), 89 deletions(-) diff --git a/package.json b/package.json index 17d259f0..40022ee8 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "@types/eslint": "^8.56.12", "@types/jest": "^29.5.14", "@types/lodash": "^4.17.13", - "@types/node": "^20.16.5", + "@types/node": "^22.9.0", "@types/papaparse": "^5.3.15", "@types/react": "^18.3.7", "@types/react-dom": "^18.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9b965e63..410f15d6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -82,13 +82,13 @@ importers: version: 0.11.1(typescript@5.6.3)(zod@3.23.8) '@tailwindcss/aspect-ratio': specifier: ^0.4.2 - version: 0.4.2(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3))) + version: 0.4.2(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))) '@tailwindcss/container-queries': specifier: ^0.1.1 - version: 0.1.1(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3))) + version: 0.1.1(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))) '@tailwindcss/forms': specifier: ^0.5.9 - version: 0.5.9(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3))) + version: 0.5.9(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))) '@tanstack/react-table': specifier: ^8.20.5 version: 8.20.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -97,7 +97,7 @@ importers: version: 3.2.24 '@uploadthing/react': specifier: ^7.1.0 - version: 7.1.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(react@18.3.1)(uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)))) + version: 7.1.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(react@18.3.1)(uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)))) '@xmldom/xmldom': specifier: ^0.8.10 version: 0.8.10 @@ -253,10 +253,10 @@ importers: version: 2.5.4 tailwindcss-animate: specifier: ^1.0.7 - version: 1.0.7(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3))) + version: 1.0.7(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))) uploadthing: specifier: ^7.2.0 - version: 7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3))) + version: 7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))) usehooks-ts: specifier: ^2.16.0 version: 2.16.0(react@18.3.1) @@ -278,7 +278,7 @@ importers: version: 5.22.0(prisma@5.22.0) '@tailwindcss/typography': specifier: ^0.5.15 - version: 0.5.15(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3))) + version: 0.5.15(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))) '@total-typescript/ts-reset': specifier: ^0.6.1 version: 0.6.1 @@ -298,8 +298,8 @@ importers: specifier: ^4.17.13 version: 4.17.13 '@types/node': - specifier: ^20.16.5 - version: 20.16.5 + specifier: ^22.9.0 + version: 22.9.0 '@types/papaparse': specifier: ^5.3.15 version: 5.3.15 @@ -326,7 +326,7 @@ importers: version: 6.21.0(eslint@8.57.1)(typescript@5.6.3) '@vitejs/plugin-react': specifier: ^4.3.3 - version: 4.3.3(vite@5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0)) + version: 4.3.3(vite@5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0)) autoprefixer: specifier: ^10.4.20 version: 10.4.20(postcss@8.4.47) @@ -341,13 +341,13 @@ importers: version: 9.1.0(eslint@8.57.1) jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)) + version: 29.7.0(@types/node@22.9.0)(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) jsdom: specifier: ^25.0.1 version: 25.0.1 knip: specifier: ^5.30.2 - version: 5.30.2(@types/node@20.16.5)(typescript@5.6.3) + version: 5.30.2(@types/node@22.9.0)(typescript@5.6.3) postcss: specifier: ^8.4.47 version: 8.4.47 @@ -365,16 +365,16 @@ importers: version: 1.79.1 tailwindcss: specifier: ^3.4.12 - version: 3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)) + version: 3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) typescript: specifier: 5.6.3 version: 5.6.3 vite-tsconfig-paths: specifier: ^5.1.2 - version: 5.1.2(typescript@5.6.3)(vite@5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0)) + version: 5.1.2(typescript@5.6.3)(vite@5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0)) vitest: specifier: ^2.1.5 - version: 2.1.5(@types/node@20.16.5)(jsdom@25.0.1)(sass@1.79.1)(terser@5.36.0) + version: 2.1.5(@types/node@22.9.0)(jsdom@25.0.1)(sass@1.79.1)(terser@5.36.0) packages: @@ -1359,19 +1359,6 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-presence@1.1.0': - resolution: {integrity: sha512-Gq6wuRN/asf9H/E/VzdKoUtT8GC9PQc9z40/vEr0VCJ4u5XvvhWIrSsCB6vD2/cH7ugTdSfYq9fLJCcM00acrQ==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-presence@1.1.1': resolution: {integrity: sha512-IeFXVi4YS1K0wVZzXNrbaaUvIJ3qdY+/Ih4eHFhWA9SwGR9UDX7Ck8abvL57C4cv3wwMvUE0OG69Qc3NCcTe/A==} peerDependencies: @@ -1843,6 +1830,9 @@ packages: '@types/node@20.16.5': resolution: {integrity: sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==} + '@types/node@22.9.0': + resolution: {integrity: sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ==} + '@types/papaparse@5.3.15': resolution: {integrity: sha512-JHe6vF6x/8Z85nCX4yFdDslN11d+1pr12E526X8WAfhadOeaOTx5AuIkvDKIBopfvlzpzkdMx4YyvSKCM9oqtw==} @@ -5817,7 +5807,7 @@ snapshots: jest-util: 29.7.0 slash: 3.0.0 - '@jest/core@29.7.0(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3))': + '@jest/core@29.7.0(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 @@ -5831,7 +5821,7 @@ snapshots: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)) + jest-config: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -6342,16 +6332,6 @@ snapshots: '@types/react': 18.3.7 '@types/react-dom': 18.3.1 - '@radix-ui/react-presence@1.1.0(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.7)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.7)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.7 - '@types/react-dom': 18.3.1 - '@radix-ui/react-presence@1.1.1(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.7)(react@18.3.1) @@ -6659,26 +6639,26 @@ snapshots: optionalDependencies: typescript: 5.6.3 - '@tailwindcss/aspect-ratio@0.4.2(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)))': + '@tailwindcss/aspect-ratio@0.4.2(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)))': dependencies: - tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)) + tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) - '@tailwindcss/container-queries@0.1.1(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)))': + '@tailwindcss/container-queries@0.1.1(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)))': dependencies: - tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)) + tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) - '@tailwindcss/forms@0.5.9(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)))': + '@tailwindcss/forms@0.5.9(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)))': dependencies: mini-svg-data-uri: 1.4.4 - tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)) + tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) - '@tailwindcss/typography@0.5.15(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)))': + '@tailwindcss/typography@0.5.15(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)))': dependencies: lodash.castarray: 4.4.0 lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 postcss-selector-parser: 6.0.10 - tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)) + tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) '@tanstack/react-table@8.20.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: @@ -6794,6 +6774,10 @@ snapshots: dependencies: undici-types: 6.19.8 + '@types/node@22.9.0': + dependencies: + undici-types: 6.19.8 + '@types/papaparse@5.3.15': dependencies: '@types/node': 20.16.5 @@ -6955,12 +6939,12 @@ snapshots: '@uploadthing/mime-types@0.3.1': {} - '@uploadthing/react@7.1.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(react@18.3.1)(uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3))))': + '@uploadthing/react@7.1.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(react@18.3.1)(uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))))': dependencies: '@uploadthing/shared': 7.1.0 file-selector: 0.6.0 react: 18.3.1 - uploadthing: 7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3))) + uploadthing: 7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))) optionalDependencies: next: 14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1) @@ -6970,14 +6954,14 @@ snapshots: effect: 3.10.3 sqids: 0.3.0 - '@vitejs/plugin-react@4.3.3(vite@5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0))': + '@vitejs/plugin-react@4.3.3(vite@5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0))': dependencies: '@babel/core': 7.25.2 '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.25.2) '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.25.2) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 - vite: 5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0) + vite: 5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0) transitivePeerDependencies: - supports-color @@ -6988,13 +6972,13 @@ snapshots: chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.5(vite@5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0))': + '@vitest/mocker@2.1.5(vite@5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0))': dependencies: '@vitest/spy': 2.1.5 estree-walker: 3.0.3 magic-string: 0.30.12 optionalDependencies: - vite: 5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0) + vite: 5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0) '@vitest/pretty-format@2.1.5': dependencies: @@ -7520,13 +7504,13 @@ snapshots: crc-32: 1.2.2 readable-stream: 4.5.2 - create-jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)): + create-jest@29.7.0(@types/node@22.9.0)(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)) + jest-config: 29.7.0(@types/node@22.9.0)(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -8735,16 +8719,16 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)): + jest-cli@29.7.0(@types/node@22.9.0)(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)) + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)) + create-jest: 29.7.0(@types/node@22.9.0)(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) exit: 0.1.2 import-local: 3.2.0 - jest-config: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)) + jest-config: 29.7.0(@types/node@22.9.0)(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -8754,7 +8738,7 @@ snapshots: - supports-color - ts-node - jest-config@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)): + jest-config@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)): dependencies: '@babel/core': 7.25.2 '@jest/test-sequencer': 29.7.0 @@ -8780,7 +8764,38 @@ snapshots: strip-json-comments: 3.1.1 optionalDependencies: '@types/node': 20.16.5 - ts-node: 10.9.2(@types/node@20.16.5)(typescript@5.6.3) + ts-node: 10.9.2(@types/node@22.9.0)(typescript@5.6.3) + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + + jest-config@29.7.0(@types/node@22.9.0)(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)): + dependencies: + '@babel/core': 7.25.2 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.25.2) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0 + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.8 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + optionalDependencies: + '@types/node': 22.9.0 + ts-node: 10.9.2(@types/node@22.9.0)(typescript@5.6.3) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -9000,12 +9015,12 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)): + jest@29.7.0(@types/node@22.9.0)(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)) + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) '@jest/types': 29.6.3 import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)) + jest-cli: 29.7.0(@types/node@22.9.0)(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -9093,11 +9108,11 @@ snapshots: kleur@3.0.3: {} - knip@5.30.2(@types/node@20.16.5)(typescript@5.6.3): + knip@5.30.2(@types/node@22.9.0)(typescript@5.6.3): dependencies: '@nodelib/fs.walk': 1.2.8 '@snyk/github-codeowners': 1.1.0 - '@types/node': 20.16.5 + '@types/node': 22.9.0 easy-table: 1.2.0 enhanced-resolve: 5.17.1 fast-glob: 3.3.2 @@ -9697,13 +9712,13 @@ snapshots: camelcase-css: 2.0.1 postcss: 8.4.47 - postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)): + postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)): dependencies: lilconfig: 3.1.2 yaml: 2.5.1 optionalDependencies: postcss: 8.4.47 - ts-node: 10.9.2(@types/node@20.16.5)(typescript@5.6.3) + ts-node: 10.9.2(@types/node@22.9.0)(typescript@5.6.3) postcss-nested@6.2.0(postcss@8.4.47): dependencies: @@ -10437,11 +10452,11 @@ snapshots: tailwind-merge@2.5.4: {} - tailwindcss-animate@1.0.7(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3))): + tailwindcss-animate@1.0.7(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))): dependencies: - tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)) + tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) - tailwindcss@3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)): + tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -10460,7 +10475,7 @@ snapshots: postcss: 8.4.47 postcss-import: 15.1.0(postcss@8.4.47) postcss-js: 4.0.1(postcss@8.4.47) - postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)) + postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) postcss-nested: 6.2.0(postcss@8.4.47) postcss-selector-parser: 6.1.2 resolve: 1.22.8 @@ -10552,14 +10567,14 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3): + ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.16.5 + '@types/node': 22.9.0 acorn: 8.14.0 acorn-walk: 8.3.4 arg: 4.1.3 @@ -10676,7 +10691,7 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.0 - uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3))): + uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))): dependencies: '@effect/platform': 0.69.8(effect@3.10.3) '@uploadthing/mime-types': 0.3.1 @@ -10684,7 +10699,7 @@ snapshots: effect: 3.10.3 optionalDependencies: next: 14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1) - tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@20.16.5)(typescript@5.6.3)) + tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) uri-js@4.4.1: dependencies: @@ -10746,13 +10761,13 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 - vite-node@2.1.5(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0): + vite-node@2.1.5(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0): dependencies: cac: 6.7.14 debug: 4.3.7 es-module-lexer: 1.5.4 pathe: 1.1.2 - vite: 5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0) + vite: 5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0) transitivePeerDependencies: - '@types/node' - less @@ -10764,32 +10779,32 @@ snapshots: - supports-color - terser - vite-tsconfig-paths@5.1.2(typescript@5.6.3)(vite@5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0)): + vite-tsconfig-paths@5.1.2(typescript@5.6.3)(vite@5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0)): dependencies: debug: 4.3.7 globrex: 0.1.2 tsconfck: 3.1.3(typescript@5.6.3) optionalDependencies: - vite: 5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0) + vite: 5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0) transitivePeerDependencies: - supports-color - typescript - vite@5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0): + vite@5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0): dependencies: esbuild: 0.21.5 postcss: 8.4.47 rollup: 4.24.3 optionalDependencies: - '@types/node': 20.16.5 + '@types/node': 22.9.0 fsevents: 2.3.3 sass: 1.79.1 terser: 5.36.0 - vitest@2.1.5(@types/node@20.16.5)(jsdom@25.0.1)(sass@1.79.1)(terser@5.36.0): + vitest@2.1.5(@types/node@22.9.0)(jsdom@25.0.1)(sass@1.79.1)(terser@5.36.0): dependencies: '@vitest/expect': 2.1.5 - '@vitest/mocker': 2.1.5(vite@5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0)) + '@vitest/mocker': 2.1.5(vite@5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0)) '@vitest/pretty-format': 2.1.5 '@vitest/runner': 2.1.5 '@vitest/snapshot': 2.1.5 @@ -10805,11 +10820,11 @@ snapshots: tinyexec: 0.3.1 tinypool: 1.0.1 tinyrainbow: 1.2.0 - vite: 5.4.6(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0) - vite-node: 2.1.5(@types/node@20.16.5)(sass@1.79.1)(terser@5.36.0) + vite: 5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0) + vite-node: 2.1.5(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 20.16.5 + '@types/node': 22.9.0 jsdom: 25.0.1 transitivePeerDependencies: - less From 23c20493ed97775ec8009b0906f9c3e1b62dccc2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 22:33:31 +0000 Subject: [PATCH 07/37] Bump cross-spawn in the npm_and_yarn group across 1 directory Bumps the npm_and_yarn group with 1 update in the / directory: [cross-spawn](https://github.com/moxystudio/node-cross-spawn). Updates `cross-spawn` from 7.0.3 to 7.0.6 - [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md) - [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6) --- updated-dependencies: - dependency-name: cross-spawn dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] --- pnpm-lock.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 66a0719f..f196d691 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2521,8 +2521,8 @@ packages: create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} - cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} cssesc@3.0.0: @@ -7650,7 +7650,7 @@ snapshots: create-require@1.1.1: optional: true - cross-spawn@7.0.3: + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 @@ -8144,7 +8144,7 @@ snapshots: '@ungap/structured-clone': 1.2.0 ajv: 6.12.6 chalk: 4.1.2 - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 debug: 4.3.7 doctrine: 3.0.0 escape-string-regexp: 4.0.0 @@ -8207,7 +8207,7 @@ snapshots: execa@5.1.1: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 get-stream: 6.0.1 human-signals: 2.1.0 is-stream: 2.0.1 @@ -8313,7 +8313,7 @@ snapshots: foreground-child@3.3.0: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 signal-exit: 4.1.0 form-data@4.0.0: From 02e35fae9cbb93dceb667973b4637426524e663d Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Wed, 20 Nov 2024 14:58:12 +0200 Subject: [PATCH 08/37] make root redirect permanent --- app/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index f889cb61..7a4e2de8 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,5 +1,5 @@ -import { redirect } from 'next/navigation'; +import { permanentRedirect } from 'next/navigation'; export default function Home() { - redirect('/dashboard'); + permanentRedirect('/dashboard'); } From 95552e3325b800898f4364c282d5267ebcd16f44 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:04:55 +0000 Subject: [PATCH 09/37] Bump cross-spawn in the npm_and_yarn group across 1 directory Bumps the npm_and_yarn group with 1 update in the / directory: [cross-spawn](https://github.com/moxystudio/node-cross-spawn). Updates `cross-spawn` from 7.0.3 to 7.0.6 - [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md) - [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6) --- updated-dependencies: - dependency-name: cross-spawn dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] --- pnpm-lock.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 66a0719f..f196d691 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2521,8 +2521,8 @@ packages: create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} - cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} cssesc@3.0.0: @@ -7650,7 +7650,7 @@ snapshots: create-require@1.1.1: optional: true - cross-spawn@7.0.3: + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 @@ -8144,7 +8144,7 @@ snapshots: '@ungap/structured-clone': 1.2.0 ajv: 6.12.6 chalk: 4.1.2 - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 debug: 4.3.7 doctrine: 3.0.0 escape-string-regexp: 4.0.0 @@ -8207,7 +8207,7 @@ snapshots: execa@5.1.1: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 get-stream: 6.0.1 human-signals: 2.1.0 is-stream: 2.0.1 @@ -8313,7 +8313,7 @@ snapshots: foreground-child@3.3.0: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 signal-exit: 4.1.0 form-data@4.0.0: From eacebf6c855e842455693c72d1a025e8f8515728 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 20:46:15 +0000 Subject: [PATCH 10/37] Bump the npm_and_yarn group across 1 directory with 2 updates Bumps the npm_and_yarn group with 2 updates in the / directory: [cross-spawn](https://github.com/moxystudio/node-cross-spawn) and [smol-toml](https://github.com/squirrelchat/smol-toml). Updates `cross-spawn` from 7.0.3 to 7.0.6 - [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md) - [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6) Updates `smol-toml` from 1.3.0 to 1.3.1 - [Release notes](https://github.com/squirrelchat/smol-toml/releases) - [Commits](https://github.com/squirrelchat/smol-toml/commits) --- updated-dependencies: - dependency-name: cross-spawn dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: smol-toml dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] --- pnpm-lock.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 66a0719f..aba76e18 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2521,8 +2521,8 @@ packages: create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} - cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} cssesc@3.0.0: @@ -4703,8 +4703,8 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} - smol-toml@1.3.0: - resolution: {integrity: sha512-tWpi2TsODPScmi48b/OQZGi2lgUmBCHy6SZrhi/FdnnHiU1GwebbCfuQuxsC3nHaLwtYeJGPrDZDIeodDOc4pA==} + smol-toml@1.3.1: + resolution: {integrity: sha512-tEYNll18pPKHroYSmLLrksq233j021G0giwW7P3D24jC54pQ5W5BXMsQ/Mvw1OJCmEYDgY+lrzT+3nNUtoNfXQ==} engines: {node: '>= 18'} source-map-js@1.2.1: @@ -7650,7 +7650,7 @@ snapshots: create-require@1.1.1: optional: true - cross-spawn@7.0.3: + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 @@ -8144,7 +8144,7 @@ snapshots: '@ungap/structured-clone': 1.2.0 ajv: 6.12.6 chalk: 4.1.2 - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 debug: 4.3.7 doctrine: 3.0.0 escape-string-regexp: 4.0.0 @@ -8207,7 +8207,7 @@ snapshots: execa@5.1.1: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 get-stream: 6.0.1 human-signals: 2.1.0 is-stream: 2.0.1 @@ -8313,7 +8313,7 @@ snapshots: foreground-child@3.3.0: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 signal-exit: 4.1.0 form-data@4.0.0: @@ -9219,7 +9219,7 @@ snapshots: picocolors: 1.1.0 picomatch: 4.0.2 pretty-ms: 9.1.0 - smol-toml: 1.3.0 + smol-toml: 1.3.1 strip-json-comments: 5.0.1 summary: 2.1.0 typescript: 5.6.3 @@ -10371,7 +10371,7 @@ snapshots: slash@3.0.0: {} - smol-toml@1.3.0: {} + smol-toml@1.3.1: {} source-map-js@1.2.1: {} From 7a1b864a09f48afde0decb0f9e83f01510fc8717 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:10:39 +0000 Subject: [PATCH 11/37] Bump @types/archiver from 6.0.2 to 6.0.3 Bumps [@types/archiver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/archiver) from 6.0.2 to 6.0.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/archiver) --- updated-dependencies: - dependency-name: "@types/archiver" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- pnpm-lock.yaml | 38 +++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index eb792ec6..91c40309 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "@prisma/client": "^5.22.0", "@tailwindcss/typography": "^0.5.15", "@total-typescript/ts-reset": "^0.6.1", - "@types/archiver": "^6.0.2", + "@types/archiver": "^6.0.3", "@types/d3-interpolate-path": "^2.0.3", "@types/eslint": "^8.56.12", "@types/jest": "^29.5.14", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 98507c25..d677ea0b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -283,8 +283,8 @@ importers: specifier: ^0.6.1 version: 0.6.1 '@types/archiver': - specifier: ^6.0.2 - version: 6.0.2 + specifier: ^6.0.3 + version: 6.0.3 '@types/d3-interpolate-path': specifier: ^2.0.3 version: 2.0.3 @@ -1755,8 +1755,8 @@ packages: '@tsconfig/node16@1.0.4': resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} - '@types/archiver@6.0.2': - resolution: {integrity: sha512-KmROQqbQzKGuaAbmK+ZcytkJ51+YqDa7NmbXjmtC5YBLSyQYo21YaUnQ3HbaPFKL1ooo6RQ6OPYPIDyxfpDDXw==} + '@types/archiver@6.0.3': + resolution: {integrity: sha512-a6wUll6k3zX6qs5KlxIggs1P1JcYJaTCx2gnlr+f0S1yd2DoaEwoIK10HmBaLnZwWneBz+JBm0dwcZu0zECBcQ==} '@types/async@3.2.24': resolution: {integrity: sha512-8iHVLHsCCOBKjCF2KwFe0p9Z3rfM9mL+sSP8btyR5vTjJRAqpBYD28/ZLgXPf0pjG1VxOvtCV/BgXkQbpSe8Hw==} @@ -5801,7 +5801,7 @@ snapshots: '@jest/console@29.7.0': dependencies: '@jest/types': 29.6.3 - '@types/node': 20.16.5 + '@types/node': 22.9.0 chalk: 4.1.2 jest-message-util: 29.7.0 jest-util: 29.7.0 @@ -5846,7 +5846,7 @@ snapshots: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.16.5 + '@types/node': 22.9.0 jest-mock: 29.7.0 '@jest/expect-utils@29.7.0': @@ -5864,7 +5864,7 @@ snapshots: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 20.16.5 + '@types/node': 22.9.0 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -5886,7 +5886,7 @@ snapshots: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.25 - '@types/node': 20.16.5 + '@types/node': 22.9.0 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 @@ -6682,7 +6682,7 @@ snapshots: '@tsconfig/node16@1.0.4': optional: true - '@types/archiver@6.0.2': + '@types/archiver@6.0.3': dependencies: '@types/readdir-glob': 1.1.5 @@ -6728,7 +6728,7 @@ snapshots: '@types/graceful-fs@4.1.9': dependencies: - '@types/node': 20.16.5 + '@types/node': 22.9.0 '@types/hast@3.0.4': dependencies: @@ -6795,7 +6795,7 @@ snapshots: '@types/readdir-glob@1.1.5': dependencies: - '@types/node': 20.16.5 + '@types/node': 22.9.0 '@types/redux-form@8.3.11': dependencies: @@ -8699,7 +8699,7 @@ snapshots: '@jest/expect': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.16.5 + '@types/node': 22.9.0 chalk: 4.1.2 co: 4.6.0 dedent: 1.5.3 @@ -8824,7 +8824,7 @@ snapshots: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.16.5 + '@types/node': 22.9.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -8834,7 +8834,7 @@ snapshots: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.9 - '@types/node': 20.16.5 + '@types/node': 22.9.0 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -8873,7 +8873,7 @@ snapshots: jest-mock@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 20.16.5 + '@types/node': 22.9.0 jest-util: 29.7.0 jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): @@ -8908,7 +8908,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.16.5 + '@types/node': 22.9.0 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -8936,7 +8936,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.16.5 + '@types/node': 22.9.0 chalk: 4.1.2 cjs-module-lexer: 1.4.1 collect-v8-coverage: 1.0.2 @@ -9001,7 +9001,7 @@ snapshots: dependencies: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.16.5 + '@types/node': 22.9.0 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -9010,7 +9010,7 @@ snapshots: jest-worker@29.7.0: dependencies: - '@types/node': 20.16.5 + '@types/node': 22.9.0 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 From 1a99df23715109470fc33b10f3b418229c3834f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:10:55 +0000 Subject: [PATCH 12/37] Bump knip from 5.30.2 to 5.37.2 Bumps [knip](https://github.com/webpro-nl/knip/tree/HEAD/packages/knip) from 5.30.2 to 5.37.2. - [Release notes](https://github.com/webpro-nl/knip/releases) - [Changelog](https://github.com/webpro-nl/knip/blob/main/packages/knip/.release-it.json) - [Commits](https://github.com/webpro-nl/knip/commits/5.37.2/packages/knip) --- updated-dependencies: - dependency-name: knip dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- pnpm-lock.yaml | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index eb792ec6..a1eb1722 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "eslint-config-prettier": "^9.1.0", "jest": "^29.7.0", "jsdom": "^25.0.1", - "knip": "^5.30.2", + "knip": "^5.37.2", "postcss": "^8.4.47", "prettier": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 98507c25..3327bfb2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -346,8 +346,8 @@ importers: specifier: ^25.0.1 version: 25.0.1 knip: - specifier: ^5.30.2 - version: 5.30.2(@types/node@22.9.0)(typescript@5.6.3) + specifier: ^5.37.2 + version: 5.37.2(@types/node@22.9.0)(typescript@5.6.3) postcss: specifier: ^8.4.47 version: 8.4.47 @@ -3555,6 +3555,10 @@ packages: resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} hasBin: true + jiti@2.4.0: + resolution: {integrity: sha512-H5UpaUI+aHOqZXlYOaFP/8AzKsg+guWu+Pr3Y8i7+Y3zr1aXAvCvTAQ1RxSc6oVD8R8c7brgNtTVP91E7upH/g==} + hasBin: true + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -3621,8 +3625,8 @@ packages: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} - knip@5.30.2: - resolution: {integrity: sha512-UuUwuTN+6Aa6mjxufWwidayGX/tPJsxZSlwUo8q4R+Gf/0aNYuhHsUH/GccuKtRPfFnf3r+ZU/7BV0dNfC7OEQ==} + knip@5.37.2: + resolution: {integrity: sha512-Rs9HHTgmUacyKxchP4kRwG8idi0tzVHVpSyo4EM9sNGDSrPq20lhKXOWMFmShGCV6CH2352393Ok/qG1NblCMw==} engines: {node: '>=18.6.0'} hasBin: true peerDependencies: @@ -9029,6 +9033,8 @@ snapshots: jiti@1.21.6: {} + jiti@2.4.0: {} + js-tokens@4.0.0: {} js-yaml@3.14.1: @@ -9108,7 +9114,7 @@ snapshots: kleur@3.0.3: {} - knip@5.30.2(@types/node@22.9.0)(typescript@5.6.3): + knip@5.37.2(@types/node@22.9.0)(typescript@5.6.3): dependencies: '@nodelib/fs.walk': 1.2.8 '@snyk/github-codeowners': 1.1.0 @@ -9116,7 +9122,7 @@ snapshots: easy-table: 1.2.0 enhanced-resolve: 5.17.1 fast-glob: 3.3.2 - jiti: 1.21.6 + jiti: 2.4.0 js-yaml: 4.1.0 minimist: 1.2.8 picocolors: 1.1.0 From e42a11c1830f415de86aa212009a5ed385f8a633 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:11:10 +0000 Subject: [PATCH 13/37] Bump tailwind-merge from 2.5.4 to 2.5.5 Bumps [tailwind-merge](https://github.com/dcastil/tailwind-merge) from 2.5.4 to 2.5.5. - [Release notes](https://github.com/dcastil/tailwind-merge/releases) - [Commits](https://github.com/dcastil/tailwind-merge/compare/v2.5.4...v2.5.5) --- updated-dependencies: - dependency-name: tailwind-merge dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index eb792ec6..a1634625 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "scrollparent": "^2.1.0", "sharp": "^0.33.5", "strip-markdown": "^6.0.0", - "tailwind-merge": "^2.5.4", + "tailwind-merge": "^2.5.5", "tailwindcss-animate": "^1.0.7", "uploadthing": "^7.2.0", "usehooks-ts": "^2.16.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 98507c25..c6813231 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -249,8 +249,8 @@ importers: specifier: ^6.0.0 version: 6.0.0 tailwind-merge: - specifier: ^2.5.4 - version: 2.5.4 + specifier: ^2.5.5 + version: 2.5.5 tailwindcss-animate: specifier: ^1.0.7 version: 1.0.7(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))) @@ -4808,8 +4808,8 @@ packages: resolution: {integrity: sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==} engines: {node: ^14.18.0 || >=16.0.0} - tailwind-merge@2.5.4: - resolution: {integrity: sha512-0q8cfZHMu9nuYP/b5Shb7Y7Sh1B7Nnl5GqNr1U+n2p6+mybvRtayrQ+0042Z5byvTA8ihjlP8Odo8/VnHbZu4Q==} + tailwind-merge@2.5.5: + resolution: {integrity: sha512-0LXunzzAZzo0tEPxV3I297ffKZPlKDrjj7NXphC8V5ak9yHC5zRmxnOe2m/Rd/7ivsOMJe3JZ2JVocoDdQTRBA==} tailwindcss-animate@1.0.7: resolution: {integrity: sha512-bl6mpH3T7I3UFxuvDEXLxy/VuFxBk5bbzplh7tXI68mwMokNYd1t9qPBHlnyTwfa4JGC4zP516I1hYYtQ/vspA==} @@ -10450,7 +10450,7 @@ snapshots: '@pkgr/core': 0.1.1 tslib: 2.8.0 - tailwind-merge@2.5.4: {} + tailwind-merge@2.5.5: {} tailwindcss-animate@1.0.7(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))): dependencies: From 921703ccce1d763f402082b8b7845a2b83c7ca61 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:11:48 +0000 Subject: [PATCH 14/37] Bump prettier-plugin-tailwindcss from 0.6.8 to 0.6.9 Bumps [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) from 0.6.8 to 0.6.9. - [Release notes](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/compare/v0.6.8...v0.6.9) --- updated-dependencies: - dependency-name: prettier-plugin-tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index eb792ec6..fade3cdf 100644 --- a/package.json +++ b/package.json @@ -139,7 +139,7 @@ "knip": "^5.30.2", "postcss": "^8.4.47", "prettier": "^3.3.3", - "prettier-plugin-tailwindcss": "^0.6.8", + "prettier-plugin-tailwindcss": "^0.6.9", "prisma": "^5.22.0", "sass": "^1.79.1", "tailwindcss": "^3.4.12", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 98507c25..e258e3f3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -355,8 +355,8 @@ importers: specifier: ^3.3.3 version: 3.3.3 prettier-plugin-tailwindcss: - specifier: ^0.6.8 - version: 0.6.8(prettier@3.3.3) + specifier: ^0.6.9 + version: 0.6.9(prettier@3.3.3) prisma: specifier: ^5.22.0 version: 5.22.0 @@ -4157,8 +4157,8 @@ packages: resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} engines: {node: '>=6.0.0'} - prettier-plugin-tailwindcss@0.6.8: - resolution: {integrity: sha512-dGu3kdm7SXPkiW4nzeWKCl3uoImdd5CTZEJGxyypEPL37Wj0HT2pLqjrvSei1nTeuQfO4PUfjeW5cTUNRLZ4sA==} + prettier-plugin-tailwindcss@0.6.9: + resolution: {integrity: sha512-r0i3uhaZAXYP0At5xGfJH876W3HHGHDp+LCRUJrs57PBeQ6mYHMwr25KH8NPX44F2yGTvdnH7OqCshlQx183Eg==} engines: {node: '>=14.21.3'} peerDependencies: '@ianvs/prettier-plugin-sort-imports': '*' @@ -9755,7 +9755,7 @@ snapshots: dependencies: fast-diff: 1.3.0 - prettier-plugin-tailwindcss@0.6.8(prettier@3.3.3): + prettier-plugin-tailwindcss@0.6.9(prettier@3.3.3): dependencies: prettier: 3.3.3 From d241d114234315a36a993a45ee6eaf802de13d2f Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Tue, 26 Nov 2024 14:26:05 +0200 Subject: [PATCH 15/37] upgrade to motion from framer-motion --- app/(blobs)/(setup)/setup/Setup.tsx | 2 +- app/dashboard/_components/NavigationBar.tsx | 2 +- .../_components/ProtocolUploader.tsx | 2 +- components/ErrorReportNotifier.tsx | 2 +- components/ProtocolImport/JobCard.tsx | 10 +-- .../components/Canvas/SimulationPanel.js | 7 +- lib/interviewer/components/CloseButton.js | 3 +- .../components/CollapsablePrompts.js | 4 +- lib/interviewer/components/List.js | 12 ++-- lib/interviewer/components/Loading.js | 5 +- lib/interviewer/components/MultiNodeBucket.js | 12 ++-- lib/interviewer/components/NodeList.js | 10 +-- .../containers/Canvas/NodeBucket.js | 12 ++-- lib/interviewer/containers/FormWizard.js | 6 +- .../containers/HyperList/HyperList.js | 12 ++-- .../Interfaces/DyadCensus/DyadCensus.js | 22 +++--- .../containers/Interfaces/DyadCensus/Pair.js | 3 +- .../containers/Interfaces/EgoForm.js | 16 ++--- .../NameGeneratorRoster/DropOverlay.js | 3 +- .../NameGeneratorRoster.js | 72 +++++++++---------- .../Interfaces/TieStrengthCensus/Pair.js | 3 +- .../TieStrengthCensus/TieStrengthCensus.js | 18 ++--- .../Interfaces/utils/StageLevelValidation.js | 10 +-- lib/interviewer/containers/NodeForm.js | 14 ++-- lib/interviewer/containers/Overlay.js | 2 +- lib/interviewer/containers/ProtocolScreen.tsx | 14 ++-- lib/interviewer/containers/QuickNodeForm.js | 11 +-- lib/interviewer/containers/SearchableList.js | 14 ++-- .../containers/SlidesForm/SlidesForm.js | 14 ++-- lib/interviewer/hooks/useViewport.js | 4 +- lib/ui/components/Dialog/Error.js | 2 +- .../Fields/DatePicker/DatePicker.js | 29 ++++---- .../Fields/DatePicker/DatePreview.js | 6 +- lib/ui/components/Fields/DatePicker/Panel.js | 5 +- lib/ui/components/Fields/DatePicker/Panels.js | 3 +- lib/ui/components/HoverMarquee.js | 4 +- lib/ui/components/Modal.js | 2 +- lib/ui/components/Prompts/Pips.js | 3 +- lib/ui/components/Prompts/Prompt.js | 14 ++-- lib/ui/components/Prompts/Prompts.js | 8 +-- lib/ui/components/Transitions/Drop.js | 3 +- package.json | 6 +- pnpm-lock.yaml | 49 +++++++------ 43 files changed, 230 insertions(+), 225 deletions(-) diff --git a/app/(blobs)/(setup)/setup/Setup.tsx b/app/(blobs)/(setup)/setup/Setup.tsx index fa2d6392..1408e078 100644 --- a/app/(blobs)/(setup)/setup/Setup.tsx +++ b/app/(blobs)/(setup)/setup/Setup.tsx @@ -1,6 +1,6 @@ 'use client'; -import { motion } from 'framer-motion'; +import { motion } from 'motion/react'; import { parseAsInteger, useQueryState } from 'nuqs'; import { useEffect } from 'react'; import { containerClasses } from '~/components/ContainerClasses'; diff --git a/app/dashboard/_components/NavigationBar.tsx b/app/dashboard/_components/NavigationBar.tsx index 4e3374a7..7783aa90 100644 --- a/app/dashboard/_components/NavigationBar.tsx +++ b/app/dashboard/_components/NavigationBar.tsx @@ -1,6 +1,6 @@ 'use client'; -import { motion } from 'framer-motion'; +import { motion } from 'motion/react'; import type { Route } from 'next'; import Image from 'next/image'; import Link from 'next/link'; diff --git a/app/dashboard/_components/ProtocolUploader.tsx b/app/dashboard/_components/ProtocolUploader.tsx index 07c4ac8d..66e88c4c 100644 --- a/app/dashboard/_components/ProtocolUploader.tsx +++ b/app/dashboard/_components/ProtocolUploader.tsx @@ -1,7 +1,7 @@ 'use client'; -import { AnimatePresence, motion } from 'framer-motion'; import { FileDown, Loader2 } from 'lucide-react'; +import { AnimatePresence, motion } from 'motion/react'; import { useCallback } from 'react'; import { useDropzone } from 'react-dropzone'; import JobCard from '~/components/ProtocolImport/JobCard'; diff --git a/components/ErrorReportNotifier.tsx b/components/ErrorReportNotifier.tsx index 6c08843a..7b352618 100644 --- a/components/ErrorReportNotifier.tsx +++ b/components/ErrorReportNotifier.tsx @@ -1,5 +1,5 @@ -import { AnimatePresence, motion } from 'framer-motion'; import { CheckIcon, Loader2, XCircle } from 'lucide-react'; +import { AnimatePresence, motion } from 'motion/react'; import { useEffect, useRef, useState } from 'react'; import trackEvent from '~/lib/analytics'; diff --git a/components/ProtocolImport/JobCard.tsx b/components/ProtocolImport/JobCard.tsx index 5876a5fa..e2b306a6 100644 --- a/components/ProtocolImport/JobCard.tsx +++ b/components/ProtocolImport/JobCard.tsx @@ -1,13 +1,13 @@ +import { CheckCircle, Loader2, XCircle } from 'lucide-react'; +import { motion } from 'motion/react'; import { forwardRef, useEffect, useState } from 'react'; -import ErrorDialog from '../ui/ErrorDialog'; -import { CloseButton } from '../ui/CloseButton'; -import { type ImportJob } from './JobReducer'; import { cn } from '~/utils/shadcn'; -import { CheckCircle, Loader2, XCircle } from 'lucide-react'; import { Button } from '../ui/Button'; +import { CloseButton } from '../ui/CloseButton'; +import ErrorDialog from '../ui/ErrorDialog'; import Heading from '../ui/typography/Heading'; import Paragraph from '../ui/typography/Paragraph'; -import { motion } from 'framer-motion'; +import { type ImportJob } from './JobReducer'; type JobCardProps = { job: ImportJob; diff --git a/lib/interviewer/components/Canvas/SimulationPanel.js b/lib/interviewer/components/Canvas/SimulationPanel.js index ecdbc89b..b1fde173 100644 --- a/lib/interviewer/components/Canvas/SimulationPanel.js +++ b/lib/interviewer/components/Canvas/SimulationPanel.js @@ -1,8 +1,7 @@ -import React, { useContext } from 'react'; +import { Pause as PauseIcon, Play as PlayIcon } from 'lucide-react'; +import { motion } from 'motion/react'; import PropTypes from 'prop-types'; -import { motion } from 'framer-motion'; -import { Play as PlayIcon } from 'lucide-react'; -import { Pause as PauseIcon } from 'lucide-react'; +import { useContext } from 'react'; import LayoutContext from '../../contexts/LayoutContext'; const SimulationPanel = ({ dragConstraints }) => { diff --git a/lib/interviewer/components/CloseButton.js b/lib/interviewer/components/CloseButton.js index 22e5f020..04ece15c 100644 --- a/lib/interviewer/components/CloseButton.js +++ b/lib/interviewer/components/CloseButton.js @@ -1,5 +1,4 @@ -import React from 'react'; -import { motion } from 'framer-motion'; +import { motion } from 'motion/react'; import Icon from '~/lib/ui/components/Icon'; const CloseButton = (props) => ( diff --git a/lib/interviewer/components/CollapsablePrompts.js b/lib/interviewer/components/CollapsablePrompts.js index c11f383e..77ce2b3f 100644 --- a/lib/interviewer/components/CollapsablePrompts.js +++ b/lib/interviewer/components/CollapsablePrompts.js @@ -1,6 +1,6 @@ -import { AnimatePresence, motion } from 'framer-motion'; import { Minus } from 'lucide-react'; -import React, { useEffect, useRef, useState } from 'react'; +import { AnimatePresence, motion } from 'motion/react'; +import { useEffect, useRef, useState } from 'react'; import Prompts from './Prompts'; const CollapsablePrompts = (props) => { diff --git a/lib/interviewer/components/List.js b/lib/interviewer/components/List.js index 3a8fada3..8a45de6b 100644 --- a/lib/interviewer/components/List.js +++ b/lib/interviewer/components/List.js @@ -1,12 +1,12 @@ -import React, { useMemo } from 'react'; +import cx from 'classnames'; +import { motion, useReducedMotion } from 'motion/react'; import PropTypes from 'prop-types'; -import { motion, useReducedMotion } from 'framer-motion'; +import React, { useMemo } from 'react'; import { compose } from 'recompose'; -import cx from 'classnames'; import { - DragSource, - DropTarget, - MonitorDropTarget, + DragSource, + DropTarget, + MonitorDropTarget, } from '../behaviours/DragAndDrop'; import useAnimationSettings from '../hooks/useAnimationSettings'; diff --git a/lib/interviewer/components/Loading.js b/lib/interviewer/components/Loading.js index 8f5d40d7..f43c25e3 100644 --- a/lib/interviewer/components/Loading.js +++ b/lib/interviewer/components/Loading.js @@ -1,7 +1,6 @@ -import React from 'react'; -import PropTypes from 'prop-types'; import cx from 'classnames'; -import { motion } from 'framer-motion'; +import { motion } from 'motion/react'; +import PropTypes from 'prop-types'; import { Spinner } from '~/lib/ui/components'; const Loading = ({ message, className, small = false }) => ( diff --git a/lib/interviewer/components/MultiNodeBucket.js b/lib/interviewer/components/MultiNodeBucket.js index 49f8886b..05908121 100644 --- a/lib/interviewer/components/MultiNodeBucket.js +++ b/lib/interviewer/components/MultiNodeBucket.js @@ -1,13 +1,13 @@ -import React, { useEffect, useState } from 'react'; -import PropTypes from 'prop-types'; import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; -import Node from './Node'; -import { NO_SCROLL } from '../behaviours/DragAndDrop/DragManager'; +import { AnimatePresence, motion } from 'motion/react'; +import PropTypes from 'prop-types'; +import { useEffect, useState } from 'react'; import { DragSource } from '../behaviours/DragAndDrop'; +import { NO_SCROLL } from '../behaviours/DragAndDrop/DragManager'; +import useReadyForNextStage from '../hooks/useReadyForNextStage'; import createSorter from '../utils/createSorter'; +import Node from './Node'; import { NodeTransition } from './NodeList'; -import { AnimatePresence, motion } from 'framer-motion'; -import useReadyForNextStage from '../hooks/useReadyForNextStage'; const EnhancedNode = DragSource(Node); diff --git a/lib/interviewer/components/NodeList.js b/lib/interviewer/components/NodeList.js index db7684ee..119699b5 100644 --- a/lib/interviewer/components/NodeList.js +++ b/lib/interviewer/components/NodeList.js @@ -1,17 +1,17 @@ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; import { compose } from '@reduxjs/toolkit'; import cx from 'classnames'; -import { AnimatePresence, motion } from 'framer-motion'; import { find } from 'lodash'; +import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useRef, useState } from 'react'; import { v4 } from 'uuid'; import { getCSSVariableAsString } from '~/lib/ui/utils/CSSVariables'; import { - DragSource, - DropTarget, - MonitorDragSource, - MonitorDropTarget, + DragSource, + DropTarget, + MonitorDragSource, + MonitorDropTarget, } from '../behaviours/DragAndDrop'; import scrollable from '../behaviours/scrollable'; import createSorter from '../utils/createSorter'; diff --git a/lib/interviewer/containers/Canvas/NodeBucket.js b/lib/interviewer/containers/Canvas/NodeBucket.js index a45eb75e..81b1777d 100644 --- a/lib/interviewer/containers/Canvas/NodeBucket.js +++ b/lib/interviewer/containers/Canvas/NodeBucket.js @@ -1,13 +1,13 @@ -import React, { useContext } from 'react'; -import PropTypes from 'prop-types'; +import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; import { isNull, isUndefined } from 'lodash'; +import { AnimatePresence, motion } from 'motion/react'; +import PropTypes from 'prop-types'; +import React, { useContext } from 'react'; import { compose } from 'recompose'; -import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; -import { AnimatePresence, motion } from 'framer-motion'; -import Node from '../../components/Node'; -import LayoutContext from '../../contexts/LayoutContext'; import { DragSource, DropObstacle } from '../../behaviours/DragAndDrop'; import { NO_SCROLL } from '../../behaviours/DragAndDrop/DragManager'; +import Node from '../../components/Node'; +import LayoutContext from '../../contexts/LayoutContext'; import { FIRST_LOAD_UI_ELEMENT_DELAY } from '../Interfaces/utils/constants'; const EnhancedNode = DragSource(Node); diff --git a/lib/interviewer/containers/FormWizard.js b/lib/interviewer/containers/FormWizard.js index 8b3436e6..21ea247a 100644 --- a/lib/interviewer/containers/FormWizard.js +++ b/lib/interviewer/containers/FormWizard.js @@ -1,8 +1,8 @@ -import React, { Component } from 'react'; +import cx from 'classnames'; +import { motion } from 'motion/react'; import PropTypes from 'prop-types'; +import { Component } from 'react'; import Icon from '~/lib/ui/components/Icon'; -import { motion } from 'framer-motion'; -import cx from 'classnames'; import Form from './Form'; const NavigationButton = ({ icon, left, right, onClickHandler }) => { diff --git a/lib/interviewer/containers/HyperList/HyperList.js b/lib/interviewer/containers/HyperList/HyperList.js index 77ecdf11..4bb53d2b 100644 --- a/lib/interviewer/containers/HyperList/HyperList.js +++ b/lib/interviewer/containers/HyperList/HyperList.js @@ -1,16 +1,16 @@ import cx from 'classnames'; -import { AnimatePresence, motion } from 'framer-motion'; +import { AnimatePresence, motion } from 'motion/react'; +import { renderToString } from 'next/dist/compiled/react-dom/cjs/react-dom-server-legacy.browser.production'; import PropTypes from 'prop-types'; -import React, { useContext, useMemo, useCallback } from 'react'; +import React, { useCallback, useContext, useMemo } from 'react'; import AutoSizer from 'react-virtualized-auto-sizer'; import { VariableSizeList as List } from 'react-window'; import { compose } from 'recompose'; import { - DragSource, - DropTarget, - MonitorDropTarget, + DragSource, + DropTarget, + MonitorDropTarget, } from '../../behaviours/DragAndDrop'; -import { renderToString } from 'next/dist/compiled/react-dom/cjs/react-dom-server-legacy.browser.production'; const LargeRosterNotice = () => (
(width < 140 ? 1 : Math.floor(width / 450)); diff --git a/lib/interviewer/containers/Interfaces/TieStrengthCensus/Pair.js b/lib/interviewer/containers/Interfaces/TieStrengthCensus/Pair.js index 8219b112..4114ead6 100644 --- a/lib/interviewer/containers/Interfaces/TieStrengthCensus/Pair.js +++ b/lib/interviewer/containers/Interfaces/TieStrengthCensus/Pair.js @@ -1,6 +1,5 @@ -import React from 'react'; +import { motion } from 'motion/react'; import PropTypes from 'prop-types'; -import { motion } from 'framer-motion'; import Node from '../../../components/Node'; const animationOffset = 200; diff --git a/lib/interviewer/containers/Interfaces/TieStrengthCensus/TieStrengthCensus.js b/lib/interviewer/containers/Interfaces/TieStrengthCensus/TieStrengthCensus.js index 796fcecd..99f93d87 100644 --- a/lib/interviewer/containers/Interfaces/TieStrengthCensus/TieStrengthCensus.js +++ b/lib/interviewer/containers/Interfaces/TieStrengthCensus/TieStrengthCensus.js @@ -1,21 +1,21 @@ -import React, { useState } from 'react'; -import PropTypes from 'prop-types'; import cx from 'classnames'; +import { AnimatePresence, motion } from 'motion/react'; +import PropTypes from 'prop-types'; +import { useState } from 'react'; +import usePropSelector from '~/lib/interviewer/hooks/usePropSelector'; +import { getProtocolCodebook } from '~/lib/interviewer/selectors/protocol'; import BooleanOption from '~/lib/ui/components/Boolean/BooleanOption'; -import { AnimatePresence, motion } from 'framer-motion'; import { Markdown } from '~/lib/ui/components/Fields'; -import Prompts from '../../../components/Prompts'; import { usePrompts } from '../../../behaviours/withPrompt'; +import Prompts from '../../../components/Prompts'; import { getNetworkNodesForType } from '../../../selectors/interface'; import { getEdgeColor, getNetworkEdges as getEdges } from '../../../selectors/network'; -import { getPairs, getNodePair } from './helpers'; -import Pair from './Pair'; import { get } from '../../../utils/lodash-replacements'; -import usePropSelector from '~/lib/interviewer/hooks/usePropSelector'; import useAutoAdvance from '../DyadCensus/useAutoAdvance'; -import useSteps from '../DyadCensus/useSteps'; import useEdgeState from '../DyadCensus/useEdgeState'; -import { getProtocolCodebook } from '~/lib/interviewer/selectors/protocol'; +import useSteps from '../DyadCensus/useSteps'; +import { getNodePair, getPairs } from './helpers'; +import Pair from './Pair'; const fadeVariants = { show: { opacity: 1, transition: { duration: 0.5 } }, diff --git a/lib/interviewer/containers/Interfaces/utils/StageLevelValidation.js b/lib/interviewer/containers/Interfaces/utils/StageLevelValidation.js index ffafb9d5..532c0d8e 100644 --- a/lib/interviewer/containers/Interfaces/utils/StageLevelValidation.js +++ b/lib/interviewer/containers/Interfaces/utils/StageLevelValidation.js @@ -1,10 +1,10 @@ -import React, { useCallback, useEffect, useRef, useState } from 'react'; -import { AnimatePresence, motion } from 'framer-motion'; -import Icon from '~/lib/ui/components/Icon'; -import { v4 as uuid } from 'uuid'; import { defaultTo } from 'lodash'; -import { FIRST_LOAD_UI_ELEMENT_DELAY } from './constants'; +import { AnimatePresence, motion } from 'motion/react'; +import { useCallback, useEffect, useRef, useState } from 'react'; +import { v4 as uuid } from 'uuid'; import useReadyForNextStage from '~/lib/interviewer/hooks/useReadyForNextStage'; +import Icon from '~/lib/ui/components/Icon'; +import { FIRST_LOAD_UI_ELEMENT_DELAY } from './constants'; /** * Simple wrapper to add self-dismissing behaviour to a component diff --git a/lib/interviewer/containers/NodeForm.js b/lib/interviewer/containers/NodeForm.js index 0ac87039..9aa60ffe 100644 --- a/lib/interviewer/containers/NodeForm.js +++ b/lib/interviewer/containers/NodeForm.js @@ -1,17 +1,17 @@ -import React, { useEffect, useState, useMemo, useCallback } from 'react'; +import { + entityAttributesProperty, + entityPrimaryKeyProperty, +} from '@codaco/shared-consts'; +import { AnimatePresence, motion } from 'motion/react'; +import { useCallback, useEffect, useMemo, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { submit } from 'redux-form'; import { ActionButton, Button, Scroller } from '~/lib/ui/components'; -import { motion, AnimatePresence } from 'framer-motion'; -import { - entityPrimaryKeyProperty, - entityAttributesProperty, -} from '@codaco/shared-consts'; import { actionCreators as sessionActions } from '../ducks/modules/session'; -import Overlay from './Overlay'; import Form from './Form'; import FormWizard from './FormWizard'; import { FIRST_LOAD_UI_ELEMENT_DELAY } from './Interfaces/utils/constants'; +import Overlay from './Overlay'; const reduxFormName = 'NODE_FORM'; diff --git a/lib/interviewer/containers/Overlay.js b/lib/interviewer/containers/Overlay.js index 5864ef39..3ea23f38 100644 --- a/lib/interviewer/containers/Overlay.js +++ b/lib/interviewer/containers/Overlay.js @@ -1,6 +1,6 @@ import cx from 'classnames'; -import { motion } from 'framer-motion'; import { ChevronUp as ExpandLessIcon } from 'lucide-react'; +import { motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useEffect, useMemo, useState } from 'react'; import { useSelector } from 'react-redux'; diff --git a/lib/interviewer/containers/ProtocolScreen.tsx b/lib/interviewer/containers/ProtocolScreen.tsx index 44d38bd2..1ffbb333 100644 --- a/lib/interviewer/containers/ProtocolScreen.tsx +++ b/lib/interviewer/containers/ProtocolScreen.tsx @@ -2,10 +2,10 @@ import type { AnyAction } from '@reduxjs/toolkit'; import { - motion, - useAnimate, - type ValueAnimationTransition, -} from 'framer-motion'; + motion, + useAnimate, + type ValueAnimationTransition, +} from 'motion/react'; import { parseAsInteger, useQueryState } from 'nuqs'; import { useCallback, useEffect, useRef, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; @@ -14,9 +14,9 @@ import Navigation from '../components/Navigation'; import { actionCreators as sessionActions } from '../ducks/modules/session'; import useReadyForNextStage from '../hooks/useReadyForNextStage'; import { - getCurrentStage, - getNavigationInfo, - makeGetFakeSessionProgress, + getCurrentStage, + getNavigationInfo, + makeGetFakeSessionProgress, } from '../selectors/session'; import { getNavigableStages } from '../selectors/skip-logic'; import Stage from './Stage'; diff --git a/lib/interviewer/containers/QuickNodeForm.js b/lib/interviewer/containers/QuickNodeForm.js index b2366966..f08bf2d9 100644 --- a/lib/interviewer/containers/QuickNodeForm.js +++ b/lib/interviewer/containers/QuickNodeForm.js @@ -1,11 +1,14 @@ -import React, { - useState, useMemo, useEffect, useRef, +import { AnimatePresence, motion } from 'motion/react'; +import { + useEffect, + useMemo, + useRef, + useState, } from 'react'; -import { motion, AnimatePresence } from 'framer-motion'; import { useDispatch } from 'react-redux'; import { ActionButton, Node } from '~/lib/ui/components'; -import { FIRST_LOAD_UI_ELEMENT_DELAY } from './Interfaces/utils/constants'; import { actionCreators as sessionActions } from '../ducks/modules/session'; +import { FIRST_LOAD_UI_ELEMENT_DELAY } from './Interfaces/utils/constants'; const containerVariants = { animate: (wide) => wide ? ({ diff --git a/lib/interviewer/containers/SearchableList.js b/lib/interviewer/containers/SearchableList.js index 2b4e8bf6..d877eef4 100644 --- a/lib/interviewer/containers/SearchableList.js +++ b/lib/interviewer/containers/SearchableList.js @@ -1,17 +1,17 @@ -import React, { useEffect, useMemo, useRef } from 'react'; +import cx from 'classnames'; +import { get, isEqual } from 'lodash'; +import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; +import { useEffect, useMemo, useRef } from 'react'; import { v4 as uuid } from 'uuid'; -import cx from 'classnames'; -import { AnimatePresence, motion } from 'framer-motion'; -import { isEqual, get } from 'lodash'; -import { getCSSVariableAsNumber } from '~/lib/ui/utils/CSSVariables'; import Search from '~/lib/ui/components/Fields/Search'; +import { getCSSVariableAsNumber } from '~/lib/ui/utils/CSSVariables'; +import useDropMonitor from '../behaviours/DragAndDrop/useDropMonitor'; import Loading from '../components/Loading'; import Panel from '../components/Panel'; -import useSort from '../hooks/useSort'; import useSearch from '../hooks/useSearch'; +import useSort from '../hooks/useSort'; import HyperList from './HyperList'; -import useDropMonitor from '../behaviours/DragAndDrop/useDropMonitor'; import DropOverlay from './Interfaces/NameGeneratorRoster/DropOverlay'; const SortButton = ({ diff --git a/lib/interviewer/containers/SlidesForm/SlidesForm.js b/lib/interviewer/containers/SlidesForm/SlidesForm.js index fa647725..74109a6d 100644 --- a/lib/interviewer/containers/SlidesForm/SlidesForm.js +++ b/lib/interviewer/containers/SlidesForm/SlidesForm.js @@ -1,16 +1,16 @@ -import React, { useState, useEffect, useRef, useCallback } from 'react'; -import { AnimatePresence, motion } from 'framer-motion'; import cx from 'classnames'; -import { v4 as uuid } from 'uuid'; -import PropTypes from 'prop-types'; import { debounce } from 'lodash'; +import { AnimatePresence, motion } from 'motion/react'; +import PropTypes from 'prop-types'; +import { useCallback, useEffect, useRef, useState } from 'react'; +import { flushSync } from 'react-dom'; import { connect, useDispatch } from 'react-redux'; -import ProgressBar from '~/lib/ui/components/ProgressBar'; +import { isDirty, isValid, submit } from 'redux-form'; +import { v4 as uuid } from 'uuid'; import { Markdown } from '~/lib/ui/components/Fields'; -import { submit, isValid, isDirty } from 'redux-form'; +import ProgressBar from '~/lib/ui/components/ProgressBar'; import { actionCreators as dialogActions } from '../../ducks/modules/dialogs'; import useReadyForNextStage from '../../hooks/useReadyForNextStage'; -import { flushSync } from 'react-dom'; const confirmDialog = { type: 'Confirm', diff --git a/lib/interviewer/hooks/useViewport.js b/lib/interviewer/hooks/useViewport.js index b0aef645..a7faee1f 100644 --- a/lib/interviewer/hooks/useViewport.js +++ b/lib/interviewer/hooks/useViewport.js @@ -1,6 +1,6 @@ -import { useCallback } from 'react'; -import { useMotionValue } from 'framer-motion'; import { clamp, max, min } from 'lodash'; +import { useMotionValue } from 'motion/react'; +import { useCallback } from 'react'; import { get } from '../utils/lodash-replacements'; const LAYOUT_SPACE = 1000; diff --git a/lib/ui/components/Dialog/Error.js b/lib/ui/components/Dialog/Error.js index c7aaaaa9..d33b87e9 100644 --- a/lib/ui/components/Dialog/Error.js +++ b/lib/ui/components/Dialog/Error.js @@ -1,4 +1,4 @@ -import { motion } from 'framer-motion'; +import { motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useState } from 'react'; import Button from '../Button'; diff --git a/lib/ui/components/Fields/DatePicker/DatePicker.js b/lib/ui/components/Fields/DatePicker/DatePicker.js index 7fb21f3a..a3ae3666 100644 --- a/lib/ui/components/Fields/DatePicker/DatePicker.js +++ b/lib/ui/components/Fields/DatePicker/DatePicker.js @@ -1,22 +1,25 @@ -import React, { - useState, useCallback, useEffect, useRef, -} from 'react'; -import PropTypes from 'prop-types'; import cx from 'classnames'; -import { motion, AnimatePresence, LayoutGroup } from 'framer-motion'; +import { AnimatePresence, LayoutGroup, motion } from 'motion/react'; +import PropTypes from 'prop-types'; +import { + useCallback, useEffect, useRef, + useState, +} from 'react'; +import useScrollTo from '../../../hooks/useScrollTo'; +import Date from './DatePicker/Date'; import DatePicker from './DatePicker/DatePicker'; -import Years from './DatePicker/Years'; -import Months from './DatePicker/Months'; import Days from './DatePicker/Days'; -import Date from './DatePicker/Date'; -import Panels from './Panels'; -import Panel from './Panel'; -import RangePicker from './RangePicker'; +import Months from './DatePicker/Months'; +import Years from './DatePicker/Years'; import DatePreview from './DatePreview'; import { - now, isEmpty, getFirstDayOfMonth, hasProperties, + getFirstDayOfMonth, hasProperties, + isEmpty, + now, } from './helpers'; -import useScrollTo from '../../../hooks/useScrollTo'; +import Panel from './Panel'; +import Panels from './Panels'; +import RangePicker from './RangePicker'; const DatePickerInput = ({ onChange: onChangeInput, diff --git a/lib/ui/components/Fields/DatePicker/DatePreview.js b/lib/ui/components/Fields/DatePicker/DatePreview.js index 848f69cd..c58ad12b 100644 --- a/lib/ui/components/Fields/DatePicker/DatePreview.js +++ b/lib/ui/components/Fields/DatePicker/DatePreview.js @@ -1,7 +1,7 @@ -import React from 'react'; -import PropTypes from 'prop-types'; import cx from 'classnames'; -import { motion } from 'framer-motion'; +import { motion } from 'motion/react'; +import PropTypes from 'prop-types'; +import React from 'react'; import Date from './DatePicker/Date'; import { getMonthName } from './helpers'; diff --git a/lib/ui/components/Fields/DatePicker/Panel.js b/lib/ui/components/Fields/DatePicker/Panel.js index edf1e19b..36581fce 100644 --- a/lib/ui/components/Fields/DatePicker/Panel.js +++ b/lib/ui/components/Fields/DatePicker/Panel.js @@ -1,7 +1,6 @@ -import React from 'react'; -import PropTypes from 'prop-types'; import cx from 'classnames'; -import { motion } from 'framer-motion'; +import { motion } from 'motion/react'; +import PropTypes from 'prop-types'; const getAnimation = ({ isComplete, isActive }) => { if (isComplete) { diff --git a/lib/ui/components/Fields/DatePicker/Panels.js b/lib/ui/components/Fields/DatePicker/Panels.js index 095fefa1..9feb92f0 100644 --- a/lib/ui/components/Fields/DatePicker/Panels.js +++ b/lib/ui/components/Fields/DatePicker/Panels.js @@ -1,6 +1,5 @@ -import React from 'react'; +import { motion } from 'motion/react'; import PropTypes from 'prop-types'; -import { motion } from 'framer-motion'; const Panels = ({ children }) => ( ( diff --git a/package.json b/package.json index d0b018e0..c7a93c3e 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,6 @@ "csvtojson": "^2.0.10", "d3-interpolate-path": "^2.3.0", "dotenv": "^16.4.5", - "framer-motion": "11.11.11", "fuse.js": "^7.0.0", "jssha": "^3.3.1", "jszip": "^3.10.1", @@ -73,6 +72,7 @@ "lucia": "^2.7.7", "lucide-react": "^0.314.0", "luxon": "^3.5.0", + "motion": "^11.11.17", "next": "^14.2.16", "nuqs": "^1.19.1", "ohash": "^1.1.4", @@ -144,7 +144,7 @@ "sass": "^1.79.1", "tailwindcss": "^3.4.12", "typescript": "5.6.3", - "vitest": "^2.1.5", - "vite-tsconfig-paths": "^5.1.2" + "vite-tsconfig-paths": "^5.1.2", + "vitest": "^2.1.5" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b901c24f..c5b967e6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -137,9 +137,6 @@ importers: dotenv: specifier: ^16.4.5 version: 16.4.5 - framer-motion: - specifier: 11.11.11 - version: 11.11.11(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) fuse.js: specifier: ^7.0.0 version: 7.0.0 @@ -161,6 +158,9 @@ importers: luxon: specifier: ^3.5.0 version: 3.5.0 + motion: + specifier: ^11.11.17 + version: 11.11.17(react-dom@18.3.1(react@18.3.1))(react@18.3.1) next: specifier: ^14.2.16 version: 14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1) @@ -594,12 +594,6 @@ packages: '@emnapi/runtime@1.2.0': resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - '@emotion/is-prop-valid@1.3.1': - resolution: {integrity: sha512-/ACwoqx7XQi9knQs/G0qKvv5teDMhD7bXYns9N/wM8ah8iNb8jZ2uNO0YOgiq2o2poIvVtJS2YALasQuMSQ7Kw==} - - '@emotion/memoize@0.9.0': - resolution: {integrity: sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==} - '@esbuild/aix-ppc64@0.21.5': resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} engines: {node: '>=12'} @@ -2972,8 +2966,8 @@ packages: fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} - framer-motion@11.11.11: - resolution: {integrity: sha512-tuDH23ptJAKUHGydJQII9PhABNJBpB+z0P1bmgKK9QFIssHGlfPd6kxMq00LSKwE27WFsb2z0ovY0bpUyMvfRw==} + framer-motion@11.11.17: + resolution: {integrity: sha512-O8QzvoKiuzI5HSAHbcYuL6xU+ZLXbrH7C8Akaato4JzQbX2ULNeniqC2Vo5eiCtFktX9XsJ+7nUhxcl2E2IjpA==} peerDependencies: '@emotion/is-prop-valid': '*' react: ^18.0.0 @@ -3878,6 +3872,20 @@ packages: mitt@3.0.1: resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} + motion@11.11.17: + resolution: {integrity: sha512-y6mXYElvJ5HHwPBUpYG/5wclKVGW4hJhqPkTjWccib5/WrcRM185adg3+4aSmG5iD10XKFt5uBOAiKwuzMHPPQ==} + peerDependencies: + '@emotion/is-prop-valid': '*' + react: ^18.0.0 + react-dom: ^18.0.0 + peerDependenciesMeta: + '@emotion/is-prop-valid': + optional: true + react: + optional: true + react-dom: + optional: true + ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -5575,14 +5583,6 @@ snapshots: tslib: 2.8.0 optional: true - '@emotion/is-prop-valid@1.3.1': - dependencies: - '@emotion/memoize': 0.9.0 - optional: true - - '@emotion/memoize@0.9.0': - optional: true - '@esbuild/aix-ppc64@0.21.5': optional: true @@ -8202,11 +8202,10 @@ snapshots: fraction.js@4.3.7: {} - framer-motion@11.11.11(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + framer-motion@11.11.17(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: tslib: 2.8.0 optionalDependencies: - '@emotion/is-prop-valid': 1.3.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -9490,6 +9489,14 @@ snapshots: mitt@3.0.1: {} + motion@11.11.17(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + dependencies: + framer-motion: 11.11.17(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + tslib: 2.8.0 + optionalDependencies: + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + ms@2.1.3: {} multipasta@0.2.5: {} From 48f7aa1a8e63e920244e1f69876a85d7b9338a06 Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 28 Nov 2024 09:56:26 +0200 Subject: [PATCH 16/37] run v4 beta migrate cool and fix default border colors --- .../OnboardSteps/Documentation.tsx | 4 +- app/(blobs)/(setup)/_components/Sidebar.tsx | 2 +- app/(blobs)/layout.tsx | 2 +- .../_components/SmallScreenOverlay.tsx | 4 +- app/(interview)/interview/layout.tsx | 2 +- .../_components/ProtocolUploader.tsx | 2 +- .../_components/SummaryStatistics/Icons.tsx | 4 +- .../_components/ExportInterviewsDialog.tsx | 2 +- app/layout.tsx | 2 +- components.json | 2 +- components/Feedback/FeedbackBanner.tsx | 6 +- components/Link.tsx | 2 +- .../data-table/data-table-faceted-filter.tsx | 2 +- components/layout/SettingsSection.tsx | 4 +- components/ui/Button.tsx | 2 +- components/ui/CloseButton.tsx | 2 +- components/ui/Input.tsx | 2 +- components/ui/badge.tsx | 2 +- components/ui/checkbox.tsx | 2 +- components/ui/command.tsx | 4 +- components/ui/dialog.tsx | 2 +- components/ui/dropdown-menu.tsx | 8 +- components/ui/popover.tsx | 2 +- components/ui/select.tsx | 4 +- components/ui/sheet.tsx | 2 +- components/ui/switch.tsx | 2 +- components/ui/toast.tsx | 8 +- components/ui/toaster.tsx | 2 +- components/ui/typography/Paragraph.tsx | 2 +- lib/interviewer/components/Navigation.tsx | 4 +- lib/interviewer/styles/main.scss | 9 +- package.json | 4 +- pnpm-lock.yaml | 613 +++++++++--------- postcss.config.js | 3 +- tailwind.config.ts | 190 ------ 35 files changed, 349 insertions(+), 560 deletions(-) delete mode 100644 tailwind.config.ts diff --git a/app/(blobs)/(setup)/_components/OnboardSteps/Documentation.tsx b/app/(blobs)/(setup)/_components/OnboardSteps/Documentation.tsx index db9021bc..28aabc5d 100644 --- a/app/(blobs)/(setup)/_components/OnboardSteps/Documentation.tsx +++ b/app/(blobs)/(setup)/_components/OnboardSteps/Documentation.tsx @@ -45,7 +45,7 @@ function Documentation() { Visit our documentation site to learn more about Fresco.
-
+
-
+
+
{steps.map((step, index) => (
-
+
{children}
diff --git a/app/(interview)/interview/_components/SmallScreenOverlay.tsx b/app/(interview)/interview/_components/SmallScreenOverlay.tsx index e2b73018..cebf9a53 100644 --- a/app/(interview)/interview/_components/SmallScreenOverlay.tsx +++ b/app/(interview)/interview/_components/SmallScreenOverlay.tsx @@ -9,7 +9,7 @@ const SmallScreenOverlay = () => { } return ( -
+
{ To complete this interview, please use a device with a larger screen, or maximize your browser window. - + Note: it is not possible to complete this interview using a mobile phone. diff --git a/app/(interview)/interview/layout.tsx b/app/(interview)/interview/layout.tsx index c3e6a423..8a806918 100644 --- a/app/(interview)/interview/layout.tsx +++ b/app/(interview)/interview/layout.tsx @@ -8,7 +8,7 @@ export const metadata = { function RootLayout({ children }: { children: React.ReactNode }) { return ( -
+
{children}
diff --git a/app/dashboard/_components/ProtocolUploader.tsx b/app/dashboard/_components/ProtocolUploader.tsx index 66e88c4c..c7feb1ad 100644 --- a/app/dashboard/_components/ProtocolUploader.tsx +++ b/app/dashboard/_components/ProtocolUploader.tsx @@ -58,7 +58,7 @@ function ProtocolUploader({ className={cn( isActive && cn( - 'bg-gradient-to-r from-cyber-grape via-neon-coral to-cyber-grape text-white', + 'bg-linear-to-r from-cyber-grape via-neon-coral to-cyber-grape text-white', 'pointer-events-none animate-background-gradient cursor-wait bg-[length:400%]', ), className, diff --git a/app/dashboard/_components/SummaryStatistics/Icons.tsx b/app/dashboard/_components/SummaryStatistics/Icons.tsx index 5779e748..5a92bfb0 100644 --- a/app/dashboard/_components/SummaryStatistics/Icons.tsx +++ b/app/dashboard/_components/SummaryStatistics/Icons.tsx @@ -1,5 +1,5 @@ export const ProtocolIcon = () => ( -
+
@@ -11,7 +11,7 @@ export const ProtocolIcon = () => ( ); export const InterviewIcon = () => ( -
+
diff --git a/app/dashboard/interviews/_components/ExportInterviewsDialog.tsx b/app/dashboard/interviews/_components/ExportInterviewsDialog.tsx index c3ca66ae..be1f603a 100644 --- a/app/dashboard/interviews/_components/ExportInterviewsDialog.tsx +++ b/app/dashboard/interviews/_components/ExportInterviewsDialog.tsx @@ -29,7 +29,7 @@ import ExportOptionsView from './ExportOptionsView'; const ExportingStateAnimation = () => { return ( -
+
{ aria-hidden="true" >
{ aria-hidden="true" >
{ )}
diff --git a/components/Link.tsx b/components/Link.tsx index 247484a2..de6191f2 100644 --- a/components/Link.tsx +++ b/components/Link.tsx @@ -6,7 +6,7 @@ export default function Link(props: LinkProps) { className="text-link group font-semibold transition-all duration-300 ease-in-out" {...props} > - + {props.children} diff --git a/components/data-table/data-table-faceted-filter.tsx b/components/data-table/data-table-faceted-filter.tsx index a6c473ea..cdff64fa 100644 --- a/components/data-table/data-table-faceted-filter.tsx +++ b/components/data-table/data-table-faceted-filter.tsx @@ -147,7 +147,7 @@ export function DataTableFacetedFilter({ name="filter" placeholder={title} autoFocus - className="focus-visible:ring-ring flex w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50" + className="focus-visible:ring-ring flex w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-2xs transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50" /> No results found. diff --git a/components/layout/SettingsSection.tsx b/components/layout/SettingsSection.tsx index 8b6af605..5a444c09 100644 --- a/components/layout/SettingsSection.tsx +++ b/components/layout/SettingsSection.tsx @@ -32,7 +32,7 @@ export default function SettingsSection({ {children}
{controlArea && ( -
+
{controlArea}
)} @@ -52,7 +52,7 @@ export function SettingsSectionSkeleton({
{controlAreaSkelton && ( -
+
{controlAreaSkelton}
)} diff --git a/components/ui/Button.tsx b/components/ui/Button.tsx index 853e3456..dbe64908 100644 --- a/components/ui/Button.tsx +++ b/components/ui/Button.tsx @@ -5,7 +5,7 @@ import { cn } from '~/utils/shadcn'; import { Skeleton } from './skeleton'; const buttonVariants = cva( - 'inline-flex items-center justify-center rounded-full text-sm font-semibold ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 text-nowrap truncate text-foreground', + 'inline-flex items-center justify-center rounded-full text-sm font-semibold ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 text-nowrap truncate text-foreground', { variants: { variant: { diff --git a/components/ui/CloseButton.tsx b/components/ui/CloseButton.tsx index e5c948f6..d246b945 100644 --- a/components/ui/CloseButton.tsx +++ b/components/ui/CloseButton.tsx @@ -12,7 +12,7 @@ export const CloseButton = ({ type="button" onClick={onClick} className={cn( - 'rounded-sm ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted', + 'rounded-sm ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted', className, )} > diff --git a/components/ui/Input.tsx b/components/ui/Input.tsx index d1666f3b..33d6b7cd 100644 --- a/components/ui/Input.tsx +++ b/components/ui/Input.tsx @@ -48,7 +48,7 @@ const Input = React.forwardRef( id={id} type={type} className={cn( - 'focus-visible:ring-ring flex h-10 w-full rounded-input border border-border bg-input px-3 py-2 text-sm text-input-foreground ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', + 'focus-visible:ring-ring flex h-10 w-full rounded-input border border-border bg-input px-3 py-2 text-sm text-input-foreground ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', !!leftAdornment && 'pl-10', !!rightAdornment && 'pr-10', !!error && 'border-destructive', diff --git a/components/ui/badge.tsx b/components/ui/badge.tsx index 089181d9..f74fc522 100644 --- a/components/ui/badge.tsx +++ b/components/ui/badge.tsx @@ -4,7 +4,7 @@ import { cva, type VariantProps } from 'class-variance-authority'; import { cn } from '~/utils/shadcn'; const badgeVariants = cva( - 'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 flex-shrink-1', + 'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 flex-shrink-1', { variants: { variant: { diff --git a/components/ui/checkbox.tsx b/components/ui/checkbox.tsx index 572fda71..c3ec896e 100644 --- a/components/ui/checkbox.tsx +++ b/components/ui/checkbox.tsx @@ -13,7 +13,7 @@ const Checkbox = React.forwardRef< {children} - + Close diff --git a/components/ui/dropdown-menu.tsx b/components/ui/dropdown-menu.tsx index 397710d6..61d14950 100644 --- a/components/ui/dropdown-menu.tsx +++ b/components/ui/dropdown-menu.tsx @@ -19,7 +19,7 @@ const DropdownMenuSubTrigger = React.forwardRef< {children} - + Close diff --git a/components/ui/switch.tsx b/components/ui/switch.tsx index 7e0a903e..debdb626 100644 --- a/components/ui/switch.tsx +++ b/components/ui/switch.tsx @@ -12,7 +12,7 @@ const Switch = React.forwardRef< >(({ className, ...props }, ref) => ( -
+
{icon}
diff --git a/components/ui/typography/Paragraph.tsx b/components/ui/typography/Paragraph.tsx index 2ce71c65..966f6175 100644 --- a/components/ui/typography/Paragraph.tsx +++ b/components/ui/typography/Paragraph.tsx @@ -16,7 +16,7 @@ export const paragraphVariants = cva('text-pretty font-normal', { smallText: 'text-sm', }, margin: { - default: '[&:not(:first-child)]:mt-4', + default: 'not-first:mt-4', none: 'mt-0', }, }, diff --git a/lib/interviewer/components/Navigation.tsx b/lib/interviewer/components/Navigation.tsx index a0f86659..acb82b52 100644 --- a/lib/interviewer/components/Navigation.tsx +++ b/lib/interviewer/components/Navigation.tsx @@ -52,7 +52,7 @@ const Navigation = ({ return (
-
+
=3.0.0 || >= 3.0.0-alpha.1 || >= 4.0.0-alpha.20' + '@tailwindcss/node@4.0.0-beta.3': + resolution: {integrity: sha512-TPS/a/fsLwPU/p3VeSSKXfuhzKjvmMTJDIp8zVrcBmSk+GNbIrcjkc2p/KcvTSh7Zfw6xF/Z8cjA/JnTgMVjQA==} + + '@tailwindcss/oxide-android-arm64@4.0.0-beta.3': + resolution: {integrity: sha512-YXXoYFvzELo3YRzFIgJrcJCdw1p31xY2ONO1akZwajNjP+Ac8QdvjZejFJc4sLtnL5EXmYSOFv5w3Pa2gRzcAA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [android] + + '@tailwindcss/oxide-darwin-arm64@4.0.0-beta.3': + resolution: {integrity: sha512-ERDVLTEbjFOEnWEYQx8FWgAVl0gPhtoUJ8jXXhTcY4lIGQ/UNWg7amRwFF8jV2qOXUhMh1XppfsxemFMNl/XtQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@tailwindcss/oxide-darwin-x64@4.0.0-beta.3': + resolution: {integrity: sha512-FE5rWGNDNS6q0eSZiuD6M9VmBZgyEep+h4Oq7K6Ei+62sRTD0CRyLNhuot/w/C/IrkZqi2t/spHJa4mM3YKNiQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@tailwindcss/oxide-freebsd-x64@4.0.0-beta.3': + resolution: {integrity: sha512-CLmGpKpmtZpD/+9kvGmtDeY55OiwuePGsOpCrAZQ3PD40uNK2ghwWt+T/BmQJTI5RzsOPbMjzfzKmQthdtWZrg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [freebsd] + + '@tailwindcss/oxide-linux-arm-gnueabihf@4.0.0-beta.3': + resolution: {integrity: sha512-szLw3+50bgAubvoFrynnt6ELbiLd9A/rYpchfA5AnWUakz29IxP7ZYruCkOnYnW9+KRTNv4kFSsRlPJAEJY5sw==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + + '@tailwindcss/oxide-linux-arm64-gnu@4.0.0-beta.3': + resolution: {integrity: sha512-BpsBhwgW1V152GQ7FepJR1zqq17oyl3pVe2UyTCIPv92xCwJQ+eDm2vTvaNF9L6dznBVpppMPPfDfxk4KGvgTg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@tailwindcss/oxide-linux-arm64-musl@4.0.0-beta.3': + resolution: {integrity: sha512-S4+PO+C10cG58sNb9qcjPN0A7q9UUxUFdGjetrNVN/t1JseFNOy1OhPp7oQCiXwCYye7vZzKNAUJK9nIGLAMEg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@tailwindcss/oxide-linux-x64-gnu@4.0.0-beta.3': + resolution: {integrity: sha512-iAGIPAE26xNAbHSaTpu8N2+eG0csOpJ+ukOoKvoQWKArjIfquRw/7XNX1A6pTMvVteFvKPt4e305U7kdf3KtfA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@tailwindcss/oxide-linux-x64-musl@4.0.0-beta.3': + resolution: {integrity: sha512-dKeqjuK94YG+INIYpcfrynq9B5YkrBXEBsX26p1g0K6ai42nzO3Eg/fEadePSqGUBjL1CjtR4pChqaEUPNq1Xw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@tailwindcss/oxide-win32-arm64-msvc@4.0.0-beta.3': + resolution: {integrity: sha512-AEHX9depJFa3GCxmV9s+abklPPo0OmL2uNpPBCumk6N4GLUpmXNpkDlEYeSgggHPRwoSyfvbs957Ahvf5E4v4w==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@tailwindcss/oxide-win32-x64-msvc@4.0.0-beta.3': + resolution: {integrity: sha512-hb24QffsW/9dM+6DgLv5VbTJKGLgfXMjIF47KLCqkhuZRvkQoSPHT6kXJSerEkO3rY3ptCxkPIhyfudACeHMSQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@tailwindcss/oxide@4.0.0-beta.3': + resolution: {integrity: sha512-uN9ZlT8w4LlktqzS3aH2SztfxixzTYGZqEaRQgVuBPkFfTahInX1+GEGNZwmZ/hadR2jkCuCqxg8z1IuhWsSbw==} + engines: {node: '>= 10'} + + '@tailwindcss/postcss@4.0.0-beta.3': + resolution: {integrity: sha512-VpEJYVHtLtJ3MalzxBqO+7eFzned2TcTzMM7ogu0vwcYgIQkaQ9xe+Uo5GDqTjx+MECqYOdiS+X6/EJu+WnOKQ==} + '@tailwindcss/typography@0.5.15': resolution: {integrity: sha512-AqhlCXl+8grUz8uqExv5OTtgpjuVIwFTSXTrh8y9/pw6q2ek7fJ+Y8ZEVw7EB2DCcuCOtEjf9w3+J3rzts01uA==} peerDependencies: @@ -2077,9 +2153,6 @@ packages: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} - any-promise@1.3.0: - resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} - anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} @@ -2095,9 +2168,6 @@ packages: arg@4.1.3: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} - arg@5.0.2: - resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} - argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} @@ -2164,13 +2234,6 @@ packages: resolution: {integrity: sha512-7prDjvt9HmqiZ0cl5CRjtS84sEyhsHP2coDkaZKRKVfCDo9s7iw7ChVmar78Gu9pC4SoR/28wFu/G5JJhTnqEg==} engines: {node: '>=4'} - autoprefixer@10.4.20: - resolution: {integrity: sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==} - engines: {node: ^10 || ^12 || >=14} - hasBin: true - peerDependencies: - postcss: ^8.1.0 - available-typed-arrays@1.0.7: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} @@ -2223,10 +2286,6 @@ packages: base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - binary-extensions@2.3.0: - resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} - engines: {node: '>=8'} - blobs@2.3.0-beta.2: resolution: {integrity: sha512-kzLT5TOg/hsETxeyHae1sNpRWXNHnB1VN467FASoZfLRm4LdoXyp6HTTjes0cPE1sOVoOHEJFT9qyFGOpQFvPw==} @@ -2277,10 +2336,6 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - camelcase-css@2.0.1: - resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==} - engines: {node: '>= 6'} - camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} @@ -2334,10 +2389,6 @@ packages: resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} engines: {node: '>= 16'} - chokidar@3.6.0: - resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} - engines: {node: '>= 8.10.0'} - chokidar@4.0.0: resolution: {integrity: sha512-mxIojEAQcuEvT/lyXq+jf/3cO/KoA6z4CeNDGGevTybECPOMFCnQy3OPahluUkbqgPNGw5Bi78UC7Po6Lhy+NA==} engines: {node: '>= 14.16.0'} @@ -2571,6 +2622,11 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} + detect-libc@1.0.3: + resolution: {integrity: sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==} + engines: {node: '>=0.10'} + hasBin: true + detect-libc@2.0.3: resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} engines: {node: '>=8'} @@ -2585,9 +2641,6 @@ packages: devlop@1.1.0: resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} - didyoumean@1.2.2: - resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} - diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -2600,9 +2653,6 @@ packages: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} - dlv@1.1.3: - resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} - doctrine@2.1.0: resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} engines: {node: '>=0.10.0'} @@ -2963,9 +3013,6 @@ packages: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} - fraction.js@4.3.7: - resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} - framer-motion@11.11.17: resolution: {integrity: sha512-O8QzvoKiuzI5HSAHbcYuL6xU+ZLXbrH7C8Akaato4JzQbX2ULNeniqC2Vo5eiCtFktX9XsJ+7nUhxcl2E2IjpA==} peerDependencies: @@ -3249,10 +3296,6 @@ packages: is-bigint@1.0.4: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} - is-binary-path@2.1.0: - resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} - engines: {node: '>=8'} - is-boolean-object@1.1.2: resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} engines: {node: '>= 0.4'} @@ -3545,10 +3588,6 @@ packages: node-notifier: optional: true - jiti@1.21.6: - resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} - hasBin: true - jiti@2.4.0: resolution: {integrity: sha512-H5UpaUI+aHOqZXlYOaFP/8AzKsg+guWu+Pr3Y8i7+Y3zr1aXAvCvTAQ1RxSc6oVD8R8c7brgNtTVP91E7upH/g==} hasBin: true @@ -3649,13 +3688,69 @@ packages: lie@3.3.0: resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==} - lilconfig@2.1.0: - resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} - engines: {node: '>=10'} + lightningcss-darwin-arm64@1.28.2: + resolution: {integrity: sha512-/8cPSqZiusHSS+WQz0W4NuaqFjquys1x+NsdN/XOHb+idGHJSoJ7SoQTVl3DZuAgtPZwFZgRfb/vd1oi8uX6+g==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] - lilconfig@3.1.2: - resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} - engines: {node: '>=14'} + lightningcss-darwin-x64@1.28.2: + resolution: {integrity: sha512-R7sFrXlgKjvoEG8umpVt/yutjxOL0z8KWf0bfPT3cYMOW4470xu5qSHpFdIOpRWwl3FKNMUdbKtMUjYt0h2j4g==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.28.2: + resolution: {integrity: sha512-l2qrCT+x7crAY+lMIxtgvV10R8VurzHAoUZJaVFSlHrN8kRLTvEg9ObojIDIexqWJQvJcVVV3vfzsEynpiuvgA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.28.2: + resolution: {integrity: sha512-DKMzpICBEKnL53X14rF7hFDu8KKALUJtcKdFUCW5YOlGSiwRSgVoRjM97wUm/E0NMPkzrTi/rxfvt7ruNK8meg==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.28.2: + resolution: {integrity: sha512-nhfjYkfymWZSxdtTNMWyhFk2ImUm0X7NAgJWFwnsYPOfmtWQEapzG/DXZTfEfMjSzERNUNJoQjPAbdqgB+sjiw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + + lightningcss-linux-arm64-musl@1.28.2: + resolution: {integrity: sha512-1SPG1ZTNnphWvAv8RVOymlZ8BDtAg69Hbo7n4QxARvkFVCJAt0cgjAw1Fox0WEhf4PwnyoOBaVH0Z5YNgzt4dA==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + + lightningcss-linux-x64-gnu@1.28.2: + resolution: {integrity: sha512-ZhQy0FcO//INWUdo/iEdbefntTdpPVQ0XJwwtdbBuMQe+uxqZoytm9M+iqR9O5noWFaxK+nbS2iR/I80Q2Ofpg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + + lightningcss-linux-x64-musl@1.28.2: + resolution: {integrity: sha512-alb/j1NMrgQmSFyzTbN1/pvMPM+gdDw7YBuQ5VSgcFDypN3Ah0BzC2dTZbzwzaMdUVDszX6zH5MzjfVN1oGuww==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + + lightningcss-win32-arm64-msvc@1.28.2: + resolution: {integrity: sha512-WnwcjcBeAt0jGdjlgbT9ANf30pF0C/QMb1XnLnH272DQU8QXh+kmpi24R55wmWBwaTtNAETZ+m35ohyeMiNt+g==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.28.2: + resolution: {integrity: sha512-3piBifyT3avz22o6mDKywQC/OisH2yDK+caHWkiMsF82i3m5wDBadyCjlCQ5VNgzYkxrWZgiaxHDdd5uxsi0/A==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.28.2: + resolution: {integrity: sha512-ePLRrbt3fgjXI5VFZOLbvkLD5ZRuxGKm+wJ3ujCqBtL3NanDHPo/5zicR5uEKAPiIjBYF99BM4K4okvMznjkVA==} + engines: {node: '>= 12.0.0'} lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} @@ -3892,9 +3987,6 @@ packages: multipasta@0.2.5: resolution: {integrity: sha512-c8eMDb1WwZcE02WVjHoOmUVk7fnKU/RmUcosHACglrWAuPQsEJv+E8430sXj6jNc1jHw0zrS16aCjQh4BcEb4A==} - mz@2.7.0: - resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} - nanoid@3.3.7: resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -3931,10 +4023,6 @@ packages: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} - normalize-range@0.1.2: - resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} - engines: {node: '>=0.10.0'} - npm-run-path@4.0.1: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} @@ -3951,10 +4039,6 @@ packages: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} - object-hash@3.0.0: - resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} - engines: {node: '>= 6'} - object-inspect@1.13.2: resolution: {integrity: sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==} engines: {node: '>= 0.4'} @@ -4093,10 +4177,6 @@ packages: resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} engines: {node: '>=12'} - pify@2.3.0: - resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} - engines: {node: '>=0.10.0'} - pirates@4.0.6: resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} engines: {node: '>= 6'} @@ -4112,47 +4192,10 @@ packages: resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} engines: {node: '>= 0.4'} - postcss-import@15.1.0: - resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} - engines: {node: '>=14.0.0'} - peerDependencies: - postcss: ^8.0.0 - - postcss-js@4.0.1: - resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==} - engines: {node: ^12 || ^14 || >= 16} - peerDependencies: - postcss: ^8.4.21 - - postcss-load-config@4.0.2: - resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==} - engines: {node: '>= 14'} - peerDependencies: - postcss: '>=8.0.9' - ts-node: '>=9.0.0' - peerDependenciesMeta: - postcss: - optional: true - ts-node: - optional: true - - postcss-nested@6.2.0: - resolution: {integrity: sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==} - engines: {node: '>=12.0'} - peerDependencies: - postcss: ^8.2.14 - postcss-selector-parser@6.0.10: resolution: {integrity: sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==} engines: {node: '>=4'} - postcss-selector-parser@6.1.2: - resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==} - engines: {node: '>=4'} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - postcss@8.4.31: resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} engines: {node: ^10 || ^12 || >=14} @@ -4410,9 +4453,6 @@ packages: resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} engines: {node: '>=0.10.0'} - read-cache@1.0.0: - resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==} - readable-stream@2.3.8: resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} @@ -4423,10 +4463,6 @@ packages: readdir-glob@1.1.3: resolution: {integrity: sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==} - readdirp@3.6.0: - resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} - engines: {node: '>=8.10.0'} - readdirp@4.0.1: resolution: {integrity: sha512-GkMg9uOTpIWWKbSsgwb5fA4EavTR+SG/PMPoAY8hkhHfEEY0/vqljY+XHqtDf2cr2IJtoNRDbrrEpZUiZCkYRw==} engines: {node: '>= 14.16.0'} @@ -4785,11 +4821,6 @@ packages: babel-plugin-macros: optional: true - sucrase@3.35.0: - resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} - engines: {node: '>=16 || 14 >=14.17'} - hasBin: true - summary@2.1.0: resolution: {integrity: sha512-nMIjMrd5Z2nuB2RZCKJfFMjgS3fygbeyGk9PxPPaJR1RIcyN9yn4A63Isovzm3ZtQuEkLBVgMdPup8UeLH7aQw==} @@ -4828,10 +4859,8 @@ packages: peerDependencies: tailwindcss: '>=3.0.0 || insiders' - tailwindcss@3.4.12: - resolution: {integrity: sha512-Htf/gHj2+soPb9UayUNci/Ja3d8pTmu9ONTfh4QY8r3MATTZOzmv6UYWF7ZwikEIC8okpfqmGqrmDehua8mF8w==} - engines: {node: '>=14.0.0'} - hasBin: true + tailwindcss@4.0.0-beta.3: + resolution: {integrity: sha512-Cem7SF6OYcijYA1ZOGmuZHxk704iOxsRboFCXIpSJSR0XFft/NNz93Yoo0kHZIGNlqZmnQItI7JUSdR++Y9hZQ==} tapable@2.2.1: resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} @@ -4855,13 +4884,6 @@ packages: text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - thenify-all@1.6.0: - resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} - engines: {node: '>=0.8'} - - thenify@3.3.1: - resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} - tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} @@ -4924,9 +4946,6 @@ packages: peerDependencies: typescript: '>=4.2.0' - ts-interface-checker@0.1.13: - resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - ts-node@10.9.2: resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true @@ -5280,11 +5299,6 @@ packages: yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} - yaml@2.5.1: - resolution: {integrity: sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==} - engines: {node: '>= 14'} - hasBin: true - yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} @@ -6643,26 +6657,88 @@ snapshots: optionalDependencies: typescript: 5.6.3 - '@tailwindcss/aspect-ratio@0.4.2(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)))': + '@tailwindcss/aspect-ratio@0.4.2(tailwindcss@4.0.0-beta.3)': dependencies: - tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) + tailwindcss: 4.0.0-beta.3 - '@tailwindcss/container-queries@0.1.1(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)))': + '@tailwindcss/container-queries@0.1.1(tailwindcss@4.0.0-beta.3)': dependencies: - tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) + tailwindcss: 4.0.0-beta.3 - '@tailwindcss/forms@0.5.9(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)))': + '@tailwindcss/forms@0.5.9(tailwindcss@4.0.0-beta.3)': dependencies: mini-svg-data-uri: 1.4.4 - tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) + tailwindcss: 4.0.0-beta.3 + + '@tailwindcss/node@4.0.0-beta.3': + dependencies: + enhanced-resolve: 5.17.1 + jiti: 2.4.0 + tailwindcss: 4.0.0-beta.3 + + '@tailwindcss/oxide-android-arm64@4.0.0-beta.3': + optional: true + + '@tailwindcss/oxide-darwin-arm64@4.0.0-beta.3': + optional: true + + '@tailwindcss/oxide-darwin-x64@4.0.0-beta.3': + optional: true - '@tailwindcss/typography@0.5.15(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)))': + '@tailwindcss/oxide-freebsd-x64@4.0.0-beta.3': + optional: true + + '@tailwindcss/oxide-linux-arm-gnueabihf@4.0.0-beta.3': + optional: true + + '@tailwindcss/oxide-linux-arm64-gnu@4.0.0-beta.3': + optional: true + + '@tailwindcss/oxide-linux-arm64-musl@4.0.0-beta.3': + optional: true + + '@tailwindcss/oxide-linux-x64-gnu@4.0.0-beta.3': + optional: true + + '@tailwindcss/oxide-linux-x64-musl@4.0.0-beta.3': + optional: true + + '@tailwindcss/oxide-win32-arm64-msvc@4.0.0-beta.3': + optional: true + + '@tailwindcss/oxide-win32-x64-msvc@4.0.0-beta.3': + optional: true + + '@tailwindcss/oxide@4.0.0-beta.3': + optionalDependencies: + '@tailwindcss/oxide-android-arm64': 4.0.0-beta.3 + '@tailwindcss/oxide-darwin-arm64': 4.0.0-beta.3 + '@tailwindcss/oxide-darwin-x64': 4.0.0-beta.3 + '@tailwindcss/oxide-freebsd-x64': 4.0.0-beta.3 + '@tailwindcss/oxide-linux-arm-gnueabihf': 4.0.0-beta.3 + '@tailwindcss/oxide-linux-arm64-gnu': 4.0.0-beta.3 + '@tailwindcss/oxide-linux-arm64-musl': 4.0.0-beta.3 + '@tailwindcss/oxide-linux-x64-gnu': 4.0.0-beta.3 + '@tailwindcss/oxide-linux-x64-musl': 4.0.0-beta.3 + '@tailwindcss/oxide-win32-arm64-msvc': 4.0.0-beta.3 + '@tailwindcss/oxide-win32-x64-msvc': 4.0.0-beta.3 + + '@tailwindcss/postcss@4.0.0-beta.3': + dependencies: + '@alloc/quick-lru': 5.2.0 + '@tailwindcss/node': 4.0.0-beta.3 + '@tailwindcss/oxide': 4.0.0-beta.3 + lightningcss: 1.28.2 + postcss: 8.4.47 + tailwindcss: 4.0.0-beta.3 + + '@tailwindcss/typography@0.5.15(tailwindcss@4.0.0-beta.3)': dependencies: lodash.castarray: 4.4.0 lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 postcss-selector-parser: 6.0.10 - tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) + tailwindcss: 4.0.0-beta.3 '@tanstack/react-table@8.20.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: @@ -6943,12 +7019,12 @@ snapshots: '@uploadthing/mime-types@0.3.1': {} - '@uploadthing/react@7.1.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(react@18.3.1)(uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))))': + '@uploadthing/react@7.1.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(react@18.3.1)(uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@4.0.0-beta.3))': dependencies: '@uploadthing/shared': 7.1.0 file-selector: 0.6.0 react: 18.3.1 - uploadthing: 7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))) + uploadthing: 7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@4.0.0-beta.3) optionalDependencies: next: 14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1) @@ -6958,14 +7034,14 @@ snapshots: effect: 3.10.3 sqids: 0.3.0 - '@vitejs/plugin-react@4.3.3(vite@5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0))': + '@vitejs/plugin-react@4.3.3(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0))': dependencies: '@babel/core': 7.25.2 '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.25.2) '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.25.2) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 - vite: 5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0) + vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) transitivePeerDependencies: - supports-color @@ -6976,13 +7052,13 @@ snapshots: chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.5(vite@5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0))': + '@vitest/mocker@2.1.5(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0))': dependencies: '@vitest/spy': 2.1.5 estree-walker: 3.0.3 magic-string: 0.30.12 optionalDependencies: - vite: 5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0) + vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) '@vitest/pretty-format@2.1.5': dependencies: @@ -7076,8 +7152,6 @@ snapshots: ansi-styles@6.2.1: {} - any-promise@1.3.0: {} - anymatch@3.1.3: dependencies: normalize-path: 3.0.0 @@ -7106,8 +7180,6 @@ snapshots: arg@4.1.3: optional: true - arg@5.0.2: {} - argparse@1.0.10: dependencies: sprintf-js: 1.0.3 @@ -7199,16 +7271,6 @@ snapshots: attr-accept@2.2.2: {} - autoprefixer@10.4.20(postcss@8.4.47): - dependencies: - browserslist: 4.23.3 - caniuse-lite: 1.0.30001660 - fraction.js: 4.3.7 - normalize-range: 0.1.2 - picocolors: 1.1.0 - postcss: 8.4.47 - postcss-value-parser: 4.2.0 - available-typed-arrays@1.0.7: dependencies: possible-typed-array-names: 1.0.0 @@ -7283,8 +7345,6 @@ snapshots: base64-js@1.5.1: {} - binary-extensions@2.3.0: {} - blobs@2.3.0-beta.2: dependencies: simplex-noise: 4.0.3 @@ -7340,8 +7400,6 @@ snapshots: callsites@3.1.0: {} - camelcase-css@2.0.1: {} - camelcase@5.3.1: {} camelcase@6.3.0: {} @@ -7385,18 +7443,6 @@ snapshots: check-error@2.1.1: {} - chokidar@3.6.0: - dependencies: - anymatch: 3.1.3 - braces: 3.0.3 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.3 - chokidar@4.0.0: dependencies: readdirp: 4.0.1 @@ -7643,6 +7689,8 @@ snapshots: dequal@2.0.3: {} + detect-libc@1.0.3: {} + detect-libc@2.0.3: {} detect-newline@3.1.0: {} @@ -7653,8 +7701,6 @@ snapshots: dependencies: dequal: 2.0.3 - didyoumean@1.2.2: {} - diff-sequences@29.6.3: {} diff@4.0.2: @@ -7664,8 +7710,6 @@ snapshots: dependencies: path-type: 4.0.0 - dlv@1.1.3: {} - doctrine@2.1.0: dependencies: esutils: 2.0.3 @@ -8200,8 +8244,6 @@ snapshots: combined-stream: 1.0.8 mime-types: 2.1.35 - fraction.js@4.3.7: {} - framer-motion@11.11.17(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: tslib: 2.8.0 @@ -8524,10 +8566,6 @@ snapshots: dependencies: has-bigints: 1.0.2 - is-binary-path@2.1.0: - dependencies: - binary-extensions: 2.3.0 - is-boolean-object@1.1.2: dependencies: call-bind: 1.0.7 @@ -9030,8 +9068,6 @@ snapshots: - supports-color - ts-node - jiti@1.21.6: {} - jiti@2.4.0: {} js-tokens@4.0.0: {} @@ -9155,9 +9191,50 @@ snapshots: dependencies: immediate: 3.0.6 - lilconfig@2.1.0: {} + lightningcss-darwin-arm64@1.28.2: + optional: true + + lightningcss-darwin-x64@1.28.2: + optional: true + + lightningcss-freebsd-x64@1.28.2: + optional: true + + lightningcss-linux-arm-gnueabihf@1.28.2: + optional: true + + lightningcss-linux-arm64-gnu@1.28.2: + optional: true + + lightningcss-linux-arm64-musl@1.28.2: + optional: true + + lightningcss-linux-x64-gnu@1.28.2: + optional: true + + lightningcss-linux-x64-musl@1.28.2: + optional: true - lilconfig@3.1.2: {} + lightningcss-win32-arm64-msvc@1.28.2: + optional: true + + lightningcss-win32-x64-msvc@1.28.2: + optional: true + + lightningcss@1.28.2: + dependencies: + detect-libc: 1.0.3 + optionalDependencies: + lightningcss-darwin-arm64: 1.28.2 + lightningcss-darwin-x64: 1.28.2 + lightningcss-freebsd-x64: 1.28.2 + lightningcss-linux-arm-gnueabihf: 1.28.2 + lightningcss-linux-arm64-gnu: 1.28.2 + lightningcss-linux-arm64-musl: 1.28.2 + lightningcss-linux-x64-gnu: 1.28.2 + lightningcss-linux-x64-musl: 1.28.2 + lightningcss-win32-arm64-msvc: 1.28.2 + lightningcss-win32-x64-msvc: 1.28.2 lines-and-columns@1.2.4: {} @@ -9501,12 +9578,6 @@ snapshots: multipasta@0.2.5: {} - mz@2.7.0: - dependencies: - any-promise: 1.3.0 - object-assign: 4.1.1 - thenify-all: 1.6.0 - nanoid@3.3.7: {} natural-compare@1.4.0: {} @@ -9543,8 +9614,6 @@ snapshots: normalize-path@3.0.0: {} - normalize-range@0.1.2: {} - npm-run-path@4.0.1: dependencies: path-key: 3.1.1 @@ -9558,8 +9627,6 @@ snapshots: object-assign@4.1.1: {} - object-hash@3.0.0: {} - object-inspect@1.13.2: {} object-is@1.1.6: @@ -9701,8 +9768,6 @@ snapshots: picomatch@4.0.2: {} - pify@2.3.0: {} - pirates@4.0.6: {} pkg-dir@4.2.0: @@ -9713,43 +9778,11 @@ snapshots: possible-typed-array-names@1.0.0: {} - postcss-import@15.1.0(postcss@8.4.47): - dependencies: - postcss: 8.4.47 - postcss-value-parser: 4.2.0 - read-cache: 1.0.0 - resolve: 1.22.8 - - postcss-js@4.0.1(postcss@8.4.47): - dependencies: - camelcase-css: 2.0.1 - postcss: 8.4.47 - - postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)): - dependencies: - lilconfig: 3.1.2 - yaml: 2.5.1 - optionalDependencies: - postcss: 8.4.47 - ts-node: 10.9.2(@types/node@22.9.0)(typescript@5.6.3) - - postcss-nested@6.2.0(postcss@8.4.47): - dependencies: - postcss: 8.4.47 - postcss-selector-parser: 6.1.2 - postcss-selector-parser@6.0.10: dependencies: cssesc: 3.0.0 util-deprecate: 1.0.2 - postcss-selector-parser@6.1.2: - dependencies: - cssesc: 3.0.0 - util-deprecate: 1.0.2 - - postcss-value-parser@4.2.0: {} - postcss@8.4.31: dependencies: nanoid: 3.3.7 @@ -9958,10 +9991,6 @@ snapshots: dependencies: loose-envify: 1.4.0 - read-cache@1.0.0: - dependencies: - pify: 2.3.0 - readable-stream@2.3.8: dependencies: core-util-is: 1.0.3 @@ -9984,10 +10013,6 @@ snapshots: dependencies: minimatch: 5.1.6 - readdirp@3.6.0: - dependencies: - picomatch: 2.3.1 - readdirp@4.0.1: {} redux-form@8.3.10(immutable@4.3.7)(react-redux@8.1.3(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(redux@4.2.1))(react@18.3.1)(redux@4.2.1): @@ -10428,16 +10453,6 @@ snapshots: optionalDependencies: '@babel/core': 7.25.2 - sucrase@3.35.0: - dependencies: - '@jridgewell/gen-mapping': 0.3.5 - commander: 4.1.1 - glob: 10.4.5 - lines-and-columns: 1.2.4 - mz: 2.7.0 - pirates: 4.0.6 - ts-interface-checker: 0.1.13 - summary@2.1.0: {} supports-color@5.5.0: @@ -10465,36 +10480,11 @@ snapshots: tailwind-merge@2.5.5: {} - tailwindcss-animate@1.0.7(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))): + tailwindcss-animate@1.0.7(tailwindcss@4.0.0-beta.3): dependencies: - tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) + tailwindcss: 4.0.0-beta.3 - tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)): - dependencies: - '@alloc/quick-lru': 5.2.0 - arg: 5.0.2 - chokidar: 3.6.0 - didyoumean: 1.2.2 - dlv: 1.1.3 - fast-glob: 3.3.2 - glob-parent: 6.0.2 - is-glob: 4.0.3 - jiti: 1.21.6 - lilconfig: 2.1.0 - micromatch: 4.0.8 - normalize-path: 3.0.0 - object-hash: 3.0.0 - picocolors: 1.1.0 - postcss: 8.4.47 - postcss-import: 15.1.0(postcss@8.4.47) - postcss-js: 4.0.1(postcss@8.4.47) - postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) - postcss-nested: 6.2.0(postcss@8.4.47) - postcss-selector-parser: 6.1.2 - resolve: 1.22.8 - sucrase: 3.35.0 - transitivePeerDependencies: - - ts-node + tailwindcss@4.0.0-beta.3: {} tapable@2.2.1: {} @@ -10524,14 +10514,6 @@ snapshots: text-table@0.2.0: {} - thenify-all@1.6.0: - dependencies: - thenify: 3.3.1 - - thenify@3.3.1: - dependencies: - any-promise: 1.3.0 - tinybench@2.9.0: {} tinyexec@0.3.1: {} @@ -10578,8 +10560,6 @@ snapshots: dependencies: typescript: 5.6.3 - ts-interface-checker@0.1.13: {} - ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3): dependencies: '@cspotcode/source-map-support': 0.8.1 @@ -10704,7 +10684,7 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.0 - uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3))): + uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@4.0.0-beta.3): dependencies: '@effect/platform': 0.69.8(effect@3.10.3) '@uploadthing/mime-types': 0.3.1 @@ -10712,7 +10692,7 @@ snapshots: effect: 3.10.3 optionalDependencies: next: 14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1) - tailwindcss: 3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)) + tailwindcss: 4.0.0-beta.3 uri-js@4.4.1: dependencies: @@ -10774,13 +10754,13 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 - vite-node@2.1.5(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0): + vite-node@2.1.5(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0): dependencies: cac: 6.7.14 debug: 4.3.7 es-module-lexer: 1.5.4 pathe: 1.1.2 - vite: 5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0) + vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) transitivePeerDependencies: - '@types/node' - less @@ -10792,18 +10772,18 @@ snapshots: - supports-color - terser - vite-tsconfig-paths@5.1.2(typescript@5.6.3)(vite@5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0)): + vite-tsconfig-paths@5.1.2(typescript@5.6.3)(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0)): dependencies: debug: 4.3.7 globrex: 0.1.2 tsconfck: 3.1.3(typescript@5.6.3) optionalDependencies: - vite: 5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0) + vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) transitivePeerDependencies: - supports-color - typescript - vite@5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0): + vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0): dependencies: esbuild: 0.21.5 postcss: 8.4.47 @@ -10811,13 +10791,14 @@ snapshots: optionalDependencies: '@types/node': 22.9.0 fsevents: 2.3.3 + lightningcss: 1.28.2 sass: 1.79.1 terser: 5.36.0 - vitest@2.1.5(@types/node@22.9.0)(jsdom@25.0.1)(sass@1.79.1)(terser@5.36.0): + vitest@2.1.5(@types/node@22.9.0)(jsdom@25.0.1)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0): dependencies: '@vitest/expect': 2.1.5 - '@vitest/mocker': 2.1.5(vite@5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0)) + '@vitest/mocker': 2.1.5(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0)) '@vitest/pretty-format': 2.1.5 '@vitest/runner': 2.1.5 '@vitest/snapshot': 2.1.5 @@ -10833,8 +10814,8 @@ snapshots: tinyexec: 0.3.1 tinypool: 1.0.1 tinyrainbow: 1.2.0 - vite: 5.4.6(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0) - vite-node: 2.1.5(@types/node@22.9.0)(sass@1.79.1)(terser@5.36.0) + vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) + vite-node: 2.1.5(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.9.0 @@ -10960,8 +10941,6 @@ snapshots: yallist@3.1.1: {} - yaml@2.5.1: {} - yargs-parser@21.1.1: {} yargs@17.7.2: diff --git a/postcss.config.js b/postcss.config.js index a982c641..297374d8 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,7 +1,6 @@ const config = { plugins: { - tailwindcss: {}, - autoprefixer: {}, + '@tailwindcss/postcss': {}, }, }; diff --git a/tailwind.config.ts b/tailwind.config.ts deleted file mode 100644 index ef3ecd7c..00000000 --- a/tailwind.config.ts +++ /dev/null @@ -1,190 +0,0 @@ -import { type Config } from 'tailwindcss'; -import defaultTheme from 'tailwindcss/defaultTheme'; - -export default { - content: [ - './app/**/*.{js,ts,jsx,tsx}', - './lib/interviewer/**/*.{js,ts,jsx,tsx}', - './components/**/*.{js,ts,jsx,tsx}', - ], - theme: { - colors: { - // NC colors - 'neon-coral': { - DEFAULT: 'hsl(var(--neon-coral) / )', - dark: 'hsl(var(--neon-coral--dark) / )', - }, - 'sea-green': { - DEFAULT: 'hsl(var(--sea-green) / )', - dark: 'hsl(var(--sea-green--dark) / )', - }, - 'slate-blue': { - DEFAULT: 'hsl(var(--slate-blue) / )', - dark: 'hsl(var(--slate-blue--dark) / )', - }, - 'navy-taupe': { - DEFAULT: 'hsl(var(--navy-taupe) / )', - dark: 'hsl(var(--navy-taupe--dark) / )', - }, - 'cyber-grape': { - DEFAULT: 'hsl(var(--cyber-grape) / )', - dark: 'hsl(var(--cyber-grape--dark) / )', - }, - 'mustard': { - DEFAULT: 'hsl(var(--mustard) / )', - dark: 'hsl(var(--mustard--dark) / )', - }, - 'rich-black': { - DEFAULT: 'hsl(var(--rich-black) / )', - dark: 'hsl(var(--rich-black--dark) / )', - }, - 'charcoal': { - DEFAULT: 'hsl(var(--charcoal) / )', - dark: 'hsl(var(--charcoal--dark) / )', - }, - 'platinum': { - DEFAULT: 'hsl(var(--platinum) / )', - dark: 'hsl(var(--platinum--dark) / )', - }, - 'sea-serpent': { - DEFAULT: 'hsl(var(--sea-serpent) / )', - dark: 'hsl(var(--sea-serpent--dark) / )', - }, - 'purple-pizazz': { - DEFAULT: 'hsl(var(--purple-pizazz) / )', - dark: 'hsl(var(--purple-pizazz--dark) / )', - }, - 'paradise-pink': { - DEFAULT: 'hsl(var(--paradise-pink) / )', - dark: 'hsl(var(--paradise-pink--dark) / )', - }, - 'cerulean-blue': { - DEFAULT: 'hsl(var(--cerulean-blue) / )', - dark: 'hsl(var(--cerulean-blue--dark) / )', - }, - 'kiwi': { - DEFAULT: 'hsl(var(--kiwi) / )', - dark: 'hsl(var(--kiwi--dark) / )', - }, - 'neon-carrot': { - DEFAULT: 'hsl(var(--neon-carrot) / )', - dark: 'hsl(var(--neon-carrot--dark) / )', - }, - 'barbie-pink': { - DEFAULT: 'hsl(var(--barbie-pink) / )', - dark: 'hsl(var(--barbie-pink--dark) / )', - }, - 'tomato': { - DEFAULT: 'hsl(var(--tomato) / )', - dark: 'hsl(var(--tomato--dark) / )', - }, - 'transparent': 'transparent', - 'white': 'hsl(var(--white) / )', - - 'background': 'hsl(var(--background) / )', - 'foreground': 'hsl(var(--foreground) / )', - - 'primary': { - DEFAULT: 'hsl(var(--primary) / )', - foreground: 'hsl(var(--primary-foreground) / )', - }, - 'secondary': { - DEFAULT: 'hsl(var(--secondary) / )', - foreground: 'hsl(var(--secondary-foreground) / )', - }, - 'destructive': { - DEFAULT: 'hsl(var(--destructive) / )', - foreground: 'hsl(var(--destructive-foreground) / )', - }, - 'success': { - DEFAULT: 'hsl(var(--success) / )', - foreground: 'hsl(var(--success-foreground) / )', - }, - 'info': { - DEFAULT: 'hsl(var(--info) / )', - foreground: 'hsl(var(--info-foreground) / )', - }, - 'muted': { - DEFAULT: 'hsl(var(--muted) / )', - foreground: 'hsl(var(--muted-foreground) / )', - }, - 'accent': { - DEFAULT: 'hsl(var(--accent) / )', - foreground: 'hsl(var(--accent-foreground) / )', - }, - 'popover': { - DEFAULT: 'hsl(var(--popover) / )', - foreground: 'hsl(var(--popover-foreground) / )', - }, - 'card': { - DEFAULT: 'hsl(var(--card) / )', - foreground: 'hsl(var(--card-foreground) / )', - }, - 'panel': { - DEFAULT: 'hsl(var(--panel) / )', - foreground: 'hsl(var(--foreground) / )', - }, - 'input': { - DEFAULT: 'hsl(var(--input) / )', - foreground: 'hsl(var(--input-foreground) / )', - }, - 'border': 'hsl(var(--border) / )', - 'link': 'hsl(var(--link) / )', - }, - borderRadius: { - ...defaultTheme.borderRadius, - input: defaultTheme.borderRadius.xl, - }, - extend: { - keyframes: { - 'wiggle': { - '0%, 100%': { transform: 'rotate(-3deg)' }, - '50%': { transform: 'rotate(3deg)' }, - }, - 'accordion-down': { - from: { height: '0' }, - to: { height: 'var(--radix-accordion-content-height)' }, - }, - 'accordion-up': { - from: { height: 'var(--radix-accordion-content-height)' }, - to: { height: '0' }, - }, - 'indeterminate-progress-bar': { - '0%': { transform: ' translateX(0) scaleX(0)' }, - '40%': { transform: 'translateX(0) scaleX(0.4)' }, - '100%': { transform: 'translateX(100%) scaleX(0.5)' }, - }, - 'background-gradient': { - '0%, 50%': { backgroundPosition: '0% 50%' }, - '50%': { backgroundPosition: '100% 50%' }, - }, - 'shake': { - '10%, 90%': { transform: 'translate3d(-1px, 0, 0)' }, - '20%, 80%': { transform: 'translate3d(2px, 0, 0)' }, - '30%, 50%, 70%': { transform: 'translate3d(-4px, 0, 0)' }, - '40%, 60%': { transform: 'translate3d(4px, 0, 0)' }, - }, - }, - animation: { - 'wiggle': 'wiggle 1s ease-in-out infinite', - 'shake': 'shake 0.82s cubic-bezier(.36,.07,.19,.97) both', - 'accordion-down': 'accordion-down 0.2s ease-out', - 'accordion-up': 'accordion-up 0.2s ease-out', - 'indeterminate-progress-bar': - 'indeterminate-progress-bar 1s infinite linear', - 'background-gradient': 'background-gradient 5s infinite ease-in-out', - }, - transformOrigin: { - 'left-right': '0% 50%', - }, - }, - }, - - plugins: [ - require('@tailwindcss/forms'), - require('@tailwindcss/aspect-ratio'), - require('@tailwindcss/container-queries'), - require('tailwindcss-animate'), - require('@tailwindcss/typography'), - ], -} satisfies Config; From a9e58ac715af190f549d5896a6ee2dd57a435ae3 Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 28 Nov 2024 10:03:16 +0200 Subject: [PATCH 17/37] update interviewer sass @use statement to be at the top of the file;delete duplicate stylesheets --- lib/interviewer/styles/main.scss | 2 +- styles/{globals.scss => globals.css} | 220 +++++++++++++++++++++++++-- styles/interview.scss | 9 -- 3 files changed, 211 insertions(+), 20 deletions(-) rename styles/{globals.scss => globals.css} (53%) diff --git a/lib/interviewer/styles/main.scss b/lib/interviewer/styles/main.scss index 7b641b2c..763592df 100644 --- a/lib/interviewer/styles/main.scss +++ b/lib/interviewer/styles/main.scss @@ -1,3 +1,4 @@ +@use '~~/lib/ui/styles/global/core/units'; @import '~~/lib/ui/styles/_all'; @import 'helpers/all'; @import 'components/all'; @@ -7,7 +8,6 @@ $font-path: '~~/lib/ui/assets/fonts'; $image-path: '~~/lib/ui/assets/images'; -@use '~~/lib/ui/styles/global/core/units'; // Remove touch and focus outlines * { diff --git a/styles/globals.scss b/styles/globals.css similarity index 53% rename from styles/globals.scss rename to styles/globals.css index 692d7730..b1874268 100644 --- a/styles/globals.scss +++ b/styles/globals.css @@ -1,11 +1,215 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; +@import 'tailwindcss'; + +@plugin '@tailwindcss/forms'; +@plugin '@tailwindcss/aspect-ratio'; +@plugin '@tailwindcss/container-queries'; +@plugin 'tailwindcss-animate'; +@plugin '@tailwindcss/typography'; + +@theme { + --color-*: initial; + --color-neon-coral: hsl(var(--neon-coral)); + --color-neon-coral-dark: hsl(var(--neon-coral--dark)); + + --color-sea-green: hsl(var(--sea-green)); + --color-sea-green-dark: hsl(var(--sea-green--dark)); + + --color-slate-blue: hsl(var(--slate-blue)); + --color-slate-blue-dark: hsl(var(--slate-blue--dark)); + + --color-navy-taupe: hsl(var(--navy-taupe)); + --color-navy-taupe-dark: hsl(var(--navy-taupe--dark)); + + --color-cyber-grape: hsl(var(--cyber-grape)); + --color-cyber-grape-dark: hsl(var(--cyber-grape--dark)); + + --color-mustard: hsl(var(--mustard)); + --color-mustard-dark: hsl(var(--mustard--dark)); + + --color-rich-black: hsl(var(--rich-black)); + --color-rich-black-dark: hsl(var(--rich-black--dark)); + + --color-charcoal: hsl(var(--charcoal)); + --color-charcoal-dark: hsl(var(--charcoal--dark)); + + --color-platinum: hsl(var(--platinum)); + --color-platinum-dark: hsl(var(--platinum--dark)); + + --color-sea-serpent: hsl(var(--sea-serpent)); + --color-sea-serpent-dark: hsl(var(--sea-serpent--dark)); + + --color-purple-pizazz: hsl(var(--purple-pizazz)); + --color-purple-pizazz-dark: hsl(var(--purple-pizazz--dark)); + + --color-paradise-pink: hsl(var(--paradise-pink)); + --color-paradise-pink-dark: hsl(var(--paradise-pink--dark)); + + --color-cerulean-blue: hsl(var(--cerulean-blue)); + --color-cerulean-blue-dark: hsl(var(--cerulean-blue--dark)); + + --color-kiwi: hsl(var(--kiwi)); + --color-kiwi-dark: hsl(var(--kiwi--dark)); + + --color-neon-carrot: hsl(var(--neon-carrot)); + --color-neon-carrot-dark: hsl(var(--neon-carrot--dark)); + + --color-barbie-pink: hsl(var(--barbie-pink)); + --color-barbie-pink-dark: hsl(var(--barbie-pink--dark)); + + --color-tomato: hsl(var(--tomato)); + --color-tomato-dark: hsl(var(--tomato--dark)); + + --color-transparent: transparent; + --color-white: hsl(var(--white)); + --color-background: hsl(var(--background)); + --color-foreground: hsl(var(--foreground)); + + --color-primary: hsl(var(--primary)); + --color-primary-foreground: hsl(var(--primary-foreground)); + + --color-secondary: hsl(var(--secondary)); + --color-secondary-foreground: hsl(var(--secondary-foreground)); + + --color-destructive: hsl(var(--destructive)); + --color-destructive-foreground: hsl(var(--destructive-foreground)); + + --color-success: hsl(var(--success)); + --color-success-foreground: hsl(var(--success-foreground)); + + --color-info: hsl(var(--info)); + --color-info-foreground: hsl(var(--info-foreground)); + + --color-muted: hsl(var(--muted)); + --color-muted-foreground: hsl(var(--muted-foreground)); + + --color-accent: hsl(var(--accent)); + --color-accent-foreground: hsl(var(--accent-foreground)); + + --color-popover: hsl(var(--popover)); + --color-popover-foreground: hsl(var(--popover-foreground)); + + --color-card: hsl(var(--card)); + --color-card-foreground: hsl(var(--card-foreground)); + + --color-panel: hsl(var(--panel)); + --color-panel-foreground: hsl(var(--foreground)); + + --color-input: hsl(var(--input)); + --color-input-foreground: hsl(var(--input-foreground)); + + --color-border: hsl(var(--border)); + --color-link: hsl(var(--link)); + + --radius-*: initial; + --radius-none: 0px; + --radius-sm: 0.125rem; + --radius: 0.25rem; + --radius-md: 0.375rem; + --radius-lg: 0.5rem; + --radius-xl: 0.75rem; + --radius-2xl: 1rem; + --radius-3xl: 1.5rem; + --radius-full: 9999px; + --radius-input: 0.75rem; + + --animate-wiggle: wiggle 1s ease-in-out infinite; + --animate-shake: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; + --animate-accordion-down: accordion-down 0.2s ease-out; + --animate-accordion-up: accordion-up 0.2s ease-out; + --animate-indeterminate-progress-bar: indeterminate-progress-bar 1s infinite + linear; + --animate-background-gradient: background-gradient 5s infinite ease-in-out; + + --transform-origin-left-right: 0% 50%; + + @keyframes wiggle { + 0%, + 100% { + transform: rotate(-3deg); + } + 50% { + transform: rotate(3deg); + } + } + @keyframes accordion-down { + from { + height: 0; + } + to { + height: var(--radix-accordion-content-height); + } + } + @keyframes accordion-up { + from { + height: var(--radix-accordion-content-height); + } + to { + height: 0; + } + } + @keyframes indeterminate-progress-bar { + 0% { + transform: translateX(0) scaleX(0); + } + 40% { + transform: translateX(0) scaleX(0.4); + } + 100% { + transform: translateX(100%) scaleX(0.5); + } + } + @keyframes background-gradient { + 0%, + 50% { + background-position: 0% 50%; + } + 50% { + background-position: 100% 50%; + } + } + @keyframes shake { + 10%, + 90% { + transform: translate3d(-1px, 0, 0); + } + 20%, + 80% { + transform: translate3d(2px, 0, 0); + } + 30%, + 50%, + 70% { + transform: translate3d(-4px, 0, 0); + } + 40%, + 60% { + transform: translate3d(4px, 0, 0); + } + } +} + +/* + The default border color has changed to `currentColor` in Tailwind CSS v4, + so we've added these compatibility styles to make sure everything still + looks the same as it did with Tailwind CSS v3. + + If we ever want to remove these styles, we need to add an explicit border + color utility to any element that depends on these defaults. +*/ +@layer base { + *, + ::after, + ::before, + ::backdrop, + ::file-selector-button { + border-color: var(--color-platinum-dark, currentColor); + } +} @layer base { :root { /* UI Colors */ - // To generate dark color variants, subtract 5% from the lightness. + /* To generate dark color variants, subtract 5% from the lightness. */ --dark-mod: 5%; --neon-coral-hue: 342; --neon-coral-saturation: 76.9%; @@ -142,7 +346,7 @@ --white: 0 0% 100%; - // Semantic slots + /* Semantic slots */ --background: var(--platinum); --foreground: var(--cyber-grape); @@ -190,16 +394,12 @@ } @layer base { - * { - @apply border-border; - } body { @apply bg-background text-foreground; font-family: 'Open Sans', sans-serif; } - // These two tags are semantic, so I think its okay to apply styles to them - // directly in the global styles. + /* These two tags are semantic, so I think its okay to apply styles to them directly in the global styles. */ strong { @apply font-extrabold; } diff --git a/styles/interview.scss b/styles/interview.scss index fe2308de..97b765b6 100644 --- a/styles/interview.scss +++ b/styles/interview.scss @@ -1,10 +1 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -// Interview specific stylesheet? - -// $font-path: '~~/lib/ui/assets/fonts'; -// $image-path: '~~/lib/ui/assets/images'; - @import '../lib/interviewer/styles/main.scss'; From 98396a1f15653997273851b2610f6c9c46188e4f Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 28 Nov 2024 11:47:29 +0200 Subject: [PATCH 18/37] knip --- knip.json | 11 ++++++++++- package.json | 13 ++++++------- pnpm-lock.yaml | 39 ++++++++++++++++++--------------------- 3 files changed, 34 insertions(+), 29 deletions(-) diff --git a/knip.json b/knip.json index 2b33ef89..1dd29557 100644 --- a/knip.json +++ b/knip.json @@ -10,6 +10,15 @@ "utils/auth.ts", "load-test.js" ], - "ignoreDependencies": ["server-only", "prop-types", "sharp"], + "ignoreDependencies": [ + "server-only", + "prop-types", + "sharp", + "@tailwindcss/aspect-ratio", + "@tailwindcss/container-queries", + "@tailwindcss/forms", + "@tailwindcss/typography", + "tailwindcss-animate" + ], "ignoreBinaries": ["docker-compose"] } diff --git a/package.json b/package.json index 2d01e8e8..8d8c4551 100644 --- a/package.json +++ b/package.json @@ -45,12 +45,7 @@ "@radix-ui/react-tooltip": "^1.1.3", "@radix-ui/react-visually-hidden": "^1.1.0", "@reduxjs/toolkit": "^1.9.7", - "@t3-oss/env-nextjs": "^0.11.1", - "@tailwindcss/aspect-ratio": "^0.4.2", - "@tailwindcss/container-queries": "^0.1.1", - "@tailwindcss/forms": "^0.5.9", "@tanstack/react-table": "^8.20.5", - "@types/async": "^3.2.24", "@uploadthing/react": "^7.1.0", "@xmldom/xmldom": "^0.8.10", "animejs": "^2.2.0", @@ -103,7 +98,6 @@ "sharp": "^0.33.5", "strip-markdown": "^6.0.0", "tailwind-merge": "^2.5.5", - "tailwindcss-animate": "^1.0.7", "uploadthing": "^7.2.0", "usehooks-ts": "^2.16.0", "uuid": "^11.0.2", @@ -113,10 +107,15 @@ }, "devDependencies": { "@prisma/client": "^5.22.0", + "@t3-oss/env-nextjs": "^0.11.1", + "@tailwindcss/aspect-ratio": "^0.4.2", + "@tailwindcss/container-queries": "^0.1.1", + "@tailwindcss/forms": "^0.5.9", "@tailwindcss/postcss": "4.0.0-beta.3", "@tailwindcss/typography": "^0.5.15", "@total-typescript/ts-reset": "^0.6.1", "@types/archiver": "^6.0.3", + "@types/async": "^3.2.24", "@types/d3-interpolate-path": "^2.0.3", "@types/eslint": "^8.56.12", "@types/jest": "^29.5.14", @@ -137,12 +136,12 @@ "jest": "^29.7.0", "jsdom": "^25.0.1", "knip": "^5.37.2", - "postcss": "^8.4.47", "prettier": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.9", "prisma": "^5.22.0", "sass": "^1.79.1", "tailwindcss": "4.0.0-beta.3", + "tailwindcss-animate": "^1.0.7", "typescript": "5.6.3", "vite-tsconfig-paths": "^5.1.2", "vitest": "^2.1.5" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 156a8d9f..19ae2588 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -77,24 +77,9 @@ importers: '@reduxjs/toolkit': specifier: ^1.9.7 version: 1.9.7(react-redux@8.1.3(@types/react-dom@18.3.1)(@types/react@18.3.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(redux@4.2.1))(react@18.3.1) - '@t3-oss/env-nextjs': - specifier: ^0.11.1 - version: 0.11.1(typescript@5.6.3)(zod@3.23.8) - '@tailwindcss/aspect-ratio': - specifier: ^0.4.2 - version: 0.4.2(tailwindcss@4.0.0-beta.3) - '@tailwindcss/container-queries': - specifier: ^0.1.1 - version: 0.1.1(tailwindcss@4.0.0-beta.3) - '@tailwindcss/forms': - specifier: ^0.5.9 - version: 0.5.9(tailwindcss@4.0.0-beta.3) '@tanstack/react-table': specifier: ^8.20.5 version: 8.20.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@types/async': - specifier: ^3.2.24 - version: 3.2.24 '@uploadthing/react': specifier: ^7.1.0 version: 7.1.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(react@18.3.1)(uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@4.0.0-beta.3)) @@ -251,9 +236,6 @@ importers: tailwind-merge: specifier: ^2.5.5 version: 2.5.5 - tailwindcss-animate: - specifier: ^1.0.7 - version: 1.0.7(tailwindcss@4.0.0-beta.3) uploadthing: specifier: ^7.2.0 version: 7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@4.0.0-beta.3) @@ -276,6 +258,18 @@ importers: '@prisma/client': specifier: ^5.22.0 version: 5.22.0(prisma@5.22.0) + '@t3-oss/env-nextjs': + specifier: ^0.11.1 + version: 0.11.1(typescript@5.6.3)(zod@3.23.8) + '@tailwindcss/aspect-ratio': + specifier: ^0.4.2 + version: 0.4.2(tailwindcss@4.0.0-beta.3) + '@tailwindcss/container-queries': + specifier: ^0.1.1 + version: 0.1.1(tailwindcss@4.0.0-beta.3) + '@tailwindcss/forms': + specifier: ^0.5.9 + version: 0.5.9(tailwindcss@4.0.0-beta.3) '@tailwindcss/postcss': specifier: 4.0.0-beta.3 version: 4.0.0-beta.3 @@ -288,6 +282,9 @@ importers: '@types/archiver': specifier: ^6.0.3 version: 6.0.3 + '@types/async': + specifier: ^3.2.24 + version: 3.2.24 '@types/d3-interpolate-path': specifier: ^2.0.3 version: 2.0.3 @@ -348,9 +345,6 @@ importers: knip: specifier: ^5.37.2 version: 5.37.2(@types/node@22.9.0)(typescript@5.6.3) - postcss: - specifier: ^8.4.47 - version: 8.4.47 prettier: specifier: ^3.3.3 version: 3.3.3 @@ -366,6 +360,9 @@ importers: tailwindcss: specifier: 4.0.0-beta.3 version: 4.0.0-beta.3 + tailwindcss-animate: + specifier: ^1.0.7 + version: 1.0.7(tailwindcss@4.0.0-beta.3) typescript: specifier: 5.6.3 version: 5.6.3 From 1d60223f85553fc439f0624b229891f28c45c953 Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 28 Nov 2024 13:58:11 +0200 Subject: [PATCH 19/37] replace with lodash-es --- .../interview/_components/ServerSync.tsx | 4 +- .../_components/DropzoneField.tsx | 2 +- hooks/use-data-table.tsx | 33 +- .../behaviours/DragAndDrop/DragManager.js | 2 +- .../behaviours/DragAndDrop/DragSource.js | 6 +- .../behaviours/DragAndDrop/Monitor.js | 4 +- .../DragAndDrop/MonitorDropTarget.js | 6 +- .../behaviours/DragAndDrop/reducer.js | 2 +- .../behaviours/DragAndDrop/useDropMonitor.js | 17 +- .../behaviours/autoInitialisedForm.js | 16 +- lib/interviewer/behaviours/withBounds.js | 10 +- lib/interviewer/behaviours/withPrompt.js | 22 +- .../components/Canvas/ConvexHull.js | 8 +- .../components/Canvas/ConvexHulls.js | 12 +- .../components/Canvas/EdgeLayout.js | 5 +- .../components/Canvas/NodeLayout.js | 118 ++-- .../components/Canvas/ScreenManager.js | 24 +- lib/interviewer/components/Canvas/utils.js | 2 +- lib/interviewer/components/NodeList.js | 10 +- .../containers/Canvas/NodeBucket.js | 3 +- .../containers/Canvas/NodeLayout.js | 206 +++--- .../containers/Canvas/PresetSwitcherKey.js | 17 +- lib/interviewer/containers/Canvas/Radar.js | 40 +- .../CategoricalList/CategoricalList.js | 117 ++-- .../CategoricalList/CategoricalListItem.js | 2 +- lib/interviewer/containers/Field.js | 6 +- .../Interfaces/DyadCensus/DyadCensus.js | 16 +- .../containers/Interfaces/EgoForm.js | 2 +- .../containers/Interfaces/NameGenerator.js | 86 +-- .../NameGeneratorRoster.js | 61 +- .../NameGeneratorRoster/useFuseOptions.js | 3 +- .../useSortableProperties.js | 6 +- .../containers/Interfaces/Narrative.js | 20 +- .../containers/Interfaces/OrdinalBin.js | 13 +- .../containers/Interfaces/Sociogram.js | 66 +- .../TieStrengthCensus/TieStrengthCensus.js | 50 +- .../Interfaces/utils/StageLevelValidation.js | 8 +- lib/interviewer/containers/NodePanel.js | 3 +- lib/interviewer/containers/NodePanels.js | 3 +- lib/interviewer/containers/OrdinalBins.js | 90 +-- lib/interviewer/containers/SearchableList.js | 11 +- .../containers/SlidesForm/SlideFormEdge.js | 15 +- .../containers/SlidesForm/SlidesForm.js | 109 ++- .../containers/withExternalData.js | 12 +- lib/interviewer/contexts/LayoutContext.js | 142 ++-- .../ducks/modules/installedProtocols.js | 16 +- lib/interviewer/ducks/modules/network.js | 202 +++--- lib/interviewer/ducks/modules/reset.js | 20 +- lib/interviewer/ducks/modules/session.js | 643 ++++++++++-------- lib/interviewer/hooks/useExternalData.js | 2 +- lib/interviewer/hooks/useFlipflop.js | 30 +- lib/interviewer/hooks/useSort.js | 11 +- lib/interviewer/hooks/useViewport.js | 3 +- lib/interviewer/selectors/canvas.js | 11 +- lib/interviewer/selectors/forms.js | 41 +- lib/interviewer/selectors/interface.js | 19 +- lib/interviewer/selectors/name-generator.js | 45 +- lib/interviewer/selectors/network.ts | 16 +- lib/interviewer/selectors/protocol.js | 22 +- lib/interviewer/selectors/utils.js | 2 +- lib/interviewer/utils/Validations.js | 95 ++- lib/interviewer/utils/createSorter.js | 257 ++++--- .../utils/getParentKeyByNameValue.js | 25 +- lib/interviewer/utils/playSound.js | 2 +- .../formatters/csv/__tests__/mockObjects.js | 98 ++- .../formatters/graphml/createGraphML.js | 12 +- .../formatters/graphml/helpers.js | 9 +- lib/network-query/predicate.js | 191 +++--- lib/ui/components/ActionButton.js | 2 +- lib/ui/components/Cards/DataCard.js | 30 +- lib/ui/components/Dialogs.js | 2 +- .../Fields/DatePicker/DatePicker/Days.js | 11 +- .../Fields/DatePicker/DatePicker/Months.js | 25 +- .../Fields/DatePicker/DatePicker/Years.js | 7 +- .../Fields/DatePicker/DatePicker/helpers.js | 2 +- .../Fields/DatePicker/RangePicker.js | 58 +- .../components/Fields/DatePicker/helpers.js | 30 +- lib/ui/components/Fields/Search.js | 10 +- lib/ui/components/Fields/Slider/Slider.js | 10 +- lib/ui/components/Fields/TextArea.js | 6 +- lib/ui/components/Fields/Toggle.js | 6 +- lib/ui/components/Fields/utils/options.js | 5 +- lib/ui/components/Prompts/Prompts.js | 59 +- lib/ui/components/Scroller.js | 18 +- lib/ui/hooks/useSpeech.js | 42 +- lib/ui/utils/CSSVariables.js | 11 +- package.json | 4 +- pnpm-lock.yaml | 8 +- 88 files changed, 1882 insertions(+), 1646 deletions(-) diff --git a/app/(interview)/interview/_components/ServerSync.tsx b/app/(interview)/interview/_components/ServerSync.tsx index bd83b32e..4f0fde8c 100644 --- a/app/(interview)/interview/_components/ServerSync.tsx +++ b/app/(interview)/interview/_components/ServerSync.tsx @@ -1,7 +1,7 @@ 'use client'; -import { debounce, isEqual } from 'lodash'; -import { type ReactNode, useEffect, useState, useCallback } from 'react'; +import { debounce, isEqual } from 'lodash-es'; +import { type ReactNode, useCallback, useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; import type { SyncInterviewType } from '~/actions/interviews'; import usePrevious from '~/hooks/usePrevious'; diff --git a/app/dashboard/participants/_components/DropzoneField.tsx b/app/dashboard/participants/_components/DropzoneField.tsx index 468fb3ad..0201b9aa 100644 --- a/app/dashboard/participants/_components/DropzoneField.tsx +++ b/app/dashboard/participants/_components/DropzoneField.tsx @@ -1,4 +1,4 @@ -import { isArray } from 'lodash'; +import { isArray } from 'lodash-es'; import { FileCheck, FileText } from 'lucide-react'; import { useId } from 'react'; import { useDropzone } from 'react-dropzone'; diff --git a/hooks/use-data-table.tsx b/hooks/use-data-table.tsx index abd873c0..599f9f1d 100644 --- a/hooks/use-data-table.tsx +++ b/hooks/use-data-table.tsx @@ -23,7 +23,7 @@ import type { SortableField, } from '~/lib/data-table/types'; -import { debounce } from 'lodash'; +import { debounce } from 'lodash-es'; import { useTableStateFromSearchParams } from '~/app/dashboard/_components/ActivityFeed/useTableStateFromSearchParams'; type UseDataTableProps = { @@ -96,19 +96,22 @@ export function useDataTable({ ); // eslint-disable-next-line react-hooks/exhaustive-deps - const debouncedUpdateFilterParams = useCallback(debounce( - (columnFilters: FilterParam[]) => { - void setSearchParams({ - page: 1, - filterParams: columnFilters, - }); - }, - 2000, - { - trailing: true, - leading: false, - }, - ), []); + const debouncedUpdateFilterParams = useCallback( + debounce( + (columnFilters: FilterParam[]) => { + void setSearchParams({ + page: 1, + filterParams: columnFilters, + }); + }, + 2000, + { + trailing: true, + leading: false, + }, + ), + [], + ); // Sync any changes to columnFilters back to searchParams React.useEffect(() => { @@ -179,4 +182,4 @@ export function useDataTable({ }); return { dataTable }; -} \ No newline at end of file +} diff --git a/lib/interviewer/behaviours/DragAndDrop/DragManager.js b/lib/interviewer/behaviours/DragAndDrop/DragManager.js index 593c3b8b..9c0e5ced 100644 --- a/lib/interviewer/behaviours/DragAndDrop/DragManager.js +++ b/lib/interviewer/behaviours/DragAndDrop/DragManager.js @@ -1,4 +1,4 @@ -import { throttle } from 'lodash'; +import { throttle } from 'lodash-es'; export const VERTICAL_SCROLL = 'VERTICAL_SCROLL'; const HORIZONTAL_SCROLL = 'HORIZONTAL_SCROLL'; diff --git a/lib/interviewer/behaviours/DragAndDrop/DragSource.js b/lib/interviewer/behaviours/DragAndDrop/DragSource.js index 1c4e025a..07790ca2 100644 --- a/lib/interviewer/behaviours/DragAndDrop/DragSource.js +++ b/lib/interviewer/behaviours/DragAndDrop/DragSource.js @@ -1,7 +1,7 @@ -import React, { useEffect, useRef, useState } from 'react'; -import { throttle } from 'lodash'; -import DragPreview from './DragPreview'; +import { throttle } from 'lodash-es'; +import { useEffect, useRef, useState } from 'react'; import DragManager, { VERTICAL_SCROLL } from './DragManager'; +import DragPreview from './DragPreview'; import { actionCreators as actions } from './reducer'; import store from './store'; diff --git a/lib/interviewer/behaviours/DragAndDrop/Monitor.js b/lib/interviewer/behaviours/DragAndDrop/Monitor.js index 95507e44..9ce93471 100644 --- a/lib/interviewer/behaviours/DragAndDrop/Monitor.js +++ b/lib/interviewer/behaviours/DragAndDrop/Monitor.js @@ -1,5 +1,5 @@ -import React, { PureComponent } from 'react'; -import { pick, isEqual } from 'lodash'; +import { isEqual, pick } from 'lodash-es'; +import { PureComponent } from 'react'; import store from './store'; const monitor = (getMonitorProps, types) => (WrappedComponent) => diff --git a/lib/interviewer/behaviours/DragAndDrop/MonitorDropTarget.js b/lib/interviewer/behaviours/DragAndDrop/MonitorDropTarget.js index cf76a131..3b3459d9 100644 --- a/lib/interviewer/behaviours/DragAndDrop/MonitorDropTarget.js +++ b/lib/interviewer/behaviours/DragAndDrop/MonitorDropTarget.js @@ -1,5 +1,5 @@ +import { find, get } from 'lodash-es'; import { PropTypes } from 'prop-types'; -import { find, get } from 'lodash'; import Monitor from './Monitor'; const defaultMonitorProps = { @@ -10,7 +10,9 @@ const defaultMonitorProps = { const getMonitorProps = (state, props) => { const target = find(state.targets, ['id', props.id]); - if (!target) { return { ...defaultMonitorProps }; } + if (!target) { + return { ...defaultMonitorProps }; + } const monitorProps = { isOver: get(target, 'isOver', false), diff --git a/lib/interviewer/behaviours/DragAndDrop/reducer.js b/lib/interviewer/behaviours/DragAndDrop/reducer.js index 8ec868fb..eda28f46 100644 --- a/lib/interviewer/behaviours/DragAndDrop/reducer.js +++ b/lib/interviewer/behaviours/DragAndDrop/reducer.js @@ -1,4 +1,4 @@ -import { filter, reject, omit, isEmpty, thru, some } from 'lodash'; +import { filter, isEmpty, omit, reject, some, thru } from 'lodash-es'; const UPSERT_TARGET = Symbol('DRAG_AND_DROP/UPSERT_TARGET'); const RENAME_TARGET = Symbol('DRAG_AND_DROP/RENAME_TARGET'); diff --git a/lib/interviewer/behaviours/DragAndDrop/useDropMonitor.js b/lib/interviewer/behaviours/DragAndDrop/useDropMonitor.js index e56440f2..9a212126 100644 --- a/lib/interviewer/behaviours/DragAndDrop/useDropMonitor.js +++ b/lib/interviewer/behaviours/DragAndDrop/useDropMonitor.js @@ -1,10 +1,5 @@ -import { useEffect, useState, useRef, useCallback } from 'react'; -import { - find, - get, - pick, - isEqual, -} from 'lodash'; +import { find, get, isEqual, pick } from 'lodash-es'; +import { useCallback, useEffect, useRef, useState } from 'react'; import store from './store'; @@ -13,7 +8,9 @@ const defaultProps = ['isOver', 'willAccept']; const getMonitorProps = (state, id, props) => { const target = find(state.targets, ['id', id]); - if (!target) { return null; } + if (!target) { + return null; + } const monitorProps = { isOver: get(target, 'isOver', false), @@ -28,7 +25,9 @@ const useDropMonitor = (id, props = defaultProps) => { const [state, setState] = useState(); const updateState = (newState) => { - if (isEqual(internalState.current, newState)) { return; } + if (isEqual(internalState.current, newState)) { + return; + } internalState.current = newState; setState(newState); }; diff --git a/lib/interviewer/behaviours/autoInitialisedForm.js b/lib/interviewer/behaviours/autoInitialisedForm.js index ebcbe63a..f3b8d3d1 100644 --- a/lib/interviewer/behaviours/autoInitialisedForm.js +++ b/lib/interviewer/behaviours/autoInitialisedForm.js @@ -1,6 +1,5 @@ -import React from 'react'; +import { fromPairs, map } from 'lodash-es'; import PropTypes from 'prop-types'; -import { fromPairs, map } from 'lodash'; // TODO: Seems like this knowledge should be part of the field component? const typeInitalValue = (field) => { @@ -13,17 +12,18 @@ const typeInitalValue = (field) => { } }; -const initialValues = (fields) => fromPairs( - map(fields, (field) => [field.name, typeInitalValue(field)]), -); +const initialValues = (fields) => + fromPairs(map(fields, (field) => [field.name, typeInitalValue(field)])); /** - * Renders a redux form that contains fields according to a `fields` config. - */ + * Renders a redux form that contains fields according to a `fields` config. + */ const autoInitialisedForm = (WrappedComponent) => { const AutoInitialisedForm = (props) => { const { fields } = props; - return ; + return ( + + ); }; AutoInitialisedForm.propTypes = { diff --git a/lib/interviewer/behaviours/withBounds.js b/lib/interviewer/behaviours/withBounds.js index 53f3e09f..825fb532 100644 --- a/lib/interviewer/behaviours/withBounds.js +++ b/lib/interviewer/behaviours/withBounds.js @@ -1,9 +1,9 @@ /* eslint-disable react/no-find-dom-node */ -import React, { Component } from 'react'; -import { isEqual } from 'lodash'; -import getAbsoluteBoundingRect from '../utils/getAbsoluteBoundingRect'; +import { isEqual } from 'lodash-es'; +import { Component } from 'react'; import { findDOMNode } from 'react-dom'; +import getAbsoluteBoundingRect from '../utils/getAbsoluteBoundingRect'; const initialState = { width: 0, @@ -51,7 +51,9 @@ export default function withBounds(WrappedComponent) { } componentWillUnmount() { - if (!this.observer || !this.node) { return; } + if (!this.observer || !this.node) { + return; + } this.observer.unobserve(this.node); this.observer.disconnect(); diff --git a/lib/interviewer/behaviours/withPrompt.js b/lib/interviewer/behaviours/withPrompt.js index d7d85559..89c9fa20 100644 --- a/lib/interviewer/behaviours/withPrompt.js +++ b/lib/interviewer/behaviours/withPrompt.js @@ -1,12 +1,9 @@ +import { get } from 'lodash-es'; import { useDispatch, useSelector } from 'react-redux'; import { actionCreators as sessionActions } from '../ducks/modules/session'; import { getAllVariableUUIDsByEntity } from '../selectors/protocol'; -import { - getPromptIndex, - getPrompts, -} from '../selectors/session'; +import { getPromptIndex, getPrompts } from '../selectors/session'; import { processProtocolSortRule } from '../utils/createSorter'; -import { get } from '../utils/lodash-replacements'; /** * Convert sort rules to new format. See `processProtocolSortRule` for details. @@ -40,7 +37,7 @@ const processSortRules = (prompts = [], codebookVariables) => { * @property {string} [variable] * @property {string} [createEdge] * @property {string} [edgeVariable] - * + * * @typedef {Array} Prompts * * @typedef {Object} PromptState @@ -53,10 +50,10 @@ const processSortRules = (prompts = [], codebookVariables) => { * @property {boolean} isLastPrompt * @property {boolean} isFirstPrompt * @property {Function} updatePrompt - * + * * @returns {PromptState} * @private - * + * * @example * const { * promptIndex, @@ -119,17 +116,10 @@ const withPrompt = (WrappedComponent) => { const WithPrompt = (props) => { const prompts = usePrompts(); - return ( - - ); + return ; }; return WithPrompt; }; - - export default withPrompt; diff --git a/lib/interviewer/components/Canvas/ConvexHull.js b/lib/interviewer/components/Canvas/ConvexHull.js index 5b085b89..bb37a087 100644 --- a/lib/interviewer/components/Canvas/ConvexHull.js +++ b/lib/interviewer/components/Canvas/ConvexHull.js @@ -1,8 +1,8 @@ -import React, { useState, useEffect } from 'react'; -import PropTypes from 'prop-types'; -import { map } from 'lodash'; -import ConcaveMan from 'concaveman'; import { entityAttributesProperty } from '@codaco/shared-consts'; +import ConcaveMan from 'concaveman'; +import { map } from 'lodash-es'; +import PropTypes from 'prop-types'; +import { useEffect, useState } from 'react'; const ConvexHull = ({ color = 'cat-color-seq-1', diff --git a/lib/interviewer/components/Canvas/ConvexHulls.js b/lib/interviewer/components/Canvas/ConvexHulls.js index d913003f..d7c199cf 100644 --- a/lib/interviewer/components/Canvas/ConvexHulls.js +++ b/lib/interviewer/components/Canvas/ConvexHulls.js @@ -1,12 +1,12 @@ -import React, { useEffect, useMemo, useRef, useState } from 'react'; -import PropTypes from 'prop-types'; -import { findIndex } from 'lodash'; -import ConvexHull from './ConvexHull'; -import useResizeObserver from '~/hooks/useResizeObserver'; import { entityAttributesProperty } from '@codaco/shared-consts'; +import { findIndex } from 'lodash-es'; +import PropTypes from 'prop-types'; +import { useEffect, useMemo, useRef, useState } from 'react'; import { useSelector } from 'react-redux'; -import { getCategoricalOptions } from '../../selectors/network'; +import useResizeObserver from '~/hooks/useResizeObserver'; import { getCurrentStage } from '~/lib/interviewer/selectors/session'; +import { getCategoricalOptions } from '../../selectors/network'; +import ConvexHull from './ConvexHull'; const getColor = (group, options) => { const colorIndex = findIndex(options, ['value', group]) + 1 || 1; diff --git a/lib/interviewer/components/Canvas/EdgeLayout.js b/lib/interviewer/components/Canvas/EdgeLayout.js index a4042479..b9642f48 100644 --- a/lib/interviewer/components/Canvas/EdgeLayout.js +++ b/lib/interviewer/components/Canvas/EdgeLayout.js @@ -1,8 +1,8 @@ -import React, { useRef, useContext, useEffect } from 'react'; +import { useContext, useEffect, useRef } from 'react'; import { useSelector } from 'react-redux'; import LayoutContext from '../../contexts/LayoutContext'; import { getProtocolCodebook } from '../../selectors/protocol'; -import { get } from '../../utils/lodash-replacements'; +import { get } from '../lodash-es'; const viewBoxScale = 100; @@ -81,5 +81,4 @@ const EdgeLayout = () => { ); }; - export default EdgeLayout; diff --git a/lib/interviewer/components/Canvas/NodeLayout.js b/lib/interviewer/components/Canvas/NodeLayout.js index d4002a30..47104658 100644 --- a/lib/interviewer/components/Canvas/NodeLayout.js +++ b/lib/interviewer/components/Canvas/NodeLayout.js @@ -1,11 +1,14 @@ /* eslint-disable no-param-reassign */ -import React from 'react'; +import { + entityAttributesProperty, + entityPrimaryKeyProperty, +} from '@codaco/shared-consts'; +import { find, isEmpty } from 'lodash-es'; import PropTypes from 'prop-types'; -import { entityPrimaryKeyProperty, entityAttributesProperty } from '@codaco/shared-consts'; -import { isEmpty, find } from 'lodash'; +import React from 'react'; import LayoutContext from '../../contexts/LayoutContext'; +import { get } from '../lodash-es'; import LayoutNode from './LayoutNode'; -import { get } from '../../utils/lodash-replacements'; import { getTwoModeLayoutVariable } from './utils'; export default class NodeLayout extends React.Component { @@ -39,7 +42,9 @@ export default class NodeLayout extends React.Component { } componentDidUpdate() { - const { network: { nodes } } = this.context; + const { + network: { nodes }, + } = this.context; if (this.layoutEls.length !== nodes.length) { this.createLayoutEls(); @@ -53,10 +58,14 @@ export default class NodeLayout extends React.Component { } createLayoutEls = () => { - const { network: { nodes } } = this.context; + const { + network: { nodes }, + } = this.context; this.layoutEls = nodes.map((_, index) => { - if (this.layoutEls[index]) { return this.layoutEls[index]; } + if (this.layoutEls[index]) { + return this.layoutEls[index]; + } const nodeEl = document.createElement('div'); nodeEl.style.position = 'absolute'; @@ -66,26 +75,26 @@ export default class NodeLayout extends React.Component { return nodeEl; }); - } + }; update = () => { - const { - getPosition, - screen, - } = this.context; + const { getPosition, screen } = this.context; this.layoutEls.forEach((el, index) => { const relativePosition = getPosition.current(index); - if (!relativePosition || !el) { return; } + if (!relativePosition || !el) { + return; + } - const screenPosition = screen.current.calculateScreenCoords(relativePosition); + const screenPosition = + screen.current.calculateScreenCoords(relativePosition); el.style.left = `${screenPosition.x}px`; el.style.top = `${screenPosition.y}px`; el.style.display = 'block'; }); this.updateRAF = requestAnimationFrame(() => this.update()); - } + }; isLinking = (node) => { const { connectFrom } = this.props; @@ -95,28 +104,34 @@ export default class NodeLayout extends React.Component { isHighlighted = (node) => { const { highlightAttribute } = this.props; return ( - !isEmpty(highlightAttribute) - && get(node, [entityAttributesProperty, highlightAttribute], false) === true + !isEmpty(highlightAttribute) && + get(node, [entityAttributesProperty, highlightAttribute], false) === true ); }; isDisabled = (node) => { - const { - connectFrom, - originRestriction, - destinationRestriction, - } = this.props; + const { connectFrom, originRestriction, destinationRestriction } = + this.props; - const { network: { nodes } } = this.context; + const { + network: { nodes }, + } = this.context; // Node is disabled if type is same as originRestriction, unless there is a connectFrom // If there is a connectFrom, we need to check other things. - if (!connectFrom && originRestriction && node.type === originRestriction) { return true; } + if (!connectFrom && originRestriction && node.type === originRestriction) { + return true; + } // Not disabled if we aren't linking, or if the node is the origin - if (!connectFrom || connectFrom === node[entityPrimaryKeyProperty]) { return false; } + if (!connectFrom || connectFrom === node[entityPrimaryKeyProperty]) { + return false; + } - const originType = find(nodes, [entityPrimaryKeyProperty, connectFrom]).type; + const originType = find(nodes, [ + entityPrimaryKeyProperty, + connectFrom, + ]).type; const thisType = get(node, 'type'); if (destinationRestriction === 'same') { @@ -143,10 +158,7 @@ export default class NodeLayout extends React.Component { const { updateNode } = this.props; - const { - x, - y, - } = delta; + const { x, y } = delta; const relativeDelta = screen.current.calculateRelativeCoords(delta); @@ -161,11 +173,9 @@ export default class NodeLayout extends React.Component { const nodeType = get(nodes, [index, 'type']); const layoutVariable = getTwoModeLayoutVariable(twoMode, nodeType, layout); - updateNode( - uuid, - undefined, - { [layoutVariable]: screen.current.calculateRelativeCoords({ x, y }) }, - ); + updateNode(uuid, undefined, { + [layoutVariable]: screen.current.calculateRelativeCoords({ x, y }), + }); }; handleDragMove = (uuid, index, delta) => { @@ -179,10 +189,7 @@ export default class NodeLayout extends React.Component { const { updateNode } = this.props; - const { - x, - y, - } = delta; + const { x, y } = delta; const relativeDelta = screen.current.calculateRelativeCoords(delta); @@ -197,11 +204,9 @@ export default class NodeLayout extends React.Component { const nodeType = get(nodes, [index, 'type']); const layoutVariable = getTwoModeLayoutVariable(twoMode, nodeType, layout); - updateNode( - uuid, - undefined, - { [layoutVariable]: screen.current.calculateRelativeCoords({ x, y }) }, - ); + updateNode(uuid, undefined, { + [layoutVariable]: screen.current.calculateRelativeCoords({ x, y }), + }); }; handleDragEnd = (uuid, index, { x, y }) => { @@ -213,9 +218,7 @@ export default class NodeLayout extends React.Component { screen, } = this.context; - const { - updateNode, - } = this.props; + const { updateNode } = this.props; if (allowAutomaticLayout) { const { simulationEnabled, releaseNode } = simulation; @@ -229,17 +232,17 @@ export default class NodeLayout extends React.Component { const nodeType = get(nodes, [index, 'type']); const layoutVariable = getTwoModeLayoutVariable(twoMode, nodeType, layout); - updateNode( - uuid, - undefined, - { [layoutVariable]: screen.current.calculateRelativeCoords({ x, y }) }, - ); + updateNode(uuid, undefined, { + [layoutVariable]: screen.current.calculateRelativeCoords({ x, y }), + }); }; // When node is dragged this is called last, // we can use that to reset isDragging state handleSelected = (...args) => { - if (this.isDisabled(...args)) { return; } + if (this.isDisabled(...args)) { + return; + } const { onSelected } = this.props; if (this.isDragging) { @@ -254,17 +257,16 @@ export default class NodeLayout extends React.Component { network: { nodes }, } = this.context; - const { - allowPositioning, - allowSelect, - } = this.props; + const { allowPositioning, allowSelect } = this.props; return ( <>
{nodes.map((node, index) => { const el = this.layoutEls[index]; - if (!el) { return null; } + if (!el) { + return null; + } return ( { const el = { @@ -21,12 +21,7 @@ const screenManager = () => { }; const measureScreen = () => { - const { - width, - height, - left, - top, - } = el.current.getBoundingClientRect(); + const { width, height, left, top } = el.current.getBoundingClientRect(); state.width = width; state.height = height; @@ -50,24 +45,17 @@ const screenManager = () => { const { width, height } = state; return { - x: (((x - 0.5) * width) + (0.5 * width)), - y: (((y - 0.5) * height) + (0.5 * height)), + x: (x - 0.5) * width + 0.5 * width, + y: (y - 0.5) * height + 0.5 * height, }; }; // Given a position on the screen calculate the relative coordinate for the viewport const calculateRelativeCoords = ({ x, y, ...rest } = { x: 0, y: 0 }) => { - const { - width, - height, - left: viewportX, - top: viewportY, - } = state; + const { width, height, left: viewportX, top: viewportY } = state; const hasDelta = rest.dy && rest.dx; - const delta = hasDelta - ? { dy: rest.dy / height, dx: rest.dx / width } - : {}; + const delta = hasDelta ? { dy: rest.dy / height, dx: rest.dx / width } : {}; return { x: clamp((x - viewportX) / width, 0, 1), diff --git a/lib/interviewer/components/Canvas/utils.js b/lib/interviewer/components/Canvas/utils.js index 8f6a5788..539a19ce 100644 --- a/lib/interviewer/components/Canvas/utils.js +++ b/lib/interviewer/components/Canvas/utils.js @@ -1,4 +1,4 @@ -import { get } from '../../utils/lodash-replacements'; +import { get } from '../lodash-es'; export const getTwoModeLayoutVariable = (twoMode, nodeType, layout) => { if (!twoMode) { diff --git a/lib/interviewer/components/NodeList.js b/lib/interviewer/components/NodeList.js index 119699b5..d2abefa5 100644 --- a/lib/interviewer/components/NodeList.js +++ b/lib/interviewer/components/NodeList.js @@ -1,17 +1,17 @@ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; import { compose } from '@reduxjs/toolkit'; import cx from 'classnames'; -import { find } from 'lodash'; +import { find } from 'lodash-es'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useRef, useState } from 'react'; import { v4 } from 'uuid'; import { getCSSVariableAsString } from '~/lib/ui/utils/CSSVariables'; import { - DragSource, - DropTarget, - MonitorDragSource, - MonitorDropTarget, + DragSource, + DropTarget, + MonitorDragSource, + MonitorDropTarget, } from '../behaviours/DragAndDrop'; import scrollable from '../behaviours/scrollable'; import createSorter from '../utils/createSorter'; diff --git a/lib/interviewer/containers/Canvas/NodeBucket.js b/lib/interviewer/containers/Canvas/NodeBucket.js index 81b1777d..a14a74e3 100644 --- a/lib/interviewer/containers/Canvas/NodeBucket.js +++ b/lib/interviewer/containers/Canvas/NodeBucket.js @@ -1,5 +1,5 @@ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; -import { isNull, isUndefined } from 'lodash'; +import { isNull, isUndefined } from 'lodash-es'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import React, { useContext } from 'react'; @@ -59,5 +59,4 @@ NodeBucket.propTypes = { allowPositioning: PropTypes.bool.isRequired, }; - export default compose(DropObstacle)(NodeBucket); diff --git a/lib/interviewer/containers/Canvas/NodeLayout.js b/lib/interviewer/containers/Canvas/NodeLayout.js index 5b66d4c5..b86619d4 100644 --- a/lib/interviewer/containers/Canvas/NodeLayout.js +++ b/lib/interviewer/containers/Canvas/NodeLayout.js @@ -1,12 +1,15 @@ +import { + entityAttributesProperty, + entityPrimaryKeyProperty, +} from '@codaco/shared-consts'; +import { get } from 'lodash-es'; import { connect } from 'react-redux'; import { compose, withHandlers, withState } from 'recompose'; -import { entityAttributesProperty, entityPrimaryKeyProperty } from '@codaco/shared-consts'; -import { actionCreators as sessionsActions } from '../../ducks/modules/session'; -import withBounds from '../../behaviours/withBounds'; -import { store } from '../../store'; -import { get } from 'lodash'; import { DropTarget } from '../../behaviours/DragAndDrop'; +import withBounds from '../../behaviours/withBounds'; import NodeLayout from '../../components/Canvas/NodeLayout'; +import { actionCreators as sessionsActions } from '../../ducks/modules/session'; +import { store } from '../../store'; const relativeCoords = (container, node) => ({ x: (node.x - container.x) / container.width, @@ -16,109 +19,128 @@ const relativeCoords = (container, node) => ({ const withConnectFrom = withState('connectFrom', 'setConnectFrom', null); const withConnectFromHandler = withHandlers({ - handleConnectFrom: ({ setConnectFrom }) => (id) => { - if (id === null) { - store.dispatch({ - type: 'STOP_SOUND', - sound: 'link', - }); - } else { - store.dispatch({ - type: 'PLAY_SOUND', - sound: 'link', - }); - } + handleConnectFrom: + ({ setConnectFrom }) => + (id) => { + if (id === null) { + store.dispatch({ + type: 'STOP_SOUND', + sound: 'link', + }); + } else { + store.dispatch({ + type: 'PLAY_SOUND', + sound: 'link', + }); + } - setConnectFrom(id); - }, - handleResetConnectFrom: ({ setConnectFrom }) => () => setConnectFrom(null), + setConnectFrom(id); + }, + handleResetConnectFrom: + ({ setConnectFrom }) => + () => + setConnectFrom(null), }); const withDropHandlers = withHandlers({ - accepts: () => ({ meta }) => meta.itemType === 'POSITIONED_NODE', - onDrop: ({ - updateNode, layout, twoMode, width, height, x, y, - }) => (item) => { - const layoutVariable = twoMode ? layout[item.meta.type] : layout; + accepts: + () => + ({ meta }) => + meta.itemType === 'POSITIONED_NODE', + onDrop: + ({ updateNode, layout, twoMode, width, height, x, y }) => + (item) => { + const layoutVariable = twoMode ? layout[item.meta.type] : layout; - updateNode( - item.meta[entityPrimaryKeyProperty], - {}, - { - [layoutVariable]: relativeCoords({ - width, height, x, y, - }, item), - }, - ); - }, + updateNode( + item.meta[entityPrimaryKeyProperty], + {}, + { + [layoutVariable]: relativeCoords( + { + width, + height, + x, + y, + }, + item, + ), + }, + ); + }, }); const withSelectHandlers = compose( withHandlers({ - connectNode: ({ - nodes, - createEdge, - connectFrom, - handleConnectFrom, - toggleEdge, - originRestriction, - }) => (nodeId) => { - // If edge creation is disabled, return - if (!createEdge) { return; } + connectNode: + ({ + nodes, + createEdge, + connectFrom, + handleConnectFrom, + toggleEdge, + originRestriction, + }) => + (nodeId) => { + // If edge creation is disabled, return + if (!createEdge) { + return; + } - // If the target and source node are the same, deselect - if (connectFrom === nodeId) { - handleConnectFrom(null); - return; - } + // If the target and source node are the same, deselect + if (connectFrom === nodeId) { + handleConnectFrom(null); + return; + } - // If there isn't a target node yet, and the type isn't restricted, - // set the selected node into the linking state - if (!connectFrom) { - const nodeType = get(nodes, [nodeId, 'type']); + // If there isn't a target node yet, and the type isn't restricted, + // set the selected node into the linking state + if (!connectFrom) { + const nodeType = get(nodes, [nodeId, 'type']); - // If the node type is restricted, return - if (originRestriction && nodeType === originRestriction) { return; } + // If the node type is restricted, return + if (originRestriction && nodeType === originRestriction) { + return; + } - handleConnectFrom(nodeId); - return; - } + handleConnectFrom(nodeId); + return; + } - // Either add or remove an edge - if (connectFrom !== nodeId) { - toggleEdge({ - from: connectFrom, - to: nodeId, - type: createEdge, - }); - } + // Either add or remove an edge + if (connectFrom !== nodeId) { + toggleEdge({ + from: connectFrom, + to: nodeId, + type: createEdge, + }); + } - // Reset the node linking state - handleConnectFrom(null); - }, - toggleHighlightAttribute: ({ - allowHighlighting, highlightAttribute, toggleHighlight, - }) => (node) => { - if (!allowHighlighting) { return; } - const newVal = !node[entityAttributesProperty][highlightAttribute]; - toggleHighlight( - node[entityPrimaryKeyProperty], - { [highlightAttribute]: newVal }, - ); - }, + // Reset the node linking state + handleConnectFrom(null); + }, + toggleHighlightAttribute: + ({ allowHighlighting, highlightAttribute, toggleHighlight }) => + (node) => { + if (!allowHighlighting) { + return; + } + const newVal = !node[entityAttributesProperty][highlightAttribute]; + toggleHighlight(node[entityPrimaryKeyProperty], { + [highlightAttribute]: newVal, + }); + }, }), withHandlers({ - onSelected: ({ - allowHighlighting, - connectNode, - toggleHighlightAttribute, - }) => (node) => { - if (!allowHighlighting) { - connectNode(node[entityPrimaryKeyProperty]); - } else { - toggleHighlightAttribute(node); - } - }, + onSelected: + ({ allowHighlighting, connectNode, toggleHighlightAttribute }) => + (node) => { + if (!allowHighlighting) { + connectNode(node[entityPrimaryKeyProperty]); + } else { + toggleHighlightAttribute(node); + } + }, }), ); @@ -136,4 +158,4 @@ export default compose( withDropHandlers, withSelectHandlers, DropTarget, -)(NodeLayout); \ No newline at end of file +)(NodeLayout); diff --git a/lib/interviewer/containers/Canvas/PresetSwitcherKey.js b/lib/interviewer/containers/Canvas/PresetSwitcherKey.js index 6c8a3026..a5b12ce6 100644 --- a/lib/interviewer/containers/Canvas/PresetSwitcherKey.js +++ b/lib/interviewer/containers/Canvas/PresetSwitcherKey.js @@ -1,21 +1,21 @@ +import cx from 'classnames'; +import { isEmpty } from 'lodash-es'; +import PropTypes from 'prop-types'; import React, { Component } from 'react'; +import { createPortal } from 'react-dom'; import { connect } from 'react-redux'; import { compose } from 'recompose'; -import PropTypes from 'prop-types'; -import cx from 'classnames'; -import { isEmpty } from 'lodash'; +import { MarkdownLabel, Radio } from '~/lib/ui/components/Fields'; import Icon from '~/lib/ui/components/Icon'; -import { Radio, MarkdownLabel } from '~/lib/ui/components/Fields'; -import Accordion from './Accordion'; import { + makeGetCategoricalOptions, makeGetEdgeColor, makeGetEdgeLabel, makeGetNodeAttributeLabel, - makeGetCategoricalOptions, } from '../../selectors/network'; -import { get } from '../../utils/lodash-replacements'; -import { createPortal } from 'react-dom'; import { getCurrentStage } from '../../selectors/session'; +import { get } from '../lodash-es'; +import Accordion from './Accordion'; class PresetSwitcherKey extends Component { constructor() { @@ -156,5 +156,4 @@ const makeMapStateToProps = () => { return mapStateToProps; }; - export default compose(connect(makeMapStateToProps))(PresetSwitcherKey); diff --git a/lib/interviewer/containers/Canvas/Radar.js b/lib/interviewer/containers/Canvas/Radar.js index 39bff854..472b5bd0 100644 --- a/lib/interviewer/containers/Canvas/Radar.js +++ b/lib/interviewer/containers/Canvas/Radar.js @@ -1,7 +1,6 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { range, last, zipWith } from 'lodash'; import color from 'color'; +import { last, range, zipWith } from 'lodash-es'; +import PropTypes from 'prop-types'; import { getCSSVariableAsString } from '~/lib/ui/utils/CSSVariables'; const equalByArea = (outerRadius, n) => { @@ -11,22 +10,20 @@ const equalByArea = (outerRadius, n) => { return range(1, n + 1) .reduce((memo) => { const previous = last(memo) || 0; - const next = (b + (previous ** 2)) ** 0.5; + const next = (b + previous ** 2) ** 0.5; return [...memo, next]; }, []) .reverse(); }; -const equalByIncrement = (outerRadius, n) => range(1, n + 1) - .map((v) => (v * outerRadius) / n) - .reverse(); +const equalByIncrement = (outerRadius, n) => + range(1, n + 1) + .map((v) => (v * outerRadius) / n) + .reverse(); // Weight towards `a` by factor -const weightedAverage = (a, b, factor = 1) => zipWith( - a, - b, - (c, d) => ((c * factor) + d) / (1 + factor), -); +const weightedAverage = (a, b, factor = 1) => + zipWith(a, b, (c, d) => (c * factor + d) / (1 + factor)); const Radar = ({ n = 4, skewed = true }) => { const num = parseInt(n, 10); @@ -39,7 +36,9 @@ const Radar = ({ n = 4, skewed = true }) => { : equalByIncrement(50, num); const colorRing = color(getCSSVariableAsString('--nc-ring--accent')); - const colorBackground = color(getCSSVariableAsString('--nc-ring--background')); + const colorBackground = color( + getCSSVariableAsString('--nc-ring--background'), + ); const ringFill = (ring) => { const mix = (ring + 1) / num; @@ -49,9 +48,20 @@ const Radar = ({ n = 4, skewed = true }) => { }; return ( - + {radii.map((radius, index) => ( - + ))} ); diff --git a/lib/interviewer/containers/CategoricalList/CategoricalList.js b/lib/interviewer/containers/CategoricalList/CategoricalList.js index e63e44a9..909b1289 100644 --- a/lib/interviewer/containers/CategoricalList/CategoricalList.js +++ b/lib/interviewer/containers/CategoricalList/CategoricalList.js @@ -1,19 +1,25 @@ -import React, { Component } from 'react'; +import { entityAttributesProperty } from '@codaco/shared-consts'; import { compose } from '@reduxjs/toolkit'; -import { throttle } from 'lodash'; -import { connect } from 'react-redux'; -import PropTypes from 'prop-types'; -import { Flipper } from 'react-flip-toolkit'; import cx from 'classnames'; import color from 'color'; +import { throttle } from 'lodash-es'; +import PropTypes from 'prop-types'; +import React, { Component } from 'react'; +import { Flipper } from 'react-flip-toolkit'; +import { connect } from 'react-redux'; import { getCSSVariableAsString } from '~/lib/ui/utils/CSSVariables'; -import { entityAttributesProperty } from '@codaco/shared-consts'; import { MonitorDragSource } from '../../behaviours/DragAndDrop'; +import { + getNetworkNodesForType, + makeGetVariableOptions, +} from '../../selectors/interface'; +import { + getPromptOtherVariable, + getPromptVariable, +} from '../../selectors/prop'; import getAbsoluteBoundingRect from '../../utils/getAbsoluteBoundingRect'; import CategoricalListItem from './CategoricalListItem'; -import { getItemSize, getExpandedSize } from './helpers'; -import { getNetworkNodesForType, makeGetVariableOptions } from '../../selectors/interface'; -import { getPromptOtherVariable, getPromptVariable } from '../../selectors/prop'; +import { getExpandedSize, getItemSize } from './helpers'; const isSpecialValue = (value) => { if (value === null) { @@ -26,8 +32,8 @@ const isSpecialValue = (value) => { }; /** - * CategoricalList: Renders a list of categorical bin items - */ + * CategoricalList: Renders a list of categorical bin items + */ class CategoricalList extends Component { constructor(props) { super(props); @@ -76,11 +82,7 @@ class CategoricalList extends Component { const expandedSize = getExpandedSize(bounds); - const itemSize = getItemSize( - bounds, - bins.length, - this.isExpanded, - ); + const itemSize = getItemSize(bounds, bins.length, this.isExpanded); return { expandedSize, @@ -94,8 +96,11 @@ class CategoricalList extends Component { } getCatColor = (itemNumber, bin) => { - if (itemNumber < 0) { return null; } - const categoryColor = this.colorPresets[itemNumber % this.colorPresets.length]; + if (itemNumber < 0) { + return null; + } + const categoryColor = + this.colorPresets[itemNumber % this.colorPresets.length]; if (isSpecialValue(bin.value)) { return color(categoryColor).desaturate(0.6).darken(0.5).toString(); @@ -122,31 +127,26 @@ class CategoricalList extends Component { expandedBinIndex, } = this.props; - return bins - .map((bin, index) => ( - - )); + return bins.map((bin, index) => ( + + )); }; render() { - const { - bins, - expandedBinIndex, - onExpandBin, - } = this.props; + const { bins, expandedBinIndex, onExpandBin } = this.props; const listClasses = cx( 'categorical-list', @@ -167,12 +167,12 @@ class CategoricalList extends Component {
{ e.stopPropagation(); onExpandBin(); }} + onClick={(e) => { + e.stopPropagation(); + onExpandBin(); + }} > - + {expandedBin} {otherBins} @@ -191,18 +191,16 @@ CategoricalList.propTypes = { onExpandBin: PropTypes.func.isRequired, }; -const matchVariable = (node, variable, value) => ( - node[entityAttributesProperty][variable] - && node[entityAttributesProperty][variable].includes(value) -); +const matchVariable = (node, variable, value) => + node[entityAttributesProperty][variable] && + node[entityAttributesProperty][variable].includes(value); -const hasOtherVariable = (node, otherVariable) => ( - otherVariable && node[entityAttributesProperty][otherVariable] !== null -); +const hasOtherVariable = (node, otherVariable) => + otherVariable && node[entityAttributesProperty][otherVariable] !== null; -const matchBin = (bin, variable) => (node) => ( - matchVariable(node, variable, bin.value) || hasOtherVariable(node, bin.otherVariable) -); +const matchBin = (bin, variable) => (node) => + matchVariable(node, variable, bin.value) || + hasOtherVariable(node, bin.otherVariable); const appendNodesForBin = (nodes, activePromptVariable) => (bin) => ({ ...bin, @@ -215,9 +213,11 @@ function makeMapStateToProps() { return function mapStateToProps(state, props) { const stageNodes = getNetworkNodesForType(state, props); const activePromptVariable = getPromptVariable(state, props); - const [promptOtherVariable, promptOtherVariablePrompt] = getPromptOtherVariable(state, props); - const bins = getCategoricalValues(state, props) - .map(appendNodesForBin(stageNodes, activePromptVariable)); + const [promptOtherVariable, promptOtherVariablePrompt] = + getPromptOtherVariable(state, props); + const bins = getCategoricalValues(state, props).map( + appendNodesForBin(stageNodes, activePromptVariable), + ); return { activePromptVariable, @@ -228,7 +228,6 @@ function makeMapStateToProps() { }; } - export default compose( connect(makeMapStateToProps), MonitorDragSource(['isDragging', 'meta']), diff --git a/lib/interviewer/containers/CategoricalList/CategoricalListItem.js b/lib/interviewer/containers/CategoricalList/CategoricalListItem.js index 5b1de360..d81fe265 100644 --- a/lib/interviewer/containers/CategoricalList/CategoricalListItem.js +++ b/lib/interviewer/containers/CategoricalList/CategoricalListItem.js @@ -8,7 +8,7 @@ import { getEntityAttributes } from '../../ducks/modules/network'; import { actionCreators as sessionActions } from '../../ducks/modules/session'; import { getNodeColor, getNodeLabel } from '../../selectors/network'; import { getSubjectType } from '../../selectors/prop'; -import { get } from '../../utils/lodash-replacements'; +import { get } from '../lodash-es'; import Overlay from '../Overlay'; import OtherVariableForm from './OtherVariableForm'; diff --git a/lib/interviewer/containers/Field.js b/lib/interviewer/containers/Field.js index ddce09fb..4610d966 100644 --- a/lib/interviewer/containers/Field.js +++ b/lib/interviewer/containers/Field.js @@ -1,11 +1,11 @@ -import React, { useMemo } from 'react'; +import { get, map, toPairs } from 'lodash-es'; import PropTypes from 'prop-types'; +import { useMemo } from 'react'; import { useStore } from 'react-redux'; import { Field as ReduxFormField } from 'redux-form'; -import { map, toPairs, get } from 'lodash'; import * as Fields from '~/lib/ui/components/Fields'; -import validations from '../utils/Validations'; import { FormComponent } from '../protocol-consts'; +import validations from '../utils/Validations'; const ComponentTypeNotFound = (componentType) => { const ComponentTypeNotFoundInner = () => ( diff --git a/lib/interviewer/containers/Interfaces/DyadCensus/DyadCensus.js b/lib/interviewer/containers/Interfaces/DyadCensus/DyadCensus.js index 08fc2eb6..9a70df2e 100644 --- a/lib/interviewer/containers/Interfaces/DyadCensus/DyadCensus.js +++ b/lib/interviewer/containers/Interfaces/DyadCensus/DyadCensus.js @@ -9,7 +9,7 @@ import { Markdown } from '~/lib/ui/components/Fields'; import { usePrompts } from '../../../behaviours/withPrompt'; import Prompts from '../../../components/Prompts'; import { getEdgeColor, getNetworkEdges } from '../../../selectors/network'; -import { get } from '../../../utils/lodash-replacements'; +import { get } from '../../lodash-es'; import { getNodePair, getPairs } from './helpers'; import Pair from './Pair'; import useAutoAdvance from './useAutoAdvance'; @@ -46,18 +46,14 @@ const introVariants = { const DyadCensus = (props) => { const { registerBeforeNext, stage, getNavigationHelpers } = props; - const { - moveForward, - } = getNavigationHelpers(); + const { moveForward } = getNavigationHelpers(); const [isIntroduction, setIsIntroduction] = useState(true); const [isForwards, setForwards] = useState(true); const [isValid, setIsValid] = useState(true); const { - prompt: { - createEdge, - }, + prompt: { createEdge }, promptIndex, prompts, } = usePrompts(); @@ -132,7 +128,7 @@ const DyadCensus = (props) => { if (stepsState.isStepStart) { // IMPORTANT! `previousStep()` needs to be called still, so that the useSteps - // state reflects the change in substep! Alternatively it could be + // state reflects the change in substep! Alternatively it could be // refactored to use the prompt index in place of the step. previousStep(); return true; // Go back to the previous prompt @@ -148,7 +144,9 @@ const DyadCensus = (props) => { const handleChange = (nextValue) => () => { // 'debounce' clicks, one click (isTouched) should start auto-advance // so ignore further clicks - if (isTouched) { return; } + if (isTouched) { + return; + } setEdge(nextValue); }; diff --git a/lib/interviewer/containers/Interfaces/EgoForm.js b/lib/interviewer/containers/Interfaces/EgoForm.js index 46bda543..df66740a 100644 --- a/lib/interviewer/containers/Interfaces/EgoForm.js +++ b/lib/interviewer/containers/Interfaces/EgoForm.js @@ -1,4 +1,4 @@ -import { debounce } from 'lodash'; +import { debounce } from 'lodash-es'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useCallback, useEffect, useMemo, useState } from 'react'; diff --git a/lib/interviewer/containers/Interfaces/NameGenerator.js b/lib/interviewer/containers/Interfaces/NameGenerator.js index 65eb9c48..cc85a277 100644 --- a/lib/interviewer/containers/Interfaces/NameGenerator.js +++ b/lib/interviewer/containers/Interfaces/NameGenerator.js @@ -1,50 +1,49 @@ -import React, { useEffect, useRef, useState } from 'react'; -import { useDispatch, useSelector } from 'react-redux'; -import PropTypes from 'prop-types'; -import { has, omit } from 'lodash'; -import { createPortal } from 'react-dom'; import { entityAttributesProperty, entityPrimaryKeyProperty, } from '@codaco/shared-consts'; -import Prompts from '../../components/Prompts'; +import { has, omit } from 'lodash'; +import PropTypes from 'prop-types'; +import { useEffect, useRef, useState } from 'react'; +import { createPortal } from 'react-dom'; +import { useDispatch, useSelector } from 'react-redux'; +import NodeBin from '~/lib/interviewer/components/NodeBin'; +import NodeList from '~/lib/interviewer/components/NodeList'; import { usePrompts } from '../../behaviours/withPrompt'; +import Prompts from '../../components/Prompts'; import { actionCreators as sessionActions } from '../../ducks/modules/session'; +import usePropSelector from '../../hooks/usePropSelector'; import { - getStageNodeCount, getNetworkNodesForPrompt, + getStageNodeCount, } from '../../selectors/interface'; import { - getPromptModelData as getPromptNodeModelData, getNodeIconName, + getPromptModelData as getPromptNodeModelData, } from '../../selectors/name-generator'; -import NodePanels from '../NodePanels'; +import { getNodeColor, getNodeTypeLabel } from '../../selectors/network'; +import { getAdditionalAttributesSelector } from '../../selectors/prop'; +import { get } from '../lodash-es'; import NodeForm from '../NodeForm'; -import NodeList from '~/lib/interviewer/components/NodeList'; -import NodeBin from '~/lib/interviewer/components/NodeBin'; +import NodePanels from '../NodePanels'; +import QuickNodeForm from '../QuickNodeForm'; import { MaxNodesMet, maxNodesWithDefault, MinNodesNotMet, minNodesWithDefault, } from './utils/StageLevelValidation'; -import { get } from '../../utils/lodash-replacements'; -import QuickNodeForm from '../QuickNodeForm'; -import { getNodeColor, getNodeTypeLabel } from '../../selectors/network'; -import usePropSelector from '../../hooks/usePropSelector'; -import { getAdditionalAttributesSelector } from '../../selectors/prop'; -export const nameGeneratorHandleBeforeLeaving = (isLastPrompt, stageNodeCount, minNodes, setShowMinWarning) => (direction) => { - if ( - (isLastPrompt && direction === 'forwards') && - stageNodeCount < minNodes - ) { - setShowMinWarning(true); - return false; - } +export const nameGeneratorHandleBeforeLeaving = + (isLastPrompt, stageNodeCount, minNodes, setShowMinWarning) => + (direction) => { + if (isLastPrompt && direction === 'forwards' && stageNodeCount < minNodes) { + setShowMinWarning(true); + return false; + } - return true; -}; + return true; + }; const NameGenerator = (props) => { const { registerBeforeNext, stage } = props; @@ -90,7 +89,14 @@ const NameGenerator = (props) => { } }, [stageNodeCount, minNodes]); - registerBeforeNext(nameGeneratorHandleBeforeLeaving(isLastPrompt, stageNodeCount, minNodes, setShowMinWarning)); + registerBeforeNext( + nameGeneratorHandleBeforeLeaving( + isLastPrompt, + stageNodeCount, + minNodes, + setShowMinWarning, + ), + ); /** * Drop node handler @@ -154,20 +160,18 @@ const NameGenerator = (props) => { dropHandler={(meta) => removeNode(meta[entityPrimaryKeyProperty])} id="NODE_BIN" /> - { - createPortal( - , - document.getElementById('stage'), - )} - { - createPortal( - setShowMinWarning(false)} - />, - document.getElementById('stage'), - )} + {createPortal( + , + document.getElementById('stage'), + )} + {createPortal( + setShowMinWarning(false)} + />, + document.getElementById('stage'), + )} {form && ( ( * Name Generator (unified) Roster Interface */ const NameGeneratorRoster = (props) => { - const { - stage, - registerBeforeNext, - } = props; + const { stage, registerBeforeNext } = props; const { promptIndex, isLastPrompt } = usePrompts(); @@ -107,7 +99,14 @@ const NameGeneratorRoster = (props) => { const [showMinWarning, setShowMinWarning] = useState(false); - registerBeforeNext(nameGeneratorHandleBeforeLeaving(isLastPrompt, stageNodeCount, minNodes, setShowMinWarning)); + registerBeforeNext( + nameGeneratorHandleBeforeLeaving( + isLastPrompt, + stageNodeCount, + minNodes, + setShowMinWarning, + ), + ); useEffect(() => { setShowMinWarning(false); @@ -178,17 +177,13 @@ const NameGeneratorRoster = (props) => { }); const disabled = useMemo( - () => itemsStatus.isLoading || (stageNodeCount >= maxNodes), + () => itemsStatus.isLoading || stageNodeCount >= maxNodes, [stageNodeCount, maxNodes, itemsStatus.isLoading], ); return (
- -
+
{ title="Available to add" columns={countColumns} placeholder={ - itemsStatus.error && ( - - ) + itemsStatus.error && } itemType="SOURCE_NODES" // drop type excludeItems={excludeItems} @@ -218,9 +211,7 @@ const NameGeneratorRoster = (props) => { dragComponent={Node} sortOptions={sortOptions} searchOptions={fuseOptions} - accepts={({ meta: { itemType } }) => - itemType !== 'SOURCE_NODES' - } + accepts={({ meta: { itemType } }) => itemType !== 'SOURCE_NODES'} onDrop={handleRemoveNode} dropNodeColor={dropNodeColor} disabled={disabled} @@ -233,9 +224,7 @@ const NameGeneratorRoster = (props) => { id="node-list" className={nodeListClasses} itemType="ADDED_NODES" - accepts={({ meta: { itemType } }) => - itemType !== 'ADDED_NODES' - } + accepts={({ meta: { itemType } }) => itemType !== 'ADDED_NODES'} onDrop={handleAddNode} items={nodesForPrompt.map((item) => ({ id: item._uid, diff --git a/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useFuseOptions.js b/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useFuseOptions.js index 22e0e1b4..6a57d065 100644 --- a/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useFuseOptions.js +++ b/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useFuseOptions.js @@ -1,6 +1,5 @@ +import { compact, get, isEmpty } from 'lodash-es'; import { useMemo } from 'react'; -import { compact, isEmpty } from 'lodash'; -import { get } from 'lodash'; const defaultFuseOptions = { keys: [['props', 'label']], diff --git a/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useSortableProperties.js b/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useSortableProperties.js index 3f4559e1..01981cdd 100644 --- a/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useSortableProperties.js +++ b/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useSortableProperties.js @@ -1,8 +1,8 @@ +import { compact } from 'lodash-es'; import { useMemo } from 'react'; -import { compact } from 'lodash'; -import { convertNamesToUUIDs } from './helpers'; -import { get } from '../../../utils/lodash-replacements'; import { mapNCType } from '../../../utils/createSorter'; +import { get } from '../../lodash-es'; +import { convertNamesToUUIDs } from './helpers'; /** * Convert protocol config options into a format diff --git a/lib/interviewer/containers/Interfaces/Narrative.js b/lib/interviewer/containers/Interfaces/Narrative.js index 4bed73b8..ea30be04 100644 --- a/lib/interviewer/containers/Interfaces/Narrative.js +++ b/lib/interviewer/containers/Interfaces/Narrative.js @@ -1,19 +1,19 @@ +import { entityAttributesProperty } from '@codaco/shared-consts'; +import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { connect } from 'react-redux'; import { compose } from 'recompose'; -import PropTypes from 'prop-types'; import ConvexHulls from '~/lib/interviewer/components/Canvas/ConvexHulls'; -import Background from '../Canvas/Background'; -import PresetSwitcher from '../Canvas/PresetSwitcher'; -import Annotations from '../Canvas/Annotations'; -import { getNetworkEdges, getNetworkNodes } from '../../selectors/network'; -import { edgesToCoords } from '../../selectors/canvas'; -import { get } from '../../utils/lodash-replacements'; -import { LayoutProvider } from '../../contexts/LayoutContext'; -import { entityAttributesProperty } from '@codaco/shared-consts'; import NodeLayout from '~/lib/interviewer/containers/Canvas/NodeLayout'; -import NarrativeEdgeLayout from '../../components/Canvas/NarrativeEdgeLayout'; import Canvas from '../../components/Canvas/Canvas'; +import NarrativeEdgeLayout from '../../components/Canvas/NarrativeEdgeLayout'; +import { LayoutProvider } from '../../contexts/LayoutContext'; +import { edgesToCoords } from '../../selectors/canvas'; +import { getNetworkEdges, getNetworkNodes } from '../../selectors/network'; +import Annotations from '../Canvas/Annotations'; +import Background from '../Canvas/Background'; +import PresetSwitcher from '../Canvas/PresetSwitcher'; +import { get } from '../lodash-es'; /** * Narrative Interface diff --git a/lib/interviewer/containers/Interfaces/OrdinalBin.js b/lib/interviewer/containers/Interfaces/OrdinalBin.js index bf58be39..c204f1c4 100644 --- a/lib/interviewer/containers/Interfaces/OrdinalBin.js +++ b/lib/interviewer/containers/Interfaces/OrdinalBin.js @@ -1,14 +1,13 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { isNil } from 'lodash'; import { entityAttributesProperty } from '@codaco/shared-consts'; -import Prompts from '../../components/Prompts'; -import OrdinalBins from '../OrdinalBins'; +import { isNil } from 'lodash-es'; +import PropTypes from 'prop-types'; +import { usePrompts } from '../../behaviours/withPrompt'; import MultiNodeBucket from '../../components/MultiNodeBucket'; +import Prompts from '../../components/Prompts'; +import usePropSelector from '../../hooks/usePropSelector'; import { getNetworkNodesForType } from '../../selectors/interface'; import { getPromptVariable } from '../../selectors/prop'; -import { usePrompts } from '../../behaviours/withPrompt'; -import usePropSelector from '../../hooks/usePropSelector'; +import OrdinalBins from '../OrdinalBins'; /** * OrdinalBin Interface diff --git a/lib/interviewer/containers/Interfaces/Sociogram.js b/lib/interviewer/containers/Interfaces/Sociogram.js index 35f8472a..9a1b3b5d 100644 --- a/lib/interviewer/containers/Interfaces/Sociogram.js +++ b/lib/interviewer/containers/Interfaces/Sociogram.js @@ -1,16 +1,16 @@ -import React, { useMemo, useRef, useState } from 'react'; -import { isArray } from 'lodash'; import { bindActionCreators } from '@reduxjs/toolkit'; -import { connect, useSelector } from 'react-redux'; -import { withHandlers, compose } from 'recompose'; +import { isArray } from 'lodash-es'; import PropTypes from 'prop-types'; +import { useMemo, useRef, useState } from 'react'; +import { connect, useSelector } from 'react-redux'; +import { compose, withHandlers } from 'recompose'; +import useTimeout from '~/lib/ui/hooks/useTimeout'; import withPrompt from '../../behaviours/withPrompt'; -import { LayoutProvider } from '../../contexts/LayoutContext'; import Canvas from '../../components/Canvas/Canvas'; -import NodeBucket from '../Canvas/NodeBucket'; import EdgeLayout from '../../components/Canvas/EdgeLayout'; import SimulationPanel from '../../components/Canvas/SimulationPanel'; -import Background from '../Canvas/Background'; +import CollapsablePrompts from '../../components/CollapsablePrompts'; +import { LayoutProvider } from '../../contexts/LayoutContext'; import { actionCreators as resetActions } from '../../ducks/modules/reset'; import { getEdges, @@ -18,35 +18,35 @@ import { getNodes, getPlacedNodes, } from '../../selectors/canvas'; -import CollapsablePrompts from '../../components/CollapsablePrompts'; -import { get } from '../../utils/lodash-replacements'; import { getAssetUrlFromId } from '../../selectors/protocol'; +import Background from '../Canvas/Background'; +import NodeBucket from '../Canvas/NodeBucket'; import NodeLayout from '../Canvas/NodeLayout'; -import useTimeout from '~/lib/ui/hooks/useTimeout'; +import { get } from '../lodash-es'; const withResetInterfaceHandler = withHandlers({ handleResetInterface: ({ resetPropertyForAllNodes, resetEdgesOfType, prompts }) => - () => { - prompts.forEach((prompt) => { - if (prompt.edges) { - resetEdgesOfType(prompt.edges.creates); - } - - const layoutVariable = get(prompt, 'layout.layoutVariable', null); - if (!layoutVariable) { - return; - } - - if (typeof layoutVariable === 'string') { - resetPropertyForAllNodes(layoutVariable); - } else { - Object.keys(layoutVariable).forEach((type) => { - resetPropertyForAllNodes(layoutVariable[type]); - }); - } - }); - }, + () => { + prompts.forEach((prompt) => { + if (prompt.edges) { + resetEdgesOfType(prompt.edges.creates); + } + + const layoutVariable = get(prompt, 'layout.layoutVariable', null); + if (!layoutVariable) { + return; + } + + if (typeof layoutVariable === 'string') { + resetPropertyForAllNodes(layoutVariable); + } else { + Object.keys(layoutVariable).forEach((type) => { + resetPropertyForAllNodes(layoutVariable[type]); + }); + } + }); + }, }); /** @@ -97,12 +97,12 @@ const Sociogram = (props) => { const nodes = allowAutomaticLayout ? allNodes : placedNodes; const edges = useSelector((state) => getEdges(state, props)); - /** + /** * Hack to force the node layout to re-render after the interface has finished - * animating in. This is necessary because withBounds calculates the + * animating in. This is necessary because withBounds calculates the * boundingClientRect of the interface, which has an incorrect y value when * the stage is animating in. Should be removed after we refactor! - */ + */ const [ready, setReady] = useState(false); useTimeout(() => { setReady(true); diff --git a/lib/interviewer/containers/Interfaces/TieStrengthCensus/TieStrengthCensus.js b/lib/interviewer/containers/Interfaces/TieStrengthCensus/TieStrengthCensus.js index 99f93d87..97a4dc04 100644 --- a/lib/interviewer/containers/Interfaces/TieStrengthCensus/TieStrengthCensus.js +++ b/lib/interviewer/containers/Interfaces/TieStrengthCensus/TieStrengthCensus.js @@ -9,8 +9,11 @@ import { Markdown } from '~/lib/ui/components/Fields'; import { usePrompts } from '../../../behaviours/withPrompt'; import Prompts from '../../../components/Prompts'; import { getNetworkNodesForType } from '../../../selectors/interface'; -import { getEdgeColor, getNetworkEdges as getEdges } from '../../../selectors/network'; -import { get } from '../../../utils/lodash-replacements'; +import { + getEdgeColor, + getNetworkEdges as getEdges, +} from '../../../selectors/network'; +import { get } from '../../lodash-es'; import useAutoAdvance from '../DyadCensus/useAutoAdvance'; import useEdgeState from '../DyadCensus/useEdgeState'; import useSteps from '../DyadCensus/useSteps'; @@ -45,15 +48,9 @@ const introVariants = { * Dyad Census Interface */ const TieStrengthCensus = (props) => { - const { - registerBeforeNext, - stage, - getNavigationHelpers, - } = props; + const { registerBeforeNext, stage, getNavigationHelpers } = props; - const { - moveForward, - } = getNavigationHelpers(); + const { moveForward } = getNavigationHelpers(); const [isIntroduction, setIsIntroduction] = useState(true); const [isForwards, setForwards] = useState(true); @@ -61,22 +58,22 @@ const TieStrengthCensus = (props) => { const { promptIndex, - prompt: { - createEdge, - edgeVariable, - negativeLabel - }, - prompts + prompt: { createEdge, edgeVariable, negativeLabel }, + prompts, } = usePrompts(); const nodes = usePropSelector(getNetworkNodesForType, props); const edges = usePropSelector(getEdges, props); const edgeColor = usePropSelector(getEdgeColor, { - type: createEdge - }) + type: createEdge, + }); const codebook = usePropSelector(getProtocolCodebook, props); - const edgeVariableOptions = get(codebook, ['edge', createEdge, 'variables', edgeVariable, 'options'], []); + const edgeVariableOptions = get( + codebook, + ['edge', createEdge, 'variables', edgeVariable, 'options'], + [], + ); const pairs = getPairs(nodes); @@ -92,11 +89,7 @@ const TieStrengthCensus = (props) => { // - null: not yet decided // - true: edge exists const { hasEdge, edgeVariableValue, setEdge, isTouched, isChanged } = - useEdgeState( - pair, - edges, - `${stepsState.step}_${stepsState.substep}`, - ); + useEdgeState(pair, edges, `${stepsState.step}_${stepsState.substep}`); registerBeforeNext(async (direction) => { if (direction === 'forwards') { @@ -146,7 +139,7 @@ const TieStrengthCensus = (props) => { if (stepsState.isStepStart) { // IMPORTANT! `previousStep()` needs to be called still, so that the useSteps - // state reflects the change in substep! Alternatively it could be + // state reflects the change in substep! Alternatively it could be // refactored to use the prompt index in place of the step. previousStep(); return true; // Go back to the previous prompt @@ -231,8 +224,9 @@ const TieStrengthCensus = (props) => { // Set the max width of the container based on the number of options // This prevents them getting too wide, but also ensures that they // expand to take up all available space. - maxWidth: `${(edgeVariableOptions.length + 1) * 20 + 3.6 - }rem`, + maxWidth: `${ + (edgeVariableOptions.length + 1) * 20 + 3.6 + }rem`, }} >
@@ -290,4 +284,4 @@ TieStrengthCensus.propTypes = { stage: PropTypes.object.isRequired, }; -export default TieStrengthCensus +export default TieStrengthCensus; diff --git a/lib/interviewer/containers/Interfaces/utils/StageLevelValidation.js b/lib/interviewer/containers/Interfaces/utils/StageLevelValidation.js index 532c0d8e..56dfff80 100644 --- a/lib/interviewer/containers/Interfaces/utils/StageLevelValidation.js +++ b/lib/interviewer/containers/Interfaces/utils/StageLevelValidation.js @@ -1,4 +1,4 @@ -import { defaultTo } from 'lodash'; +import { defaultTo } from 'lodash-es'; import { AnimatePresence, motion } from 'motion/react'; import { useCallback, useEffect, useRef, useState } from 'react'; import { v4 as uuid } from 'uuid'; @@ -171,7 +171,7 @@ export const MaxNodesMet = SelfDismissingNote(() => { return () => { updateReady(false); - } + }; }, [updateReady]); return ( @@ -193,8 +193,8 @@ export const MaxNodesMet = SelfDismissingNote(() => {

- You have added the maximum number of items for this screen. Click the - down arrow to continue. + You have added the maximum number of items for this screen. Click + the down arrow to continue.

diff --git a/lib/interviewer/containers/NodePanel.js b/lib/interviewer/containers/NodePanel.js index d7424275..aee98922 100644 --- a/lib/interviewer/containers/NodePanel.js +++ b/lib/interviewer/containers/NodePanel.js @@ -1,4 +1,5 @@ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; +import { get } from 'lodash-es'; import { PureComponent } from 'react'; import { connect } from 'react-redux'; import { compose } from 'recompose'; @@ -10,7 +11,6 @@ import { getNetworkNodesForPrompt, } from '../selectors/interface'; import { getNetworkEdges, getNetworkEgo } from '../selectors/network'; -import { get } from '../utils/lodash-replacements'; import withExternalData from './withExternalData'; class NodePanel extends PureComponent { @@ -120,7 +120,6 @@ const mapStateToProps = (state, props) => { }; }; - export default compose( withExternalData('externalDataSource', 'externalData'), connect(mapStateToProps), diff --git a/lib/interviewer/containers/NodePanels.js b/lib/interviewer/containers/NodePanels.js index 9a4875b5..404d88b5 100644 --- a/lib/interviewer/containers/NodePanels.js +++ b/lib/interviewer/containers/NodePanels.js @@ -1,5 +1,6 @@ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; import { compose } from '@reduxjs/toolkit'; +import { get } from 'lodash-es'; import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { connect } from 'react-redux'; @@ -9,7 +10,6 @@ import Panels from '../components/Panels'; import { actionCreators as sessionActions } from '../ducks/modules/session'; import { makeGetPanelConfiguration } from '../selectors/name-generator'; import { makeGetAdditionalAttributes } from '../selectors/prop'; -import { get } from '../utils/lodash-replacements'; import NodePanel from './NodePanel'; /** @@ -197,7 +197,6 @@ const mapDispatchToProps = { removeNode: sessionActions.removeNode, }; - export default compose( connect(makeMapStateToProps, mapDispatchToProps), MonitorDragSource(['isDragging', 'meta']), diff --git a/lib/interviewer/containers/OrdinalBins.js b/lib/interviewer/containers/OrdinalBins.js index b233eacd..a115674f 100644 --- a/lib/interviewer/containers/OrdinalBins.js +++ b/lib/interviewer/containers/OrdinalBins.js @@ -1,17 +1,23 @@ -import React, { PureComponent } from 'react'; -import { compose, bindActionCreators } from '@reduxjs/toolkit'; -import { connect } from 'react-redux'; -import PropTypes from 'prop-types'; -import { isNil } from 'lodash'; +import { + entityAttributesProperty, + entityPrimaryKeyProperty, +} from '@codaco/shared-consts'; +import { bindActionCreators, compose } from '@reduxjs/toolkit'; import color from 'color'; +import { isNil } from 'lodash-es'; +import PropTypes from 'prop-types'; +import { PureComponent } from 'react'; +import { connect } from 'react-redux'; import { MarkdownLabel } from '~/lib/ui/components/Fields'; import { getCSSVariableAsString } from '~/lib/ui/utils/CSSVariables'; -import { entityAttributesProperty, entityPrimaryKeyProperty } from '@codaco/shared-consts'; -import { makeGetVariableOptions, getNetworkNodesForType } from '../selectors/interface'; -import { actionCreators as sessionActions } from '../ducks/modules/session'; -import NodeList from '../components/NodeList'; import { MonitorDragSource } from '../behaviours/DragAndDrop'; +import NodeList from '../components/NodeList'; import { getEntityAttributes } from '../ducks/modules/network'; +import { actionCreators as sessionActions } from '../ducks/modules/session'; +import { + getNetworkNodesForType, + makeGetVariableOptions, +} from '../selectors/interface'; import { getPromptVariable } from '../selectors/prop'; class OrdinalBins extends PureComponent { @@ -28,35 +34,40 @@ class OrdinalBins extends PureComponent { calculateAccentColor = (index, missingValue) => { const { bins } = this.props; if (missingValue) { - return color(getCSSVariableAsString('--color-rich-black')).mix(this.backgroundColor(), 0.8).toString(); + return color(getCSSVariableAsString('--color-rich-black')) + .mix(this.backgroundColor(), 0.8) + .toString(); } - const blendRatio = 1 / (bins.length) * index; - return this.promptColor().mix(this.backgroundColor(), blendRatio).toString(); + const blendRatio = (1 / bins.length) * index; + return this.promptColor() + .mix(this.backgroundColor(), blendRatio) + .toString(); }; calculatePanelColor = (index, missingValue) => { const { bins } = this.props; if (missingValue) { - return color(getCSSVariableAsString('--color-rich-black')).mix(this.backgroundColor(), 0.9).toString(); + return color(getCSSVariableAsString('--color-rich-black')) + .mix(this.backgroundColor(), 0.9) + .toString(); } - const blendRatio = 1 / (bins.length) * index; - return color(getCSSVariableAsString('--nc-panel-bg-muted')).mix(this.backgroundColor(), blendRatio).toString(); + const blendRatio = (1 / bins.length) * index; + return color(getCSSVariableAsString('--nc-panel-bg-muted')) + .mix(this.backgroundColor(), blendRatio) + .toString(); }; calculatePanelHighlightColor = (missingValue) => { if (missingValue) { return this.backgroundColor().toString(); } - return color(getCSSVariableAsString('--nc-panel-bg-muted')).mix(this.promptColor(), 0.2).toString(); + return color(getCSSVariableAsString('--nc-panel-bg-muted')) + .mix(this.promptColor(), 0.2) + .toString(); }; renderOrdinalBin = (bin, index) => { - const { - prompt, - stage, - activePromptVariable, - updateNode, - } = this.props; + const { prompt, stage, activePromptVariable, updateNode } = this.props; const missingValue = bin.value < 0; const onDrop = ({ meta }) => { @@ -83,7 +94,10 @@ class OrdinalBins extends PureComponent {
-
+
); - } + }; render() { const { bins } = this.props; - return ( - bins.map(this.renderOrdinalBin) - ); + return bins.map(this.renderOrdinalBin); } } @@ -125,18 +137,18 @@ function makeMapStateToProps() { return { activePromptVariable, - bins: getOrdinalValues(state, props) - .map((bin) => { - const nodes = stageNodes.filter( - (node) => !isNil(node[entityAttributesProperty][activePromptVariable]) - && node[entityAttributesProperty][activePromptVariable] === bin.value, - ); - - return { - ...bin, - nodes, - }; - }), + bins: getOrdinalValues(state, props).map((bin) => { + const nodes = stageNodes.filter( + (node) => + !isNil(node[entityAttributesProperty][activePromptVariable]) && + node[entityAttributesProperty][activePromptVariable] === bin.value, + ); + + return { + ...bin, + nodes, + }; + }), }; }; } diff --git a/lib/interviewer/containers/SearchableList.js b/lib/interviewer/containers/SearchableList.js index d877eef4..a9f2d66c 100644 --- a/lib/interviewer/containers/SearchableList.js +++ b/lib/interviewer/containers/SearchableList.js @@ -1,5 +1,5 @@ import cx from 'classnames'; -import { get, isEqual } from 'lodash'; +import { get, isEqual } from 'lodash-es'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useEffect, useMemo, useRef } from 'react'; @@ -170,10 +170,11 @@ const SearchableList = (props) => {
{hasQuery && (
{ setSortByProperty(['relevance']); setSortType('number'); diff --git a/lib/interviewer/containers/SlidesForm/SlideFormEdge.js b/lib/interviewer/containers/SlidesForm/SlideFormEdge.js index ce4f2ae8..f3071241 100644 --- a/lib/interviewer/containers/SlidesForm/SlideFormEdge.js +++ b/lib/interviewer/containers/SlidesForm/SlideFormEdge.js @@ -1,15 +1,15 @@ -import React, { PureComponent } from 'react'; -import { find } from 'lodash'; -import PropTypes from 'prop-types'; -import { connect } from 'react-redux'; -import { withProps, compose } from 'recompose'; -import Scroller from '~/lib/ui/components/Scroller'; import { entityAttributesProperty, entityPrimaryKeyProperty, } from '@codaco/shared-consts'; -import { makeGetEdgeColor, getNetworkNodes } from '../../selectors/network'; +import { find } from 'lodash-es'; +import PropTypes from 'prop-types'; +import { PureComponent } from 'react'; +import { connect } from 'react-redux'; +import { compose, withProps } from 'recompose'; +import Scroller from '~/lib/ui/components/Scroller'; import Node from '../../components/Node'; +import { getNetworkNodes, makeGetEdgeColor } from '../../selectors/network'; import Form from '../Form'; class SlideFormEdge extends PureComponent { @@ -92,5 +92,4 @@ const withStore = connect((state, props) => { }; }); - export default compose(withStore, withEdgeProps)(SlideFormEdge); diff --git a/lib/interviewer/containers/SlidesForm/SlidesForm.js b/lib/interviewer/containers/SlidesForm/SlidesForm.js index 74109a6d..6f1ff28b 100644 --- a/lib/interviewer/containers/SlidesForm/SlidesForm.js +++ b/lib/interviewer/containers/SlidesForm/SlidesForm.js @@ -1,5 +1,5 @@ import cx from 'classnames'; -import { debounce } from 'lodash'; +import { debounce } from 'lodash-es'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useCallback, useEffect, useRef, useState } from 'react'; @@ -123,68 +123,67 @@ const SlidesForm = (props) => { return openDialog(confirmDialog); }, [openDialog]); - const beforeNext = - (direction) => { - // Leave the stage if there are no items - if (items.length === 0) { - return true; - } - - setPendingDirection(direction); - flushSync(); + const beforeNext = (direction) => { + // Leave the stage if there are no items + if (items.length === 0) { + return true; + } - // Leave the stage if we are on the intro and going backwards - if (isIntroScreen() && direction === 'backwards') { - return true; - } + setPendingDirection(direction); + flushSync(); - // We are moving backwards. - if (direction === 'backwards') { - // When moving backwards, allow navigation when form is valid and not dirty - if (!currentFormIsValid() && currentFormIsDirty()) { - checkShouldProceed().then((confirm) => { - if (confirm) { - previousItem(); - } - submitCurrentForm(); // submit so errors will display - }); - return false; - // submit the form if it is valid - } else if (currentFormIsValid()) { - submitCurrentForm(); - } + // Leave the stage if we are on the intro and going backwards + if (isIntroScreen() && direction === 'backwards') { + return true; + } - previousItem(); + // We are moving backwards. + if (direction === 'backwards') { + // When moving backwards, allow navigation when form is valid and not dirty + if (!currentFormIsValid() && currentFormIsDirty()) { + checkShouldProceed().then((confirm) => { + if (confirm) { + previousItem(); + } + submitCurrentForm(); // submit so errors will display + }); return false; + // submit the form if it is valid + } else if (currentFormIsValid()) { + submitCurrentForm(); } - // We are moving forwards. + previousItem(); + return false; + } - // If we are on the intro and moving forwards, move to the next item - if (isIntroScreen()) { - nextItem(); - return false; - } + // We are moving forwards. - // We need to check the validity of the current - // form, and submit it. - submitCurrentForm(); + // If we are on the intro and moving forwards, move to the next item + if (isIntroScreen()) { + nextItem(); + return false; + } - if (!currentFormIsValid()) { - return false; - } + // We need to check the validity of the current + // form, and submit it. + submitCurrentForm(); - // If the form is valid, move to the next item - if (currentFormIsValid()) { - // If we are on the last item, move to the next stage - if (isLastItem()) { - return true; - } + if (!currentFormIsValid()) { + return false; + } - nextItem(); - return false; + // If the form is valid, move to the next item + if (currentFormIsValid()) { + // If we are on the last item, move to the next stage + if (isLastItem()) { + return true; } + + nextItem(); + return false; } + }; const parentClasses = cx('alter-form', parentClass); @@ -238,11 +237,10 @@ const SlidesForm = (props) => { registerBeforeNext(beforeNext); // enter key should always move forward, and needs to process using beforeNext - const handleEnterSubmit = - (e) => { - moveForward(); - e.preventDefault(); - }; + const handleEnterSubmit = (e) => { + moveForward(); + e.preventDefault(); + }; const renderActiveSlide = () => { const itemIndex = getItemIndex(); @@ -378,5 +376,4 @@ const makeMapStateToProps = () => { const withStore = connect(makeMapStateToProps); - export default withStore(SlidesForm); diff --git a/lib/interviewer/containers/withExternalData.js b/lib/interviewer/containers/withExternalData.js index 1e56a10a..e8907786 100644 --- a/lib/interviewer/containers/withExternalData.js +++ b/lib/interviewer/containers/withExternalData.js @@ -1,19 +1,19 @@ +import { entityAttributesProperty } from '@codaco/shared-consts'; +import { get, includes, isNil, reduce, toNumber } from 'lodash-es'; import { connect } from 'react-redux'; import { compose, - withState, - withHandlers, lifecycle, mapProps, + withHandlers, + withState, } from 'recompose'; -import { get, includes, isNil, toNumber, reduce } from 'lodash'; -import { entityAttributesProperty } from '@codaco/shared-consts'; -import loadExternalData from '../utils/loadExternalData'; -import ProtocolConsts from '../protocol-consts'; import { getSessionMeta, makeVariableUUIDReplacer, } from '../hooks/useExternalData'; +import ProtocolConsts from '../protocol-consts'; +import loadExternalData from '../utils/loadExternalData'; const mapStateToProps = (state) => { const { protocolUID, assetManifest, protocolCodebook } = diff --git a/lib/interviewer/contexts/LayoutContext.js b/lib/interviewer/contexts/LayoutContext.js index 7aee89b3..21f368ff 100644 --- a/lib/interviewer/contexts/LayoutContext.js +++ b/lib/interviewer/contexts/LayoutContext.js @@ -1,19 +1,11 @@ /* eslint-disable react-hooks/exhaustive-deps */ -import React, { - useEffect, - useCallback, - useRef, - useState, -} from 'react'; -import { useDispatch } from 'react-redux'; -import { - noop, clamp, -} from 'lodash'; import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; +import { clamp, get, noop } from 'lodash-es'; +import React, { useCallback, useEffect, useRef, useState } from 'react'; +import { useDispatch } from 'react-redux'; +import { getTwoModeLayoutVariable } from '../components/Canvas/utils'; import { actionCreators as sessionsActions } from '../ducks/modules/session'; import useForceSimulation from '../hooks/useForceSimulation'; -import { get } from '../utils/lodash-replacements'; -import { getTwoModeLayoutVariable } from '../components/Canvas/utils'; const SIMULATION_OPTIONS = { decay: 0.1, @@ -35,28 +27,26 @@ const LayoutContext = React.createContext({ }); const getLinks = ({ nodes, edges }) => { - if (nodes.length === 0 || edges.length === 0) { return []; } - - const nodeIdMap = nodes.reduce( - (memo, node, index) => { - const uid = node[entityPrimaryKeyProperty]; - return { - ...memo, - [uid]: index, - }; - }, - {}, - ); + if (nodes.length === 0 || edges.length === 0) { + return []; + } + + const nodeIdMap = nodes.reduce((memo, node, index) => { + const uid = node[entityPrimaryKeyProperty]; + return { + ...memo, + [uid]: index, + }; + }, {}); - const links = edges.reduce( - (acc, { from, to }) => { - const source = nodeIdMap[from]; - const target = nodeIdMap[to]; - if (source === undefined || target === undefined) { return acc; } - return [...acc, { source, target }]; - }, - [], - ); + const links = edges.reduce((acc, { from, to }) => { + const source = nodeIdMap[from]; + const target = nodeIdMap[to]; + if (source === undefined || target === undefined) { + return acc; + } + return [...acc, { source, target }]; + }, []); return links; }; @@ -72,26 +62,27 @@ export const LayoutProvider = ({ const dispatch = useDispatch(); const updateNetworkInStore = useCallback(() => { - if (!forceSimulation.current) { return; } + if (!forceSimulation.current) { + return; + } nodes.forEach((node, index) => { const position = get(forceSimulation.current.nodes, [index]); - if (!position) { return; } + if (!position) { + return; + } const { x, y } = position; const layoutVariable = twoMode ? layout[node.type] : layout; dispatch( - sessionsActions.updateNode( - node[entityPrimaryKeyProperty], - undefined, - { [layoutVariable]: { x: clamp(x, 0, 1), y: clamp(y, 0, 1) } }, - ), + sessionsActions.updateNode(node[entityPrimaryKeyProperty], undefined, { + [layoutVariable]: { x: clamp(x, 0, 1), y: clamp(y, 0, 1) }, + }), ); }); }, [dispatch, nodes, layout]); - const { state: forceSimulation, screen, @@ -121,13 +112,20 @@ export const LayoutProvider = ({ } const nodeType = get(nodes, [index, 'type']); - const layoutVariable = getTwoModeLayoutVariable(twoMode, nodeType, layout); + const layoutVariable = getTwoModeLayoutVariable( + twoMode, + nodeType, + layout, + ); return get(nodes, [index, 'attributes', layoutVariable]); }; }, [nodes, simulationEnabled, allowAutomaticLayout, layout, twoMode]); useEffect(() => { - const didStopRunning = isRunning.current && isRunning.current == false && previousIsRunning.current == true; + const didStopRunning = + isRunning.current && + isRunning.current == false && + previousIsRunning.current == true; previousIsRunning.current = isRunning.current; if (didStopRunning) { @@ -146,7 +144,9 @@ export const LayoutProvider = ({ // Run setSimulationEnabled in next tick in order to // allow updateNetworkInStore to run before getPosition // changes to redux state. - setTimeout(() => { setSimulationEnabled(false); }, 0); + setTimeout(() => { + setSimulationEnabled(false); + }, 0); }, [simulationEnabled, setSimulationEnabled, updateNetworkInStore]); useEffect(() => { @@ -155,7 +155,9 @@ export const LayoutProvider = ({ }, [edges, nodes]); useEffect(() => { - if (!allowAutomaticLayout) { return; } + if (!allowAutomaticLayout) { + return; + } // We can start with an empty network since the other effects // will provide the nodes/links @@ -165,37 +167,40 @@ export const LayoutProvider = ({ }, [allowAutomaticLayout]); useEffect(() => { - if (!allowAutomaticLayout || !simulationEnabled) { return; } + if (!allowAutomaticLayout || !simulationEnabled) { + return; + } - const simulationNodes = nodes.map( - ({ attributes, type }) => { - const layoutVariable = twoMode ? layout[type] : layout; - return get(attributes, layoutVariable); - }, - ); + const simulationNodes = nodes.map(({ attributes, type }) => { + const layoutVariable = twoMode ? layout[type] : layout; + return get(attributes, layoutVariable); + }); updateNetwork({ nodes: simulationNodes }); }, [allowAutomaticLayout, simulationEnabled, nodes, layout, twoMode]); useEffect(() => { - if (!allowAutomaticLayout || !simulationEnabled) { return; } + if (!allowAutomaticLayout || !simulationEnabled) { + return; + } updateNetwork({ links }); }, [allowAutomaticLayout, simulationEnabled, links]); - const simulation = allowAutomaticLayout ? { - simulation: forceSimulation, - initialize, - updateOptions, - start, - reheat, - stop, - moveNode, - releaseNode, - simulationEnabled, - toggleSimulation, - } : undefined; - + const simulation = allowAutomaticLayout + ? { + simulation: forceSimulation, + initialize, + updateOptions, + start, + reheat, + stop, + moveNode, + releaseNode, + simulationEnabled, + toggleSimulation, + } + : undefined; const value = { network: { @@ -212,11 +217,8 @@ export const LayoutProvider = ({ }; return ( - - {children} - + {children} ); }; export default LayoutContext; - diff --git a/lib/interviewer/ducks/modules/installedProtocols.js b/lib/interviewer/ducks/modules/installedProtocols.js index 8ea1e695..4bcff40c 100644 --- a/lib/interviewer/ducks/modules/installedProtocols.js +++ b/lib/interviewer/ducks/modules/installedProtocols.js @@ -1,4 +1,4 @@ -import { omit, findKey } from 'lodash'; +import { findKey, omit } from 'lodash-es'; import { SET_SERVER_SESSION } from './setServerSession'; const IMPORT_PROTOCOL_COMPLETE = 'IMPORT_PROTOCOL_COMPLETE'; @@ -10,7 +10,9 @@ const initialState = {}; export default function reducer(state = initialState, action = {}) { switch (action.type) { case SET_SERVER_SESSION: { - if (!action.payload.protocol) { return state; } + if (!action.payload.protocol) { + return state; + } const { protocol } = action.payload; const uid = protocol.id; @@ -30,7 +32,10 @@ export default function reducer(state = initialState, action = {}) { // If the protocol name (which is the true UID of protocol) already exists, // overwrite. We only get here after user has confirmed. - const existingIndex = findKey(state, (protocol) => protocol.name === newProtocol.name); + const existingIndex = findKey( + state, + (protocol) => protocol.name === newProtocol.name, + ); if (existingIndex) { return { @@ -55,13 +60,10 @@ export default function reducer(state = initialState, action = {}) { } } - const actionTypes = { DELETE_PROTOCOL, IMPORT_PROTOCOL_COMPLETE, IMPORT_PROTOCOL_FAILED, }; -export { - actionTypes, -}; +export { actionTypes }; diff --git a/lib/interviewer/ducks/modules/network.js b/lib/interviewer/ducks/modules/network.js index fab93e89..5c2e5a80 100644 --- a/lib/interviewer/ducks/modules/network.js +++ b/lib/interviewer/ducks/modules/network.js @@ -1,7 +1,8 @@ -import { entityAttributesProperty, entityPrimaryKeyProperty } from '@codaco/shared-consts'; import { - reject, find, isMatch, omit, keys, get, -} from 'lodash'; + entityAttributesProperty, + entityPrimaryKeyProperty, +} from '@codaco/shared-consts'; +import { find, get, isMatch, keys, omit, reject } from 'lodash-es'; import { v4 as uuid } from 'uuid'; import { SET_SERVER_SESSION } from './setServerSession'; @@ -41,7 +42,11 @@ const initialState = { * @param attributeData Takes precidence over other attributes * @param defaultAttributes Is added before other attributes */ -const batchAddNodes = (nodeList, attributeData = {}, defaultAttributes = {}) => ({ +const batchAddNodes = ( + nodeList, + attributeData = {}, + defaultAttributes = {}, +) => ({ type: BATCH_ADD_NODES, nodeList, defaultAttributes, @@ -66,13 +71,16 @@ function flipEdge(edge) { * if (edgeExists) { * console.log('Edge exists:', edgeExists); * } - * -*/ + * + */ export function edgeExists(edges, from, to, type) { const forwardsEdge = find(edges, { from, to, type }); const reverseEdge = find(edges, flipEdge({ from, to, type })); - if ((forwardsEdge && forwardsEdge !== -1) || (reverseEdge && reverseEdge !== -1)) { + if ( + (forwardsEdge && forwardsEdge !== -1) || + (reverseEdge && reverseEdge !== -1) + ) { const foundEdge = forwardsEdge || reverseEdge; return get(foundEdge, entityPrimaryKeyProperty); } @@ -80,7 +88,8 @@ export function edgeExists(edges, from, to, type) { return false; } -export const getEntityAttributes = (node) => node[entityAttributesProperty] || {}; +export const getEntityAttributes = (node) => + node[entityAttributesProperty] || {}; /** * Correctly construct the node object based on a @@ -88,8 +97,7 @@ export const getEntityAttributes = (node) => node[entityAttributesProperty] || { */ const formatNodeAttributes = (modelData, attributeData) => ({ ...omit(modelData, 'promptId'), - [entityPrimaryKeyProperty]: - modelData[entityPrimaryKeyProperty] || uuid(), + [entityPrimaryKeyProperty]: modelData[entityPrimaryKeyProperty] || uuid(), [entityAttributesProperty]: { ...modelData[entityAttributesProperty], ...attributeData, @@ -113,8 +121,7 @@ const formatEgoAttributes = (modelData, attributeData) => ({ */ const formatEdgeAttributes = (modelData, attributeData) => ({ ...modelData, - [entityPrimaryKeyProperty]: - modelData[entityPrimaryKeyProperty] || uuid(), + [entityPrimaryKeyProperty]: modelData[entityPrimaryKeyProperty] || uuid(), [entityAttributesProperty]: { ...modelData[entityAttributesProperty], ...attributeData, @@ -124,19 +131,18 @@ const formatEdgeAttributes = (modelData, attributeData) => ({ const addEdge = (state, action) => ({ ...state, - edges: ( - () => state.edges.concat( - formatEdgeAttributes( - action.modelData, - action.attributeData, - ), - ) - )(), + edges: (() => + state.edges.concat( + formatEdgeAttributes(action.modelData, action.attributeData), + ))(), }); const removeEdge = (state, edgeId) => ({ ...state, - edges: reject(state.edges, (edge) => edge[entityPrimaryKeyProperty] === edgeId), + edges: reject( + state.edges, + (edge) => edge[entityPrimaryKeyProperty] === edgeId, + ), }); export default function reducer(state = initialState, action = {}) { @@ -153,10 +159,7 @@ export default function reducer(state = initialState, action = {}) { ...state, nodes: [ ...state.nodes, - formatNodeAttributes( - action.modelData, - action.attributeData, - ), + formatNodeAttributes(action.modelData, action.attributeData), ], }; } @@ -195,17 +198,22 @@ export default function reducer(state = initialState, action = {}) { case TOGGLE_NODE_ATTRIBUTES: { return { ...state, - nodes: ( - () => state.nodes.map( + nodes: (() => + state.nodes.map( (node) => { - if (node[entityPrimaryKeyProperty] !== action[entityPrimaryKeyProperty]) { + if ( + node[entityPrimaryKeyProperty] !== + action[entityPrimaryKeyProperty] + ) { return node; } // If the node's attrs contain the same key/vals, remove them if (isMatch(node[entityAttributesProperty], action.attributes)) { const omittedKeys = Object.keys(action.attributes); - const nestedProps = omittedKeys.map((key) => `${entityAttributesProperty}.${key}`); + const nestedProps = omittedKeys.map( + (key) => `${entityAttributesProperty}.${key}`, + ); return omit(node, nestedProps); } @@ -218,27 +226,29 @@ export default function reducer(state = initialState, action = {}) { }, }; }, // end node map function - ) - )(), + ))(), }; } case UPDATE_NODE: { return { ...state, - nodes: (() => state.nodes.map((node) => { - if (node[entityPrimaryKeyProperty] !== action.nodeId) { return node; } - return { - ...node, - ...omit(action.newModelData, 'promptId'), - promptIDs: action.newModelData.promptId - ? [...node.promptIDs, action.newModelData.promptId] : node.promptIDs, - [entityAttributesProperty]: { - ...node[entityAttributesProperty], - ...action.newAttributeData, - }, - }; - }) - )(), + nodes: (() => + state.nodes.map((node) => { + if (node[entityPrimaryKeyProperty] !== action.nodeId) { + return node; + } + return { + ...node, + ...omit(action.newModelData, 'promptId'), + promptIDs: action.newModelData.promptId + ? [...node.promptIDs, action.newModelData.promptId] + : node.promptIDs, + [entityAttributesProperty]: { + ...node[entityAttributesProperty], + ...action.newAttributeData, + }, + }; + }))(), }; } case REMOVE_NODE: { @@ -247,57 +257,60 @@ export default function reducer(state = initialState, action = {}) { ...state, nodes: reject( state.nodes, - (node) => node[entityPrimaryKeyProperty] === removeentityPrimaryKeyProperty, + (node) => + node[entityPrimaryKeyProperty] === removeentityPrimaryKeyProperty, ), edges: reject( state.edges, - (edge) => ( - edge.from === removeentityPrimaryKeyProperty - || edge.to === removeentityPrimaryKeyProperty - ), + (edge) => + edge.from === removeentityPrimaryKeyProperty || + edge.to === removeentityPrimaryKeyProperty, ), }; } case ADD_NODE_TO_PROMPT: { return { ...state, - nodes: (() => state.nodes.map( - (node) => { - if (node[entityPrimaryKeyProperty] !== action.nodeId) { return node; } + nodes: (() => + state.nodes.map((node) => { + if (node[entityPrimaryKeyProperty] !== action.nodeId) { + return node; + } return { ...node, - [entityAttributesProperty]: - { ...node[entityAttributesProperty], ...action.promptAttributes }, + [entityAttributesProperty]: { + ...node[entityAttributesProperty], + ...action.promptAttributes, + }, promptIDs: [...node.promptIDs, action.promptId], }; - }, - ) - )(), + }))(), }; } case REMOVE_NODE_FROM_PROMPT: { - const togglePromptAttributes = keys(action.promptAttributes) - .reduce( - (attributes, attrKey) => ({ - ...attributes, - [attrKey]: !action.promptAttributes[attrKey], - }), - {}, - ); + const togglePromptAttributes = keys(action.promptAttributes).reduce( + (attributes, attrKey) => ({ + ...attributes, + [attrKey]: !action.promptAttributes[attrKey], + }), + {}, + ); return { ...state, - nodes: (() => state.nodes.map( - (node) => { - if (node[entityPrimaryKeyProperty] !== action.nodeId) { return node; } + nodes: (() => + state.nodes.map((node) => { + if (node[entityPrimaryKeyProperty] !== action.nodeId) { + return node; + } return { ...node, - [entityAttributesProperty]: - { ...node[entityAttributesProperty], ...togglePromptAttributes }, + [entityAttributesProperty]: { + ...node[entityAttributesProperty], + ...togglePromptAttributes, + }, promptIDs: node.promptIDs.filter((id) => id !== action.promptId), }; - }, - ) - )(), + }))(), }; } case ADD_EDGE: { @@ -306,24 +319,28 @@ export default function reducer(state = initialState, action = {}) { case UPDATE_EDGE: { return { ...state, - edges: (() => state.edges.map((edge) => { - if (edge[entityPrimaryKeyProperty] !== action.edgeId) { return edge; } - return { - ...edge, - ...action.newModelData, - [entityAttributesProperty]: { - ...edge[entityAttributesProperty], - ...action.newAttributeData, - }, - }; - }) - )(), + edges: (() => + state.edges.map((edge) => { + if (edge[entityPrimaryKeyProperty] !== action.edgeId) { + return edge; + } + return { + ...edge, + ...action.newModelData, + [entityAttributesProperty]: { + ...edge[entityAttributesProperty], + ...action.newAttributeData, + }, + }; + }))(), }; } case TOGGLE_EDGE: { // remove edge if it exists, add it if it doesn't const { to, from, type } = action.modelData; - if (!to || !from || !type) { return state; } + if (!to || !from || !type) { + return state; + } // Returns an edge UID if an existing edge is found, otherwise false; const existingEdgeId = edgeExists(state.edges, from, to, type); @@ -341,10 +358,7 @@ export default function reducer(state = initialState, action = {}) { case ADD_SESSION: { return { ...initialState, - ego: formatEgoAttributes( - initialState.ego, - action.egoAttributeData, - ), + ego: formatEgoAttributes(initialState.ego, action.egoAttributeData), }; } default: @@ -371,8 +385,4 @@ const actionCreators = { batchAddNodes, }; -export { - actionTypes, - actionCreators, - // For actionCreators see `src/ducks/modules/sessions` -}; +export { actionCreators, actionTypes }; diff --git a/lib/interviewer/ducks/modules/reset.js b/lib/interviewer/ducks/modules/reset.js index 3357f988..969ed1bc 100644 --- a/lib/interviewer/ducks/modules/reset.js +++ b/lib/interviewer/ducks/modules/reset.js @@ -1,7 +1,7 @@ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; -import { actionCreators as sessionActions } from './session'; +import { get } from '../lodash-es'; import { actionCreators as deviceActions } from './deviceSettings'; -import { get } from '../../utils/lodash-replacements'; +import { actionCreators as sessionActions } from './session'; const RESET_STATE = 'RESET_STATE'; @@ -16,9 +16,7 @@ const resetPropertyForAllNodes = (property) => (dispatch, getState) => { }, installedProtocols: { [protocolUID]: { - codebook: { - node: nodeRegistry, - }, + codebook: { node: nodeRegistry }, }, }, } = getState(); @@ -44,7 +42,13 @@ const resetPropertyForAllNodes = (property) => (dispatch, getState) => { const resetEdgesOfType = (edgeType) => (dispatch, getState) => { const { activeSessionId } = getState(); - const { sessions: { [activeSessionId]: { network: { edges } } } } = getState(); + const { + sessions: { + [activeSessionId]: { + network: { edges }, + }, + }, + } = getState(); edges.forEach((edge) => { if (edge.type !== edgeType) { @@ -67,6 +71,4 @@ const actionCreators = { resetPropertyForAllNodes, }; -export { - actionCreators, -}; +export { actionCreators }; diff --git a/lib/interviewer/ducks/modules/session.js b/lib/interviewer/ducks/modules/session.js index a5f8c05e..9c6f9336 100644 --- a/lib/interviewer/ducks/modules/session.js +++ b/lib/interviewer/ducks/modules/session.js @@ -1,8 +1,11 @@ -import { has, omit, reduce } from 'lodash'; -import { v4 as uuid } from 'uuid'; import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; +import { has, omit, reduce } from 'lodash-es'; +import { v4 as uuid } from 'uuid'; import { actionTypes as installedProtocolsActionTypes } from './installedProtocols'; -import networkReducer, { actionTypes as networkActionTypes, actionCreators as networkActions } from './network'; +import networkReducer, { + actionTypes as networkActionTypes, + actionCreators as networkActions, +} from './network'; import { SET_SERVER_SESSION } from './setServerSession'; const ADD_SESSION = 'ADD_SESSION'; @@ -24,143 +27,170 @@ const withTimestamp = (session) => ({ const sessionExists = (sessionId, sessions) => has(sessions, sessionId); -const getReducer = (network) => (state = initialState, action = {}) => { - switch (action.type) { - case SET_SERVER_SESSION: { - if (!action.payload.session) { - return state; - } +const getReducer = + (network) => + (state = initialState, action = {}) => { + switch (action.type) { + case SET_SERVER_SESSION: { + if (!action.payload.session) { + return state; + } - const { session: { id } } = action.payload; - const { protocol: { id: protocolUID } } = action.payload; - - return { - ...state, - [id]: { - protocolUID, - ...action.payload.session, - network: action.payload.session.network ?? network(state.network, action), - stageMetadata: action.payload.session.stageMetadata ?? {}, - }, + const { + session: { id }, + } = action.payload; + const { + protocol: { id: protocolUID }, + } = action.payload; + + return { + ...state, + [id]: { + protocolUID, + ...action.payload.session, + network: + action.payload.session.network ?? network(state.network, action), + stageMetadata: action.payload.session.stageMetadata ?? {}, + }, + }; } - } - case installedProtocolsActionTypes.DELETE_PROTOCOL: - return reduce(state, (result, sessionData, sessionId) => { - if (sessionData.protocolUID !== action.protocolUID) { - return { ...result, [sessionId]: sessionData }; + case installedProtocolsActionTypes.DELETE_PROTOCOL: + return reduce( + state, + (result, sessionData, sessionId) => { + if (sessionData.protocolUID !== action.protocolUID) { + return { ...result, [sessionId]: sessionData }; + } + return result; + }, + {}, + ); + case networkActionTypes.ADD_NODE: + case networkActionTypes.ADD_NODE_TO_PROMPT: + case networkActionTypes.BATCH_ADD_NODES: + case networkActionTypes.REMOVE_NODE: + case networkActionTypes.REMOVE_NODE_FROM_PROMPT: + case networkActionTypes.UPDATE_NODE: + case networkActionTypes.TOGGLE_NODE_ATTRIBUTES: + case networkActionTypes.ADD_EDGE: + case networkActionTypes.UPDATE_EDGE: + case networkActionTypes.TOGGLE_EDGE: + case networkActionTypes.REMOVE_EDGE: + case networkActionTypes.UPDATE_EGO: { + if (!sessionExists(action.sessionId, state)) { + return state; } - return result; - }, {}); - case networkActionTypes.ADD_NODE: - case networkActionTypes.ADD_NODE_TO_PROMPT: - case networkActionTypes.BATCH_ADD_NODES: - case networkActionTypes.REMOVE_NODE: - case networkActionTypes.REMOVE_NODE_FROM_PROMPT: - case networkActionTypes.UPDATE_NODE: - case networkActionTypes.TOGGLE_NODE_ATTRIBUTES: - case networkActionTypes.ADD_EDGE: - case networkActionTypes.UPDATE_EDGE: - case networkActionTypes.TOGGLE_EDGE: - case networkActionTypes.REMOVE_EDGE: - case networkActionTypes.UPDATE_EGO: { - if (!sessionExists(action.sessionId, state)) { return state; } - return { - ...state, - [action.sessionId]: withTimestamp({ - ...state[action.sessionId], - // Reset finished and exported state if network changes - finishedAt: null, - exportedAt: null, - network: network(state[action.sessionId].network, action), - }), - }; - } - case ADD_SESSION: - return { - ...state, - [action.sessionId]: withTimestamp({ - protocolUID: action.protocolUID, - promptIndex: 0, - currentStep: null, - caseId: action.caseId, - network: action.network ? action.network : network(state.network, action), - startedAt: Date.now(), - }), - }; - case SET_SESSION_FINISHED: { - if (!sessionExists(action.sessionId, state)) { return state; } - return { - ...state, - [action.sessionId]: withTimestamp({ - ...state[action.sessionId], - finishedAt: Date.now(), - }), - }; - } + return { + ...state, + [action.sessionId]: withTimestamp({ + ...state[action.sessionId], + // Reset finished and exported state if network changes + finishedAt: null, + exportedAt: null, + network: network(state[action.sessionId].network, action), + }), + }; + } + case ADD_SESSION: + return { + ...state, + [action.sessionId]: withTimestamp({ + protocolUID: action.protocolUID, + promptIndex: 0, + currentStep: null, + caseId: action.caseId, + network: action.network + ? action.network + : network(state.network, action), + startedAt: Date.now(), + }), + }; + case SET_SESSION_FINISHED: { + if (!sessionExists(action.sessionId, state)) { + return state; + } + return { + ...state, + [action.sessionId]: withTimestamp({ + ...state[action.sessionId], + finishedAt: Date.now(), + }), + }; + } - case SET_SESSION_EXPORTED: { - if (!sessionExists(action.sessionId, state)) { return state; } - return { - ...state, - [action.sessionId]: { - ...state[action.sessionId], - exportedAt: Date.now(), - }, - }; - } - case LOAD_SESSION: - return state; - case UPDATE_PROMPT: { - if (!sessionExists(action.sessionId, state)) { return state; } - return { - ...state, - [action.sessionId]: withTimestamp({ - ...state[action.sessionId], - promptIndex: action.promptIndex, - }), - }; - } - case UPDATE_STAGE: { - if (!sessionExists(action.sessionId, state)) { return state; } - return { - ...state, - [action.sessionId]: withTimestamp({ - ...state[action.sessionId], - currentStep: action.currentStep, - promptIndex: 0, - }), - }; - } - case UPDATE_CASE_ID: { - if (!sessionExists(action.sessionId, state)) { return state; } - return { - ...state, - [action.sessionId]: withTimestamp({ - ...state[action.sessionId], - caseId: action.caseId, - }), - }; - } - case UPDATE_STAGE_METADATA: { - if (!sessionExists(action.sessionId, state)) { return state; } - const session = state[action.sessionId]; - return { - ...state, - [action.sessionId]: withTimestamp({ - ...session, - stageMetadata: { - ...session.stageMetadata, - [action.currentStep]: action.state, + case SET_SESSION_EXPORTED: { + if (!sessionExists(action.sessionId, state)) { + return state; + } + return { + ...state, + [action.sessionId]: { + ...state[action.sessionId], + exportedAt: Date.now(), }, - }), - }; + }; + } + case LOAD_SESSION: + return state; + case UPDATE_PROMPT: { + if (!sessionExists(action.sessionId, state)) { + return state; + } + return { + ...state, + [action.sessionId]: withTimestamp({ + ...state[action.sessionId], + promptIndex: action.promptIndex, + }), + }; + } + case UPDATE_STAGE: { + if (!sessionExists(action.sessionId, state)) { + return state; + } + return { + ...state, + [action.sessionId]: withTimestamp({ + ...state[action.sessionId], + currentStep: action.currentStep, + promptIndex: 0, + }), + }; + } + case UPDATE_CASE_ID: { + if (!sessionExists(action.sessionId, state)) { + return state; + } + return { + ...state, + [action.sessionId]: withTimestamp({ + ...state[action.sessionId], + caseId: action.caseId, + }), + }; + } + case UPDATE_STAGE_METADATA: { + if (!sessionExists(action.sessionId, state)) { + return state; + } + const session = state[action.sessionId]; + return { + ...state, + [action.sessionId]: withTimestamp({ + ...session, + stageMetadata: { + ...session.stageMetadata, + [action.currentStep]: action.state, + }, + }), + }; + } + case REMOVE_SESSION: + return omit(state, [action.sessionId]); + default: + return state; } - case REMOVE_SESSION: - return omit(state, [action.sessionId]); - default: - return state; - } -}; + }; /** * This function generates default values for all variables in the variable registry for this node @@ -205,74 +235,77 @@ const withActiveSessionId = (action) => (dispatch, getState) => { * @memberof! NetworkActionCreators * TODO: is `type` superfluous as contained by nodes in nodeList? */ -const batchAddNodes = (nodeList, attributeData, type) => (dispatch, getState) => { - const { activeSessionId, sessions, installedProtocols } = getState(); - - const session = sessions[activeSessionId]; - const activeProtocol = installedProtocols[session.protocolUID]; - const nodeRegistry = activeProtocol.codebook.node; - const registryForType = nodeRegistry[type].variables; - const defaultAttributes = getDefaultAttributesForEntityType(registryForType); - - dispatch( - withActiveSessionId( - networkActions.batchAddNodes( - nodeList, - attributeData, - defaultAttributes, +const batchAddNodes = + (nodeList, attributeData, type) => (dispatch, getState) => { + const { activeSessionId, sessions, installedProtocols } = getState(); + + const session = sessions[activeSessionId]; + const activeProtocol = installedProtocols[session.protocolUID]; + const nodeRegistry = activeProtocol.codebook.node; + const registryForType = nodeRegistry[type].variables; + const defaultAttributes = + getDefaultAttributesForEntityType(registryForType); + + dispatch( + withActiveSessionId( + networkActions.batchAddNodes( + nodeList, + attributeData, + defaultAttributes, + ), ), - ), - ); -}; - -const addNode = (modelData, attributeData = {}) => (dispatch, getState) => { - const { activeSessionId, sessions, installedProtocols } = getState(); - - const activeProtocol = installedProtocols[sessions[activeSessionId].protocolUID]; - const nodeRegistry = activeProtocol.codebook.node; - - const registryForType = nodeRegistry[modelData.type].variables; - - dispatch({ - type: networkActionTypes.ADD_NODE, - sessionId: activeSessionId, - modelData, - attributeData: { - ...getDefaultAttributesForEntityType(registryForType), - ...attributeData, - }, - }); -}; - -const updateNode = ( - nodeId, - newModelData = {}, - newAttributeData = {}, - sound, -) => (dispatch, getState) => { - const { activeSessionId } = getState(); + ); + }; - dispatch({ - type: networkActionTypes.UPDATE_NODE, - sessionId: activeSessionId, - nodeId, - newModelData, - newAttributeData, - sound, - }); -}; +const addNode = + (modelData, attributeData = {}) => + (dispatch, getState) => { + const { activeSessionId, sessions, installedProtocols } = getState(); + + const activeProtocol = + installedProtocols[sessions[activeSessionId].protocolUID]; + const nodeRegistry = activeProtocol.codebook.node; + + const registryForType = nodeRegistry[modelData.type].variables; + + dispatch({ + type: networkActionTypes.ADD_NODE, + sessionId: activeSessionId, + modelData, + attributeData: { + ...getDefaultAttributesForEntityType(registryForType), + ...attributeData, + }, + }); + }; -const addNodeToPrompt = (nodeId, promptId, promptAttributes) => (dispatch, getState) => { - const { activeSessionId } = getState(); +const updateNode = + (nodeId, newModelData = {}, newAttributeData = {}, sound) => + (dispatch, getState) => { + const { activeSessionId } = getState(); + + dispatch({ + type: networkActionTypes.UPDATE_NODE, + sessionId: activeSessionId, + nodeId, + newModelData, + newAttributeData, + sound, + }); + }; - dispatch({ - type: networkActionTypes.ADD_NODE_TO_PROMPT, - sessionId: activeSessionId, - nodeId, - promptId, - promptAttributes, - }); -}; +const addNodeToPrompt = + (nodeId, promptId, promptAttributes) => (dispatch, getState) => { + const { activeSessionId } = getState(); + + dispatch({ + type: networkActionTypes.ADD_NODE_TO_PROMPT, + sessionId: activeSessionId, + nodeId, + promptId, + promptAttributes, + }); + }; const toggleNodeAttributes = (uid, attributes) => (dispatch, getState) => { const { activeSessionId } = getState(); @@ -295,84 +328,96 @@ const removeNode = (uid) => (dispatch, getState) => { }); }; -const removeNodeFromPrompt = (nodeId, promptId, promptAttributes) => (dispatch, getState) => { - const { activeSessionId } = getState(); - - dispatch({ - type: networkActionTypes.REMOVE_NODE_FROM_PROMPT, - sessionId: activeSessionId, - nodeId, - promptId, - promptAttributes, - }); -}; - -const updateEgo = (modelData = {}, attributeData = {}) => (dispatch, getState) => { - const { activeSessionId, sessions, installedProtocols } = getState(); - - const activeProtocol = installedProtocols[sessions[activeSessionId].protocolUID]; - const egoRegistry = activeProtocol.codebook.ego || {}; - - dispatch({ - type: networkActionTypes.UPDATE_EGO, - sessionId: activeSessionId, - modelData, - attributeData: { - ...getDefaultAttributesForEntityType(egoRegistry.variables), - ...attributeData, - }, - }); -}; - -const addEdge = (modelData, attributeData = {}) => (dispatch, getState) => { - const { activeSessionId, sessions, installedProtocols } = getState(); - - const activeProtocol = installedProtocols[sessions[activeSessionId].protocolUID]; - const edgeRegistry = activeProtocol.codebook.edge; - - const registryForType = edgeRegistry[modelData.type].variables; - - dispatch({ - type: networkActionTypes.ADD_EDGE, - sessionId: activeSessionId, - modelData, - attributeData: { - ...getDefaultAttributesForEntityType(registryForType), - ...attributeData, - }, - }); -}; - -const updateEdge = (edgeId, newModelData = {}, newAttributeData = {}) => (dispatch, getState) => { - const { activeSessionId } = getState(); - - dispatch({ - type: networkActionTypes.UPDATE_EDGE, - sessionId: activeSessionId, - edgeId, - newModelData, - newAttributeData, - }); -}; +const removeNodeFromPrompt = + (nodeId, promptId, promptAttributes) => (dispatch, getState) => { + const { activeSessionId } = getState(); + + dispatch({ + type: networkActionTypes.REMOVE_NODE_FROM_PROMPT, + sessionId: activeSessionId, + nodeId, + promptId, + promptAttributes, + }); + }; -const toggleEdge = (modelData, attributeData = {}) => (dispatch, getState) => { - const { activeSessionId, sessions, installedProtocols } = getState(); +const updateEgo = + (modelData = {}, attributeData = {}) => + (dispatch, getState) => { + const { activeSessionId, sessions, installedProtocols } = getState(); + + const activeProtocol = + installedProtocols[sessions[activeSessionId].protocolUID]; + const egoRegistry = activeProtocol.codebook.ego || {}; + + dispatch({ + type: networkActionTypes.UPDATE_EGO, + sessionId: activeSessionId, + modelData, + attributeData: { + ...getDefaultAttributesForEntityType(egoRegistry.variables), + ...attributeData, + }, + }); + }; - const activeProtocol = installedProtocols[sessions[activeSessionId].protocolUID]; - const edgeRegistry = activeProtocol.codebook.edge; +const addEdge = + (modelData, attributeData = {}) => + (dispatch, getState) => { + const { activeSessionId, sessions, installedProtocols } = getState(); + + const activeProtocol = + installedProtocols[sessions[activeSessionId].protocolUID]; + const edgeRegistry = activeProtocol.codebook.edge; + + const registryForType = edgeRegistry[modelData.type].variables; + + dispatch({ + type: networkActionTypes.ADD_EDGE, + sessionId: activeSessionId, + modelData, + attributeData: { + ...getDefaultAttributesForEntityType(registryForType), + ...attributeData, + }, + }); + }; - const registryForType = edgeRegistry[modelData.type].variables; +const updateEdge = + (edgeId, newModelData = {}, newAttributeData = {}) => + (dispatch, getState) => { + const { activeSessionId } = getState(); + + dispatch({ + type: networkActionTypes.UPDATE_EDGE, + sessionId: activeSessionId, + edgeId, + newModelData, + newAttributeData, + }); + }; - dispatch({ - type: networkActionTypes.TOGGLE_EDGE, - sessionId: activeSessionId, - modelData, - attributeData: { - ...getDefaultAttributesForEntityType(registryForType), - ...attributeData, - }, - }); -}; +const toggleEdge = + (modelData, attributeData = {}) => + (dispatch, getState) => { + const { activeSessionId, sessions, installedProtocols } = getState(); + + const activeProtocol = + installedProtocols[sessions[activeSessionId].protocolUID]; + const edgeRegistry = activeProtocol.codebook.edge; + + const registryForType = edgeRegistry[modelData.type].variables; + + dispatch({ + type: networkActionTypes.TOGGLE_EDGE, + sessionId: activeSessionId, + modelData, + attributeData: { + ...getDefaultAttributesForEntityType(registryForType), + ...attributeData, + }, + }); + }; const removeEdge = (edgeId) => (dispatch, getState) => { const { activeSessionId } = getState(); @@ -384,23 +429,26 @@ const removeEdge = (edgeId) => (dispatch, getState) => { }); }; -const addSession = (caseId, protocolUID, sessionNetwork) => (dispatch, getState) => { - const id = uuid(); - - const { installedProtocols } = getState(); - const activeProtocol = installedProtocols[protocolUID]; - const egoRegistry = activeProtocol.codebook.ego || {}; - const egoAttributeData = getDefaultAttributesForEntityType(egoRegistry.variables); - - dispatch({ - type: ADD_SESSION, - sessionId: id, - ...(sessionNetwork && { network: sessionNetwork }), - caseId, - protocolUID, - egoAttributeData, // initial values for ego - }); -}; +const addSession = + (caseId, protocolUID, sessionNetwork) => (dispatch, getState) => { + const id = uuid(); + + const { installedProtocols } = getState(); + const activeProtocol = installedProtocols[protocolUID]; + const egoRegistry = activeProtocol.codebook.ego || {}; + const egoAttributeData = getDefaultAttributesForEntityType( + egoRegistry.variables, + ); + + dispatch({ + type: ADD_SESSION, + sessionId: id, + ...(sessionNetwork && { network: sessionNetwork }), + caseId, + protocolUID, + egoAttributeData, // initial values for ego + }); + }; const updateCaseId = (caseId) => (dispatch, getState) => { const { activeSessionId } = getState(); @@ -453,11 +501,13 @@ const updateStageMetadata = (state) => (dispatch, getState) => { const { activeSessionId, sessions } = getState(); const { currentStep } = sessions[activeSessionId]; - dispatch(withSessionId({ - type: UPDATE_STAGE_METADATA, - currentStep, - state, - })); + dispatch( + withSessionId({ + type: UPDATE_STAGE_METADATA, + currentStep, + state, + }), + ); }; function removeSession(id) { @@ -513,9 +563,6 @@ const actionTypes = { REMOVE_SESSION, }; -export { - actionCreators, - actionTypes, -}; +export { actionCreators, actionTypes }; export default getReducer(networkReducer); diff --git a/lib/interviewer/hooks/useExternalData.js b/lib/interviewer/hooks/useExternalData.js index c4cc987e..bc4e9b51 100644 --- a/lib/interviewer/hooks/useExternalData.js +++ b/lib/interviewer/hooks/useExternalData.js @@ -3,7 +3,7 @@ import { entityPrimaryKeyProperty, } from '@codaco/shared-consts'; import { createSelector } from '@reduxjs/toolkit'; -import { mapKeys } from 'lodash'; +import { mapKeys } from 'lodash-es'; import { hash } from 'ohash'; import { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; diff --git a/lib/interviewer/hooks/useFlipflop.js b/lib/interviewer/hooks/useFlipflop.js index 929afa92..e19240a2 100644 --- a/lib/interviewer/hooks/useFlipflop.js +++ b/lib/interviewer/hooks/useFlipflop.js @@ -1,26 +1,26 @@ -import { isNil } from 'lodash'; -import { - useEffect, - useState, - useRef, - useCallback, -} from 'react'; +import { isNil } from 'lodash-es'; +import { useCallback, useEffect, useRef, useState } from 'react'; // Hook that provides state that returns to a rest value after a delay // Optionally has an initial value which can be different from the rest value const useFlipflop = (restValue, delay, initialState) => { const timer = useRef(null); - const [state, _setState] = useState(!isNil(initialState) ? initialState : restValue); + const [state, _setState] = useState( + !isNil(initialState) ? initialState : restValue, + ); - const setState = useCallback((value) => { - clearTimeout(timer.current); + const setState = useCallback( + (value) => { + clearTimeout(timer.current); - _setState(value); + _setState(value); - timer.current = setTimeout(() => { - _setState(restValue); - }, delay); - }, [delay, restValue]); + timer.current = setTimeout(() => { + _setState(restValue); + }, delay); + }, + [delay, restValue], + ); useEffect(() => { clearTimeout(timer.current); diff --git a/lib/interviewer/hooks/useSort.js b/lib/interviewer/hooks/useSort.js index 6817f8e2..d16cd732 100644 --- a/lib/interviewer/hooks/useSort.js +++ b/lib/interviewer/hooks/useSort.js @@ -1,5 +1,5 @@ +import { isEqual } from 'lodash-es'; import { useMemo, useState } from 'react'; -import { isEqual } from 'lodash'; import createSorter from '../utils/createSorter'; const defaultSortOrder = { @@ -41,9 +41,8 @@ const useSort = (list, initialSortOrder = defaultSortOrder) => { const [sortType, setSortType] = useState(initialType); const [sortDirection, setSortDirection] = useState(initialDirection); - const toggleSortDirection = () => setSortDirection( - (d) => (d === 'desc' ? 'asc' : 'desc'), - ); + const toggleSortDirection = () => + setSortDirection((d) => (d === 'desc' ? 'asc' : 'desc')); const updateSortByProperty = (newProperty) => { // If no property, reset to initial @@ -65,7 +64,9 @@ const useSort = (list, initialSortOrder = defaultSortOrder) => { }; const sortedList = useMemo(() => { - if (!sortByProperty) { return list; } + if (!sortByProperty) { + return list; + } const rule = { property: sortByProperty, diff --git a/lib/interviewer/hooks/useViewport.js b/lib/interviewer/hooks/useViewport.js index a7faee1f..4c660b18 100644 --- a/lib/interviewer/hooks/useViewport.js +++ b/lib/interviewer/hooks/useViewport.js @@ -1,7 +1,6 @@ -import { clamp, max, min } from 'lodash'; +import { clamp, get, max, min } from 'lodash-es'; import { useMotionValue } from 'motion/react'; import { useCallback } from 'react'; -import { get } from '../utils/lodash-replacements'; const LAYOUT_SPACE = 1000; diff --git a/lib/interviewer/selectors/canvas.js b/lib/interviewer/selectors/canvas.js index 98b59e2e..410e2d91 100644 --- a/lib/interviewer/selectors/canvas.js +++ b/lib/interviewer/selectors/canvas.js @@ -1,15 +1,14 @@ -import { first, has, isArray, isNil } from 'lodash'; import { entityAttributesProperty, entityPrimaryKeyProperty, } from '@codaco/shared-consts'; -import { getNetworkNodes, getNetworkEdges } from './network'; -import { createDeepEqualSelector } from './utils'; -import createSorter, { processProtocolSortRule } from '../utils/createSorter'; +import { first, get, has, isArray, isNil } from 'lodash-es'; import { getEntityAttributes } from '../ducks/modules/network'; -import { get } from '../utils/lodash-replacements'; -import { getAllVariableUUIDsByEntity } from './protocol'; +import createSorter, { processProtocolSortRule } from '../utils/createSorter'; +import { getNetworkEdges, getNetworkNodes } from './network'; import { getStageSubject } from './prop'; +import { getAllVariableUUIDsByEntity } from './protocol'; +import { createDeepEqualSelector } from './utils'; const getLayout = (_, props) => get(props, 'prompt.layout.layoutVariable', null); diff --git a/lib/interviewer/selectors/forms.js b/lib/interviewer/selectors/forms.js index daeebdee..89e11e46 100644 --- a/lib/interviewer/selectors/forms.js +++ b/lib/interviewer/selectors/forms.js @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { get } from '../utils/lodash-replacements'; +import { get } from 'lodash-es'; import { getProtocolCodebook } from './protocol'; // Prop selectors @@ -9,14 +9,18 @@ const propStageSubject = (_, props) => props.subject || { entity: 'ego' }; // MemoedSelectors -const rehydrateField = ({ - codebook, entity, type, field, -}) => { - if (!field.variable) { return field; } +const rehydrateField = ({ codebook, entity, type, field }) => { + if (!field.variable) { + return field; + } const entityPath = entity === 'ego' ? [entity] : [entity, type]; - const entityProperties = get(codebook, [...entityPath, 'variables', field.variable], {}); + const entityProperties = get( + codebook, + [...entityPath, 'variables', field.variable], + {}, + ); return { ...entityProperties, @@ -26,13 +30,18 @@ const rehydrateField = ({ }; }; -export const makeRehydrateFields = () => createSelector( - propStageSubject, - propFields, - (state, props) => getProtocolCodebook(state, props), - ({ entity, type }, fields, codebook) => fields.map( - (field) => rehydrateField({ - codebook, entity, type, field, - }), - ), -); +export const makeRehydrateFields = () => + createSelector( + propStageSubject, + propFields, + (state, props) => getProtocolCodebook(state, props), + ({ entity, type }, fields, codebook) => + fields.map((field) => + rehydrateField({ + codebook, + entity, + type, + field, + }), + ), + ); diff --git a/lib/interviewer/selectors/interface.js b/lib/interviewer/selectors/interface.js index 2dac6870..eab01b34 100644 --- a/lib/interviewer/selectors/interface.js +++ b/lib/interviewer/selectors/interface.js @@ -1,14 +1,14 @@ -import { filter, includes, intersection } from 'lodash'; -import { getProtocolCodebook } from './protocol'; +import { createSelector } from '@reduxjs/toolkit'; +import { filter, includes, intersection } from 'lodash-es'; import { getNetwork, getNetworkEdges, getNetworkNodes } from './network'; import { getPromptOtherVariable, - getStageSubject, - stagePromptIds, getPromptVariable, + getStageSubject, getSubjectType, + stagePromptIds, } from './prop'; -import { createSelector } from '@reduxjs/toolkit'; +import { getProtocolCodebook } from './protocol'; import { getPromptIndex, getPrompts } from './session'; // Selectors that are generic between interfaces @@ -141,7 +141,8 @@ export const getPromptId = createSelector( export const getNetworkNodesForPrompt = createSelector( getNetworkNodesForType, getPromptId, - (nodes, promptId) => filter(nodes, (node) => includes(node.promptIDs, promptId)), + (nodes, promptId) => + filter(nodes, (node) => includes(node.promptIDs, promptId)), ); /** @@ -152,6 +153,8 @@ export const getNetworkNodesForPrompt = createSelector( */ export const getNetworkNodesForOtherPrompts = createSelector( - getNetworkNodesForType, getPromptId, - (nodes, promptId) => filter(nodes, (node) => !includes(node.promptIDs, promptId)), + getNetworkNodesForType, + getPromptId, + (nodes, promptId) => + filter(nodes, (node) => !includes(node.promptIDs, promptId)), ); diff --git a/lib/interviewer/selectors/name-generator.js b/lib/interviewer/selectors/name-generator.js index 6a92eb04..6b99ea30 100644 --- a/lib/interviewer/selectors/name-generator.js +++ b/lib/interviewer/selectors/name-generator.js @@ -1,8 +1,8 @@ -import { has } from 'lodash'; -import { getProtocolCodebook } from './protocol'; -import { getStageSubject, getSubjectType, propStageId } from './prop'; import { createSelector } from '@reduxjs/toolkit'; +import { has } from 'lodash-es'; import { getPromptId } from './interface'; +import { getStageSubject, getSubjectType, propStageId } from './prop'; +import { getProtocolCodebook } from './protocol'; // Selectors that are specific to the name generator @@ -23,16 +23,12 @@ const defaultPanelConfiguration = { const stageCardOptions = (_, props) => props.stage.cardOptions; const propPanels = (_, props) => props.stage.panels; -const getIDs = createSelector( - propStageId, - getPromptId, - (stageId, promptId) => { - return { - stageId, - promptId, - }; - }, -) +const getIDs = createSelector(propStageId, getPromptId, (stageId, promptId) => { + return { + stageId, + promptId, + }; +}); export const getPromptModelData = createSelector( getStageSubject, @@ -44,26 +40,33 @@ export const getPromptModelData = createSelector( promptId, }; }, -) +); // Returns any additional properties to be displayed on cards. // Returns an empty array if no additional properties are specified in the protocol. export const getCardAdditionalProperties = createSelector( stageCardOptions, - (cardOptions) => (has(cardOptions, 'additionalProperties') ? cardOptions.additionalProperties : []), + (cardOptions) => + has(cardOptions, 'additionalProperties') + ? cardOptions.additionalProperties + : [], ); - export const getNodeIconName = createSelector( getProtocolCodebook, getSubjectType, (codebook, nodeType) => { const nodeInfo = codebook.node; - return (nodeInfo && nodeInfo[nodeType] && nodeInfo[nodeType].iconVariant) || 'add-a-person'; + return ( + (nodeInfo && nodeInfo[nodeType] && nodeInfo[nodeType].iconVariant) || + 'add-a-person' + ); }, ); -export const makeGetPanelConfiguration = () => createSelector( - propPanels, - (panels) => (panels ? panels.map((panel) => ({ ...defaultPanelConfiguration, ...panel })) : []), -); +export const makeGetPanelConfiguration = () => + createSelector(propPanels, (panels) => + panels + ? panels.map((panel) => ({ ...defaultPanelConfiguration, ...panel })) + : [], + ); diff --git a/lib/interviewer/selectors/network.ts b/lib/interviewer/selectors/network.ts index f17f931c..c1c721b5 100644 --- a/lib/interviewer/selectors/network.ts +++ b/lib/interviewer/selectors/network.ts @@ -1,10 +1,3 @@ -import { findKey, find } from 'lodash'; -import { getActiveSession } from './session'; -import { createDeepEqualSelector } from './utils'; -import { getProtocolCodebook } from './protocol'; -import customFilter from '~/lib/network-query/filter'; -import { createSelector } from '@reduxjs/toolkit'; -import { getStageSubject, getSubjectType } from './prop'; import { entityAttributesProperty, type Codebook, @@ -15,8 +8,15 @@ import { type Stage, type StageSubject, } from '@codaco/shared-consts'; -import type { RootState } from '../store'; +import { createSelector } from '@reduxjs/toolkit'; +import { find, findKey } from 'lodash-es'; import { getEntityAttributes } from '~/lib/interviewer/ducks/modules/network'; +import customFilter from '~/lib/network-query/filter'; +import type { RootState } from '../store'; +import { getStageSubject, getSubjectType } from './prop'; +import { getProtocolCodebook } from './protocol'; +import { getActiveSession } from './session'; +import { createDeepEqualSelector } from './utils'; export const getNetwork = createSelector( getActiveSession, diff --git a/lib/interviewer/selectors/protocol.js b/lib/interviewer/selectors/protocol.js index 41de204f..a923f215 100644 --- a/lib/interviewer/selectors/protocol.js +++ b/lib/interviewer/selectors/protocol.js @@ -1,6 +1,6 @@ -import { v4 as uuid } from 'uuid'; -import { get } from '../utils/lodash-replacements'; import { createSelector } from '@reduxjs/toolkit'; +import { get } from 'lodash-es'; +import { v4 as uuid } from 'uuid'; import { getStageSubject } from './prop'; const DefaultFinishStage = { @@ -10,9 +10,8 @@ const DefaultFinishStage = { label: 'Finish Interview', }; -const getActiveSession = (state) => ( - state.activeSessionId && state.sessions[state.activeSessionId] -); +const getActiveSession = (state) => + state.activeSessionId && state.sessions[state.activeSessionId]; const getInstalledProtocols = (state) => state.installedProtocols; @@ -24,10 +23,11 @@ const getCurrentSessionProtocol = createSelector( export const getAssetManifest = createSelector( getCurrentSessionProtocol, - (protocol) => protocol.assets.reduce((manifest, asset) => { - manifest[asset.assetId] = asset; - return manifest; - }, {}) + (protocol) => + protocol.assets.reduce((manifest, asset) => { + manifest[asset.assetId] = asset; + return manifest; + }, {}), ); export const getAssetUrlFromId = createSelector( @@ -85,7 +85,9 @@ export const getAllVariableUUIDsByEntity = createSelector( ); const withFinishStage = (stages = []) => { - if (!stages) { return []; } + if (!stages) { + return []; + } return [...stages, DefaultFinishStage]; }; diff --git a/lib/interviewer/selectors/utils.js b/lib/interviewer/selectors/utils.js index 749857c5..1c2d64c7 100644 --- a/lib/interviewer/selectors/utils.js +++ b/lib/interviewer/selectors/utils.js @@ -1,4 +1,4 @@ -import { isEqual } from 'lodash'; +import { isEqual } from 'lodash-es'; import { createSelectorCreator, defaultMemoize } from 'reselect'; // create a "selector creator" that uses lodash.isEqual instead of === diff --git a/lib/interviewer/utils/Validations.js b/lib/interviewer/utils/Validations.js index f6e92aa9..cc8495dd 100644 --- a/lib/interviewer/utils/Validations.js +++ b/lib/interviewer/utils/Validations.js @@ -1,13 +1,13 @@ +import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; import { filter, + get, isEqual, isNil, isNumber, isString, some, - get, -} from 'lodash'; -import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; +} from 'lodash-es'; import { getNetworkEntitiesForType } from '../selectors/interface'; import { getCodebookVariablesForType } from '../selectors/protocol'; @@ -15,7 +15,7 @@ import { getCodebookVariablesForType } from '../selectors/protocol'; // or a single value const coerceArray = (value) => { if (value instanceof Object) { - return value.reduce((acc, individual) => ([...acc, individual.value]), []); + return value.reduce((acc, individual) => [...acc, individual.value], []); } if (value instanceof Array) { return value; @@ -33,14 +33,32 @@ const required = (message) => (value) => { return undefined; }; -const maxLength = (max) => (value) => (value && value.length > max ? `Your answer must be ${max} characters or less` : undefined); -const minLength = (min) => (value) => (!value || value.length < min ? `Your answer must be ${min} characters or more` : undefined); -const minValue = (min) => (value) => (isNumber(value) && value < min ? `Your answer must be at least ${min}` : undefined); -const maxValue = (max) => (value) => (isNumber(value) && value > max ? `Your answer must be less than ${max}` : undefined); - -const minSelected = (min) => (value) => (!value || coerceArray(value).length < min ? `You must choose a minimum of ${min} option(s)` : undefined); - -const maxSelected = (max) => (value) => (value && coerceArray(value).length > max ? `You must choose a maximum of ${max} option(s)` : undefined); +const maxLength = (max) => (value) => + value && value.length > max + ? `Your answer must be ${max} characters or less` + : undefined; +const minLength = (min) => (value) => + !value || value.length < min + ? `Your answer must be ${min} characters or more` + : undefined; +const minValue = (min) => (value) => + isNumber(value) && value < min + ? `Your answer must be at least ${min}` + : undefined; +const maxValue = (max) => (value) => + isNumber(value) && value > max + ? `Your answer must be less than ${max}` + : undefined; + +const minSelected = (min) => (value) => + !value || coerceArray(value).length < min + ? `You must choose a minimum of ${min} option(s)` + : undefined; + +const maxSelected = (max) => (value) => + value && coerceArray(value).length > max + ? `You must choose a maximum of ${max} option(s)` + : undefined; const isMatchingValue = (submittedValue, existingValue) => { if (submittedValue && existingValue && existingValue instanceof Array) { @@ -52,45 +70,60 @@ const isMatchingValue = (submittedValue, existingValue) => { return submittedValue === existingValue; }; -const isSomeValueMatching = (value, otherNetworkEntities, name) => ( - some(otherNetworkEntities, (entity) => entity.attributes - && isMatchingValue(value, entity.attributes[name]))); +const isSomeValueMatching = (value, otherNetworkEntities, name) => + some( + otherNetworkEntities, + (entity) => + entity.attributes && isMatchingValue(value, entity.attributes[name]), + ); -const getOtherNetworkEntities = (entities, entityId) => filter( - entities, - (node) => (!entityId || node[entityPrimaryKeyProperty] !== entityId), -); +const getOtherNetworkEntities = (entities, entityId) => + filter( + entities, + (node) => !entityId || node[entityPrimaryKeyProperty] !== entityId, + ); const unique = (_, store) => { - return (value, __, { validationMeta }, name) => { const otherNetworkEntities = getOtherNetworkEntities( getNetworkEntitiesForType(store.getState()), validationMeta?.entityId, ); - return isSomeValueMatching(value, otherNetworkEntities, name) ? 'Your answer must be unique' : undefined; + return isSomeValueMatching(value, otherNetworkEntities, name) + ? 'Your answer must be unique' + : undefined; }; }; const getVariableName = (variableId, store) => { - const codebookVariablesForType = getCodebookVariablesForType(store.getState()); + const codebookVariablesForType = getCodebookVariablesForType( + store.getState(), + ); return get(codebookVariablesForType, [variableId, 'name']); }; const getVariableType = (variableId, store) => { - const codebookVariablesForType = getCodebookVariablesForType(store.getState()); + const codebookVariablesForType = getCodebookVariablesForType( + store.getState(), + ); return get(codebookVariablesForType, [variableId, 'type']); }; const differentFrom = (variableId, store) => { const variableName = getVariableName(variableId, store); - return (value, allValues) => (isMatchingValue(value, allValues[variableId]) ? `Your answer must be different from ${variableName}` : undefined); + return (value, allValues) => + isMatchingValue(value, allValues[variableId]) + ? `Your answer must be different from ${variableName}` + : undefined; }; const sameAs = (variableId, store) => { const variableName = getVariableName(variableId, store); - return (value, allValues) => (!isMatchingValue(value, allValues[variableId]) ? `Your answer must be the same as ${variableName}` : undefined); + return (value, allValues) => + !isMatchingValue(value, allValues[variableId]) + ? `Your answer must be the same as ${variableName}` + : undefined; }; const compareVariables = (value1, value2, type) => { @@ -117,13 +150,21 @@ const compareVariables = (value1, value2, type) => { const greaterThanVariable = (variableId, store) => { const variableName = getVariableName(variableId, store); const variableType = getVariableType(variableId, store); - return (value, allValues) => (isNil(value) || (compareVariables(value, allValues[variableId], variableType) <= 0) ? `Your answer must be greater than ${variableName}` : undefined); + return (value, allValues) => + isNil(value) || + compareVariables(value, allValues[variableId], variableType) <= 0 + ? `Your answer must be greater than ${variableName}` + : undefined; }; const lessThanVariable = (variableId, store) => { const variableName = getVariableName(variableId, store); const variableType = getVariableType(variableId, store); - return (value, allValues) => (isNil(value) || (compareVariables(value, allValues[variableId], variableType) >= 0) ? `Your answer must be less than ${variableName}` : undefined); + return (value, allValues) => + isNil(value) || + compareVariables(value, allValues[variableId], variableType) >= 0 + ? `Your answer must be less than ${variableName}` + : undefined; }; export default { diff --git a/lib/interviewer/utils/createSorter.js b/lib/interviewer/utils/createSorter.js index 5139adea..9ec70c62 100644 --- a/lib/interviewer/utils/createSorter.js +++ b/lib/interviewer/utils/createSorter.js @@ -1,5 +1,5 @@ import { entityAttributesProperty } from '@codaco/shared-consts'; -import { get } from './lodash-replacements'; +import { get } from 'lodash-es'; /** * Creating a collator that is reused by string comparison is significantly faster @@ -11,13 +11,12 @@ import { get } from './lodash-replacements'; const collator = new Intl.Collator(); /* Maps a `_createdIndex` index value to all items in an array */ -const withCreatedIndex = (items) => items.map( - (item, _createdIndex) => ({ ...item, _createdIndex }), -); +const withCreatedIndex = (items) => + items.map((item, _createdIndex) => ({ ...item, _createdIndex })); /* all items without the '_createdIndex' prop */ -const withoutCreatedIndex = (items) => items - .map(({ _createdIndex, ...originalItem }) => originalItem); +const withoutCreatedIndex = (items) => + items.map(({ _createdIndex, ...originalItem }) => originalItem); /** * Helper that returns a function compatible with Array.sort that uses an @@ -47,123 +46,144 @@ const desc = (propertyGetter) => (a, b) => asc(propertyGetter)(b, a); * * Used to chain together multiple sort functions. */ -const chain = (...fns) => (a, b) => fns.reduce((diff, fn) => diff || fn(a, b), 0); +const chain = + (...fns) => + (a, b) => + fns.reduce((diff, fn) => diff || fn(a, b), 0); /** - * Generates a sort function for strings that handles null/undefined values by - * placing them at the end of the list. - * - * Also places non-strings at the end of the sorting order. + * Generates a sort function for strings that handles null/undefined values by + * placing them at the end of the list. + * + * Also places non-strings at the end of the sorting order. */ -const stringFunction = ({ property, direction }) => (a, b) => { - const firstValue = get(a, property, null); - const secondValue = get(b, property, null); - - if (firstValue === null || typeof firstValue !== 'string') { - return 1; - } - - if (secondValue === null || typeof secondValue !== 'string') { - return -1; - } - - if (direction === 'asc') { - return collator.compare(firstValue, secondValue); - } +const stringFunction = + ({ property, direction }) => + (a, b) => { + const firstValue = get(a, property, null); + const secondValue = get(b, property, null); - return collator.compare(secondValue, firstValue); -}; + if (firstValue === null || typeof firstValue !== 'string') { + return 1; + } -const categoricalFunction = ({ property, direction, hierarchy = [] }) => (a, b) => { - // hierarchy is whatever order the variables were specified in the variable definition - const firstValues = get(a, property, []); - const secondValues = get(b, property, []); + if (secondValue === null || typeof secondValue !== 'string') { + return -1; + } - for (let i = 0; i < Math.max(firstValues.length, secondValues.length); i += 1) { - const firstValue = i < firstValues.length ? firstValues[i] : null; - const secondValue = i < secondValues.length ? secondValues[i] : null; + if (direction === 'asc') { + return collator.compare(firstValue, secondValue); + } - if (firstValue !== secondValue) { - // If one of the values is not in the hierarchy, it is sorted to the end of the list - const firstIndex = hierarchy.indexOf(firstValue); - const secondIndex = hierarchy.indexOf(secondValue); + return collator.compare(secondValue, firstValue); + }; - if (firstIndex === -1) { - return 1; - } - if (secondIndex === -1) { - return -1; +const categoricalFunction = + ({ property, direction, hierarchy = [] }) => + (a, b) => { + // hierarchy is whatever order the variables were specified in the variable definition + const firstValues = get(a, property, []); + const secondValues = get(b, property, []); + + for ( + let i = 0; + i < Math.max(firstValues.length, secondValues.length); + i += 1 + ) { + const firstValue = i < firstValues.length ? firstValues[i] : null; + const secondValue = i < secondValues.length ? secondValues[i] : null; + + if (firstValue !== secondValue) { + // If one of the values is not in the hierarchy, it is sorted to the end of the list + const firstIndex = hierarchy.indexOf(firstValue); + const secondIndex = hierarchy.indexOf(secondValue); + + if (firstIndex === -1) { + return 1; + } + if (secondIndex === -1) { + return -1; + } + + if (direction === 'asc') { + return firstIndex - secondIndex; + } + return secondIndex - firstIndex; // desc } - - if (direction === 'asc') { - return firstIndex - secondIndex; - } return secondIndex - firstIndex; // desc } - } - return 0; -}; + return 0; + }; /** * Creates a sort function that sorts items according to the index of their * property value in a hierarchy array. */ -const hierarchyFunction = ({ property, direction = 'desc', hierarchy = [] }) => (a, b) => { - const firstValue = get(a, property); - const secondValue = get(b, property); - - const firstIndex = hierarchy.indexOf(firstValue); - const secondIndex = hierarchy.indexOf(secondValue); +const hierarchyFunction = + ({ property, direction = 'desc', hierarchy = [] }) => + (a, b) => { + const firstValue = get(a, property); + const secondValue = get(b, property); - // If the value is not in the hierarchy, it is sorted to the end of the list - if (firstIndex === -1) { - return 1; - } - if (secondIndex === -1) { - return -1; - } + const firstIndex = hierarchy.indexOf(firstValue); + const secondIndex = hierarchy.indexOf(secondValue); - if (direction === 'asc') { - if (firstIndex > secondIndex) { - return -1; - } - - if (firstIndex < secondIndex) { + // If the value is not in the hierarchy, it is sorted to the end of the list + if (firstIndex === -1) { return 1; } - } else { - if (firstIndex < secondIndex) { + if (secondIndex === -1) { return -1; } - if (firstIndex > secondIndex) { - return 1; + if (direction === 'asc') { + if (firstIndex > secondIndex) { + return -1; + } + + if (firstIndex < secondIndex) { + return 1; + } + } else { + if (firstIndex < secondIndex) { + return -1; + } + + if (firstIndex > secondIndex) { + return 1; + } } - } - return 0; -}; + return 0; + }; -const dateFunction = ({ property, direction }) => (a, b) => { - const firstValueString = get(a, property, null); - const secondValueString = get(b, property, null); +const dateFunction = + ({ property, direction }) => + (a, b) => { + const firstValueString = get(a, property, null); + const secondValueString = get(b, property, null); - const firstValueDate = Date.parse(firstValueString); - const secondValueDate = Date.parse(secondValueString); + const firstValueDate = Date.parse(firstValueString); + const secondValueDate = Date.parse(secondValueString); - if (Number.isNaN(firstValueDate)) { - return 1; - } + if (Number.isNaN(firstValueDate)) { + return 1; + } - if (Number.isNaN(secondValueDate)) { - return -1; - } + if (Number.isNaN(secondValueDate)) { + return -1; + } - if (direction === 'asc') { - return -(firstValueDate < secondValueDate) || +(firstValueDate > secondValueDate); - } + if (direction === 'asc') { + return ( + -(firstValueDate < secondValueDate) || + +(firstValueDate > secondValueDate) + ); + } - return -(firstValueDate > secondValueDate) || +(firstValueDate < secondValueDate); -}; + return ( + -(firstValueDate > secondValueDate) || +(firstValueDate < secondValueDate) + ); + }; /** * Transforms sort rules into sort functions compatible with Array.sort. @@ -182,23 +202,43 @@ const getSortFunction = (rule) => { // LIFO/FIFO rule sorted by _createdIndex if (property === '*') { - return direction === 'asc' ? asc((item) => get(item, '_createdIndex')) : desc((item) => get(item, '_createdIndex')); + return direction === 'asc' + ? asc((item) => get(item, '_createdIndex')) + : desc((item) => get(item, '_createdIndex')); } - if (type === 'string') { return stringFunction(rule); } + if (type === 'string') { + return stringFunction(rule); + } - if (type === 'boolean') { return direction === 'asc' ? asc((item) => get(item, property, false)) : desc((item) => get(item, property, true)); } + if (type === 'boolean') { + return direction === 'asc' + ? asc((item) => get(item, property, false)) + : desc((item) => get(item, property, true)); + } - if (type === 'number') { return direction === 'asc' ? asc((item) => get(item, property, Infinity)) : desc((item) => get(item, property, -Infinity)); } + if (type === 'number') { + return direction === 'asc' + ? asc((item) => get(item, property, Infinity)) + : desc((item) => get(item, property, -Infinity)); + } - if (type === 'date') { return dateFunction(rule); } + if (type === 'date') { + return dateFunction(rule); + } - if (type === 'hierarchy') { return hierarchyFunction(rule); } + if (type === 'hierarchy') { + return hierarchyFunction(rule); + } - if (type === 'categorical') { return categoricalFunction(rule); } + if (type === 'categorical') { + return categoricalFunction(rule); + } // eslint-disable-next-line no-console - console.warn('🤔 Sort rule missing required property \'type\', or type was not recognized. Sorting as a string, which may cause incorrect results. Supported types are: number, boolean, string, date, hierarchy, categorical.'); + console.warn( + "🤔 Sort rule missing required property 'type', or type was not recognized. Sorting as a string, which may cause incorrect results. Supported types are: number, boolean, string, date, hierarchy, categorical.", + ); return stringFunction(rule); }; @@ -212,9 +252,8 @@ const getSortFunction = (rule) => { */ const createSorter = (sortRules = []) => { const sortFunctions = sortRules.map(getSortFunction); - return (items) => withoutCreatedIndex(withCreatedIndex(items).sort(chain( - ...sortFunctions, - ))); + return (items) => + withoutCreatedIndex(withCreatedIndex(items).sort(chain(...sortFunctions))); }; /** @@ -264,7 +303,7 @@ export const mapNCType = (type) => { /** * Add the entity attributes property to the property path of a sort rule. -*/ + */ const propertyWithAttributePath = (rule) => { // 'type' rules are a special case - they exist in the protocol, but do not // refer to an entity attribute (they refer to a model property) @@ -304,8 +343,12 @@ export const processProtocolSortRule = (codebookVariables) => (sortRule) => { property: propertyWithAttributePath(sortRule), type: mapNCType(type), // Generate a hierarchy if the variable is ordinal based on the ordinal options - ...type === 'ordinal' && { hierarchy: variableDefinition.options.map((option) => option.value) }, - ...type === 'categorical' && { hierarchy: variableDefinition.options.map((option) => option.value) }, + ...(type === 'ordinal' && { + hierarchy: variableDefinition.options.map((option) => option.value), + }), + ...(type === 'categorical' && { + hierarchy: variableDefinition.options.map((option) => option.value), + }), }; }; diff --git a/lib/interviewer/utils/getParentKeyByNameValue.js b/lib/interviewer/utils/getParentKeyByNameValue.js index ea775d3c..f61400a2 100644 --- a/lib/interviewer/utils/getParentKeyByNameValue.js +++ b/lib/interviewer/utils/getParentKeyByNameValue.js @@ -1,6 +1,4 @@ -import { - isEmpty, find, findKey, has, -} from 'lodash'; +import { find, findKey, has, isEmpty } from 'lodash-es'; const findCategoricalKey = (object, toFind) => { // make list of possible var_option pairs @@ -17,10 +15,18 @@ const findCategoricalKey = (object, toFind) => { let foundKey = ''; // check for a categorical variable with a valid option value const categoricalVariable = collection.find((pair) => { - foundKey = findKey(object, (objectItem) => objectItem.name.toString() === pair.name.toString()); - return (foundKey && has(object[foundKey], 'options') - && find(object[foundKey].options, - (option) => option.value.toString() === pair.option.toString())); + foundKey = findKey( + object, + (objectItem) => objectItem.name.toString() === pair.name.toString(), + ); + return ( + foundKey && + has(object[foundKey], 'options') && + find( + object[foundKey].options, + (option) => option.value.toString() === pair.option.toString(), + ) + ); }); if (has(categoricalVariable, 'option')) { return `${foundKey}_${categoricalVariable.option}`; @@ -56,7 +62,10 @@ const getParentKeyByNameValue = (object, toFind) => { // possible location if (!foundKey && toFind && (toFind.endsWith('_x') || toFind.endsWith('_y'))) { const locationName = toFind.substring(0, toFind.length - 2); - foundKey = findKey(object, (objectItem) => objectItem.name === locationName); + foundKey = findKey( + object, + (objectItem) => objectItem.name === locationName, + ); if (foundKey) { foundKey += toFind.substring(toFind.length - 2); } diff --git a/lib/interviewer/utils/playSound.js b/lib/interviewer/utils/playSound.js index af7224ac..2926d9e7 100644 --- a/lib/interviewer/utils/playSound.js +++ b/lib/interviewer/utils/playSound.js @@ -1,4 +1,4 @@ -import { debounce } from './lodash-replacements'; +import { debounce } from 'lodash-es'; // Play a given sound export const playSound = ({ diff --git a/lib/network-exporters/formatters/csv/__tests__/mockObjects.js b/lib/network-exporters/formatters/csv/__tests__/mockObjects.js index be4ddec7..87ca1acd 100644 --- a/lib/network-exporters/formatters/csv/__tests__/mockObjects.js +++ b/lib/network-exporters/formatters/csv/__tests__/mockObjects.js @@ -1,5 +1,16 @@ -import { caseProperty, codebookHashProperty, entityAttributesProperty, entityPrimaryKeyProperty, protocolName, protocolProperty, sessionExportTimeProperty, sessionFinishTimeProperty, sessionProperty, sessionStartTimeProperty } from '@codaco/shared-consts'; -import { groupBy } from 'lodash'; +import { + caseProperty, + codebookHashProperty, + entityAttributesProperty, + entityPrimaryKeyProperty, + protocolName, + protocolProperty, + sessionExportTimeProperty, + sessionFinishTimeProperty, + sessionProperty, + sessionStartTimeProperty, +} from '@codaco/shared-consts'; +import { groupBy } from 'lodash-es'; import { insertEgoIntoSessionNetworks } from '../../session/insertEgoIntoSessionNetworks'; import { resequenceIds } from '../../session/resequenceIds'; @@ -46,14 +57,52 @@ export const mockExportOptions = { export const mockNetwork = { nodes: [ - { [entityPrimaryKeyProperty]: '1', type: 'mock-node-type', [entityAttributesProperty]: { 'mock-uuid-1': 'Dee', 'mock-uuid-2': 40, 'mock-uuid-3': { x: 0, y: 0 }, 'mock-uuid-4': true, 'mock-uuid-5': null } }, - { [entityPrimaryKeyProperty]: '2', type: 'mock-node-type', [entityAttributesProperty]: { 'mock-uuid-1': 'Carl', 'mock-uuid-2': 0, 'mock-uuid-3': { x: 0, y: 0 }, 'mock-uuid-4': false, 'mock-uuid-5': null } }, - { [entityPrimaryKeyProperty]: '3', type: 'mock-node-type', [entityAttributesProperty]: { 'mock-uuid-1': 'Jumbo', 'mock-uuid-2': 50, 'mock-uuid-3': null, 'mock-uuid-4': true, 'mock-uuid-5': null } }, - { [entityPrimaryKeyProperty]: '4', type: 'mock-node-type', [entityAttributesProperty]: { 'mock-uuid-1': 'Francis', 'mock-uuid-2': 10, 'mock-uuid-3': { x: 0, y: 0 }, 'mock-uuid-4': null, 'mock-uuid-5': null } }, - ], - edges: [ - { from: '1', to: '2', type: 'mock-edge-type' }, + { + [entityPrimaryKeyProperty]: '1', + type: 'mock-node-type', + [entityAttributesProperty]: { + 'mock-uuid-1': 'Dee', + 'mock-uuid-2': 40, + 'mock-uuid-3': { x: 0, y: 0 }, + 'mock-uuid-4': true, + 'mock-uuid-5': null, + }, + }, + { + [entityPrimaryKeyProperty]: '2', + type: 'mock-node-type', + [entityAttributesProperty]: { + 'mock-uuid-1': 'Carl', + 'mock-uuid-2': 0, + 'mock-uuid-3': { x: 0, y: 0 }, + 'mock-uuid-4': false, + 'mock-uuid-5': null, + }, + }, + { + [entityPrimaryKeyProperty]: '3', + type: 'mock-node-type', + [entityAttributesProperty]: { + 'mock-uuid-1': 'Jumbo', + 'mock-uuid-2': 50, + 'mock-uuid-3': null, + 'mock-uuid-4': true, + 'mock-uuid-5': null, + }, + }, + { + [entityPrimaryKeyProperty]: '4', + type: 'mock-node-type', + [entityAttributesProperty]: { + 'mock-uuid-1': 'Francis', + 'mock-uuid-2': 10, + 'mock-uuid-3': { x: 0, y: 0 }, + 'mock-uuid-4': null, + 'mock-uuid-5': null, + }, + }, ], + edges: [{ from: '1', to: '2', type: 'mock-edge-type' }], ego: { [entityPrimaryKeyProperty]: 'ego-id-1', [entityAttributesProperty]: { @@ -78,12 +127,26 @@ export const mockNetwork = { export const mockNetwork2 = { nodes: [ - { [entityPrimaryKeyProperty]: '10', type: 'mock-node-type', [entityAttributesProperty]: { 'mock-uuid-1': 'Jimbo', 'mock-uuid-2': 20, 'mock-uuid-3': { x: 10, y: 50 } } }, - { [entityPrimaryKeyProperty]: '20', type: 'mock-node-type', [entityAttributesProperty]: { 'mock-uuid-1': 'Jambo', 'mock-uuid-2': 30, 'mock-uuid-3': { x: 20, y: 20 } } }, - ], - edges: [ - { from: '10', to: '20', type: 'mock-edge-type' }, + { + [entityPrimaryKeyProperty]: '10', + type: 'mock-node-type', + [entityAttributesProperty]: { + 'mock-uuid-1': 'Jimbo', + 'mock-uuid-2': 20, + 'mock-uuid-3': { x: 10, y: 50 }, + }, + }, + { + [entityPrimaryKeyProperty]: '20', + type: 'mock-node-type', + [entityAttributesProperty]: { + 'mock-uuid-1': 'Jambo', + 'mock-uuid-2': 30, + 'mock-uuid-3': { x: 20, y: 20 }, + }, + }, ], + edges: [{ from: '10', to: '20', type: 'mock-edge-type' }], ego: { [entityPrimaryKeyProperty]: 'ego-id-10', [entityAttributesProperty]: { @@ -109,8 +172,11 @@ export const mockNetwork2 = { // Function designed to mirror the flow in FileExportManager.exportSessions() export const processMockNetworks = (networkCollection) => { const sessionsWithEgo = insertEgoIntoSessionNetworks(networkCollection); - const sessionsByProtocol = groupBy(sessionsWithEgo, `sessionVariables.${protocolProperty}`); + const sessionsByProtocol = groupBy( + sessionsWithEgo, + `sessionVariables.${protocolProperty}`, + ); const sessionsWithResequencedIDs = resequenceIds(sessionsByProtocol); return sessionsWithResequencedIDs; -}; \ No newline at end of file +}; diff --git a/lib/network-exporters/formatters/graphml/createGraphML.js b/lib/network-exporters/formatters/graphml/createGraphML.js index c493bbff..e4c2bebc 100644 --- a/lib/network-exporters/formatters/graphml/createGraphML.js +++ b/lib/network-exporters/formatters/graphml/createGraphML.js @@ -1,10 +1,6 @@ import jsSHA from 'jssha/dist/sha1'; -import { findKey, groupBy, includes } from 'lodash'; -import { - createDataElement, - formatXml, - getGraphMLTypeForKey, -} from './helpers'; +import { findKey, groupBy, includes } from 'lodash-es'; +import { createDataElement, formatXml, getGraphMLTypeForKey } from './helpers'; import { VariableType, @@ -427,7 +423,7 @@ const generateEgoDataElements = ( document, { key: optionKey }, !!entityAttributes[key] && - includes(entityAttributes[key], option.value), + includes(entityAttributes[key], option.value), ), ); }); @@ -611,7 +607,7 @@ const generateDataElements = ( document, { key: optionKey }, !!entityAttributes[key] && - includes(entityAttributes[key], option.value), + includes(entityAttributes[key], option.value), ), ); }); diff --git a/lib/network-exporters/formatters/graphml/helpers.js b/lib/network-exporters/formatters/graphml/helpers.js index ec25b192..af37b824 100644 --- a/lib/network-exporters/formatters/graphml/helpers.js +++ b/lib/network-exporters/formatters/graphml/helpers.js @@ -1,4 +1,4 @@ -import { isNil } from 'lodash'; +import { isNil } from 'lodash-es'; import { getEntityAttributes } from '../../utils/general'; // Gephi does not support long lines in graphML, meaning we need to "beautify" the output @@ -63,9 +63,4 @@ const createElement = (xmlDoc, tagName, attrs = {}, child = null) => { const createDataElement = (xmlDoc, attributes, text) => createElement(xmlDoc, 'data', attributes, xmlDoc.createTextNode(text)); -export { - createDataElement, - formatXml, - getGraphMLTypeForKey -}; - +export { createDataElement, formatXml, getGraphMLTypeForKey }; diff --git a/lib/network-query/predicate.js b/lib/network-query/predicate.js index d2d14cfd..cf159b60 100644 --- a/lib/network-query/predicate.js +++ b/lib/network-query/predicate.js @@ -1,4 +1,4 @@ -import { isEqual, isNull, isArray } from 'lodash'; +import { isArray, isEqual, isNull } from 'lodash-es'; // operators list export const operators = { @@ -45,118 +45,117 @@ export const countOperators = { */ const predicate = (operator) => - ({ value, other: variableValue }) => { - switch (operator) { - case operators.GREATER_THAN: - case countOperators.COUNT_GREATER_THAN: - return value > variableValue; - case operators.LESS_THAN: - case countOperators.COUNT_LESS_THAN: - return value < variableValue; - case operators.GREATER_THAN_OR_EQUAL: - case countOperators.COUNT_GREATER_THAN_OR_EQUAL: - return value >= variableValue; - case operators.LESS_THAN_OR_EQUAL: - case countOperators.COUNT_LESS_THAN_OR_EQUAL: - return value <= variableValue; - case operators.EXACTLY: - case countOperators.COUNT: - return isEqual(value, variableValue); - case operators.NOT: - case countOperators.COUNT_NOT: - return !isEqual(value, variableValue); - case operators.CONTAINS: { - const regexp = new RegExp(variableValue); - return regexp.test(value); - } - case operators.DOES_NOT_CONTAIN: { - const regexp = new RegExp(variableValue); - return !regexp.test(value); - } - /** - * WARNING: INCLUDES/EXCLUDES are complicated! - * - * value can be a string, an integer, or an array - * variableValue can be a string, an integer, or an array - * - * If you change these, make sure you test all the cases! - */ - case operators.INCLUDES: { - if (!value) { - return false; - } // ord/cat vars are initialised to null - - if (isArray(variableValue)) { - if (isArray(value)) { - return variableValue.every((v) => value.includes(v)); - } - - return variableValue.includes(value); - } + ({ value, other: variableValue }) => { + switch (operator) { + case operators.GREATER_THAN: + case countOperators.COUNT_GREATER_THAN: + return value > variableValue; + case operators.LESS_THAN: + case countOperators.COUNT_LESS_THAN: + return value < variableValue; + case operators.GREATER_THAN_OR_EQUAL: + case countOperators.COUNT_GREATER_THAN_OR_EQUAL: + return value >= variableValue; + case operators.LESS_THAN_OR_EQUAL: + case countOperators.COUNT_LESS_THAN_OR_EQUAL: + return value <= variableValue; + case operators.EXACTLY: + case countOperators.COUNT: + return isEqual(value, variableValue); + case operators.NOT: + case countOperators.COUNT_NOT: + return !isEqual(value, variableValue); + case operators.CONTAINS: { + const regexp = new RegExp(variableValue); + return regexp.test(value); + } + case operators.DOES_NOT_CONTAIN: { + const regexp = new RegExp(variableValue); + return !regexp.test(value); + } + /** + * WARNING: INCLUDES/EXCLUDES are complicated! + * + * value can be a string, an integer, or an array + * variableValue can be a string, an integer, or an array + * + * If you change these, make sure you test all the cases! + */ + case operators.INCLUDES: { + if (!value) { + return false; + } // ord/cat vars are initialised to null + if (isArray(variableValue)) { if (isArray(value)) { - return value.includes(variableValue); + return variableValue.every((v) => value.includes(v)); } - // both are strings or integers - return value === variableValue; + return variableValue.includes(value); } - case operators.EXCLUDES: { - if (!value) { - return true; - } // ord/cat vars are initialised to null - if (isArray(variableValue)) { - if (isArray(value)) { - return variableValue.every((v) => !value.includes(v)); - } + if (isArray(value)) { + return value.includes(variableValue); + } - return !variableValue.includes(value); - } + // both are strings or integers + return value === variableValue; + } + case operators.EXCLUDES: { + if (!value) { + return true; + } // ord/cat vars are initialised to null + if (isArray(variableValue)) { if (isArray(value)) { - return !value.includes(variableValue); + return variableValue.every((v) => !value.includes(v)); } - // both are strings or integers - return value !== variableValue; + return !variableValue.includes(value); } - case operators.EXISTS: - return !isNull(value); - case operators.NOT_EXISTS: - return isNull(value); - case countOperators.COUNT_ANY: - return value > 0; - case countOperators.COUNT_NONE: - return value === 0; - case operators.OPTIONS_GREATER_THAN: { - if (!isArray(value)) { - return false; - } - return value.length > variableValue; + + if (isArray(value)) { + return !value.includes(variableValue); } - case operators.OPTIONS_LESS_THAN: { - if (!isArray(value)) { - return false; - } - return value.length < variableValue; + + // both are strings or integers + return value !== variableValue; + } + case operators.EXISTS: + return !isNull(value); + case operators.NOT_EXISTS: + return isNull(value); + case countOperators.COUNT_ANY: + return value > 0; + case countOperators.COUNT_NONE: + return value === 0; + case operators.OPTIONS_GREATER_THAN: { + if (!isArray(value)) { + return false; } - case operators.OPTIONS_EQUALS: { - if (!isArray(value)) { - return false; - } - return value.length === variableValue; + return value.length > variableValue; + } + case operators.OPTIONS_LESS_THAN: { + if (!isArray(value)) { + return false; } - case operators.OPTIONS_NOT_EQUALS: { - if (!isArray(value)) { - return false; - } - return value.length !== variableValue; + return value.length < variableValue; + } + case operators.OPTIONS_EQUALS: { + if (!isArray(value)) { + return false; } - default: + return value.length === variableValue; + } + case operators.OPTIONS_NOT_EQUALS: { + if (!isArray(value)) { return false; + } + return value.length !== variableValue; } - }; - + default: + return false; + } + }; export default predicate; diff --git a/lib/ui/components/ActionButton.js b/lib/ui/components/ActionButton.js index f4f8ac99..656a462f 100644 --- a/lib/ui/components/ActionButton.js +++ b/lib/ui/components/ActionButton.js @@ -1,5 +1,5 @@ import cx from 'classnames'; -import { noop } from 'lodash'; +import { noop } from 'lodash-es'; import PropTypes from 'prop-types'; import React from 'react'; import Icon from './Icon'; diff --git a/lib/ui/components/Cards/DataCard.js b/lib/ui/components/Cards/DataCard.js index 4cf17a96..49e7943e 100644 --- a/lib/ui/components/Cards/DataCard.js +++ b/lib/ui/components/Cards/DataCard.js @@ -1,27 +1,15 @@ -import React from 'react'; -import PropTypes from 'prop-types'; import cx from 'classnames'; -import { noop } from 'lodash'; +import { noop } from 'lodash-es'; +import PropTypes from 'prop-types'; -const DataCard = ({ - label, - data = {}, - onClick = noop, - allowDrag = false, -}) => { - const classes = cx( - 'data-card', - { - 'data-card--can-drag': allowDrag, - 'data-card--can-click': onClick !== noop, - }, - ); +const DataCard = ({ label, data = {}, onClick = noop, allowDrag = false }) => { + const classes = cx('data-card', { + 'data-card--can-drag': allowDrag, + 'data-card--can-click': onClick !== noop, + }); return ( -
+

{label}

@@ -39,8 +27,6 @@ const DataCard = ({ ); }; - - DataCard.propTypes = { data: PropTypes.object, label: PropTypes.string.isRequired, diff --git a/lib/ui/components/Dialogs.js b/lib/ui/components/Dialogs.js index 6eb29de0..50b9221e 100644 --- a/lib/ui/components/Dialogs.js +++ b/lib/ui/components/Dialogs.js @@ -1,4 +1,4 @@ -import { omit } from 'lodash'; +import { omit } from 'lodash-es'; import PropTypes from 'prop-types'; import { Component } from 'react'; import DialogVariants from './Dialog'; diff --git a/lib/ui/components/Fields/DatePicker/DatePicker/Days.js b/lib/ui/components/Fields/DatePicker/DatePicker/Days.js index cfff4fb2..542f7b9a 100644 --- a/lib/ui/components/Fields/DatePicker/DatePicker/Days.js +++ b/lib/ui/components/Fields/DatePicker/DatePicker/Days.js @@ -1,6 +1,6 @@ -import { useContext } from 'react'; -import { range } from 'lodash'; +import { range } from 'lodash-es'; import { DateTime } from 'luxon'; +import { useContext } from 'react'; import DatePickerContext from './DatePickerContext'; import { formatRangeItem } from './helpers'; @@ -10,14 +10,15 @@ import { formatRangeItem } from './helpers'; const Days = ({ children }) => { const { date, range: dateRange } = useContext(DatePickerContext); - const days = range(1, DateTime.fromObject(date).daysInMonth + 1) - .map((day) => { + const days = range(1, DateTime.fromObject(date).daysInMonth + 1).map( + (day) => { const d = DateTime.fromObject({ ...date, day }); if (dateRange.contains(d)) { return formatRangeItem(day); } return formatRangeItem(day, { isOutOfRange: true }); - }); + }, + ); return children({ days }); }; diff --git a/lib/ui/components/Fields/DatePicker/DatePicker/Months.js b/lib/ui/components/Fields/DatePicker/DatePicker/Months.js index d47100a8..79dceb1d 100644 --- a/lib/ui/components/Fields/DatePicker/DatePicker/Months.js +++ b/lib/ui/components/Fields/DatePicker/DatePicker/Months.js @@ -1,6 +1,6 @@ -import { useContext } from 'react'; -import { range } from 'lodash'; +import { range } from 'lodash-es'; import { Interval } from 'luxon'; +import { useContext } from 'react'; import DatePickerContext from './DatePickerContext'; import { formatRangeItem, getMonthName } from './helpers'; @@ -10,17 +10,16 @@ import { formatRangeItem, getMonthName } from './helpers'; const Months = ({ children }) => { const { date, range: dateRange } = useContext(DatePickerContext); - const months = range(1, 13) - .map((month) => { - // Create a month long period - const m = Interval.after({ ...date, month, day: 1 }, { months: 1 }); - const label = getMonthName(month); - // if it overlaps min/max period, then this month is valid - if (!dateRange.overlaps(m) || !date.year) { - return formatRangeItem(month, { label, isOutOfRange: true }); - } - return formatRangeItem(month, { label }); - }); + const months = range(1, 13).map((month) => { + // Create a month long period + const m = Interval.after({ ...date, month, day: 1 }, { months: 1 }); + const label = getMonthName(month); + // if it overlaps min/max period, then this month is valid + if (!dateRange.overlaps(m) || !date.year) { + return formatRangeItem(month, { label, isOutOfRange: true }); + } + return formatRangeItem(month, { label }); + }); return children({ months }); }; diff --git a/lib/ui/components/Fields/DatePicker/DatePicker/Years.js b/lib/ui/components/Fields/DatePicker/DatePicker/Years.js index 8ad52e7a..cc2bd927 100644 --- a/lib/ui/components/Fields/DatePicker/DatePicker/Years.js +++ b/lib/ui/components/Fields/DatePicker/DatePicker/Years.js @@ -1,5 +1,5 @@ +import { range } from 'lodash-es'; import { useContext } from 'react'; -import { range } from 'lodash'; import DatePickerContext from './DatePickerContext'; import { formatRangeItem } from './helpers'; @@ -8,8 +8,9 @@ import { formatRangeItem } from './helpers'; */ const Years = ({ children }) => { const { range: dateRange } = useContext(DatePickerContext); - const years = range(dateRange.start.year, dateRange.end.year + 1) - .map((y) => formatRangeItem(y)); + const years = range(dateRange.start.year, dateRange.end.year + 1).map((y) => + formatRangeItem(y), + ); return children({ years }); }; diff --git a/lib/ui/components/Fields/DatePicker/DatePicker/helpers.js b/lib/ui/components/Fields/DatePicker/DatePicker/helpers.js index 58f7e83d..7c7284d8 100644 --- a/lib/ui/components/Fields/DatePicker/DatePicker/helpers.js +++ b/lib/ui/components/Fields/DatePicker/DatePicker/helpers.js @@ -1,5 +1,5 @@ +import { get, isEqual } from 'lodash-es'; import { DateTime, Info } from 'luxon'; -import { isEqual, get } from 'lodash'; export const now = () => DateTime.local(); diff --git a/lib/ui/components/Fields/DatePicker/RangePicker.js b/lib/ui/components/Fields/DatePicker/RangePicker.js index 5e18f3aa..53662e4f 100644 --- a/lib/ui/components/Fields/DatePicker/RangePicker.js +++ b/lib/ui/components/Fields/DatePicker/RangePicker.js @@ -1,7 +1,7 @@ -import React, { useEffect } from 'react'; -import PropTypes from 'prop-types'; import cx from 'classnames'; -import { times, find } from 'lodash'; +import { find, times } from 'lodash-es'; +import PropTypes from 'prop-types'; +import React, { useEffect } from 'react'; // If today's date isn't in range, what's the closest value? const getScrollToValue = (range = [], today) => { @@ -24,43 +24,47 @@ const getScrollToValue = (range = [], today) => { return last; }; -const RangePicker = ({ - type, - range, - today, - value, - onSelect, - offset = 0, -}) => { +const RangePicker = ({ type, range, today, value, onSelect, offset = 0 }) => { const datePickerRef = React.createRef(); const scrollRef = React.createRef(); const datePickerKey = !!datePickerRef.current; - const scrollRefKey = scrollRef.current && scrollRef.current.getAttribute('data-value'); + const scrollRefKey = + scrollRef.current && scrollRef.current.getAttribute('data-value'); const rangeKey = range.toString(); useEffect(() => { // only scroll year - if (type !== 'year') { return; } + if (type !== 'year') { + return; + } // only scroll when value is empty - if (value !== null) { return; } - if (!datePickerRef.current || !scrollRef.current) { return; } + if (value !== null) { + return; + } + if (!datePickerRef.current || !scrollRef.current) { + return; + } const { offsetTop } = scrollRef.current; const { offsetHeight } = scrollRef.current; - datePickerRef.current.scrollTop = offsetTop - (offsetHeight * 0.5); - }, [rangeKey, datePickerKey, scrollRefKey, value, datePickerRef, scrollRef, type]); + datePickerRef.current.scrollTop = offsetTop - offsetHeight * 0.5; + }, [ + rangeKey, + datePickerKey, + scrollRefKey, + value, + datePickerRef, + scrollRef, + type, + ]); - const classes = cx( - 'date-picker__range-picker', - { [`date-picker__range-picker--${type}`]: !!type }, - ); + const classes = cx('date-picker__range-picker', { + [`date-picker__range-picker--${type}`]: !!type, + }); - const padding = times( - offset, - (index) => ( -
- ), - ); + const padding = times(offset, (index) => ( +
+ )); const scrollToValue = getScrollToValue(range, today); return ( diff --git a/lib/ui/components/Fields/DatePicker/helpers.js b/lib/ui/components/Fields/DatePicker/helpers.js index 5e8d5ae4..a68b160e 100644 --- a/lib/ui/components/Fields/DatePicker/helpers.js +++ b/lib/ui/components/Fields/DatePicker/helpers.js @@ -1,23 +1,29 @@ +import { difference, get, intersection } from 'lodash-es'; import { DateTime, Info } from 'luxon'; -import { difference, intersection, get } from 'lodash'; export const now = () => DateTime.local(); export const isEmpty = (value) => value === null || value === ''; -export const getFirstDayOfMonth = (dateObj) => DateTime.fromObject({ ...dateObj, day: 1 }).toFormat('c'); +export const getFirstDayOfMonth = (dateObj) => + DateTime.fromObject({ ...dateObj, day: 1 }).toFormat('c'); -const getProperties = (obj) => Object.keys(obj) - .reduce((acc, key) => { - if (!obj[key]) { return acc; } +const getProperties = (obj) => + Object.keys(obj).reduce((acc, key) => { + if (!obj[key]) { + return acc; + } return [...acc, key]; }, []); -export const hasProperties = (includes = [], excludes = []) => (obj) => { - const props = getProperties(obj); - const hasIncludes = difference(includes, props).length === 0; - const noExcludes = intersection(props, excludes).length === 0; - return hasIncludes && noExcludes; -}; +export const hasProperties = + (includes = [], excludes = []) => + (obj) => { + const props = getProperties(obj); + const hasIncludes = difference(includes, props).length === 0; + const noExcludes = intersection(props, excludes).length === 0; + return hasIncludes && noExcludes; + }; -export const getMonthName = (numericMonth) => get(Info.months(), numericMonth - 1, numericMonth); +export const getMonthName = (numericMonth) => + get(Info.months(), numericMonth - 1, numericMonth); diff --git a/lib/ui/components/Fields/Search.js b/lib/ui/components/Fields/Search.js index 7d825f14..985f83b5 100644 --- a/lib/ui/components/Fields/Search.js +++ b/lib/ui/components/Fields/Search.js @@ -1,8 +1,6 @@ -import React from 'react'; +import { get, isEmpty, noop } from 'lodash-es'; +import { X as ClearIcon, Search as SearchIcon } from 'lucide-react'; import PropTypes from 'prop-types'; -import { noop, get, isEmpty } from 'lodash'; -import { Search as SearchIcon } from 'lucide-react'; -import { X as ClearIcon } from 'lucide-react'; import { getCSSVariableAsString } from '../../utils/CSSVariables'; import Text from './Text'; @@ -17,9 +15,7 @@ const Search = (props) => { onChange(''); }; - const adornmentLeft = color && ( - - ); + const adornmentLeft = color && ; const adornmentRight = color && hasValue && ( (isString(value) ? value : JSON.stringify(value)); export const getValue = (option) => get(option, 'value', option); -const getLabel = (option) => - get(option, 'label', toString(getValue(option))); +const getLabel = (option) => get(option, 'label', toString(getValue(option))); export const asOptionObject = (option) => { if (typeof option !== 'string') { diff --git a/lib/ui/components/Prompts/Prompts.js b/lib/ui/components/Prompts/Prompts.js index f12f6ad4..1724b83c 100644 --- a/lib/ui/components/Prompts/Prompts.js +++ b/lib/ui/components/Prompts/Prompts.js @@ -1,4 +1,4 @@ -import { findIndex } from 'lodash'; +import { findIndex } from 'lodash-es'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useEffect, useMemo, useRef } from 'react'; @@ -6,49 +6,52 @@ import Pips from './Pips'; import Prompt from './Prompt'; /** - * Displays prompts - */ + * Displays prompts + */ const Prompts = (props) => { - const { - currentPromptId = 0, - prompts, - speakable = false, - } = props; + const { currentPromptId = 0, prompts, speakable = false } = props; const prevPromptRef = useRef(); - const currentIndex = findIndex(prompts, (prompt) => prompt.id === currentPromptId); + const currentIndex = findIndex( + prompts, + (prompt) => prompt.id === currentPromptId, + ); useEffect(() => { prevPromptRef.current = currentIndex; }, [currentPromptId, currentIndex]); - const backwards = useMemo(() => currentIndex < prevPromptRef.current, [currentIndex]); + const backwards = useMemo( + () => currentIndex < prevPromptRef.current, + [currentIndex], + ); const variants = { initial: { opacity: 0 }, animate: { opacity: 1, transition: { when: 'beforeChildren' } }, - } + }; return ( - - {prompts.length > 1 ? () : (
)} + + {prompts.length > 1 ? ( + + ) : ( +
+ )} - {prompts.map(({ - id, - text, - }) => (prompts[currentIndex].id === id && ( - - )))} + {prompts.map( + ({ id, text }) => + prompts[currentIndex].id === id && ( + + ), + )}
diff --git a/lib/ui/components/Scroller.js b/lib/ui/components/Scroller.js index 8a9a4c2a..33be55e8 100644 --- a/lib/ui/components/Scroller.js +++ b/lib/ui/components/Scroller.js @@ -1,14 +1,12 @@ -import React, { useRef, useCallback, useImperativeHandle } from 'react'; -import { clamp } from 'lodash'; import cx from 'classnames'; +import { clamp } from 'lodash-es'; import PropTypes from 'prop-types'; +import React, { useCallback, useImperativeHandle, useRef } from 'react'; -const Scroller = React.forwardRef(function Scroller({ - className, - children, - useSmoothScrolling = true, - onScroll, -}, ref) { +const Scroller = React.forwardRef(function Scroller( + { className, children, useSmoothScrolling = true, onScroll }, + ref, +) { const scrollableRef = useRef(); useImperativeHandle(ref, () => ({ @@ -16,7 +14,9 @@ const Scroller = React.forwardRef(function Scroller({ })); const handleScroll = useCallback(() => { - if (!scrollableRef.current || !onScroll) { return; } + if (!scrollableRef.current || !onScroll) { + return; + } const element = scrollableRef.current; const { scrollTop } = element; const maxScrollPosition = element.scrollHeight - element.clientHeight; diff --git a/lib/ui/hooks/useSpeech.js b/lib/ui/hooks/useSpeech.js index 868a2441..bc53cf91 100644 --- a/lib/ui/hooks/useSpeech.js +++ b/lib/ui/hooks/useSpeech.js @@ -1,4 +1,4 @@ -import { noop } from 'lodash'; +import { noop } from 'lodash-es'; import { useCallback, useEffect, useMemo, useState } from 'react'; import useIsMounted from './useIsMounted'; @@ -25,10 +25,14 @@ const useSpeech = (text, lang = window.navigator.language) => { // Find the first speech synthesis voice available for our current language. // The first voice may not always be the best, so this could be improved. - const voiceForLanguage = useMemo(() => voices.find( - // iOS/macOS seem to lower-case navigator.language (which is the default language) - (voice) => voice.lang.toLowerCase() === lang.toLowerCase(), - ), [lang, voices]); + const voiceForLanguage = useMemo( + () => + voices.find( + // iOS/macOS seem to lower-case navigator.language (which is the default language) + (voice) => voice.lang.toLowerCase() === lang.toLowerCase(), + ), + [lang, voices], + ); const speak = () => { if (error) { @@ -51,23 +55,22 @@ const useSpeech = (text, lang = window.navigator.language) => { }; const stop = useCallback(() => { - if (error) { return; } + if (error) { + return; + } speechSynthesis.cancel(); setIsSpeaking(false); }, [error]); - useEffect( - () => { - if (!voiceForLanguage) { - setError(`No voice available for language "${lang}". Cannot speak!`); - } + useEffect(() => { + if (!voiceForLanguage) { + setError(`No voice available for language "${lang}". Cannot speak!`); + } - return () => { - stop(); - }; - }, - [voiceForLanguage, lang, stop], - ); + return () => { + stop(); + }; + }, [voiceForLanguage, lang, stop]); // No text means nothing to do. if (!text) { @@ -75,7 +78,10 @@ const useSpeech = (text, lang = window.navigator.language) => { } return { - speak, stop, isSpeaking, error, + speak, + stop, + isSpeaking, + error, }; }; diff --git a/lib/ui/utils/CSSVariables.js b/lib/ui/utils/CSSVariables.js index 464df495..e7172568 100644 --- a/lib/ui/utils/CSSVariables.js +++ b/lib/ui/utils/CSSVariables.js @@ -1,4 +1,4 @@ -import { isEmpty } from 'lodash'; +import { isEmpty } from 'lodash-es'; const CSSVariable = (variableName) => { if (document.readyState !== 'complete') { @@ -17,8 +17,11 @@ const CSSVariable = (variableName) => { return variable; }; -export const getCSSVariableAsString = (variableName) => CSSVariable(variableName); +export const getCSSVariableAsString = (variableName) => + CSSVariable(variableName); -export const getCSSVariableAsNumber = (variableName) => parseInt(CSSVariable(variableName), 10); +export const getCSSVariableAsNumber = (variableName) => + parseInt(CSSVariable(variableName), 10); -export const getCSSVariableAsObject = (variableName) => JSON.parse(CSSVariable(variableName)); +export const getCSSVariableAsObject = (variableName) => + JSON.parse(CSSVariable(variableName)); diff --git a/package.json b/package.json index c7a93c3e..176e4307 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "@tailwindcss/forms": "^0.5.9", "@tanstack/react-table": "^8.20.5", "@types/async": "^3.2.24", + "@types/lodash-es": "^4.17.12", "@uploadthing/react": "^7.1.0", "@xmldom/xmldom": "^0.8.10", "animejs": "^2.2.0", @@ -68,7 +69,7 @@ "fuse.js": "^7.0.0", "jssha": "^3.3.1", "jszip": "^3.10.1", - "lodash": "^4.17.21", + "lodash-es": "^4.17.21", "lucia": "^2.7.7", "lucide-react": "^0.314.0", "luxon": "^3.5.0", @@ -119,7 +120,6 @@ "@types/d3-interpolate-path": "^2.0.3", "@types/eslint": "^8.56.12", "@types/jest": "^29.5.14", - "@types/lodash": "^4.17.13", "@types/node": "^22.9.0", "@types/papaparse": "^5.3.15", "@types/react": "^18.3.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c5b967e6..ee16be58 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -95,6 +95,9 @@ importers: '@types/async': specifier: ^3.2.24 version: 3.2.24 + '@types/lodash-es': + specifier: ^4.17.12 + version: 4.17.12 '@uploadthing/react': specifier: ^7.1.0 version: 7.1.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(react@18.3.1)(uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)))) @@ -146,7 +149,7 @@ importers: jszip: specifier: ^3.10.1 version: 3.10.1 - lodash: + lodash-es: specifier: ^4.17.21 version: 4.17.21 lucia: @@ -294,9 +297,6 @@ importers: '@types/jest': specifier: ^29.5.14 version: 29.5.14 - '@types/lodash': - specifier: ^4.17.13 - version: 4.17.13 '@types/node': specifier: ^22.9.0 version: 22.9.0 From 7e4401e147bcf6747f84528b82395dba5a9ce00b Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 28 Nov 2024 13:58:47 +0200 Subject: [PATCH 20/37] delete lodash-replacements --- lib/interviewer/utils/lodash-replacements.js | 74 -------------------- 1 file changed, 74 deletions(-) delete mode 100644 lib/interviewer/utils/lodash-replacements.js diff --git a/lib/interviewer/utils/lodash-replacements.js b/lib/interviewer/utils/lodash-replacements.js deleted file mode 100644 index 0a40f9a9..00000000 --- a/lib/interviewer/utils/lodash-replacements.js +++ /dev/null @@ -1,74 +0,0 @@ -const pathReducer = (acc, part) => { - // If part is an array, call pathReducer on each element - if (Array.isArray(part)) { - return part.reduce(pathReducer, acc); - } - - return acc?.[part]; -}; - -// Replacement for lodash.get using optional chaining and nullish coalescing -const getReplacement = (object, path, defaultValue = undefined) => { - if (!object) { return defaultValue; } - if (path === undefined || path === null) { return defaultValue; } - - // If path is a single number, attempt to use it as an array index - if (typeof path === 'number') { - return object?.[path] ?? defaultValue; - } - - const parts = Array.isArray(path) ? path : path.split('.'); - - return parts.reduce(pathReducer, object) ?? defaultValue; -}; - -export const get = getReplacement; - -// Replacement for lodash debounce supporting leading and trailing options -export const debounce = (func, wait, options = {}) => { - const { leading, trailing } = options; - let timeout; - let lastArgs; - let lastThis; - let result; - - const later = () => { - timeout = null; - if (lastArgs) { - result = func.apply(lastThis, lastArgs); - lastArgs = null; - lastThis = null; - } - }; - - const debounced = (...args) => { - if (!timeout && leading) { - result = func.apply(this, args); - } else { - lastArgs = args; - // eslint-disable-next-line @typescript-eslint/no-this-alias - lastThis = this; - } - - clearTimeout(timeout); - timeout = setTimeout(later, wait); - - return result; - }; - - debounced.cancel = () => { - clearTimeout(timeout); - timeout = null; - lastArgs = null; - lastThis = null; - }; - - if (trailing) { - debounced.flush = () => { - clearTimeout(timeout); - later(); - }; - } - - return debounced; -}; From d75c1ffaebe6f39f8cc939a746d2af6cc5fbf4eb Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 28 Nov 2024 14:01:48 +0200 Subject: [PATCH 21/37] fix broken lodash-es imports --- lib/interviewer/components/Canvas/EdgeLayout.js | 2 +- lib/interviewer/components/Canvas/NodeLayout.js | 3 +-- lib/interviewer/components/Canvas/utils.js | 2 +- lib/interviewer/containers/Canvas/PresetSwitcherKey.js | 3 +-- .../containers/CategoricalList/CategoricalListItem.js | 2 +- lib/interviewer/containers/Interfaces/DyadCensus/DyadCensus.js | 2 +- lib/interviewer/containers/Interfaces/NameGenerator.js | 2 +- .../Interfaces/NameGeneratorRoster/NameGeneratorRoster.js | 2 +- .../Interfaces/NameGeneratorRoster/useSortableProperties.js | 3 +-- lib/interviewer/containers/Interfaces/Narrative.js | 2 +- lib/interviewer/containers/Interfaces/Sociogram.js | 3 +-- .../Interfaces/TieStrengthCensus/TieStrengthCensus.js | 2 +- lib/interviewer/ducks/modules/reset.js | 2 +- 13 files changed, 13 insertions(+), 17 deletions(-) diff --git a/lib/interviewer/components/Canvas/EdgeLayout.js b/lib/interviewer/components/Canvas/EdgeLayout.js index b9642f48..535f7be4 100644 --- a/lib/interviewer/components/Canvas/EdgeLayout.js +++ b/lib/interviewer/components/Canvas/EdgeLayout.js @@ -1,8 +1,8 @@ +import { get } from 'lodash-es'; import { useContext, useEffect, useRef } from 'react'; import { useSelector } from 'react-redux'; import LayoutContext from '../../contexts/LayoutContext'; import { getProtocolCodebook } from '../../selectors/protocol'; -import { get } from '../lodash-es'; const viewBoxScale = 100; diff --git a/lib/interviewer/components/Canvas/NodeLayout.js b/lib/interviewer/components/Canvas/NodeLayout.js index 47104658..2cbbfe89 100644 --- a/lib/interviewer/components/Canvas/NodeLayout.js +++ b/lib/interviewer/components/Canvas/NodeLayout.js @@ -3,11 +3,10 @@ import { entityAttributesProperty, entityPrimaryKeyProperty, } from '@codaco/shared-consts'; -import { find, isEmpty } from 'lodash-es'; +import { find, get, isEmpty } from 'lodash-es'; import PropTypes from 'prop-types'; import React from 'react'; import LayoutContext from '../../contexts/LayoutContext'; -import { get } from '../lodash-es'; import LayoutNode from './LayoutNode'; import { getTwoModeLayoutVariable } from './utils'; diff --git a/lib/interviewer/components/Canvas/utils.js b/lib/interviewer/components/Canvas/utils.js index 539a19ce..8f320c2d 100644 --- a/lib/interviewer/components/Canvas/utils.js +++ b/lib/interviewer/components/Canvas/utils.js @@ -1,4 +1,4 @@ -import { get } from '../lodash-es'; +import { get } from 'lodash-es'; export const getTwoModeLayoutVariable = (twoMode, nodeType, layout) => { if (!twoMode) { diff --git a/lib/interviewer/containers/Canvas/PresetSwitcherKey.js b/lib/interviewer/containers/Canvas/PresetSwitcherKey.js index a5b12ce6..689437ae 100644 --- a/lib/interviewer/containers/Canvas/PresetSwitcherKey.js +++ b/lib/interviewer/containers/Canvas/PresetSwitcherKey.js @@ -1,5 +1,5 @@ import cx from 'classnames'; -import { isEmpty } from 'lodash-es'; +import { get, isEmpty } from 'lodash-es'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { createPortal } from 'react-dom'; @@ -14,7 +14,6 @@ import { makeGetNodeAttributeLabel, } from '../../selectors/network'; import { getCurrentStage } from '../../selectors/session'; -import { get } from '../lodash-es'; import Accordion from './Accordion'; class PresetSwitcherKey extends Component { diff --git a/lib/interviewer/containers/CategoricalList/CategoricalListItem.js b/lib/interviewer/containers/CategoricalList/CategoricalListItem.js index d81fe265..36d96b2f 100644 --- a/lib/interviewer/containers/CategoricalList/CategoricalListItem.js +++ b/lib/interviewer/containers/CategoricalList/CategoricalListItem.js @@ -1,5 +1,6 @@ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; import { compose } from '@reduxjs/toolkit'; +import { get } from 'lodash-es'; import PropTypes from 'prop-types'; import { useState } from 'react'; import { connect } from 'react-redux'; @@ -8,7 +9,6 @@ import { getEntityAttributes } from '../../ducks/modules/network'; import { actionCreators as sessionActions } from '../../ducks/modules/session'; import { getNodeColor, getNodeLabel } from '../../selectors/network'; import { getSubjectType } from '../../selectors/prop'; -import { get } from '../lodash-es'; import Overlay from '../Overlay'; import OtherVariableForm from './OtherVariableForm'; diff --git a/lib/interviewer/containers/Interfaces/DyadCensus/DyadCensus.js b/lib/interviewer/containers/Interfaces/DyadCensus/DyadCensus.js index 9a70df2e..253b9253 100644 --- a/lib/interviewer/containers/Interfaces/DyadCensus/DyadCensus.js +++ b/lib/interviewer/containers/Interfaces/DyadCensus/DyadCensus.js @@ -1,4 +1,5 @@ import cx from 'classnames'; +import { get } from 'lodash-es'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useState } from 'react'; @@ -9,7 +10,6 @@ import { Markdown } from '~/lib/ui/components/Fields'; import { usePrompts } from '../../../behaviours/withPrompt'; import Prompts from '../../../components/Prompts'; import { getEdgeColor, getNetworkEdges } from '../../../selectors/network'; -import { get } from '../../lodash-es'; import { getNodePair, getPairs } from './helpers'; import Pair from './Pair'; import useAutoAdvance from './useAutoAdvance'; diff --git a/lib/interviewer/containers/Interfaces/NameGenerator.js b/lib/interviewer/containers/Interfaces/NameGenerator.js index cc85a277..dc0eb3f7 100644 --- a/lib/interviewer/containers/Interfaces/NameGenerator.js +++ b/lib/interviewer/containers/Interfaces/NameGenerator.js @@ -3,6 +3,7 @@ import { entityPrimaryKeyProperty, } from '@codaco/shared-consts'; import { has, omit } from 'lodash'; +import { get } from 'lodash-es'; import PropTypes from 'prop-types'; import { useEffect, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; @@ -23,7 +24,6 @@ import { } from '../../selectors/name-generator'; import { getNodeColor, getNodeTypeLabel } from '../../selectors/network'; import { getAdditionalAttributesSelector } from '../../selectors/prop'; -import { get } from '../lodash-es'; import NodeForm from '../NodeForm'; import NodePanels from '../NodePanels'; import QuickNodeForm from '../QuickNodeForm'; diff --git a/lib/interviewer/containers/Interfaces/NameGeneratorRoster/NameGeneratorRoster.js b/lib/interviewer/containers/Interfaces/NameGeneratorRoster/NameGeneratorRoster.js index 6db11af7..b7881ae5 100644 --- a/lib/interviewer/containers/Interfaces/NameGeneratorRoster/NameGeneratorRoster.js +++ b/lib/interviewer/containers/Interfaces/NameGeneratorRoster/NameGeneratorRoster.js @@ -4,6 +4,7 @@ import { } from '@codaco/shared-consts'; import cx from 'classnames'; import { isEmpty } from 'lodash'; +import { get } from 'lodash-es'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useEffect, useMemo, useRef, useState } from 'react'; @@ -26,7 +27,6 @@ import { } from '../../../selectors/interface'; import { getPromptModelData } from '../../../selectors/name-generator'; import { getNodeColor } from '../../../selectors/network'; -import { get } from '../../lodash-es'; import SearchableList from '../../SearchableList'; import { nameGeneratorHandleBeforeLeaving } from '../NameGenerator'; import { diff --git a/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useSortableProperties.js b/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useSortableProperties.js index 01981cdd..28f68c7d 100644 --- a/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useSortableProperties.js +++ b/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useSortableProperties.js @@ -1,7 +1,6 @@ -import { compact } from 'lodash-es'; +import { compact, get } from 'lodash-es'; import { useMemo } from 'react'; import { mapNCType } from '../../../utils/createSorter'; -import { get } from '../../lodash-es'; import { convertNamesToUUIDs } from './helpers'; /** diff --git a/lib/interviewer/containers/Interfaces/Narrative.js b/lib/interviewer/containers/Interfaces/Narrative.js index ea30be04..ab32f5bd 100644 --- a/lib/interviewer/containers/Interfaces/Narrative.js +++ b/lib/interviewer/containers/Interfaces/Narrative.js @@ -1,4 +1,5 @@ import { entityAttributesProperty } from '@codaco/shared-consts'; +import { get } from 'lodash-es'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { connect } from 'react-redux'; @@ -13,7 +14,6 @@ import { getNetworkEdges, getNetworkNodes } from '../../selectors/network'; import Annotations from '../Canvas/Annotations'; import Background from '../Canvas/Background'; import PresetSwitcher from '../Canvas/PresetSwitcher'; -import { get } from '../lodash-es'; /** * Narrative Interface diff --git a/lib/interviewer/containers/Interfaces/Sociogram.js b/lib/interviewer/containers/Interfaces/Sociogram.js index 9a1b3b5d..8cad3b10 100644 --- a/lib/interviewer/containers/Interfaces/Sociogram.js +++ b/lib/interviewer/containers/Interfaces/Sociogram.js @@ -1,5 +1,5 @@ import { bindActionCreators } from '@reduxjs/toolkit'; -import { isArray } from 'lodash-es'; +import { get, isArray } from 'lodash-es'; import PropTypes from 'prop-types'; import { useMemo, useRef, useState } from 'react'; import { connect, useSelector } from 'react-redux'; @@ -22,7 +22,6 @@ import { getAssetUrlFromId } from '../../selectors/protocol'; import Background from '../Canvas/Background'; import NodeBucket from '../Canvas/NodeBucket'; import NodeLayout from '../Canvas/NodeLayout'; -import { get } from '../lodash-es'; const withResetInterfaceHandler = withHandlers({ handleResetInterface: diff --git a/lib/interviewer/containers/Interfaces/TieStrengthCensus/TieStrengthCensus.js b/lib/interviewer/containers/Interfaces/TieStrengthCensus/TieStrengthCensus.js index 97a4dc04..6d375a97 100644 --- a/lib/interviewer/containers/Interfaces/TieStrengthCensus/TieStrengthCensus.js +++ b/lib/interviewer/containers/Interfaces/TieStrengthCensus/TieStrengthCensus.js @@ -1,4 +1,5 @@ import cx from 'classnames'; +import { get } from 'lodash-es'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useState } from 'react'; @@ -13,7 +14,6 @@ import { getEdgeColor, getNetworkEdges as getEdges, } from '../../../selectors/network'; -import { get } from '../../lodash-es'; import useAutoAdvance from '../DyadCensus/useAutoAdvance'; import useEdgeState from '../DyadCensus/useEdgeState'; import useSteps from '../DyadCensus/useSteps'; diff --git a/lib/interviewer/ducks/modules/reset.js b/lib/interviewer/ducks/modules/reset.js index 969ed1bc..81ba1849 100644 --- a/lib/interviewer/ducks/modules/reset.js +++ b/lib/interviewer/ducks/modules/reset.js @@ -1,5 +1,5 @@ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; -import { get } from '../lodash-es'; +import { get } from 'lodash-es'; import { actionCreators as deviceActions } from './deviceSettings'; import { actionCreators as sessionActions } from './session'; From 400c53f1365b155eecce42397773b256736d8ca4 Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 28 Nov 2024 14:03:42 +0200 Subject: [PATCH 22/37] fix broken lodash-es imports --- .../formatters/csv/processEntityVariables.js | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/network-exporters/formatters/csv/processEntityVariables.js b/lib/network-exporters/formatters/csv/processEntityVariables.js index 6b2b0fa4..57bc7052 100644 --- a/lib/network-exporters/formatters/csv/processEntityVariables.js +++ b/lib/network-exporters/formatters/csv/processEntityVariables.js @@ -1,7 +1,10 @@ // Determine which variables to include -import { includes } from "lodash"; -import { getAttributePropertyFromCodebook, getEntityAttributes } from "../../utils/general"; +import { includes } from 'lodash-es'; +import { + getAttributePropertyFromCodebook, + getEntityAttributes, +} from '../../utils/general'; const processEntityVariables = ( entity, @@ -62,14 +65,14 @@ const processEntityVariables = ( const screenSpaceAttributes = attributeData && useScreenLayoutCoordinates ? { - [`${attributeName}_screenSpaceX`]: ( - attributeData.x * screenLayoutWidth - ).toFixed(2), - [`${attributeName}_screenSpaceY`]: ( - (1.0 - attributeData.y) * - screenLayoutHeight - ).toFixed(2), - } + [`${attributeName}_screenSpaceX`]: ( + attributeData.x * screenLayoutWidth + ).toFixed(2), + [`${attributeName}_screenSpaceY`]: ( + (1.0 - attributeData.y) * + screenLayoutHeight + ).toFixed(2), + } : {}; const layoutAttrs = { @@ -91,4 +94,4 @@ const processEntityVariables = ( ), }); -export default processEntityVariables; \ No newline at end of file +export default processEntityVariables; From f4527cea2c34261b9bd2bb2da34ba354e3b40c52 Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 28 Nov 2024 14:06:57 +0200 Subject: [PATCH 23/37] further broken lodash-es imports --- .../containers/Interfaces/NameGenerator.js | 3 +- .../NameGeneratorRoster.js | 3 +- lib/interviewer/hooks/useForceSimulation.js | 220 ++++++++++-------- .../session/groupByProtocolProperty.ts | 2 +- 4 files changed, 127 insertions(+), 101 deletions(-) diff --git a/lib/interviewer/containers/Interfaces/NameGenerator.js b/lib/interviewer/containers/Interfaces/NameGenerator.js index dc0eb3f7..062d1f09 100644 --- a/lib/interviewer/containers/Interfaces/NameGenerator.js +++ b/lib/interviewer/containers/Interfaces/NameGenerator.js @@ -2,8 +2,7 @@ import { entityAttributesProperty, entityPrimaryKeyProperty, } from '@codaco/shared-consts'; -import { has, omit } from 'lodash'; -import { get } from 'lodash-es'; +import { get, has, omit } from 'lodash-es'; import PropTypes from 'prop-types'; import { useEffect, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; diff --git a/lib/interviewer/containers/Interfaces/NameGeneratorRoster/NameGeneratorRoster.js b/lib/interviewer/containers/Interfaces/NameGeneratorRoster/NameGeneratorRoster.js index b7881ae5..619a1e53 100644 --- a/lib/interviewer/containers/Interfaces/NameGeneratorRoster/NameGeneratorRoster.js +++ b/lib/interviewer/containers/Interfaces/NameGeneratorRoster/NameGeneratorRoster.js @@ -3,8 +3,7 @@ import { entityPrimaryKeyProperty, } from '@codaco/shared-consts'; import cx from 'classnames'; -import { isEmpty } from 'lodash'; -import { get } from 'lodash-es'; +import { get, isEmpty } from 'lodash-es'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useEffect, useMemo, useRef, useState } from 'react'; diff --git a/lib/interviewer/hooks/useForceSimulation.js b/lib/interviewer/hooks/useForceSimulation.js index bc0f33d0..2358351b 100644 --- a/lib/interviewer/hooks/useForceSimulation.js +++ b/lib/interviewer/hooks/useForceSimulation.js @@ -1,10 +1,6 @@ /* eslint-disable react-hooks/exhaustive-deps */ -import { - useRef, - useCallback, - useEffect, -} from 'react'; -import get from 'lodash/get'; +import { get } from 'lodash-es'; +import { useCallback, useEffect, useRef } from 'react'; import screenManager from '../components/Canvas/ScreenManager'; import useViewport from './useViewport'; @@ -14,110 +10,131 @@ const emptyNetwork = { nodes: [], links: [] }; const useForceSimulation = (callback) => { const screen = useRef(screenManager()); - const { - calculateLayoutCoords, - calculateRelativeCoords, - autoZoom, - } = useViewport(VIEWPORT_SPACE_PX); + const { calculateLayoutCoords, calculateRelativeCoords, autoZoom } = + useViewport(VIEWPORT_SPACE_PX); const worker = useRef(null); const simNetwork = useRef(null); const state = useRef(null); const isRunning = useRef(false); - useEffect(() => () => { - if (!worker.current) { return; } - worker.current.terminate(); - worker.current = null; - }, []); - - const initialize = useCallback((network = {}, options = {}) => { - if (worker.current) { worker.current.terminate(); } - - worker.current = new Worker(new URL('./forceSimulation.worker', import.meta.url)); + useEffect( + () => () => { + if (!worker.current) { + return; + } + worker.current.terminate(); + worker.current = null; + }, + [], + ); + + const initialize = useCallback( + (network = {}, options = {}) => { + if (worker.current) { + worker.current.terminate(); + } - const { nodes, links } = { ...emptyNetwork, ...network }; + worker.current = new Worker( + new URL('./forceSimulation.worker', import.meta.url), + ); - state.current = { - links, - nodes, - }; + const { nodes, links } = { ...emptyNetwork, ...network }; - worker.current.onmessage = (event) => { - switch (event.data.type) { - case 'tick': { - isRunning.current = true; - simNetwork.current.nodes = event.data.nodes; - autoZoom(simNetwork.current.nodes, screen.current.get()); - const protocolNodes = event.data.nodes.map(calculateRelativeCoords); - state.current.nodes = protocolNodes; - break; - } - case 'end': { - simNetwork.current.nodes = event.data.nodes; - autoZoom(simNetwork.current.nodes, screen.current.get()); - const protocolNodes = event.data.nodes.map(calculateRelativeCoords); - state.current.nodes = protocolNodes; - isRunning.current = false; - callback(); - break; + state.current = { + links, + nodes, + }; + + worker.current.onmessage = (event) => { + switch (event.data.type) { + case 'tick': { + isRunning.current = true; + simNetwork.current.nodes = event.data.nodes; + autoZoom(simNetwork.current.nodes, screen.current.get()); + const protocolNodes = event.data.nodes.map(calculateRelativeCoords); + state.current.nodes = protocolNodes; + break; + } + case 'end': { + simNetwork.current.nodes = event.data.nodes; + autoZoom(simNetwork.current.nodes, screen.current.get()); + const protocolNodes = event.data.nodes.map(calculateRelativeCoords); + state.current.nodes = protocolNodes; + isRunning.current = false; + callback(); + break; + } + default: } - default: - } - }; - - simNetwork.current = { - nodes: nodes.map(calculateLayoutCoords), - links, - }; + }; - worker.current.postMessage({ - type: 'initialize', - network: { - nodes: simNetwork.current.nodes, + simNetwork.current = { + nodes: nodes.map(calculateLayoutCoords), links, - }, - options, - }); - - isRunning.current = false; - }, [callback]); - - const updateOptions = useCallback((options) => { - if (!worker.current) { return; } + }; + + worker.current.postMessage({ + type: 'initialize', + network: { + nodes: simNetwork.current.nodes, + links, + }, + options, + }); + + isRunning.current = false; + }, + [callback], + ); + + const updateOptions = useCallback( + (options) => { + if (!worker.current) { + return; + } - worker.current.postMessage({ - type: 'update_options', - options, - }); - }, [initialize]); + worker.current.postMessage({ + type: 'update_options', + options, + }); + }, + [initialize], + ); const start = useCallback(() => { - if (!worker.current) { return; } + if (!worker.current) { + return; + } worker.current.postMessage({ type: 'start' }); }, []); const reheat = useCallback(() => { - if (!worker.current) { return; } + if (!worker.current) { + return; + } worker.current.postMessage({ type: 'reheat' }); }, []); const stop = useCallback(() => { - if (!worker.current) { return; } + if (!worker.current) { + return; + } worker.current.postMessage({ type: 'stop' }); // worker.current = null; }, []); // TODO: separate update nodes and update links? const updateNetwork = useCallback((network) => { - if (!worker.current) { return; } + if (!worker.current) { + return; + } const nodes = network.nodes || state.current.nodes; - const simNodes = (network.nodes && network.nodes.map(calculateLayoutCoords)) - || simNetwork.current.nodes; + const simNodes = + (network.nodes && network.nodes.map(calculateLayoutCoords)) || + simNetwork.current.nodes; - const links = nodes.length > 0 - ? (network.links || state.current.links) - : []; + const links = nodes.length > 0 ? network.links || state.current.links : []; state.current = { nodes, @@ -129,10 +146,13 @@ const useForceSimulation = (callback) => { links, }; - const shouldRestart = ( - (!!network.nodes && get(network, 'nodes', []).length !== get(simNetwork, 'current.nodes', []).length) - || (!!network.links && get(network, 'links', []).length !== get(simNetwork, 'current.links', []).length) - ); + const shouldRestart = + (!!network.nodes && + get(network, 'nodes', []).length !== + get(simNetwork, 'current.nodes', []).length) || + (!!network.links && + get(network, 'links', []).length !== + get(simNetwork, 'current.links', []).length); simNetwork.current.nodes = newSimNetwork.nodes; simNetwork.current.links = newSimNetwork.links; @@ -145,7 +165,9 @@ const useForceSimulation = (callback) => { }, []); const updateNode = useCallback((node, index) => { - if (!worker.current) { return; } + if (!worker.current) { + return; + } worker.current.postMessage({ type: 'update_node', @@ -154,20 +176,26 @@ const useForceSimulation = (callback) => { }); }, []); - const moveNode = useCallback(({ x, y }, nodeIndex) => { - const layoutCoords = calculateLayoutCoords({ x, y }); + const moveNode = useCallback( + ({ x, y }, nodeIndex) => { + const layoutCoords = calculateLayoutCoords({ x, y }); - const nodeAttributes = { - fx: layoutCoords.x, - fy: layoutCoords.y, - }; + const nodeAttributes = { + fx: layoutCoords.x, + fy: layoutCoords.y, + }; - updateNode(nodeAttributes, nodeIndex); - }, [updateNode]); + updateNode(nodeAttributes, nodeIndex); + }, + [updateNode], + ); - const releaseNode = useCallback((nodeIndex) => { - updateNode({ fx: null, fy: null }, nodeIndex); - }, [updateNode]); + const releaseNode = useCallback( + (nodeIndex) => { + updateNode({ fx: null, fy: null }, nodeIndex); + }, + [updateNode], + ); return { state, @@ -184,4 +212,4 @@ const useForceSimulation = (callback) => { }; }; -export default useForceSimulation; \ No newline at end of file +export default useForceSimulation; diff --git a/lib/network-exporters/formatters/session/groupByProtocolProperty.ts b/lib/network-exporters/formatters/session/groupByProtocolProperty.ts index f4501553..efafeb0c 100644 --- a/lib/network-exporters/formatters/session/groupByProtocolProperty.ts +++ b/lib/network-exporters/formatters/session/groupByProtocolProperty.ts @@ -1,5 +1,5 @@ import { protocolProperty } from '@codaco/shared-consts'; -import groupBy from 'lodash/groupBy'; +import { groupBy } from 'lodash-es'; import type { SessionWithNetworkEgo, SessionsByProtocol, From 40f5336c10d615707a47f3be47a04314987bc08b Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 28 Nov 2024 15:40:03 +0200 Subject: [PATCH 24/37] refactor to use es-toolkit --- .../interview/_components/ServerSync.tsx | 6 +-- .../_components/DropzoneField.tsx | 3 +- hooks/use-data-table.tsx | 5 +-- .../behaviours/DragAndDrop/DragManager.js | 2 +- .../behaviours/DragAndDrop/DragSource.js | 2 +- .../behaviours/DragAndDrop/Monitor.js | 2 +- .../DragAndDrop/MonitorDropTarget.js | 2 +- .../behaviours/DragAndDrop/reducer.js | 41 +++++++++++-------- .../behaviours/DragAndDrop/useDropMonitor.js | 3 +- .../behaviours/autoInitialisedForm.js | 6 +-- lib/interviewer/behaviours/withBounds.js | 2 +- lib/interviewer/behaviours/withPrompt.js | 2 +- .../components/Canvas/ConvexHull.js | 3 +- .../components/Canvas/ConvexHulls.js | 2 +- .../components/Canvas/EdgeLayout.js | 2 +- .../components/Canvas/NodeLayout.js | 2 +- .../components/Canvas/ScreenManager.js | 2 +- lib/interviewer/components/Canvas/utils.js | 2 +- lib/interviewer/components/NodeList.js | 2 +- .../containers/Canvas/NodeBucket.js | 2 +- .../containers/Canvas/NodeLayout.js | 2 +- .../containers/Canvas/PresetSwitcherKey.js | 2 +- lib/interviewer/containers/Canvas/Radar.js | 2 +- .../CategoricalList/CategoricalList.js | 2 +- .../CategoricalList/CategoricalListItem.js | 2 +- lib/interviewer/containers/Field.js | 4 +- .../Interfaces/DyadCensus/DyadCensus.js | 2 +- .../containers/Interfaces/EgoForm.js | 2 +- .../containers/Interfaces/NameGenerator.js | 3 +- .../NameGeneratorRoster.js | 2 +- .../NameGeneratorRoster/useFuseOptions.js | 3 +- .../useSortableProperties.js | 3 +- .../containers/Interfaces/Narrative.js | 2 +- .../containers/Interfaces/OrdinalBin.js | 2 +- .../containers/Interfaces/Sociogram.js | 4 +- .../TieStrengthCensus/TieStrengthCensus.js | 2 +- .../Interfaces/utils/StageLevelValidation.js | 2 +- lib/interviewer/containers/NodePanel.js | 2 +- lib/interviewer/containers/NodePanels.js | 2 +- lib/interviewer/containers/OrdinalBins.js | 2 +- lib/interviewer/containers/SearchableList.js | 3 +- .../containers/SlidesForm/SlideFormEdge.js | 2 +- .../containers/SlidesForm/SlidesForm.js | 2 +- .../containers/withExternalData.js | 6 +-- lib/interviewer/contexts/LayoutContext.js | 3 +- .../ducks/modules/installedProtocols.js | 2 +- lib/interviewer/ducks/modules/network.js | 24 +++++------ lib/interviewer/ducks/modules/reset.js | 2 +- lib/interviewer/ducks/modules/session.js | 19 ++++----- lib/interviewer/hooks/useExternalData.js | 2 +- lib/interviewer/hooks/useFlipflop.js | 2 +- lib/interviewer/hooks/useForceSimulation.js | 2 +- lib/interviewer/hooks/useSort.js | 2 +- lib/interviewer/hooks/useViewport.js | 3 +- lib/interviewer/selectors/canvas.js | 7 ++-- lib/interviewer/selectors/forms.js | 2 +- lib/interviewer/selectors/interface.js | 3 +- lib/interviewer/selectors/name-generator.js | 2 +- lib/interviewer/selectors/network.ts | 18 ++++---- lib/interviewer/selectors/protocol.js | 2 +- lib/interviewer/selectors/utils.js | 2 +- lib/interviewer/utils/Validations.js | 11 +---- lib/interviewer/utils/createSorter.js | 2 +- .../utils/getParentKeyByNameValue.js | 3 +- lib/interviewer/utils/playSound.js | 4 +- .../formatters/csv/__tests__/mockObjects.js | 4 +- .../formatters/csv/processEntityVariables.js | 2 +- .../formatters/graphml/createGraphML.js | 7 ++-- .../formatters/graphml/helpers.js | 2 +- .../session/groupByProtocolProperty.ts | 4 +- lib/network-query/predicate.js | 22 +++++----- lib/ui/components/ActionButton.js | 2 +- lib/ui/components/Cards/DataCard.js | 2 +- lib/ui/components/Dialogs.js | 2 +- .../Fields/DatePicker/DatePicker/Days.js | 2 +- .../Fields/DatePicker/DatePicker/Months.js | 2 +- .../Fields/DatePicker/DatePicker/Years.js | 2 +- .../Fields/DatePicker/DatePicker/helpers.js | 3 +- .../Fields/DatePicker/RangePicker.js | 2 +- .../components/Fields/DatePicker/helpers.js | 3 +- lib/ui/components/Fields/Search.js | 3 +- lib/ui/components/Fields/Slider/Slider.js | 3 +- lib/ui/components/Fields/TextArea.js | 2 +- lib/ui/components/Fields/Toggle.js | 2 +- lib/ui/components/Fields/utils/options.js | 3 +- lib/ui/components/Prompts/Prompts.js | 2 +- lib/ui/components/Scroller.js | 2 +- lib/ui/hooks/useSpeech.js | 2 +- lib/ui/utils/CSSVariables.js | 2 +- package.json | 3 +- pnpm-lock.yaml | 14 ++++--- 91 files changed, 189 insertions(+), 180 deletions(-) diff --git a/app/(interview)/interview/_components/ServerSync.tsx b/app/(interview)/interview/_components/ServerSync.tsx index 4f0fde8c..2a00ee2e 100644 --- a/app/(interview)/interview/_components/ServerSync.tsx +++ b/app/(interview)/interview/_components/ServerSync.tsx @@ -1,6 +1,6 @@ 'use client'; -import { debounce, isEqual } from 'lodash-es'; +import { debounce, isEqual } from 'es-toolkit'; import { type ReactNode, useCallback, useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; import type { SyncInterviewType } from '~/actions/interviews'; @@ -26,9 +26,7 @@ const ServerSync = ({ // eslint-disable-next-line react-hooks/exhaustive-deps const debouncedSessionSync = useCallback( debounce(serverSync, 2000, { - leading: true, - trailing: true, - maxWait: 10000, + edges: ['trailing', 'leading'], }), [serverSync], ); diff --git a/app/dashboard/participants/_components/DropzoneField.tsx b/app/dashboard/participants/_components/DropzoneField.tsx index 0201b9aa..d6e39d60 100644 --- a/app/dashboard/participants/_components/DropzoneField.tsx +++ b/app/dashboard/participants/_components/DropzoneField.tsx @@ -1,4 +1,3 @@ -import { isArray } from 'lodash-es'; import { FileCheck, FileText } from 'lucide-react'; import { useId } from 'react'; import { useDropzone } from 'react-dropzone'; @@ -41,7 +40,7 @@ export default function DropzoneField({ return 'No CSV file selected. Please select a file.'; } - if (!isArray(value)) { + if (!Array.isArray(value)) { return 'Invalid CSV. Please select a valid CSV file.'; } diff --git a/hooks/use-data-table.tsx b/hooks/use-data-table.tsx index 599f9f1d..8063b80b 100644 --- a/hooks/use-data-table.tsx +++ b/hooks/use-data-table.tsx @@ -23,7 +23,7 @@ import type { SortableField, } from '~/lib/data-table/types'; -import { debounce } from 'lodash-es'; +import { debounce } from 'es-toolkit'; import { useTableStateFromSearchParams } from '~/app/dashboard/_components/ActivityFeed/useTableStateFromSearchParams'; type UseDataTableProps = { @@ -106,8 +106,7 @@ export function useDataTable({ }, 2000, { - trailing: true, - leading: false, + edges: ['trailing'], }, ), [], diff --git a/lib/interviewer/behaviours/DragAndDrop/DragManager.js b/lib/interviewer/behaviours/DragAndDrop/DragManager.js index 9c0e5ced..14e0b8db 100644 --- a/lib/interviewer/behaviours/DragAndDrop/DragManager.js +++ b/lib/interviewer/behaviours/DragAndDrop/DragManager.js @@ -1,4 +1,4 @@ -import { throttle } from 'lodash-es'; +import { throttle } from 'es-toolkit'; export const VERTICAL_SCROLL = 'VERTICAL_SCROLL'; const HORIZONTAL_SCROLL = 'HORIZONTAL_SCROLL'; diff --git a/lib/interviewer/behaviours/DragAndDrop/DragSource.js b/lib/interviewer/behaviours/DragAndDrop/DragSource.js index 07790ca2..5b0421c5 100644 --- a/lib/interviewer/behaviours/DragAndDrop/DragSource.js +++ b/lib/interviewer/behaviours/DragAndDrop/DragSource.js @@ -1,4 +1,4 @@ -import { throttle } from 'lodash-es'; +import { throttle } from 'es-toolkit'; import { useEffect, useRef, useState } from 'react'; import DragManager, { VERTICAL_SCROLL } from './DragManager'; import DragPreview from './DragPreview'; diff --git a/lib/interviewer/behaviours/DragAndDrop/Monitor.js b/lib/interviewer/behaviours/DragAndDrop/Monitor.js index 9ce93471..0992194a 100644 --- a/lib/interviewer/behaviours/DragAndDrop/Monitor.js +++ b/lib/interviewer/behaviours/DragAndDrop/Monitor.js @@ -1,4 +1,4 @@ -import { isEqual, pick } from 'lodash-es'; +import { isEqual, pick } from 'es-toolkit'; import { PureComponent } from 'react'; import store from './store'; diff --git a/lib/interviewer/behaviours/DragAndDrop/MonitorDropTarget.js b/lib/interviewer/behaviours/DragAndDrop/MonitorDropTarget.js index 3b3459d9..68d80a28 100644 --- a/lib/interviewer/behaviours/DragAndDrop/MonitorDropTarget.js +++ b/lib/interviewer/behaviours/DragAndDrop/MonitorDropTarget.js @@ -1,4 +1,4 @@ -import { find, get } from 'lodash-es'; +import { find, get } from 'es-toolkit/compat'; import { PropTypes } from 'prop-types'; import Monitor from './Monitor'; diff --git a/lib/interviewer/behaviours/DragAndDrop/reducer.js b/lib/interviewer/behaviours/DragAndDrop/reducer.js index eda28f46..4bf922ad 100644 --- a/lib/interviewer/behaviours/DragAndDrop/reducer.js +++ b/lib/interviewer/behaviours/DragAndDrop/reducer.js @@ -1,4 +1,5 @@ -import { filter, isEmpty, omit, reject, some, thru } from 'lodash-es'; +import { omit } from 'es-toolkit'; +import { filter, isEmpty, some } from 'es-toolkit/compat'; const UPSERT_TARGET = Symbol('DRAG_AND_DROP/UPSERT_TARGET'); const RENAME_TARGET = Symbol('DRAG_AND_DROP/RENAME_TARGET'); @@ -63,18 +64,17 @@ const markHitTarget = ({ target, source }) => { const markHitTargets = ({ targets, source }) => targets.map((target) => markHitTarget({ target, source })); -const markHitSource = ({ targets, source }) => - thru(source, (s) => { - if (isEmpty(s)) { - return s; - } +const markHitSource = ({ targets, source }) => { + if (isEmpty(source)) { + return source; + } - return { - ...s, - isOver: filter(targets, 'isOver').length > 0, - isOutOfBounds: markOutOfBounds(s), - }; - }); + return { + ...source, + isOver: filter(targets, 'isOver').length > 0, + isOutOfBounds: markOutOfBounds(source), + }; +}; const markHitAll = ({ targets, obstacles, source, ...rest }) => { const targetsWithHits = markHitTargets({ targets, source }); @@ -142,7 +142,7 @@ const reducer = (state = initialState, action) => { switch (action.type) { case UPSERT_TARGET: { const targets = [ - ...reject(state.targets, ['id', action.target.id]), + ...filter(state.targets, (target) => target.id !== action.target.id), markHitTarget({ target: action.target, source: state.source }), ]; @@ -172,7 +172,10 @@ const reducer = (state = initialState, action) => { }), }; case REMOVE_TARGET: { - const targets = reject(state.targets, ['id', action.id]); + const targets = filter( + state.targets, + (target) => target.id !== action.id, + ); const source = markHitSource({ targets, source: state.source }); return { ...state, @@ -182,7 +185,10 @@ const reducer = (state = initialState, action) => { } case UPSERT_OBSTACLE: { const obstacles = [ - ...reject(state.obstacles, ['id', action.obstacle.id]), + ...filter( + state.obstacles, + (obstacle) => obstacle.id !== action.obstacle.id, + ), markHitTarget({ target: action.obstacle, source: state.source }), ]; @@ -198,7 +204,10 @@ const reducer = (state = initialState, action) => { }; } case REMOVE_OBSTACLE: { - const obstacles = reject(state.obstacles, ['id', action.id]); + const obstacles = filter( + state.obstacles, + (obstacle) => obstacle.id !== action.id, + ); const source = markHitSource({ targets: obstacles, source: state.source, diff --git a/lib/interviewer/behaviours/DragAndDrop/useDropMonitor.js b/lib/interviewer/behaviours/DragAndDrop/useDropMonitor.js index 9a212126..2afee696 100644 --- a/lib/interviewer/behaviours/DragAndDrop/useDropMonitor.js +++ b/lib/interviewer/behaviours/DragAndDrop/useDropMonitor.js @@ -1,4 +1,5 @@ -import { find, get, isEqual, pick } from 'lodash-es'; +import { isEqual, pick } from 'es-toolkit'; +import { find, get } from 'es-toolkit/compat'; import { useCallback, useEffect, useRef, useState } from 'react'; import store from './store'; diff --git a/lib/interviewer/behaviours/autoInitialisedForm.js b/lib/interviewer/behaviours/autoInitialisedForm.js index f3b8d3d1..57afcc1b 100644 --- a/lib/interviewer/behaviours/autoInitialisedForm.js +++ b/lib/interviewer/behaviours/autoInitialisedForm.js @@ -1,4 +1,4 @@ -import { fromPairs, map } from 'lodash-es'; +import { fromPairs } from 'es-toolkit/compat'; import PropTypes from 'prop-types'; // TODO: Seems like this knowledge should be part of the field component? @@ -6,14 +6,14 @@ const typeInitalValue = (field) => { switch (field.type) { case 'CheckboxGroup': case 'ToggleGroup': - return fromPairs(map(field.options, (option) => [option, false])); + return fromPairs(field.options.map((option) => [option, false])); default: return ''; } }; const initialValues = (fields) => - fromPairs(map(fields, (field) => [field.name, typeInitalValue(field)])); + fromPairs(fields.map((field) => [field.name, typeInitalValue(field)])); /** * Renders a redux form that contains fields according to a `fields` config. diff --git a/lib/interviewer/behaviours/withBounds.js b/lib/interviewer/behaviours/withBounds.js index 825fb532..108588c1 100644 --- a/lib/interviewer/behaviours/withBounds.js +++ b/lib/interviewer/behaviours/withBounds.js @@ -1,6 +1,6 @@ /* eslint-disable react/no-find-dom-node */ -import { isEqual } from 'lodash-es'; +import { isEqual } from 'es-toolkit'; import { Component } from 'react'; import { findDOMNode } from 'react-dom'; import getAbsoluteBoundingRect from '../utils/getAbsoluteBoundingRect'; diff --git a/lib/interviewer/behaviours/withPrompt.js b/lib/interviewer/behaviours/withPrompt.js index 89c9fa20..07d2ee4e 100644 --- a/lib/interviewer/behaviours/withPrompt.js +++ b/lib/interviewer/behaviours/withPrompt.js @@ -1,4 +1,4 @@ -import { get } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; import { useDispatch, useSelector } from 'react-redux'; import { actionCreators as sessionActions } from '../ducks/modules/session'; import { getAllVariableUUIDsByEntity } from '../selectors/protocol'; diff --git a/lib/interviewer/components/Canvas/ConvexHull.js b/lib/interviewer/components/Canvas/ConvexHull.js index bb37a087..fdc441ec 100644 --- a/lib/interviewer/components/Canvas/ConvexHull.js +++ b/lib/interviewer/components/Canvas/ConvexHull.js @@ -1,6 +1,5 @@ import { entityAttributesProperty } from '@codaco/shared-consts'; import ConcaveMan from 'concaveman'; -import { map } from 'lodash-es'; import PropTypes from 'prop-types'; import { useEffect, useState } from 'react'; @@ -15,7 +14,7 @@ const ConvexHull = ({ useEffect(() => { const generateHull = (nodeCollection) => { // Restructure as array of arrays of coords - const groupAsCoords = map(nodeCollection, (node) => { + const groupAsCoords = nodeCollection.map((node) => { const nodeCoords = node[entityAttributesProperty][layoutVariable]; return [nodeCoords.x, nodeCoords.y]; }); diff --git a/lib/interviewer/components/Canvas/ConvexHulls.js b/lib/interviewer/components/Canvas/ConvexHulls.js index d7c199cf..01652c2e 100644 --- a/lib/interviewer/components/Canvas/ConvexHulls.js +++ b/lib/interviewer/components/Canvas/ConvexHulls.js @@ -1,5 +1,5 @@ import { entityAttributesProperty } from '@codaco/shared-consts'; -import { findIndex } from 'lodash-es'; +import { findIndex } from 'es-toolkit/compat'; import PropTypes from 'prop-types'; import { useEffect, useMemo, useRef, useState } from 'react'; import { useSelector } from 'react-redux'; diff --git a/lib/interviewer/components/Canvas/EdgeLayout.js b/lib/interviewer/components/Canvas/EdgeLayout.js index 535f7be4..4bd4af2d 100644 --- a/lib/interviewer/components/Canvas/EdgeLayout.js +++ b/lib/interviewer/components/Canvas/EdgeLayout.js @@ -1,4 +1,4 @@ -import { get } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; import { useContext, useEffect, useRef } from 'react'; import { useSelector } from 'react-redux'; import LayoutContext from '../../contexts/LayoutContext'; diff --git a/lib/interviewer/components/Canvas/NodeLayout.js b/lib/interviewer/components/Canvas/NodeLayout.js index 2cbbfe89..afd40416 100644 --- a/lib/interviewer/components/Canvas/NodeLayout.js +++ b/lib/interviewer/components/Canvas/NodeLayout.js @@ -3,7 +3,7 @@ import { entityAttributesProperty, entityPrimaryKeyProperty, } from '@codaco/shared-consts'; -import { find, get, isEmpty } from 'lodash-es'; +import { find, get, isEmpty } from 'es-toolkit/compat'; import PropTypes from 'prop-types'; import React from 'react'; import LayoutContext from '../../contexts/LayoutContext'; diff --git a/lib/interviewer/components/Canvas/ScreenManager.js b/lib/interviewer/components/Canvas/ScreenManager.js index fe795b67..b886d6d6 100644 --- a/lib/interviewer/components/Canvas/ScreenManager.js +++ b/lib/interviewer/components/Canvas/ScreenManager.js @@ -1,4 +1,4 @@ -import { clamp } from 'lodash-es'; +import { clamp } from 'es-toolkit'; const screenManager = () => { const el = { diff --git a/lib/interviewer/components/Canvas/utils.js b/lib/interviewer/components/Canvas/utils.js index 8f320c2d..4a385978 100644 --- a/lib/interviewer/components/Canvas/utils.js +++ b/lib/interviewer/components/Canvas/utils.js @@ -1,4 +1,4 @@ -import { get } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; export const getTwoModeLayoutVariable = (twoMode, nodeType, layout) => { if (!twoMode) { diff --git a/lib/interviewer/components/NodeList.js b/lib/interviewer/components/NodeList.js index d2abefa5..4eb8b024 100644 --- a/lib/interviewer/components/NodeList.js +++ b/lib/interviewer/components/NodeList.js @@ -1,7 +1,7 @@ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; import { compose } from '@reduxjs/toolkit'; import cx from 'classnames'; -import { find } from 'lodash-es'; +import { find } from 'es-toolkit/compat'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useRef, useState } from 'react'; diff --git a/lib/interviewer/containers/Canvas/NodeBucket.js b/lib/interviewer/containers/Canvas/NodeBucket.js index a14a74e3..703f056a 100644 --- a/lib/interviewer/containers/Canvas/NodeBucket.js +++ b/lib/interviewer/containers/Canvas/NodeBucket.js @@ -1,5 +1,5 @@ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; -import { isNull, isUndefined } from 'lodash-es'; +import { isNull, isUndefined } from 'es-toolkit'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import React, { useContext } from 'react'; diff --git a/lib/interviewer/containers/Canvas/NodeLayout.js b/lib/interviewer/containers/Canvas/NodeLayout.js index b86619d4..32e13536 100644 --- a/lib/interviewer/containers/Canvas/NodeLayout.js +++ b/lib/interviewer/containers/Canvas/NodeLayout.js @@ -2,7 +2,7 @@ import { entityAttributesProperty, entityPrimaryKeyProperty, } from '@codaco/shared-consts'; -import { get } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; import { connect } from 'react-redux'; import { compose, withHandlers, withState } from 'recompose'; import { DropTarget } from '../../behaviours/DragAndDrop'; diff --git a/lib/interviewer/containers/Canvas/PresetSwitcherKey.js b/lib/interviewer/containers/Canvas/PresetSwitcherKey.js index 689437ae..f9e4df68 100644 --- a/lib/interviewer/containers/Canvas/PresetSwitcherKey.js +++ b/lib/interviewer/containers/Canvas/PresetSwitcherKey.js @@ -1,5 +1,5 @@ import cx from 'classnames'; -import { get, isEmpty } from 'lodash-es'; +import { get, isEmpty } from 'es-toolkit/compat'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { createPortal } from 'react-dom'; diff --git a/lib/interviewer/containers/Canvas/Radar.js b/lib/interviewer/containers/Canvas/Radar.js index 472b5bd0..31cfa3ec 100644 --- a/lib/interviewer/containers/Canvas/Radar.js +++ b/lib/interviewer/containers/Canvas/Radar.js @@ -1,5 +1,5 @@ import color from 'color'; -import { last, range, zipWith } from 'lodash-es'; +import { last, range, zipWith } from 'es-toolkit'; import PropTypes from 'prop-types'; import { getCSSVariableAsString } from '~/lib/ui/utils/CSSVariables'; diff --git a/lib/interviewer/containers/CategoricalList/CategoricalList.js b/lib/interviewer/containers/CategoricalList/CategoricalList.js index 909b1289..f9cef7c0 100644 --- a/lib/interviewer/containers/CategoricalList/CategoricalList.js +++ b/lib/interviewer/containers/CategoricalList/CategoricalList.js @@ -2,7 +2,7 @@ import { entityAttributesProperty } from '@codaco/shared-consts'; import { compose } from '@reduxjs/toolkit'; import cx from 'classnames'; import color from 'color'; -import { throttle } from 'lodash-es'; +import { throttle } from 'es-toolkit'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { Flipper } from 'react-flip-toolkit'; diff --git a/lib/interviewer/containers/CategoricalList/CategoricalListItem.js b/lib/interviewer/containers/CategoricalList/CategoricalListItem.js index 36d96b2f..c7c5d550 100644 --- a/lib/interviewer/containers/CategoricalList/CategoricalListItem.js +++ b/lib/interviewer/containers/CategoricalList/CategoricalListItem.js @@ -1,6 +1,6 @@ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; import { compose } from '@reduxjs/toolkit'; -import { get } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; import PropTypes from 'prop-types'; import { useState } from 'react'; import { connect } from 'react-redux'; diff --git a/lib/interviewer/containers/Field.js b/lib/interviewer/containers/Field.js index 4610d966..cc0eb0de 100644 --- a/lib/interviewer/containers/Field.js +++ b/lib/interviewer/containers/Field.js @@ -1,4 +1,4 @@ -import { get, map, toPairs } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; import PropTypes from 'prop-types'; import { useMemo } from 'react'; import { useStore } from 'react-redux'; @@ -31,7 +31,7 @@ const getInputComponent = (componentType = 'Text') => { * @param {string} validation The name of the validation function to return. */ const getValidation = (validation, store) => - map(toPairs(validation), ([type, options]) => + Object.entries(validation).map(([type, options]) => Object.hasOwnProperty.call(validations, type) ? validations[type](options, store) : () => `Validation "${type}" not found`, diff --git a/lib/interviewer/containers/Interfaces/DyadCensus/DyadCensus.js b/lib/interviewer/containers/Interfaces/DyadCensus/DyadCensus.js index 253b9253..915cbbe8 100644 --- a/lib/interviewer/containers/Interfaces/DyadCensus/DyadCensus.js +++ b/lib/interviewer/containers/Interfaces/DyadCensus/DyadCensus.js @@ -1,5 +1,5 @@ import cx from 'classnames'; -import { get } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useState } from 'react'; diff --git a/lib/interviewer/containers/Interfaces/EgoForm.js b/lib/interviewer/containers/Interfaces/EgoForm.js index df66740a..46ba6988 100644 --- a/lib/interviewer/containers/Interfaces/EgoForm.js +++ b/lib/interviewer/containers/Interfaces/EgoForm.js @@ -1,4 +1,4 @@ -import { debounce } from 'lodash-es'; +import { debounce } from 'es-toolkit'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useCallback, useEffect, useMemo, useState } from 'react'; diff --git a/lib/interviewer/containers/Interfaces/NameGenerator.js b/lib/interviewer/containers/Interfaces/NameGenerator.js index 062d1f09..a28fb2ee 100644 --- a/lib/interviewer/containers/Interfaces/NameGenerator.js +++ b/lib/interviewer/containers/Interfaces/NameGenerator.js @@ -2,7 +2,8 @@ import { entityAttributesProperty, entityPrimaryKeyProperty, } from '@codaco/shared-consts'; -import { get, has, omit } from 'lodash-es'; +import { omit } from 'es-toolkit'; +import { get, has } from 'es-toolkit/compat'; import PropTypes from 'prop-types'; import { useEffect, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; diff --git a/lib/interviewer/containers/Interfaces/NameGeneratorRoster/NameGeneratorRoster.js b/lib/interviewer/containers/Interfaces/NameGeneratorRoster/NameGeneratorRoster.js index 619a1e53..cb7171e7 100644 --- a/lib/interviewer/containers/Interfaces/NameGeneratorRoster/NameGeneratorRoster.js +++ b/lib/interviewer/containers/Interfaces/NameGeneratorRoster/NameGeneratorRoster.js @@ -3,7 +3,7 @@ import { entityPrimaryKeyProperty, } from '@codaco/shared-consts'; import cx from 'classnames'; -import { get, isEmpty } from 'lodash-es'; +import { get, isEmpty } from 'es-toolkit/compat'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useEffect, useMemo, useRef, useState } from 'react'; diff --git a/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useFuseOptions.js b/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useFuseOptions.js index 6a57d065..754d9c4e 100644 --- a/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useFuseOptions.js +++ b/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useFuseOptions.js @@ -1,4 +1,5 @@ -import { compact, get, isEmpty } from 'lodash-es'; +import { compact } from 'es-toolkit'; +import { get, isEmpty } from 'es-toolkit/compat'; import { useMemo } from 'react'; const defaultFuseOptions = { diff --git a/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useSortableProperties.js b/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useSortableProperties.js index 28f68c7d..010249ca 100644 --- a/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useSortableProperties.js +++ b/lib/interviewer/containers/Interfaces/NameGeneratorRoster/useSortableProperties.js @@ -1,4 +1,5 @@ -import { compact, get } from 'lodash-es'; +import { compact } from 'es-toolkit'; +import { get } from 'es-toolkit/compat'; import { useMemo } from 'react'; import { mapNCType } from '../../../utils/createSorter'; import { convertNamesToUUIDs } from './helpers'; diff --git a/lib/interviewer/containers/Interfaces/Narrative.js b/lib/interviewer/containers/Interfaces/Narrative.js index ab32f5bd..11cb190f 100644 --- a/lib/interviewer/containers/Interfaces/Narrative.js +++ b/lib/interviewer/containers/Interfaces/Narrative.js @@ -1,5 +1,5 @@ import { entityAttributesProperty } from '@codaco/shared-consts'; -import { get } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { connect } from 'react-redux'; diff --git a/lib/interviewer/containers/Interfaces/OrdinalBin.js b/lib/interviewer/containers/Interfaces/OrdinalBin.js index c204f1c4..7915f9a2 100644 --- a/lib/interviewer/containers/Interfaces/OrdinalBin.js +++ b/lib/interviewer/containers/Interfaces/OrdinalBin.js @@ -1,5 +1,5 @@ import { entityAttributesProperty } from '@codaco/shared-consts'; -import { isNil } from 'lodash-es'; +import { isNil } from 'es-toolkit'; import PropTypes from 'prop-types'; import { usePrompts } from '../../behaviours/withPrompt'; import MultiNodeBucket from '../../components/MultiNodeBucket'; diff --git a/lib/interviewer/containers/Interfaces/Sociogram.js b/lib/interviewer/containers/Interfaces/Sociogram.js index 8cad3b10..be4117a6 100644 --- a/lib/interviewer/containers/Interfaces/Sociogram.js +++ b/lib/interviewer/containers/Interfaces/Sociogram.js @@ -1,5 +1,5 @@ import { bindActionCreators } from '@reduxjs/toolkit'; -import { get, isArray } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; import PropTypes from 'prop-types'; import { useMemo, useRef, useState } from 'react'; import { connect, useSelector } from 'react-redux'; @@ -57,7 +57,7 @@ const Sociogram = (props) => { const interfaceRef = useRef(null); const dragSafeRef = useRef(null); - const twoMode = useMemo(() => isArray(stage.subject), [stage.subject]); + const twoMode = useMemo(() => Array.isArray(stage.subject), [stage.subject]); const getAssetUrl = useSelector(getAssetUrlFromId); diff --git a/lib/interviewer/containers/Interfaces/TieStrengthCensus/TieStrengthCensus.js b/lib/interviewer/containers/Interfaces/TieStrengthCensus/TieStrengthCensus.js index 6d375a97..40140cb4 100644 --- a/lib/interviewer/containers/Interfaces/TieStrengthCensus/TieStrengthCensus.js +++ b/lib/interviewer/containers/Interfaces/TieStrengthCensus/TieStrengthCensus.js @@ -1,5 +1,5 @@ import cx from 'classnames'; -import { get } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useState } from 'react'; diff --git a/lib/interviewer/containers/Interfaces/utils/StageLevelValidation.js b/lib/interviewer/containers/Interfaces/utils/StageLevelValidation.js index 56dfff80..031245aa 100644 --- a/lib/interviewer/containers/Interfaces/utils/StageLevelValidation.js +++ b/lib/interviewer/containers/Interfaces/utils/StageLevelValidation.js @@ -1,4 +1,4 @@ -import { defaultTo } from 'lodash-es'; +import { defaultTo } from 'es-toolkit/compat'; import { AnimatePresence, motion } from 'motion/react'; import { useCallback, useEffect, useRef, useState } from 'react'; import { v4 as uuid } from 'uuid'; diff --git a/lib/interviewer/containers/NodePanel.js b/lib/interviewer/containers/NodePanel.js index aee98922..066331cc 100644 --- a/lib/interviewer/containers/NodePanel.js +++ b/lib/interviewer/containers/NodePanel.js @@ -1,5 +1,5 @@ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; -import { get } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; import { PureComponent } from 'react'; import { connect } from 'react-redux'; import { compose } from 'recompose'; diff --git a/lib/interviewer/containers/NodePanels.js b/lib/interviewer/containers/NodePanels.js index 404d88b5..34658ef4 100644 --- a/lib/interviewer/containers/NodePanels.js +++ b/lib/interviewer/containers/NodePanels.js @@ -1,6 +1,6 @@ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; import { compose } from '@reduxjs/toolkit'; -import { get } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { connect } from 'react-redux'; diff --git a/lib/interviewer/containers/OrdinalBins.js b/lib/interviewer/containers/OrdinalBins.js index a115674f..a5b3c28a 100644 --- a/lib/interviewer/containers/OrdinalBins.js +++ b/lib/interviewer/containers/OrdinalBins.js @@ -4,7 +4,7 @@ import { } from '@codaco/shared-consts'; import { bindActionCreators, compose } from '@reduxjs/toolkit'; import color from 'color'; -import { isNil } from 'lodash-es'; +import { isNil } from 'es-toolkit'; import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { connect } from 'react-redux'; diff --git a/lib/interviewer/containers/SearchableList.js b/lib/interviewer/containers/SearchableList.js index a9f2d66c..a7afe4ff 100644 --- a/lib/interviewer/containers/SearchableList.js +++ b/lib/interviewer/containers/SearchableList.js @@ -1,5 +1,6 @@ import cx from 'classnames'; -import { get, isEqual } from 'lodash-es'; +import { isEqual } from 'es-toolkit'; +import { get } from 'es-toolkit/compat'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useEffect, useMemo, useRef } from 'react'; diff --git a/lib/interviewer/containers/SlidesForm/SlideFormEdge.js b/lib/interviewer/containers/SlidesForm/SlideFormEdge.js index f3071241..8164f96b 100644 --- a/lib/interviewer/containers/SlidesForm/SlideFormEdge.js +++ b/lib/interviewer/containers/SlidesForm/SlideFormEdge.js @@ -2,7 +2,7 @@ import { entityAttributesProperty, entityPrimaryKeyProperty, } from '@codaco/shared-consts'; -import { find } from 'lodash-es'; +import { find } from 'es-toolkit/compat'; import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { connect } from 'react-redux'; diff --git a/lib/interviewer/containers/SlidesForm/SlidesForm.js b/lib/interviewer/containers/SlidesForm/SlidesForm.js index 6f1ff28b..771ca7ef 100644 --- a/lib/interviewer/containers/SlidesForm/SlidesForm.js +++ b/lib/interviewer/containers/SlidesForm/SlidesForm.js @@ -1,5 +1,5 @@ import cx from 'classnames'; -import { debounce } from 'lodash-es'; +import { debounce } from 'es-toolkit'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useCallback, useEffect, useRef, useState } from 'react'; diff --git a/lib/interviewer/containers/withExternalData.js b/lib/interviewer/containers/withExternalData.js index e8907786..15a9ab0a 100644 --- a/lib/interviewer/containers/withExternalData.js +++ b/lib/interviewer/containers/withExternalData.js @@ -1,5 +1,6 @@ import { entityAttributesProperty } from '@codaco/shared-consts'; -import { get, includes, isNil, reduce, toNumber } from 'lodash-es'; +import { isNil } from 'es-toolkit'; +import { get, includes, toNumber } from 'es-toolkit/compat'; import { connect } from 'react-redux'; import { compose, @@ -133,8 +134,7 @@ const getNodeListUsingTypes = ( protocolCodebook, stageSubject, ); - const attributes = reduce( - node.attributes, + const attributes = node.attributes.reduce( (consolidatedAttributes, attributeValue, attributeKey) => { if (isNil(attributeValue) || attributeValue === '') { return consolidatedAttributes; diff --git a/lib/interviewer/contexts/LayoutContext.js b/lib/interviewer/contexts/LayoutContext.js index 21f368ff..2439bb4a 100644 --- a/lib/interviewer/contexts/LayoutContext.js +++ b/lib/interviewer/contexts/LayoutContext.js @@ -1,6 +1,7 @@ /* eslint-disable react-hooks/exhaustive-deps */ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; -import { clamp, get, noop } from 'lodash-es'; +import { clamp, noop } from 'es-toolkit'; +import { get } from 'es-toolkit/compat'; import React, { useCallback, useEffect, useRef, useState } from 'react'; import { useDispatch } from 'react-redux'; import { getTwoModeLayoutVariable } from '../components/Canvas/utils'; diff --git a/lib/interviewer/ducks/modules/installedProtocols.js b/lib/interviewer/ducks/modules/installedProtocols.js index 4bcff40c..9f92b21a 100644 --- a/lib/interviewer/ducks/modules/installedProtocols.js +++ b/lib/interviewer/ducks/modules/installedProtocols.js @@ -1,4 +1,4 @@ -import { findKey, omit } from 'lodash-es'; +import { findKey, omit } from 'es-toolkit'; import { SET_SERVER_SESSION } from './setServerSession'; const IMPORT_PROTOCOL_COMPLETE = 'IMPORT_PROTOCOL_COMPLETE'; diff --git a/lib/interviewer/ducks/modules/network.js b/lib/interviewer/ducks/modules/network.js index 5c2e5a80..579a3353 100644 --- a/lib/interviewer/ducks/modules/network.js +++ b/lib/interviewer/ducks/modules/network.js @@ -2,7 +2,8 @@ import { entityAttributesProperty, entityPrimaryKeyProperty, } from '@codaco/shared-consts'; -import { find, get, isMatch, keys, omit, reject } from 'lodash-es'; +import { omit } from 'es-toolkit'; +import { find, get, isMatch } from 'es-toolkit/compat'; import { v4 as uuid } from 'uuid'; import { SET_SERVER_SESSION } from './setServerSession'; @@ -139,9 +140,8 @@ const addEdge = (state, action) => ({ const removeEdge = (state, edgeId) => ({ ...state, - edges: reject( - state.edges, - (edge) => edge[entityPrimaryKeyProperty] === edgeId, + edges: state.edges.filter( + (edge) => edge[entityPrimaryKeyProperty] !== edgeId, ), }); @@ -255,16 +255,14 @@ export default function reducer(state = initialState, action = {}) { const removeentityPrimaryKeyProperty = action[entityPrimaryKeyProperty]; return { ...state, - nodes: reject( - state.nodes, + nodes: state.nodes.filter( (node) => - node[entityPrimaryKeyProperty] === removeentityPrimaryKeyProperty, + node[entityPrimaryKeyProperty] !== removeentityPrimaryKeyProperty, ), - edges: reject( - state.edges, + edges: state.edges.filter( (edge) => - edge.from === removeentityPrimaryKeyProperty || - edge.to === removeentityPrimaryKeyProperty, + edge.from !== removeentityPrimaryKeyProperty && + edge.to !== removeentityPrimaryKeyProperty, ), }; } @@ -288,7 +286,9 @@ export default function reducer(state = initialState, action = {}) { }; } case REMOVE_NODE_FROM_PROMPT: { - const togglePromptAttributes = keys(action.promptAttributes).reduce( + const togglePromptAttributes = Object.keys( + action.promptAttributes, + ).reduce( (attributes, attrKey) => ({ ...attributes, [attrKey]: !action.promptAttributes[attrKey], diff --git a/lib/interviewer/ducks/modules/reset.js b/lib/interviewer/ducks/modules/reset.js index 81ba1849..cb8c60b8 100644 --- a/lib/interviewer/ducks/modules/reset.js +++ b/lib/interviewer/ducks/modules/reset.js @@ -1,5 +1,5 @@ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; -import { get } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; import { actionCreators as deviceActions } from './deviceSettings'; import { actionCreators as sessionActions } from './session'; diff --git a/lib/interviewer/ducks/modules/session.js b/lib/interviewer/ducks/modules/session.js index 9c6f9336..437657be 100644 --- a/lib/interviewer/ducks/modules/session.js +++ b/lib/interviewer/ducks/modules/session.js @@ -1,5 +1,6 @@ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; -import { has, omit, reduce } from 'lodash-es'; +import { omit } from 'es-toolkit'; +import { has } from 'es-toolkit/compat'; import { v4 as uuid } from 'uuid'; import { actionTypes as installedProtocolsActionTypes } from './installedProtocols'; import networkReducer, { @@ -55,16 +56,12 @@ const getReducer = }; } case installedProtocolsActionTypes.DELETE_PROTOCOL: - return reduce( - state, - (result, sessionData, sessionId) => { - if (sessionData.protocolUID !== action.protocolUID) { - return { ...result, [sessionId]: sessionData }; - } - return result; - }, - {}, - ); + return state.reduce((result, sessionData, sessionId) => { + if (sessionData.protocolUID !== action.protocolUID) { + return { ...result, [sessionId]: sessionData }; + } + return result; + }, {}); case networkActionTypes.ADD_NODE: case networkActionTypes.ADD_NODE_TO_PROMPT: case networkActionTypes.BATCH_ADD_NODES: diff --git a/lib/interviewer/hooks/useExternalData.js b/lib/interviewer/hooks/useExternalData.js index bc4e9b51..86b276ad 100644 --- a/lib/interviewer/hooks/useExternalData.js +++ b/lib/interviewer/hooks/useExternalData.js @@ -3,7 +3,7 @@ import { entityPrimaryKeyProperty, } from '@codaco/shared-consts'; import { createSelector } from '@reduxjs/toolkit'; -import { mapKeys } from 'lodash-es'; +import { mapKeys } from 'es-toolkit'; import { hash } from 'ohash'; import { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; diff --git a/lib/interviewer/hooks/useFlipflop.js b/lib/interviewer/hooks/useFlipflop.js index e19240a2..b91c341e 100644 --- a/lib/interviewer/hooks/useFlipflop.js +++ b/lib/interviewer/hooks/useFlipflop.js @@ -1,4 +1,4 @@ -import { isNil } from 'lodash-es'; +import { isNil } from 'es-toolkit'; import { useCallback, useEffect, useRef, useState } from 'react'; // Hook that provides state that returns to a rest value after a delay diff --git a/lib/interviewer/hooks/useForceSimulation.js b/lib/interviewer/hooks/useForceSimulation.js index 2358351b..b95bf3fd 100644 --- a/lib/interviewer/hooks/useForceSimulation.js +++ b/lib/interviewer/hooks/useForceSimulation.js @@ -1,5 +1,5 @@ /* eslint-disable react-hooks/exhaustive-deps */ -import { get } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; import { useCallback, useEffect, useRef } from 'react'; import screenManager from '../components/Canvas/ScreenManager'; import useViewport from './useViewport'; diff --git a/lib/interviewer/hooks/useSort.js b/lib/interviewer/hooks/useSort.js index d16cd732..6a0c5a0c 100644 --- a/lib/interviewer/hooks/useSort.js +++ b/lib/interviewer/hooks/useSort.js @@ -1,4 +1,4 @@ -import { isEqual } from 'lodash-es'; +import { isEqual } from 'es-toolkit'; import { useMemo, useState } from 'react'; import createSorter from '../utils/createSorter'; diff --git a/lib/interviewer/hooks/useViewport.js b/lib/interviewer/hooks/useViewport.js index 4c660b18..ec498247 100644 --- a/lib/interviewer/hooks/useViewport.js +++ b/lib/interviewer/hooks/useViewport.js @@ -1,4 +1,5 @@ -import { clamp, get, max, min } from 'lodash-es'; +import { clamp } from 'es-toolkit'; +import { get, max, min } from 'es-toolkit/compat'; import { useMotionValue } from 'motion/react'; import { useCallback } from 'react'; diff --git a/lib/interviewer/selectors/canvas.js b/lib/interviewer/selectors/canvas.js index 410e2d91..af764982 100644 --- a/lib/interviewer/selectors/canvas.js +++ b/lib/interviewer/selectors/canvas.js @@ -2,7 +2,8 @@ import { entityAttributesProperty, entityPrimaryKeyProperty, } from '@codaco/shared-consts'; -import { first, get, has, isArray, isNil } from 'lodash-es'; +import { isNil } from 'es-toolkit'; +import { first, get, has } from 'es-toolkit/compat'; import { getEntityAttributes } from '../ducks/modules/network'; import createSorter, { processProtocolSortRule } from '../utils/createSorter'; import { getNetworkEdges, getNetworkNodes } from './network'; @@ -38,7 +39,7 @@ export const getNextUnplacedNode = createDeepEqualSelector( } // Stage subject is either a single object or a collection of objects - const types = isArray(subject) + const types = Array.isArray(subject) ? subject.map((s) => s.type) : [subject.type]; @@ -97,7 +98,7 @@ export const getPlacedNodes = createDeepEqualSelector( } // Stage subject is either a single object or a collecton of objects - const types = isArray(subject) + const types = Array.isArray(subject) ? subject.map((s) => s.type) : [subject.type]; diff --git a/lib/interviewer/selectors/forms.js b/lib/interviewer/selectors/forms.js index 89e11e46..e7809f15 100644 --- a/lib/interviewer/selectors/forms.js +++ b/lib/interviewer/selectors/forms.js @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { get } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; import { getProtocolCodebook } from './protocol'; // Prop selectors diff --git a/lib/interviewer/selectors/interface.js b/lib/interviewer/selectors/interface.js index eab01b34..e2e969b0 100644 --- a/lib/interviewer/selectors/interface.js +++ b/lib/interviewer/selectors/interface.js @@ -1,5 +1,6 @@ import { createSelector } from '@reduxjs/toolkit'; -import { filter, includes, intersection } from 'lodash-es'; +import { intersection } from 'es-toolkit'; +import { filter, includes } from 'es-toolkit/compat'; import { getNetwork, getNetworkEdges, getNetworkNodes } from './network'; import { getPromptOtherVariable, diff --git a/lib/interviewer/selectors/name-generator.js b/lib/interviewer/selectors/name-generator.js index 6b99ea30..066d70cd 100644 --- a/lib/interviewer/selectors/name-generator.js +++ b/lib/interviewer/selectors/name-generator.js @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { has } from 'lodash-es'; +import { has } from 'es-toolkit/compat'; import { getPromptId } from './interface'; import { getStageSubject, getSubjectType, propStageId } from './prop'; import { getProtocolCodebook } from './protocol'; diff --git a/lib/interviewer/selectors/network.ts b/lib/interviewer/selectors/network.ts index c1c721b5..7289df8c 100644 --- a/lib/interviewer/selectors/network.ts +++ b/lib/interviewer/selectors/network.ts @@ -9,7 +9,8 @@ import { type StageSubject, } from '@codaco/shared-consts'; import { createSelector } from '@reduxjs/toolkit'; -import { find, findKey } from 'lodash-es'; +import { findKey } from 'es-toolkit'; +import { toString } from 'es-toolkit/compat'; import { getEntityAttributes } from '~/lib/interviewer/ducks/modules/network'; import customFilter from '~/lib/network-query/filter'; import type { RootState } from '../store'; @@ -95,17 +96,14 @@ export const labelLogic = ( return nodeAttributes[variableCalledName] as string; } - // 2. Look for a property on the node with a key of ‘name’, and try to retrieve this - // value as a key in the node's attributes. - // const nodeVariableCalledName = get(nodeAttributes, 'name'); - - const nodeVariableCalledName = find( - nodeAttributes, - (_, key) => key.toLowerCase() === 'name', - ); + // 2. Look for a property in nodeAttributes with a key of ‘name’, and return the value + const nodeVariableCalledName = Object.entries(nodeAttributes).find( + ([key]) => key.toLowerCase() === 'name', + )?.[1]; if (nodeVariableCalledName) { - return nodeVariableCalledName as string; + // cast to string + return toString(nodeVariableCalledName); } // 3. Last resort! diff --git a/lib/interviewer/selectors/protocol.js b/lib/interviewer/selectors/protocol.js index a923f215..92de5f5d 100644 --- a/lib/interviewer/selectors/protocol.js +++ b/lib/interviewer/selectors/protocol.js @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { get } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; import { v4 as uuid } from 'uuid'; import { getStageSubject } from './prop'; diff --git a/lib/interviewer/selectors/utils.js b/lib/interviewer/selectors/utils.js index 1c2d64c7..c34e89f9 100644 --- a/lib/interviewer/selectors/utils.js +++ b/lib/interviewer/selectors/utils.js @@ -1,4 +1,4 @@ -import { isEqual } from 'lodash-es'; +import { isEqual } from 'es-toolkit'; import { createSelectorCreator, defaultMemoize } from 'reselect'; // create a "selector creator" that uses lodash.isEqual instead of === diff --git a/lib/interviewer/utils/Validations.js b/lib/interviewer/utils/Validations.js index cc8495dd..804815da 100644 --- a/lib/interviewer/utils/Validations.js +++ b/lib/interviewer/utils/Validations.js @@ -1,13 +1,6 @@ import { entityPrimaryKeyProperty } from '@codaco/shared-consts'; -import { - filter, - get, - isEqual, - isNil, - isNumber, - isString, - some, -} from 'lodash-es'; +import { isEqual, isNil, isString } from 'es-toolkit'; +import { filter, get, isNumber, some } from 'es-toolkit/compat'; import { getNetworkEntitiesForType } from '../selectors/interface'; import { getCodebookVariablesForType } from '../selectors/protocol'; diff --git a/lib/interviewer/utils/createSorter.js b/lib/interviewer/utils/createSorter.js index 9ec70c62..2a78f026 100644 --- a/lib/interviewer/utils/createSorter.js +++ b/lib/interviewer/utils/createSorter.js @@ -1,5 +1,5 @@ import { entityAttributesProperty } from '@codaco/shared-consts'; -import { get } from 'lodash-es'; +import { get } from 'es-toolkit/compat'; /** * Creating a collator that is reused by string comparison is significantly faster diff --git a/lib/interviewer/utils/getParentKeyByNameValue.js b/lib/interviewer/utils/getParentKeyByNameValue.js index f61400a2..ad008c0a 100644 --- a/lib/interviewer/utils/getParentKeyByNameValue.js +++ b/lib/interviewer/utils/getParentKeyByNameValue.js @@ -1,4 +1,5 @@ -import { find, findKey, has, isEmpty } from 'lodash-es'; +import { findKey } from 'es-toolkit'; +import { find, has, isEmpty } from 'es-toolkit/compat'; const findCategoricalKey = (object, toFind) => { // make list of possible var_option pairs diff --git a/lib/interviewer/utils/playSound.js b/lib/interviewer/utils/playSound.js index 2926d9e7..9abb88b8 100644 --- a/lib/interviewer/utils/playSound.js +++ b/lib/interviewer/utils/playSound.js @@ -1,4 +1,4 @@ -import { debounce } from 'lodash-es'; +import { debounce } from 'es-toolkit'; // Play a given sound export const playSound = ({ @@ -26,7 +26,7 @@ export const playSound = ({ audio.play(); }, debounceInterval, - { leading: true, trailing: false }, + { edges: ['leading'] }, ); const stop = () => { diff --git a/lib/network-exporters/formatters/csv/__tests__/mockObjects.js b/lib/network-exporters/formatters/csv/__tests__/mockObjects.js index 87ca1acd..d37bb8ee 100644 --- a/lib/network-exporters/formatters/csv/__tests__/mockObjects.js +++ b/lib/network-exporters/formatters/csv/__tests__/mockObjects.js @@ -10,7 +10,7 @@ import { sessionProperty, sessionStartTimeProperty, } from '@codaco/shared-consts'; -import { groupBy } from 'lodash-es'; +import { groupBy } from 'es-toolkit'; import { insertEgoIntoSessionNetworks } from '../../session/insertEgoIntoSessionNetworks'; import { resequenceIds } from '../../session/resequenceIds'; @@ -174,7 +174,7 @@ export const processMockNetworks = (networkCollection) => { const sessionsWithEgo = insertEgoIntoSessionNetworks(networkCollection); const sessionsByProtocol = groupBy( sessionsWithEgo, - `sessionVariables.${protocolProperty}`, + (s) => s.sessionVariables[protocolProperty], ); const sessionsWithResequencedIDs = resequenceIds(sessionsByProtocol); diff --git a/lib/network-exporters/formatters/csv/processEntityVariables.js b/lib/network-exporters/formatters/csv/processEntityVariables.js index 57bc7052..f7ab1c6d 100644 --- a/lib/network-exporters/formatters/csv/processEntityVariables.js +++ b/lib/network-exporters/formatters/csv/processEntityVariables.js @@ -1,6 +1,6 @@ // Determine which variables to include -import { includes } from 'lodash-es'; +import { includes } from 'es-toolkit/compat'; import { getAttributePropertyFromCodebook, getEntityAttributes, diff --git a/lib/network-exporters/formatters/graphml/createGraphML.js b/lib/network-exporters/formatters/graphml/createGraphML.js index e4c2bebc..5fc3cd19 100644 --- a/lib/network-exporters/formatters/graphml/createGraphML.js +++ b/lib/network-exporters/formatters/graphml/createGraphML.js @@ -1,5 +1,6 @@ +import { findKey, groupBy } from 'es-toolkit'; +import { includes } from 'es-toolkit/compat'; import jsSHA from 'jssha/dist/sha1'; -import { findKey, groupBy, includes } from 'lodash-es'; import { createDataElement, formatXml, getGraphMLTypeForKey } from './helpers'; import { @@ -730,8 +731,8 @@ function* graphMLGenerator(network, codebook, exportOptions) { if (exportOptions.globalOptions.unifyNetworks) { // Group nodes and edges by sessionProperty, and then map. const groupedNetwork = { - nodes: groupBy(network.nodes, sessionProperty), - edges: groupBy(network.edges, sessionProperty), + nodes: groupBy(network.nodes, (n) => n[sessionProperty]), + edges: groupBy(network.edges, (e) => e[sessionProperty]), }; /* eslint-disable no-restricted-syntax, guard-for-in, no-unused-vars */ diff --git a/lib/network-exporters/formatters/graphml/helpers.js b/lib/network-exporters/formatters/graphml/helpers.js index af37b824..059399b6 100644 --- a/lib/network-exporters/formatters/graphml/helpers.js +++ b/lib/network-exporters/formatters/graphml/helpers.js @@ -1,4 +1,4 @@ -import { isNil } from 'lodash-es'; +import { isNil } from 'es-toolkit'; import { getEntityAttributes } from '../../utils/general'; // Gephi does not support long lines in graphML, meaning we need to "beautify" the output diff --git a/lib/network-exporters/formatters/session/groupByProtocolProperty.ts b/lib/network-exporters/formatters/session/groupByProtocolProperty.ts index efafeb0c..2a9da7dc 100644 --- a/lib/network-exporters/formatters/session/groupByProtocolProperty.ts +++ b/lib/network-exporters/formatters/session/groupByProtocolProperty.ts @@ -1,5 +1,5 @@ import { protocolProperty } from '@codaco/shared-consts'; -import { groupBy } from 'lodash-es'; +import { groupBy } from 'es-toolkit'; import type { SessionWithNetworkEgo, SessionsByProtocol, @@ -8,5 +8,5 @@ import type { export default function groupByProtocolProperty( s: SessionWithNetworkEgo[], ): SessionsByProtocol { - return groupBy(s, `sessionVariables.${protocolProperty}`); + return groupBy(s, (i) => i.sessionVariables[protocolProperty]); } diff --git a/lib/network-query/predicate.js b/lib/network-query/predicate.js index cf159b60..0e3c7830 100644 --- a/lib/network-query/predicate.js +++ b/lib/network-query/predicate.js @@ -1,4 +1,4 @@ -import { isArray, isEqual, isNull } from 'lodash-es'; +import { isEqual, isNull } from 'es-toolkit'; // operators list export const operators = { @@ -86,15 +86,15 @@ const predicate = return false; } // ord/cat vars are initialised to null - if (isArray(variableValue)) { - if (isArray(value)) { + if (Array.isArray(variableValue)) { + if (Array.isArray(value)) { return variableValue.every((v) => value.includes(v)); } return variableValue.includes(value); } - if (isArray(value)) { + if (Array.isArray(value)) { return value.includes(variableValue); } @@ -106,15 +106,15 @@ const predicate = return true; } // ord/cat vars are initialised to null - if (isArray(variableValue)) { - if (isArray(value)) { + if (Array.isArray(variableValue)) { + if (Array.isArray(value)) { return variableValue.every((v) => !value.includes(v)); } return !variableValue.includes(value); } - if (isArray(value)) { + if (Array.isArray(value)) { return !value.includes(variableValue); } @@ -130,25 +130,25 @@ const predicate = case countOperators.COUNT_NONE: return value === 0; case operators.OPTIONS_GREATER_THAN: { - if (!isArray(value)) { + if (!Array.isArray(value)) { return false; } return value.length > variableValue; } case operators.OPTIONS_LESS_THAN: { - if (!isArray(value)) { + if (!Array.isArray(value)) { return false; } return value.length < variableValue; } case operators.OPTIONS_EQUALS: { - if (!isArray(value)) { + if (!Array.isArray(value)) { return false; } return value.length === variableValue; } case operators.OPTIONS_NOT_EQUALS: { - if (!isArray(value)) { + if (!Array.isArray(value)) { return false; } return value.length !== variableValue; diff --git a/lib/ui/components/ActionButton.js b/lib/ui/components/ActionButton.js index 656a462f..b8a6c9dd 100644 --- a/lib/ui/components/ActionButton.js +++ b/lib/ui/components/ActionButton.js @@ -1,5 +1,5 @@ import cx from 'classnames'; -import { noop } from 'lodash-es'; +import { noop } from 'es-toolkit'; import PropTypes from 'prop-types'; import React from 'react'; import Icon from './Icon'; diff --git a/lib/ui/components/Cards/DataCard.js b/lib/ui/components/Cards/DataCard.js index 49e7943e..ee3d940f 100644 --- a/lib/ui/components/Cards/DataCard.js +++ b/lib/ui/components/Cards/DataCard.js @@ -1,5 +1,5 @@ import cx from 'classnames'; -import { noop } from 'lodash-es'; +import { noop } from 'es-toolkit'; import PropTypes from 'prop-types'; const DataCard = ({ label, data = {}, onClick = noop, allowDrag = false }) => { diff --git a/lib/ui/components/Dialogs.js b/lib/ui/components/Dialogs.js index 50b9221e..c2b2f849 100644 --- a/lib/ui/components/Dialogs.js +++ b/lib/ui/components/Dialogs.js @@ -1,4 +1,4 @@ -import { omit } from 'lodash-es'; +import { omit } from 'es-toolkit'; import PropTypes from 'prop-types'; import { Component } from 'react'; import DialogVariants from './Dialog'; diff --git a/lib/ui/components/Fields/DatePicker/DatePicker/Days.js b/lib/ui/components/Fields/DatePicker/DatePicker/Days.js index 542f7b9a..b5a17dcf 100644 --- a/lib/ui/components/Fields/DatePicker/DatePicker/Days.js +++ b/lib/ui/components/Fields/DatePicker/DatePicker/Days.js @@ -1,4 +1,4 @@ -import { range } from 'lodash-es'; +import { range } from 'es-toolkit'; import { DateTime } from 'luxon'; import { useContext } from 'react'; import DatePickerContext from './DatePickerContext'; diff --git a/lib/ui/components/Fields/DatePicker/DatePicker/Months.js b/lib/ui/components/Fields/DatePicker/DatePicker/Months.js index 79dceb1d..268f673d 100644 --- a/lib/ui/components/Fields/DatePicker/DatePicker/Months.js +++ b/lib/ui/components/Fields/DatePicker/DatePicker/Months.js @@ -1,4 +1,4 @@ -import { range } from 'lodash-es'; +import { range } from 'es-toolkit'; import { Interval } from 'luxon'; import { useContext } from 'react'; import DatePickerContext from './DatePickerContext'; diff --git a/lib/ui/components/Fields/DatePicker/DatePicker/Years.js b/lib/ui/components/Fields/DatePicker/DatePicker/Years.js index cc2bd927..f823ed7b 100644 --- a/lib/ui/components/Fields/DatePicker/DatePicker/Years.js +++ b/lib/ui/components/Fields/DatePicker/DatePicker/Years.js @@ -1,4 +1,4 @@ -import { range } from 'lodash-es'; +import { range } from 'es-toolkit'; import { useContext } from 'react'; import DatePickerContext from './DatePickerContext'; import { formatRangeItem } from './helpers'; diff --git a/lib/ui/components/Fields/DatePicker/DatePicker/helpers.js b/lib/ui/components/Fields/DatePicker/DatePicker/helpers.js index 7c7284d8..7a30fb0c 100644 --- a/lib/ui/components/Fields/DatePicker/DatePicker/helpers.js +++ b/lib/ui/components/Fields/DatePicker/DatePicker/helpers.js @@ -1,4 +1,5 @@ -import { get, isEqual } from 'lodash-es'; +import { isEqual } from 'es-toolkit'; +import { get } from 'es-toolkit/compat'; import { DateTime, Info } from 'luxon'; export const now = () => DateTime.local(); diff --git a/lib/ui/components/Fields/DatePicker/RangePicker.js b/lib/ui/components/Fields/DatePicker/RangePicker.js index 53662e4f..edaa3e9a 100644 --- a/lib/ui/components/Fields/DatePicker/RangePicker.js +++ b/lib/ui/components/Fields/DatePicker/RangePicker.js @@ -1,5 +1,5 @@ import cx from 'classnames'; -import { find, times } from 'lodash-es'; +import { find, times } from 'es-toolkit/compat'; import PropTypes from 'prop-types'; import React, { useEffect } from 'react'; diff --git a/lib/ui/components/Fields/DatePicker/helpers.js b/lib/ui/components/Fields/DatePicker/helpers.js index a68b160e..2a9f760f 100644 --- a/lib/ui/components/Fields/DatePicker/helpers.js +++ b/lib/ui/components/Fields/DatePicker/helpers.js @@ -1,4 +1,5 @@ -import { difference, get, intersection } from 'lodash-es'; +import { difference, intersection } from 'es-toolkit'; +import { get } from 'es-toolkit/compat'; import { DateTime, Info } from 'luxon'; export const now = () => DateTime.local(); diff --git a/lib/ui/components/Fields/Search.js b/lib/ui/components/Fields/Search.js index 985f83b5..e64febba 100644 --- a/lib/ui/components/Fields/Search.js +++ b/lib/ui/components/Fields/Search.js @@ -1,4 +1,5 @@ -import { get, isEmpty, noop } from 'lodash-es'; +import { noop } from 'es-toolkit'; +import { get, isEmpty } from 'es-toolkit/compat'; import { X as ClearIcon, Search as SearchIcon } from 'lucide-react'; import PropTypes from 'prop-types'; import { getCSSVariableAsString } from '../../utils/CSSVariables'; diff --git a/lib/ui/components/Fields/Slider/Slider.js b/lib/ui/components/Fields/Slider/Slider.js index 4438ee9d..d2f3865b 100644 --- a/lib/ui/components/Fields/Slider/Slider.js +++ b/lib/ui/components/Fields/Slider/Slider.js @@ -1,5 +1,6 @@ import cx from 'classnames'; -import { get, isNil, round } from 'lodash-es'; +import { isNil, round } from 'es-toolkit'; +import { get } from 'es-toolkit/compat'; import PropTypes from 'prop-types'; import { Component } from 'react'; import { Handles, Slider, Ticks, Tracks } from 'react-compound-slider'; diff --git a/lib/ui/components/Fields/TextArea.js b/lib/ui/components/Fields/TextArea.js index 34d69a3b..cfec1129 100644 --- a/lib/ui/components/Fields/TextArea.js +++ b/lib/ui/components/Fields/TextArea.js @@ -1,5 +1,5 @@ import cx from 'classnames'; -import { uniqueId } from 'lodash-es'; +import { uniqueId } from 'es-toolkit/compat'; import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Icon from '../Icon'; diff --git a/lib/ui/components/Fields/Toggle.js b/lib/ui/components/Fields/Toggle.js index 1b284492..cb32a0a6 100644 --- a/lib/ui/components/Fields/Toggle.js +++ b/lib/ui/components/Fields/Toggle.js @@ -1,5 +1,5 @@ import cx from 'classnames'; -import { isBoolean } from 'lodash-es'; +import { isBoolean } from 'es-toolkit'; import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { v4 as uuid } from 'uuid'; diff --git a/lib/ui/components/Fields/utils/options.js b/lib/ui/components/Fields/utils/options.js index 27786bbf..1f2ca9db 100644 --- a/lib/ui/components/Fields/utils/options.js +++ b/lib/ui/components/Fields/utils/options.js @@ -1,4 +1,5 @@ -import { get, isString } from 'lodash-es'; +import { isString } from 'es-toolkit'; +import { get } from 'es-toolkit/compat'; const toString = (value) => (isString(value) ? value : JSON.stringify(value)); export const getValue = (option) => get(option, 'value', option); diff --git a/lib/ui/components/Prompts/Prompts.js b/lib/ui/components/Prompts/Prompts.js index 1724b83c..9ac1c344 100644 --- a/lib/ui/components/Prompts/Prompts.js +++ b/lib/ui/components/Prompts/Prompts.js @@ -1,4 +1,4 @@ -import { findIndex } from 'lodash-es'; +import { findIndex } from 'es-toolkit/compat'; import { AnimatePresence, motion } from 'motion/react'; import PropTypes from 'prop-types'; import { useEffect, useMemo, useRef } from 'react'; diff --git a/lib/ui/components/Scroller.js b/lib/ui/components/Scroller.js index 33be55e8..28a25cda 100644 --- a/lib/ui/components/Scroller.js +++ b/lib/ui/components/Scroller.js @@ -1,5 +1,5 @@ import cx from 'classnames'; -import { clamp } from 'lodash-es'; +import { clamp } from 'es-toolkit'; import PropTypes from 'prop-types'; import React, { useCallback, useImperativeHandle, useRef } from 'react'; diff --git a/lib/ui/hooks/useSpeech.js b/lib/ui/hooks/useSpeech.js index bc53cf91..f630a679 100644 --- a/lib/ui/hooks/useSpeech.js +++ b/lib/ui/hooks/useSpeech.js @@ -1,4 +1,4 @@ -import { noop } from 'lodash-es'; +import { noop } from 'es-toolkit'; import { useCallback, useEffect, useMemo, useState } from 'react'; import useIsMounted from './useIsMounted'; diff --git a/lib/ui/utils/CSSVariables.js b/lib/ui/utils/CSSVariables.js index e7172568..2c5c3f25 100644 --- a/lib/ui/utils/CSSVariables.js +++ b/lib/ui/utils/CSSVariables.js @@ -1,4 +1,4 @@ -import { isEmpty } from 'lodash-es'; +import { isEmpty } from 'es-toolkit/compat'; const CSSVariable = (variableName) => { if (document.readyState !== 'complete') { diff --git a/package.json b/package.json index 176e4307..5fb22bd6 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,6 @@ "@tailwindcss/forms": "^0.5.9", "@tanstack/react-table": "^8.20.5", "@types/async": "^3.2.24", - "@types/lodash-es": "^4.17.12", "@uploadthing/react": "^7.1.0", "@xmldom/xmldom": "^0.8.10", "animejs": "^2.2.0", @@ -66,10 +65,10 @@ "csvtojson": "^2.0.10", "d3-interpolate-path": "^2.3.0", "dotenv": "^16.4.5", + "es-toolkit": "^1.27.0", "fuse.js": "^7.0.0", "jssha": "^3.3.1", "jszip": "^3.10.1", - "lodash-es": "^4.17.21", "lucia": "^2.7.7", "lucide-react": "^0.314.0", "luxon": "^3.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ee16be58..ca6a783b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -95,9 +95,6 @@ importers: '@types/async': specifier: ^3.2.24 version: 3.2.24 - '@types/lodash-es': - specifier: ^4.17.12 - version: 4.17.12 '@uploadthing/react': specifier: ^7.1.0 version: 7.1.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(react@18.3.1)(uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@3.4.12(ts-node@10.9.2(@types/node@22.9.0)(typescript@5.6.3)))) @@ -140,6 +137,9 @@ importers: dotenv: specifier: ^16.4.5 version: 16.4.5 + es-toolkit: + specifier: ^1.27.0 + version: 1.27.0 fuse.js: specifier: ^7.0.0 version: 7.0.0 @@ -149,9 +149,6 @@ importers: jszip: specifier: ^3.10.1 version: 3.10.1 - lodash-es: - specifier: ^4.17.21 - version: 4.17.21 lucia: specifier: ^2.7.7 version: 2.7.7 @@ -2688,6 +2685,9 @@ packages: resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} engines: {node: '>= 0.4'} + es-toolkit@1.27.0: + resolution: {integrity: sha512-ETSFA+ZJArcuSCpzD2TjAy6UHpx4E4uqFsoDg9F/nTLogrLmVVZQ+zNxco5h7cWnA1nNak07IXsLcaSMih+ZPQ==} + es6-error@4.1.1: resolution: {integrity: sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==} @@ -7818,6 +7818,8 @@ snapshots: is-date-object: 1.0.5 is-symbol: 1.0.4 + es-toolkit@1.27.0: {} + es6-error@4.1.1: {} esbuild@0.21.5: From ec696eaee14883e4154ad22cde683c44ad379f38 Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 28 Nov 2024 15:57:26 +0200 Subject: [PATCH 25/37] fix external data loading --- .../containers/withExternalData.js | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/lib/interviewer/containers/withExternalData.js b/lib/interviewer/containers/withExternalData.js index 15a9ab0a..0034cedd 100644 --- a/lib/interviewer/containers/withExternalData.js +++ b/lib/interviewer/containers/withExternalData.js @@ -1,5 +1,4 @@ import { entityAttributesProperty } from '@codaco/shared-consts'; -import { isNil } from 'es-toolkit'; import { get, includes, toNumber } from 'es-toolkit/compat'; import { connect } from 'react-redux'; import { @@ -134,18 +133,23 @@ const getNodeListUsingTypes = ( protocolCodebook, stageSubject, ); - const attributes = node.attributes.reduce( - (consolidatedAttributes, attributeValue, attributeKey) => { - if (isNil(attributeValue) || attributeValue === '') { + const attributes = Object.entries(node.attributes).reduce( + (consolidatedAttributes, [attributeKey, attributeValue]) => { + if ( + attributeValue === null || + attributeValue === undefined || + attributeValue === '' + ) { return consolidatedAttributes; } - let codebookType = get( - codebookDefinition, - `variables[${attributeKey}].type`, - ); - if (!includes(ProtocolConsts.VariableType, codebookType)) { - // use type based on column data because the codebook type wasn't valid + // Replace lodash get() with optional chaining + let codebookType = codebookDefinition?.variables?.[attributeKey]?.type; + + // Replace lodash includes() with Array.includes() + if ( + !Object.values(ProtocolConsts.VariableType).includes(codebookType) + ) { codebookType = derivedAttributeTypes[attributeKey]; } @@ -160,14 +164,13 @@ const getNodeListUsingTypes = ( case ProtocolConsts.VariableType.scalar: { return { ...consolidatedAttributes, - [attributeKey]: toNumber(attributeValue), + [attributeKey]: Number(attributeValue), // Replace lodash toNumber() }; } case ProtocolConsts.VariableType.categorical: case ProtocolConsts.VariableType.ordinal: case ProtocolConsts.VariableType.layout: { try { - // do special characters need to be sanitized/escaped? return { ...consolidatedAttributes, [attributeKey]: JSON.parse(attributeValue), @@ -185,7 +188,7 @@ const getNodeListUsingTypes = ( ...consolidatedAttributes, [uuid]: { ...consolidatedAttributes[uuid], - x: toNumber(attributeValue), + x: Number(attributeValue), }, }; } @@ -195,7 +198,7 @@ const getNodeListUsingTypes = ( ...consolidatedAttributes, [uuid]: { ...consolidatedAttributes[uuid], - y: toNumber(attributeValue), + y: Number(attributeValue), }, }; } From cbe17874cb5a7a9acb5436fc01edbf47484257ff Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 28 Nov 2024 16:02:53 +0200 Subject: [PATCH 26/37] fix session reducer --- lib/interviewer/ducks/modules/session.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/interviewer/ducks/modules/session.js b/lib/interviewer/ducks/modules/session.js index 437657be..95a50d6b 100644 --- a/lib/interviewer/ducks/modules/session.js +++ b/lib/interviewer/ducks/modules/session.js @@ -56,7 +56,7 @@ const getReducer = }; } case installedProtocolsActionTypes.DELETE_PROTOCOL: - return state.reduce((result, sessionData, sessionId) => { + return Object.keys(state).reduce((result, sessionData, sessionId) => { if (sessionData.protocolUID !== action.protocolUID) { return { ...result, [sessionId]: sessionData }; } From 67dfd8833892b92ca4ebcd62eb5d031c63ee6f42 Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 28 Nov 2024 16:14:38 +0200 Subject: [PATCH 27/37] ensure entity variables property is cast as empty object if it does not exist --- lib/network-exporters/formatters/graphml/createGraphML.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/network-exporters/formatters/graphml/createGraphML.js b/lib/network-exporters/formatters/graphml/createGraphML.js index 5fc3cd19..b068469d 100644 --- a/lib/network-exporters/formatters/graphml/createGraphML.js +++ b/lib/network-exporters/formatters/graphml/createGraphML.js @@ -549,7 +549,7 @@ const generateDataElements = ( // For nodes, add a element for the label using the name property const entityLabel = () => { const variableCalledName = findKey( - codebook[type][entity.type].variables, + codebook[type][entity.type].variables ?? {}, (variable) => variable.name.toLowerCase() === 'name', ); From 628f927c57eec52c5ffd4646b92495959e89d92e Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Fri, 29 Nov 2024 09:51:16 +0200 Subject: [PATCH 28/37] fix link color override for alert variants --- components/ui/Alert.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/ui/Alert.tsx b/components/ui/Alert.tsx index bbdccb44..2f3ee2dc 100644 --- a/components/ui/Alert.tsx +++ b/components/ui/Alert.tsx @@ -12,11 +12,11 @@ const alertVariants = cva( variants: { variant: { default: '', - info: 'border-info bg-info/10 [--link:var(--info)] [&>svg]:text-info', + info: 'border-info bg-info/10 [--color-link:var(--color-info)] [&>svg]:text-info', destructive: - 'border-destructive bg-destructive/5 text-destructive dark:border-destructive [&>svg]:text-destructive [--link:var(--destructive)]', + 'border-destructive bg-destructive/5 text-destructive dark:border-destructive [&>svg]:text-destructive [--color-link:var(--color-destructive)]', success: - 'border-success bg-success/10 text-success-foreground [&>svg]:text-success-foreground [--link:var(--success-foreground)]', + 'border-success bg-success/10 text-success-foreground [&>svg]:text-success-foreground [--color-link:var(--color-success-foreground)]', }, }, defaultVariants: { From 393413bc7530106fecf590643da4179cebfc9c40 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:29:30 +0000 Subject: [PATCH 29/37] Bump motion from 11.11.17 to 11.12.0 Bumps [motion](https://github.com/framer/motion) from 11.11.17 to 11.12.0. - [Changelog](https://github.com/motiondivision/motion/blob/main/CHANGELOG.md) - [Commits](https://github.com/framer/motion/compare/v11.11.17...v11.12.0) --- updated-dependencies: - dependency-name: motion dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- pnpm-lock.yaml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index cc31bfae..475b31b9 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "lucia": "^2.7.7", "lucide-react": "^0.314.0", "luxon": "^3.5.0", - "motion": "^11.11.17", + "motion": "^11.12.0", "next": "^14.2.16", "nuqs": "^1.19.1", "ohash": "^1.1.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 13592876..13228379 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -144,8 +144,8 @@ importers: specifier: ^3.5.0 version: 3.5.0 motion: - specifier: ^11.11.17 - version: 11.11.17(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^11.12.0 + version: 11.12.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) next: specifier: ^14.2.16 version: 14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1) @@ -3010,8 +3010,8 @@ packages: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} - framer-motion@11.11.17: - resolution: {integrity: sha512-O8QzvoKiuzI5HSAHbcYuL6xU+ZLXbrH7C8Akaato4JzQbX2ULNeniqC2Vo5eiCtFktX9XsJ+7nUhxcl2E2IjpA==} + framer-motion@11.12.0: + resolution: {integrity: sha512-gZaZeqFM6pX9kMVti60hYAa75jGpSsGYWAHbBfIkuHN7DkVHVkxSxeNYnrGmHuM0zPkWTzQx10ZT+fDjn7N4SA==} peerDependencies: '@emotion/is-prop-valid': '*' react: ^18.0.0 @@ -3964,8 +3964,8 @@ packages: mitt@3.0.1: resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} - motion@11.11.17: - resolution: {integrity: sha512-y6mXYElvJ5HHwPBUpYG/5wclKVGW4hJhqPkTjWccib5/WrcRM185adg3+4aSmG5iD10XKFt5uBOAiKwuzMHPPQ==} + motion@11.12.0: + resolution: {integrity: sha512-BFH9vwCs4dI9t1W1/1HonahOCnTxcKfzBR8D310wHFdx7oIwlP/51OqLNGO74lxOdCpTLf5BLe233k6yRqJo9Q==} peerDependencies: '@emotion/is-prop-valid': '*' react: ^18.0.0 @@ -8243,7 +8243,7 @@ snapshots: combined-stream: 1.0.8 mime-types: 2.1.35 - framer-motion@11.11.17(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + framer-motion@11.12.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: tslib: 2.8.0 optionalDependencies: @@ -9565,9 +9565,9 @@ snapshots: mitt@3.0.1: {} - motion@11.11.17(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + motion@11.12.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - framer-motion: 11.11.17(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + framer-motion: 11.12.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) tslib: 2.8.0 optionalDependencies: react: 18.3.1 From 2bee8d7c025688fbb52a88c4b66aaa9c9c75723b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:30:17 +0000 Subject: [PATCH 30/37] Bump react-dropzone from 14.2.3 to 14.3.5 Bumps [react-dropzone](https://github.com/react-dropzone/react-dropzone) from 14.2.3 to 14.3.5. - [Release notes](https://github.com/react-dropzone/react-dropzone/releases) - [Commits](https://github.com/react-dropzone/react-dropzone/compare/v14.2.3...v14.3.5) --- updated-dependencies: - dependency-name: react-dropzone dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- pnpm-lock.yaml | 28 ++++++++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index cc31bfae..18ec8369 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "react": "18.3.1", "react-compound-slider": "^3.4.0", "react-dom": "18.3.1", - "react-dropzone": "^14.2.3", + "react-dropzone": "^14.3.5", "react-flip-toolkit": "^7.2.4", "react-hook-form": "^7.53.0", "react-markdown": "^9.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 13592876..1ec20f3f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -168,8 +168,8 @@ importers: specifier: 18.3.1 version: 18.3.1(react@18.3.1) react-dropzone: - specifier: ^14.2.3 - version: 14.2.3(react@18.3.1) + specifier: ^14.3.5 + version: 14.3.5(react@18.3.1) react-flip-toolkit: specifier: ^7.2.4 version: 7.2.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -2224,8 +2224,8 @@ packages: asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - attr-accept@2.2.2: - resolution: {integrity: sha512-7prDjvt9HmqiZ0cl5CRjtS84sEyhsHP2coDkaZKRKVfCDo9s7iw7ChVmar78Gu9pC4SoR/28wFu/G5JJhTnqEg==} + attr-accept@2.2.5: + resolution: {integrity: sha512-0bDNnY/u6pPwHDMoF0FieU354oBi0a8rD9FcsLwzcGWbc8KS8KPIi7y+s13OlVY+gMWc/9xEMUgNE6Qm8ZllYQ==} engines: {node: '>=4'} available-typed-arrays@1.0.7: @@ -2973,6 +2973,10 @@ packages: resolution: {integrity: sha512-QlZ5yJC0VxHxQQsQhXvBaC7VRJ2uaxTf+Tfpu4Z/OcVQJVpZO+DGU0rkoVW5ce2SccxugvpBJoMvUs59iILYdw==} engines: {node: '>= 12'} + file-selector@2.1.2: + resolution: {integrity: sha512-QgXo+mXTe8ljeqUFaX3QVHc5osSItJ/Km+xpocx0aSqWGMSCf6qYs/VnzZgS864Pjn5iceMRFigeAV7AfTlaig==} + engines: {node: '>= 12'} + fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} @@ -4328,8 +4332,8 @@ packages: peerDependencies: react: ^18.3.1 - react-dropzone@14.2.3: - resolution: {integrity: sha512-O3om8I+PkFKbxCukfIR3QAGftYXDZfOE2N1mr/7qebQJHs7U+/RSL/9xomJNpRg9kM5h9soQSdf0Gc7OHF5Fug==} + react-dropzone@14.3.5: + resolution: {integrity: sha512-9nDUaEEpqZLOz5v5SUcFA0CjM4vq8YbqO0WRls+EYT7+DvxUdzDPKNCPLqGfj3YL9MsniCLCD4RFA6M95V6KMQ==} engines: {node: '>= 10.13'} peerDependencies: react: '>= 16.8 || 18.0.0' @@ -7266,7 +7270,7 @@ snapshots: asynckit@0.4.0: {} - attr-accept@2.2.2: {} + attr-accept@2.2.5: {} available-typed-arrays@1.0.7: dependencies: @@ -8200,6 +8204,10 @@ snapshots: dependencies: tslib: 2.8.0 + file-selector@2.1.2: + dependencies: + tslib: 2.8.0 + fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 @@ -9866,10 +9874,10 @@ snapshots: react: 18.3.1 scheduler: 0.23.2 - react-dropzone@14.2.3(react@18.3.1): + react-dropzone@14.3.5(react@18.3.1): dependencies: - attr-accept: 2.2.2 - file-selector: 0.6.0 + attr-accept: 2.2.5 + file-selector: 2.1.2 prop-types: 15.8.1 react: 18.3.1 From cdc6d28140ab71a427f1f9ee3ab0d488aa9224a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:30:33 +0000 Subject: [PATCH 31/37] Bump react-hook-form from 7.53.0 to 7.53.2 Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.53.0 to 7.53.2. - [Release notes](https://github.com/react-hook-form/react-hook-form/releases) - [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md) - [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.53.0...v7.53.2) --- updated-dependencies: - dependency-name: react-hook-form dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- pnpm-lock.yaml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index cc31bfae..2e139a4d 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "react-dom": "18.3.1", "react-dropzone": "^14.2.3", "react-flip-toolkit": "^7.2.4", - "react-hook-form": "^7.53.0", + "react-hook-form": "^7.53.2", "react-markdown": "^9.0.1", "react-redux": "^8.1.3", "react-resize-aware": "^4.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 13592876..22eec469 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,7 +22,7 @@ importers: version: 0.0.2 '@hookform/resolvers': specifier: ^3.9.1 - version: 3.9.1(react-hook-form@7.53.0(react@18.3.1)) + version: 3.9.1(react-hook-form@7.53.2(react@18.3.1)) '@lucia-auth/adapter-prisma': specifier: ^3.0.2 version: 3.0.2(@prisma/client@5.22.0(prisma@5.22.0))(lucia@2.7.7) @@ -174,8 +174,8 @@ importers: specifier: ^7.2.4 version: 7.2.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react-hook-form: - specifier: ^7.53.0 - version: 7.53.0(react@18.3.1) + specifier: ^7.53.2 + version: 7.53.2(react@18.3.1) react-markdown: specifier: ^9.0.1 version: 9.0.1(@types/react@18.3.7)(react@18.3.1) @@ -4341,8 +4341,8 @@ packages: react: '>= 16.x' react-dom: '>= 16.x' - react-hook-form@7.53.0: - resolution: {integrity: sha512-M1n3HhqCww6S2hxLxciEXy2oISPnAzxY7gvwVPrtlczTM/1dDadXgUxDpHMrMTblDOcm/AXtXxHwZ3jpg1mqKQ==} + react-hook-form@7.53.2: + resolution: {integrity: sha512-YVel6fW5sOeedd1524pltpHX+jgU2u3DSDtXEaBORNdqiNrsX/nUI/iGXONegttg0mJVnfrIkiV0cmTU6Oo2xw==} engines: {node: '>=18.0.0'} peerDependencies: react: ^16.8.0 || ^17 || ^18 || ^19 @@ -5703,9 +5703,9 @@ snapshots: '@floating-ui/utils@0.2.8': {} - '@hookform/resolvers@3.9.1(react-hook-form@7.53.0(react@18.3.1))': + '@hookform/resolvers@3.9.1(react-hook-form@7.53.2(react@18.3.1))': dependencies: - react-hook-form: 7.53.0(react@18.3.1) + react-hook-form: 7.53.2(react@18.3.1) '@humanwhocodes/config-array@0.13.0': dependencies: @@ -9880,7 +9880,7 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - react-hook-form@7.53.0(react@18.3.1): + react-hook-form@7.53.2(react@18.3.1): dependencies: react: 18.3.1 From 78edf7d30ec816eb7703f0a2d1eb85692d5ed37d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:30:51 +0000 Subject: [PATCH 32/37] Bump vitest from 2.1.5 to 2.1.7 Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 2.1.5 to 2.1.7. - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v2.1.7/packages/vitest) --- updated-dependencies: - dependency-name: vitest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- pnpm-lock.yaml | 96 +++++++++++++++++++++++++------------------------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/package.json b/package.json index cc31bfae..b104ef28 100644 --- a/package.json +++ b/package.json @@ -143,6 +143,6 @@ "tailwindcss-animate": "^1.0.7", "typescript": "5.6.3", "vite-tsconfig-paths": "^5.1.2", - "vitest": "^2.1.5" + "vitest": "^2.1.7" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 13592876..a08742af 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -367,8 +367,8 @@ importers: specifier: ^5.1.2 version: 5.1.2(typescript@5.6.3)(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0)) vitest: - specifier: ^2.1.5 - version: 2.1.5(@types/node@22.9.0)(jsdom@25.0.1)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) + specifier: ^2.1.7 + version: 2.1.7(@types/node@22.9.0)(jsdom@25.0.1)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) packages: @@ -2046,11 +2046,11 @@ packages: peerDependencies: vite: ^4.2.0 || ^5.0.0 - '@vitest/expect@2.1.5': - resolution: {integrity: sha512-nZSBTW1XIdpZvEJyoP/Sy8fUg0b8od7ZpGDkTUcfJ7wz/VoZAFzFfLyxVxGFhUjJzhYqSbIpfMtl/+k/dpWa3Q==} + '@vitest/expect@2.1.7': + resolution: {integrity: sha512-folWk4qQDEedgUyvaZw94LIJuNLoDtY+rhKhhNy0csdwifn/pQz8EWVRnyrW3j0wMpy+xwJT8WiwiYxk+i+s7w==} - '@vitest/mocker@2.1.5': - resolution: {integrity: sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ==} + '@vitest/mocker@2.1.7': + resolution: {integrity: sha512-nKMTnuJrarFH+7llWxeLmYRldIwTY3OM1DzdytHj0f2+fah6Cyk4XbswhjOiTCnAvXsZAEoo1OaD6rneSSU+3Q==} peerDependencies: msw: ^2.4.9 vite: ^5.0.0 @@ -2060,20 +2060,20 @@ packages: vite: optional: true - '@vitest/pretty-format@2.1.5': - resolution: {integrity: sha512-4ZOwtk2bqG5Y6xRGHcveZVr+6txkH7M2e+nPFd6guSoN638v/1XQ0K06eOpi0ptVU/2tW/pIU4IoPotY/GZ9fw==} + '@vitest/pretty-format@2.1.7': + resolution: {integrity: sha512-HoqRIyfQlXPrRDB43h0lC8eHPUDPwFweMaD6t+psOvwClCC+oZZim6wPMjuoMnRdiFxXqbybg/QbuewgTwK1vA==} - '@vitest/runner@2.1.5': - resolution: {integrity: sha512-pKHKy3uaUdh7X6p1pxOkgkVAFW7r2I818vHDthYLvUyjRfkKOU6P45PztOch4DZarWQne+VOaIMwA/erSSpB9g==} + '@vitest/runner@2.1.7': + resolution: {integrity: sha512-MrDNpXUIXksR57qipYh068SOX4N1hVw6oVILlTlfeTyA1rp0asuljyp15IZwKqhjpWLObFj+tiNrOM4R8UnSqg==} - '@vitest/snapshot@2.1.5': - resolution: {integrity: sha512-zmYw47mhfdfnYbuhkQvkkzYroXUumrwWDGlMjpdUr4jBd3HZiV2w7CQHj+z7AAS4VOtWxI4Zt4bWt4/sKcoIjg==} + '@vitest/snapshot@2.1.7': + resolution: {integrity: sha512-OioIxV/xS393DKdlkRNhmtY0K37qVdCv8w1M2SlLTBSX+fNK6zgcd01VlT1nXdbKVDaB8Zb6BOfQYYoGeGTEGg==} - '@vitest/spy@2.1.5': - resolution: {integrity: sha512-aWZF3P0r3w6DiYTVskOYuhBc7EMc3jvn1TkBg8ttylFFRqNN2XGD7V5a4aQdk6QiUzZQ4klNBSpCLJgWNdIiNw==} + '@vitest/spy@2.1.7': + resolution: {integrity: sha512-e5pzIaIC0LBrb/j1FaF7HXlPJLGtltiAkwXTMqNEHALJc7USSLEwziJ+aIWTmjsWNg89zazg37h7oZITnublsQ==} - '@vitest/utils@2.1.5': - resolution: {integrity: sha512-yfj6Yrp0Vesw2cwJbP+cl04OC+IHFsuQsrsJBL9pyGeQXE56v1UAOQco+SR55Vf1nQzfV0QJg1Qum7AaWUwwYg==} + '@vitest/utils@2.1.7': + resolution: {integrity: sha512-7gUdvIzCCuIrMZu0WHTvDJo8C1NsUtOqmwmcS3bRHUcfHemj29wmkzLVNuWQD7WHoBD/+I7WIgrnzt7kxR54ow==} '@xmldom/xmldom@0.8.10': resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==} @@ -5125,9 +5125,9 @@ packages: vfile@6.0.3: resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} - vite-node@2.1.5: - resolution: {integrity: sha512-rd0QIgx74q4S1Rd56XIiL2cYEdyWn13cunYBIuqh9mpmQr7gGS0IxXoP8R6OaZtNQQLyXSWbd4rXKYUbhFpK5w==} - engines: {node: ^18.0.0 || >=20.0.0} + vite-node@2.1.7: + resolution: {integrity: sha512-b/5MxSWd0ftWt1B1LHfzCw0ASzaxHztUwP0rcsBhkDSGy9ZDEDieSIjFG3I78nI9dUN0eSeD6LtuKPZGjwwpZQ==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true vite-tsconfig-paths@5.1.2: @@ -5169,15 +5169,15 @@ packages: terser: optional: true - vitest@2.1.5: - resolution: {integrity: sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A==} - engines: {node: ^18.0.0 || >=20.0.0} + vitest@2.1.7: + resolution: {integrity: sha512-wzJ7Wri44ufkzTZbI1lHsdHfiGdFRmnJ9qIudDQ6tknjJeHhF5QgNSSjk7KRZUU535qEiEXFJ7tSHqyzyIv0jQ==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' - '@types/node': ^18.0.0 || >=20.0.0 - '@vitest/browser': 2.1.5 - '@vitest/ui': 2.1.5 + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + '@vitest/browser': 2.1.7 + '@vitest/ui': 2.1.7 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -7042,43 +7042,43 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitest/expect@2.1.5': + '@vitest/expect@2.1.7': dependencies: - '@vitest/spy': 2.1.5 - '@vitest/utils': 2.1.5 + '@vitest/spy': 2.1.7 + '@vitest/utils': 2.1.7 chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.5(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0))': + '@vitest/mocker@2.1.7(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0))': dependencies: - '@vitest/spy': 2.1.5 + '@vitest/spy': 2.1.7 estree-walker: 3.0.3 magic-string: 0.30.12 optionalDependencies: vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) - '@vitest/pretty-format@2.1.5': + '@vitest/pretty-format@2.1.7': dependencies: tinyrainbow: 1.2.0 - '@vitest/runner@2.1.5': + '@vitest/runner@2.1.7': dependencies: - '@vitest/utils': 2.1.5 + '@vitest/utils': 2.1.7 pathe: 1.1.2 - '@vitest/snapshot@2.1.5': + '@vitest/snapshot@2.1.7': dependencies: - '@vitest/pretty-format': 2.1.5 + '@vitest/pretty-format': 2.1.7 magic-string: 0.30.12 pathe: 1.1.2 - '@vitest/spy@2.1.5': + '@vitest/spy@2.1.7': dependencies: tinyspy: 3.0.2 - '@vitest/utils@2.1.5': + '@vitest/utils@2.1.7': dependencies: - '@vitest/pretty-format': 2.1.5 + '@vitest/pretty-format': 2.1.7 loupe: 3.1.2 tinyrainbow: 1.2.0 @@ -10753,7 +10753,7 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 - vite-node@2.1.5(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0): + vite-node@2.1.7(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0): dependencies: cac: 6.7.14 debug: 4.3.7 @@ -10794,15 +10794,15 @@ snapshots: sass: 1.79.1 terser: 5.36.0 - vitest@2.1.5(@types/node@22.9.0)(jsdom@25.0.1)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0): + vitest@2.1.7(@types/node@22.9.0)(jsdom@25.0.1)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0): dependencies: - '@vitest/expect': 2.1.5 - '@vitest/mocker': 2.1.5(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0)) - '@vitest/pretty-format': 2.1.5 - '@vitest/runner': 2.1.5 - '@vitest/snapshot': 2.1.5 - '@vitest/spy': 2.1.5 - '@vitest/utils': 2.1.5 + '@vitest/expect': 2.1.7 + '@vitest/mocker': 2.1.7(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0)) + '@vitest/pretty-format': 2.1.7 + '@vitest/runner': 2.1.7 + '@vitest/snapshot': 2.1.7 + '@vitest/spy': 2.1.7 + '@vitest/utils': 2.1.7 chai: 5.1.2 debug: 4.3.7 expect-type: 1.1.0 @@ -10814,7 +10814,7 @@ snapshots: tinypool: 1.0.1 tinyrainbow: 1.2.0 vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) - vite-node: 2.1.5(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) + vite-node: 2.1.7(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.9.0 From 04dcbba6b9e8e5034ddb0ea34d8437222e50b33e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:08:45 +0000 Subject: [PATCH 33/37] Bump sass from 1.79.1 to 1.81.0 Bumps [sass](https://github.com/sass/dart-sass) from 1.79.1 to 1.81.0. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.79.1...1.81.0) --- updated-dependencies: - dependency-name: sass dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- pnpm-lock.yaml | 237 ++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 198 insertions(+), 41 deletions(-) diff --git a/package.json b/package.json index 102a7f52..a3fc32a8 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,7 @@ "prettier": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.9", "prisma": "^5.22.0", - "sass": "^1.79.1", + "sass": "^1.81.0", "tailwindcss": "4.0.0-beta.3", "tailwindcss-animate": "^1.0.7", "typescript": "5.6.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 22f44f1f..7e0f0d7c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,7 +13,7 @@ importers: dependencies: '@codaco/analytics': specifier: 7.0.0 - version: 7.0.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1)) + version: 7.0.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0)) '@codaco/protocol-validation': specifier: 3.0.0-alpha.4 version: 3.0.0-alpha.4(@types/eslint@8.56.12)(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1) @@ -82,7 +82,7 @@ importers: version: 8.20.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@uploadthing/react': specifier: ^7.1.0 - version: 7.1.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(react@18.3.1)(uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@4.0.0-beta.3)) + version: 7.1.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0))(react@18.3.1)(uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0))(tailwindcss@4.0.0-beta.3)) '@xmldom/xmldom': specifier: ^0.8.10 version: 0.8.10 @@ -148,10 +148,10 @@ importers: version: 11.12.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) next: specifier: ^14.2.16 - version: 14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1) + version: 14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0) nuqs: specifier: ^1.19.1 - version: 1.19.1(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1)) + version: 1.19.1(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0)) ohash: specifier: ^1.1.4 version: 1.1.4 @@ -238,7 +238,7 @@ importers: version: 2.5.5 uploadthing: specifier: ^7.2.0 - version: 7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@4.0.0-beta.3) + version: 7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0))(tailwindcss@4.0.0-beta.3) usehooks-ts: specifier: ^2.16.0 version: 2.16.0(react@18.3.1) @@ -323,7 +323,7 @@ importers: version: 6.21.0(eslint@8.57.1)(typescript@5.6.3) '@vitejs/plugin-react': specifier: ^4.3.3 - version: 4.3.3(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0)) + version: 4.3.3(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.81.0)(terser@5.36.0)) eslint: specifier: ^8.57.1 version: 8.57.1 @@ -352,8 +352,8 @@ importers: specifier: ^5.22.0 version: 5.22.0 sass: - specifier: ^1.79.1 - version: 1.79.1 + specifier: ^1.81.0 + version: 1.81.0 tailwindcss: specifier: 4.0.0-beta.3 version: 4.0.0-beta.3 @@ -365,10 +365,10 @@ importers: version: 5.6.3 vite-tsconfig-paths: specifier: ^5.1.2 - version: 5.1.2(typescript@5.6.3)(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0)) + version: 5.1.2(typescript@5.6.3)(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.81.0)(terser@5.36.0)) vitest: specifier: ^2.1.7 - version: 2.1.7(@types/node@22.9.0)(jsdom@25.0.1)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) + version: 2.1.7(@types/node@22.9.0)(jsdom@25.0.1)(lightningcss@1.28.2)(sass@1.81.0)(terser@5.36.0) packages: @@ -1073,6 +1073,88 @@ packages: '@paralleldrive/cuid2@2.2.2': resolution: {integrity: sha512-ZOBkgDwEdoYVlSeRbYYXs0S9MejQofiVYoTbKzy/6GQa39/q5tQU2IX46+shYnUkpEl3wc+J6wRlar7r2EK2xA==} + '@parcel/watcher-android-arm64@2.5.0': + resolution: {integrity: sha512-qlX4eS28bUcQCdribHkg/herLe+0A9RyYC+mm2PXpncit8z5b3nSqGVzMNR3CmtAOgRutiZ02eIJJgP/b1iEFQ==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [android] + + '@parcel/watcher-darwin-arm64@2.5.0': + resolution: {integrity: sha512-hyZ3TANnzGfLpRA2s/4U1kbw2ZI4qGxaRJbBH2DCSREFfubMswheh8TeiC1sGZ3z2jUf3s37P0BBlrD3sjVTUw==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [darwin] + + '@parcel/watcher-darwin-x64@2.5.0': + resolution: {integrity: sha512-9rhlwd78saKf18fT869/poydQK8YqlU26TMiNg7AIu7eBp9adqbJZqmdFOsbZ5cnLp5XvRo9wcFmNHgHdWaGYA==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [darwin] + + '@parcel/watcher-freebsd-x64@2.5.0': + resolution: {integrity: sha512-syvfhZzyM8kErg3VF0xpV8dixJ+RzbUaaGaeb7uDuz0D3FK97/mZ5AJQ3XNnDsXX7KkFNtyQyFrXZzQIcN49Tw==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [freebsd] + + '@parcel/watcher-linux-arm-glibc@2.5.0': + resolution: {integrity: sha512-0VQY1K35DQET3dVYWpOaPFecqOT9dbuCfzjxoQyif1Wc574t3kOSkKevULddcR9znz1TcklCE7Ht6NIxjvTqLA==} + engines: {node: '>= 10.0.0'} + cpu: [arm] + os: [linux] + + '@parcel/watcher-linux-arm-musl@2.5.0': + resolution: {integrity: sha512-6uHywSIzz8+vi2lAzFeltnYbdHsDm3iIB57d4g5oaB9vKwjb6N6dRIgZMujw4nm5r6v9/BQH0noq6DzHrqr2pA==} + engines: {node: '>= 10.0.0'} + cpu: [arm] + os: [linux] + + '@parcel/watcher-linux-arm64-glibc@2.5.0': + resolution: {integrity: sha512-BfNjXwZKxBy4WibDb/LDCriWSKLz+jJRL3cM/DllnHH5QUyoiUNEp3GmL80ZqxeumoADfCCP19+qiYiC8gUBjA==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [linux] + + '@parcel/watcher-linux-arm64-musl@2.5.0': + resolution: {integrity: sha512-S1qARKOphxfiBEkwLUbHjCY9BWPdWnW9j7f7Hb2jPplu8UZ3nes7zpPOW9bkLbHRvWM0WDTsjdOTUgW0xLBN1Q==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [linux] + + '@parcel/watcher-linux-x64-glibc@2.5.0': + resolution: {integrity: sha512-d9AOkusyXARkFD66S6zlGXyzx5RvY+chTP9Jp0ypSTC9d4lzyRs9ovGf/80VCxjKddcUvnsGwCHWuF2EoPgWjw==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [linux] + + '@parcel/watcher-linux-x64-musl@2.5.0': + resolution: {integrity: sha512-iqOC+GoTDoFyk/VYSFHwjHhYrk8bljW6zOhPuhi5t9ulqiYq1togGJB5e3PwYVFFfeVgc6pbz3JdQyDoBszVaA==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [linux] + + '@parcel/watcher-win32-arm64@2.5.0': + resolution: {integrity: sha512-twtft1d+JRNkM5YbmexfcH/N4znDtjgysFaV9zvZmmJezQsKpkfLYJ+JFV3uygugK6AtIM2oADPkB2AdhBrNig==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [win32] + + '@parcel/watcher-win32-ia32@2.5.0': + resolution: {integrity: sha512-+rgpsNRKwo8A53elqbbHXdOMtY/tAtTzManTWShB5Kk54N8Q9mzNWV7tV+IbGueCbcj826MfWGU3mprWtuf1TA==} + engines: {node: '>= 10.0.0'} + cpu: [ia32] + os: [win32] + + '@parcel/watcher-win32-x64@2.5.0': + resolution: {integrity: sha512-lPrxve92zEHdgeff3aiu4gDOIt4u7sJYha6wbdEZDCDUhtjTsOMiaJzG5lMY4GkWH8p0fMmO2Ppq5G5XXG+DQw==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [win32] + + '@parcel/watcher@2.5.0': + resolution: {integrity: sha512-i0GV1yJnm2n3Yq1qw6QrUrd/LI9bE8WEBOTtOkpCXHHdyN3TAGgqAK/DAT05z4fq2x04cARXt2pDmjWjL92iTQ==} + engines: {node: '>= 10.0.0'} + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -3233,6 +3315,9 @@ packages: immutable@4.3.7: resolution: {integrity: sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==} + immutable@5.0.3: + resolution: {integrity: sha512-P8IdPQHq3lA1xVeBRi5VPqUm5HDgKnx0Ru51wZz5mjxHr5n3RWhjIpOFU7ybkUxfB+5IToy+OLaHYDBIWsv+uw==} + import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} @@ -4014,6 +4099,9 @@ packages: sass: optional: true + node-addon-api@7.1.1: + resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==} + node-int64@0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} @@ -4607,8 +4695,8 @@ packages: sanitize-filename@1.6.3: resolution: {integrity: sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==} - sass@1.79.1: - resolution: {integrity: sha512-+mA7svoNKeL0DiJqZGeR/ZGUu8he4I8o3jyUcOFyo4eBJrwNgIMmAEwCMo/N2Y3wdjOBcRzoNxZIOtrtMX8EXg==} + sass@1.81.0: + resolution: {integrity: sha512-Q4fOxRfhmv3sqCLoGfvrC9pRV8btc0UtqL9mN6Yrv6Qi9ScL55CVH1vlPP863ISLEEMNLLuu9P+enCeGHlnzhA==} engines: {node: '>=14.0.0'} hasBin: true @@ -5561,9 +5649,9 @@ snapshots: '@bcoe/v8-coverage@0.2.3': {} - '@codaco/analytics@7.0.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))': + '@codaco/analytics@7.0.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0))': dependencies: - next: 14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1) + next: 14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0) zod: 3.23.8 '@codaco/protocol-validation@3.0.0-alpha.4(@types/eslint@8.56.12)(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)': @@ -6066,6 +6154,67 @@ snapshots: dependencies: '@noble/hashes': 1.5.0 + '@parcel/watcher-android-arm64@2.5.0': + optional: true + + '@parcel/watcher-darwin-arm64@2.5.0': + optional: true + + '@parcel/watcher-darwin-x64@2.5.0': + optional: true + + '@parcel/watcher-freebsd-x64@2.5.0': + optional: true + + '@parcel/watcher-linux-arm-glibc@2.5.0': + optional: true + + '@parcel/watcher-linux-arm-musl@2.5.0': + optional: true + + '@parcel/watcher-linux-arm64-glibc@2.5.0': + optional: true + + '@parcel/watcher-linux-arm64-musl@2.5.0': + optional: true + + '@parcel/watcher-linux-x64-glibc@2.5.0': + optional: true + + '@parcel/watcher-linux-x64-musl@2.5.0': + optional: true + + '@parcel/watcher-win32-arm64@2.5.0': + optional: true + + '@parcel/watcher-win32-ia32@2.5.0': + optional: true + + '@parcel/watcher-win32-x64@2.5.0': + optional: true + + '@parcel/watcher@2.5.0': + dependencies: + detect-libc: 1.0.3 + is-glob: 4.0.3 + micromatch: 4.0.8 + node-addon-api: 7.1.1 + optionalDependencies: + '@parcel/watcher-android-arm64': 2.5.0 + '@parcel/watcher-darwin-arm64': 2.5.0 + '@parcel/watcher-darwin-x64': 2.5.0 + '@parcel/watcher-freebsd-x64': 2.5.0 + '@parcel/watcher-linux-arm-glibc': 2.5.0 + '@parcel/watcher-linux-arm-musl': 2.5.0 + '@parcel/watcher-linux-arm64-glibc': 2.5.0 + '@parcel/watcher-linux-arm64-musl': 2.5.0 + '@parcel/watcher-linux-x64-glibc': 2.5.0 + '@parcel/watcher-linux-x64-musl': 2.5.0 + '@parcel/watcher-win32-arm64': 2.5.0 + '@parcel/watcher-win32-ia32': 2.5.0 + '@parcel/watcher-win32-x64': 2.5.0 + optional: true + '@pkgjs/parseargs@0.11.0': optional: true @@ -7020,14 +7169,14 @@ snapshots: '@uploadthing/mime-types@0.3.1': {} - '@uploadthing/react@7.1.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(react@18.3.1)(uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@4.0.0-beta.3))': + '@uploadthing/react@7.1.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0))(react@18.3.1)(uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0))(tailwindcss@4.0.0-beta.3))': dependencies: '@uploadthing/shared': 7.1.0 file-selector: 0.6.0 react: 18.3.1 - uploadthing: 7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@4.0.0-beta.3) + uploadthing: 7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0))(tailwindcss@4.0.0-beta.3) optionalDependencies: - next: 14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1) + next: 14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0) '@uploadthing/shared@7.1.0': dependencies: @@ -7035,14 +7184,14 @@ snapshots: effect: 3.10.3 sqids: 0.3.0 - '@vitejs/plugin-react@4.3.3(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0))': + '@vitejs/plugin-react@4.3.3(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.81.0)(terser@5.36.0))': dependencies: '@babel/core': 7.25.2 '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.25.2) '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.25.2) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 - vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) + vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.81.0)(terser@5.36.0) transitivePeerDependencies: - supports-color @@ -7053,13 +7202,13 @@ snapshots: chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.7(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0))': + '@vitest/mocker@2.1.7(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.81.0)(terser@5.36.0))': dependencies: '@vitest/spy': 2.1.7 estree-walker: 3.0.3 magic-string: 0.30.12 optionalDependencies: - vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) + vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.81.0)(terser@5.36.0) '@vitest/pretty-format@2.1.7': dependencies: @@ -8507,7 +8656,10 @@ snapshots: immer@9.0.21: {} - immutable@4.3.7: {} + immutable@4.3.7: + optional: true + + immutable@5.0.3: {} import-fresh@3.3.0: dependencies: @@ -9589,7 +9741,7 @@ snapshots: natural-compare@1.4.0: {} - next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1): + next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0): dependencies: '@next/env': 14.2.16 '@swc/helpers': 0.5.5 @@ -9610,11 +9762,14 @@ snapshots: '@next/swc-win32-arm64-msvc': 14.2.16 '@next/swc-win32-ia32-msvc': 14.2.16 '@next/swc-win32-x64-msvc': 14.2.16 - sass: 1.79.1 + sass: 1.81.0 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros + node-addon-api@7.1.1: + optional: true + node-int64@0.4.0: {} node-releases@2.0.18: {} @@ -9625,10 +9780,10 @@ snapshots: dependencies: path-key: 3.1.1 - nuqs@1.19.1(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1)): + nuqs@1.19.1(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0)): dependencies: mitt: 3.0.1 - next: 14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1) + next: 14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0) nwsapi@2.2.12: {} @@ -10211,11 +10366,13 @@ snapshots: dependencies: truncate-utf8-bytes: 1.0.2 - sass@1.79.1: + sass@1.81.0: dependencies: chokidar: 4.0.0 - immutable: 4.3.7 + immutable: 5.0.3 source-map-js: 1.2.1 + optionalDependencies: + '@parcel/watcher': 2.5.0 saxes@6.0.0: dependencies: @@ -10691,14 +10848,14 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.0 - uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1))(tailwindcss@4.0.0-beta.3): + uploadthing@7.2.0(next@14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0))(tailwindcss@4.0.0-beta.3): dependencies: '@effect/platform': 0.69.8(effect@3.10.3) '@uploadthing/mime-types': 0.3.1 '@uploadthing/shared': 7.1.0 effect: 3.10.3 optionalDependencies: - next: 14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1) + next: 14.2.16(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.81.0) tailwindcss: 4.0.0-beta.3 uri-js@4.4.1: @@ -10761,13 +10918,13 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 - vite-node@2.1.7(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0): + vite-node@2.1.7(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.81.0)(terser@5.36.0): dependencies: cac: 6.7.14 debug: 4.3.7 es-module-lexer: 1.5.4 pathe: 1.1.2 - vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) + vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.81.0)(terser@5.36.0) transitivePeerDependencies: - '@types/node' - less @@ -10779,18 +10936,18 @@ snapshots: - supports-color - terser - vite-tsconfig-paths@5.1.2(typescript@5.6.3)(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0)): + vite-tsconfig-paths@5.1.2(typescript@5.6.3)(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.81.0)(terser@5.36.0)): dependencies: debug: 4.3.7 globrex: 0.1.2 tsconfck: 3.1.3(typescript@5.6.3) optionalDependencies: - vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) + vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.81.0)(terser@5.36.0) transitivePeerDependencies: - supports-color - typescript - vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0): + vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.81.0)(terser@5.36.0): dependencies: esbuild: 0.21.5 postcss: 8.4.47 @@ -10799,13 +10956,13 @@ snapshots: '@types/node': 22.9.0 fsevents: 2.3.3 lightningcss: 1.28.2 - sass: 1.79.1 + sass: 1.81.0 terser: 5.36.0 - vitest@2.1.7(@types/node@22.9.0)(jsdom@25.0.1)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0): + vitest@2.1.7(@types/node@22.9.0)(jsdom@25.0.1)(lightningcss@1.28.2)(sass@1.81.0)(terser@5.36.0): dependencies: '@vitest/expect': 2.1.7 - '@vitest/mocker': 2.1.7(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0)) + '@vitest/mocker': 2.1.7(vite@5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.81.0)(terser@5.36.0)) '@vitest/pretty-format': 2.1.7 '@vitest/runner': 2.1.7 '@vitest/snapshot': 2.1.7 @@ -10821,8 +10978,8 @@ snapshots: tinyexec: 0.3.1 tinypool: 1.0.1 tinyrainbow: 1.2.0 - vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) - vite-node: 2.1.7(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.79.1)(terser@5.36.0) + vite: 5.4.6(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.81.0)(terser@5.36.0) + vite-node: 2.1.7(@types/node@22.9.0)(lightningcss@1.28.2)(sass@1.81.0)(terser@5.36.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.9.0 From 08a10caed4b879f1d8a193cafa059aefd182b383 Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 5 Dec 2024 11:38:08 +0200 Subject: [PATCH 34/37] fix dialog and alert animation issues caused by tailwind 4 migration --- components/ui/AlertDialog.tsx | 8 +++----- components/ui/dialog.tsx | 17 +++++++++++------ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/components/ui/AlertDialog.tsx b/components/ui/AlertDialog.tsx index e55be58d..f614edfe 100644 --- a/components/ui/AlertDialog.tsx +++ b/components/ui/AlertDialog.tsx @@ -6,6 +6,7 @@ import * as React from 'react'; import { type VariantProps } from 'class-variance-authority'; import { buttonVariants } from '~/components/ui/Button'; import { cn } from '~/utils/shadcn'; +import { dialogContentClasses } from './dialog'; import Heading from './typography/Heading'; import { paragraphVariants } from './typography/Paragraph'; @@ -24,10 +25,7 @@ const AlertDialogOverlay = React.forwardRef< // eslint-disable-next-line @typescript-eslint/no-unused-vars >(({ className, children, ...props }, ref) => ( @@ -43,7 +41,7 @@ const AlertDialogContent = React.forwardRef< + cn( + 'fixed top-[50%] left-[50%] z-50 max-h-screen w-full max-w-2xl translate-x-[-50%] translate-y-[-50%] md:w-full', + 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-85 data-[state=open]:zoom-in-100 data-[state=closed]:slide-out-to-top-[10%] data-[state=open]:slide-in-from-top-[10%] duration-300', + 'bg-card flex flex-col gap-4 border p-6 shadow-lg sm:rounded-lg', + className, + ); + const DialogContent = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef @@ -40,14 +48,11 @@ const DialogContent = React.forwardRef< {children} - + Close From 20168a37bd34d821d1ec5e4e4787b6af16e2d430 Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 5 Dec 2024 13:04:48 +0200 Subject: [PATCH 35/37] bump version to 2.0.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a3fc32a8..0aaae606 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fresco", - "version": "2.0.1", + "version": "2.0.2", "private": true, "type": "module", "packageManager": "pnpm@9.1.1+sha256.9551e803dcb7a1839fdf5416153a844060c7bce013218ce823410532504ac10b", From d2f4791c38fc62c3ca6f76226124c74103496551 Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 5 Dec 2024 13:12:26 +0200 Subject: [PATCH 36/37] correct fix for alert dialog animation classes --- components/ui/AlertDialog.tsx | 9 +++------ components/ui/dialog.tsx | 11 +++++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/ui/AlertDialog.tsx b/components/ui/AlertDialog.tsx index f614edfe..299521a7 100644 --- a/components/ui/AlertDialog.tsx +++ b/components/ui/AlertDialog.tsx @@ -6,7 +6,7 @@ import * as React from 'react'; import { type VariantProps } from 'class-variance-authority'; import { buttonVariants } from '~/components/ui/Button'; import { cn } from '~/utils/shadcn'; -import { dialogContentClasses } from './dialog'; +import { dialogContentClasses, dialogOverlayClasses } from './dialog'; import Heading from './typography/Heading'; import { paragraphVariants } from './typography/Paragraph'; @@ -25,7 +25,7 @@ const AlertDialogOverlay = React.forwardRef< // eslint-disable-next-line @typescript-eslint/no-unused-vars >(({ className, children, ...props }, ref) => ( @@ -40,10 +40,7 @@ const AlertDialogContent = React.forwardRef< diff --git a/components/ui/dialog.tsx b/components/ui/dialog.tsx index fc849e39..dcbc85bf 100644 --- a/components/ui/dialog.tsx +++ b/components/ui/dialog.tsx @@ -17,16 +17,19 @@ const DialogPortal = ({ ...props }: DialogPrimitive.DialogPortalProps) => ( ); DialogPortal.displayName = DialogPrimitive.Portal.displayName; +export const dialogOverlayClasses = (className?: string) => + cn( + 'bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 backdrop-blur-sm', + className, + ); + const DialogOverlay = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); From 58629b42e8d024a2f42801e02714b7c4bb85d7bb Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 5 Dec 2024 13:33:32 +0200 Subject: [PATCH 37/37] fix toast styling --- components/ui/Alert.tsx | 6 +++--- components/ui/toast.tsx | 8 ++++---- styles/globals.css | 5 ++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/components/ui/Alert.tsx b/components/ui/Alert.tsx index 2f3ee2dc..f474717c 100644 --- a/components/ui/Alert.tsx +++ b/components/ui/Alert.tsx @@ -12,11 +12,11 @@ const alertVariants = cva( variants: { variant: { default: '', - info: 'border-info bg-info/10 [--color-link:var(--color-info)] [&>svg]:text-info', + info: 'bg-info/5 border-info text-info [--color-link:var(--color-info)] [&>svg]:text-info', destructive: - 'border-destructive bg-destructive/5 text-destructive dark:border-destructive [&>svg]:text-destructive [--color-link:var(--color-destructive)]', + 'bg-destructive/5 border-destructive text-destructive [&>svg]:text-destructive [--color-link:var(--color-destructive)]', success: - 'border-success bg-success/10 text-success-foreground [&>svg]:text-success-foreground [--color-link:var(--color-success-foreground)]', + 'bg-success/5 border-success text-success [&>svg]:text-success [--color-link:var(--color-success)]', }, }, defaultVariants: { diff --git a/components/ui/toast.tsx b/components/ui/toast.tsx index e76673f2..d8907001 100644 --- a/components/ui/toast.tsx +++ b/components/ui/toast.tsx @@ -14,7 +14,7 @@ const ToastViewport = React.forwardRef<