@adriansteffan/reactive 0.2.0 → 0.2.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.
@@ -1,4 +1,4 @@
1
- import { W as P, b as x, E } from "./mod-C-XUCKhQ.js";
1
+ import { W as P, b as x, E } from "./mod-CWKvMS7s.js";
2
2
  function m(w) {
3
3
  const e = w.split("/").filter((t) => t !== "."), r = [];
4
4
  return e.forEach((t) => {
@@ -1,4 +1,4 @@
1
- import { W as e } from "./mod-C-XUCKhQ.js";
1
+ import { W as e } from "./mod-CWKvMS7s.js";
2
2
  class s extends e {
3
3
  async enable() {
4
4
  console.log("Immersive mode is only available on Android");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adriansteffan/reactive",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
 
3
3
  import '../index.css';
4
- import { ExperimentConfig, Store, Param, now, getParam } from '../utils/common';
4
+ import { ExperimentConfig, Store, Param, now, getParam, registerExperimentParams } from '../utils/common';
5
5
  import { useCallback, useEffect, useMemo, useRef, useState, ComponentType } from 'react';
6
6
  import {
7
7
  compileTimeline,
@@ -110,6 +110,7 @@ export default function ExperimentRunner({
110
110
  /** Simulation config — not used at runtime, extracted by simulate.ts via createElement. */
111
111
  simulationConfig?: any;
112
112
  }) {
113
+ registerExperimentParams(timeline);
113
114
  const disableHybridSimulation = useHybridSimulationDisabled();
114
115
  const trialByteCode = useMemo(() => {
115
116
  return compileTimeline(timeline);
@@ -197,7 +197,9 @@ export function registerExperimentParams(experiment: any[]) {
197
197
  if (params) {
198
198
  for (const param of params) {
199
199
  if(!item.hideSettings || (item.hideSettings !== true && !item.hideSettings.includes(param.name))){
200
- sharedRegistry.push(param);
200
+ if (!sharedRegistry.some((p) => p.name === param.name)) {
201
+ sharedRegistry.push(param);
202
+ }
201
203
  }
202
204
  }
203
205
  }
@@ -212,8 +214,6 @@ export function registerComponentParams(
212
214
  }
213
215
 
214
216
  export function subsetExperimentByParam(experiment: any[]) {
215
- registerExperimentParams(experiment);
216
-
217
217
  timelineRepresentation.length = 0;
218
218
 
219
219
  experiment.forEach((item) => {