@fictjs/runtime 0.2.2 → 0.3.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 (58) hide show
  1. package/dist/advanced.cjs +10 -8
  2. package/dist/advanced.cjs.map +1 -1
  3. package/dist/advanced.d.cts +10 -16
  4. package/dist/advanced.d.ts +10 -16
  5. package/dist/advanced.js +5 -3
  6. package/dist/advanced.js.map +1 -1
  7. package/dist/{chunk-3U7EBKEU.cjs → chunk-ID3WBWNO.cjs} +559 -319
  8. package/dist/chunk-ID3WBWNO.cjs.map +1 -0
  9. package/dist/{chunk-3A4VW6AK.cjs → chunk-L4DIV3RC.cjs} +7 -7
  10. package/dist/{chunk-3A4VW6AK.cjs.map → chunk-L4DIV3RC.cjs.map} +1 -1
  11. package/dist/{chunk-URDFDRHR.cjs → chunk-M2TSXZ4C.cjs} +16 -16
  12. package/dist/{chunk-URDFDRHR.cjs.map → chunk-M2TSXZ4C.cjs.map} +1 -1
  13. package/dist/{chunk-YVS4WJ2W.js → chunk-SO6X7G5S.js} +558 -318
  14. package/dist/chunk-SO6X7G5S.js.map +1 -0
  15. package/dist/{chunk-LU2LD2WJ.js → chunk-TWELIZRY.js} +2 -2
  16. package/dist/{chunk-TEYUDPTA.js → chunk-XLIZJMMJ.js} +2 -2
  17. package/dist/{context-9gFXOdJl.d.cts → context-B25xyQrJ.d.cts} +36 -2
  18. package/dist/{context-4woHo7-L.d.ts → context-CGdP7_Jb.d.ts} +36 -2
  19. package/dist/{effect-ClARNUCc.d.cts → effect-D6kaLM2-.d.cts} +80 -1
  20. package/dist/{effect-ClARNUCc.d.ts → effect-D6kaLM2-.d.ts} +80 -1
  21. package/dist/index.cjs +40 -38
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +4 -4
  24. package/dist/index.d.ts +4 -4
  25. package/dist/index.dev.js +430 -246
  26. package/dist/index.dev.js.map +1 -1
  27. package/dist/index.js +4 -2
  28. package/dist/index.js.map +1 -1
  29. package/dist/internal.cjs +39 -35
  30. package/dist/internal.cjs.map +1 -1
  31. package/dist/internal.d.cts +8 -6
  32. package/dist/internal.d.ts +8 -6
  33. package/dist/internal.js +7 -3
  34. package/dist/internal.js.map +1 -1
  35. package/dist/{props-DAyeRPwH.d.ts → props-BEgIVMRx.d.ts} +8 -15
  36. package/dist/{props-CBwuh35e.d.cts → props-BIfromL0.d.cts} +8 -15
  37. package/dist/scope-Cx_3CjIZ.d.cts +18 -0
  38. package/dist/scope-CzNkn587.d.ts +18 -0
  39. package/package.json +1 -1
  40. package/src/advanced.ts +1 -0
  41. package/src/binding.ts +30 -4
  42. package/src/constants.ts +5 -0
  43. package/src/cycle-guard.ts +164 -103
  44. package/src/devtools.ts +22 -2
  45. package/src/dom.ts +84 -10
  46. package/src/hooks.ts +60 -13
  47. package/src/index.ts +3 -1
  48. package/src/internal.ts +2 -2
  49. package/src/lifecycle.ts +13 -5
  50. package/src/memo.ts +3 -4
  51. package/src/props.ts +16 -0
  52. package/src/signal.ts +204 -36
  53. package/dist/chunk-3U7EBKEU.cjs.map +0 -1
  54. package/dist/chunk-YVS4WJ2W.js.map +0 -1
  55. package/dist/scope-DvgMquEy.d.ts +0 -55
  56. package/dist/scope-xmdo6lVU.d.cts +0 -55
  57. /package/dist/{chunk-LU2LD2WJ.js.map → chunk-TWELIZRY.js.map} +0 -0
  58. /package/dist/{chunk-TEYUDPTA.js.map → chunk-XLIZJMMJ.js.map} +0 -0
