@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.
- package/.eslintrc.json +35 -0
- package/.prettierrc.json +4 -0
- package/README.md +27 -0
- package/index.html +15 -0
- package/package.json +48 -0
- package/public/themes/lara-dark-blue/fonts/Inter-italic.var.woff2 +0 -0
- package/public/themes/lara-dark-blue/fonts/Inter-roman.var.woff2 +0 -0
- package/public/themes/lara-dark-blue/theme.css +7015 -0
- package/public/themes/lara-light-blue/fonts/Inter-italic.var.woff2 +0 -0
- package/public/themes/lara-light-blue/fonts/Inter-roman.var.woff2 +0 -0
- package/public/themes/lara-light-blue/theme.css +7005 -0
- package/src/App.tsx +116 -0
- package/src/AppRedux.css +39 -0
- package/src/MetaPlayer.tsx +51 -0
- package/src/app/createAppSlice.ts +6 -0
- package/src/app/hooks.ts +12 -0
- package/src/app/store.ts +46 -0
- package/src/app.module.scss +56 -0
- package/src/demo.tsx +81 -0
- package/src/features/activityData/IsDirtySetter.tsx +17 -0
- package/src/features/activityData/OptionSetter.tsx +35 -0
- package/src/features/activityData/activityDataSlice.ts +250 -0
- package/src/features/activityData/metaPlayerOptions.ts +17 -0
- package/src/features/activityJS/ActivityJSProvider.tsx +110 -0
- package/src/features/activityJS/AfterSaveAction.tsx +23 -0
- package/src/features/activityJS/BeforeSaveAction.tsx +23 -0
- package/src/features/activityJS/Saver.tsx +147 -0
- package/src/features/activityJS/hooks.ts +93 -0
- package/src/features/activityJS/saverSlice.ts +58 -0
- package/src/features/layout/layoutSlice.ts +76 -0
- package/src/features/navbar/ActivityInfo.tsx +41 -0
- package/src/features/navbar/ActivityMenu.tsx +56 -0
- package/src/features/navbar/ActivityQuickActions.tsx +52 -0
- package/src/features/navbar/ActivitySidebarActions.tsx +52 -0
- package/src/features/navbar/CapytaleMenu.tsx +183 -0
- package/src/features/navbar/GradingNav.tsx +120 -0
- package/src/features/navbar/ReviewNavbar.tsx +18 -0
- package/src/features/navbar/SidebarContent.tsx +125 -0
- package/src/features/navbar/index.tsx +33 -0
- package/src/features/navbar/navbarSlice.ts +51 -0
- package/src/features/navbar/student-utils.ts +11 -0
- package/src/features/navbar/style.module.scss +162 -0
- package/src/features/pedago/AnswerSheetEditor.tsx +65 -0
- package/src/features/pedago/InstructionsEditor.tsx +82 -0
- package/src/features/pedago/index.tsx +219 -0
- package/src/features/pedago/style.module.scss +104 -0
- package/src/features/theming/ThemeSwitcher.tsx +51 -0
- package/src/features/theming/themingSlice.ts +93 -0
- package/src/hooks/index.ts +8 -0
- package/src/index.css +30 -0
- package/src/index.tsx +6 -0
- package/src/logo.svg +1 -0
- package/src/my_json_data.js +4146 -0
- package/src/settings.ts +6 -0
- package/src/setupTests.ts +1 -0
- package/src/utils/ErrorBoundary.tsx +41 -0
- package/src/utils/PopupButton.tsx +135 -0
- package/src/utils/activity.ts +8 -0
- package/src/utils/breakpoints.ts +5 -0
- package/src/utils/clipboard.ts +11 -0
- package/src/utils/test-utils.tsx +65 -0
- package/src/utils/useFullscreen.ts +65 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.json +27 -0
- package/tsconfig.node.json +9 -0
- 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
|
+
}
|
package/.prettierrc.json
ADDED
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
|
+
}
|
|
Binary file
|
|
Binary file
|