@rssa-project/study-template 1.0.0

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 (52) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +49 -0
  3. package/dist/App.d.ts +2 -0
  4. package/dist/components/CodeInput.d.ts +7 -0
  5. package/dist/components/ContinueFormModal.d.ts +9 -0
  6. package/dist/components/ErrorBoundary.d.ts +15 -0
  7. package/dist/components/LoadingText.d.ts +6 -0
  8. package/dist/components/PaginatedDataViewer.d.ts +9 -0
  9. package/dist/components/Select.d.ts +7 -0
  10. package/dist/components/TestFeedbackModal.d.ts +10 -0
  11. package/dist/components/TestModeConfirmation.d.ts +7 -0
  12. package/dist/components/TestModeIndicator.d.ts +6 -0
  13. package/dist/components/TestModeToast.d.ts +10 -0
  14. package/dist/components/loadingscreen/LoadingScreen.d.ts +7 -0
  15. package/dist/components/moviegallery/MovieCard.d.ts +7 -0
  16. package/dist/components/moviegallery/StarRating.d.ts +6 -0
  17. package/dist/components/warningDialog.d.ts +12 -0
  18. package/dist/constants.d.ts +11 -0
  19. package/dist/contexts/NextButtonContext.d.ts +12 -0
  20. package/dist/contexts/NextButtonControlProvider.d.ts +3 -0
  21. package/dist/contexts/StudyUrlParamsContext.d.ts +12 -0
  22. package/dist/contexts/pageCompletionContext.d.ts +4 -0
  23. package/dist/contexts/stepCompletionContext.d.ts +4 -0
  24. package/dist/hooks/useDebounce.d.ts +1 -0
  25. package/dist/hooks/useNextButtonControl.d.ts +1 -0
  26. package/dist/hooks/usePageCompletion.d.ts +7 -0
  27. package/dist/hooks/useStepCompletion.d.ts +7 -0
  28. package/dist/index.d.ts +26 -0
  29. package/dist/layouts/StudyFooter.d.ts +2 -0
  30. package/dist/layouts/StudyHeader.d.ts +5 -0
  31. package/dist/layouts/StudyLayout.d.ts +6 -0
  32. package/dist/layouts/WelcomeFooter.d.ts +8 -0
  33. package/dist/layouts/templates/ContentBlock.d.ts +7 -0
  34. package/dist/layouts/templates/ItemBlock.d.ts +11 -0
  35. package/dist/layouts/templates/SurveyTemplate.d.ts +6 -0
  36. package/dist/main.d.ts +0 -0
  37. package/dist/pages/ConsentPage.d.ts +21 -0
  38. package/dist/pages/DemographicsPage.d.ts +2 -0
  39. package/dist/pages/FeedbackPage.d.ts +16 -0
  40. package/dist/pages/FinalPage.d.ts +3 -0
  41. package/dist/pages/MovieRatingPage.d.ts +7 -0
  42. package/dist/pages/StudyExitPage.d.ts +3 -0
  43. package/dist/pages/SurveyPage.d.ts +2 -0
  44. package/dist/pages/WelcomePage.d.ts +18 -0
  45. package/dist/res/country_state.json.d.ts +970 -0
  46. package/dist/routes/RouteWrapper.d.ts +13 -0
  47. package/dist/rssa-study-template.es.js +8989 -0
  48. package/dist/types/rssa.types.d.ts +142 -0
  49. package/dist/types/study.types.d.ts +5 -0
  50. package/dist/utils/constants.d.ts +11 -0
  51. package/dist/vite.svg +1 -0
  52. package/package.json +83 -0