@@ -1,55 +0,0 @@
1
- import { O as MaybeReactive } from './effect-ClARNUCc.js';
2
-
3
- /**
4
- * Signal accessor - function to get/set signal value
5
- */
6
- interface SignalAccessor<T> {
7
- (): T;
8
- (value: T): void;
9
- }
10
- /**
11
- * Computed accessor - function to get computed value
12
- */
13
- type ComputedAccessor<T> = () => T;
14
- /**
15
- * Effect scope disposer - function to dispose an effect scope
16
- */
17
- type EffectScopeDisposer = () => void;
18
- /**
19
- * Create a reactive signal
20
- * @param initialValue - The initial value
21
- * @returns A signal accessor function
22
- */
23
- declare function signal<T>(initialValue: T): SignalAccessor<T>;
24
- /**
25
- * Create a reactive effect scope
26
- * @param fn - The scope function
27
- * @returns An effect scope disposer function
28
- */
29
- declare function effectScope(fn: () => void): EffectScopeDisposer;
30
- /**
31
- * Create a selector signal that efficiently updates only when the selected key matches.
32
- * Useful for large lists where only one item is selected.
33
- *
34
- * @param source - The source signal returning the current key
35
- * @param equalityFn - Optional equality function
36
- * @returns A selector function that takes a key and returns a boolean signal accessor
37
- */
38
- declare function createSelector<T>(source: () => T, equalityFn?: (a: T, b: T) => boolean): (key: T) => boolean;
39
-
40
- interface ReactiveScope {
41
- run<T>(fn: () => T): T;
42
- stop(): void;
43
- }
44
- /**
45
- * Create an explicit reactive scope that can contain effects/memos and be stopped manually.
46
- * The scope registers with the current root for cleanup.
47
- */
48
- declare function createScope(): ReactiveScope;
49
- /**
50
- * Run a block of reactive code inside a managed scope that follows a boolean flag.
51
- * When the flag turns false, the scope is disposed and all contained effects/memos are cleaned up.
52
- */
53
- declare function runInScope(flag: MaybeReactive<boolean>, fn: () => void): void;
54
-
55
- export { type ComputedAccessor as C, type ReactiveScope as R, type SignalAccessor as S, createSelector as a, createScope as c, effectScope as e, runInScope as r, signal as s };
@@ -1,55 +0,0 @@
1
- import { O as MaybeReactive } from './effect-ClARNUCc.cjs';
2
-
3
- /**
4
- * Signal accessor - function to get/set signal value
5
- */
6
- interface SignalAccessor<T> {
7
- (): T;
8
- (value: T): void;
9
- }
10
- /**
11
- * Computed accessor - function to get computed value
12
- */
13
- type ComputedAccessor<T> = () => T;
14
- /**
15
- * Effect scope disposer - function to dispose an effect scope
16
- */
17
- type EffectScopeDisposer = () => void;
18
- /**
19
- * Create a reactive signal
20
- * @param initialValue - The initial value
21
- * @returns A signal accessor function
22
- */
23
- declare function signal<T>(initialValue: T): SignalAccessor<T>;
24
- /**
25
- * Create a reactive effect scope
26
- * @param fn - The scope function
27
- * @returns An effect scope disposer function
28
- */
29
- declare function effectScope(fn: () => void): EffectScopeDisposer;
30
- /**
31
- * Create a selector signal that efficiently updates only when the selected key matches.
32
- * Useful for large lists where only one item is selected.
33
- *
34
- * @param source - The source signal returning the current key
35
- * @param equalityFn - Optional equality function
36
- * @returns A selector function that takes a key and returns a boolean signal accessor
37
- */
38
- declare function createSelector<T>(source: () => T, equalityFn?: (a: T, b: T) => boolean): (key: T) => boolean;
39
-
40
- interface ReactiveScope {
41
- run<T>(fn: () => T): T;
42
- stop(): void;
43
- }
44
- /**
45
- * Create an explicit reactive scope that can contain effects/memos and be stopped manually.
46
- * The scope registers with the current root for cleanup.
47
- */
48
- declare function createScope(): ReactiveScope;
49
- /**
50
- * Run a block of reactive code inside a managed scope that follows a boolean flag.
51
- * When the flag turns false, the scope is disposed and all contained effects/memos are cleaned up.
52
- */
53
- declare function runInScope(flag: MaybeReactive<boolean>, fn: () => void): void;
54
-
55
- export { type ComputedAccessor as C, type ReactiveScope as R, type SignalAccessor as S, createSelector as a, createScope as c, effectScope as e, runInScope as r, signal as s };