@adriansteffan/reactive 0.1.14 → 0.1.15

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.
@@ -1,4 +1,4 @@
1
- import { W as e } from "./mod-BbekIh7x.js";
1
+ import { W as e } from "./mod-jEMvaWXA.js";
2
2
  class s extends e {
3
3
  async enable() {
4
4
  console.log("Immersive mode is only available on Android");
@@ -1,4 +1,4 @@
1
- import { W as P, b as x, E } from "./mod-BbekIh7x.js";
1
+ import { W as P, b as x, E } from "./mod-jEMvaWXA.js";
2
2
  function m(w) {
3
3
  const e = w.split("/").filter((t) => t !== "."), r = [];
4
4
  return e.forEach((t) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adriansteffan/reactive",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -10,9 +10,18 @@ import { Param } from '../utils/common';
10
10
  const HybridSimulationContext = createContext(false);
11
11
  export const useHybridSimulationDisabled = () => useContext(HybridSimulationContext);
12
12
 
13
+ function parseBooleanProp(value: unknown): boolean {
14
+ if (typeof value === 'boolean') return value;
15
+ if (typeof value === 'string') {
16
+ const lower = value.trim().toLowerCase();
17
+ return lower !== '' && lower !== 'false' && lower !== '0';
18
+ }
19
+ return !!value;
20
+ }
21
+
13
22
  export default function ExperimentProvider({ children, disableSettings, disableHybridSimulation }: { children: ReactNode, disableSettings?: boolean, disableHybridSimulation?: boolean }) {
14
-
15
- if (window.location.pathname.endsWith('/settings') && !disableSettings) {
23
+
24
+ if (window.location.pathname.endsWith('/settings') && !parseBooleanProp(disableSettings)) {
16
25
  return (
17
26
  <SettingsScreen
18
27
  paramRegistry={Param.getRegistry()}
@@ -23,7 +32,7 @@ export default function ExperimentProvider({ children, disableSettings, disableH
23
32
 
24
33
  return (
25
34
  <QueryClientProvider client={queryClient}>
26
- <HybridSimulationContext.Provider value={!!disableHybridSimulation}>
35
+ <HybridSimulationContext.Provider value={parseBooleanProp(disableHybridSimulation)}>
27
36
  {children}
28
37
  </HybridSimulationContext.Provider>
29
38
  <ToastContainer