@capytale/meta-player 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/.eslintrc.json +35 -0
  2. package/.prettierrc.json +4 -0
  3. package/README.md +27 -0
  4. package/index.html +15 -0
  5. package/package.json +48 -0
  6. package/public/themes/lara-dark-blue/fonts/Inter-italic.var.woff2 +0 -0
  7. package/public/themes/lara-dark-blue/fonts/Inter-roman.var.woff2 +0 -0
  8. package/public/themes/lara-dark-blue/theme.css +7015 -0
  9. package/public/themes/lara-light-blue/fonts/Inter-italic.var.woff2 +0 -0
  10. package/public/themes/lara-light-blue/fonts/Inter-roman.var.woff2 +0 -0
  11. package/public/themes/lara-light-blue/theme.css +7005 -0
  12. package/src/App.tsx +116 -0
  13. package/src/AppRedux.css +39 -0
  14. package/src/MetaPlayer.tsx +51 -0
  15. package/src/app/createAppSlice.ts +6 -0
  16. package/src/app/hooks.ts +12 -0
  17. package/src/app/store.ts +46 -0
  18. package/src/app.module.scss +56 -0
  19. package/src/demo.tsx +81 -0
  20. package/src/features/activityData/IsDirtySetter.tsx +17 -0
  21. package/src/features/activityData/OptionSetter.tsx +35 -0
  22. package/src/features/activityData/activityDataSlice.ts +250 -0
  23. package/src/features/activityData/metaPlayerOptions.ts +17 -0
  24. package/src/features/activityJS/ActivityJSProvider.tsx +110 -0
  25. package/src/features/activityJS/AfterSaveAction.tsx +23 -0
  26. package/src/features/activityJS/BeforeSaveAction.tsx +23 -0
  27. package/src/features/activityJS/Saver.tsx +147 -0
  28. package/src/features/activityJS/hooks.ts +93 -0
  29. package/src/features/activityJS/saverSlice.ts +58 -0
  30. package/src/features/layout/layoutSlice.ts +76 -0
  31. package/src/features/navbar/ActivityInfo.tsx +41 -0
  32. package/src/features/navbar/ActivityMenu.tsx +56 -0
  33. package/src/features/navbar/ActivityQuickActions.tsx +52 -0
  34. package/src/features/navbar/ActivitySidebarActions.tsx +52 -0
  35. package/src/features/navbar/CapytaleMenu.tsx +183 -0
  36. package/src/features/navbar/GradingNav.tsx +120 -0
  37. package/src/features/navbar/ReviewNavbar.tsx +18 -0
  38. package/src/features/navbar/SidebarContent.tsx +125 -0
  39. package/src/features/navbar/index.tsx +33 -0
  40. package/src/features/navbar/navbarSlice.ts +51 -0
  41. package/src/features/navbar/student-utils.ts +11 -0
  42. package/src/features/navbar/style.module.scss +162 -0
  43. package/src/features/pedago/AnswerSheetEditor.tsx +65 -0
  44. package/src/features/pedago/InstructionsEditor.tsx +82 -0
  45. package/src/features/pedago/index.tsx +219 -0
  46. package/src/features/pedago/style.module.scss +104 -0
  47. package/src/features/theming/ThemeSwitcher.tsx +51 -0
  48. package/src/features/theming/themingSlice.ts +93 -0
  49. package/src/hooks/index.ts +8 -0
  50. package/src/index.css +30 -0
  51. package/src/index.tsx +6 -0
  52. package/src/logo.svg +1 -0
  53. package/src/my_json_data.js +4146 -0
  54. package/src/settings.ts +6 -0
  55. package/src/setupTests.ts +1 -0
  56. package/src/utils/ErrorBoundary.tsx +41 -0
  57. package/src/utils/PopupButton.tsx +135 -0
  58. package/src/utils/activity.ts +8 -0
  59. package/src/utils/breakpoints.ts +5 -0
  60. package/src/utils/clipboard.ts +11 -0
  61. package/src/utils/test-utils.tsx +65 -0
  62. package/src/utils/useFullscreen.ts +65 -0
  63. package/src/vite-env.d.ts +1 -0
  64. package/tsconfig.json +27 -0
  65. package/tsconfig.node.json +9 -0
  66. package/vite.config.ts +17 -0
