From b11469442334b595bfa8e24e5b49aa4fdaaf614e Mon Sep 17 00:00:00 2001 From: Adam Howard <91115+codeincontext@users.noreply.github.com> Date: Mon, 16 Dec 2024 20:17:35 +0100 Subject: [PATCH 1/4] chore: update posthog (#454) --- apps/nextjs/package.json | 4 +- pnpm-lock.yaml | 472 +++++++++++++++++++-------------------- 2 files changed, 237 insertions(+), 239 deletions(-) diff --git a/apps/nextjs/package.json b/apps/nextjs/package.json index 3547f6d63..a6a7f072f 100644 --- a/apps/nextjs/package.json +++ b/apps/nextjs/package.json @@ -96,8 +96,8 @@ "openai": "^4.58.1", "p-limit": "^6.1.0", "partial-json-parser": "^1.2.2", - "posthog-js": "^1.139.1", - "posthog-node": "^4.0.0", + "posthog-js": "^1.201.0", + "posthog-node": "^4.3.2", "pptxgenjs": "^3.12.0", "ramda": "^0.30.1", "react": "18.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e624823fc..77b25dee2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -276,11 +276,11 @@ importers: specifier: ^1.2.2 version: 1.2.2 posthog-js: - specifier: ^1.139.1 - version: 1.139.1 + specifier: ^1.201.0 + version: 1.201.0 posthog-node: - specifier: ^4.0.0 - version: 4.0.0 + specifier: ^4.3.2 + version: 4.3.2 pptxgenjs: specifier: ^3.12.0 version: 3.12.0 @@ -6256,12 +6256,12 @@ packages: '@babel/runtime': 7.24.5 dev: false - /@radix-ui/primitive@1.1.0: - resolution: {integrity: sha512-4Z8dn6Upk0qk4P74xBhZ6Hd/w0mPEzOOLxy4xiPXOXqjF7jZS0VAKk7/x/H6FyY2zCkYJqePf1G5KmkmNJ4RBA==} + /@radix-ui/primitive@1.1.1: + resolution: {integrity: sha512-SJ31y+Q/zAyShtXJc8x83i9TYdbAfHZ++tUZnvjJJqFjzsdUnKsxPL6IEtBlxKkU7yzer//GQtZSV4GbldL3YA==} dev: false - /@radix-ui/react-accessible-icon@1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-i9Zg4NOSXlfUva0agzI2DjWrvFJm9uO4L6CMW7nmMa5CIOOX/Yin894W7WwjodFQWPwe5kmAJ4JF33R8slKI2g==} + /@radix-ui/react-accessible-icon@1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-DH8vuU7oqHt9RhO3V9Z1b8ek+bOl4+9VLsh0cgL6t7f2WhbuOChm3ft0EmCCsfd4ORi7Cs3II4aNcTXi+bh+wg==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6273,7 +6273,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-visually-hidden': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 react: 18.2.0 @@ -6309,8 +6309,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-alert-dialog@1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-eGSlLzPhKO+TErxkiGcCZGuvbVMnLA1MTnyBksGOeGRGkxHiiJUujsjmNTdWTm4iHVSRaUao9/4Ur671auMghQ==} + /@radix-ui/react-alert-dialog@1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-5xzWppXTNZe6zFrTTwAJIoMJeZmdFe0l8ZqQrPGKAVvhdyOWR4r53/G7SZqx6/uf1J441oxK7GzmTkrrWDroHA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6322,12 +6322,12 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-dialog': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-slot': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-dialog': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-slot': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 react: 18.2.0 @@ -6355,8 +6355,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-arrow@1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-FmlW1rCg7hBpEBwFbjHwCW6AmWLQM6g/v0Sn8XbP9NvmSZ2San1FpQeyPtufzOMSIx7Y4dzjlHoifhp+7NkZhw==} + /@radix-ui/react-arrow@1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-NaVpZfmv8SKeZbn4ijN2V3jlHA9ngBG16VnIIm22nUR0Yk8KUALyBxT3KYEUnNuch9sTE8UTsS3whzBgKOL30w==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6368,15 +6368,15 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-aspect-ratio@1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-dP87DM/Y7jFlPgUZTlhx6FF5CEzOiaxp2rBCKlaXlpH5Ip/9Fg5zZ9lDOQ5o/MOfUlf36eak14zoWYpgcgGoOg==} + /@radix-ui/react-aspect-ratio@1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-kNU4FIpcFMBLkOUcgeIteH06/8JLBcYY6Le1iKenDGCYNYFX3TQqCZjzkOsz37h7r94/99GTb7YhEr98ZBJibw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6388,15 +6388,15 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-avatar@1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-eoOtThOmxeoizxpX6RiEsQZ2wj5r4+zoeqAwO0cBaFQGjJwIH3dIX0OCxNrCyrrdxG+vBweMETh3VziQG7c1kw==} + /@radix-ui/react-avatar@1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-GaC7bXQZ5VgZvVvsJ5mu/AEbjYLnhhkoidOboC50Z6FFlLA03wG2ianUoH+zgDQ31/9gCF59bE4+2bBgTyMiig==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6409,7 +6409,7 @@ packages: optional: true dependencies: '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 @@ -6418,8 +6418,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-checkbox@1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-/i0fl686zaJbDQLNKrkCbMyDm6FQMt4jg323k7HuqitoANm9sE23Ql8yOK3Wusk34HSLKDChhMux05FnP6KUkw==} + /@radix-ui/react-checkbox@1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-HD7/ocp8f1B3e6OHygH0n7ZKjONkhciy1Nh0yuBgObqThc3oyx+vuMfFHKAknXRHHWVE9XvXStxJFyjUmB8PIw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6431,11 +6431,11 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-presence': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-presence': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-previous': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-size': 1.1.0(@types/react@18.2.57)(react@18.2.0) @@ -6497,8 +6497,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-collection@1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-GZsZslMJEyo1VKm5L1ZJY8tGDxZNPAoUeQUIbKeJfoi7Q4kmig5AsgLMYYuyYbfjd8fBmFORAIwYAkXMnXZgZw==} + /@radix-ui/react-collection@1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-LwT3pSho9Dljg+wY2KN2mrrh6y3qELfftINERIzBUO9e0N+t0oMTyn3k9iv+ZqgrwGkRnLpNJrsMv9BZlt2yuA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6510,10 +6510,10 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-context': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-slot': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-slot': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 react: 18.2.0 @@ -6534,8 +6534,8 @@ packages: react: 18.2.0 dev: false - /@radix-ui/react-compose-refs@1.1.0(@types/react@18.2.57)(react@18.2.0): - resolution: {integrity: sha512-b4inOtiaOnYf9KWyO3jAeeCG6FeyfY6ldiEPanbUjWd+xIk5wZeHa8yVwmrJ2vderhu/BQvzCrJI0lHd+wIiqw==} + /@radix-ui/react-compose-refs@1.1.1(@types/react@18.2.57)(react@18.2.0): + resolution: {integrity: sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==} peerDependencies: '@types/react': '*' react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc @@ -6547,8 +6547,8 @@ packages: react: 18.2.0 dev: false - /@radix-ui/react-context-menu@2.2.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-99EatSTpW+hRYHt7m8wdDlLtkmTovEe8Z/hnxUPV+SKuuNL5HWNhQI4QSdjZqNSgXHay2z4M3Dym73j9p2Gx5Q==} + /@radix-ui/react-context-menu@2.2.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-i4ZjZNoiAKwxcaKBR5XdiOyEJQdBT4P6TeMtzP4fjlcDJpxwIcmmWkdd13YEzCHHcWYZOyl7fVHKT8dFMHdo3w==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6560,10 +6560,10 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/primitive': 1.1.0 + '@radix-ui/primitive': 1.1.1 '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-menu': 2.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-menu': 2.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 @@ -6586,19 +6586,6 @@ packages: react: 18.2.0 dev: false - /@radix-ui/react-context@1.1.0(@types/react@18.2.57)(react@18.2.0): - resolution: {integrity: sha512-OKrckBy+sMEgYM/sMmqmErVn0kZqrHPJze+Ql3DzYsDDp0hl0L62nx/2122/Bvps1qz645jlcu2tD9lrRSdf8A==} - peerDependencies: - '@types/react': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - dependencies: - '@types/react': 18.2.57 - react: 18.2.0 - dev: false - /@radix-ui/react-context@1.1.1(@types/react@18.2.57)(react@18.2.0): resolution: {integrity: sha512-UASk9zi+crv9WteK/NU4PLvOoL3OuE6BWVKNF6hPRBtYBDXQ2u5iu3O59zUlJiTVvkyuycnqrztsHVJwcK9K+Q==} peerDependencies: @@ -6612,8 +6599,8 @@ packages: react: 18.2.0 dev: false - /@radix-ui/react-dialog@1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-Yj4dZtqa2o+kG61fzB0H2qUvmwBA2oyQroGLyNtBj1beo1khoQ3q1a2AO8rrQYjd8256CO9+N8L9tvsS+bnIyA==} + /@radix-ui/react-dialog@1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-ujGvqQNkZ0J7caQyl8XuZRj2/TIrYcOGwqz5TeD1OMcCdfBuEMP0D12ve+8J5F9XuNUth3FAKFWo/wt0E/GJrQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6625,17 +6612,17 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-dismissable-layer': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-focus-guards': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-focus-scope': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-id': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-portal': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-presence': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-slot': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-portal': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-presence': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-slot': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 @@ -6697,8 +6684,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-dismissable-layer@1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-QSxg29lfr/xcev6kSz7MAlmDnzbP1eI/Dwn3Tp1ip0KT5CUELsxkekFEMVBEoykI3oV39hKT4TKZzBNMbcTZYQ==} + /@radix-ui/react-dismissable-layer@1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-kEHnlhv7wUggvhuJPkyw4qspXLJOdYoAP4dO2c8ngGuXTq1w/HZp1YeVB+NQ2KbH1iEG+pvOCGYSqh9HZOz6hg==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6710,9 +6697,9 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-escape-keydown': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 @@ -6721,8 +6708,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-dropdown-menu@2.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-GVZMR+eqK8/Kes0a36Qrv+i20bAPXSn8rCBTHx30w+3ECnR5o3xixAlqcVaYvLeyKUsm0aqyhWfmUcqufM8nYA==} + /@radix-ui/react-dropdown-menu@2.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-eKyAfA9e4HOavzyGJC6kiDIlHMPzAU0zqSqTg+VwS0Okvb9nkTo7L4TugkCUqM3I06ciSpdtYQ73cgB7tyUgVw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6734,12 +6721,12 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-id': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-menu': 2.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-menu': 2.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 @@ -6760,8 +6747,8 @@ packages: react: 18.2.0 dev: false - /@radix-ui/react-focus-scope@1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-200UD8zylvEyL8Bx+z76RJnASR2gRMuxlgFCPAe/Q/679a/r0eK3MBVYMb7vZODZcffZBdob1EGnky78xmVvcA==} + /@radix-ui/react-focus-scope@1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-01omzJAYRxXdG2/he/+xy+c8a8gCydoQ1yOxnWNcRhrrBW5W+RQJ22EK1SaO8tb3WoUsuEw7mJjBozPzihDFjA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6773,8 +6760,8 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 @@ -6782,8 +6769,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-form@0.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-1/oVYPDjbFILOLIarcGcMKo+y6SbTVT/iUKVEw59CF4offwZgBgC3ZOeSBewjqU0vdA6FWTPWTN63obj55S/tQ==} + /@radix-ui/react-form@0.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-Ah2TBvzl2trb4DL9DQtyUJgAUfq/djMN7j5CHzdpbdR3W7OL8N4JcJgE80cXMf3ssCE+8yg0zFQoJ0srxqfsFA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6795,20 +6782,20 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-context': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-id': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-label': 2.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-label': 2.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-hover-card@1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-Y5w0qGhysvmqsIy6nQxaPa6mXNKznfoGjOfBgzOjocLxr2XlSjqBMYQQL+FfyogsMuX+m8cZyQGYhJxvxUzO4w==} + /@radix-ui/react-hover-card@1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-D+o67Fd7fjkW10ycdsse1sYuGV9dNQKOhoVii7ksSfUYqQiTPxz9bP/Vu1g6huJ1651/2j8q7JGGWSIBIuGO1Q==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6820,14 +6807,14 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-dismissable-layer': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-portal': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-presence': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-popper': 1.2.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-portal': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-presence': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 @@ -6872,8 +6859,8 @@ packages: react: 18.2.0 dev: false - /@radix-ui/react-label@2.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-peLblDlFw/ngk3UWq0VnYaOLy6agTZZ+MUO/WhVfm14vJGML+xH4FAl2XQGLqdefjNb7ApRg6Yn7U42ZhmYXdw==} + /@radix-ui/react-label@2.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-UUw5E4e/2+4kFMH7+YxORXGWggtY6sM8WIwh5RZchhLuUg2H1hc98Py+pr8HMz6rdaYrK2t296ZEjYLOCO5uUw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6885,15 +6872,15 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-menu@2.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-lZ0R4qR2Al6fZ4yCCZzu/ReTFrylHFxIqy7OezIpWF4bL0o9biKo0pFIvkaew3TyZ9Fy5gYVrR5zCGZBVbO1zg==} + /@radix-ui/react-menu@2.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-wY5SY6yCiJYP+DMIy7RrjF4shoFpB9LJltliVwejBm8T2yepWDJgKBhIFYOGWYR/lFHOCtbstN9duZFu6gmveQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6905,21 +6892,21 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-collection': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-direction': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-dismissable-layer': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-focus-guards': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-focus-scope': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-id': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-portal': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-presence': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-slot': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-popper': 1.2.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-portal': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-presence': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-roving-focus': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-slot': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 @@ -6929,8 +6916,8 @@ packages: react-remove-scroll: 2.6.0(@types/react@18.2.57)(react@18.2.0) dev: false - /@radix-ui/react-popover@1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-u2HRUyWW+lOiA2g0Le0tMmT55FGOEWHwPFt1EPfbLly7uXQExFo5duNKqG2DzmFXIdqOeNd+TpE8baHWJCyP9w==} + /@radix-ui/react-popover@1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-MBDKFwRe6fi0LT8m/Jl4V8J3WbS/UfXJtsgg8Ym5w5AyPG3XfHH4zhBp1P8HmZK83T8J7UzVm6/JpDE3WMl1Dw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -6942,18 +6929,18 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-dismissable-layer': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-focus-guards': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-focus-scope': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-id': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-portal': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-presence': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-slot': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-popper': 1.2.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-portal': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-presence': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-slot': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 @@ -6993,8 +6980,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-popper@1.2.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-ZnRMshKF43aBxVWPWvbj21+7TQCvhuULWJ4gNIKYpRlQt5xGRhLx66tMp8pya2UkGHTSlhpXwmjqltDYHhw7Vg==} + /@radix-ui/react-popper@1.2.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-3kn5Me69L+jv82EKRuQCXdYyf1DqHwD2U/sxoNgBGCB7K9TRc3bQamQ+5EPM9EvyPdli0W41sROd+ZU1dTCztw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -7007,10 +6994,10 @@ packages: optional: true dependencies: '@floating-ui/react-dom': 2.1.2(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-arrow': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-context': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-arrow': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-rect': 1.1.0(@types/react@18.2.57)(react@18.2.0) @@ -7043,8 +7030,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-portal@1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-WeDYLGPxJb/5EGBoedyJbT0MpoULmwnIPMJMSldkuiMsBAv7N1cRdsTWZWht9vpPOiN3qyiGAtbK2is47/uMFg==} + /@radix-ui/react-portal@1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-NciRqhXnGojhT93RPyDaMPfLH3ZSl4jjIFbZQ1b/vxvZEdHsBZ49wP9w8L3HzUQwep01LcWtkUvm0OVB5JAHTw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -7056,7 +7043,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 @@ -7086,8 +7073,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-presence@1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-IeFXVi4YS1K0wVZzXNrbaaUvIJ3qdY+/Ih4eHFhWA9SwGR9UDX7Ck8abvL57C4cv3wwMvUE0OG69Qc3NCcTe/A==} + /@radix-ui/react-presence@1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-18TFr80t5EVgL9x1SwF/YGtfG+l0BS0PRAlCWBDoBEiDQjeKgnNZRVJp/oVBl24sr3Gbfwc/Qpj4OcWTQMsAEg==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -7099,7 +7086,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 @@ -7128,8 +7115,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-primitive@2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-ZSpFm0/uHa8zTvKBDjLFWLo8dkr4MBsiDLz0g3gMUwqgLHz9rTaRRGYDgvZPtBJgYCBKXkS9fzmoySgr8CO6Cw==} + /@radix-ui/react-primitive@2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-sHCWTtxwNn3L3fH8qAfnF3WbUZycW93SM1j3NFDzXBiz8D6F5UTTy8G1+WFEaiCdvCVRJWj6N2R4Xq6HdiHmDg==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -7141,15 +7128,15 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/react-slot': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-slot': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-radio-group@1.2.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-kdbv54g4vfRjja9DNWPMxKvXblzqbpEC8kspEkZ6dVP7kQksGCn+iZHkcCz2nb00+lPdRvxrqy4WrvvV1cNqrQ==} + /@radix-ui/react-radio-group@1.2.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-E0MLLGfOP0l8P/NxgVzfXJ8w3Ch8cdO6UDzJfDChu4EJDy+/WdO5LqpdY8PYnCErkmZH3gZhDL1K7kQ41fAHuQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -7161,13 +7148,13 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-direction': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-presence': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-presence': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-roving-focus': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-previous': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-size': 1.1.0(@types/react@18.2.57)(react@18.2.0) @@ -7177,8 +7164,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-roving-focus@1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-EA6AMGeq9AEeQDeSH0aZgG198qkfHSbvWTf1HvoDmOB5bBG/qTxjYMWUKMnYiV6J/iP/J8MEFSuB2zRU2n7ODA==} + /@radix-ui/react-roving-focus@1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-QE1RoxPGJ/Nm8Qmk0PxP8ojmoaS67i0s7hVssS7KuI2FQoc/uzVlZsqKfQvxPE6D8hICCPHJ4D88zNhT3OOmkw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -7190,13 +7177,13 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-context': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-collection': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-direction': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-id': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 @@ -7205,8 +7192,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-scroll-area@1.2.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-FnM1fHfCtEZ1JkyfH/1oMiTcFBQvHKl4vD9WnpwkLgtF+UmnXMCad6ECPTaAjcDjam+ndOEJWgHyKDGNteWSHw==} + /@radix-ui/react-scroll-area@1.2.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-EFI1N/S3YxZEW/lJ/H1jY3njlvTd8tBmgKEn4GHi51+aMm94i6NmAJstsm5cu3yJwYqYc93gpCPm21FeAbFk6g==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -7219,12 +7206,12 @@ packages: optional: true dependencies: '@radix-ui/number': 1.1.0 - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-direction': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-presence': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-presence': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 @@ -7233,8 +7220,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-select@2.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-rZJtWmorC7dFRi0owDmoijm6nSJH1tVw64QGiNIZ9PNLyBDtG+iAq+XGsya052At4BfarzY/Dhv9wrrUr6IMZA==} + /@radix-ui/react-select@2.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-tlLwaewTfrKetiex8iW9wwME/qrYlzlH0qcgYmos7xS54MO00SiPHasLoAykg/yVrjf41GQptPPi4oXzrP+sgg==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -7247,24 +7234,24 @@ packages: optional: true dependencies: '@radix-ui/number': 1.1.0 - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-collection': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-direction': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-dismissable-layer': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-focus-guards': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-focus-scope': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-id': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-portal': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-slot': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-popper': 1.2.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-portal': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-slot': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-previous': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-visually-hidden': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 aria-hidden: 1.2.4 @@ -7273,8 +7260,8 @@ packages: react-remove-scroll: 2.6.0(@types/react@18.2.57)(react@18.2.0) dev: false - /@radix-ui/react-separator@1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-3uBAs+egzvJBDZAzvb/n4NxxOYpnspmWxO2u5NbZ8Y6FM/NdrGSF9bop3Cf6F6C71z1rTSn8KV0Fo2ZVd79lGA==} + /@radix-ui/react-separator@1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-RRiNRSrD8iUiXriq/Y5n4/3iE8HzqgLHsusUSg5jVpU2+3tqcUFPJXHDymwEypunc2sWxDUS3UC+rkZRlHedsw==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -7286,15 +7273,15 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-slider@1.2.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-bEzQoDW0XP+h/oGbutF5VMWJPAl/UU8IJjr7h02SOHDIIIxq+cep8nItVNoBV+OMmahCdqdF38FTpmXoqQUGvw==} + /@radix-ui/react-slider@1.2.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-sNlU06ii1/ZcbHf8I9En54ZPW0Vil/yPVg4vQMcFNjrIx51jsHbFl1HYHQvCIWJSr1q0ZmA+iIs/ZTv8h7HHSA==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -7307,12 +7294,12 @@ packages: optional: true dependencies: '@radix-ui/number': 1.1.0 - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-collection': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-direction': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-previous': 1.1.0(@types/react@18.2.57)(react@18.2.0) @@ -7338,8 +7325,8 @@ packages: react: 18.2.0 dev: false - /@radix-ui/react-slot@1.1.0(@types/react@18.2.57)(react@18.2.0): - resolution: {integrity: sha512-FUCf5XMfmW4dtYl69pdS4DbxKy8nj4M7SafBgPllysxmdachynNflAdp/gCsnYWNDnge6tI9onzMp5ARYc1KNw==} + /@radix-ui/react-slot@1.1.1(@types/react@18.2.57)(react@18.2.0): + resolution: {integrity: sha512-RApLLOcINYJA+dMVbOju7MYv1Mb2EBp2nH4HdDzXTSyaR5optlm6Otrz1euW3HbdOR8UmmFK06TD+A9frYWv+g==} peerDependencies: '@types/react': '*' react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc @@ -7347,13 +7334,13 @@ packages: '@types/react': optional: true dependencies: - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 react: 18.2.0 dev: false - /@radix-ui/react-switch@1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-diPqDDoBcZPSicYoMWdWx+bCPuTRH4QSp9J+65IvtdS0Kuzt67bI6n32vCj8q6NZmYW/ah+2orOtMwcX5eQwIg==} + /@radix-ui/react-switch@1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-zGukiWHjEdBCRyXvKR6iXAQG6qXm2esuAD6kDOi9Cn+1X6ev3ASo4+CsYaD6Fov9r/AQFekqnD/7+V0Cs6/98g==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -7365,10 +7352,10 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-previous': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-size': 1.1.0(@types/react@18.2.57)(react@18.2.0) @@ -7378,8 +7365,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-tabs@1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-3GBUDmP2DvzmtYLMsHmpA1GtR46ZDZ+OreXM/N+kkQJOPIgytFWWTfDQmBQKBvaFS0Vno0FktdbVzN28KGrMdw==} + /@radix-ui/react-tabs@1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-9u/tQJMcC2aGq7KXpGivMm1mgq7oRJKXphDwdypPd/j21j/2znamPU8WkXgnhUaTrSFNIt8XhOyCAupg8/GbwQ==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -7391,13 +7378,13 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/primitive': 1.1.0 + '@radix-ui/primitive': 1.1.1 '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-direction': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-id': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-presence': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-presence': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-roving-focus': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.2.57)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 @@ -7437,8 +7424,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-tooltip@1.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-QpObUH/ZlpaO4YgHSaYzrLO2VuO+ZBFFgGzjMUPwtiYnAzzNNDPJeEGRrT7qNOrWm/Jr08M1vlp+vTHtnSQ0Uw==} + /@radix-ui/react-tooltip@1.1.5(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-IucoQPcK5nwUuztaxBQvudvYwH58wtRcJlv1qvaMSyIbL9dEBfFN0vRf/D8xDbu6HmAJLlNGty4z8Na+vIqe9Q==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -7450,18 +7437,18 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-compose-refs': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-context': 1.1.1(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-dismissable-layer': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-id': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-portal': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-presence': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-slot': 1.1.0(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-popper': 1.2.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-portal': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-presence': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-slot': 1.1.1(@types/react@18.2.57)(react@18.2.0) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-visually-hidden': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 react: 18.2.0 @@ -7672,8 +7659,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-visually-hidden@1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-N8MDZqtgCgG5S3aV60INAB475osJousYpZ4cTJ2cFbMpdHS5Y6loLTH8LPtkj2QN0x93J30HT/M3qJXM0+lyeQ==} + /@radix-ui/react-visually-hidden@1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-vVfA2IZ9q/J+gEamvj761Oq1FpWgCDaNOOIfbPVp2MVPLEomUr5+Vf7kJGwQ24YxZSlQVar7Bes8kyTo5Dshpg==} peerDependencies: '@types/react': '*' '@types/react-dom': '*' @@ -7685,7 +7672,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 react: 18.2.0 @@ -7716,30 +7703,30 @@ packages: optional: true dependencies: '@radix-ui/colors': 2.0.1 - '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-accessible-icon': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-alert-dialog': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-aspect-ratio': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-avatar': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-checkbox': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-context-menu': 2.2.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-dialog': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/primitive': 1.1.1 + '@radix-ui/react-accessible-icon': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-alert-dialog': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-aspect-ratio': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-avatar': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-checkbox': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-context-menu': 2.2.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dialog': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-direction': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-dropdown-menu': 2.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-form': 0.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-hover-card': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-popover': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-portal': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-radio-group': 1.2.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-scroll-area': 1.2.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-select': 2.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-separator': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-slider': 1.2.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-slot': 1.1.0(@types/react@18.2.57)(react@18.2.0) - '@radix-ui/react-switch': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-tabs': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-tooltip': 1.1.4(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-dropdown-menu': 2.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-form': 0.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-hover-card': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-popover': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-portal': 1.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-radio-group': 1.2.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-scroll-area': 1.2.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-select': 2.1.3(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-separator': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-slider': 1.2.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-slot': 1.1.1(@types/react@18.2.57)(react@18.2.0) + '@radix-ui/react-switch': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-tabs': 1.1.2(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-tooltip': 1.1.5(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-visually-hidden': 1.1.1(@types/react-dom@18.2.19)(@types/react@18.2.57)(react-dom@18.2.0)(react@18.2.0) '@types/react': 18.2.57 '@types/react-dom': 18.2.19 classnames: 2.3.2 @@ -12217,6 +12204,11 @@ packages: requiresBuild: true dev: false + /core-js@3.39.0: + resolution: {integrity: sha512-raM0ew0/jJUqkJ0E6e8UDtl+y/7ktFivgWvqw8dNSQeNWoSDLvQ1H/RN3aPXB9tBd4/FhyR4RDPGhsNIMsAn7g==} + requiresBuild: true + dev: false + /core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} @@ -20268,18 +20260,20 @@ packages: xtend: 4.0.2 dev: false - /posthog-js@1.139.1: - resolution: {integrity: sha512-+JDu2S7z6sh9Q5kj0oh/W8PZJMQ1gSigWi7gbY4NwwCq2M3t0wNFjxlfHbAo1GncRWDxen+IC+3J7oJ8TJGnkA==} + /posthog-js@1.201.0: + resolution: {integrity: sha512-5LG4i36eYykIj5FYaQQ1vmSOriVeiswCNPUAPkpnq4ccmavu8y5L+QIxaX98ACmDAW7DkUDS05yUjYWmd84tzQ==} dependencies: + core-js: 3.39.0 fflate: 0.4.8 preact: 10.20.2 + web-vitals: 4.2.4 dev: false - /posthog-node@4.0.0: - resolution: {integrity: sha512-jEZnNbgb/3FNk+gNwtTcyz3j+62zIN+UTPotONfacVXJnoI70KScSkKdIR+rvP9tA2kjBSoHQxGwJuizs27o9A==} + /posthog-node@4.3.2: + resolution: {integrity: sha512-vy8Mt9IEfniUgqQ1rOCQ31CBO1VNqDGd3ZtHlWR9/YfU6RiuK+9pUXPb4h6HTGzQmjL8NFnjd8K8NMXSX8S6MQ==} engines: {node: '>=15.0.0'} dependencies: - axios: 1.6.8 + axios: 1.7.7 rusha: 0.8.14 transitivePeerDependencies: - debug @@ -24042,6 +24036,10 @@ packages: engines: {node: '>= 14'} dev: false + /web-vitals@4.2.4: + resolution: {integrity: sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw==} + dev: false + /webcrypto-core@1.8.0: resolution: {integrity: sha512-kR1UQNH8MD42CYuLzvibfakG5Ew5seG85dMMoAM/1LqvckxaF6pUiidLuraIu4V+YCIFabYecUZAW0TuxAoaqw==} dependencies: From dea3106d249119169e515d7ccebc827f324bdbf3 Mon Sep 17 00:00:00 2001 From: Joe Baker Date: Tue, 17 Dec 2024 08:48:03 +0000 Subject: [PATCH 2/4] fix: sonar duplication (#397) --- .../src/app/api/aila-download-all/route.ts | 63 ++--- .../app/api/aila-download/downloadHelpers.ts | 27 ++ .../nextjs/src/app/api/aila-download/route.ts | 31 +-- .../Chat/chat-start-accordion.tsx | 197 -------------- .../useExportAllLessonAssets.ts | 5 +- .../export/exportAdditionalMaterialsDoc.ts | 55 +--- packages/api/src/export/exportHelpers.ts | 132 ++++++++++ packages/api/src/export/exportLessonPlan.ts | 54 +--- packages/api/src/export/exportLessonSlides.ts | 51 +--- .../src/export/exportQuizDesignerSlides.ts | 96 +++++++ packages/api/src/export/exportQuizDoc.ts | 49 +--- packages/api/src/export/exportWorksheets.ts | 50 +--- packages/api/src/router/exports.ts | 242 +++--------------- packages/core/src/models/lessonSnapshots.ts | 2 +- packages/core/src/types/export-template.ts | 233 ----------------- packages/db/schemas/lesson.ts | 21 +- .../exports/src/exportAdditionalMaterials.ts | 4 +- packages/exports/src/schema/input.schema.ts | 6 +- sonar-project.properties | 3 +- 19 files changed, 379 insertions(+), 942 deletions(-) create mode 100644 apps/nextjs/src/app/api/aila-download/downloadHelpers.ts delete mode 100644 apps/nextjs/src/components/AppComponents/Chat/chat-start-accordion.tsx create mode 100644 packages/api/src/export/exportHelpers.ts create mode 100644 packages/api/src/export/exportQuizDesignerSlides.ts delete mode 100644 packages/core/src/types/export-template.ts diff --git a/apps/nextjs/src/app/api/aila-download-all/route.ts b/apps/nextjs/src/app/api/aila-download-all/route.ts index 37d46e7f6..cb4b8031d 100644 --- a/apps/nextjs/src/app/api/aila-download-all/route.ts +++ b/apps/nextjs/src/app/api/aila-download-all/route.ts @@ -1,6 +1,5 @@ import { auth } from "@clerk/nextjs/server"; -import type { LessonExportType } from "@oakai/db"; -import { prisma } from "@oakai/db"; +import { prisma, type LessonExportType } from "@oakai/db"; import { downloadDriveFile } from "@oakai/exports"; import * as Sentry from "@sentry/node"; import { kv } from "@vercel/kv"; @@ -9,6 +8,7 @@ import { PassThrough } from "stream"; import { withSentry } from "@/lib/sentry/withSentry"; +import { saveDownloadEvent } from "../aila-download/downloadHelpers"; import { sanitizeFilename } from "../sanitizeFilename"; type FileIdsAndFormats = { @@ -16,48 +16,6 @@ type FileIdsAndFormats = { formats: ReadonlyArray<"pptx" | "docx" | "pdf">; }[]; -function getReadableExportType(exportType: LessonExportType) { - switch (exportType) { - case "EXIT_QUIZ_DOC": - return "Exit quiz"; - case "LESSON_PLAN_DOC": - return "Lesson plan"; - case "STARTER_QUIZ_DOC": - return "Starter quiz"; - case "WORKSHEET_SLIDES": - return "Worksheet"; - case "LESSON_SLIDES_SLIDES": - return "Lesson slides"; - case "ADDITIONAL_MATERIALS_DOCS": - return "Additional materials"; - } -} - -async function saveDownloadEvent({ - lessonExportId, - downloadedBy, - ext, -}: { - lessonExportId: string; - downloadedBy: string; - ext: string; -}) { - try { - await prisma.lessonExportDownload.create({ - data: { - lessonExportId, - downloadedBy, - ext, - }, - }); - } catch (error) { - Sentry.captureException(error, { - level: "warning", - extra: { lessonExportId, downloadedBy, ext }, - }); - } -} - function nodePassThroughToReadableStream(passThrough: PassThrough) { return new ReadableStream({ start(controller) { @@ -77,6 +35,23 @@ function nodePassThroughToReadableStream(passThrough: PassThrough) { }); } +function getReadableExportType(exportType: LessonExportType) { + switch (exportType) { + case "EXIT_QUIZ_DOC": + return "Exit quiz"; + case "LESSON_PLAN_DOC": + return "Lesson plan"; + case "STARTER_QUIZ_DOC": + return "Starter quiz"; + case "WORKSHEET_SLIDES": + return "Worksheet"; + case "LESSON_SLIDES_SLIDES": + return "Lesson slides"; + case "ADDITIONAL_MATERIALS_DOCS": + return "Additional materials"; + } +} + async function getHandler(req: Request): Promise { const { searchParams } = new URL(req.url); const fileIdsParam = searchParams.get("fileIds"); diff --git a/apps/nextjs/src/app/api/aila-download/downloadHelpers.ts b/apps/nextjs/src/app/api/aila-download/downloadHelpers.ts new file mode 100644 index 000000000..7ce92b445 --- /dev/null +++ b/apps/nextjs/src/app/api/aila-download/downloadHelpers.ts @@ -0,0 +1,27 @@ +import { prisma } from "@oakai/db"; +import * as Sentry from "@sentry/node"; + +export async function saveDownloadEvent({ + lessonExportId, + downloadedBy, + ext, +}: { + lessonExportId: string; + downloadedBy: string; + ext: string; +}) { + try { + await prisma.lessonExportDownload.create({ + data: { + lessonExportId, + downloadedBy, + ext, + }, + }); + } catch (error) { + Sentry.captureException(error, { + level: "warning", + extra: { lessonExportId, downloadedBy, ext }, + }); + } +} diff --git a/apps/nextjs/src/app/api/aila-download/route.ts b/apps/nextjs/src/app/api/aila-download/route.ts index 64c9010bc..6177ba41e 100644 --- a/apps/nextjs/src/app/api/aila-download/route.ts +++ b/apps/nextjs/src/app/api/aila-download/route.ts @@ -1,12 +1,12 @@ import { auth } from "@clerk/nextjs/server"; -import type { LessonExportType } from "@oakai/db"; -import { prisma } from "@oakai/db"; +import { prisma, type LessonExportType } from "@oakai/db"; import { downloadDriveFile } from "@oakai/exports"; import * as Sentry from "@sentry/node"; import { withSentry } from "@/lib/sentry/withSentry"; import { sanitizeFilename } from "../sanitizeFilename"; +import { saveDownloadEvent } from "./downloadHelpers"; // From: https://www.ericburel.tech/blog/nextjs-stream-files async function* nodeStreamToIterator(stream: NodeJS.ReadableStream) { @@ -46,31 +46,6 @@ function getReadableExportType(exportType: LessonExportType) { } } -async function saveDownloadEvent({ - lessonExportId, - downloadedBy, - ext, -}: { - lessonExportId: string; - downloadedBy: string; - ext: string; -}) { - try { - await prisma.lessonExportDownload.create({ - data: { - lessonExportId, - downloadedBy, - ext, - }, - }); - } catch (error) { - Sentry.captureException(error, { - level: "warning", - extra: { lessonExportId, downloadedBy, ext }, - }); - } -} - async function getHandler(req: Request): Promise { const { searchParams } = new URL(req.url); @@ -135,7 +110,7 @@ async function getHandler(req: Request): Promise { }); } - saveDownloadEvent({ + await saveDownloadEvent({ lessonExportId: lessonExport.id, downloadedBy: userId, ext, diff --git a/apps/nextjs/src/components/AppComponents/Chat/chat-start-accordion.tsx b/apps/nextjs/src/components/AppComponents/Chat/chat-start-accordion.tsx deleted file mode 100644 index 4ce5992b9..000000000 --- a/apps/nextjs/src/components/AppComponents/Chat/chat-start-accordion.tsx +++ /dev/null @@ -1,197 +0,0 @@ -"use client"; - -import React from "react"; - -import * as Accordion from "@radix-ui/react-accordion"; -import { lessonSections } from "ai-apps/lesson-planner/lessonSection"; - -import { Icon } from "@/components/Icon"; -import AiIcon from "@/components/SVGParts/AiIcon"; -import LessonIcon from "@/components/SVGParts/LessonIcon"; -import QuizIcon from "@/components/SVGParts/QuizIcon"; -import SlidesIcon from "@/components/SVGParts/SlidesIcon"; -import { convertTitleCaseToSentenceCase } from "@/utils/convertTitleCaseToSentenceCase"; - -import { handleRewordingSections } from "./export-buttons"; - -const ChatStartAccordion = () => { - const slidesLessonSections = lessonSections.filter( - (section) => - section !== "Title" && - section !== "Key stage" && - section !== "Subject" && - section !== "Prior knowledge" && - section !== "Key learning points" && - section !== "Misconceptions" && - section !== "Starter quiz" && - section !== "Exit Quiz", - ); - - const quizLessonSections = lessonSections.filter( - (section) => - section !== "Title" && - section !== "Key stage" && - section !== "Subject" && - section !== "Prior knowledge" && - section !== "Key learning points" && - section !== "Misconceptions" && - section !== "Learning cycle 1" && - section !== "Keywords" && - section !== "Learning cycles" && - section !== "Learning outcome", - ); - - return ( - - - - 1 lesson plan - - -
- {lessonSections.map((section) => { - if ( - section == "Title" || - section == "Key stage" || - section == "Subject" - ) { - return null; - } - return ( -
- - - {convertTitleCaseToSentenceCase( - handleRewordingSections(section), - )} - -
- ); - })} -
-
-
- - - 1 slide deck - - -
- {slidesLessonSections.map((section) => { - if ( - section == "Title" || - section == "Key stage" || - section == "Subject" - ) { - return null; - } - return ( -
- - - {convertTitleCaseToSentenceCase( - handleRewordingSections(section), - )} - -
- ); - })} -
-
-
- - - 2 quizzes - - -
- {quizLessonSections.map((section) => { - if ( - section == "Title" || - section == "Key stage" || - section == "Subject" - ) { - return null; - } - return ( -
- - - {convertTitleCaseToSentenceCase( - handleRewordingSections(section), - )} - -
- ); - })} -
-
-
- -
- - 1 worksheet - -
-
-
- ); -}; - -// Define prop types for each component -interface AccordionItemProps - extends React.ComponentPropsWithoutRef { - readonly children: React.ReactNode; -} - -interface AccordionTriggerProps - extends React.ComponentPropsWithoutRef { - readonly children: React.ReactNode; -} - -interface AccordionContentProps - extends React.ComponentPropsWithoutRef { - readonly children: React.ReactNode; -} - -const AccordionItem = React.forwardRef( - ({ children, ...props }, forwardedRef) => ( - - {children} - - ), -); -AccordionItem.displayName = "AccordionItem"; - -const AccordionTrigger = React.forwardRef< - HTMLDivElement, - AccordionTriggerProps ->(({ children, ...props }) => ( - - - {children} - - - -)); -AccordionTrigger.displayName = "AccordionTrigger"; - -const AccordionContent = React.forwardRef< - HTMLDivElement, - AccordionContentProps ->(({ children, ...props }, forwardedRef) => ( - -
{children}
-
-)); - -AccordionContent.displayName = "AccordionContent"; - -export default ChatStartAccordion; diff --git a/apps/nextjs/src/components/ExportsDialogs/useExportAllLessonAssets.ts b/apps/nextjs/src/components/ExportsDialogs/useExportAllLessonAssets.ts index 7005f37b1..9a0560955 100644 --- a/apps/nextjs/src/components/ExportsDialogs/useExportAllLessonAssets.ts +++ b/apps/nextjs/src/components/ExportsDialogs/useExportAllLessonAssets.ts @@ -2,7 +2,7 @@ import { useCallback, useEffect, useMemo, useState } from "react"; import type { LessonDeepPartial } from "@oakai/exports/browser"; import { exportSlidesFullLessonSchema } from "@oakai/exports/browser"; -import type { LessonSlidesInputData } from "@oakai/exports/src/schema/input.schema"; +import type { LessonInputData } from "@oakai/exports/src/schema/input.schema"; import { aiLogger } from "@oakai/logger"; import * as Sentry from "@sentry/nextjs"; import { useDebounce } from "@uidotdev/usehooks"; @@ -29,8 +29,7 @@ export function useExportAllLessonAssets({ const query = trpc.exports.generateAllAssetExports.useMutation(); const [parseResult, setParseResult] = useState< - | { data?: LessonSlidesInputData; success: boolean; error?: ZodError } - | undefined + { data?: LessonInputData; success: boolean; error?: ZodError } | undefined >({ success: false }); const debouncedParseResult = useDebounce(parseResult, 500); diff --git a/packages/api/src/export/exportAdditionalMaterialsDoc.ts b/packages/api/src/export/exportAdditionalMaterialsDoc.ts index 826339ea4..4b532aebd 100644 --- a/packages/api/src/export/exportAdditionalMaterialsDoc.ts +++ b/packages/api/src/export/exportAdditionalMaterialsDoc.ts @@ -1,19 +1,13 @@ import type { SignedInAuthObject } from "@clerk/backend/internal"; -import { clerkClient } from "@clerk/nextjs/server"; -import { LessonSnapshots } from "@oakai/core"; import type { PrismaClientWithAccelerate } from "@oakai/db"; import { exportAdditionalMaterials } from "@oakai/exports"; -import type { LessonSlidesInputData } from "@oakai/exports/src/schema/input.schema"; +import type { LessonInputData } from "@oakai/exports/src/schema/input.schema"; import { aiLogger } from "@oakai/logger"; import * as Sentry from "@sentry/nextjs"; -import type { - OutputSchema} from "../router/exports"; -import { - ailaGetExportBySnapshotId, - ailaSaveExport, - reportErrorResult, -} from "../router/exports"; +import type { OutputSchema } from "../router/exports"; +import { ailaSaveExport, reportErrorResult } from "../router/exports"; +import { getExistingExportData, getUserEmail } from "./exportHelpers"; const log = aiLogger("exports"); @@ -22,7 +16,7 @@ export async function exportAdditionalMaterialsDoc({ ctx, }: { input: { - data: LessonSlidesInputData; + data: LessonInputData; chatId: string; messageId: string; }; @@ -31,50 +25,23 @@ export async function exportAdditionalMaterialsDoc({ prisma: PrismaClientWithAccelerate; }; }) { - const user = await clerkClient.users.getUser(ctx.auth.userId); - const userEmail = user?.emailAddresses[0]?.emailAddress; - const exportType = "ADDITIONAL_MATERIALS_DOCS"; - + const userEmail = await getUserEmail(ctx); if (!userEmail) { return { error: new Error("User email not found"), message: "User email not found", }; } + const exportType = "ADDITIONAL_MATERIALS_DOCS"; - const lessonSnapshots = new LessonSnapshots(ctx.prisma); - const lessonSnapshot = await lessonSnapshots.getOrSaveSnapshot({ - userId: ctx.auth.userId, - chatId: input.chatId, - messageId: input.messageId, - snapshot: input.data, - trigger: "EXPORT_BY_USER", - }); - - Sentry.addBreadcrumb({ - category: "exportAdditionalMaterialsDoc", - message: "Got or saved snapshot", - data: { lessonSnapshot }, - }); - - const exportData = await ailaGetExportBySnapshotId({ - prisma: ctx.prisma, - snapshotId: lessonSnapshot.id, + const { exportData, lessonSnapshot } = await getExistingExportData({ + ctx, + input, exportType, }); - Sentry.addBreadcrumb({ - category: "exportAdditionalMaterialsDoc", - message: "Got export data", - data: { exportData }, - }); - if (exportData) { - const output: OutputSchema = { - link: exportData.gdriveFileUrl, - canViewSourceDoc: exportData.userCanViewGdriveFile, - }; - return output; + return exportData; } const result = await exportAdditionalMaterials({ diff --git a/packages/api/src/export/exportHelpers.ts b/packages/api/src/export/exportHelpers.ts new file mode 100644 index 000000000..e110de9ab --- /dev/null +++ b/packages/api/src/export/exportHelpers.ts @@ -0,0 +1,132 @@ +import type { SignedInAuthObject } from "@clerk/backend/internal"; +import { clerkClient } from "@clerk/nextjs/server"; +import { LessonSnapshots } from "@oakai/core"; +import type { Snapshot } from "@oakai/core/src/models/lessonSnapshots"; +import type { + LessonExportType, + LessonSnapshot, + PrismaClientWithAccelerate, +} from "@oakai/db"; +import * as Sentry from "@sentry/nextjs"; + +import { + ailaGetExportBySnapshotId, + type OutputSchema, +} from "../router/exports"; + +export const getUserEmail = async (ctx: { + auth: SignedInAuthObject; + prisma: PrismaClientWithAccelerate; +}) => { + const user = await clerkClient.users.getUser(ctx.auth.userId); + const userEmail = user?.emailAddresses[0]?.emailAddress; + + return userEmail; +}; + +const categoryMap: Record = { + LESSON_SLIDES_SLIDES: "exportLessonSlidesDoc", + LESSON_PLAN_DOC: "exportLessonPlanDoc", + WORKSHEET_SLIDES: "exportWorksheetDocs", + ADDITIONAL_MATERIALS_DOCS: "exportAdditionalMaterialsDoc", + EXIT_QUIZ_DOC: "exportQuizDoc", + STARTER_QUIZ_DOC: "exportQuizDoc", +}; + +export const getLessonSnapshot = async ({ + input, + ctx, + exportType, +}: { + input: { + data: T; + chatId: string; + messageId: string; + }; + ctx: { + auth: SignedInAuthObject; + prisma: PrismaClientWithAccelerate; + }; + exportType: LessonExportType; +}): Promise => { + const lessonSnapshots = new LessonSnapshots(ctx.prisma); + + const lessonSnapshot = await lessonSnapshots.getOrSaveSnapshot({ + userId: ctx.auth.userId, + chatId: input.chatId, + messageId: input.messageId, + snapshot: input.data as Snapshot, + trigger: "EXPORT_BY_USER", + }); + + const category = categoryMap[exportType] ?? "exportLessonDoc"; + + Sentry.addBreadcrumb({ + category, + message: "Got or saved snapshot", + data: { lessonSnapshot }, + }); + + return lessonSnapshot; +}; + +export const getExportData = async ({ + prisma, + snapshotId, + exportType, +}: { + prisma: PrismaClientWithAccelerate; + snapshotId: string; + exportType: LessonExportType; +}) => { + const exportData = await ailaGetExportBySnapshotId({ + prisma, + snapshotId, + exportType, + }); + const category = categoryMap[exportType] ?? "exportLessonDoc"; + Sentry.addBreadcrumb({ + category, + message: "Got export data", + data: { exportData }, + }); + + if (exportData) { + const output: OutputSchema = { + link: exportData.gdriveFileUrl, + canViewSourceDoc: exportData.userCanViewGdriveFile, + }; + return output; + } +}; + +export const getExistingExportData = async ({ + input, + ctx, + exportType, +}: { + input: { + data: T; + chatId: string; + messageId: string; + }; + ctx: { + auth: SignedInAuthObject; + prisma: PrismaClientWithAccelerate; + }; + exportType: LessonExportType; +}) => { + const lessonSnapshot = await getLessonSnapshot({ + ctx, + input, + exportType, + }); + + const exportData = await getExportData({ + prisma: ctx.prisma, + snapshotId: lessonSnapshot.id, + exportType, + }); + + return { exportData, lessonSnapshot }; +}; diff --git a/packages/api/src/export/exportLessonPlan.ts b/packages/api/src/export/exportLessonPlan.ts index 705b197ae..941fb9470 100644 --- a/packages/api/src/export/exportLessonPlan.ts +++ b/packages/api/src/export/exportLessonPlan.ts @@ -1,19 +1,13 @@ import type { SignedInAuthObject } from "@clerk/backend/internal"; -import { clerkClient } from "@clerk/nextjs/server"; -import { LessonSnapshots } from "@oakai/core"; import type { PrismaClientWithAccelerate } from "@oakai/db"; import { exportDocLessonPlan } from "@oakai/exports"; -import type { LessonSlidesInputData } from "@oakai/exports/src/schema/input.schema"; +import type { LessonInputData } from "@oakai/exports/src/schema/input.schema"; import { aiLogger } from "@oakai/logger"; import * as Sentry from "@sentry/nextjs"; -import type { - OutputSchema} from "../router/exports"; -import { - ailaGetExportBySnapshotId, - ailaSaveExport, - reportErrorResult, -} from "../router/exports"; +import type { OutputSchema } from "../router/exports"; +import { ailaSaveExport, reportErrorResult } from "../router/exports"; +import { getExistingExportData, getUserEmail } from "./exportHelpers"; const log = aiLogger("exports"); @@ -22,7 +16,7 @@ export async function exportLessonPlan({ ctx, }: { input: { - data: LessonSlidesInputData; + data: LessonInputData; chatId: string; messageId: string; }; @@ -31,10 +25,7 @@ export async function exportLessonPlan({ prisma: PrismaClientWithAccelerate; }; }) { - const user = await clerkClient.users.getUser(ctx.auth.userId); - const userEmail = user?.emailAddresses[0]?.emailAddress; - const exportType = "LESSON_PLAN_DOC"; - + const userEmail = await getUserEmail(ctx); if (!userEmail) { return { error: new Error("User email not found"), @@ -42,39 +33,16 @@ export async function exportLessonPlan({ }; } - const lessonSnapshots = new LessonSnapshots(ctx.prisma); - const lessonSnapshot = await lessonSnapshots.getOrSaveSnapshot({ - userId: ctx.auth.userId, - chatId: input.chatId, - messageId: input.messageId, - snapshot: input.data, - trigger: "EXPORT_BY_USER", - }); - - Sentry.addBreadcrumb({ - category: "exportLessonPlanDoc", - message: "Got or saved snapshot", - data: { lessonSnapshot }, - }); + const exportType = "LESSON_PLAN_DOC"; - const exportData = await ailaGetExportBySnapshotId({ - prisma: ctx.prisma, - snapshotId: lessonSnapshot.id, + const { exportData, lessonSnapshot } = await getExistingExportData({ + ctx, + input, exportType, }); - Sentry.addBreadcrumb({ - category: "exportLessonPlanDoc", - message: "Got export data", - data: { exportData }, - }); - if (exportData) { - const output: OutputSchema = { - link: exportData.gdriveFileUrl, - canViewSourceDoc: exportData.userCanViewGdriveFile, - }; - return output; + return exportData; } /** diff --git a/packages/api/src/export/exportLessonSlides.ts b/packages/api/src/export/exportLessonSlides.ts index c941915e3..0da0d6f99 100644 --- a/packages/api/src/export/exportLessonSlides.ts +++ b/packages/api/src/export/exportLessonSlides.ts @@ -1,19 +1,13 @@ import type { SignedInAuthObject } from "@clerk/backend/internal"; -import { clerkClient } from "@clerk/nextjs/server"; -import { LessonSnapshots } from "@oakai/core"; import type { PrismaClientWithAccelerate } from "@oakai/db"; import { exportSlidesFullLesson } from "@oakai/exports"; import type { LessonSlidesInputData } from "@oakai/exports/src/schema/input.schema"; import { aiLogger } from "@oakai/logger"; import * as Sentry from "@sentry/nextjs"; -import type { - OutputSchema} from "../router/exports"; -import { - ailaGetExportBySnapshotId, - ailaSaveExport, - reportErrorResult, -} from "../router/exports"; +import type { OutputSchema } from "../router/exports"; +import { ailaSaveExport, reportErrorResult } from "../router/exports"; +import { getExistingExportData, getUserEmail } from "./exportHelpers"; const log = aiLogger("exports"); @@ -31,50 +25,23 @@ export async function exportLessonSlides({ prisma: PrismaClientWithAccelerate; }; }) { - const user = await clerkClient.users.getUser(ctx.auth.userId); - const userEmail = user?.emailAddresses[0]?.emailAddress; - const exportType = "LESSON_SLIDES_SLIDES"; - + const userEmail = await getUserEmail(ctx); if (!userEmail) { return { error: new Error("User email not found"), message: "User email not found", }; } + const exportType = "LESSON_SLIDES_SLIDES"; - const lessonSnapshots = new LessonSnapshots(ctx.prisma); - const lessonSnapshot = await lessonSnapshots.getOrSaveSnapshot({ - userId: ctx.auth.userId, - chatId: input.chatId, - messageId: input.messageId, - snapshot: input.data, - trigger: "EXPORT_BY_USER", - }); - - Sentry.addBreadcrumb({ - category: "exportLessonSlides", - message: "Got or saved snapshot", - data: { lessonSnapshot }, - }); - - const exportData = await ailaGetExportBySnapshotId({ - prisma: ctx.prisma, - snapshotId: lessonSnapshot.id, + const { exportData, lessonSnapshot } = await getExistingExportData({ + ctx, + input, exportType, }); - Sentry.addBreadcrumb({ - category: "exportLessonSlides", - message: "Got export data", - data: { exportData }, - }); - if (exportData) { - const output: OutputSchema = { - link: exportData.gdriveFileUrl, - canViewSourceDoc: exportData.userCanViewGdriveFile, - }; - return output; + return exportData; } /** diff --git a/packages/api/src/export/exportQuizDesignerSlides.ts b/packages/api/src/export/exportQuizDesignerSlides.ts new file mode 100644 index 000000000..48a04a968 --- /dev/null +++ b/packages/api/src/export/exportQuizDesignerSlides.ts @@ -0,0 +1,96 @@ +import type { SignedInAuthObject } from "@clerk/backend/internal"; +import type { PrismaClientWithAccelerate } from "@oakai/db"; +import { exportQuizDesignerSlides } from "@oakai/exports"; +import type { ExportableQuizAppState } from "@oakai/exports/src/schema/input.schema"; +import { aiLogger } from "@oakai/logger"; +import * as Sentry from "@sentry/nextjs"; + +import type { OutputSchema } from "../router/exports"; +import { qdSaveExport, reportErrorResult } from "../router/exports"; +import { getExistingExportData, getUserEmail } from "./exportHelpers"; + +const log = aiLogger("exports"); + +export async function exportQuizDesignerSlidesWrapper({ + input, + ctx, +}: { + input: { + data: ExportableQuizAppState; + chatId: string; + messageId: string; + }; + ctx: { + auth: SignedInAuthObject; + prisma: PrismaClientWithAccelerate; + }; +}) { + const userEmail = await getUserEmail(ctx); + if (!userEmail) { + return { + error: new Error("User email not found"), + message: "User email not found", + }; + } + const exportType = "LESSON_SLIDES_SLIDES"; + + const { exportData, lessonSnapshot } = await getExistingExportData({ + ctx, + input, + exportType, + }); + + if (exportData) { + return exportData; + } + + /** + * User hasn't yet exported the lesson in this state, so we'll do it now + * and store the result in the database + */ + + const result = await exportQuizDesignerSlides({ + snapshotId: "lessonSnapshot.id", + userEmail, + onStateChange: (state) => { + log.info(state); + + Sentry.addBreadcrumb({ + category: "exportWorksheetSlides", + message: "Export state change", + data: state, + }); + }, + quiz: input.data, + }); + + Sentry.addBreadcrumb({ + category: "exportLessonSlides", + message: "Got export result", + data: { result }, + }); + + if ("error" in result) { + reportErrorResult(result, input); + return { + error: result.error, + message: "Failed to export lesson", + }; + } + + const { data } = result; + + await qdSaveExport({ + auth: ctx.auth, + prisma: ctx.prisma, + snapshotId: lessonSnapshot.id, + exportType, + data: result.data, + }); + + const output: OutputSchema = { + link: data.fileUrl, + canViewSourceDoc: data.userCanViewGdriveFile, + }; + return output; +} diff --git a/packages/api/src/export/exportQuizDoc.ts b/packages/api/src/export/exportQuizDoc.ts index e7472ac7b..178194fa0 100644 --- a/packages/api/src/export/exportQuizDoc.ts +++ b/packages/api/src/export/exportQuizDoc.ts @@ -1,6 +1,4 @@ import type { SignedInAuthObject } from "@clerk/backend/internal"; -import { clerkClient } from "@clerk/nextjs/server"; -import { LessonSnapshots } from "@oakai/core"; import type { PrismaClientWithAccelerate } from "@oakai/db"; import { exportDocQuiz } from "@oakai/exports"; import type { QuizDocInputData } from "@oakai/exports/src/schema/input.schema"; @@ -9,11 +7,8 @@ import * as Sentry from "@sentry/nextjs"; import { z } from "zod"; import type { OutputSchema } from "../router/exports"; -import { - ailaGetExportBySnapshotId, - ailaSaveExport, - reportErrorResult, -} from "../router/exports"; +import { ailaSaveExport, reportErrorResult } from "../router/exports"; +import { getExistingExportData, getUserEmail } from "./exportHelpers"; const log = aiLogger("exports"); @@ -36,11 +31,7 @@ export async function exportQuizDoc({ data: QuizDocInputData; }; }) { - const user = await clerkClient.users.getUser(ctx.auth.userId); - const userEmail = user?.emailAddresses[0]?.emailAddress; - const exportType = - input.data.quizType === "exit" ? "EXIT_QUIZ_DOC" : "STARTER_QUIZ_DOC"; - + const userEmail = await getUserEmail(ctx); if (!userEmail) { return { error: new Error("User email not found"), @@ -48,39 +39,17 @@ export async function exportQuizDoc({ }; } - const lessonSnapshots = new LessonSnapshots(ctx.prisma); - const lessonSnapshot = await lessonSnapshots.getOrSaveSnapshot({ - userId: ctx.auth.userId, - chatId: input.chatId, - messageId: input.messageId, - snapshot: input.lessonSnapshot, - trigger: "EXPORT_BY_USER", - }); - - Sentry.addBreadcrumb({ - category: "exportQuizDoc", - message: "Got or saved snapshot", - data: { lessonSnapshot }, - }); + const exportType = + input.data.quizType === "exit" ? "EXIT_QUIZ_DOC" : "STARTER_QUIZ_DOC"; - const exportData = await ailaGetExportBySnapshotId({ - prisma: ctx.prisma, - snapshotId: lessonSnapshot.id, + const { exportData, lessonSnapshot } = await getExistingExportData({ + ctx, + input, exportType, }); - Sentry.addBreadcrumb({ - category: "exportQuizDoc", - message: "Got export data", - data: { exportData }, - }); - if (exportData) { - const output: OutputSchema = { - link: exportData.gdriveFileUrl, - canViewSourceDoc: exportData.userCanViewGdriveFile, - }; - return output; + return exportData; } /** diff --git a/packages/api/src/export/exportWorksheets.ts b/packages/api/src/export/exportWorksheets.ts index 45e9785fa..4ead33d65 100644 --- a/packages/api/src/export/exportWorksheets.ts +++ b/packages/api/src/export/exportWorksheets.ts @@ -1,19 +1,13 @@ import type { SignedInAuthObject } from "@clerk/backend/internal"; -import { clerkClient } from "@clerk/nextjs/server"; -import { LessonSnapshots } from "@oakai/core"; import type { PrismaClientWithAccelerate } from "@oakai/db"; import { exportDocsWorksheet } from "@oakai/exports"; import type { WorksheetSlidesInputData } from "@oakai/exports/src/schema/input.schema"; import { aiLogger } from "@oakai/logger"; import * as Sentry from "@sentry/nextjs"; -import type { - OutputSchema} from "../router/exports"; -import { - ailaGetExportBySnapshotId, - ailaSaveExport, - reportErrorResult, -} from "../router/exports"; +import type { OutputSchema } from "../router/exports"; +import { ailaSaveExport, reportErrorResult } from "../router/exports"; +import { getExistingExportData, getUserEmail } from "./exportHelpers"; const log = aiLogger("exports"); @@ -31,9 +25,7 @@ export async function exportWorksheets({ prisma: PrismaClientWithAccelerate; }; }) { - const user = await clerkClient.users.getUser(ctx.auth.userId); - const userEmail = user?.emailAddresses[0]?.emailAddress; - const exportType = "WORKSHEET_SLIDES"; + const userEmail = await getUserEmail(ctx); if (!userEmail) { return { @@ -41,40 +33,16 @@ export async function exportWorksheets({ message: "User email not found", }; } + const exportType = "WORKSHEET_SLIDES"; - const lessonSnapshots = new LessonSnapshots(ctx.prisma); - const lessonSnapshot = await lessonSnapshots.getOrSaveSnapshot({ - userId: ctx.auth.userId, - chatId: input.chatId, - messageId: input.messageId, - snapshot: input.data, - trigger: "EXPORT_BY_USER", - }); - - Sentry.addBreadcrumb({ - category: "exportWorksheetDocs", - message: "Got or saved snapshot", - data: { lessonSnapshot }, - }); - - const exportData = await ailaGetExportBySnapshotId({ - prisma: ctx.prisma, - snapshotId: lessonSnapshot.id, + const { exportData, lessonSnapshot } = await getExistingExportData({ + ctx, + input, exportType, }); - Sentry.addBreadcrumb({ - category: "exportWorksheetDocs", - message: "Got export data", - data: { exportData }, - }); - if (exportData) { - const output: OutputSchema = { - link: exportData.gdriveFileUrl, - canViewSourceDoc: exportData.userCanViewGdriveFile, - }; - return output; + return exportData; } /** diff --git a/packages/api/src/router/exports.ts b/packages/api/src/router/exports.ts index 24ef6a433..e7eda2240 100644 --- a/packages/api/src/router/exports.ts +++ b/packages/api/src/router/exports.ts @@ -1,6 +1,5 @@ import type { SignedInAuthObject } from "@clerk/backend/internal"; import { clerkClient } from "@clerk/nextjs/server"; -import { LessonSnapshots } from "@oakai/core"; import { sendEmail } from "@oakai/core/src/utils/sendEmail"; import type { PrismaClientWithAccelerate } from "@oakai/db"; import { @@ -8,7 +7,6 @@ import { exportDocQuizSchema, exportSlidesFullLessonSchema, exportDocsWorksheetSchema, - exportQuizDesignerSlides, } from "@oakai/exports"; import { exportableQuizAppStateSchema } from "@oakai/exports/src/schema/input.schema"; import { aiLogger } from "@oakai/logger"; @@ -18,8 +16,10 @@ import { kv } from "@vercel/kv"; import { z } from "zod"; import { exportAdditionalMaterialsDoc } from "../export/exportAdditionalMaterialsDoc"; +import { getExistingExportData } from "../export/exportHelpers"; import { exportLessonPlan } from "../export/exportLessonPlan"; import { exportLessonSlides } from "../export/exportLessonSlides"; +import { exportQuizDesignerSlidesWrapper } from "../export/exportQuizDesignerSlides"; import { exportQuizDoc } from "../export/exportQuizDoc"; import { exportWorksheets } from "../export/exportWorksheets"; import { protectedProcedure } from "../middleware/auth"; @@ -178,10 +178,6 @@ const outputSchema = z.union([ ]); export type OutputSchema = z.infer; -/** - * @todo refactor this router to for less duplication - */ - export const exportsRouter = router({ exportLessonSlides: protectedProcedure .input( @@ -214,28 +210,15 @@ export const exportsRouter = router({ ) .mutation(async ({ input, ctx }) => { try { - const userId = ctx.auth.userId; - const { chatId, data, messageId } = input; - const lessonSnapshots = new LessonSnapshots(ctx.prisma); - const { id: snapshotId } = await lessonSnapshots.getOrSaveSnapshot({ - userId, - chatId, - snapshot: data, - trigger: "EXPORT_BY_USER", - messageId, + const exportType = "LESSON_PLAN_DOC"; + const { exportData } = await getExistingExportData({ + ctx, + input, + exportType, }); - const exportData = await ailaGetExportBySnapshotId({ - prisma: ctx.prisma, - snapshotId, - exportType: "LESSON_PLAN_DOC", - }); if (exportData) { - const output: OutputSchema = { - link: exportData.gdriveFileUrl, - canViewSourceDoc: exportData.userCanViewGdriveFile, - }; - return output; + return exportData; } } catch (error) { log.error("Error checking if download exists:", error); @@ -256,28 +239,16 @@ export const exportsRouter = router({ ) .mutation(async ({ input, ctx }) => { try { - const userId = ctx.auth.userId; - const { chatId, data, messageId } = input; - const lessonSnapshots = new LessonSnapshots(ctx.prisma); - const { id: snapshotId } = await lessonSnapshots.getOrSaveSnapshot({ - userId, - chatId, - snapshot: data, - trigger: "EXPORT_BY_USER", - messageId, - }); // find the latest export for this snapshot - const exportData = await ailaGetExportBySnapshotId({ - prisma: ctx.prisma, - snapshotId, - exportType: "LESSON_SLIDES_SLIDES", + const exportType = "LESSON_SLIDES_SLIDES"; + const { exportData } = await getExistingExportData({ + ctx, + input, + exportType, }); + if (exportData) { - const output: OutputSchema = { - link: exportData.gdriveFileUrl, - canViewSourceDoc: exportData.userCanViewGdriveFile, - }; - return output; + return exportData; } } catch (error) { log.error("Error checking if download exists:", error); @@ -299,106 +270,9 @@ export const exportsRouter = router({ .output(outputSchema) .mutation(async ({ input, ctx }) => { try { - const { userId } = ctx.auth; - const user = await clerkClient.users.getUser(userId); - const userEmail = user?.emailAddresses[0]?.emailAddress; - const exportType = "LESSON_SLIDES_SLIDES"; - - if (!userEmail) { - return { - error: new Error("User email not found"), - message: "User email not found", - }; - } - - const { chatId, messageId, data: snapshot } = input; - - const lessonSnapshots = new LessonSnapshots(ctx.prisma); - const { id: snapshotId } = await lessonSnapshots.getOrSaveSnapshot({ - userId, - chatId, - snapshot, - trigger: "EXPORT_BY_USER", - messageId, - }); - - Sentry.addBreadcrumb({ - category: "exportQuizDesignerSlides", - message: "Got or saved snapshot", - data: { snapshot }, - }); - - const exportData = await qdGetExportBySnapshotId({ - prisma: ctx.prisma, - snapshotId, - exportType, - }); - - Sentry.addBreadcrumb({ - category: "exportQuizDesignerSlides", - message: "Got export data", - data: { exportData }, - }); - - if (exportData) { - const output: OutputSchema = { - link: exportData.gdriveFileUrl, - canViewSourceDoc: exportData.userCanViewGdriveFile, - }; - return output; - } - - /** - * User hasn't yet exported the lesson in this state, so we'll do it now - * and store the result in the database - */ - - const result = await exportQuizDesignerSlides({ - snapshotId: "lessonSnapshot.id", - userEmail, - onStateChange: (state) => { - log.info(state); - - Sentry.addBreadcrumb({ - category: "exportWorksheetSlides", - message: "Export state change", - data: state, - }); - }, - quiz: input.data, - }); - - Sentry.addBreadcrumb({ - category: "exportLessonSlides", - message: "Got export result", - data: { result }, - }); - - if ("error" in result) { - reportErrorResult(result, input); - return { - error: result.error, - message: "Failed to export lesson", - }; - } - - const { data } = result; - - await qdSaveExport({ - auth: ctx.auth, - prisma: ctx.prisma, - snapshotId, - exportType, - data: result.data, - }); - - const output: OutputSchema = { - link: data.fileUrl, - canViewSourceDoc: data.userCanViewGdriveFile, - }; - return output; + return await exportQuizDesignerSlidesWrapper({ input, ctx }); } catch (error) { - const message = "Failed to export lesson"; + const message = "Failed to export quiz designer slides"; reportErrorResult({ error, message }, input); return { error, @@ -420,7 +294,7 @@ export const exportsRouter = router({ try { return await exportAdditionalMaterialsDoc({ input, ctx }); } catch (error) { - const message = "Failed to export lesson"; + const message = "Failed to export additional materials"; reportErrorResult({ error, message }, input); return { error, @@ -438,31 +312,20 @@ export const exportsRouter = router({ ) .mutation(async ({ input, ctx }) => { try { - const userId = ctx.auth.userId; - const { chatId, data: snapshot, messageId } = input; - const lessonSnapshots = new LessonSnapshots(ctx.prisma); - const { id: snapshotId } = await lessonSnapshots.getOrSaveSnapshot({ - userId, - chatId, - snapshot, - trigger: "EXPORT_BY_USER", - messageId, - }); - const exportData = await ailaGetExportBySnapshotId({ - prisma: ctx.prisma, - snapshotId, - exportType: "ADDITIONAL_MATERIALS_DOCS", + const exportType = "ADDITIONAL_MATERIALS_DOCS"; + const { exportData } = await getExistingExportData({ + ctx, + input, + exportType, }); + if (exportData) { - const output: OutputSchema = { - link: exportData.gdriveFileUrl, - canViewSourceDoc: exportData.userCanViewGdriveFile, - }; - return output; + return exportData; } } catch (error) { log.error("Error checking if download exists:", error); - const message = "Failed to check if download exists"; + const message = + "Failed to check if additional materials download exists"; return { error, message, @@ -500,27 +363,15 @@ export const exportsRouter = router({ ) .mutation(async ({ input, ctx }) => { try { - const userId = ctx.auth.userId; - const { chatId, data, messageId } = input; - const lessonSnapshots = new LessonSnapshots(ctx.prisma); - const { id: snapshotId } = await lessonSnapshots.getOrSaveSnapshot({ - userId, - chatId, - snapshot: data, - trigger: "EXPORT_BY_USER", - messageId, - }); - const exportData = await ailaGetExportBySnapshotId({ - prisma: ctx.prisma, - snapshotId, - exportType: "WORKSHEET_SLIDES", + const exportType = "WORKSHEET_SLIDES"; + const { exportData } = await getExistingExportData({ + ctx, + input, + exportType, }); + if (exportData) { - const output: OutputSchema = { - link: exportData.gdriveFileUrl, - canViewSourceDoc: exportData.userCanViewGdriveFile, - }; - return output; + return exportData; } } catch (error) { log.error("Error checking if download exists:", error); @@ -564,30 +415,17 @@ export const exportsRouter = router({ ) .mutation(async ({ input, ctx }) => { try { - const userId = ctx.auth.userId; - const { chatId, data, lessonSnapshot, messageId } = input; - const lessonSnapshots = new LessonSnapshots(ctx.prisma); - const { id: snapshotId } = await lessonSnapshots.getOrSaveSnapshot({ - userId, - chatId, - snapshot: lessonSnapshot, - trigger: "EXPORT_BY_USER", - messageId, - }); const exportType = - data.quizType === "exit" ? "EXIT_QUIZ_DOC" : "STARTER_QUIZ_DOC"; + input.data.quizType === "exit" ? "EXIT_QUIZ_DOC" : "STARTER_QUIZ_DOC"; - const exportData = await ailaGetExportBySnapshotId({ - prisma: ctx.prisma, - snapshotId, + const { exportData } = await getExistingExportData({ + ctx, + input, exportType, }); + if (exportData) { - const output: OutputSchema = { - link: exportData.gdriveFileUrl, - canViewSourceDoc: exportData.userCanViewGdriveFile, - }; - return output; + return exportData; } } catch (error) { log.error("Error checking if download exists:", error); diff --git a/packages/core/src/models/lessonSnapshots.ts b/packages/core/src/models/lessonSnapshots.ts index 330344254..fc5f79074 100644 --- a/packages/core/src/models/lessonSnapshots.ts +++ b/packages/core/src/models/lessonSnapshots.ts @@ -105,7 +105,7 @@ export class LessonSnapshots { messageId: string; snapshot: Snapshot; trigger: LessonSnapshotTrigger; - }) { + }): Promise { /** * Prisma types complained when passing the JSON schema directly to the Prisma */ diff --git a/packages/core/src/types/export-template.ts b/packages/core/src/types/export-template.ts deleted file mode 100644 index 1f20062db..000000000 --- a/packages/core/src/types/export-template.ts +++ /dev/null @@ -1,233 +0,0 @@ -import { z } from "zod"; - -export const proformaTemplateDataSchema = z.object({ - lesson_title: z.string(), - subject: z.string(), - key_stage: z.string(), - topic: z.string().optional(), - learning_outcome: z.string(), - learning_cycle_outcome_1: z.string(), - learning_cycle_outcome_2: z.string().optional(), - learning_cycle_outcome_3: z.string().optional(), - prior_knowledge: z.array(z.string()), - misconception_1: z.string(), - misconception_2: z.string(), - misconception_3: z.string(), - keyword_1: z.string(), - keyword_2: z.string(), - keyword_3: z.string().optional(), - keyword_4: z.string().optional(), - keyword_5: z.string().optional(), - keyword_definition_1: z.string(), - keyword_definition_2: z.string(), - keyword_definition_3: z.string().optional(), - keyword_definition_4: z.string().optional(), - keyword_definition_5: z.string().optional(), - key_learning_point_1: z.string(), - key_learning_point_2: z.string().optional(), - key_learning_point_3: z.string().optional(), - key_learning_point_4: z.string().optional(), - starter_quiz_question_1: z.string(), - starter_quiz_question_1_answer_1: z.string(), - starter_quiz_question_1_answer_2: z.string(), - starter_quiz_question_1_answer_3: z.string(), - starter_quiz_question_2: z.string(), - starter_quiz_question_2_answer_1: z.string(), - starter_quiz_question_2_answer_2: z.string(), - starter_quiz_question_2_answer_3: z.string(), - starter_quiz_question_3: z.string(), - starter_quiz_question_3_answer_1: z.string(), - starter_quiz_question_3_answer_2: z.string(), - starter_quiz_question_3_answer_3: z.string(), - starter_quiz_question_4: z.string(), - starter_quiz_question_4_answer_1: z.string(), - starter_quiz_question_4_answer_2: z.string(), - starter_quiz_question_4_answer_3: z.string(), - starter_quiz_question_5: z.string(), - starter_quiz_question_5_answer_1: z.string(), - starter_quiz_question_5_answer_2: z.string(), - starter_quiz_question_5_answer_3: z.string(), - starter_quiz_question_6: z.string(), - starter_quiz_question_6_answer_1: z.string(), - starter_quiz_question_6_answer_2: z.string(), - starter_quiz_question_6_answer_3: z.string(), - exit_quiz_question_1: z.string(), - exit_quiz_question_1_answer_1: z.string(), - exit_quiz_question_1_answer_2: z.string(), - exit_quiz_question_1_answer_3: z.string(), - exit_quiz_question_2: z.string(), - exit_quiz_question_2_answer_1: z.string(), - exit_quiz_question_2_answer_2: z.string(), - exit_quiz_question_2_answer_3: z.string(), - exit_quiz_question_3: z.string(), - exit_quiz_question_3_answer_1: z.string(), - exit_quiz_question_3_answer_2: z.string(), - exit_quiz_question_3_answer_3: z.string(), - exit_quiz_question_4: z.string(), - exit_quiz_question_4_answer_1: z.string(), - exit_quiz_question_4_answer_2: z.string(), - exit_quiz_question_4_answer_3: z.string(), - exit_quiz_question_5: z.string(), - exit_quiz_question_5_answer_1: z.string(), - exit_quiz_question_5_answer_2: z.string(), - exit_quiz_question_5_answer_3: z.string(), - exit_quiz_question_6: z.string(), - exit_quiz_question_6_answer_1: z.string(), - exit_quiz_question_6_answer_2: z.string(), - exit_quiz_question_6_answer_3: z.string(), - - learning_cycle_1_title: z.string(), - learning_cycle_2_title: z.string(), - learning_cycle_3_title: z.string(), - learning_cycle_1_text: z.string(), - cycle_1_spoken_explanation: z.string(), - cycle_1_check_for_understanding_question_1: z.string(), - cycle_1_check_for_understanding_question_1_answer_1: z.string(), - cycle_1_check_for_understanding_question_1_answer_2: z.string(), - cycle_1_check_for_understanding_question_1_answer_3: z.string(), - - cycle_1_check_for_understanding_question_2: z.string(), - cycle_1_check_for_understanding_question_2_answer_1: z.string(), - cycle_1_check_for_understanding_question_2_answer_2: z.string(), - cycle_1_check_for_understanding_question_2_answer_3: z.string(), - - cycle_1_practice: z.string(), - cycle_1_feedback: z.string(), - - cycle_2_spoken_explanation: z.string(), - cycle_2_check_for_understanding_question_1: z.string(), - cycle_2_check_for_understanding_question_1_answer_1: z.string(), - cycle_2_check_for_understanding_question_1_answer_2: z.string(), - cycle_2_check_for_understanding_question_1_answer_3: z.string(), - - cycle_2_check_for_understanding_question_2: z.string(), - cycle_2_check_for_understanding_question_2_answer_1: z.string(), - cycle_2_check_for_understanding_question_2_answer_2: z.string(), - cycle_2_check_for_understanding_question_2_answer_3: z.string(), - - cycle_2_practice: z.string(), - cycle_2_feedback: z.string(), - - cycle_3_spoken_explanation: z.string(), - cycle_3_check_for_understanding_question_1: z.string(), - cycle_3_check_for_understanding_question_1_answer_1: z.string(), - cycle_3_check_for_understanding_question_1_answer_2: z.string(), - cycle_3_check_for_understanding_question_1_answer_3: z.string(), - - cycle_3_check_for_understanding_question_2: z.string(), - cycle_3_check_for_understanding_question_2_answer_1: z.string(), - cycle_3_check_for_understanding_question_2_answer_2: z.string(), - cycle_3_check_for_understanding_question_2_answer_3: z.string(), - - cycle_3_practice: z.string(), - cycle_3_feedback: z.string(), -}); - -export type ProformaTemplateData = z.infer; - -export const slidesTemplateDataSchema = z.object({ - lesson_title: z.string(), - subject_title: z.string(), - key_stage_title: z.string().nullish(), - topic_title: z.string().nullish(), - learning_outcomes: z.string(), - keywords: z.array(z.string()).nullish(), - keyword_sentences: z.array(z.string()).nullish(), - learning_cycle_1_title: z.string(), - learning_cycle_2_title: z.string().nullish(), - learning_cycle_3_title: z.string().nullish(), - learning_cycle_1_text: z.string(), - learning_cycle_1_image_prompt: z.string(), - - learning_cycle_1_title_long: z.string(), - learning_cycle_2_title_long: z.string().nullish(), - learning_cycle_3_title_long: z.string().nullish(), - - learning_cycle_1_check_question_1_question: z.string(), - learning_cycle_1_question_1_check_answer_1: z.string(), - learning_cycle_1_question_1_check_answer_2: z.string(), - learning_cycle_1_question_1_check_answer_3: z.string(), - learning_cycle_1_check_question_2: z.string(), - learning_cycle_1_question_2_check_answer_1: z.string(), - learning_cycle_1_question_2_check_answer_2: z.string(), - learning_cycle_1_question_2_check_answer_3: z.string(), - - learning_cycle_1_practise: z.string().nullish(), - - learning_cycle_2_text: z.string().nullish(), - learning_cycle_2_image_prompt: z.string().nullish(), - learning_cycle_2_question_1_check_question: z.string().nullish(), - learning_cycle_2_question_1_check_answer_1: z.string().nullish(), - learning_cycle_2_question_1_check_answer_2: z.string().nullish(), - learning_cycle_2_question_1_check_answer_3: z.string().nullish(), - - learning_cycle_2_question_2_check_question: z.string().nullish(), - learning_cycle_2_question_2_check_answer_1: z.string().nullish(), - learning_cycle_2_question_2_check_answer_2: z.string().nullish(), - learning_cycle_2_question_2_check_answer_3: z.string().nullish(), - - learning_cycle_2_practise: z.string().nullish(), - - learning_cycle_3_text: z.string().nullish(), - learning_cycle_3_image_prompt: z.string().nullish(), - - learning_cycle_3_question_1_check_question: z.string().nullish(), - learning_cycle_3_question_1_check_answer_1: z.string().nullish(), - learning_cycle_3_question_1_check_answer_2: z.string().nullish(), - learning_cycle_3_question_1_check_answer_3: z.string().nullish(), - - learning_cycle_3_question_2_check_question: z.string().nullish(), - learning_cycle_3_question_2_check_answer_1: z.string().nullish(), - learning_cycle_3_question_2_check_answer_2: z.string().nullish(), - learning_cycle_3_question_2_check_answer_3: z.string().nullish(), - - learning_cycle_3_practise: z.string().nullish(), -}); - -export const WARN_IF_MISSING = [ - "learning_cycle_2_title", - "learning_cycle_2_text", - "learning_cycle_2_image_prompt", - "learning_cycle_2_question_1_check_question", - "learning_cycle_2_question_1_check_answer_1", - "learning_cycle_2_question_1_check_answer_2", - "learning_cycle_2_question_1_check_answer_3", - "learning_cycle_2_question_2_check_question", - "learning_cycle_2_question_2_check_answer_1", - "learning_cycle_2_question_2_check_answer_2", - "learning_cycle_2_question_2_check_answer_3", - "learning_cycle_2_practise", -]; - -export type SlidesTemplateData = z.infer; - -export const lessonQuizSchema = z.object({ - lesson_title: z.string(), - quiz_type: z.string(), - question_1: z.string().nullish(), - question_1_answer_a: z.string().nullish(), - question_1_answer_b: z.string().nullish(), - question_1_answer_c: z.string().nullish(), - question_2: z.string().nullish(), - question_2_answer_a: z.string().nullish(), - question_2_answer_b: z.string().nullish(), - question_2_answer_c: z.string().nullish(), - question_3: z.string().nullish(), - question_3_answer_a: z.string().nullish(), - question_3_answer_b: z.string().nullish(), - question_3_answer_c: z.string().nullish(), - question_4: z.string().nullish(), - question_4_answer_a: z.string().nullish(), - question_4_answer_b: z.string().nullish(), - question_4_answer_c: z.string().nullish(), - question_5: z.string().nullish(), - question_5_answer_a: z.string().nullish(), - question_5_answer_b: z.string().nullish(), - question_5_answer_c: z.string().nullish(), - question_6: z.string().nullish(), - question_6_answer_a: z.string().nullish(), - question_6_answer_b: z.string().nullish(), - question_6_answer_c: z.string().nullish(), -}); - -export type LessonQuiz = z.infer; diff --git a/packages/db/schemas/lesson.ts b/packages/db/schemas/lesson.ts index 32d5e3843..e8d42fe98 100644 --- a/packages/db/schemas/lesson.ts +++ b/packages/db/schemas/lesson.ts @@ -38,26 +38,7 @@ export const ZLesson = z.object({ programmeOfStudyUnits: z.array( z.object({ id: z.number(), - programme: z.object({ - id: z.number(), - slug: z.string(), - title: z.string(), - subject: z.object({ - id: z.number(), - slug: z.string(), - title: z.string(), - }), - year: z.object({ - id: z.number(), - title: z.string(), - slug: z.string(), - keyStage: z.object({ - id: z.number(), - title: z.string(), - slug: z.string(), - }), - }), - }), + programme: Programme, }), ), therapyUnits: z.array(z.unknown()).nullish(), diff --git a/packages/exports/src/exportAdditionalMaterials.ts b/packages/exports/src/exportAdditionalMaterials.ts index 4f8d3fe32..5ce40ea36 100644 --- a/packages/exports/src/exportAdditionalMaterials.ts +++ b/packages/exports/src/exportAdditionalMaterials.ts @@ -4,7 +4,7 @@ import { prepLessonForAdditionalMaterialsDoc } from "./dataHelpers/prepLessonFor import { exportGeneric } from "./exportGeneric"; import { getDocsClient } from "./gSuite/docs/client"; import { populateDoc } from "./gSuite/docs/populateDoc"; -import type { LessonSlidesInputData } from "./schema/input.schema"; +import type { LessonInputData } from "./schema/input.schema"; import { getSlidesTemplateIdAdditionalMaterials as getDocsTemplateIdAdditionalMaterials } from "./templates"; import type { OutputData, Result, State } from "./types"; @@ -17,7 +17,7 @@ export const exportAdditionalMaterials = async ({ onStateChange, }: { snapshotId: string; - lesson: LessonSlidesInputData; + lesson: LessonInputData; userEmail: string; onStateChange: (state: State) => void; }): Promise> => { diff --git a/packages/exports/src/schema/input.schema.ts b/packages/exports/src/schema/input.schema.ts index 59870b427..19645e7f4 100644 --- a/packages/exports/src/schema/input.schema.ts +++ b/packages/exports/src/schema/input.schema.ts @@ -37,7 +37,7 @@ export const keywordSchema = z.object({ definition: z.string(), }); -export const lessonSlidesInputSchema = z.object({ +export const lessonInputSchema = z.object({ title: z.string(), subject: z.string(), keyStage: z.string().nullish(), @@ -58,6 +58,10 @@ export const lessonSlidesInputSchema = z.object({ _experimental_exitQuizMathsV0: quizSchema.nullish(), }); +export type LessonInputData = z.infer; + +export const lessonSlidesInputSchema = lessonInputSchema; + export type LessonSlidesInputData = z.infer; export const lessonPlanDocInputSchema = lessonSlidesInputSchema; diff --git a/sonar-project.properties b/sonar-project.properties index c082e59ce..5d3c422c8 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -18,9 +18,10 @@ sonar.exclusions=\ sonar.cpd.exclusions=\ **/*.test.ts, \ **/*.fixture.ts, \ + apps/nextjs/jest.config.js \ **/*.json \ **/*.stories.ts \ - **/*.stories.tsx \ + **/*.stories.tsx sonar.tests=. sonar.test.inclusions=**/*.test.ts From 9dee4adb840a0a5d96e43f02349ad04597862539 Mon Sep 17 00:00:00 2001 From: Tom Wise <79859203+tomwisecodes@users.noreply.github.com> Date: Tue, 17 Dec 2024 09:33:26 +0000 Subject: [PATCH 3/4] feat: soft delete (#383) --- apps/nextjs/src/app/actions.ts | 2 +- .../ContentOptions/ClearChatHistory.tsx | 4 +++- .../ClearSingleChatFromChatHistory.tsx | 2 +- .../components/DialogControl/DialogContents.tsx | 4 ++++ .../features/persistence/adaptors/prisma/index.ts | 1 + packages/api/src/router/appSessions.ts | 14 +++++++++++--- packages/api/src/router/chats.ts | 3 ++- packages/core/src/models/apps.ts | 2 ++ .../migration.sql | 3 +++ packages/db/prisma/schema.prisma | 5 +++-- 10 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 packages/db/prisma/migrations/20241126134932_add_deleted_session_col/migration.sql diff --git a/apps/nextjs/src/app/actions.ts b/apps/nextjs/src/app/actions.ts index b0d64870b..b365ff4bc 100644 --- a/apps/nextjs/src/app/actions.ts +++ b/apps/nextjs/src/app/actions.ts @@ -43,7 +43,7 @@ export async function getChatById( id: string, ): Promise { const session = await prisma?.appSession.findUnique({ - where: { id }, + where: { id, deletedAt: null }, }); if (!session) { diff --git a/apps/nextjs/src/components/DialogControl/ContentOptions/ClearChatHistory.tsx b/apps/nextjs/src/components/DialogControl/ContentOptions/ClearChatHistory.tsx index 07e9ed1ca..bcdb28aa8 100644 --- a/apps/nextjs/src/components/DialogControl/ContentOptions/ClearChatHistory.tsx +++ b/apps/nextjs/src/components/DialogControl/ContentOptions/ClearChatHistory.tsx @@ -61,7 +61,9 @@ const ClearChatHistory = ({ $justifyContent="center" $gap="space-between-m" > - This will permanently delete all of your lesson history. + + This will permanently delete all of your lesson history. + - This will permanently delete this lesson. + This will permanently delete this lesson. {isLoading ? ( diff --git a/apps/nextjs/src/components/DialogControl/DialogContents.tsx b/apps/nextjs/src/components/DialogControl/DialogContents.tsx index 7187dc4e6..ed297f230 100644 --- a/apps/nextjs/src/components/DialogControl/DialogContents.tsx +++ b/apps/nextjs/src/components/DialogControl/DialogContents.tsx @@ -1,5 +1,8 @@ +import { useState } from "react"; + import type { LooseLessonPlan } from "@oakai/aila/src/protocol/schema"; import { + OakModal, OakModalCenter, OakModalCenterBody, type OakIconName, @@ -8,6 +11,7 @@ import type { Message } from "ai"; import styled from "styled-components"; import type { DialogTypes } from "../AppComponents/Chat/Chat/types"; +import { ChatHistory } from "../AppComponents/Chat/chat-history"; import { useDialog } from "../AppComponents/DialogContext"; import ClearChatHistory from "./ContentOptions/ClearChatHistory"; import ClearSingleChatFromChatHistory from "./ContentOptions/ClearSingleChatFromChatHistory"; diff --git a/packages/aila/src/features/persistence/adaptors/prisma/index.ts b/packages/aila/src/features/persistence/adaptors/prisma/index.ts index 28b2923e3..198930700 100644 --- a/packages/aila/src/features/persistence/adaptors/prisma/index.ts +++ b/packages/aila/src/features/persistence/adaptors/prisma/index.ts @@ -39,6 +39,7 @@ export class AilaPrismaPersistence extends AilaPersistence { const appSession = await this._prisma.appSession.findFirst({ where: { id, + deletedAt: null, }, }); diff --git a/packages/api/src/router/appSessions.ts b/packages/api/src/router/appSessions.ts index 7375e1420..29f9042a6 100644 --- a/packages/api/src/router/appSessions.ts +++ b/packages/api/src/router/appSessions.ts @@ -79,6 +79,7 @@ export async function getChat(id: string, prisma: PrismaClientWithAccelerate) { const chatRecord = await prisma.appSession.findUnique({ where: { id: id, + deletedAt: null, }, }); if (!chatRecord) { @@ -205,6 +206,7 @@ export const appSessionsRouter = router({ "app_sessions" WHERE "user_id" = ${userId} AND "app_id" = 'lesson-planner' + AND "deleted_at" IS NULL ORDER BY "updated_at" DESC `; @@ -245,22 +247,27 @@ export const appSessionsRouter = router({ const { userId } = ctx.auth; const { id } = input; - await ctx.prisma.appSession.deleteMany({ + await ctx.prisma.appSession.update({ where: { id, appId: "lesson-planner", userId, }, + data: { + deletedAt: new Date(), + }, }); }), deleteAllChats: protectedProcedure.mutation(async ({ ctx }) => { const { userId } = ctx.auth; - - await ctx.prisma.appSession.deleteMany({ + await ctx.prisma.appSession.updateMany({ where: { userId, appId: "lesson-planner", }, + data: { + deletedAt: new Date(), + }, }); }), shareChat: protectedProcedure @@ -278,6 +285,7 @@ export const appSessionsRouter = router({ id, userId, appId: "lesson-planner", + deletedAt: null, }, }); diff --git a/packages/api/src/router/chats.ts b/packages/api/src/router/chats.ts index 403dc29fb..c63158839 100644 --- a/packages/api/src/router/chats.ts +++ b/packages/api/src/router/chats.ts @@ -45,7 +45,7 @@ export const chatsRouter = router({ const { id } = input; const session = await prisma?.appSession.findUnique({ - where: { id }, + where: { id, deletedAt: null }, }); if (!session) { @@ -72,6 +72,7 @@ export const chatsRouter = router({ where: { userId, appId: "lesson-planner", + deletedAt: null, }, }); diff --git a/packages/core/src/models/apps.ts b/packages/core/src/models/apps.ts index 4c9b6563a..59ba0007d 100644 --- a/packages/core/src/models/apps.ts +++ b/packages/core/src/models/apps.ts @@ -46,6 +46,7 @@ export class Apps { where: { id: sessionId, userId: userId, + deletedAt: null, output: { not: Prisma.AnyNull, }, @@ -59,6 +60,7 @@ export class Apps { return this.prisma.appSession.findMany({ where: { userId: userId, + deletedAt: null, output: { not: Prisma.AnyNull, }, diff --git a/packages/db/prisma/migrations/20241126134932_add_deleted_session_col/migration.sql b/packages/db/prisma/migrations/20241126134932_add_deleted_session_col/migration.sql new file mode 100644 index 000000000..b9e9d9f95 --- /dev/null +++ b/packages/db/prisma/migrations/20241126134932_add_deleted_session_col/migration.sql @@ -0,0 +1,3 @@ + +-- AlterTable +ALTER TABLE "public"."app_sessions" ADD COLUMN "deleted_at" TIMESTAMP(3); diff --git a/packages/db/prisma/schema.prisma b/packages/db/prisma/schema.prisma index 4cabd577c..a6f727de3 100644 --- a/packages/db/prisma/schema.prisma +++ b/packages/db/prisma/schema.prisma @@ -344,14 +344,15 @@ model AppSession { id String @id @default(cuid()) createdAt DateTime @default(now()) @map("created_at") updatedAt DateTime @updatedAt @map("updated_at") - + deletedAt DateTime? @map("deleted_at") + app App @relation(fields: [appId], references: [id], onDelete: Cascade) appId String @map("app_id") userId String @map("user_id") // The user that requested this generation output Json? // The final output of the session - + userTweaks UserTweak[] reGenerations ReGeneration[] generationUserFlags GenerationUserFlag[] From 36a533dbeabfdbb0b51e5b3798c65746fd114783 Mon Sep 17 00:00:00 2001 From: Adam Howard <91115+codeincontext@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:41:15 +0100 Subject: [PATCH 4/4] test: use tighter "satisfies" typing in storybook (#456) --- apps/nextjs/.storybook/preview.tsx | 12 +++++++++++- .../aila/[id]/download/DownloadView.stories.tsx | 6 +++--- .../src/app/aila/[id]/share/index.stories.tsx | 6 +++--- apps/nextjs/src/app/aila/help/index.stories.tsx | 6 +++--- apps/nextjs/src/app/faqs/index.stories.tsx | 6 +++--- apps/nextjs/src/app/home-page.stories.tsx | 6 +++--- apps/nextjs/src/app/legal/[slug]/legal.stories.tsx | 6 +++--- .../account-locked/account-locked.stories.tsx | 6 +++--- apps/nextjs/src/app/prompts/prompts.stories.tsx | 6 +++--- .../Chat/Chat/ChatModerationDisplay.stories.tsx | 6 +++--- .../AppComponents/Chat/chat-history.stories.tsx | 6 +++--- .../Chat/chat-lessonPlanDisplay.stories.tsx | 9 ++++++--- .../AppComponents/Chat/chat-lhs-header.stories.tsx | 14 ++++++++------ .../Chat/chat-list/demo-limit-message.stories.tsx | 9 ++++++--- .../chat-list/in-chat-download-buttons.stories.tsx | 6 +++--- .../Chat/chat-message/ChatMessagePart.stories.tsx | 6 +++--- .../Chat/chat-message/ChatMessagePart.tsx | 3 --- .../Chat/chat-message/index.stories.tsx | 8 +++++--- .../AppComponents/Chat/chat-message/index.tsx | 6 +----- .../AppComponents/Chat/chat-panel.stories.tsx | 6 +++--- .../Chat/chat-quick-buttons.stories.tsx | 6 +++--- .../AppComponents/Chat/chat-start-form.stories.tsx | 6 +++--- .../AppComponents/Chat/chat-start.stories.tsx | 6 +++--- .../AppComponents/Chat/clear-history.stories.tsx | 6 +++--- .../Chat/drop-down-section/index.stories.tsx | 9 ++++++--- .../LessonPlanProgressDropdown.stories.tsx | 8 +++++--- .../export-buttons/MobileExportButtons.stories.tsx | 8 ++++---- .../Chat/export-buttons/index.stories.tsx | 2 +- .../Chat/guidance-required.stories.tsx | 6 +++--- .../AppComponents/Chat/header.stories.tsx | 6 +++--- .../AppComponents/Chat/sidebar-actions.stories.tsx | 6 +++--- .../DialogControl/DialogContents.stories.tsx | 12 +++++++----- apps/nextjs/src/components/Footer.stories.tsx | 6 +++--- apps/nextjs/src/components/Header.stories.tsx | 11 ++++++++--- .../Onboarding/AcceptTermsForm.stories.tsx | 6 +++--- .../Onboarding/LegacyUpgradeNotice.stories.tsx | 6 +++--- .../components/Onboarding/TermsContent.stories.tsx | 6 +++--- .../src/components/SignUpSignInLayout.stories.tsx | 11 +++++++---- 38 files changed, 147 insertions(+), 119 deletions(-) diff --git a/apps/nextjs/.storybook/preview.tsx b/apps/nextjs/.storybook/preview.tsx index 59f9ee53d..0f552f1be 100644 --- a/apps/nextjs/.storybook/preview.tsx +++ b/apps/nextjs/.storybook/preview.tsx @@ -8,7 +8,11 @@ import "@fontsource/lexend/800.css"; import "@fontsource/lexend/900.css"; import { OakThemeProvider, oakDefaultTheme } from "@oaknational/oak-components"; import type { Preview, Decorator } from "@storybook/react"; -import { initialize as initializeMsw, mswLoader } from "msw-storybook-addon"; +import { + initialize as initializeMsw, + mswLoader, + MswParameters, +} from "msw-storybook-addon"; import { TooltipProvider } from "../src/components/AppComponents/Chat/ui/tooltip"; import { DialogProvider } from "../src/components/AppComponents/DialogContext"; @@ -19,6 +23,12 @@ import { chromaticParams } from "./chromatic"; import { RadixThemeDecorator } from "./decorators/RadixThemeDecorator"; import "./preview.css"; +declare module "@storybook/csf" { + interface Parameters { + msw?: MswParameters["msw"]; + } +} + initializeMsw(); const preview: Preview = { diff --git a/apps/nextjs/src/app/aila/[id]/download/DownloadView.stories.tsx b/apps/nextjs/src/app/aila/[id]/download/DownloadView.stories.tsx index 164aaa6e6..f61acc667 100644 --- a/apps/nextjs/src/app/aila/[id]/download/DownloadView.stories.tsx +++ b/apps/nextjs/src/app/aila/[id]/download/DownloadView.stories.tsx @@ -6,7 +6,7 @@ import { chromaticParams } from "@/storybook/chromatic"; import { DemoProvider } from "../../../../../src/components/ContextProviders/Demo"; import { DownloadContent } from "./DownloadView"; -const meta: Meta = { +const meta = { title: "Pages/Chat/Download", component: DownloadContent, parameters: { @@ -20,10 +20,10 @@ const meta: Meta = { ), ], -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; const chat: AilaPersistedChat = { id: "nSLmbQ1LO75zLTcA", diff --git a/apps/nextjs/src/app/aila/[id]/share/index.stories.tsx b/apps/nextjs/src/app/aila/[id]/share/index.stories.tsx index 2136dbd62..4c4ba5945 100644 --- a/apps/nextjs/src/app/aila/[id]/share/index.stories.tsx +++ b/apps/nextjs/src/app/aila/[id]/share/index.stories.tsx @@ -5,17 +5,17 @@ import { chromaticParams } from "@/storybook/chromatic"; import ShareChat from "./"; -const meta: Meta = { +const meta = { title: "Pages/Chat/Share", component: ShareChat, parameters: { layout: "fullscreen", ...chromaticParams(["mobile", "desktop"]), }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; const lessonPlan: LooseLessonPlan = { title: "The End of Roman Britain", diff --git a/apps/nextjs/src/app/aila/help/index.stories.tsx b/apps/nextjs/src/app/aila/help/index.stories.tsx index 2fabd3d90..20695aa7b 100644 --- a/apps/nextjs/src/app/aila/help/index.stories.tsx +++ b/apps/nextjs/src/app/aila/help/index.stories.tsx @@ -5,7 +5,7 @@ import { chromaticParams } from "@/storybook/chromatic"; import { HelpContent } from "."; -const meta: Meta = { +const meta = { title: "Pages/Chat/Help", component: HelpContent, parameters: { @@ -20,10 +20,10 @@ const meta: Meta = { ), ], -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: {}, diff --git a/apps/nextjs/src/app/faqs/index.stories.tsx b/apps/nextjs/src/app/faqs/index.stories.tsx index 35b3504b9..937727546 100644 --- a/apps/nextjs/src/app/faqs/index.stories.tsx +++ b/apps/nextjs/src/app/faqs/index.stories.tsx @@ -4,16 +4,16 @@ import { chromaticParams } from "@/storybook/chromatic"; import { FAQPageContent } from "."; -const meta: Meta = { +const meta = { title: "Pages/FAQs", component: FAQPageContent, parameters: { ...chromaticParams(["mobile", "desktop"]), }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: {}, diff --git a/apps/nextjs/src/app/home-page.stories.tsx b/apps/nextjs/src/app/home-page.stories.tsx index 3e370c474..f4db6a63e 100644 --- a/apps/nextjs/src/app/home-page.stories.tsx +++ b/apps/nextjs/src/app/home-page.stories.tsx @@ -4,16 +4,16 @@ import { chromaticParams } from "@/storybook/chromatic"; import { HomePageContent } from "./home-page"; -const meta: Meta = { +const meta = { title: "Pages/Homepage", component: HomePageContent, parameters: { ...chromaticParams(["mobile", "desktop"]), }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: { diff --git a/apps/nextjs/src/app/legal/[slug]/legal.stories.tsx b/apps/nextjs/src/app/legal/[slug]/legal.stories.tsx index 928cfee17..087a95fcf 100644 --- a/apps/nextjs/src/app/legal/[slug]/legal.stories.tsx +++ b/apps/nextjs/src/app/legal/[slug]/legal.stories.tsx @@ -4,16 +4,16 @@ import { chromaticParams } from "@/storybook/chromatic"; import { LegalContent } from "./legal"; -const meta: Meta = { +const meta = { title: "Pages/Legal/Sanity dynamic", component: LegalContent, parameters: { ...chromaticParams(["mobile", "desktop"]), }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; const fixture = { pageData: { diff --git a/apps/nextjs/src/app/legal/account-locked/account-locked.stories.tsx b/apps/nextjs/src/app/legal/account-locked/account-locked.stories.tsx index 3376e8996..d3802b627 100644 --- a/apps/nextjs/src/app/legal/account-locked/account-locked.stories.tsx +++ b/apps/nextjs/src/app/legal/account-locked/account-locked.stories.tsx @@ -4,16 +4,16 @@ import { chromaticParams } from "@/storybook/chromatic"; import { AccountLocked } from "./account-locked"; -const meta: Meta = { +const meta = { title: "Pages/Legal/Account Locked", component: AccountLocked, parameters: { ...chromaticParams(["mobile", "desktop"]), }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: {}, diff --git a/apps/nextjs/src/app/prompts/prompts.stories.tsx b/apps/nextjs/src/app/prompts/prompts.stories.tsx index 97b18aea5..9fdb74c13 100644 --- a/apps/nextjs/src/app/prompts/prompts.stories.tsx +++ b/apps/nextjs/src/app/prompts/prompts.stories.tsx @@ -4,16 +4,16 @@ import { chromaticParams } from "@/storybook/chromatic"; import { PromptsContent } from "./prompts"; -const meta: Meta = { +const meta = { title: "Pages/Prompts", component: PromptsContent, parameters: { ...chromaticParams(["mobile", "desktop"]), }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; const fixture = { apps: [ diff --git a/apps/nextjs/src/components/AppComponents/Chat/Chat/ChatModerationDisplay.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/Chat/ChatModerationDisplay.stories.tsx index ec9bcd8d9..93fb1b5b8 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/Chat/ChatModerationDisplay.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/Chat/ChatModerationDisplay.stories.tsx @@ -3,7 +3,7 @@ import type { Meta, StoryObj } from "@storybook/react"; import { ChatModerationDisplay } from "./ChatModerationDisplay"; -const meta: Meta = { +const meta = { title: "Components/Dialogs/ChatModerationDisplay", component: ChatModerationDisplay, tags: ["autodocs"], @@ -14,10 +14,10 @@ const meta: Meta = { ), ], -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; const toxicModeration: PersistedModerationBase = { id: "mock-moderation-id", diff --git a/apps/nextjs/src/components/AppComponents/Chat/chat-history.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/chat-history.stories.tsx index d5ccab452..58ae81767 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/chat-history.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/chat-history.stories.tsx @@ -3,7 +3,7 @@ import type { Meta, StoryObj } from "@storybook/react"; import { ChatHistory } from "./chat-history"; -const meta: Meta = { +const meta = { title: "Components/Sidebar/ChatHistory", component: ChatHistory, parameters: { @@ -17,10 +17,10 @@ const meta: Meta = { ), ], -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: {}, diff --git a/apps/nextjs/src/components/AppComponents/Chat/chat-lessonPlanDisplay.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/chat-lessonPlanDisplay.stories.tsx index bb02e9628..7cff21bc8 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/chat-lessonPlanDisplay.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/chat-lessonPlanDisplay.stories.tsx @@ -21,19 +21,22 @@ const chatContext: Partial = { ailaStreamingStatus: "Idle", }; -const meta: Meta = { +const meta = { title: "Components/LessonPlan/LessonPlanDisplay", component: LessonPlanDisplay, tags: ["autodocs"], decorators: [ChatDecorator], args: { documentContainerRef: { current: null }, + chatEndRef: undefined, + sectionRefs: {}, + showLessonMobile: false, }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: {}, diff --git a/apps/nextjs/src/components/AppComponents/Chat/chat-lhs-header.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/chat-lhs-header.stories.tsx index e4e63c3f9..d18674a0b 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/chat-lhs-header.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/chat-lhs-header.stories.tsx @@ -1,30 +1,32 @@ import type { Meta, StoryObj } from "@storybook/react"; +import { fn } from "@storybook/test"; import { ChatDecorator } from "@/storybook/decorators/ChatDecorator"; import ChatLhsHeader from "./chat-lhs-header"; -const meta: Meta = { +const meta = { title: "Components/Chat/ChatLhsHeader", component: ChatLhsHeader, tags: ["autodocs"], decorators: [ChatDecorator], args: { showStreamingStatus: false, + setShowLessonMobile: fn(), + showLessonMobile: false, + isDemoUser: false, }, parameters: { chatContext: { ailaStreamingStatus: "Idle", }, }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; -export const Default: Story = { - args: {}, -}; +export const Default: Story = {}; export const NonProdStreamingStatus: Story = { args: { diff --git a/apps/nextjs/src/components/AppComponents/Chat/chat-list/demo-limit-message.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/chat-list/demo-limit-message.stories.tsx index 135fef708..626d41a72 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/chat-list/demo-limit-message.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/chat-list/demo-limit-message.stories.tsx @@ -4,7 +4,7 @@ import { ChatModerationProvider } from "@/components/ContextProviders/ChatModera import { DemoLimitMessage } from "./demo-limit-message"; -const meta: Meta = { +const meta = { title: "Components/Chat/DemoLimitMessage", component: DemoLimitMessage, tags: ["autodocs"], @@ -15,10 +15,13 @@ const meta: Meta = { ), ], -}; + args: { + id: "test-chat-id", + }, +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: {}, diff --git a/apps/nextjs/src/components/AppComponents/Chat/chat-list/in-chat-download-buttons.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/chat-list/in-chat-download-buttons.stories.tsx index 179e99445..0a3a91d47 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/chat-list/in-chat-download-buttons.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/chat-list/in-chat-download-buttons.stories.tsx @@ -7,7 +7,7 @@ import { import { InChatDownloadButtons } from "./in-chat-download-buttons"; -const meta: Meta = { +const meta = { title: "Components/Chat/InChatDownloadButtons", component: InChatDownloadButtons, tags: ["autodocs"], @@ -18,10 +18,10 @@ const meta: Meta = { parameters: { ...demoParams({ isDemoUser: true }), }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = {}; diff --git a/apps/nextjs/src/components/AppComponents/Chat/chat-message/ChatMessagePart.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/chat-message/ChatMessagePart.stories.tsx index 1895e0b16..a0bfcc600 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/chat-message/ChatMessagePart.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/chat-message/ChatMessagePart.stories.tsx @@ -3,17 +3,17 @@ import type { Meta, StoryObj } from "@storybook/react"; import { ChatMessagePart } from "./ChatMessagePart"; -const meta: Meta = { +const meta = { title: "Components/Chat/ChatMessagePart", component: ChatMessagePart, tags: ["autodocs"], args: { inspect: false, }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; const basePart: Omit = { type: "message-part", diff --git a/apps/nextjs/src/components/AppComponents/Chat/chat-message/ChatMessagePart.tsx b/apps/nextjs/src/components/AppComponents/Chat/chat-message/ChatMessagePart.tsx index 0d944e59e..1876d9e4b 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/chat-message/ChatMessagePart.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/chat-message/ChatMessagePart.tsx @@ -8,8 +8,6 @@ import { aiLogger } from "@oakai/logger"; import { MemoizedReactMarkdownWithStyles } from "@/components/AppComponents/Chat/markdown"; -import type { ModerationModalHelpers } from "../../FeedbackForms/ModerationFeedbackModal"; - const log = aiLogger("chat"); const components = { @@ -34,7 +32,6 @@ const components = { export interface ChatMessagePartProps { part: MessagePart; inspect: boolean; - moderationModalHelpers: ModerationModalHelpers; } export function ChatMessagePart({ diff --git a/apps/nextjs/src/components/AppComponents/Chat/chat-message/index.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/chat-message/index.stories.tsx index 1b318e488..e2901608f 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/chat-message/index.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/chat-message/index.stories.tsx @@ -4,7 +4,7 @@ import { ChatModerationProvider } from "@/components/ContextProviders/ChatModera import { ChatMessage } from "./"; -const meta: Meta = { +const meta = { title: "Components/Chat/ChatMessage", component: ChatMessage, tags: ["autodocs"], @@ -16,12 +16,14 @@ const meta: Meta = { ), ], args: { + chatId: "test-chat-id", persistedModerations: [], + ailaStreamingStatus: "Idle", }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const UserMessage: Story = { args: { diff --git a/apps/nextjs/src/components/AppComponents/Chat/chat-message/index.tsx b/apps/nextjs/src/components/AppComponents/Chat/chat-message/index.tsx index 4685bc77e..9ad0c1644 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/chat-message/index.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/chat-message/index.tsx @@ -131,11 +131,7 @@ export function ChatMessage({ messageParts.map((part) => { return (
- +
); })} diff --git a/apps/nextjs/src/components/AppComponents/Chat/chat-panel.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/chat-panel.stories.tsx index 989c13892..384b1f794 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/chat-panel.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/chat-panel.stories.tsx @@ -13,7 +13,7 @@ const DummyMessage: Message = { role: "user", }; -const meta: Meta = { +const meta = { title: "Components/Chat/ChatPanel", component: ChatPanel, tags: ["autodocs"], @@ -26,10 +26,10 @@ const meta: Meta = { messages: [DummyMessage], }, }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const NoMessages: Story = { args: {}, diff --git a/apps/nextjs/src/components/AppComponents/Chat/chat-quick-buttons.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/chat-quick-buttons.stories.tsx index 9ec91fd30..05adefe11 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/chat-quick-buttons.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/chat-quick-buttons.stories.tsx @@ -12,7 +12,7 @@ const DummyMessage: Message = { role: "user", }; -const meta: Meta = { +const meta = { title: "Components/Chat/ChatQuickButtons", component: ChatQuickButtons, tags: ["autodocs"], @@ -22,10 +22,10 @@ const meta: Meta = { messages: [DummyMessage], }, }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Idle: Story = { args: {}, diff --git a/apps/nextjs/src/components/AppComponents/Chat/chat-start-form.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/chat-start-form.stories.tsx index 8ca82763a..22f08d579 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/chat-start-form.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/chat-start-form.stories.tsx @@ -2,14 +2,14 @@ import type { Meta, StoryObj } from "@storybook/react"; import { ChatStartForm } from "./chat-start-form"; -const meta: Meta = { +const meta = { title: "Components/Chat Start/ChatStartForm", component: ChatStartForm, tags: ["autodocs"], -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: { diff --git a/apps/nextjs/src/components/AppComponents/Chat/chat-start.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/chat-start.stories.tsx index cb44eea25..45f1c3ecc 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/chat-start.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/chat-start.stories.tsx @@ -6,7 +6,7 @@ import { chromaticParams } from "@/storybook/chromatic"; import { DialogProvider } from "../DialogContext"; import { ChatStart } from "./chat-start"; -const meta: Meta = { +const meta = { title: "Pages/Chat/Chat Start", component: ChatStart, parameters: { @@ -23,10 +23,10 @@ const meta: Meta = { ), ], -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: {}, diff --git a/apps/nextjs/src/components/AppComponents/Chat/clear-history.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/clear-history.stories.tsx index 084254fb1..de0d65c04 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/clear-history.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/clear-history.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react"; import { ClearHistory } from "./clear-history"; -const meta: Meta = { +const meta = { title: "Components/Sidebar/ClearHistory", component: ClearHistory, tags: ["autodocs"], @@ -14,10 +14,10 @@ const meta: Meta = { return ; }, ], -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: { diff --git a/apps/nextjs/src/components/AppComponents/Chat/drop-down-section/index.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/drop-down-section/index.stories.tsx index d425661e9..322496291 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/drop-down-section/index.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/drop-down-section/index.stories.tsx @@ -9,7 +9,7 @@ const MAX_INT32 = 2 ** 31 - 1; const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); -const meta: Meta = { +const meta = { title: "Components/LessonPlan/DropDownSection", component: DropDownSection, tags: ["autodocs"], @@ -19,6 +19,9 @@ const meta: Meta = { "I can explain the reasons why frogs are so important to British society and culture", documentContainerRef: { current: null }, streamingTimeout: 0, + userHasCancelledAutoScroll: false, + sectionRefs: {}, + showLessonMobile: false, }, decorators: [ChatDecorator], parameters: { @@ -38,10 +41,10 @@ const meta: Meta = { ailaStreamingStatus: "Idle", }, }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: {}, diff --git a/apps/nextjs/src/components/AppComponents/Chat/export-buttons/LessonPlanProgressDropdown.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/export-buttons/LessonPlanProgressDropdown.stories.tsx index db7a114f5..a9cf19bff 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/export-buttons/LessonPlanProgressDropdown.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/export-buttons/LessonPlanProgressDropdown.stories.tsx @@ -8,17 +8,18 @@ import type { Meta, StoryObj } from "@storybook/react"; import { LessonPlanProgressDropdown } from "./LessonPlanProgressDropdown"; -const meta: Meta = { +const meta = { title: "Components/LessonPlan/LessonPlanProgressDropdown", component: LessonPlanProgressDropdown, tags: ["autodocs"], -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: { + isStreaming: false, lessonPlan: { // 1 (lesson details) title: "Introduction to Glaciation", @@ -49,6 +50,7 @@ export const Default: Story = { export const PartiallyCompleted: Story = { args: { ...Default.args, + isStreaming: true, lessonPlan: { // 1 (lesson details) title: "Introduction to Glaciation", diff --git a/apps/nextjs/src/components/AppComponents/Chat/export-buttons/MobileExportButtons.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/export-buttons/MobileExportButtons.stories.tsx index 542377fe5..42d1045d5 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/export-buttons/MobileExportButtons.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/export-buttons/MobileExportButtons.stories.tsx @@ -9,14 +9,14 @@ import { import { MobileExportButtons } from "./MobileExportButtons"; -const meta: Meta = { +const meta = { title: "Components/LessonPlan/MobileExportButtons", component: MobileExportButtons, tags: ["autodocs"], decorators: [ChatDecorator, DemoDecorator], parameters: { viewport: { - defaultViewport: "mobile1", + defaultViewport: "mobile", }, ...chromaticParams(["mobile"]), ...demoParams({ isDemoUser: false }), @@ -27,10 +27,10 @@ const meta: Meta = { args: { closeMobileLessonPullOut: () => {}, }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = {}; diff --git a/apps/nextjs/src/components/AppComponents/Chat/export-buttons/index.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/export-buttons/index.stories.tsx index 60000c652..fc59a9a17 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/export-buttons/index.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/export-buttons/index.stories.tsx @@ -28,7 +28,7 @@ const meta: Meta = { }; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = {}; diff --git a/apps/nextjs/src/components/AppComponents/Chat/guidance-required.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/guidance-required.stories.tsx index bae1cc2e9..e6df42f91 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/guidance-required.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/guidance-required.stories.tsx @@ -3,14 +3,14 @@ import type { Meta, StoryObj } from "@storybook/react"; import { GuidanceRequired } from "./guidance-required"; -const meta: Meta = { +const meta = { title: "Components/Chat/GuidanceRequired", component: GuidanceRequired, tags: ["autodocs"], -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; const mockModeration: PersistedModerationBase = { id: "moderated", diff --git a/apps/nextjs/src/components/AppComponents/Chat/header.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/header.stories.tsx index c92263948..7e39d249b 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/header.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/header.stories.tsx @@ -8,7 +8,7 @@ import { import { Header } from "./header"; -const meta: Meta = { +const meta = { title: "Components/Layout/ChatHeader", component: Header, tags: ["autodocs"], @@ -22,10 +22,10 @@ const meta: Meta = { }, ...demoParams({ isDemoUser: false }), }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: {}, diff --git a/apps/nextjs/src/components/AppComponents/Chat/sidebar-actions.stories.tsx b/apps/nextjs/src/components/AppComponents/Chat/sidebar-actions.stories.tsx index b970589d9..772bee5bd 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/sidebar-actions.stories.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/sidebar-actions.stories.tsx @@ -3,17 +3,17 @@ import { within } from "@storybook/test"; import { SidebarActions } from "./sidebar-actions"; -const meta: Meta = { +const meta = { title: "Components/Sidebar/Actions", component: SidebarActions, parameters: { layout: "centered", }, tags: ["autodocs"], -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; const mockChat = { id: "1", diff --git a/apps/nextjs/src/components/DialogControl/DialogContents.stories.tsx b/apps/nextjs/src/components/DialogControl/DialogContents.stories.tsx index a9b212545..b519c01e1 100644 --- a/apps/nextjs/src/components/DialogControl/DialogContents.stories.tsx +++ b/apps/nextjs/src/components/DialogControl/DialogContents.stories.tsx @@ -10,19 +10,21 @@ import { DialogContentDecorator } from "@/storybook/decorators/DialogContentDeco import { DemoProvider } from "../ContextProviders/Demo"; import DialogContents from "./DialogContents"; -const meta: Meta = { +const meta = { title: "Components/Dialogs/DialogContents", component: DialogContents, decorators: [DialogContentDecorator], -}; + args: { + lesson: {}, + chatId: "example-chat-id", + }, +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const ShareChat: Story = { args: { - lesson: {}, - chatId: "example-chat-id", isShared: false, }, parameters: { diff --git a/apps/nextjs/src/components/Footer.stories.tsx b/apps/nextjs/src/components/Footer.stories.tsx index 1725794e8..688fc02b0 100644 --- a/apps/nextjs/src/components/Footer.stories.tsx +++ b/apps/nextjs/src/components/Footer.stories.tsx @@ -2,15 +2,15 @@ import type { Meta, StoryObj } from "@storybook/react"; import Footer from "./Footer"; -const meta: Meta = { +const meta = { title: "Components/Layout/Footer", component: Footer, tags: ["autodocs"], -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: {}, diff --git a/apps/nextjs/src/components/Header.stories.tsx b/apps/nextjs/src/components/Header.stories.tsx index 6b914c5c9..300f608c9 100644 --- a/apps/nextjs/src/components/Header.stories.tsx +++ b/apps/nextjs/src/components/Header.stories.tsx @@ -1,8 +1,9 @@ import type { Meta, StoryObj } from "@storybook/react"; +import { fn } from "@storybook/test"; import Header from "./Header"; -const meta: Meta = { +const meta = { title: "Components/Layout/Header", component: Header, tags: ["autodocs"], @@ -14,11 +15,15 @@ const meta: Meta = { }, }, }, -}; + args: { + menuOpen: false, + setMenuOpen: fn(), + }, +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const SignedIn: Story = { args: {}, diff --git a/apps/nextjs/src/components/Onboarding/AcceptTermsForm.stories.tsx b/apps/nextjs/src/components/Onboarding/AcceptTermsForm.stories.tsx index efc0e2527..bd2ba269b 100644 --- a/apps/nextjs/src/components/Onboarding/AcceptTermsForm.stories.tsx +++ b/apps/nextjs/src/components/Onboarding/AcceptTermsForm.stories.tsx @@ -4,16 +4,16 @@ import { chromaticParams } from "@/storybook/chromatic"; import { AcceptTermsForm } from "./AcceptTermsForm"; -const meta: Meta = { +const meta = { title: "Pages/Onboarding/AcceptTermsForm", component: AcceptTermsForm, parameters: { ...chromaticParams(["mobile", "desktop"]), }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: {}, diff --git a/apps/nextjs/src/components/Onboarding/LegacyUpgradeNotice.stories.tsx b/apps/nextjs/src/components/Onboarding/LegacyUpgradeNotice.stories.tsx index b2e2fccf9..11d53aad7 100644 --- a/apps/nextjs/src/components/Onboarding/LegacyUpgradeNotice.stories.tsx +++ b/apps/nextjs/src/components/Onboarding/LegacyUpgradeNotice.stories.tsx @@ -4,16 +4,16 @@ import { chromaticParams } from "@/storybook/chromatic"; import { LegacyUpgradeNotice } from "./LegacyUpgradeNotice"; -const meta: Meta = { +const meta = { title: "Pages/Onboarding/LegacyUpgradeNotice", component: LegacyUpgradeNotice, parameters: { ...chromaticParams(["mobile", "desktop"]), }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: {}, diff --git a/apps/nextjs/src/components/Onboarding/TermsContent.stories.tsx b/apps/nextjs/src/components/Onboarding/TermsContent.stories.tsx index 4065320f4..d3a282067 100644 --- a/apps/nextjs/src/components/Onboarding/TermsContent.stories.tsx +++ b/apps/nextjs/src/components/Onboarding/TermsContent.stories.tsx @@ -2,13 +2,13 @@ import type { Meta, StoryObj } from "@storybook/react"; import TermsContent from "./TermsContent"; -const meta: Meta = { +const meta = { title: "Components/Onboarding/TermsContent", component: TermsContent, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: {}, diff --git a/apps/nextjs/src/components/SignUpSignInLayout.stories.tsx b/apps/nextjs/src/components/SignUpSignInLayout.stories.tsx index 63cda9985..567147602 100644 --- a/apps/nextjs/src/components/SignUpSignInLayout.stories.tsx +++ b/apps/nextjs/src/components/SignUpSignInLayout.stories.tsx @@ -2,14 +2,17 @@ import type { Meta, StoryObj } from "@storybook/react"; import SignUpSignInLayout from "./SignUpSignInLayout"; -const meta: Meta = { +const meta = { title: "Components/Layout/SignUpSignInLayout", component: SignUpSignInLayout, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { - args: {}, + args: { + children: null, + loaded: true, + }, };