@@ -0,0 +1,142 @@
1
+ export interface RatedItem {
2
+ id?: string;
3
+ item_id: string;
4
+ rating: number;
5
+ version?: number;
6
+ }
7
+ export interface MovieEmotions {
8
+ id: string;
9
+ movie_id: string;
10
+ movielens_id: string;
11
+ anger: number;
12
+ anticipation: number;
13
+ disgust: number;
14
+ fear: number;
15
+ joy: number;
16
+ surprise: number;
17
+ sadness: number;
18
+ trust: number;
19
+ }
20
+ export interface MovieRecommendationText {
21
+ movie_id: string;
22
+ formal: string;
23
+ informal: string;
24
+ source: string | null;
25
+ model: string | null;
26
+ created_at: string;
27
+ updated_at: string;
28
+ }
29
+ export interface Movie {
30
+ id: string;
31
+ imdb_id: string | null;
32
+ tmdb_id: string | null;
33
+ movielens_id: string;
34
+ title: string;
35
+ year: number;
36
+ ave_rating: number;
37
+ imdb_avg_rating: number | null;
38
+ imdb_rate_count: number | null;
39
+ tmdb_avg_rating: number | null;
40
+ tmdb_rate_count: number | null;
41
+ genre: string;
42
+ director: string | null;
43
+ cast: string;
44
+ description: string;
45
+ poster: string;
46
+ tmdb_poster: string;
47
+ poster_identifier: string;
48
+ }
49
+ export interface EmotionMovies extends Movie, MovieEmotions {
50
+ }
51
+ export interface MovieRecommdantions extends Movie, MovieRecommendationText {
52
+ }
53
+ export interface MovieDetails extends Movie {
54
+ emotions: MovieEmotions | null;
55
+ recommendations_text: MovieRecommendationText | null;
56
+ }
57
+ export interface Page {
58
+ id: string;
59
+ step_id: string;
60
+ study_id: string;
61
+ order_position: number;
62
+ next: string | null;
63
+ page_type?: string;
64
+ title?: string;
65
+ instructions?: string;
66
+ last_page: boolean;
67
+ }
68
+ export interface NavigationWrapper<T> {
69
+ data: T;
70
+ next_id: string | null;
71
+ next_path: string | null;
72
+ }
73
+ export interface StudyStep {
74
+ id: string;
75
+ study_id: string;
76
+ name: string;
77
+ description: string;
78
+ order_position: number;
79
+ next: string | null;
80
+ step_type: string;
81
+ path: string;
82
+ title: string;
83
+ instructions: string;
84
+ pages?: Page[];
85
+ survey_api_root?: string;
86
+ root_page_info?: NavigationWrapper<SurveyPageType>;
87
+ }
88
+ export interface SurveyConstructItem {
89
+ id: string;
90
+ survey_construct_id: string;
91
+ display_name: string;
92
+ order_position: number;
93
+ }
94
+ export interface ScaleLevel {
95
+ id: string;
96
+ survey_scale_id: string;
97
+ display_name: string;
98
+ value: number;
99
+ order_position: number;
100
+ }
101
+ export interface PageContent {
102
+ id: string;
103
+ study_step_page_id: string;
104
+ preamble: string;
105
+ survey_construct_id: string;
106
+ items: SurveyConstructItem[];
107
+ scale_levels: ScaleLevel[];
108
+ display_name: string;
109
+ }
110
+ export interface SurveyPageType {
111
+ id: string;
112
+ description: string;
113
+ order_position: number;
114
+ study_step_page_contents: PageContent[];
115
+ next: string;
116
+ }
117
+ export interface StudyResponseMetaFields {
118
+ step_id: string;
119
+ page_id?: string;
120
+ construct_id?: string;
121
+ construct_name?: string;
122
+ }
123
+ export interface SurveyItemResponse {
124
+ id: string;
125
+ survey_item_id: string;
126
+ survey_scale_level_id: string;
127
+ version?: number;
128
+ }
129
+ export interface ParticipantRatingPayload {
130
+ study_step_id: string;
131
+ study_step_page_id: string | null;
132
+ context_tag: string;
133
+ rated_item: RatedItem;
134
+ }
135
+ export interface ParticipantRatingResponse {
136
+ id: string;
137
+ study_step_id: string;
138
+ study_step_page_id: string | null;
139
+ context_tag: string;
140
+ rated_item: RatedItem;
141
+ version: number;
142
+ }
@@ -0,0 +1,5 @@
1
+ import { StudyStep } from './rssa.types';
2
+ export type StudyLayoutContextType = {
3
+ studyStep: StudyStep;
4
+ resetNextButton: () => void;
5
+ };
@@ -0,0 +1,11 @@
1
+ export declare const STRINGS: {
2
+ WINDOW_TOO_SMALL: string;
3
+ STUDY_ERROR: string;
4
+ };
5
+ export declare const customBreakpoints: {
6
+ xl: number;
7
+ xxl: number;
8
+ xxxl: number;
9
+ xl4: number;
10
+ };
11
+ export declare const RETRY_DELAYS_MS: number[];
package/dist/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/package.json ADDED
@@ -0,0 +1,83 @@
1
+ {
2
+ "name": "@rssa-project/study-template",
3
+ "version": "1.0.0",
4
+ "license": "MIT",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/RSSA-Project/rssa-study-template.git"
12
+ },
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "main": "./dist/rssa-study-template.es.js",
17
+ "module": "./dist/rssa-study-template.es.js",
18
+ "types": "./dist/index.d.ts",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.ts",
22
+ "import": "./dist/rssa-study-template.es.js"
23
+ }
24
+ },
25
+ "scripts": {
26
+ "dev": "vite",
27
+ "build": "tsc -b && vite build",
28
+ "test": "vitest run",
29
+ "lint": "eslint .",
30
+ "preview": "vite preview",
31
+ "prepare": "npm run build"
32
+ },
33
+ "dependencies": {
34
+ "@headlessui/react": "^2.2.9",
35
+ "@heroicons/react": "^2.2.0",
36
+ "@tailwindcss/vite": "^4.1.17",
37
+ "@tanstack/query-async-storage-persister": "^5.90.9",
38
+ "@tanstack/react-query-persist-client": "^5.90.9",
39
+ "clsx": "^2.1.1",
40
+ "dompurify": "^3.3.0",
41
+ "html-react-parser": "^5.2.8"
42
+ },
43
+ "peerDependencies": {
44
+ "@rssa-project/api": "^1.0.1",
45
+ "@tanstack/react-query": "^5.90.7",
46
+ "react": "^19.1.1",
47
+ "react-dom": "^19.1.1",
48
+ "react-router-dom": "^7.9.5"
49
+ },
50
+ "devDependencies": {
51
+ "@eslint/js": "^9.36.0",
52
+ "@tanstack/react-query": "^5.90.12",
53
+ "@tanstack/react-query-devtools": "^5.90.2",
54
+ "@testing-library/jest-dom": "^6.9.1",
55
+ "@testing-library/react": "^16.3.1",
56
+ "@types/node": "^24.10.0",
57
+ "@types/react": "^19.1.16",
58
+ "@types/react-dom": "^19.1.9",
59
+ "@vitejs/plugin-react-swc": "^3.10.2",
60
+ "autoprefixer": "^10.4.21",
61
+ "eslint": "^9.36.0",
62
+ "eslint-plugin-react-hooks": "^5.2.0",
63
+ "eslint-plugin-react-refresh": "^0.4.22",
64
+ "globals": "^16.4.0",
65
+ "jsdom": "^27.4.0",
66
+ "lint-staged": "^16.2.7",
67
+ "postcss": "^8.5.6",
68
+ "prettier": "^3.6.2",
69
+ "react": "^19.2.1",
70
+ "react-dom": "^19.2.1",
71
+ "react-router-dom": "^7.10.1",
72
+ "tailwindcss": "^4.1.17",
73
+ "typescript": "~5.9.3",
74
+ "typescript-eslint": "^8.45.0",
75
+ "vite": "^7.0.4",
76
+ "vite-plugin-css-injected-by-js": "^3.5.2",
77
+ "vite-plugin-dts": "^4.5.4",
78
+ "vitest": "^4.0.16"
79
+ },
80
+ "lint-staged": {
81
+ "**/*.{js,jsx,ts,tsx,json,css,scss,md}": "prettier --write"
82
+ }
83
+ }