package/.eslintrc.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "extends": [
3
+ "eslint:recommended",
4
+ "react-app",
5
+ "plugin:react/jsx-runtime",
6
+ "prettier"
7
+ ],
8
+ "parser": "@typescript-eslint/parser",
9
+ "parserOptions": { "project": true, "tsconfigRootDir": "./" },
10
+ "plugins": ["@typescript-eslint"],
11
+ "root": true,
12
+ "ignorePatterns": ["dist"],
13
+ "rules": {
14
+ "@typescript-eslint/consistent-type-imports": [
15
+ 2,
16
+ { "fixStyle": "separate-type-imports" }
17
+ ],
18
+ "@typescript-eslint/no-restricted-imports": [
19
+ 2,
20
+ {
21
+ "paths": [
22
+ {
23
+ "name": "react-redux",
24
+ "importNames": ["useSelector", "useStore", "useDispatch"],
25
+ "message": "Please use pre-typed versions from `src/app/hooks.ts` instead."
26
+ }
27
+ ]
28
+ }
29
+ ]
30
+ },
31
+ "overrides": [
32
+ { "files": ["*.{c,m,}{t,j}s", "*.{t,j}sx"] },
33
+ { "files": ["*{test,spec}.{t,j}s?(x)"], "env": { "jest": true } }
34
+ ]
35
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "semi": true,
3
+ "arrowParens": "always"
4
+ }
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # vite-template-redux
2
+
3
+ Uses [Vite](https://vitejs.dev/), [Vitest](https://vitest.dev/), and [React Testing Library](https://github.com/testing-library/react-testing-library) to create a modern [React](https://react.dev/) app compatible with [Create React App](https://create-react-app.dev/)
4
+
5
+ ```sh
6
+ npx degit reduxjs/redux-templates/packages/vite-template-redux my-app
7
+ ```
8
+
9
+ ## Goals
10
+
11
+ - Easy migration from Create React App or Vite
12
+ - As beginner friendly as Create React App
13
+ - Optimized performance compared to Create React App
14
+ - Customizable without ejecting
15
+
16
+ ## Scripts
17
+
18
+ - `dev`/`start` - start dev server and open browser
19
+ - `build` - build for production
20
+ - `preview` - locally preview production build
21
+ - `test` - launch test runner
22
+
23
+ ## Inspiration
24
+
25
+ - [Create React App](https://github.com/facebook/create-react-app/tree/main/packages/cra-template)
26
+ - [Vite](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react)
27
+ - [Vitest](https://github.com/vitest-dev/vitest/tree/main/examples/react-testing-lib)
package/index.html ADDED
@@ -0,0 +1,15 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <link id="theme-link" rel="stylesheet" href="https://cdn.ac-paris.fr/capytale/meta-player/themes/lara-light-blue/theme.css">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8
+ <title>Capytale</title>
9
+ </head>
10
+ <body>
11
+ <noscript>You need to enable JavaScript to run this app.</noscript>
12
+ <div id="root"></div>
13
+ <script type="module" src="/src/demo.tsx"></script>
14
+ </body>
15
+ </html>
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@capytale/meta-player",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "start": "vite",
8
+ "build": "tsc && vite build",
9
+ "preview": "vite preview",
10
+ "test": "vitest run",
11
+ "format": "prettier --write .",
12
+ "lint": "eslint .",
13
+ "lint:fix": "eslint --fix .",
14
+ "type-check": "tsc --noEmit"
15
+ },
16
+ "dependencies": {
17
+ "@capytale/activity.js": "^3.0.8",
18
+ "@capytale/capytale-rich-text-editor": "^0.4.2",
19
+ "@reduxjs/toolkit": "^2.0.1",
20
+ "@uidotdev/usehooks": "^2.4.1",
21
+ "primeicons": "^7.0.0",
22
+ "primereact": "^10.6.3",
23
+ "react": "^18.2.0",
24
+ "react-dom": "^18.2.0",
25
+ "react-html-props": "^2.0.9",
26
+ "react-redux": "^9.1.0",
27
+ "screenfull": "^6.0.2"
28
+ },
29
+ "devDependencies": {
30
+ "@testing-library/dom": "^9.3.4",
31
+ "@testing-library/jest-dom": "^6.2.0",
32
+ "@testing-library/react": "^14.1.2",
33
+ "@testing-library/user-event": "^14.5.2",
34
+ "@types/react": "^18.2.47",
35
+ "@types/react-dom": "^18.2.18",
36
+ "@vitejs/plugin-react": "^4.2.1",
37
+ "eslint": "^8.56.0",
38
+ "eslint-config-prettier": "^9.1.0",
39
+ "eslint-config-react-app": "^7.0.1",
40
+ "eslint-plugin-prettier": "^5.1.3",
41
+ "jsdom": "^23.2.0",
42
+ "prettier": "^3.2.1",
43
+ "sass": "^1.75.0",
44
+ "typescript": "^5.3.3",
45
+ "vite": "^5.0.11",
46
+ "vitest": "^1.2.0"
47
+ }
48
+ }