@adriansteffan/reactive 0.1.24 → 0.1.25
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/dist/{mod-fBXh2yt0.js → mod-pa8Hci6M.js} +119 -114
- package/dist/reactive.es.js +1 -1
- package/dist/reactive.umd.js +2 -2
- package/dist/style.css +1 -1
- package/dist/{web-B1R-GYWu.js → web-CWLGQMq-.js} +1 -1
- package/dist/{web-DEK1IMF9.js → web-DvZ82oLB.js} +1 -1
- package/package.json +1 -1
- package/src/components/experimentprovider.tsx +14 -1
- package/src/components/quest.tsx +1 -1
- package/src/index.css +5 -0
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { ToastContainer } from 'react-toastify';
|
|
|
3
3
|
|
|
4
4
|
const queryClient = new QueryClient();
|
|
5
5
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
6
|
-
import { createContext, ReactNode, useContext } from 'react';
|
|
6
|
+
import { createContext, ReactNode, useContext, useEffect } from 'react';
|
|
7
7
|
import { SettingsScreen } from './settingsscreen';
|
|
8
8
|
import { Param } from '../utils/common';
|
|
9
9
|
|
|
@@ -21,6 +21,19 @@ function parseBooleanProp(value: unknown): boolean {
|
|
|
21
21
|
|
|
22
22
|
export default function ExperimentProvider({ children, disableSettings, disableHybridSimulation }: { children: ReactNode, disableSettings?: boolean, disableHybridSimulation?: boolean }) {
|
|
23
23
|
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const preventSpaceScroll = (e: KeyboardEvent) => {
|
|
26
|
+
if (e.key === ' ' &&
|
|
27
|
+
!(e.target instanceof HTMLInputElement) &&
|
|
28
|
+
!(e.target instanceof HTMLTextAreaElement) &&
|
|
29
|
+
!(e.target as HTMLElement).isContentEditable) {
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
window.addEventListener('keydown', preventSpaceScroll);
|
|
34
|
+
return () => window.removeEventListener('keydown', preventSpaceScroll);
|
|
35
|
+
}, []);
|
|
36
|
+
|
|
24
37
|
if (window.location.pathname.endsWith('/settings') && !parseBooleanProp(disableSettings)) {
|
|
25
38
|
return (
|
|
26
39
|
<SettingsScreen
|
package/src/components/quest.tsx
CHANGED
|
@@ -132,7 +132,7 @@ function Quest({
|
|
|
132
132
|
|
|
133
133
|
const survey = new Model({
|
|
134
134
|
...surveyJson,
|
|
135
|
-
css: { ...defaultCss, root:
|
|
135
|
+
css: { ...defaultCss, root: `sd-root-modern custom-root${containerClass ? ' survey-custom-bg' : ''}` },
|
|
136
136
|
});
|
|
137
137
|
survey.applyTheme(theme ?? ContrastLight);
|
|
138
138
|
|
package/src/index.css
CHANGED
|
@@ -94,6 +94,11 @@
|
|
|
94
94
|
font-family: 'Atkinson Hyperlegible', sans-serif; /* Added this line */
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
.sd-root-modern.survey-custom-bg {
|
|
98
|
+
background-color: transparent !important;
|
|
99
|
+
background-image: none !important;
|
|
100
|
+
}
|
|
101
|
+
|
|
97
102
|
.sd-root-modern * {
|
|
98
103
|
font-family: 'Atkinson Hyperlegible', sans-serif;
|
|
99
104
|
}
|